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

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 (70) hide show
  1. package/README.md +16 -30
  2. package/dist/cjs/br-button.cjs.entry.js +1 -1
  3. package/dist/cjs/br-checkbox.cjs.entry.js +1 -1
  4. package/dist/cjs/br-icon.cjs.entry.js +2465 -0
  5. package/dist/cjs/br-icon.cjs.entry.js.map +1 -0
  6. package/dist/cjs/br-input.cjs.entry.js +2 -2
  7. package/dist/cjs/br-input.cjs.entry.js.map +1 -1
  8. package/dist/cjs/br-item.cjs.entry.js +2 -2
  9. package/dist/cjs/{index-c5475da7.js → index-d682c89d.js} +9 -5
  10. package/dist/cjs/{index-c5475da7.js.map → index-d682c89d.js.map} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/webcomponents.cjs.js +3 -3
  13. package/dist/cjs/webcomponents.cjs.js.map +1 -1
  14. package/dist/collection/collection-manifest.json +2 -1
  15. package/dist/collection/components/icon/icon.css +23222 -0
  16. package/dist/collection/components/icon/icon.js +324 -0
  17. package/dist/collection/components/icon/icon.js.map +1 -0
  18. package/dist/collection/components/icon/tests/icon.e2e.js +107 -0
  19. package/dist/collection/components/icon/tests/icon.e2e.js.map +1 -0
  20. package/dist/collection/components/icon/tests/icon.spec.js +80 -0
  21. package/dist/collection/components/icon/tests/icon.spec.js.map +1 -0
  22. package/dist/collection/components/input/input.js +1 -1
  23. package/dist/collection/components/input/input.js.map +1 -1
  24. package/dist/collection/components/input/tests/input.e2e.js +25 -0
  25. package/dist/collection/components/input/tests/input.e2e.js.map +1 -0
  26. package/dist/collection/components/input/tests/input.spec.js +36 -0
  27. package/dist/collection/components/input/tests/input.spec.js.map +1 -0
  28. package/dist/collection/components/item/item.js +1 -1
  29. package/dist/collection/pages/icon/icon.js +19 -0
  30. package/dist/components/br-icon.d.ts +11 -0
  31. package/dist/components/br-icon.js +2481 -0
  32. package/dist/components/br-icon.js.map +1 -0
  33. package/dist/components/br-input.js +1 -1
  34. package/dist/components/br-input.js.map +1 -1
  35. package/dist/components/br-item.js +1 -1
  36. package/dist/components/index.d.ts +2 -0
  37. package/dist/components/index.js +1 -0
  38. package/dist/components/index.js.map +1 -1
  39. package/dist/esm/br-button.entry.js +1 -1
  40. package/dist/esm/br-checkbox.entry.js +1 -1
  41. package/dist/esm/br-icon.entry.js +2461 -0
  42. package/dist/esm/br-icon.entry.js.map +1 -0
  43. package/dist/esm/br-input.entry.js +2 -2
  44. package/dist/esm/br-input.entry.js.map +1 -1
  45. package/dist/esm/br-item.entry.js +2 -2
  46. package/dist/esm/{index-57007b22.js → index-55a13a51.js} +9 -5
  47. package/dist/esm/{index-57007b22.js.map → index-55a13a51.js.map} +1 -1
  48. package/dist/esm/loader.js +3 -3
  49. package/dist/esm/webcomponents.js +4 -4
  50. package/dist/esm/webcomponents.js.map +1 -1
  51. package/dist/types/components/icon/icon.d.ts +50 -0
  52. package/dist/types/components.d.ts +128 -0
  53. package/dist/webcomponents/p-1b6e8650.entry.js +13 -0
  54. package/dist/webcomponents/p-1b6e8650.entry.js.map +1 -0
  55. package/dist/webcomponents/{p-1b276845.entry.js → p-61231fb7.entry.js} +2 -2
  56. package/dist/webcomponents/{p-a0b98f14.entry.js → p-8ed9a673.entry.js} +2 -2
  57. package/dist/webcomponents/{p-5f162437.entry.js → p-a7e423b4.entry.js} +2 -2
  58. package/dist/webcomponents/{p-5f162437.entry.js.map → p-a7e423b4.entry.js.map} +1 -1
  59. package/dist/webcomponents/{p-6d857090.entry.js → p-b0e416bd.entry.js} +2 -2
  60. package/dist/webcomponents/p-f379e66c.js +3 -0
  61. package/dist/webcomponents/{p-a3d8d916.js.map → p-f379e66c.js.map} +1 -1
  62. package/dist/webcomponents/webcomponents.esm.js +1 -1
  63. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  64. package/hydrate/index.js +18038 -11564
  65. package/package.json +22 -11
  66. package/vscode-data.json +37 -0
  67. package/dist/webcomponents/p-a3d8d916.js +0 -3
  68. /package/dist/webcomponents/{p-1b276845.entry.js.map → p-61231fb7.entry.js.map} +0 -0
  69. /package/dist/webcomponents/{p-a0b98f14.entry.js.map → p-8ed9a673.entry.js.map} +0 -0
  70. /package/dist/webcomponents/{p-6d857090.entry.js.map → p-b0e416bd.entry.js.map} +0 -0
