@devschile/chucao 1.8.0 → 2.1.0

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 (158) hide show
  1. package/README.md +3 -0
  2. package/dist/chucao/chucao.esm.js +1 -1
  3. package/dist/chucao/chucao.esm.js.map +1 -1
  4. package/dist/chucao/{p-e8fe65bb.entry.js → p-04dbcfa0.entry.js} +2 -2
  5. package/dist/chucao/p-11083711.entry.js +2 -0
  6. package/dist/chucao/p-11083711.entry.js.map +1 -0
  7. package/dist/chucao/{p-cfb6db53.entry.js → p-121fbfc8.entry.js} +2 -2
  8. package/dist/chucao/p-1b1e56cd.entry.js +2 -0
  9. package/dist/chucao/p-1b1e56cd.entry.js.map +1 -0
  10. package/dist/chucao/{p-df73f786.entry.js → p-2ab4a6a8.entry.js} +2 -2
  11. package/dist/chucao/p-4bc8e098.entry.js +2 -0
  12. package/dist/chucao/p-4bc8e098.entry.js.map +1 -0
  13. package/dist/chucao/p-5fe8bfff.entry.js +2 -0
  14. package/dist/chucao/p-5fe8bfff.entry.js.map +1 -0
  15. package/dist/chucao/p-9bb81a65.entry.js +2 -0
  16. package/dist/chucao/p-9bb81a65.entry.js.map +1 -0
  17. package/dist/chucao/p-DWC12BJ-.js +3 -0
  18. package/dist/chucao/p-DWC12BJ-.js.map +1 -0
  19. package/dist/chucao/{p-2d7e81b2.entry.js → p-a955eebf.entry.js} +2 -2
  20. package/dist/chucao/{p-cbb2b478.entry.js → p-d5a9e340.entry.js} +2 -2
  21. package/dist/chucao/{p-1cc7042e.entry.js → p-ff5f5c1f.entry.js} +2 -2
  22. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  23. package/dist/cjs/ch-alert_8.cjs.entry.js +186 -9
  24. package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ch-checkbox.cjs.entry.js +62 -3
  26. package/dist/cjs/ch-checkbox.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ch-divider.cjs.entry.js +1 -1
  28. package/dist/cjs/ch-emoji.cjs.entry.js +104 -0
  29. package/dist/cjs/ch-emoji.cjs.entry.js.map +1 -0
  30. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  31. package/dist/cjs/ch-modal.cjs.entry.js +2 -2
  32. package/dist/cjs/ch-radio.cjs.entry.js +62 -3
  33. package/dist/cjs/ch-radio.cjs.entry.js.map +1 -1
  34. package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
  35. package/dist/cjs/ch-textarea.cjs.entry.js +62 -3
  36. package/dist/cjs/ch-textarea.cjs.entry.js.map +1 -1
  37. package/dist/cjs/ch-tooltip.cjs.entry.js +2 -2
  38. package/dist/cjs/chucao.cjs.js +3 -3
  39. package/dist/cjs/chucao.cjs.js.map +1 -1
  40. package/dist/cjs/{index-DMeDkSQU.js → index-C9cpLteP.js} +71 -12
  41. package/dist/cjs/index-C9cpLteP.js.map +1 -0
  42. package/dist/cjs/loader.cjs.js +2 -2
  43. package/dist/collection/collection-manifest.json +2 -1
  44. package/dist/collection/components/ch-card/ch-card.js +1 -1
  45. package/dist/collection/components/ch-checkbox/ch-checkbox.css +10 -0
  46. package/dist/collection/components/ch-checkbox/ch-checkbox.js +64 -4
  47. package/dist/collection/components/ch-checkbox/ch-checkbox.js.map +1 -1
  48. package/dist/collection/components/ch-emoji/ch-emoji.css +33 -0
  49. package/dist/collection/components/ch-emoji/ch-emoji.js +151 -0
  50. package/dist/collection/components/ch-emoji/ch-emoji.js.map +1 -0
  51. package/dist/collection/components/ch-input/ch-input.css +11 -0
  52. package/dist/collection/components/ch-input/ch-input.js +64 -4
  53. package/dist/collection/components/ch-input/ch-input.js.map +1 -1
  54. package/dist/collection/components/ch-modal/ch-modal.js +1 -1
  55. package/dist/collection/components/ch-radio/ch-radio.css +10 -0
  56. package/dist/collection/components/ch-radio/ch-radio.js +64 -4
  57. package/dist/collection/components/ch-radio/ch-radio.js.map +1 -1
  58. package/dist/collection/components/ch-select/ch-select.css +11 -0
  59. package/dist/collection/components/ch-select/ch-select.js +64 -4
  60. package/dist/collection/components/ch-select/ch-select.js.map +1 -1
  61. package/dist/collection/components/ch-spinner/ch-spinner.js +1 -1
  62. package/dist/collection/components/ch-switch/ch-switch.css +10 -0
  63. package/dist/collection/components/ch-switch/ch-switch.js +64 -4
  64. package/dist/collection/components/ch-switch/ch-switch.js.map +1 -1
  65. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  66. package/dist/collection/components/ch-textarea/ch-textarea.css +11 -0
  67. package/dist/collection/components/ch-textarea/ch-textarea.js +64 -4
  68. package/dist/collection/components/ch-textarea/ch-textarea.js.map +1 -1
  69. package/dist/collection/components/ch-tooltip/ch-tooltip.js +1 -1
  70. package/dist/components/ch-accordion.js +1 -1
  71. package/dist/components/ch-alert.js +1 -1
  72. package/dist/components/ch-badge.js +1 -1
  73. package/dist/components/ch-button.js +1 -1
  74. package/dist/components/ch-card.js +1 -1
  75. package/dist/components/ch-checkbox.js +1 -1
  76. package/dist/components/ch-checkbox.js.map +1 -1
  77. package/dist/components/ch-divider.js +1 -1
  78. package/dist/components/ch-emoji.d.ts +11 -0
  79. package/dist/components/ch-emoji.js +2 -0
  80. package/dist/components/ch-emoji.js.map +1 -0
  81. package/dist/components/ch-input.js +1 -1
  82. package/dist/components/ch-input.js.map +1 -1
  83. package/dist/components/ch-link.js +1 -1
  84. package/dist/components/ch-modal.js +1 -1
  85. package/dist/components/ch-radio.js +1 -1
  86. package/dist/components/ch-radio.js.map +1 -1
  87. package/dist/components/ch-select.js +1 -1
  88. package/dist/components/ch-select.js.map +1 -1
  89. package/dist/components/ch-spinner.js +1 -1
  90. package/dist/components/ch-switch.js +1 -1
  91. package/dist/components/ch-switch.js.map +1 -1
  92. package/dist/components/ch-tabs.js +1 -1
  93. package/dist/components/ch-textarea.js +1 -1
  94. package/dist/components/ch-textarea.js.map +1 -1
  95. package/dist/components/ch-tooltip.js +1 -1
  96. package/dist/components/index.js +1 -1
  97. package/dist/components/p-BhAZrOxf.js +2 -0
  98. package/dist/components/p-BhAZrOxf.js.map +1 -0
  99. package/dist/esm/ch-accordion.entry.js +1 -1
  100. package/dist/esm/ch-alert_8.entry.js +186 -9
  101. package/dist/esm/ch-alert_8.entry.js.map +1 -1
  102. package/dist/esm/ch-checkbox.entry.js +62 -3
  103. package/dist/esm/ch-checkbox.entry.js.map +1 -1
  104. package/dist/esm/ch-divider.entry.js +1 -1
  105. package/dist/esm/ch-emoji.entry.js +102 -0
  106. package/dist/esm/ch-emoji.entry.js.map +1 -0
  107. package/dist/esm/ch-link.entry.js +1 -1
  108. package/dist/esm/ch-modal.entry.js +2 -2
  109. package/dist/esm/ch-radio.entry.js +62 -3
  110. package/dist/esm/ch-radio.entry.js.map +1 -1
  111. package/dist/esm/ch-tabs.entry.js +2 -2
  112. package/dist/esm/ch-textarea.entry.js +62 -3
  113. package/dist/esm/ch-textarea.entry.js.map +1 -1
  114. package/dist/esm/ch-tooltip.entry.js +2 -2
  115. package/dist/esm/chucao.js +4 -4
  116. package/dist/esm/chucao.js.map +1 -1
  117. package/dist/esm/{index-Bvah_WQV.js → index-DWC12BJ-.js} +71 -12
  118. package/dist/esm/index-DWC12BJ-.js.map +1 -0
  119. package/dist/esm/loader.js +3 -3
  120. package/dist/types/components/ch-checkbox/ch-checkbox.d.ts +9 -0
  121. package/dist/types/components/ch-emoji/ch-emoji.d.ts +32 -0
  122. package/dist/types/components/ch-input/ch-input.d.ts +9 -0
  123. package/dist/types/components/ch-radio/ch-radio.d.ts +9 -0
  124. package/dist/types/components/ch-select/ch-select.d.ts +9 -0
  125. package/dist/types/components/ch-switch/ch-switch.d.ts +9 -0
  126. package/dist/types/components/ch-textarea/ch-textarea.d.ts +9 -0
  127. package/dist/types/components.d.ts +96 -0
  128. package/dist/types/stencil-public-runtime.d.ts +1 -0
  129. package/dist-react/components.d.ts +3 -0
  130. package/dist-react/components.js +9 -0
  131. package/dist-react/components.ts +12 -0
  132. package/dist-vue/index.d.ts +1 -0
  133. package/dist-vue/index.js +6 -0
  134. package/dist-vue/index.ts +8 -0
  135. package/hydrate/index.js +555 -63
  136. package/hydrate/index.mjs +555 -63
  137. package/loader/index.d.ts +1 -1
  138. package/package.json +5 -1
  139. package/dist/chucao/p-13ab5f9a.entry.js +0 -2
  140. package/dist/chucao/p-13ab5f9a.entry.js.map +0 -1
  141. package/dist/chucao/p-23c5220b.entry.js +0 -2
  142. package/dist/chucao/p-23c5220b.entry.js.map +0 -1
  143. package/dist/chucao/p-421cda05.entry.js +0 -2
  144. package/dist/chucao/p-421cda05.entry.js.map +0 -1
  145. package/dist/chucao/p-Bvah_WQV.js +0 -3
  146. package/dist/chucao/p-Bvah_WQV.js.map +0 -1
  147. package/dist/chucao/p-c16b18b7.entry.js +0 -2
  148. package/dist/chucao/p-c16b18b7.entry.js.map +0 -1
  149. package/dist/cjs/index-DMeDkSQU.js.map +0 -1
  150. package/dist/components/p-hyy-cLgi.js +0 -2
  151. package/dist/components/p-hyy-cLgi.js.map +0 -1
  152. package/dist/esm/index-Bvah_WQV.js.map +0 -1
  153. /package/dist/chucao/{p-e8fe65bb.entry.js.map → p-04dbcfa0.entry.js.map} +0 -0
  154. /package/dist/chucao/{p-cfb6db53.entry.js.map → p-121fbfc8.entry.js.map} +0 -0
  155. /package/dist/chucao/{p-df73f786.entry.js.map → p-2ab4a6a8.entry.js.map} +0 -0
  156. /package/dist/chucao/{p-2d7e81b2.entry.js.map → p-a955eebf.entry.js.map} +0 -0
  157. /package/dist/chucao/{p-cbb2b478.entry.js.map → p-d5a9e340.entry.js.map} +0 -0
  158. /package/dist/chucao/{p-1cc7042e.entry.js.map → p-ff5f5c1f.entry.js.map} +0 -0
