@haiilo/catalyst 0.14.1 → 0.15.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 (81) 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 +37 -15
  4. package/dist/catalyst/p-01da674e.entry.js +12 -0
  5. package/dist/catalyst/p-01da674e.entry.js.map +1 -0
  6. package/dist/catalyst/p-a255bd64.js +3 -0
  7. package/dist/catalyst/p-a255bd64.js.map +1 -0
  8. package/dist/cjs/{cat-alert_22.cjs.entry.js → cat-alert_24.cjs.entry.js} +2264 -50
  9. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -0
  10. package/dist/cjs/catalyst.cjs.js +2 -2
  11. package/dist/cjs/{index-158dcabf.js → index-c7955116.js} +1 -4
  12. package/dist/cjs/index-c7955116.js.map +1 -0
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/collection/collection-manifest.json +2 -0
  15. package/dist/collection/components/cat-badge/cat-badge.css +5 -5
  16. package/dist/collection/components/cat-button/cat-button.css +4 -0
  17. package/dist/collection/components/cat-checkbox/cat-checkbox.css +1 -0
  18. package/dist/collection/components/cat-checkbox/cat-checkbox.js +9 -6
  19. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  20. package/dist/collection/components/cat-input/cat-input.css +1 -0
  21. package/dist/collection/components/cat-scrollable/cat-scrollable.css +0 -1
  22. package/dist/collection/components/cat-select-remote/cat-select-remote.css +209 -0
  23. package/dist/collection/components/cat-select-remote/cat-select-remote.js +778 -0
  24. package/dist/collection/components/cat-select-remote/cat-select-remote.js.map +1 -0
  25. package/dist/collection/components/cat-select-remote-test/cat-select-remote-test.js +1288 -0
  26. package/dist/collection/components/cat-select-remote-test/cat-select-remote-test.js.map +1 -0
  27. package/dist/collection/components/cat-toggle/cat-toggle.js +9 -6
  28. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  29. package/dist/collection/index.cdn.js +37 -15
  30. package/dist/components/cat-badge.js +1 -1
  31. package/dist/components/cat-badge.js.map +1 -1
  32. package/dist/components/cat-button2.js +1 -1
  33. package/dist/components/cat-button2.js.map +1 -1
  34. package/dist/components/cat-checkbox.js +1 -112
  35. package/dist/components/cat-checkbox.js.map +1 -1
  36. package/dist/components/cat-checkbox2.js +119 -0
  37. package/dist/components/cat-checkbox2.js.map +1 -0
  38. package/dist/components/cat-input.js +1 -1
  39. package/dist/components/cat-input.js.map +1 -1
  40. package/dist/components/cat-scrollable.js +1 -1355
  41. package/dist/components/cat-scrollable.js.map +1 -1
  42. package/dist/components/cat-scrollable2.js +1359 -0
  43. package/dist/components/cat-scrollable2.js.map +1 -0
  44. package/dist/components/cat-select-remote-test.d.ts +11 -0
  45. package/dist/components/cat-select-remote-test.js +1368 -0
  46. package/dist/components/cat-select-remote-test.js.map +1 -0
  47. package/dist/components/cat-select-remote.d.ts +11 -0
  48. package/dist/components/cat-select-remote.js +8 -0
  49. package/dist/components/cat-select-remote.js.map +1 -0
  50. package/dist/components/cat-select-remote2.js +980 -0
  51. package/dist/components/cat-select-remote2.js.map +1 -0
  52. package/dist/components/cat-skeleton.js +1 -71
  53. package/dist/components/cat-skeleton.js.map +1 -1
  54. package/dist/components/cat-skeleton2.js +75 -0
  55. package/dist/components/cat-skeleton2.js.map +1 -0
  56. package/dist/components/cat-toggle.js +7 -4
  57. package/dist/components/cat-toggle.js.map +1 -1
  58. package/dist/components/index.d.ts +2 -0
  59. package/dist/components/index.js +2 -0
  60. package/dist/components/index.js.map +1 -1
  61. package/dist/esm/{cat-alert_22.entry.js → cat-alert_24.entry.js} +2263 -51
  62. package/dist/esm/cat-alert_24.entry.js.map +1 -0
  63. package/dist/esm/catalyst.js +2 -2
  64. package/dist/esm/{index-62388101.js → index-17d2bcf3.js} +2 -4
  65. package/dist/esm/index-17d2bcf3.js.map +1 -0
  66. package/dist/esm/loader.js +2 -2
  67. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -1
  68. package/dist/types/components/cat-select-remote/autosize.d.ts +1 -0
  69. package/dist/types/components/cat-select-remote/cat-select-remote.d.ts +141 -0
  70. package/dist/types/components/cat-select-remote-test/cat-select-remote-test.d.ts +6 -0
  71. package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -1
  72. package/dist/types/components.d.ts +145 -4
  73. package/package.json +5 -4
  74. package/dist/catalyst/p-153d4fb8.js +0 -3
  75. package/dist/catalyst/p-153d4fb8.js.map +0 -1
  76. package/dist/catalyst/p-57d68cab.entry.js +0 -12
  77. package/dist/catalyst/p-57d68cab.entry.js.map +0 -1
  78. package/dist/cjs/cat-alert_22.cjs.entry.js.map +0 -1
  79. package/dist/cjs/index-158dcabf.js.map +0 -1
  80. package/dist/esm/cat-alert_22.entry.js.map +0 -1
  81. package/dist/esm/index-62388101.js.map +0 -1
