@wrrdev/fenix-ui 1.1.1 → 1.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.
@@ -4139,7 +4139,8 @@ _FxDialog.styles = css`
4139
4139
  border: 1px solid var(--fx-border-default);
4140
4140
  border-radius: var(--fx-radius-lg);
4141
4141
  box-shadow: var(--fx-shadow-xl);
4142
- width: min(560px, calc(100vw - 32px));
4142
+ /* Largura customizável por instância: defina --fx-dialog-width no elemento. */
4143
+ width: min(var(--fx-dialog-width, 560px), calc(100vw - 32px));
4143
4144
  max-height: calc(100vh - 64px);
4144
4145
  display: flex;
4145
4146
  flex-direction: column;
@@ -4147,8 +4148,15 @@ _FxDialog.styles = css`
4147
4148
  animation: pop var(--fx-motion-duration-normal) var(--fx-motion-easing);
4148
4149
  }
4149
4150
  @keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
4150
- :host([size='sm']) .dialog { width: min(400px, calc(100vw - 32px)); }
4151
- :host([size='lg']) .dialog { width: min(800px, calc(100vw - 32px)); }
4151
+ :host([size='sm']) .dialog { width: min(var(--fx-dialog-width, 400px), calc(100vw - 32px)); }
4152
+ :host([size='lg']) .dialog { width: min(var(--fx-dialog-width, 800px), calc(100vw - 32px)); }
4153
+ /* Mobile: dialog ocupa praticamente toda a largura da tela. */
4154
+ @media (max-width: 640px) {
4155
+ .dialog, :host([size='sm']) .dialog, :host([size='lg']) .dialog {
4156
+ width: calc(100vw - 16px);
4157
+ max-width: calc(100vw - 16px);
4158
+ }
4159
+ }
4152
4160
  header {
4153
4161
  display: flex;
4154
4162
  align-items: center;
@@ -4825,6 +4833,14 @@ const _FxSlider = class _FxSlider extends FxElement {
4825
4833
  this._bindPointer();
4826
4834
  this._bindKeyboard();
4827
4835
  }
4836
+ disconnectedCallback() {
4837
+ super.disconnectedCallback();
4838
+ if (this._dragging) {
4839
+ this._dragging = false;
4840
+ if (this._onMove) window.removeEventListener("pointermove", this._onMove);
4841
+ if (this._onUp) window.removeEventListener("pointerup", this._onUp);
4842
+ }
4843
+ }
4828
4844
  _wrap() {
4829
4845
  return this.root.querySelector(".track-wrap");
4830
4846
  }
@@ -4844,6 +4860,7 @@ const _FxSlider = class _FxSlider extends FxElement {
4844
4860
  new CustomEvent("input", { bubbles: true, composed: true, detail: { value: this.value } })
4845
4861
  );
4846
4862
  };
4863
+ this._onMove = move;
4847
4864
  const up = (e) => {
4848
4865
  if (!this._dragging) return;
4849
4866
  this._dragging = false;
@@ -4856,6 +4873,7 @@ const _FxSlider = class _FxSlider extends FxElement {
4856
4873
  new CustomEvent("change", { bubbles: true, composed: true, detail: { value: this.value } })
4857
4874
  );
4858
4875
  };
4876
+ this._onUp = up;
4859
4877
  wrap.addEventListener("pointerdown", (e) => {
4860
4878
  if (this.hasAttr("disabled")) return;
4861
4879
  this._dragging = true;
@@ -6314,8 +6332,11 @@ const _FxTimeline = class _FxTimeline extends FxElement {
6314
6332
  time ? `<span class="time">${esc(time)}</span>` : "",
6315
6333
  title ? `<span class="title">${esc(title)}</span>` : ""
6316
6334
  ].join("");
6317
- return `<li class="event" part="event"><span class="dot" part="marker" aria-hidden="true">${esc(marker)}</span><div class="head">${head}</div><div class="content">${item.innerHTML}</div></li>`;
6335
+ const icon = item.getAttribute("icon");
6336
+ const dot = icon ? `<span class="dot fx-icon" part="marker" aria-hidden="true">${esc(icon)}</span>` : `<span class="dot" part="marker" aria-hidden="true">${esc(marker)}</span>`;
6337
+ return `<li class="event" part="event">${dot}<div class="head">${head}</div><div class="content">${item.innerHTML}</div></li>`;
6318
6338
  }).join("");
6339
+ if (items.some((item) => item.hasAttribute("icon"))) void __vitePreload(() => import("./fenix-ui2.esm.js"), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url);
6319
6340
  }
