@thibezer/ui-components-kit 2.8.1 → 2.8.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.
Files changed (191) hide show
  1. package/CHANGELOG.md +22 -103
  2. package/README.md +8 -32
  3. package/dist/botao.cjs +1 -1
  4. package/dist/botao.js +1 -1
  5. package/dist/camadas.cjs +110 -114
  6. package/dist/camadas.js +1177 -1343
  7. package/dist/campo-texto.cjs +1 -1
  8. package/dist/campo-texto.js +1 -1
  9. package/dist/canvas.cjs +63 -64
  10. package/dist/canvas.js +3544 -4025
  11. package/dist/card.cjs +1 -1
  12. package/dist/card.js +1 -1
  13. package/dist/components/ui-avatar/ui-avatar.d.ts +0 -11
  14. package/dist/components/ui-badge/ui-badge.d.ts +0 -2
  15. package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -1
  16. package/dist/components/ui-barra-ferramentas/tipos.d.ts +31 -0
  17. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +17 -1
  18. package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +17 -0
  19. package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +0 -2
  20. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +11 -4
  21. package/dist/components/ui-camadas/camadas-drag-drop.d.ts +1 -13
  22. package/dist/components/ui-camadas/camadas-host.d.ts +0 -1
  23. package/dist/components/ui-camadas/camadas-mapas-base.d.ts +1 -3
  24. package/dist/components/ui-camadas/camadas-selecao.d.ts +0 -12
  25. package/dist/components/ui-camadas/ui-camadas.d.ts +5 -8
  26. package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +1 -2
  27. package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
  28. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +8 -3
  29. package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +106 -39
  30. package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +1 -3
  31. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +1 -15
  32. package/dist/components/ui-checkbox/ui-checkbox.d.ts +1 -4
  33. package/dist/components/ui-cores/tipos.d.ts +0 -2
  34. package/dist/components/ui-cores/ui-controle-cores.d.ts +3 -8
  35. package/dist/components/ui-cores/ui-seletor-cor.d.ts +1 -3
  36. package/dist/components/ui-mapa/ui-mapa-linha.d.ts +5 -12
  37. package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +6 -15
  38. package/dist/components/ui-mapa/ui-mapa.d.ts +1 -14
  39. package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
  40. package/dist/components/ui-modal/ui-modal.d.ts +11 -1
  41. package/dist/components/ui-radio/radio-grupo-registry.d.ts +0 -10
  42. package/dist/components/ui-radio/ui-radio.d.ts +2 -9
  43. package/dist/components/ui-skeleton/ui-skeleton.d.ts +0 -9
  44. package/dist/components/ui-switch/ui-switch.d.ts +1 -3
  45. package/dist/components/ui-tabela/ui-tabela.d.ts +19 -1
  46. package/dist/components/ui-tooltip/ui-tooltip.d.ts +1 -24
  47. package/dist/core/index.d.ts +0 -1
  48. package/dist/core.cjs +1 -1
  49. package/dist/core.js +18 -28
  50. package/dist/cores.cjs +1 -1
  51. package/dist/cores.js +1 -1
  52. package/dist/custom-elements.json +13585 -18764
  53. package/dist/data.cjs +1 -1
  54. package/dist/data.js +2 -2
  55. package/dist/feedback.cjs +1 -1
  56. package/dist/feedback.js +2 -2
  57. package/dist/form-validacao-BIOXxt-1.js +140 -0
  58. package/dist/form-validacao-ytRYSF3E.cjs +1 -0
  59. package/dist/forms.cjs +1 -1
  60. package/dist/forms.js +2 -2
  61. package/dist/gerencigeo-canvas/canvas_interacao.d.ts +1 -0
  62. package/dist/gerencigeo-canvas/feature_metricas.d.ts +9 -0
  63. package/dist/gerencigeo-canvas/feature_popup.d.ts +0 -2
  64. package/dist/gerencigeo-canvas/mapa_core.d.ts +0 -6
  65. package/dist/index.cjs +1 -1
  66. package/dist/index.d.ts +0 -3
  67. package/dist/index.js +176 -179
  68. package/dist/mapa.cjs +16 -11
  69. package/dist/mapa.js +170 -242
  70. package/dist/modal.cjs +1 -1
  71. package/dist/modal.js +1 -1
  72. package/dist/register.cjs +1 -1
  73. package/dist/register.js +11 -11
  74. package/dist/svg-seguro-ChVJ2L2z.js +74 -0
  75. package/dist/svg-seguro-J2RM1Ssf.cjs +1 -0
  76. package/dist/tabela.cjs +1 -1
  77. package/dist/tabela.js +1 -1
  78. package/dist/tipos-elementos.d.ts +20 -48
  79. package/dist/tipos-react.d.ts +0 -2
  80. package/dist/tipos-vue.d.ts +15 -44
  81. package/dist/tools.cjs +1 -1
  82. package/dist/tools.js +1 -1
  83. package/dist/ui-badge-BxT-sDmV.cjs +28 -0
  84. package/dist/ui-badge-C0eKBI8E.js +183 -0
  85. package/dist/ui-botao-BOOnP8ds.cjs +12 -0
  86. package/dist/ui-botao-DfqSivHl.js +165 -0
  87. package/dist/ui-botao-OGJV6Vfk.js +165 -0
  88. package/dist/ui-botao-psS1juof.cjs +12 -0
  89. package/dist/ui-campo-texto-Cnn2UAkS.cjs +16 -0
  90. package/dist/{ui-campo-texto-B_OHVGiN.js → ui-campo-texto-Uu2dJE_0.js} +51 -51
  91. package/dist/ui-card-B86lJXTP.cjs +20 -0
  92. package/dist/{ui-card-BNYCQ7g-.js → ui-card-C_o5_0cB.js} +42 -50
  93. package/dist/ui-controle-cores-BS0WYPdi.js +572 -0
  94. package/dist/ui-controle-cores-Er6ZcQ7U.cjs +111 -0
  95. package/dist/ui-kit.css +1 -1
  96. package/dist/ui-modal-CvGFGh1h.cjs +18 -0
  97. package/dist/{ui-modal-BkYvNP0G.js → ui-modal-DBOtSTbR.js} +140 -116
  98. package/dist/ui-paleta-ferramentas-CEZYcN4J.js +624 -0
  99. package/dist/ui-paleta-ferramentas-CU4icLl0.js +1171 -0
  100. package/dist/{ui-paleta-ferramentas-bDLPbiGA.cjs → ui-paleta-ferramentas-Ccmo-rB5.cjs} +7 -7
  101. package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +21 -0
  102. package/dist/{ui-paleta-ferramentas-Ksh6gMW3.js → ui-paleta-ferramentas-DNN5i6nL.js} +329 -359
  103. package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +18 -0
  104. package/dist/ui-paleta-ferramentas-DbwdWVtT.js +1173 -0
  105. package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +21 -0
  106. package/dist/ui-segmented-D6b6zxVs.cjs +19 -0
  107. package/dist/ui-segmented-DyF5YLsV.js +418 -0
  108. package/dist/ui-segmented-rn9RxRGM.cjs +19 -0
  109. package/dist/{ui-linha-nCDh2wPm.js → ui-segmented-wUraId2e.js} +105 -200
  110. package/dist/ui-skeleton-DI4_9WOX.js +428 -0
  111. package/dist/{ui-skeleton-DiOxTBZK.cjs → ui-skeleton-SPYqku8P.cjs} +10 -10
  112. package/dist/{ui-skeleton-B2Rgrv8o.js → ui-skeleton-W9uwIceA.js} +191 -254
  113. package/dist/ui-skeleton-elhKIh2B.cjs +33 -0
  114. package/dist/{ui-switch-DO1R0Ce7.js → ui-switch-BcOqOkiV.js} +128 -187
  115. package/dist/ui-switch-D7iPKDj-.cjs +53 -0
  116. package/dist/ui-tabela-propriedades-BBr5sqki.cjs +145 -0
  117. package/dist/{ui-tabela-propriedades-DzZlyNZ_.cjs → ui-tabela-propriedades-BecPqC-e.cjs} +10 -10
  118. package/dist/{ui-tabela-propriedades-D9Echt2X.js → ui-tabela-propriedades-BokvDD3b.js} +826 -845
  119. package/dist/ui-tabela-propriedades-Boy7I5yW.js +2412 -0
  120. package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +141 -0
  121. package/dist/ui-tabela-propriedades-Df9ajC6M.js +2648 -0
  122. package/dist/ui-toast-Bp_NlM5G.js +156 -0
  123. package/dist/ui-toast-DGTZKne5.cjs +20 -0
  124. package/dist/zero-js-triggers-C_KrvFOQ.js +244 -0
  125. package/dist/zero-js-triggers-C_gtaojZ.cjs +1 -0
  126. package/package.json +3 -3
  127. package/dist/acessibilidade-CSzX-DkG.cjs +0 -1
  128. package/dist/acessibilidade-CUlSXc2X.js +0 -38
  129. package/dist/altura-controle-ukMRPckR.cjs +0 -1
  130. package/dist/altura-controle-vxQiXG4q.js +0 -62
  131. package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +0 -16
  132. package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +0 -24
  133. package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +0 -14
  134. package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +0 -17
  135. package/dist/components/ui-camadas/camadas-colecao.d.ts +0 -27
  136. package/dist/components/ui-camadas/camadas-drop-ops.d.ts +0 -31
  137. package/dist/components/ui-camadas/camadas-hierarquia.d.ts +0 -10
  138. package/dist/components/ui-camadas/camadas-lembranca.d.ts +0 -34
  139. package/dist/components/ui-camadas/camadas-render.d.ts +0 -15
  140. package/dist/components/ui-camadas/camadas-renomear.d.ts +0 -12
  141. package/dist/components/ui-camadas/camadas-selecao-api.d.ts +0 -17
  142. package/dist/components/ui-camadas/camadas-thumb.d.ts +0 -1
  143. package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +0 -15
  144. package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +0 -22
  145. package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +0 -26
  146. package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +0 -21
  147. package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +0 -39
  148. package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +0 -68
  149. package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +0 -37
  150. package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +0 -48
  151. package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +0 -28
  152. package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +0 -22
  153. package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +0 -53
  154. package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +0 -33
  155. package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +0 -5
  156. package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +0 -5
  157. package/dist/components/ui-canvas-cad/tipos.d.ts +0 -37
  158. package/dist/components/ui-linha/index.d.ts +0 -1
  159. package/dist/components/ui-linha/ui-linha.d.ts +0 -48
  160. package/dist/components/ui-mapa/mapa-atributos.d.ts +0 -14
  161. package/dist/components/ui-mapa/mapa-basemaps.d.ts +0 -7
  162. package/dist/components/ui-mapa/mapa-icones.d.ts +0 -4
  163. package/dist/components/ui-mapa/mapa-leaflet.d.ts +0 -5
  164. package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +0 -22
  165. package/dist/components/ui-mapa/tipos.d.ts +0 -13
  166. package/dist/components/ui-modal/modal-foco.d.ts +0 -28
  167. package/dist/components/ui-tabela/tabela-estados.d.ts +0 -16
  168. package/dist/components/ui-tabela/tabela-rolagem.d.ts +0 -44
  169. package/dist/components/ui-tabela/tabela-teclado.d.ts +0 -16
  170. package/dist/components/ui-tooltip/tooltip-popover.d.ts +0 -7
  171. package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +0 -29
  172. package/dist/core/altura-controle.d.ts +0 -34
  173. package/dist/core/opcoes.d.ts +0 -9
  174. package/dist/core/rotulo-controle.d.ts +0 -13
  175. package/dist/form-validacao-BlQFxUVj.js +0 -104
  176. package/dist/form-validacao-DIeyQVH5.cjs +0 -1
  177. package/dist/gerencigeo-canvas/popup_gate.d.ts +0 -30
  178. package/dist/gerencigeo-canvas/zoom_opcoes.d.ts +0 -10
  179. package/dist/opcoes-CJYLi6kd.js +0 -12
  180. package/dist/opcoes-CkyDxBuQ.cjs +0 -1
  181. package/dist/ui-badge-BWhoGgo9.js +0 -197
  182. package/dist/ui-badge-SIR81R9l.cjs +0 -28
  183. package/dist/ui-botao-D24oXySA.cjs +0 -12
  184. package/dist/ui-botao-Dsj08jjw.js +0 -165
  185. package/dist/ui-campo-texto-DauJCde3.cjs +0 -16
  186. package/dist/ui-card-BrjBL-yo.cjs +0 -20
  187. package/dist/ui-controle-cores-DgEza3wF.js +0 -612
  188. package/dist/ui-controle-cores-uY__TgwW.cjs +0 -117
  189. package/dist/ui-linha-C6HBnsaw.cjs +0 -19
  190. package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
  191. package/dist/ui-switch-D9a8XlVX.cjs +0 -53
