@govbr-ds/webcomponents 2.0.0-next.46 → 2.0.0-next.47

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 (112) hide show
  1. package/dist/cjs/br-avatar.cjs.entry.js +1 -1
  2. package/dist/cjs/br-avatar.cjs.entry.js.map +1 -1
  3. package/dist/cjs/br-avatar.entry.cjs.js.map +1 -1
  4. package/dist/cjs/br-button.br-icon.entry.cjs.js.map +1 -1
  5. package/dist/cjs/br-button_2.cjs.entry.js +1 -1
  6. package/dist/cjs/br-button_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/br-switch.cjs.entry.js +28 -2
  8. package/dist/cjs/br-switch.cjs.entry.js.map +1 -1
  9. package/dist/cjs/br-switch.entry.cjs.js.map +1 -1
  10. package/dist/cjs/br-tag.cjs.entry.js +151 -13
  11. package/dist/cjs/br-tag.cjs.entry.js.map +1 -1
  12. package/dist/cjs/br-tag.entry.cjs.js.map +1 -1
  13. package/dist/cjs/br-textarea.cjs.entry.js +32 -5
  14. package/dist/cjs/br-textarea.cjs.entry.js.map +1 -1
  15. package/dist/cjs/br-textarea.entry.cjs.js.map +1 -1
  16. package/dist/cjs/br-tooltip.cjs.entry.js +1 -1
  17. package/dist/cjs/br-upload.cjs.entry.js +15 -23
  18. package/dist/cjs/br-upload.cjs.entry.js.map +1 -1
  19. package/dist/cjs/br-upload.entry.cjs.js.map +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/cjs/webcomponents.cjs.js +1 -1
  22. package/dist/collection/components/avatar/avatar.js +1 -1
  23. package/dist/collection/components/avatar/avatar.js.map +1 -1
  24. package/dist/collection/components/button/button.js +1 -1
  25. package/dist/collection/components/button/button.js.map +1 -1
  26. package/dist/collection/components/switch/switch.css +1 -1
  27. package/dist/collection/components/switch/switch.js +27 -1
  28. package/dist/collection/components/switch/switch.js.map +1 -1
  29. package/dist/collection/components/tag/tag.css +1 -1
  30. package/dist/collection/components/tag/tag.js +192 -14
  31. package/dist/collection/components/tag/tag.js.map +1 -1
  32. package/dist/collection/components/textarea/textarea.js +51 -5
  33. package/dist/collection/components/textarea/textarea.js.map +1 -1
  34. package/dist/collection/components/tooltip/tooltip.js +1 -1
  35. package/dist/collection/components/upload/upload.js +46 -30
  36. package/dist/collection/components/upload/upload.js.map +1 -1
  37. package/dist/components/br-avatar.js +3 -2
  38. package/dist/components/br-avatar.js.map +1 -1
  39. package/dist/components/br-breadcrumb.js +1 -1
  40. package/dist/components/br-button.js +4 -4
  41. package/dist/components/br-footer-social.js +1 -1
  42. package/dist/components/br-input.js +3 -3
  43. package/dist/components/br-message.js +1 -1
  44. package/dist/components/br-select.js +2 -2
  45. package/dist/components/br-step-item.js +1 -1
  46. package/dist/components/br-switch.js +35 -11
  47. package/dist/components/br-switch.js.map +1 -1
  48. package/dist/components/br-tag.js +166 -51
  49. package/dist/components/br-tag.js.map +1 -1
  50. package/dist/components/br-textarea.js +42 -15
  51. package/dist/components/br-textarea.js.map +1 -1
  52. package/dist/components/br-tooltip.js +15 -15
  53. package/dist/components/br-upload.js +56 -58
  54. package/dist/components/br-upload.js.map +1 -1
  55. package/dist/components/{p-DZhiQXGc.js → p-Bjt1OWm8.js} +3 -3
  56. package/dist/components/{p-ssSt5UuQ.js → p-Brhs7qAd.js} +6 -7
  57. package/dist/components/p-Brhs7qAd.js.map +1 -0
  58. package/dist/custom-elements.json +273 -9
  59. package/dist/esm/br-avatar.entry.js +1 -1
  60. package/dist/esm/br-avatar.entry.js.map +1 -1
  61. package/dist/esm/br-button.br-icon.entry.js.map +1 -1
  62. package/dist/esm/br-button_2.entry.js +1 -1
  63. package/dist/esm/br-button_2.entry.js.map +1 -1
  64. package/dist/esm/br-switch.entry.js +28 -2
  65. package/dist/esm/br-switch.entry.js.map +1 -1
  66. package/dist/esm/br-tag.entry.js +151 -13
  67. package/dist/esm/br-tag.entry.js.map +1 -1
  68. package/dist/esm/br-textarea.entry.js +32 -5
  69. package/dist/esm/br-textarea.entry.js.map +1 -1
  70. package/dist/esm/br-tooltip.entry.js +1 -1
  71. package/dist/esm/br-upload.entry.js +15 -23
  72. package/dist/esm/br-upload.entry.js.map +1 -1
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/webcomponents.js +1 -1
  75. package/dist/hydrate/index.js +239 -50
  76. package/dist/hydrate/index.mjs +239 -50
  77. package/dist/types/components/switch/switch.d.ts +8 -3
  78. package/dist/types/components/tag/tag.d.ts +45 -3
  79. package/dist/types/components/textarea/textarea.d.ts +18 -0
  80. package/dist/types/components/upload/upload.d.ts +14 -4
  81. package/dist/types/components.d.ts +40 -6
  82. package/dist/webcomponents/br-avatar.entry.esm.js.map +1 -1
  83. package/dist/webcomponents/br-button.br-icon.entry.esm.js.map +1 -1
  84. package/dist/webcomponents/br-switch.entry.esm.js.map +1 -1
  85. package/dist/webcomponents/br-tag.entry.esm.js.map +1 -1
  86. package/dist/webcomponents/br-textarea.entry.esm.js.map +1 -1
  87. package/dist/webcomponents/br-upload.entry.esm.js.map +1 -1
  88. package/dist/webcomponents/{p-fa0aeb0f.entry.js → p-3f18e20a.entry.js} +5 -6
  89. package/dist/webcomponents/p-3f18e20a.entry.js.map +1 -0
  90. package/dist/webcomponents/{p-8b15dfc8.entry.js → p-6dba4bb1.entry.js} +10 -10
  91. package/dist/webcomponents/{p-df6e707a.entry.js → p-7251c80f.entry.js} +4 -3
  92. package/dist/webcomponents/p-7251c80f.entry.js.map +1 -0
  93. package/dist/webcomponents/{p-24f6adad.entry.js → p-73794ac8.entry.js} +42 -16
  94. package/dist/webcomponents/p-73794ac8.entry.js.map +1 -0
  95. package/dist/webcomponents/{p-abf81334.entry.js → p-82dec3b6.entry.js} +36 -12
  96. package/dist/webcomponents/p-82dec3b6.entry.js.map +1 -0
  97. package/dist/webcomponents/{p-a802ca08.entry.js → p-861b8ebf.entry.js} +55 -58
  98. package/dist/webcomponents/p-861b8ebf.entry.js.map +1 -0
  99. package/dist/webcomponents/{p-761f7798.entry.js → p-d3463d4a.entry.js} +161 -48
  100. package/dist/webcomponents/p-d3463d4a.entry.js.map +1 -0
  101. package/dist/webcomponents/webcomponents.esm.js +1 -1
  102. package/dist/webcomponents.html-custom-data.json +15 -3
  103. package/package.json +1 -1
  104. package/dist/components/p-ssSt5UuQ.js.map +0 -1
  105. package/dist/webcomponents/p-24f6adad.entry.js.map +0 -1
  106. package/dist/webcomponents/p-761f7798.entry.js.map +0 -1
  107. package/dist/webcomponents/p-a802ca08.entry.js.map +0 -1
  108. package/dist/webcomponents/p-abf81334.entry.js.map +0 -1
  109. package/dist/webcomponents/p-df6e707a.entry.js.map +0 -1
  110. package/dist/webcomponents/p-fa0aeb0f.entry.js.map +0 -1
  111. /package/dist/components/{p-DZhiQXGc.js.map → p-Bjt1OWm8.js.map} +0 -0
  112. /package/dist/webcomponents/{p-8b15dfc8.entry.js.map → p-6dba4bb1.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"br-tag.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,MAAM,GAAG,o11EAAo11E;;ACgBn21E;;;;AAIG;AAEH;AACA,MAAM,aAAa,GAAG,OAAO;AAC7B,MAAM,cAAc,GAAG,QAAQ;AAC/B,MAAM,aAAa,GAAG,OAAO;AAE7B,MAAM,YAAY,GAAG,QAAQ;AAC7B,MAAM,aAAa,GAAG,SAAS;AAC/B,MAAM,aAAa,GAAG,SAAS;MAQlB,GAAG,GAAA,MAAA;AANhB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;AAgBE;;;AAGG;AAC+B,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AAEpD;;;AAGG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAEvD;;;AAGG;AAC+B,QAAA,IAAI,CAAA,IAAA,GAAW,EAAE;AAEnD;;AAEK;AAC6B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAE3D;;AAEK;AACmC,QAAA,IAAQ,CAAA,QAAA,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,CACH,EACDA,OAAA,CAAA,OAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAO,OAAO,EAAE,IAAI,CAAC,KAAK,EAAA,EACvB,IAAI,CAAC,UAAU,EAAE,EAClBA,OAAO,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAA,IAAI,CAAC,KAAK,CAAQ,CACnB,CACH,CACR,CACI;;;;;;;;;;AAKb,IAAI,KAAK,GAAG,CAAC;;;;;","names":["h","Host"],"sources":["../../packages/webcomponents/src/components/tag/tag.scss?tag=br-tag&encapsulation=shadow","../../packages/webcomponents/src/components/tag/tag.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/checkbox/checkbox\";\n@import \"~@govbr-ds/core/src/components/input/input\";\n@import \"~@govbr-ds/core/src/components/tag/tag\";\n\n:host {\n display: inline-block;\n\n .tag-position {\n display: flex;\n justify-content: space-around;\n align-items: center;\n }\n\n .tag-spacing-status {\n margin-left: var(--spacing-scale-half) !important;\n }\n}\n\n.br-tag {\n &:not(.icon) {\n br-icon {\n margin-right: var(--spacing-scale-base);\n }\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/tag?tab=designer).\n *\n * @slot default - Espaço de conteúdo do tag. Geralmente usado para incluir o rótulo ou um ícone.\n */\n\n// Constantes para valores fixos\nconst DENSITY_SMALL = 'small'\nconst DENSITY_MEDIUM = 'medium'\nconst DENSITY_LARGE = 'large'\n\nconst SHAPE_CIRCLE = 'circle'\nconst SHAPE_ROUNDED = 'rounded'\nconst SHAPE_DEFAULT = 'default'\n\n@Component({\n tag: 'br-tag',\n styleUrl: 'tag.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Tag {\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: HTMLBrTagElement\n\n /** API de controle de formulário nativa */\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * A propriedade 'label' é uma string que representa o texto a ser exibido no componente.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly label: string = ''\n\n /**\n * A propriedade 'iconName' define o nome do ícone que será exibido ao lado do texto.\n * O valor padrão é 'fa-solid:car', que corresponde a um ícone de carro da biblioteca Font Awesome.\n */\n @Prop({ reflect: true }) readonly iconName: string = ''\n\n /**\n * A propriedade 'name' é uma string que representa o nome do grupo da tag para seleção.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly name: string = ''\n\n /**\n * A tag permite seleção múltipla.\n * */\n @Prop({ reflect: true }) readonly multiple: boolean = false\n\n /**\n * A tag está selecionada.\n * */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false\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 = `br-tag-${tagId++}`\n\n /**\n * A propriedade 'color' permite definir a cor do componente.\n * Aceita valores como 'red', 'blue', entre outros, e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly color: string = ''\n\n /**\n * A propriedade 'density' permite definir a densidade do componente.\n * Aceita valores como 'small', 'medium' e 'large', e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = DENSITY_SMALL\n\n /**\n * A propriedade 'shape' define o formato do componente.\n * Valores possíveis:\n * - 'circle': Componente com formato circular.\n * - 'rounded': Componente com bordas arredondadas.\n * - 'default': Componente com formato padrão.\n */\n @Prop({ reflect: true }) readonly shape: 'circle' | 'rounded' | 'default' = SHAPE_DEFAULT\n\n /**\n * Status deve ser exibido.\n */\n @Prop({ reflect: true }) readonly status: boolean = false\n\n /**\n * Interação deve ser habilitada.\n */\n @Prop({ reflect: true, mutable: true }) interaction: boolean = false\n\n /**\n * Interação de seleção deve ser habilitada.\n * */\n @Prop({ reflect: true }) interactionSelect: boolean = false\n\n /**\n * Tag deve estar desabilitado.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Tag está selecionada.\n */\n @State() selectedClassValue: boolean = false\n\n /**\n * Evento emitido quando a tag é selecionada.\n */\n @Event() radioSelected: EventEmitter<string>\n\n @Watch('interaction')\n handleInteractionChange(newValue: boolean) {\n if (newValue && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n @Watch('interactionSelect')\n handleInteractionSelectChange(newValue: boolean) {\n if (newValue && this.interaction) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n componentWillLoad() {\n if (this.interaction && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n connectedCallback() {\n this.selectedClassValue = this.selected\n }\n\n @Watch('selected')\n handleSelectedChange(newValue: boolean) {\n this.selectedClassValue = newValue\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-tag': true,\n interaction: this.interaction,\n 'interaction-select': this.interactionSelect,\n selected: this.selectedClassValue,\n [this.color]: !!this.color,\n [DENSITY_SMALL]: this.density === DENSITY_SMALL,\n [DENSITY_MEDIUM]: this.density === DENSITY_MEDIUM,\n [DENSITY_LARGE]: this.density === DENSITY_LARGE,\n count: this.shape === SHAPE_ROUNDED,\n icon: this.shape === SHAPE_CIRCLE,\n status: this.status,\n }\n }\n\n private renderIcon() {\n return this.iconName && this.iconName.trim() !== '' ? (\n <br-icon icon-name={this.iconName} aria-hidden=\"true\" />\n ) : null\n }\n\n private renderLabel() {\n return this.shape !== SHAPE_CIRCLE && !this.status ? <span>{this.label}</span> : null\n }\n\n private renderCloseButton() {\n if (!this.interaction) return null\n return (\n <br-button\n type=\"button\"\n shape=\"circle\"\n emphasis=\"primary\"\n aria-label=\"Fechar\"\n onClick={this.handleClose}\n disabled={this.disabled}\n >\n <br-icon icon-name=\"fa-solid:times\"></br-icon>\n </br-button>\n )\n }\n\n private renderStatusLabel() {\n return this.status ? <span class=\"tag-spacing-status\">{this.label}</span> : null\n }\n\n private handleClose = () => {\n this.el.remove()\n }\n\n private handleChangeValueChecked = () => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n }\n this.selected = !this.selected\n }\n\n private handleChangeRadioValue = (event: MouseEvent) => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n this.selected = (event.target as HTMLInputElement).checked\n }\n }\n\n @Listen('radioSelected', { target: 'document' })\n handleCheckedChange(event: CustomEvent) {\n if (event.detail === this.name && this.el !== event.target) {\n this.selected = false\n }\n }\n\n render() {\n const mainTagContent = (\n <span class={this.getCssClassMap()} id={this.customId}>\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderCloseButton()}\n <slot></slot>\n </span>\n )\n\n return (\n <Host>\n {!this.status ? (\n mainTagContent\n ) : (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {mainTagContent}\n {this.renderStatusLabel()}\n </div>\n )}\n\n {this.interactionSelect && (\n <span class={this.getCssClassMap()} id={this.customId}>\n {this.multiple ? (\n <input\n id={this.label}\n type=\"checkbox\"\n name={this.name}\n value={this.label}\n checked={this.selected}\n onClick={this.handleChangeValueChecked}\n disabled={this.disabled}\n />\n ) : (\n <input\n id={this.label}\n type=\"radio\"\n name={this.name}\n value={this.label}\n checked={this.selected}\n onClick={this.handleChangeRadioValue}\n disabled={this.disabled}\n />\n )}\n <label htmlFor={this.label}>\n {this.renderIcon()}\n <span>{this.label}</span>\n </label>\n </span>\n )}\n </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A,OAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAA,EACnDA,OACE,CAAA,OAAA,EAAA,EAAA,EAAE,EAAE,CAAA,MAAA,EAAS,IAAI,CAAC,QAAQ,EAAE,EAC5B,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,OAAO,EAC1C,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,CAAA,EACFA,OAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,SAAS,IAAI,CAAC,QAAQ,CAAA,CAAE,EAAA,EACrC,IAAI,CAAC,UAAU,EAAE,EACjB,IAAI,CAAC,WAAW,EAAE,CACb,CACH;;IAIX,MAAM,GAAA;AACJ,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE;AAE/C,QAAA,QACEA,OAAC,CAAAC,UAAI,EACF,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAA,IAAI,CAAC;AACJ,cAAE,IAAI,CAAC,0BAA0B;cAC/B,IAAI,CAAC;AACL,kBAAE,IAAI,CAAC,kBAAkB,CAAC,WAAW;AACrC,kBAAE,WAAW,CACZ;;;;;;;;;;AAKb,IAAI,KAAK,GAAG,CAAC;;;;;","names":["h","Host"],"sources":["../../packages/webcomponents/src/components/tag/tag.scss?tag=br-tag&encapsulation=shadow","../../packages/webcomponents/src/components/tag/tag.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/checkbox/checkbox\";\n@import \"~@govbr-ds/core/src/components/input/input\";\n@import \"~@govbr-ds/core/src/components/tag/tag\";\n\n:host {\n display: inline-block;\n margin-right: var(--spacing-scale-half);\n\n .tag-spacing-status {\n margin-left: var(--spacing-scale-half) !important;\n }\n}\n\n.br-tag {\n &.interaction {\n br-button {\n margin-left: var(--spacing-scale-baseh);\n }\n }\n\n &:not(.icon) {\n br-icon {\n margin-right: var(--spacing-scale-base);\n }\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/tag?tab=designer).\n *\n * @slot default - Espaço de conteúdo do tag. Geralmente usado para incluir o rótulo ou um ícone.\n */\n\n// Constantes para valores fixos\nconst DENSITY_SMALL = 'small'\nconst DENSITY_MEDIUM = 'medium'\nconst DENSITY_LARGE = 'large'\n\nconst SHAPE_CIRCLE = 'circle'\nconst SHAPE_ROUNDED = 'rounded'\nconst SHAPE_DEFAULT = 'default'\n\n@Component({\n tag: 'br-tag',\n styleUrl: 'tag.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Tag {\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: HTMLBrTagElement\n\n /** API de controle de formulário nativa */\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * A propriedade 'label' é uma string que representa o texto a ser exibido no componente.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly label: string = ''\n\n /**\n * A propriedade 'iconName' define o nome do ícone que será exibido ao lado do texto.\n * O valor padrão é 'fa-solid:car', que corresponde a um ícone de carro da biblioteca Font Awesome.\n */\n @Prop({ reflect: true }) readonly iconName: string = ''\n\n /**\n * A propriedade 'name' é uma string que representa o nome do grupo da tag para seleção.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly name: string = ''\n\n /**\n * A tag permite seleção múltipla.\n * */\n @Prop({ reflect: true }) readonly multiple: boolean = false\n\n /**\n * A tag está selecionada.\n * */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false\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 = `br-tag-${tagId++}`\n\n /**\n * A propriedade 'color' permite definir a cor do componente.\n * Aceita valores como 'red', 'blue', entre outros, e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly color: string = ''\n\n /**\n * A propriedade 'density' permite definir a densidade do componente.\n * Aceita valores como 'small', 'medium' e 'large', e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = DENSITY_MEDIUM\n\n /**\n * A propriedade 'shape' define o formato do componente.\n * Valores possíveis:\n * - 'circle': Componente com formato circular.\n * - 'rounded': Componente com bordas arredondadas.\n * - 'default': Componente com formato padrão.\n */\n @Prop({ reflect: true }) readonly shape: 'circle' | 'rounded' | 'default' = SHAPE_DEFAULT\n\n /**\n * Transforma a tag em um indicador de status, com aparência circular.\n * É flexível podendo ser utilizado com label ou apenas a superfície circular (informação é transmitida por meio de cores).\n */\n @Prop({ reflect: true }) readonly status: boolean = false\n\n /**\n * Interação deve ser habilitada.\n */\n @Prop({ reflect: true, mutable: true }) interaction: boolean = false\n\n /**\n * Interação de seleção deve ser habilitada.\n * */\n @Prop({ reflect: true }) interactionSelect: boolean = false\n\n /**\n * Tag deve estar desabilitado.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Rótulo personalizado para leitores de tela.\n * Quando fornecido, substitui completamente o texto visível para usuários de leitores de tela.\n * Útil quando o texto visível não é suficientemente descritivo (ex: ícones, abreviações).\n */\n @Prop({ reflect: true }) readonly ariaLabel: string = null\n\n /**\n * ID do elemento que fornece descrição adicional da tag.\n * Referencia um elemento na página que contém informações complementares sobre a tag.\n * A descrição é lida após o conteúdo principal, fornecendo contexto extra aos usuários de leitores de tela.\n * Exemplo: aria-describedby=\"help-status\" onde existe <div id=\"help-status\">Aguardando aprovação</div>\n */\n @Prop({ reflect: true }) readonly ariaDescribedby: string = null\n\n /**\n * Tag está selecionada.\n */\n @State() selectedClassValue: boolean = false\n\n /**\n * Evento emitido quando a tag é selecionada.\n */\n @Event() radioSelected: EventEmitter<string>\n\n @Watch('interaction')\n handleInteractionChange(newValue: boolean) {\n if (newValue && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n @Watch('interactionSelect')\n handleInteractionSelectChange(newValue: boolean) {\n if (newValue && this.interaction) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n @Watch('selected')\n handleSelectedChange(newValue: boolean) {\n this.selectedClassValue = newValue\n }\n\n @Listen('radioSelected', { target: 'document' })\n handleCheckedChange(event: CustomEvent) {\n if (event.detail === this.name && this.el !== event.target) {\n this.selected = false\n }\n }\n\n componentWillLoad() {\n if (this.interaction && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n connectedCallback() {\n this.selectedClassValue = this.selected\n this.el.addEventListener('keydown', this.handleKeyDown)\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('keydown', this.handleKeyDown)\n }\n /**\n * Permite navegação por teclado (setas) entre tags do tipo radio (seleção unica).\n * Funciona apenas quando 'interactionSelect' é true e 'multiple' é false.\n * Ignora tags desabilitadas.\n * @param event - Evento de teclado\n */\n private handleKeyDown = (event: KeyboardEvent) => {\n if (!this.interactionSelect || this.multiple || this.disabled) return\n\n if (event.key === 'ArrowRight') {\n event.preventDefault()\n this.selectNextRadio()\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault()\n this.selectPreviousRadio()\n }\n }\n\n private selectNextRadio() {\n this.selectRadioByStep(1)\n }\n\n private selectPreviousRadio() {\n this.selectRadioByStep(-1)\n }\n\n private selectRadioByStep(step: number) {\n const radios = Array.from(\n document.querySelectorAll(`br-tag[interaction-select][name=\"${this.name}\"]:not([disabled])`)\n ) as HTMLElement[]\n const currentIndex = radios.indexOf(this.el)\n if (currentIndex === -1) return\n const newIndex = (currentIndex + step + radios.length) % radios.length\n this.selectRadioByIndex(radios, newIndex)\n }\n\n private selectRadioByIndex(radios: HTMLElement[], index: number) {\n const nextRadio = radios[index] as HTMLBrTagElement\n const input = nextRadio.shadowRoot?.querySelector('input[type=\"radio\"]') as HTMLInputElement | null\n if (input !== null) {\n input.focus()\n input.click()\n }\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-tag': true,\n interaction: this.interaction,\n 'interaction-select': this.interactionSelect,\n selected: this.selectedClassValue,\n disabled: this.disabled,\n [this.color]: this.color !== '',\n [DENSITY_SMALL]: this.density === DENSITY_SMALL,\n [DENSITY_MEDIUM]: this.density === DENSITY_MEDIUM,\n [DENSITY_LARGE]: this.density === DENSITY_LARGE,\n count: this.shape === SHAPE_ROUNDED,\n icon: this.shape === SHAPE_CIRCLE,\n status: this.status,\n }\n }\n\n private getTagAttributes() {\n if (this.interaction) {\n return {\n id: this.customId,\n }\n }\n\n return {\n id: this.customId,\n role: this.getRole(),\n 'aria-label': this.getAriaLabel(),\n 'aria-describedby': this.getAriaDescribedBy(),\n 'aria-checked': this.getAriaChecked(),\n 'aria-disabled': this.getAriaDisabled(),\n }\n }\n\n private getAriaDescribedBy(): string | null {\n const hostTitle = this.el.getAttribute('title')\n if (this.hasContent(hostTitle)) {\n return null\n }\n\n const hasInternalLabel = !this.status && this.label !== ''\n\n if (this.ariaDescribedby && this.ariaDescribedby.trim() !== '') {\n return this.ariaDescribedby\n }\n\n if (hasInternalLabel && !this.hasContent(this.ariaLabel)) {\n return `${this.customId}-label`\n }\n\n return null\n }\n\n /**\n * Verifica se uma string possui conteúdo válido (não vazia após remover espaços em branco).\n * @param value - String a ser verificada\n * @returns {boolean} true se a string possui conteúdo\n */\n private hasContent(value: string): boolean {\n return value?.trim().length > 0\n }\n\n private getAriaLabel(): string | null {\n return this.ariaLabel && this.ariaLabel.trim() !== '' ? this.ariaLabel : null\n }\n\n private getRole(): string | null {\n const hostTitle = this.el.getAttribute('title')\n if (this.hasContent(hostTitle)) {\n return null\n }\n\n if (this.interactionSelect) return this.multiple ? 'checkbox' : 'radio'\n return 'status'\n }\n\n private getAriaChecked(): string | null {\n return this.interactionSelect ? (this.selected ? 'true' : 'false') : null\n }\n\n private getAriaDisabled(): string | null {\n return this.disabled ? 'true' : null\n }\n\n private renderIcon() {\n return this.iconName && this.iconName.trim() !== '' ? (\n <br-icon icon-name={this.iconName} aria-hidden=\"true\" />\n ) : null\n }\n\n private renderLabel() {\n return this.shape !== SHAPE_CIRCLE && !this.status ? <span id={`${this.customId}-label`}>{this.label}</span> : null\n }\n\n private renderCloseButton() {\n if (!this.interaction) return null\n return (\n <br-button\n shape=\"circle\"\n emphasis=\"primary\"\n density=\"small\"\n aria-label={`Fechar ${this.label || 'tag'}`}\n onClick={this.handleClose}\n disabled={this.disabled}\n >\n <br-icon icon-name=\"fa-solid:times\" aria-hidden=\"true\"></br-icon>\n </br-button>\n )\n }\n\n private renderStatusLabel() {\n return this.status ? <span class=\"tag-spacing-status\">{this.label}</span> : null\n }\n\n private handleClose = () => {\n this.el.remove()\n }\n\n private handleChangeValueChecked = () => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n }\n this.selected = !this.selected\n }\n\n private handleChangeRadioValue = (event: MouseEvent) => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n this.selected = (event.target as HTMLInputElement).checked\n }\n }\n\n private renderMainTagContent() {\n return (\n <span class={this.getCssClassMap()} {...this.getTagAttributes()}>\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderCloseButton()}\n <slot></slot>\n </span>\n )\n }\n\n private renderStatusLayout(content: JSX.Element) {\n return (\n <span style={{ display: 'flex', alignItems: 'center' }}>\n {content}\n {this.renderStatusLabel()}\n </span>\n )\n }\n\n private handleInputChange = (event: MouseEvent) => {\n if (this.multiple) {\n this.handleChangeValueChecked()\n } else {\n this.handleChangeRadioValue(event)\n }\n }\n\n private renderInteractionSelectTag() {\n if (!this.interactionSelect) {\n return null\n }\n\n return (\n <span class={this.getCssClassMap()} id={this.customId}>\n <input\n id={`input-${this.customId}`}\n type={this.multiple ? 'checkbox' : 'radio'}\n name={this.name}\n value={this.label}\n checked={this.selected}\n onClick={this.handleInputChange}\n disabled={this.disabled}\n />\n <label htmlFor={`input-${this.customId}`}>\n {this.renderIcon()}\n {this.renderLabel()}\n </label>\n </span>\n )\n }\n\n render() {\n const mainContent = this.renderMainTagContent()\n\n return (\n <Host>\n {this.interactionSelect\n ? this.renderInteractionSelectTag()\n : this.status\n ? this.renderStatusLayout(mainContent)\n : mainContent}\n </Host>\n )\n }\n}\n\nlet tagId = 0\n"],"version":3}
@@ -1 +1 @@
1
- {"version":3,"file":"br-tag.entry.cjs.js","sources":["../../packages/webcomponents/src/components/tag/tag.scss?tag=br-tag&encapsulation=shadow","../../packages/webcomponents/src/components/tag/tag.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/checkbox/checkbox\";\n@import \"~@govbr-ds/core/src/components/input/input\";\n@import \"~@govbr-ds/core/src/components/tag/tag\";\n\n:host {\n display: inline-block;\n\n .tag-position {\n display: flex;\n justify-content: space-around;\n align-items: center;\n }\n\n .tag-spacing-status {\n margin-left: var(--spacing-scale-half) !important;\n }\n}\n\n.br-tag {\n &:not(.icon) {\n br-icon {\n margin-right: var(--spacing-scale-base);\n }\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/tag?tab=designer).\n *\n * @slot default - Espaço de conteúdo do tag. Geralmente usado para incluir o rótulo ou um ícone.\n */\n\n// Constantes para valores fixos\nconst DENSITY_SMALL = 'small'\nconst DENSITY_MEDIUM = 'medium'\nconst DENSITY_LARGE = 'large'\n\nconst SHAPE_CIRCLE = 'circle'\nconst SHAPE_ROUNDED = 'rounded'\nconst SHAPE_DEFAULT = 'default'\n\n@Component({\n tag: 'br-tag',\n styleUrl: 'tag.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Tag {\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: HTMLBrTagElement\n\n /** API de controle de formulário nativa */\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * A propriedade 'label' é uma string que representa o texto a ser exibido no componente.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly label: string = ''\n\n /**\n * A propriedade 'iconName' define o nome do ícone que será exibido ao lado do texto.\n * O valor padrão é 'fa-solid:car', que corresponde a um ícone de carro da biblioteca Font Awesome.\n */\n @Prop({ reflect: true }) readonly iconName: string = ''\n\n /**\n * A propriedade 'name' é uma string que representa o nome do grupo da tag para seleção.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly name: string = ''\n\n /**\n * A tag permite seleção múltipla.\n * */\n @Prop({ reflect: true }) readonly multiple: boolean = false\n\n /**\n * A tag está selecionada.\n * */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false\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 = `br-tag-${tagId++}`\n\n /**\n * A propriedade 'color' permite definir a cor do componente.\n * Aceita valores como 'red', 'blue', entre outros, e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly color: string = ''\n\n /**\n * A propriedade 'density' permite definir a densidade do componente.\n * Aceita valores como 'small', 'medium' e 'large', e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = DENSITY_SMALL\n\n /**\n * A propriedade 'shape' define o formato do componente.\n * Valores possíveis:\n * - 'circle': Componente com formato circular.\n * - 'rounded': Componente com bordas arredondadas.\n * - 'default': Componente com formato padrão.\n */\n @Prop({ reflect: true }) readonly shape: 'circle' | 'rounded' | 'default' = SHAPE_DEFAULT\n\n /**\n * Status deve ser exibido.\n */\n @Prop({ reflect: true }) readonly status: boolean = false\n\n /**\n * Interação deve ser habilitada.\n */\n @Prop({ reflect: true, mutable: true }) interaction: boolean = false\n\n /**\n * Interação de seleção deve ser habilitada.\n * */\n @Prop({ reflect: true }) interactionSelect: boolean = false\n\n /**\n * Tag deve estar desabilitado.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Tag está selecionada.\n */\n @State() selectedClassValue: boolean = false\n\n /**\n * Evento emitido quando a tag é selecionada.\n */\n @Event() radioSelected: EventEmitter<string>\n\n @Watch('interaction')\n handleInteractionChange(newValue: boolean) {\n if (newValue && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n @Watch('interactionSelect')\n handleInteractionSelectChange(newValue: boolean) {\n if (newValue && this.interaction) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n componentWillLoad() {\n if (this.interaction && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n connectedCallback() {\n this.selectedClassValue = this.selected\n }\n\n @Watch('selected')\n handleSelectedChange(newValue: boolean) {\n this.selectedClassValue = newValue\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-tag': true,\n interaction: this.interaction,\n 'interaction-select': this.interactionSelect,\n selected: this.selectedClassValue,\n [this.color]: !!this.color,\n [DENSITY_SMALL]: this.density === DENSITY_SMALL,\n [DENSITY_MEDIUM]: this.density === DENSITY_MEDIUM,\n [DENSITY_LARGE]: this.density === DENSITY_LARGE,\n count: this.shape === SHAPE_ROUNDED,\n icon: this.shape === SHAPE_CIRCLE,\n status: this.status,\n }\n }\n\n private renderIcon() {\n return this.iconName && this.iconName.trim() !== '' ? (\n <br-icon icon-name={this.iconName} aria-hidden=\"true\" />\n ) : null\n }\n\n private renderLabel() {\n return this.shape !== SHAPE_CIRCLE && !this.status ? <span>{this.label}</span> : null\n }\n\n private renderCloseButton() {\n if (!this.interaction) return null\n return (\n <br-button\n type=\"button\"\n shape=\"circle\"\n emphasis=\"primary\"\n aria-label=\"Fechar\"\n onClick={this.handleClose}\n disabled={this.disabled}\n >\n <br-icon icon-name=\"fa-solid:times\"></br-icon>\n </br-button>\n )\n }\n\n private renderStatusLabel() {\n return this.status ? <span class=\"tag-spacing-status\">{this.label}</span> : null\n }\n\n private handleClose = () => {\n this.el.remove()\n }\n\n private handleChangeValueChecked = () => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n }\n this.selected = !this.selected\n }\n\n private handleChangeRadioValue = (event: MouseEvent) => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n this.selected = (event.target as HTMLInputElement).checked\n }\n }\n\n @Listen('radioSelected', { target: 'document' })\n handleCheckedChange(event: CustomEvent) {\n if (event.detail === this.name && this.el !== event.target) {\n this.selected = false\n }\n }\n\n render() {\n const mainTagContent = (\n <span class={this.getCssClassMap()} id={this.customId}>\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderCloseButton()}\n <slot></slot>\n </span>\n )\n\n return (\n <Host>\n {!this.status ? (\n mainTagContent\n ) : (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {mainTagContent}\n {this.renderStatusLabel()}\n </div>\n )}\n\n {this.interactionSelect && (\n <span class={this.getCssClassMap()} id={this.customId}>\n {this.multiple ? (\n <input\n id={this.label}\n type=\"checkbox\"\n name={this.name}\n value={this.label}\n checked={this.selected}\n onClick={this.handleChangeValueChecked}\n disabled={this.disabled}\n />\n ) : (\n <input\n id={this.label}\n type=\"radio\"\n name={this.name}\n value={this.label}\n checked={this.selected}\n onClick={this.handleChangeRadioValue}\n disabled={this.disabled}\n />\n )}\n <label htmlFor={this.label}>\n {this.renderIcon()}\n <span>{this.label}</span>\n </label>\n </span>\n )}\n </Host>\n )\n }\n}\n\nlet tagId = 0\n"],"names":["h","Host"],"mappings":";;;;;;;;AAAA,MAAM,MAAM,GAAG,o11EAAo11E;;ACgBn21E;;;;AAIG;AAEH;AACA,MAAM,aAAa,GAAG,OAAO;AAC7B,MAAM,cAAc,GAAG,QAAQ;AAC/B,MAAM,aAAa,GAAG,OAAO;AAE7B,MAAM,YAAY,GAAG,QAAQ;AAC7B,MAAM,aAAa,GAAG,SAAS;AAC/B,MAAM,aAAa,GAAG,SAAS;MAQlB,GAAG,GAAA,MAAA;AANhB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;AAgBE;;;AAGG;AAC+B,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AAEpD;;;AAGG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAW,EAAE;AAEvD;;;AAGG;AAC+B,QAAA,IAAI,CAAA,IAAA,GAAW,EAAE;AAEnD;;AAEK;AAC6B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAE3D;;AAEK;AACmC,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAEjE;;;AAGG;AAC+B,QAAA,IAAA,CAAA,QAAQ,GAAW,UAAU,KAAK,EAAE,EAAE;AAExE;;;AAGG;AAC+B,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AAEpD;;;AAGG;AAC+B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,GAAA,EAAA,0CAAA,EAAA,EAAA,IAAI,CAAC,KAAK,CAAQ,CACnB,CACH,CACR,CACI;;;;;;;;;;AAKb,IAAI,KAAK,GAAG,CAAC;;;;;"}
1
+ {"version":3,"file":"br-tag.entry.cjs.js","sources":["../../packages/webcomponents/src/components/tag/tag.scss?tag=br-tag&encapsulation=shadow","../../packages/webcomponents/src/components/tag/tag.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/checkbox/checkbox\";\n@import \"~@govbr-ds/core/src/components/input/input\";\n@import \"~@govbr-ds/core/src/components/tag/tag\";\n\n:host {\n display: inline-block;\n margin-right: var(--spacing-scale-half);\n\n .tag-spacing-status {\n margin-left: var(--spacing-scale-half) !important;\n }\n}\n\n.br-tag {\n &.interaction {\n br-button {\n margin-left: var(--spacing-scale-baseh);\n }\n }\n\n &:not(.icon) {\n br-icon {\n margin-right: var(--spacing-scale-base);\n }\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/tag?tab=designer).\n *\n * @slot default - Espaço de conteúdo do tag. Geralmente usado para incluir o rótulo ou um ícone.\n */\n\n// Constantes para valores fixos\nconst DENSITY_SMALL = 'small'\nconst DENSITY_MEDIUM = 'medium'\nconst DENSITY_LARGE = 'large'\n\nconst SHAPE_CIRCLE = 'circle'\nconst SHAPE_ROUNDED = 'rounded'\nconst SHAPE_DEFAULT = 'default'\n\n@Component({\n tag: 'br-tag',\n styleUrl: 'tag.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Tag {\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: HTMLBrTagElement\n\n /** API de controle de formulário nativa */\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * A propriedade 'label' é uma string que representa o texto a ser exibido no componente.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly label: string = ''\n\n /**\n * A propriedade 'iconName' define o nome do ícone que será exibido ao lado do texto.\n * O valor padrão é 'fa-solid:car', que corresponde a um ícone de carro da biblioteca Font Awesome.\n */\n @Prop({ reflect: true }) readonly iconName: string = ''\n\n /**\n * A propriedade 'name' é uma string que representa o nome do grupo da tag para seleção.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) readonly name: string = ''\n\n /**\n * A tag permite seleção múltipla.\n * */\n @Prop({ reflect: true }) readonly multiple: boolean = false\n\n /**\n * A tag está selecionada.\n * */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false\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 = `br-tag-${tagId++}`\n\n /**\n * A propriedade 'color' permite definir a cor do componente.\n * Aceita valores como 'red', 'blue', entre outros, e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly color: string = ''\n\n /**\n * A propriedade 'density' permite definir a densidade do componente.\n * Aceita valores como 'small', 'medium' e 'large', e é refletida no DOM.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = DENSITY_MEDIUM\n\n /**\n * A propriedade 'shape' define o formato do componente.\n * Valores possíveis:\n * - 'circle': Componente com formato circular.\n * - 'rounded': Componente com bordas arredondadas.\n * - 'default': Componente com formato padrão.\n */\n @Prop({ reflect: true }) readonly shape: 'circle' | 'rounded' | 'default' = SHAPE_DEFAULT\n\n /**\n * Transforma a tag em um indicador de status, com aparência circular.\n * É flexível podendo ser utilizado com label ou apenas a superfície circular (informação é transmitida por meio de cores).\n */\n @Prop({ reflect: true }) readonly status: boolean = false\n\n /**\n * Interação deve ser habilitada.\n */\n @Prop({ reflect: true, mutable: true }) interaction: boolean = false\n\n /**\n * Interação de seleção deve ser habilitada.\n * */\n @Prop({ reflect: true }) interactionSelect: boolean = false\n\n /**\n * Tag deve estar desabilitado.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Rótulo personalizado para leitores de tela.\n * Quando fornecido, substitui completamente o texto visível para usuários de leitores de tela.\n * Útil quando o texto visível não é suficientemente descritivo (ex: ícones, abreviações).\n */\n @Prop({ reflect: true }) readonly ariaLabel: string = null\n\n /**\n * ID do elemento que fornece descrição adicional da tag.\n * Referencia um elemento na página que contém informações complementares sobre a tag.\n * A descrição é lida após o conteúdo principal, fornecendo contexto extra aos usuários de leitores de tela.\n * Exemplo: aria-describedby=\"help-status\" onde existe <div id=\"help-status\">Aguardando aprovação</div>\n */\n @Prop({ reflect: true }) readonly ariaDescribedby: string = null\n\n /**\n * Tag está selecionada.\n */\n @State() selectedClassValue: boolean = false\n\n /**\n * Evento emitido quando a tag é selecionada.\n */\n @Event() radioSelected: EventEmitter<string>\n\n @Watch('interaction')\n handleInteractionChange(newValue: boolean) {\n if (newValue && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n @Watch('interactionSelect')\n handleInteractionSelectChange(newValue: boolean) {\n if (newValue && this.interaction) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n\n @Watch('selected')\n handleSelectedChange(newValue: boolean) {\n this.selectedClassValue = newValue\n }\n\n @Listen('radioSelected', { target: 'document' })\n handleCheckedChange(event: CustomEvent) {\n if (event.detail === this.name && this.el !== event.target) {\n this.selected = false\n }\n }\n\n componentWillLoad() {\n if (this.interaction && this.interactionSelect) {\n console.warn(\n \"Aviso: 'interaction' e 'interactionSelect' não podem ser usados ao mesmo tempo. Alterando o 'interaction' para 'false'.\"\n )\n this.interaction = false\n }\n }\n connectedCallback() {\n this.selectedClassValue = this.selected\n this.el.addEventListener('keydown', this.handleKeyDown)\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('keydown', this.handleKeyDown)\n }\n /**\n * Permite navegação por teclado (setas) entre tags do tipo radio (seleção unica).\n * Funciona apenas quando 'interactionSelect' é true e 'multiple' é false.\n * Ignora tags desabilitadas.\n * @param event - Evento de teclado\n */\n private handleKeyDown = (event: KeyboardEvent) => {\n if (!this.interactionSelect || this.multiple || this.disabled) return\n\n if (event.key === 'ArrowRight') {\n event.preventDefault()\n this.selectNextRadio()\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault()\n this.selectPreviousRadio()\n }\n }\n\n private selectNextRadio() {\n this.selectRadioByStep(1)\n }\n\n private selectPreviousRadio() {\n this.selectRadioByStep(-1)\n }\n\n private selectRadioByStep(step: number) {\n const radios = Array.from(\n document.querySelectorAll(`br-tag[interaction-select][name=\"${this.name}\"]:not([disabled])`)\n ) as HTMLElement[]\n const currentIndex = radios.indexOf(this.el)\n if (currentIndex === -1) return\n const newIndex = (currentIndex + step + radios.length) % radios.length\n this.selectRadioByIndex(radios, newIndex)\n }\n\n private selectRadioByIndex(radios: HTMLElement[], index: number) {\n const nextRadio = radios[index] as HTMLBrTagElement\n const input = nextRadio.shadowRoot?.querySelector('input[type=\"radio\"]') as HTMLInputElement | null\n if (input !== null) {\n input.focus()\n input.click()\n }\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-tag': true,\n interaction: this.interaction,\n 'interaction-select': this.interactionSelect,\n selected: this.selectedClassValue,\n disabled: this.disabled,\n [this.color]: this.color !== '',\n [DENSITY_SMALL]: this.density === DENSITY_SMALL,\n [DENSITY_MEDIUM]: this.density === DENSITY_MEDIUM,\n [DENSITY_LARGE]: this.density === DENSITY_LARGE,\n count: this.shape === SHAPE_ROUNDED,\n icon: this.shape === SHAPE_CIRCLE,\n status: this.status,\n }\n }\n\n private getTagAttributes() {\n if (this.interaction) {\n return {\n id: this.customId,\n }\n }\n\n return {\n id: this.customId,\n role: this.getRole(),\n 'aria-label': this.getAriaLabel(),\n 'aria-describedby': this.getAriaDescribedBy(),\n 'aria-checked': this.getAriaChecked(),\n 'aria-disabled': this.getAriaDisabled(),\n }\n }\n\n private getAriaDescribedBy(): string | null {\n const hostTitle = this.el.getAttribute('title')\n if (this.hasContent(hostTitle)) {\n return null\n }\n\n const hasInternalLabel = !this.status && this.label !== ''\n\n if (this.ariaDescribedby && this.ariaDescribedby.trim() !== '') {\n return this.ariaDescribedby\n }\n\n if (hasInternalLabel && !this.hasContent(this.ariaLabel)) {\n return `${this.customId}-label`\n }\n\n return null\n }\n\n /**\n * Verifica se uma string possui conteúdo válido (não vazia após remover espaços em branco).\n * @param value - String a ser verificada\n * @returns {boolean} true se a string possui conteúdo\n */\n private hasContent(value: string): boolean {\n return value?.trim().length > 0\n }\n\n private getAriaLabel(): string | null {\n return this.ariaLabel && this.ariaLabel.trim() !== '' ? this.ariaLabel : null\n }\n\n private getRole(): string | null {\n const hostTitle = this.el.getAttribute('title')\n if (this.hasContent(hostTitle)) {\n return null\n }\n\n if (this.interactionSelect) return this.multiple ? 'checkbox' : 'radio'\n return 'status'\n }\n\n private getAriaChecked(): string | null {\n return this.interactionSelect ? (this.selected ? 'true' : 'false') : null\n }\n\n private getAriaDisabled(): string | null {\n return this.disabled ? 'true' : null\n }\n\n private renderIcon() {\n return this.iconName && this.iconName.trim() !== '' ? (\n <br-icon icon-name={this.iconName} aria-hidden=\"true\" />\n ) : null\n }\n\n private renderLabel() {\n return this.shape !== SHAPE_CIRCLE && !this.status ? <span id={`${this.customId}-label`}>{this.label}</span> : null\n }\n\n private renderCloseButton() {\n if (!this.interaction) return null\n return (\n <br-button\n shape=\"circle\"\n emphasis=\"primary\"\n density=\"small\"\n aria-label={`Fechar ${this.label || 'tag'}`}\n onClick={this.handleClose}\n disabled={this.disabled}\n >\n <br-icon icon-name=\"fa-solid:times\" aria-hidden=\"true\"></br-icon>\n </br-button>\n )\n }\n\n private renderStatusLabel() {\n return this.status ? <span class=\"tag-spacing-status\">{this.label}</span> : null\n }\n\n private handleClose = () => {\n this.el.remove()\n }\n\n private handleChangeValueChecked = () => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n }\n this.selected = !this.selected\n }\n\n private handleChangeRadioValue = (event: MouseEvent) => {\n if (!this.multiple) {\n this.radioSelected.emit(this.name)\n this.selected = (event.target as HTMLInputElement).checked\n }\n }\n\n private renderMainTagContent() {\n return (\n <span class={this.getCssClassMap()} {...this.getTagAttributes()}>\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderCloseButton()}\n <slot></slot>\n </span>\n )\n }\n\n private renderStatusLayout(content: JSX.Element) {\n return (\n <span style={{ display: 'flex', alignItems: 'center' }}>\n {content}\n {this.renderStatusLabel()}\n </span>\n )\n }\n\n private handleInputChange = (event: MouseEvent) => {\n if (this.multiple) {\n this.handleChangeValueChecked()\n } else {\n this.handleChangeRadioValue(event)\n }\n }\n\n private renderInteractionSelectTag() {\n if (!this.interactionSelect) {\n return null\n }\n\n return (\n <span class={this.getCssClassMap()} id={this.customId}>\n <input\n id={`input-${this.customId}`}\n type={this.multiple ? 'checkbox' : 'radio'}\n name={this.name}\n value={this.label}\n checked={this.selected}\n onClick={this.handleInputChange}\n disabled={this.disabled}\n />\n <label htmlFor={`input-${this.customId}`}>\n {this.renderIcon()}\n {this.renderLabel()}\n </label>\n </span>\n )\n }\n\n render() {\n const mainContent = this.renderMainTagContent()\n\n return (\n <Host>\n {this.interactionSelect\n ? this.renderInteractionSelectTag()\n : this.status\n ? this.renderStatusLayout(mainContent)\n : mainContent}\n </Host>\n )\n }\n}\n\nlet tagId = 0\n"],"names":["h","Host"],"mappings":";;;;;;;;AAAA,MAAM,MAAM,GAAG,+v1EAA+v1E;;ACgB9w1E;;;;AAIG;AAEH;AACA,MAAM,aAAa,GAAG,OAAO;AAC7B,MAAM,cAAc,GAAG,QAAQ;AAC/B,MAA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E,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,OAAO,EAC1C,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,CAAA,EACFA,OAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,SAAS,IAAI,CAAC,QAAQ,CAAA,CAAE,EAAA,EACrC,IAAI,CAAC,UAAU,EAAE,EACjB,IAAI,CAAC,WAAW,EAAE,CACb,CACH;;IAIX,MAAM,GAAA;AACJ,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE;AAE/C,QAAA,QACEA,OAAC,CAAAC,UAAI,EACF,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAA,IAAI,CAAC;AACJ,cAAE,IAAI,CAAC,0BAA0B;cAC/B,IAAI,CAAC;AACL,kBAAE,IAAI,CAAC,kBAAkB,CAAC,WAAW;AACrC,kBAAE,WAAW,CACZ;;;;;;;;;;AAKb,IAAI,KAAK,GAAG,CAAC;;;;;"}
@@ -46,15 +46,15 @@ const Textarea = class {
46
46
  this.isInline = false;
47
47
  this.handleInput = (event) => {
48
48
  this.value = event.target.value;
49
- this.currentLength = this.value?.length;
49
+ this.currentLength = this.value?.length || 0;
50
50
  this.valueChange.emit(this.value);
51
51
  };
52
52
  }
53
53
  componentWillLoad() {
54
- this.currentLength = this.value?.length;
54
+ this.currentLength = this.value?.length || 0;
55
55
  }
56
56
  valueChanged() {
57
- this.currentLength = this.value?.length;
57
+ this.currentLength = this.value?.length || 0;
58
58
  }
59
59
  /**
60
60
  * Define um novo valor para o textarea.
@@ -62,9 +62,35 @@ const Textarea = class {
62
62
  */
63
63
  async setValue(newValue) {
64
64
  this.value = newValue;
65
- this.currentLength = this.value?.length;
65
+ this.currentLength = this.value?.length || 0;
66
66
  this.valueChange.emit(this.value);
67
67
  }
68
+ /**
69
+ * Retorna os ids para o atributo aria-describedby do textarea
70
+ */
71
+ getDescribedBy() {
72
+ return [this.showCounter ? `${this.customId}-limitMax` : null, `${this.customId}-slotInfo`]
73
+ .filter(Boolean)
74
+ .join(' ');
75
+ }
76
+ /**
77
+ * Determina o texto a ser usado para acessibilidade quando não há label
78
+ * Ordem de prioridade:
79
+ * - aria-label do elemento host
80
+ * - propriedade ariaLabel do componente
81
+ * - placeholder
82
+ * - texto padrão ("Campo de texto")
83
+ */
84
+ getAccessibilityLabel() {
85
+ const hostAriaLabel = this.el.getAttribute('aria-label');
86
+ return hostAriaLabel && hostAriaLabel.trim() !== ''
87
+ ? hostAriaLabel
88
+ : this.ariaLabel && this.ariaLabel.trim() !== ''
89
+ ? this.ariaLabel
90
+ : this.placeholder && this.placeholder.trim() !== ''
91
+ ? this.placeholder
92
+ : 'Campo de texto';
93
+ }
68
94
  getCssClassMap() {
69
95
  return {
70
96
  'br-textarea': true,
@@ -79,7 +105,8 @@ const Textarea = class {
79
105
  render() {
80
106
  const caracteresRestantes = this.maxlength - this.currentLength;
81
107
  const mostrarLimite = this.currentLength > 0;
82
- return (index.h(index.Host, { key: '31b508c72540c266449933596ccbc8fd960962e7' }, index.h("div", { key: 'bfa11fb0b9e66c7fec97c8ad67cd2c5cb253a8b6', class: this.getCssClassMap() }, index.h("div", { key: 'fe27960edc7144abd6f91dd2b194127f6afa5d65', class: this.isInline ? 'row' : '' }, this.isInline ? (index.h("div", { class: "col-auto pt-half" }, index.h("label", { htmlFor: this.customId }, this.label))) : (index.h("label", { htmlFor: this.customId }, this.label)), index.h("div", { key: 'f6b05e4e30c67bcd270571ab949eaee7ce9e5ab2', class: this.isInline ? 'col' : '' }, index.h("textarea", { key: '9afe24806c27a70801b5da76082cfc83460612ca', id: this.customId, value: this.value, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, ...(this.maxlength > 0 ? { maxLength: this.maxlength } : {}) }), index.h("div", { key: '883a4d10573927cac2fdc63190e565d053c9a45f', class: "text-base mt-1" }, this.showCounter && (index.h("div", { key: '6301a3bdafa2d318e8d5dbd69c40e94750cda564' }, mostrarLimite ? (index.h("span", { class: "restantes", "aria-live": "polite", role: "status", id: "limitMax" }, "Restam ", index.h("strong", null, caracteresRestantes), " caracteres")) : (index.h("span", { class: "limit", "aria-live": "polite" }, "Limite m\u00E1ximo de ", index.h("strong", null, this.maxlength), " caracteres"))))), index.h("slot", { key: '0a8e1a6fa116134023d1202cb65d54aa534914cb' }))))));
108
+ const hasLabel = !!this.label;
109
+ return (index.h(index.Host, { key: '2ef9c7541022573e6c1da8a05e5d10e4831d1348' }, index.h("div", { key: 'b8756f018a5517345ba33c746b8927dc7107ba5c', class: this.getCssClassMap() }, index.h("div", { key: 'ffa093877353602fdebe1f5d4e7c45c2fc3f63d3', class: this.isInline ? 'row' : '' }, this.isInline ? (index.h("div", { class: "col-auto pt-half" }, index.h("label", { htmlFor: this.customId }, this.label))) : (index.h("label", { htmlFor: this.customId }, this.label)), index.h("div", { key: '8afafd7535e57a978ead59165eb6b227b02820be', class: this.isInline ? 'col' : '' }, index.h("textarea", { key: '83772b0c42ea0d09991e4a622d8f86851bda2a8b', id: this.customId, value: this.value, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, ...(this.maxlength > 0 ? { maxLength: this.maxlength } : {}), "aria-describedby": this.getDescribedBy(), ...(!hasLabel ? { 'aria-label': this.getAccessibilityLabel() } : {}) }), index.h("div", { key: '7e1a019e4186f4d888fd2898665aa3037f543a8e', class: "text-base mt-1" }, this.showCounter && (index.h("div", { key: '9e80a2b49f9f107acf8a07958c5ba15881bc0fd9' }, mostrarLimite ? (index.h("span", { class: "restantes", "aria-live": "polite", role: "status", id: `${this.customId}-limitMax` }, "Restam ", index.h("strong", null, caracteresRestantes), " caracteres")) : (index.h("span", { class: "limit", "aria-live": "polite", id: `${this.customId}-limitMax` }, "Limite m\u00E1ximo de ", index.h("strong", null, this.maxlength), " caracteres"))))), index.h("div", { key: 'cb5d661d80018f2e3a3159d7e3b427a26572e1c0', id: `${this.customId}-slotInfo`, "aria-live": "polite" }, index.h("slot", { key: '38bace1df619a710ba8474e19e21ff76cf27563c' })))))));
83
110
  }
84
111
  static get formAssociated() { return true; }
85
112
  get el() { return index.getElement(this); }
@@ -1 +1 @@
1
- {"file":"br-textarea.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,y43DAAy43D;;MC2Bh53D,QAAQ,GAAA,MAAA;AANrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;AA2BE;;;AAGG;AAC+B,QAAA,IAAA,CAAA,QAAQ,GAAW,eAAe,UAAU,EAAE,EAAE;AAElF;;AAEG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAE3D;;AAEG;AAC+B,QAAA,IAAS,CAAA,SAAA,GAAW,CAAC;AAEvD;;AAEG;AAC+B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAM9D;;AAEG;AAC+B,QAAA,IAAO,CAAA,OAAA,GAAiC,QAAQ;AAElF;;AAEG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAqB1C,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,KAAY,KAAI;YAC9C,IAAI,CAAC,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK;YACrD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM;YACvC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACnC,SAAC;AAuEF;IAzFC,iBAAiB,GAAA;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM;;IASzC,YAAY,GAAA;QACV,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM;;AASzC;;;AAGG;IAEH,MAAM,QAAQ,CAAC,QAAgB,EAAA;AAC7B,QAAA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C;;;;;","names":["h","Host"],"sources":["../../packages/webcomponents/src/components/textarea/textarea.scss?tag=br-textarea&encapsulation=shadow","../../packages/webcomponents/src/components/textarea/textarea.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/textarea/textarea\";\n\n:host {\n display: inline-block;\n box-sizing: border-box;\n font-family: Rawline, Raleway, sans-serif;\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/textarea?tab=designer).\n *\n * @slot default - Espaço de conteúdo do textarea. Geralmente usado para incluir texto adicional ou instruções para o usuário.\n */\n@Component({\n tag: 'br-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el: HTMLBrTextareaElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Valor exibido no textarea.\n * Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.\n */\n @Prop({ mutable: true, reflect: true }) value: string\n\n /**\n * Texto exibido como rótulo do input.\n */\n @Prop({ reflect: true }) readonly label: string\n\n /**\n * Texto exibido dentro do input quando está vazio, fornecendo uma dica ou sugestão ao usuário.\n */\n @Prop({ reflect: true }) readonly placeholder: string\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 = `br-textarea-${textareaId++}`\n\n /**\n * Indica se o textarea está desabilitado. Quando verdadeiro, o usuário não pode interagir com o campo.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Número máximo de caracteres permitidos no textarea. Se definido como 0, não há limite.\n */\n @Prop({ reflect: true }) readonly maxlength: number = 0\n\n /**\n * Mostra o contador com a quantidade máxima de caracteres.\n */\n @Prop({ reflect: true }) readonly showCounter: boolean = false\n\n /**\n * Define o estado visual do componente, podendo ser 'danger', 'success' ou 'warning'.\n */\n @Prop({ reflect: true }) readonly state: 'danger' | 'success' | 'warning'\n /**\n * Ajusta a densidade do componente, podendo ser 'small', 'medium' ou 'large'.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = 'medium'\n\n /**\n * Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).\n */\n @Prop({ reflect: true }) readonly isInline: boolean = false\n\n /**\n * Comprimento atual do texto no textarea. É atualizado sempre que o valor do textarea muda.\n */\n @State() currentLength: number\n\n componentWillLoad() {\n this.currentLength = this.value?.length\n }\n\n /**\n * Valor atualizado do textarea\n */\n @Event() valueChange: EventEmitter<string>\n\n @Watch('value')\n valueChanged() {\n this.currentLength = this.value?.length\n }\n\n private readonly handleInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value\n this.currentLength = this.value?.length\n this.valueChange.emit(this.value)\n }\n\n /**\n * Define um novo valor para o textarea.\n * @param newValue - O novo valor a ser definido.\n */\n @Method()\n async setValue(newValue: string) {\n this.value = newValue\n this.currentLength = this.value?.length\n this.valueChange.emit(this.value)\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-textarea': true,\n small: this.density === 'small',\n medium: this.density === 'medium',\n large: this.density === 'large',\n success: this.state === 'success',\n danger: this.state === 'danger',\n warning: this.state === 'warning',\n }\n }\n\n render() {\n const caracteresRestantes: number = this.maxlength - this.currentLength\n const mostrarLimite = this.currentLength > 0\n\n return (\n <Host>\n <div class={this.getCssClassMap()}>\n <div class={this.isInline ? 'row' : ''}>\n {this.isInline ? (\n <div class=\"col-auto pt-half\">\n <label htmlFor={this.customId}>{this.label}</label>\n </div>\n ) : (\n <label htmlFor={this.customId}>{this.label}</label>\n )}\n <div class={this.isInline ? 'col' : ''}>\n <textarea\n id={this.customId}\n value={this.value}\n placeholder={this.placeholder}\n disabled={this.disabled}\n onInput={this.handleInput}\n {...(this.maxlength > 0 ? { maxLength: this.maxlength } : {})}\n ></textarea>\n <div class=\"text-base mt-1\">\n {this.showCounter && (\n <div>\n {mostrarLimite ? (\n <span class=\"restantes\" aria-live=\"polite\" role=\"status\" id=\"limitMax\">\n Restam <strong>{caracteresRestantes}</strong> caracteres\n </span>\n ) : (\n <span class=\"limit\" aria-live=\"polite\">\n Limite máximo de <strong>{this.maxlength}</strong> caracteres\n </span>\n )}\n </div>\n )}\n </div>\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n )\n }\n}\n\nlet textareaId = 0\n"],"version":3}
1
+ {"file":"br-textarea.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,y43DAAy43D;;MC2Bh53D,QAAQ,GAAA,MAAA;AANrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;AAiCE;;;AAGG;AAC+B,QAAA,IAAA,CAAA,QAAQ,GAAW,eAAe,UAAU,EAAE,EAAE;AAElF;;AAEG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAE3D;;AAEG;AAC+B,QAAA,IAAS,CAAA,SAAA,GAAW,CAAC;AAEvD;;AAEG;AAC+B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAM9D;;AAEG;AAC+B,QAAA,IAAO,CAAA,OAAA,GAAiC,QAAQ;AAElF;;AAEG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAqB1C,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,KAAY,KAAI;YAC9C,IAAI,CAAC,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK;YACrD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;YAC5C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACnC,SAAC;AA0GF;IA5HC,iBAAiB,GAAA;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;;IAS9C,YA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b,IAAI,UAAU,GAAG,CAAC;;;;;","names":["h","Host"],"sources":["../../packages/webcomponents/src/components/textarea/textarea.scss?tag=br-textarea&encapsulation=shadow","../../packages/webcomponents/src/components/textarea/textarea.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/textarea/textarea\";\n\n:host {\n display: inline-block;\n box-sizing: border-box;\n font-family: Rawline, Raleway, sans-serif;\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/textarea?tab=designer).\n *\n * @slot default - Espaço de conteúdo do textarea. Geralmente usado para incluir texto adicional ou instruções para o usuário.\n */\n@Component({\n tag: 'br-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el: HTMLBrTextareaElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Valor exibido no textarea.\n * Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.\n */\n @Prop({ mutable: true, reflect: true }) value: string\n\n /**\n * Texto exibido como rótulo do input.\n */\n @Prop({ reflect: true }) readonly label: string\n\n /**\n * Texto exibido dentro do input quando está vazio, fornecendo uma dica ou sugestão ao usuário.\n */\n @Prop({ reflect: true }) readonly placeholder: string\n\n /**\n * Texto alternativo para acessibilidade quando não há label visível.\n * Fornece um rótulo para tecnologias assistivas sem exibir visualmente.\n */\n @Prop({ reflect: true }) readonly ariaLabel: string\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 = `br-textarea-${textareaId++}`\n\n /**\n * Indica se o textarea está desabilitado. Quando verdadeiro, o usuário não pode interagir com o campo.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Número máximo de caracteres permitidos no textarea. Se definido como 0, não há limite.\n */\n @Prop({ reflect: true }) readonly maxlength: number = 0\n\n /**\n * Mostra o contador com a quantidade máxima de caracteres.\n */\n @Prop({ reflect: true }) readonly showCounter: boolean = false\n\n /**\n * Define o estado visual do componente, podendo ser 'danger', 'success' ou 'warning'.\n */\n @Prop({ reflect: true }) readonly state: 'danger' | 'success' | 'warning'\n /**\n * Ajusta a densidade do componente, podendo ser 'small', 'medium' ou 'large'.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = 'medium'\n\n /**\n * Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).\n */\n @Prop({ reflect: true }) readonly isInline: boolean = false\n\n /**\n * Comprimento atual do texto no textarea. É atualizado sempre que o valor do textarea muda.\n */\n @State() currentLength: number\n\n componentWillLoad() {\n this.currentLength = this.value?.length || 0\n }\n\n /**\n * Valor atualizado do textarea\n */\n @Event() valueChange: EventEmitter<string>\n\n @Watch('value')\n valueChanged() {\n this.currentLength = this.value?.length || 0\n }\n\n private readonly handleInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value\n this.currentLength = this.value?.length || 0\n this.valueChange.emit(this.value)\n }\n\n /**\n * Define um novo valor para o textarea.\n * @param newValue - O novo valor a ser definido.\n */\n @Method()\n async setValue(newValue: string) {\n this.value = newValue\n this.currentLength = this.value?.length || 0\n this.valueChange.emit(this.value)\n }\n\n /**\n * Retorna os ids para o atributo aria-describedby do textarea\n */\n private getDescribedBy(): string {\n return [this.showCounter ? `${this.customId}-limitMax` : null, `${this.customId}-slotInfo`]\n .filter(Boolean)\n .join(' ')\n }\n\n /**\n * Determina o texto a ser usado para acessibilidade quando não há label\n * Ordem de prioridade:\n * - aria-label do elemento host\n * - propriedade ariaLabel do componente\n * - placeholder\n * - texto padrão (\"Campo de texto\")\n */\n private getAccessibilityLabel(): string {\n const hostAriaLabel = this.el.getAttribute('aria-label')\n\n return hostAriaLabel && hostAriaLabel.trim() !== ''\n ? hostAriaLabel\n : this.ariaLabel && this.ariaLabel.trim() !== ''\n ? this.ariaLabel\n : this.placeholder && this.placeholder.trim() !== ''\n ? this.placeholder\n : 'Campo de texto'\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-textarea': true,\n small: this.density === 'small',\n medium: this.density === 'medium',\n large: this.density === 'large',\n success: this.state === 'success',\n danger: this.state === 'danger',\n warning: this.state === 'warning',\n }\n }\n\n render() {\n const caracteresRestantes: number = this.maxlength - this.currentLength\n const mostrarLimite = this.currentLength > 0\n const hasLabel = !!this.label\n\n return (\n <Host>\n <div class={this.getCssClassMap()}>\n <div class={this.isInline ? 'row' : ''}>\n {this.isInline ? (\n <div class=\"col-auto pt-half\">\n <label htmlFor={this.customId}>{this.label}</label>\n </div>\n ) : (\n <label htmlFor={this.customId}>{this.label}</label>\n )}\n\n <div class={this.isInline ? 'col' : ''}>\n <textarea\n id={this.customId}\n value={this.value}\n placeholder={this.placeholder}\n disabled={this.disabled}\n onInput={this.handleInput}\n {...(this.maxlength > 0 ? { maxLength: this.maxlength } : {})}\n aria-describedby={this.getDescribedBy()}\n {...(!hasLabel ? { 'aria-label': this.getAccessibilityLabel() } : {})}\n ></textarea>\n <div class=\"text-base mt-1\">\n {this.showCounter && (\n <div>\n {mostrarLimite ? (\n <span class=\"restantes\" aria-live=\"polite\" role=\"status\" id={`${this.customId}-limitMax`}>\n Restam <strong>{caracteresRestantes}</strong> caracteres\n </span>\n ) : (\n <span class=\"limit\" aria-live=\"polite\" id={`${this.customId}-limitMax`}>\n Limite máximo de <strong>{this.maxlength}</strong> caracteres\n </span>\n )}\n </div>\n )}\n </div>\n <div id={`${this.customId}-slotInfo`} aria-live=\"polite\">\n <slot></slot>\n </div>\n </div>\n </div>\n </div>\n </Host>\n )\n }\n}\n\nlet textareaId = 0\n"],"version":3}
@@ -1 +1 @@
1
- {"version":3,"file":"br-textarea.entry.cjs.js","sources":["../../packages/webcomponents/src/components/textarea/textarea.scss?tag=br-textarea&encapsulation=shadow","../../packages/webcomponents/src/components/textarea/textarea.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/textarea/textarea\";\n\n:host {\n display: inline-block;\n box-sizing: border-box;\n font-family: Rawline, Raleway, sans-serif;\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/textarea?tab=designer).\n *\n * @slot default - Espaço de conteúdo do textarea. Geralmente usado para incluir texto adicional ou instruções para o usuário.\n */\n@Component({\n tag: 'br-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el: HTMLBrTextareaElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Valor exibido no textarea.\n * Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.\n */\n @Prop({ mutable: true, reflect: true }) value: string\n\n /**\n * Texto exibido como rótulo do input.\n */\n @Prop({ reflect: true }) readonly label: string\n\n /**\n * Texto exibido dentro do input quando está vazio, fornecendo uma dica ou sugestão ao usuário.\n */\n @Prop({ reflect: true }) readonly placeholder: string\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 = `br-textarea-${textareaId++}`\n\n /**\n * Indica se o textarea está desabilitado. Quando verdadeiro, o usuário não pode interagir com o campo.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Número máximo de caracteres permitidos no textarea. Se definido como 0, não há limite.\n */\n @Prop({ reflect: true }) readonly maxlength: number = 0\n\n /**\n * Mostra o contador com a quantidade máxima de caracteres.\n */\n @Prop({ reflect: true }) readonly showCounter: boolean = false\n\n /**\n * Define o estado visual do componente, podendo ser 'danger', 'success' ou 'warning'.\n */\n @Prop({ reflect: true }) readonly state: 'danger' | 'success' | 'warning'\n /**\n * Ajusta a densidade do componente, podendo ser 'small', 'medium' ou 'large'.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = 'medium'\n\n /**\n * Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).\n */\n @Prop({ reflect: true }) readonly isInline: boolean = false\n\n /**\n * Comprimento atual do texto no textarea. É atualizado sempre que o valor do textarea muda.\n */\n @State() currentLength: number\n\n componentWillLoad() {\n this.currentLength = this.value?.length\n }\n\n /**\n * Valor atualizado do textarea\n */\n @Event() valueChange: EventEmitter<string>\n\n @Watch('value')\n valueChanged() {\n this.currentLength = this.value?.length\n }\n\n private readonly handleInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value\n this.currentLength = this.value?.length\n this.valueChange.emit(this.value)\n }\n\n /**\n * Define um novo valor para o textarea.\n * @param newValue - O novo valor a ser definido.\n */\n @Method()\n async setValue(newValue: string) {\n this.value = newValue\n this.currentLength = this.value?.length\n this.valueChange.emit(this.value)\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-textarea': true,\n small: this.density === 'small',\n medium: this.density === 'medium',\n large: this.density === 'large',\n success: this.state === 'success',\n danger: this.state === 'danger',\n warning: this.state === 'warning',\n }\n }\n\n render() {\n const caracteresRestantes: number = this.maxlength - this.currentLength\n const mostrarLimite = this.currentLength > 0\n\n return (\n <Host>\n <div class={this.getCssClassMap()}>\n <div class={this.isInline ? 'row' : ''}>\n {this.isInline ? (\n <div class=\"col-auto pt-half\">\n <label htmlFor={this.customId}>{this.label}</label>\n </div>\n ) : (\n <label htmlFor={this.customId}>{this.label}</label>\n )}\n <div class={this.isInline ? 'col' : ''}>\n <textarea\n id={this.customId}\n value={this.value}\n placeholder={this.placeholder}\n disabled={this.disabled}\n onInput={this.handleInput}\n {...(this.maxlength > 0 ? { maxLength: this.maxlength } : {})}\n ></textarea>\n <div class=\"text-base mt-1\">\n {this.showCounter && (\n <div>\n {mostrarLimite ? (\n <span class=\"restantes\" aria-live=\"polite\" role=\"status\" id=\"limitMax\">\n Restam <strong>{caracteresRestantes}</strong> caracteres\n </span>\n ) : (\n <span class=\"limit\" aria-live=\"polite\">\n Limite máximo de <strong>{this.maxlength}</strong> caracteres\n </span>\n )}\n </div>\n )}\n </div>\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n )\n }\n}\n\nlet textareaId = 0\n"],"names":["h","Host"],"mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,y43DAAy43D;;MC2Bh53D,QAAQ,GAAA,MAAA;AANrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;;;;;AA2BE;;;AAGG;AAC+B,QAAA,IAAA,CAAA,QAAQ,GAAW,eAAe,UAAU,EAAE,EAAE;AAElF;;AAEG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAE3D;;AAEG;AAC+B,QAAA,IAAS,CAAA,SAAA,GAAW,CAAC;AAEvD;;AAEG;AAC+B,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;AAM9D;;AAEG;AAC+B,QAAA,IAAO,CAAA,OAAA,GAAiC,QAAQ;AAElF;;AAEG;AAC+B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAqB1C,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,KAAY,KAAI;YAC9C,IAAI,CAAC,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK;YACrD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM;YACvC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;AACnC,SAAC;AAuEF;IAzFC,iBAAiB,GAAA;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM;;IASzC,YAAY,GAAA;QACV,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,MAAM;;AASzC;;;AAGG;IAEH,MAAM,QAAQ,CAAC,QAAgB,EAAA;AAC7B,QAAA,IAAI,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"}
1
+ {"version":3,"file":"br-textarea.entry.cjs.js","sources":["../../packages/webcomponents/src/components/textarea/textarea.scss?tag=br-textarea&encapsulation=shadow","../../packages/webcomponents/src/components/textarea/textarea.tsx"],"sourcesContent":["@import \"~@govbr-ds/core/src/components/textarea/textarea\";\n\n:host {\n display: inline-block;\n box-sizing: border-box;\n font-family: Rawline, Raleway, sans-serif;\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\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/textarea?tab=designer).\n *\n * @slot default - Espaço de conteúdo do textarea. Geralmente usado para incluir texto adicional ou instruções para o usuário.\n */\n@Component({\n tag: 'br-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Textarea {\n @Element() el: HTMLBrTextareaElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Valor exibido no textarea.\n * Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.\n */\n @Prop({ mutable: true, reflect: true }) value: string\n\n /**\n * Texto exibido como rótulo do input.\n */\n @Prop({ reflect: true }) readonly label: string\n\n /**\n * Texto exibido dentro do input quando está vazio, fornecendo uma dica ou sugestão ao usuário.\n */\n @Prop({ reflect: true }) readonly placeholder: string\n\n /**\n * Texto alternativo para acessibilidade quando não há label visível.\n * Fornece um rótulo para tecnologias assistivas sem exibir visualmente.\n */\n @Prop({ reflect: true }) readonly ariaLabel: string\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 = `br-textarea-${textareaId++}`\n\n /**\n * Indica se o textarea está desabilitado. Quando verdadeiro, o usuário não pode interagir com o campo.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false\n\n /**\n * Número máximo de caracteres permitidos no textarea. Se definido como 0, não há limite.\n */\n @Prop({ reflect: true }) readonly maxlength: number = 0\n\n /**\n * Mostra o contador com a quantidade máxima de caracteres.\n */\n @Prop({ reflect: true }) readonly showCounter: boolean = false\n\n /**\n * Define o estado visual do componente, podendo ser 'danger', 'success' ou 'warning'.\n */\n @Prop({ reflect: true }) readonly state: 'danger' | 'success' | 'warning'\n /**\n * Ajusta a densidade do componente, podendo ser 'small', 'medium' ou 'large'.\n */\n @Prop({ reflect: true }) readonly density: 'small' | 'medium' | 'large' = 'medium'\n\n /**\n * Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).\n */\n @Prop({ reflect: true }) readonly isInline: boolean = false\n\n /**\n * Comprimento atual do texto no textarea. É atualizado sempre que o valor do textarea muda.\n */\n @State() currentLength: number\n\n componentWillLoad() {\n this.currentLength = this.value?.length || 0\n }\n\n /**\n * Valor atualizado do textarea\n */\n @Event() valueChange: EventEmitter<string>\n\n @Watch('value')\n valueChanged() {\n this.currentLength = this.value?.length || 0\n }\n\n private readonly handleInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value\n this.currentLength = this.value?.length || 0\n this.valueChange.emit(this.value)\n }\n\n /**\n * Define um novo valor para o textarea.\n * @param newValue - O novo valor a ser definido.\n */\n @Method()\n async setValue(newValue: string) {\n this.value = newValue\n this.currentLength = this.value?.length || 0\n this.valueChange.emit(this.value)\n }\n\n /**\n * Retorna os ids para o atributo aria-describedby do textarea\n */\n private getDescribedBy(): string {\n return [this.showCounter ? `${this.customId}-limitMax` : null, `${this.customId}-slotInfo`]\n .filter(Boolean)\n .join(' ')\n }\n\n /**\n * Determina o texto a ser usado para acessibilidade quando não há label\n * Ordem de prioridade:\n * - aria-label do elemento host\n * - propriedade ariaLabel do componente\n * - placeholder\n * - texto padrão (\"Campo de texto\")\n */\n private getAccessibilityLabel(): string {\n const hostAriaLabel = this.el.getAttribute('aria-label')\n\n return hostAriaLabel && hostAriaLabel.trim() !== ''\n ? hostAriaLabel\n : this.ariaLabel && this.ariaLabel.trim() !== ''\n ? this.ariaLabel\n : this.placeholder && this.placeholder.trim() !== ''\n ? this.placeholder\n : 'Campo de texto'\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-textarea': true,\n small: this.density === 'small',\n medium: this.density === 'medium',\n large: this.density === 'large',\n success: this.state === 'success',\n danger: this.state === 'danger',\n warning: this.state === 'warning',\n }\n }\n\n render() {\n const caracteresRestantes: number = this.maxlength - this.currentLength\n const mostrarLimite = this.currentLength > 0\n const hasLabel = !!this.label\n\n return (\n <Host>\n <div class={this.getCssClassMap()}>\n <div class={this.isInline ? 'row' : ''}>\n {this.isInline ? (\n <div class=\"col-auto pt-half\">\n <label htmlFor={this.customId}>{this.label}</label>\n </div>\n ) : (\n <label htmlFor={this.customId}>{this.label}</label>\n )}\n\n <div class={this.isInline ? 'col' : ''}>\n <textarea\n id={this.customId}\n value={this.value}\n placeholder={this.placeholder}\n disabled={this.disabled}\n onInput={this.handleInput}\n {...(this.maxlength > 0 ? { maxLength: this.maxlength } : {})}\n aria-describedby={this.getDescribedBy()}\n {...(!hasLabel ? { 'aria-label': this.getAccessibilityLabel() } : {})}\n ></textarea>\n <div class=\"text-base mt-1\">\n {this.showCounter && (\n <div>\n {mostrarLimite ? (\n <span class=\"restantes\" aria-live=\"polite\" role=\"status\" id={`${this.customId}-limitMax`}>\n Restam <strong>{caracteresRestantes}</strong> caracteres\n </span>\n ) : (\n <span class=\"limit\" aria-live=\"polite\" id={`${this.customId}-limitMax`}>\n Limite máximo de <strong>{this.maxlength}</strong> caracteres\n </span>\n )}\n </div>\n )}\n </div>\n <div id={`${this.customId}-slotInfo`} aria-live=\"polite\">\n <slot></slot>\n </div>\n </div>\n </div>\n </div>\n </Host>\n )\n }\n}\n\nlet textareaId = 0\n"],"names":["h","Host"],"mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,y43DAAy43D;;MC2Bh53D,QAAQ,GAAA,MAAA;AANrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;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AAA,0CAAA,EAAA,EAAA,aAAa,IACZA,OAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,WAAW,EAAA,WAAA,EAAW,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAW,SAAA,CAAA,EAAA,aAC/EA,OAAA,CAAA,QAAA,EAAA,IAAA,EAAS,mBAAmB,CAAU,EACxC,aAAA,CAAA,KAEPA,OAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,OAAO,EAAW,WAAA,EAAA,QAAQ,EAAC,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAW,SAAA,CAAA,EAAA,4BACnDA,OAAS,CAAA,QAAA,EAAA,IAAA,EAAA,IAAI,CAAC,SAAS,CAAU,gBAC7C,CACR,CACG,CACP,CACG,EACNA,OAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAE,EAAE,CAAA,EAAG,IAAI,CAAC,QAAQ,WAAW,eAAY,QAAQ,EAAA,EACtDA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACT,CACF,CACF,CACF,CACD;;;;;;;;AAKb,IAAI,UAAU,GAAG,CAAC;;;;;"}
@@ -2131,7 +2131,7 @@ const Tooltip = class {
2131
2131
  * @returns JSX.Element
2132
2132
  */
2133
2133
  render() {
2134
- return (index.h(index.Host, { key: '99bea58c6f571ff49f266072d8ee4af8b4081adc' }, index.h("div", { key: '190c140a9059470c92450f7677ad8bef6d48b207', id: this.customId, class: this.getCssClassMap() }, index.h("div", { key: 'ab35ec93893f689929774cc0172e2cdf6f2f76e7', class: this.getTriggerCssClassMap(), ref: (el) => (this.triggerElement = el), "aria-describedby": `${this.customId}-content`, "aria-expanded": this.isVisible ? 'true' : 'false', "aria-controls": `${this.customId}-content`, role: "button", tabindex: "-1 " }, index.h("slot", { key: '62de7618f2bae7e8e5aaca4ecad10b91205ce230', name: "trigger" })), index.h("div", { key: 'd6dd66c4102ddbb2f0924cf9aeb3dab1bab28176', id: `${this.customId}-content`, class: this.getContentCssClassMap(), ref: (el) => (this.contentElement = el), role: this.type === 'popover' ? 'dialog' : 'tooltip', tabindex: "-1" }, index.h("slot", { key: '4a9403a4690b52de0dad0209b36af290601c21d0', name: "content" }), this.type === 'popover' && (index.h("br-button", { key: 'fd3c23f6f1bcc9654180a4b5c09bb5206a127e6d', class: "close", shape: "circle", density: "small", onClick: this.hideContent, "aria-label": "Fechar popover" }, index.h("br-icon", { key: '0b301c330749757e8207fb1d82041f4037e06b14', "icon-name": "fa6-solid:xmark" }))), index.h("div", { key: '88b50021b6ff75a51534d3c1bc57cb7b279852a4', class: this.getArrowCssClassMap(), ref: (el) => (this.arrowElement = el) })))));
2134
+ return (index.h(index.Host, { key: '3a99ff00895f77cf90574ccbd8ccae37ce68f9bb' }, index.h("div", { key: 'd642b5e8747633cd155a89afa3e84e5036dfdc10', id: this.customId, class: this.getCssClassMap() }, index.h("div", { key: 'bb6b81ac3460ffacbe071082f634d0482c4b106c', class: this.getTriggerCssClassMap(), ref: (el) => (this.triggerElement = el), "aria-describedby": `${this.customId}-content`, "aria-expanded": this.isVisible ? 'true' : 'false', "aria-controls": `${this.customId}-content`, role: "button", tabindex: "-1 " }, index.h("slot", { key: '30bc547b469bc666a58f2e04203df0b44e330fef', name: "trigger" })), index.h("div", { key: '67c59e644d3b88deab9553accc461c2f6136a312', id: `${this.customId}-content`, class: this.getContentCssClassMap(), ref: (el) => (this.contentElement = el), role: this.type === 'popover' ? 'dialog' : 'tooltip', tabindex: "-1" }, index.h("slot", { key: 'e3321ee00f78e6e7332c528029d9ea6f5ceabf9d', name: "content" }), this.type === 'popover' && (index.h("br-button", { key: '61a1e0732d23e3eec044788b9a9953d1229c3e14', class: "close", shape: "circle", density: "small", onClick: this.hideContent, "aria-label": "Fechar popover" }, index.h("br-icon", { key: '93357409f8f123d36708118dc23b368ff534e0d7', "icon-name": "fa6-solid:xmark" }))), index.h("div", { key: 'd3fd53e7146b4e01daa827c64f526fde5f78aef9', class: this.getArrowCssClassMap(), ref: (el) => (this.arrowElement = el) })))));
2135
2135
  }
2136
2136
  static get formAssociated() { return true; }
2137
2137
  get el() { return index.getElement(this); }