bromcom-ui-next 0.1.3 → 0.1.4

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 (200) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js.map +1 -1
  3. package/dist/bromcom-ui/global/global.js +14 -15
  4. package/dist/bromcom-ui/p-04f6d730.entry.js +2 -0
  5. package/dist/bromcom-ui/p-04f6d730.entry.js.map +1 -0
  6. package/dist/bromcom-ui/{p-b36f4f44.js → p-12360e4c.js} +1 -1
  7. package/dist/bromcom-ui/p-15fe392b.js +3 -0
  8. package/dist/bromcom-ui/p-15fe392b.js.map +1 -0
  9. package/dist/bromcom-ui/p-1b11150b.entry.js +2 -0
  10. package/dist/bromcom-ui/{p-6430a887.entry.js.map → p-1b11150b.entry.js.map} +1 -1
  11. package/dist/bromcom-ui/p-1d86c1cf.entry.js +2 -0
  12. package/dist/bromcom-ui/p-1d86c1cf.entry.js.map +1 -0
  13. package/dist/bromcom-ui/p-31354aaa.js +2 -0
  14. package/dist/bromcom-ui/p-31354aaa.js.map +1 -0
  15. package/dist/bromcom-ui/p-3b607038.entry.js +2 -0
  16. package/dist/bromcom-ui/p-3b607038.entry.js.map +1 -0
  17. package/dist/bromcom-ui/p-5d0838e9.entry.js +2 -0
  18. package/dist/bromcom-ui/{p-bde58312.entry.js.map → p-5d0838e9.entry.js.map} +1 -1
  19. package/dist/bromcom-ui/p-729a870f.js +2 -0
  20. package/dist/bromcom-ui/p-729a870f.js.map +1 -0
  21. package/dist/bromcom-ui/p-a590f793.entry.js +2 -0
  22. package/dist/bromcom-ui/p-a590f793.entry.js.map +1 -0
  23. package/dist/bromcom-ui/p-cd437280.entry.js +2 -0
  24. package/dist/bromcom-ui/p-cd437280.entry.js.map +1 -0
  25. package/dist/bromcom-ui/{p-dcc13a55.entry.js → p-dcea8d62.entry.js} +2 -2
  26. package/dist/bromcom-ui/{p-3805363a.entry.js → p-ebed10d5.entry.js} +2 -2
  27. package/dist/cjs/app-globals-29edfda4.js +39 -0
  28. package/dist/cjs/app-globals-29edfda4.js.map +1 -0
  29. package/dist/cjs/bcm-accordion-group.cjs.entry.js +3 -3
  30. package/dist/cjs/bcm-accordion-group.cjs.entry.js.map +1 -1
  31. package/dist/cjs/bcm-accordion.cjs.entry.js +7 -7
  32. package/dist/cjs/bcm-accordion.cjs.entry.js.map +1 -1
  33. package/dist/cjs/bcm-alert.cjs.entry.js +1 -1
  34. package/dist/cjs/bcm-avatar_4.cjs.entry.js +577 -0
  35. package/dist/cjs/bcm-avatar_4.cjs.entry.js.map +1 -0
  36. package/dist/cjs/bcm-chip.cjs.entry.js +4 -4
  37. package/dist/cjs/bcm-chip.cjs.entry.js.map +1 -1
  38. package/dist/cjs/bcm-divider.cjs.entry.js +81 -0
  39. package/dist/cjs/bcm-divider.cjs.entry.js.map +1 -0
  40. package/dist/cjs/bcm-input.cjs.entry.js +313 -0
  41. package/dist/cjs/bcm-input.cjs.entry.js.map +1 -0
  42. package/dist/cjs/bcm-text.cjs.entry.js +3 -3
  43. package/dist/cjs/bcm-text.cjs.entry.js.map +1 -1
  44. package/dist/cjs/bcm-textarea.cjs.entry.js +316 -0
  45. package/dist/cjs/bcm-textarea.cjs.entry.js.map +1 -0
  46. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  47. package/dist/cjs/{index-c36002ae.js → index-4795c073.js} +13 -4
  48. package/dist/cjs/index-4795c073.js.map +1 -0
  49. package/dist/{components/p-b36f4f44.js → cjs/index-5a88e57b.js} +5 -3
  50. package/dist/cjs/{index-a4eea4bb.js.map → index-5a88e57b.js.map} +1 -1
  51. package/dist/cjs/loader.cjs.js +3 -3
  52. package/dist/cjs/validation-messages-c36e5c31.js +134 -0
  53. package/dist/cjs/validation-messages-c36e5c31.js.map +1 -0
  54. package/dist/collection/collection-manifest.json +5 -1
  55. package/dist/collection/components/accordion/accordion.component.js +5 -5
  56. package/dist/collection/components/accordion/accordion.component.js.map +1 -1
  57. package/dist/collection/components/accordion/accordion.css +1 -1
  58. package/dist/collection/components/accordion-group/accordion-group.component.js +1 -1
  59. package/dist/collection/components/accordion-group/accordion-group.component.js.map +1 -1
  60. package/dist/collection/components/accordion-group/accordion-group.css +1 -1
  61. package/dist/collection/components/avatar/avatar.component.js.map +1 -1
  62. package/dist/collection/components/avatar/avatar.css +1 -1
  63. package/dist/collection/components/badge/badge.component.js +373 -0
  64. package/dist/collection/components/badge/badge.component.js.map +1 -0
  65. package/dist/collection/components/badge/badge.css +1 -0
  66. package/dist/collection/components/basic-badge/basic-badge.component.js +236 -0
  67. package/dist/collection/components/basic-badge/basic-badge.component.js.map +1 -0
  68. package/dist/collection/components/basic-badge/basic-badge.css +1 -0
  69. package/dist/collection/components/button/button.component.js +2 -2
  70. package/dist/collection/components/button/button.css +1 -1
  71. package/dist/collection/components/chip/chip.component.js +2 -2
  72. package/dist/collection/components/chip/chip.component.js.map +1 -1
  73. package/dist/collection/components/chip/chip.css +1 -1
  74. package/dist/collection/components/divider/divider.component.js +190 -0
  75. package/dist/collection/components/divider/divider.component.js.map +1 -0
  76. package/dist/collection/components/divider/divider.css +1 -0
  77. package/dist/collection/components/input/input.component.js +209 -24
  78. package/dist/collection/components/input/input.component.js.map +1 -1
  79. package/dist/collection/components/input/input.css +1 -1
  80. package/dist/collection/components/input/types.js +10 -1
  81. package/dist/collection/components/input/types.js.map +1 -1
  82. package/dist/collection/components/text/text.component.js +1 -1
  83. package/dist/collection/components/textarea/textarea.component.js +1013 -0
  84. package/dist/collection/components/textarea/textarea.component.js.map +1 -0
  85. package/dist/collection/components/textarea/textarea.css +2 -0
  86. package/dist/collection/components/textarea/types.js +2 -0
  87. package/dist/collection/components/textarea/types.js.map +1 -0
  88. package/dist/collection/global/global.js +14 -15
  89. package/dist/collection/utils/i18n.js +29 -0
  90. package/dist/collection/utils/i18n.js.map +1 -0
  91. package/dist/collection/utils/slot/check-slot-content.js +15 -0
  92. package/dist/collection/utils/slot/check-slot-content.js.map +1 -0
  93. package/dist/collection/utils/validation-messages.js +17 -0
  94. package/dist/collection/utils/validation-messages.js.map +1 -0
  95. package/dist/components/bcm-accordion-group.js +3 -3
  96. package/dist/components/bcm-accordion-group.js.map +1 -1
  97. package/dist/components/bcm-accordion.js +7 -7
  98. package/dist/components/bcm-accordion.js.map +1 -1
  99. package/dist/components/bcm-alert.js +1 -1
  100. package/dist/components/bcm-avatar.js +13 -7
  101. package/dist/components/bcm-avatar.js.map +1 -1
  102. package/dist/components/bcm-badge.d.ts +11 -0
  103. package/dist/components/bcm-badge.js +8 -0
  104. package/dist/components/bcm-badge.js.map +1 -0
  105. package/dist/components/bcm-basic-badge.d.ts +11 -0
  106. package/dist/components/bcm-basic-badge.js +113 -0
  107. package/dist/components/bcm-basic-badge.js.map +1 -0
  108. package/dist/components/bcm-button.js +4 -4
  109. package/dist/components/bcm-button.js.map +1 -1
  110. package/dist/components/bcm-chip.js +4 -4
  111. package/dist/components/bcm-chip.js.map +1 -1
  112. package/dist/components/bcm-divider.d.ts +11 -0
  113. package/dist/components/bcm-divider.js +100 -0
  114. package/dist/components/bcm-divider.js.map +1 -0
  115. package/dist/components/bcm-input.js +168 -105
  116. package/dist/components/bcm-input.js.map +1 -1
  117. package/dist/components/bcm-text.js +3 -3
  118. package/dist/components/bcm-text.js.map +1 -1
  119. package/dist/components/bcm-textarea.d.ts +11 -0
  120. package/dist/components/bcm-textarea.js +369 -0
  121. package/dist/components/bcm-textarea.js.map +1 -0
  122. package/dist/components/index.js +12 -16
  123. package/dist/components/index.js.map +1 -1
  124. package/dist/{esm/index-f0e9d579.js → components/p-12360e4c.js} +3 -3
  125. package/dist/components/{p-b36f4f44.js.map → p-12360e4c.js.map} +1 -1
  126. package/dist/components/{p-8ded2c73.js → p-13582168.js} +10 -2
  127. package/dist/components/p-13582168.js.map +1 -0
  128. package/dist/components/p-31354aaa.js +129 -0
  129. package/dist/components/p-31354aaa.js.map +1 -0
  130. package/dist/components/p-39637e05.js +145 -0
  131. package/dist/components/p-39637e05.js.map +1 -0
  132. package/dist/esm/app-globals-bfa07b76.js +37 -0
  133. package/dist/esm/app-globals-bfa07b76.js.map +1 -0
  134. package/dist/esm/bcm-accordion-group.entry.js +3 -3
  135. package/dist/esm/bcm-accordion-group.entry.js.map +1 -1
  136. package/dist/esm/bcm-accordion.entry.js +7 -7
  137. package/dist/esm/bcm-accordion.entry.js.map +1 -1
  138. package/dist/esm/bcm-alert.entry.js +1 -1
  139. package/dist/esm/bcm-avatar_4.entry.js +570 -0
  140. package/dist/esm/bcm-avatar_4.entry.js.map +1 -0
  141. package/dist/esm/bcm-chip.entry.js +4 -4
  142. package/dist/esm/bcm-chip.entry.js.map +1 -1
  143. package/dist/esm/bcm-divider.entry.js +77 -0
  144. package/dist/esm/bcm-divider.entry.js.map +1 -0
  145. package/dist/esm/bcm-input.entry.js +309 -0
  146. package/dist/esm/bcm-input.entry.js.map +1 -0
  147. package/dist/esm/bcm-text.entry.js +3 -3
  148. package/dist/esm/bcm-text.entry.js.map +1 -1
  149. package/dist/esm/bcm-textarea.entry.js +312 -0
  150. package/dist/esm/bcm-textarea.entry.js.map +1 -0
  151. package/dist/esm/bromcom-ui.js +4 -4
  152. package/dist/{cjs/index-a4eea4bb.js → esm/index-097075ad.js} +3 -5
  153. package/dist/esm/{index-f0e9d579.js.map → index-097075ad.js.map} +1 -1
  154. package/dist/esm/{index-e23ee9b0.js → index-27cc1bac.js} +13 -4
  155. package/dist/esm/index-27cc1bac.js.map +1 -0
  156. package/dist/esm/loader.js +4 -4
  157. package/dist/esm/validation-messages-a29d53be.js +129 -0
  158. package/dist/esm/validation-messages-a29d53be.js.map +1 -0
  159. package/dist/types/components/badge/badge.component.d.ts +87 -0
  160. package/dist/types/components/basic-badge/basic-badge.component.d.ts +54 -0
  161. package/dist/types/components/divider/divider.component.d.ts +40 -0
  162. package/dist/types/components/input/input.component.d.ts +19 -0
  163. package/dist/types/components/input/types.d.ts +10 -0
  164. package/dist/types/components/textarea/textarea.component.d.ts +85 -0
  165. package/dist/types/components/textarea/types.d.ts +7 -0
  166. package/dist/types/components.d.ts +643 -0
  167. package/dist/types/utils/i18n.d.ts +8 -0
  168. package/dist/types/utils/slot/check-slot-content.d.ts +7 -0
  169. package/dist/types/utils/validation-messages.d.ts +11 -0
  170. package/package.json +1 -1
  171. package/dist/bromcom-ui/p-047e562f.entry.js +0 -2
  172. package/dist/bromcom-ui/p-047e562f.entry.js.map +0 -1
  173. package/dist/bromcom-ui/p-40643b53.js +0 -2
  174. package/dist/bromcom-ui/p-40643b53.js.map +0 -1
  175. package/dist/bromcom-ui/p-61c030c5.js +0 -3
  176. package/dist/bromcom-ui/p-61c030c5.js.map +0 -1
  177. package/dist/bromcom-ui/p-6430a887.entry.js +0 -2
  178. package/dist/bromcom-ui/p-9e94d920.entry.js +0 -2
  179. package/dist/bromcom-ui/p-9e94d920.entry.js.map +0 -1
  180. package/dist/bromcom-ui/p-bde58312.entry.js +0 -2
  181. package/dist/bromcom-ui/p-e7732b0c.entry.js +0 -2
  182. package/dist/bromcom-ui/p-e7732b0c.entry.js.map +0 -1
  183. package/dist/cjs/app-globals-e8faea0d.js +0 -43
  184. package/dist/cjs/app-globals-e8faea0d.js.map +0 -1
  185. package/dist/cjs/bcm-avatar.cjs.entry.js +0 -89
  186. package/dist/cjs/bcm-avatar.cjs.entry.js.map +0 -1
  187. package/dist/cjs/bcm-button_2.cjs.entry.js +0 -549
  188. package/dist/cjs/bcm-button_2.cjs.entry.js.map +0 -1
  189. package/dist/cjs/index-c36002ae.js.map +0 -1
  190. package/dist/components/p-8ded2c73.js.map +0 -1
  191. package/dist/esm/app-globals-f781c325.js +0 -41
  192. package/dist/esm/app-globals-f781c325.js.map +0 -1
  193. package/dist/esm/bcm-avatar.entry.js +0 -85
  194. package/dist/esm/bcm-avatar.entry.js.map +0 -1
  195. package/dist/esm/bcm-button_2.entry.js +0 -544
  196. package/dist/esm/bcm-button_2.entry.js.map +0 -1
  197. package/dist/esm/index-e23ee9b0.js.map +0 -1
  198. /package/dist/bromcom-ui/{p-b36f4f44.js.map → p-12360e4c.js.map} +0 -0
  199. /package/dist/bromcom-ui/{p-dcc13a55.entry.js.map → p-dcea8d62.entry.js.map} +0 -0
  200. /package/dist/bromcom-ui/{p-3805363a.entry.js.map → p-ebed10d5.entry.js.map} +0 -0