@@ -0,0 +1,156 @@
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
+ 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
+ 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
+ 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
+ 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
+ };
12
+ class u extends b {
13
+ constructor() {
14
+ super();
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
+ const t = this.attachShadow({ mode: "open" });
27
+ t.innerHTML = `
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
+ <span class="ui-alerta__mensagem-texto" style="display: none;"></span>
35
+ <slot></slot>
36
+ </p>
37
+ </div>
38
+ <div class="ui-alerta__acoes" style="display: none;">
39
+ <button type="button" class="ui-alerta__botao-acao" part="acao"></button>
40
+ </div>
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
+ <div class="ui-toast__progresso-barra"></div>
44
+ </div>
45
+ </div>
46
+ `, 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");
47
+ }
48
+ static get observedAttributes() {
49
+ return [
50
+ "tipo",
51
+ "variante",
52
+ "variant",
53
+ "titulo",
54
+ "title",
55
+ "mensagem",
56
+ "fechavel",
57
+ "dismissible"
58
+ ];
59
+ }
60
+ connectedCallback() {
61
+ this.listeners.cleanup(), this.listeners.add(this.closeElement, "click", () => this.fechar()), this.syncState();
62
+ }
63
+ disconnectedCallback() {
64
+ this.listeners.cleanup();
65
+ }
66
+ attributeChangedCallback(t, o, e) {
67
+ this.syncState();
68
+ }
69
+ fechar() {
70
+ this.dispatchEvent(
71
+ new CustomEvent("ui-fechar", {
72
+ bubbles: !0,
73
+ composed: !0
74
+ })
75
+ ), this.remove();
76
+ }
77
+ syncState() {
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
+ this.alertaElement.className = `ui-alerta ui-alerta--${t}`;
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
+ }
83
+ }
84
+ c("ui-alerta", u);
85
+ class n extends u {
86
+ constructor() {
87
+ super(...arguments);
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
+ new CustomEvent("ui-toast-acao", {
98
+ detail: {
99
+ rotulo: (e = this.acaoConfig) == null ? void 0 : e.rotulo,
100
+ tipo: (s = this.acaoConfig) == null ? void 0 : s.tipo
101
+ },
102
+ bubbles: !0,
103
+ composed: !0
104
+ })
105
+ ), this.fechar();
106
+ });
107
+ r(this, "pausarTimer", () => {
108
+ if (this.isPausado || this.tempoRestante <= 0) return;
109
+ this.isPausado = !0, this.timerId && (clearTimeout(this.timerId), this.timerId = null);
110
+ const t = Date.now() - this.inicioTimestamp;
111
+ this.tempoRestante = Math.max(0, this.tempoRestante - t), this.progressoBarra.style.animationPlayState = "paused";
112
+ });
113
+ r(this, "retomarTimer", () => {
114
+ !this.isPausado || this.tempoRestante <= 0 || (this.isPausado = !1, this.progressoBarra.style.animationPlayState = "running", this.iniciarTimer(Math.max(this.tempoRestante, 300)));
115
+ });
116
+ }
117
+ configurarAcao(t) {
118
+ this.acaoConfig = t, this.botaoAcaoElement.textContent = t.rotulo, this.acoesElement.style.display = "flex";
119
+ const o = t.tipo || "primario";
120
+ this.botaoAcaoElement.className = `ui-alerta__botao-acao ui-alerta__botao-acao--${o}`;
121
+ }
122
+ connectedCallback() {
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", 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
+ }
127
+ fechar() {
128
+ const t = this.parentElement || this.containerRef;
129
+ super.fechar(), t && t.id.startsWith("ui-toast-container-") && t.children.length === 0 && t.remove();
130
+ }
131
+ disconnectedCallback() {
132
+ 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);
133
+ }
134
+ iniciarTimer(t) {
135
+ this.timerId && clearTimeout(this.timerId), this.inicioTimestamp = Date.now(), this.timerId = setTimeout(() => {
136
+ this.fechar();
137
+ }, t);
138
+ }
139
+ static obterContainer(t) {
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
+ }
144
+ // Utilitário estático para disparo imperativo de Toasts de qualquer lugar no código
145
+ static notificar(t) {
146
+ if (typeof document > "u") return null;
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
+ }
150
+ }
151
+ c("ui-toast", n);
152
+ export {
153
+ l as I,
154
+ u as U,
155
+ n as a
156
+ };
@@ -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": "2.8.1",
3
+ "version": "2.8.2",
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",
@@ -149,8 +149,8 @@
149
149
  "check:layers": "node scripts/check-layers.mjs",
