@thibezer/ui-components-kit 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/LICENSE +21 -21
  3. package/README.md +150 -14
  4. package/dist/botao.cjs +1 -1
  5. package/dist/botao.js +1 -1
  6. package/dist/camadas.cjs +65 -65
  7. package/dist/camadas.js +762 -729
  8. package/dist/campo-texto.cjs +1 -1
  9. package/dist/campo-texto.js +1 -1
  10. package/dist/canvas.cjs +105 -146
  11. package/dist/canvas.js +5132 -1199
  12. package/dist/card.cjs +1 -1
  13. package/dist/card.js +1 -1
  14. package/dist/components/ui-botao/ui-botao.d.ts +15 -0
  15. package/dist/components/ui-camadas/camadas-persistencia.d.ts +4 -0
  16. package/dist/components/ui-camadas/ui-camadas.d.ts +10 -0
  17. package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +5 -0
  18. package/dist/components/ui-canvas-cad/cad-estilos-externos.d.ts +16 -0
  19. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +4 -0
  20. package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +262 -0
  21. package/dist/components/ui-canvas-cad/cad-ferramentas-barra.d.ts +15 -0
  22. package/dist/components/ui-canvas-cad/cad-snap.d.ts +32 -0
  23. package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +1 -0
  24. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +143 -0
  25. package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +2 -0
  26. package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +1 -0
  27. package/dist/components/ui-modal/modal-pilha.d.ts +3 -0
  28. package/dist/components/ui-modal/ui-modal.d.ts +19 -4
  29. package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +3 -0
  30. package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +3 -0
  31. package/dist/components/ui-tabela/tabela-corpo.d.ts +2 -0
  32. package/dist/components/ui-tabela/tabela-localizador.d.ts +8 -1
  33. package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +4 -0
  34. package/dist/components/ui-tabela/tabela-renderizador.d.ts +1 -0
  35. package/dist/components/ui-tabela/tabela-selecao.d.ts +21 -6
  36. package/dist/components/ui-tabela/tipos.d.ts +6 -0
  37. package/dist/components/ui-tabela/ui-tabela.d.ts +56 -2
  38. package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +0 -5
  39. package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +17 -1
  40. package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +2 -0
  41. package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +10 -1
  42. package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +3 -1
  43. package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +5 -1
  44. package/dist/components/ui-tooltip/ui-tooltip.d.ts +15 -0
  45. package/dist/core/alvo-digitavel.d.ts +1 -0
  46. package/dist/core/form-submissao.d.ts +16 -0
  47. package/dist/core/index.d.ts +1 -0
  48. package/dist/core/parts.d.ts +6 -0
  49. package/dist/core/rotulo.d.ts +6 -0
  50. package/dist/core/svg-seguro.d.ts +10 -0
  51. package/dist/core/ui-bus.d.ts +13 -2
  52. package/dist/core.cjs +1 -1
  53. package/dist/core.js +14 -12
  54. package/dist/custom-elements.json +32905 -0
  55. package/dist/data.cjs +1 -1
  56. package/dist/data.js +51 -46
  57. package/dist/feedback.cjs +1 -1
  58. package/dist/feedback.js +3 -3
  59. package/dist/form-submissao-C-SPRKgT.js +61 -0
  60. package/dist/form-submissao-DxKO5MHI.cjs +1 -0
  61. package/dist/forms.cjs +1 -1
  62. package/dist/forms.js +2 -2
  63. package/dist/gerencigeo-canvas/canvas_interacao.d.ts +18 -0
  64. package/dist/gerencigeo-canvas/feature_adapters.d.ts +35 -0
  65. package/dist/gerencigeo-canvas/feature_algoritmos.d.ts +45 -0
  66. package/dist/gerencigeo-canvas/feature_amostra.d.ts +4 -0
  67. package/dist/gerencigeo-canvas/feature_caixa.d.ts +19 -0
  68. package/dist/gerencigeo-canvas/feature_cluster.d.ts +61 -0
  69. package/dist/gerencigeo-canvas/feature_cursores.d.ts +17 -0
  70. package/dist/gerencigeo-canvas/feature_desenho.d.ts +53 -0
  71. package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +91 -0
  72. package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +19 -0
  73. package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +62 -0
  74. package/dist/gerencigeo-canvas/feature_formas.d.ts +7 -0
  75. package/dist/gerencigeo-canvas/feature_hud.d.ts +23 -0
  76. package/dist/gerencigeo-canvas/feature_indice.d.ts +36 -0
  77. package/dist/gerencigeo-canvas/feature_metricas.d.ts +16 -0
  78. package/dist/gerencigeo-canvas/feature_popup.d.ts +31 -0
  79. package/dist/gerencigeo-canvas/feature_selecao.d.ts +38 -0
  80. package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +14 -0
  81. package/dist/gerencigeo-canvas/feature_snap.d.ts +25 -0
  82. package/dist/gerencigeo-canvas/feature_types.d.ts +86 -0
  83. package/dist/gerencigeo-canvas/feature_versoes.d.ts +19 -0
  84. package/dist/gerencigeo-canvas/index.d.ts +21 -0
  85. package/dist/gerencigeo-canvas/layer_hit_test.d.ts +30 -0
  86. package/dist/gerencigeo-canvas/layer_manager.d.ts +11 -3
  87. package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +9 -0
  88. package/dist/gerencigeo-canvas/mapa_controller.d.ts +1 -0
  89. package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +24 -5
  90. package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +89 -0
  91. package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +1 -0
  92. package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +2 -2
  93. package/dist/gerencigeo-canvas/types.d.ts +12 -0
  94. package/dist/gerencigeo-canvas/utils.d.ts +3 -1
  95. package/dist/index.cjs +1 -1
  96. package/dist/index.d.ts +2 -2
  97. package/dist/index.js +117 -112
  98. package/dist/leaflet-DcO7uRC-.cjs +1 -0
  99. package/dist/{leaflet-DkaFZYc5.js → leaflet-PPDKB6Dd.js} +37 -37
  100. package/dist/mapa.cjs +4 -4
  101. package/dist/mapa.js +2 -2
  102. package/dist/modal.cjs +1 -1
  103. package/dist/modal.js +1 -1
  104. package/dist/parts-CaoQiCfI.js +7 -0
  105. package/dist/parts-vQa2873h.cjs +1 -0
  106. package/dist/register.cjs +1 -1
  107. package/dist/register.js +12 -12
  108. package/dist/seletor-mapa-base.cjs +16 -16
  109. package/dist/seletor-mapa-base.js +111 -61
  110. package/dist/svg-seguro-BsbNQqpd.js +50 -0
  111. package/dist/svg-seguro-C76iLlAZ.cjs +1 -0
  112. package/dist/tabela.cjs +1 -1
  113. package/dist/tabela.js +41 -36
  114. package/dist/tipos-elementos.d.ts +1232 -0
  115. package/dist/tipos-react.d.ts +113 -0
  116. package/dist/tipos-vue.d.ts +1201 -0
  117. package/dist/tools.cjs +1 -1
  118. package/dist/tools.js +1 -1
  119. package/dist/ui-badge-BxT-sDmV.cjs +28 -0
  120. package/dist/ui-badge-C0eKBI8E.js +183 -0
  121. package/dist/ui-botao-OGJV6Vfk.js +165 -0
  122. package/dist/ui-botao-psS1juof.cjs +12 -0
  123. package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
  124. package/dist/{ui-campo-texto-B_JF6POq.js → ui-campo-texto-Uu2dJE_0.js} +81 -63
  125. package/dist/{ui-card-Bhm6k91e.cjs → ui-card-B86lJXTP.cjs} +7 -7
  126. package/dist/{ui-card-BJ8SmvVf.js → ui-card-C_o5_0cB.js} +14 -14
  127. package/dist/ui-kit.css +1 -1
  128. package/dist/ui-modal-CvGFGh1h.cjs +18 -0
  129. package/dist/ui-modal-DBOtSTbR.js +238 -0
  130. package/dist/{ui-paleta-ferramentas-Bpp4XBVg.js → ui-paleta-ferramentas-CEZYcN4J.js} +18 -27
  131. package/dist/{ui-paleta-ferramentas-B6dJ0O6K.cjs → ui-paleta-ferramentas-Dbj1kBS9.cjs} +6 -6
  132. package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
  133. package/dist/{ui-segmented-C8wuycjJ.js → ui-segmented-wUraId2e.js} +68 -67
  134. package/dist/ui-skeleton-DI4_9WOX.js +428 -0
  135. package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
  136. package/dist/{ui-switch-CO9MoS8x.js → ui-switch-BcOqOkiV.js} +92 -62
  137. package/dist/ui-switch-D7iPKDj-.cjs +53 -0
  138. package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
  139. package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
  140. package/dist/{ui-toast-CwUmiqyG.js → ui-toast-Bp_NlM5G.js} +51 -51
  141. package/dist/ui-toast-DGTZKne5.cjs +20 -0
  142. package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
  143. package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
  144. package/package.json +27 -7
  145. package/dist/leaflet-Cw6tqYFh.cjs +0 -1
  146. package/dist/ui-badge-92yelKls.js +0 -183
  147. package/dist/ui-badge-B95jSECC.cjs +0 -28
  148. package/dist/ui-botao-BShEouvi.js +0 -124
  149. package/dist/ui-botao-DF1yuUUD.cjs +0 -12
  150. package/dist/ui-campo-texto-BCh5HyCM.cjs +0 -16
  151. package/dist/ui-modal-Bi4isGYh.cjs +0 -18
  152. package/dist/ui-modal-DV-pw2x1.js +0 -194
  153. package/dist/ui-segmented-NC5cBXLh.cjs +0 -19
  154. package/dist/ui-skeleton-B3xQyn0Z.js +0 -396
  155. package/dist/ui-skeleton-D42oQufF.cjs +0 -33
  156. package/dist/ui-switch-C6o4yZUF.cjs +0 -53
  157. package/dist/ui-tabela-propriedades-7yJ9g7ti.cjs +0 -145
  158. package/dist/ui-tabela-propriedades-D-XKNVwK.js +0 -2078
  159. package/dist/ui-toast-CQBqvUm3.cjs +0 -20
  160. package/dist/zero-js-triggers-DdESy0tk.js +0 -205
  161. package/dist/zero-js-triggers-QGD7FOTv.cjs +0 -1
