dgonmej-ui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,7 +53,8 @@ Lit se comparte la misma copia. La librería se distribuye como módulo ES con `
53
53
  que necesita un empaquetador (Vite, Astro, webpack...) o una CDN que resuelva las dependencias:
54
54
 
55
55
  ```html
56
- <script type="module" src="https://cdn.jsdelivr.net/npm/dgonmej-ui/+esm"></script>
56
+ <link rel="stylesheet" href="https://esm.sh/dgonmej-ui@0.1/tokens.css" />
57
+ <script type="module" src="https://esm.sh/dgonmej-ui@0.1"></script>
57
58
  ```
58
59
 
59
60
  También se puede instalar directamente desde GitHub (se compila al instalar):
@@ -1,9 +1,9 @@
1
- var re = Object.defineProperty;
2
- var ie = (o, e, t) => e in o ? re(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var i = (o, e, t) => ie(o, typeof e != "symbol" ? e + "" : e, t);
4
- import { svg as s, html as a, LitElement as p, css as d } from "lit";
1
+ var ce = Object.defineProperty;
2
+ var pe = (o, e, t) => e in o ? ce(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var i = (o, e, t) => pe(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { svg as s, html as a, LitElement as p, css as c, nothing as ue } from "lit";
5
5
  import { ifDefined as n } from "lit/directives/if-defined.js";
6
- import { repeat as oe } from "lit/directives/repeat.js";
6
+ import { repeat as he } from "lit/directives/repeat.js";
7
7
  /*! @license
8
8
  * Iconos de Lucide v0.460.0 (https://lucide.dev), copiados como trazos SVG.
9
9
  *
@@ -23,7 +23,7 @@ import { repeat as oe } from "lit/directives/repeat.js";
23
23
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24
24
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25
25
  */
26
- const C = "currentColor", J = {
26
+ const I = "currentColor", ie = {
27
27
  "chevron-left": s`<path d="m15 18-6-6 6-6" />`,
28
28
  // chevron-left
29
29
  "chevron-right": s`<path d="m9 18 6-6-6-6" />`,
@@ -38,9 +38,9 @@ const C = "currentColor", J = {
38
38
  // plus
39
39
  minus: s`<path d="M5 12h14" />`,
40
40
  // minus
41
- play: s`<polygon fill=${C} points="6 3 20 12 6 21 6 3" />`,
41
+ play: s`<polygon fill=${I} points="6 3 20 12 6 21 6 3" />`,
42
42
  // play
43
- pause: s`<rect fill=${C} x="14" y="4" width="4" height="16" rx="1" /><rect fill=${C} x="6" y="4" width="4" height="16" rx="1" />`,
43
+ pause: s`<rect fill=${I} x="14" y="4" width="4" height="16" rx="1" /><rect fill=${I} x="6" y="4" width="4" height="16" rx="1" />`,
44
44
  // pause
45
45
  speaker: s`<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z" /><path d="M16 9a5 5 0 0 1 0 6" /><path d="M19.364 18.364a9 9 0 0 0 0-12.728" />`,
46
46
  // volume-2
@@ -102,7 +102,7 @@ const C = "currentColor", J = {
102
102
  // eye-off
103
103
  };
104
104
  function u(o, { size: e = 20, label: t } = {}) {
105
- const r = J[o];
105
+ const r = ie[o];
106
106
  return r ? a`<svg
107
107
  class="icon"
108
108
  viewBox="0 0 24 24"
@@ -118,8 +118,8 @@ function u(o, { size: e = 20, label: t } = {}) {
118
118
  aria-label=${n(t || void 0)}
119
119
  >${r}</svg>` : "";
120
120
  }