@@ -90,35 +90,35 @@
90
90
 
91
91
  .badge-xs {
92
92
  height: 1rem;
93
- min-width: 0.75rem;
93
+ min-width: 1rem;
94
94
  font-size: 12px;
95
95
  padding: 0 0.25rem;
96
96
  }
97
97
 
98
98
  .badge-s {
99
99
  height: 1.5rem;
100
- min-width: 1rem;
100
+ min-width: 1.5rem;
101
101
  font-size: 12px;
102
102
  padding: 0 0.5rem;
103
103
  }
104
104
 
105
105
  .badge-m {
106
106
  height: 2rem;
107
- min-width: 1.25rem;
107
+ min-width: 2rem;
108
108
  font-size: 13px;
109
109
  padding: 0 0.75rem;
110
110
  }
111
111
 
112
112
  .badge-l {
113
113
  height: 2.5rem;
114
- min-width: 1.5rem;
114
+ min-width: 2.5rem;
115
115
  font-size: 15px;
116
116
  padding: 0 1rem;
117
117
  }
118
118
 
119
119
  .badge-xl {
120
120
  height: 3rem;
121
- min-width: 1.75rem;
121
+ min-width: 3rem;
122
122
  font-size: 18px;
123
123
  padding: 0 1rem;
124
124
  }
@@ -37,6 +37,10 @@
37
37
  outline-offset: 1px;
38
38
  }
39
39
 
