bth-ui 0.0.0-stage → 0.0.1

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 (71) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bth-ui/bth-ui.esm.js +1 -0
  3. package/dist/bth-ui/index.esm.js +0 -0
  4. package/dist/bth-ui/p-DQuL1Twl.js +1 -0
  5. package/dist/bth-ui/p-e916e3c7.entry.js +1 -0
  6. package/dist/bth-ui/p-svnzPQiH.js +3 -0
  7. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  8. package/dist/cjs/bth-alert_6.cjs.entry.js +133 -0
  9. package/dist/cjs/bth-ui.cjs.js +25 -0
  10. package/dist/cjs/index-UJE5BQI1.js +1550 -0
  11. package/dist/cjs/index.cjs.js +2 -0
  12. package/dist/cjs/loader.cjs.js +13 -0
  13. package/dist/collection/collection-manifest.json +18 -0
  14. package/dist/collection/components/bth-alert/bth-alert-description.css +16 -0
  15. package/dist/collection/components/bth-alert/bth-alert-description.js +34 -0
  16. package/dist/collection/components/bth-alert/bth-alert-title.css +13 -0
  17. package/dist/collection/components/bth-alert/bth-alert-title.js +34 -0
  18. package/dist/collection/components/bth-alert/bth-alert.css +109 -0
  19. package/dist/collection/components/bth-alert/bth-alert.js +138 -0
  20. package/dist/collection/components/bth-alert/bth-alert.types.js +1 -0
  21. package/dist/collection/components/bth-badge/bth-badge.css +109 -0
  22. package/dist/collection/components/bth-badge/bth-badge.js +129 -0
  23. package/dist/collection/components/bth-badge/bth-badge.types.js +1 -0
  24. package/dist/collection/components/bth-button/bth-button.css +152 -0
  25. package/dist/collection/components/bth-button/bth-button.js +183 -0
  26. package/dist/collection/components/bth-button/bth-button.types.js +1 -0
  27. package/dist/collection/components/bth-icon/bth-icon.css +9 -0
  28. package/dist/collection/components/bth-icon/bth-icon.js +57 -0
  29. package/dist/collection/index.js +1 -0
  30. package/dist/components/bth-alert-description.d.ts +11 -0
  31. package/dist/components/bth-alert-description.js +1 -0
  32. package/dist/components/bth-alert-title.d.ts +11 -0
  33. package/dist/components/bth-alert-title.js +1 -0
  34. package/dist/components/bth-alert.d.ts +11 -0
  35. package/dist/components/bth-alert.js +1 -0
  36. package/dist/components/bth-badge.d.ts +11 -0
  37. package/dist/components/bth-badge.js +1 -0
  38. package/dist/components/bth-button.d.ts +11 -0
  39. package/dist/components/bth-button.js +1 -0
  40. package/dist/components/bth-icon.d.ts +11 -0
  41. package/dist/components/bth-icon.js +1 -0
  42. package/dist/components/index.d.ts +35 -0
  43. package/dist/components/index.js +1 -0
  44. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  45. package/dist/esm/bth-alert_6.entry.js +126 -0
  46. package/dist/esm/bth-ui.js +21 -0
  47. package/dist/esm/index-svnzPQiH.js +1541 -0
  48. package/dist/esm/index.js +1 -0
  49. package/dist/esm/loader.js +11 -0
  50. package/dist/index.cjs.js +1 -0
  51. package/dist/index.js +1 -0
  52. package/dist/types/components/bth-alert/bth-alert-description.d.ts +19 -0
  53. package/dist/types/components/bth-alert/bth-alert-title.d.ts +19 -0
  54. package/dist/types/components/bth-alert/bth-alert.d.ts +41 -0
  55. package/dist/types/components/bth-alert/bth-alert.types.d.ts +1 -0
  56. package/dist/types/components/bth-badge/bth-badge.d.ts +30 -0
  57. package/dist/types/components/bth-badge/bth-badge.types.d.ts +3 -0
  58. package/dist/types/components/bth-button/bth-button.d.ts +34 -0
  59. package/dist/types/components/bth-button/bth-button.types.d.ts +3 -0
  60. package/dist/types/components/bth-icon/bth-icon.d.ts +20 -0
  61. package/dist/types/components.d.ts +580 -0
  62. package/dist/types/index.d.ts +10 -0
  63. package/dist/types/stencil-public-runtime.d.ts +1879 -0
  64. package/loader/cdn.js +1 -0
  65. package/loader/index.cjs.js +1 -0
  66. package/loader/index.d.ts +24 -0
  67. package/loader/index.es2017.js +1 -0
  68. package/loader/index.js +2 -0
  69. package/package.json +46 -4
  70. package/readme.md +31 -0
  71. package/README.md +0 -3
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-UJE5BQI1.js');
4
+ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
+
6
+ const defineCustomElements = async (win, options) => {
7
+ if (typeof window === 'undefined') return undefined;
8
+ await appGlobals.globalScripts();
9
+ return index.bootstrapLazy([["bth-alert_6.cjs",[[769,"bth-alert",{"variant":[513],"dismissible":[4],"hasIcon":[32],"dismissed":[32]}],[257,"bth-alert-description"],[257,"bth-alert-title"],[769,"bth-badge",{"variant":[513],"color":[513],"size":[513]}],[769,"bth-button",{"variant":[513],"disabled":[516],"size":[513],"color":[513],"type":[1]}],[512,"bth-icon",{"name":[1]}]]]], options);
10
+ };
11
+
12
+ exports.setNonce = index.setNonce;
13
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,18 @@
1
+ {
2
+ "entries": [
3
+ "components/bth-alert/bth-alert-description.js",
4
+ "components/bth-alert/bth-alert-title.js",
5
+ "components/bth-alert/bth-alert.js",
6
+ "components/bth-badge/bth-badge.js",
7
+ "components/bth-button/bth-button.js",
8
+ "components/bth-icon/bth-icon.js"
9
+ ],
10
+ "mixins": [],
11
+ "compiler": {
12
+ "name": "@stencil/core",
13
+ "version": "4.45.2",
14
+ "typescriptVersion": "5.8.3"
15
+ },
16
+ "collections": [],
17
+ "bundles": []
18
+ }
@@ -0,0 +1,16 @@
1
+ :host {
2
+ display: block;
3
+ grid-column: 2;
4
+ }
5
+
6
+ .alert-description {
7
+ margin: 0;
8
+ font-family: var(--bth-font-family, "Geist", sans-serif);
9
+ font-size: var(--bth-font-size-md, 0.875rem);
10
+ line-height: var(--bth-line-height-normal, 1.45);
11
+ color: var(--bth-alert-text-color, var(--bth-color-text, #222222));
12
+ }
13
+
14
+ :host(:not(:first-child)) .alert-description {
15
+ margin-top: var(--bth-spacing-1x, 4px);
16
+ }
@@ -0,0 +1,34 @@
1
+ import { Host, h } from "@stencil/core";
2
+ /**
3
+ * Descrição de um `bth-alert`.
4
+ *
5
+ * @usage-when Dentro de um `bth-alert`, para detalhar a mensagem ou orientar o próximo passo.
6
+ * @usage-avoid Fora de um `bth-alert`; para outros textos, use um parágrafo comum.
7
+ * @category feedback
8
+ * @related bth-alert, bth-alert-title
9
+ * @example
10
+ * ```html
11
+ * <bth-alert-description>Uma nova versão está disponível.</bth-alert-description>
12
+ * ```
13
+ * @status beta
14
+ *
15
+ * @slot - Texto da descrição.
16
+ * @part description - Elemento da descrição.
17
+ */
18
+ export class BthAlertDescription {
19
+ render() {
20
+ return (h(Host, { key: '27e9214204ef24ab0e97c1773127d2876430dad5', "data-slot": 'alert-description' }, h("div", { key: '4ccf13a8de497058066c392b141f3a20f113c2e4', class: 'alert-description', part: 'description' }, h("slot", { key: '3229468fe358daa760bd6383c4aff6ed26e6504f' }))));
21
+ }
22
+ static get is() { return "bth-alert-description"; }
23
+ static get encapsulation() { return "shadow"; }
24
+ static get originalStyleUrls() {
25
+ return {
26
+ "$": ["bth-alert-description.scss"]
27
+ };
28
+ }
29
+ static get styleUrls() {
30
+ return {
31
+ "$": ["bth-alert-description.css"]
32
+ };
33
+ }
34
+ }
@@ -0,0 +1,13 @@
1
+ :host {
2
+ display: block;
3
+ grid-column: 2;
4
+ }
5
+
6
+ .alert-title {
7
+ margin: 0;
8
+ font-family: var(--bth-font-family, "Geist", sans-serif);
9
+ font-size: var(--bth-font-size-lg, 1rem);
10
+ font-weight: var(--bth-font-weight-semibold, 600);
11
+ line-height: var(--bth-spacing-6x, 24px);
12
+ color: var(--bth-alert-accent-color, inherit);
13
+ }
@@ -0,0 +1,34 @@
1
+ import { Host, h } from "@stencil/core";
2
+ /**
3
+ * Título de um `bth-alert`.
4
+ *
5
+ * @usage-when Dentro de um `bth-alert`, para resumir a mensagem em poucas palavras.
6
+ * @usage-avoid Fora de um `bth-alert`; para outros títulos, use um elemento de título comum.
7
+ * @category feedback
8
+ * @related bth-alert, bth-alert-description
9
+ * @example
10
+ * ```html
11
+ * <bth-alert-title>Informação</bth-alert-title>
12
+ * ```
13
+ * @status beta
14
+ *
15
+ * @slot - Texto do título.
16
+ * @part title - Elemento do título.
17
+ */
18
+ export class BthAlertTitle {
19
+ render() {
20
+ return (h(Host, { key: '0c513e02bcbf0ed3e90f855da9e4d93d3b59818f', "data-slot": 'alert-title' }, h("h5", { key: 'df92e7dc279675b15e69c4267e32fdd6c417dc8f', class: 'alert-title', part: 'title' }, h("slot", { key: '79fe942452e0d649a5dbe1920aadc0b74fe08e40' }))));
21
+ }
22
+ static get is() { return "bth-alert-title"; }
23
+ static get encapsulation() { return "shadow"; }
24
+ static get originalStyleUrls() {
25
+ return {
26
+ "$": ["bth-alert-title.scss"]
27
+ };
28
+ }
29
+ static get styleUrls() {
30
+ return {
31
+ "$": ["bth-alert-title.css"]
32
+ };
33
+ }
34
+ }
@@ -0,0 +1,109 @@
1
+ :host {
2
+ display: block;
3
+ --bth-alert-bg-color: transparent;
4
+ --bth-alert-text-color: var(--bth-color-text, #222222);
5
+ --bth-alert-border-color: var(--bth-color-border, #d1d5db);
6
+ --bth-alert-accent-color: var(--bth-color-text, #222222);
7
+ }
8
+
9
+ :host([hidden]) {
10
+ display: none;
11
+ }
12
+
13
+ :host([variant=default]) {
14
+ --bth-alert-bg-color: transparent;
15
+ --bth-alert-text-color: var(--bth-color-text, #222222);
16
+ --bth-alert-border-color: var(--bth-color-border, #d1d5db);
17
+ --bth-alert-accent-color: var(--bth-color-text, #222222);
18
+ }
19
+
20
+ :host([variant=danger]) {
21
+ --bth-alert-bg-color: var(--bth-color-danger, #df4661);
22
+ --bth-alert-text-color: var(--bth-color-danger-contrast, #ffffff);
23
+ --bth-alert-border-color: var(--bth-color-danger, #df4661);
24
+ --bth-alert-accent-color: var(--bth-color-danger, #df4661);
25
+ }
26
+
27
+ :host([variant=success]) {
28
+ --bth-alert-bg-color: var(--bth-color-success, #26d07c);
29
+ --bth-alert-text-color: var(--bth-color-success-contrast, #ffffff);
30
+ --bth-alert-border-color: var(--bth-color-success, #26d07c);
31
+ --bth-alert-accent-color: var(--bth-color-success, #26d07c);
32
+ }
33
+
34
+ :host([variant=warning]) {
35
+ --bth-alert-bg-color: var(--bth-color-warning, #f7b500);
36
+ --bth-alert-text-color: var(--bth-color-warning-contrast, #ffffff);
37
+ --bth-alert-border-color: var(--bth-color-warning, #f7b500);
38
+ --bth-alert-accent-color: var(--bth-color-warning, #f7b500);
39
+ }
40
+
41
+ :host([variant=info]) {
42
+ --bth-alert-bg-color: var(--bth-color-info, #009cde);
43
+ --bth-alert-text-color: var(--bth-color-info-contrast, #ffffff);
44
+ --bth-alert-border-color: var(--bth-color-info, #009cde);
45
+ --bth-alert-accent-color: var(--bth-color-info, #009cde);
46
+ }
47
+
48
+ :host([variant]) {
49
+ --bth-alert-bg-color: color-mix(in srgb, var(--bth-alert-accent-color) var(--bth-tint-subtle, 10%), transparent);
50
+ --bth-alert-text-color: var(--bth-color-text, #222222);
51
+ }
52
+
53
+ :host([variant=default]) {
54
+ --bth-alert-bg-color: transparent;
55
+ }
56
+
57
+ .alert {
58
+ display: grid;
59
+ grid-template-columns: 0 1fr auto;
60
+ align-items: start;
61
+ box-sizing: border-box;
62
+ padding: var(--bth-spacing-4x, 16px);
63
+ border: 1px solid var(--bth-alert-border-color);
64
+ border-radius: var(--bth-radius-md, 10px);
65
+ background-color: var(--bth-alert-bg-color);
66
+ color: var(--bth-alert-accent-color);
67
+ font-family: var(--bth-font-family, "Geist", sans-serif);
68
+ }
69
+
70
+ .alert--has-icon {
71
+ grid-template-columns: auto 1fr auto;
72
+ }
73
+
74
+ ::slotted([slot=icon]) {
75
+ grid-column: 1;
76
+ grid-row: 1/span 2;
77
+ display: flex;
78
+ align-items: flex-start;
79
+ margin-right: var(--bth-spacing-3x, 12px);
80
+ color: currentColor;
81
+ }
82
+
83
+ .alert-dismiss {
84
+ grid-column: 3;
85
+ grid-row: 1/span 2;
86
+ display: inline-flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ width: var(--bth-spacing-6x, 24px);
90
+ height: var(--bth-spacing-6x, 24px);
91
+ margin-left: var(--bth-spacing-3x, 12px);
92
+ padding: 0;
93
+ border: 0;
94
+ border-radius: var(--bth-radius-xs, 6px);
95
+ background-color: transparent;
96
+ color: var(--bth-alert-text-color);
97
+ cursor: pointer;
98
+ transition: background-color 0.15s ease;
99
+ }
100
+ .alert-dismiss:hover {
101
+ background-color: color-mix(in srgb, var(--bth-alert-accent-color) var(--bth-tint-hover, 10%), transparent);
102
+ }
103
+ .alert-dismiss:active {
104
+ background-color: color-mix(in srgb, var(--bth-alert-accent-color) var(--bth-tint-active, 18%), transparent);
105
+ }
106
+ .alert-dismiss:focus-visible {
107
+ outline: 2px solid var(--bth-alert-accent-color);
108
+ outline-offset: 2px;
109
+ }
@@ -0,0 +1,138 @@
1
+ import clsx from "clsx";
2
+ import { Host, h } from "@stencil/core";
3
+ /**
4
+ * Alerta para destacar uma mensagem importante dentro do conteúdo da página.
5
+ *
6
+ * @usage-when Para comunicar o resultado de uma ação, como sucesso ou erro ao salvar.
7
+ * @usage-when Para avisar sobre um estado ou uma condição que afeta o que a pessoa está fazendo.
8
+ * @usage-avoid Para mensagens temporárias que somem sozinhas; use uma notificação do tipo toast.
9
+ * @usage-avoid Para validação de um campo específico; mostre a mensagem junto ao campo.
10
+ * @category feedback
11
+ * @related bth-alert-title, bth-alert-description, bth-icon
12
+ * @example
13
+ * ```html
14
+ * <bth-alert variant="info" dismissible>
15
+ * <bth-icon slot="icon" name="info"></bth-icon>
16
+ * <bth-alert-title>Informação</bth-alert-title>
17
+ * <bth-alert-description>Uma nova versão está disponível.</bth-alert-description>
18
+ * </bth-alert>
19
+ * ```
20
+ * @status beta
21
+ *
22
+ * @slot - Conteúdo do alerta, normalmente `bth-alert-title` e `bth-alert-description`.
23
+ * @slot icon - Ícone exibido à esquerda do conteúdo.
24
+ * @part alert - Contêiner do alerta.
25
+ * @part dismiss - Botão de fechar, presente quando `dismissible` está ativo.
26
+ */
27
+ export class BthAlert {
28
+ el;
29
+ /** Variante de cor, de acordo com o tipo da mensagem. */
30
+ variant = 'default';
31
+ /** Exibe um botão que permite fechar o alerta. */
32
+ dismissible = false;
33
+ hasIcon = false;
34
+ dismissed = false;
35
+ /** Emitido quando o alerta é fechado pelo botão de fechar. */
36
+ bthDismiss;
37
+ componentWillLoad() {
38
+ this.updateHasIcon();
39
+ }
40
+ updateHasIcon = () => {
41
+ this.hasIcon = !!this.el.querySelector(':scope > [slot="icon"]');
42
+ };
43
+ handleDismiss = () => {
44
+ this.dismissed = true;
45
+ this.bthDismiss.emit();
46
+ };
47
+ render() {
48
+ return (h(Host, { key: '92b3322ec6586bea380d12b09b6fc9556db26195', "data-slot": 'alert', hidden: this.dismissed }, h("div", { key: 'c897cc5ef279ad1420dc6b73a99087a6900af1d2', class: clsx('alert', this.hasIcon && 'alert--has-icon'), role: 'alert', part: 'alert' }, h("slot", { key: 'e87cca48b662e26b04fc486c8f6a2c359de99a15', name: 'icon', onSlotchange: this.updateHasIcon }), h("slot", { key: 'dca9b4c45e911bb28632ae419c1b446f302d5333' }), this.dismissible && (h("button", { key: '6a044accbc86dcef7f54369e3f8fb7f6071ee918', class: 'alert-dismiss', type: 'button', "aria-label": 'Fechar', part: 'dismiss', onClick: this.handleDismiss }, h("svg", { key: 'e3472ad3898665a876270cf92681c05aac2989a2', width: '16', height: '16', viewBox: '0 0 16 16', fill: 'none', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "aria-hidden": 'true' }, h("path", { key: '8a11a9e5a1cdb140894c2fc8af356c4318605fdb', d: 'M4 4l8 8M12 4l-8 8' })))))));
49
+ }
50
+ static get is() { return "bth-alert"; }
51
+ static get encapsulation() { return "shadow"; }
52
+ static get originalStyleUrls() {
53
+ return {
54
+ "$": ["bth-alert.scss"]
55
+ };
56
+ }
57
+ static get styleUrls() {
58
+ return {
59
+ "$": ["bth-alert.css"]
60
+ };
61
+ }
62
+ static get properties() {
63
+ return {
64
+ "variant": {
65
+ "type": "string",
66
+ "mutable": false,
67
+ "complexType": {
68
+ "original": "AlertVariant",
69
+ "resolved": "\"danger\" | \"default\" | \"info\" | \"success\" | \"warning\"",
70
+ "references": {
71
+ "AlertVariant": {
72
+ "location": "import",
73
+ "path": "./bth-alert.types",
74
+ "id": "src/components/bth-alert/bth-alert.types.ts::AlertVariant",
75
+ "referenceLocation": "AlertVariant"
76
+ }
77
+ }
78
+ },
79
+ "required": false,
80
+ "optional": false,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": "Variante de cor, de acordo com o tipo da mensagem."
84
+ },
85
+ "getter": false,
86
+ "setter": false,
87
+ "reflect": true,
88
+ "attribute": "variant",
89
+ "defaultValue": "'default'"
90
+ },
91
+ "dismissible": {
92
+ "type": "boolean",
93
+ "mutable": false,
94
+ "complexType": {
95
+ "original": "boolean",
96
+ "resolved": "boolean",
97
+ "references": {}
98
+ },
99
+ "required": false,
100
+ "optional": false,
101
+ "docs": {
102
+ "tags": [],
103
+ "text": "Exibe um bot\u00E3o que permite fechar o alerta."
104
+ },
105
+ "getter": false,
106
+ "setter": false,
107
+ "reflect": false,
108
+ "attribute": "dismissible",
109
+ "defaultValue": "false"
110
+ }
111
+ };
112
+ }
113
+ static get states() {
114
+ return {
115
+ "hasIcon": {},
116
+ "dismissed": {}
117
+ };
118
+ }
119
+ static get events() {
120
+ return [{
121
+ "method": "bthDismiss",
122
+ "name": "bthDismiss",
123
+ "bubbles": true,
124
+ "cancelable": true,
125
+ "composed": true,
126
+ "docs": {
127
+ "tags": [],
128
+ "text": "Emitido quando o alerta \u00E9 fechado pelo bot\u00E3o de fechar."
129
+ },
130
+ "complexType": {
131
+ "original": "void",
132
+ "resolved": "void",
133
+ "references": {}
134
+ }
135
+ }];
136
+ }
137
+ static get elementRef() { return "el"; }
138
+ }
@@ -0,0 +1,109 @@
1
+ :host {
2
+ display: inline-block;
3
+ vertical-align: middle;
4
+ font-size: var(--bth-badge-font-size);
5
+ --bth-badge-bg-color: transparent;
6
+ --bth-badge-text-color: var(--bth-color-text, #222222);
7
+ --bth-badge-border-color: var(--bth-color-border, #d1d5db);
8
+ --bth-badge-accent-color: var(--bth-color-text, #222222);
9
+ --bth-badge-font-size: 0.75em;
10
+ }
11
+
12
+ :host([color=default]) {
13
+ --bth-badge-bg-color: transparent;
14
+ --bth-badge-text-color: var(--bth-color-text, #222222);
15
+ --bth-badge-border-color: var(--bth-color-border, #d1d5db);
16
+ --bth-badge-accent-color: var(--bth-color-text, #222222);
17
+ }
18
+
19
+ :host([color=primary]) {
20
+ --bth-badge-bg-color: var(--bth-color-primary, #0861ff);
21
+ --bth-badge-text-color: var(--bth-color-primary-contrast, #ffffff);
22
+ --bth-badge-border-color: var(--bth-color-primary, #0861ff);
23
+ --bth-badge-accent-color: var(--bth-color-primary, #0861ff);
24
+ }
25
+
26
+ :host([color=success]) {
27
+ --bth-badge-bg-color: var(--bth-color-success, #26d07c);
28
+ --bth-badge-text-color: var(--bth-color-success-contrast, #ffffff);
29
+ --bth-badge-border-color: var(--bth-color-success, #26d07c);
30
+ --bth-badge-accent-color: var(--bth-color-success, #26d07c);
31
+ }
32
+
33
+ :host([color=danger]) {
34
+ --bth-badge-bg-color: var(--bth-color-danger, #df4661);
35
+ --bth-badge-text-color: var(--bth-color-danger-contrast, #ffffff);
36
+ --bth-badge-border-color: var(--bth-color-danger, #df4661);
37
+ --bth-badge-accent-color: var(--bth-color-danger, #df4661);
38
+ }
39
+
40
+ :host([color=warning]) {
41
+ --bth-badge-bg-color: var(--bth-color-warning, #f7b500);
42
+ --bth-badge-text-color: var(--bth-color-warning-contrast, #ffffff);
43
+ --bth-badge-border-color: var(--bth-color-warning, #f7b500);
44
+ --bth-badge-accent-color: var(--bth-color-warning, #f7b500);
45
+ }
46
+
47
+ :host([color=info]) {
48
+ --bth-badge-bg-color: var(--bth-color-info, #009cde);
49
+ --bth-badge-text-color: var(--bth-color-info-contrast, #ffffff);
50
+ --bth-badge-border-color: var(--bth-color-info, #009cde);
51
+ --bth-badge-accent-color: var(--bth-color-info, #009cde);
52
+ }
53
+
54
+ :host([color=accent]) {
55
+ --bth-badge-bg-color: var(--bth-color-accent, #7740ff);
56
+ --bth-badge-text-color: var(--bth-color-accent-contrast, #ffffff);
57
+ --bth-badge-border-color: var(--bth-color-accent, #7740ff);
58
+ --bth-badge-accent-color: var(--bth-color-accent, #7740ff);
59
+ }
60
+
61
+ :host([size=xs]) {
62
+ --bth-badge-font-size: 0.55em;
63
+ }
64
+
65
+ :host([size=sm]) {
66
+ --bth-badge-font-size: 0.65em;
67
+ }
68
+
69
+ :host([size=md]) {
70
+ --bth-badge-font-size: 0.75em;
71
+ }
72
+
73
+ :host([size=lg]) {
74
+ --bth-badge-font-size: 0.875em;
75
+ }
76
+
77
+ :host([size=xl]) {
78
+ --bth-badge-font-size: 1em;
79
+ }
80
+
81
+ .badge {
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ gap: 0.35em;
86
+ box-sizing: border-box;
87
+ padding: 0.3em 0.7em;
88
+ border: 1px solid var(--bth-badge-border-color);
89
+ border-radius: 0.5em;
90
+ background-color: var(--bth-badge-bg-color);
91
+ color: var(--bth-badge-text-color);
92
+ font-family: var(--bth-font-family, "Geist", sans-serif);
93
+ font-size: 1em;
94
+ font-weight: var(--bth-font-weight-medium, 500);
95
+ line-height: var(--bth-line-height-tight, 1.2);
96
+ letter-spacing: normal;
97
+ white-space: nowrap;
98
+ }
99
+
100
+ :host([variant=subtle]),
101
+ :host([variant=outline]) {
102
+ --bth-badge-bg-color: transparent;
103
+ --bth-badge-text-color: var(--bth-badge-accent-color);
104
+ }
105
+
106
+ :host([variant=subtle]) {
107
+ --bth-badge-bg-color: color-mix(in srgb, var(--bth-badge-accent-color) var(--bth-tint-subtle, 10%), transparent);
108
+ --bth-badge-border-color: transparent;
109
+ }
@@ -0,0 +1,129 @@
1
+ import { Host, h } from "@stencil/core";
2
+ /**
3
+ * Etiqueta curta para destacar um status, uma categoria ou uma contagem.
4
+ *
5
+ * @usage-when Para indicar o status de um item, como "Ativo", "Pendente" ou "Novo".
6
+ * @usage-when Para rotular ou categorizar um conteúdo, inclusive ao lado de um título.
7
+ * @usage-avoid Para ações clicáveis; use um `bth-button`.
8
+ * @usage-avoid Para mensagens longas ou que exigem atenção imediata; use um `bth-alert`.
9
+ * @category dados
10
+ * @related bth-button, bth-alert, bth-icon
11
+ * @example
12
+ * ```html
13
+ * <bth-badge variant="solid" color="primary">solid</bth-badge>
14
+ * <bth-badge variant="subtle" color="primary">subtle</bth-badge>
15
+ * <bth-badge variant="outline" color="primary">outline</bth-badge>
16
+ * ```
17
+ * @status beta
18
+ *
19
+ * @slot - Conteúdo do badge.
20
+ * @part badge - Elemento do badge.
21
+ */
22
+ export class BthBadge {
23
+ /** Estilo visual: `solid` é preenchido, `subtle` tem um fundo suave e `outline` tem só a borda. */
24
+ variant = 'solid';
25
+ /** Cor do badge. */
26
+ color = 'default';
27
+ /** Tamanho do badge, proporcional ao tamanho da fonte do contexto onde ele está. */
28
+ size = 'md';
29
+ render() {
30
+ return (h(Host, { key: '845476bdaa75c6e1e90b97c14e9055b02a1fef60', "data-slot": 'badge' }, h("span", { key: 'f18a3a971b47b1a6c80131b71278a5c66cbe39b1', class: 'badge', part: 'badge' }, h("slot", { key: 'e296ee90d002f0a25d7bf7fb7aaa3ebfe4952d7f' }))));
31
+ }
32
+ static get is() { return "bth-badge"; }
33
+ static get encapsulation() { return "shadow"; }
34
+ static get originalStyleUrls() {
35
+ return {
36
+ "$": ["bth-badge.scss"]
37
+ };
38
+ }
39
+ static get styleUrls() {
40
+ return {
41
+ "$": ["bth-badge.css"]
42
+ };
43
+ }
44
+ static get properties() {
45
+ return {
46
+ "variant": {
47
+ "type": "string",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "BadgeVariant",
51
+ "resolved": "\"outline\" | \"solid\" | \"subtle\"",
52
+ "references": {
53
+ "BadgeVariant": {
54
+ "location": "import",
55
+ "path": "./bth-badge.types",
56
+ "id": "src/components/bth-badge/bth-badge.types.ts::BadgeVariant",
57
+ "referenceLocation": "BadgeVariant"
58
+ }
59
+ }
60
+ },
61
+ "required": false,
62
+ "optional": false,
63
+ "docs": {
64
+ "tags": [],
65
+ "text": "Estilo visual: `solid` \u00E9 preenchido, `subtle` tem um fundo suave e `outline` tem s\u00F3 a borda."
66
+ },
67
+ "getter": false,
68
+ "setter": false,
69
+ "reflect": true,
70
+ "attribute": "variant",
71
+ "defaultValue": "'solid'"
72
+ },
73
+ "color": {
74
+ "type": "string",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "BadgeColor",
78
+ "resolved": "\"accent\" | \"danger\" | \"default\" | \"info\" | \"primary\" | \"success\" | \"warning\"",
79
+ "references": {
80
+ "BadgeColor": {
81
+ "location": "import",
82
+ "path": "./bth-badge.types",
83
+ "id": "src/components/bth-badge/bth-badge.types.ts::BadgeColor",
84
+ "referenceLocation": "BadgeColor"
85
+ }
86
+ }
87
+ },
88
+ "required": false,
89
+ "optional": false,
90
+ "docs": {
91
+ "tags": [],
92
+ "text": "Cor do badge."
93
+ },
94
+ "getter": false,
95
+ "setter": false,
96
+ "reflect": true,
97
+ "attribute": "color",
98
+ "defaultValue": "'default'"
99
+ },
100
+ "size": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "BadgeSize",
105
+ "resolved": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"",
106
+ "references": {
107
+ "BadgeSize": {
108
+ "location": "import",
109
+ "path": "./bth-badge.types",
110
+ "id": "src/components/bth-badge/bth-badge.types.ts::BadgeSize",
111
+ "referenceLocation": "BadgeSize"
112
+ }
113
+ }
114
+ },
115
+ "required": false,
116
+ "optional": false,
117
+ "docs": {
118
+ "tags": [],
119
+ "text": "Tamanho do badge, proporcional ao tamanho da fonte do contexto onde ele est\u00E1."
120
+ },
121
+ "getter": false,
122
+ "setter": false,
123
+ "reflect": true,
124
+ "attribute": "size",
125
+ "defaultValue": "'md'"
126
+ }
127
+ };
128
+ }
129
+ }