@haiilo/catalyst 2.3.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/catalyst/catalyst.css +1 -1
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/p-e5f9669a.entry.js +2 -0
  5. package/dist/catalyst/p-e5f9669a.entry.js.map +1 -0
  6. package/dist/catalyst/scss/core/_typography.scss +5 -4
  7. package/dist/cjs/{cat-alert_22.cjs.entry.js → cat-alert_23.cjs.entry.js} +71 -49
  8. package/dist/cjs/cat-alert_23.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-alert/cat-alert.js +2 -3
  13. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  14. package/dist/collection/components/cat-badge/cat-badge.js +6 -31
  15. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  16. package/dist/collection/components/cat-checkbox/cat-checkbox.js +21 -1
  17. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  18. package/dist/collection/components/cat-input/cat-input.js +24 -9
  19. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  20. package/dist/collection/components/cat-label/cat-label.css +16 -0
  21. package/dist/collection/components/cat-label/cat-label.js +96 -0
  22. package/dist/collection/components/cat-label/cat-label.js.map +1 -0
  23. package/dist/collection/components/cat-radio/cat-radio.js +22 -2
  24. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  25. package/dist/collection/components/cat-select/cat-select.js +24 -9
  26. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  27. package/dist/collection/components/cat-textarea/cat-textarea.js +24 -9
  28. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  29. package/dist/collection/components/cat-toggle/cat-toggle.js +21 -1
  30. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  31. package/dist/collection/scss/core/_typography.scss +5 -4
  32. package/dist/collection/utils/setDefault.js +0 -6
  33. package/dist/collection/utils/setDefault.js.map +1 -1
  34. package/dist/components/cat-alert.js +7 -3
  35. package/dist/components/cat-alert.js.map +1 -1
  36. package/dist/components/cat-badge.js +5 -25
  37. package/dist/components/cat-badge.js.map +1 -1
  38. package/dist/components/cat-checkbox2.js +5 -1
  39. package/dist/components/cat-checkbox2.js.map +1 -1
  40. package/dist/components/cat-dropdown2.js.map +1 -1
  41. package/dist/components/cat-input.js +5 -5
  42. package/dist/components/cat-input.js.map +1 -1
  43. package/dist/components/cat-label.d.ts +11 -0
  44. package/dist/components/cat-label.js +71 -0
  45. package/dist/components/cat-label.js.map +1 -0
  46. package/dist/components/cat-radio.js +6 -2
  47. package/dist/components/cat-radio.js.map +1 -1
  48. package/dist/components/cat-select2.js +5 -5
  49. package/dist/components/cat-select2.js.map +1 -1
  50. package/dist/components/cat-textarea.js +5 -5
  51. package/dist/components/cat-textarea.js.map +1 -1
  52. package/dist/components/cat-toggle.js +5 -1
  53. package/dist/components/cat-toggle.js.map +1 -1
  54. package/dist/components/index.d.ts +1 -0
  55. package/dist/components/index.js +1 -0
  56. package/dist/components/index.js.map +1 -1
  57. package/dist/esm/{cat-alert_22.entry.js → cat-alert_23.entry.js} +71 -50
  58. package/dist/esm/cat-alert_23.entry.js.map +1 -0
  59. package/dist/esm/catalyst.js +1 -1
  60. package/dist/esm/loader.js +1 -1
  61. package/dist/types/components/cat-badge/cat-badge.d.ts +0 -4
  62. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +6 -1
  63. package/dist/types/components/cat-input/cat-input.d.ts +7 -2
  64. package/dist/types/components/cat-label/cat-label.d.ts +17 -0
  65. package/dist/types/components/cat-radio/cat-radio.d.ts +6 -1
  66. package/dist/types/components/cat-select/cat-select.d.ts +7 -2
  67. package/dist/types/components/cat-textarea/cat-textarea.d.ts +7 -2
  68. package/dist/types/components/cat-toggle/cat-toggle.d.ts +6 -1
  69. package/dist/types/components.d.ts +80 -3
  70. package/dist/types/utils/setDefault.d.ts +0 -6
  71. package/package.json +2 -2
  72. package/dist/catalyst/p-757cf2e8.entry.js +0 -2
  73. package/dist/catalyst/p-757cf2e8.entry.js.map +0 -1
  74. package/dist/cjs/cat-alert_22.cjs.entry.js.map +0 -1
  75. package/dist/components/setDefault.js +0 -18
  76. package/dist/components/setDefault.js.map +0 -1
  77. package/dist/esm/cat-alert_22.entry.js.map +0 -1
@@ -13,7 +13,7 @@ let nextUniqueId = 0;
13
13
  */
