@govbr-ds/webcomponents 2.0.0-next.46 → 2.0.0-next.48
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.
- package/dist/cjs/br-avatar.cjs.entry.js +2 -2
- package/dist/cjs/br-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/br-avatar.entry.cjs.js.map +1 -1
- package/dist/cjs/br-button.br-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/br-button_2.cjs.entry.js +1 -1
- package/dist/cjs/br-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/br-sign-in.cjs.entry.js +109 -0
- package/dist/cjs/br-sign-in.cjs.entry.js.map +1 -0
- package/dist/cjs/br-sign-in.entry.cjs.js.map +1 -0
- package/dist/cjs/br-step-item.cjs.entry.js +1 -1
- package/dist/cjs/br-step.cjs.entry.js +1 -1
- package/dist/cjs/br-switch.cjs.entry.js +28 -2
- package/dist/cjs/br-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/br-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/br-tab-item.cjs.entry.js +1 -1
- package/dist/cjs/br-tab.cjs.entry.js +1 -1
- package/dist/cjs/br-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/br-table-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/br-table-header-row.cjs.entry.js +1 -1
- package/dist/cjs/br-table-row.cjs.entry.js +1 -1
- package/dist/cjs/br-table.cjs.entry.js +1 -1
- package/dist/cjs/br-tag.cjs.entry.js +151 -13
- package/dist/cjs/br-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/br-tag.entry.cjs.js.map +1 -1
- package/dist/cjs/br-textarea.cjs.entry.js +32 -5
- package/dist/cjs/br-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/br-textarea.entry.cjs.js.map +1 -1
- package/dist/cjs/br-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/br-upload.cjs.entry.js +15 -23
- package/dist/cjs/br-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/br-upload.entry.cjs.js.map +1 -1
- package/dist/cjs/index-DNnn1o_9.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/avatar/avatar.js +1 -1
- package/dist/collection/components/avatar/avatar.js.map +1 -1
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/sign-in/sign-in.css +1 -0
- package/dist/collection/components/sign-in/sign-in.js +303 -0
- package/dist/collection/components/sign-in/sign-in.js.map +1 -0
- package/dist/collection/components/step/step.js +1 -1
- package/dist/collection/components/step-item/step-item.js +1 -1
- package/dist/collection/components/switch/switch.css +1 -1
- package/dist/collection/components/switch/switch.js +27 -1
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/collection/components/tab/tab.js +1 -1
- package/dist/collection/components/tab-item/tab-item.js +1 -1
- package/dist/collection/components/table/table.js +1 -1
- package/dist/collection/components/table-cell/table-cell.js +1 -1
- package/dist/collection/components/table-header-cell/table-header-cell.js +1 -1
- package/dist/collection/components/table-header-row/table-header-row.js +1 -1
- package/dist/collection/components/table-row/table-row.js +1 -1
- package/dist/collection/components/tag/tag.css +1 -1
- package/dist/collection/components/tag/tag.js +192 -14
- package/dist/collection/components/tag/tag.js.map +1 -1
- package/dist/collection/components/textarea/textarea.js +51 -5
- package/dist/collection/components/textarea/textarea.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/collection/components/upload/upload.js +46 -30
- package/dist/collection/components/upload/upload.js.map +1 -1
- package/dist/collection/pages/components/sign-in/index.js +18 -0
- package/dist/collection/pages/scripts/menu.js +5 -0
- package/dist/components/br-avatar.js +4 -3
- package/dist/components/br-avatar.js.map +1 -1
- package/dist/components/br-breadcrumb.js +1 -1
- package/dist/components/br-button.js +4 -4
- package/dist/components/br-footer-social.js +1 -1
- package/dist/components/br-input.js +3 -3
- package/dist/components/br-message.js +1 -1
- package/dist/components/br-select.js +2 -2
- package/dist/components/br-sign-in.d.ts +11 -0
- package/dist/components/br-sign-in.js +169 -0
- package/dist/components/br-sign-in.js.map +1 -0
- package/dist/components/br-step-item.js +13 -13
- package/dist/components/br-step.js +3 -3
- package/dist/components/br-switch.js +35 -11
- package/dist/components/br-switch.js.map +1 -1
- package/dist/components/br-tab-item.js +8 -8
- package/dist/components/br-tab.js +6 -6
- package/dist/components/br-table-cell.js +3 -3
- package/dist/components/br-table-header-cell.js +3 -3
- package/dist/components/br-table-header-row.js +3 -3
- package/dist/components/br-table-row.js +3 -3
- package/dist/components/br-table.js +6 -6
- package/dist/components/br-tag.js +166 -51
- package/dist/components/br-tag.js.map +1 -1
- package/dist/components/br-textarea.js +42 -15
- package/dist/components/br-textarea.js.map +1 -1
- package/dist/components/br-tooltip.js +15 -15
- package/dist/components/br-upload.js +56 -58
- package/dist/components/br-upload.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/{p-DZhiQXGc.js → p-Bjt1OWm8.js} +3 -3
- package/dist/components/{p-ssSt5UuQ.js → p-Brhs7qAd.js} +6 -7
- package/dist/components/p-Brhs7qAd.js.map +1 -0
- package/dist/custom-elements.json +551 -9
- package/dist/esm/br-avatar.entry.js +2 -2
- package/dist/esm/br-avatar.entry.js.map +1 -1
- package/dist/esm/br-button.br-icon.entry.js.map +1 -1
- package/dist/esm/br-button_2.entry.js +1 -1
- package/dist/esm/br-button_2.entry.js.map +1 -1
- package/dist/esm/br-sign-in.entry.js +107 -0
- package/dist/esm/br-sign-in.entry.js.map +1 -0
- package/dist/esm/br-step-item.entry.js +1 -1
- package/dist/esm/br-step.entry.js +1 -1
- package/dist/esm/br-switch.entry.js +28 -2
- package/dist/esm/br-switch.entry.js.map +1 -1
- package/dist/esm/br-tab-item.entry.js +1 -1
- package/dist/esm/br-tab.entry.js +1 -1
- package/dist/esm/br-table-cell.entry.js +1 -1
- package/dist/esm/br-table-header-cell.entry.js +1 -1
- package/dist/esm/br-table-header-row.entry.js +1 -1
- package/dist/esm/br-table-row.entry.js +1 -1
- package/dist/esm/br-table.entry.js +1 -1
- package/dist/esm/br-tag.entry.js +151 -13
- package/dist/esm/br-tag.entry.js.map +1 -1
- package/dist/esm/br-textarea.entry.js +32 -5
- package/dist/esm/br-textarea.entry.js.map +1 -1
- package/dist/esm/br-tooltip.entry.js +1 -1
- package/dist/esm/br-upload.entry.js +15 -23
- package/dist/esm/br-upload.entry.js.map +1 -1
- package/dist/esm/index-DmA0bHaX.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/hydrate/index.js +381 -60
- package/dist/hydrate/index.mjs +381 -60
- package/dist/types/components/sign-in/sign-in.d.ts +69 -0
- package/dist/types/components/switch/switch.d.ts +8 -3
- package/dist/types/components/tag/tag.d.ts +45 -3
- package/dist/types/components/textarea/textarea.d.ts +18 -0
- package/dist/types/components/upload/upload.d.ts +14 -4
- package/dist/types/components.d.ts +157 -6
- package/dist/webcomponents/br-avatar.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-button.br-icon.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-sign-in.entry.esm.js.map +1 -0
- package/dist/webcomponents/br-switch.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-tag.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-textarea.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-upload.entry.esm.js.map +1 -1
- package/dist/webcomponents/{p-df6e707a.entry.js → p-0286bc8b.entry.js} +5 -4
- package/dist/webcomponents/p-0286bc8b.entry.js.map +1 -0
- package/dist/webcomponents/{p-a802ca08.entry.js → p-177edeb5.entry.js} +55 -58
- package/dist/webcomponents/p-177edeb5.entry.js.map +1 -0
- package/dist/webcomponents/{p-761f7798.entry.js → p-1b86e06c.entry.js} +161 -48
- package/dist/webcomponents/p-1b86e06c.entry.js.map +1 -0
- package/dist/webcomponents/p-3af05218.entry.js +133 -0
- package/dist/webcomponents/p-3af05218.entry.js.map +1 -0
- package/dist/webcomponents/{p-bbd38dd7.entry.js → p-3e9e650d.entry.js} +4 -4
- package/dist/webcomponents/{p-fa0aeb0f.entry.js → p-3f18e20a.entry.js} +5 -6
- package/dist/webcomponents/p-3f18e20a.entry.js.map +1 -0
- package/dist/webcomponents/{p-24f6adad.entry.js → p-5e08c9e4.entry.js} +42 -16
- package/dist/webcomponents/p-5e08c9e4.entry.js.map +1 -0
- package/dist/webcomponents/{p-8b15dfc8.entry.js → p-600fe722.entry.js} +10 -10
- package/dist/webcomponents/{p-2a407917.entry.js → p-8f28e933.entry.js} +7 -7
- package/dist/webcomponents/{p-d549a87b.entry.js → p-9480b1aa.entry.js} +4 -4
- package/dist/webcomponents/{p-1d018f30.entry.js → p-9bbb66bd.entry.js} +4 -4
- package/dist/webcomponents/{p-abf81334.entry.js → p-b4dde339.entry.js} +36 -12
- package/dist/webcomponents/p-b4dde339.entry.js.map +1 -0
- package/dist/webcomponents/{p-096b0875.entry.js → p-b72b4850.entry.js} +4 -4
- package/dist/webcomponents/{p-70d4da25.entry.js → p-c9cbb5b3.entry.js} +9 -9
- package/dist/webcomponents/{p-ac4ce40c.entry.js → p-e4d965d4.entry.js} +13 -13
- package/dist/webcomponents/{p-deb094fb.entry.js → p-e7f1afa4.entry.js} +4 -4
- package/dist/webcomponents/{p-f1738ae0.entry.js → p-f883ebf5.entry.js} +7 -7
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents.html-custom-data.json +56 -3
- package/package.json +1 -1
- package/dist/components/p-ssSt5UuQ.js.map +0 -1
- package/dist/webcomponents/p-24f6adad.entry.js.map +0 -1
- package/dist/webcomponents/p-761f7798.entry.js.map +0 -1
- package/dist/webcomponents/p-a802ca08.entry.js.map +0 -1
- package/dist/webcomponents/p-abf81334.entry.js.map +0 -1
- package/dist/webcomponents/p-df6e707a.entry.js.map +0 -1
- package/dist/webcomponents/p-fa0aeb0f.entry.js.map +0 -1
- /package/dist/components/{p-DZhiQXGc.js.map → p-Bjt1OWm8.js.map} +0 -0
- /package/dist/webcomponents/{p-bbd38dd7.entry.js.map → p-3e9e650d.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-8b15dfc8.entry.js.map → p-600fe722.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-2a407917.entry.js.map → p-8f28e933.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-d549a87b.entry.js.map → p-9480b1aa.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-1d018f30.entry.js.map → p-9bbb66bd.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-096b0875.entry.js.map → p-b72b4850.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-70d4da25.entry.js.map → p-c9cbb5b3.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-ac4ce40c.entry.js.map → p-e4d965d4.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-deb094fb.entry.js.map → p-e7f1afa4.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-f1738ae0.entry.js.map → p-f883ebf5.entry.js.map} +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Construído por SERPRO
|
|
3
|
+
* © https://serpro.gov.br/ - MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { h, Host } from "@stencil/core";
|
|
6
|
+
import Helpers from "../../utils/helpers";
|
|
7
|
+
/**
|
|
8
|
+
* Para uma descrição detalhada, consulte a [documentação do GovBR-DS](https://www.gov.br/ds/components/sign-in?tab=designer).
|
|
9
|
+
*
|
|
10
|
+
* Para acessibilidade adequada, especialmente em formatos circulares, use a propriedade aria-label:
|
|
11
|
+
* <br-sign-in shape="circle" aria-label="Fazer login com Gov.br"></br-sign-in>
|
|
12
|
+
*
|
|
13
|
+
* Para controlar onde o link abre, use a propriedade target:
|
|
14
|
+
* <br-sign-in href="https://accounts.google.com" target="_self">Login Google</br-sign-in>
|
|
15
|
+
* <br-sign-in href="https://help.site.com" target="_blank">Ajuda</br-sign-in>
|
|
16
|
+
*
|
|
17
|
+
* @slot default - Conteúdo do label/texto do sign-in
|
|
18
|
+
* @slot icon - Ícone personalizado. Para shape="circle", um ícone padrão (fa6-solid:user) será exibido se nenhum for fornecido
|
|
19
|
+
* @slot image - Imagem ou ícone exibido ao lado da label
|
|
20
|
+
*
|
|
21
|
+
* @part content - Área do conteúdo/texto dentro do sign-in
|
|
22
|
+
* @part image - Área da imagem/ícone (para controle de tamanho via CSS)
|
|
23
|
+
*/
|
|
24
|
+
export class SignIn {
|
|
25
|
+
constructor() {
|
|
26
|
+
/**
|
|
27
|
+
* Identificador único.
|
|
28
|
+
* Caso não seja fornecido, um ID gerado automaticamente será usado.
|
|
29
|
+
*/
|
|
30
|
+
this.customId = Helpers.generateUniqueId();
|
|
31
|
+
/**
|
|
32
|
+
* Ajusta a densidade, alterando o espaçamento interno para um visual mais compacto ou mais expandido.
|
|
33
|
+
*/
|
|
34
|
+
this.density = 'medium';
|
|
35
|
+
/**
|
|
36
|
+
* Desativa o sign-in, tornando-o não interativo.
|
|
37
|
+
*/
|
|
38
|
+
this.disabled = false;
|
|
39
|
+
/**
|
|
40
|
+
* Define a ênfase do sign-in, alterando sua aparência para criar hierarquia visual.
|
|
41
|
+
*/
|
|
42
|
+
this.emphasis = 'secondary';
|
|
43
|
+
/**
|
|
44
|
+
* Define o formato do sign-in.
|
|
45
|
+
*/
|
|
46
|
+
this.shape = 'pill';
|
|
47
|
+
/**
|
|
48
|
+
* Define onde abrir o link quando href é fornecido.
|
|
49
|
+
*/
|
|
50
|
+
this.target = '_self';
|
|
51
|
+
this.handleClick = (event) => {
|
|
52
|
+
if (this.disabled) {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
event.stopPropagation();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this.handleFocus = (event) => {
|
|
59
|
+
if (this.disabled) {
|
|
60
|
+
;
|
|
61
|
+
event.target?.blur?.();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
hasSlotContent(slotName) {
|
|
66
|
+
return this.el.querySelector(`[slot="${slotName}"]`) !== null;
|
|
67
|
+
}
|
|
68
|
+
getCssClassMap() {
|
|
69
|
+
return {
|
|
70
|
+
'br-sign-in': true,
|
|
71
|
+
primary: this.emphasis === 'primary',
|
|
72
|
+
secondary: this.emphasis === 'secondary',
|
|
73
|
+
large: this.density === 'large',
|
|
74
|
+
small: this.density === 'small',
|
|
75
|
+
block: this.shape === 'block',
|
|
76
|
+
circle: this.shape === 'circle',
|
|
77
|
+
'dark-mode': this.colorMode === 'dark',
|
|
78
|
+
disabled: this.disabled,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
getTagType() {
|
|
82
|
+
return this.href && this.href.length > 0 ? 'a' : 'button';
|
|
83
|
+
}
|
|
84
|
+
getAttributes() {
|
|
85
|
+
const TagType = this.getTagType();
|
|
86
|
+
if (TagType === 'a') {
|
|
87
|
+
return {
|
|
88
|
+
href: this.disabled ? null : this.href,
|
|
89
|
+
target: this.disabled ? null : this.target,
|
|
90
|
+
'aria-disabled': this.disabled ? 'true' : null,
|
|
91
|
+
'aria-label': this.ariaLabel,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
type: 'button',
|
|
96
|
+
disabled: this.disabled,
|
|
97
|
+
'aria-label': this.ariaLabel,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
const TagType = this.getTagType();
|
|
102
|
+
const attributes = this.getAttributes();
|
|
103
|
+
const classList = this.getCssClassMap();
|
|
104
|
+
return (h(Host, { key: 'be4bc01e580c8ab957e9c2ae81c9820bc5fb4659', "aria-disabled": this.disabled ? 'true' : null }, h(TagType, { key: 'c919aed0cf415c11d41558d7dedb93239c469a5b', part: "button", class: classList, id: this.customId, ...attributes, onClick: this.handleClick, onFocus: this.handleFocus }, h("slot", { key: '005638e1eb9f163ec1fce714df9a0d9b588c1a1b', name: "icon" }, this.shape === 'circle' && h("br-icon", { key: '9593566ed221def2a09a1615ef36da748eef2431', "icon-name": "fa6-solid:user" })), h("span", { key: 'f93eda737e5acff5a3e6a324b4380354577a5b7d', part: "content" }, h("slot", { key: '15a5d63b7772f93a948759e6384488015848170d' })), this.hasSlotContent('image') && (h("span", { key: '571cc0f4cac2abbf72397d05ba72444c80a8174f', part: "image" }, h("slot", { key: '4867a15d93f99c64a0588fd2981911f36177edda', name: "image" }))))));
|
|
105
|
+
}
|
|
106
|
+
static get is() { return "br-sign-in"; }
|
|
107
|
+
static get encapsulation() { return "shadow"; }
|
|
108
|
+
static get formAssociated() { return true; }
|
|
109
|
+
static get originalStyleUrls() {
|
|
110
|
+
return {
|
|
111
|
+
"$": ["sign-in.scss"]
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
static get styleUrls() {
|
|
115
|
+
return {
|
|
116
|
+
"$": ["sign-in.css"]
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
static get properties() {
|
|
120
|
+
return {
|
|
121
|
+
"customId": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"mutable": false,
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "string",
|
|
126
|
+
"resolved": "string",
|
|
127
|
+
"references": {}
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"optional": false,
|
|
131
|
+
"docs": {
|
|
132
|
+
"tags": [],
|
|
133
|
+
"text": "Identificador \u00FAnico.\nCaso n\u00E3o seja fornecido, um ID gerado automaticamente ser\u00E1 usado."
|
|
134
|
+
},
|
|
135
|
+
"getter": false,
|
|
136
|
+
"setter": false,
|
|
137
|
+
"attribute": "custom-id",
|
|
138
|
+
"reflect": true,
|
|
139
|
+
"defaultValue": "Helpers.generateUniqueId()"
|
|
140
|
+
},
|
|
141
|
+
"colorMode": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "'dark'",
|
|
146
|
+
"resolved": "\"dark\"",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": "Define se o sign-in usar\u00E1 um esquema de cores escuro."
|
|
154
|
+
},
|
|
155
|
+
"getter": false,
|
|
156
|
+
"setter": false,
|
|
157
|
+
"attribute": "color-mode",
|
|
158
|
+
"reflect": true
|
|
159
|
+
},
|
|
160
|
+
"density": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"mutable": false,
|
|
163
|
+
"complexType": {
|
|
164
|
+
"original": "'large' | 'medium' | 'small'",
|
|
165
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
166
|
+
"references": {}
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": false,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": "Ajusta a densidade, alterando o espa\u00E7amento interno para um visual mais compacto ou mais expandido."
|
|
173
|
+
},
|
|
174
|
+
"getter": false,
|
|
175
|
+
"setter": false,
|
|
176
|
+
"attribute": "density",
|
|
177
|
+
"reflect": true,
|
|
178
|
+
"defaultValue": "'medium'"
|
|
179
|
+
},
|
|
180
|
+
"disabled": {
|
|
181
|
+
"type": "boolean",
|
|
182
|
+
"mutable": false,
|
|
183
|
+
"complexType": {
|
|
184
|
+
"original": "boolean",
|
|
185
|
+
"resolved": "boolean",
|
|
186
|
+
"references": {}
|
|
187
|
+
},
|
|
188
|
+
"required": false,
|
|
189
|
+
"optional": false,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "Desativa o sign-in, tornando-o n\u00E3o interativo."
|
|
193
|
+
},
|
|
194
|
+
"getter": false,
|
|
195
|
+
"setter": false,
|
|
196
|
+
"attribute": "disabled",
|
|
197
|
+
"reflect": true,
|
|
198
|
+
"defaultValue": "false"
|
|
199
|
+
},
|
|
200
|
+
"emphasis": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"mutable": false,
|
|
203
|
+
"complexType": {
|
|
204
|
+
"original": "'primary' | 'secondary'",
|
|
205
|
+
"resolved": "\"primary\" | \"secondary\"",
|
|
206
|
+
"references": {}
|
|
207
|
+
},
|
|
208
|
+
"required": false,
|
|
209
|
+
"optional": false,
|
|
210
|
+
"docs": {
|
|
211
|
+
"tags": [],
|
|
212
|
+
"text": "Define a \u00EAnfase do sign-in, alterando sua apar\u00EAncia para criar hierarquia visual."
|
|
213
|
+
},
|
|
214
|
+
"getter": false,
|
|
215
|
+
"setter": false,
|
|
216
|
+
"attribute": "emphasis",
|
|
217
|
+
"reflect": true,
|
|
218
|
+
"defaultValue": "'secondary'"
|
|
219
|
+
},
|
|
220
|
+
"shape": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"mutable": false,
|
|
223
|
+
"complexType": {
|
|
224
|
+
"original": "'block' | 'circle' | 'pill'",
|
|
225
|
+
"resolved": "\"block\" | \"circle\" | \"pill\"",
|
|
226
|
+
"references": {}
|
|
227
|
+
},
|
|
228
|
+
"required": false,
|
|
229
|
+
"optional": false,
|
|
230
|
+
"docs": {
|
|
231
|
+
"tags": [],
|
|
232
|
+
"text": "Define o formato do sign-in."
|
|
233
|
+
},
|
|
234
|
+
"getter": false,
|
|
235
|
+
"setter": false,
|
|
236
|
+
"attribute": "shape",
|
|
237
|
+
"reflect": true,
|
|
238
|
+
"defaultValue": "'pill'"
|
|
239
|
+
},
|
|
240
|
+
"href": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"mutable": false,
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "string",
|
|
245
|
+
"resolved": "string",
|
|
246
|
+
"references": {}
|
|
247
|
+
},
|
|
248
|
+
"required": false,
|
|
249
|
+
"optional": false,
|
|
250
|
+
"docs": {
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": "URL para onde o usu\u00E1rio ser\u00E1 redirecionado ao clicar. Use para login com provedores externos ou em sites tradicionais."
|
|
253
|
+
},
|
|
254
|
+
"getter": false,
|
|
255
|
+
"setter": false,
|
|
256
|
+
"attribute": "href",
|
|
257
|
+
"reflect": true
|
|
258
|
+
},
|
|
259
|
+
"target": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"mutable": false,
|
|
262
|
+
"complexType": {
|
|
263
|
+
"original": "'_self' | '_blank' | '_parent' | '_top'",
|
|
264
|
+
"resolved": "\"_blank\" | \"_parent\" | \"_self\" | \"_top\"",
|
|
265
|
+
"references": {}
|
|
266
|
+
},
|
|
267
|
+
"required": false,
|
|
268
|
+
"optional": false,
|
|
269
|
+
"docs": {
|
|
270
|
+
"tags": [],
|
|
271
|
+
"text": "Define onde abrir o link quando href \u00E9 fornecido."
|
|
272
|
+
},
|
|
273
|
+
"getter": false,
|
|
274
|
+
"setter": false,
|
|
275
|
+
"attribute": "target",
|
|
276
|
+
"reflect": true,
|
|
277
|
+
"defaultValue": "'_self'"
|
|
278
|
+
},
|
|
279
|
+
"ariaLabel": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"mutable": false,
|
|
282
|
+
"complexType": {
|
|
283
|
+
"original": "string",
|
|
284
|
+
"resolved": "string",
|
|
285
|
+
"references": {}
|
|
286
|
+
},
|
|
287
|
+
"required": false,
|
|
288
|
+
"optional": false,
|
|
289
|
+
"docs": {
|
|
290
|
+
"tags": [],
|
|
291
|
+
"text": "Define o r\u00F3tulo acess\u00EDvel do sign-in, especialmente importante para formatos circulares."
|
|
292
|
+
},
|
|
293
|
+
"getter": false,
|
|
294
|
+
"setter": false,
|
|
295
|
+
"attribute": "aria-label",
|
|
296
|
+
"reflect": true
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
static get elementRef() { return "el"; }
|
|
301
|
+
static get attachInternalsMemberName() { return "elementInternals"; }
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=sign-in.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in.js","sourceRoot":"","sources":["../../../../../../packages/webcomponents/src/components/sign-in/sign-in.tsx"],"names":[],"mappings":"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","sourcesContent":["import { AttachInternals, Component, Element, h, Host, Prop } from '@stencil/core'\n\nimport Helpers from '../../utils/helpers'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n * Para uma descrição detalhada, consulte a [documentação do GovBR-DS](https://www.gov.br/ds/components/sign-in?tab=designer).\n *\n * Para acessibilidade adequada, especialmente em formatos circulares, use a propriedade aria-label:\n * <br-sign-in shape=\"circle\" aria-label=\"Fazer login com Gov.br\"></br-sign-in>\n *\n * Para controlar onde o link abre, use a propriedade target:\n * <br-sign-in href=\"https://accounts.google.com\" target=\"_self\">Login Google</br-sign-in>\n * <br-sign-in href=\"https://help.site.com\" target=\"_blank\">Ajuda</br-sign-in>\n *\n * @slot default - Conteúdo do label/texto do sign-in\n * @slot icon - Ícone personalizado. Para shape=\"circle\", um ícone padrão (fa6-solid:user) será exibido se nenhum for fornecido\n * @slot image - Imagem ou ícone exibido ao lado da label\n *\n * @part content - Área do conteúdo/texto dentro do sign-in\n * @part image - Área da imagem/ícone (para controle de tamanho via CSS)\n */\n@Component({\n tag: 'br-sign-in',\n styleUrl: 'sign-in.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class SignIn {\n /**\n * Referência ao elemento host do componente.\n * Utilize esta propriedade para acessar e manipular o elemento do DOM associado ao componente.\n */\n @Element() el: HTMLBrSignInElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Identificador único.\n * Caso não seja fornecido, um ID gerado automaticamente será usado.\n */\n @Prop({ reflect: true }) readonly customId: string = Helpers.generateUniqueId()\n\n /**\n * Define se o sign-in usará um esquema de cores escuro.\n */\n @Prop({ reflect: true }) readonly colorMode: 'dark'\n\n /**\n * Ajusta a densidade, alterando o espaçamento interno para um visual mais compacto ou mais expandido.\n */\n @Prop({ reflect: true }) readonly density: 'large' | 'medium' | 'small' = 'medium'\n\n /**\n * Desativa o sign-in, tornando-o não interativo.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Define a ênfase do sign-in, alterando sua aparência para criar hierarquia visual.\n */\n @Prop({ reflect: true }) readonly emphasis: 'primary' | 'secondary' = 'secondary'\n\n /**\n * Define o formato do sign-in.\n */\n @Prop({ reflect: true }) readonly shape: 'block' | 'circle' | 'pill' = 'pill'\n\n /**\n * URL para onde o usuário será redirecionado ao clicar. Use para login com provedores externos ou em sites tradicionais.\n */\n @Prop({ reflect: true }) readonly href: string\n\n /**\n * Define onde abrir o link quando href é fornecido.\n */\n @Prop({ reflect: true }) readonly target: '_self' | '_blank' | '_parent' | '_top' = '_self'\n\n /**\n * Define o rótulo acessível do sign-in, especialmente importante para formatos circulares.\n */\n @Prop({ reflect: true }) readonly ariaLabel: string\n\n private readonly handleClick = (event: MouseEvent) => {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n return\n }\n }\n\n private readonly handleFocus = (event: FocusEvent) => {\n if (this.disabled) {\n ;(event.target as HTMLElement)?.blur?.()\n }\n }\n\n private hasSlotContent(slotName: string): boolean {\n return this.el.querySelector(`[slot=\"${slotName}\"]`) !== null\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-sign-in': true,\n primary: this.emphasis === 'primary',\n secondary: this.emphasis === 'secondary',\n large: this.density === 'large',\n small: this.density === 'small',\n block: this.shape === 'block',\n circle: this.shape === 'circle',\n 'dark-mode': this.colorMode === 'dark',\n disabled: this.disabled,\n }\n }\n\n private getTagType(): string {\n return this.href && this.href.length > 0 ? 'a' : 'button'\n }\n\n private getAttributes() {\n const TagType = this.getTagType()\n\n if (TagType === 'a') {\n return {\n href: this.disabled ? null : this.href,\n target: this.disabled ? null : this.target,\n 'aria-disabled': this.disabled ? 'true' : null,\n 'aria-label': this.ariaLabel,\n }\n }\n\n return {\n type: 'button',\n disabled: this.disabled,\n 'aria-label': this.ariaLabel,\n }\n }\n\n render() {\n const TagType = this.getTagType()\n const attributes = this.getAttributes()\n const classList = this.getCssClassMap()\n\n return (\n <Host aria-disabled={this.disabled ? 'true' : null}>\n <TagType\n part=\"button\"\n class={classList}\n id={this.customId}\n {...attributes}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n >\n <slot name=\"icon\">{this.shape === 'circle' && <br-icon icon-name=\"fa6-solid:user\"></br-icon>}</slot>\n <span part=\"content\">\n <slot></slot>\n </span>\n {this.hasSlotContent('image') && (\n <span part=\"image\">\n <slot name=\"image\"></slot>\n </span>\n )}\n </TagType>\n </Host>\n )\n }\n}\n"]}
|
|
@@ -240,7 +240,7 @@ export class Step {
|
|
|
240
240
|
return ariaLabel;
|
|
241
241
|
}
|
|
242
242
|
render() {
|
|
243
|
-
return (h(Host, { key: '
|
|
243
|
+
return (h(Host, { key: '260ee78648df3fbdea867351a9c7e6a6ec8ced92' }, this.stepItems.length > 0 && (h("div", { key: '080b50b0a72031c19ffe962ca5450cd6af2ca9e5', role: "listbox", tabIndex: 0, "aria-orientation": this.layout, "aria-label": this.getAreaLabel(), class: this.getCssClassMap() }, h("slot", { key: '62b283c6c3c20c5743ebef7ba4e39811f01a75be' })))));
|
|
244
244
|
}
|
|
245
245
|
static get is() { return "br-step"; }
|
|
246
246
|
static get encapsulation() { return "shadow"; }
|
|
@@ -202,7 +202,7 @@ export class StepItem {
|
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
204
|
render() {
|
|
205
|
-
return (h(Host, { key: '
|
|
205
|
+
return (h(Host, { key: '6ad8d196434bf798653aefe9530191e97446df93' }, h("div", { key: 'a8b1a44ac8450744fd82eb675bcbadc9d8b50c42', id: "item-container", class: this.getStepContainerClassMap() }, h("div", { key: '4e31d7e06e0bcd2677d3ea2be553eeddf0ee2ce2', id: "item-content", class: this.getStepItemContentClassMap() }, h("div", { key: 'b0c03db09efb54cca28a72177d486b4f19e89371', id: "indicator-area", "data-active": this.active, class: this.getStepItemIndicatorAreaClassMap() }, this.mode === 'step' && this.highlight && (h("div", { key: '6612f4f5333c9be947ac515967c309a738e111f0', class: this.getHighlightClass() }, h("br-icon", { key: 'fd2b85f591d35b1835aeb02dd527ccbc6d27d913', "icon-name": this.IconsName[this.highlight], class: `${this.highlight === 'warning' && 'warning-color'}` }))), this.mode === 'step' && (h("br-button", { key: '9d599f1289b5e21767e7d3cdd9b5595158dc746f', shape: "circle", emphasis: "secondary", isActive: this.active, class: this.getStepItemIndicatorClass() }, this.contentType === 'no-content' && '', this.contentType === 'default' && this.content, this.contentType === 'br-icon' && (h("br-icon", { key: 'b8c60e93705559d39fedb21c1d04a496ddc6c9c2', "icon-name": this.brIconName, class: 'content-type-br-icon' })), this.contentType === 'slotted' && h("slot", { key: '81ded0e569aa2c41d155fa219b28dbb6e24806a0', name: 'content-area' }))), this.mode === 'controller' && h("button", { key: '2deaefbc908e810bec44e4db6eaacb2fcb307a78', "data-active": this.active, class: 'mode-controller' })), h("div", { key: 'b8616bb87c2f708ec36b8a0d2d00fd4a74f5ee5f', id: "label-area", class: this.getStepItemLabelAreaClassMap() }, h("span", { key: 'f1a4eb62403541532ea0899839088997e58e36f3' }, " ", this.label, " "))))));
|
|
206
206
|
}
|
|
207
207
|
static get is() { return "br-step-item"; }
|
|
208
208
|
static get encapsulation() { return "shadow"; }
|