@govbr-ds/webcomponents 2.0.0-next.3 → 2.0.0-next.5

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 (135) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +104 -81
  3. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  4. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  5. package/dist/cjs/br-button.cjs.entry.js +116 -0
  6. package/dist/cjs/br-button.cjs.entry.js.map +1 -0
  7. package/dist/cjs/br-checkbox.cjs.entry.js +98 -0
  8. package/dist/cjs/br-checkbox.cjs.entry.js.map +1 -0
  9. package/dist/cjs/br-input.cjs.entry.js +116 -0
  10. package/dist/cjs/br-input.cjs.entry.js.map +1 -0
  11. package/dist/cjs/br-item.cjs.entry.js +87 -0
  12. package/dist/cjs/br-item.cjs.entry.js.map +1 -0
  13. package/dist/cjs/index-c5475da7.js +1476 -0
  14. package/dist/cjs/index-c5475da7.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +4 -0
  16. package/dist/cjs/index.cjs.js.map +1 -0
  17. package/dist/cjs/inherited-attributes-61a2aff9.js +103 -0
  18. package/dist/cjs/inherited-attributes-61a2aff9.js.map +1 -0
  19. package/dist/cjs/loader.cjs.js +17 -0
  20. package/dist/cjs/loader.cjs.js.map +1 -0
  21. package/dist/cjs/webcomponents.cjs.js +27 -0
  22. package/dist/cjs/webcomponents.cjs.js.map +1 -0
  23. package/dist/collection/collection-manifest.json +15 -0
  24. package/dist/collection/components/button/button.css +24213 -0
  25. package/dist/collection/components/button/button.js +454 -0
  26. package/dist/collection/components/button/button.js.map +1 -0
  27. package/dist/collection/components/checkbox/checkbox.css +23375 -0
  28. package/dist/collection/components/checkbox/checkbox.js +392 -0
  29. package/dist/collection/components/checkbox/checkbox.js.map +1 -0
  30. package/dist/collection/components/input/input.css +23428 -0
  31. package/dist/collection/components/input/input.js +631 -0
  32. package/dist/collection/components/input/input.js.map +1 -0
  33. package/dist/collection/components/item/item.css +23596 -0
  34. package/dist/collection/components/item/item.js +297 -0
  35. package/dist/collection/components/item/item.js.map +1 -0
  36. package/dist/collection/index.js +2 -0
  37. package/dist/collection/index.js.map +1 -0
  38. package/dist/collection/pages/button/button.js +32 -0
  39. package/dist/collection/pages/checkbox/checkbox.js +34 -0
  40. package/dist/collection/pages/input/input.js +35 -0
  41. package/dist/collection/pages/item/item.js +0 -0
  42. package/dist/collection/utils/inherited-attributes.js +98 -0
  43. package/dist/collection/utils/inherited-attributes.js.map +1 -0
  44. package/dist/collection/utils/interfaces.js +2 -0
  45. package/dist/collection/utils/interfaces.js.map +1 -0
  46. package/dist/components/br-button.d.ts +11 -0
  47. package/dist/components/br-button.js +8 -0
  48. package/dist/components/br-button.js.map +1 -0
  49. package/dist/components/br-checkbox.d.ts +11 -0
  50. package/dist/components/br-checkbox.js +114 -0
  51. package/dist/components/br-checkbox.js.map +1 -0
  52. package/dist/components/br-input.d.ts +11 -0
  53. package/dist/components/br-input.js +150 -0
  54. package/dist/components/br-input.js.map +1 -0
  55. package/dist/components/br-item.d.ts +11 -0
  56. package/dist/components/br-item.js +99 -0
  57. package/dist/components/br-item.js.map +1 -0
  58. package/dist/components/button.js +132 -0
  59. package/dist/components/button.js.map +1 -0
  60. package/dist/components/index.d.ts +44 -0
  61. package/dist/components/index.js +7 -0
  62. package/dist/components/index.js.map +1 -0
  63. package/dist/components/inherited-attributes.js +101 -0
  64. package/dist/components/inherited-attributes.js.map +1 -0
  65. package/dist/esm/app-globals-0f993ce5.js +5 -0
  66. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  67. package/dist/esm/br-button.entry.js +112 -0
  68. package/dist/esm/br-button.entry.js.map +1 -0
  69. package/dist/esm/br-checkbox.entry.js +94 -0
  70. package/dist/esm/br-checkbox.entry.js.map +1 -0
  71. package/dist/esm/br-input.entry.js +112 -0
  72. package/dist/esm/br-input.entry.js.map +1 -0
  73. package/dist/esm/br-item.entry.js +83 -0
  74. package/dist/esm/br-item.entry.js.map +1 -0
  75. package/dist/esm/index-57007b22.js +1447 -0
  76. package/dist/esm/index-57007b22.js.map +1 -0
  77. package/dist/esm/index.js +3 -0
  78. package/dist/esm/index.js.map +1 -0
  79. package/dist/esm/inherited-attributes-c856c729.js +101 -0
  80. package/dist/esm/inherited-attributes-c856c729.js.map +1 -0
  81. package/dist/esm/loader.js +13 -0
  82. package/dist/esm/loader.js.map +1 -0
  83. package/dist/esm/polyfills/core-js.js +11 -0
  84. package/dist/esm/polyfills/dom.js +79 -0
  85. package/dist/esm/polyfills/es5-html-element.js +1 -0
  86. package/dist/esm/polyfills/index.js +34 -0
  87. package/dist/esm/polyfills/system.js +6 -0
  88. package/dist/esm/webcomponents.js +22 -0
  89. package/dist/esm/webcomponents.js.map +1 -0
  90. package/dist/index.cjs.js +1 -0
  91. package/dist/index.js +1 -0
  92. package/dist/types/components/button/button.d.ts +68 -0
  93. package/dist/types/components/checkbox/checkbox.d.ts +54 -0
  94. package/dist/types/components/input/input.d.ts +85 -0
  95. package/dist/types/components/item/item.d.ts +50 -0
  96. package/dist/types/components.d.ts +649 -0
  97. package/dist/types/index.d.ts +1 -0
  98. package/dist/types/stencil-public-runtime.d.ts +1681 -0
  99. package/dist/types/utils/inherited-attributes.d.ts +20 -0
  100. package/dist/types/utils/interfaces.d.ts +3 -0
  101. package/dist/webcomponents/index.esm.js +2 -0
  102. package/dist/webcomponents/index.esm.js.map +1 -0
  103. package/dist/webcomponents/p-1b276845.entry.js +2 -0
  104. package/dist/webcomponents/p-1b276845.entry.js.map +1 -0
  105. package/dist/webcomponents/p-5f162437.entry.js +2 -0
  106. package/dist/webcomponents/p-5f162437.entry.js.map +1 -0
  107. package/dist/webcomponents/p-6d857090.entry.js +2 -0
  108. package/dist/webcomponents/p-6d857090.entry.js.map +1 -0
  109. package/dist/webcomponents/p-a0b98f14.entry.js +2 -0
  110. package/dist/webcomponents/p-a0b98f14.entry.js.map +1 -0
  111. package/dist/webcomponents/p-a3d8d916.js +3 -0
  112. package/dist/webcomponents/p-a3d8d916.js.map +1 -0
  113. package/dist/webcomponents/p-e1255160.js +2 -0
  114. package/dist/webcomponents/p-e1255160.js.map +1 -0
  115. package/dist/webcomponents/p-ee6f4f3f.js +2 -0
  116. package/dist/webcomponents/p-ee6f4f3f.js.map +1 -0
  117. package/dist/webcomponents/webcomponents.esm.js +2 -0
  118. package/dist/webcomponents/webcomponents.esm.js.map +1 -0
  119. package/hydrate/index.d.ts +218 -0
  120. package/hydrate/index.js +14213 -0
  121. package/hydrate/package.json +6 -0
  122. package/loader/cdn.js +3 -0
  123. package/loader/index.cjs.js +3 -0
  124. package/loader/index.d.ts +21 -0
  125. package/loader/index.es2017.js +3 -0
  126. package/loader/index.js +4 -0
  127. package/loader/package.json +11 -0
  128. package/package.json +42 -86
  129. package/vscode-data.json +272 -0
  130. package/dist/webcomponents.common.js +0 -24619
  131. package/dist/webcomponents.common.js.map +0 -1
  132. package/dist/webcomponents.umd.js +0 -24630
  133. package/dist/webcomponents.umd.js.map +0 -1
  134. package/dist/webcomponents.umd.min.js +0 -10
  135. package/dist/webcomponents.umd.min.js.map +0 -1