40
+ .cat-button-content {
41
+ word-wrap: break-word;
42
+ word-break: break-word;
43
+ }
40
44
  .cat-button-ellipsed .cat-button-content {
41
45
  /* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
42
46
  overflow: hidden;
@@ -111,6 +111,7 @@ input {
111
111
 
112
112
  .label {
113
113
  flex: 1 1 auto;
114
+ min-width: 0;
114
115
  }
115
116
  .is-hidden .label {
116
117
  position: absolute !important;
@@ -67,7 +67,7 @@ export class CatCheckbox {
67
67
  render() {
68
68
  return (h(Host, null,
69
69
  h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } },
70
- h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }),
70
+ h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }),
71
71
  h("span", { class: "box", "aria-hidden": "true", part: "checkbox" },
72
72
  h("svg", { class: "check", viewBox: "0 0 12 10" },
73
73
  h("polyline", { points: "1.5 6 4.5 9 10.5 1" })),
@@ -81,7 +81,10 @@ export class CatCheckbox {
81
81
  return ((this.hint || hasSlottedHint) && (h(CatFormHint, { hint: this.hint, slottedHint: hasSlottedHint && h("slot", { name: "hint" }) })));
82
82
  }
83
83
  onInput(event) {
84
- this.value = this.input.value;
84
+ this.checked = this.input.checked;
85
+ if (!this.value || typeof this.value === 'boolean') {
86
+ this.value = this.checked;
87
+ }
85
88
  this.catChange.emit(event);
86
89
  }
87
90
  onFocus(event) {
@@ -101,7 +104,7 @@ export class CatCheckbox {
101
104
  static get properties() { return {
102
105
  "checked": {
103
106
  "type": "boolean",
104
- "mutable": false,
107
+ "mutable": true,
105
108
  "complexType": {
106
109
  "original": "boolean",
107
110
  "resolved": "boolean",
@@ -225,11 +228,11 @@ export class CatCheckbox {
225
228
  "defaultValue": "false"
226
229
  },
227
230
  "value": {
228
- "type": "string",
231
+ "type": "any",
229
232
  "mutable": true,
230
233
  "complexType": {
231
- "original": "string",
232
- "resolved": "string | undefined",
234
+ "original": "string | boolean",
235
+ "resolved": "boolean | string | undefined",
233
236
  "references": {}
234
237
  },
235
238
  "required": false,
@@ -1 +1 @@
1
- {"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;EALxB;IAMmB,OAAE,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;IAK9C,oBAAe,GAAG,KAAK,CAAC;IAEjC;;OAEG;IACK,YAAO,GAAG,KAAK,CAAC;IAExB;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,kBAAa,GAAG,KAAK,CAAC;IAE9B;;OAEG;IACK,UAAK,GAAG,EAAE,CAAC;IAEnB;;OAEG;IACK,gBAAW,GAAG,KAAK,CAAC;IAO5B;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAYzB;;OAEG;IACK,cAAS,GAAG,KAAK,CAAC;GAmG3B;EAlFC,gBAAgB;IACd,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,EAAE;MACpC,IAAI,CAAC,KAAK,CAAC,a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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Checkboxes are used to let a user choose one or more options from a limited\n * number of options.\n *\n * @slot hint - Optional hint element to be displayed with the checkbox.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part checkbox - The checkbox element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\n shadow: true\n})\nexport class CatCheckbox {\n private readonly id = `cat-checkbox-${nextUniqueId++}`;\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Checked state of the checkbox\n */\n @Prop() checked = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop() indeterminate = false;\n\n /**\n * Label of the checkbox which is presented in the UI\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the input\n */\n @Prop() name?: string;\n\n /**\n * Required state of the checkbox\n */\n @Prop() required = false;\n\n /**\n * The value of the checkbox\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * Optional hint text(s) to be displayed with the checkbox.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the checkbox.\n */\n @Prop() labelLeft = false;\n\n /**\n * Emitted when the checked status of the checkbox is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the checkbox received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad() {\n if (this.input && this.indeterminate) {\n this.input.indeterminate = true;\n }\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Sets focus on the checkbox. Use this method instead of `checkbox.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n >\n <input\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"box\" aria-hidden=\"true\" part=\"checkbox\">\n <svg class=\"check\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n <svg class=\"dash\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 5 10.5 5\"></polyline>\n </svg>\n </span>\n <span class=\"label\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hintSection}\n </Host>\n );\n }\n\n private get hintSection() {\n const hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n return (\n (this.hint || hasSlottedHint) && (\n <CatFormHint hint={this.hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n )\n );\n }\n\n private onInput(event: Event) {\n this.value = this.input.value;\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"]}
1
+ {"version":3,"file":"cat-checkbox.js","sourceRoot":"","sources":["../../../src/components/cat-checkbox/cat-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;GAQG;AAMH,MAAM,OAAO,WAAW;EALxB;IAMmB,OAAE,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;IAK9C,oBAAe,GAAG,KAAK,CAAC;IAEjC;;OAEG;IACsB,YAAO,GAAG,KAAK,CAAC;IAEzC;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACK,kBAAa,GAAG,KAAK,CAAC;IAE9B;;OAEG;IACK,UAAK,GAAG,EAAE,CAAC;IAEnB;;OAEG;IACK,gBAAW,GAAG,KAAK,CAAC;IAO5B;;OAEG;IACK,aAAQ,GAAG,KAAK,CAAC;IAYzB;;OAEG;IACK,cAAS,GAAG,KAAK,CAAC;GAuG3B;EAtFC,gBAAgB;IACd,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,EAAE;MACpC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;KACjC;EACH,CAAC;EAED,mBAAmB;IACjB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1E,IAAI,CAAC,IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Checkboxes are used to let a user choose one or more options from a limited\n * number of options.\n *\n * @slot hint - Optional hint element to be displayed with the checkbox.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part checkbox - The checkbox element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-checkbox',\n styleUrls: ['cat-checkbox.scss'],\n shadow: true\n})\nexport class CatCheckbox {\n private readonly id = `cat-checkbox-${nextUniqueId++}`;\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Checked state of the checkbox\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the checkbox\n */\n @Prop() disabled = false;\n\n /**\n * Indeterminate state of the checkbox\n */\n @Prop() indeterminate = false;\n\n /**\n * Label of the checkbox which is presented in the UI\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * The name of the input\n */\n @Prop() name?: string;\n\n /**\n * Required state of the checkbox\n */\n @Prop() required = false;\n\n /**\n * The value of the checkbox\n */\n @Prop({ mutable: true }) value?: string | boolean;\n\n /**\n * Optional hint text(s) to be displayed with the checkbox.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the checkbox.\n */\n @Prop() labelLeft = false;\n\n /**\n * Emitted when the checked status of the checkbox is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the checkbox received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the checkbox loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad() {\n if (this.input && this.indeterminate) {\n this.input.indeterminate = true;\n }\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Sets focus on the checkbox. Use this method instead of `checkbox.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n render() {\n return (\n <Host>\n <label\n htmlFor={this.id}\n class={{ 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }}\n >\n <input\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n type=\"checkbox\"\n name={this.name}\n value={this.value !== undefined ? String(this.value) : this.value}\n checked={this.checked}\n required={this.required}\n disabled={this.disabled}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"box\" aria-hidden=\"true\" part=\"checkbox\">\n <svg class=\"check\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 6 4.5 9 10.5 1\"></polyline>\n </svg>\n <svg class=\"dash\" viewBox=\"0 0 12 10\">\n <polyline points=\"1.5 5 10.5 5\"></polyline>\n </svg>\n </span>\n <span class=\"label\" part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n </span>\n </label>\n {this.hintSection}\n </Host>\n );\n }\n\n private get hintSection() {\n const hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n return (\n (this.hint || hasSlottedHint) && (\n <CatFormHint hint={this.hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n )\n );\n }\n\n private onInput(event: Event) {\n this.checked = this.input.checked;\n\n if (!this.value || typeof this.value === 'boolean') {\n this.value = this.checked;\n }\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"]}
@@ -108,6 +108,7 @@ label.hidden {
108
108
 
109
109
  .input-inner-wrapper {
110
110
  display: flex;
111
+ align-items: center;
111
112
  position: relative;
112
113
  flex: 1 1 auto;
113
114
  }
@@ -57,7 +57,6 @@
57
57
  .scrollable-content {
58
58
  width: 100%;
59
59
  overflow: hidden;
60
- white-space: nowrap;
61
60
  }
62
61
  .scrollable-content.scroll-x {
63
62
  overflow-x: auto;
@@ -0,0 +1,209 @@
1
+ /**
2
+ * Auto-generated file. Do not edit directly.
3
+ */
4
+ /* stylelint-disable value-keyword-case */
5
+ /* stylelint-enable value-keyword-case */
6
+ .hint-section {
7
+ display: flex;
8
+ gap: 0.5rem;
9
+ flex-direction: column;
10
+ }
11
+ .hint-section .input-hint,
12
+ .hint-section ::slotted([slot=hint]) {
13
+ font-size: 0.875rem;
14
+ line-height: 1rem;
15
+ font-weight: var(--cat-font-weight-body, 400);
16
+ margin: 0;
17
+ }
18
+
19
+ :host {
20
+ display: flex;
21
+ flex-direction: column;
22
+ gap: 0.5rem;
23
+ position: relative;
24
+ }
25
+
26
+ :host([hidden]) {
27
+ display: none;
28
+ }
29
+
30
+ label {
31
+ align-self: flex-start;
32
+ }
33
+ label.hidden {
34
+ position: absolute !important;
35
+ width: 1px !important;
36
+ height: 1px !important;
37
+ padding: 0 !important;
38
+ margin: -1px !important;
39
+ overflow: hidden !important;
40
+ clip: rect(0, 0, 0, 0) !important;
41
+ white-space: nowrap !important;
42
+ border: 0 !important;
43
+ }
44
+
45
+ .input-optional {
46
+ margin-left: 0.25rem;
47
+ font-size: 0.75rem;
48
+ line-height: 1rem;
49
+ font-weight: var(--cat-font-weight-body, 400);
50
+ color: rgb(var(--cat-font-color-muted, 105, 118, 135));
51
+ }
52
+
53
+ .select-wrapper {
54
+ display: flex;
55
+ align-items: flex-start;
56
+ background: white;
57
+ border-radius: 0.25rem;
58
+ box-shadow: 0 0 0 1px #d7dbe0;
59
+ transition: box-shadow 0.13s linear;
60
+ padding: 4px;
61
+ }
62
+ .select-wrapper:not(.select-disabled):hover {
63
+ box-shadow: 0 0 0 2px #d7dbe0;
64
+ }
65
+ .select-wrapper:not(.select-disabled):focus-within {
66
+ outline: 2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));
67
+ }
68
+
69
+ .select-disabled {
70
+ background: #f8f8fb;
71
+ cursor: not-allowed;
72
+ color: rgb(var(--cat-font-color-muted, 105, 118, 135));
73
+ }
74
+
75
+ .select-wrapper-inner {
76
+ display: flex;
77
+ flex: 1 1 auto;
78
+ flex-wrap: wrap;
79
+ align-items: center;
80
+ gap: 4px;
81
+ min-width: 0;
82
+ }
83
+
84
+ .select-input {
85
+ font: inherit;
86
+ background: none;
87
+ border: none;
88
+ outline: none;
89
+ padding: 6px 8px;
90
+ flex: 1 1 auto;
91
+ /* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ white-space: nowrap;
95
+ /* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
96
+ }
97
+ .select-disabled .select-input {
98
+ cursor: inherit;
99
+ }
100
+
101
+ .select-pills {
102
+ display: contents;
103
+ }
104
+
105
+ .pill {
106
+ display: inline-flex;
107
+ align-items: center;
108
+ gap: 4px;
109
+ padding: 4px 8px;
110
+ background: #ebecf0;
111
+ border-radius: 0.125rem;
112
+ white-space: nowrap;
113
+ min-width: 0;
114
+ }
115
+ .pill > span {
116
+ overflow: hidden;
117
+ text-overflow: ellipsis;
118
+ }
119
+ .pill > cat-button {
120
+ margin-right: -4px;
121
+ }
122
+
123
+ .select-btn {
124
+ transition: transform 0.13s linear;
125
+ }
126
+ .select-btn::part(button) {
127
+ outline: none;
128
+ }
129
+
130
+ cat-spinner {
131
+ padding: 6px;
132
+ }
133
+
134
+ .select-btn-open {
135
+ transform: rotate(180deg);
136
+ }
137
+
138
+ .select-dropdown {
139
+ position: absolute;
140
+ right: 0;
141
+ background: white;
142
+ display: none;
143
+ overflow: auto;
144
+ box-shadow: 0 1px 4px 0 rgba(16, 29, 48, 0.2);
145
+ border-radius: 0.25rem;
146
+ z-index: 100;
147
+ }
148
+
149
+ .select-options-wrapper {
150
+ max-height: 16rem;
151
+ width: 100%;
152
+ }
153
+
154
+ .select-empty {
155
+ margin: 1rem 0;
156
+ padding: 0 1.25rem;
157
+ }
158
+
159
+ .select-options {
160
+ list-style-type: none;
161
+ margin: 0;
162
+ padding: 0.5rem 0;
163
+ }
164
+ .select-options cat-checkbox,
165
+ .select-options .select-option-single {
166
+ margin: 0;
167
+ padding: 0.5rem 1rem;
168
+ }
169
+
170
+ .select-option-single {
171
+ cursor: pointer;
172
+ }
173
+
174
+ .select-input-transparent-caret {
175
+ caret-color: transparent;
176
+ }
177
+
178
+ .select-option-empty,
179
+ .select-option-loading {
180
+ padding: 0.5rem 1rem;
181
+ }
182
+
183
+ .select-option:hover {
184
+ background-color: rgba(105, 118, 135, 0.05);
185
+ }
186
+
187
+ .select-option-active {
188
+ outline: 2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));
189
+ outline-offset: -2px;
190
+ }
191
+
192
+ .select-option-label {
193
+ /* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
194
+ display: -webkit-box;
195
+ -webkit-line-clamp: 2;
196
+ -webkit-box-orient: vertical;
197
+ overflow: hidden;
198
+ /* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
199
+ }
200
+
201
+ .select-option-description {
202
+ /* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
203
+ display: -webkit-box;
204
+ -webkit-line-clamp: 2;
205
+ -webkit-box-orient: vertical;
206
+ overflow: hidden;
207
+ /* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
208
+ color: rgb(var(--cat-font-color-muted, 105, 118, 135));
209
+ }