@haiilo/catalyst 2.4.9 → 2.5.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 (57) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/index.cdn.js +1 -0
  4. package/dist/catalyst/p-2fdb52c9.entry.js +2 -0
  5. package/dist/catalyst/p-2fdb52c9.entry.js.map +1 -0
  6. package/dist/catalyst/scss/_variables.scss +11 -11
  7. package/dist/cjs/{cat-alert_23.cjs.entry.js → cat-alert_24.cjs.entry.js} +63 -7
  8. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -0
  9. package/dist/cjs/catalyst.cjs.js +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/collection-manifest.json +1 -0
  12. package/dist/collection/components/cat-form-group/cat-form-group.css +3 -0
  13. package/dist/collection/components/cat-form-group/cat-form-group.js +66 -0
  14. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -0
  15. package/dist/collection/components/cat-input/cat-input.js +27 -1
  16. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  17. package/dist/collection/components/cat-label/cat-label.js +27 -1
  18. package/dist/collection/components/cat-label/cat-label.js.map +1 -1
  19. package/dist/collection/components/cat-select/cat-select.js +47 -4
  20. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  21. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  22. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  23. package/dist/collection/components/cat-textarea/cat-textarea.js +31 -1
  24. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  25. package/dist/collection/index.cdn.js +1 -0
  26. package/dist/collection/scss/_variables.scss +11 -11
  27. package/dist/components/cat-form-group.d.ts +11 -0
  28. package/dist/components/cat-form-group.js +64 -0
  29. package/dist/components/cat-form-group.js.map +1 -0
  30. package/dist/components/cat-input.js +6 -1
  31. package/dist/components/cat-input.js.map +1 -1
  32. package/dist/components/cat-label.js +6 -1
  33. package/dist/components/cat-label.js.map +1 -1
  34. package/dist/components/cat-select-demo.js +1 -1
  35. package/dist/components/cat-select-demo.js.map +1 -1
  36. package/dist/components/cat-select2.js +8 -2
  37. package/dist/components/cat-select2.js.map +1 -1
  38. package/dist/components/cat-textarea.js +7 -1
  39. package/dist/components/cat-textarea.js.map +1 -1
  40. package/dist/components/index.d.ts +1 -0
  41. package/dist/components/index.js +1 -0
  42. package/dist/components/index.js.map +1 -1
  43. package/dist/esm/{cat-alert_23.entry.js → cat-alert_24.entry.js} +63 -8
  44. package/dist/esm/cat-alert_24.entry.js.map +1 -0
  45. package/dist/esm/catalyst.js +1 -1
  46. package/dist/esm/loader.js +1 -1
  47. package/dist/types/components/cat-form-group/cat-form-group.d.ts +16 -0
  48. package/dist/types/components/cat-input/cat-input.d.ts +4 -0
  49. package/dist/types/components/cat-label/cat-label.d.ts +4 -0
  50. package/dist/types/components/cat-select/cat-select.d.ts +13 -5
  51. package/dist/types/components/cat-textarea/cat-textarea.d.ts +4 -0
  52. package/dist/types/components.d.ts +63 -2
  53. package/package.json +2 -2
  54. package/dist/catalyst/p-602c38be.entry.js +0 -2
  55. package/dist/catalyst/p-602c38be.entry.js.map +0 -1
  56. package/dist/cjs/cat-alert_23.cjs.entry.js.map +0 -1
  57. package/dist/esm/cat-alert_23.entry.js.map +0 -1