@@ -1,89 +1,35 @@
1
- import { p as proxyCustomElement, H, c as createEvent, h } from './p-8ded2c73.js';
1
+ import { p as proxyCustomElement, H, c as createEvent, h } from './p-13582168.js';
2
2
  import { c as ce } from './p-5fcf77f9.js';
3
- import { c as cs } from './p-b36f4f44.js';
3
+ import { c as classNames } from './p-12360e4c.js';
4
+ import { g as generateId, s as setValidationMessages, a as getValidationMessage, d as defaultValidationMessages } from './p-31354aaa.js';
4
5
 
5
- const byteToHex = [];
6
- for (let i = 0; i < 256; ++i) {
7
- byteToHex.push((i + 0x100).toString(16).slice(1));
8
- }
9
- function unsafeStringify(arr, offset = 0) {
10
- return (byteToHex[arr[offset + 0]] +
11
- byteToHex[arr[offset + 1]] +
12
- byteToHex[arr[offset + 2]] +
13
- byteToHex[arr[offset + 3]] +
14
- '-' +
15
- byteToHex[arr[offset + 4]] +
16
- byteToHex[arr[offset + 5]] +
17
- '-' +
18
- byteToHex[arr[offset + 6]] +
19
- byteToHex[arr[offset + 7]] +
20
- '-' +
21
- byteToHex[arr[offset + 8]] +
22
- byteToHex[arr[offset + 9]] +
23
- '-' +
24
- byteToHex[arr[offset + 10]] +
25
- byteToHex[arr[offset + 11]] +
26
- byteToHex[arr[offset + 12]] +
27
- byteToHex[arr[offset + 13]] +
28
- byteToHex[arr[offset + 14]] +
29
- byteToHex[arr[offset + 15]]).toLowerCase();
30
- }
31
-
32
- let getRandomValues;
33
- const rnds8 = new Uint8Array(16);
34
- function rng() {
35
- if (!getRandomValues) {
36
- if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
37
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
38
- }
39
- getRandomValues = crypto.getRandomValues.bind(crypto);
40
- }
41
- return getRandomValues(rnds8);
42
- }
43
-
44
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
45
- const native = { randomUUID };
46
-
47
- function v4(options, buf, offset) {
48
- if (native.randomUUID && !buf && !options) {
49
- return native.randomUUID();
50
- }
51
- options = options || {};
52
- const rnds = options.random ?? options.rng?.() ?? rng();
53
- if (rnds.length < 16) {
54
- throw new Error('Random bytes length must be >= 16');
55
- }
56
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
57
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
58
- if (buf) {
59
- offset = offset || 0;
60
- if (offset < 0 || offset + 16 > buf.length) {
61
- throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
62
- }
63
- for (let i = 0; i < 16; ++i) {
64
- buf[offset + i] = rnds[i];
65
- }
66
- return buf;
67
- }
68
- return unsafeStringify(rnds);
69
- }
6
+ const defaultIcons = {
7
+ 'search': 'fa-regular fa-magnifying-glass',
8
+ 'email': 'fa-regular fa-envelope',
9
+ 'tel': 'fa-regular fa-phone',
10
+ 'url': 'fa-regular fa-link',
11
+ 'date': 'fa-regular fa-calendar',
12
+ 'time': 'fa-regular fa-clock',
13
+ 'datetime-local': 'fa-regular fa-calendar-clock',
14
+ 'password': 'fa-regular fa-lock',
15
+ };
70
16
 
71
17
  /**
72
- * Generates a unique identifier with an optional prefix.
73
- * @param prefix - Optional prefix for the generated ID (default: 'bcm')
74
- * @returns A unique string ID in the format "prefix-uuid"
75
- * @example
76
- * const id = generateId('button'); // -> "button-123e4567-e89b..."
77
- * const defaultId = generateId(); // -> "bcm-123e4567-e89b..."
18
+ * Checks if a named slot has any content
19
+ * @param element - The host element (component instance)
20
+ * @param slotName - Name of the slot to check
21
+ * @returns boolean indicating if the slot has any assigned nodes
78
22
  */
79
- const generateId = (prefix = 'bcm') => {
80
- if (!prefix) {
81
- throw new Error('Prefix cannot be empty');
82
- }
83
- return `${prefix}-${v4()}`;
23
+ const checkSlotContent = (element, slotName) => {
24
+ var _a;
25
+ const slot = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`slot[name="${slotName}"]`);
26
+ if (!slot)
27
+ return false;
28
+ const assignedNodes = slot.assignedNodes();
29
+ return assignedNodes.length > 0;
84
30
  };
85
31
 