14
14
  export class CatToggle {
15
15
  constructor() {
16
- this.id = `cat-toggle-${nextUniqueId++}`;
16
+ this._id = `cat-toggle-${nextUniqueId++}`;
17
17
  this.hasSlottedLabel = false;
18
18
  /**
19
19
  * Checked state of the toggle.
@@ -40,6 +40,9 @@ export class CatToggle {
40
40
  */
41
41
  this.labelLeft = false;
42
42
  }
43
+ get id() {
44
+ return this.identifier || this._id;
45
+ }
43
46
  componentWillRender() {
44
47
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
45
48
  if (!this.label && !this.hasSlottedLabel) {
@@ -139,6 +142,23 @@ export class CatToggle {
139
142
  "reflect": false,
140
143
  "defaultValue": "false"
141
144
  },
145
+ "identifier": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string",
150
+ "resolved": "string | undefined",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": true,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": "A unique identifier for the input."
158
+ },
159
+ "attribute": "identifier",
160
+ "reflect": false
161
+ },
142
162
  "label": {
143
163
  "type": "string",
144
164
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"cat-toggle.js","sourceRoot":"","sources":["../../../src/components/cat-toggle/cat-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA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I,CAAC,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IACzE,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAC/B,EAAC,WAAW,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ,GAAI,CAC3F,CACF,CAAC;EACJ,CAAC;EAEO,OAAO,CAAC,KAAY;IAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAElC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;MAClD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;KAC3B;IACD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC7B,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 * Toggles are graphical interface switches that give user control over a\n * feature or option that can be turned on or off.\n *\n * @slot hint - Optional hint element to be displayed with the toggle.\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 toggle - The toggle element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-toggle',\n styleUrls: ['cat-toggle.scss'],\n shadow: true\n})\nexport class CatToggle {\n private readonly id = `cat-toggle-${nextUniqueId++}`;\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Checked state of the toggle.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * The label of the toggle that is visible.\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 toggle.\n */\n @Prop() required = false;\n\n /**\n * The value of the toggle\n */\n @Prop({ mutable: true }) value?: string | boolean;\n\n /**\n * Optional hint text(s) to be displayed with the toggle.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the toggle.\n */\n @Prop() labelLeft = false;\n\n /**\n * Emitted when the checked status of the toggle is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the toggle received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Programmatically move focus to the toggle. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the toggle. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the toggle.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\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 class=\"form-check-input\"\n role=\"switch\"\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"toggle\" part=\"toggle\"></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"]}
1
+ {"version":3,"file":"cat-toggle.js","sourceRoot":"","sources":["../../../src/components/cat-toggle/cat-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,E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';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Toggles are graphical interface switches that give user control over a\n * feature or option that can be turned on or off.\n *\n * @slot hint - Optional hint element to be displayed with the toggle.\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 toggle - The toggle element.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-toggle',\n styleUrls: ['cat-toggle.scss'],\n shadow: true\n})\nexport class CatToggle {\n private readonly _id = `cat-toggle-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Checked state of the toggle.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disabled state of the toggle.\n */\n @Prop() disabled = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label of the toggle that is visible.\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 toggle.\n */\n @Prop() required = false;\n\n /**\n * The value of the toggle\n */\n @Prop({ mutable: true }) value?: string | boolean;\n\n /**\n * Optional hint text(s) to be displayed with the toggle.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Whether the label should appear to the left of the toggle.\n */\n @Prop() labelLeft = false;\n\n /**\n * Emitted when the checked status of the toggle is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the toggle received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on toggle', this);\n }\n }\n\n /**\n * Programmatically move focus to the toggle. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the toggle. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the toggle.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\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 class=\"form-check-input\"\n role=\"switch\"\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n />\n <span class=\"toggle\" part=\"toggle\"></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"]}
@@ -160,8 +160,9 @@ dd {
160
160
  }
161
161
 
162
162
  blockquote {
163
- padding: 0.5rem 0 0.5rem calc(2rem - 4px);
164
- border-left: 4px solid cat-token('color.ui.border.default');
163
+ padding: 0.75rem 0 0.75rem calc(1.5rem - 2px);
164
+ border-left: 2px solid cat-token('color.ui.border.quote');
165
+ font-style: italic;
165
166
  @include cat-body('l', null);
166
167
 
167
168
  > :last-child {
@@ -182,8 +183,8 @@ figcaption {
182
183
  }
183
184
 
184
185
  figure {
185
- padding: 0.5rem 0 0.5rem calc(2rem - 4px);
186
- border-left: 4px solid cat-token('color.ui.border.default');
186
+ padding: 0.75rem 0 0.75rem calc(1.5rem - 2px);
187
+ border-left: 2px solid cat-token('color.ui.border.quote');
187
188
 
188
189
  blockquote {
189
190
  margin-bottom: 0;
@@ -3,13 +3,7 @@ export function setAttributeDefault(host, attr, value) {
3
3
  host.hostElement.setAttribute(attr, String(value));
4
4
  }
5
5
  }
6
- export function setPropertyDefault(host, prop) {
7
- setAttributeDefault(host, String(prop), host[prop]);
8
- }
9
6
  export function setAttribute(host, attr, value) {
10
7
  host.hostElement.setAttribute(attr, String(value));
11
8
  }
12
- export function setProperty(host, prop) {
13
- setAttribute(host, String(prop), host[prop]);
14
- }
15
9
  //# sourceMappingURL=setDefault.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setDefault.js","sourceRoot":"","sources":["../../src/utils/setDefault.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CACjC,IAAO,EACP,IAAY,EACZ,KAAc;EAEd,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE;IACzD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;GACpD;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAyC,IAAO,EAAE,IAAa;EAC/F,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,YAAY,CAAyC,IAAO,EAAE,IAAY,EAAE,KAAc;EACxG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,WAAW,CAAyC,IAAO,EAAE,IAAa;EACxF,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["export function setAttributeDefault<T extends { hostElement: HTMLElement }>(\n host: T,\n attr: string,\n value: unknown\n): void {\n if (!host.hostElement.hasAttribute(attr) && value != null) {\n host.hostElement.setAttribute(attr, String(value));\n }\n}\n\nexport function setPropertyDefault<T extends { hostElement: HTMLElement }>(host: T, prop: keyof T): void {\n setAttributeDefault(host, String(prop), host[prop]);\n}\n\nexport function setAttribute<T extends { hostElement: HTMLElement }>(host: T, attr: string, value: unknown): void {\n host.hostElement.setAttribute(attr, String(value));\n}\n\nexport function setProperty<T extends { hostElement: HTMLElement }>(host: T, prop: keyof T): void {\n setAttribute(host, String(prop), host[prop]);\n}\n"]}
1
+ {"version":3,"file":"setDefault.js","sourceRoot":"","sources":["../../src/utils/setDefault.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CACjC,IAAO,EACP,IAAY,EACZ,KAAc;EAEd,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE;IACzD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;GACpD;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAyC,IAAO,EAAE,IAAY,EAAE,KAAc;EACxG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["export function setAttributeDefault<T extends { hostElement: HTMLElement }>(\n host: T,\n attr: string,\n value: unknown\n): void {\n if (!host.hostElement.hasAttribute(attr) && value != null) {\n host.hostElement.setAttribute(attr, String(value));\n }\n}\n\nexport function setAttribute<T extends { hostElement: HTMLElement }>(host: T, attr: string, value: unknown): void {\n host.hostElement.setAttribute(attr, String(value));\n}\n"]}
@@ -1,7 +1,12 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { s as setAttributeDefault, a as setPropertyDefault } from './setDefault.js';
3
2
  import { d as defineCustomElement$2 } from './cat-icon2.js';
4
3
 
4
+ function setAttributeDefault(host, attr, value) {
5
+ if (!host.hostElement.hasAttribute(attr) && value != null) {
6
+ host.hostElement.setAttribute(attr, String(value));
7
+ }
8
+ }
9
+
5
10
  const catAlertCss = ":host{display:flex;gap:0.5rem;padding:1.25rem;border-radius:var(--cat-border-radius-l, 0.5rem);margin-bottom:1rem}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.content{align-self:center}::slotted(:last-child){margin-bottom:0 !important}:host([color=primary]){background-color:rgba(var(--cat-primary-bg, 0, 129, 148), 0.1)}:host([color=primary]) cat-icon{color:rgb(var(--cat-primary-text, 0, 129, 148))}:host([color=secondary]){background-color:rgba(var(--cat-secondary-bg, 105, 118, 135), 0.1)}:host([color=secondary]) cat-icon{color:#697687}:host([color=success]){background-color:rgba(var(--cat-success-bg-, 0, 132, 88), 0.1)}:host([color=success]) cat-icon{color:#008458}:host([color=warning]){background-color:rgba(var(--cat-warning-bg, 255, 206, 128), 0.1)}:host([color=warning]) cat-icon{color:#ebb663}:host([color=danger]){background-color:rgba(var(--cat-danger-bg, 217, 52, 13), 0.1)}:host([color=danger]) cat-icon{color:#d9340d}";
6
11
 
7
12
  const CatAlert$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -35,7 +40,6 @@ const CatAlert$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
35
40
  connectedCallback() {
36
41
  setAttributeDefault(this, 'tabindex', 0);
37
42
  setAttributeDefault(this, 'role', this.mapRole.get(this.color));
38
- setPropertyDefault(this, 'color');
39
43
  }
40
44
  render() {
41
45
  return (h(Host, null, !this.noIcon && h("cat-icon", { size: "l", icon: this.icon ? this.icon : this.mapIcon.get(this.color) }), h("div", { class: "content" }, h("slot", null))));
@@ -43,7 +47,7 @@ const CatAlert$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
43
47
  get hostElement() { return this; }
44
48
  static get style() { return catAlertCss; }
45
49
  }, [1, "cat-alert", {
46
- "color": [1],
50
+ "color": [513],
47
51
  "icon": [1],
48
52
  "noIcon": [4, "no-icon"]
49
53
  }]);
@@ -1 +1 @@
1
- {"file":"cat-alert.js","mappings":";;;;AAAA,MAAM,WAAW,GAAG,sgCAAsgC;;MCY7gCA,UAAQ;EALrB;;;;IAMmB,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,oBAAoB,CAAC;MACjC,CAAC,WAAW,EAAE,cAAc,CAAC;MAC7B,CAAC,SAAS,EAAE,qBAAqB,CAAC;MAClC,CAAC,SAAS,EAAE,eAAe,CAAC;MAC5B,CAAC,QAAQ,EAAE,qBAAqB,CAAC;KAClC,CAAC,CAAC;IACc,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,WAAW,EAAE,QAAQ,CAAC;MACvB,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,SAAS,EAAE,OAAO,CAAC;MACpB,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;;;;IAOK,UAAK,GAA+D,SAAS,CAAC;;;;IAU9E,WAAM,GAAG,KAAK,CAAC;GAkBxB;EAhBC,iBAAiB;IACf,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAChE,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;GACnC;EAED,MAAM;IACJ,QACE,EAAC,IAAI,QACF,CAAC,IAAI,CAAC,MAAM,IAAI,gBAAU,IAAI,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAa,EAC3G,WAAK,KAAK,EAAC,SAAS,IAClB,eAAa,CACT,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatAlert"],"sources":["./src/components/cat-alert/cat-alert.scss?tag=cat-alert&encapsulation=shadow","./src/components/cat-alert/cat-alert.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n// -----\n\n$-icon-colors: (\n 'primary': cat-token('color.theme.primary.text'),\n 'secondary': cat-token('color.base.neutral.400'),\n 'success': cat-token('color.base.green.400'),\n 'warning': cat-token('color.base.orange.400'),\n 'danger': cat-token('color.base.red.400')\n);\n\n// -----\n\n:host {\n display: flex;\n gap: 0.5rem;\n padding: 1.25rem;\n border-radius: cat-border-radius('l');\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host(:focus-visible) {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n}\n\n.content {\n align-self: center;\n}\n\n::slotted(:last-child) {\n margin-bottom: 0 !important;\n}\n\n// ----- theme\n\n@mixin theme($theme) {\n :host([color='#{$theme}']) {\n background-color: cat-token('color.theme.#{$theme}.bg', 0.1);\n\n cat-icon {\n color: map.get($-icon-colors, $theme);\n }\n }\n}\n\n@include theme('primary');\n@include theme('secondary');\n@include theme('success');\n@include theme('warning');\n@include theme('danger');\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\nimport { setAttributeDefault, setPropertyDefault } from '../../utils/setDefault';\n\n/**\n * Informs user about important changes or conditions in the interface. Use this\n * component if you need to capture user’s attention in a prominent way.\n */\n@Component({\n tag: 'cat-alert',\n styleUrl: 'cat-alert.scss',\n shadow: true\n})\nexport class CatAlert {\n private readonly mapIcon: Map<string, string> = new Map([\n ['primary', 'star-circle-filled'],\n ['secondary', 'clock-filled'],\n ['success', 'check-circle-filled'],\n ['warning', 'danger-filled'],\n ['danger', 'cross-circle-filled']\n ]);\n private readonly mapRole: Map<string, string> = new Map([\n ['primary', 'status'],\n ['secondary', 'status'],\n ['success', 'status'],\n ['warning', 'alert'],\n ['danger', 'alert']\n ]);\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * The color palette of the alert.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The name of an icon to be displayed in the alert.\n */\n @Prop() icon?: string;\n\n /**\n * Whether the icon of the alert is deactivated.\n */\n @Prop() noIcon = false;\n\n connectedCallback() {\n setAttributeDefault(this, 'tabindex', 0);\n setAttributeDefault(this, 'role', this.mapRole.get(this.color));\n setPropertyDefault(this, 'color');\n }\n\n render() {\n return (\n <Host>\n {!this.noIcon && <cat-icon size=\"l\" icon={this.icon ? this.icon : this.mapIcon.get(this.color)}></cat-icon>}\n <div class=\"content\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"cat-alert.js","mappings":";;;SAAgB,mBAAmB,CACjC,IAAO,EACP,IAAY,EACZ,KAAc;EAEd,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,EAAE;IACzD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;GACpD;AACH;;ACRA,MAAM,WAAW,GAAG,sgCAAsgC;;MCY7gCA,UAAQ;EALrB;;;;IAMmB,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,oBAAoB,CAAC;MACjC,CAAC,WAAW,EAAE,cAAc,CAAC;MAC7B,CAAC,SAAS,EAAE,qBAAqB,CAAC;MAClC,CAAC,SAAS,EAAE,eAAe,CAAC;MAC5B,CAAC,QAAQ,EAAE,qBAAqB,CAAC;KAClC,CAAC,CAAC;IACc,YAAO,GAAwB,IAAI,GAAG,CAAC;MACtD,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,WAAW,EAAE,QAAQ,CAAC;MACvB,CAAC,SAAS,EAAE,QAAQ,CAAC;MACrB,CAAC,SAAS,EAAE,OAAO,CAAC;MACpB,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;;;;IAOsB,UAAK,GAA+D,SAAS,CAAC;;;;IAU/F,WAAM,GAAG,KAAK,CAAC;GAiBxB;EAfC,iBAAiB;IACf,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACzC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;GACjE;EAED,MAAM;IACJ,QACE,EAAC,IAAI,QACF,CAAC,IAAI,CAAC,MAAM,IAAI,gBAAU,IAAI,EAAC,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAa,EAC3G,WAAK,KAAK,EAAC,SAAS,IAClB,eAAa,CACT,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatAlert"],"sources":["./src/utils/setDefault.ts","./src/components/cat-alert/cat-alert.scss?tag=cat-alert&encapsulation=shadow","./src/components/cat-alert/cat-alert.tsx"],"sourcesContent":["export function setAttributeDefault<T extends { hostElement: HTMLElement }>(\n host: T,\n attr: string,\n value: unknown\n): void {\n if (!host.hostElement.hasAttribute(attr) && value != null) {\n host.hostElement.setAttribute(attr, String(value));\n }\n}\n\nexport function setAttribute<T extends { hostElement: HTMLElement }>(host: T, attr: string, value: unknown): void {\n host.hostElement.setAttribute(attr, String(value));\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n// -----\n\n$-icon-colors: (\n 'primary': cat-token('color.theme.primary.text'),\n 'secondary': cat-token('color.base.neutral.400'),\n 'success': cat-token('color.base.green.400'),\n 'warning': cat-token('color.base.orange.400'),\n 'danger': cat-token('color.base.red.400')\n);\n\n// -----\n\n:host {\n display: flex;\n gap: 0.5rem;\n padding: 1.25rem;\n border-radius: cat-border-radius('l');\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host(:focus-visible) {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n}\n\n.content {\n align-self: center;\n}\n\n::slotted(:last-child) {\n margin-bottom: 0 !important;\n}\n\n// ----- theme\n\n@mixin theme($theme) {\n :host([color='#{$theme}']) {\n background-color: cat-token('color.theme.#{$theme}.bg', 0.1);\n\n cat-icon {\n color: map.get($-icon-colors, $theme);\n }\n }\n}\n\n@include theme('primary');\n@include theme('secondary');\n@include theme('success');\n@include theme('warning');\n@include theme('danger');\n","import { Component, Element, h, Host, Prop } from '@stencil/core';\nimport { setAttributeDefault } from '../../utils/setDefault';\n\n/**\n * Informs user about important changes or conditions in the interface. Use this\n * component if you need to capture user’s attention in a prominent way.\n */\n@Component({\n tag: 'cat-alert',\n styleUrl: 'cat-alert.scss',\n shadow: true\n})\nexport class CatAlert {\n private readonly mapIcon: Map<string, string> = new Map([\n ['primary', 'star-circle-filled'],\n ['secondary', 'clock-filled'],\n ['success', 'check-circle-filled'],\n ['warning', 'danger-filled'],\n ['danger', 'cross-circle-filled']\n ]);\n private readonly mapRole: Map<string, string> = new Map([\n ['primary', 'status'],\n ['secondary', 'status'],\n ['success', 'status'],\n ['warning', 'alert'],\n ['danger', 'alert']\n ]);\n\n @Element() hostElement!: HTMLElement;\n\n /**\n * The color palette of the alert.\n */\n @Prop({ reflect: true }) color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The name of an icon to be displayed in the alert.\n */\n @Prop() icon?: string;\n\n /**\n * Whether the icon of the alert is deactivated.\n */\n @Prop() noIcon = false;\n\n connectedCallback() {\n setAttributeDefault(this, 'tabindex', 0);\n setAttributeDefault(this, 'role', this.mapRole.get(this.color));\n }\n\n render() {\n return (\n <Host>\n {!this.noIcon && <cat-icon size=\"l\" icon={this.icon ? this.icon : this.mapIcon.get(this.color)}></cat-icon>}\n <div class=\"content\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,4 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { a as setPropertyDefault, b as setProperty } from './setDefault.js';
3
2
 
4
3
  const catBadgeCss = ":host([hidden]){display:none}:host{display:inline-flex;max-width:100%;vertical-align:baseline;align-items:center;justify-content:center;border-radius:var(--cat-border-radius-m, 0.25rem);text-decoration:none;line-height:1.5}:host slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}:host([round]){border-radius:10rem}:host([variant=filled]){background-color:rgba(var(--bg), 0.1);color:rgb(var(--text));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}:host([variant=outlined]){background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}:host([color=primary]){--bg:var(--cat-primary-bg, 0, 129, 148);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 0, 129, 148);--border:var(--cat-primary-text, 0, 129, 148)}:host([color=secondary]){--bg:var(--cat-secondary-bg, 105, 118, 135);--fill:var(--cat-secondary-fill, 255, 255, 255);--text:var(--cat-secondary-text, 0, 0, 0);--border:var(--cat-secondary-bg, 105, 118, 135)}:host([color=success]){--bg:var(--cat-success-bg-, 0, 132, 88);--fill:var(--cat-success-fill, 255, 255, 255);--text:var(--cat-success-text, 0, 132, 88);--border:var(--cat-success-text, 0, 132, 88)}:host([color=warning]){--bg:var(--cat-warning-bg, 255, 206, 128);--fill:var(--cat-warning-fill, 0, 0, 0);--text:var(--cat-warning-text, 159, 97, 0);--border:var(--cat-warning-text, 159, 97, 0)}:host([color=danger]){--bg:var(--cat-danger-bg, 217, 52, 13);--fill:var(--cat-danger-fill, 255, 255, 255);--text:var(--cat-danger-text, 217, 52, 13);--border:var(--cat-danger-text, 217, 52, 13)}:host([size=xs]){height:1rem;min-width:1rem;font-size:0.75rem;padding:0 0.25rem}:host([size=s]){height:1.5rem;min-width:1.5rem;font-size:0.75rem;padding:0 0.5rem}:host([size=m]){height:2rem;min-width:2rem;font-size:0.875rem;padding:0 0.75rem}:host([size=l]){height:2.5rem;min-width:2.5rem;font-size:0.9375rem;padding:0 1rem}:host([size=xl]){height:3rem;min-width:3rem;font-size:1.125rem;padding:0 1rem}:host([pulse][variant=filled]){animation:1.5s ease 0s infinite normal none running pulse}:host([pulse][variant=outlined]){animation:1.5s ease 0s infinite normal none running pulse-outlined}@keyframes pulse{0%{box-shadow:0 0 0 0 rgb(var(--bg))}70%{box-shadow:transparent 0 0 0 0.5rem}100%{box-shadow:transparent 0 0 0 0}}@keyframes pulse-outlined{0%{box-shadow:0 0 0 0 rgb(var(--bg)), inset 0 0 0 1px rgba(var(--border), 0.2)}70%{box-shadow:transparent 0 0 0 0.5rem, inset 0 0 0 1px rgba(var(--border), 0.2)}100%{box-shadow:transparent 0 0 0 0, inset 0 0 0 1px rgba(var(--border), 0.2)}}";
5
4
 
@@ -29,36 +28,17 @@ const CatBadge$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
29
28
  */
30
29
  this.pulse = false;
31
30
  }
32
- connectedCallback() {
33
- setPropertyDefault(this, 'variant');
34
- setPropertyDefault(this, 'color');
35
- setPropertyDefault(this, 'size');
36
- }
37
31
  render() {
38
32
  return h("slot", null);
39
33
  }
40
- onColorChanged() {
41
- setProperty(this, 'color');
42
- }
43
- onSizeChanged() {
44
- setProperty(this, 'size');
45
- }
46
- onVariantChanged() {
47
- setProperty(this, 'variant');
48
- }
49
34
  get hostElement() { return this; }
50
- static get watchers() { return {
51
- "color": ["onColorChanged"],
52
- "size": ["onSizeChanged"],
53
- "variant": ["onVariantChanged"]
54
- }; }
55
35
  static get style() { return catBadgeCss; }
56
36
  }, [1, "cat-badge", {
57
- "variant": [1],
58
- "color": [1],
59
- "size": [1],
60
- "round": [4],
61
- "pulse": [4]
37
+ "variant": [513],
38
+ "color": [513],
39
+ "size": [513],
40
+ "round": [516],
41
+ "pulse": [516]
62
42
  }]);
63
43
  function defineCustomElement$1() {
64
44
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"cat-badge.js","mappings":";;;AAAA,MAAM,WAAW,GAAG,+jFAA+jF;;MCYtkFA,UAAQ;EALrB;;;;;;;IAWU,YAAO,GAA0B,QAAQ,CAAC;;;;IAK1C,UAAK,GAA+D,SAAS,CAAC;;;;IAK9E,SAAI,GAAkC,GAAG,CAAC;;;;IAK1C,UAAK,GAAG,KAAK,CAAC;;;;IAKd,UAAK,GAAG,KAAK,CAAC;GA0BvB;EAxBC,iBAAiB;IACf,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACpC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClC,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;GAClC;EAED,MAAM;IACJ,OAAO,eAAa,CAAC;GACtB;EAGD,cAAc;IACZ,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;GAC5B;EAGD,aAAa;IACX,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;GAC3B;EAGD,gBAAgB;IACd,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;GAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatBadge"],"sources":["./src/components/cat-badge/cat-badge.scss?tag=cat-badge&encapsulation=shadow","./src/components/cat-badge/cat-badge.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n// -----\n\n$-sizes: (\n 'xl': 3rem,\n 'l': 2.5rem,\n 'm': 2rem,\n 's': 1.5rem,\n 'xs': 1rem\n);\n$-paddings: (\n 'xl': 0 1rem,\n 'l': 0 1rem,\n 'm': 0 0.75rem,\n 's': 0 0.5rem,\n 'xs': 0 0.25rem\n);\n\n// -----\n\n:host([hidden]) {\n display: none;\n}\n\n:host {\n display: inline-flex;\n max-width: 100%;\n vertical-align: baseline;\n align-items: center;\n justify-content: center;\n border-radius: cat-border-radius('m');\n text-decoration: none;\n line-height: 1.5;\n\n slot {\n display: inline-block;\n @include cat-ellipsis;\n }\n}\n\n// ----- round\n\n:host([round]) {\n border-radius: 10rem;\n}\n\n// ----- theme\n\n:host([variant='filled']) {\n background-color: cat-token-wrap(var(--bg), 0.1);\n color: cat-token-wrap(var(--text));\n font-weight: 600;\n @include cat-font-smooth;\n}\n\n$-outline: inset 0 0 0 1px cat-token-wrap(var(--border), $alpha: 0.2);\n\n:host([variant='outlined']) {\n background-color: cat-token('color.ui.background.body');\n box-shadow: $-outline;\n color: cat-token-wrap(var(--text));\n}\n\n@mixin theme($theme) {\n :host([color='#{$theme}']) {\n --bg: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fill', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n @if $theme == 'secondary' {\n --border: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n } @else {\n --border: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n }\n }\n}\n\n@include theme('primary');\n@include theme('secondary');\n@include theme('success');\n@include theme('warning');\n@include theme('danger');\n\n// ----- size\n\n@mixin size($size, $fontSize) {\n :host([size='#{$size}']) {\n height: map.get($-sizes, $size);\n min-width: map.get($-sizes, $size);\n font-size: cat-body-font-size($fontSize);\n padding: map.get($-paddings, $size);\n }\n}\n\n@include size('xs', 'xs');\n@include size('s', 'xs');\n@include size('m', 's');\n@include size('l', 'm');\n@include size('xl', 'l');\n\n// ----- pulse\n\n$-pulse-0: 0 0 0 0 cat-token-wrap(var(--bg));\n$-pulse-70: transparent 0 0 0 0.5rem;\n$-pulse-100: transparent 0 0 0 0;\n\n:host([pulse][variant='filled']) {\n animation: 1.5s ease 0s infinite normal none running pulse;\n}\n\n:host([pulse][variant='outlined']) {\n animation: 1.5s ease 0s infinite normal none running pulse-outlined;\n}\n\n@keyframes pulse {\n 0% {\n box-shadow: $-pulse-0;\n }\n\n 70% {\n box-shadow: $-pulse-70;\n }\n\n 100% {\n box-shadow: $-pulse-100;\n }\n}\n\n@keyframes pulse-outlined {\n 0% {\n box-shadow: $-pulse-0, $-outline;\n }\n\n 70% {\n box-shadow: $-pulse-70, $-outline;\n }\n\n 100% {\n box-shadow: $-pulse-100, $-outline;\n }\n}\n","import { Component, Element, Prop, Watch, h } from '@stencil/core';\nimport { setProperty, setPropertyDefault } from '../../utils/setDefault';\n\n/**\n * Badges are used to inform users of the status of an object or of an action\n * that’s been taken.\n */\n@Component({\n tag: 'cat-badge',\n styleUrl: 'cat-badge.scss',\n shadow: true\n})\nexport class CatBadge {\n @Element() hostElement!: HTMLElement;\n\n /**\n * The rendering style of the badge.\n */\n @Prop() variant: 'filled' | 'outlined' = 'filled';\n\n /**\n * The color palette of the badge.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The size of the badge.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * Use round badge edges.\n */\n @Prop() round = false;\n\n /**\n * Draw attention to the badge with a subtle animation.\n */\n @Prop() pulse = false;\n\n connectedCallback() {\n setPropertyDefault(this, 'variant');\n setPropertyDefault(this, 'color');\n setPropertyDefault(this, 'size');\n }\n\n render() {\n return <slot></slot>;\n }\n\n @Watch('color')\n onColorChanged() {\n setProperty(this, 'color');\n }\n\n @Watch('size')\n onSizeChanged() {\n setProperty(this, 'size');\n }\n\n @Watch('variant')\n onVariantChanged() {\n setProperty(this, 'variant');\n }\n}\n"],"version":3}
1
+ {"file":"cat-badge.js","mappings":";;AAAA,MAAM,WAAW,GAAG,+jFAA+jF;;MCWtkFA,UAAQ;EALrB;;;;;;;IAW2B,YAAO,GAA0B,QAAQ,CAAC;;;;IAK1C,UAAK,GAA+D,SAAS,CAAC;;;;IAK9E,SAAI,GAAkC,GAAG,CAAC;;;;IAK1C,UAAK,GAAG,KAAK,CAAC;;;;IAKd,UAAK,GAAG,KAAK,CAAC;GAKxC;EAHC,MAAM;IACJ,OAAO,eAAa,CAAC;GACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatBadge"],"sources":["./src/components/cat-badge/cat-badge.scss?tag=cat-badge&encapsulation=shadow","./src/components/cat-badge/cat-badge.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n// -----\n\n$-sizes: (\n 'xl': 3rem,\n 'l': 2.5rem,\n 'm': 2rem,\n 's': 1.5rem,\n 'xs': 1rem\n);\n$-paddings: (\n 'xl': 0 1rem,\n 'l': 0 1rem,\n 'm': 0 0.75rem,\n 's': 0 0.5rem,\n 'xs': 0 0.25rem\n);\n\n// -----\n\n:host([hidden]) {\n display: none;\n}\n\n:host {\n display: inline-flex;\n max-width: 100%;\n vertical-align: baseline;\n align-items: center;\n justify-content: center;\n border-radius: cat-border-radius('m');\n text-decoration: none;\n line-height: 1.5;\n\n slot {\n display: inline-block;\n @include cat-ellipsis;\n }\n}\n\n// ----- round\n\n:host([round]) {\n border-radius: 10rem;\n}\n\n// ----- theme\n\n:host([variant='filled']) {\n background-color: cat-token-wrap(var(--bg), 0.1);\n color: cat-token-wrap(var(--text));\n font-weight: 600;\n @include cat-font-smooth;\n}\n\n$-outline: inset 0 0 0 1px cat-token-wrap(var(--border), $alpha: 0.2);\n\n:host([variant='outlined']) {\n background-color: cat-token('color.ui.background.body');\n box-shadow: $-outline;\n color: cat-token-wrap(var(--text));\n}\n\n@mixin theme($theme) {\n :host([color='#{$theme}']) {\n --bg: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fill', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n @if $theme == 'secondary' {\n --border: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n } @else {\n --border: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n }\n }\n}\n\n@include theme('primary');\n@include theme('secondary');\n@include theme('success');\n@include theme('warning');\n@include theme('danger');\n\n// ----- size\n\n@mixin size($size, $fontSize) {\n :host([size='#{$size}']) {\n height: map.get($-sizes, $size);\n min-width: map.get($-sizes, $size);\n font-size: cat-body-font-size($fontSize);\n padding: map.get($-paddings, $size);\n }\n}\n\n@include size('xs', 'xs');\n@include size('s', 'xs');\n@include size('m', 's');\n@include size('l', 'm');\n@include size('xl', 'l');\n\n// ----- pulse\n\n$-pulse-0: 0 0 0 0 cat-token-wrap(var(--bg));\n$-pulse-70: transparent 0 0 0 0.5rem;\n$-pulse-100: transparent 0 0 0 0;\n\n:host([pulse][variant='filled']) {\n animation: 1.5s ease 0s infinite normal none running pulse;\n}\n\n:host([pulse][variant='outlined']) {\n animation: 1.5s ease 0s infinite normal none running pulse-outlined;\n}\n\n@keyframes pulse {\n 0% {\n box-shadow: $-pulse-0;\n }\n\n 70% {\n box-shadow: $-pulse-70;\n }\n\n 100% {\n box-shadow: $-pulse-100;\n }\n}\n\n@keyframes pulse-outlined {\n 0% {\n box-shadow: $-pulse-0, $-outline;\n }\n\n 70% {\n box-shadow: $-pulse-70, $-outline;\n }\n\n 100% {\n box-shadow: $-pulse-100, $-outline;\n }\n}\n","import { Component, Element, h, Prop } from '@stencil/core';\n\n/**\n * Badges are used to inform users of the status of an object or of an action\n * that’s been taken.\n */\n@Component({\n tag: 'cat-badge',\n styleUrl: 'cat-badge.scss',\n shadow: true\n})\nexport class CatBadge {\n @Element() hostElement!: HTMLElement;\n\n /**\n * The rendering style of the badge.\n */\n @Prop({ reflect: true }) variant: 'filled' | 'outlined' = 'filled';\n\n /**\n * The color palette of the badge.\n */\n @Prop({ reflect: true }) color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'primary';\n\n /**\n * The size of the badge.\n */\n @Prop({ reflect: true }) size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * Use round badge edges.\n */\n @Prop({ reflect: true }) round = false;\n\n /**\n * Draw attention to the badge with a subtle animation.\n */\n @Prop({ reflect: true }) pulse = false;\n\n render() {\n return <slot></slot>;\n }\n}\n"],"version":3}
@@ -13,7 +13,7 @@ const CatCheckbox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
13
13
  this.catChange = createEvent(this, "catChange", 7);
14
14
  this.catFocus = createEvent(this, "catFocus", 7);
15
15
  this.catBlur = createEvent(this, "catBlur", 7);
16
- this.id = `cat-checkbox-${nextUniqueId++}`;
16
+ this._id = `cat-checkbox-${nextUniqueId++}`;
17
17
  this.hasSlottedLabel = false;
18
18
  /**
19
19
  * Checked state of the checkbox
@@ -44,6 +44,9 @@ const CatCheckbox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
44
44
  */
45
45
  this.labelLeft = false;
46
46
  }
47
+ get id() {
48
+ return this.identifier || this._id;
49
+ }
47
50
  componentDidLoad() {
48
51
  if (this.input && this.indeterminate) {
49
52
  this.input.indeterminate = true;
@@ -103,6 +106,7 @@ const CatCheckbox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
103
106
  }, [1, "cat-checkbox", {
104
107
  "checked": [1028],
105
108
  "disabled": [4],
109
+ "identifier": [1],
106
110
  "indeterminate": [4],
107
111
  "label": [1],
108
112
  "labelHidden": [4, "label-hidden"],
@@ -1 +1 @@
1
- {"file":"cat-checkbox2.js","mappings":";;;;AAAA,MAAM,cAAc,GAAG,uoFAAuoF;;ACI9pF,IAAI,YAAY,GAAG,CAAC,CAAC;MAgBR,WAAW;EALxB;;;;;;;IAMmB,OAAE,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;IAK9C,oBAAe,GAAG,KAAK,CAAC;;;;IAKR,YAAO,GAAG,KAAK,CAAC;;;;IAKjC,aAAQ,GAAG,KAAK,CAAC;;;;IAKjB,kBAAa,GAAG,KAAK,CAAC;;;;IAKtB,UAAK,GAAG,EAAE,CAAC;;;;IAKX,gBAAW,GAAG,KAAK,CAAC;;;;IAUpB,aAAQ,GAAG,KAAK,CAAC;;;;IAejB,cAAS,GAAG,KAAK,CAAC;GAyH3B;EAxGC,gBAAgB;IACd,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,EAAE;MACpC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;KACjC;GACF;EAED,mBAAmB;IACjB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1E,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;MACxCA,QAAG,CAAC,IAAI,CAAC,uCAAuC,EAAE,IAAI,CAAC,CAAC;KACzD;GACF;;;;;;;;EAUD,MAAM,OAAO,CAAC,OAAsB;IAClC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;GAC3B;;;;;EAOD,MAAM,MAAM;IACV,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;GACnB;;;;EAMD,MAAM,OAAO;IACX,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,C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AC9D,CACD,EACP,IAAI,CAAC,WAAW,CACZ,EACP;GACH;EAED,IAAY,WAAW;IACrB,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IACzE,QACE,CAAC,IAAI,CAAC,IAAI,IAAI,cAAc,MAC1B,EAAC,WAAW,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ,GAAI,CAC3F,EACD;GACH;EAEO,OAAO,CAAC,KAAY;IAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAElC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;MAClD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;KAC3B;IACD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC5B;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC3B;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["log"],"sources":["./src/components/cat-checkbox/cat-checkbox.scss?tag=cat-checkbox&encapsulation=shadow","./src/components/cat-checkbox/cat-checkbox.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'src/components/cat-form-hint/cat-form-hint';\n\n$checkbox-width: 1.25rem;\n$checkbox-height: 1.25rem;\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nlabel {\n flex: 0 1 auto;\n display: flex;\n gap: 0.5rem;\n @include cat-body('m');\n @include cat-select(none);\n cursor: pointer;\n position: relative;\n}\n\n.label-left {\n flex-direction: row-reverse;\n\n input {\n right: 1px;\n left: unset;\n }\n}\n\ninput {\n position: absolute;\n width: $checkbox-width;\n height: $checkbox-height;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n left: 1px;\n top: 0.5px;\n}\n\n.box {\n flex: 0 0 auto;\n display: flex;\n position: relative;\n height: $checkbox-height;\n width: $checkbox-width;\n background-color: cat-token('color.ui.background.input');\n border: 1px solid cat-token('color.ui.border.dark');\n border-radius: cat-border-radius(s);\n transition: background-color cat-token('time.transition.s') ease, border-color cat-token('time.transition.s') ease;\n pointer-events: none;\n\n svg {\n fill: none;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-dasharray: 16px;\n stroke-dashoffset: 16px;\n transition: all cat-token('time.transition.s') ease;\n width: 50%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.99);\n }\n\n :checked + & {\n background-color: cat-token('color.theme.primary.bg');\n border-color: cat-token('color.theme.primary.bg');\n stroke: cat-token('color.theme.primary.fill');\n\n .check {\n stroke-dashoffset: 0;\n }\n }\n\n :indeterminate + & {\n background-color: cat-token('color.theme.primary.bg');\n border-color: cat-token('color.theme.primary.bg');\n stroke: cat-token('color.theme.primary.fill');\n\n .dash {\n stroke-dashoffset: 0;\n }\n }\n\n :focus-visible + & {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n\n .is-disabled & {\n background-color: cat-token('color.ui.background.inputDisabled');\n border-color: cat-token('color.ui.border.dark');\n stroke: cat-token('color.ui.font.muted');\n }\n}\n\n:host(.cat-error) {\n .box {\n border: 1px solid cat-token('color.theme.danger.bg');\n }\n\n :checked + .box,\n :indeterminate + .box {\n background-color: cat-token('color.theme.danger.bg');\n border-color: cat-token('color.theme.danger.bg');\n stroke: cat-token('color.theme.danger.fill');\n }\n}\n\n.label {\n flex: 1 1 auto;\n min-width: 0;\n\n .is-hidden & {\n @include cat-visually-hidden;\n }\n}\n\n.is-disabled {\n cursor: not-allowed;\n color: cat-token('color.ui.font.muted');\n}\n","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.warn('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Programmatically move focus to the checkbox. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the checkbox. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the checkbox.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\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"],"version":3}
1
+ {"file":"cat-checkbox2.js","mappings":";;;;AAAA,MAAM,cAAc,GAAG,uoFAAuoF;;ACI9pF,IAAI,YAAY,GAAG,CAAC,CAAC;MAgBR,WAAW;EALxB;;;;;;;IAMmB,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;IAS/C,oBAAe,GAAG,KAAK,CAAC;;;;IAKR,YAAO,GAAG,KAAK,CAAC;;;;IAKjC,aAAQ,GAAG,KAAK,CAAC;;;;IAUjB,kBAAa,GAAG,KAAK,CAAC;;;;IAKtB,UAAK,GAAG,EAAE,CAAC;;;;IAKX,gBAAW,GAAG,KAAK,CAAC;;;;IAUpB,aAAQ,GAAG,KAAK,CAAC;;;;IAejB,cAAS,GAAG,KAAK,CAAC;GAyH3B;EAxLC,IAAY,EAAE;IACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC;GACpC;EA8ED,gBAAgB;IACd,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,EAAE;MACpC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;KACjC;GACF;EAED,mBAAmB;IACjB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1E,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;MACxCA,QAAG,CAAC,IAAI,CAAC,uCAAuC,EAAE,IAAI,CAAC,CAAC;KACzD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ourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n@use 'src/components/cat-form-hint/cat-form-hint';\n\n$checkbox-width: 1.25rem;\n$checkbox-height: 1.25rem;\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nlabel {\n flex: 0 1 auto;\n display: flex;\n gap: 0.5rem;\n @include cat-body('m');\n @include cat-select(none);\n cursor: pointer;\n position: relative;\n}\n\n.label-left {\n flex-direction: row-reverse;\n\n input {\n right: 1px;\n left: unset;\n }\n}\n\ninput {\n position: absolute;\n width: $checkbox-width;\n height: $checkbox-height;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n left: 1px;\n top: 0.5px;\n}\n\n.box {\n flex: 0 0 auto;\n display: flex;\n position: relative;\n height: $checkbox-height;\n width: $checkbox-width;\n background-color: cat-token('color.ui.background.input');\n border: 1px solid cat-token('color.ui.border.dark');\n border-radius: cat-border-radius(s);\n transition: background-color cat-token('time.transition.s') ease, border-color cat-token('time.transition.s') ease;\n pointer-events: none;\n\n svg {\n fill: none;\n stroke-width: 2;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-dasharray: 16px;\n stroke-dashoffset: 16px;\n transition: all cat-token('time.transition.s') ease;\n width: 50%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(0.99);\n }\n\n :checked + & {\n background-color: cat-token('color.theme.primary.bg');\n border-color: cat-token('color.theme.primary.bg');\n stroke: cat-token('color.theme.primary.fill');\n\n .check {\n stroke-dashoffset: 0;\n }\n }\n\n :indeterminate + & {\n background-color: cat-token('color.theme.primary.bg');\n border-color: cat-token('color.theme.primary.bg');\n stroke: cat-token('color.theme.primary.fill');\n\n .dash {\n stroke-dashoffset: 0;\n }\n }\n\n :focus-visible + & {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n\n .is-disabled & {\n background-color: cat-token('color.ui.background.inputDisabled');\n border-color: cat-token('color.ui.border.dark');\n stroke: cat-token('color.ui.font.muted');\n }\n}\n\n:host(.cat-error) {\n .box {\n border: 1px solid cat-token('color.theme.danger.bg');\n }\n\n :checked + .box,\n :indeterminate + .box {\n background-color: cat-token('color.theme.danger.bg');\n border-color: cat-token('color.theme.danger.bg');\n stroke: cat-token('color.theme.danger.fill');\n }\n}\n\n.label {\n flex: 1 1 auto;\n min-width: 0;\n\n .is-hidden & {\n @include cat-visually-hidden;\n }\n}\n\n.is-disabled {\n cursor: not-allowed;\n color: cat-token('color.ui.font.muted');\n}\n","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 get id() {\n return this.identifier || this._id;\n }\n\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 * A unique identifier for the input.\n */\n @Prop() identifier?: string;\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.warn('[A11y] Missing ARIA label on checkbox', this);\n }\n }\n\n /**\n * Programmatically move focus to the checkbox. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.input.focus(options);\n }\n\n /**\n * Programmatically remove focus from the checkbox. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Programmatically simulate a click on the checkbox.\n */\n @Method()\n async doClick(): Promise<void> {\n this.input.click();\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"],"version":3}
@@ -1 +1 @@
1
- {"file":"cat-dropdown2.js","mappings":";;;;;AAAA;AACA;AACA;AAgPO,MAAM,eAAe,GAAG,GAAG;;AClPlC,MAAM,cAAc,GAAG,q7BAAq7B;;ACO58B,IAAI,YAAY,GAAG,CAAC,CAAC;MAOR,WAAW;EALxB;;;;;;IAOmB,OAAE,GAAG,YAAY,EAAE,CAAC;IAM7B,WAAM,GAAmB,KAAK,CAAC;;;;IAK/B,cAAS,GAAc,cAAc,CAAC;;;;IAKtC,gBAAW,GAAG,KAAK,CAAC;;;;IAKpB,aAAQ,GAAG,KAAK,CAAC;GA2K1B;EA9JC,YAAY,CAAC,KAA8B;;;;IAIzC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;MACjB,IAAI,CAAC,WAAW,EAAE,CAAC;MACnB,IAAI,CAAC,MAAM,EAAE,CAAC;KACf;;IAGD,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,IAAI,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SAAS,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;UAChC,IAAI,EAAE,GAAG,CAAC,IAAI;UACd,GAAG,EAAE,GAAG,CAAC,IAAI;SACd,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;GACF;;;;;;;;AAhMuB,kBAAM,GAAG,CAAE,CAAA;;;;;;;;;;;;;;;;;","names":["focusTrap.createFocusTrap"],"sources":["../tokens/dist/js/variables.js","./src/components/cat-dropdown/cat-dropdown.scss?tag=cat-dropdown&encapsulation=shadow","./src/components/cat-dropdown/cat-dropdown.tsx"],"sourcesContent":["/**\n * Auto-generated file. Do not edit directly.\n */\n\nexport const assetFontDmSansName = \"DM Sans\";\nexport const assetFontDmSansWoff2Bold = \"DMSans-Bold.woff2\";\nexport const assetFontDmSansWoff2BoldItalic = \"DMSans-BoldItalic.woff2\";\nexport const assetFontDmSansWoff2Italic = \"DMSans-Italic.woff2\";\nexport const assetFontDmSansWoff2Medium = \"DMSans-Medium.woff2\";\nexport const assetFontDmSansWoff2MediumItalic = \"DMSans-MediumItalic.woff2\";\nexport const assetFontDmSansWoff2Regular = \"DMSans-Regular.woff2\";\nexport const assetFontLatoName = \"Lato\";\nexport const assetFontLatoWoffBlack = \"Lato-Black.woff\";\nexport const assetFontLatoWoff2Black = \"Lato-Black.woff2\";\nexport const assetFontLatoWoffBlackItalic = \"Lato-BlackItalic.woff\";\nexport const assetFontLatoWoff2BlackItalic = \"Lato-BlackItalic.woff2\";\nexport const assetFontLatoWoffBold = \"Lato-Bold.woff\";\nexport const assetFontLatoWoff2Bold = \"Lato-Bold.woff2\";\nexport const assetFontLatoWoffBoldItalic = \"Lato-BoldItalic.woff\";\nexport const assetFontLatoWoff2BoldItalic = \"Lato-BoldItalic.woff2\";\nexport const assetFontLatoWoffHairline = \"Lato-Hairline.woff\";\nexport const assetFontLatoWoff2Hairline = \"Lato-Hairline.woff2\";\nexport const assetFontLatoWoffHairlineItalic = \"Lato-HairlineItalic.woff\";\nexport const assetFontLatoWoff2HairlineItalic = \"Lato-HairlineItalic.woff2\";\nexport const assetFontLatoWoffHeavy = \"Lato-Heavy.woff\";\nexport const assetFontLatoWoff2Heavy = \"Lato-Heavy.woff2\";\nexport const assetFontLatoWoffHeavyItalic = \"Lato-HeavyItalic.woff\";\nexport const assetFontLatoWoff2HeavyItalic = \"Lato-HeavyItalic.woff2\";\nexport const assetFontLatoWoffItalic = \"Lato-Italic.woff\";\nexport const assetFontLatoWoff2Italic = \"Lato-Italic.woff2\";\nexport const assetFontLatoWoffLight = \"Lato-Light.woff\";\nexport const assetFontLatoWoff2Light = \"Lato-Light.woff2\";\nexport const assetFontLatoWoffLightItalic = \"Lato-LightItalic.woff\";\nexport const assetFontLatoWoff2LightItalic = \"Lato-LightItalic.woff2\";\nexport const assetFontLatoWoffMedium = \"Lato-Medium.woff\";\nexport const assetFontLatoWoff2Medium = \"Lato-Medium.woff2\";\nexport const assetFontLatoWoffMediumItalic = \"Lato-MediumItalic.woff\";\nexport const assetFontLatoWoff2MediumItalic = \"Lato-MediumItalic.woff2\";\nexport const assetFontLatoWoffRegular = \"Lato-Regular.woff\";\nexport const assetFontLatoWoff2Regular = \"Lato-Regular.woff2\";\nexport const assetFontLatoWoffSemibold = \"Lato-Semibold.woff\";\nexport const assetFontLatoWoff2Semibold = \"Lato-Semibold.woff2\";\nexport const assetFontLatoWoffSemiboldItalic = \"Lato-SemiboldItalic.woff\";\nexport const assetFontLatoWoff2SemiboldItalic = \"Lato-SemiboldItalic.woff2\";\nexport const assetFontLatoWoffThin = \"Lato-Thin.woff\";\nexport const assetFontLatoWoff2Thin = \"Lato-Thin.woff2\";\nexport const assetFontLatoWoffThinItalic = \"Lato-ThinItalic.woff\";\nexport const assetFontLatoWoff2ThinItalic = \"Lato-ThinItalic.woff2\";\nexport const assetFontAzeretMonoName = \"Azeret Mono\";\nexport const assetFontAzeretMonoWoff2Regular = \"AzeretMono-Regular.woff2\";\nexport const colorBaseWhite = \"#ffffff\";\nexport const colorBaseBlack = \"#000000\";\nexport const colorBaseNeutral100 = \"#f2f4f7\";\nexport const colorBaseNeutral200 = \"#ebecf0\";\nexport const colorBaseNeutral300 = \"#d7dbe0\";\nexport const colorBaseNeutral400 = \"#697687\";\nexport const colorBaseNeutral500 = \"#515c6c\";\nexport const colorBaseNeutral600 = \"#394251\";\nexport const colorBaseNeutral700 = \"#1b1f26\";\nexport const colorBaseNeutralDark400 = \"#697687\";\nexport const colorBaseBrand100 = \"#c9e5e8\";\nexport const colorBaseBrand200 = \"#2db3c3\";\nexport const colorBaseBrand300 = \"#29a3b1\";\nexport const colorBaseBrand400 = \"#008194\";\nexport const colorBaseBrand500 = \"#017384\";\nexport const colorBaseBrand600 = \"#026371\";\nexport const colorBaseBrand700 = \"#175b63\";\nexport const colorBaseBrandDark400 = \"#93b4f2\";\nexport const colorBaseBrandDark500 = \"#93b4f2\";\nexport const colorBaseBrandDark600 = \"#93b4f2\";\nexport const colorBaseGreen100 = \"#d4ede4\";\nexport const colorBaseGreen200 = \"#00bb7d\";\nexport const colorBaseGreen300 = \"#00aa71\";\nexport const colorBaseGreen400 = \"#008458\";\nexport const colorBaseGreen500 = \"#00754e\";\nexport const colorBaseGreen600 = \"#006946\";\nexport const colorBaseGreen700 = \"#005f40\";\nexport const colorBaseOrange100 = \"#ffdea8\";\nexport const colorBaseOrange200 = \"#ffd694\";\nexport const colorBaseOrange300 = \"#ffce80\";\nexport const colorBaseOrange400 = \"#ebb663\";\nexport const colorBaseOrange500 = \"#d6a75a\";\nexport const colorBaseOrange600 = \"#b0853e\";\nexport const colorBaseOrange700 = \"#9f6100\";\nexport const colorBaseRed100 = \"#fbc7bb\";\nexport const colorBaseRed200 = \"#f68368\";\nexport const colorBaseRed300 = \"#f46a49\";\nexport const colorBaseRed400 = \"#d9340d\";\nexport const colorBaseRed500 = \"#c22e0b\";\nexport const colorBaseRed600 = \"#ae2a0a\";\nexport const colorBaseRed700 = \"#9e2609\";\nexport const colorThemePrimaryBg = \"#008194\";\nexport const colorThemePrimaryBgHover = \"#017384\";\nexport const colorThemePrimaryBgActive = \"#026371\";\nexport const colorThemePrimaryFill = \"#ffffff\";\nexport const colorThemePrimaryFillHover = \"#ffffff\";\nexport const colorThemePrimaryFillActive = \"#ffffff\";\nexport const colorThemePrimaryText = \"#008194\";\nexport const colorThemePrimaryTextHover = \"#017384\";\nexport const colorThemePrimaryTextActive = \"#026371\";\nexport const colorThemePrimaryDarkBg = \"#93b4f2\";\nexport const colorThemePrimaryDarkBgHover = \"#93b4f2\";\nexport const colorThemePrimaryDarkBgActive = \"#93b4f2\";\nexport const colorThemePrimaryDarkFill = \"#000000\";\nexport const colorThemePrimaryDarkFillHover = \"#000000\";\nexport const colorThemePrimaryDarkFillActive = \"#000000\";\nexport const colorThemePrimaryDarkText = \"#93b4f2\";\nexport const colorThemePrimaryDarkTextHover = \"#93b4f2\";\nexport const colorThemePrimaryDarkTextActive = \"#93b4f2\";\nexport const colorThemeSecondaryBg = \"#697687\";\nexport const colorThemeSecondaryBgHover = \"#697687\";\nexport const colorThemeSecondaryBgActive = \"#697687\";\nexport const colorThemeSecondaryFill = \"#ffffff\";\nexport const colorThemeSecondaryFillHover = \"#ffffff\";\nexport const colorThemeSecondaryFillActive = \"#ffffff\";\nexport const colorThemeSecondaryText = \"#000000\";\nexport const colorThemeSecondaryTextHover = \"#000000\";\nexport const colorThemeSecondaryTextActive = \"#000000\";\nexport const colorThemeSecondaryDarkBg = \"#697687\";\nexport const colorThemeSecondaryDarkBgHover = \"#697687\";\nexport const colorThemeSecondaryDarkBgActive = \"#697687\";\nexport const colorThemeSecondaryDarkFill = \"#000000\";\nexport const colorThemeSecondaryDarkFillHover = \"#000000\";\nexport const colorThemeSecondaryDarkFillActive = \"#000000\";\nexport const colorThemeSecondaryDarkText = \"#ffffff\";\nexport const colorThemeSecondaryDarkTextHover = \"#ffffff\";\nexport const colorThemeSecondaryDarkTextActive = \"#ffffff\";\nexport const colorThemeSuccessBg = \"#008458\";\nexport const colorThemeSuccessBgHover = \"#00754e\";\nexport const colorThemeSuccessBgActive = \"#006946\";\nexport const colorThemeSuccessFill = \"#ffffff\";\nexport const colorThemeSuccessFillHover = \"#ffffff\";\nexport const colorThemeSuccessFillActive = \"#ffffff\";\nexport const colorThemeSuccessText = \"#008458\";\nexport const colorThemeSuccessTextHover = \"#00754e\";\nexport const colorThemeSuccessTextActive = \"#006946\";\nexport const colorThemeWarningBg = \"#ffce80\";\nexport const colorThemeWarningBgHover = \"#ffd694\";\nexport const colorThemeWarningBgActive = \"#ffdea8\";\nexport const colorThemeWarningFill = \"#000000\";\nexport const colorThemeWarningFillHover = \"#000000\";\nexport const colorThemeWarningFillActive = \"#000000\";\nexport const colorThemeWarningText = \"#9f6100\";\nexport const colorThemeWarningTextHover = \"#9f6100\";\nexport const colorThemeWarningTextActive = \"#9f6100\";\nexport const colorThemeDangerBg = \"#d9340d\";\nexport const colorThemeDangerBgHover = \"#c22e0b\";\nexport const colorThemeDangerBgActive = \"#ae2a0a\";\nexport const colorThemeDangerFill = \"#ffffff\";\nexport const colorThemeDangerFillHover = \"#ffffff\";\nexport const colorThemeDangerFillActive = \"#ffffff\";\nexport const colorThemeDangerText = \"#d9340d\";\nexport const colorThemeDangerTextHover = \"#c22e0b\";\nexport const colorThemeDangerTextActive = \"#ae2a0a\";\nexport const colorUiBackgroundCanvas = \"#f2f4f7\";\nexport const colorUiBackgroundBody = \"#ffffff\";\nexport const colorUiBackgroundBodyDark = \"#1b1f26\";\nexport const colorUiBackgroundMuted = \"#ebecf0\";\nexport const colorUiBackgroundInput = \"#ffffff\";\nexport const colorUiBackgroundInputDisabled = \"#f2f4f7\";\nexport const colorUiBackgroundSkeleton = \"#ebecf0\";\nexport const colorUiBackgroundSkeletonHighlight = \"#d7dbe0\";\nexport const colorUiBackgroundTooltip = \"#000000\";\nexport const colorUiBackgroundBackdrop = \"#000000\";\nexport const colorUiBackgroundSelectPill = \"#f2f4f7\";\nexport const colorUiBorderLight = \"#f2f4f7\";\nexport const colorUiBorderDefault = \"#ebecf0\";\nexport const colorUiBorderDark = \"#d7dbe0\";\nexport const colorUiBorderFocus = \"#0071ff\";\nexport const colorUiFontHead = \"#000000\";\nexport const colorUiFontHeadDark = \"#ffffff\";\nexport const colorUiFontBody = \"#000000\";\nexport const colorUiFontBodyDark = \"#ffffff\";\nexport const colorUiFontMono = \"#000000\";\nexport const colorUiFontMonoDark = \"#ffffff\";\nexport const colorUiFontMuted = \"#697687\";\nexport const colorUiFontQuote = \"#697687\";\nexport const colorUiFontTooltip = \"#ffffff\";\nexport const fontFamilyHead = \"Lato\";\nexport const fontFamilyBody = \"Lato\";\nexport const fontFamilyMono = \"Azeret Mono\";\nexport const fontFamilyEmoji = \"''\";\nexport const fontWeightHead = 500;\nexport const fontWeightBody = 400;\nexport const fontWeightMono = 400;\nexport const fontDecorationLink = \"none\";\nexport const fontDecorationLinkHover = \"underline\";\nexport const fontDecorationLinkButton = \"none\";\nexport const fontDecorationLinkButtonHover = \"none\";\nexport const opacityDisabled = 0.65;\nexport const opacityBackdrop = 0.6;\nexport const opacityTooltip = 1;\nexport const sizeBorderRadiusL = \"0.5rem\";\nexport const sizeBorderRadiusM = \"0.25rem\";\nexport const sizeBorderRadiusS = \"0.125rem\";\nexport const sizeFontHead1 = \"1.75rem\";\nexport const sizeFontHead2 = \"1.5rem\";\nexport const sizeFontHead3 = \"1.25rem\";\nexport const sizeFontHead4 = \"1.125rem\";\nexport const sizeFontHead5 = \"0.9375rem\";\nexport const sizeFontHead6 = \"0.875rem\";\nexport const sizeFontBodyXl = \"1.25rem\";\nexport const sizeFontBodyL = \"1.125rem\";\nexport const sizeFontBodyM = \"0.9375rem\";\nexport const sizeFontBodyS = \"0.875rem\";\nexport const sizeFontBodyXs = \"0.75rem\";\nexport const sizeFontMonoXl = \"1.125rem\";\nexport const sizeFontMonoL = \"0.9375rem\";\nexport const sizeFontMonoM = \"0.875rem\";\nexport const sizeFontMonoS = \"0.75rem\";\nexport const sizeFontMonoXs = \"0.625rem\";\nexport const sizeLineHead1 = \"2rem\";\nexport const sizeLineHead2 = \"1.75rem\";\nexport const sizeLineHead3 = \"1.5rem\";\nexport const sizeLineHead4 = \"1.5rem\";\nexport const sizeLineHead5 = \"1.25rem\";\nexport const sizeLineHead6 = \"1rem\";\nexport const sizeLineBodyXl = \"1.5rem\";\nexport const sizeLineBodyL = \"1.5rem\";\nexport const sizeLineBodyM = \"1.25rem\";\nexport const sizeLineBodyS = \"1rem\";\nexport const sizeLineBodyXs = \"1rem\";\nexport const sizeLineMonoXl = \"1.5rem\";\nexport const sizeLineMonoL = \"1.25rem\";\nexport const sizeLineMonoM = \"1.125rem\";\nexport const sizeLineMonoS = \"1rem\";\nexport const sizeLineMonoXs = \"0.875rem\";\nexport const sizeModalS = \"400rem\";\nexport const sizeModalM = \"600rem\";\nexport const sizeModalL = \"800rem\";\nexport const sizeScreenXs = \"540rem\";\nexport const sizeScreenS = \"768rem\";\nexport const sizeScreenM = \"992rem\";\nexport const sizeScreenL = \"1200rem\";\nexport const sizeScreenXl = \"1400rem\";\nexport const sizeSpacingXl = \"2rem\";\nexport const sizeSpacingL = \"1.5rem\";\nexport const sizeSpacingM = \"1rem\";\nexport const sizeSpacingS = \"0.5rem\";\nexport const sizeSpacingXs = \"0.25rem\";\nexport const timeTransitionL = 500;\nexport const timeTransitionM = 250;\nexport const timeTransitionS = 125;\nexport const timeDelayL = 500;\nexport const timeDelayM = 250;\nexport const timeDelayS = 125;\nexport const timeDurationL = 1000;\nexport const timeDurationM = 500;\nexport const timeDurationS = 250;","@import 'variables';\n@import 'mixins';\n\n$-min-width: 8rem;\n$-max-width: 16rem;\n$-min-height: 2rem;\n$-max-height: calc(100vh - 48px);\n\n:host {\n display: contents;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n::slotted(nav) {\n padding-top: $cat-body-margin-bottom * 0.5;\n padding-bottom: $cat-body-margin-bottom * 0.5;\n min-width: $-min-width;\n max-width: $-max-width;\n}\n\n.content {\n position: absolute;\n background: cat-token('color.ui.background.body');\n display: none;\n -webkit-overflow-scrolling: touch;\n min-height: $-min-height;\n max-height: $-max-height;\n @include cat-elevation(1);\n border-radius: cat-border-radius('m');\n z-index: $cat-dropdown-z-index;\n opacity: 0;\n transition: transform cat-token('time.transition.s') cubic-bezier(0.3, 0, 0.8, 0.15),\n opacity cat-token('time.transition.s') cubic-bezier(0.3, 0, 0.8, 0.15);\n\n &[data-placement^='top'] {\n transform: translateY(1rem);\n }\n\n &[data-placement^='left'] {\n transform: translateX(1rem);\n }\n\n &[data-placement^='right'] {\n transform: translateX(-1rem);\n }\n\n &[data-placement^='bottom'] {\n transform: translateY(-1rem);\n }\n\n &.show {\n opacity: 1;\n transform: translateX(0);\n transform: translateY(0);\n transition: transform cat-token('time.transition.l') cubic-bezier(0.05, 0.7, 0.1, 1),\n opacity cat-token('time.transition.l') cubic-bezier(0.05, 0.7, 0.1, 1);\n }\n\n &.overflow-auto {\n overflow: auto;\n }\n}\n","import { autoUpdate, computePosition, flip, offset, Placement } from '@floating-ui/dom';\nimport { timeTransitionS } from '@haiilo/catalyst-tokens';\nimport { Component, Event, EventEmitter, h, Host, Listen, Method, Prop } from '@stencil/core';\nimport * as focusTrap from 'focus-trap';\nimport { FocusableElement, tabbable } from 'tabbable';\nimport firstTabbable from '../../utils/first-tabbable';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-dropdown',\n styleUrl: 'cat-dropdown.scss',\n shadow: true\n})\nexport class CatDropdown {\n private static readonly OFFSET = 4;\n private readonly id = nextUniqueId++;\n private triggerSlot!: HTMLSlotElement;\n private trigger?: FocusableElement;\n private content!: HTMLElement;\n private trap?: focusTrap.FocusTrap;\n private keyListener?: (event: KeyboardEvent) => void;\n private isOpen: boolean | null = false;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-start';\n\n /**\n * Do not close the dropdown on outside clicks.\n */\n @Prop() noAutoClose = false;\n\n /**\n * Allow overflow when dropdown is open.\n */\n @Prop() overflow = false;\n\n /**\n * Emitted when the dropdown is opened.\n */\n @Event() catOpen!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event() catClose!: EventEmitter<FocusEvent>;\n\n @Listen('catClick')\n clickHandler(event: CustomEvent<MouseEvent>) {\n // we need to delay the initialization of the trigger until first,\n // interaction because the element might still be hidden (and thus not\n // tabbable) if contained in another Stencil web component\n if (!this.trigger) {\n this.initTrigger();\n this.toggle();\n }\n\n // hide dropdown on button click\n if (!this.noAutoClose && event.composedPath().includes(this.content)) {\n this.close();\n }\n }\n\n /**\n * Toggles the dropdown.\n */\n async toggle(): Promise<void> {\n this.isOpen ? this.close() : this.open();\n }\n\n /**\n * Opens the dropdown.\n */\n async open(): Promise<void> {\n if (this.isOpen === null) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.style.display = 'block';\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = true;\n this.content.classList.add('show');\n this.trigger?.setAttribute('aria-expanded', 'true');\n this.catOpen.emit();\n this.trap = this.trap\n ? this.trap.updateContainerElements(this.content)\n : focusTrap.createFocusTrap(this.content, {\n tabbableOptions: {\n getShadowRoot: true\n },\n allowOutsideClick: true,\n clickOutsideDeactivates: event =>\n !this.noAutoClose &&\n !event.composedPath().includes(this.content) &&\n (!this.trigger || !event.composedPath().includes(this.trigger)),\n onPostDeactivate: () => this.close()\n });\n this.trap.activate();\n });\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n async close(): Promise<void> {\n if (this.isOpen === null) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.classList.remove('show');\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = false;\n this.content.classList.remove('show');\n this.content.style.display = '';\n this.trigger?.setAttribute('aria-expanded', 'false');\n this.trap?.deactivate();\n this.catClose.emit();\n }, timeTransitionS);\n }\n\n componentDidLoad(): void {\n this.keyListener = event => {\n if (this.isOpen && ['ArrowDown', 'ArrowUp'].includes(event.key)) {\n const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });\n const activeElement = firstTabbable(document.activeElement);\n const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;\n const activeOff = event.key === 'ArrowDown' ? 1 : -1;\n const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;\n targetElements[targetIdx].focus();\n event.preventDefault();\n }\n };\n document.addEventListener('keydown', this.keyListener);\n }\n\n disconnectedCallback(): void {\n if (this.keyListener) {\n document.removeEventListener('keydown', this.keyListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot name=\"trigger\" ref={el => (this.triggerSlot = el as HTMLSlotElement)}></slot>\n <div\n id={this.contentId}\n class={{ content: true, 'overflow-auto': !this.overflow }}\n ref={el => (this.content = el as HTMLElement)}\n >\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n\n private get contentId() {\n return `cat-dropdown-${this.id}`;\n }\n\n private initTrigger() {\n this.trigger = this.findTrigger();\n this.trigger.setAttribute('aria-haspopup', 'true');\n this.trigger.setAttribute('aria-expanded', 'false');\n this.trigger.setAttribute('aria-controls', this.contentId);\n this.trigger.addEventListener('click', () => this.toggle());\n autoUpdate(this.trigger, this.content, () => this.update());\n }\n\n private findTrigger() {\n let trigger: FocusableElement | undefined;\n const elems = this.triggerSlot?.assignedElements?.() || [];\n while (!trigger && elems.length) {\n const elem = elems.shift();\n trigger = elem?.hasAttribute('data-trigger')\n ? (elem as HTMLElement)\n : elem?.querySelector('[data-trigger]') ?? undefined;\n }\n if (!trigger) {\n trigger = firstTabbable(this.triggerSlot);\n }\n if (!trigger) {\n throw new Error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');\n }\n return trigger;\n }\n\n private update() {\n if (this.trigger) {\n computePosition(this.trigger, this.content, {\n placement: this.placement,\n middleware: [offset(CatDropdown.OFFSET), flip()]\n }).then(({ x, y, placement }) => {\n this.content.dataset.placement = placement;\n Object.assign(this.content.style, {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,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,CAAC,gBAAgB,CAAC,mCAAI,SAAS,CAAC;KACxD;IACD,IAAI,CAAC,OAAO,EAAE;MACZ,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KAC3C;IACD,IAAI,CAAC,OAAO,EAAE;MACZ,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KACzF;IACD,OAAO,OAAO,CAAC;GAChB;EAEO,MAAM;IACZ,IAAI,IAAI,CAAC,OAAO,EAAE;MAChB,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;QAC1C,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;OACjD,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE;QAC1B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;UAChC,IAAI,EAAE,GAAG,CAAC,IAAI;UACd,GAAG,EAAE,GAAG,CAAC,IAAI;SACd,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;GACF;;;;;;;;AAhMuB,kBAAM,GAAG,CAAE,CAAA;;;;;;;;;;;;;;;;;","names":["focusTrap.createFocusTrap"],"sources":["../tokens/dist/js/variables.js","./src/components/cat-dropdown/cat-dropdown.scss?tag=cat-dropdown&encapsulation=shadow","./src/components/cat-dropdown/cat-dropdown.tsx"],"sourcesContent":["/**\n * Auto-generated file. Do not edit directly.\n */\n\nexport const assetFontDmSansName = \"DM Sans\";\nexport const assetFontDmSansWoff2Bold = \"DMSans-Bold.woff2\";\nexport const assetFontDmSansWoff2BoldItalic = \"DMSans-BoldItalic.woff2\";\nexport const assetFontDmSansWoff2Italic = \"DMSans-Italic.woff2\";\nexport const assetFontDmSansWoff2Medium = \"DMSans-Medium.woff2\";\nexport const assetFontDmSansWoff2MediumItalic = \"DMSans-MediumItalic.woff2\";\nexport const assetFontDmSansWoff2Regular = \"DMSans-Regular.woff2\";\nexport const assetFontLatoName = \"Lato\";\nexport const assetFontLatoWoffBlack = \"Lato-Black.woff\";\nexport const assetFontLatoWoff2Black = \"Lato-Black.woff2\";\nexport const assetFontLatoWoffBlackItalic = \"Lato-BlackItalic.woff\";\nexport const assetFontLatoWoff2BlackItalic = \"Lato-BlackItalic.woff2\";\nexport const assetFontLatoWoffBold = \"Lato-Bold.woff\";\nexport const assetFontLatoWoff2Bold = \"Lato-Bold.woff2\";\nexport const assetFontLatoWoffBoldItalic = \"Lato-BoldItalic.woff\";\nexport const assetFontLatoWoff2BoldItalic = \"Lato-BoldItalic.woff2\";\nexport const assetFontLatoWoffHairline = \"Lato-Hairline.woff\";\nexport const assetFontLatoWoff2Hairline = \"Lato-Hairline.woff2\";\nexport const assetFontLatoWoffHairlineItalic = \"Lato-HairlineItalic.woff\";\nexport const assetFontLatoWoff2HairlineItalic = \"Lato-HairlineItalic.woff2\";\nexport const assetFontLatoWoffHeavy = \"Lato-Heavy.woff\";\nexport const assetFontLatoWoff2Heavy = \"Lato-Heavy.woff2\";\nexport const assetFontLatoWoffHeavyItalic = \"Lato-HeavyItalic.woff\";\nexport const assetFontLatoWoff2HeavyItalic = \"Lato-HeavyItalic.woff2\";\nexport const assetFontLatoWoffItalic = \"Lato-Italic.woff\";\nexport const assetFontLatoWoff2Italic = \"Lato-Italic.woff2\";\nexport const assetFontLatoWoffLight = \"Lato-Light.woff\";\nexport const assetFontLatoWoff2Light = \"Lato-Light.woff2\";\nexport const assetFontLatoWoffLightItalic = \"Lato-LightItalic.woff\";\nexport const assetFontLatoWoff2LightItalic = \"Lato-LightItalic.woff2\";\nexport const assetFontLatoWoffMedium = \"Lato-Medium.woff\";\nexport const assetFontLatoWoff2Medium = \"Lato-Medium.woff2\";\nexport const assetFontLatoWoffMediumItalic = \"Lato-MediumItalic.woff\";\nexport const assetFontLatoWoff2MediumItalic = \"Lato-MediumItalic.woff2\";\nexport const assetFontLatoWoffRegular = \"Lato-Regular.woff\";\nexport const assetFontLatoWoff2Regular = \"Lato-Regular.woff2\";\nexport const assetFontLatoWoffSemibold = \"Lato-Semibold.woff\";\nexport const assetFontLatoWoff2Semibold = \"Lato-Semibold.woff2\";\nexport const assetFontLatoWoffSemiboldItalic = \"Lato-SemiboldItalic.woff\";\nexport const assetFontLatoWoff2SemiboldItalic = \"Lato-SemiboldItalic.woff2\";\nexport const assetFontLatoWoffThin = \"Lato-Thin.woff\";\nexport const assetFontLatoWoff2Thin = \"Lato-Thin.woff2\";\nexport const assetFontLatoWoffThinItalic = \"Lato-ThinItalic.woff\";\nexport const assetFontLatoWoff2ThinItalic = \"Lato-ThinItalic.woff2\";\nexport const assetFontAzeretMonoName = \"Azeret Mono\";\nexport const assetFontAzeretMonoWoff2Regular = \"AzeretMono-Regular.woff2\";\nexport const colorBaseWhite = \"#ffffff\";\nexport const colorBaseBlack = \"#000000\";\nexport const colorBaseNeutral100 = \"#f2f4f7\";\nexport const colorBaseNeutral200 = \"#ebecf0\";\nexport const colorBaseNeutral300 = \"#d7dbe0\";\nexport const colorBaseNeutral400 = \"#697687\";\nexport const colorBaseNeutral500 = \"#515c6c\";\nexport const colorBaseNeutral600 = \"#394251\";\nexport const colorBaseNeutral700 = \"#1b1f26\";\nexport const colorBaseNeutralDark400 = \"#697687\";\nexport const colorBaseBrand100 = \"#c9e5e8\";\nexport const colorBaseBrand200 = \"#2db3c3\";\nexport const colorBaseBrand300 = \"#29a3b1\";\nexport const colorBaseBrand400 = \"#008194\";\nexport const colorBaseBrand500 = \"#017384\";\nexport const colorBaseBrand600 = \"#026371\";\nexport const colorBaseBrand700 = \"#175b63\";\nexport const colorBaseBrandDark400 = \"#93b4f2\";\nexport const colorBaseBrandDark500 = \"#93b4f2\";\nexport const colorBaseBrandDark600 = \"#93b4f2\";\nexport const colorBaseGreen100 = \"#d4ede4\";\nexport const colorBaseGreen200 = \"#00bb7d\";\nexport const colorBaseGreen300 = \"#00aa71\";\nexport const colorBaseGreen400 = \"#008458\";\nexport const colorBaseGreen500 = \"#00754e\";\nexport const colorBaseGreen600 = \"#006946\";\nexport const colorBaseGreen700 = \"#005f40\";\nexport const colorBaseOrange100 = \"#ffdea8\";\nexport const colorBaseOrange200 = \"#ffd694\";\nexport const colorBaseOrange300 = \"#ffce80\";\nexport const colorBaseOrange400 = \"#ebb663\";\nexport const colorBaseOrange500 = \"#d6a75a\";\nexport const colorBaseOrange600 = \"#b0853e\";\nexport const colorBaseOrange700 = \"#9f6100\";\nexport const colorBaseRed100 = \"#fbc7bb\";\nexport const colorBaseRed200 = \"#f68368\";\nexport const colorBaseRed300 = \"#f46a49\";\nexport const colorBaseRed400 = \"#d9340d\";\nexport const colorBaseRed500 = \"#c22e0b\";\nexport const colorBaseRed600 = \"#ae2a0a\";\nexport const colorBaseRed700 = \"#9e2609\";\nexport const colorThemePrimaryBg = \"#008194\";\nexport const colorThemePrimaryBgHover = \"#017384\";\nexport const colorThemePrimaryBgActive = \"#026371\";\nexport const colorThemePrimaryFill = \"#ffffff\";\nexport const colorThemePrimaryFillHover = \"#ffffff\";\nexport const colorThemePrimaryFillActive = \"#ffffff\";\nexport const colorThemePrimaryText = \"#008194\";\nexport const colorThemePrimaryTextHover = \"#017384\";\nexport const colorThemePrimaryTextActive = \"#026371\";\nexport const colorThemePrimaryDarkBg = \"#93b4f2\";\nexport const colorThemePrimaryDarkBgHover = \"#93b4f2\";\nexport const colorThemePrimaryDarkBgActive = \"#93b4f2\";\nexport const colorThemePrimaryDarkFill = \"#000000\";\nexport const colorThemePrimaryDarkFillHover = \"#000000\";\nexport const colorThemePrimaryDarkFillActive = \"#000000\";\nexport const colorThemePrimaryDarkText = \"#93b4f2\";\nexport const colorThemePrimaryDarkTextHover = \"#93b4f2\";\nexport const colorThemePrimaryDarkTextActive = \"#93b4f2\";\nexport const colorThemeSecondaryBg = \"#697687\";\nexport const colorThemeSecondaryBgHover = \"#697687\";\nexport const colorThemeSecondaryBgActive = \"#697687\";\nexport const colorThemeSecondaryFill = \"#ffffff\";\nexport const colorThemeSecondaryFillHover = \"#ffffff\";\nexport const colorThemeSecondaryFillActive = \"#ffffff\";\nexport const colorThemeSecondaryText = \"#000000\";\nexport const colorThemeSecondaryTextHover = \"#000000\";\nexport const colorThemeSecondaryTextActive = \"#000000\";\nexport const colorThemeSecondaryDarkBg = \"#697687\";\nexport const colorThemeSecondaryDarkBgHover = \"#697687\";\nexport const colorThemeSecondaryDarkBgActive = \"#697687\";\nexport const colorThemeSecondaryDarkFill = \"#000000\";\nexport const colorThemeSecondaryDarkFillHover = \"#000000\";\nexport const colorThemeSecondaryDarkFillActive = \"#000000\";\nexport const colorThemeSecondaryDarkText = \"#ffffff\";\nexport const colorThemeSecondaryDarkTextHover = \"#ffffff\";\nexport const colorThemeSecondaryDarkTextActive = \"#ffffff\";\nexport const colorThemeSuccessBg = \"#008458\";\nexport const colorThemeSuccessBgHover = \"#00754e\";\nexport const colorThemeSuccessBgActive = \"#006946\";\nexport const colorThemeSuccessFill = \"#ffffff\";\nexport const colorThemeSuccessFillHover = \"#ffffff\";\nexport const colorThemeSuccessFillActive = \"#ffffff\";\nexport const colorThemeSuccessText = \"#008458\";\nexport const colorThemeSuccessTextHover = \"#00754e\";\nexport const colorThemeSuccessTextActive = \"#006946\";\nexport const colorThemeWarningBg = \"#ffce80\";\nexport const colorThemeWarningBgHover = \"#ffd694\";\nexport const colorThemeWarningBgActive = \"#ffdea8\";\nexport const colorThemeWarningFill = \"#000000\";\nexport const colorThemeWarningFillHover = \"#000000\";\nexport const colorThemeWarningFillActive = \"#000000\";\nexport const colorThemeWarningText = \"#9f6100\";\nexport const colorThemeWarningTextHover = \"#9f6100\";\nexport const colorThemeWarningTextActive = \"#9f6100\";\nexport const colorThemeDangerBg = \"#d9340d\";\nexport const colorThemeDangerBgHover = \"#c22e0b\";\nexport const colorThemeDangerBgActive = \"#ae2a0a\";\nexport const colorThemeDangerFill = \"#ffffff\";\nexport const colorThemeDangerFillHover = \"#ffffff\";\nexport const colorThemeDangerFillActive = \"#ffffff\";\nexport const colorThemeDangerText = \"#d9340d\";\nexport const colorThemeDangerTextHover = \"#c22e0b\";\nexport const colorThemeDangerTextActive = \"#ae2a0a\";\nexport const colorUiBackgroundCanvas = \"#f2f4f7\";\nexport const colorUiBackgroundBody = \"#ffffff\";\nexport const colorUiBackgroundBodyDark = \"#1b1f26\";\nexport const colorUiBackgroundMuted = \"#ebecf0\";\nexport const colorUiBackgroundInput = \"#ffffff\";\nexport const colorUiBackgroundInputDisabled = \"#f2f4f7\";\nexport const colorUiBackgroundSkeleton = \"#ebecf0\";\nexport const colorUiBackgroundSkeletonHighlight = \"#d7dbe0\";\nexport const colorUiBackgroundTooltip = \"#000000\";\nexport const colorUiBackgroundBackdrop = \"#000000\";\nexport const colorUiBackgroundSelectPill = \"#f2f4f7\";\nexport const colorUiBorderLight = \"#f2f4f7\";\nexport const colorUiBorderDefault = \"#ebecf0\";\nexport const colorUiBorderDark = \"#d7dbe0\";\nexport const colorUiBorderFocus = \"#0071ff\";\nexport const colorUiBorderQuote = \"#697687\";\nexport const colorUiFontHead = \"#000000\";\nexport const colorUiFontHeadDark = \"#ffffff\";\nexport const colorUiFontBody = \"#000000\";\nexport const colorUiFontBodyDark = \"#ffffff\";\nexport const colorUiFontMono = \"#000000\";\nexport const colorUiFontMonoDark = \"#ffffff\";\nexport const colorUiFontMuted = \"#697687\";\nexport const colorUiFontQuote = \"#697687\";\nexport const colorUiFontTooltip = \"#ffffff\";\nexport const fontFamilyHead = \"Lato\";\nexport const fontFamilyBody = \"Lato\";\nexport const fontFamilyMono = \"Azeret Mono\";\nexport const fontFamilyEmoji = \"''\";\nexport const fontWeightHead = 500;\nexport const fontWeightBody = 400;\nexport const fontWeightMono = 400;\nexport const fontDecorationLink = \"none\";\nexport const fontDecorationLinkHover = \"underline\";\nexport const fontDecorationLinkButton = \"none\";\nexport const fontDecorationLinkButtonHover = \"none\";\nexport const opacityDisabled = 0.65;\nexport const opacityBackdrop = 0.6;\nexport const opacityTooltip = 1;\nexport const sizeBorderRadiusL = \"0.5rem\";\nexport const sizeBorderRadiusM = \"0.25rem\";\nexport const sizeBorderRadiusS = \"0.125rem\";\nexport const sizeFontHead1 = \"1.75rem\";\nexport const sizeFontHead2 = \"1.5rem\";\nexport const sizeFontHead3 = \"1.25rem\";\nexport const sizeFontHead4 = \"1.125rem\";\nexport const sizeFontHead5 = \"0.9375rem\";\nexport const sizeFontHead6 = \"0.875rem\";\nexport const sizeFontBodyXl = \"1.25rem\";\nexport const sizeFontBodyL = \"1.125rem\";\nexport const sizeFontBodyM = \"0.9375rem\";\nexport const sizeFontBodyS = \"0.875rem\";\nexport const sizeFontBodyXs = \"0.75rem\";\nexport const sizeFontMonoXl = \"1.125rem\";\nexport const sizeFontMonoL = \"0.9375rem\";\nexport const sizeFontMonoM = \"0.875rem\";\nexport const sizeFontMonoS = \"0.75rem\";\nexport const sizeFontMonoXs = \"0.625rem\";\nexport const sizeLineHead1 = \"2rem\";\nexport const sizeLineHead2 = \"1.75rem\";\nexport const sizeLineHead3 = \"1.5rem\";\nexport const sizeLineHead4 = \"1.5rem\";\nexport const sizeLineHead5 = \"1.25rem\";\nexport const sizeLineHead6 = \"1rem\";\nexport const sizeLineBodyXl = \"1.5rem\";\nexport const sizeLineBodyL = \"1.5rem\";\nexport const sizeLineBodyM = \"1.25rem\";\nexport const sizeLineBodyS = \"1rem\";\nexport const sizeLineBodyXs = \"1rem\";\nexport const sizeLineMonoXl = \"1.5rem\";\nexport const sizeLineMonoL = \"1.25rem\";\nexport const sizeLineMonoM = \"1.125rem\";\nexport const sizeLineMonoS = \"1rem\";\nexport const sizeLineMonoXs = \"0.875rem\";\nexport const sizeModalS = \"400rem\";\nexport const sizeModalM = \"600rem\";\nexport const sizeModalL = \"800rem\";\nexport const sizeScreenXs = \"540rem\";\nexport const sizeScreenS = \"768rem\";\nexport const sizeScreenM = \"992rem\";\nexport const sizeScreenL = \"1200rem\";\nexport const sizeScreenXl = \"1400rem\";\nexport const sizeSpacingXl = \"2rem\";\nexport const sizeSpacingL = \"1.5rem\";\nexport const sizeSpacingM = \"1rem\";\nexport const sizeSpacingS = \"0.5rem\";\nexport const sizeSpacingXs = \"0.25rem\";\nexport const timeTransitionL = 500;\nexport const timeTransitionM = 250;\nexport const timeTransitionS = 125;\nexport const timeDelayL = 500;\nexport const timeDelayM = 250;\nexport const timeDelayS = 125;\nexport const timeDurationL = 1000;\nexport const timeDurationM = 500;\nexport const timeDurationS = 250;","@import 'variables';\n@import 'mixins';\n\n$-min-width: 8rem;\n$-max-width: 16rem;\n$-min-height: 2rem;\n$-max-height: calc(100vh - 48px);\n\n:host {\n display: contents;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n::slotted(nav) {\n padding-top: $cat-body-margin-bottom * 0.5;\n padding-bottom: $cat-body-margin-bottom * 0.5;\n min-width: $-min-width;\n max-width: $-max-width;\n}\n\n.content {\n position: absolute;\n background: cat-token('color.ui.background.body');\n display: none;\n -webkit-overflow-scrolling: touch;\n min-height: $-min-height;\n max-height: $-max-height;\n @include cat-elevation(1);\n border-radius: cat-border-radius('m');\n z-index: $cat-dropdown-z-index;\n opacity: 0;\n transition: transform cat-token('time.transition.s') cubic-bezier(0.3, 0, 0.8, 0.15),\n opacity cat-token('time.transition.s') cubic-bezier(0.3, 0, 0.8, 0.15);\n\n &[data-placement^='top'] {\n transform: translateY(1rem);\n }\n\n &[data-placement^='left'] {\n transform: translateX(1rem);\n }\n\n &[data-placement^='right'] {\n transform: translateX(-1rem);\n }\n\n &[data-placement^='bottom'] {\n transform: translateY(-1rem);\n }\n\n &.show {\n opacity: 1;\n transform: translateX(0);\n transform: translateY(0);\n transition: transform cat-token('time.transition.l') cubic-bezier(0.05, 0.7, 0.1, 1),\n opacity cat-token('time.transition.l') cubic-bezier(0.05, 0.7, 0.1, 1);\n }\n\n &.overflow-auto {\n overflow: auto;\n }\n}\n","import { autoUpdate, computePosition, flip, offset, Placement } from '@floating-ui/dom';\nimport { timeTransitionS } from '@haiilo/catalyst-tokens';\nimport { Component, Event, EventEmitter, h, Host, Listen, Method, Prop } from '@stencil/core';\nimport * as focusTrap from 'focus-trap';\nimport { FocusableElement, tabbable } from 'tabbable';\nimport firstTabbable from '../../utils/first-tabbable';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-dropdown',\n styleUrl: 'cat-dropdown.scss',\n shadow: true\n})\nexport class CatDropdown {\n private static readonly OFFSET = 4;\n private readonly id = nextUniqueId++;\n private triggerSlot!: HTMLSlotElement;\n private trigger?: FocusableElement;\n private content!: HTMLElement;\n private trap?: focusTrap.FocusTrap;\n private keyListener?: (event: KeyboardEvent) => void;\n private isOpen: boolean | null = false;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-start';\n\n /**\n * Do not close the dropdown on outside clicks.\n */\n @Prop() noAutoClose = false;\n\n /**\n * Allow overflow when dropdown is open.\n */\n @Prop() overflow = false;\n\n /**\n * Emitted when the dropdown is opened.\n */\n @Event() catOpen!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event() catClose!: EventEmitter<FocusEvent>;\n\n @Listen('catClick')\n clickHandler(event: CustomEvent<MouseEvent>) {\n // we need to delay the initialization of the trigger until first,\n // interaction because the element might still be hidden (and thus not\n // tabbable) if contained in another Stencil web component\n if (!this.trigger) {\n this.initTrigger();\n this.toggle();\n }\n\n // hide dropdown on button click\n if (!this.noAutoClose && event.composedPath().includes(this.content)) {\n this.close();\n }\n }\n\n /**\n * Toggles the dropdown.\n */\n async toggle(): Promise<void> {\n this.isOpen ? this.close() : this.open();\n }\n\n /**\n * Opens the dropdown.\n */\n async open(): Promise<void> {\n if (this.isOpen === null) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.style.display = 'block';\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = true;\n this.content.classList.add('show');\n this.trigger?.setAttribute('aria-expanded', 'true');\n this.catOpen.emit();\n this.trap = this.trap\n ? this.trap.updateContainerElements(this.content)\n : focusTrap.createFocusTrap(this.content, {\n tabbableOptions: {\n getShadowRoot: true\n },\n allowOutsideClick: true,\n clickOutsideDeactivates: event =>\n !this.noAutoClose &&\n !event.composedPath().includes(this.content) &&\n (!this.trigger || !event.composedPath().includes(this.trigger)),\n onPostDeactivate: () => this.close()\n });\n this.trap.activate();\n });\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n async close(): Promise<void> {\n if (this.isOpen === null) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.classList.remove('show');\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = false;\n this.content.classList.remove('show');\n this.content.style.display = '';\n this.trigger?.setAttribute('aria-expanded', 'false');\n this.trap?.deactivate();\n this.catClose.emit();\n }, timeTransitionS);\n }\n\n componentDidLoad(): void {\n this.keyListener = event => {\n if (this.isOpen && ['ArrowDown', 'ArrowUp'].includes(event.key)) {\n const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });\n const activeElement = firstTabbable(document.activeElement);\n const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;\n const activeOff = event.key === 'ArrowDown' ? 1 : -1;\n const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;\n targetElements[targetIdx].focus();\n event.preventDefault();\n }\n };\n document.addEventListener('keydown', this.keyListener);\n }\n\n disconnectedCallback(): void {\n if (this.keyListener) {\n document.removeEventListener('keydown', this.keyListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot name=\"trigger\" ref={el => (this.triggerSlot = el as HTMLSlotElement)}></slot>\n <div\n id={this.contentId}\n class={{ content: true, 'overflow-auto': !this.overflow }}\n ref={el => (this.content = el as HTMLElement)}\n >\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n\n private get contentId() {\n return `cat-dropdown-${this.id}`;\n }\n\n private initTrigger() {\n this.trigger = this.findTrigger();\n this.trigger.setAttribute('aria-haspopup', 'true');\n this.trigger.setAttribute('aria-expanded', 'false');\n this.trigger.setAttribute('aria-controls', this.contentId);\n this.trigger.addEventListener('click', () => this.toggle());\n autoUpdate(this.trigger, this.content, () => this.update());\n }\n\n private findTrigger() {\n let trigger: FocusableElement | undefined;\n const elems = this.triggerSlot?.assignedElements?.() || [];\n while (!trigger && elems.length) {\n const elem = elems.shift();\n trigger = elem?.hasAttribute('data-trigger')\n ? (elem as HTMLElement)\n : elem?.querySelector('[data-trigger]') ?? undefined;\n }\n if (!trigger) {\n trigger = firstTabbable(this.triggerSlot);\n }\n if (!trigger) {\n throw new Error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');\n }\n return trigger;\n }\n\n private update() {\n if (this.trigger) {\n computePosition(this.trigger, this.content, {\n placement: this.placement,\n middleware: [offset(CatDropdown.OFFSET), flip()]\n }).then(({ x, y, placement }) => {\n this.content.dataset.placement = placement;\n Object.assign(this.content.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n });\n }\n }\n}\n"],"version":3}
@@ -17,7 +17,7 @@ const CatInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
17
17
  this.catChange = createEvent(this, "catChange", 7);
18
18
  this.catFocus = createEvent(this, "catFocus", 7);
19
19
  this.catBlur = createEvent(this, "catBlur", 7);
20
- this.id = `cat-input-${nextUniqueId++}`;
20
+ this._id = `cat-input-${nextUniqueId++}`;
21
21
  this.hasSlottedLabel = false;
22
22
  /**
23
23
  * Whether the input should show a clear button.
@@ -39,10 +39,6 @@ const CatInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
39
39
  * Visually hide the label, but still show it to assistive technologies like screen readers.
40
40
  */
41
41
  this.labelHidden = false;
42
- /**
43
- * The name of the form control. Submitted with the form as part of a name/value pair.
44
- */
45
- this.name = '';
46
42
  /**
47
43
  * The value is not editable.
48
44
  */
@@ -60,6 +56,9 @@ const CatInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
60
56
  */
61
57
  this.type = 'text';
62
58
  }
59
+ get id() {
60
+ return this.identifier || this._id;
61
+ }
63
62
  componentWillRender() {
64
63
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
65
64
  if (!this.label && !this.hasSlottedLabel) {
@@ -127,6 +126,7 @@ const CatInput$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
127
126
  "hint": [1],
128
127
  "icon": [1],
129
128
  "iconRight": [4, "icon-right"],
129
+ "identifier": [1],
130
130
  "label": [1],
131
131
  "labelHidden": [4, "label-hidden"],
132
132
  "max": [8],