@@ -31,34 +31,34 @@ $cat-elevation: (
31
31
  0: none,
32
32
  1: (
33
33
  0 0 0 1px cat-token('color.ui.border.default'),
34
- 0 1px 2px rgba(27, 31, 38, 0.05)
34
+ 0 1px 2px rgba(27, 31, 38, 5%)
35
35
  ),
36
36
  2: (
37
37
  0 0 0 1px cat-token('color.ui.border.default'),
38
- 0 1px 2px rgba(27, 31, 38, 0.06),
39
- 0 1px 3px rgba(27, 31, 38, 0.1)
38
+ 0 1px 2px rgba(27, 31, 38, 6%),
39
+ 0 1px 3px rgba(27, 31, 38, 10%)
40
40
  ),
41
41
  3: (
42
42
  0 0 0 1px cat-token('color.ui.border.default'),
43
- 0 2px 4px -2px rgba(27, 31, 38, 0.06),
44
- 0 4px 8px -2px rgba(27, 31, 38, 0.1)
43
+ 0 2px 4px -2px rgba(27, 31, 38, 6%),
44
+ 0 4px 8px -2px rgba(27, 31, 38, 10%)
45
45
  ),
46
46
  4: (
47
47
  0 0 0 1px cat-token('color.ui.border.default'),
48
- 0 4px 6px -2px rgba(27, 31, 38, 0.03),
49
- 0 12px 16px -4px rgba(27, 31, 38, 0.08)
48
+ 0 4px 6px -2px rgba(27, 31, 38, 3%),
49
+ 0 12px 16px -4px rgba(27, 31, 38, 8%)
50
50
  ),
51
51
  5: (
52
52
  0 0 0 1px cat-token('color.ui.border.default'),
53
- 0 8px 8px -4px rgba(27, 31, 38, 0.03),
54
- 0 20px 24px -4px rgba(27, 31, 38, 0.08)
53
+ 0 8px 8px -4px rgba(27, 31, 38, 3%),
54
+ 0 20px 24px -4px rgba(27, 31, 38, 8%)
55
55
  ),
56
56
  6: (
57
57
  0 0 0 1px cat-token('color.ui.border.default'),
58
- 0 24px 48px -12px rgba(27, 31, 38, 0.18)
58
+ 0 24px 48px -12px rgba(27, 31, 38, 18%)
59
59
  ),
60
60
  7: (
61
61
  0 0 0 1px cat-token('color.ui.border.default'),
62
- 0 32px 64px -12px rgba(27, 31, 38, 0.14)
62
+ 0 32px 64px -12px rgba(27, 31, 38, 14%)
63
63
  )
64
64
  );
