@thibezer/ui-components-kit 2.17.1 → 2.17.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 (116) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/camadas.cjs +51 -52
  3. package/dist/camadas.js +136 -135
  4. package/dist/custom-elements.json +4090 -4090
  5. package/package.json +1 -1
  6. package/dist/form-validacao-BIOXxt-1.js +0 -140
  7. package/dist/form-validacao-ytRYSF3E.cjs +0 -1
  8. package/dist/gerencigeo-canvas/layer_defaults.d.ts +0 -3
  9. package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +0 -6
  10. package/dist/gerencigeo-canvas/layer_state_ops.d.ts +0 -6
  11. package/dist/leaflet-DcO7uRC-.cjs +0 -1
  12. package/dist/leaflet-PPDKB6Dd.js +0 -69
  13. package/dist/motor-BCWqlv3e.cjs +0 -1
  14. package/dist/motor-CXjQjVba.js +0 -1386
  15. package/dist/svg-seguro-BsbNQqpd.js +0 -50
  16. package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
  17. package/dist/ui-badge-1UU8vT-b.js +0 -198
  18. package/dist/ui-badge-B5J_c5P5.js +0 -197
  19. package/dist/ui-badge-BxT-sDmV.cjs +0 -28
  20. package/dist/ui-badge-C0eKBI8E.js +0 -183
  21. package/dist/ui-badge-CKKKPdt8.cjs +0 -28
  22. package/dist/ui-badge-DC4y6Dik.cjs +0 -28
  23. package/dist/ui-botao-BOOnP8ds.cjs +0 -12
  24. package/dist/ui-botao-D24oXySA.cjs +0 -12
  25. package/dist/ui-botao-DfqSivHl.js +0 -165
  26. package/dist/ui-botao-Dsj08jjw.js +0 -165
  27. package/dist/ui-botao-OGJV6Vfk.js +0 -165
  28. package/dist/ui-botao-bU_bf6SU.js +0 -166
  29. package/dist/ui-botao-psS1juof.cjs +0 -12
  30. package/dist/ui-botao-xTbH5mpH.cjs +0 -12
  31. package/dist/ui-campo-texto-19tIrmBK.js +0 -377
  32. package/dist/ui-campo-texto-CH8mzX61.cjs +0 -16
  33. package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
  34. package/dist/ui-campo-texto-DVU_sWV1.cjs +0 -16
  35. package/dist/ui-campo-texto-Uu2dJE_0.js +0 -379
  36. package/dist/ui-campo-texto-W5M0gNE4.js +0 -377
  37. package/dist/ui-card-0wu4rjEX.cjs +0 -20
  38. package/dist/ui-card-B86lJXTP.cjs +0 -20
  39. package/dist/ui-card-BYyYxxY1.cjs +0 -20
  40. package/dist/ui-card-C_o5_0cB.js +0 -111
  41. package/dist/ui-card-CojoGXaT.js +0 -144
  42. package/dist/ui-card-DRtpOo3l.js +0 -143
  43. package/dist/ui-controle-cores-B4R6ct4I.js +0 -291
  44. package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
  45. package/dist/ui-controle-cores-Bq_XUrIQ.cjs +0 -32
  46. package/dist/ui-controle-cores-BtA6yzu3.js +0 -291
  47. package/dist/ui-controle-cores-C8um-If9.cjs +0 -32
  48. package/dist/ui-controle-cores-CHMKGemo.cjs +0 -141
  49. package/dist/ui-controle-cores-C_cVXxCn.js +0 -291
  50. package/dist/ui-controle-cores-CuDFS8Y8.cjs +0 -32
  51. package/dist/ui-controle-cores-Dog7ERYv.js +0 -697
  52. package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
  53. package/dist/ui-linha-BxhEBn27.js +0 -749
  54. package/dist/ui-linha-C306zxWG.cjs +0 -19
  55. package/dist/ui-linha-C_azWkcG.js +0 -517
  56. package/dist/ui-linha-CcalUBDw.cjs +0 -38
  57. package/dist/ui-linha-DAz6DBcl.cjs +0 -38
  58. package/dist/ui-linha-DkxwMhD-.js +0 -749
  59. package/dist/ui-modal-4nU-tXjO.cjs +0 -18
  60. package/dist/ui-modal-BkYvNP0G.js +0 -214
  61. package/dist/ui-modal-BwB9fksp.js +0 -214
  62. package/dist/ui-modal-CUNbpbZ1.cjs +0 -18
  63. package/dist/ui-modal-CvGFGh1h.cjs +0 -18
  64. package/dist/ui-modal-DBOtSTbR.js +0 -238
  65. package/dist/ui-paleta-ferramentas-BXXrI1Y7.js +0 -1233
  66. package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
  67. package/dist/ui-paleta-ferramentas-CU4icLl0.js +0 -1171
  68. package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
  69. package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +0 -21
  70. package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +0 -21
  71. package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
  72. package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
  73. package/dist/ui-paleta-ferramentas-DbwdWVtT.js +0 -1173
  74. package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +0 -21
  75. package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
  76. package/dist/ui-segmented-DyF5YLsV.js +0 -418
  77. package/dist/ui-segmented-rn9RxRGM.cjs +0 -19
  78. package/dist/ui-segmented-wUraId2e.js +0 -412
  79. package/dist/ui-seletor-cor-C4U2eqxY.cjs +0 -82
  80. package/dist/ui-seletor-cor-D2_C6Aor.js +0 -391
  81. package/dist/ui-seletor-cor-DPKqf5wb.cjs +0 -82
  82. package/dist/ui-seletor-cor-FYtRccnK.js +0 -396
  83. package/dist/ui-skeleton-B2Rgrv8o.js +0 -648
  84. package/dist/ui-skeleton-DEHwpDqa.js +0 -648
  85. package/dist/ui-skeleton-DI4_9WOX.js +0 -428
  86. package/dist/ui-skeleton-DiOxTBZK.cjs +0 -52
  87. package/dist/ui-skeleton-SPYqku8P.cjs +0 -52
  88. package/dist/ui-skeleton-W9uwIceA.js +0 -585
  89. package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
  90. package/dist/ui-skeleton-sIphhOSx.cjs +0 -52
  91. package/dist/ui-switch-BL-x_-SM.js +0 -1202
  92. package/dist/ui-switch-BcOqOkiV.js +0 -856
  93. package/dist/ui-switch-C0i_3QXu.cjs +0 -66
  94. package/dist/ui-switch-D7iPKDj-.cjs +0 -53
  95. package/dist/ui-switch-DAIgOhqr.cjs +0 -66
  96. package/dist/ui-switch-_F8yubdX.js +0 -1203
  97. package/dist/ui-tabela-propriedades-2bq2nX-b.js +0 -3202
  98. package/dist/ui-tabela-propriedades-8IAYmk3P.cjs +0 -142
  99. package/dist/ui-tabela-propriedades-B8AwlpqL.cjs +0 -141
  100. package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
  101. package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
  102. package/dist/ui-tabela-propriedades-BoYXzP5Z.js +0 -3191
  103. package/dist/ui-tabela-propriedades-BokvDD3b.js +0 -2648
  104. package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
  105. package/dist/ui-tabela-propriedades-C-PeuW1i.cjs +0 -141
  106. package/dist/ui-tabela-propriedades-C5YYnod1.js +0 -3053
  107. package/dist/ui-tabela-propriedades-CnfW9DZG.cjs +0 -142
  108. package/dist/ui-tabela-propriedades-CyPyKXtB.js +0 -3013
  109. package/dist/ui-tabela-propriedades-DWOKznMN.cjs +0 -142
  110. package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
  111. package/dist/ui-tabela-propriedades-DqvPilK_.cjs +0 -142
  112. package/dist/ui-tabela-propriedades-DuaC4sFX.js +0 -2767
  113. package/dist/ui-toast-Bp_NlM5G.js +0 -156
  114. package/dist/ui-toast-DGTZKne5.cjs +0 -20
  115. package/dist/zero-js-triggers-C_KrvFOQ.js +0 -244
  116. package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