86
- const inputCss = ".visible{visibility:visible}.collapse{visibility:collapse}.relative{position:relative}.block{display:block}.table{display:table}.contents{display:contents}.hidden{display:none}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.border{border-width:1px}.underline{text-decoration-line:underline}.outline{outline-style:solid}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid oklch(.928 .006 264.531);box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:oklch(.707 .022 261.325);opacity:1}input::placeholder,textarea::placeholder{color:oklch(.707 .022 261.325);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{display:inline-block}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.flex{display:flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.w-full{width:100%}.flex-1{flex:1 1 0%}.cursor-not-allowed{cursor:not-allowed}.appearance-none{appearance:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.border-0{border-width:0}.border-solid{border-style:solid}.border-\\[--bcm-ui-color-border-default\\]{border-color:var(--bcm-ui-color-border-default)}.bg-\\[--bcm-ui-color-background-base-default\\]{background-color:var(--bcm-ui-color-background-base-default)}.bg-transparent{background-color:transparent}.px-3{padding-left:.75rem;padding-right:.75rem}.font-sans{font-family:Inter,sans-serif}.text-size-3{font-size:var(--bcm-ui-font-size-3,12px);line-height:var(--bcm-ui-line-height-3,16px)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.text-\\[--bcm-ui-color-text-default\\]{color:var(--bcm-ui-color-text-default)}.text-color-caption{color:var(--bcm-ui-color-text-caption)}.text-color-disabled{color:var(--bcm-ui-color-text-disabled)}.text-color-error{color:var(--bcm-ui-color-text-error)}.text-color-info{color:var(--bcm-ui-color-text-info)}.text-color-label{color:var(--bcm-ui-color-text-label)}.text-color-success{color:var(--bcm-ui-color-text-success)}.text-color-warning{color:var(--bcm-ui-color-text-warning)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-0{outline-width:0}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.placeholder\\:font-normal::placeholder{font-weight:400}.placeholder\\:text-\\[--bcm-ui-color-text-placeholder\\]::placeholder{color:var(--bcm-ui-color-text-placeholder)}";
32
+ const inputCss = ".visible{visibility:visible}.collapse{visibility:collapse}.relative{position:relative}.block{display:block}.table{display:table}.contents{display:contents}.hidden{display:none}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize{resize:both}.border{border-width:1px}.underline{text-decoration-line:underline}.outline{outline-style:solid}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid oklch(.928 .006 264.531);box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Inter,sans-serif;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:oklch(.707 .022 261.325);opacity:1}input::placeholder,textarea::placeholder{color:oklch(.707 .022 261.325);opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:host{display:inline-block}.bcm-ui-element{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,sans-serif}.static{position:static}.mt-1{margin-top:.25rem}.flex{display:flex}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-8{height:2rem}.w-full{width:100%}.flex-1{flex:1 1 0%}.cursor-not-allowed{cursor:not-allowed}.appearance-none{appearance:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.border-0{border-width:0}.border-solid{border-style:solid}.border-\\[--bcm-ui-color-border-default\\]{border-color:var(--bcm-ui-color-border-default)}.border-\\[--bcm-ui-color-border-error\\]{border-color:var(--bcm-ui-color-border-error)}.border-\\[--bcm-ui-color-border-info\\]{border-color:var(--bcm-ui-color-border-info)}.border-\\[--bcm-ui-color-border-success\\]{border-color:var(--bcm-ui-color-border-success)}.border-\\[--bcm-ui-color-border-warning\\]{border-color:var(--bcm-ui-color-border-warning)}.bg-\\[--bcm-ui-color-background-base-default\\]{background-color:var(--bcm-ui-color-background-base-default)}.bg-transparent{background-color:transparent}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.font-sans{font-family:Inter,sans-serif}.text-size-3{font-size:var(--bcm-ui-font-size-3,12px);line-height:var(--bcm-ui-line-height-3,16px)}.text-size-4{font-size:var(--bcm-ui-font-size-4,14px);line-height:var(--bcm-ui-line-height-4,20px)}.text-size-5{font-size:var(--bcm-ui-font-size-5,16px);line-height:var(--bcm-ui-line-height-5,24px)}.text-size-6{font-size:var(--bcm-ui-font-size-6,18px);line-height:var(--bcm-ui-line-height-6,24px)}.font-medium{font-weight:500}.text-\\[--bcm-ui-color-text-caption\\]{color:var(--bcm-ui-color-text-caption)}.text-\\[--bcm-ui-color-text-default\\]{color:var(--bcm-ui-color-text-default)}.text-\\[--bcm-ui-color-text-disabled\\]{color:var(--bcm-ui-color-text-disabled)}.text-\\[--bcm-ui-color-text-error\\]{color:var(--bcm-ui-color-text-error)}.text-\\[--bcm-ui-color-text-info\\]{color:var(--bcm-ui-color-text-info)}.text-\\[--bcm-ui-color-text-success\\]{color:var(--bcm-ui-color-text-success)}.text-\\[--bcm-ui-color-text-warning\\]{color:var(--bcm-ui-color-text-warning)}.text-color-disabled{color:var(--bcm-ui-color-text-disabled)}.text-color-label{color:var(--bcm-ui-color-text-label)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-0{outline-width:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.placeholder\\:font-normal::placeholder{font-weight:400}.placeholder\\:text-\\[--bcm-ui-color-text-placeholder\\]::placeholder{color:var(--bcm-ui-color-text-placeholder)}.hover\\:border-\\[--bcm-ui-color-border-error\\]:hover{border-color:var(--bcm-ui-color-border-error)}.hover\\:border-\\[--bcm-ui-color-border-info\\]:hover{border-color:var(--bcm-ui-color-border-info)}.hover\\:border-\\[--bcm-ui-color-border-primary\\]:hover{border-color:var(--bcm-ui-color-border-primary)}.hover\\:border-\\[--bcm-ui-color-border-success\\]:hover{border-color:var(--bcm-ui-color-border-success)}.hover\\:border-\\[--bcm-ui-color-border-warning\\]:hover{border-color:var(--bcm-ui-color-border-warning)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-error\\]:has(:focus){border-color:var(--bcm-ui-color-border-error)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-info\\]:has(:focus){border-color:var(--bcm-ui-color-border-info)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-primary\\]:has(:focus){border-color:var(--bcm-ui-color-border-primary)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-success\\]:has(:focus){border-color:var(--bcm-ui-color-border-success)}.has-\\[\\:focus\\]\\:border-\\[--bcm-ui-color-border-warning\\]:has(:focus){border-color:var(--bcm-ui-color-border-warning)}";
87
33
  const BcmInputStyle0 = inputCss;
88
34
 
89
35
  const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
@@ -98,6 +44,8 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
98
44
  this.bcmKeyDown = createEvent(this, "bcmKeyDown", 1);
99
45
  this.bcmKeyUp = createEvent(this, "bcmKeyUp", 1);
100
46
  this.isFocused = false;
47
+ this.isValid = true;
48
+ this.internalStatus = 'default';
101
49
  /** Input value */
102
50
  this.value = '';
103
51
  /** Input id */
@@ -116,10 +64,15 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
116
64
  this.readonly = false;
117
65
  /** Whether the input is required */
118
66
  this.required = false;
67
+ /** Whether to use native form validation
68
+ * If false, component will handle validation internally
69
+ */
70
+ this.useNativeValidation = true;
119
71
  this.onInput = (event) => {
120
72
  const input = event.target;
121
73
  this.value = input.value;
122
74
  this.bcmInput.emit(event);
75
+ this.validateInput();
123
76
  };