@@ -0,0 +1,454 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { inheritAriaAttributes } from "../../utils/inherited-attributes";
3
+ /**
4
+ * Consulte a [documentação GovBR-DS](https://www.gov.br/ds/components/button?tab=designer) para mais detalhes.
5
+ *
6
+ * @slot default Conteúdo do Button
7
+ */
8
+ export class Button {
9
+ constructor() {
10
+ this.inheritedAttributes = {};
11
+ this.circle = false;
12
+ this.emphasis = null;
13
+ this.block = false;
14
+ this.density = null;
15
+ this.loading = false;
16
+ this.disabled = false;
17
+ this.active = false;
18
+ this.type = 'button';
19
+ this.value = undefined;
20
+ this.darkMode = false;
21
+ }
22
+ connectedCallback() {
23
+ this.brConnectedCallback.emit(this);
24
+ }
25
+ componentWillLoad() {
26
+ this.brComponentWillLoad.emit(this);
27
+ this.inheritedAttributes = inheritAriaAttributes(this.el);
28
+ }
29
+ componentDidLoad() {
30
+ this.brComponentDidLoad.emit(this);
31
+ }
32
+ componentWillRender() {
33
+ this.brComponentWillRender.emit(this);
34
+ }
35
+ componentDidRender() {
36
+ this.brComponentDidRender.emit(this);
37
+ }
38
+ componentShouldUpdate() {
39
+ this.brComponentShouldUpdate.emit(this);
40
+ }
41
+ componentWillUpdate() {
42
+ this.brComponentWillUpdate.emit(this);
43
+ }
44
+ componentDidUpdate() {
45
+ this.brComponentDidUpdate.emit(this);
46
+ }
47
+ disconnectedCallback() {
48
+ this.brDisconnectedCallback.emit(this);
49
+ }
50
+ onFormAssociatedCallback(form) {
51
+ this.formAssociatedCallback.emit(form);
52
+ }
53
+ onFormDisassociatedCallback(form) {
54
+ this.formDisassociatedCallback.emit(form);
55
+ }
56
+ handleClick() {
57
+ if (this.type === 'submit') {
58
+ const submitEvent = new SubmitEvent('submit', {
59
+ submitter: this.elementInternals.form,
60
+ composed: true,
61
+ cancelable: true,
62
+ bubbles: true,
63
+ });
64
+ this.elementInternals.form.dispatchEvent(submitEvent);
65
+ }
66
+ if (this.type === 'reset') {
67
+ this.elementInternals.form.reset();
68
+ }
69
+ }
70
+ getCssClassMap() {
71
+ return {
72
+ 'br-button': true,
73
+ primary: this.emphasis === 'primary',
74
+ secondary: this.emphasis === 'secondary',
75
+ large: this.density === 'large',
76
+ small: this.density === 'small',
77
+ block: this.block,
78
+ circle: this.circle,
79
+ active: this.active,
80
+ loading: this.loading,
81
+ 'dark-mode': this.darkMode,
82
+ };
83
+ }
84
+ render() {
85
+ return (h(Host, { key: '697a85f836a7b660c5b093ed3d35018fa5f0d96e', "aria-disabled": this.disabled ? 'true' : null }, h("button", Object.assign({ key: 'aadd54e84485ecef0e2a38902086567b0f1dc881', class: this.getCssClassMap(), type: this.type, disabled: this.disabled, value: this.value, onClick: () => this.handleClick() }, this.inheritedAttributes), h("slot", { key: '1dbe98ff522f5f9e95096a2397a24752ee06d9c4' }))));
86
+ }
87
+ static get is() { return "br-button"; }
88
+ static get encapsulation() { return "shadow"; }
89
+ static get formAssociated() { return true; }
90
+ static get originalStyleUrls() {
91
+ return {
92
+ "$": ["button.scss"]
93
+ };
94
+ }
95
+ static get styleUrls() {
96
+ return {
97
+ "$": ["button.css"]
98
+ };
99
+ }
100
+ static get properties() {
101
+ return {
102
+ "circle": {
103
+ "type": "boolean",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "boolean",
107
+ "resolved": "boolean",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": "Tipo: circular"
115
+ },
116
+ "attribute": "circle",
117
+ "reflect": true,
118
+ "defaultValue": "false"
119
+ },
120
+ "emphasis": {
121
+ "type": "string",
122
+ "mutable": false,
123
+ "complexType": {
124
+ "original": "'primary' | 'secondary'",
125
+ "resolved": "\"primary\" | \"secondary\"",
126
+ "references": {}
127
+ },
128
+ "required": false,
129
+ "optional": false,
130
+ "docs": {
131
+ "tags": [],
132
+ "text": "\u00CAnfase"
133
+ },
134
+ "attribute": "emphasis",
135
+ "reflect": true,
136
+ "defaultValue": "null"
137
+ },
138
+ "block": {
139
+ "type": "boolean",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "boolean",
143
+ "resolved": "boolean",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": "Comportamento: bloco"
151
+ },
152
+ "attribute": "block",
153
+ "reflect": true,
154
+ "defaultValue": "false"
155
+ },
156
+ "density": {
157
+ "type": "string",
158
+ "mutable": false,
159
+ "complexType": {
160
+ "original": "'small' | 'large' | null",
161
+ "resolved": "\"large\" | \"small\"",
162
+ "references": {}
163
+ },
164
+ "required": false,
165
+ "optional": false,
166
+ "docs": {
167
+ "tags": [],
168
+ "text": "Comportamento: densidade"
169
+ },
170
+ "attribute": "density",
171
+ "reflect": true,
172
+ "defaultValue": "null"
173
+ },
174
+ "loading": {
175
+ "type": "boolean",
176
+ "mutable": false,
177
+ "complexType": {
178
+ "original": "boolean",
179
+ "resolved": "boolean",
180
+ "references": {}
181
+ },
182
+ "required": false,
183
+ "optional": false,
184
+ "docs": {
185
+ "tags": [],
186
+ "text": "Estado: loading/progresso"
187
+ },
188
+ "attribute": "loading",
189
+ "reflect": true,
190
+ "defaultValue": "false"
191
+ },
192
+ "disabled": {
193
+ "type": "boolean",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "boolean",
197
+ "resolved": "boolean",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "Estado: desabilitado"
205
+ },
206
+ "attribute": "disabled",
207
+ "reflect": true,
208
+ "defaultValue": "false"
209
+ },
210
+ "active": {
211
+ "type": "boolean",
212
+ "mutable": false,
213
+ "complexType": {
214
+ "original": "boolean",
215
+ "resolved": "boolean",
216
+ "references": {}
217
+ },
218
+ "required": false,
219
+ "optional": false,
220
+ "docs": {
221
+ "tags": [],
222
+ "text": "Estado: ativo"
223
+ },
224
+ "attribute": "active",
225
+ "reflect": true,
226
+ "defaultValue": "false"
227
+ },
228
+ "type": {
229
+ "type": "string",
230
+ "mutable": false,
231
+ "complexType": {
232
+ "original": "'button' | 'reset' | 'submit'",
233
+ "resolved": "\"button\" | \"reset\" | \"submit\"",
234
+ "references": {}
235
+ },
236
+ "required": false,
237
+ "optional": false,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": "[Tipo](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/button#type) do bot\u00E3o."
241
+ },
242
+ "attribute": "type",
243
+ "reflect": true,
244
+ "defaultValue": "'button'"
245
+ },
246
+ "value": {
247
+ "type": "string",
248
+ "mutable": false,
249
+ "complexType": {
250
+ "original": "string",
251
+ "resolved": "string",
252
+ "references": {}
253
+ },
254
+ "required": false,
255
+ "optional": false,
256
+ "docs": {
257
+ "tags": [],
258
+ "text": "Valor do bot\u00E3o"
259
+ },
260
+ "attribute": "value",
261
+ "reflect": true
262
+ },
263
+ "darkMode": {
264
+ "type": "boolean",
265
+ "mutable": false,
266
+ "complexType": {
267
+ "original": "boolean",
268
+ "resolved": "boolean",
269
+ "references": {}
270
+ },
271
+ "required": false,
272
+ "optional": false,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": "Habilita bot\u00E3o para fundos escuros (dark mode/invertido)"
276
+ },
277
+ "attribute": "dark-mode",
278
+ "reflect": true,
279
+ "defaultValue": "false"
280
+ }
281
+ };
282
+ }
283
+ static get events() {
284
+ return [{
285
+ "method": "brConnectedCallback",
286
+ "name": "brConnectedCallback",
287
+ "bubbles": true,
288
+ "cancelable": true,
289
+ "composed": true,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
293
+ },
294
+ "complexType": {
295
+ "original": "this",
296
+ "resolved": "this",
297
+ "references": {}
298
+ }
299
+ }, {
300
+ "method": "brComponentWillLoad",
301
+ "name": "brComponentWillLoad",
302
+ "bubbles": true,
303
+ "cancelable": true,
304
+ "composed": true,
305
+ "docs": {
306
+ "tags": [],
307
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
308
+ },
309
+ "complexType": {
310
+ "original": "this",
311
+ "resolved": "this",
312
+ "references": {}
313
+ }
314
+ }, {
315
+ "method": "brComponentDidLoad",
316
+ "name": "brComponentDidLoad",
317
+ "bubbles": true,
318
+ "cancelable": true,
319
+ "composed": true,
320
+ "docs": {
321
+ "tags": [],
322
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
323
+ },
324
+ "complexType": {
325
+ "original": "this",
326
+ "resolved": "this",
327
+ "references": {}
328
+ }
329
+ }, {
330
+ "method": "brComponentWillRender",
331
+ "name": "brComponentWillRender",
332
+ "bubbles": true,
333
+ "cancelable": true,
334
+ "composed": true,
335
+ "docs": {
336
+ "tags": [],
337
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
338
+ },
339
+ "complexType": {
340
+ "original": "this",
341
+ "resolved": "this",
342
+ "references": {}
343
+ }
344
+ }, {
345
+ "method": "brComponentDidRender",
346
+ "name": "brComponentDidRender",
347
+ "bubbles": true,
348
+ "cancelable": true,
349
+ "composed": true,
350
+ "docs": {
351
+ "tags": [],
352
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
353
+ },
354
+ "complexType": {
355
+ "original": "this",
356
+ "resolved": "this",
357
+ "references": {}
358
+ }
359
+ }, {
360
+ "method": "brComponentShouldUpdate",
361
+ "name": "brComponentShouldUpdate",
362
+ "bubbles": true,
363
+ "cancelable": true,
364
+ "composed": true,
365
+ "docs": {
366
+ "tags": [],
367
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
368
+ },
369
+ "complexType": {
370
+ "original": "this",
371
+ "resolved": "this",
372
+ "references": {}
373
+ }
374
+ }, {
375
+ "method": "brComponentWillUpdate",
376
+ "name": "brComponentWillUpdate",
377
+ "bubbles": true,
378
+ "cancelable": true,
379
+ "composed": true,
380
+ "docs": {
381
+ "tags": [],
382
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
383
+ },
384
+ "complexType": {
385
+ "original": "this",
386
+ "resolved": "this",
387
+ "references": {}
388
+ }
389
+ }, {
390
+ "method": "brComponentDidUpdate",
391
+ "name": "brComponentDidUpdate",
392
+ "bubbles": true,
393
+ "cancelable": true,
394
+ "composed": true,
395
+ "docs": {
396
+ "tags": [],
397
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
398
+ },
399
+ "complexType": {
400
+ "original": "this",
401
+ "resolved": "this",
402
+ "references": {}
403
+ }
404
+ }, {
405
+ "method": "brDisconnectedCallback",
406
+ "name": "brDisconnectedCallback",
407
+ "bubbles": true,
408
+ "cancelable": true,
409
+ "composed": true,
410
+ "docs": {
411
+ "tags": [],
412
+ "text": "Consulte a documenta\u00E7\u00E3o do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback)."
413
+ },
414
+ "complexType": {
415
+ "original": "this",
416
+ "resolved": "this",
417
+ "references": {}
418
+ }
419
+ }, {
420
+ "method": "formAssociatedCallback",
421
+ "name": "formAssociatedCallback",
422
+ "bubbles": true,
423
+ "cancelable": true,
424
+ "composed": true,
425
+ "docs": {
426
+ "tags": [],
427
+ "text": "Componente foi inserido em um `<form>`"
428
+ },
429
+ "complexType": {
430
+ "original": "this",
431
+ "resolved": "this",
432
+ "references": {}
433
+ }
434
+ }, {
435
+ "method": "formDisassociatedCallback",
436
+ "name": "formDisassociatedCallback",
437
+ "bubbles": true,
438
+ "cancelable": true,
439
+ "composed": true,
440
+ "docs": {
441
+ "tags": [],
442
+ "text": "Componente foi removido de um `<form>`"
443
+ },
444
+ "complexType": {
445
+ "original": "this",
446
+ "resolved": "this",
447
+ "references": {}
448
+ }
449
+ }];
450
+ }
451
+ static get elementRef() { return "el"; }
452
+ static get attachInternalsMemberName() { return "elementInternals"; }
453
+ }
454
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AACvG,OAAO,EAAc,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAGpF;;;;GAIG;AAOH,MAAM,OAAO,MAAM;;QAsIT,wBAAmB,GAAe,EAAE,CAAA;sBA/HD,KAAK;wBA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7B,IAAI,CAAC,mBAAmB;gBAE5B,8DAAa,CACN,CACJ,CACR,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, Host, Prop, h } from '@stencil/core'\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n * Consulte a [documentação GovBR-DS](https://www.gov.br/ds/components/button?tab=designer) para mais detalhes.\n *\n * @slot default Conteúdo do Button\n */\n@Component({\n tag: 'br-button',\n styleUrl: 'button.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Button {\n /** Elemento host */\n @Element() el: HTMLButtonElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /** Tipo: circular */\n @Prop({ reflect: true }) circle: boolean = false\n\n /** Ênfase */\n @Prop({ reflect: true }) emphasis: 'primary' | 'secondary' = null\n\n /** Comportamento: bloco */\n @Prop({ reflect: true }) block: boolean = false\n\n /** Comportamento: densidade */\n @Prop({ reflect: true }) density: 'small' | 'large' | null = null\n\n /** Estado: loading/progresso */\n @Prop({ reflect: true }) loading: boolean = false\n\n /** Estado: desabilitado */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /** Estado: ativo */\n @Prop({ reflect: true }) active: boolean = false\n\n /** [Tipo](https://developer.mozilla.org/pt-BR/docs/Web/HTML/Element/button#type) do botão. */\n @Prop({ reflect: true }) type: 'button' | 'reset' | 'submit' = 'button'\n\n /** Valor do botão */\n @Prop({ reflect: true }) value: string\n\n /** Habilita botão para fundos escuros (dark mode/invertido) */\n @Prop({ reflect: true }) darkMode: boolean = false\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brConnectedCallback: EventEmitter<this>\n connectedCallback() {\n this.brConnectedCallback.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillLoad: EventEmitter<this>\n componentWillLoad() {\n this.brComponentWillLoad.emit(this)\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidLoad: EventEmitter<this>\n componentDidLoad() {\n this.brComponentDidLoad.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillRender: EventEmitter<this>\n componentWillRender() {\n this.brComponentWillRender.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidRender: EventEmitter<this>\n componentDidRender() {\n this.brComponentDidRender.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentShouldUpdate: EventEmitter<this>\n componentShouldUpdate() {\n this.brComponentShouldUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentWillUpdate: EventEmitter<this>\n componentWillUpdate() {\n this.brComponentWillUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brComponentDidUpdate: EventEmitter<this>\n componentDidUpdate() {\n this.brComponentDidUpdate.emit(this)\n }\n\n /** Consulte a documentação do [StencilJS](https://stenciljs.com/docs/component-lifecycle#connectedcallback). */\n @Event() brDisconnectedCallback: EventEmitter<this>\n disconnectedCallback() {\n this.brDisconnectedCallback.emit(this)\n }\n\n /** Componente foi inserido em um `<form>` */\n @Event() formAssociatedCallback: EventEmitter<this>\n onFormAssociatedCallback(form) {\n this.formAssociatedCallback.emit(form)\n }\n\n /** Componente foi removido de um `<form>` */\n @Event() formDisassociatedCallback: EventEmitter<this>\n onFormDisassociatedCallback(form) {\n this.formDisassociatedCallback.emit(form)\n }\n\n private handleClick() {\n if (this.type === 'submit') {\n const submitEvent = new SubmitEvent('submit', {\n submitter: this.elementInternals.form,\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n this.elementInternals.form.dispatchEvent(submitEvent)\n }\n\n if (this.type === 'reset') {\n this.elementInternals.form.reset()\n }\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-button': true,\n primary: this.emphasis === 'primary',\n secondary: this.emphasis === 'secondary',\n large: this.density === 'large',\n small: this.density === 'small',\n block: this.block,\n circle: this.circle,\n active: this.active,\n loading: this.loading,\n 'dark-mode': this.darkMode,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n render() {\n return (\n <Host aria-disabled={this.disabled ? 'true' : null}>\n <button\n class={this.getCssClassMap()}\n type={this.type}\n disabled={this.disabled}\n value={this.value}\n onClick={() => this.handleClick()}\n {...this.inheritedAttributes}\n >\n <slot></slot>\n </button>\n </Host>\n )\n }\n}\n"]}