6320
6341
  connectedCallback() {
6321
6342
  super.connectedCallback();
@@ -6334,10 +6355,10 @@ _FxTimeline.styles = css`
6334
6355
  display: block;
6335
6356
  font-family: var(--fx-font-family);
6336
6357
  font-size: var(--fx-font-size);
6337
- --_marker: calc(var(--fx-font-size) - 1px);
6358
+ --_marker: calc(var(--fx-font-size) + 6px);
6338
6359
  }
6339
- :host([size='sm']) { --_marker: calc(var(--fx-font-size) - 3px); }
6340
- :host([size='lg']) { --_marker: calc(var(--fx-font-size) + 2px); }
6360
+ :host([size='sm']) { --_marker: calc(var(--fx-font-size) - 2px); }
6361
+ :host([size='lg']) { --_marker: calc(var(--fx-font-size) + 14px); }
6341
6362
 
6342
6363
  .tl {
6343
6364
  list-style: none;
@@ -6370,10 +6391,22 @@ _FxTimeline.styles = css`
6370
6391
  display: inline-flex;
6371
6392
  align-items: center;
6372
6393
  justify-content: center;
6373
- font-size: calc(var(--_marker) * 0.55);
6394
+ font-size: calc(var(--_marker) * 0.5);
6374
6395
  color: var(--fx-color-primary);
6375
6396
  line-height: 1;
6376
6397
  }
6398
+ /* marcador com ícone da fonte Fenix Icons (atributo icon no item) */
6399
+ .dot.fx-icon {
6400
+ font-family: var(--fx-icon-font, 'Fenix Icons');
6401
+ font-weight: normal;
6402
+ font-style: normal;
6403
+ font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
6404
+ -webkit-font-smoothing: antialiased;
6405
+ user-select: none;
6406
+ background: color-mix(in srgb, var(--fx-color-primary) 14%, transparent);
6407
+ border-radius: 50%;
6408
+ font-size: calc(var(--_marker) * 0.55);
6409
+ }
6377
6410
  .head {
6378
6411
  display: flex;
6379
6412
  align-items: baseline;
@@ -6749,7 +6782,24 @@ const KIND_ICON = {
6749
6782
  info: "i"
6750
6783
  };
6751
6784
  const CARD_CSS = `
6752
- :host { display: contents; }
6785
+ :host { display: contents; pointer-events: auto; }
6786
+ /* Modo explícito: sobrepõe os tokens herdados do tema global SOMENTE neste card. */
6787
+ :host([mode='dark']) {
6788
+ --fx-surface-background: #1e293b;
6789
+ --fx-text-default: #f1f5f9;
6790
+ --fx-text-muted: #94a3b8;
6791
+ --fx-border-default: #334155;
6792
+ --fx-shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
6793
+ --fx-surface-surface-hover: rgba(255, 255, 255, .08);
6794
+ }
6795
+ :host([mode='light']) {
6796
+ --fx-surface-background: #ffffff;
6797
+ --fx-text-default: #1e293b;
6798
+ --fx-text-muted: #64748b;
6799
+ --fx-border-default: #e2e8f0;
6800
+ --fx-shadow-lg: 0 10px 30px rgba(0, 0, 0, .14);
6801
+ --fx-surface-surface-hover: rgba(0, 0, 0, .05);
6802
+ }
6753
6803
  .fx-icon {
6754
6804
  font-family: var(--fx-icon-font, 'Fenix Icons');
6755
6805
  font-weight: normal;
@@ -6804,7 +6854,16 @@ class FxToast extends HTMLElement {
6804
6854
  this.attachShadow({ mode: "open" });
6805
6855
  }
6806
6856
  static get observedAttributes() {
6807
- return ["kind", "title", "message", "duration", "icon"];
6857
+ return ["kind", "title", "message", "duration", "icon", "mode"];
6858
+ }
6859
+ /** Esquema de cores forçado do card: 'light' | 'dark' | undefined (segue o tema). */
6860
+ get mode() {
6861
+ const m = this.getAttribute("mode");
6862
+ return m === "light" || m === "dark" ? m : void 0;
6863
+ }
6864
+ set mode(value) {
6865
+ if (value) this.setAttribute("mode", value);
6866
+ else this.removeAttribute("mode");
6808
6867
  }
6809
6868
  connectedCallback() {
6810
6869
  if (!this.shadowRoot.firstChild) __privateMethod(this, _FxToast_instances, render_fn).call(this);
@@ -6876,9 +6935,6 @@ function regionFor(position) {
6876
6935
  style.gap = "8px";
6877
6936
  style.zIndex = "1100";
6878
6937
  style.pointerEvents = "none";
6879
- new MutationObserver(() => {
6880
- region.querySelectorAll("*").forEach((c) => c.style.pointerEvents = "auto");
6881
- }).observe(region, { childList: true });
6882
6938
  document.body.appendChild(region);
6883
6939
  }
6884
6940
  return region;
@@ -6902,6 +6958,7 @@ class ToastApi {
6902
6958
  if (message) el.setAttribute("message", message);
6903
6959
  el.setAttribute("position", o.position ?? "top-right");
6904
6960
  el.setAttribute("duration", String(o.duration ?? 4e3));
6961
+ if (o.mode) el.setAttribute("mode", o.mode);
6905
6962
  regionFor(o.position ?? "top-right").appendChild(el);
6906
6963
  this.map.set(id, el);
6907
6964
  return id;
@@ -10103,6 +10160,7 @@ const _FxAccordionPanel = class _FxAccordionPanel extends FxElement {
10103
10160
  disconnectedCallback() {
10104
10161
  this._mo?.disconnect();
10105
10162
  this._mo = null;
10163
+ super.disconnectedCallback();
10106
10164
  }
10107
10165
  render() {
10108
10166
  this.setTemplate(`