124
77
  this.onChange = (event) => {
125
78
  this.bcmChange.emit(event);
@@ -131,6 +84,7 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
131
84
  this.onBlur = (event) => {
132
85
  this.isFocused = false;
133
86
  this.bcmBlur.emit(event);
87
+ this.validateInput();
134
88
  };
135
89
  this.onKeyDown = (event) => {
136
90
  this.bcmKeyDown.emit(event);
@@ -142,10 +96,11 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
142
96
  slots: {
143
97
  base: [
144
98
  'bcm-input bcm-input__container',
145
- 'bg-[--bcm-ui-color-background-base-default] border-[--bcm-ui-color-border-default]',
99
+ 'bg-[--bcm-ui-color-background-base-default]',
146
100
  'border border-solid rounded',
147
- 'flex items-center justify-between gap-2',
148
- // 'px-3',
101
+ 'flex items-center justify-between',
102
+ 'transition-colors duration-200',
103
+ 'px-2',
149
104
  ],
150
105
  inputClass: [
151
106
  'input',
@@ -154,21 +109,39 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
154
109
  'appearance-none text-ellipsis',
155
110
  'text-[--bcm-ui-color-text-default] placeholder:text-[--bcm-ui-color-text-placeholder] placeholder:font-normal',
156
111
  'font-sans antialiased font-medium',
112
+ 'px-1',
157
113
  ],
158
114
  },
159
115
  variants: {
160
116
  size: {
161
117
  small: {
162
118
  base: '',
163
- inputClass: 'text-size-4 px-3 h-6',
119
+ inputClass: 'text-size-4 h-6',
164
120
  },
165
121
  medium: {
166
122
  base: '',
167
- inputClass: 'text-size-5 px-3 h-8',
123
+ inputClass: 'text-size-5 h-8',
168
124
  },
169
125
  large: {
170
126
  base: '',
171
- inputClass: 'text-size-6 px-3 h-10',
127
+ inputClass: 'text-size-6 h-10',
128
+ },
129
+ },
130
+ status: {
131
+ default: {
132
+ base: ['border-[--bcm-ui-color-border-default]', 'hover:border-[--bcm-ui-color-border-primary]', 'has-[:focus]:border-[--bcm-ui-color-border-primary]'],
133
+ },
134
+ error: {
135
+ base: ['border-[--bcm-ui-color-border-error]', 'hover:border-[--bcm-ui-color-border-error]', 'has-[:focus]:border-[--bcm-ui-color-border-error]'],
136
+ },
137
+ success: {
138
+ base: ['border-[--bcm-ui-color-border-success]', 'hover:border-[--bcm-ui-color-border-success]', 'has-[:focus]:border-[--bcm-ui-color-border-success]'],
139
+ },
140
+ warning: {
141
+ base: ['border-[--bcm-ui-color-border-warning]', 'hover:border-[--bcm-ui-color-border-warning]', 'has-[:focus]:border-[--bcm-ui-color-border-warning]'],
142
+ },
143
+ info: {
144
+ base: ['border-[--bcm-ui-color-border-info]', 'hover:border-[--bcm-ui-color-border-info]', 'has-[:focus]:border-[--bcm-ui-color-border-info]'],
172
145
  },
173
146
  },
174
147
  fullWidth: {
@@ -180,12 +153,13 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
180
153
  },
181
154
  focused: {
182
155
  true: {
183
- base: 'ring',
156
+ base: '',
184
157
  },
185
158
  },
186
159
  },
187
160
  defaultVariants: {
188
161
  size: 'medium',
162
+ status: 'default',
189
163
  fullWidth: false,
190
164
  disabled: false,
191
165
  focused: false,
@@ -199,6 +173,12 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
199
173
  this.inputRef.value = newValue;
200
174
  }
201
175
  }
176
+ watchStatus(newValue) {
177
+ this.internalStatus = newValue;
178
+ }
179
+ watchErrorMessage(newValue) {
180
+ this.internalErrorMessage = newValue;
181
+ }
202
182
  async setFocus() {
203
183
  var _a;
204
184
  (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.focus();
@@ -211,43 +191,117 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
211
191
  var _a;
212
192
  (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.select();
213
193
  }
214
- // private inputStyles = {
215
- // '--bcm-input-bg': `var(--bcm-ui-color-background-${this.status}-default)`,
216
- // '--bcm-button-bg-hover': `var(--bcm-ui-color-background-${this.status}-hover)`,
217
- // '--bcm-button-bg-active': `var(--bcm-ui-color-background-${this.status}-active)`,
218
- // '--bcm-button-border': 'transparent',
219
- // '--bcm-button-text': 'var(--bcm-ui-color-text-base)',
220
- // };
194
+ /** Sets locale and messages for all inputs */
195
+ async setLocale(locale, messages) {
196
+ // Set messages and update validation immediately
197
+ setValidationMessages(locale, messages);
198
+ // Mevcut validasyon mesajını güncelle
199
+ if (!this.isValid) {
200
+ this.validateInput();
201
+ }
202
+ }
203
+ componentWillLoad() {
204
+ // I18n için default mesajları set et
205
+ setValidationMessages('en', defaultValidationMessages);
206
+ this.internalStatus = this.status;
207
+ this.internalErrorMessage = this.errorMessage;
208
+ }
209
+ validateInput() {
210
+ if (!this.inputRef)
211
+ return;
212
+ // Reset validation state
213
+ this.isValid = true;
214
+ this.validationMessage = '';
215
+ const value = this.inputRef.value;
216
+ // Required check
217
+ if (this.required && !value) {
218
+ this.isValid = false;
219
+ this.validationMessage = getValidationMessage('required');
220
+ this.internalStatus = 'error';
221
+ this.internalErrorMessage = this.validationMessage;
222
+ return;
223
+ }
224
+ // Minimum length check
225
+ else if (this.minLength && value.length < this.minLength) {
226
+ this.isValid = false;
227
+ this.validationMessage = getValidationMessage('minlength', { min: this.minLength });
228
+ }
229
+ // Maximum length check
230
+ else if (this.maxLength && value.length > this.maxLength) {
231
+ this.isValid = false;
232
+ this.validationMessage = getValidationMessage('maxlength', { max: this.maxLength });
233
+ }
234
+ // Pattern check
235
+ else if (this.pattern && !new RegExp(this.pattern).test(value)) {
236
+ this.isValid = false;
237
+ this.validationMessage = getValidationMessage('pattern');
238
+ }
239
+ // Email check
240
+ else if (this.type === 'email' && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
241
+ this.isValid = false;
242
+ this.validationMessage = getValidationMessage('email');
243
+ }
244
+ // Number range check
245
+ else if (this.type === 'number' && value) {
246
+ const numValue = parseFloat(value);
247
+ if (this.min !== undefined && numValue < this.min) {
248
+ this.isValid = false;
249
+ this.validationMessage = getValidationMessage('min', { min: this.min });
250
+ }
251
+ else if (this.max !== undefined && numValue > this.max) {
252
+ this.isValid = false;
253
+ this.validationMessage = getValidationMessage('max', { max: this.max });
254
+ }
255
+ }
256
+ // Update component state
257
+ this.internalStatus = this.isValid ? 'default' : 'error';
258
+ this.internalErrorMessage = this.validationMessage;
259
+ }
260
+ hasSlotContent(slotName) {
261
+ return checkSlotContent(this.el, slotName);
262
+ }
263
+ getDefaultIconForType() {
264
+ return defaultIcons[this.type];
265
+ }
221
266
  render() {
222
267
  const inputId = this._id + '-input' || this.name;
223
268
  const { base, inputClass } = this.styleClass({
224
269
  size: this.size,
270
+ status: this.internalStatus,
225
271
  fullWidth: this.fullWidth,
226
272
  disabled: this.disabled,
227
273
  focused: this.isFocused,
228
274
  });
229
- return (h("div", { key: '4e8b381764b3bf96ccd8e8506286d0e88e989a30', class: "bcm-ui-element" }, this.label && (h("label", { key: 'dc213a515a6596e388b4a60c23c498f8bdd22247', class: cs('input-label font-medium', {
275
+ const iconSize = {
276
+ small: 14,
277
+ medium: 16,
278
+ large: 18,
279
+ }[this.size];
280
+ return (h("div", { key: '2d734e68473e991fa5bf264a000387a7e8c6d806', class: "bcm-ui-element" }, this.label && (h("label", { key: 'ed2362eae0dbedb6ab360d8c8e437a3ca282b0ea', class: classNames('input-label font-medium', {
230
281
  'text-color-label': !this.disabled,
231
282
  'text-color-disabled': this.disabled,
232
283
  }, {
233
284
  'text-size-3': this.size === 'small',
234
285
  'text-size-4': this.size === 'medium',
235
286
  'text-size-5': this.size === 'large',
236
- }), htmlFor: inputId }, h("slot", { key: '513585e5000edf7f7f9e3ff73241b7203e3433a3', name: "label" }, this.label), this.required && h("span", { key: '5ffc16ce50aa435033518ce1b7a2e616150f99ca' }, "*"))), h("div", { key: '3a9d0bdbc9d1d6949a05088c889d7feb2fa6d64b', class: base() }, h("slot", { key: '3d10c90faeb1ee767de8f5261551c8bd62652856', name: "prefix" }), this.prefixIcon && h("bcm-icon", { key: 'e4e01b842c49cac8da1f2ac2e37a80311caa32d3', class: "prefix-icon", "icon-name": this.prefixIcon }), h("input", { key: '17d404e0e63f2b89ad1be1a564c0a462e76bbd72', ref: el => (this.inputRef = el), id: inputId, class: inputClass(), type: this.type, name: this.name, disabled: this.disabled, readonly: this.readonly, required: this.required, placeholder: this.placeholder, autocomplete: this.autocomplete, minlength: this.minLength, maxlength: this.maxLength, min: this.min, max: this.max, step: this.step, pattern: this.pattern, "aria-invalid": this.status === 'error', "aria-required": this.required, "aria-labelledby": this.labelledby, "aria-describedby": this.describedby, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, onKeyUp: this.onKeyUp }), this.suffixIcon && h("bcm-icon", { key: '293c7b2d1853bb86c7733d70201817b5c809f645', class: "suffix-icon", "icon-name": this.suffixIcon }), h("slot", { key: '0ccd4968dbeeff480e452c23fb10913df8436dc6', name: "suffix" })), (this.captionText || this.errorMessage) && (h("div", { key: '30f7cd413c012c755dd0297d252afacf1405c1fb', class: cs('input-caption-text font-regular', {
237
- 'text-color-caption': !this.disabled && this.status === 'default',
238
- 'text-color-error': !this.disabled && this.status === 'error',
239
- 'text-color-success': !this.disabled && this.status === 'success',
240
- 'text-color-warning': !this.disabled && this.status === 'warning',
241
- 'text-color-info': !this.disabled && this.status === 'info',
242
- 'text-color-disabled': this.disabled,
287
+ }), htmlFor: inputId }, h("slot", { key: '9ef244524cbe01412d7860c4bb1842f8d3b58fdd', name: "label" }, this.label), this.required && h("span", { key: '411c0522038e0dba40bc2b335c5298dd1e538fcc' }, "*"))), h("div", { key: '567dbda203fba555203af092175165b32282c98b', class: base() }, (this.hasSlotContent('prefix') || this.prefixIcon || this.getDefaultIconForType()) && (h("div", { key: 'cc1073ccc66a13fb0bd8a21fcd5507755a2985a4', class: "flex items-center gap-2 px-2" }, (this.prefixIcon || this.getDefaultIconForType()) && (h("bcm-icon", { key: '10af5ceee34923e96229b1c0cb3acfc82c042fbe', class: "prefix-icon", "icon-name": this.prefixIcon || this.getDefaultIconForType(), size: iconSize })), h("slot", { key: '64677d561c6b8b909f3332c831c780c8213b192f', name: "prefix" }))), h("input", { key: 'e1cf6364100bb073b20fc7d0989e8d92c9dc41e8', ref: el => (this.inputRef = el), id: inputId, class: inputClass(), type: this.type, name: this.name, disabled: this.disabled, readonly: this.readonly, required: this.required, placeholder: this.placeholder, autocomplete: this.autocomplete, minlength: this.minLength, maxlength: this.maxLength, min: this.min, max: this.max, step: this.step, pattern: this.pattern, "aria-invalid": this.status === 'error', "aria-required": this.required, "aria-labelledby": this.labelledby, "aria-describedby": this.describedby, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onKeyDown: this.onKeyDown, onKeyUp: this.onKeyUp }), (this.hasSlotContent('suffix') || this.suffixIcon) && (h("div", { key: 'a3b5e1bd54d8c4a326c71e0f6a955fcbeeec9723', class: "flex items-center gap-2 px-2" }, h("slot", { key: 'a90f3f8ccb5f82f85f726c714aa1a4f70c1fcecd', name: "suffix" }), this.suffixIcon && h("bcm-icon", { key: '6551bd6154e1f15906dfc098362d8f3269bda7f2', class: "suffix-icon", "icon-name": this.suffixIcon, size: iconSize })))), (this.captionText || this.internalErrorMessage || this.validationMessage) && (h("div", { key: '1d34fb86e2637d52ed5500e1a1906023fb084c78', class: classNames('input-caption-text font-regular mt-1', {
288
+ 'text-[--bcm-ui-color-text-caption]': !this.disabled && this.internalStatus === 'default',
289
+ 'text-[--bcm-ui-color-text-error]': !this.disabled && (this.internalStatus === 'error' || !this.isValid),
290
+ 'text-[--bcm-ui-color-text-success]': !this.disabled && this.internalStatus === 'success',
291
+ 'text-[--bcm-ui-color-text-warning]': !this.disabled && this.internalStatus === 'warning',
292
+ 'text-[--bcm-ui-color-text-info]': !this.disabled && this.internalStatus === 'info',
293
+ 'text-[--bcm-ui-color-text-disabled]': this.disabled,
243
294
  }, {
244
295
  'text-size-3': this.size === 'small',
245
296
  'text-size-4': this.size === 'medium',
246
297
  'text-size-5': this.size === 'large',
247
- }) }, this.status === 'error' ? this.errorMessage : this.captionText))));
298
+ }) }, !this.isValid ? this.validationMessage : this.internalStatus === 'error' ? this.internalErrorMessage : this.captionText))));
248
299
  }
300
+ get el() { return this; }
249
301
  static get watchers() { return {
250
- "value": ["handleValueChange"]
302
+ "value": ["handleValueChange"],
303
+ "status": ["watchStatus"],
304
+ "errorMessage": ["watchErrorMessage"]
251
305
  }; }
252
306
  static get style() { return BcmInputStyle0; }
253
307
  }, [1, "bcm-input", {
@@ -276,12 +330,21 @@ const BcmInput$1 = /*@__PURE__*/ proxyCustomElement(class BcmInput extends H {
276
330
  "describedby": [1],
277
331
  "prefixIcon": [1, "prefix-icon"],
278
332
  "suffixIcon": [1, "suffix-icon"],
333
+ "useNativeValidation": [4, "use-native-validation"],
334
+ "validator": [16],
279
335
  "isFocused": [32],
336
+ "validationMessage": [32],
337
+ "isValid": [32],
338
+ "internalStatus": [32],
339
+ "internalErrorMessage": [32],
280
340
  "setFocus": [64],
281
341
  "setBlur": [64],
282
- "select": [64]
342
+ "select": [64],
343
+ "setLocale": [64]
283
344
  }, undefined, {
284
- "value": ["handleValueChange"]
345
+ "value": ["handleValueChange"],
346
+ "status": ["watchStatus"],
347
+ "errorMessage": ["watchErrorMessage"]
285
348
  }]);
286
349
  function defineCustomElement$1() {
287
350
  if (typeof customElements === "und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AAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;gBACjE,oBAAoB,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;gBACjE,iBAAiB,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM;gBAC3D,qBAAqB,EAAE,IAAI,CAAC,QAAQ;aACrC,EACD;gBACE,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;gBACpC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACrC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;aACrC,CACF,IAEA,IAAI,CAAC,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAC3D,CACP,CACG,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["uuidv4","BcmInput","tv","classNames"],"sources":["node_modules/uuid/dist/esm-browser/stringify.js","node_modules/uuid/dist/esm-browser/rng.js","node_modules/uuid/dist/esm-browser/native.js","node_modules/uuid/dist/esm-browser/v4.js","src/utils/id/generate-id.ts","src/components/input/input.scss?tag=bcm-input&encapsulation=shadow","src/components/input/input.component.tsx"],"sourcesContent":["import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n","import { v4 as uuidv4 } from 'uuid';\n\n/**\n * Generates a unique identifier with an optional prefix.\n * @param prefix - Optional prefix for the generated ID (default: 'bcm')\n * @returns A unique string ID in the format \"prefix-uuid\"\n * @example\n * const id = generateId('button'); // -> \"button-123e4567-e89b...\"\n * const defaultId = generateId(); // -> \"bcm-123e4567-e89b...\"\n */\nexport const generateId = (prefix = 'bcm'): string => {\n if (!prefix) {\n throw new Error('Prefix cannot be empty');\n }\n return `${prefix}-${uuidv4()}`;\n};\n",":host {\n display: inline-block;\n}\n","import { Component, Prop, h, Event, EventEmitter, Method, State, Watch } from '@stencil/core';\nimport { InputSize, InputStatus, InputType } from './types';\nimport { tv } from 'tailwind-variants';\nimport classNames from 'classnames';\nimport { generateId } from '../../utils/id/generate-id';\n\n@Component({\n tag: 'bcm-input',\n styleUrl: 'input.scss',\n shadow: true,\n})\nexport class BcmInput {\n private inputRef: HTMLInputElement;\n\n @State() isFocused = false;\n\n /** Input value */\n @Prop({ mutable: true, reflect: true })\n value: string = '';\n\n /** Input placeholder text */\n @Prop()\n placeholder?: string;\n\n /** Input name */\n @Prop()\n name?: string;\n\n /** Input id */\n @Prop({ attribute: 'id', reflect: true })\n _id?: string = generateId('input');\n\n /** Controls the input size */\n @Prop()\n size: InputSize = 'medium';\n\n /** Defines the input's status/state */\n @Prop()\n status: InputStatus = 'default';\n\n /** Full width input */\n @Prop({ attribute: 'full-width', reflect: true })\n fullWidth = false;\n\n /** HTML input type */\n @Prop()\n type: InputType = 'text';\n\n /** Whether the input is disabled */\n @Prop()\n disabled = false;\n\n /** Whether the input is readonly */\n @Prop()\n readonly = false;\n\n /** Whether the input is required */\n @Prop()\n required = false;\n\n /** Input autocomplete attribute */\n @Prop()\n autocomplete?: string;\n\n /** Min length for text input */\n @Prop()\n minLength?: number;\n\n /** Max length for text input */\n @Prop()\n maxLength?: number;\n\n /** Min value for number input */\n @Prop()\n min?: number;\n\n /** Max value for number input */\n @Prop()\n max?: number;\n\n /** Step value for number input */\n @Prop()\n step?: number;\n\n /** Pattern for validation */\n @Prop()\n pattern?: string;\n\n /** Input label for accessibility */\n @Prop()\n label?: string;\n\n /** Error message to display */\n @Prop()\n errorMessage?: string;\n\n /** Caption text to display below input */\n @Prop()\n captionText?: string;\n\n /** ID of associated label element */\n @Prop()\n labelledby?: string;\n\n /** ID of associated caption/error text element */\n @Prop()\n describedby?: string;\n\n /** Prefix icon class name */\n @Prop()\n prefixIcon?: string;\n\n /** Suffix icon class name */\n @Prop()\n suffixIcon?: string;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmInput: EventEmitter<InputEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmChange: EventEmitter<Event>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmFocus: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmBlur: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyDown: EventEmitter<KeyboardEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyUp: EventEmitter<KeyboardEvent>;\n\n @Watch('value')\n handleValueChange(newValue: string) {\n if (this.inputRef) {\n this.inputRef.value = newValue;\n }\n }\n\n @Method()\n async setFocus() {\n this.inputRef?.focus();\n }\n\n @Method()\n async setBlur() {\n this.inputRef?.blur();\n }\n\n @Method()\n async select() {\n this.inputRef?.select();\n }\n\n private onInput = (event: InputEvent) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.bcmInput.emit(event);\n };\n\n private onChange = (event: Event) => {\n this.bcmChange.emit(event);\n };\n\n private onFocus = (event: FocusEvent) => {\n this.isFocused = true;\n this.bcmFocus.emit(event);\n };\n\n private onBlur = (event: FocusEvent) => {\n this.isFocused = false;\n this.bcmBlur.emit(event);\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n this.bcmKeyDown.emit(event);\n };\n\n private onKeyUp = (event: KeyboardEvent) => {\n this.bcmKeyUp.emit(event);\n };\n\n private styleClass = tv(\n {\n slots: {\n base: [\n 'bcm-input bcm-input__container',\n 'bg-[--bcm-ui-color-background-base-default] border-[--bcm-ui-color-border-default]',\n 'border border-solid rounded',\n 'flex items-center justify-between gap-2',\n // 'px-3',\n ],\n inputClass: [\n 'input',\n 'w-full flex-1',\n 'border-0 outline-0 bg-transparent',\n 'appearance-none text-ellipsis',\n 'text-[--bcm-ui-color-text-default] placeholder:text-[--bcm-ui-color-text-placeholder] placeholder:font-normal',\n 'font-sans antialiased font-medium',\n ],\n },\n variants: {\n size: {\n small: {\n base: '',\n inputClass: 'text-size-4 px-3 h-6',\n },\n medium: {\n base: '',\n inputClass: 'text-size-5 px-3 h-8',\n },\n large: {\n base: '',\n inputClass: 'text-size-6 px-3 h-10',\n },\n },\n fullWidth: {\n true: 'full-width w-full',\n },\n disabled: {\n true: 'disabled cursor-not-allowed',\n false: '',\n },\n focused: {\n true: {\n base: 'ring',\n },\n },\n },\n defaultVariants: {\n size: 'medium',\n fullWidth: false,\n disabled: false,\n focused: false,\n },\n },\n {\n twMerge: false,\n },\n );\n\n // private inputStyles = {\n // '--bcm-input-bg': `var(--bcm-ui-color-background-${this.status}-default)`,\n // '--bcm-button-bg-hover': `var(--bcm-ui-color-background-${this.status}-hover)`,\n // '--bcm-button-bg-active': `var(--bcm-ui-color-background-${this.status}-active)`,\n // '--bcm-button-border': 'transparent',\n // '--bcm-button-text': 'var(--bcm-ui-color-text-base)',\n // };\n\n render() {\n const inputId = this._id + '-input' || this.name;\n\n const { base, inputClass } = this.styleClass({\n size: this.size,\n fullWidth: this.fullWidth,\n disabled: this.disabled,\n focused: this.isFocused,\n });\n\n return (\n <div class=\"bcm-ui-element\">\n {this.label && (\n <label\n class={classNames(\n 'input-label font-medium',\n {\n 'text-color-label': !this.disabled,\n 'text-color-disabled': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n htmlFor={inputId}\n >\n <slot name=\"label\">{this.label}</slot>\n {this.required && <span>*</span>}\n </label>\n )}\n\n <div class={base()}>\n <slot name=\"prefix\"></slot>\n {this.prefixIcon && <bcm-icon class=\"prefix-icon\" icon-name={this.prefixIcon}></bcm-icon>}\n <input\n ref={el => (this.inputRef = el)}\n id={inputId}\n class={inputClass()}\n type={this.type}\n name={this.name}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n placeholder={this.placeholder}\n autocomplete={this.autocomplete}\n minlength={this.minLength}\n maxlength={this.maxLength}\n min={this.min}\n max={this.max}\n step={this.step}\n pattern={this.pattern}\n aria-invalid={this.status === 'error'}\n aria-required={this.required}\n aria-labelledby={this.labelledby}\n aria-describedby={this.describedby}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyDown={this.onKeyDown}\n onKeyUp={this.onKeyUp}\n />\n {this.suffixIcon && <bcm-icon class=\"suffix-icon\" icon-name={this.suffixIcon}></bcm-icon>}\n <slot name=\"suffix\"></slot>\n </div>\n {(this.captionText || this.errorMessage) && (\n <div\n class={classNames(\n 'input-caption-text font-regular',\n {\n 'text-color-caption': !this.disabled && this.status === 'default',\n 'text-color-error': !this.disabled && this.status === 'error',\n 'text-color-success': !this.disabled && this.status === 'success',\n 'text-color-warning': !this.disabled && this.status === 'warning',\n 'text-color-info': !this.disabled && this.status === 'info',\n 'text-color-disabled': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n >\n {this.status === 'error' ? this.errorMessage : this.captionText}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bcm-input.js","mappings":";;;;;AAIO,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,gCAAgC;IAC1C,OAAO,EAAE,wBAAwB;IACjC,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,oBAAoB;IAC3B,MAAM,EAAE,wBAAwB;IAChC,MAAM,EAAE,qBAAqB;IAC7B,gBAAgB,EAAE,8BAA8B;IAChD,UAAU,EAAE,oBAAoB;CACxB;;ACbV;;;;;;AAMO,MAAM,gBAAgB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,KAAK,OAAO;gBACpC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;gBACrC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;aACrC,CACF,IAEA,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc,KAAK,OAAO,GAAG,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,WAAW,CACpH,CACP,CACG,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BcmInput","tv"],"sources":["src/components/input/types.ts","src/utils/slot/check-slot-content.ts","src/components/input/input.scss?tag=bcm-input&encapsulation=shadow","src/components/input/input.component.tsx"],"sourcesContent":["export type InputSize = 'small' | 'medium' | 'large';\nexport type InputStatus = 'default' | 'error' | 'success' | 'warning' | 'info';\nexport type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local';\n\nexport const defaultIcons = {\n 'search': 'fa-regular fa-magnifying-glass',\n 'email': 'fa-regular fa-envelope',\n 'tel': 'fa-regular fa-phone',\n 'url': 'fa-regular fa-link',\n 'date': 'fa-regular fa-calendar',\n 'time': 'fa-regular fa-clock',\n 'datetime-local': 'fa-regular fa-calendar-clock',\n 'password': 'fa-regular fa-lock',\n} as const;\n","/**\n * Checks if a named slot has any content\n * @param element - The host element (component instance)\n * @param slotName - Name of the slot to check\n * @returns boolean indicating if the slot has any assigned nodes\n */\nexport const checkSlotContent = (element: HTMLElement, slotName: string): boolean => {\n const slot = element.shadowRoot?.querySelector(`slot[name=\"${slotName}\"]`) as HTMLSlotElement;\n if (!slot) return false;\n\n const assignedNodes = slot.assignedNodes();\n return assignedNodes.length > 0;\n};\n",":host {\n display: inline-block;\n}\n","import { Component, Prop, h, Event, EventEmitter, Method, State, Watch, Element } from '@stencil/core';\nimport { InputSize, InputStatus, InputType, defaultIcons } from './types';\nimport { tv } from 'tailwind-variants';\nimport classNames from 'classnames';\nimport { generateId } from '../../utils/id/generate-id';\nimport { checkSlotContent } from '../../utils/slot/check-slot-content';\nimport { getValidationMessage, setValidationMessages, defaultValidationMessages } from '../../utils/validation-messages';\n\n@Component({\n tag: 'bcm-input',\n styleUrl: 'input.scss',\n shadow: true,\n})\nexport class BcmInput {\n @Element() el: HTMLElement;\n private inputRef: HTMLInputElement;\n\n @State() isFocused = false;\n @State() validationMessage: string;\n @State() isValid = true;\n @State() internalStatus: InputStatus = 'default';\n @State() internalErrorMessage: string;\n\n /** Input value */\n @Prop({ mutable: true, reflect: true })\n value: string = '';\n\n /** Input placeholder text */\n @Prop()\n placeholder?: string;\n\n /** Input name */\n @Prop()\n name?: string;\n\n /** Input id */\n @Prop({ attribute: 'id', reflect: true })\n _id?: string = generateId('input');\n\n /** Controls the input size */\n @Prop()\n size: InputSize = 'medium';\n\n /** Defines the input's status/state */\n @Prop()\n status: InputStatus = 'default';\n\n /** Full width input */\n @Prop({ attribute: 'full-width', reflect: true })\n fullWidth = false;\n\n /** HTML input type */\n @Prop()\n type: InputType = 'text';\n\n /** Whether the input is disabled */\n @Prop()\n disabled = false;\n\n /** Whether the input is readonly */\n @Prop()\n readonly = false;\n\n /** Whether the input is required */\n @Prop()\n required = false;\n\n /** Input autocomplete attribute */\n @Prop()\n autocomplete?: string;\n\n /** Min length for text input */\n @Prop()\n minLength?: number;\n\n /** Max length for text input */\n @Prop()\n maxLength?: number;\n\n /** Min value for number input */\n @Prop()\n min?: number;\n\n /** Max value for number input */\n @Prop()\n max?: number;\n\n /** Step value for number input */\n @Prop()\n step?: number;\n\n /** Pattern for validation */\n @Prop()\n pattern?: string;\n\n /** Input label for accessibility */\n @Prop()\n label?: string;\n\n /** Error message to display */\n @Prop()\n errorMessage?: string;\n\n /** Caption text to display below input */\n @Prop()\n captionText?: string;\n\n /** ID of associated label element */\n @Prop()\n labelledby?: string;\n\n /** ID of associated caption/error text element */\n @Prop()\n describedby?: string;\n\n /** Prefix icon class name */\n @Prop()\n prefixIcon?: string;\n\n /** Suffix icon class name */\n @Prop()\n suffixIcon?: string;\n\n /** Whether to use native form validation\n * If false, component will handle validation internally\n */\n @Prop()\n useNativeValidation = true;\n\n /** Custom validation function */\n @Prop()\n validator?: (value: string) => string | undefined;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmInput: EventEmitter<InputEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmChange: EventEmitter<Event>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmFocus: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmBlur: EventEmitter<FocusEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyDown: EventEmitter<KeyboardEvent>;\n\n @Event({\n composed: false,\n bubbles: false,\n cancelable: true,\n })\n bcmKeyUp: EventEmitter<KeyboardEvent>;\n\n @Watch('value')\n handleValueChange(newValue: string) {\n if (this.inputRef) {\n this.inputRef.value = newValue;\n }\n }\n\n @Watch('status')\n watchStatus(newValue: InputStatus) {\n this.internalStatus = newValue;\n }\n\n @Watch('errorMessage')\n watchErrorMessage(newValue: string) {\n this.internalErrorMessage = newValue;\n }\n\n @Method()\n async setFocus() {\n this.inputRef?.focus();\n }\n\n @Method()\n async setBlur() {\n this.inputRef?.blur();\n }\n\n @Method()\n async select() {\n this.inputRef?.select();\n }\n\n /** Sets locale and messages for all inputs */\n @Method()\n async setLocale(locale: string, messages: Record<string, string>) {\n // Set messages and update validation immediately\n setValidationMessages(locale, messages);\n\n // Mevcut validasyon mesajını güncelle\n if (!this.isValid) {\n this.validateInput();\n }\n }\n\n componentWillLoad() {\n // I18n için default mesajları set et\n setValidationMessages('en', defaultValidationMessages);\n this.internalStatus = this.status;\n this.internalErrorMessage = this.errorMessage;\n }\n\n private validateInput(): void {\n if (!this.inputRef) return;\n\n // Reset validation state\n this.isValid = true;\n this.validationMessage = '';\n\n const value = this.inputRef.value;\n\n // Required check\n if (this.required && !value) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('required');\n this.internalStatus = 'error';\n this.internalErrorMessage = this.validationMessage;\n return;\n }\n\n // Minimum length check\n else if (this.minLength && value.length < this.minLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('minlength', { min: this.minLength });\n }\n // Maximum length check\n else if (this.maxLength && value.length > this.maxLength) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('maxlength', { max: this.maxLength });\n }\n // Pattern check\n else if (this.pattern && !new RegExp(this.pattern).test(value)) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('pattern');\n }\n // Email check\n else if (this.type === 'email' && value && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('email');\n }\n // Number range check\n else if (this.type === 'number' && value) {\n const numValue = parseFloat(value);\n if (this.min !== undefined && numValue < this.min) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('min', { min: this.min });\n } else if (this.max !== undefined && numValue > this.max) {\n this.isValid = false;\n this.validationMessage = getValidationMessage('max', { max: this.max });\n }\n }\n\n // Update component state\n this.internalStatus = this.isValid ? 'default' : 'error';\n this.internalErrorMessage = this.validationMessage;\n }\n\n private onInput = (event: InputEvent) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.bcmInput.emit(event);\n this.validateInput();\n };\n\n private onChange = (event: Event) => {\n this.bcmChange.emit(event);\n };\n\n private onFocus = (event: FocusEvent) => {\n this.isFocused = true;\n this.bcmFocus.emit(event);\n };\n\n private onBlur = (event: FocusEvent) => {\n this.isFocused = false;\n this.bcmBlur.emit(event);\n this.validateInput();\n };\n\n private onKeyDown = (event: KeyboardEvent) => {\n this.bcmKeyDown.emit(event);\n };\n\n private onKeyUp = (event: KeyboardEvent) => {\n this.bcmKeyUp.emit(event);\n };\n\n private hasSlotContent(slotName: string): boolean {\n return checkSlotContent(this.el, slotName);\n }\n\n private styleClass = tv(\n {\n slots: {\n base: [\n 'bcm-input bcm-input__container',\n 'bg-[--bcm-ui-color-background-base-default]',\n 'border border-solid rounded',\n 'flex items-center justify-between',\n 'transition-colors duration-200',\n 'px-2',\n ],\n inputClass: [\n 'input',\n 'w-full flex-1',\n 'border-0 outline-0 bg-transparent',\n 'appearance-none text-ellipsis',\n 'text-[--bcm-ui-color-text-default] placeholder:text-[--bcm-ui-color-text-placeholder] placeholder:font-normal',\n 'font-sans antialiased font-medium',\n 'px-1',\n ],\n },\n variants: {\n size: {\n small: {\n base: '',\n inputClass: 'text-size-4 h-6',\n },\n medium: {\n base: '',\n inputClass: 'text-size-5 h-8',\n },\n large: {\n base: '',\n inputClass: 'text-size-6 h-10',\n },\n },\n status: {\n default: {\n base: ['border-[--bcm-ui-color-border-default]', 'hover:border-[--bcm-ui-color-border-primary]', 'has-[:focus]:border-[--bcm-ui-color-border-primary]'],\n },\n error: {\n base: ['border-[--bcm-ui-color-border-error]', 'hover:border-[--bcm-ui-color-border-error]', 'has-[:focus]:border-[--bcm-ui-color-border-error]'],\n },\n success: {\n base: ['border-[--bcm-ui-color-border-success]', 'hover:border-[--bcm-ui-color-border-success]', 'has-[:focus]:border-[--bcm-ui-color-border-success]'],\n },\n warning: {\n base: ['border-[--bcm-ui-color-border-warning]', 'hover:border-[--bcm-ui-color-border-warning]', 'has-[:focus]:border-[--bcm-ui-color-border-warning]'],\n },\n info: {\n base: ['border-[--bcm-ui-color-border-info]', 'hover:border-[--bcm-ui-color-border-info]', 'has-[:focus]:border-[--bcm-ui-color-border-info]'],\n },\n },\n fullWidth: {\n true: 'full-width w-full',\n },\n disabled: {\n true: 'disabled cursor-not-allowed',\n false: '',\n },\n focused: {\n true: {\n base: '',\n },\n },\n },\n defaultVariants: {\n size: 'medium',\n status: 'default',\n fullWidth: false,\n disabled: false,\n focused: false,\n },\n },\n {\n twMerge: false,\n },\n );\n\n private getDefaultIconForType(): string | undefined {\n return defaultIcons[this.type as keyof typeof defaultIcons];\n }\n\n render() {\n const inputId = this._id + '-input' || this.name;\n\n const { base, inputClass } = this.styleClass({\n size: this.size,\n status: this.internalStatus,\n fullWidth: this.fullWidth,\n disabled: this.disabled,\n focused: this.isFocused,\n });\n\n const iconSize = {\n small: 14,\n medium: 16,\n large: 18,\n }[this.size];\n\n return (\n <div class=\"bcm-ui-element\">\n {this.label && (\n <label\n class={classNames(\n 'input-label font-medium',\n {\n 'text-color-label': !this.disabled,\n 'text-color-disabled': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n htmlFor={inputId}\n >\n <slot name=\"label\">{this.label}</slot>\n {this.required && <span>*</span>}\n </label>\n )}\n\n <div class={base()}>\n {(this.hasSlotContent('prefix') || this.prefixIcon || this.getDefaultIconForType()) && (\n <div class=\"flex items-center gap-2 px-2\">\n {(this.prefixIcon || this.getDefaultIconForType()) && (\n <bcm-icon class=\"prefix-icon\" icon-name={this.prefixIcon || this.getDefaultIconForType()} size={iconSize}></bcm-icon>\n )}\n <slot name=\"prefix\"></slot>\n </div>\n )}\n <input\n ref={el => (this.inputRef = el)}\n id={inputId}\n class={inputClass()}\n type={this.type}\n name={this.name}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n placeholder={this.placeholder}\n autocomplete={this.autocomplete}\n minlength={this.minLength}\n maxlength={this.maxLength}\n min={this.min}\n max={this.max}\n step={this.step}\n pattern={this.pattern}\n aria-invalid={this.status === 'error'}\n aria-required={this.required}\n aria-labelledby={this.labelledby}\n aria-describedby={this.describedby}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyDown={this.onKeyDown}\n onKeyUp={this.onKeyUp}\n />\n {(this.hasSlotContent('suffix') || this.suffixIcon) && (\n <div class=\"flex items-center gap-2 px-2\">\n <slot name=\"suffix\"></slot>\n {this.suffixIcon && <bcm-icon class=\"suffix-icon\" icon-name={this.suffixIcon} size={iconSize}></bcm-icon>}\n </div>\n )}\n </div>\n {(this.captionText || this.internalErrorMessage || this.validationMessage) && (\n <div\n class={classNames(\n 'input-caption-text font-regular mt-1',\n {\n 'text-[--bcm-ui-color-text-caption]': !this.disabled && this.internalStatus === 'default',\n 'text-[--bcm-ui-color-text-error]': !this.disabled && (this.internalStatus === 'error' || !this.isValid),\n 'text-[--bcm-ui-color-text-success]': !this.disabled && this.internalStatus === 'success',\n 'text-[--bcm-ui-color-text-warning]': !this.disabled && this.internalStatus === 'warning',\n 'text-[--bcm-ui-color-text-info]': !this.disabled && this.internalStatus === 'info',\n 'text-[--bcm-ui-color-text-disabled]': this.disabled,\n },\n {\n 'text-size-3': this.size === 'small',\n 'text-size-4': this.size === 'medium',\n 'text-size-5': this.size === 'large',\n },\n )}\n >\n {!this.isValid ? this.validationMessage : this.internalStatus === 'error' ? this.internalErrorMessage : this.captionText}\n </div>\n )}\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
- import { p as proxyCustomElement, H, h } from './p-8ded2c73.js';
2
- import { c as cs } from './p-b36f4f44.js';
1
+ import { p as proxyCustomElement, H, h } from './p-13582168.js';
2
+ import { c as classNames } from './p-12360e4c.js';
3
3
 
4
4
  const variantTagMap = {
5
5
  display: 'h1',
@@ -107,7 +107,7 @@ const BcmText$1 = /*@__PURE__*/ proxyCustomElement(class BcmText extends H {
107
107
  render() {
108
108
  const Tag = variantTagMap[this.variant];
109
109
  const variantClass = this.getTextClass(this.variant, this.size);
110
- return (h(Tag, { key: 'be80ea42fcc903f96694e7e8a12f360e1e209a3a', class: cs('bcm-text appearance-none m-0 p-0', variantClass), part: "text" }, h("slot", { key: 'eeada28b9aad802ed2c88bb76cb297bac7c3464b' }, this.text)));
110
+ return (h(Tag, { key: 'a9ba5eeb50ec7e4bce324ae9f3e2ef91b6d68966', class: classNames('bcm-text appearance-none m-0 p-0', variantClass), part: "text" }, h("slot", { key: 'd656033433d725099f429978df47d119dba10727' }, this.text)));
111
111
  }
112
112
  static get style() { return BcmTextStyle0; }
113
113
  }, [1, "bcm-text", {
@@ -1 +1 @@
1
- {"file":"bcm-text.js","mappings":";;;AAEO,MAAM,aAAa,GAAiC;IACzD,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,GAAG;IACT,UAAU,EAAE,GAAG;IACf,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,GAAG;IAChB,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,UAAU,EAAE,GAAG;CAChB;;AClBD,MAAM,OAAO,GAAG,+7CAA+7C,CAAC;AACh9C,sBAAe,OAAO;;MCSTA,SAAO;IALpB;;;;;QAYE,YAAO,GAAgB,MAAM,CAAC;;QAI9B,SAAI,GAAa,QAAQ,CAAC;QAET,oBAAe,GAAG;YACjC,OAAO,EAAE,8CAA8C;YACvD,QAAQ,EAAE,6CAA6C;YACvD,QAAQ,EAAE,6CAA6C;YACvD,MAAM,EAAE;gBACN,KAAK,EAAE,6CAA6C;gBACpD,MAAM,EAAE,6CAA6C;gBACrD,KAAK,EAAE,6CAA6C;aACrD;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,8CAA8C;gBACrD,MAAM,EAAE,8CAA8C;gBACtD,KAAK,EAAE,8CAA8C;aACtD;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,+CAA+C;gBACtD,MAAM,EAAE,+CAA+C;gBACvD,KAAK,EAAE,+CAA+C;aACvD;YACD,IAAI,EAAE;gBACJ,KAAK,EAAE,6CAA6C;gBACpD,MAAM,EAAE,6CAA6C;gBACrD,KAAK,EAAE,6CAA6C;aACrD;YACD,UAAU,EA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EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhE,QACE,EAAC,GAAG,qDAAC,KAAK,EAAE,EAAE,CAAC,kCAAkC,EAAE,YAAY,CAAC,EAAE,IAAI,EAAC,MAAM,IAC3E,+DAAO,IAAI,CAAC,IAAI,CAAQ,CACpB,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["BcmText"],"sources":["src/components/text/text.utils.ts","src/components/text/text.scss?tag=bcm-text&encapsulation=shadow","src/components/text/text.component.tsx"],"sourcesContent":["import { TextVariant, TextTag } from './text.types';\n\nexport const variantTagMap: Record<TextVariant, TextTag> = {\n display: 'h1',\n heading1: 'h2',\n heading2: 'h3',\n title1: 'h4',\n title2: 'h5',\n title3: 'h6',\n body: 'p',\n bodyAccent: 'p',\n helper: 'p',\n caption: 'p',\n label: 'label',\n placeholder: 'p',\n link: 'a',\n info: 'p',\n infoAccent: 'p',\n};\n","","import { Component, h, Prop } from '@stencil/core';\nimport cs from 'classnames';\nimport { TextVariant, TextSize } from './text.types';\nimport { variantTagMap } from './text.utils';\n\n@Component({\n tag: 'bcm-text',\n styleUrl: 'text.scss',\n shadow: true,\n})\nexport class BcmText {\n /** Text content */\n @Prop()\n text: string;\n\n /** Text variant */\n @Prop()\n variant: TextVariant = 'body';\n\n /** Text size */\n @Prop()\n size: TextSize = 'medium';\n\n private readonly variantClassMap = {\n display: 'font-semibold text-size-12 text-color-header',\n heading1: 'font-semibold text-size-7 text-color-header',\n heading2: 'font-semibold text-size-6 text-color-header',\n title1: {\n small: 'font-semibold text-size-5 text-color-header',\n medium: 'font-semibold text-size-6 text-color-header',\n large: 'font-semibold text-size-7 text-color-header',\n },\n title2: {\n small: 'font-semibold text-size-4 text-color-default',\n medium: 'font-semibold text-size-5 text-color-default',\n large: 'font-semibold text-size-6 text-color-default',\n },\n title3: {\n small: 'font-semibold text-size-3 text-color-disabled',\n medium: 'font-semibold text-size-4 text-color-disabled',\n large: 'font-semibold text-size-5 text-color-disabled',\n },\n body: {\n small: 'font-regular text-size-4 text-color-default',\n medium: 'font-regular text-size-5 text-color-default',\n large: 'font-regular text-size-6 text-color-default',\n },\n bodyAccent: {\n small: 'font-medium text-size-4 text-color-default',\n medium: 'font-medium text-size-5 text-color-default',\n large: 'font-medium text-size-6 text-color-default',\n },\n helper: {\n small: 'font-regular text-size-4 text-color-helper',\n medium: 'font-regular text-size-5 text-color-helper',\n large: 'font-regular text-size-6 text-color-helper',\n },\n caption: {\n small: 'font-regular text-size-3 text-color-caption',\n medium: 'font-regular text-size-4 text-color-caption',\n large: 'font-regular text-size-5 text-color-caption',\n },\n link: {\n small: 'font-medium text-size-4 underline text-color-primary',\n medium: 'font-medium text-size-5 underline text-color-primary',\n large: 'font-medium text-size-6 underline text-color-primary',\n },\n label: {\n small: 'font-medium text-size-3 text-color-label',\n medium: 'font-medium text-size-4 text-color-label',\n large: 'font-medium text-size-5 text-color-label',\n },\n placeholder: {\n small: 'font-regular text-size-4 text-color-placeholder',\n medium: 'font-regular text-size-5 text-color-placeholder',\n large: 'font-regular text-size-6 text-color-placeholder',\n },\n info: {\n small: 'font-regular text-size-3 text-color-default',\n medium: 'font-regular text-size-4 text-color-default',\n large: 'font-regular text-size-5 text-color-default',\n },\n infoAccent: {\n small: 'font-medium text-size-3 text-color-header',\n medium: 'font-medium text-size-4 text-color-header',\n large: 'font-medium text-size-5 text-color-header',\n },\n } as const;\n\n private getTextClass = (variant: TextVariant, size: TextSize): string => {\n const variantClasses = this.variantClassMap[variant];\n\n if (typeof variantClasses === 'string') {\n return variantClasses;\n }\n\n return variantClasses[size];\n };\n\n render() {\n const Tag = variantTagMap[this.variant];\n const variantClass = this.getTextClass(this.variant, this.size);\n\n return (\n <Tag class={cs('bcm-text appearance-none m-0 p-0', variantClass)} part=\"text\">\n <slot>{this.text}</slot>\n </Tag>\n );\n }\n}\n"],"version":3}
1
+ {"file":"bcm-text.js","mappings":";;;AAEO,MAAM,aAAa,GAAiC;IACzD,OAAO,EAAE,IAAI;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;;;;;;;;;;;;;;;;","names":["BcmText","cs"],"sources":["src/components/text/text.utils.ts","src/components/text/text.scss?tag=bcm-text&encapsulation=shadow","src/components/text/text.component.tsx"],"sourcesContent":["import { TextVariant, TextTag } from './text.types';\n\nexport const variantTagMap: Record<TextVariant, TextTag> = {\n display: 'h1',\n heading1: 'h2',\n heading2: 'h3',\n title1: 'h4',\n title2: 'h5',\n title3: 'h6',\n body: 'p',\n bodyAccent: 'p',\n helper: 'p',\n caption: 'p',\n label: 'label',\n placeholder: 'p',\n link: 'a',\n info: 'p',\n infoAccent: 'p',\n};\n","","import { Component, h, Prop } from '@stencil/core';\nimport cs from 'classnames';\nimport { TextVariant, TextSize } from './text.types';\nimport { variantTagMap } from './text.utils';\n\n@Component({\n tag: 'bcm-text',\n styleUrl: 'text.scss',\n shadow: true,\n})\nexport class BcmText {\n /** Text content */\n @Prop()\n text: string;\n\n /** Text variant */\n @Prop()\n variant: TextVariant = 'body';\n\n /** Text size */\n @Prop()\n size: TextSize = 'medium';\n\n private readonly variantClassMap = {\n display: 'font-semibold text-size-12 text-color-header',\n heading1: 'font-semibold text-size-7 text-color-header',\n heading2: 'font-semibold text-size-6 text-color-header',\n title1: {\n small: 'font-semibold text-size-5 text-color-header',\n medium: 'font-semibold text-size-6 text-color-header',\n large: 'font-semibold text-size-7 text-color-header',\n },\n title2: {\n small: 'font-semibold text-size-4 text-color-default',\n medium: 'font-semibold text-size-5 text-color-default',\n large: 'font-semibold text-size-6 text-color-default',\n },\n title3: {\n small: 'font-semibold text-size-3 text-color-disabled',\n medium: 'font-semibold text-size-4 text-color-disabled',\n large: 'font-semibold text-size-5 text-color-disabled',\n },\n body: {\n small: 'font-regular text-size-4 text-color-default',\n medium: 'font-regular text-size-5 text-color-default',\n large: 'font-regular text-size-6 text-color-default',\n },\n bodyAccent: {\n small: 'font-medium text-size-4 text-color-default',\n medium: 'font-medium text-size-5 text-color-default',\n large: 'font-medium text-size-6 text-color-default',\n },\n helper: {\n small: 'font-regular text-size-4 text-color-helper',\n medium: 'font-regular text-size-5 text-color-helper',\n large: 'font-regular text-size-6 text-color-helper',\n },\n caption: {\n small: 'font-regular text-size-3 text-color-caption',\n medium: 'font-regular text-size-4 text-color-caption',\n large: 'font-regular text-size-5 text-color-caption',\n },\n link: {\n small: 'font-medium text-size-4 underline text-color-primary',\n medium: 'font-medium text-size-5 underline text-color-primary',\n large: 'font-medium text-size-6 underline text-color-primary',\n },\n label: {\n small: 'font-medium text-size-3 text-color-label',\n medium: 'font-medium text-size-4 text-color-label',\n large: 'font-medium text-size-5 text-color-label',\n },\n placeholder: {\n small: 'font-regular text-size-4 text-color-placeholder',\n medium: 'font-regular text-size-5 text-color-placeholder',\n large: 'font-regular text-size-6 text-color-placeholder',\n },\n info: {\n small: 'font-regular text-size-3 text-color-default',\n medium: 'font-regular text-size-4 text-color-default',\n large: 'font-regular text-size-5 text-color-default',\n },\n infoAccent: {\n small: 'font-medium text-size-3 text-color-header',\n medium: 'font-medium text-size-4 text-color-header',\n large: 'font-medium text-size-5 text-color-header',\n },\n } as const;\n\n private getTextClass = (variant: TextVariant, size: TextSize): string => {\n const variantClasses = this.variantClassMap[variant];\n\n if (typeof variantClasses === 'string') {\n return variantClasses;\n }\n\n return variantClasses[size];\n };\n\n render() {\n const Tag = variantTagMap[this.variant];\n const variantClass = this.getTextClass(this.variant, this.size);\n\n return (\n <Tag class={cs('bcm-text appearance-none m-0 p-0', variantClass)} part=\"text\">\n <slot>{this.text}</slot>\n </Tag>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface BcmTextarea extends Components.BcmTextarea, HTMLElement {}
4
+ export const BcmTextarea: {
5
+ prototype: BcmTextarea;
6
+ new (): BcmTextarea;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;