@jegdev/sema-ui 0.0.7 → 0.0.9-beta.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.
@@ -1,5 +1,7 @@
1
- import { css as a, LitElement as c, html as r } from "lit";
2
- const b = a`
1
+ import { css as m, LitElement as b, html as l } from "lit";
2
+ import { property as n, customElement as u } from "lit/decorators.js";
3
+ import { unsafeHTML as T } from "lit/directives/unsafe-html.js";
4
+ const j = m`
3
5
  /* ---------------- GENERAL STYLES ------------------- */
4
6
 
5
7
  a {
@@ -94,56 +96,45 @@ const b = a`
94
96
  color: var(--btn-secondary-color);
95
97
  }
96
98
  `;
97
- class l extends c {
98
- static get is() {
99
- return "sema-button";
100
- }
101
- static styles = [b];
102
- static properties = {
103
- mode: { type: String },
104
- kind: { type: String },
105
- custom: { type: String },
106
- firstColor: { type: String },
107
- secondaryColor: { type: String },
108
- size: { type: String },
109
- fontSize: { type: String },
110
- url: { type: String },
111
- target: { type: String },
112
- altText: { type: String }
113
- };
99
+ var D = Object.defineProperty, B = Object.getOwnPropertyDescriptor, p = (s, e, r, o) => {
100
+ for (var t = o > 1 ? void 0 : o ? B(e, r) : e, a = s.length - 1, i; a >= 0; a--)
101
+ (i = s[a]) && (t = (o ? i(e, r, t) : i(t)) || t);
102
+ return o && t && D(e, r, t), t;
103
+ };
104
+ let c = class extends b {
114
105
  constructor() {
115
- super(), this.mode = "", this.kind = "", this.custom = "off", this.firstColor = "", this.secondaryColor = "", this.size = "", this.fontSize = "", this.url, this.altText, this.target;
106
+ super(...arguments), this.mode = "", this.kind = "button", this.custom = "off", this.size = "md", this.fontSize = "md", this.url = "", this.target = "_self", this.altText = "";
116
107
  }
117
108
  render() {
118
- const n = this.custom === "on", t = n ? `--btn-primary-color: ${this.firstColor}; --btn-secondary-color: ${this.secondaryColor};` : "";
119
- let e = "120px";
120
- this.size === "sm" ? e = "80px" : this.size === "md" ? e = "120px" : this.size === "lg" ? e = "160px" : this.size === "full" && (e = "100%");
121
- const o = `--btn-width: ${e};`;
122
- let i = "1rem";
123
- this.fontSize === "sm" ? i = "0.8rem" : this.fontSize === "md" ? i = "1rem" : this.fontSize === "lg" ? i = "1.5rem" : this.fontSize === "xl" && (i = "2rem");
124
- const s = `--btn-font-size: ${i}`;
125
- return this.mode === "outline" ? this.kind === "link" ? r`
109
+ const s = this.custom === "on", e = s ? `--btn-primary-color: ${this.firstColor}; --btn-secondary-color: ${this.secondaryColor};` : "";
110
+ let r = "120px";
111
+ this.size === "sm" ? r = "80px" : this.size === "md" ? r = "120px" : this.size === "lg" ? r = "160px" : this.size === "full" && (r = "100%");
112
+ const o = `--btn-width: ${r};`;
113
+ let t = "1rem";
114
+ this.fontSize === "sm" ? t = "0.8rem" : this.fontSize === "md" ? t = "1rem" : this.fontSize === "lg" ? t = "1.5rem" : this.fontSize === "xl" && (t = "2rem");
115
+ const a = `--btn-font-size: ${t}`;
116
+ return this.mode === "outline" ? this.kind === "link" ? l`
126
117
  <a
127
- style="${t}${o}${s}"
118
+ style="${e}${o}${a}"
128
119
  href="${this.url}"
129
120
  alt="${this.altText}"
130
121
  title="${this.altText}"
131
122
  target="${this.target}"
132
- class="btn ${n ? "btn-outline-custom" : "btn-outline"}"
123
+ class="btn ${s ? "btn-outline-custom" : "btn-outline"}"
133
124
  >
134
125
  <slot></slot>
135
126
  </a>
136
- ` : r`
127
+ ` : l`
137
128
  <button
138
- style="${t}${o}${s}"
139
- class="btn ${n ? "btn-outline-custom" : "btn-outline"}"
129
+ style="${e}${o}${a}"
130
+ class="btn ${s ? "btn-outline-custom" : "btn-outline"}"
140
131
  title="${this.altText}"
141
132
  >
142
133
  <slot></slot>
143
134
  </button>
144
- ` : this.mode === "ghost" ? this.kind === "link" ? r`
135
+ ` : this.mode === "ghost" ? this.kind === "link" ? l`
145
136
  <a
146
- style="${t}${o}${s}"
137
+ style="${e}${o}${a}"
147
138
  href="${this.url}"
148
139
  alt="${this.altText}"
149
140
  title="${this.altText}"
@@ -152,17 +143,17 @@ class l extends c {
152
143
  >
153
144
  <slot></slot>
154
145
  </a>
155
- ` : r`
146
+ ` : l`
156
147
  <button
157
- style="${t}${o}${s}"
148
+ style="${e}${o}${a}"
158
149
  class="btn ${this.custom === "on" ? "btn-ghost-custom" : "btn-ghost"}"
159
150
  title="${this.altText}"
160
151
  >
161
152
  <slot></slot>
162
153
  </button>
163
- ` : this.kind === "link" ? r`
154
+ ` : this.kind === "link" ? l`
164
155
  <a
165
- style="${t}${o}${s}"
156
+ style="${e}${o}${a}"
166
157
  href="${this.url}"
167
158
  alt="${this.altText}"
168
159
  title="${this.altText}"
@@ -171,9 +162,9 @@ class l extends c {
171
162
  >
172
163
  <slot></slot>
173
164
  </a>
174
- ` : r`
165
+ ` : l`
175
166
  <button
176
- style="${t}${o}${s}"
167
+ style="${e}${o}${a}"
177
168
  class="btn ${this.custom === "on" ? "btn-custom" : "btn-primary"}"
178
169
  title="${this.altText}"
179
170
  >
@@ -181,9 +172,859 @@ class l extends c {
181
172
  </button>
182
173
  `;
183
174
  }
184
- }
185
- customElements.define(l.is, l);
186
- const m = "0.0.1";
175
+ };
176
+ c.styles = [j];
177
+ p([
178
+ n({ type: String })
179
+ ], c.prototype, "mode", 2);
180
+ p([
181
+ n({ type: String })
182
+ ], c.prototype, "kind", 2);
183
+ p([
184
+ n({ type: String })
185
+ ], c.prototype, "custom", 2);
186
+ p([
187
+ n({ type: String })
188
+ ], c.prototype, "firstColor", 2);
189
+ p([
190
+ n({ type: String })
191
+ ], c.prototype, "secondaryColor", 2);
192
+ p([
193
+ n({ type: String })
194
+ ], c.prototype, "size", 2);
195
+ p([
196
+ n({ type: String })
197
+ ], c.prototype, "fontSize", 2);
198
+ p([
199
+ n({ type: String })
200
+ ], c.prototype, "url", 2);
201
+ p([
202
+ n({ type: String })
203
+ ], c.prototype, "target", 2);
204
+ p([
205
+ n({ type: String })
206
+ ], c.prototype, "altText", 2);
207
+ c = p([
208
+ u("sema-button")
209
+ ], c);
210
+ const q = m`
211
+ :host {
212
+ font-family: "Inter", system-ui, -apple-system, sans-serif;
213
+ }
214
+
215
+ .__section {
216
+ display: flex;
217
+ flex-direction: column;
218
+ width: 100%;
219
+ height: auto;
220
+ border-radius: 8px;
221
+ box-sizing: border-box;
222
+ overflow: hidden;
223
+ padding: 1rem 1rem 1rem 0;
224
+ }
225
+
226
+ .__title {
227
+ margin-left: 1rem;
228
+ margin-top: 0;
229
+ margin-bottom: 0.5rem;
230
+ font-size: 1rem;
231
+ font-weight: bold;
232
+ }
233
+ .__paragraph {
234
+ margin-left: 1rem;
235
+ margin-top: 0;
236
+ margin-bottom: 0;
237
+ font-size: 0.9rem;
238
+ }
239
+
240
+ .__error {
241
+ border: 1px solid #dc2626;
242
+ border-left-width: 4px;
243
+ background: #450a0a;
244
+ -webkit-backdrop-filter: blur(4px);
245
+ backdrop-filter: blur(4px);
246
+
247
+ .__title {
248
+ color: #dc2626;
249
+ }
250
+ .__paragraph {
251
+ color: #fff;
252
+ }
253
+ }
254
+
255
+ .__warn {
256
+ border: 1px solid #ffbb27;
257
+ border-left-width: 4px;
258
+ background: #775a1a;
259
+ -webkit-backdrop-filter: blur(4px);
260
+ backdrop-filter: blur(4px);
261
+
262
+ .__title {
263
+ color: #ffbb27;
264
+ }
265
+ .__paragraph {
266
+ color: #fff;
267
+ }
268
+ }
269
+
270
+ .__info {
271
+ border-left: 4px solid #3ffc38;
272
+ border: 1px solid #3ffc38;
273
+ border-left-width: 4px;
274
+ background: #f1f1f1;
275
+ -webkit-backdrop-filter: blur(4px);
276
+ backdrop-filter: blur(4px);
277
+
278
+ .__title {
279
+ color: #0a0a0a;
280
+ }
281
+ .__paragraph {
282
+ color: #585858;
283
+ }
284
+ }
285
+
286
+ @media (prefers-color-scheme: dark) {
287
+ .__info {
288
+ background: transparent;
289
+
290
+ .__title {
291
+ color: #e0e0e0;
292
+ }
293
+ .__paragraph {
294
+ color: #fff;
295
+ }
296
+ }
297
+ }
298
+ `;
299
+ var L = Object.defineProperty, A = Object.getOwnPropertyDescriptor, O = (s, e, r, o) => {
300
+ for (var t = o > 1 ? void 0 : o ? A(e, r) : e, a = s.length - 1, i; a >= 0; a--)
301
+ (i = s[a]) && (t = (o ? i(e, r, t) : i(t)) || t);
302
+ return o && t && L(e, r, t), t;
303
+ };
304
+ let y = class extends b {
305
+ constructor() {
306
+ super(...arguments), this.type = "info", this.title = "", this.message = "";
307
+ }
308
+ render() {
309
+ return l`
310
+ <section class="__section __${this.type}">
311
+ <h3 class="__title">${this.title}</h3>
312
+ <p class="__paragraph">${this.message}</p>
313
+ </section>
314
+ `;
315
+ }
316
+ };
317
+ y.styles = [q];
318
+ O([
319
+ n({ type: String })
320
+ ], y.prototype, "type", 2);
321
+ O([
322
+ n({ type: String })
323
+ ], y.prototype, "title", 2);
324
+ O([
325
+ n({ type: String })
326
+ ], y.prototype, "message", 2);
327
+ y = O([
328
+ u("sema-alerts")
329
+ ], y);
330
+ const E = m`
331
+ :host {
332
+ display: block;
333
+ font-family: "Inter", system-ui, -apple-system, sans-serif;
334
+ }
335
+
336
+ .accordion {
337
+ border-radius: 4px;
338
+ margin-bottom: 0.5rem;
339
+ background: var(--isOpenBackground);
340
+ overflow: hidden;
341
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
342
+ }
343
+
344
+ .__btn {
345
+ padding: 1rem;
346
+ cursor: pointer;
347
+ display: flex;
348
+ justify-content: space-between;
349
+ align-items: center;
350
+ font-weight: 600;
351
+ background: var(--color-btn);
352
+ backdrop-filter: blur(5px);
353
+ transition: background 0.2s ease, color 0.2s ease;
354
+ max-height: 200px;
355
+ gap: 1rem;
356
+ }
357
+
358
+ .__title {
359
+ margin: 0;
360
+ color: #000;
361
+ }
362
+
363
+ svg {
364
+ width: 1rem;
365
+ height: 1rem;
366
+ fill: var(--svgcolor);
367
+ transform: var(--isOpenRotate);
368
+ transition: transform 0.3s;
369
+ }
370
+
371
+ .__dropdown {
372
+ padding: var(--isOpenPadding);
373
+ max-height: var(--isOpenHeight);
374
+ overflow: hidden;
375
+ transition: all 0.3s ease;
376
+ opacity: var(--isOpenOpacity);
377
+ }
378
+
379
+ .__text {
380
+ color: #444547;
381
+ margin: 0;
382
+ }
383
+
384
+ @media (prefers-color-scheme: dark) {
385
+
386
+ .__btn {
387
+ background: var(--svgcolor);
388
+ }
389
+
390
+ .__title {
391
+ color: #fff;
392
+ }
393
+
394
+ svg {
395
+ fill: #fff;
396
+ }
397
+
398
+ .__text {
399
+ color: #dbdbdd;
400
+ }
401
+
402
+ }
403
+ `;
404
+ var I = Object.defineProperty, N = Object.getOwnPropertyDescriptor, $ = (s, e, r, o) => {
405
+ for (var t = o > 1 ? void 0 : o ? N(e, r) : e, a = s.length - 1, i; a >= 0; a--)
406
+ (i = s[a]) && (t = (o ? i(e, r, t) : i(t)) || t);
407
+ return o && t && I(e, r, t), t;
408
+ };
409
+ let g = class extends b {
410
+ constructor() {
411
+ super(...arguments), this.question = "", this.answer = "", this.color = "", this.open = !1;
412
+ }
413
+ render() {
414
+ const s = this.open === !0;
415
+ let e = this.color ? this.color : "#dc2626";
416
+ const o = s ? `
417
+ --color-btn: ${s ? "rgba(229, 231, 235, 0.2)" : ""};
418
+ --isOpenPadding: 1rem;
419
+ --isOpenHeight: 200px;
420
+ --isOpenOpacity: 1;
421
+ --isOpenRotate: rotate(180deg);` : `
422
+ --color-btn: transparent;
423
+ --isOpenPadding: 0;
424
+ --isOpenHeight: 0;
425
+ --isOpenOpacity: 0;
426
+ --isOpenRotate: rotate(0);`, t = `
427
+ --svgcolor: ${e};`, a = o + t;
428
+ return l`
429
+ <article class="accordion" style="${a}" >
430
+ <div class="__btn" @click="${this._changeIsOpen}">
431
+ <h3 class="__title">${this.question}</h3>
432
+
433
+ <div class="__icon">
434
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 451.847 451.847" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M225.923 354.706c-8.098 0-16.195-3.092-22.369-9.263L9.27 151.157c-12.359-12.359-12.359-32.397 0-44.751 12.354-12.354 32.388-12.354 44.748 0l171.905 171.915 171.906-171.909c12.359-12.354 32.391-12.354 44.744 0 12.365 12.354 12.365 32.392 0 44.751L248.292 345.449c-6.177 6.172-14.274 9.257-22.369 9.257z" opacity="1" data-original="#000000" class=""></path></g></svg>
435
+ </div>
436
+ </div>
437
+ <div class="__dropdown">
438
+ <p class="__text">${this.answer}</p>
439
+ </div>
440
+ </article>
441
+ `;
442
+ }
443
+ _changeIsOpen() {
444
+ this.open === !1 ? this.open = !0 : this.open = !1;
445
+ }
446
+ };
447
+ g.styles = [E];
448
+ $([
449
+ n({ type: String })
450
+ ], g.prototype, "question", 2);
451
+ $([
452
+ n({ type: String })
453
+ ], g.prototype, "answer", 2);
454
+ $([
455
+ n({ type: String })
456
+ ], g.prototype, "color", 2);
457
+ $([
458
+ n({ type: Boolean })
459
+ ], g.prototype, "open", 2);
460
+ g = $([
461
+ u("sema-accordion")
462
+ ], g);
463
+ const R = m`
464
+
465
+ .__title {
466
+ color: #000;
467
+ text-align: center;
468
+ }
469
+
470
+ @media (prefers-color-scheme: dark) {
471
+ :root {
472
+ display: block;
473
+ font-family: "Inter", system-ui, -apple-system, sans-serif;
474
+ }
475
+
476
+ section {
477
+ display: flex;
478
+ flex-direction: column;
479
+ justify-content: center;
480
+ align-items: center;
481
+ width: 100%;
482
+ }
483
+
484
+ article {
485
+ max-width: 980px;
486
+ width: 100%;
487
+ }
488
+ .__title{
489
+ color: #fff;
490
+ }
491
+ }
492
+ `;
493
+ var P = Object.freeze, C = Object.defineProperty, H = Object.getOwnPropertyDescriptor, S = (s, e, r, o) => {
494
+ for (var t = o > 1 ? void 0 : o ? H(e, r) : e, a = s.length - 1, i; a >= 0; a--)
495
+ (i = s[a]) && (t = (o ? i(e, r, t) : i(t)) || t);
496
+ return o && t && C(e, r, t), t;
497
+ }, M = (s, e) => P(C(s, "raw", { value: P(s.slice()) })), z;
498
+ let _ = class extends b {
499
+ constructor() {
500
+ super(...arguments), this.title = "", this.color = "", this.faqs = [];
501
+ }
502
+ render() {
503
+ const s = {
504
+ "@context": "https://schema.org",
505
+ "@type": "FAQPage",
506
+ mainEntity: this.faqs.map((r) => ({
507
+ "@type": "Question",
508
+ name: r.question,
509
+ acceptedAnswer: {
510
+ "@type": "Answer",
511
+ text: r.answer
512
+ }
513
+ }))
514
+ }, e = JSON.stringify(s).replace(/<\/script>/g, "<\\/script>");
515
+ return l(z || (z = M([`
516
+ <section class="faqs-section">
517
+ <h2 class="__title">`, `</h2>
518
+ <article>
519
+ `, `
520
+ </article>
521
+ </section>
522
+ <script type="application/ld+json">
523
+ `, `
524
+ <\/script>
525
+ `])), this.title, this.faqs.map(
526
+ (r) => l`
527
+ <sema-accordion
528
+ color="${this.color}"
529
+ question="${r.question}"
530
+ answer="${r.answer}"
531
+ ></sema-accordion>
532
+ `
533
+ ), T(e));
534
+ }
535
+ };
536
+ _.styles = [R];
537
+ S([
538
+ n({ type: String })
539
+ ], _.prototype, "title", 2);
540
+ S([
541
+ n({ type: String })
542
+ ], _.prototype, "color", 2);
543
+ S([
544
+ n({ type: Array })
545
+ ], _.prototype, "faqs", 2);
546
+ _ = S([
547
+ u("sema-faqs")
548
+ ], _);
549
+ const Y = m`
550
+ :host {
551
+ display: block;
552
+ font-family: "Inter", system-ui, -apple-system, sans-serif;
553
+ }
554
+
555
+ ol {
556
+ display: flex;
557
+ list-style: none;
558
+ padding: 0;
559
+ margin: 0;
560
+ font-size: 0.9rem;
561
+ }
562
+
563
+ .__link a {
564
+ color: #000;
565
+ cursor: pointer;
566
+ font-weight: 500;
567
+ }
568
+
569
+ .__slash {
570
+ margin: 0 8px;
571
+ color: #9ca3af;
572
+ }
573
+
574
+ .__active, .__link, a {
575
+ color: var(--color-primary);
576
+ cursor: default;
577
+ font-weight: 600;
578
+ }
579
+
580
+ @media (prefers-color-scheme: dark) {
581
+ .__link a {
582
+ color: #fff;
583
+ }
584
+ }
585
+ `;
586
+ var F = Object.defineProperty, U = Object.getOwnPropertyDescriptor, k = (s, e, r, o) => {
587
+ for (var t = o > 1 ? void 0 : o ? U(e, r) : e, a = s.length - 1, i; a >= 0; a--)
588
+ (i = s[a]) && (t = (o ? i(e, r, t) : i(t)) || t);
589
+ return o && t && F(e, r, t), t;
590
+ };
591
+ let x = class extends b {
592
+ constructor() {
593
+ super(...arguments), this.items = [], this.color = "";
594
+ }
595
+ render() {
596
+ const s = this.color ? `--color-primary: ${this.color};` : "--color-primary: #dc2626;";
597
+ return l`
598
+ <nav aria-label="breadcrumb" style="${s}">
599
+ <ol>
600
+ ${this.items.map((e, r) => l`
601
+ <li class="${r === this.items.length - 1 ? "__active" : "__link"}">
602
+ ${e.path && r !== this.items.length - 1 ? l`<a href="${e.path}">${e.label}</a>` : e.label}
603
+ </li>
604
+ ${r < this.items.length - 1 ? l`<li class="__slash">/</li>` : ""}
605
+ `)}
606
+ </ol>
607
+ </nav>
608
+ `;
609
+ }
610
+ };
611
+ x.styles = [Y];
612
+ k([
613
+ n({ type: Array })
614
+ ], x.prototype, "items", 2);
615
+ k([
616
+ n({ type: String })
617
+ ], x.prototype, "color", 2);
618
+ x = k([
619
+ u("sema-breadcrumbs")
620
+ ], x);
621
+ const V = m`
622
+ :host {
623
+ display: block;
624
+ font-family: "Inter", system-ui, -apple-system, sans-serif;
625
+ }
626
+ .__btn {
627
+ display: flex;
628
+ justify-content: space-between;
629
+ align-items: center;
630
+ background: transparent;
631
+ backdrop-filter: blur(5px);
632
+ transition: background 0.2s ease, color 0.2s ease;
633
+ max-height: 200px;
634
+ min-width: 100px;
635
+ cursor: pointer;
636
+ border: none;
637
+ border-radius: 4px;
638
+ padding: 1rem;
639
+ gap: 1rem;
640
+ }
641
+
642
+ .__label {
643
+ margin: 0;
644
+ color: #fff;
645
+ }
646
+
647
+ svg {
648
+ width: 1rem;
649
+ height: 1rem;
650
+ fill: var(--svgcolor);
651
+ transform: var(--isOpenRotate);
652
+ transition: transform 0.3s;
653
+ }
654
+
655
+ .__content {
656
+ display: flex;
657
+ padding: var(--isOpenPadding);
658
+ max-height: var(--isOpenHeight);
659
+ overflow: hidden;
660
+ transition: all 0.3s ease;
661
+ opacity: var(--isOpenOpacity);
662
+ background: #f1f1f1;
663
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
664
+ flex-direction: column;
665
+ max-width: 150px;
666
+ border-radius: 4px;
667
+ }
668
+
669
+ .__category {
670
+ display: flex;
671
+ flex-direction: column;
672
+ margin-bottom: 0.5rem;
673
+ }
674
+
675
+ .__category-title {
676
+ font-size: 0.7rem;
677
+ font-weight: bold;
678
+ color: var(--svgcolor);
679
+ padding: 0.25rem 0.5rem;
680
+ text-transform: uppercase;
681
+ }
682
+
683
+ .__link {
684
+ color: #444547;
685
+ text-decoration: none;
686
+ padding: 0.5rem;
687
+ padding-left: 1rem;
688
+ border-radius: 4px;
689
+ transition: background-color 0.2s;
690
+ }
691
+
692
+ .__link:hover {
693
+ background-color: rgba(0, 0, 0, 0.05);
694
+ }
695
+
696
+ @media (prefers-color-scheme: dark) {
697
+ .__label {
698
+ color: #fff;
699
+ }
700
+
701
+ svg {
702
+ fill: var(--svgcolor);
703
+ }
704
+
705
+ .__content {
706
+ background: #131313;
707
+ }
708
+ .__link {
709
+ color: #dbdbdd;
710
+ }
711
+
712
+ .__link:hover {
713
+ background-color: rgba(255, 255, 255, 0.1);
714
+ }
715
+
716
+ .__category-title {
717
+ color: var(--svgcolor);
718
+ }
719
+
720
+ }
721
+ `;
722
+ var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, v = (s, e, r, o) => {
723
+ for (var t = o > 1 ? void 0 : o ? Q(e, r) : e, a = s.length - 1, i; a >= 0; a--)
724
+ (i = s[a]) && (t = (o ? i(e, r, t) : i(t)) || t);
725
+ return o && t && G(e, r, t), t;
726
+ };
727
+ let h = class extends b {
728
+ constructor() {
729
+ super(...arguments), this.label = "", this.color = "", this.bgColor = "", this.open = !1, this.items = [];
730
+ }
731
+ render() {
732
+ const s = this.open === !0;
733
+ let e = this.color ? this.color : "#dc2626", r = this.bgColor ? this.bgColor : "#dc2626";
734
+ const o = s ? `
735
+ --isOpenBgColor: ${r};
736
+ --isOpenPadding: 1rem;
737
+ --isOpenHeight: auto;
738
+ --isOpenOpacity: 1;
739
+ --isOpenRotate: rotate(180deg);` : `
740
+ --isOpenPadding: 0;
741
+ --isOpenHeight: 0;
742
+ --isOpenOpacity: 0;
743
+ --isOpenRotate: rotate(0);`, t = `--svgcolor: ${e};`, a = o + t;
744
+ return l`
745
+ <button class="__btn" @click="${this._changeIsOpen}" style="${t}">
746
+ <span class="__label">${this.label}</span>
747
+
748
+ <div class="__icon">
749
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512" x="0" y="0" viewBox="0 0 451.847 451.847" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><path d="M225.923 354.706c-8.098 0-16.195-3.092-22.369-9.263L9.27 151.157c-12.359-12.359-12.359-32.397 0-44.751 12.354-12.354 32.388-12.354 44.748 0l171.905 171.915 171.906-171.909c12.359-12.354 32.391-12.354 44.744 0 12.365 12.354 12.365 32.392 0 44.751L248.292 345.449c-6.177 6.172-14.274 9.257-22.369 9.257z" opacity="1" data-original="#000000" class=""></path></g></svg>
750
+ </div>
751
+ </button>
752
+
753
+ <div class="__content" style="${a}">
754
+ ${this.items.map((i) => "category" in i ? l`
755
+ <div class="__category">
756
+ <span class="__category-title">${i.category}</span>
757
+ ${i.items.map((w) => l`
758
+ <a href="${w.path || "#"}" title="${w.label}" aria-label="${w.label}" class="__link">${w.label}</a>
759
+ `)}
760
+ </div>
761
+ ` : l`<a href="${i.path || "#"}" title="${i.label}" aria-label="${i.label}" class="__link">${i.label}</a>`)}
762
+ </div>
763
+ </div>
764
+ `;
765
+ }
766
+ _changeIsOpen() {
767
+ this.open = !this.open;
768
+ }
769
+ };
770
+ h.styles = [V];
771
+ v([
772
+ n({ type: String })
773
+ ], h.prototype, "label", 2);
774
+ v([
775
+ n({ type: String })
776
+ ], h.prototype, "color", 2);
777
+ v([
778
+ n({ type: String })
779
+ ], h.prototype, "bgColor", 2);
780
+ v([
781
+ n({ type: Boolean })
782
+ ], h.prototype, "open", 2);
783
+ v([
784
+ n({ type: Array })
785
+ ], h.prototype, "items", 2);
786
+ h = v([
787
+ u("sema-dropdown")
788
+ ], h);
789
+ const J = m`
790
+ .product-card {
791
+ background-color: white;
792
+ width: 300px;
793
+ border-radius: 12px;
794
+ overflow: hidden; /* Para que la imagen respete los bordes redondeados */
795
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
796
+ transition:
797
+ transform 0.3s ease,
798
+ box-shadow 0.3s ease;
799
+ cursor: pointer;
800
+ }
801
+
802
+ /* Efecto al pasar el mouse por encima */
803
+ .product-card:hover {
804
+ transform: translateY(-5px);
805
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
806
+ }
807
+
808
+ /* 1. Imagen */
809
+ .card-image-container {
810
+ width: 100%;
811
+ height: 200px;
812
+ overflow: hidden;
813
+ position: relative;
814
+ }
815
+
816
+ .card-image-container img {
817
+ width: 100%;
818
+ height: 100%;
819
+ object-fit: cover; /* Mantiene la proporción de la imagen sin estirarla */
820
+ transition: transform 0.5s ease;
821
+ }
822
+
823
+ .product-card:hover .card-image-container img {
824
+ transform: scale(1.05); /* Zoom suave en la imagen */
825
+ }
826
+
827
+ /* Contenedor de la información */
828
+ .card-details {
829
+ padding: 20px;
830
+ }
831
+
832
+ /* 2. Categoría e ID (Cabecera pequeña) */
833
+ .card-meta {
834
+ display: flex;
835
+ justify-content: space-between;
836
+ align-items: center;
837
+ margin-bottom: 10px;
838
+ font-size: 0.75rem;
839
+ }
840
+
841
+ .category {
842
+ background-color: #e0e7ff;
843
+ color: #4338ca;
844
+ padding: 4px 8px;
845
+ border-radius: 4px;
846
+ font-weight: 700;
847
+ text-transform: uppercase;
848
+ letter-spacing: 0.5px;
849
+ }
850
+
851
+ .product-id {
852
+ color: #888;
853
+ }
854
+
855
+ /* 3. Título del Producto */
856
+ .product-title {
857
+ margin: 0 0 10px 0;
858
+ font-size: 1.2rem;
859
+ color: #333;
860
+ line-height: 1.4;
861
+ font-weight: 600;
862
+ display: -webkit-box;
863
+ -webkit-line-clamp: 1;
864
+ -webkit-box-orient: vertical;
865
+ overflow: hidden;
866
+ }
867
+
868
+ /* 4. Valoración (Estrellas y Promedio) */
869
+ .rating-container {
870
+ display: flex;
871
+ align-items: center;
872
+ margin-bottom: 15px;
873
+ font-size: 0.9rem;
874
+ }
875
+
876
+ .stars {
877
+ color: #fbbf24; /* Color dorado */
878
+ margin-right: 5px;
879
+ letter-spacing: 1px;
880
+ }
881
+
882
+ .average-rating {
883
+ font-weight: bold;
884
+ color: #333;
885
+ margin-right: 5px;
886
+ }
887
+
888
+ .review-count {
889
+ color: #6b7280;
890
+ font-size: 0.8rem;
891
+ }
892
+
893
+ /* Línea separadora */
894
+ hr {
895
+ border: 0;
896
+ border-top: 1px solid #eee;
897
+ margin: 10px 0;
898
+ }
899
+
900
+ /* 5. Precio */
901
+ .price-container {
902
+ display: flex;
903
+ justify-content: space-between;
904
+ align-items: center;
905
+ margin-top: 15px;
906
+ }
907
+
908
+ .price {
909
+ font-size: 1.5rem;
910
+ font-weight: 800;
911
+ color: #1f2937;
912
+ }
913
+
914
+ .currency {
915
+ font-size: 0.9rem;
916
+ vertical-align: top;
917
+ }
918
+
919
+ @media (prefers-color-scheme: dark) {
920
+ .product-card {
921
+ background-color: #1f2937;
922
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
923
+ }
924
+
925
+ .product-title {
926
+ color: #f9fafb;
927
+ }
928
+
929
+ .average-rating {
930
+ color: #f3f4f6;
931
+ }
932
+
933
+ .review-count {
934
+ color: #9ca3af;
935
+ }
936
+
937
+ .price {
938
+ color: #f9fafb;
939
+ }
940
+
941
+ .category {
942
+ background-color: #3730a3;
943
+ color: #e0e7ff;
944
+ }
945
+
946
+ hr {
947
+ border-top: 1px solid #374151;
948
+ }
949
+ }
950
+ `;
951
+ var Z = Object.defineProperty, K = Object.getOwnPropertyDescriptor, f = (s, e, r, o) => {
952
+ for (var t = o > 1 ? void 0 : o ? K(e, r) : e, a = s.length - 1, i; a >= 0; a--)
953
+ (i = s[a]) && (t = (o ? i(e, r, t) : i(t)) || t);
954
+ return o && t && Z(e, r, t), t;
955
+ };
956
+ let d = class extends b {
957
+ constructor() {
958
+ super(...arguments), this.image = "", this.category = "", this.id = "", this.title = "", this.rate = 0, this.count = 0, this.price = 0;
959
+ }
960
+ render() {
961
+ const s = Math.min(5, Math.max(0, Math.round(this.rate))), e = 5 - s;
962
+ return l`
963
+ <article class="product-card" id="${this.id}">
964
+ <div class="card-image-container">
965
+ <img
966
+ src="${this.image}"
967
+ alt="Auriculares Premium"
968
+ />
969
+ </div>
970
+
971
+ <div class="card-details">
972
+ <div class="card-meta">
973
+ <span class="category">${this.category}</span>
974
+ <span class="product-id">${this.id ? `ID: ${this.id}` : ""}</span>
975
+ </div>
976
+
977
+ <h3 class="product-title">${this.title}</h3>
978
+
979
+ <div class="rating-container">
980
+ <span class="stars">${"★".repeat(s)}${"☆".repeat(e)}</span>
981
+ <span class="average-rating">${this.rate}</span>
982
+ <span class="review-count">(${this.count} valoraciones)</span>
983
+ </div>
984
+
985
+ <hr />
986
+
987
+ <div class="price-container">
988
+ <span class="price"><span class="currency">$</span>${this.price}</span>
989
+ </div>
990
+ </div>
991
+ </article>
992
+ `;
993
+ }
994
+ };
995
+ d.styles = [J];
996
+ f([
997
+ n({ type: String })
998
+ ], d.prototype, "image", 2);
999
+ f([
1000
+ n({ type: String })
1001
+ ], d.prototype, "category", 2);
1002
+ f([
1003
+ n({ type: String })
1004
+ ], d.prototype, "id", 2);
1005
+ f([
1006
+ n({ type: String })
1007
+ ], d.prototype, "title", 2);
1008
+ f([
1009
+ n({ type: Number })
1010
+ ], d.prototype, "rate", 2);
1011
+ f([
1012
+ n({ type: Number })
1013
+ ], d.prototype, "count", 2);
1014
+ f([
1015
+ n({ type: Number })
1016
+ ], d.prototype, "price", 2);
1017
+ d = f([
1018
+ u("sema-card-product")
1019
+ ], d);
1020
+ const et = "0.0.1";
187
1021
  export {
188
- m as version
1022
+ g as SemaAccordion,
1023
+ y as SemaAlerts,
1024
+ x as SemaBreadcrumbs,
1025
+ c as SemaButton,
1026
+ d as SemaCardProduct,
1027
+ h as SemaDropdown,
1028
+ _ as SemaFaqs,
1029
+ et as version
189
1030
  };