@@ -1,45 +1,45 @@
1
- var h = Object.defineProperty;
2
- var m = (r, o, t) => o in r ? h(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
3
- var i = (r, o, t) => m(r, typeof o != "symbol" ? o + "" : o, t);
4
- import { L as f } from "./listener-bag-DQgv7OON.js";
5
- import { d as c, S as p } from "./ssr-safe-5cWfJP-s.js";
6
- const b = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-alerta{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ui-raio-borda, 8px);border:1px solid transparent;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;position:relative;transition:opacity .2s ease,transform .2s ease;line-height:1.4}.ui-alerta__icone{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;line-height:1}.ui-alerta__icone svg,.ui-alerta__icone ::slotted(svg),.ui-alerta__icone ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-alerta__conteudo{flex:1}.ui-alerta__titulo{font-size:14px;font-weight:600;margin:0 0 2px;line-height:1.2}.ui-alerta__mensagem{font-size:13px;margin:0;opacity:.9}.ui-alerta__close{background:transparent;border:none;color:currentColor;opacity:.7;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:4px;line-height:1;flex-shrink:0;margin-top:-2px;margin-right:-4px;transition:opacity .15s ease,background-color .15s ease}.ui-alerta__close:hover{opacity:1;background-color:#ffffff26}.ui-alerta--sucesso{background-color:#00e08a1f;border-color:#00e08a4d;color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-alerta--sucesso .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--erro{background-color:#ff55551f;border-color:#ff55554d;color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta--erro .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--alerta{background-color:#ffb86c1f;border-color:#ffb86c4d;color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-alerta--alerta .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--info{background-color:#00aaff1f;border-color:#00aaff4d;color:#0af}.ui-alerta--info .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta__acoes{display:flex;align-items:center;flex-shrink:0;margin-left:4px}.ui-alerta__botao-acao{background:#ffffff14;border:1px solid rgba(255,255,255,.16);color:inherit;font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:5px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,transform .1s ease}.ui-alerta__botao-acao:hover{background:#ffffff2e;border-color:#ffffff4d}.ui-alerta__botao-acao:active{transform:scale(.96)}.ui-alerta__botao-acao:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario{background:#00e08a26;border-color:#00e08a59;color:var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario:hover{background:#00e08a40;border-color:#00e08a80}.ui-alerta__botao-acao--destrutivo{background:#ff444426;border-color:#ff444459;color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta__botao-acao--destrutivo:hover{background:#ff444440;border-color:#ff444480}:host(ui-toast){display:block;width:100%;box-sizing:border-box;pointer-events:auto;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease}.ui-toast__banner{box-shadow:0 10px 32px #000000a6,0 0 0 1px #ffffff14;animation:ui-toast-slide .3s cubic-bezier(.16,1,.3,1);position:relative;overflow:hidden}.ui-toast__progresso{position:absolute;bottom:0;left:0;right:0;height:2px;background:#ffffff14;overflow:hidden}.ui-toast__progresso-barra{width:100%;height:100%;background:currentColor;opacity:.7;transform-origin:left;animation:ui-toast-timer linear forwards}:host(ui-toast:hover) .ui-toast__progresso-barra,:host(ui-toast:focus-within) .ui-toast__progresso-barra{animation-play-state:paused}@keyframes ui-toast-timer{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes ui-toast-slide{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@starting-style{:host(ui-toast){opacity:0;transform:translateY(12px) scale(.96)}}', l = {
1
+ var d = Object.defineProperty;
2
+ var p = (i, a, t) => a in i ? d(i, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[a] = t;
3
+ var r = (i, a, t) => p(i, typeof a != "symbol" ? a + "" : a, t);
4
+ import { L as h } from "./listener-bag-DQgv7OON.js";
5
+ import { d as c, S as b } from "./ssr-safe-5cWfJP-s.js";
6
+ const f = ':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-alerta{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ui-raio-borda, 8px);border:1px solid transparent;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;position:relative;transition:opacity .2s ease,transform .2s ease;line-height:1.4}.ui-alerta__icone{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;line-height:1}.ui-alerta__icone svg,.ui-alerta__icone ::slotted(svg),.ui-alerta__icone ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-alerta__conteudo{flex:1}.ui-alerta__titulo{font-size:14px;font-weight:600;margin:0 0 2px;line-height:1.2}.ui-alerta__mensagem{font-size:13px;margin:0;opacity:.9}.ui-alerta__close{background:transparent;border:none;color:currentColor;opacity:.7;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:var(--ui-raio-sm, 4px);line-height:1;flex-shrink:0;margin-top:-2px;margin-right:-4px;transition:opacity .15s ease,background-color .15s ease}.ui-alerta__close:hover{opacity:1;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent)}.ui-alerta--sucesso{background-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 30%,transparent);color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-alerta--sucesso .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--erro{background-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 30%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta--erro .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--alerta{background-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 30%,transparent);color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-alerta--alerta .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--info{background-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 30%,transparent);color:var(--ui-cor-texto-info, #33b5ff)}.ui-alerta--info .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta__acoes{display:flex;align-items:center;flex-shrink:0;margin-left:4px}.ui-alerta__botao-acao{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent);color:inherit;font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:5px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,transform .1s ease}.ui-alerta__botao-acao:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-alerta__botao-acao:active{transform:scale(.96)}.ui-alerta__botao-acao:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 35%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario:hover{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 50%,transparent)}.ui-alerta__botao-acao--destrutivo{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 35%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta__botao-acao--destrutivo:hover{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 50%,transparent)}:host(ui-toast){display:block;width:100%;box-sizing:border-box;pointer-events:auto;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease}.ui-toast__banner{box-shadow:var(--ui-sombra-lg, 0 10px 30px rgba(0, 0, 0, .3)),0 0 0 1px var(--ui-cor-borda, rgba(255, 255, 255, .1));animation:ui-toast-slide .3s cubic-bezier(.16,1,.3,1);position:relative;overflow:hidden;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}.ui-toast__banner.ui-alerta--sucesso{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-sucesso, #00E08A) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 40%,transparent)}.ui-toast__banner.ui-alerta--erro{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-erro, #ff5555) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 40%,transparent)}.ui-toast__banner.ui-alerta--alerta{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-alerta, #ffb86c) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 40%,transparent)}.ui-toast__banner.ui-alerta--info{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-info, #33b5ff) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 40%,transparent)}.ui-toast__progresso{position:absolute;bottom:0;left:0;right:0;height:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);overflow:hidden}.ui-toast__progresso-barra{width:100%;height:100%;background:currentColor;opacity:.7;transform-origin:left;animation:ui-toast-timer linear forwards}:host(ui-toast:hover) .ui-toast__progresso-barra,:host(ui-toast:focus-within) .ui-toast__progresso-barra{animation-play-state:paused}@keyframes ui-toast-timer{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes ui-toast-slide{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@starting-style{:host(ui-toast){opacity:0;transform:translateY(12px) scale(.96)}}', l = {
7
7
  sucesso: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',
8
8
  erro: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',
9
9
  alerta: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',
10
10
  info: '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>'
11
11
  };
12
- class u extends p {
12
+ class u extends b {
13
13
  constructor() {
14
14
  super();
15
- i(this, "alertaElement");
16
- i(this, "iconeElement");
17
- i(this, "tituloElement");
18
- i(this, "mensagemElement");
19
- i(this, "mensagemTextoElement");
20
- i(this, "closeElement");
21
- i(this, "acoesElement");
22
- i(this, "botaoAcaoElement");
23
- i(this, "progressoContainer");
24
- i(this, "progressoBarra");
25
- i(this, "listeners", new f());
15
+ r(this, "alertaElement");
16
+ r(this, "iconeElement");
17
+ r(this, "tituloElement");
18
+ r(this, "mensagemElement");
19
+ r(this, "mensagemTextoElement");
20
+ r(this, "closeElement");
21
+ r(this, "acoesElement");
22
+ r(this, "botaoAcaoElement");
23
+ r(this, "progressoContainer");
24
+ r(this, "progressoBarra");
25
+ r(this, "listeners", new h());
26
26
  const t = this.attachShadow({ mode: "open" });
27
27
  t.innerHTML = `
28
- <style>${b}</style>
29
- <div class="ui-alerta" role="alert">
30
- <span class="ui-alerta__icone"></span>
31
- <div class="ui-alerta__conteudo">
32
- <h4 class="ui-alerta__titulo" style="display: none;"></h4>
33
- <p class="ui-alerta__mensagem">
28
+ <style>${f}</style>
29
+ <div class="ui-alerta" part="base" role="alert">
30
+ <span class="ui-alerta__icone" part="icone"></span>
31
+ <div class="ui-alerta__conteudo" part="conteudo">
32
+ <h4 class="ui-alerta__titulo" part="titulo" style="display: none;"></h4>
33
+ <p class="ui-alerta__mensagem" part="mensagem">
34
34
  <span class="ui-alerta__mensagem-texto" style="display: none;"></span>
35
35
  <slot></slot>
36
36
  </p>
37
37
  </div>
38
38
  <div class="ui-alerta__acoes" style="display: none;">
39
- <button type="button" class="ui-alerta__botao-acao"></button>
39
+ <button type="button" class="ui-alerta__botao-acao" part="acao"></button>
40
40
  </div>
41
- <button class="ui-alerta__close" type="button" aria-label="Fechar alerta" style="display: none;" title="Fechar">✕</button>
42
- <div class="ui-toast__progresso" style="display: none;">
41
+ <button class="ui-alerta__close" part="fechar" type="button" aria-label="Fechar alerta" style="display: none;" title="Fechar">✕</button>
42
+ <div class="ui-toast__progresso" part="progresso" style="display: none;">
43
43
  <div class="ui-toast__progresso-barra"></div>
44
44
  </div>
45
45
  </div>
@@ -63,7 +63,7 @@ class u extends p {
63
63
  disconnectedCallback() {
64
64
  this.listeners.cleanup();
65
65
  }
66
- attributeChangedCallback(t, a, e) {
66
+ attributeChangedCallback(t, o, e) {
67
67
  this.syncState();
68
68
  }
69
69
  fechar() {
@@ -75,25 +75,25 @@ class u extends p {
75
75
  ), this.remove();
76
76
  }
77
77
  syncState() {
78
- const t = this.getAttribute("tipo") || this.getAttribute("variante") || this.getAttribute("variant") || "info", a = this.getAttribute("titulo") || this.getAttribute("title"), e = this.getAttribute("mensagem"), s = this.hasAttribute("fechavel") || this.hasAttribute("dismissible");
78
+ const t = this.getAttribute("tipo") || this.getAttribute("variante") || this.getAttribute("variant") || "info", o = this.getAttribute("titulo") || this.getAttribute("title"), e = this.getAttribute("mensagem"), s = this.hasAttribute("fechavel") || this.hasAttribute("dismissible");
79
79
  this.alertaElement.className = `ui-alerta ui-alerta--${t}`;
80
- const d = l[t] || l.info;
81
- this.iconeElement.innerHTML = d, a ? (this.tituloElement.textContent = a, this.tituloElement.style.display = "block") : (this.tituloElement.style.display = "none", this.tituloElement.textContent = ""), e ? (this.mensagemTextoElement.textContent = e, this.mensagemTextoElement.style.display = "inline") : (this.mensagemTextoElement.style.display = "none", this.mensagemTextoElement.textContent = ""), s ? this.closeElement.style.display = "block" : this.closeElement.style.display = "none";
80
+ const m = l[t] || l.info;
81
+ this.iconeElement.innerHTML = m, o ? (this.tituloElement.textContent = o, this.tituloElement.style.display = "block") : (this.tituloElement.style.display = "none", this.tituloElement.textContent = ""), e ? (this.mensagemTextoElement.textContent = e, this.mensagemTextoElement.style.display = "inline") : (this.mensagemTextoElement.style.display = "none", this.mensagemTextoElement.textContent = ""), s ? this.closeElement.style.display = "block" : this.closeElement.style.display = "none";
82
82
  }
83
83
  }
84
84
  c("ui-alerta", u);
85
85
  class n extends u {
86
86
  constructor() {
87
87
  super(...arguments);
88
- i(this, "timerId", null);
89
- i(this, "tempoRestante", 4e3);
90
- i(this, "inicioTimestamp", 0);
91
- i(this, "isPausado", !1);
92
- i(this, "acaoConfig");
93
- i(this, "containerRef", null);
94
- i(this, "handleAcaoClick", (t) => {
95
- var a, e, s;
96
- t.stopPropagation(), (a = this.acaoConfig) != null && a.onClick && this.acaoConfig.onClick(t), this.dispatchEvent(
88
+ r(this, "timerId", null);
89
+ r(this, "tempoRestante", 4e3);
90
+ r(this, "inicioTimestamp", 0);
91
+ r(this, "isPausado", !1);
92
+ r(this, "acaoConfig");
93
+ r(this, "containerRef", null);
94
+ r(this, "handleAcaoClick", (t) => {
95
+ var o, e, s;
96
+ t.stopPropagation(), (o = this.acaoConfig) != null && o.onClick && this.acaoConfig.onClick(t), this.dispatchEvent(
97
97
  new CustomEvent("ui-toast-acao", {
98
98
  detail: {
99
99
  rotulo: (e = this.acaoConfig) == null ? void 0 : e.rotulo,
@@ -104,25 +104,25 @@ class n extends u {
104
104
  })
105
105
  ), this.fechar();
106
106
  });
107
- i(this, "pausarTimer", () => {
107
+ r(this, "pausarTimer", () => {
108
108
  if (this.isPausado || this.tempoRestante <= 0) return;
109
109
  this.isPausado = !0, this.timerId && (clearTimeout(this.timerId), this.timerId = null);
110
110
  const t = Date.now() - this.inicioTimestamp;
111
111
  this.tempoRestante = Math.max(0, this.tempoRestante - t), this.progressoBarra.style.animationPlayState = "paused";
112
112
  });
113
- i(this, "retomarTimer", () => {
113
+ r(this, "retomarTimer", () => {
114
114
  !this.isPausado || this.tempoRestante <= 0 || (this.isPausado = !1, this.progressoBarra.style.animationPlayState = "running", this.iniciarTimer(Math.max(this.tempoRestante, 300)));
115
115
  });
116
116
  }
117
117
  configurarAcao(t) {
118
118
  this.acaoConfig = t, this.botaoAcaoElement.textContent = t.rotulo, this.acoesElement.style.display = "flex";
119
- const a = t.tipo || "primario";
120
- this.botaoAcaoElement.className = `ui-alerta__botao-acao ui-alerta__botao-acao--${a}`;
119
+ const o = t.tipo || "primario";
120
+ this.botaoAcaoElement.className = `ui-alerta__botao-acao ui-alerta__botao-acao--${o}`;
121
121
  }
122
122
  connectedCallback() {
123
123
  super.connectedCallback(), this.containerRef = this.parentElement, this.alertaElement.classList.add("ui-toast__banner"), this.acaoConfig && this.listeners.add(this.botaoAcaoElement, "click", this.handleAcaoClick);
124
- const t = this.getAttribute("duracao") || this.getAttribute("duration") || "4000", a = parseInt(t, 10);
125
- this.tempoRestante = isNaN(a) ? 4e3 : a, this.tempoRestante > 0 ? (this.progressoContainer.style.display = "block", this.progressoBarra.style.animationDuration = `${this.tempoRestante}ms`, this.getAttribute("pausar-no-hover") !== "false" && (this.listeners.add(this, "mouseenter", this.pausarTimer), this.listeners.add(this, "mouseleave", this.retomarTimer), this.listeners.add(this, "focusin", this.pausarTimer), this.listeners.add(this, "focusout", this.retomarTimer)), this.iniciarTimer(this.tempoRestante)) : this.progressoContainer.style.display = "none";
124
+ const t = this.getAttribute("duracao") || this.getAttribute("duration") || "4000", o = parseInt(t, 10);
125
+ this.tempoRestante = isNaN(o) ? 4e3 : o, this.tempoRestante > 0 ? (this.progressoContainer.style.display = "block", this.progressoBarra.style.animationDuration = `${this.tempoRestante}ms`, this.getAttribute("pausar-no-hover") !== "false" && (this.listeners.add(this, "mouseenter", this.pausarTimer), this.listeners.add(this, "mouseleave", this.retomarTimer), this.listeners.add(this, "focusin", this.pausarTimer), this.listeners.add(this, "focusout", this.retomarTimer)), this.iniciarTimer(this.tempoRestante)) : this.progressoContainer.style.display = "none";
126
126
  }
127
127
  fechar() {
128
128
  const t = this.parentElement || this.containerRef;
@@ -137,15 +137,15 @@ class n extends u {
137
137
  }, t);
138
138
  }
139
139
  static obterContainer(t) {
140
- const a = `ui-toast-container-${t}`;
141
- let e = document.getElementById(a);
142
- return e || (e = document.createElement("div"), e.id = a, e.style.position = "fixed", e.style.setProperty("z-index", "var(--ui-z-toast, 1100)"), e.style.display = "flex", e.style.gap = "10px", e.style.maxWidth = "400px", e.style.width = "calc(100vw - 32px)", e.style.pointerEvents = "none", e.style.boxSizing = "border-box", e.style.transition = "all 0.2s ease", t === "top-right" ? (e.style.top = "20px", e.style.right = "20px", e.style.flexDirection = "column") : t === "top-left" ? (e.style.top = "20px", e.style.left = "20px", e.style.flexDirection = "column") : t === "bottom-left" ? (e.style.bottom = "20px", e.style.left = "20px", e.style.flexDirection = "column-reverse") : t === "top-center" ? (e.style.top = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column") : t === "bottom-center" ? (e.style.bottom = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column-reverse") : (e.style.bottom = "20px", e.style.right = "20px", e.style.flexDirection = "column-reverse"), document.body.appendChild(e)), e;
140
+ const o = `ui-toast-container-${t}`;
141
+ let e = document.getElementById(o);
142
+ return e || (e = document.createElement("div"), e.id = o, e.style.position = "fixed", e.style.setProperty("z-index", "var(--ui-z-toast, 1100)"), e.style.display = "flex", e.style.gap = "10px", e.style.maxWidth = "400px", e.style.width = "calc(100vw - 32px)", e.style.pointerEvents = "none", e.style.boxSizing = "border-box", e.style.transition = "all 0.2s ease", t === "top-right" ? (e.style.top = "20px", e.style.right = "20px", e.style.flexDirection = "column") : t === "top-left" ? (e.style.top = "20px", e.style.left = "20px", e.style.flexDirection = "column") : t === "bottom-left" ? (e.style.bottom = "20px", e.style.left = "20px", e.style.flexDirection = "column-reverse") : t === "top-center" ? (e.style.top = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column") : t === "bottom-center" ? (e.style.bottom = "20px", e.style.left = "50%", e.style.transform = "translateX(-50%)", e.style.flexDirection = "column-reverse") : (e.style.bottom = "20px", e.style.right = "20px", e.style.flexDirection = "column-reverse"), document.body.appendChild(e)), e;
143
143
  }
144
144
  // Utilitário estático para disparo imperativo de Toasts de qualquer lugar no código
145
145
  static notificar(t) {
146
146
  if (typeof document > "u") return null;
147
- const a = t.posicao || "bottom-right", e = document.createElement("ui-toast");
148
- return t.tipo && e.setAttribute("tipo", t.tipo), t.titulo && e.setAttribute("titulo", t.titulo), t.mensagem && e.setAttribute("mensagem", t.mensagem), t.duracao !== void 0 && e.setAttribute("duracao", String(t.duracao)), t.pausarNoHover === !1 && e.setAttribute("pausar-no-hover", "false"), e.setAttribute("posicao", a), t.fechavel !== !1 && e.setAttribute("fechavel", ""), t.acao && e.configurarAcao(t.acao), n.obterContainer(a).appendChild(e), e;
147
+ const o = t.posicao || "bottom-right", e = document.createElement("ui-toast");
148
+ return t.tipo && e.setAttribute("tipo", t.tipo), t.titulo && e.setAttribute("titulo", t.titulo), t.mensagem && e.setAttribute("mensagem", t.mensagem), t.duracao !== void 0 && e.setAttribute("duracao", String(t.duracao)), t.pausarNoHover === !1 && e.setAttribute("pausar-no-hover", "false"), e.setAttribute("posicao", o), t.fechavel !== !1 && e.setAttribute("fechavel", ""), t.acao && e.configurarAcao(t.acao), n.obterContainer(o).appendChild(e), e;
149
149
  }
150
150
  }
151
151
  c("ui-toast", n);
@@ -0,0 +1,20 @@
1
+ "use strict";var d=Object.defineProperty;var p=(i,a,t)=>a in i?d(i,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[a]=t;var r=(i,a,t)=>p(i,typeof a!="symbol"?a+"":a,t);const h=require("./listener-bag-D5omxZ9h.cjs"),c=require("./ssr-safe-CiHD1adl.cjs"),b=':host{display:block;box-sizing:border-box;font-family:var(--ui-fonte-base, "Inter", sans-serif)}.ui-alerta{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:var(--ui-raio-borda, 8px);border:1px solid transparent;background-color:var(--ui-cor-fundo-elevado, #1a1a1e);color:var(--ui-cor-texto, #e1e1e6);box-sizing:border-box;position:relative;transition:opacity .2s ease,transform .2s ease;line-height:1.4}.ui-alerta__icone{display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;line-height:1}.ui-alerta__icone svg,.ui-alerta__icone ::slotted(svg),.ui-alerta__icone ::slotted(ui-icone){shape-rendering:geometricPrecision}.ui-alerta__conteudo{flex:1}.ui-alerta__titulo{font-size:14px;font-weight:600;margin:0 0 2px;line-height:1.2}.ui-alerta__mensagem{font-size:13px;margin:0;opacity:.9}.ui-alerta__close{background:transparent;border:none;color:currentColor;opacity:.7;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:var(--ui-raio-sm, 4px);line-height:1;flex-shrink:0;margin-top:-2px;margin-right:-4px;transition:opacity .15s ease,background-color .15s ease}.ui-alerta__close:hover{opacity:1;background-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 15%,transparent)}.ui-alerta--sucesso{background-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 30%,transparent);color:var(--ui-cor-texto-sucesso, #00E08A)}.ui-alerta--sucesso .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--erro{background-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 30%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta--erro .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--alerta{background-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 30%,transparent);color:var(--ui-cor-texto-alerta, #ffb86c)}.ui-alerta--alerta .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta--info{background-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 12%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 30%,transparent);color:var(--ui-cor-texto-info, #33b5ff)}.ui-alerta--info .ui-alerta__mensagem{color:var(--ui-cor-texto, #e1e1e6)}.ui-alerta__acoes{display:flex;align-items:center;flex-shrink:0;margin-left:4px}.ui-alerta__botao-acao{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);border:1px solid color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 16%,transparent);color:inherit;font-family:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:5px;cursor:pointer;line-height:1;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,transform .1s ease}.ui-alerta__botao-acao:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 18%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 30%,transparent)}.ui-alerta__botao-acao:active{transform:scale(.96)}.ui-alerta__botao-acao:focus-visible{outline:none;box-shadow:0 0 0 2px var(--ui-cor-fundo, #0b0b0d),0 0 0 4px var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 35%,transparent);color:var(--ui-cor-primaria, #00E08A)}.ui-alerta__botao-acao--primario:hover{background:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 50%,transparent)}.ui-alerta__botao-acao--destrutivo{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 15%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 35%,transparent);color:var(--ui-cor-texto-erro, #ff5555)}.ui-alerta__botao-acao--destrutivo:hover{background:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 25%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 50%,transparent)}:host(ui-toast){display:block;width:100%;box-sizing:border-box;pointer-events:auto;transition:transform .25s cubic-bezier(.16,1,.3,1),opacity .25s ease}.ui-toast__banner{box-shadow:var(--ui-sombra-lg, 0 10px 30px rgba(0, 0, 0, .3)),0 0 0 1px var(--ui-cor-borda, rgba(255, 255, 255, .1));animation:ui-toast-slide .3s cubic-bezier(.16,1,.3,1);position:relative;overflow:hidden;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}.ui-toast__banner.ui-alerta--sucesso{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-sucesso, #00E08A) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-sucesso, #00E08A) 40%,transparent)}.ui-toast__banner.ui-alerta--erro{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-erro, #ff5555) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-erro, #ff5555) 40%,transparent)}.ui-toast__banner.ui-alerta--alerta{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-alerta, #ffb86c) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-alerta, #ffb86c) 40%,transparent)}.ui-toast__banner.ui-alerta--info{background-color:color-mix(in srgb,color-mix(in srgb,var(--ui-cor-fundo-elevado, #1a1a1e) 88%,var(--ui-cor-texto-info, #33b5ff) 12%) 60%,transparent);border-color:color-mix(in srgb,var(--ui-cor-texto-info, #33b5ff) 40%,transparent)}.ui-toast__progresso{position:absolute;bottom:0;left:0;right:0;height:2px;background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 8%,transparent);overflow:hidden}.ui-toast__progresso-barra{width:100%;height:100%;background:currentColor;opacity:.7;transform-origin:left;animation:ui-toast-timer linear forwards}:host(ui-toast:hover) .ui-toast__progresso-barra,:host(ui-toast:focus-within) .ui-toast__progresso-barra{animation-play-state:paused}@keyframes ui-toast-timer{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes ui-toast-slide{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@starting-style{:host(ui-toast){opacity:0;transform:translateY(12px) scale(.96)}}',l={sucesso:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',erro:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',alerta:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',info:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>'};class u extends c.SafeHTMLElement{constructor(){super();r(this,"alertaElement");r(this,"iconeElement");r(this,"tituloElement");r(this,"mensagemElement");r(this,"mensagemTextoElement");r(this,"closeElement");r(this,"acoesElement");r(this,"botaoAcaoElement");r(this,"progressoContainer");r(this,"progressoBarra");r(this,"listeners",new h.ListenerBag);const t=this.attachShadow({mode:"open"});t.innerHTML=`
2
+ <style>${b}</style>
3
+ <div class="ui-alerta" part="base" role="alert">
4
+ <span class="ui-alerta__icone" part="icone"></span>
5
+ <div class="ui-alerta__conteudo" part="conteudo">
6
+ <h4 class="ui-alerta__titulo" part="titulo" style="display: none;"></h4>
7
+ <p class="ui-alerta__mensagem" part="mensagem">
8
+ <span class="ui-alerta__mensagem-texto" style="display: none;"></span>
9
+ <slot></slot>
10
+ </p>
11
+ </div>
12
+ <div class="ui-alerta__acoes" style="display: none;">
13
+ <button type="button" class="ui-alerta__botao-acao" part="acao"></button>
14
+ </div>
15
+ <button class="ui-alerta__close" part="fechar" type="button" aria-label="Fechar alerta" style="display: none;" title="Fechar">✕</button>
16
+ <div class="ui-toast__progresso" part="progresso" style="display: none;">
17
+ <div class="ui-toast__progresso-barra"></div>
18
+ </div>
19
+ </div>
20
+ `,this.alertaElement=t.querySelector(".ui-alerta"),this.iconeElement=t.querySelector(".ui-alerta__icone"),this.tituloElement=t.querySelector(".ui-alerta__titulo"),this.mensagemElement=t.querySelector(".ui-alerta__mensagem"),this.mensagemTextoElement=t.querySelector(".ui-alerta__mensagem-texto"),this.closeElement=t.querySelector(".ui-alerta__close"),this.acoesElement=t.querySelector(".ui-alerta__acoes"),this.botaoAcaoElement=t.querySelector(".ui-alerta__botao-acao"),this.progressoContainer=t.querySelector(".ui-toast__progresso"),this.progressoBarra=t.querySelector(".ui-toast__progresso-barra")}static get observedAttributes(){return["tipo","variante","variant","titulo","title","mensagem","fechavel","dismissible"]}connectedCallback(){this.listeners.cleanup(),this.listeners.add(this.closeElement,"click",()=>this.fechar()),this.syncState()}disconnectedCallback(){this.listeners.cleanup()}attributeChangedCallback(t,o,e){this.syncState()}fechar(){this.dispatchEvent(new CustomEvent("ui-fechar",{bubbles:!0,composed:!0})),this.remove()}syncState(){const t=this.getAttribute("tipo")||this.getAttribute("variante")||this.getAttribute("variant")||"info",o=this.getAttribute("titulo")||this.getAttribute("title"),e=this.getAttribute("mensagem"),s=this.hasAttribute("fechavel")||this.hasAttribute("dismissible");this.alertaElement.className=`ui-alerta ui-alerta--${t}`;const m=l[t]||l.info;this.iconeElement.innerHTML=m,o?(this.tituloElement.textContent=o,this.tituloElement.style.display="block"):(this.tituloElement.style.display="none",this.tituloElement.textContent=""),e?(this.mensagemTextoElement.textContent=e,this.mensagemTextoElement.style.display="inline"):(this.mensagemTextoElement.style.display="none",this.mensagemTextoElement.textContent=""),s?this.closeElement.style.display="block":this.closeElement.style.display="none"}}c.definirCustomElement("ui-alerta",u);class n extends u{constructor(){super(...arguments);r(this,"timerId",null);r(this,"tempoRestante",4e3);r(this,"inicioTimestamp",0);r(this,"isPausado",!1);r(this,"acaoConfig");r(this,"containerRef",null);r(this,"handleAcaoClick",t=>{var o,e,s;t.stopPropagation(),(o=this.acaoConfig)!=null&&o.onClick&&this.acaoConfig.onClick(t),this.dispatchEvent(new CustomEvent("ui-toast-acao",{detail:{rotulo:(e=this.acaoConfig)==null?void 0:e.rotulo,tipo:(s=this.acaoConfig)==null?void 0:s.tipo},bubbles:!0,composed:!0})),this.fechar()});r(this,"pausarTimer",()=>{if(this.isPausado||this.tempoRestante<=0)return;this.isPausado=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null);const t=Date.now()-this.inicioTimestamp;this.tempoRestante=Math.max(0,this.tempoRestante-t),this.progressoBarra.style.animationPlayState="paused"});r(this,"retomarTimer",()=>{!this.isPausado||this.tempoRestante<=0||(this.isPausado=!1,this.progressoBarra.style.animationPlayState="running",this.iniciarTimer(Math.max(this.tempoRestante,300)))})}configurarAcao(t){this.acaoConfig=t,this.botaoAcaoElement.textContent=t.rotulo,this.acoesElement.style.display="flex";const o=t.tipo||"primario";this.botaoAcaoElement.className=`ui-alerta__botao-acao ui-alerta__botao-acao--${o}`}connectedCallback(){super.connectedCallback(),this.containerRef=this.parentElement,this.alertaElement.classList.add("ui-toast__banner"),this.acaoConfig&&this.listeners.add(this.botaoAcaoElement,"click",this.handleAcaoClick);const t=this.getAttribute("duracao")||this.getAttribute("duration")||"4000",o=parseInt(t,10);this.tempoRestante=isNaN(o)?4e3:o,this.tempoRestante>0?(this.progressoContainer.style.display="block",this.progressoBarra.style.animationDuration=`${this.tempoRestante}ms`,this.getAttribute("pausar-no-hover")!=="false"&&(this.listeners.add(this,"mouseenter",this.pausarTimer),this.listeners.add(this,"mouseleave",this.retomarTimer),this.listeners.add(this,"focusin",this.pausarTimer),this.listeners.add(this,"focusout",this.retomarTimer)),this.iniciarTimer(this.tempoRestante)):this.progressoContainer.style.display="none"}fechar(){const t=this.parentElement||this.containerRef;super.fechar(),t&&t.id.startsWith("ui-toast-container-")&&t.children.length===0&&t.remove()}disconnectedCallback(){super.disconnectedCallback(),this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.containerRef&&this.containerRef.id.startsWith("ui-toast-container-")&&this.containerRef.children.length===0&&(this.containerRef.remove(),this.containerRef=null)}iniciarTimer(t){this.timerId&&clearTimeout(this.timerId),this.inicioTimestamp=Date.now(),this.timerId=setTimeout(()=>{this.fechar()},t)}static obterContainer(t){const o=`ui-toast-container-${t}`;let e=document.getElementById(o);return e||(e=document.createElement("div"),e.id=o,e.style.position="fixed",e.style.setProperty("z-index","var(--ui-z-toast, 1100)"),e.style.display="flex",e.style.gap="10px",e.style.maxWidth="400px",e.style.width="calc(100vw - 32px)",e.style.pointerEvents="none",e.style.boxSizing="border-box",e.style.transition="all 0.2s ease",t==="top-right"?(e.style.top="20px",e.style.right="20px",e.style.flexDirection="column"):t==="top-left"?(e.style.top="20px",e.style.left="20px",e.style.flexDirection="column"):t==="bottom-left"?(e.style.bottom="20px",e.style.left="20px",e.style.flexDirection="column-reverse"):t==="top-center"?(e.style.top="20px",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.flexDirection="column"):t==="bottom-center"?(e.style.bottom="20px",e.style.left="50%",e.style.transform="translateX(-50%)",e.style.flexDirection="column-reverse"):(e.style.bottom="20px",e.style.right="20px",e.style.flexDirection="column-reverse"),document.body.appendChild(e)),e}static notificar(t){if(typeof document>"u")return null;const o=t.posicao||"bottom-right",e=document.createElement("ui-toast");return t.tipo&&e.setAttribute("tipo",t.tipo),t.titulo&&e.setAttribute("titulo",t.titulo),t.mensagem&&e.setAttribute("mensagem",t.mensagem),t.duracao!==void 0&&e.setAttribute("duracao",String(t.duracao)),t.pausarNoHover===!1&&e.setAttribute("pausar-no-hover","false"),e.setAttribute("posicao",o),t.fechavel!==!1&&e.setAttribute("fechavel",""),t.acao&&e.configurarAcao(t.acao),n.obterContainer(o).appendChild(e),e}}c.definirCustomElement("ui-toast",n);exports.ICONES_ALERTA=l;exports.UIAlerta=u;exports.UIToast=n;
@@ -0,0 +1,244 @@
1
+ var v = Object.defineProperty;
2
+ var E = (o, e, t) => e in o ? v(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var m = (o, e, t) => E(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { a as A } from "./ui-toast-Bp_NlM5G.js";
5
+ class I {
6
+ constructor() {
7
+ m(this, "listeners", /* @__PURE__ */ new Map());
8
+ m(this, "_observandoSistema", !1);
9
+ this.observarTemaDoSistema();
10
+ }
11
+ on(e, t) {
12
+ return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), () => this.off(e, t);
13
+ }
14
+ once(e, t) {
15
+ const r = (u) => {
16
+ this.off(e, r), t(u);
17
+ };
18
+ this.on(e, r);
19
+ }
20
+ off(e, t) {
21
+ const r = this.listeners.get(e);
22
+ r && (r.delete(t), r.size === 0 && this.listeners.delete(e));
23
+ }
24
+ emit(e, t) {
25
+ const r = this.listeners.get(e);
26
+ r && r.forEach((u) => {
27
+ try {
28
+ u(t);
29
+ } catch (f) {
30
+ console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`, f);
31
+ }
32
+ }), typeof window < "u" && window.dispatchEvent(
33
+ new CustomEvent(`uibus:${e}`, {
34
+ detail: t,
35
+ bubbles: !0,
36
+ composed: !0
37
+ })
38
+ );
39
+ }
40
+ /* ====================================================
41
+ Métodos de Atalho e Ações de Alta Produtividade
42
+ ==================================================== */
43
+ /**
44
+ * Abre um modal pelo seu ID no documento.
45
+ */
46
+ abrirModal(e) {
47
+ if (typeof document > "u") return !1;
48
+ const t = document.getElementById(e);
49
+ return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("modal:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("modal:aberto", { id: e }), !0) : (console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`), !1);
50
+ }
51
+ /**
52
+ * Fecha um modal pelo seu ID ou todos os modais abertos se nenhum ID for passado.
53
+ * Retorna `false` se o modal não existir ou continuar aberto (`bloquear-fechamento`).
54
+ */
55
+ fecharModal(e) {
56
+ if (typeof document > "u") return !1;
57
+ if (e) {
58
+ const t = document.getElementById(e);
59
+ return t && typeof t.fechar == "function" ? (t.fechar(), t.hasAttribute("aberto") || t.hasAttribute("open") ? !1 : (this.emit("modal:fechado", { id: e }), !0)) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("modal:fechado", { id: e }), !0) : !1;
60
+ } else
61
+ return document.querySelectorAll(
62
+ "ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]"
63
+ ).forEach((r) => {
64
+ typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
65
+ }), this.emit("modal:fechado-todos"), !0;
66
+ }
67
+ /**
68
+ * Abre um painel lateral (drawer / sheet) pelo seu ID no documento.
69
+ */
70
+ abrirDrawer(e) {
71
+ if (typeof document > "u") return !1;
72
+ const t = document.getElementById(e);
73
+ return t && typeof t.abrir == "function" ? (t.abrir(), this.emit("drawer:aberto", { id: e }), !0) : t ? (t.setAttribute("aberto", ""), this.emit("drawer:aberto", { id: e }), !0) : (console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`), !1);
74
+ }
75
+ /**
76
+ * Fecha um painel lateral (drawer / sheet) pelo seu ID ou todos se nenhum for passado.
77
+ */
78
+ fecharDrawer(e) {
79
+ if (typeof document > "u") return !1;
80
+ if (e) {
81
+ const t = document.getElementById(e);
82
+ return t && typeof t.fechar == "function" ? (t.fechar(), this.emit("drawer:fechado", { id: e }), !0) : t ? (t.removeAttribute("aberto"), t.removeAttribute("open"), this.emit("drawer:fechado", { id: e }), !0) : !1;
83
+ } else
84
+ return document.querySelectorAll(
85
+ "ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]"
86
+ ).forEach((r) => {
87
+ typeof r.fechar == "function" ? r.fechar() : (r.removeAttribute("aberto"), r.removeAttribute("open"));
88
+ }), this.emit("drawer:fechado-todos"), !0;
89
+ }
90
+ /**
91
+ * Dispara uma notificação toast flutuante inteligente.
92
+ */
93
+ notificar(e) {
94
+ typeof e == "string" ? A.notificar({ mensagem: e, tipo: "info" }) : A.notificar(e);
95
+ }
96
+ /**
97
+ * Copia um texto para a área de transferência do usuário e exibe feedback opcional.
98
+ */
99
+ async copiar(e, t) {
100
+ if (typeof navigator > "u" || !navigator.clipboard)
101
+ return !1;
102
+ try {
103
+ return await navigator.clipboard.writeText(e), t !== void 0 && this.notificar({
104
+ tipo: "sucesso",
105
+ mensagem: t || "Copiado para a área de transferência!"
106
+ }), this.emit("clipboard:copiado", { texto: e }), !0;
107
+ } catch (r) {
108
+ return console.error("[UIBus] Falha ao copiar texto:", r), this.notificar({
109
+ tipo: "erro",
110
+ mensagem: "Não foi possível copiar o texto."
111
+ }), !1;
112
+ }
113
+ }
114
+ /**
115
+ * Altera a densidade visual global do kit (compacta, normal ou relaxada).
116
+ */
117
+ definirDensidade(e) {
118
+ let t = 34;
119
+ typeof e == "number" ? t = Math.max(15, e) : e === "compacta" ? t = 26 : e === "relaxada" ? t = 42 : t = 34, !(typeof document > "u") && (document.documentElement.style.setProperty("--ui-altura-minima", `${t}px`), document.documentElement.style.setProperty("--ui-campo-altura", `${t}px`), document.documentElement.setAttribute("data-ui-densidade", typeof e == "string" ? e : "custom"), this.emit("densidade:alterada", { densidade: e, alturaPx: t }));
120
+ }
121
+ /**
122
+ * Tema em vigor: o forçado na raiz (`data-tema`, `data-theme`, `.dark`/`.light`)
123
+ * ou, sem nenhum, o do sistema operacional (`prefers-color-scheme`).
124
+ */
125
+ obterTema() {
126
+ if (typeof document > "u") return "escuro";
127
+ const e = w(document.documentElement);
128
+ return e || (T() ? "claro" : "escuro");
129
+ }
130
+ /**
131
+ * Define o tema global. Sem argumento, alterna o tema em vigor;
132
+ * `'auto'` remove o tema forçado e volta a seguir o sistema operacional.
133
+ */
134
+ definirTema(e) {
135
+ if (typeof document > "u") return e === "claro" ? "claro" : "escuro";
136
+ const t = document.documentElement;
137
+ if (e === "auto")
138
+ t.removeAttribute("data-tema"), t.removeAttribute("data-theme"), t.classList.remove("dark", "light");
139
+ else {
140
+ const u = e || (this.obterTema() === "escuro" ? "claro" : "escuro");
141
+ t.setAttribute("data-tema", u), t.classList.toggle("dark", u === "escuro"), t.classList.toggle("light", u === "claro");
142
+ }
143
+ const r = this.obterTema();
144
+ return this.emit("tema:alterado", { tema: r }), r;
145
+ }
146
+ /** Com o tema seguindo o SO, avisa `tema:alterado` quando o usuário troca o tema do sistema. */
147
+ observarTemaDoSistema() {
148
+ var e, t;
149
+ this._observandoSistema || typeof window > "u" || typeof window.matchMedia != "function" || (this._observandoSistema = !0, (t = (e = window.matchMedia("(prefers-color-scheme: light)")).addEventListener) == null || t.call(e, "change", () => {
150
+ w(document.documentElement) || this.emit("tema:alterado", { tema: this.obterTema() });
151
+ }));
152
+ }
153
+ }
154
+ function w(o) {
155
+ const e = o.getAttribute("data-tema") || o.getAttribute("data-theme");
156
+ return e === "escuro" || e === "dark" ? "escuro" : e === "claro" || e === "light" ? "claro" : o.classList.contains("dark") ? "escuro" : o.classList.contains("light") ? "claro" : null;
157
+ }
158
+ function T() {
159
+ return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: light)").matches;
160
+ }
161
+ const n = new I();
162
+ let y = !1;
163
+ function x(o) {
164
+ if (o.hasAttribute("disabled") || o.hasAttribute("carregando") || o.getAttribute("aria-disabled") === "true" || o.localName.startsWith("ui-") && o.hasAttribute("loading")) return !0;
165
+ try {
166
+ return o.matches(":disabled");
167
+ } catch {
168
+ return !1;
169
+ }
170
+ }
171
+ function B() {
172
+ y || typeof document > "u" || (y = !0, document.addEventListener("click", (o) => {
173
+ const e = o.composedPath ? o.composedPath() : [o.target], t = "[target-modal], [modal-alvo], [dismiss-modal], [fechar-modal], [target-drawer], [drawer-alvo], [dismiss-drawer], [fechar-drawer], [toast-sucesso], [toast-erro], [toast-alerta], [toast-info], [copiar-texto], [alternar-tema], [definir-densidade], [limpar-form]";
174
+ let r = null;
175
+ for (const i of e)
176
+ if (i instanceof HTMLElement && i.matches(t)) {
177
+ r = i;
178
+ break;
179
+ }
180
+ if (!r || x(r)) return;
181
+ const u = r.getAttribute("target-modal") || r.getAttribute("modal-alvo");
182
+ if (u && n.abrirModal(u), r.hasAttribute("dismiss-modal") || r.hasAttribute("fechar-modal")) {
183
+ const i = r.getAttribute("dismiss-modal") || r.getAttribute("fechar-modal");
184
+ if (i && i !== "")
185
+ n.fecharModal(i);
186
+ else {
187
+ let s = null;
188
+ for (const a of e)
189
+ if (a instanceof HTMLElement && (a.matches("ui-modal, ui-dialog") || a.tagName === "UI-MODAL" || a.tagName === "UI-DIALOG")) {
190
+ s = a;
191
+ break;
192
+ }
193
+ s && (typeof s.fechar == "function" ? s.fechar() : (s.removeAttribute("aberto"), s.removeAttribute("open")));
194
+ }
195
+ }
196
+ const f = r.getAttribute("target-drawer") || r.getAttribute("drawer-alvo");
197
+ if (f && n.abrirDrawer(f), r.hasAttribute("dismiss-drawer") || r.hasAttribute("fechar-drawer")) {
198
+ const i = r.getAttribute("dismiss-drawer") || r.getAttribute("fechar-drawer");
199
+ if (i && i !== "")
200
+ n.fecharDrawer(i);
201
+ else {
202
+ let s = null;
203
+ for (const a of e)
204
+ if (a instanceof HTMLElement && (a.matches("ui-drawer, ui-sheet, ui-painel-lateral, ui-gaveta") || a.tagName.startsWith("UI-DRAWER") || a.tagName.startsWith("UI-SHEET"))) {
205
+ s = a;
206
+ break;
207
+ }
208
+ s && (typeof s.fechar == "function" ? s.fechar() : (s.removeAttribute("aberto"), s.removeAttribute("open")));
209
+ }
210
+ }
211
+ const d = r.getAttribute("toast-sucesso");
212
+ d && n.notificar({ tipo: "sucesso", mensagem: d });
213
+ const l = r.getAttribute("toast-erro");
214
+ l && n.notificar({ tipo: "erro", mensagem: l });
215
+ const h = r.getAttribute("toast-alerta");
216
+ h && n.notificar({ tipo: "alerta", mensagem: h });
217
+ const b = r.getAttribute("toast-info");
218
+ b && n.notificar({ tipo: "info", mensagem: b });
219
+ const c = r.getAttribute("copiar-texto");
220
+ if (c !== null) {
221
+ let i = c;
222
+ if (c.startsWith("#") || c.startsWith(".") || c.match(/^[a-zA-Z0-9_-]+$/))
223
+ try {
224
+ let a = null;
225
+ c.startsWith("#") || c.startsWith(".") ? a = document.querySelector(c) : a = document.getElementById(c) || document.querySelector(`#${c}`), a && (i = a.value !== void 0 && a.value !== null ? a.value : a.textContent || "");
226
+ } catch {
227
+ }
228
+ const s = r.getAttribute("copiar-mensagem") || "Copiado com sucesso!";
229
+ n.copiar(i, s);
230
+ }
231
+ r.hasAttribute("alternar-tema") && n.definirTema();
232
+ const p = r.getAttribute("definir-densidade");
233
+ p && n.definirDensidade(p);
234
+ const g = r.getAttribute("limpar-form");
235
+ if (g) {
236
+ const i = document.getElementById(g);
237
+ i && typeof i.reset == "function" && (i.reset(), n.notificar({ tipo: "info", mensagem: "Formulário limpo." }));
238
+ }
239
+ }));
240
+ }
241
+ export {
242
+ n as U,
243
+ B as i
244
+ };
@@ -0,0 +1 @@
1
+ "use strict";var v=Object.defineProperty;var E=(o,e,t)=>e in o?v(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var m=(o,e,t)=>E(o,typeof e!="symbol"?e+"":e,t);const A=require("./ui-toast-DGTZKne5.cjs");class I{constructor(){m(this,"listeners",new Map);m(this,"_observandoSistema",!1);this.observarTemaDoSistema()}on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}once(e,t){const r=u=>{this.off(e,r),t(u)};this.on(e,r)}off(e,t){const r=this.listeners.get(e);r&&(r.delete(t),r.size===0&&this.listeners.delete(e))}emit(e,t){const r=this.listeners.get(e);r&&r.forEach(u=>{try{u(t)}catch(f){console.error(`[UIBus] Erro ao executar ouvinte do evento "${e}":`,f)}}),typeof window<"u"&&window.dispatchEvent(new CustomEvent(`uibus:${e}`,{detail:t,bubbles:!0,composed:!0}))}abrirModal(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("modal:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("modal:aberto",{id:e}),!0):(console.warn(`[UIBus] Modal com ID "${e}" não encontrado no DOM.`),!1)}fecharModal(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),t.hasAttribute("aberto")||t.hasAttribute("open")?!1:(this.emit("modal:fechado",{id:e}),!0)):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("modal:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-modal[aberto], ui-modal[open], ui-dialog[aberto], ui-dialog[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("modal:fechado-todos"),!0}abrirDrawer(e){if(typeof document>"u")return!1;const t=document.getElementById(e);return t&&typeof t.abrir=="function"?(t.abrir(),this.emit("drawer:aberto",{id:e}),!0):t?(t.setAttribute("aberto",""),this.emit("drawer:aberto",{id:e}),!0):(console.warn(`[UIBus] Drawer com ID "${e}" não encontrado no DOM.`),!1)}fecharDrawer(e){if(typeof document>"u")return!1;if(e){const t=document.getElementById(e);return t&&typeof t.fechar=="function"?(t.fechar(),this.emit("drawer:fechado",{id:e}),!0):t?(t.removeAttribute("aberto"),t.removeAttribute("open"),this.emit("drawer:fechado",{id:e}),!0):!1}else return document.querySelectorAll("ui-drawer[aberto], ui-drawer[open], ui-sheet[aberto], ui-sheet[open]").forEach(r=>{typeof r.fechar=="function"?r.fechar():(r.removeAttribute("aberto"),r.removeAttribute("open"))}),this.emit("drawer:fechado-todos"),!0}notificar(e){typeof e=="string"?A.UIToast.notificar({mensagem:e,tipo:"info"}):A.UIToast.notificar(e)}async copiar(e,t){if(typeof navigator>"u"||!navigator.clipboard)return!1;try{return await navigator.clipboard.writeText(e),t!==void 0&&this.notificar({tipo:"sucesso",mensagem:t||"Copiado para a área de transferência!"}),this.emit("clipboard:copiado",{texto:e}),!0}catch(r){return console.error("[UIBus] Falha ao copiar texto:",r),this.notificar({tipo:"erro",mensagem:"Não foi possível copiar o texto."}),!1}}definirDensidade(e){let t=34;typeof e=="number"?t=Math.max(15,e):e==="compacta"?t=26:e==="relaxada"?t=42:t=34,!(typeof document>"u")&&(document.documentElement.style.setProperty("--ui-altura-minima",`${t}px`),document.documentElement.style.setProperty("--ui-campo-altura",`${t}px`),document.documentElement.setAttribute("data-ui-densidade",typeof e=="string"?e:"custom"),this.emit("densidade:alterada",{densidade:e,alturaPx:t}))}obterTema(){if(typeof document>"u")return"escuro";const e=w(document.documentElement);return e||(T()?"claro":"escuro")}definirTema(e){if(typeof document>"u")return e==="claro"?"claro":"escuro";const t=document.documentElement;if(e==="auto")t.removeAttribute("data-tema"),t.removeAttribute("data-theme"),t.classList.remove("dark","light");else{const u=e||(this.obterTema()==="escuro"?"claro":"escuro");t.setAttribute("data-tema",u),t.classList.toggle("dark",u==="escuro"),t.classList.toggle("light",u==="claro")}const r=this.obterTema();return this.emit("tema:alterado",{tema:r}),r}observarTemaDoSistema(){var e,t;this._observandoSistema||typeof window>"u"||typeof window.matchMedia!="function"||(this._observandoSistema=!0,(t=(e=window.matchMedia("(prefers-color-scheme: light)")).addEventListener)==null||t.call(e,"change",()=>{w(document.documentElement)||this.emit("tema:alterado",{tema:this.obterTema()})}))}}function w(o){const e=o.getAttribute("data-tema")||o.getAttribute("data-theme");return e==="escuro"||e==="dark"?"escuro":e==="claro"||e==="light"?"claro":o.classList.contains("dark")?"escuro":o.classList.contains("light")?"claro":null}function T(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: light)").matches}const n=new I;let y=!1;function S(o){if(o.hasAttribute("disabled")||o.hasAttribute("carregando")||o.getAttribute("aria-disabled")==="true"||o.localName.startsWith("ui-")&&o.hasAttribute("loading"))return!0;try{return o.matches(":disabled")}catch{return!1}}function x(){y||typeof document>"u"||(y=!0,document.addEventListener("click",o=>{const e=o.composedPath?o.composedPath():[o.target],t="[target-modal], [modal-alvo], [dismiss-modal], [fechar-modal], [target-drawer], [drawer-alvo], [dismiss-drawer], [fechar-drawer], [toast-sucesso], [toast-erro], [toast-alerta], [toast-info], [copiar-texto], [alternar-tema], [definir-densidade], [limpar-form]";let r=null;for(const i of e)if(i instanceof HTMLElement&&i.matches(t)){r=i;break}if(!r||S(r))return;const u=r.getAttribute("target-modal")||r.getAttribute("modal-alvo");if(u&&n.abrirModal(u),r.hasAttribute("dismiss-modal")||r.hasAttribute("fechar-modal")){const i=r.getAttribute("dismiss-modal")||r.getAttribute("fechar-modal");if(i&&i!=="")n.fecharModal(i);else{let s=null;for(const a of e)if(a instanceof HTMLElement&&(a.matches("ui-modal, ui-dialog")||a.tagName==="UI-MODAL"||a.tagName==="UI-DIALOG")){s=a;break}s&&(typeof s.fechar=="function"?s.fechar():(s.removeAttribute("aberto"),s.removeAttribute("open")))}}const f=r.getAttribute("target-drawer")||r.getAttribute("drawer-alvo");if(f&&n.abrirDrawer(f),r.hasAttribute("dismiss-drawer")||r.hasAttribute("fechar-drawer")){const i=r.getAttribute("dismiss-drawer")||r.getAttribute("fechar-drawer");if(i&&i!=="")n.fecharDrawer(i);else{let s=null;for(const a of e)if(a instanceof HTMLElement&&(a.matches("ui-drawer, ui-sheet, ui-painel-lateral, ui-gaveta")||a.tagName.startsWith("UI-DRAWER")||a.tagName.startsWith("UI-SHEET"))){s=a;break}s&&(typeof s.fechar=="function"?s.fechar():(s.removeAttribute("aberto"),s.removeAttribute("open")))}}const d=r.getAttribute("toast-sucesso");d&&n.notificar({tipo:"sucesso",mensagem:d});const l=r.getAttribute("toast-erro");l&&n.notificar({tipo:"erro",mensagem:l});const h=r.getAttribute("toast-alerta");h&&n.notificar({tipo:"alerta",mensagem:h});const b=r.getAttribute("toast-info");b&&n.notificar({tipo:"info",mensagem:b});const c=r.getAttribute("copiar-texto");if(c!==null){let i=c;if(c.startsWith("#")||c.startsWith(".")||c.match(/^[a-zA-Z0-9_-]+$/))try{let a=null;c.startsWith("#")||c.startsWith(".")?a=document.querySelector(c):a=document.getElementById(c)||document.querySelector(`#${c}`),a&&(i=a.value!==void 0&&a.value!==null?a.value:a.textContent||"")}catch{}const s=r.getAttribute("copiar-mensagem")||"Copiado com sucesso!";n.copiar(i,s)}r.hasAttribute("alternar-tema")&&n.definirTema();const p=r.getAttribute("definir-densidade");p&&n.definirDensidade(p);const g=r.getAttribute("limpar-form");if(g){const i=document.getElementById(g);i&&typeof i.reset=="function"&&(i.reset(),n.notificar({tipo:"info",mensagem:"Formulário limpo."}))}}))}exports.UIBus=n;exports.initZeroJSTriggers=x;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thibezer/ui-components-kit",
3
- "version": "1.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Web Components nativos (W3C Custom Elements + Shadow DOM) para interfaces densas de GIS, CAD e formulários, sem dependência de framework.",
5
5
  "keywords": [
6
6
  "web-components",
@@ -11,7 +11,10 @@
11
11
  "gis",
12
12
  "cad",
13
13
  "leaflet",
14
- "form-associated"
14
+ "form-associated",
15
+ "custom-elements-manifest",
16
+ "react",
17
+ "vue"
15
18
  ],
16
19
  "author": "thibezer",
17
20
  "license": "MIT",
@@ -29,7 +32,8 @@
29
32
  "types": "./dist/index.d.ts",
30
33
  "style": "./dist/ui-kit.css",
31
34
  "files": [
32
- "dist"
35
+ "dist",
36
+ "CHANGELOG.md"
33
37
  ],
34
38
  "exports": {
35
39
  ".": {
@@ -114,15 +118,27 @@
114
118
  "import": "./dist/seletor-mapa-base.js",
115
119
  "require": "./dist/seletor-mapa-base.cjs"
116
120
  },
121
+ "./custom-elements.json": "./dist/custom-elements.json",
122
+ "./tipos-react": {
123
+ "types": "./dist/tipos-react.d.ts"
124
+ },
125
+ "./tipos-vue": {
126
+ "types": "./dist/tipos-vue.d.ts"
127
+ },
128
+ "./tipos-elementos": {
129
+ "types": "./dist/tipos-elementos.d.ts"
130
+ },
117
131
  "./package.json": "./package.json"
118
132
  },
119
133
  "scripts": {
120
134
  "dev": "vite",
121
- "build": "tsc && vite build",
135
+ "build": "tsc && vite build && npm run manifesto",
122
136
  "test": "vitest run",
123
137
  "test:coverage": "vitest run --coverage",
124
138
  "preview": "vite preview",
125
- "prepublishOnly": "npm test && npm run build"
139
+ "prepublishOnly": "npm test && npm run build && npm run test:tipos",
140
+ "manifesto": "cem analyze --config custom-elements-manifest.config.mjs",
141
+ "test:tipos": "tsc -p tests/tipos/tsconfig.json"
126
142
  },
127
143
  "peerDependencies": {
128
144
  "leaflet": "^1.9.4"
@@ -133,10 +149,13 @@
133
149
  }
134
150
  },
135
151
  "devDependencies": {
152
+ "@custom-elements-manifest/analyzer": "^0.11.0",
136
153
  "@types/leaflet": "^1.9.22",
154
+ "@types/react": "^19.3.0",
137
155
  "@vitest/coverage-v8": "^4.1.10",
138
156
  "element-internals-polyfill": "^3.0.2",
139
- "happy-dom": "^20.11.1",
157
+ "esbuild": "0.28.2",
158
+ "happy-dom": "20.11.1",
140
159
  "leaflet": "^1.9.4",
141
160
  "typescript": "^5.0.0",
142
161
  "vite": "^5.0.0",
@@ -145,5 +164,6 @@
145
164
  },
146
165
  "publishConfig": {
147
166
  "access": "public"
148
- }
167
+ },
168
+ "customElements": "dist/custom-elements.json"
149
169
  }