@@ -0,0 +1,25 @@
1
+ import AxeBuilder from "@axe-core/playwright";
2
+ import { expect, test } from "@playwright/test";
3
+ test.describe('br-input', () => {
4
+ test('should render the correct label', async ({ page }) => {
5
+ // The path here is the path to the www output relative to the dev server root directory
6
+ await page.goto('input');
7
+ // Verifica se tem o label
8
+ await expect(page.getByText('Com botão')).toBeVisible();
9
+ // Verifica se o input está na tela e dá um clique nele
10
+ await page.getByRole('textbox', { name: 'Com botão' }).click();
11
+ // Insere um texto no campo input
12
+ await page.getByRole('textbox', { name: 'Com botão' }).first().fill('Jhon Doe');
13
+ // Verifica se o valor informando no campo acima foi realmente inserida no campo
14
+ await expect(page.getByRole('textbox', { name: 'Com botão' })).toHaveValue('Jhon Doe');
15
+ });
16
+ test('should not have any automatically detectable WCAG A or AA violations', async ({ page }) => {
17
+ await page.goto('input');
18
+ const accessibilityScanResults = await new AxeBuilder({ page })
19
+ .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
20
+ .disableRules(['color-contrast'])
21
+ .analyze();
22
+ expect(accessibilityScanResults.violations).toEqual([]);
23
+ });
24
+ });
25
+ //# sourceMappingURL=input.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.e2e.js","sourceRoot":"","sources":["../../../../src/components/input/tests/input.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAE/C,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IAC7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from '@playwright/test'\n\ntest.describe('br-input', () => {\n test('should render the correct label', async ({ page }) => {\n // The path here is the path to the www output relative to the dev server root directory\n await page.goto('input')\n\n // Verifica se tem o label\n await expect(page.getByText('Com botão')).toBeVisible()\n\n // Verifica se o input está na tela e dá um clique nele\n await page.getByRole('textbox', { name: 'Com botão' }).click()\n\n // Insere um texto no campo input\n await page.getByRole('textbox', { name: 'Com botão' }).first().fill('Jhon Doe')\n\n // Verifica se o valor informando no campo acima foi realmente inserida no campo\n await expect(page.getByRole('textbox', { name: 'Com botão' })).toHaveValue('Jhon Doe')\n })\n\n test('should not have any automatically detectable WCAG A or AA violations', async ({ page }) => {\n await page.goto('input')\n\n const accessibilityScanResults = await new AxeBuilder({ page })\n .withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])\n .disableRules(['color-contrast'])\n .analyze()\n\n expect(accessibilityScanResults.violations).toEqual([])\n })\n})\n"]}
@@ -0,0 +1,36 @@
1
+ // Since the 'template' argument to `newSpecPage` is using jsx syntax, this should be in a .tsx file.
2
+ import { h } from "@stencil/core";
3
+ import { newSpecPage } from "@stencil/core/testing";
4
+ import { Input } from "../input";
5
+ describe('Input', () => {
6
+ it('should render my component', async () => {
7
+ const page = await newSpecPage({
8
+ components: [Input],
9
+ template: () => (h("br-input", { label: 'teste' })),
10
+ });
11
+ expect(page.root).toEqualHtml(`
12
+ <br-input density="" label="teste" type="text">
13
+ <mock:shadow-root>
14
+ <div class="br-input">
15
+ <label class="text-nowrap" htmlfor="">
16
+ teste
17
+ </label>
18
+ <input type="text">
19
+ </div>
20
+ </mock:shadow-root>
21
+ </br-input>
22
+ `);
23
+ });
24
+ it('should render my component with label', async () => {
25
+ var _a;
26
+ const label = 'Label do input';
27
+ const page = await newSpecPage({
28
+ components: [Input],
29
+ html: `<br-input label="${label}"></br-input>`,
30
+ });
31
+ // console.log(page.body?.innerHTML)
32
+ // console.log(page.root?.label)
33
+ await expect((_a = page.root) === null || _a === void 0 ? void 0 : _a.label).toContain(label);
34
+ });
35
+ });
36
+ //# sourceMappingURL=input.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.spec.js","sourceRoot":"","sources":["../../../../src/components/input/tests/input.spec.tsx"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,KAAK,CAAC;YACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,gBAAU,KAAK,EAAC,OAAO,GAAY,CAAC;SACtD,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;GAW7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;;QACrD,MAAM,KAAK,GAAG,gBAAgB,CAAC;QAC/B,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,KAAK,CAAC;YACnB,IAAI,EAAE,oBAAoB,KAAK,eAAe;SAC/C,CAAC,CAAC;QAEH,oCAAoC;QACpC,gCAAgC;QAEhC,MAAM,MAAM,CAAC,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAEjD,CAAC,CAAC,CAAA;AAEF,CAAC,CAAC,CAAA","sourcesContent":["// Since the 'template' argument to `newSpecPage` is using jsx syntax, this should be in a .tsx file.\nimport { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { Input } from '../input';\n\ndescribe('Input', () => {\nit('should render my component', async () => {\n const page = await newSpecPage({\n components: [Input],\n template: () => (<br-input label='teste'></br-input>),\n });\n \n expect(page.root).toEqualHtml(`\n <br-input density=\"\" label=\"teste\" type=\"text\">\n <mock:shadow-root>\n <div class=\"br-input\">\n <label class=\"text-nowrap\" htmlfor=\"\">\n teste\n </label>\n <input type=\"text\">\n </div>\n </mock:shadow-root>\n </br-input>\n `);\n});\n\nit('should render my component with label', async () => {\n const label = 'Label do input';\n const page = await newSpecPage({\n components: [Input],\n html: `<br-input label=\"${label}\"></br-input>`,\n });\n\n // console.log(page.body?.innerHTML)\n // console.log(page.root?.label)\n\n await expect(page.root?.label).toContain(label)\n\n})\n\n})"]}
@@ -53,7 +53,7 @@ export class Item {
53
53
  };