150
150
  "test:run": "vitest run",
151
151
  "test:ssr": "vitest run tests/ssr-safety.test.ts",
152
- "gate": "npm run check:layers && npm run check:types && npm run test:run",
153
- "gate:full": "npm run gate && npm run build && npm run check:framework-types"
152
+ "gate": "npm run check:layers && npm run check:types && npm run check:framework-types && npm run test:run",
153
+ "gate:full": "npm run gate && npm run build"
154
154
  },
155
155
  "peerDependencies": {
156
156
  "leaflet": "^1.9.4"
@@ -1 +0,0 @@
1
- "use strict";let d=0;function m(t="ui"){return d+=1,`${t}-${d.toString(36)}-${Math.random().toString(36).slice(2,7)}`}function f(t,e){if(t===e)return"";if(t.nodeType===3)return t.textContent??"";let i="";return t.childNodes.forEach(r=>{i+=f(r,e)}),i}function b(t,e){var l,n,u;const i=(l=t.getAttribute("aria-label"))==null?void 0:l.trim();if(i)return i;const r=new Set;try{(n=e==null?void 0:e.labels)==null||n.forEach(o=>r.add(o))}catch{}if(t.id){const o=t.getRootNode();(u=o.querySelectorAll)==null||u.call(o,"label[for]").forEach(a=>{a.htmlFor===t.id&&r.add(a)})}const c=t.closest("label");return c&&r.add(c),Array.from(r).map(o=>f(o,t).replace(/\s+/g," ").trim()).filter(Boolean).join(" ")}function E(t,e){return e.composedPath()[0]===t}exports.cliqueVeioDeRotuloExterno=E;exports.gerarIdUnico=m;exports.obterRotuloExterno=b;
@@ -1,38 +0,0 @@
1
- let d = 0;
2
- function m(t = "ui") {
3
- return d += 1, `${t}-${d.toString(36)}-${Math.random().toString(36).slice(2, 7)}`;
4
- }
5
- function f(t, e) {
6
- if (t === e) return "";
7
- if (t.nodeType === 3) return t.textContent ?? "";
8
- let a = "";
9
- return t.childNodes.forEach((r) => {
10
- a += f(r, e);
11
- }), a;
12
- }
13
- function b(t, e) {
14
- var i, l, n;
15
- const a = (i = t.getAttribute("aria-label")) == null ? void 0 : i.trim();
16
- if (a) return a;
17
- const r = /* @__PURE__ */ new Set();
18
- try {
19
- (l = e == null ? void 0 : e.labels) == null || l.forEach((o) => r.add(o));
20
- } catch {
21
- }
22
- if (t.id) {
23
- const o = t.getRootNode();
24
- (n = o.querySelectorAll) == null || n.call(o, "label[for]").forEach((u) => {
25
- u.htmlFor === t.id && r.add(u);
26
- });
27
- }
28
- const c = t.closest("label");
29
- return c && r.add(c), Array.from(r).map((o) => f(o, t).replace(/\s+/g, " ").trim()).filter(Boolean).join(" ");
30
- }
31
- function s(t, e) {
32
- return e.composedPath()[0] === t;
33
- }
34
- export {
35
- s as c,
36
- m as g,
37
- b as o
38
- };
@@ -1 +0,0 @@
1
- "use strict";const d=["sm","md","lg"],e="--ui-campo-altura";const u={sm:"sm",compacta:"sm",compacto:"sm",md:"md",padrao:"md",padrão:"md",normal:"md",lg:"lg",relaxada:"lg",relaxado:"lg",conforto:"lg"},T={sm:"var(--ui-altura-sm, 26px)",md:"var(--ui-altura-md, 34px)",lg:"var(--ui-altura-lg, 42px)"};function A(t){const r=(t??"").trim().toLowerCase();return Object.prototype.hasOwnProperty.call(u,r)?u[r]:null}function m(t){const r=A(t);return r?T[r]:null}function i(t){if(t==null)return null;const r=String(t).trim().toLowerCase(),n=/^(\d+(?:\.\d+)?|\.\d+)(px|rem|em)?$/.exec(r);if(!n)return null;const a=Number(n[1]);if(!Number.isFinite(a)||a<=0)return null;const l=n[2]??"px";return l==="px"?`${Math.min(200,Math.max(15,a))}px`:`${Math.min(12.5,a)}${l}`}function s(t){return i(t.altura)??m(t.tamanho)}function c(t){return{altura:t.getAttribute("altura")??t.getAttribute("height"),tamanho:t.getAttribute("tamanho")??t.getAttribute("size")??t.getAttribute("densidade")}}const o=new WeakSet;function _(t){try{const r=s(c(t));r?(t.style.setProperty(e,r),o.add(t)):o.has(t)&&(t.style.removeProperty(e),o.delete(t))}catch{}}exports.TAMANHOS_CONTROLE=d;exports.VARIAVEL_ALTURA_CONTROLE=e;exports.alturaDoTamanho=m;exports.aplicarAlturaControle=_;exports.lerEntradaAltura=c;exports.normalizarAltura=i;exports.normalizarTamanhoControle=A;exports.resolverAlturaControle=s;
@@ -1,62 +0,0 @@
1
- const p = ["sm", "md", "lg"], u = "--ui-campo-altura";
2
- const s = {
3
- sm: "sm",
4
- compacta: "sm",
5
- compacto: "sm",
6
- md: "md",
7
- padrao: "md",
8
- padrão: "md",
9
- normal: "md",
10
- lg: "lg",
11
- relaxada: "lg",
12
- relaxado: "lg",
13
- conforto: "lg"
14
- }, l = {
15
- sm: "var(--ui-altura-sm, 26px)",
16
- md: "var(--ui-altura-md, 34px)",
17
- lg: "var(--ui-altura-lg, 42px)"
18
- };
19
- function m(t) {
20
- const a = (t ?? "").trim().toLowerCase();
21
- return Object.prototype.hasOwnProperty.call(s, a) ? s[a] : null;
22
- }
23
- function i(t) {
24
- const a = m(t);
25
- return a ? l[a] : null;
26
- }
27
- function c(t) {
28
- if (t == null) return null;
29
- const a = String(t).trim().toLowerCase(), n = /^(\d+(?:\.\d+)?|\.\d+)(px|rem|em)?$/.exec(a);
30
- if (!n) return null;
31
- const r = Number(n[1]);
32
- if (!Number.isFinite(r) || r <= 0) return null;
33
- const e = n[2] ?? "px";
34
- return e === "px" ? `${Math.min(200, Math.max(15, r))}px` : `${Math.min(12.5, r)}${e}`;
35
- }
36
- function A(t) {
37
- return c(t.altura) ?? i(t.tamanho);
38
- }
39
- function d(t) {
40
- return {
41
- altura: t.getAttribute("altura") ?? t.getAttribute("height"),
42
- tamanho: t.getAttribute("tamanho") ?? t.getAttribute("size") ?? t.getAttribute("densidade")
43
- };
44
- }
45
- const o = /* @__PURE__ */ new WeakSet();
46
- function _(t) {
47
- try {
48
- const a = A(d(t));
49
- a ? (t.style.setProperty(u, a), o.add(t)) : o.has(t) && (t.style.removeProperty(u), o.delete(t));
50
- } catch {
51
- }
52
- }
53
- export {
54
- p as T,
55
- u as V,
56
- i as a,
57
- _ as b,
58
- m as c,
59
- d as l,
60
- c as n,
61
- A as r
62
- };