@@ -1,291 +0,0 @@
1
- var k = Object.defineProperty;
2
- var S = (d, l, e) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[l] = e;
3
- var s = (d, l, e) => S(d, typeof l != "symbol" ? l + "" : l, e);
4
- import { d as T, S as w } from "./ssr-safe-5cWfJP-s.js";
5
- import { L as q } from "./listener-bag-DQgv7OON.js";
6
- import { b as g, n as m, c as $, d as P, a as E } from "./ui-seletor-cor-FYtRccnK.js";
7
- const M = ':host{--_a: var(--ui-controle-cores-amostra, 26px);--_pilha: calc(var(--_a) * 5 / 3);--_borda: color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 30%, transparent);--_borda-forte: color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 70%, transparent);--_base: var(--ui-cor-superficie, #1d1d22);--_destaque: var(--ui-cor-primaria, #00e08a);--_vermelho: #ef4444;display:inline-block;flex-shrink:0;-webkit-user-select:none;user-select:none}:host([hidden]){display:none}*,*:before,*:after{box-sizing:border-box}.pilha{display:flex;align-items:stretch;gap:6px}.amostras{position:relative;flex:none;width:var(--_pilha);height:var(--_pilha)}.amostra{position:absolute;width:var(--_a);height:var(--_a);padding:0;background:var(--_base);border:1px solid var(--_borda);border-radius:6px;cursor:pointer;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease}.amostra--traco{right:0;bottom:0;z-index:1}.amostra--preenchimento{top:0;left:0;z-index:2;box-shadow:0 2px 6px #00000059}.amostra:hover{border-color:var(--_borda-forte);transform:scale(1.05)}.amostra:focus-visible{outline:2px solid var(--ui-cor-texto, #e1e1e6);outline-offset:2px}.amostra--ativa,.amostra--ativa:hover{z-index:3;border-color:var(--_destaque);box-shadow:0 0 0 1.5px var(--_destaque),0 2px 6px #00000059}:host([so-traco]) .amostra--preenchimento{opacity:.4}.face{position:absolute;top:3px;right:3px;bottom:3px;left:3px;border-radius:3.5px;pointer-events:none}.face--traco{background:transparent;border:4px solid #ffffff}.face--sem-cor{background:repeating-conic-gradient(#3a3a45,#3a3a45 25%,#24242b 0%,#24242b 50%) 50% / 6px 6px!important;border-color:#ef44448c!important;overflow:hidden}.face--sem-cor:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(to top right,transparent calc(50% - 1px),var(--_vermelho) calc(50% - 1px),var(--_vermelho) calc(50% + 1px),transparent calc(50% + 1px))}.face--misto{display:flex;align-items:center;justify-content:center;background:#2e2e38!important;border-color:#64748b!important}.face--misto:after{content:"?";color:#fff;font-size:12px;font-weight:800;line-height:1;text-shadow:0 1px 2px rgba(0,0,0,.8)}.acoes{display:flex;flex:none;flex-direction:column;gap:2px;width:16px}.acao{display:flex;flex:1;align-items:center;justify-content:center;min-height:0;padding:0;background:transparent;border:0;border-radius:4px;color:var(--ui-cor-texto-secundario, #9696a6);cursor:pointer;transition:color .15s ease,background .15s ease}.acao:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent);color:var(--_destaque)}.acao:focus-visible{outline:2px solid var(--ui-cor-texto, #e1e1e6);outline-offset:1px}.acao svg{width:12px;height:12px}.acao--sem-cor:hover{background:#ef444433;color:var(--_vermelho)}.icone-padrao{position:relative;width:11px;height:11px}.ponto{position:absolute;width:7px;height:7px;border-radius:1.5px}.ponto--preenchimento{top:0;left:0;background:#00e08a;border:1px solid var(--_borda-forte)}.ponto--traco{right:0;bottom:0;background:var(--_base);border:1.5px solid #ffffff}:host([desabilitado]) .pilha{opacity:.5}:host([desabilitado]) .amostra,:host([desabilitado]) .acao{cursor:not-allowed;pointer-events:none}@media (prefers-reduced-motion: reduce){.amostra,.acao{transition:none}.amostra:hover{transform:none}}';
8
- class j extends w {
9
- constructor() {
10
- super();
11
- s(this, "raiz");
12
- s(this, "listeners", new q());
13
- s(this, "renderizado", !1);
14
- s(this, "_preenchimento", "#00e08a");
15
- s(this, "_traco", "#ffffff");
16
- s(this, "_opacidade", 0.35);
17
- s(this, "_espessuraTraco", 2.5);
18
- s(this, "_alvo", "preenchimento");
19
- s(this, "_misto", { preenchimento: !1, traco: !1 });
20
- s(this, "_padrao", { preenchimento: "#00e08a", traco: "#ffffff" });
21
- s(this, "_coresProjeto", []);
22
- s(this, "_atalhos", {});
23
- s(this, "seletor", null);
24
- s(this, "estadoAoAbrir", null);
25
- this.raiz = this.attachShadow({ mode: "open" });
26
- }
27
- static get observedAttributes() {
28
- return ["preenchimento", "traco", "opacidade", "espessura-traco", "alvo", "padrao-preenchimento", "padrao-traco", "desabilitado"];
29
- }
30
- connectedCallback() {
31
- this.renderizado || this.renderizar(), this.listeners.cleanup(), this.vincularEventos(), this.atualizar();
32
- }
33
- disconnectedCallback() {
34
- this.fecharSeletor(!0), this.listeners.cleanup();
35
- }
36
- attributeChangedCallback(e, t, r) {
37
- if (t !== r) {
38
- if (e === "desabilitado") {
39
- this.hasAttribute("desabilitado") && this.fecharSeletor(!1), this.atualizar();
40
- return;
41
- }
42
- if (r !== null) {
43
- if (e === "preenchimento") this.definirCores({ preenchimento: r });
44
- else if (e === "traco") this.definirCores({ traco: r });
45
- else if (e === "opacidade") this.definirCores({ opacidade: Number(r) });
46
- else if (e === "espessura-traco") this.definirCores({ espessuraTraco: g(r) });
47
- else if (e === "alvo") this.definirAlvo(r);
48
- else if (e === "padrao-preenchimento" || e === "padrao-traco") {
49
- const a = m(r);
50
- if (!a) return;
51
- e === "padrao-preenchimento" ? this._padrao.preenchimento = a : this._padrao.traco = a, this.atualizar();
52
- }
53
- }
54
- }
55
- }
56
- /* ---------- Propriedades ---------- */
57
- get preenchimento() {
58
- return this._preenchimento;
59
- }
60
- set preenchimento(e) {
61
- this.definirCores({ preenchimento: e });
62
- }
63
- get traco() {
64
- return this._traco;
65
- }
66
- set traco(e) {
67
- this.definirCores({ traco: e });
68
- }
69
- get opacidade() {
70
- return this._opacidade;
71
- }
72
- set opacidade(e) {
73
- this.definirCores({ opacidade: e });
74
- }
75
- get espessuraTraco() {
76
- return this._espessuraTraco;
77
- }
78
- set espessuraTraco(e) {
79
- this.definirCores({ espessuraTraco: e });
80
- }
81
- get alvo() {
82
- return this._alvo;
83
- }
84
- set alvo(e) {
85
- this.definirAlvo(e);
86
- }
87
- /** @deprecated Ignorado: o seletor de cor não mostra mais amostras de cores. */
88
- get coresProjeto() {
89
- return [...this._coresProjeto];
90
- }
91
- set coresProjeto(e) {
92
- this._coresProjeto = $(e);
93
- }
94
- /** Teclas exibidas nas dicas dos botões (ex.: `{ inverter: 'Shift+X' }`). */
95
- get atalhos() {
96
- return { ...this._atalhos };
97
- }
98
- set atalhos(e) {
99
- this._atalhos = { ...e || {} }, this.atualizar();
100
- }
101
- get seletorAberto() {
102
- var e;
103
- return !!((e = this.seletor) != null && e.aberto);
104
- }
105
- /* ---------- Métodos (sem eventos) ---------- */
106
- /** Define cores, opacidade e/ou espessura sem emitir eventos. Valores inválidos são ignorados; uma cor definida deixa de ser "mista". */
107
- definirCores(e = {}) {
108
- const t = m(e.preenchimento), r = m(e.traco);
109
- t && (this._preenchimento = t, this._misto.preenchimento = !1), r && (this._traco = r, this._misto.traco = !1), e.opacidade !== void 0 && (this._opacidade = P(e.opacidade, this._opacidade)), e.espessuraTraco !== void 0 && (this._espessuraTraco = g(e.espessuraTraco, this._espessuraTraco)), this.atualizar();
110
- }
111
- obterCores() {
112
- return {
113
- preenchimento: this._preenchimento,
114
- traco: this._traco,
115
- opacidade: this._opacidade,
116
- espessuraTraco: this._espessuraTraco,
117
- alvo: this._alvo
118
- };
119
- }
120
- /** Marca a amostra como ativa sem emitir eventos. */
121
- definirAlvo(e) {
122
- this._alvo = e === "traco" ? "traco" : "preenchimento", this.atualizar(), this.sincronizarSeletor();
123
- }
124
- /** Mostra "?" nas amostras cujas cores divergem na seleção atual. */
125
- definirMisto(e = {}) {
126
- this._misto = { preenchimento: !!e.preenchimento, traco: !!e.traco }, this.atualizar();
127
- }
128
- /* ---------- Ações (emitem eventos) ---------- */
129
- /** Alterna o alvo ativo entre preenchimento e traço; emite `ui-alvo-change`. */
130
- alternarAlvo() {
131
- this.mudarAlvo(this._alvo === "traco" ? "preenchimento" : "traco");
132
- }
133
- /** Troca preenchimento e traço; emite `ui-cores-change` confirmado. */
134
- inverter() {
135
- const e = this._preenchimento;
136
- this._preenchimento = this._traco, this._traco = e, this._misto = { preenchimento: this._misto.traco, traco: this._misto.preenchimento }, this.atualizar(), this.emitirCores(!0, ["preenchimento", "traco"], "inverter");
137
- }
138
- /** "Sem cor" no alvo indicado (padrão: o ativo); emite `ui-cores-change` confirmado. */
139
- semCor(e = this._alvo) {
140
- const t = e === "traco" ? "traco" : "preenchimento";
141
- t === "traco" ? this._traco = "none" : this._preenchimento = "none", this._misto[t] = !1, this.atualizar(), this.emitirCores(!0, [t], "sem-cor");
142
- }
143
- /** Volta às cores de `padrao-preenchimento` e `padrao-traco`; emite `ui-cores-change` confirmado. */
144
- restaurarPadrao() {
145
- this._preenchimento = this._padrao.preenchimento, this._traco = this._padrao.traco, this._misto = { preenchimento: !1, traco: !1 }, this.atualizar(), this.emitirCores(!0, ["preenchimento", "traco"], "padrao");
146
- }
147
- /** Abre o seletor de cor ancorado na amostra do alvo (que passa a ser o ativo). Com `focar`, leva o foco do teclado para o painel. */
148
- abrirSeletor(e = this._alvo, t = !1) {
149
- if (this.hasAttribute("desabilitado") || (this.mudarAlvo(e === "traco" ? "traco" : "preenchimento"), this.seletorAberto)) return;
150
- const r = this.raiz.querySelector(`[data-alvo="${this._alvo}"]`) || this;
151
- this.estadoAoAbrir = this.obterCores(), this.seletor = E({
152
- ancora: r,
153
- titulo: this.getAttribute("titulo-seletor") || "Cores e estilo",
154
- modo: "duplo",
155
- alvo: this._alvo,
156
- preenchimento: this._preenchimento,
157
- traco: this._traco,
158
- opacidade: this._opacidade,
159
- espessuraTraco: this._espessuraTraco,
160
- misto: this._misto[this._alvo],
161
- focar: t,
162
- aoAlterar: (a) => this.aplicarDoSeletor(a, !1),
163
- aoConfirmar: (a) => {
164
- this.seletor = null, this.aplicarDoSeletor(a, !0);
165
- },
166
- aoCancelar: () => {
167
- this.seletor = null, this.estadoAoAbrir = null;
168
- },
169
- aoTrocarAlvo: (a) => this.mudarAlvo(a)
170
- });
171
- }
172
- /**
173
- * Fecha o seletor aberto por este controle. Com `confirmar` (padrão), grava o que foi editado;
174
- * sem ele, cancela: as cores iniciais voltam (com um `ui-cores-change` não confirmado) e nada é confirmado.
175
- */
176
- fecharSeletor(e = !0) {
177
- const t = this.seletor;
178
- t && (e ? t.fechar(!0) : t.elemento.cancelar());
179
- }
180
- /* ---------- Interno ---------- */
181
- mudarAlvo(e) {
182
- e !== this._alvo && (this._alvo = e, this.atualizar(), this.sincronizarSeletor(), this.dispatchEvent(new CustomEvent("ui-alvo-change", { detail: { alvo: e }, bubbles: !0, composed: !0 })));
183
- }
184
- /** Mantém a aba do seletor aberto igual ao alvo do controle. */
185
- sincronizarSeletor() {
186
- var e, t;
187
- (t = (e = this.seletor) == null ? void 0 : e.elemento) == null || t.trocarAlvo(this._alvo);
188
- }
189
- aplicarDoSeletor(e, t) {
190
- const r = (o) => {
191
- const p = [];
192
- return e.preenchimento !== o.preenchimento && p.push("preenchimento"), e.traco !== o.traco && p.push("traco"), e.opacidade !== o.opacidade && p.push("opacidade"), e.espessuraTraco !== void 0 && Math.abs(e.espessuraTraco - o.espessuraTraco) > 0.05 && p.push("espessuraTraco"), p;
193
- }, a = r(this.obterCores());
194
- if (this._preenchimento = e.preenchimento, this._traco = e.traco, this._opacidade = e.opacidade, e.espessuraTraco !== void 0 && (this._espessuraTraco = e.espessuraTraco), a.includes("preenchimento") && (this._misto.preenchimento = !1), a.includes("traco") && (this._misto.traco = !1), this.atualizar(), !t) {
195
- a.length && this.emitirCores(!1, a, "seletor");
196
- return;
197
- }
198
- this.emitirCores(!0, this.estadoAoAbrir ? r(this.estadoAoAbrir) : a, "seletor"), this.estadoAoAbrir = null;
199
- }
200
- emitirCores(e, t, r) {
201
- const a = { ...this.obterCores(), confirmado: e, alterados: t, origem: r };
202
- this.dispatchEvent(new CustomEvent("ui-cores-change", { detail: a, bubbles: !0, composed: !0 }));
203
- }
204
- dica(e, t) {
205
- return t ? `${e} [${t}]` : e;
206
- }
207
- renderizar() {
208
- this.raiz.innerHTML = `
209
- <style>${M}</style>
210
- <div class="pilha" part="pilha" role="group" aria-label="Cores de desenho">
211
- <div class="amostras" part="amostras">
212
- <button type="button" class="amostra amostra--traco" data-alvo="traco" part="amostra amostra-traco">
213
- <span class="face face--traco"></span>
214
- </button>
215
- <button type="button" class="amostra amostra--preenchimento" data-alvo="preenchimento" part="amostra amostra-preenchimento">
216
- <span class="face face--preenchimento"></span>
217
- </button>
218
- </div>
219
- <div class="acoes" part="acoes">
220
- <button type="button" class="acao acao--inverter" data-acao="inverter" part="acao acao-inverter" aria-label="Inverter preenchimento e traço">
221
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
222
- <path d="m16 3 4 4-4 4"/><path d="M20 7H4"/><path d="m8 21-4-4 4-4"/><path d="M4 17h16"/>
223
- </svg>
224
- </button>
225
- <button type="button" class="acao acao--sem-cor" data-acao="sem-cor" part="acao acao-sem-cor" aria-label="Sem cor">
226
- <svg viewBox="0 0 24 24" fill="none" stroke-width="2.4" stroke-linecap="round" aria-hidden="true">
227
- <circle cx="12" cy="12" r="8" stroke="currentColor"/>
228
- <line x1="6.5" y1="6.5" x2="17.5" y2="17.5" stroke="#ef4444"/>
229
- </svg>
230
- </button>
231
- <button type="button" class="acao acao--padrao" data-acao="padrao" part="acao acao-padrao" aria-label="Restaurar cores padrão">
232
- <span class="icone-padrao" aria-hidden="true">
233
- <span class="ponto ponto--preenchimento"></span>
234
- <span class="ponto ponto--traco"></span>
235
- </span>
236
- </button>
237
- </div>
238
- </div>
239
- `, this.renderizado = !0;
240
- }
241
- vincularEventos() {
242
- const e = this.raiz;
243
- e.querySelectorAll("[data-alvo]").forEach((r) => {
244
- const a = r.dataset.alvo;
245
- this.listeners.add(r, "click", (o) => {
246
- o.stopPropagation(), a !== this._alvo ? this.mudarAlvo(a) : this.seletorAberto ? this.fecharSeletor(!0) : this.abrirSeletor(a);
247
- }), this.listeners.add(r, "dblclick", (o) => {
248
- o.stopPropagation(), this.abrirSeletor(a);
249
- }), this.listeners.add(r, "keydown", (o) => {
250
- o.key !== "Enter" && o.key !== " " || (o.preventDefault(), a === this._alvo && this.seletorAberto ? this.fecharSeletor(!0) : this.abrirSeletor(a, !0));
251
- }), this.listeners.add(r, "keyup", (o) => {
252
- o.key === " " && o.preventDefault();
253
- });
254
- });
255
- const t = (r, a) => {
256
- this.listeners.add(e.querySelector(`[data-acao="${r}"]`), "click", (o) => {
257
- o.stopPropagation(), a();
258
- });
259
- };
260
- t("inverter", () => this.inverter()), t("sem-cor", () => this.semCor()), t("padrao", () => this.restaurarPadrao());
261
- }
262
- atualizar() {
263
- if (!this.renderizado) return;
264
- const e = this.raiz, t = this._atalhos, r = this.hasAttribute("desabilitado"), a = (i, n) => n ? "Misto (?) [várias cores na seleção]" : i === "none" ? "Sem cor" : i, o = (i, n, c, y, z = "") => {
265
- const h = e.querySelector(`[data-alvo="${i}"]`), u = h == null ? void 0 : h.querySelector(".face");
266
- if (!h || !u) return;
267
- const _ = this._alvo === i;
268
- h.classList.toggle("amostra--ativa", _), h.setAttribute("aria-pressed", String(_)), h.disabled = r, u.classList.toggle("face--misto", c), u.classList.toggle("face--sem-cor", !c && n === "none");
269
- const A = i === "traco" ? "borderColor" : "backgroundColor";
270
- u.style[A] = c || n === "none" ? "" : n, i === "traco" && n !== "none" && !c && (u.style.borderWidth = `${Math.max(2, Math.min(4.5, this._espessuraTraco))}px`);
271
- const x = `${y}: ${a(n, c)}${z}`;
272
- h.title = this.dica(`${x} — clique para ativar, clique de novo para editar`, t.alternar), h.setAttribute("aria-label", x);
273
- }, p = this._preenchimento === "none" || this._misto.preenchimento ? "" : `, opacidade ${Math.round(this._opacidade * 100)}%`;
274
- o("preenchimento", this._preenchimento, this._misto.preenchimento, "Preenchimento", p);
275
- const C = this._traco === "none" || this._misto.traco ? "" : `, espessura ${this._espessuraTraco}px`;
276
- o("traco", this._traco, this._misto.traco, "Traço / contorno", C);
277
- const f = (i, n) => {
278
- const c = e.querySelector(`[data-acao="${i}"]`);
279
- c && (c.title = n, c.disabled = r);
280
- };
281
- f("inverter", this.dica("Inverter preenchimento e traço", t.inverter)), f("sem-cor", this.dica("Sem cor no alvo ativo", t.semCor)), f("padrao", this.dica("Restaurar cores padrão", t.padrao));
282
- const b = e.querySelector(".ponto--preenchimento");
283
- b && (b.style.backgroundColor = this._padrao.preenchimento === "none" ? "transparent" : this._padrao.preenchimento);
284
- const v = e.querySelector(".ponto--traco");
285
- v && (v.style.borderColor = this._padrao.traco === "none" ? "#ef4444" : this._padrao.traco);
286
- }
287
- }
288
- T("ui-controle-cores", j);
289
- export {
290
- j as U
291
- };
@@ -1,32 +0,0 @@
1
- "use strict";var S=Object.defineProperty;var T=(u,h,e)=>h in u?S(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e;var i=(u,h,e)=>T(u,typeof h!="symbol"?h+"":h,e);const g=require("./ssr-safe-CiHD1adl.cjs"),w=require("./listener-bag-D5omxZ9h.cjs"),p=require("./ui-seletor-cor-DPKqf5wb.cjs"),q=':host{--_a: var(--ui-controle-cores-amostra, 26px);--_pilha: calc(var(--_a) * 5 / 3);--_borda: color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 30%, transparent);--_borda-forte: color-mix(in srgb, var(--ui-cor-texto, #e1e1e6) 70%, transparent);--_base: var(--ui-cor-superficie, #1d1d22);--_destaque: var(--ui-cor-primaria, #00e08a);--_vermelho: #ef4444;display:inline-block;flex-shrink:0;-webkit-user-select:none;user-select:none}:host([hidden]){display:none}*,*:before,*:after{box-sizing:border-box}.pilha{display:flex;align-items:stretch;gap:6px}.amostras{position:relative;flex:none;width:var(--_pilha);height:var(--_pilha)}.amostra{position:absolute;width:var(--_a);height:var(--_a);padding:0;background:var(--_base);border:1px solid var(--_borda);border-radius:6px;cursor:pointer;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease}.amostra--traco{right:0;bottom:0;z-index:1}.amostra--preenchimento{top:0;left:0;z-index:2;box-shadow:0 2px 6px #00000059}.amostra:hover{border-color:var(--_borda-forte);transform:scale(1.05)}.amostra:focus-visible{outline:2px solid var(--ui-cor-texto, #e1e1e6);outline-offset:2px}.amostra--ativa,.amostra--ativa:hover{z-index:3;border-color:var(--_destaque);box-shadow:0 0 0 1.5px var(--_destaque),0 2px 6px #00000059}:host([so-traco]) .amostra--preenchimento{opacity:.4}.face{position:absolute;top:3px;right:3px;bottom:3px;left:3px;border-radius:3.5px;pointer-events:none}.face--traco{background:transparent;border:4px solid #ffffff}.face--sem-cor{background:repeating-conic-gradient(#3a3a45,#3a3a45 25%,#24242b 0%,#24242b 50%) 50% / 6px 6px!important;border-color:#ef44448c!important;overflow:hidden}.face--sem-cor:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(to top right,transparent calc(50% - 1px),var(--_vermelho) calc(50% - 1px),var(--_vermelho) calc(50% + 1px),transparent calc(50% + 1px))}.face--misto{display:flex;align-items:center;justify-content:center;background:#2e2e38!important;border-color:#64748b!important}.face--misto:after{content:"?";color:#fff;font-size:12px;font-weight:800;line-height:1;text-shadow:0 1px 2px rgba(0,0,0,.8)}.acoes{display:flex;flex:none;flex-direction:column;gap:2px;width:16px}.acao{display:flex;flex:1;align-items:center;justify-content:center;min-height:0;padding:0;background:transparent;border:0;border-radius:4px;color:var(--ui-cor-texto-secundario, #9696a6);cursor:pointer;transition:color .15s ease,background .15s ease}.acao:hover{background:color-mix(in srgb,var(--ui-cor-texto, #e1e1e6) 12%,transparent);color:var(--_destaque)}.acao:focus-visible{outline:2px solid var(--ui-cor-texto, #e1e1e6);outline-offset:1px}.acao svg{width:12px;height:12px}.acao--sem-cor:hover{background:#ef444433;color:var(--_vermelho)}.icone-padrao{position:relative;width:11px;height:11px}.ponto{position:absolute;width:7px;height:7px;border-radius:1.5px}.ponto--preenchimento{top:0;left:0;background:#00e08a;border:1px solid var(--_borda-forte)}.ponto--traco{right:0;bottom:0;background:var(--_base);border:1.5px solid #ffffff}:host([desabilitado]) .pilha{opacity:.5}:host([desabilitado]) .amostra,:host([desabilitado]) .acao{cursor:not-allowed;pointer-events:none}@media (prefers-reduced-motion: reduce){.amostra,.acao{transition:none}.amostra:hover{transform:none}}';class C extends g.SafeHTMLElement{constructor(){super();i(this,"raiz");i(this,"listeners",new w.ListenerBag);i(this,"renderizado",!1);i(this,"_preenchimento","#00e08a");i(this,"_traco","#ffffff");i(this,"_opacidade",.35);i(this,"_espessuraTraco",2.5);i(this,"_alvo","preenchimento");i(this,"_misto",{preenchimento:!1,traco:!1});i(this,"_padrao",{preenchimento:"#00e08a",traco:"#ffffff"});i(this,"_coresProjeto",[]);i(this,"_atalhos",{});i(this,"seletor",null);i(this,"estadoAoAbrir",null);this.raiz=this.attachShadow({mode:"open"})}static get observedAttributes(){return["preenchimento","traco","opacidade","espessura-traco","alvo","padrao-preenchimento","padrao-traco","desabilitado"]}connectedCallback(){this.renderizado||this.renderizar(),this.listeners.cleanup(),this.vincularEventos(),this.atualizar()}disconnectedCallback(){this.fecharSeletor(!0),this.listeners.cleanup()}attributeChangedCallback(e,t,r){if(t!==r){if(e==="desabilitado"){this.hasAttribute("desabilitado")&&this.fecharSeletor(!1),this.atualizar();return}if(r!==null){if(e==="preenchimento")this.definirCores({preenchimento:r});else if(e==="traco")this.definirCores({traco:r});else if(e==="opacidade")this.definirCores({opacidade:Number(r)});else if(e==="espessura-traco")this.definirCores({espessuraTraco:p.normalizarEspessura(r)});else if(e==="alvo")this.definirAlvo(r);else if(e==="padrao-preenchimento"||e==="padrao-traco"){const a=p.normalizarCor(r);if(!a)return;e==="padrao-preenchimento"?this._padrao.preenchimento=a:this._padrao.traco=a,this.atualizar()}}}}get preenchimento(){return this._preenchimento}set preenchimento(e){this.definirCores({preenchimento:e})}get traco(){return this._traco}set traco(e){this.definirCores({traco:e})}get opacidade(){return this._opacidade}set opacidade(e){this.definirCores({opacidade:e})}get espessuraTraco(){return this._espessuraTraco}set espessuraTraco(e){this.definirCores({espessuraTraco:e})}get alvo(){return this._alvo}set alvo(e){this.definirAlvo(e)}get coresProjeto(){return[...this._coresProjeto]}set coresProjeto(e){this._coresProjeto=p.coresUnicas(e)}get atalhos(){return{...this._atalhos}}set atalhos(e){this._atalhos={...e||{}},this.atualizar()}get seletorAberto(){var e;return!!((e=this.seletor)!=null&&e.aberto)}definirCores(e={}){const t=p.normalizarCor(e.preenchimento),r=p.normalizarCor(e.traco);t&&(this._preenchimento=t,this._misto.preenchimento=!1),r&&(this._traco=r,this._misto.traco=!1),e.opacidade!==void 0&&(this._opacidade=p.normalizarOpacidade(e.opacidade,this._opacidade)),e.espessuraTraco!==void 0&&(this._espessuraTraco=p.normalizarEspessura(e.espessuraTraco,this._espessuraTraco)),this.atualizar()}obterCores(){return{preenchimento:this._preenchimento,traco:this._traco,opacidade:this._opacidade,espessuraTraco:this._espessuraTraco,alvo:this._alvo}}definirAlvo(e){this._alvo=e==="traco"?"traco":"preenchimento",this.atualizar(),this.sincronizarSeletor()}definirMisto(e={}){this._misto={preenchimento:!!e.preenchimento,traco:!!e.traco},this.atualizar()}alternarAlvo(){this.mudarAlvo(this._alvo==="traco"?"preenchimento":"traco")}inverter(){const e=this._preenchimento;this._preenchimento=this._traco,this._traco=e,this._misto={preenchimento:this._misto.traco,traco:this._misto.preenchimento},this.atualizar(),this.emitirCores(!0,["preenchimento","traco"],"inverter")}semCor(e=this._alvo){const t=e==="traco"?"traco":"preenchimento";t==="traco"?this._traco="none":this._preenchimento="none",this._misto[t]=!1,this.atualizar(),this.emitirCores(!0,[t],"sem-cor")}restaurarPadrao(){this._preenchimento=this._padrao.preenchimento,this._traco=this._padrao.traco,this._misto={preenchimento:!1,traco:!1},this.atualizar(),this.emitirCores(!0,["preenchimento","traco"],"padrao")}abrirSeletor(e=this._alvo,t=!1){if(this.hasAttribute("desabilitado")||(this.mudarAlvo(e==="traco"?"traco":"preenchimento"),this.seletorAberto))return;const r=this.raiz.querySelector(`[data-alvo="${this._alvo}"]`)||this;this.estadoAoAbrir=this.obterCores(),this.seletor=p.abrirSeletorCor({ancora:r,titulo:this.getAttribute("titulo-seletor")||"Cores e estilo",modo:"duplo",alvo:this._alvo,preenchimento:this._preenchimento,traco:this._traco,opacidade:this._opacidade,espessuraTraco:this._espessuraTraco,misto:this._misto[this._alvo],focar:t,aoAlterar:a=>this.aplicarDoSeletor(a,!1),aoConfirmar:a=>{this.seletor=null,this.aplicarDoSeletor(a,!0)},aoCancelar:()=>{this.seletor=null,this.estadoAoAbrir=null},aoTrocarAlvo:a=>this.mudarAlvo(a)})}fecharSeletor(e=!0){const t=this.seletor;t&&(e?t.fechar(!0):t.elemento.cancelar())}mudarAlvo(e){e!==this._alvo&&(this._alvo=e,this.atualizar(),this.sincronizarSeletor(),this.dispatchEvent(new CustomEvent("ui-alvo-change",{detail:{alvo:e},bubbles:!0,composed:!0})))}sincronizarSeletor(){var e,t;(t=(e=this.seletor)==null?void 0:e.elemento)==null||t.trocarAlvo(this._alvo)}aplicarDoSeletor(e,t){const r=o=>{const d=[];return e.preenchimento!==o.preenchimento&&d.push("preenchimento"),e.traco!==o.traco&&d.push("traco"),e.opacidade!==o.opacidade&&d.push("opacidade"),e.espessuraTraco!==void 0&&Math.abs(e.espessuraTraco-o.espessuraTraco)>.05&&d.push("espessuraTraco"),d},a=r(this.obterCores());if(this._preenchimento=e.preenchimento,this._traco=e.traco,this._opacidade=e.opacidade,e.espessuraTraco!==void 0&&(this._espessuraTraco=e.espessuraTraco),a.includes("preenchimento")&&(this._misto.preenchimento=!1),a.includes("traco")&&(this._misto.traco=!1),this.atualizar(),!t){a.length&&this.emitirCores(!1,a,"seletor");return}this.emitirCores(!0,this.estadoAoAbrir?r(this.estadoAoAbrir):a,"seletor"),this.estadoAoAbrir=null}emitirCores(e,t,r){const a={...this.obterCores(),confirmado:e,alterados:t,origem:r};this.dispatchEvent(new CustomEvent("ui-cores-change",{detail:a,bubbles:!0,composed:!0}))}dica(e,t){return t?`${e} [${t}]`:e}renderizar(){this.raiz.innerHTML=`
2
- <style>${q}</style>
3
- <div class="pilha" part="pilha" role="group" aria-label="Cores de desenho">
4
- <div class="amostras" part="amostras">
5
- <button type="button" class="amostra amostra--traco" data-alvo="traco" part="amostra amostra-traco">
6
- <span class="face face--traco"></span>
7
- </button>
8
- <button type="button" class="amostra amostra--preenchimento" data-alvo="preenchimento" part="amostra amostra-preenchimento">
9
- <span class="face face--preenchimento"></span>
10
- </button>
11
- </div>
12
- <div class="acoes" part="acoes">
13
- <button type="button" class="acao acao--inverter" data-acao="inverter" part="acao acao-inverter" aria-label="Inverter preenchimento e traço">
14
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
15
- <path d="m16 3 4 4-4 4"/><path d="M20 7H4"/><path d="m8 21-4-4 4-4"/><path d="M4 17h16"/>
16
- </svg>
17
- </button>
18
- <button type="button" class="acao acao--sem-cor" data-acao="sem-cor" part="acao acao-sem-cor" aria-label="Sem cor">
19
- <svg viewBox="0 0 24 24" fill="none" stroke-width="2.4" stroke-linecap="round" aria-hidden="true">
20
- <circle cx="12" cy="12" r="8" stroke="currentColor"/>
21
- <line x1="6.5" y1="6.5" x2="17.5" y2="17.5" stroke="#ef4444"/>
22
- </svg>
23
- </button>
24
- <button type="button" class="acao acao--padrao" data-acao="padrao" part="acao acao-padrao" aria-label="Restaurar cores padrão">
25
- <span class="icone-padrao" aria-hidden="true">
26
- <span class="ponto ponto--preenchimento"></span>
27
- <span class="ponto ponto--traco"></span>
28
- </span>
29
- </button>
30
- </div>
31
- </div>
32
- `,this.renderizado=!0}vincularEventos(){const e=this.raiz;e.querySelectorAll("[data-alvo]").forEach(r=>{const a=r.dataset.alvo;this.listeners.add(r,"click",o=>{o.stopPropagation(),a!==this._alvo?this.mudarAlvo(a):this.seletorAberto?this.fecharSeletor(!0):this.abrirSeletor(a)}),this.listeners.add(r,"dblclick",o=>{o.stopPropagation(),this.abrirSeletor(a)}),this.listeners.add(r,"keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),a===this._alvo&&this.seletorAberto?this.fecharSeletor(!0):this.abrirSeletor(a,!0))}),this.listeners.add(r,"keyup",o=>{o.key===" "&&o.preventDefault()})});const t=(r,a)=>{this.listeners.add(e.querySelector(`[data-acao="${r}"]`),"click",o=>{o.stopPropagation(),a()})};t("inverter",()=>this.inverter()),t("sem-cor",()=>this.semCor()),t("padrao",()=>this.restaurarPadrao())}atualizar(){if(!this.renderizado)return;const e=this.raiz,t=this._atalhos,r=this.hasAttribute("desabilitado"),a=(s,n)=>n?"Misto (?) [várias cores na seleção]":s==="none"?"Sem cor":s,o=(s,n,c,y,A="")=>{const l=e.querySelector(`[data-alvo="${s}"]`),f=l==null?void 0:l.querySelector(".face");if(!l||!f)return;const _=this._alvo===s;l.classList.toggle("amostra--ativa",_),l.setAttribute("aria-pressed",String(_)),l.disabled=r,f.classList.toggle("face--misto",c),f.classList.toggle("face--sem-cor",!c&&n==="none");const k=s==="traco"?"borderColor":"backgroundColor";f.style[k]=c||n==="none"?"":n,s==="traco"&&n!=="none"&&!c&&(f.style.borderWidth=`${Math.max(2,Math.min(4.5,this._espessuraTraco))}px`);const x=`${y}: ${a(n,c)}${A}`;l.title=this.dica(`${x} — clique para ativar, clique de novo para editar`,t.alternar),l.setAttribute("aria-label",x)},d=this._preenchimento==="none"||this._misto.preenchimento?"":`, opacidade ${Math.round(this._opacidade*100)}%`;o("preenchimento",this._preenchimento,this._misto.preenchimento,"Preenchimento",d);const z=this._traco==="none"||this._misto.traco?"":`, espessura ${this._espessuraTraco}px`;o("traco",this._traco,this._misto.traco,"Traço / contorno",z);const m=(s,n)=>{const c=e.querySelector(`[data-acao="${s}"]`);c&&(c.title=n,c.disabled=r)};m("inverter",this.dica("Inverter preenchimento e traço",t.inverter)),m("sem-cor",this.dica("Sem cor no alvo ativo",t.semCor)),m("padrao",this.dica("Restaurar cores padrão",t.padrao));const b=e.querySelector(".ponto--preenchimento");b&&(b.style.backgroundColor=this._padrao.preenchimento==="none"?"transparent":this._padrao.preenchimento);const v=e.querySelector(".ponto--traco");v&&(v.style.borderColor=this._padrao.traco==="none"?"#ef4444":this._padrao.traco)}}g.definirCustomElement("ui-controle-cores",C);exports.UIControleCores=C;