121
- const $e = Object.keys(J);
122
- class E extends p {
121
+ const Te = Object.keys(ie);
122
+ class B extends p {
123
123
  constructor() {
124
124
  super(), this.name = "", this.size = 20, this.label = "";
125
125
  }
@@ -127,19 +127,19 @@ class E extends p {
127
127
  return a`${u(this.name, { size: this.size, label: this.label })}`;
128
128
  }
129
129
  }
130
- i(E, "properties", {
130
+ i(B, "properties", {
131
131
  name: { type: String },
132
132
  size: { type: Number },
133
133
  label: { type: String }
134
- }), i(E, "styles", d`
134
+ }), i(B, "styles", c`
135
135
  :host {
136
136
  display: inline-flex;
137
137
  line-height: 0;
138
138
  vertical-align: middle;
139
139
  }
140
140
  `);
141
- customElements.define("dgonmej-ui-icon", E);
142
- class M extends p {
141
+ customElements.define("dgonmej-ui-icon", B);
142
+ class L extends p {
143
143
  constructor() {
144
144
  super(), this.variant = "primary", this.size = "medium", this.block = !1, this.disabled = !1, this.icon = !1, this.label = "";
145
145
  }
@@ -181,7 +181,7 @@ class M extends p {
181
181
  this.dispatchEvent(new CustomEvent("ui-click", { bubbles: !0, composed: !0 }));
182
182
  }
183
183
  }
184
- i(M, "properties", {
184
+ i(L, "properties", {
185
185
  variant: { type: String, reflect: !0 },
186
186
  disabled: { type: Boolean, reflect: !0 },
187
187
  icon: { type: Boolean, reflect: !0 },
@@ -193,7 +193,7 @@ i(M, "properties", {
193
193
  current: { type: String, reflect: !0 },
194
194
  expanded: { type: String },
195
195
  haspopup: { type: String }
196
- }), i(M, "styles", d`
196
+ }), i(L, "styles", c`
197
197
  :host {
198
198
  display: inline-block;
199
199
  font-family: var(--ui-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif);
@@ -352,8 +352,8 @@ i(M, "properties", {
352
352
  }
353
353
  }
354
354
  `);
355
- customElements.define("dgonmej-ui-button", M);
356
- const h = d`
355
+ customElements.define("dgonmej-ui-button", L);
356
+ const m = c`
357
357
  :host {
358
358
  font-family: var(--ui-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif);
359
359
  -webkit-font-smoothing: antialiased;
@@ -366,7 +366,7 @@ const h = d`
366
366
  [hidden] {
367
367
  display: none !important;
368
368
  }
369
- `, S = d`
369
+ `, P = c`
370
370
  .material {
371
371
  color: var(--ui-material-text, #1d1d1f);
372
372
  background: var(--ui-material-bg, rgb(250 250 252 / 0.94));
@@ -379,7 +379,7 @@ const h = d`
379
379
  backdrop-filter: var(--ui-material-blur, blur(20px) saturate(180%));
380
380
  }
381
381
  }
382
- `, U = d`
382
+ `, oe = c`
383
383
  .sr-only {
384
384
  position: absolute;
385
385
  width: 1px;
@@ -392,7 +392,7 @@ const h = d`
392
392
  border: 0;
393
393
  }
394
394
  `;
395
- class A extends p {
395
+ class j extends p {
396
396
  constructor() {
397
397
  super(), this.variant = "neutral", this.dot = !1, this.size = "medium";
398
398
  }
@@ -400,13 +400,13 @@ class A extends p {
400
400
  return a`<span class="badge" part="badge">${this.dot ? a`<span class="dot"></span>` : ""}<slot></slot></span>`;
401
401
  }
402
402
  }
403
- i(A, "properties", {
403
+ i(j, "properties", {
404
404
  variant: { type: String, reflect: !0 },
405
405
  dot: { type: Boolean, reflect: !0 },
406
406
  size: { type: String, reflect: !0 }
407
- }), i(A, "styles", [
408
- h,
409
- d`
407
+ }), i(j, "styles", [
408
+ m,
409
+ c`
410
410
  :host {
411
411
  --_color: var(--ui-color-text, #1d1d1f);
412
412
  --_bg: var(--ui-color-fill, rgb(120 120 128 / 0.12));
@@ -465,8 +465,8 @@ i(A, "properties", {
465
465
  }
466
466
  `
467
467
  ]);
468
- customElements.define("dgonmej-ui-badge", A);
469
- const P = {
468
+ customElements.define("dgonmej-ui-badge", j);
469
+ const R = {
470
470
  es: {
471
471
  "theme.label": "Tema",
472
472
  "theme.system": "Sistema",
@@ -558,15 +558,15 @@ const P = {
558
558
  "player.error": "Couldn't play the audio. Check your connection and try again."
559
559
  }
560
560
  };
561
- function se(o) {
562
- var r, c;
563
- const t = (((c = (r = o == null ? void 0 : o.closest) == null ? void 0 : r.call(o, "[lang]")) == null ? void 0 : c.getAttribute("lang")) || document.documentElement.lang || "es").toLowerCase().slice(0, 2);
564
- return P[t] ? t : "es";
561
+ function me(o) {
562
+ var r, d;
563
+ const t = (((d = (r = o == null ? void 0 : o.closest) == null ? void 0 : r.call(o, "[lang]")) == null ? void 0 : d.getAttribute("lang")) || document.documentElement.lang || "es").toLowerCase().slice(0, 2);
564
+ return R[t] ? t : "es";
565
565
  }
566
566
  function l(o, e, t = {}) {
567
- return (P[se(o)][e] ?? P.es[e] ?? e).replace(/\{(\w+)\}/g, (c, m) => m in t ? t[m] : `{${m}}`);
567
+ return (R[me(o)][e] ?? R.es[e] ?? e).replace(/\{(\w+)\}/g, (d, h) => h in t ? t[h] : `{${h}}`);
568
568
  }
569
- const D = [
569
+ const te = [
570
570
  ["#0071e3", "#004fa3"],
571
571
  ["#5e5ce6", "#3634a3"],
572
572
  ["#c4001a", "#8f0013"],
@@ -574,16 +574,16 @@ const D = [
574
574
  ["#b25000", "#7a3700"],
575
575
  ["#8944ab", "#5e2a78"],
576
576
  ["#0a7a8f", "#065463"]
577
- ], ne = (o = "") => o.trim().split(/\s+/).slice(0, 2).map((e) => {
577
+ ], ge = (o = "") => o.trim().split(/\s+/).slice(0, 2).map((e) => {
578
578
  var t;
579
579
  return ((t = e[0]) == null ? void 0 : t.toUpperCase()) || "";
580
- }).join(""), le = (o = "") => [...o].reduce((e, t) => e * 31 + t.charCodeAt(0) >>> 0, 7);
580
+ }).join(""), ve = (o = "") => [...o].reduce((e, t) => e * 31 + t.charCodeAt(0) >>> 0, 7);
581
581
  if (typeof CSS < "u" && CSS.registerProperty)
582
582
  try {
583
583
  CSS.registerProperty({ name: "--ui-avatar-angle", syntax: "<angle>", inherits: !1, initialValue: "200deg" });
584
584
  } catch {
585
585
  }
586
- class T extends p {
586
+ class V extends p {
587
587
  constructor() {
588
588
  super(), this.name = "", this.src = "", this.size = "md", this.ring = !1, this.shape = "circle", this.status = "", this._failed = !1;
589
589
  }
@@ -594,18 +594,18 @@ class T extends p {
594
594
  return ["online", "away", "busy"].includes(this.status) ? l(this, `avatar.${this.status}`) : "";
595
595
  }
596
596
  render() {
597
- const [e, t] = D[le(this.name) % D.length], r = this.src && !this._failed;
597
+ const [e, t] = te[ve(this.name) % te.length], r = this.src && !this._failed;
598
598
  return a`
599
599
  <div class="avatar" part="avatar" role="img" aria-label=${[this.name || l(this, "avatar.label"), this._statusText].filter(Boolean).join(", ")}>
600
600
  <div class="inner ${r ? "has-image" : ""}" style="--_from: ${e}; --_to: ${t}">
601
- ${r ? a`<img part="image" src=${this.src} alt="" @error=${() => this._failed = !0} />` : a`<span aria-hidden="true">${ne(this.name)}</span>`}
601
+ ${r ? a`<img part="image" src=${this.src} alt="" @error=${() => this._failed = !0} />` : a`<span aria-hidden="true">${ge(this.name)}</span>`}
602
602
  </div>
603
603
  </div>
604
604
  ${this._statusText ? a`<span class="status ${this.status}" aria-hidden="true"></span>` : ""}
605
605
  `;
606
606
  }
607
607
  }
608
- i(T, "properties", {
608
+ i(V, "properties", {
609
609
  name: { type: String },
610
610
  src: { type: String },
611
611
  size: { type: String, reflect: !0 },
@@ -613,9 +613,9 @@ i(T, "properties", {
613
613
  shape: { type: String, reflect: !0 },
614
614
  status: { type: String, reflect: !0 },
615
615
  _failed: { state: !0 }
616
- }), i(T, "styles", [
617
- h,
618
- d`
616
+ }), i(V, "styles", [
617
+ m,
618
+ c`
619
619
  :host {
620
620
  --_size: 44px;
621
621
  /* Tamaño final: el libre (--ui-avatar-size) o el de "size" */
@@ -789,11 +789,11 @@ i(T, "properties", {
789
789
  }
790
790
  `
791
791
  ]);
792
- customElements.define("dgonmej-ui-avatar", T);
793
- let de = 0;
794
- class x extends p {
792
+ customElements.define("dgonmej-ui-avatar", V);
793
+ let fe = 0;
794
+ class $ extends p {
795
795
  constructor() {
796
- super(), this._internals = this.attachInternals(), this._id = `ui-tf-${++de}`, this.label = "", this.value = "", this.type = "text", this.placeholder = "", this.helper = "", this.error = "", this.required = !1, this.disabled = !1, this.clearable = !1, this.noIcon = !1, this._reveal = !1, this.size = "medium", this.variant = "filled";
796
+ super(), this._internals = this.attachInternals(), this._id = `ui-tf-${++fe}`, this.label = "", this.value = "", this.type = "text", this.placeholder = "", this.helper = "", this.error = "", this.required = !1, this.disabled = !1, this.clearable = !1, this.noIcon = !1, this._reveal = !1, this.size = "medium", this.variant = "filled";
797
797
  }
798
798
  updated(e) {
799
799
  e.has("value") && this._internals.setFormValue(this.value), this.toggleAttribute("empty", !this.value), e.has("type") && e.get("type") === "password" && (this._reveal = !1), e.has("error") && this.toggleAttribute("invalid", !!this.error);
@@ -849,7 +849,7 @@ class x extends p {
849
849
  }
850
850
  }
851
851
  render() {
852
- const e = `${this._id}-msg`, t = this.error || this.helper, r = this.type === "year", c = this._renderTypeIcon(), m = this.clearable && this.value;
852
+ const e = `${this._id}-msg`, t = this.error || this.helper, r = this.type === "year", d = this._renderTypeIcon(), h = this.clearable && this.value;
853
853
  return a`
854
854
  ${this.label ? a`<label for=${this._id}>
855
855
  ${this.label}${this.required ? a` <span class="required">(${l(this, "field.required")})</span>` : ""}
@@ -875,11 +875,11 @@ class x extends p {
875
875
  @input=${this._onInput}
876
876
  @change=${this._onChange}
877
877
  />
878
- ${m || c ? a`<span class="trailing">
879
- ${m ? a`<button class="clear" type="button" aria-label=${l(this, "field.clear")} @click=${this._clear}>
878
+ ${h || d ? a`<span class="trailing">
879
+ ${h ? a`<button class="clear" type="button" aria-label=${l(this, "field.clear")} @click=${this._clear}>
880
880
  ${u("xmark", { size: 16 })}
881
881
  </button>` : ""}
882
- ${c}
882
+ ${d}
883
883
  </span>` : ""}
884
884
  </div>
885
885
  ${t ? a`<div id=${e} class="message ${this.error ? "error" : ""}">
@@ -898,7 +898,7 @@ class x extends p {
898
898
  this.value = "", this.focus(), this._onInput({ target: { value: "" } }), this._onChange();
899
899
  }
900
900
  }
901
- i(x, "formAssociated", !0), i(x, "properties", {
901
+ i($, "formAssociated", !0), i($, "properties", {
902
902
  label: { type: String },
903
903
  name: { type: String, reflect: !0 },
904
904
  value: { type: String },
@@ -917,9 +917,9 @@ i(x, "formAssociated", !0), i(x, "properties", {
917
917
  size: { type: String, reflect: !0 },
918
918
  _reveal: { state: !0 },
919
919
  variant: { type: String, reflect: !0 }
920
- }), i(x, "styles", [
921
- h,
922
- d`
920
+ }), i($, "styles", [
921
+ m,
922
+ c`
923
923
  :host {
924
924
  --_h: var(--ui-control-height, 44px);
925
925
  --_fs: var(--ui-font-size-body, 1.0625rem);
@@ -1151,11 +1151,11 @@ i(x, "formAssociated", !0), i(x, "properties", {
1151
1151
  }
1152
1152
  `
1153
1153
  ]);
1154
- customElements.define("dgonmej-ui-text-field", x);
1155
- let ce = 0;
1156
- class y extends p {
1154
+ customElements.define("dgonmej-ui-text-field", $);
1155
+ let be = 0;
1156
+ class z extends p {
1157
1157
  constructor() {
1158
- super(), this._internals = this.attachInternals(), this._id = `ui-select-${++ce}`, this.label = "", this.value = "", this.placeholder = "", this.helper = "", this.options = [], this.required = !1, this.disabled = !1, this.size = "medium", this.variant = "filled";
1158
+ super(), this._internals = this.attachInternals(), this._id = `ui-select-${++be}`, this.label = "", this.value = "", this.placeholder = "", this.helper = "", this.options = [], this.required = !1, this.disabled = !1, this.size = "medium", this.variant = "filled";
1159
1159
  }
1160
1160
  updated(e) {
1161
1161
  e.has("value") && this._internals.setFormValue(this.value || null);
@@ -1191,7 +1191,7 @@ class y extends p {
1191
1191
  this.value = e.target.value, this.dispatchEvent(new CustomEvent("ui-change", { detail: { value: this.value }, bubbles: !0, composed: !0 }));
1192
1192
  }
1193
1193
  }
1194
- i(y, "formAssociated", !0), i(y, "properties", {
1194
+ i(z, "formAssociated", !0), i(z, "properties", {
1195
1195
  label: { type: String },
1196
1196
  name: { type: String, reflect: !0 },
1197
1197
  value: { type: String },
@@ -1202,9 +1202,9 @@ i(y, "formAssociated", !0), i(y, "properties", {
1202
1202
  disabled: { type: Boolean, reflect: !0 },
1203
1203
  size: { type: String, reflect: !0 },
1204
1204
  variant: { type: String, reflect: !0 }
1205
- }), i(y, "styles", [
1206
- h,
1207
- d`
1205
+ }), i(z, "styles", [
1206
+ m,
1207
+ c`
1208
1208
  :host {
1209
1209
  --_h: var(--ui-control-height, 44px);
1210
1210
  --_fs: var(--ui-font-size-body, 1.0625rem);
@@ -1299,11 +1299,11 @@ i(y, "formAssociated", !0), i(y, "properties", {
1299
1299
  }
1300
1300
  `
1301
1301
  ]);
1302
- customElements.define("dgonmej-ui-select", y);
1303
- let pe = 0;
1304
- class _ extends p {
1302
+ customElements.define("dgonmej-ui-select", z);
1303
+ let xe = 0;
1304
+ class S extends p {
1305
1305
  constructor() {
1306
- super(), this._internals = this.attachInternals(), this._id = `ui-ta-${++pe}`, this.label = "", this.value = "", this.placeholder = "", this.helper = "", this.error = "", this.rows = 3, this.maxRows = 10, this.autoresize = !1, this.variant = "filled", this.required = !1, this.disabled = !1;
1306
+ super(), this._internals = this.attachInternals(), this._id = `ui-ta-${++xe}`, this.label = "", this.value = "", this.placeholder = "", this.helper = "", this.error = "", this.rows = 3, this.maxRows = 10, this.autoresize = !1, this.variant = "filled", this.required = !1, this.disabled = !1;
1307
1307
  }
1308
1308
  updated(e) {
1309
1309
  var t;
@@ -1359,7 +1359,7 @@ class _ extends p {
1359
1359
  this.dispatchEvent(new CustomEvent("ui-change", { detail: { value: this.value }, bubbles: !0, composed: !0 }));
1360
1360
  }
1361
1361
  }
1362
- i(_, "formAssociated", !0), i(_, "properties", {
1362
+ i(S, "formAssociated", !0), i(S, "properties", {
1363
1363
  label: { type: String },
1364
1364
  name: { type: String, reflect: !0 },
1365
1365
  value: { type: String },
@@ -1373,9 +1373,9 @@ i(_, "formAssociated", !0), i(_, "properties", {
1373
1373
  variant: { type: String, reflect: !0 },
1374
1374
  required: { type: Boolean, reflect: !0 },
1375
1375
  disabled: { type: Boolean, reflect: !0 }
1376
- }), i(_, "styles", [
1377
- h,
1378
- d`
1376
+ }), i(S, "styles", [
1377
+ m,
1378
+ c`
1379
1379
  :host {
1380
1380
  display: block;
1381
1381
  }
@@ -1491,8 +1491,8 @@ i(_, "formAssociated", !0), i(_, "properties", {
1491
1491
  }
1492
1492
  `
1493
1493
  ]);
1494
- customElements.define("dgonmej-ui-textarea", _);
1495
- class w extends p {
1494
+ customElements.define("dgonmej-ui-textarea", S);
1495
+ class C extends p {
1496
1496
  constructor() {
1497
1497
  super(), this._internals = this.attachInternals(), this.checked = !1, this.disabled = !1, this.size = "medium";
1498
1498
  }
@@ -1517,14 +1517,14 @@ class w extends p {
1517
1517
  this.disabled || (this.checked = !this.checked, this.dispatchEvent(new CustomEvent("ui-change", { detail: { checked: this.checked }, bubbles: !0, composed: !0 })));
1518
1518
  }
1519
1519
  }
1520
- i(w, "formAssociated", !0), i(w, "properties", {
1520
+ i(C, "formAssociated", !0), i(C, "properties", {
1521
1521
  checked: { type: Boolean, reflect: !0 },
1522
1522
  disabled: { type: Boolean, reflect: !0 },
1523
1523
  name: { type: String, reflect: !0 },
1524
1524
  size: { type: String, reflect: !0 }
1525
- }), i(w, "styles", [
1526
- h,
1527
- d`
1525
+ }), i(C, "styles", [
1526
+ m,
1527
+ c`
1528
1528
  :host {
1529
1529
  --_w: 51px;
1530
1530
  --_t: 27px;
@@ -1619,8 +1619,8 @@ i(w, "formAssociated", !0), i(w, "properties", {
1619
1619
  }
1620
1620
  `
1621
1621
  ]);
1622
- customElements.define("dgonmej-ui-switch", w);
1623
- class k extends p {
1622
+ customElements.define("dgonmej-ui-switch", C);
1623
+ class E extends p {
1624
1624
  constructor() {
1625
1625
  super(), this._internals = this.attachInternals(), this.checked = !1, this.disabled = !1, this.value = "on";
1626
1626
  }
@@ -1646,14 +1646,14 @@ class k extends p {
1646
1646
  this.checked = e.target.checked, this.dispatchEvent(new CustomEvent("ui-change", { detail: { checked: this.checked }, bubbles: !0, composed: !0 }));
1647
1647
  }
1648
1648
  }
1649
- i(k, "formAssociated", !0), i(k, "properties", {
1649
+ i(E, "formAssociated", !0), i(E, "properties", {
1650
1650
  checked: { type: Boolean, reflect: !0 },
1651
1651
  disabled: { type: Boolean, reflect: !0 },
1652
1652
  name: { type: String, reflect: !0 },
1653
1653
  value: { type: String }
1654
- }), i(k, "styles", [
1655
- h,
1656
- d`
1654
+ }), i(E, "styles", [
1655
+ m,
1656
+ c`
1657
1657
  :host {
1658
1658
  display: inline-block;
1659
1659
  }
@@ -1735,11 +1735,11 @@ i(k, "formAssociated", !0), i(k, "properties", {
1735
1735
  }
1736
1736
  `
1737
1737
  ]);
1738
- customElements.define("dgonmej-ui-checkbox", k);
1739
- let ue = 0;
1740
- class $ extends p {
1738
+ customElements.define("dgonmej-ui-checkbox", E);
1739
+ let ye = 0;
1740
+ class M extends p {
1741
1741
  constructor() {
1742
- super(), this._internals = this.attachInternals(), this._name = `ui-radio-${++ue}`, this.label = "", this.value = "", this.options = [], this.disabled = !1;
1742
+ super(), this._internals = this.attachInternals(), this._name = `ui-radio-${++ye}`, this.label = "", this.value = "", this.options = [], this.disabled = !1;
1743
1743
  }
1744
1744
  updated(e) {
1745
1745
  e.has("value") && this._internals.setFormValue(this.value || null);
@@ -1776,15 +1776,15 @@ class $ extends p {
1776
1776
  this.value = e, this.dispatchEvent(new CustomEvent("ui-change", { detail: { value: e }, bubbles: !0, composed: !0 }));
1777
1777
  }
1778
1778
  }
1779
- i($, "formAssociated", !0), i($, "properties", {
1779
+ i(M, "formAssociated", !0), i(M, "properties", {
1780
1780
  label: { type: String },
1781
1781
  name: { type: String, reflect: !0 },
1782
1782
  value: { type: String },
1783
1783
  options: { type: Array },
1784
1784
  disabled: { type: Boolean, reflect: !0 }
1785
- }), i($, "styles", [
1786
- h,
1787
- d`
1785
+ }), i(M, "styles", [
1786
+ m,
1787
+ c`
1788
1788
  :host {
1789
1789
  display: block;
1790
1790
  }
@@ -1911,8 +1911,8 @@ i($, "formAssociated", !0), i($, "properties", {
1911
1911
  }
1912
1912
  `
1913
1913
  ]);
1914
- customElements.define("dgonmej-ui-radio-group", $);
1915
- class z extends p {
1914
+ customElements.define("dgonmej-ui-radio-group", M);
1915
+ class A extends p {
1916
1916
  constructor() {
1917
1917
  super(), this._internals = this.attachInternals(), this.label = "", this.value = "", this.options = [], this.variant = "neutral";
1918
1918
  }
@@ -1957,24 +1957,24 @@ class z extends p {
1957
1957
  const t = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 }[e.key];
1958
1958
  if (!t || !this.options.length) return;
1959
1959
  e.preventDefault();
1960
- const c = (Math.max(0, this.options.findIndex((m) => m.value === this.value)) + t + this.options.length) % this.options.length;
1961
- this._select(this.options[c].value), this.updateComplete.then(() => {
1962
- var m;
1963
- return (m = this.renderRoot.querySelectorAll("button")[c]) == null ? void 0 : m.focus();
1960
+ const d = (Math.max(0, this.options.findIndex((h) => h.value === this.value)) + t + this.options.length) % this.options.length;
1961
+ this._select(this.options[d].value), this.updateComplete.then(() => {
1962
+ var h;
1963
+ return (h = this.renderRoot.querySelectorAll("button")[d]) == null ? void 0 : h.focus();
1964
1964
  });
1965
1965
  }
1966
1966
  }
1967
- i(z, "formAssociated", !0), i(z, "properties", {
1967
+ i(A, "formAssociated", !0), i(A, "properties", {
1968
1968
  label: { type: String },
1969
1969
  name: { type: String, reflect: !0 },
1970
1970
  value: { type: String },
1971
1971
  options: { type: Array },
1972
1972
  size: { type: String, reflect: !0 },
1973
1973
  variant: { type: String, reflect: !0 }
1974
- }), i(z, "styles", [
1975
- h,
1976
- U,
1977
- d`
1974
+ }), i(A, "styles", [
1975
+ m,
1976
+ oe,
1977
+ c`
1978
1978
  :host {
1979
1979
  display: inline-block;
1980
1980
  max-width: 100%;
@@ -2067,11 +2067,11 @@ i(z, "formAssociated", !0), i(z, "properties", {
2067
2067
  }
2068
2068
  `
2069
2069
  ]);
2070
- customElements.define("dgonmej-ui-segmented-control", z);
2071
- let he = 0;
2072
- class v extends p {
2070
+ customElements.define("dgonmej-ui-segmented-control", A);
2071
+ let _e = 0;
2072
+ class b extends p {
2073
2073
  constructor() {
2074
- super(), this._id = `ui-dialog-${++he}`, this.open = !1, this.heading = "", this.description = "", this.lightDismiss = !1, this.size = "medium", this._returnValue = "";
2074
+ super(), this._id = `ui-dialog-${++_e}`, this.open = !1, this.heading = "", this.description = "", this.lightDismiss = !1, this.size = "medium", this._returnValue = "";
2075
2075
  }
2076
2076
  get _dialog() {
2077
2077
  return this.renderRoot.querySelector("dialog");
@@ -2132,8 +2132,8 @@ class v extends p {
2132
2132
  }
2133
2133
  _onClick(e) {
2134
2134
  const t = e.composedPath().find((r) => {
2135
- var c;
2136
- return r instanceof Element && ((c = r.hasAttribute) == null ? void 0 : c.call(r, "data-close"));
2135
+ var d;
2136
+ return r instanceof Element && ((d = r.hasAttribute) == null ? void 0 : d.call(r, "data-close"));
2137
2137
  });
2138
2138
  if (t) {
2139
2139
  this.close(t.getAttribute("data-close") || "");
@@ -2145,16 +2145,16 @@ class v extends p {
2145
2145
  }
2146
2146
  }
2147
2147
  }
2148
- i(v, "properties", {
2148
+ i(b, "properties", {
2149
2149
  open: { type: Boolean, reflect: !0 },
2150
2150
  heading: { type: String },
2151
2151
  description: { type: String },
2152
2152
  lightDismiss: { type: Boolean, attribute: "light-dismiss" },
2153
2153
  size: { type: String, reflect: !0 },
2154
2154
  inline: { type: Boolean, reflect: !0 }
2155
- }), i(v, "styles", [
2156
- h,
2157
- d`
2155
+ }), i(b, "styles", [
2156
+ m,
2157
+ c`
2158
2158
  dialog {
2159
2159
  box-sizing: border-box;
2160
2160
  width: min(420px, calc(100vw - 2 * var(--ui-space-4, 16px)));
@@ -2265,8 +2265,8 @@ i(v, "properties", {
2265
2265
  }
2266
2266
  `
2267
2267
  ]);
2268
- customElements.define("dgonmej-ui-dialog", v);
2269
- class ee extends v {
2268
+ customElements.define("dgonmej-ui-dialog", b);
2269
+ class se extends b {
2270
2270
  _renderGrabber() {
2271
2271
  return a`<div
2272
2272
  class="grabber"
@@ -2293,9 +2293,9 @@ class ee extends v {
2293
2293
  this._dragStartY = null, this._dialog.classList.remove("dragging"), this._dialog.style.removeProperty("--_drag"), t > 100 && this.close("dismiss");
2294
2294
  }
2295
2295
  }
2296
- i(ee, "styles", [
2297
- v.styles,
2298
- d`
2296
+ i(se, "styles", [
2297
+ b.styles,
2298
+ c`
2299
2299
  .grabber {
2300
2300
  display: none;
2301
2301
  }
@@ -2354,24 +2354,24 @@ i(ee, "styles", [
2354
2354
  }
2355
2355
  `
2356
2356
  ]);
2357
- customElements.define("dgonmej-ui-sheet", ee);
2358
- const me = { info: "info", success: "check-circle", warning: "warning", danger: "warning" };
2359
- let ge = 0;
2360
- class q extends p {
2357
+ customElements.define("dgonmej-ui-sheet", se);
2358
+ const we = { info: "info", success: "check-circle", warning: "warning", danger: "warning" };
2359
+ let ke = 0;
2360
+ class N extends p {
2361
2361
  constructor() {
2362
2362
  super(), this.placement = "top", this._items = [];
2363
2363
  }
2364
2364
  /** Muestra un aviso y devuelve una funcion para cerrarlo antes de tiempo. */
2365
2365
  show(e, { variant: t = "info", duration: r = 3500 } = {}) {
2366
- const c = ++ge;
2367
- return this._items = [...this._items, { id: c, message: e, variant: t, leaving: !1 }], r > 0 && setTimeout(() => this.dismiss(c), r), () => this.dismiss(c);
2366
+ const d = ++ke;
2367
+ return this._items = [...this._items, { id: d, message: e, variant: t, leaving: !1 }], r > 0 && setTimeout(() => this.dismiss(d), r), () => this.dismiss(d);
2368
2368
  }
2369
2369
  dismiss(e) {
2370
2370
  this._items.some((t) => t.id === e && !t.leaving) && (this._items = this._items.map((t) => t.id === e ? { ...t, leaving: !0 } : t));
2371
2371
  }
2372
2372
  render() {
2373
2373
  return a`
2374
- ${oe(
2374
+ ${he(
2375
2375
  this._items,
2376
2376
  (e) => e.id,
2377
2377
  (e) => a`
@@ -2382,7 +2382,7 @@ class q extends p {
2382
2382
  role=${e.variant === "danger" ? "alert" : "status"}
2383
2383
  @animationend=${() => e.leaving && this._remove(e.id)}
2384
2384
  >
2385
- ${u(me[e.variant] || "info", { size: 20 })}
2385
+ ${u(we[e.variant] || "info", { size: 20 })}
2386
2386
  <span class="message">${e.message}</span>
2387
2387
  <button class="close" type="button" aria-label=${l(this, "toast.close")} @click=${() => this.dismiss(e.id)}>
2388
2388
  ${u("xmark", { size: 14 })}
@@ -2396,13 +2396,13 @@ class q extends p {
2396
2396
  this._items = this._items.filter((t) => t.id !== e);
2397
2397
  }
2398
2398
  }
2399
- i(q, "properties", {
2399
+ i(N, "properties", {
2400
2400
  placement: { type: String, reflect: !0 },
2401
2401
  _items: { state: !0 }
2402
- }), i(q, "styles", [
2403
- h,
2404
- S,
2405
- d`
2402
+ }), i(N, "styles", [
2403
+ m,
2404
+ P,
2405
+ c`
2406
2406
  :host {
2407
2407
  position: fixed;
2408
2408
  z-index: 1000;
@@ -2530,8 +2530,8 @@ i(q, "properties", {
2530
2530
  }
2531
2531
  `
2532
2532
  ]);
2533
- customElements.define("dgonmej-ui-toast", q);
2534
- class I extends p {
2533
+ customElements.define("dgonmej-ui-toast", N);
2534
+ class O extends p {
2535
2535
  constructor() {
2536
2536
  super(), this.value = void 0, this.max = 100, this.label = "", this.showValue = !1, this.tone = "accent", this.size = "regular";
2537
2537
  }
@@ -2557,16 +2557,16 @@ class I extends p {
2557
2557
  `;
2558
2558
  }
2559
2559
  }
2560
- i(I, "properties", {
2560
+ i(O, "properties", {
2561
2561
  value: { type: Number },
2562
2562
  max: { type: Number },
2563
2563
  label: { type: String },
2564
2564
  showValue: { type: Boolean, attribute: "show-value" },
2565
2565
  tone: { type: String, reflect: !0 },
2566
2566
  size: { type: String, reflect: !0 }
2567
- }), i(I, "styles", [
2568
- h,
2569
- d`
2567
+ }), i(O, "styles", [
2568
+ m,
2569
+ c`
2570
2570
  :host {
2571
2571
  display: block;
2572
2572
  }
@@ -2651,19 +2651,19 @@ i(I, "properties", {
2651
2651
  }
2652
2652
  `
2653
2653
  ]);
2654
- customElements.define("dgonmej-ui-progress", I);
2655
- const ve = "--ui-spinner-angle", te = typeof CSS < "u" && "registerProperty" in CSS;
2656
- if (te)
2654
+ customElements.define("dgonmej-ui-progress", O);
2655
+ const $e = "--ui-spinner-angle", ne = typeof CSS < "u" && "registerProperty" in CSS;
2656
+ if (ne)
2657
2657
  try {
2658
- CSS.registerProperty({ name: ve, syntax: "<angle>", inherits: !1, initialValue: "0deg" });
2658
+ CSS.registerProperty({ name: $e, syntax: "<angle>", inherits: !1, initialValue: "0deg" });
2659
2659
  } catch {
2660
2660
  }
2661
- class B extends p {
2661
+ class F extends p {
2662
2662
  constructor() {
2663
2663
  super(), this.size = "medium", this.tone = "accent", this.label = "";
2664
2664
  }
2665
2665
  connectedCallback() {
2666
- super.connectedCallback(), this.toggleAttribute("fallback", !te);
2666
+ super.connectedCallback(), this.toggleAttribute("fallback", !ne);
2667
2667
  }
2668
2668
  render() {
2669
2669
  return a`
@@ -2674,13 +2674,13 @@ class B extends p {
2674
2674
  `;
2675
2675
  }
2676
2676
  }
2677
- i(B, "properties", {
2677
+ i(F, "properties", {
2678
2678
  size: { type: String, reflect: !0 },
2679
2679
  tone: { type: String, reflect: !0 },
2680
2680
  label: { type: String }
2681
- }), i(B, "styles", [
2682
- h,
2683
- d`
2681
+ }), i(F, "styles", [
2682
+ m,
2683
+ c`
2684
2684
  :host {
2685
2685
  --_size: 24px;
2686
2686
  --_stroke: 3px;
@@ -2767,14 +2767,14 @@ i(B, "properties", {
2767
2767
  }
2768
2768
  `
2769
2769
  ]);
2770
- customElements.define("dgonmej-ui-spinner", B);
2771
- let fe = 0;
2772
- class j extends p {
2770
+ customElements.define("dgonmej-ui-spinner", F);
2771
+ let ze = 0;
2772
+ class X extends p {
2773
2773
  constructor() {
2774
- super(), this._id = `ui-menu-${++fe}`, this.items = [], this.placement = "bottom-start", this.label = "", this.open = !1, this._onDocPointer = this._onDocPointer.bind(this);
2774
+ super(), this._id = `ui-menu-${++ze}`, this.items = [], this.placement = "bottom-start", this.label = "", this.open = !1, this._onDocPointer = this._onDocPointer.bind(this);
2775
2775
  }
2776
2776
  disconnectedCallback() {
2777
- super.disconnectedCallback(), document.removeEventListener("pointerdown", this._onDocPointer, !0);
2777
+ super.disconnectedCallback(), document.removeEventListener("pointerdown", this._onDocPointer, !0), window.removeEventListener("scroll", this._reposition, { capture: !0 }), window.removeEventListener("resize", this._reposition);
2778
2778
  }
2779
2779
  get _trigger() {
2780
2780
  var e;
@@ -2783,21 +2783,37 @@ class j extends p {
2783
2783
  get _menuItems() {
2784
2784
  return [...this.renderRoot.querySelectorAll('[role="menuitem"]:not(:disabled)')];
2785
2785
  }
2786
+ get _popover() {
2787
+ return typeof HTMLElement < "u" && "showPopover" in HTMLElement.prototype;
2788
+ }
2789
+ connectedCallback() {
2790
+ super.connectedCallback(), this._reposition = () => this.open && this._place(this.renderRoot.querySelector(".menu"));
2791
+ }
2786
2792
  updated(e) {
2787
2793
  const t = this._trigger;
2788
2794
  if (t && ("expanded" in t ? (t.haspopup = "menu", t.expanded = String(this.open)) : (t.setAttribute("aria-haspopup", "menu"), t.setAttribute("aria-expanded", String(this.open)))), e.has("open")) {
2789
2795
  const r = this.renderRoot.querySelector(".menu");
2790
2796
  if (clearTimeout(this._hideTimer), this.open)
2791
- r.hidden = !1, this._fitInViewport(r), document.addEventListener("pointerdown", this._onDocPointer, !0), this._focusItem(0);
2797
+ this._popover ? (r.matches(":popover-open") || r.showPopover(), this._place(r), window.addEventListener("scroll", this._reposition, { capture: !0, passive: !0 }), window.addEventListener("resize", this._reposition, { passive: !0 })) : (r.hidden = !1, this._fitInViewport(r)), document.addEventListener("pointerdown", this._onDocPointer, !0), this._focusItem(0);
2792
2798
  else {
2793
- document.removeEventListener("pointerdown", this._onDocPointer, !0);
2794
- const c = parseFloat(getComputedStyle(r).transitionDuration.split(",").pop()) * 1e3 || 0;
2799
+ document.removeEventListener("pointerdown", this._onDocPointer, !0), window.removeEventListener("scroll", this._reposition, { capture: !0 }), window.removeEventListener("resize", this._reposition);
2800
+ const d = parseFloat(getComputedStyle(r).transitionDuration.split(",").pop()) * 1e3 || 0;
2795
2801
  this._hideTimer = setTimeout(() => {
2796
- this.open || (r.hidden = !0);
2797
- }, c);
2802
+ this.open || (this._popover ? r.matches(":popover-open") && r.hidePopover() : r.hidden = !0);
2803
+ }, d);
2798
2804
  }
2799
2805
  }
2800
2806
  }
2807
+ /** Coloca el menu (posicion fija) junto al disparador, dentro de la pantalla. */
2808
+ _place(e) {
2809
+ const t = (this._trigger || this).getBoundingClientRect(), r = e.offsetWidth, d = e.offsetHeight, h = 6, g = 8, x = document.documentElement.clientWidth, v = window.innerHeight, [T, ee] = (this.placement || "bottom-start").split("-"), y = t.bottom + h, _ = t.top - h - d;
2810
+ let w = T === "top" ? _ : y;
2811
+ T !== "top" && y + d > v - g && _ >= g && (w = _), T === "top" && _ < g && y + d <= v - g && (w = y);
2812
+ let q = ee === "end" ? t.right - r : t.left;
2813
+ q = Math.min(Math.max(q, g), x - g - r);
2814
+ const de = w < t.top ? "bottom" : "top";
2815
+ e.style.right = "auto", e.style.bottom = "auto", e.style.top = `${Math.round(w)}px`, e.style.left = `${Math.round(q)}px`, e.style.transformOrigin = `${de} ${ee === "end" ? "right" : "left"}`;
2816
+ }
2801
2817
  _fitInViewport(e) {
2802
2818
  e.classList.remove("flip-x");
2803
2819
  const t = e.getBoundingClientRect(), r = 8;
@@ -2810,7 +2826,8 @@ class j extends p {
2810
2826
  id=${this._id}
2811
2827
  class="menu material"
2812
2828
  part="menu"
2813
- hidden
2829
+ popover=${this._popover ? "manual" : ue}
2830
+ ?hidden=${!this._popover}
2814
2831
  role="menu"
2815
2832
  aria-label=${this.label || l(this, "menu.label")}
2816
2833
  @keydown=${this._onKeydown}
@@ -2860,15 +2877,15 @@ class j extends p {
2860
2877
  e.composedPath().includes(this) || this._close({ focusTrigger: !1 });
2861
2878
  }
2862
2879
  }
2863
- i(j, "properties", {
2880
+ i(X, "properties", {
2864
2881
  items: { type: Array },
2865
2882
  placement: { type: String, reflect: !0 },
2866
2883
  label: { type: String },
2867
2884
  open: { type: Boolean, reflect: !0 }
2868
- }), i(j, "styles", [
2869
- h,
2870
- S,
2871
- d`
2885
+ }), i(X, "styles", [
2886
+ m,
2887
+ P,
2888
+ c`
2872
2889
  :host {
2873
2890
  position: relative;
2874
2891
  display: inline-block;
@@ -2897,6 +2914,16 @@ i(j, "properties", {
2897
2914
  display: none;
2898
2915
  }
2899
2916
 
2917
+ /* Con Popover API: capa superior y posicion fija calculada al abrir (top/left en linea) */
2918
+ .menu[popover] {
2919
+ position: fixed;
2920
+ inset: auto;
2921
+ margin: 0;
2922
+ border: 0;
2923
+ overflow: visible;
2924
+ color: inherit;
2925
+ }
2926
+
2900
2927
  /* Si no cabe por su lado, se alinea por el contrario */
2901
2928
  .menu.flip-x {
2902
2929
  left: auto;
@@ -3001,8 +3028,8 @@ i(j, "properties", {
3001
3028
  }
3002
3029
  `
3003
3030
  ]);
3004
- customElements.define("dgonmej-ui-menu", j);
3005
- class L extends p {
3031
+ customElements.define("dgonmej-ui-menu", X);
3032
+ class Y extends p {
3006
3033
  constructor() {
3007
3034
  super(), this.elevation = "raised", this.layout = "vertical", this.padding = "regular", this.glass = !1, this.interactive = !1, this._filled = {};
3008
3035
  }
@@ -3023,7 +3050,7 @@ class L extends p {
3023
3050
  this._filled[t] !== r && (this._filled = { ...this._filled, [t]: r });
3024
3051
  }
3025
3052
  }
3026
- i(L, "properties", {
3053
+ i(Y, "properties", {
3027
3054
  elevation: { type: String, reflect: !0 },
3028
3055
  layout: { type: String, reflect: !0 },
3029
3056
  padding: { type: String, reflect: !0 },
@@ -3032,9 +3059,9 @@ i(L, "properties", {
3032
3059
  href: { type: String },
3033
3060
  target: { type: String },
3034
3061
  _filled: { state: !0 }
3035
- }), i(L, "styles", [
3036
- h,
3037
- d`
3062
+ }), i(Y, "styles", [
3063
+ m,
3064
+ c`
3038
3065
  :host {
3039
3066
  --_pad: var(--ui-space-5, 20px);
3040
3067
  display: block;
@@ -3179,8 +3206,8 @@ i(L, "properties", {
3179
3206
  }
3180
3207
  `
3181
3208
  ]);
3182
- customElements.define("dgonmej-ui-card", L);
3183
- class V extends p {
3209
+ customElements.define("dgonmej-ui-card", Y);
3210
+ class H extends p {
3184
3211
  constructor() {
3185
3212
  super(), this.items = [], this.emptyText = "", this.variant = "inset", this.hideChevron = !1;
3186
3213
  }
@@ -3210,12 +3237,12 @@ class V extends p {
3210
3237
  this.dispatchEvent(new CustomEvent("ui-select", { detail: e, bubbles: !0, composed: !0 }));
3211
3238
  }
3212
3239
  }
3213
- i(V, "properties", {
3240
+ i(H, "properties", {
3214
3241
  items: { type: Array },
3215
3242
  emptyText: { type: String, attribute: "empty-text" },
3216
3243
  variant: { type: String, reflect: !0 },
3217
3244
  hideChevron: { type: Boolean, attribute: "hide-chevron", reflect: !0 }
3218
- }), i(V, "styles", d`
3245
+ }), i(H, "styles", c`
3219
3246
  :host {
3220
3247
  display: block;
3221
3248
  font-family: var(--ui-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif);
@@ -3352,8 +3379,8 @@ i(V, "properties", {
3352
3379
  }
3353
3380
  }
3354
3381
  `);
3355
- customElements.define("dgonmej-ui-list", V);
3356
- class N extends p {
3382
+ customElements.define("dgonmej-ui-list", H);
3383
+ class K extends p {
3357
3384
  constructor() {
3358
3385
  super(), this.columns = [], this.rows = [], this.emptyText = "", this.label = "", this.density = "regular", this.striped = !1;
3359
3386
  }
@@ -3380,14 +3407,14 @@ class N extends p {
3380
3407
  `;
3381
3408
  }
3382
3409
  }
3383
- i(N, "properties", {
3410
+ i(K, "properties", {
3384
3411
  columns: { type: Array },
3385
3412
  rows: { type: Array },
3386
3413
  emptyText: { type: String, attribute: "empty-text" },
3387
3414
  label: { type: String },
3388
3415
  density: { type: String, reflect: !0 },
3389
3416
  striped: { type: Boolean, reflect: !0 }
3390
- }), i(N, "styles", d`
3417
+ }), i(K, "styles", c`
3391
3418
  :host {
3392
3419
  display: block;
3393
3420
  font-family: var(--ui-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif);
@@ -3476,8 +3503,8 @@ i(N, "properties", {
3476
3503
  }
3477
3504
  }
3478
3505
  `);
3479
- customElements.define("dgonmej-ui-table", N);
3480
- class R extends p {
3506
+ customElements.define("dgonmej-ui-table", K);
3507
+ class G extends p {
3481
3508
  constructor() {
3482
3509
  super(), this.index = 0, this.label = "", this._count = 0, this._pointerStartX = null, this.autoplay = 0, this._userPaused = !1, this._hoverPaused = !1;
3483
3510
  }
@@ -3605,13 +3632,13 @@ class R extends p {
3605
3632
  this._pointerStartX = null;
3606
3633
  }
3607
3634
  }
3608
- i(R, "properties", {
3635
+ i(G, "properties", {
3609
3636
  index: { type: Number },
3610
3637
  label: { type: String },
3611
3638
  autoplay: { type: Number },
3612
3639
  _count: { state: !0 },
3613
3640
  _userPaused: { state: !0 }
3614
- }), i(R, "styles", d`
3641
+ }), i(G, "styles", c`
3615
3642
  :host {
3616
3643
  display: block;
3617
3644
  /* No imponer el ancho de las diapositivas a su contenedor */
@@ -3773,8 +3800,8 @@ i(R, "properties", {
3773
3800
  }
3774
3801
  }
3775
3802
  `);
3776
- customElements.define("dgonmej-ui-carousel", R);
3777
- class O extends p {
3803
+ customElements.define("dgonmej-ui-carousel", G);
3804
+ class W extends p {
3778
3805
  constructor() {
3779
3806
  super(), this.heading = "", this.large = !1, this._scrolled = !1, this._onScroll = this._onScroll.bind(this);
3780
3807
  }
@@ -3806,15 +3833,15 @@ class O extends p {
3806
3833
  `;
3807
3834
  }
3808
3835
  }
3809
- i(O, "properties", {
3836
+ i(W, "properties", {
3810
3837
  heading: { type: String },
3811
3838
  large: { type: Boolean, reflect: !0 },
3812
3839
  scrollTarget: { type: String, attribute: "scroll-target" },
3813
3840
  _scrolled: { state: !0 }
3814
- }), i(O, "styles", [
3815
- h,
3816
- S,
3817
- d`
3841
+ }), i(W, "styles", [
3842
+ m,
3843
+ P,
3844
+ c`
3818
3845
  :host {
3819
3846
  position: sticky;
3820
3847
  top: 0;
@@ -3930,8 +3957,8 @@ i(O, "properties", {
3930
3957
  }
3931
3958
  `
3932
3959
  ]);
3933
- customElements.define("dgonmej-ui-nav-bar", O);
3934
- class F extends p {
3960
+ customElements.define("dgonmej-ui-nav-bar", W);
3961
+ class Z extends p {
3935
3962
  constructor() {
3936
3963
  super(), this.value = "", this.items = [], this.label = "", this.fixed = !1, this.iconOnly = !1;
3937
3964
  }
@@ -3965,17 +3992,17 @@ class F extends p {
3965
3992
  e !== this.value && (this.value = e, this.dispatchEvent(new CustomEvent("ui-change", { detail: { value: e }, bubbles: !0, composed: !0 })));
3966
3993
  }
3967
3994
  }
3968
- i(F, "properties", {
3995
+ i(Z, "properties", {
3969
3996
  value: { type: String },
3970
3997
  items: { type: Array },
3971
3998
  label: { type: String },
3972
3999
  fixed: { type: Boolean, reflect: !0 },
3973
4000
  iconOnly: { type: Boolean, attribute: "icon-only", reflect: !0 }
3974
- }), i(F, "styles", [
3975
- h,
3976
- S,
3977
- U,
3978
- d`
4001
+ }), i(Z, "styles", [
4002
+ m,
4003
+ P,
4004
+ oe,
4005
+ c`
3979
4006
  :host {
3980
4007
  display: flex;
3981
4008
  justify-content: center;
@@ -4064,8 +4091,8 @@ i(F, "properties", {
4064
4091
  }
4065
4092
  `
4066
4093
  ]);
4067
- customElements.define("dgonmej-ui-tab-bar", F);
4068
- const be = {
4094
+ customElements.define("dgonmej-ui-tab-bar", Z);
4095
+ const Se = {
4069
4096
  education: "graduation",
4070
4097
  work: "briefcase",
4071
4098
  travel: "plane",
@@ -4073,7 +4100,7 @@ const be = {
4073
4100
  start: "flag",
4074
4101
  end: "rocket"
4075
4102
  };
4076
- class X extends p {
4103
+ class D extends p {
4077
4104
  constructor() {
4078
4105
  super(), this.items = [], this.label = "", this.layout = "alternate", this.static = !1;
4079
4106
  }
@@ -4083,8 +4110,8 @@ class X extends p {
4083
4110
  const e = (t = window.matchMedia) == null ? void 0 : t.call(window, "(prefers-reduced-motion: reduce)").matches;
4084
4111
  "IntersectionObserver" in window && !e && !this.hasAttribute("static") && (this.setAttribute("animate", ""), this._observer = new IntersectionObserver(
4085
4112
  (r) => {
4086
- r.forEach((c) => {
4087
- c.isIntersecting && (c.target.classList.add("in"), this._observer.unobserve(c.target));
4113
+ r.forEach((d) => {
4114
+ d.isIntersecting && (d.target.classList.add("in"), this._observer.unobserve(d.target));
4088
4115
  });
4089
4116
  },
4090
4117
  { rootMargin: "0px 0px -10% 0px", threshold: 0.1 }
@@ -4102,8 +4129,8 @@ class X extends p {
4102
4129
  return a`
4103
4130
  <ol part="timeline" aria-label=${this.label || l(this, "timeline.label")}>
4104
4131
  ${this.items.map((t) => {
4105
- var G, Z;
4106
- const r = be[t.kind] || (t.milestone ? "star" : "calendar");
4132
+ var g, x;
4133
+ const r = Se[t.kind] || (t.milestone ? "star" : "calendar");
4107
4134
  if (t.milestone)
4108
4135
  return a`
4109
4136
  <li class="item milestone" part="item">
@@ -4117,9 +4144,9 @@ class X extends p {
4117
4144
  </div>
4118
4145
  </li>
4119
4146
  `;
4120
- const c = e++ % 2 === 0 ? "right" : "left", m = this.layout === "alternate" ? t.side || c : this.layout;
4147
+ const d = e++ % 2 === 0 ? "right" : "left", h = this.layout === "alternate" ? t.side || d : this.layout;
4121
4148
  return a`
4122
- <li class="item ${m} ${t.current ? "current" : ""}" part="item" aria-current=${t.current ? "step" : "false"}>
4149
+ <li class="item ${h} ${t.current ? "current" : ""}" part="item" aria-current=${t.current ? "step" : "false"}>
4123
4150
  <span class="marker" part="marker">${u(r, { size: 18 })}</span>
4124
4151
  <article class="card" part="card">
4125
4152
  <span class="period">
@@ -4127,11 +4154,11 @@ class X extends p {
4127
4154
  </span>
4128
4155
  <h3>${t.title}</h3>
4129
4156
  ${t.description ? a`<p>${t.description}</p>` : ""}
4130
- ${(G = t.highlights) != null && G.length ? a`<ul>${t.highlights.map((f) => a`<li>${f}</li>`)}</ul>` : ""}
4131
- ${(Z = t.links) != null && Z.length ? a`<div class="links">
4157
+ ${(g = t.highlights) != null && g.length ? a`<ul>${t.highlights.map((v) => a`<li>${v}</li>`)}</ul>` : ""}
4158
+ ${(x = t.links) != null && x.length ? a`<div class="links">
4132
4159
  ${t.links.map(
4133
- (f) => a`<a href=${f.href} target="_blank" rel="noopener noreferrer">
4134
- ${u("link", { size: 14 })}${f.label}
4160
+ (v) => a`<a href=${v.href} target="_blank" rel="noopener noreferrer">
4161
+ ${u("link", { size: 14 })}${v.label}
4135
4162
  </a>`
4136
4163
  )}
4137
4164
  </div>` : ""}
@@ -4143,14 +4170,14 @@ class X extends p {
4143
4170
  `;
4144
4171
  }
4145
4172
  }
4146
- i(X, "properties", {
4173
+ i(D, "properties", {
4147
4174
  items: { type: Array },
4148
4175
  label: { type: String },
4149
4176
  layout: { type: String, reflect: !0 },
4150
4177
  static: { type: Boolean, reflect: !0 }
4151
- }), i(X, "styles", [
4152
- h,
4153
- d`
4178
+ }), i(D, "styles", [
4179
+ m,
4180
+ c`
4154
4181
  :host {
4155
4182
  display: block;
4156
4183
  container-type: inline-size;
@@ -4454,9 +4481,9 @@ i(X, "properties", {
4454
4481
  }
4455
4482
  `
4456
4483
  ]);
4457
- customElements.define("dgonmej-ui-timeline", X);
4458
- const b = (o) => Number.isFinite(o) ? `${Math.floor(o / 60)}:${String(Math.floor(o % 60)).padStart(2, "0")}` : "0:00";
4459
- class Y extends p {
4484
+ customElements.define("dgonmej-ui-timeline", D);
4485
+ const k = (o) => Number.isFinite(o) ? `${Math.floor(o / 60)}:${String(Math.floor(o % 60)).padStart(2, "0")}` : "0:00";
4486
+ class Q extends p {
4460
4487
  constructor() {
4461
4488
  super(), this.src = "", this.heading = "", this.subheading = "", this.artwork = "", this.live = !1, this.variant = "card", this._state = "idle", this._volume = 1, this._muted = !1, this._time = 0, this._duration = NaN;
4462
4489
  }
@@ -4482,7 +4509,7 @@ class Y extends p {
4482
4509
  }
4483
4510
  }
4484
4511
  render() {
4485
- const e = this._state === "playing", t = this._state === "loading", r = `${(this._muted ? 0 : this._volume) * 100}%`, c = this._duration ? `${this._time / this._duration * 100}%` : "0%";
4512
+ const e = this._state === "playing", t = this._state === "loading", r = `${(this._muted ? 0 : this._volume) * 100}%`, d = this._duration ? `${this._time / this._duration * 100}%` : "0%";
4486
4513
  return a`
4487
4514
  <div class="player" part="player" style=${n(this.artwork ? `--_art: url("${this.artwork}")` : void 0)}>
4488
4515
  <div class="backdrop" aria-hidden="true"></div>
@@ -4513,12 +4540,12 @@ class Y extends p {
4513
4540
  max=${this._duration || 0}
4514
4541
  step="1"
4515
4542
  .value=${String(this._time)}
4516
- style="--_pct: ${c}"
4543
+ style="--_pct: ${d}"
4517
4544
  aria-label=${l(this, "player.position")}
4518
- aria-valuetext=${l(this, "player.positionText", { time: b(this._time), total: b(this._duration) })}
4545
+ aria-valuetext=${l(this, "player.positionText", { time: k(this._time), total: k(this._duration) })}
4519
4546
  @input=${this._seek}
4520
4547
  />
4521
- <div class="times"><span>${b(this._time)}</span><span>${b(this._duration)}</span></div>
4548
+ <div class="times"><span>${k(this._time)}</span><span>${k(this._duration)}</span></div>
4522
4549
  </div>`}
4523
4550
  <div class="volume">
4524
4551
  <button
@@ -4550,8 +4577,8 @@ class Y extends p {
4550
4577
  @pause=${this._onPause}
4551
4578
  @waiting=${() => this._state = "loading"}
4552
4579
  @error=${this._fail}
4553
- @timeupdate=${(m) => this._time = m.target.currentTime}
4554
- @durationchange=${(m) => this._duration = m.target.duration}
4580
+ @timeupdate=${(h) => this._time = h.target.currentTime}
4581
+ @durationchange=${(h) => this._duration = h.target.duration}
4555
4582
  ></audio>
4556
4583
  </div>
4557
4584
  `;
@@ -4582,7 +4609,7 @@ class Y extends p {
4582
4609
  }), navigator.mediaSession.setActionHandler("play", () => this.toggle()), navigator.mediaSession.setActionHandler("pause", () => this._audio.pause()));
4583
4610
  }
4584
4611
  }
4585
- i(Y, "properties", {
4612
+ i(Q, "properties", {
4586
4613
  src: { type: String },
4587
4614
  heading: { type: String },
4588
4615
  subheading: { type: String },
@@ -4594,9 +4621,9 @@ i(Y, "properties", {
4594
4621
  _muted: { state: !0 },
4595
4622
  _time: { state: !0 },
4596
4623
  _duration: { state: !0 }
4597
- }), i(Y, "styles", [
4598
- h,
4599
- d`
4624
+ }), i(Q, "styles", [
4625
+ m,
4626
+ c`
4600
4627
  :host {
4601
4628
  display: block;
4602
4629
  container-type: inline-size;
@@ -4907,33 +4934,33 @@ i(Y, "properties", {
4907
4934
  }
4908
4935
  `
4909
4936
  ]);
4910
- customElements.define("dgonmej-ui-audio-player", Y);
4911
- const ae = "dgonmej-ui-theme", g = ["system", "light", "dark"], Q = { system: "circle-half", light: "sun", dark: "moon" }, H = /* @__PURE__ */ new Set(), xe = () => {
4937
+ customElements.define("dgonmej-ui-audio-player", Q);
4938
+ const le = "dgonmej-ui-theme", f = ["system", "light", "dark"], ae = { system: "circle-half", light: "sun", dark: "moon" }, J = /* @__PURE__ */ new Set(), Ce = () => {
4912
4939
  try {
4913
- const o = localStorage.getItem(ae);
4914
- return g.includes(o) ? o : "system";
4940
+ const o = localStorage.getItem(le);
4941
+ return f.includes(o) ? o : "system";
4915
4942
  } catch {
4916
4943
  return "system";
4917
4944
  }
4918
4945
  };
4919
- function W(o) {
4946
+ function re(o) {
4920
4947
  const e = document.documentElement;
4921
4948
  o === "system" ? e.removeAttribute("data-theme") : e.setAttribute("data-theme", o);
4922
4949
  try {
4923
- localStorage.setItem(ae, o);
4950
+ localStorage.setItem(le, o);
4924
4951
  } catch {
4925
4952
  }
4926
- H.forEach((t) => t.theme = o);
4953
+ J.forEach((t) => t.theme = o);
4927
4954
  }
4928
- class K extends p {
4955
+ class U extends p {
4929
4956
  constructor() {
4930
- super(), this.variant = "segmented", this.theme = xe(), this.compact = !1;
4957
+ super(), this.variant = "segmented", this.theme = Ce(), this.compact = !1;
4931
4958
  }
4932
4959
  connectedCallback() {
4933
- super.connectedCallback(), H.add(this), W(this.theme);
4960
+ super.connectedCallback(), J.add(this), re(this.theme);
4934
4961
  }
4935
4962
  disconnectedCallback() {
4936
- super.disconnectedCallback(), H.delete(this);
4963
+ super.disconnectedCallback(), J.delete(this);
4937
4964
  }
4938
4965
  render() {
4939
4966
  return this.variant === "button" ? a`
@@ -4943,14 +4970,14 @@ class K extends p {
4943
4970
  label=${l(this, "theme.change", { theme: l(this, `theme.${this.theme}`) })}
4944
4971
  @ui-click=${this._cycle}
4945
4972
  >
4946
- ${u(Q[this.theme], { size: 20 })}
4973
+ ${u(ae[this.theme], { size: 20 })}
4947
4974
  </dgonmej-ui-button>
4948
4975
  ` : a`
4949
4976
  <dgonmej-ui-segmented-control
4950
4977
  size="small"
4951
4978
  label=${l(this, "theme.label")}
4952
4979
  .value=${this.theme}
4953
- .options=${g.map((e) => ({ value: e, label: l(this, `theme.${e}`), icon: Q[e], hideLabel: this.compact }))}
4980
+ .options=${f.map((e) => ({ value: e, label: l(this, `theme.${e}`), icon: ae[e], hideLabel: this.compact }))}
4954
4981
  @ui-change=${this._onSegment}
4955
4982
  ></dgonmej-ui-segmented-control>
4956
4983
  `;
@@ -4959,52 +4986,52 @@ class K extends p {
4959
4986
  e.stopPropagation(), this._set(e.detail.value);
4960
4987
  }
4961
4988
  _cycle(e) {
4962
- e.stopPropagation(), this._set(g[(g.indexOf(this.theme) + 1) % g.length]);
4989
+ e.stopPropagation(), this._set(f[(f.indexOf(this.theme) + 1) % f.length]);
4963
4990
  }
4964
4991
  _set(e) {
4965
- W(e), this.dispatchEvent(new CustomEvent("ui-change", { detail: { theme: e }, bubbles: !0, composed: !0 }));
4992
+ re(e), this.dispatchEvent(new CustomEvent("ui-change", { detail: { theme: e }, bubbles: !0, composed: !0 }));
4966
4993
  }
4967
4994
  }
4968
- i(K, "properties", {
4995
+ i(U, "properties", {
4969
4996
  variant: { type: String, reflect: !0 },
4970
4997
  theme: { type: String },
4971
4998
  compact: { type: Boolean, reflect: !0 }
4972
- }), i(K, "styles", [
4973
- h,
4974
- d`
4999
+ }), i(U, "styles", [
5000
+ m,
5001
+ c`
4975
5002
  :host {
4976
5003
  display: inline-block;
4977
5004
  }
4978
5005
  `
4979
5006
  ]);
4980
- customElements.define("dgonmej-ui-theme-toggle", K);
5007
+ customElements.define("dgonmej-ui-theme-toggle", U);
4981
5008
  export {
4982
- Y as DgonmejUiAudioPlayer,
4983
- T as DgonmejUiAvatar,
4984
- A as DgonmejUiBadge,
4985
- M as DgonmejUiButton,
4986
- L as DgonmejUiCard,
4987
- R as DgonmejUiCarousel,
4988
- k as DgonmejUiCheckbox,
4989
- v as DgonmejUiDialog,
4990
- E as DgonmejUiIcon,
4991
- V as DgonmejUiList,
4992
- j as DgonmejUiMenu,
4993
- O as DgonmejUiNavBar,
4994
- I as DgonmejUiProgress,
4995
- $ as DgonmejUiRadioGroup,
4996
- z as DgonmejUiSegmentedControl,
4997
- y as DgonmejUiSelect,
4998
- ee as DgonmejUiSheet,
4999
- B as DgonmejUiSpinner,
5000
- w as DgonmejUiSwitch,
5001
- F as DgonmejUiTabBar,
5002
- N as DgonmejUiTable,
5003
- x as DgonmejUiTextField,
5004
- _ as DgonmejUiTextarea,
5005
- K as DgonmejUiThemeToggle,
5006
- X as DgonmejUiTimeline,
5007
- q as DgonmejUiToast,
5008
- W as applyTheme,
5009
- $e as iconNames
5009
+ Q as DgonmejUiAudioPlayer,
5010
+ V as DgonmejUiAvatar,
5011
+ j as DgonmejUiBadge,
5012
+ L as DgonmejUiButton,
5013
+ Y as DgonmejUiCard,
5014
+ G as DgonmejUiCarousel,
5015
+ E as DgonmejUiCheckbox,
5016
+ b as DgonmejUiDialog,
5017
+ B as DgonmejUiIcon,
5018
+ H as DgonmejUiList,
5019
+ X as DgonmejUiMenu,
5020
+ W as DgonmejUiNavBar,
5021
+ O as DgonmejUiProgress,
5022
+ M as DgonmejUiRadioGroup,
5023
+ A as DgonmejUiSegmentedControl,
5024
+ z as DgonmejUiSelect,
5025
+ se as DgonmejUiSheet,
5026
+ F as DgonmejUiSpinner,
5027
+ C as DgonmejUiSwitch,
5028
+ Z as DgonmejUiTabBar,
5029
+ K as DgonmejUiTable,
5030
+ $ as DgonmejUiTextField,
5031
+ S as DgonmejUiTextarea,
5032
+ U as DgonmejUiThemeToggle,
5033
+ D as DgonmejUiTimeline,
5034
+ N as DgonmejUiToast,
5035
+ re as applyTheme,
5036
+ Te as iconNames
5010
5037
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dgonmej-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Apple-inspired web components built with Lit. Framework-agnostic, themeable with design tokens, dark mode and accessibility built in.",
5
5
  "license": "MIT",
6
6
  "author": "Diego González",
@@ -38,7 +38,8 @@
38
38
  "scripts": {
39
39
  "dev": "vite",
40
40
  "build": "vite build",
41
- "prepare": "vite build"
41
+ "prepare": "vite build",
42
+ "build:demo": "vite build --config vite.demo.config.js"
42
43
  },
43
44
  "dependencies": {
44
45
  "lit": "^3.2.0"