package/hydrate/index.js CHANGED
@@ -135,7 +135,7 @@ const NAMESPACE = 'chucao';
135
135
  const BUILD = /* chucao */ { hotModuleReplacement: false, slotRelocation: true, state: true, updatable: true};
136
136
 
137
137
  /*
138
- Stencil Hydrate Platform v4.44.0 | MIT Licensed | https://stenciljs.com
138
+ Stencil Hydrate Platform v4.44.2 | MIT Licensed | https://stenciljs.com
139
139
  */
140
140
  var __create = Object.create;
141
141
  var __defProp = Object.defineProperty;
@@ -1781,7 +1781,9 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1781
1781
  }
1782
1782
  if (propValue != null && !isComplexType(propValue)) {
1783
1783
  if (propType & 4 /* Boolean */) {
1784
- {
1784
+ if (isFormAssociated && typeof propValue === "string") {
1785
+ return propValue === "" || !!propValue;
1786
+ } else {
1785
1787
  return propValue === "false" ? false : propValue === "" || !!propValue;
1786
1788
  }
1787
1789
  }
@@ -1915,7 +1917,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
1915
1917
  }
1916
1918
  }
1917
1919
  if (newValue == null || newValue === false) {
1918
- if (newValue !== false || elm.getAttribute(memberName) === "") {
1920
+ if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
1919
1921
  {
1920
1922
  elm.removeAttribute(memberName);
1921
1923
  }
@@ -1928,6 +1930,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
1928
1930
  }
1929
1931
  }
1930
1932
  };
1933
+ var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
1934
+ var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
1931
1935
  var parseClassListRegex = /\s/;
1932
1936
  var parseClassList = (value) => {
1933
1937
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -2381,7 +2385,7 @@ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
2381
2385
  return newNode;
2382
2386
  }
2383
2387
  }
2384
- if (parent.__insertBefore) {
2388
+ if ((parent == null ? void 0 : parent.__insertBefore)) {
2385
2389
  return parent.__insertBefore(newNode, reference);
2386
2390
  } else {
2387
2391
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
@@ -2416,6 +2420,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
2416
2420
  const isHostElement = isHost(renderFnResults);
2417
2421
  const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
2418
2422
  hostTagName = hostElm.tagName;
2423
+ if (cmpMeta.$attrsToReflect$) {
2424
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
2425
+ cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
2426
+ {
2427
+ rootVnode.$attrs$[attribute] = hostElm[propName];
2428
+ }
2429
+ });
2430
+ }
2419
2431
  if (isInitialLoad && rootVnode.$attrs$) {
2420
2432
  for (const key of Object.keys(rootVnode.$attrs$)) {
2421
2433
  if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
@@ -2750,7 +2762,9 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2750
2762
  const instance = hostRef.$lazyInstance$ ;
2751
2763
  newVal = parsePropertyValue(
2752
2764
  newVal,
2753
- cmpMeta.$members$[propName][0]);
2765
+ cmpMeta.$members$[propName][0],
2766
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
2767
+ );
2754
2768
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2755
2769
  const didValueChange = newVal !== oldVal && !areBothNaN;
2756
2770
  if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
@@ -2789,8 +2803,6 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2789
2803
  }
2790
2804
  }
2791
2805
  };
2792
-
2793
- // src/runtime/proxy-component.ts
2794
2806
  var proxyComponent = (Cstr, cmpMeta, flags) => {
2795
2807
  var _a2;
2796
2808
  const prototype = Cstr.prototype;
@@ -2843,7 +2855,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
2843
2855
  origSetter.apply(this, [
2844
2856
  parsePropertyValue(
2845
2857
  newValue,
2846
- memberFlags)
2858
+ memberFlags,
2859
+ !!(cmpMeta.$flags$ & 64 /* formAssociated */)
2860
+ )
2847
2861
  ]);
2848
2862
  newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
2849
2863
  setValue(this, memberName, newValue, cmpMeta);
@@ -4874,7 +4888,7 @@ function proxyHostElement(elm, cstr) {
4874
4888
  attrPropVal = cstr.prototype[methodName](attrValue, memberName);
4875
4889
  }
4876
4890
  } else {
4877
- attrPropVal = parsePropertyValue(attrValue, memberFlags);
4891
+ attrPropVal = parsePropertyValue(attrValue, memberFlags, !!(cmpMeta.$flags$ & 64 /* formAssociated */));
4878
4892
  }
4879
4893
  }