@@ -1887,6 +1887,45 @@ const CatDropdown = class {
1887
1887
  CatDropdown.OFFSET = 4;
1888
1888
  CatDropdown.style = catDropdownCss;
1889
1889
 
1890
+ const catFormGroupCss = ":host{display:block}";
1891
+
1892
+ const CatFormGroup = class {
1893
+ constructor(hostRef) {
1894
+ index.registerInstance(this, hostRef);
1895
+ this.formElements = [];
1896
+ /**
1897
+ * Whether the labels need a marker to shown if the forms fields are required or optional.<br /><br />
1898
+ * By default, it is set to auto, it will display the mark depending on the number of required and optional fields: <br />
1899
+ * - If there are more required, the optional will be marked.<br />
1900
+ * - If there are less required, it will mark the required.<br /><br />
1901
+ * If a form field had "!", the requiredMarked of the field would not change.
1902
+ */
1903
+ this.requiredMarker = 'auto';
1904
+ }
1905
+ onRequiredMarker(newRequiredMarker) {
1906
+ const updateMarker = newRequiredMarker === 'auto' ? this.calculate(this.formElements) : newRequiredMarker;
1907
+ this.formElements.forEach(element => { var _a; return !((_a = element.requiredMarker) === null || _a === void 0 ? void 0 : _a.endsWith('!')) && (element.requiredMarker = updateMarker); });
1908
+ }
1909
+ render() {
1910
+ return (index.h(index.Host, null, index.h("slot", { onSlotchange: this.onSlotChange.bind(this) })));
1911
+ }
1912
+ onSlotChange() {
1913
+ this.formElements = Array.from(this.hostElement.querySelectorAll('cat-textarea, cat-input, cat-select, cat-label'));
1914
+ this.onRequiredMarker(this.requiredMarker);
1915
+ }
1916
+ calculate(elements) {
1917
+ const formFields = elements.filter(value => value.tagName !== 'CAT-LABEL');
1918
+ const optionalFields = formFields.filter(value => !value.required).length;
1919
+ const requiredFields = formFields.length - optionalFields;
1920
+ return requiredFields >= optionalFields ? 'optional' : 'required';
1921
+ }
1922
+ get hostElement() { return index.getElement(this); }
1923
+ static get watchers() { return {
1924
+ "requiredMarker": ["onRequiredMarker"]
1925
+ }; }
1926
+ };
1927
+ CatFormGroup.style = catFormGroupCss;
1928
+
1890
1929
  const catIconCss = ":host{display:inline-flex;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}span{display:inline-flex}svg{fill:currentColor;stroke:none;transform-origin:center center;height:1em;width:calc(var(--cat-icon-ratio, 1) * 1em)}.icon-xs svg{font-size:0.75rem}.icon-s svg{font-size:1rem}.icon-m svg{font-size:1.25rem}.icon-l svg{font-size:1.5rem}.icon-xl svg{font-size:1.75rem}";
1891
1930
 
1892
1931
  const CatIcon = class {
@@ -1921,6 +1960,10 @@ const CatInput = class {
1921
1960
  this.catBlur = index.createEvent(this, "catBlur", 7);
1922
1961
  this._id = `cat-input-${nextUniqueId$6++}`;
1923
1962
  this.hasSlottedLabel = false;
1963
+ /**
1964
+ * Whether the label need a marker to shown if the input is required or optional.
1965
+ */
1966
+ this.requiredMarker = 'optional';
1924
1967
  /**
1925
1968
  * Whether the input should show a clear button.
1926
1969
  */
@@ -1997,7 +2040,7 @@ const CatInput = class {
1997
2040
  this.value = '';
1998
2041
  }
1999
2042
  render() {
2000
- return (index.h(index.Host, null, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, index.h("span", { part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, !this.required && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.optional'), ")"))))), index.h("div", { class: {
2043
+ return (index.h(index.Host, null, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, index.h("span", { part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, !this.required && this.requiredMarker.startsWith('optional') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.required'), ")"))))), index.h("div", { class: {
2001
2044
  'input-wrapper': true,
2002
2045
  'input-round': this.round,
2003
2046
  'input-disabled': this.disabled
@@ -2028,6 +2071,10 @@ const catLabelCss = ":host{display:inline-flex;align-items:center;min-height:2.5
2028
2071
  const CatLabel = class {
2029
2072
  constructor(hostRef) {
2030
2073
  index.registerInstance(this, hostRef);
2074
+ /**
2075
+ * Whether the label need a marker to shown if the input is required or optional.
2076
+ */
2077
+ this.requiredMarker = 'optional';
2031
2078
  /**
2032
2079
  * A value is required or must be check for the form to be submittable.
2033
2080
  */
@@ -2041,7 +2088,7 @@ const CatLabel = class {
2041
2088
  }
2042
2089
  }
2043
2090
  render() {
2044
- return (index.h(index.Host, null, index.h("label", { htmlFor: this.for, onClick: this.onClick.bind(this) }, index.h("slot", null), !this.required && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.optional'), ")")))));
2091
+ return (index.h(index.Host, null, index.h("label", { htmlFor: this.for, onClick: this.onClick.bind(this) }, index.h("slot", null), !this.required && this.requiredMarker.startsWith('optional') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.required'), ")")))));
2045
2092
  }
2046
2093
  findShadowTarget(id) {
2047
2094
  var _a;
@@ -4211,6 +4258,10 @@ const CatSelect = class {
4211
4258
  this.valueChangedBySelection = false;
4212
4259
  this.state = INIT_STATE;
4213
4260
  this.hasSlottedLabel = false;
4261
+ /**
4262
+ * Whether the label need a marker to shown if the select is required or optional.
4263
+ */
4264
+ this.requiredMarker = 'optional';
4214
4265
  /**
4215
4266
  * Enable multiple selection.
4216
4267
  */
@@ -4444,7 +4495,7 @@ const CatSelect = class {
4444
4495
  });
4445
4496
  }
4446
4497
  render() {
4447
- return (index.h(index.Host, null, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, index.h("span", { part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, !this.required && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.optional'), ")"))))), index.h("div", { class: { 'select-wrapper': true, 'select-disabled': this.disabled }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, index.h("div", { class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (index.h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (index.h("span", { class: {
4498
+ return (index.h(index.Host, null, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, index.h("span", { part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, !this.required && this.requiredMarker.startsWith('optional') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.required'), ")"))))), index.h("div", { class: { 'select-wrapper': true, 'select-disabled': this.disabled }, ref: el => (this.trigger = el), id: this.id, role: "combobox", "aria-expanded": this.state.isOpen || this.isPillboxActive(), "aria-controls": this.isPillboxActive() ? `select-pillbox-${this.id}` : `select-listbox-${this.id}`, "aria-required": this.required ? 'true' : false, "aria-activedescendant": this.activeDescendant, onClick: e => this.onClick(e) }, index.h("div", { class: "select-wrapper-inner" }, this.multiple && this.state.selection.length ? (index.h("div", { id: `select-pillbox-${this.id}`, role: "listbox", "aria-orientation": "horizontal", class: "select-pills" }, this.state.selection.map((item, i) => (index.h("span", { class: {
4448
4499
  pill: true,
4449
4500
  'select-no-open': true,
4450
4501
  'select-option-active': this.state.activeSelectionIndex === i
@@ -4454,7 +4505,7 @@ const CatSelect = class {
4454
4505
  this.clearable ? (index.h("cat-button", { id: `select-clear-btn-${this.id}`, iconOnly: true, icon: "cross-circle-outlined", variant: "text", size: "s", a11yLabel: catIconRegistry.catI18nRegistry.t('input.clear'), onClick: () => this.clear() })) : null, !this.state.isResolving && (index.h("cat-button", { iconOnly: true, icon: "chevron-down-outlined", class: { 'select-btn': true, 'select-btn-open': this.state.isOpen }, variant: "text", size: "s", a11yLabel: this.state.isOpen ? catIconRegistry.catI18nRegistry.t('select.close') : catIconRegistry.catI18nRegistry.t('select.open'), "aria-controls": `select-listbox-${this.id}`, "aria-expanded": this.state.isOpen, tabIndex: -1, disabled: this.disabled || this.state.isResolving }))), this.hintSection, index.h("div", { class: "select-dropdown", ref: el => (this.dropdown = el), style: { display: this.state.isOpen ? 'block' : undefined } }, this.state.isOpen && (index.h("cat-scrollable", { class: "select-options-wrapper", scrolledBuffer: 56, noOverflowX: true, noOverscroll: true, noScrolledInit: true, onScrolledBottom: () => this.more$.next() }, index.h("ul", { class: "select-options", role: "listbox", "aria-multiselectable": this.multiple, "aria-setsize": this.state.totalElements, id: `select-listbox-${this.id}` }, this.optionsList, this.state.isLoading
4455
4506
  ? Array.from(Array(CatSelect.SKELETON_COUNT)).map(() => (index.h("li", { class: "select-option-loading" }, index.h("cat-skeleton", { variant: "body", lines: 1 }), index.h("cat-skeleton", { variant: "body", lines: 1 }))))
4456
4507
  : !this.state.options.length &&
4457
- !this.tags && index.h("li", { class: "select-option-empty" }, catIconRegistry.catI18nRegistry.t('select.empty'))))))));
4508
+ !this.tags && (index.h("li", { class: "select-option-empty" }, this.noItems ? this.noItems : catIconRegistry.catI18nRegistry.t('select.empty')))))))));
4458
4509
  }
4459
4510
  get optionsList() {
4460
4511
  return this.state.options.map((item, i) => {
@@ -4881,7 +4932,7 @@ const CatSelectTest = class {
4881
4932
  setTimeout(() => this.multipleSelect && (this.multipleSelect.value = []), 5000);
4882
4933
  }
4883
4934
  render() {
4884
- return (index.h(index.Host, { style: { display: 'flex', flexDirection: 'column' } }, index.h("cat-select", { label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => { var _a; return console.log((_a = this.multipleSelect) === null || _a === void 0 ? void 0 : _a.value); }, onCatBlur: e => console.log('Multiple blur', e), multiple: true, clearable: true }, index.h("span", { slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), index.h("cat-select", { label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true }), index.h("cat-select", { label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => { var _a; return console.log((_a = this.multipleSelectTagging) === null || _a === void 0 ? void 0 : _a.value); }, multiple: true, tags: true, clearable: true }), index.h("cat-select", { label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true }), index.h("cat-select", { label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', onCatChange: () => { var _a; return console.log((_a = this.singleSelectAvatar) === null || _a === void 0 ? void 0 : _a.value); }, placeholder: "Search for a country or capital", clearable: true }), index.h("cat-dropdown", { overflow: true, noAutoClose: true }, index.h("cat-button", { slot: "trigger", style: { width: '50%' } }, "Open select"), index.h("div", { slot: "content", style: { width: '400px' } }, index.h("cat-select", { label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => { var _a; return console.log('Single', (_a = this.singleSelectTagging) === null || _a === void 0 ? void 0 : _a.value); }, tagHint: "new country", tags: true, clearable: true, style: { width: '90%' } })))));
4935
+ return (index.h(index.Host, { style: { display: 'flex', flexDirection: 'column' } }, index.h("cat-select", { label: "Multiple Select", hint: "This is a hint!", ref: el => (this.multipleSelect = el), value: ['1'], placeholder: "Hello World", onCatChange: () => { var _a; return console.log((_a = this.multipleSelect) === null || _a === void 0 ? void 0 : _a.value); }, onCatBlur: e => console.log('Multiple blur', e), multiple: true, noItems: "No results", clearable: true }, index.h("span", { slot: "hint" }, "Searching for \"no\" -", '>', " no options are returned!")), index.h("cat-select", { label: "Multiple with img", ref: el => (this.multipleSelectAvatar = el), value: ['1'], placeholder: "Hello World", multiple: true, clearable: true }), index.h("cat-select", { label: "Multiple with tagging support", hint: "This is a hint!", ref: el => (this.multipleSelectTagging = el), value: { ids: ['1'], tags: ['Test', 'Albania', 'Algeria'] }, placeholder: "Select country", onCatChange: () => { var _a; return console.log((_a = this.multipleSelectTagging) === null || _a === void 0 ? void 0 : _a.value); }, multiple: true, tags: true, clearable: true }), index.h("cat-select", { label: "Single Select", hint: "This is a hint!", ref: el => (this.singleSelect = el), placeholder: "Search for a country or capital", onCatBlur: e => console.log('Single blur', e), clearable: true }), index.h("cat-select", { label: "Single with img", ref: el => (this.singleSelectAvatar = el), value: '1', onCatChange: () => { var _a; return console.log((_a = this.singleSelectAvatar) === null || _a === void 0 ? void 0 : _a.value); }, placeholder: "Search for a country or capital", clearable: true }), index.h("cat-dropdown", { overflow: true, noAutoClose: true }, index.h("cat-button", { slot: "trigger", style: { width: '50%' } }, "Open select"), index.h("div", { slot: "content", style: { width: '400px' } }, index.h("cat-select", { label: "Single with tagging support", ref: el => (this.singleSelectTagging = el), value: { id: '', tag: 'Albania' }, placeholder: "Search for a country or capital", onCatChange: () => { var _a; return console.log('Single', (_a = this.singleSelectTagging) === null || _a === void 0 ? void 0 : _a.value); }, tagHint: "new country", tags: true, clearable: true, style: { width: '90%' } })))));
4885
4936
  }
4886
4937
  get countryConnector() {
4887
4938
  return {
@@ -6328,6 +6379,10 @@ const CatTextarea = class {
6328
6379
  this.catBlur = index.createEvent(this, "catBlur", 7);
6329
6380
  this._id = `cat-textarea-${nextUniqueId$2++}`;
6330
6381
  this.hasSlottedLabel = false;
6382
+ /**
6383
+ * Whether the label need a marker to shown if the textarea is required or optional.
6384
+ */
6385
+ this.requiredMarker = 'optional';
6331
6386
  /**
6332
6387
  * Whether the textarea is disabled.
6333
6388
  */
@@ -6389,7 +6444,7 @@ const CatTextarea = class {
6389
6444
  this.textarea.click();
6390
6445
  }
6391
6446
  render() {
6392
- return (index.h(index.Host, null, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, index.h("span", { part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, !this.required && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(Optional)"))))), index.h("textarea", { ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), this.hintSection));
6447
+ return (index.h(index.Host, null, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, index.h("span", { part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, !this.required && this.requiredMarker.startsWith('optional') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.optional'), ")")), this.required && this.requiredMarker.startsWith('required') && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(", catIconRegistry.catI18nRegistry.t('input.required'), ")"))))), index.h("textarea", { ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), this.hintSection));
6393
6448
  }
6394
6449
  get hintSection() {
6395
6450
  const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
@@ -6655,6 +6710,7 @@ exports.cat_button = CatButton;
6655
6710
  exports.cat_card = CatCard;
6656
6711
  exports.cat_checkbox = CatCheckbox;
6657
6712
  exports.cat_dropdown = CatDropdown;
6713
+ exports.cat_form_group = CatFormGroup;
6658
6714
  exports.cat_icon = CatIcon;
6659
6715
  exports.cat_input = CatInput;
6660
6716
  exports.cat_label = CatLabel;
@@ -6672,4 +6728,4 @@ exports.cat_textarea = CatTextarea;
6672
6728
  exports.cat_toggle = CatToggle;
6673
6729
  exports.cat_tooltip = CatTooltip;
6674
6730
 
6675
- //# sourceMappingURL=cat-alert_23.cjs.entry.js.map
6731
+ //# sourceMappingURL=cat-alert_24.cjs.entry.js.map