54
54
  }
55
55
  render() {
56
- return (h(Host, { key: 'c46e3ed465539a997c4c21becaab05f484718f10' }, h("div", Object.assign({ key: '4c98a034eb880fb2c2ec80fba9075e742c7c3247', class: this.getCssClassMap(), "data-toggle": "selection" }, this.inheritedAttributes), h("slot", { key: 'cb9ff34d80d2c6819c4fbecd2c7acce7251d930a' }))));
56
+ return (h(Host, { key: 'c0945aceeae4e2c66f3adbd0856afff078b0bf87' }, h("div", Object.assign({ key: '46548c08438c8462c5def9cc0a225e0d51c8dbc1', class: this.getCssClassMap(), "data-toggle": "selection" }, this.inheritedAttributes), h("slot", { key: '17880c8117e85ab88134364a16a89c117529f6b8' }))));
57
57
  }
58
58
  static get is() { return "br-item"; }
59
59
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,19 @@
1
+ if (!window.elementsToListen && !window.eventsToListen) {
2
+ const elementsToListen = document.querySelectorAll("br-icon");
3
+
4
+ const eventsToListen = ["click"];
5
+
6
+ elementsToListen.forEach((domElement) => {
7
+ eventsToListen.forEach((event) => {
8
+ domElement.addEventListener(event, function (event) {
9
+ console.log({
10
+ Elemento: domElement,
11
+ Evento: event,
12
+ Tipo: event.type,
13
+ 'Detail(Custom Events)': event.detail,
14
+ 'Data(Native Events)': event.data,
15
+ })
16
+ })
17
+ })
18
+ })
19
+ }
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface BrIcon extends Components.BrIcon, HTMLElement {}
4
+ export const BrIcon: {
5
+ prototype: BrIcon;
6
+ new (): BrIcon;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;