4880
4894
  if (propValue !== void 0) {
@@ -5500,7 +5514,7 @@ class ChCard {
5500
5514
  registerInstance(this, hostRef);
5501
5515
  }
5502
5516
  render() {
5503
- return (hAsync(Host, { key: '1541ba4361c996716356fb87cdcc73b1260d4c6a' }, hAsync("div", { key: '924070eeb79f6c8f8e6362772bbab0dcc1c6f315', class: "card" }, hAsync("slot", { key: '2fde36426395a519cb1ebe265ba0eef3aaf6ff38' }))));
5517
+ return (hAsync(Host, { key: 'de570a460eff697eb242ef56fcedd5b400d6b03f' }, hAsync("div", { key: '3350619356a929c5d922948d52d6635420dc8547', class: "card" }, hAsync("slot", { key: 'b50679202b5fea142702de0babf62587186d4dc8' }))));
5504
5518
  }
5505
5519
  static get style() { return chCardCss(); }
5506
5520
  static get cmpMeta() { return {
@@ -5513,17 +5527,28 @@ class ChCard {
5513
5527
  }; }
5514
5528
  }
5515
5529
 
5516
- const chCheckboxCss = () => `:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
5530
+ const chCheckboxCss = () => `:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
5517
5531
 
5518
5532
  let checkboxIds = 0;
5519
5533
  class ChCheckbox {
5520
5534
  constructor(hostRef) {
5521
5535
  registerInstance(this, hostRef);
5522
5536
  this.chChange = createEvent(this, "chChange");
5537
+ if (hostRef.$hostElement$["s-ei"]) {
5538
+ this.internals = hostRef.$hostElement$["s-ei"];
5539
+ }
5540
+ else {
5541
+ this.internals = hostRef.$hostElement$.attachInternals();
5542
+ hostRef.$hostElement$["s-ei"] = this.internals;
5543
+ }
5523
5544
  }
5524
5545
  checkboxId = `ch-checkbox-${++checkboxIds}`;
5525
5546
  hintId = `${this.checkboxId}-hint`;
5526
5547
  errorId = `${this.checkboxId}-error`;
5548
+ initialChecked = false;
5549
+ internals;
5550
+ formDisabled = false;
5551
+ get host() { return getElement(this); }
5527
5552
  /**
5528
5553
  * Visible label rendered next to the checkbox, associated with it via
5529
5554
  * `for`/`id`, so assistive technology announces the checkbox's purpose.
@@ -5570,6 +5595,39 @@ class ChCheckbox {
5570
5595
  this.checked = ev.target.checked;
5571
5596
  this.chChange.emit(this.checked);
5572
5597
  };
5598
+ syncForm() {
5599
+ const internals = this.internals;
5600
+ if (typeof internals?.setFormValue !== 'function') {
5601
+ return;
5602
+ }
5603
+ internals.setFormValue(this.checked ? this.value : null);
5604
+ const flags = {};
5605
+ let message;
5606
+ if (this.required && !this.checked) {
5607
+ flags.valueMissing = true;
5608
+ }
5609
+ if (this.invalid && this.errorMessage) {
5610
+ flags.customError = true;
5611
+ }
5612
+ message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
5613
+ internals.setValidity(flags, message);
5614
+ }
5615
+ componentDidLoad() {
5616
+ this.initialChecked = this.checked;
5617
+ this.syncForm();
5618
+ this.host.addEventListener('change', this.markTouched);
5619
+ this.host.addEventListener('focusout', this.markTouched);
5620
+ this.host.addEventListener('invalid', this.markTouched);
5621
+ }
5622
+ markTouched = () => {
5623
+ this.host.setAttribute('data-touched', '');
5624
+ };
5625
+ formResetCallback() {
5626
+ this.checked = this.initialChecked;
5627
+ }
5628
+ formDisabledCallback(isDisabled) {
5629
+ this.formDisabled = isDisabled;
5630
+ }
5573
5631
  get describedBy() {
5574
5632
  if (this.invalid && this.errorMessage) {
5575
5633
  return this.errorId;
@@ -5580,26 +5638,42 @@ class ChCheckbox {
5580
5638
  return undefined;
5581
5639
  }
5582
5640
  render() {
5583
- return (hAsync(Host, { key: '130d1bf88ae8c73befe7ac288a0d4b7113fd73f7' }, hAsync("label", { key: '6a3dd5bd889a9b41dda934b7c804de3ff2a63584', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.checkboxId }, hAsync("input", { key: '9978d057782e3cf31a2fa7b4042b5d070e015be0', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && hAsync("span", { key: '8b12d266d0693b6ad710c5a72df4b3c138435ef1', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '7aa3b14ccdfb216d8bc831c820e5438e166dab1c', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'aeacbc8e1f98162182149e55fde0d8d588c97fa4', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
5641
+ return (hAsync(Host, { key: 'ad83b999d4dbafbd7b6f2369bae8fbce8e068cad' }, hAsync("label", { key: 'e5927ad9d76db7cd9418debe8e635767b597e27a', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.checkboxId }, hAsync("input", { key: '93c49822bf5a470d67a7077354adcd9144643843', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && hAsync("span", { key: 'da90747e3339879a744569c98befed94507bebdd', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '3c10c9e29a943bc12983d4ef6b9fa00d95293c80', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '76e4a8debadd36dae475bd2439410c0f2a82cb62', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
5584
5642
  }
5643
+ static get formAssociated() { return true; }
5644
+ static get watchers() { return {
5645
+ "checked": [{
5646
+ "syncForm": 0
5647
+ }],
5648
+ "required": [{
5649
+ "syncForm": 0
5650
+ }],
5651
+ "invalid": [{
5652
+ "syncForm": 0
5653
+ }],
5654
+ "errorMessage": [{
5655
+ "syncForm": 0
5656
+ }]
5657
+ }; }
5585
5658
  static get style() { return chCheckboxCss(); }
5586
5659
  static get cmpMeta() { return {
5587
- "$flags$": 521,
5660
+ "$flags$": 585,
5588
5661
  "$tagName$": "ch-checkbox",
5589
5662
  "$members$": {
5590
5663
  "label": [1],
5591
- "name": [1],
5664
+ "name": [513],
5592
5665
  "value": [1],
5593
5666
  "checked": [1028],
5594
- "disabled": [4],
5595
- "required": [4],
5667
+ "disabled": [516],
5668
+ "required": [516],
5596
5669
  "hint": [1],
5597
5670
  "errorMessage": [1, "error-message"],
5598
- "invalid": [4]
5671
+ "invalid": [4],
5672
+ "formDisabled": [32]
5599
5673
  },
5600
5674
  "$listeners$": undefined,
5601
5675
  "$lazyBundleId$": "-",
5602
- "$attrsToReflect$": []
5676
+ "$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
5603
5677
  }; }
5604
5678
  }
5605
5679
 
@@ -5629,7 +5703,124 @@ class ChDivider {
5629
5703
  }; }
5630
5704
  }
5631
5705
 
5632
- const chInputCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
5706
+ const aaaa = "aaaa";
5707
+ const ameno = "ameno";
5708
+ const heart = "huemul-love";
5709
+ const love = "huemul-love";
5710
+ const humo = "humo";
5711
+ const hypnotoad = "hypnotoad";
5712
+ const lmao = "lmao";
5713
+ const loading = "loading";
5714
+ const loco = "loco";
5715
+ const loco2 = "loco2";
5716
+ const lol = "lol";
5717
+ const lol2 = "lol2";
5718
+ const monea = "monea";
5719
+ const negative = "negative";
5720
+ var emojiMap = {
5721
+ aaaa: aaaa,
5722
+ ameno: ameno,
5723
+ "huemul-huaso": "huemul-huaso",
5724
+ "huemul-love": "huemul-love",
5725
+ heart: heart,
5726
+ love: love,
5727
+ "huemul-trusted": "huemul-trusted",
5728
+ humo: humo,
5729
+ hypnotoad: hypnotoad,
5730
+ "lets-fucking-go": "lets-fucking-go",
5731
+ lmao: lmao,
5732
+ loading: loading,
5733
+ loco: loco,
5734
+ loco2: loco2,
5735
+ lol: lol,
5736
+ lol2: lol2,
5737
+ monea: monea,
5738
+ negative: negative
5739
+ };
5740
+
5741
+ const chEmojiCss = () => `:host{display:inline-block;vertical-align:middle}.emoji{display:block;object-fit:contain}.emoji--sm{width:16px;height:16px}.emoji--md{width:24px;height:24px}.emoji--lg{width:32px;height:32px}.emoji--xl{width:48px;height:48px}.emoji--hidden{display:none}`;
5742
+
5743
+ const CDN_BASE = 'https://static.devschile.cl/emoji';
5744
+ const EXTENSIONS = ['png', 'gif', 'jpg', 'svg'];
5745
+ /**
5746
+ * Inline emoji from the devsChile CDN.
5747
+ *
5748
+ * Given a name (or alias from the emoji map), the component resolves the
5749
+ * asset URL and tries each possible file extension until one loads.
5750
+ * Size is controlled via the `size` prop.
5751
+ */
5752
+ class ChEmoji {
5753
+ constructor(hostRef) {
5754
+ registerInstance(this, hostRef);
5755
+ }
5756
+ extIndex = 0;
5757
+ loaded = false;
5758
+ /**
5759
+ * The emoji name or alias, e.g. `"huemul-love"` or `"heart"`.
5760
+ */
5761
+ name;
5762
+ /**
5763
+ * Accessible alt text for the image. Defaults to the `name` prop.
5764
+ */
5765
+ alt;
5766
+ /**
5767
+ * Size of the emoji. Either `sm`, `md`, `lg`, or `xl`.
5768
+ */
5769
+ size = 'md';
5770
+ componentWillLoad() {
5771
+ this.resolveAsset();
5772
+ }
5773
+ handleNameChange() {
5774
+ this.resolveAsset();
5775
+ }
5776
+ resolveAsset() {
5777
+ this.extIndex = 0;
5778
+ this.loaded = false;
5779
+ }
5780
+ get assetName() {
5781
+ return emojiMap[this.name] ?? this.name;
5782
+ }
5783
+ get currentSrc() {
5784
+ return `${CDN_BASE}/${this.assetName}.${EXTENSIONS[this.extIndex]}`;
5785
+ }
5786
+ handleError = () => {
5787
+ if (this.extIndex < EXTENSIONS.length - 1) {
5788
+ this.extIndex++;
5789
+ }
5790
+ };
5791
+ handleLoad = () => {
5792
+ this.loaded = true;
5793
+ };
5794
+ render() {
5795
+ return (hAsync(Host, { key: 'bfc646f047dae03aa8079825012305d7beb1fa6d' }, hAsync("img", { key: 'c397cc1f928c6871df10adc1f43874738e1cbf33', class: {
5796
+ 'emoji': true,
5797
+ [`emoji--${this.size}`]: true,
5798
+ 'emoji--hidden': !this.loaded,
5799
+ }, src: this.currentSrc, alt: this.alt ?? this.name, onError: this.handleError, onLoad: this.handleLoad })));
5800
+ }
5801
+ static get watchers() { return {
5802
+ "name": [{
5803
+ "handleNameChange": 0
5804
+ }]
5805
+ }; }
5806
+ static get style() { return chEmojiCss(); }
5807
+ static get cmpMeta() { return {
5808
+ "$flags$": 521,
5809
+ "$tagName$": "ch-emoji",
5810
+ "$members$": {
5811
+ "name": [1],
5812
+ "alt": [1],
5813
+ "size": [1],
5814
+ "extIndex": [32],
5815
+ "loaded": [32]
5816
+ },
5817
+ "$listeners$": undefined,
5818
+ "$lazyBundleId$": "-",
5819
+ "$attrsToReflect$": []
5820
+ }; }
5821
+ }
5822
+
5823
+ const chInputCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.input{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input::placeholder{color:var(--text-muted)}.input:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus,:host(:user-invalid) .input:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.input:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
5633
5824
 
5634
5825
  let inputIds = 0;
5635
5826
  class ChInput {
@@ -5637,10 +5828,21 @@ class ChInput {
5637
5828
  registerInstance(this, hostRef);
5638
5829
  this.chInput = createEvent(this, "chInput");
5639
5830
  this.chChange = createEvent(this, "chChange");
5831
+ if (hostRef.$hostElement$["s-ei"]) {
5832
+ this.internals = hostRef.$hostElement$["s-ei"];
5833
+ }
5834
+ else {
5835
+ this.internals = hostRef.$hostElement$.attachInternals();
5836
+ hostRef.$hostElement$["s-ei"] = this.internals;
5837
+ }
5640
5838
  }
5641
5839
  inputId = `ch-input-${++inputIds}`;
5642
5840
  hintId = `${this.inputId}-hint`;
5643
5841
  errorId = `${this.inputId}-error`;
5842
+ initialValue = '';
5843
+ internals;
5844
+ formDisabled = false;
5845
+ get host() { return getElement(this); }
5644
5846
  /**
5645
5847
  * Visible label rendered above the input and associated with it via
5646
5848
  * `for`/`id`, so assistive technology announces the input's purpose.
@@ -5699,6 +5901,39 @@ class ChInput {
5699
5901
  this.value = ev.target.value;
5700
5902
  this.chChange.emit(this.value);
5701
5903
  };
5904
+ syncForm() {
5905
+ const internals = this.internals;
5906
+ if (typeof internals?.setFormValue !== 'function') {
5907
+ return;
5908
+ }
5909
+ internals.setFormValue(this.value);
5910
+ const flags = {};
5911
+ let message;
5912
+ if (this.required && this.value === '') {
5913
+ flags.valueMissing = true;
5914
+ }
5915
+ if (this.invalid && this.errorMessage) {
5916
+ flags.customError = true;
5917
+ }
5918
+ message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
5919
+ internals.setValidity(flags, message);
5920
+ }
5921
+ componentDidLoad() {
5922
+ this.initialValue = this.value;
5923
+ this.syncForm();
5924
+ this.host.addEventListener('change', this.markTouched);
5925
+ this.host.addEventListener('focusout', this.markTouched);
5926
+ this.host.addEventListener('invalid', this.markTouched);
5927
+ }
5928
+ markTouched = () => {
5929
+ this.host.setAttribute('data-touched', '');
5930
+ };
5931
+ formResetCallback() {
5932
+ this.value = this.initialValue;
5933
+ }
5934
+ formDisabledCallback(isDisabled) {
5935
+ this.formDisabled = isDisabled;
5936
+ }
5702
5937
  get describedBy() {
5703
5938
  if (this.invalid && this.errorMessage) {
5704
5939
  return this.errorId;
@@ -5709,27 +5944,43 @@ class ChInput {
5709
5944
  return undefined;
5710
5945
  }
5711
5946
  render() {
5712
- return (hAsync(Host, { key: '56ef5eab354235c89214be28263cde91168f5dee' }, this.label && (hAsync("label", { key: '745fe11f607591d1c571dcf7d9429d834dfa4f2b', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: '18739cebe47aa1130b55fa5aaf184a1f3fad88d2', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.invalid }, type: this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '60a43287f6329db3f4b27ad882300fced0925645', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'ea18e90000f1a244cbe51126441b5d260562e07a', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
5947
+ return (hAsync(Host, { key: '8a4b7cf5b80097afb849e2de9620fdd205774923' }, this.label && (hAsync("label", { key: '7400206e6c27d61e7b9afadeba8a2131059af59a', class: "label", htmlFor: this.inputId }, this.label)), hAsync("input", { key: '2c4fd9215d5b21f28d57a1c49eeaa64224e21e05', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.invalid }, type: this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '6e6a381f81442622784afc480eb79327ae8a8525', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '743215633ca399d801c813194b054d40631b7be6', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
5713
5948
  }
5949
+ static get formAssociated() { return true; }
5950
+ static get watchers() { return {
5951
+ "value": [{
5952
+ "syncForm": 0
5953
+ }],
5954
+ "required": [{
5955
+ "syncForm": 0
5956
+ }],
5957
+ "invalid": [{
5958
+ "syncForm": 0
5959
+ }],
5960
+ "errorMessage": [{
5961
+ "syncForm": 0
5962
+ }]
5963
+ }; }
5714
5964
  static get style() { return chInputCss(); }
5715
5965
  static get cmpMeta() { return {
5716
- "$flags$": 521,
5966
+ "$flags$": 585,
5717
5967
  "$tagName$": "ch-input",
5718
5968
  "$members$": {
5719
5969
  "label": [1],
5720
5970
  "type": [1],
5721
5971
  "value": [1025],
5722
5972
  "placeholder": [1],
5723
- "name": [1],
5724
- "disabled": [4],
5725
- "required": [4],
5973
+ "name": [513],
5974
+ "disabled": [516],
5975
+ "required": [516],
5726
5976
  "hint": [1],
5727
5977
  "errorMessage": [1, "error-message"],
5728
- "invalid": [4]
5978
+ "invalid": [4],
5979
+ "formDisabled": [32]
5729
5980
  },
5730
5981
  "$listeners$": undefined,
5731
5982
  "$lazyBundleId$": "-",
5732
- "$attrsToReflect$": []
5983
+ "$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
5733
5984
  }; }
5734
5985
  }
5735
5986
 
@@ -5954,7 +6205,7 @@ class ChModal {
5954
6205
  this.chClose.emit();
5955
6206
  };
5956
6207
  render() {
5957
- return (hAsync(Host, { key: '92edf16d3ff079f72a4785ec9852e3e25218fd35' }, hAsync("dialog", { key: '546fc72a098e1e2d8c05fafa2f11eac19ff83fd3', class: "modal", "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: '5a67aa39b6687db89d97533eb54d3a3b663bed56', class: "modal-head" }, hAsync("slot", { key: '2e44b59a7c5e6af4a110a7f86362964ddd30d215', name: "heading" }), this.closeLabel && (hAsync("button", { key: 'ce70baaa876c9f7b82865f0547e8e8cef5d5dfde', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: 'df4536a8851a1ca9d3d2c46d15d18856660a54f6', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: '5de77062134ccd90643df17d7b0d0ddb161f6a5f', class: "modal-body" }, hAsync("slot", { key: '3b64493e9236b311a4b2f5250c5027f866bce8fd' })))));
6208
+ return (hAsync(Host, { key: '8f5f8c340291feb4385076bfdefc02a849e08efe' }, hAsync("dialog", { key: 'e435367c1e3dc5c7e8102f6ac76792394f5097fa', class: "modal", "aria-label": this.label, ref: el => (this.dialog = el) }, hAsync("div", { key: '05a0d306dc7e3f917c47de28ed6359280c0472b8', class: "modal-head" }, hAsync("slot", { key: '79e25ed41f98a5ceee2dca9afc200d8980d9f284', name: "heading" }), this.closeLabel && (hAsync("button", { key: '0620b914cb51cae7ab74f2ccccb25e9fc324811f', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, hAsync("span", { key: 'e2a1e0ec6c1d1cbdb2de684bfe4c7e0ed07ceaee', "aria-hidden": "true" }, "\u00D7")))), hAsync("div", { key: 'af254d18e1538ea5dac06c421ba03d897ddf057d', class: "modal-body" }, hAsync("slot", { key: '645876d63f275108a2a9d27f563bb6918dcb9deb' })))));
5958
6209
  }
5959
6210
  static get watchers() { return {
5960
6211
  "open": [{
@@ -5976,18 +6227,29 @@ class ChModal {
5976
6227
  }; }
5977
6228
  }
5978
6229
 
5979
- const chRadioCss = () => `:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6230
+ const chRadioCss = () => `:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .input,:host(:user-invalid) .input{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible,:host(:user-invalid) .input:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
5980
6231
 
5981
6232
  let radioIds = 0;
5982
6233
  class ChRadio {
5983
6234
  constructor(hostRef) {
5984
6235
  registerInstance(this, hostRef);
5985
6236
  this.chChange = createEvent(this, "chChange");
6237
+ if (hostRef.$hostElement$["s-ei"]) {
6238
+ this.internals = hostRef.$hostElement$["s-ei"];
6239
+ }
6240
+ else {
6241
+ this.internals = hostRef.$hostElement$.attachInternals();
6242
+ hostRef.$hostElement$["s-ei"] = this.internals;
6243
+ }
5986
6244
  }
5987
6245
  groupId = `ch-radio-${++radioIds}`;
5988
6246
  labelId = `${this.groupId}-label`;
5989
6247
  hintId = `${this.groupId}-hint`;
5990
6248
  errorId = `${this.groupId}-error`;
6249
+ initialValue;
6250
+ internals;
6251
+ formDisabled = false;
6252
+ get host() { return getElement(this); }
5991
6253
  /**
5992
6254
  * Visible label describing the radio group, associated with it via
5993
6255
  * `aria-labelledby`.
@@ -6035,6 +6297,39 @@ class ChRadio {
6035
6297
  this.value = ev.target.value;
6036
6298
  this.chChange.emit(this.value);
6037
6299
  };
6300
+ syncForm() {
6301
+ const internals = this.internals;
6302
+ if (typeof internals?.setFormValue !== 'function') {
6303
+ return;
6304
+ }
6305
+ internals.setFormValue(this.value ?? null);
6306
+ const flags = {};
6307
+ let message;
6308
+ if (this.required && !this.value) {
6309
+ flags.valueMissing = true;
6310
+ }
6311
+ if (this.invalid && this.errorMessage) {
6312
+ flags.customError = true;
6313
+ }
6314
+ message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
6315
+ internals.setValidity(flags, message);
6316
+ }
6317
+ componentDidLoad() {
6318
+ this.initialValue = this.value;
6319
+ this.syncForm();
6320
+ this.host.addEventListener('change', this.markTouched);
6321
+ this.host.addEventListener('focusout', this.markTouched);
6322
+ this.host.addEventListener('invalid', this.markTouched);
6323
+ }
6324
+ markTouched = () => {
6325
+ this.host.setAttribute('data-touched', '');
6326
+ };
6327
+ formResetCallback() {
6328
+ this.value = this.initialValue;
6329
+ }
6330
+ formDisabledCallback(isDisabled) {
6331
+ this.formDisabled = isDisabled;
6332
+ }
6038
6333
  get describedBy() {
6039
6334
  if (this.invalid && this.errorMessage) {
6040
6335
  return this.errorId;
@@ -6046,40 +6341,67 @@ class ChRadio {
6046
6341
  }
6047
6342
  render() {
6048
6343
  const groupName = this.name || `${this.groupId}-group`;
6049
- return (hAsync(Host, { key: '68ce563b4a03669b76ff3822705b1ff92c4c02f2' }, this.label && (hAsync("span", { key: '1887f5b70a5bf9f049495d76588458181d3f7735', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: 'c38ee340f9527e16c5587f2309f91ea463bb7cad', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (hAsync("label", { class: { 'control': true, 'control--disabled': this.disabled || option.disabled } }, hAsync("input", { class: { 'input': true, 'input--invalid': this.invalid }, type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || option.disabled, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), hAsync("span", { class: "mark" }), hAsync("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: 'ad60ce772279809ee334fc30182be1d0350d5586', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '316c911f9e1a29d17cc2d6b0e60ed35755420ae2', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6344
+ return (hAsync(Host, { key: '2d0f02cbeae89b8c60664825f3885bbeeafd896a' }, this.label && (hAsync("span", { key: 'c32fd25be5eaf0d05c2d8d6aae01dda281f4b952', class: "group-label", id: this.labelId }, this.label)), hAsync("div", { key: 'bd05a360ad1fd794c95d8066dbb93300152a88dc', class: "radio-group", role: "radiogroup", "aria-labelledby": this.label ? this.labelId : undefined }, this.options.map(option => (hAsync("label", { class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled || option.disabled } }, hAsync("input", { class: { 'input': true, 'input--invalid': this.invalid }, type: "radio", name: groupName, value: option.value, checked: option.value === this.value, disabled: this.disabled || this.formDisabled || option.disabled, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), hAsync("span", { class: "mark" }), hAsync("span", { class: "label-text" }, option.label))))), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '8c451f8d166c6002a4f30bfb72acd6b863ec38c2', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '8ac12f60e463c908dff76d64d7ae0e216ed51489', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6050
6345
  }
6346
+ static get formAssociated() { return true; }
6347
+ static get watchers() { return {
6348
+ "value": [{
6349
+ "syncForm": 0
6350
+ }],
6351
+ "required": [{
6352
+ "syncForm": 0
6353
+ }],
6354
+ "invalid": [{
6355
+ "syncForm": 0
6356
+ }],
6357
+ "errorMessage": [{
6358
+ "syncForm": 0
6359
+ }]
6360
+ }; }
6051
6361
  static get style() { return chRadioCss(); }
6052
6362
  static get cmpMeta() { return {
6053
- "$flags$": 521,
6363
+ "$flags$": 585,
6054
6364
  "$tagName$": "ch-radio",
6055
6365
  "$members$": {
6056
6366
  "label": [1],
6057
6367
  "options": [16],
6058
6368
  "value": [1025],
6059
- "name": [1],
6060
- "disabled": [4],
6061
- "required": [4],
6369
+ "name": [513],
6370
+ "disabled": [516],
6371
+ "required": [516],
6062
6372
  "hint": [1],
6063
6373
  "errorMessage": [1, "error-message"],
6064
- "invalid": [4]
6374
+ "invalid": [4],
6375
+ "formDisabled": [32]
6065
6376
  },
6066
6377
  "$listeners$": undefined,
6067
6378
  "$lazyBundleId$": "-",
6068
- "$attrsToReflect$": []
6379
+ "$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
6069
6380
  }; }
6070
6381
  }
6071
6382
 
6072
- const chSelectCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.select{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6383
+ const chSelectCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.select{box-sizing:border-box;width:100%;padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.select:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.select--invalid{border-color:var(--color-status-warning)}.select--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .select,:host(:user-invalid) .select{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .select:focus,:host(:user-invalid) .select:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.select:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.select option{background:var(--bg);color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6073
6384
 
6074
6385
  let selectIds = 0;
6075
6386
  class ChSelect {
6076
6387
  constructor(hostRef) {
6077
6388
  registerInstance(this, hostRef);
6078
6389
  this.chChange = createEvent(this, "chChange");
6390
+ if (hostRef.$hostElement$["s-ei"]) {
6391
+ this.internals = hostRef.$hostElement$["s-ei"];
6392
+ }
6393
+ else {
6394
+ this.internals = hostRef.$hostElement$.attachInternals();
6395
+ hostRef.$hostElement$["s-ei"] = this.internals;
6396
+ }
6079
6397
  }
6080
6398
  selectId = `ch-select-${++selectIds}`;
6081
6399
  hintId = `${this.selectId}-hint`;
6082
6400
  errorId = `${this.selectId}-error`;
6401
+ initialValue;
6402
+ internals;
6403
+ formDisabled = false;
6404
+ get host() { return getElement(this); }
6083
6405
  /**
6084
6406
  * Visible label rendered above the select and associated with it via
6085
6407
  * `for`/`id`, so assistive technology announces the select's purpose.
@@ -6130,6 +6452,39 @@ class ChSelect {
6130
6452
  this.value = ev.target.value;
6131
6453
  this.chChange.emit(this.value);
6132
6454
  };
6455
+ syncForm() {
6456
+ const internals = this.internals;
6457
+ if (typeof internals?.setFormValue !== 'function') {
6458
+ return;
6459
+ }
6460
+ internals.setFormValue(this.value ?? '');
6461
+ const flags = {};
6462
+ let message;
6463
+ if (this.required && !this.value) {
6464
+ flags.valueMissing = true;
6465
+ }
6466
+ if (this.invalid && this.errorMessage) {
6467
+ flags.customError = true;
6468
+ }
6469
+ message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
6470
+ internals.setValidity(flags, message);
6471
+ }
6472
+ componentDidLoad() {
6473
+ this.initialValue = this.value;
6474
+ this.syncForm();
6475
+ this.host.addEventListener('change', this.markTouched);
6476
+ this.host.addEventListener('focusout', this.markTouched);
6477
+ this.host.addEventListener('invalid', this.markTouched);
6478
+ }
6479
+ markTouched = () => {
6480
+ this.host.setAttribute('data-touched', '');
6481
+ };
6482
+ formResetCallback() {
6483
+ this.value = this.initialValue;
6484
+ }
6485
+ formDisabledCallback(isDisabled) {
6486
+ this.formDisabled = isDisabled;
6487
+ }
6133
6488
  get describedBy() {
6134
6489
  if (this.invalid && this.errorMessage) {
6135
6490
  return this.errorId;
@@ -6140,27 +6495,43 @@ class ChSelect {
6140
6495
  return undefined;
6141
6496
  }
6142
6497
  render() {
6143
- return (hAsync(Host, { key: '90aaf1fa70da54071539de8a22ebe9373f2ae90a' }, this.label && (hAsync("label", { key: '8b14b4deb611c4f1eb496c6f0d3fa58b7c4342b6', class: "label", htmlFor: this.selectId }, this.label)), hAsync("select", { key: 'c93b4ba079e9e61ef5bb2392256545af73263665', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (hAsync("option", { key: 'df8e97bdb0bd3e5426558027d34c1eb63ee76f1e', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (hAsync("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '6b6078e31a1a2f183951f5ada63a5e7e7f582f96', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'f7791b37b8660441a43a6b45d99472b2df7df0ab', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6498
+ return (hAsync(Host, { key: 'ffca23504c723f60f7430e6db2e1fa00db1fd4d8' }, this.label && (hAsync("label", { key: '697998ec67f01f3ca2849b1fb2aa88790d98010b', class: "label", htmlFor: this.selectId }, this.label)), hAsync("select", { key: 'f344d240f38dd123bdfd2d34cd15fbc7b5ae0a2c', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled || this.formDisabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (hAsync("option", { key: '34200e96dad92ed55632f0430abde5bc34cf6e6a', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (hAsync("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '55690dbf57cad7c974d0bf1b8eedb733ddc5b571', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '7d4598b112d21ebc96ac04bca553f63dd5825996', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6144
6499
  }
6500
+ static get formAssociated() { return true; }
6501
+ static get watchers() { return {
6502
+ "value": [{
6503
+ "syncForm": 0
6504
+ }],
6505
+ "required": [{
6506
+ "syncForm": 0
6507
+ }],
6508
+ "invalid": [{
6509
+ "syncForm": 0
6510
+ }],
6511
+ "errorMessage": [{
6512
+ "syncForm": 0
6513
+ }]
6514
+ }; }
6145
6515
  static get style() { return chSelectCss(); }
6146
6516
  static get cmpMeta() { return {
6147
- "$flags$": 521,
6517
+ "$flags$": 585,
6148
6518
  "$tagName$": "ch-select",
6149
6519
  "$members$": {
6150
6520
  "label": [1],
6151
6521
  "options": [16],
6152
6522
  "value": [1025],
6153
6523
  "placeholder": [1],
6154
- "name": [1],
6155
- "disabled": [4],
6156
- "required": [4],
6524
+ "name": [513],
6525
+ "disabled": [516],
6526
+ "required": [516],
6157
6527
  "hint": [1],
6158
6528
  "errorMessage": [1, "error-message"],
6159
- "invalid": [4]
6529
+ "invalid": [4],
6530
+ "formDisabled": [32]
6160
6531
  },
6161
6532
  "$listeners$": undefined,
6162
6533
  "$lazyBundleId$": "-",
6163
- "$attrsToReflect$": []
6534
+ "$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
6164
6535
  }; }
6165
6536
  }
6166
6537
 
@@ -6193,7 +6564,7 @@ class ChSpinner {
6193
6564
  label;
6194
6565
  render() {
6195
6566
  const labelled = Boolean(this.label);
6196
- return (hAsync(Host, { key: 'dc7c7e19f6a6878680555b0d7dbd84f5dc5774c8' }, hAsync("span", { key: 'd29d5f3344ae578d2a28382b13b45b901d41e52b', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
6567
+ return (hAsync(Host, { key: '9182eecf066be099714a870fa601f744362e697d' }, hAsync("span", { key: 'd67f2572ab80facadd4d49043a892b16816b4fef', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
6197
6568
  }
6198
6569
  static get style() { return chSpinnerCss(); }
6199
6570
  static get cmpMeta() { return {
@@ -6209,17 +6580,28 @@ class ChSpinner {
6209
6580
  }; }
6210
6581
  }
6211
6582
 
6212
- const chSwitchCss = () => `:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6583
+ const chSwitchCss = () => `:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}:host([data-touched]:invalid) .track,:host(:user-invalid) .track{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .input:focus-visible~.track,:host(:user-invalid) .input:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6213
6584
 
6214
6585
  let switchIds = 0;
6215
6586
  class ChSwitch {
6216
6587
  constructor(hostRef) {
6217
6588
  registerInstance(this, hostRef);
6218
6589
  this.chChange = createEvent(this, "chChange");
6590
+ if (hostRef.$hostElement$["s-ei"]) {
6591
+ this.internals = hostRef.$hostElement$["s-ei"];
6592
+ }
6593
+ else {
6594
+ this.internals = hostRef.$hostElement$.attachInternals();
6595
+ hostRef.$hostElement$["s-ei"] = this.internals;
6596
+ }
6219
6597
  }
6220
6598
  switchId = `ch-switch-${++switchIds}`;
6221
6599
  hintId = `${this.switchId}-hint`;
6222
6600
  errorId = `${this.switchId}-error`;
6601
+ initialChecked = false;
6602
+ internals;
6603
+ formDisabled = false;
6604
+ get host() { return getElement(this); }
6223
6605
  /**
6224
6606
  * Visible label rendered next to the switch, associated with it via
6225
6607
  * `for`/`id`, so assistive technology announces the switch's purpose.
@@ -6266,6 +6648,39 @@ class ChSwitch {
6266
6648
  this.checked = ev.target.checked;
6267
6649
  this.chChange.emit(this.checked);
6268
6650
  };
6651
+ syncForm() {
6652
+ const internals = this.internals;
6653
+ if (typeof internals?.setFormValue !== 'function') {
6654
+ return;
6655
+ }
6656
+ internals.setFormValue(this.checked ? this.value : null);
6657
+ const flags = {};
6658
+ let message;
6659
+ if (this.required && !this.checked) {
6660
+ flags.valueMissing = true;
6661
+ }
6662
+ if (this.invalid && this.errorMessage) {
6663
+ flags.customError = true;
6664
+ }
6665
+ message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
6666
+ internals.setValidity(flags, message);
6667
+ }
6668
+ componentDidLoad() {
6669
+ this.initialChecked = this.checked;
6670
+ this.syncForm();
6671
+ this.host.addEventListener('change', this.markTouched);
6672
+ this.host.addEventListener('focusout', this.markTouched);
6673
+ this.host.addEventListener('invalid', this.markTouched);
6674
+ }
6675
+ markTouched = () => {
6676
+ this.host.setAttribute('data-touched', '');
6677
+ };
6678
+ formResetCallback() {
6679
+ this.checked = this.initialChecked;
6680
+ }
6681
+ formDisabledCallback(isDisabled) {
6682
+ this.formDisabled = isDisabled;
6683
+ }
6269
6684
  get describedBy() {
6270
6685
  if (this.invalid && this.errorMessage) {
6271
6686
  return this.errorId;
@@ -6276,26 +6691,42 @@ class ChSwitch {
6276
6691
  return undefined;
6277
6692
  }
6278
6693
  render() {
6279
- return (hAsync(Host, { key: 'f95f9b724e37771ea3949ff569881dc1eff370a1' }, hAsync("label", { key: '878c3c47e380356a3b79e79fdd135df627ce37a6', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.switchId }, hAsync("input", { key: '14ee6041b8aeb4115db1f7ca9c542314651f34ea', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), hAsync("span", { key: '0d58863f220b6e9f04babd6231a35dea039a41a2', class: "track" }, hAsync("span", { key: '588617f6bb1c61168b860c4b2863892828fd5df5', class: "thumb" })), this.label && hAsync("span", { key: '530e64cc85761e91a019431f977bb9d2d8e86e27', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '71ffd6b56a753673f9d5663054a217e250363ce1', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '63f9965c30d8cd2820554de31ac7edc364aee22b', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6694
+ return (hAsync(Host, { key: 'c1a98e9b04710ed014a8c18d6591fee427df0033' }, hAsync("label", { key: '4b14ec7d7709090235b0e9b74a45d4c76dd52f25', class: { 'control': true, 'control--disabled': this.disabled || this.formDisabled }, htmlFor: this.switchId }, hAsync("input", { key: '4f2c9472b3bf34db582a94e307cc8b47b5dfcd38', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled || this.formDisabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), hAsync("span", { key: '6b2c20c6242178bba39f105a535bb12fc5198cd0', class: "track" }, hAsync("span", { key: '4ae0e675ce335417b867f6b688ec5545769b2d2c', class: "thumb" })), this.label && hAsync("span", { key: 'd5383fac3349441104c0926a6c88078b85bda05c', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '41ed07a95f8d627fb4ed8c903b6ba5ee39baa6a5', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '71cf8526dec44e2099235e3bc744db2aa53d70f0', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6280
6695
  }
6696
+ static get formAssociated() { return true; }
6697
+ static get watchers() { return {
6698
+ "checked": [{
6699
+ "syncForm": 0
6700
+ }],
6701
+ "required": [{
6702
+ "syncForm": 0
6703
+ }],
6704
+ "invalid": [{
6705
+ "syncForm": 0
6706
+ }],
6707
+ "errorMessage": [{
6708
+ "syncForm": 0
6709
+ }]
6710
+ }; }
6281
6711
  static get style() { return chSwitchCss(); }
6282
6712
  static get cmpMeta() { return {
6283
- "$flags$": 521,
6713
+ "$flags$": 585,
6284
6714
  "$tagName$": "ch-switch",
6285
6715
  "$members$": {
6286
6716
  "label": [1],
6287
- "name": [1],
6717
+ "name": [513],
6288
6718
  "value": [1],
6289
6719
  "checked": [1028],
6290
- "disabled": [4],
6291
- "required": [4],
6720
+ "disabled": [516],
6721
+ "required": [516],
6292
6722
  "hint": [1],
6293
6723
  "errorMessage": [1, "error-message"],
6294
- "invalid": [4]
6724
+ "invalid": [4],
6725
+ "formDisabled": [32]
6295
6726
  },
6296
6727
  "$listeners$": undefined,
6297
6728
  "$lazyBundleId$": "-",
6298
- "$attrsToReflect$": []
6729
+ "$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
6299
6730
  }; }
6300
6731
  }
6301
6732
 
@@ -6383,7 +6814,7 @@ class ChTabs {
6383
6814
  }
6384
6815
  render() {
6385
6816
  const active = this.activeValue;
6386
- return (hAsync(Host, { key: '0467e7ea24884d4c19c33b736a07303569dfaa3b' }, hAsync("div", { key: '8ad451816ef31809c82486f3c9dd36b6e89e77e5', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
6817
+ return (hAsync(Host, { key: '7c6b34c34e73f034eb03473ad9941eade91317c3' }, hAsync("div", { key: '601bae37f4fb3e5e0d07fb7a91968171b0bd18a3', class: "tablist", role: "tablist", "aria-label": this.label, onKeyDown: this.handleKeyDown, ref: el => (this.tablistEl = el) }, this.tabs.map(tab => {
6387
6818
  const selected = tab.value === active;
6388
6819
  return (hAsync("button", { key: tab.value, type: "button", class: { 'tab': true, 'tab--active': selected, 'tab--disabled': Boolean(tab.disabled) }, role: "tab", id: this.tabId(tab.value), "data-value": tab.value, "aria-selected": selected ? 'true' : 'false', "aria-controls": this.panelId(tab.value), tabIndex: selected ? FIRST_TAB_INDEX : LAST_TAB_INDEX, disabled: tab.disabled, onClick: () => this.select(tab.value) }, tab.label));
6389
6820
  })), this.tabs.map(tab => (hAsync("div", { key: `${tab.value}-panel`, class: "tabpanel", id: this.panelId(tab.value), role: "tabpanel", "aria-labelledby": this.tabId(tab.value), tabIndex: FIRST_TAB_INDEX, hidden: tab.value !== active }, hAsync("slot", { name: `panel-${tab.value}` }))))));
@@ -6403,7 +6834,7 @@ class ChTabs {
6403
6834
  }; }
6404
6835
  }
6405
6836
 
6406
- const chTextareaCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6837
+ const chTextareaCss = () => `:host{display:inline-block;width:100%}.label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.textarea{box-sizing:border-box;width:100%;min-height:var(--spacing-6xl);padding:var(--spacing-xl) var(--spacing-3xl);border-radius:var(--radius);border:var(--border-width) solid var(--border);background:var(--surface);color:var(--text);backdrop-filter:blur(var(--effect-blur));font-family:inherit;font-size:inherit;line-height:var(--spacing-5xl);resize:vertical;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.textarea::placeholder{color:var(--text-muted)}.textarea:focus{border-color:var(--accent);box-shadow:var(--shadow-focus-ring);outline:none}.textarea--invalid{border-color:var(--color-status-warning)}.textarea--invalid:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}:host([data-touched]:invalid) .textarea,:host(:user-invalid) .textarea{border-color:var(--color-status-warning)}:host([data-touched]:invalid) .textarea:focus,:host(:user-invalid) .textarea:focus{border-color:var(--color-status-warning);box-shadow:0 0 0 3px var(--color-status-warning-background)}.textarea:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6407
6838
 
6408
6839
  let textareaIds = 0;
6409
6840
  const DEFAULT_ROWS = 4;
@@ -6412,10 +6843,21 @@ class ChTextarea {
6412
6843
  registerInstance(this, hostRef);
6413
6844
  this.chInput = createEvent(this, "chInput");
6414
6845
  this.chChange = createEvent(this, "chChange");
6846
+ if (hostRef.$hostElement$["s-ei"]) {
6847
+ this.internals = hostRef.$hostElement$["s-ei"];
6848
+ }
6849
+ else {
6850
+ this.internals = hostRef.$hostElement$.attachInternals();
6851
+ hostRef.$hostElement$["s-ei"] = this.internals;
6852
+ }
6415
6853
  }
6416
6854
  textareaId = `ch-textarea-${++textareaIds}`;
6417
6855
  hintId = `${this.textareaId}-hint`;
6418
6856
  errorId = `${this.textareaId}-error`;
6857
+ initialValue = '';
6858
+ internals;
6859
+ formDisabled = false;
6860
+ get host() { return getElement(this); }
6419
6861
  /**
6420
6862
  * Visible label rendered above the textarea and associated with it via
6421
6863
  * `for`/`id`, so assistive technology announces the textarea's purpose.
@@ -6474,6 +6916,39 @@ class ChTextarea {
6474
6916
  this.value = ev.target.value;
6475
6917
  this.chChange.emit(this.value);
6476
6918
  };
6919
+ syncForm() {
6920
+ const internals = this.internals;
6921
+ if (typeof internals?.setFormValue !== 'function') {
6922
+ return;
6923
+ }
6924
+ internals.setFormValue(this.value);
6925
+ const flags = {};
6926
+ let message;
6927
+ if (this.required && this.value === '') {
6928
+ flags.valueMissing = true;
6929
+ }
6930
+ if (this.invalid && this.errorMessage) {
6931
+ flags.customError = true;
6932
+ }
6933
+ message = this.errorMessage ?? (flags.valueMissing ? 'Please fill out this field.' : undefined);
6934
+ internals.setValidity(flags, message);
6935
+ }
6936
+ componentDidLoad() {
6937
+ this.initialValue = this.value;
6938
+ this.syncForm();
6939
+ this.host.addEventListener('change', this.markTouched);
6940
+ this.host.addEventListener('focusout', this.markTouched);
6941
+ this.host.addEventListener('invalid', this.markTouched);
6942
+ }
6943
+ markTouched = () => {
6944
+ this.host.setAttribute('data-touched', '');
6945
+ };
6946
+ formResetCallback() {
6947
+ this.value = this.initialValue;
6948
+ }
6949
+ formDisabledCallback(isDisabled) {
6950
+ this.formDisabled = isDisabled;
6951
+ }
6477
6952
  get describedBy() {
6478
6953
  if (this.invalid && this.errorMessage) {
6479
6954
  return this.errorId;
@@ -6484,27 +6959,43 @@ class ChTextarea {
6484
6959
  return undefined;
6485
6960
  }
6486
6961
  render() {
6487
- return (hAsync(Host, { key: '1e5846687f73807b36da2328106aec84bdecb7cb' }, this.label && (hAsync("label", { key: '9a8d410d07bb6b9cc9a5329088786de6365af507', class: "label", htmlFor: this.textareaId }, this.label)), hAsync("textarea", { key: '7353cc267072e7df111d94ad0466588d0b7e77d8', id: this.label ? this.textareaId : undefined, class: { 'textarea': true, 'textarea--invalid': this.invalid }, rows: this.rows, name: this.name, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '5b953e2c568b151c502404fccc4a79d6d6e516f9', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: 'bc500a5bd32ac35cf4de723b02cb42f459614c39', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6962
+ return (hAsync(Host, { key: '6e738612514b114571c1edfad0fb85e2228653a8' }, this.label && (hAsync("label", { key: '3b58b49a02dd532430cfd9096c326288a5120d6d', class: "label", htmlFor: this.textareaId }, this.label)), hAsync("textarea", { key: '0922df038ea6ce6d1567ffe8d02c5b65534bec7a', id: this.label ? this.textareaId : undefined, class: { 'textarea': true, 'textarea--invalid': this.invalid }, rows: this.rows, name: this.name, placeholder: this.placeholder, disabled: this.disabled || this.formDisabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (hAsync("p", { key: '6d3518345b9afaad782741a854053ed2b32e31db', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (hAsync("p", { key: '8a26edd5a1ef3647133813003fb1a53b1a5f99d6', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
6488
6963
  }
6964
+ static get formAssociated() { return true; }
6965
+ static get watchers() { return {
6966
+ "value": [{
6967
+ "syncForm": 0
6968
+ }],
6969
+ "required": [{
6970
+ "syncForm": 0
6971
+ }],
6972
+ "invalid": [{
6973
+ "syncForm": 0
6974
+ }],
6975
+ "errorMessage": [{
6976
+ "syncForm": 0
6977
+ }]
6978
+ }; }
6489
6979
  static get style() { return chTextareaCss(); }
6490
6980
  static get cmpMeta() { return {
6491
- "$flags$": 521,
6981
+ "$flags$": 585,
6492
6982
  "$tagName$": "ch-textarea",
6493
6983
  "$members$": {
6494
6984
  "label": [1],
6495
6985
  "value": [1025],
6496
6986
  "placeholder": [1],
6497
6987
  "rows": [2],
6498
- "name": [1],
6499
- "disabled": [4],
6500
- "required": [4],
6988
+ "name": [513],
6989
+ "disabled": [516],
6990
+ "required": [516],
6501
6991
  "hint": [1],
6502
6992
  "errorMessage": [1, "error-message"],
6503
- "invalid": [4]
6993
+ "invalid": [4],
6994
+ "formDisabled": [32]
6504
6995
  },
6505
6996
  "$listeners$": undefined,
6506
6997
  "$lazyBundleId$": "-",
6507
- "$attrsToReflect$": []
6998
+ "$attrsToReflect$": [["name", "name"], ["disabled", "disabled"], ["required", "required"]]
6508
6999
  }; }
6509
7000
  }
6510
7001
 
@@ -6593,7 +7084,7 @@ class ChTooltip {
6593
7084
  trigger.setAttribute('aria-describedby', content.id);
6594
7085
  };
6595
7086
  render() {
6596
- return (hAsync(Host, { key: '654d4a12f84c94e014691e911e7c63c6c45b8755' }, hAsync("span", { key: '726269e02fedc37efc39f1561d8b9baf83d6a4cc', class: "anchor" }, hAsync("slot", { key: '876cb19249032d6d1c66f22bd2c255683b6a7f66', name: "trigger", onSlotchange: this.associate }), hAsync("span", { key: '7436eb75b40b33d0b6c8ce194245d4a08a29facb', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, hAsync("slot", { key: '24648cc6078d61803793df011058da9515b466b5', name: "content", onSlotchange: this.associate })))));
7087
+ return (hAsync(Host, { key: 'cebea73595fe515f952e60c72c42e92888e57133' }, hAsync("span", { key: 'c2eadb27d9d89b19d821ae1da93dcb7125d07bb0', class: "anchor" }, hAsync("slot", { key: '9eccdd49e741ffaed3d7d95c54697666e6e13cf0', name: "trigger", onSlotchange: this.associate }), hAsync("span", { key: '0842bbc4061da0be353e58bc897548e75c730e43', class: { 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible } }, hAsync("slot", { key: '43812aac1e6e2853057e6d34f484906a17b16a5a', name: "content", onSlotchange: this.associate })))));
6597
7088
  }
6598
7089
  static get style() { return chTooltipCss(); }
6599
7090
  static get cmpMeta() { return {
@@ -6619,6 +7110,7 @@ registerComponents([
6619
7110
  ChCard,
6620
7111
  ChCheckbox,
6621
7112
  ChDivider,
7113
+ ChEmoji,
6622
7114
  ChInput,
6623
7115
  ChLink,
6624
7116
  ChModal,
@@ -6730,7 +7222,7 @@ var NAMESPACE = (
6730
7222
  );
6731
7223
 
6732
7224
  /*
6733
- Stencil Hydrate Runner v4.44.0 | MIT Licensed | https://stenciljs.com
7225
+ Stencil Hydrate Runner v4.44.2 | MIT Licensed | https://stenciljs.com
6734
7226
  */
6735
7227
  var __create = Object.create;
6736
7228
  var __defProp = Object.defineProperty;