@haiilo/catalyst 0.10.8 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) 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/index.esm.js +1 -1
  5. package/dist/catalyst/p-4ced6c7c.entry.js +12 -0
  6. package/dist/catalyst/p-4ced6c7c.entry.js.map +1 -0
  7. package/dist/catalyst/p-f88f8914.js +10 -0
  8. package/dist/catalyst/p-f88f8914.js.map +1 -0
  9. package/dist/catalyst/scss/core/_base.scss +0 -1
  10. package/dist/catalyst/scss/index.scss +1 -1
  11. package/dist/catalyst/scss/utils/_layout.scss +4 -4
  12. package/dist/catalyst/scss/utils/_sizing.mixins.scss +0 -4
  13. package/dist/catalyst/scss/utils/_typography.mixins.scss +3 -3
  14. package/dist/cjs/{cat-alert_21.cjs.entry.js → cat-alert_22.cjs.entry.js} +245 -130
  15. package/dist/cjs/cat-alert_22.cjs.entry.js.map +1 -0
  16. package/dist/cjs/{cat-notification-c2859ed7.js → cat-notification-444c9ea0.js} +331 -14
  17. package/dist/cjs/cat-notification-444c9ea0.js.map +1 -0
  18. package/dist/cjs/catalyst.cjs.js +1 -1
  19. package/dist/cjs/index.cjs.js +1 -2
  20. package/dist/cjs/index.cjs.js.map +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/collection/collection-manifest.json +1 -1
  23. package/dist/collection/components/cat-badge/cat-badge.css +15 -15
  24. package/dist/collection/components/cat-button/cat-button.css +185 -0
  25. package/dist/collection/components/cat-checkbox/cat-checkbox.css +16 -9
  26. package/dist/collection/components/cat-input/cat-input.css +3 -0
  27. package/dist/collection/components/cat-input/cat-input.js +1 -1
  28. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  29. package/dist/collection/components/cat-radio/cat-radio.css +4 -0
  30. package/dist/collection/components/cat-radio-group/cat-radio-group.js +35 -4
  31. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  32. package/dist/collection/components/cat-select/cat-select.css +4 -2
  33. package/dist/collection/components/cat-select/cat-select.js +136 -200
  34. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  35. package/dist/collection/components/cat-textarea/cat-textarea.css +3 -0
  36. package/dist/collection/components/cat-toggle/cat-toggle.css +9 -9
  37. package/dist/collection/components/cat-tooltip/cat-tooltip.css +2 -3
  38. package/dist/collection/index.js.map +1 -1
  39. package/dist/collection/scss/core/_base.scss +0 -1
  40. package/dist/collection/scss/index.scss +1 -1
  41. package/dist/collection/scss/utils/_layout.scss +4 -4
  42. package/dist/collection/scss/utils/_sizing.mixins.scss +0 -4
  43. package/dist/collection/scss/utils/_typography.mixins.scss +3 -3
  44. package/dist/components/cat-avatar.js.map +1 -1
  45. package/dist/components/cat-badge.js +1 -1
  46. package/dist/components/cat-badge.js.map +1 -1
  47. package/dist/components/cat-button2.js +1 -1
  48. package/dist/components/cat-button2.js.map +1 -1
  49. package/dist/components/cat-checkbox.js +1 -1
  50. package/dist/components/cat-checkbox.js.map +1 -1
  51. package/dist/components/cat-icon2.js.map +1 -1
  52. package/dist/components/cat-input.js +1 -1
  53. package/dist/components/cat-input.js.map +1 -1
  54. package/dist/components/cat-radio-group.js +7 -3
  55. package/dist/components/cat-radio-group.js.map +1 -1
  56. package/dist/components/cat-radio.js +1 -1
  57. package/dist/components/cat-radio.js.map +1 -1
  58. package/dist/components/cat-select.js +112 -100
  59. package/dist/components/cat-select.js.map +1 -1
  60. package/dist/components/cat-skeleton.js.map +1 -1
  61. package/dist/components/cat-spinner2.js.map +1 -1
  62. package/dist/components/cat-textarea.js +1 -1
  63. package/dist/components/cat-textarea.js.map +1 -1
  64. package/dist/components/cat-toggle.js +1 -1
  65. package/dist/components/cat-toggle.js.map +1 -1
  66. package/dist/components/cat-tooltip.js +1 -1
  67. package/dist/components/cat-tooltip.js.map +1 -1
  68. package/dist/esm/{cat-alert_21.entry.js → cat-alert_22.entry.js} +230 -116
  69. package/dist/esm/cat-alert_22.entry.js.map +1 -0
  70. package/dist/esm/{cat-notification-3da6ddb1.js → cat-notification-953c785d.js} +317 -3
  71. package/dist/esm/cat-notification-953c785d.js.map +1 -0
  72. package/dist/esm/catalyst.js +1 -1
  73. package/dist/esm/index.js +1 -2
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/loader.js +1 -1
  76. package/dist/types/components/cat-input/cat-input.d.ts +1 -1
  77. package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +14 -0
  78. package/dist/types/components/cat-select/cat-select.d.ts +22 -28
  79. package/dist/types/components.d.ts +36 -35
  80. package/dist/types/index.d.ts +1 -1
  81. package/package.json +2 -2
  82. package/dist/catalyst/p-2ad6f8d8.js +0 -2
  83. package/dist/catalyst/p-2ad6f8d8.js.map +0 -1
  84. package/dist/catalyst/p-6fce43dd.js +0 -2
  85. package/dist/catalyst/p-6fce43dd.js.map +0 -1
  86. package/dist/catalyst/p-8121572a.js +0 -10
  87. package/dist/catalyst/p-8121572a.js.map +0 -1
  88. package/dist/catalyst/p-c0b4200d.entry.js +0 -2
  89. package/dist/catalyst/p-c0b4200d.entry.js.map +0 -1
  90. package/dist/catalyst/p-e5c5e21d.entry.js +0 -12
  91. package/dist/catalyst/p-e5c5e21d.entry.js.map +0 -1
  92. package/dist/cjs/cat-alert_21.cjs.entry.js.map +0 -1
  93. package/dist/cjs/cat-form-hint-25fdfed5.js +0 -22
  94. package/dist/cjs/cat-form-hint-25fdfed5.js.map +0 -1
  95. package/dist/cjs/cat-notification-c2859ed7.js.map +0 -1
  96. package/dist/cjs/cat-textarea.cjs.entry.js +0 -92
  97. package/dist/cjs/cat-textarea.cjs.entry.js.map +0 -1
  98. package/dist/cjs/loglevel-b5d158ad.js +0 -324
  99. package/dist/cjs/loglevel-b5d158ad.js.map +0 -1
  100. package/dist/esm/cat-alert_21.entry.js.map +0 -1
  101. package/dist/esm/cat-form-hint-790d1e46.js +0 -20
  102. package/dist/esm/cat-form-hint-790d1e46.js.map +0 -1
  103. package/dist/esm/cat-notification-3da6ddb1.js.map +0 -1
  104. package/dist/esm/cat-textarea.entry.js +0 -88
  105. package/dist/esm/cat-textarea.entry.js.map +0 -1
  106. package/dist/esm/loglevel-c8b59c3a.js +0 -319
  107. package/dist/esm/loglevel-c8b59c3a.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cat-select.js","sourceRoot":"","sources":["../../../src/components/cat-select/cat-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,OAAqD,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAAU,EAAE;;EAC/C,IAAI,MAAA,IAAI,CAAC,gBAAgB,0CAAE,QAAQ,EAAE;IACnC,OAAO;;8CAEmC,IAAI,CAAC,gBAAgB,CAAC,QAAQ;QACpE,IAAI,CAAC,KAAK;;KAEb,CAAC;GACH;EACD,OAAO,wBAAwB,IAAI,CAAC,KAAK,cAAc,IAAI,CAAC,QAAQ,mBAAmB,CAAC;AAC1F,CAAC,CAAC;AAEF;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;EALtB;IAMmB,SAAI,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC;IACrC,OAAE,GAAG,cAAc,YAAY,EAAE,EAAE,CAAC;IAU5C,oBAAe,GAAG,KAAK,CAAC;IAEjC;;OAEG;IACK,UA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch, State } from '@stencil/core';\nimport Choices, { Choice, ClassNames, Group, Item, Options } from 'choices.js';\nimport { CatI18nRegistry } from '../cat-i18n/cat-i18n-registry';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\nconst getOptionTemplate = (data: Item): string => {\n if (data.customProperties?.imageUrl) {\n return `\n <div class=\"d-flex align-items-center\">\n <img class=\"choices-option-icon\" src=\"${data.customProperties.imageUrl}\" style=\"margin-right: 0.5rem\" />\n ${data.label}\n </div>\n `;\n }\n return `<cat-checkbox label=\"${data.label}\" checked=\"${data.selected}\"></cat-checkbox>`;\n};\n\n/**\n * Select lets user choose one option from an options menu. Consider using\n * select when you have 6 or more options. Select component supports any content\n * type.\n *\n * @slot hint - Optional hint element to be displayed with the select.\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 label - The label content.\n */\n@Component({\n tag: 'cat-select',\n styleUrl: 'cat-select.scss',\n shadow: true\n})\nexport class CatSelect {\n private readonly i18n = CatI18nRegistry.getInstance();\n private readonly id = `cat-select-${nextUniqueId++}`;\n\n private choice?: Choices;\n private choiceInner?: Element;\n private choiceDropdown?: Element;\n private selectElement?: HTMLSelectElement;\n private removeElement?: HTMLCatButtonElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * The label for the select.\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 * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The available options for the input.\n */\n @Prop() choices: Choice[] = [];\n\n /**\n * The pre-selected items for the input.\n */\n @Prop({ mutable: true }) value?: string | string[] | Choice | Choice[];\n\n /**\n * Disable the select.\n */\n @Prop() disabled = false;\n\n /**\n * Enable multiple selection.\n */\n @Prop() multiple = false;\n\n /**\n * The placeholder for the select.\n */\n @Prop() placeholder = '';\n\n /**\n * Whether the dropdown should appear above `(top)` or below `(bottom)` the\n * input. By default, if there is not enough space within the window the\n * dropdown will appear above the input, otherwise below it.\n */\n @Prop() position: 'auto' | 'top' | 'bottom' = 'auto';\n\n /**\n * Enable search for the select.\n */\n @Prop() noSearch = false;\n\n /**\n * Optional hint text(s) to be displayed with the select.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the search is triggered.\n */\n @Event() catSearch!: EventEmitter;\n\n /**\n * Emitted when scrolled to the bottom.\n */\n @Event() catScrolledBottom!: EventEmitter;\n\n @Watch('choices')\n setChoicesHandler(choices: Choice[]) {\n if (!choices?.length) return;\n\n this.setChoices(choices, 'value', 'label', true);\n }\n\n @Watch('value')\n setValueHandler(value?: string[] | Choice[]) {\n if (this.multiple) return;\n\n this.setValue(value || []);\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on select', this);\n }\n }\n\n componentDidLoad(): void {\n this.init();\n const attachedInternals: ElementInternals | undefined = this.hostElement.attachInternals?.();\n if (attachedInternals) {\n this.choiceInner = attachedInternals.shadowRoot?.querySelector('.choices__inner') || undefined;\n this.choiceDropdown =\n attachedInternals.shadowRoot?.querySelector('.choices__list--dropdown')?.firstElementChild || undefined;\n }\n this.choiceInner?.addEventListener('click', this.showDropdownHandler.bind(this));\n this.selectElement?.addEventListener('addItem', this.onChange.bind(this));\n this.selectElement?.addEventListener('removeItem', this.onChange.bind(this));\n this.selectElement?.addEventListener('search', this.onSearch.bind(this));\n this.choiceDropdown?.addEventListener('scroll', this.onScrolledBottom.bind(this));\n if (this.multiple) {\n this.selectElement?.addEventListener('choice', this.onChoice.bind(this));\n this.createRemoveItemButton();\n }\n }\n\n disconnectedCallback(): void {\n this.choice?.destroy();\n this.choice = undefined;\n this.choiceInner?.removeEventListener('click', this.showDropdownHandler.bind(this));\n this.selectElement?.removeEventListener('addItem', this.onChange.bind(this));\n this.selectElement?.removeEventListener('removeItem', this.onChange.bind(this));\n this.selectElement?.removeEventListener('search', this.onSearch.bind(this));\n this.choiceDropdown?.removeEventListener('scroll', this.onScrolledBottom.bind(this));\n if (this.multiple) {\n this.selectElement?.removeEventListener('choice', this.onChoice.bind(this));\n this.removeElement?.removeEventListener('click', this.onRemoveItemButtonClick.bind(this));\n }\n }\n\n /**\n * Set value of input based on an array of objects or strings. This behaves\n * exactly the same as passing items via the items option but can be called\n * after initialisation.\n */\n @Method()\n async setValue(args: Array<string> | Array<Item>) {\n this.choice?.setValue(args);\n\n return this;\n }\n\n /**\n * Set choices of select input via an array of objects (or function that\n * returns array of object or promise of it), a value field name and a label\n * field name.\n */\n @Method()\n async setChoices(choices: Array<Choice> | Array<Group>, value?: string, label?: string, replaceChoices?: boolean) {\n this.choice?.setChoices(choices, value, label, replaceChoices);\n\n return this;\n }\n\n /**\n * Clear all choices from select.\n */\n @Method()\n async clearChoices() {\n this.choice?.clearChoices();\n\n return this;\n }\n\n /**\n * Clear input of any user inputted text.\n */\n @Method()\n async clearInput() {\n this.choice?.clearInput();\n\n return this;\n }\n\n render() {\n return (\n <Host>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n {!this.required && (\n <span class=\"input-optional\" aria-hidden=\"true\">\n ({this.i18n.t('input.optional')})\n </span>\n )}\n </span>\n </label>\n )}\n <select\n id={this.id}\n ref={el => (this.selectElement = el)}\n multiple={this.multiple}\n disabled={this.disabled}\n ></select>\n {this.hintSection}\n </Host>\n );\n }\n\n private init() {\n const value = this.value || [];\n const removeItemText = (value: string) => this.i18n.t('select.removeItem', { value });\n const config = {\n allowHTML: true,\n items: Array.isArray(value) ? value : ([value] as string[] | Choice[]),\n removeItemButton: true,\n duplicateItemsAllowed: false,\n delimiter: '',\n paste: false,\n searchEnabled: !this.noSearch,\n searchChoices: false,\n position: this.position,\n resetScrollPosition: false,\n placeholder: !!this.placeholder,\n placeholderValue: this.placeholder || '',\n searchPlaceholderValue: this.i18n.t('select.searchPlaceholder'),\n renderSelectedChoices: 'always' as 'auto' | 'always',\n loadingText: this.i18n.t('select.loading'),\n noResultsText: this.i18n.t('select.noResults'),\n noChoicesText: this.i18n.t('select.noChoices'),\n itemSelectText: this.i18n.t('select.selectItem'),\n addItemText: (value: string) => this.i18n.t('select.addItem', { value }),\n maxItemText: (maxItemCount: number) => this.i18n.t('select.maxItem', { maxItemCount }),\n uniqueItemText: this.i18n.t('select.uniqueItem'),\n customAddItemText: this.i18n.t('select.customAddItem')\n };\n\n const configSingle = {\n callbackOnCreateTemplates: (strToEl: (str: string) => HTMLElement) => {\n return {\n item: ({ classNames }: { classNames: ClassNames }, data: Item) => {\n const template = data.customProperties?.imageUrl\n ? `<img class=\"choices-option-icon\" src=\"${data.customProperties.imageUrl}\" style=\"margin-right: 0.5rem\" />`\n : '';\n return strToEl(\n `\n <div class=\"${classNames.item} ${\n data.highlighted ? classNames.highlightedState : classNames.itemSelectable\n } ${data.placeholder ? classNames.placeholder : ''}\" data-item data-id=\"${data.id}\" data-value=\"${\n data.value\n }\" ${data.active ? 'aria-selected=\"true\"' : ''} ${data.disabled ? 'aria-disabled=\"true\"' : ''}>\n <span>${template}</span> ${data.label}\n <button type=\"button\"\n class=\"${classNames.button}\"\n aria-label=\"${removeItemText(data.label)}\"\n data-button>${removeItemText(data.label)}</button>\n </div>\n `\n );\n }\n };\n }\n };\n\n const configMultiple = {\n callbackOnCreateTemplates: (strToEl: (str: string) => HTMLElement) => {\n const itemSelectText = config.itemSelectText;\n return {\n item: ({ classNames }: { classNames: ClassNames }, data: Item) => {\n const template = data.customProperties?.imageUrl\n ? `<img class=\"choices-option-icon\" src=\"${data.customProperties.imageUrl}\" style=\"margin-right: 0.5rem;\" />`\n : '';\n return strToEl(\n `<div class=\"\n ${classNames.item}\n ${data.highlighted ? classNames.highlightedState : classNames.itemSelectable}\n ${data.placeholder ? classNames.placeholder : ''}\"\n data-item data-id=\"${data.id}\" data-value=\"${data.value}\"\n ${data.active ? 'aria-selected=\"true\"' : ''}\n ${data.disabled ? 'aria-disabled=\"true\"' : ''}>\n ${template}\n ${data.label}\n <button type=\"button\"\n class=\"${classNames.button}\"\n aria-label=\"${removeItemText(data.label)}\"\n data-button>${removeItemText(data.label)}</button>\n </div>`\n );\n },\n choice: function ({ classNames }: { classNames: ClassNames }, data: Item) {\n const template = getOptionTemplate(data);\n const className = `${String(classNames.item)} ${String(classNames.itemChoice)}\n ${String(data.disabled ? classNames.itemDisabled : classNames.itemSelectable)}\n ${data.selected ? 'choices__item--selected' : ''}`;\n return strToEl(\n `<div class=\"${className}\"\n data-select-text=\"${itemSelectText}\"\n data-choice data-id=\"${String(data.id)}\" data-value=\"${String(data.value)}\"\n ${data.disabled ? 'data-choice-disabled aria-disabled=\"true\"' : 'data-choice-selectable'}\n ${data.groupId && data.groupId > 0 ? 'role=\"treeitem\"' : 'role=\"option\"'}>\n ${template}\n </div>`\n );\n }\n };\n }\n };\n\n const settings: Partial<Options> = this.multiple\n ? { ...config, ...configMultiple }\n : { ...config, ...configSingle };\n this.choice = new Choices(this.selectElement, settings);\n this.choice.setChoices(this.choices);\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 onChange() {\n this.value = this.choice?.getValue();\n this.catChange.emit(this.choice?.getValue());\n if (this.multiple) {\n this.updateRemoveItemButtonVisibility();\n }\n }\n\n private onSearch(event: Event) {\n const customEvent = event as CustomEvent<{ value: string }>;\n this.catSearch.emit(customEvent.detail.value);\n }\n\n private onScrolledBottom() {\n const scrolledBottom: boolean =\n this.choiceDropdown?.scrollHeight ===\n (this.choiceDropdown?.scrollTop || 0) + (this.choiceDropdown?.clientHeight || 0);\n\n if (scrolledBottom) {\n this.catScrolledBottom.emit();\n }\n }\n\n private onChoice(event: Event) {\n const customEvent = event as CustomEvent<{ choice: Choice }>;\n const items = Array.from(this.choice?.getValue() as Item[]);\n const item = items.find(value => value.choiceId === customEvent.detail.choice.id);\n if (item) {\n this.choice?._removeItem(item);\n }\n }\n\n private showDropdownHandler() {\n if (!this.disabled) {\n this.choice?.showDropdown();\n }\n }\n\n private createRemoveItemButton() {\n this.removeElement = document.createElement('cat-button') as HTMLCatButtonElement;\n this.removeElement.icon = 'cross-circle-outlined';\n this.removeElement.iconOnly = true;\n this.removeElement.a11yLabel = this.i18n.t('select.removeItem');\n this.updateRemoveItemButtonVisibility();\n this.removeElement.addEventListener('click', this.onRemoveItemButtonClick.bind(this));\n this.choiceInner?.appendChild(this.removeElement);\n }\n\n private updateRemoveItemButtonVisibility() {\n const items = Array.from(this.choice?.getValue() as Item[]);\n if (items.length) {\n this.removeElement?.removeAttribute('hidden');\n } else if (!items.length) {\n this.removeElement?.setAttribute('hidden', 'true');\n }\n }\n\n private onRemoveItemButtonClick(event: Event) {\n event.stopPropagation();\n this.choice?.removeActiveItems(-1);\n }\n}\n"]}
1
+ {"version":3,"file":"cat-select.js","sourceRoot":"","sources":["../../../src/components/cat-select/cat-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,E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B,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,QAAQ,EAAE,CAAC;EAClB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch, Listen } from '@stencil/core';\nimport Choices, { Choice, ClassNames, Item, Options } from 'choices.js';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\nimport { CatI18nRegistry } from '../cat-i18n/cat-i18n-registry';\n\nlet nextUniqueId = 0;\n\nconst getOptionTemplate = (data: Item): string => {\n if (data.customProperties?.imageUrl) {\n return `\n <div class=\"d-flex align-items-center\">\n <img class=\"choices-option-icon\" src=\"${data.customProperties.imageUrl}\" style=\"margin-right: 0.5rem\" />\n ${data.label}\n </div>\n `;\n }\n return `<cat-checkbox label=\"${data.label}\" checked=\"${data.selected}\"></cat-checkbox>`;\n};\n\n/**\n * A single option in the select.\n */\nexport type CatSelectItem = Pick<Choice, 'label' | 'value' | 'customProperties'>;\n\n/**\n * Select lets user choose one option from an options menu. Consider using\n * select when you have 6 or more options. Select component supports any content\n * type.\n *\n * @slot hint - Optional hint element to be displayed with the select.\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 label - The label content.\n */\n@Component({\n tag: 'cat-select',\n styleUrl: 'cat-select.scss',\n shadow: true\n})\nexport class CatSelect {\n private readonly i18n = CatI18nRegistry.getInstance();\n private readonly id = `cat-select-${nextUniqueId++}`;\n private resetItemsOnNextValueChange = true;\n\n private choice?: Choices;\n private choicesElement?: HTMLElement;\n private choiceInner?: Element;\n private choiceDropdown?: Element;\n private selectElement?: HTMLSelectElement;\n private removeElement?: HTMLCatButtonElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * The label for the select.\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 * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The available options for the input.\n */\n @Prop() items: CatSelectItem[] = [];\n\n /**\n * The value of the select.\n */\n @Prop({ mutable: true }) value?: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\n /**\n * Disable the select.\n */\n @Prop() disabled = false;\n\n /**\n * Enable multiple selection.\n */\n @Prop() multiple = false;\n\n /**\n * The placeholder for the select.\n */\n @Prop() placeholder = '';\n\n /**\n * Whether the dropdown should appear above `(top)` or below `(bottom)` the\n * input. By default, if there is not enough space within the window the\n * dropdown will appear above the input, otherwise below it.\n */\n @Prop() position: 'auto' | 'top' | 'bottom' = 'auto';\n\n /**\n * Enable search for the select.\n */\n @Prop() search = false;\n\n /**\n * Optional hint text(s) to be displayed with the select.\n */\n @Prop() hint?: string | string[];\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the search is triggered.\n */\n @Event() catSearch!: EventEmitter;\n\n /**\n * Emitted when scrolled to the bottom.\n */\n @Event() catScrolledBottom!: EventEmitter;\n\n /**\n * Emitted when the select loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n @Watch('items')\n setChoicesHandler(items: CatSelectItem[]) {\n const isSelected = (item: CatSelectItem) => this.value?.includes(item.value);\n const choices = items.map(item => ({ ...item, selected: isSelected(item) }));\n this.choice?.setChoices(choices, 'value', 'label', true);\n\n const vItems = this.choice?.getValue() || [];\n const vItemsArray = (Array.isArray(vItems) ? vItems : [vItems]) as Item[];\n const value = this.value || [];\n const vItemValues = [...value];\n\n // remove duplicate items\n this.choice?.unhighlightAll();\n vItemsArray.forEach(vItem => {\n const index = vItemValues.indexOf(vItem.value);\n if (index > -1) {\n vItemValues.splice(index, 1);\n } else {\n vItem.choiceId = -1; // disconnect item from choice\n this.choice?.highlightItem(vItem, false);\n }\n });\n this.choice?.removeHighlightedItems(false);\n }\n\n @Watch('value')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValueHandler(value?: any) {\n if (this.resetItemsOnNextValueChange) {\n this.choice?.removeActiveItems(-1);\n }\n this.resetItemsOnNextValueChange = true;\n this.choice?.setChoiceByValue(value);\n this.multiple && this.updateRemoveItemButtonVisibility();\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on select', this);\n }\n }\n\n componentDidLoad(): void {\n this.init();\n const attachedInternals: ElementInternals | undefined = this.hostElement.attachInternals?.();\n if (attachedInternals) {\n const root = attachedInternals.shadowRoot;\n this.choicesElement = root?.querySelector('.choices') || undefined;\n this.choiceInner = root?.querySelector('.choices__inner') || undefined;\n this.choiceDropdown = root?.querySelector('.choices__list--dropdown')?.firstElementChild || undefined;\n }\n this.choicesElement?.addEventListener('click', this.resetFocus.bind(this));\n this.choiceInner?.addEventListener('click', this.showDropdownHandler.bind(this));\n this.selectElement?.addEventListener('hideDropdown', this.showMultipleFocus.bind(this));\n this.selectElement?.addEventListener('showDropdown', this.showMultipleFocus.bind(this));\n this.selectElement?.addEventListener('removeItem', this.resetFocus.bind(this));\n this.selectElement?.addEventListener('change', this.onChange.bind(this));\n this.selectElement?.addEventListener('search', this.onSearch.bind(this));\n this.choiceDropdown?.addEventListener('scroll', this.onScrolledBottom.bind(this));\n if (this.multiple) {\n this.selectElement?.addEventListener('choice', this.onChoice.bind(this));\n this.createRemoveItemButton();\n }\n }\n\n disconnectedCallback(): void {\n this.choice?.destroy();\n this.choice = undefined;\n this.choicesElement?.removeEventListener('click', this.resetFocus.bind(this));\n this.choiceInner?.removeEventListener('click', this.showDropdownHandler.bind(this));\n this.selectElement?.removeEventListener('hideDropdown', this.showMultipleFocus.bind(this));\n this.selectElement?.removeEventListener('showDropdown', this.showMultipleFocus.bind(this));\n this.selectElement?.removeEventListener('removeItem', this.resetFocus.bind(this));\n this.selectElement?.removeEventListener('change', this.onChange.bind(this));\n this.selectElement?.removeEventListener('search', this.onSearch.bind(this));\n this.choiceDropdown?.removeEventListener('scroll', this.onScrolledBottom.bind(this));\n if (this.multiple) {\n this.removeElement?.removeEventListener('choice', this.onChoice.bind(this));\n }\n }\n\n @Listen('blur', { capture: true })\n onBlur(event: FocusEvent): void {\n this.catBlur.emit(event);\n }\n\n render() {\n return (\n <Host>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n {!this.required && (\n <span class=\"input-optional\" aria-hidden=\"true\">\n ({this.i18n.t('input.optional')})\n </span>\n )}\n </span>\n </label>\n )}\n <select\n id={this.id}\n ref={el => (this.selectElement = el)}\n multiple={this.multiple}\n disabled={this.disabled}\n ></select>\n {this.hintSection}\n </Host>\n );\n }\n\n private init() {\n const component = this; // eslint-disable-line @typescript-eslint/no-this-alias\n const removeItemText = (value: string) => this.i18n.t('select.removeItem', { value });\n const config = {\n allowHTML: true,\n removeItemButton: true,\n duplicateItemsAllowed: false,\n delimiter: '',\n paste: false,\n searchEnabled: this.search,\n searchChoices: false,\n position: this.position,\n resetScrollPosition: false,\n placeholder: !!this.placeholder,\n placeholderValue: this.placeholder || '',\n searchPlaceholderValue: this.i18n.t('select.searchPlaceholder'),\n renderSelectedChoices: 'always' as 'auto' | 'always',\n loadingText: this.i18n.t('select.loading'),\n noResultsText: this.i18n.t('select.noResults'),\n noChoicesText: this.i18n.t('select.noChoices'),\n itemSelectText: this.i18n.t('select.selectItem'),\n addItemText: (value: string) => this.i18n.t('select.addItem', { value }),\n maxItemText: (maxItemCount: number) => this.i18n.t('select.maxItem', { maxItemCount }),\n uniqueItemText: this.i18n.t('select.uniqueItem'),\n customAddItemText: this.i18n.t('select.customAddItem'),\n callbackOnInit: function () {\n const choice = this as unknown as Choices;\n choice.setChoices(component.items, 'value', 'label', true);\n choice.setChoiceByValue(component.value);\n }\n };\n\n const configSingle = {\n callbackOnCreateTemplates: (strToEl: (str: string) => HTMLElement) => {\n return {\n item: ({ classNames }: { classNames: ClassNames }, data: Item) => {\n const template = data.customProperties?.imageUrl\n ? `<img class=\"choices-option-icon\" src=\"${data.customProperties.imageUrl}\" style=\"margin-right: 0.5rem\" />`\n : '';\n return strToEl(\n `\n <div class=\"${classNames.item} ${\n data.highlighted ? classNames.highlightedState : classNames.itemSelectable\n } ${data.placeholder ? classNames.placeholder : ''}\" data-item data-id=\"${data.id}\" data-value=\"${\n data.value\n }\" ${data.active ? 'aria-selected=\"true\"' : ''} ${data.disabled ? 'aria-disabled=\"true\"' : ''}>\n <span>${template}</span> ${data.label}\n <button type=\"button\"\n class=\"${classNames.button}\"\n aria-label=\"${removeItemText(data.label)}\"\n data-button>${removeItemText(data.label)}</button>\n </div>\n `\n );\n }\n };\n }\n };\n\n const configMultiple = {\n callbackOnCreateTemplates: (strToEl: (str: string) => HTMLElement) => {\n const itemSelectText = config.itemSelectText;\n return {\n item: ({ classNames }: { classNames: ClassNames }, data: Item) => {\n const template = data.customProperties?.imageUrl\n ? `<img class=\"choices-option-icon\" src=\"${data.customProperties.imageUrl}\" style=\"margin-right: 0.5rem;\" />`\n : '';\n return strToEl(\n `<div class=\"\n ${classNames.item}\n ${data.highlighted ? classNames.highlightedState : classNames.itemSelectable}\n ${data.placeholder ? classNames.placeholder : ''}\"\n data-item data-id=\"${data.id}\" data-value=\"${data.value}\"\n ${data.active ? 'aria-selected=\"true\"' : ''}\n ${data.disabled ? 'aria-disabled=\"true\"' : ''}>\n ${template}\n ${data.label}\n <button type=\"button\"\n class=\"${classNames.button}\"\n aria-label=\"${removeItemText(data.label)}\"\n data-button>${removeItemText(data.label)}</button>\n </div>`\n );\n },\n choice: function ({ classNames }: { classNames: ClassNames }, data: Item) {\n const template = getOptionTemplate(data);\n const className = `${String(classNames.item)} ${String(classNames.itemChoice)}\n ${String(data.disabled ? classNames.itemDisabled : classNames.itemSelectable)}\n ${data.selected ? 'choices__item--selected' : ''}`;\n return strToEl(\n `<div class=\"${className}\"\n data-select-text=\"${itemSelectText}\"\n data-choice data-id=\"${String(data.id)}\" data-value=\"${String(data.value)}\"\n ${data.disabled ? 'data-choice-disabled aria-disabled=\"true\"' : 'data-choice-selectable'}\n ${data.groupId && data.groupId > 0 ? 'role=\"treeitem\"' : 'role=\"option\"'}>\n ${template}\n </div>`\n );\n }\n };\n }\n };\n\n const settings: Partial<Options> = this.multiple\n ? { ...config, ...configMultiple }\n : { ...config, ...configSingle };\n this.choice = new Choices(this.selectElement, settings);\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 onChange() {\n this.resetItemsOnNextValueChange = false;\n this.value = this.choice?.getValue(true);\n this.catChange.emit(this.value);\n }\n\n private showMultipleFocus() {\n if (this.multiple && this.isFocused() && !this.choicesElement?.classList.contains('is-focused')) {\n this.choicesElement?.classList.add('is-focused');\n }\n }\n\n private resetFocus() {\n if (!this.isFocused()) {\n if (!this.choicesElement?.hasAttribute('tabindex')) {\n this.choicesElement?.setAttribute('tabindex', '0');\n }\n this.choicesElement?.focus();\n }\n }\n\n private isFocused() {\n return document.activeElement === this.hostElement;\n }\n\n private onChoice(event: Event) {\n const customEvent = event as CustomEvent<{ choice: Choice }>;\n const choice = customEvent.detail.choice;\n if (choice.selected) {\n this.choice?.removeActiveItemsByValue(choice.value);\n this.onChange();\n }\n }\n\n private onSearch(event: Event) {\n const customEvent = event as CustomEvent<{ value: string }>;\n this.catSearch.emit(customEvent.detail.value);\n }\n\n private onScrolledBottom() {\n const scrolledBottom =\n this.choiceDropdown?.scrollHeight ===\n (this.choiceDropdown?.scrollTop || 0) + (this.choiceDropdown?.clientHeight || 0);\n if (scrolledBottom) {\n this.catScrolledBottom.emit();\n }\n }\n\n private showDropdownHandler() {\n !this.disabled && this.choice?.showDropdown();\n }\n\n private createRemoveItemButton() {\n this.removeElement = document.createElement('cat-button') as HTMLCatButtonElement;\n this.removeElement.icon = 'cross-circle-outlined';\n this.removeElement.iconOnly = true;\n this.removeElement.a11yLabel = this.i18n.t('select.removeItem');\n this.updateRemoveItemButtonVisibility();\n this.removeElement.addEventListener('click', this.onRemoveItemButtonClick.bind(this));\n this.choiceInner?.appendChild(this.removeElement);\n }\n\n private updateRemoveItemButtonVisibility() {\n if (this.value?.length) {\n this.removeElement?.removeAttribute('hidden');\n } else {\n this.removeElement?.setAttribute('hidden', 'true');\n }\n }\n\n private onRemoveItemButtonClick(event: Event) {\n event.stopPropagation();\n this.choice?.removeActiveItems(-1);\n this.onChange();\n }\n}\n"]}
@@ -12,6 +12,7 @@
12
12
  .hint-section ::slotted([slot=hint]) {
13
13
  font-size: 0.875rem;
14
14
  line-height: 1rem;
15
+ font-weight: var(--cat-font-weight-body, 400);
15
16
  margin: 0;
16
17
  }
17
18
 
@@ -21,6 +22,7 @@
21
22
  gap: 0.5rem;
22
23
  font-size: 0.9375rem;
23
24
  line-height: 1.25rem;
25
+ font-weight: var(--cat-font-weight-body, 400);
24
26
  margin-bottom: 1rem;
25
27
  }
26
28
 
@@ -47,6 +49,7 @@ label.hidden {
47
49
  margin-left: 0.25rem;
48
50
  font-size: 0.75rem;
49
51
  line-height: 1rem;
52
+ font-weight: var(--cat-font-weight-body, 400);
50
53
  color: rgb(var(--cat-font-color-muted, 105, 118, 135));
51
54
  }
52
55
 
@@ -12,6 +12,7 @@
12
12
  .hint-section ::slotted([slot=hint]) {
13
13
  font-size: 0.875rem;
14
14
  line-height: 1rem;
15
+ font-weight: var(--cat-font-weight-body, 400);
15
16
  margin: 0;
16
17
  }
17
18
 
@@ -32,6 +33,7 @@ label {
32
33
  gap: 0.5rem;
33
34
  font-size: 0.9375rem;
34
35
  line-height: 1.25rem;
36
+ font-weight: var(--cat-font-weight-body, 400);
35
37
  /* stylelint-disable property-no-vendor-prefix */
36
38
  -webkit-user-select: none;
37
39
  -ms-user-select: none;
@@ -45,15 +47,12 @@ label {
45
47
  }
46
48
 
47
49
  input {
48
- position: absolute !important;
49
- width: 1px !important;
50
- height: 1px !important;
51
- padding: 0 !important;
52
- margin: -1px !important;
53
- overflow: hidden !important;
54
- clip: rect(0, 0, 0, 0) !important;
55
- white-space: nowrap !important;
56
- border: 0 !important;
50
+ position: absolute;
51
+ margin: 0;
52
+ width: 2rem;
53
+ height: 1.25rem;
54
+ opacity: 0;
55
+ cursor: inherit;
57
56
  }
58
57
 
59
58
  .toggle {
@@ -67,6 +66,7 @@ input {
67
66
  border-radius: 10rem;
68
67
  background-color: #d7dbe0;
69
68
  transition: background-color 0.13s ease;
69
+ pointer-events: none;
70
70
  }
71
71
  :checked + .toggle {
72
72
  background-color: rgb(var(--cat-primary-bg, 32, 127, 138));
@@ -17,14 +17,13 @@
17
17
  line-height: 1rem;
18
18
  font-weight: 500;
19
19
  padding: 0.75rem;
20
- background-color: white;
20
+ background-color: black;
21
21
  border-radius: 0.25rem;
22
- color: black;
22
+ color: white;
23
23
  transition: opacity 0.25s linear, visibility 0.25s linear;
24
24
  visibility: hidden;
25
25
  opacity: 0;
26
26
  box-shadow: rgba(0, 0, 0, 0.08) 0 1px 8px 0;
27
- border: 1px solid #ebecf0;
28
27
  z-index: 200;
29
28
  max-width: 16rem;
30
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nexport { CatIconRegistry } from './components/cat-icon/cat-icon-registry';\nexport { NotificationsService } from './components/cat-notification/cat-notification';\nexport { Choice } from 'choices.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC","sourcesContent":["export { Components, JSX } from './components';\nexport { CatI18nRegistry } from './components/cat-i18n/cat-i18n-registry';\nexport { CatIconRegistry } from './components/cat-icon/cat-icon-registry';\nexport { NotificationsService } from './components/cat-notification/cat-notification';\nexport { CatSelectItem } from './components/cat-select/cat-select';\n"]}
@@ -6,7 +6,6 @@
6
6
  body {
7
7
  @include cat-body('m');
8
8
  font-family: cat-body-font-family();
9
- font-weight: cat-token('font.weight.body');
10
9
  color: cat-token('color.ui.font.body');
11
10
  background-color: cat-token('color.ui.background.canvas');
12
11
  }
@@ -68,7 +68,7 @@ section {
68
68
  padding: 2rem 0;
69
69
 
70
70
  &:not(:last-of-type) {
71
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
71
+ border-bottom: 1px solid rgba(0, 0, 0, 10%);
72
72
  }
73
73
 
74
74
  > h2:not(:first-child),
@@ -43,8 +43,8 @@
43
43
 
44
44
  @include -layout-property('justify-items-start', 'justify-items', 'flex-start');
45
45
  @include -layout-property('justify-items-end', 'justify-items', 'flex-end');
46
- @include -layout-property('justify-items-center', 'justify-items', 'flex-center');
47
- @include -layout-property('justify-items-stretch', 'justify-items', 'flex-stretch');
46
+ @include -layout-property('justify-items-center', 'justify-items', 'center');
47
+ @include -layout-property('justify-items-stretch', 'justify-items', 'stretch');
48
48
 
49
49
  @include -layout-property('content-start', 'align-content', 'flex-start');
50
50
  @include -layout-property('content-end', 'align-content', 'flex-end');
@@ -55,8 +55,8 @@
55
55
 
56
56
  @include -layout-property('items-start', 'align-items', 'flex-start');
57
57
  @include -layout-property('items-end', 'align-items', 'flex-end');
58
- @include -layout-property('items-center', 'align-items', 'flex-center');
59
- @include -layout-property('items-stretch', 'align-items', 'flex-stretch');
58
+ @include -layout-property('items-center', 'align-items', 'center');
59
+ @include -layout-property('items-stretch', 'align-items', 'stretch');
60
60
 
61
61
  // -- Grid
62
62
 
@@ -1,9 +1,5 @@
1
1
  @use '../variables' as *;
2
2
 
3
- @function cat-size($size) {
4
- @return cat-token('size.base.#{$size}');
5
- }
6
-
7
3
  @function cat-border-radius($size) {
8
4
  @if $size == '0' or $size == 0 {
9
5
  @return none;
@@ -14,7 +14,7 @@
14
14
  @return cat-token('size.line.head.#{$size}');
15
15
  }
16
16
 
17
- @mixin cat-head($size, $weight: null) {
17
+ @mixin cat-head($size, $weight: cat-token('font.weight.head')) {
18
18
  font-family: cat-head-font-family();
19
19
  font-size: cat-head-font-size($size);
20
20
  line-height: cat-head-line-height($size);
@@ -36,7 +36,7 @@
36
36
  @return cat-token('size.line.body.#{$size}');
37
37
  }
38
38
 
39
- @mixin cat-body($size, $weight: null) {
39
+ @mixin cat-body($size, $weight: cat-token('font.weight.body')) {
40
40
  // skip font family, as it is set on the body
41
41
  // skip color, as it is set on the body
42
42
  font-size: cat-body-font-size($size);
@@ -58,7 +58,7 @@
58
58
  @return cat-token('size.line.mono.#{$size}');
59
59
  }
60
60
 
61
- @mixin cat-mono($size, $weight: null) {
61
+ @mixin cat-mono($size, $weight: cat-token('font.weight.mono')) {
62
62
  font-family: cat-mono-font-family();
63
63
  font-size: cat-mono-font-size($size);
64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C,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,gBAAc,IAAI,CAAC,KAAK,IAC1G,IAAI,CAAC,OAAO,CACX,EACJ;KACH;SAAM;MACL,QACE,YAAM,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,gBAAc,IAAI,CAAC,KAAK,IACrE,IAAI,CAAC,OAAO,CACR,EACP;KACH;GACF;EAED,IAAY,OAAO;IACjB,OAAO,CAAC,IAAI,CAAC,eAAe;QACxB,CAAC,IAAI,CAAC,IAAI,GAAG,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAa,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1F,EAAE,CAAC;GACR;EAED,IAAY,QAAQ;IAClB,OAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;GACrD;EAED,IAAY,QAAQ;IAClB,OAAO;MACL,MAAM,EAAE,IAAI;MACZ,cAAc,EAAE,IAAI,CAAC,KAAK;MAC1B,CAAC,UAAU,IAAI,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;KAC5C,CAAC;GACH;EAEO,WAAW;;IACjB,QACE,MAAA,IAAI,CAAC,QAAQ,mCACb,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE;OACd,KAAK,CAAC,GAAG,CAAC;OACV,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;OACd,IAAI,CAAC,EAAE,CAAC,EACX;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatAvatar","log"],"sources":["./src/utils/load-img.ts","./src/components/cat-avatar/cat-avatar.scss?tag=cat-avatar&encapsulation=shadow","./src/components/cat-avatar/cat-avatar.tsx"],"sourcesContent":["/**\n * Loads an image and wraps the result in a promise.\n *\n * @param src the image URL\n * @returns a promise\n */\nconst loadImg = (src: string): Promise<Event> => {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.addEventListener('load', resolve);\n image.addEventListener('error', reject);\n image.src = src;\n });\n};\n\nexport default loadImg;\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n /**\n * @prop --cat-avatar-bg: The background color of the avatar.\n * @prop --cat-avatar-fill: The text color of the avatar.\n * @prop --cat-avatar-size: The size of the avatar.\n * @prop --cat-avatar-font-size: The font size of the avatar.\n */\n display: inline-block;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.avatar {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: cat-border-radius('m');\n text-decoration: inherit;\n color: var(--cat-avatar-fill, cat-token('color.ui.font.avatar'));\n background-color: var(--cat-avatar-bg, cat-token('color.ui.background.avatar'));\n background-size: cover;\n background-position: center;\n white-space: nowrap;\n overflow: hidden;\n\n &:focus-visible {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n}\n\n.avatar-round {\n border-radius: 50%;\n}\n\n// ----- size\n\n@mixin size($size, $fontSize) {\n .avatar-#{$size} {\n width: var(--cat-avatar-size, cat-size($size));\n height: var(--cat-avatar-size, cat-size($size));\n line-height: var(--cat-avatar-size, cat-size($size));\n font-size: var(--cat-avatar-font-size, cat-body-font-size($fontSize));\n }\n}\n\n@include size('xs', 'xs');\n@include size('s', 's');\n@include size('m', 'm');\n@include size('l', 'l');\n@include size('xl', 'xl');\n","import { Component, h, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport loadImg from '../../utils/load-img';\n\n/**\n * Avatars are used to represent a person or object.\n */\n@Component({\n tag: 'cat-avatar',\n styleUrl: 'cat-avatar.scss',\n shadow: true\n})\nexport class CatAvatar {\n @State() backgroundImage?: string;\n\n /**\n * The size of the avatar.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * Use round avatar edges.\n */\n @Prop() round = false;\n\n /**\n * The label of the avatar.\n */\n @Prop() label = '';\n\n /**\n * Custom initials for the avatar.\n */\n @Prop() initials?: string;\n\n /**\n * An optional avatar image.\n */\n @Prop() src?: string;\n\n /**\n * An icon to be used instead of the initials.\n */\n @Prop() icon?: string;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n @Watch('src')\n onSrcChanged(value?: string): void {\n if (value) {\n loadImg(value).then(\n () => (this.backgroundImage = `url(${value})`),\n () => (this.backgroundImage = undefined)\n );\n } else {\n this.backgroundImage = undefined;\n }\n }\n\n componentWillLoad(): void {\n this.onSrcChanged(this.src);\n }\n\n componentWillRender(): void {\n if (!this.label) {\n log.warn('[A11y] Missing ARIA label on avatar', this);\n }\n }\n\n render() {\n if (this.url) {\n return (\n <a href={this.url} target={this.urlTarget} style={this.cssStyle} class={this.cssClass} aria-label={this.label}>\n {this.content}\n </a>\n );\n } else {\n return (\n <span style={this.cssStyle} class={this.cssClass} aria-label={this.label}>\n {this.content}\n </span>\n );\n }\n }\n\n private get content() {\n return !this.backgroundImage\n ? [this.icon ? <cat-icon icon={this.icon} size={this.size}></cat-icon> : this.getInitials()]\n : [];\n }\n\n private get cssStyle() {\n return { 'background-image': this.backgroundImage };\n }\n\n private get cssClass() {\n return {\n avatar: true,\n 'avatar-round': this.round,\n [`avatar-${this.size}`]: Boolean(this.size)\n };\n }\n\n private getInitials(): string {\n return (\n this.initials ??\n (this.label ?? '')\n .split(' ')\n .map(n => n[0])\n .join('')\n );\n }\n}\n"],"version":3}
1
+ {"file":"cat-avatar.js","mappings":";;;;AAAA;;;;;;AAMA,MAAM,OAAO,GAAG,CAAC,GAAW;EAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM;IACjC,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;IAC1B,KAAK,CAAC,gBAAgB,C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O,CACR,EACP;KACH;GACF;EAED,IAAY,OAAO;IACjB,OAAO,CAAC,IAAI,CAAC,eAAe;QACxB,CAAC,IAAI,CAAC,IAAI,GAAG,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAa,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1F,EAAE,CAAC;GACR;EAED,IAAY,QAAQ;IAClB,OAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;GACrD;EAED,IAAY,QAAQ;IAClB,OAAO;MACL,MAAM,EAAE,IAAI;MACZ,cAAc,EAAE,IAAI,CAAC,KAAK;MAC1B,CAAC,UAAU,IAAI,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;KAC5C,CAAC;GACH;EAEO,WAAW;;IACjB,QACE,MAAA,IAAI,CAAC,QAAQ,mCACb,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE;OACd,KAAK,CAAC,GAAG,CAAC;OACV,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;OACd,IAAI,CAAC,EAAE,CAAC,EACX;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CatAvatar","log"],"sources":["./src/utils/load-img.ts","./src/components/cat-avatar/cat-avatar.scss?tag=cat-avatar&encapsulation=shadow","./src/components/cat-avatar/cat-avatar.tsx"],"sourcesContent":["/**\n * Loads an image and wraps the result in a promise.\n *\n * @param src the image URL\n * @returns a promise\n */\nconst loadImg = (src: string): Promise<Event> => {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.addEventListener('load', resolve);\n image.addEventListener('error', reject);\n image.src = src;\n });\n};\n\nexport default loadImg;\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n$avatar-sizes: (\n 'xl': 3.5rem,\n 'l': 3rem,\n 'm': 2.5rem,\n 's': 2rem,\n 'xs': 1.5rem\n);\n\n:host {\n /**\n * @prop --cat-avatar-bg: The background color of the avatar.\n * @prop --cat-avatar-fill: The text color of the avatar.\n * @prop --cat-avatar-size: The size of the avatar.\n * @prop --cat-avatar-font-size: The font size of the avatar.\n */\n display: inline-block;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.avatar {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: cat-border-radius('m');\n text-decoration: inherit;\n color: var(--cat-avatar-fill, cat-token('color.ui.font.avatar'));\n background-color: var(--cat-avatar-bg, cat-token('color.ui.background.avatar'));\n background-size: cover;\n background-position: center;\n white-space: nowrap;\n overflow: hidden;\n\n &:focus-visible {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n}\n\n.avatar-round {\n border-radius: 50%;\n}\n\n// ----- size\n\n@mixin size($size, $fontSize) {\n .avatar-#{$size} {\n width: var(--cat-avatar-size, map.get($avatar-sizes, $size));\n height: var(--cat-avatar-size, map.get($avatar-sizes, $size));\n line-height: var(--cat-avatar-size, map.get($avatar-sizes, $size));\n font-size: var(--cat-avatar-font-size, cat-body-font-size($fontSize));\n }\n}\n\n@include size('xs', 'xs');\n@include size('s', 's');\n@include size('m', 'm');\n@include size('l', 'l');\n@include size('xl', 'xl');\n","import { Component, h, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport loadImg from '../../utils/load-img';\n\n/**\n * Avatars are used to represent a person or object.\n */\n@Component({\n tag: 'cat-avatar',\n styleUrl: 'cat-avatar.scss',\n shadow: true\n})\nexport class CatAvatar {\n @State() backgroundImage?: string;\n\n /**\n * The size of the avatar.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * Use round avatar edges.\n */\n @Prop() round = false;\n\n /**\n * The label of the avatar.\n */\n @Prop() label = '';\n\n /**\n * Custom initials for the avatar.\n */\n @Prop() initials?: string;\n\n /**\n * An optional avatar image.\n */\n @Prop() src?: string;\n\n /**\n * An icon to be used instead of the initials.\n */\n @Prop() icon?: string;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n @Watch('src')\n onSrcChanged(value?: string): void {\n if (value) {\n loadImg(value).then(\n () => (this.backgroundImage = `url(${value})`),\n () => (this.backgroundImage = undefined)\n );\n } else {\n this.backgroundImage = undefined;\n }\n }\n\n componentWillLoad(): void {\n this.onSrcChanged(this.src);\n }\n\n componentWillRender(): void {\n if (!this.label) {\n log.warn('[A11y] Missing ARIA label on avatar', this);\n }\n }\n\n render() {\n if (this.url) {\n return (\n <a href={this.url} target={this.urlTarget} style={this.cssStyle} class={this.cssClass} aria-label={this.label}>\n {this.content}\n </a>\n );\n } else {\n return (\n <span style={this.cssStyle} class={this.cssClass} aria-label={this.label}>\n {this.content}\n </span>\n );\n }\n }\n\n private get content() {\n return !this.backgroundImage\n ? [this.icon ? <cat-icon icon={this.icon} size={this.size}></cat-icon> : this.getInitials()]\n : [];\n }\n\n private get cssStyle() {\n return { 'background-image': this.backgroundImage };\n }\n\n private get cssClass() {\n return {\n avatar: true,\n 'avatar-round': this.round,\n [`avatar-${this.size}`]: Boolean(this.size)\n };\n }\n\n private getInitials(): string {\n return (\n this.initials ??\n (this.label ?? '')\n .split(' ')\n .map(n => n[0])\n .join('')\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
 
3
- const catBadgeCss = ":host{display:inline-flex;max-width:100%;vertical-align:baseline}:host([hidden]){display:none}.badge{font:inherit;flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;border-radius:0.125rem;text-decoration:none;width:100%;box-sizing:border-box;line-height:1;white-space:nowrap}.badge slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.badge-round{border-radius:10rem}.badge-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.badge-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}.badge-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--border:var(--cat-primary-text, 32, 127, 138)}.badge-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--border:105, 118, 135}.badge-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--border:0, 132, 88}.badge-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--border:159, 97, 0}.badge-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--border:217, 52, 13}.badge-xs{height:0.75rem;min-width:0.75rem;font-size:0.75rem;padding:0rem 0.25rem}.badge-s{height:1rem;min-width:1rem;font-size:0.75rem;padding:0.25rem 0.5rem}.badge-m{height:1.25rem;min-width:1.25rem;font-size:0.75rem;padding:0.5rem 0.75rem}.badge-l{height:1.5rem;min-width:1.5rem;font-size:0.875rem;padding:0.75rem 1rem}.badge-xl{height:1.75rem;min-width:1.75rem;font-size:0.9375rem;padding:1rem 1.25rem}.badge-pulse.badge-filled{animation:1.5s ease 0s infinite normal none running pulse}.badge-pulse.badge-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)}}";
3
+ const catBadgeCss = ":host{display:inline-flex;max-width:100%;vertical-align:baseline}:host([hidden]){display:none}.badge{font:inherit;flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;border-radius:0.125rem;text-decoration:none;width:100%;box-sizing:border-box;line-height:1;white-space:nowrap}.badge slot{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.badge-round{border-radius:10rem}.badge-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.badge-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--border), 0.2);color:rgb(var(--text))}.badge-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--border:var(--cat-primary-text, 32, 127, 138)}.badge-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--border:105, 118, 135}.badge-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--border:0, 132, 88}.badge-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--border:159, 97, 0}.badge-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--border:217, 52, 13}.badge-xs{height:1rem;min-width:0.75rem;font-size:12px;padding:0 0.25rem}.badge-s{height:1.5rem;min-width:1rem;font-size:12px;padding:0 0.5rem}.badge-m{height:2rem;min-width:1.25rem;font-size:13px;padding:0 0.75rem}.badge-l{height:2.5rem;min-width:1.5rem;font-size:15px;padding:0 1rem}.badge-xl{height:3rem;min-width:1.75rem;font-size:18px;padding:0 1rem}.badge-pulse.badge-filled{animation:1.5s ease 0s infinite normal none running pulse}.badge-pulse.badge-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)}}";
4
4
 
5
5
  const CatBadge$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -1 +1 @@
1
- {"file":"cat-badge.js","mappings":";;AAAA,MAAM,WAAW,GAAG,2rEAA2rE;;MCalsEA,UAAQ;EALrB;;;;;;;IASU,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;GAmBvB;EAjBC,MAAM;IACJ,QACE,YACE,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE;QACL,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,IAAI,CAAC,KAAK;QACzB,aAAa,EAAE,IAAI,CAAC,KAAK;QACzB,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAChD,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAC5C,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;OAC3C,IAED,eAAa,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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\n:host {\n display: inline-flex;\n max-width: 100%;\n vertical-align: baseline;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.badge {\n font: inherit;\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: cat-border-radius('s');\n text-decoration: none;\n width: 100%;\n box-sizing: border-box;\n line-height: 1;\n white-space: nowrap;\n\n slot {\n display: inline-block;\n @include cat-ellipsis;\n }\n}\n\n// ----- round\n\n.badge-round {\n border-radius: 10rem;\n}\n\n// ----- theme\n\n.badge-filled {\n background-color: cat-token-wrap(var(--bg));\n color: cat-token-wrap(var(--fill));\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.badge-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 .badge-#{$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 .badge-#{$size} {\n height: cat-size($size) * 0.5;\n min-width: cat-size($size) * 0.5;\n font-size: cat-body-font-size($fontSize);\n padding: 0.5 * (cat-size($size) - 1.5) (cat-size($size) - 1) * 0.5;\n }\n}\n\n@include size('xs', 'xs');\n@include size('s', 'xs');\n@include size('m', 'xs');\n@include size('l', 's');\n@include size('xl', 'm');\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.badge-pulse {\n &.badge-filled {\n animation: 1.5s ease 0s infinite normal none running pulse;\n }\n\n &.badge-outlined {\n animation: 1.5s ease 0s infinite normal none running pulse-outlined;\n }\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, 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 * @part badge - The badge element.\n */\n@Component({\n tag: 'cat-badge',\n styleUrl: 'cat-badge.scss',\n shadow: true\n})\nexport class CatBadge {\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 render() {\n return (\n <span\n part=\"badge\"\n class={{\n badge: true,\n 'badge-round': this.round,\n 'badge-pulse': this.pulse,\n [`badge-${this.variant}`]: Boolean(this.variant),\n [`badge-${this.color}`]: Boolean(this.color),\n [`badge-${this.size}`]: Boolean(this.size)\n }}\n >\n <slot></slot>\n </span>\n );\n }\n}\n"],"version":3}
1
+ {"file":"cat-badge.js","mappings":";;AAAA,MAAM,WAAW,GAAG,woEAAwoE;;MCa/oEA,UAAQ;EALrB;;;;;;;IASU,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;GAmBvB;EAjBC,MAAM;IACJ,QACE,YACE,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE;QACL,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,IAAI,CAAC,KAAK;QACzB,aAAa,EAAE,IAAI,CAAC,KAAK;QACzB,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QAChD,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;QAC5C,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;OAC3C,IAED,eAAa,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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$badge-sizes: (\n 'xl': 1.75rem,\n 'l': 1.5rem,\n 'm': 1.25rem,\n 's': 1rem,\n 'xs': 0.75rem\n);\n\n:host {\n display: inline-flex;\n max-width: 100%;\n vertical-align: baseline;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.badge {\n font: inherit;\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: cat-border-radius('s');\n text-decoration: none;\n width: 100%;\n box-sizing: border-box;\n line-height: 1;\n white-space: nowrap;\n\n slot {\n display: inline-block;\n @include cat-ellipsis;\n }\n}\n\n// ----- round\n\n.badge-round {\n border-radius: 10rem;\n}\n\n// ----- theme\n\n.badge-filled {\n background-color: cat-token-wrap(var(--bg));\n color: cat-token-wrap(var(--fill));\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.badge-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 .badge-#{$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 .badge-#{$size} {\n height: cat-token('size.badge.height.#{$size}');\n min-width: map.get($badge-sizes, $size);\n font-size: cat-token('size.badge.font.#{$size}');\n padding: 0 cat-token('size.badge.padding.horizontal.#{$size}');\n }\n}\n\n@include size('xs', 'xs');\n@include size('s', 's');\n@include size('m', 'm');\n@include size('l', 'l');\n@include size('xl', 'xl');\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.badge-pulse {\n &.badge-filled {\n animation: 1.5s ease 0s infinite normal none running pulse;\n }\n\n &.badge-outlined {\n animation: 1.5s ease 0s infinite normal none running pulse-outlined;\n }\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, 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 * @part badge - The badge element.\n */\n@Component({\n tag: 'cat-badge',\n styleUrl: 'cat-badge.scss',\n shadow: true\n})\nexport class CatBadge {\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 render() {\n return (\n <span\n part=\"badge\"\n class={{\n badge: true,\n 'badge-round': this.round,\n 'badge-pulse': this.pulse,\n [`badge-${this.variant}`]: Boolean(this.variant),\n [`badge-${this.color}`]: Boolean(this.color),\n [`badge-${this.size}`]: Boolean(this.size)\n }}\n >\n <slot></slot>\n </span>\n );\n }\n}\n"],"version":3}
@@ -118,7 +118,7 @@ function createEmptyStyleRule(query) {
118
118
  }
119
119
  }
120
120
 
121
- const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:0.25rem;text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:0.65;filter:grayscale(100%)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.05)}.cat-button-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--base:var(--cat-primary-text, 32, 127, 138)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 28, 112, 122);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 28, 112, 122)}.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 25, 101, 110);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 25, 101, 110)}.cat-button-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--base:105, 118, 135}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--base:0, 132, 88}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 117, 78;--fill:255, 255, 255;--text:0, 117, 78}.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 105, 70;--fill:255, 255, 255;--text:0, 105, 70}.cat-button-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--base:159, 97, 0}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 214, 148;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 222, 168;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--base:217, 52, 13}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:194, 46, 11;--fill:255, 255, 255;--text:194, 46, 11}.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:174, 42, 10;--fill:255, 255, 255;--text:174, 42, 10}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1.25rem;padding-right:1.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1.25rem;padding-right:1.25rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1.25rem;padding-right:1.25rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1.25rem;padding-right:1.25rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1.25rem;padding-right:1.25rem}.cat-button-active::before{content:\"\";display:block;position:absolute;top:0;left:0;width:0.25rem;height:100%;background:rgb(var(--base))}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0;justify-content:left}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
121
+ const catButtonCss = ":host{display:inline-block;max-width:100%;vertical-align:middle;-webkit-user-select:none;-ms-user-select:none;user-select:none;}:host([hidden]){display:none}.cat-button{position:relative;font:inherit;display:flex;align-items:center;justify-content:center;border:none;border-radius:0.25rem;text-decoration:none;width:100%;box-sizing:border-box;cursor:pointer;transition:color 0.13s linear, border-color 0.13s linear, background-color 0.13s linear, box-shadow 0.13s linear}.cat-button:focus-visible{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));outline-offset:1px}.cat-button-ellipsed .cat-button-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cat-button-disabled{cursor:not-allowed;opacity:0.65;filter:grayscale(100%)}.cat-button-round{border-radius:10rem}.cat-button-loading{cursor:default}.cat-button-loading cat-spinner{position:absolute}.cat-button-loading>*:not(cat-spinner){visibility:hidden}.cat-button-filled{background-color:rgb(var(--bg));color:rgb(var(--fill));font-weight:600;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:greyscale}.cat-button-outlined{background-color:white;box-shadow:inset 0 0 0 1px rgba(var(--base), 0.2);color:rgb(var(--text))}.cat-button-outlined:hover:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.05)}.cat-button-outlined:active:not(.cat-button-disabled):not(.cat-button-loading){background-color:rgba(var(--base), 0.1)}.cat-button-text{background-color:transparent;color:rgb(var(--text));text-decoration:none}.cat-button-text:hover:not(.cat-button-disabled):not(.cat-button-loading){text-decoration:none;background-color:rgba(var(--base), 0.05)}.cat-button-primary{--bg:var(--cat-primary-bg, 32, 127, 138);--fill:var(--cat-primary-fill, 255, 255, 255);--text:var(--cat-primary-text, 32, 127, 138);--base:var(--cat-primary-text, 32, 127, 138)}.cat-button-primary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-hover, 28, 112, 122);--fill:var(--cat-primary-fill-hover, 255, 255, 255);--text:var(--cat-primary-text-hover, 28, 112, 122)}.cat-button-primary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:var(--cat-primary-bg-active, 25, 101, 110);--fill:var(--cat-primary-fill-active, 255, 255, 255);--text:var(--cat-primary-text-active, 25, 101, 110)}.cat-button-secondary{--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0;--base:105, 118, 135}.cat-button-secondary:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-secondary:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:105, 118, 135;--fill:255, 255, 255;--text:0, 0, 0}.cat-button-success{--bg:0, 132, 88;--fill:255, 255, 255;--text:0, 132, 88;--base:0, 132, 88}.cat-button-success:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 117, 78;--fill:255, 255, 255;--text:0, 117, 78}.cat-button-success:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:0, 105, 70;--fill:255, 255, 255;--text:0, 105, 70}.cat-button-warning{--bg:255, 206, 128;--fill:0, 0, 0;--text:159, 97, 0;--base:159, 97, 0}.cat-button-warning:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 214, 148;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-warning:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:255, 222, 168;--fill:0, 0, 0;--text:159, 97, 0}.cat-button-danger{--bg:217, 52, 13;--fill:255, 255, 255;--text:217, 52, 13;--base:217, 52, 13}.cat-button-danger:hover:not(.cat-button-disabled):not(.cat-button-loading){--bg:194, 46, 11;--fill:255, 255, 255;--text:194, 46, 11}.cat-button-danger:active:not(.cat-button-disabled):not(.cat-button-loading){--bg:174, 42, 10;--fill:255, 255, 255;--text:174, 42, 10}:host(.cat-button-pull:not([size])){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h:not([size])){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v:not([size])){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t:not([size])){margin-top:-0.625rem}:host(.cat-button-pull-l:not([size])){margin-left:-0.75rem}:host(.cat-button-pull-b:not([size])){margin-bottom:-0.625rem}:host(.cat-button-pull-r:not([size])){margin-right:-0.75rem}.cat-button-xs{min-width:1.5rem;padding:0.25rem 0.25rem;font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400)}.cat-button-xs .cat-button-prefix{margin-right:0.25rem}.cat-button-xs .cat-button-suffix{margin-left:0.25rem}.cat-button-xs.cat-button-icon{width:1.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xs{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xs]){margin:-0.25rem -0.25rem}:host(.cat-button-pull-h[size=xs]){margin-left:-0.25rem;margin-right:-0.25rem}:host(.cat-button-pull-v[size=xs]){margin-top:-0.25rem;margin-bottom:-0.25rem}:host(.cat-button-pull-t[size=xs]){margin-top:-0.25rem}:host(.cat-button-pull-l[size=xs]){margin-left:-0.25rem}:host(.cat-button-pull-b[size=xs]){margin-bottom:-0.25rem}:host(.cat-button-pull-r[size=xs]){margin-right:-0.25rem}.cat-button-s{min-width:2rem;padding:0.375rem 0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400)}.cat-button-s .cat-button-prefix{margin-right:0.25rem}.cat-button-s .cat-button-suffix{margin-left:0.25rem}.cat-button-s cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-s.cat-button-icon{width:2rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-s{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=s]){margin:-0.375rem -0.5rem}:host(.cat-button-pull-h[size=s]){margin-left:-0.5rem;margin-right:-0.5rem}:host(.cat-button-pull-v[size=s]){margin-top:-0.375rem;margin-bottom:-0.375rem}:host(.cat-button-pull-t[size=s]){margin-top:-0.375rem}:host(.cat-button-pull-l[size=s]){margin-left:-0.5rem}:host(.cat-button-pull-b[size=s]){margin-bottom:-0.375rem}:host(.cat-button-pull-r[size=s]){margin-right:-0.5rem}.cat-button-m{min-width:2.5rem;padding:0.625rem 0.75rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400)}.cat-button-m .cat-button-prefix{margin-right:0.25rem}.cat-button-m .cat-button-suffix{margin-left:0.25rem}.cat-button-m cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-m.cat-button-icon{width:2.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-m{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=m]){margin:-0.625rem -0.75rem}:host(.cat-button-pull-h[size=m]){margin-left:-0.75rem;margin-right:-0.75rem}:host(.cat-button-pull-v[size=m]){margin-top:-0.625rem;margin-bottom:-0.625rem}:host(.cat-button-pull-t[size=m]){margin-top:-0.625rem}:host(.cat-button-pull-l[size=m]){margin-left:-0.75rem}:host(.cat-button-pull-b[size=m]){margin-bottom:-0.625rem}:host(.cat-button-pull-r[size=m]){margin-right:-0.75rem}.cat-button-l{min-width:3rem;padding:0.875rem 1rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400)}.cat-button-l .cat-button-prefix{margin-right:0.25rem}.cat-button-l .cat-button-suffix{margin-left:0.25rem}.cat-button-l cat-icon{margin-top:-0.125rem;margin-bottom:-0.125rem}.cat-button-l.cat-button-icon{width:3rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-l{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=l]){margin:-0.875rem -1rem}:host(.cat-button-pull-h[size=l]){margin-left:-1rem;margin-right:-1rem}:host(.cat-button-pull-v[size=l]){margin-top:-0.875rem;margin-bottom:-0.875rem}:host(.cat-button-pull-t[size=l]){margin-top:-0.875rem}:host(.cat-button-pull-l[size=l]){margin-left:-1rem}:host(.cat-button-pull-b[size=l]){margin-bottom:-0.875rem}:host(.cat-button-pull-r[size=l]){margin-right:-1rem}.cat-button-xl{min-width:3.5rem;padding:1rem 1.25rem;font-size:1.125rem;line-height:1.5rem;font-weight:var(--cat-font-weight-body, 400)}.cat-button-xl .cat-button-prefix{margin-right:0.25rem}.cat-button-xl .cat-button-suffix{margin-left:0.25rem}.cat-button-xl.cat-button-icon{width:3.5rem;padding-left:0;padding-right:0}:host-context(nav) .cat-button-xl{padding-left:1.25rem;padding-right:1.25rem}:host(.cat-button-pull[size=xl]){margin:-1rem -1.25rem}:host(.cat-button-pull-h[size=xl]){margin-left:-1.25rem;margin-right:-1.25rem}:host(.cat-button-pull-v[size=xl]){margin-top:-1rem;margin-bottom:-1rem}:host(.cat-button-pull-t[size=xl]){margin-top:-1rem}:host(.cat-button-pull-l[size=xl]){margin-left:-1.25rem}:host(.cat-button-pull-b[size=xl]){margin-bottom:-1rem}:host(.cat-button-pull-r[size=xl]){margin-right:-1.25rem}.cat-button-active::before{content:\"\";display:block;position:absolute;top:0;left:0;width:0.25rem;height:100%;background:rgb(var(--base))}:host-context(nav){width:100%}:host-context(nav) .cat-button{box-shadow:none;border-radius:0;justify-content:left}:host-context(nav) .cat-button:focus-visible{outline-offset:-2px}:host(.cat-text-left) .cat-button{justify-content:left}:host(.cat-text-right) .cat-button{justify-content:right}";
122
122
 
123
123
  const CatButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
124
124
  constructor() {
@@ -1 +1 @@
1
- {"file":"cat-button2.js","mappings":";;;;;AAAA,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAInD,MAAM,WAAW,GAA2C;EACjE,EAAE,EAAE,uBAAuB;EAC3B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,wBAAwB;EAC3B,EAAE,EAAE,wBAAwB;CAC7B,CAAC;SAEc,YAAY,CAAC,KAAc;EACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAmB,CAAC,CAAC;AACjF;;ACdA;AAEA;AACA;AACA,IAAI,kBAA2B,CAAC;AAEhC;AACA;AACA;AACA;AACA;AACA,IAAI;;EAEF,kBAAkB,GAAG,OAAO,IAAI,KAAK,WAAW,IAAK,IAAY,CAAC,eAAe,CAAC;CACnF;AAAC,WAAM;EACN,kBAAkB,GAAG,KAAK,CAAC;CAC5B;MAEY,QAAQ;EAArB;;IAEE,SAAI,GAAY,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;;IAGpD,YAAO,GAAY,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;;;IAI/D,UAAK;;IAEH,CAAC,EAAG,MAAc,CAAC,MAAM,IAAI,kBAAkB,CAAC,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IA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KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["log"],"sources":["./src/utils/breakpoints.ts","./src/utils/platform.ts","./src/utils/media-matcher.ts","./src/components/cat-button/cat-button.scss?tag=cat-button&encapsulation=shadow","./src/components/cat-button/cat-button.tsx"],"sourcesContent":["const _breakpoints = ['xs', 's', 'm', 'l', 'xl'] as const;\n\nexport type Breakpoint = typeof _breakpoints[number];\n\nexport const Breakpoints: { [breakpoint in Breakpoint]: string } = {\n xs: '(max-width: 539.98px)',\n s: '(max-width: 767.98px)',\n m: '(max-width: 991.98px)',\n l: '(max-width: 1199.98px)',\n xl: '(max-width: 1399.98px)'\n};\n\nexport function isBreakpoint(value: unknown): value is Breakpoint {\n return typeof value === 'string' && _breakpoints.includes(value as Breakpoint);\n}\n","// https://github.com/angular/components/blob/master/src/cdk/platform/platform.ts\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n hasV8BreakIterator = typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator;\n} catch {\n hasV8BreakIterator = false;\n}\n\nexport class Platform {\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n !!((window as any).chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = /safari/i.test(navigator.userAgent) && this.WEBKIT;\n}\n","import log from 'loglevel';\nimport { Platform } from './platform';\n\n// https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\nexport class MediaMatcher {\n private _platform;\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor() {\n this._platform = new Platform();\n this._matchMedia = window.matchMedia.bind(window);\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT || this._platform.BLINK) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * Creates an empty stylesheet that is used to work around browser inconsistencies related to\n * `matchMedia`. At the time of writing, it handles the following cases:\n * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`\n * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.\n * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules\n * inside the `@media` match existing elements on the page. We work around it by having one rule\n * targeting the `body`. See https://github.com/angular/components/issues/23546.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head.appendChild(mediaQueryStyleNode);\n }\n if (mediaQueryStyleNode.sheet) {\n mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n log.error(e);\n }\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: inline-block;\n max-width: 100%;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.cat-button {\n position: relative;\n font: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: cat-border-radius('m');\n text-decoration: none;\n width: 100%;\n box-sizing: border-box;\n cursor: pointer;\n transition: color cat-token('time.transition.s') linear, border-color cat-token('time.transition.s') linear,\n background-color cat-token('time.transition.s') linear, box-shadow cat-token('time.transition.s') linear;\n\n &:focus-visible {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n}\n\n// ----- content\n\n.cat-button-content {\n // flex: 1 1 auto;\n // text-align: center;\n\n .cat-button-ellipsed & {\n @include cat-ellipsis;\n }\n}\n\n// ----- disabled\n\n.cat-button-disabled {\n @include cat-disabled;\n}\n\n// ----- round\n\n.cat-button-round {\n border-radius: 10rem;\n}\n\n// ----- loading\n\n.cat-button-loading {\n cursor: default;\n\n cat-spinner {\n position: absolute;\n }\n\n > *:not(cat-spinner) {\n visibility: hidden;\n }\n}\n\n// ----- theme\n\n.cat-button-filled {\n background-color: cat-token-wrap(var(--bg));\n color: cat-token-wrap(var(--fill));\n font-weight: 600;\n @include cat-font-smooth;\n}\n\n.cat-button-outlined {\n background-color: cat-token('color.ui.background.body');\n box-shadow: inset 0 0 0 1px cat-token-wrap(var(--base), $alpha: 0.2);\n color: cat-token-wrap(var(--text));\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n background-color: cat-token-wrap(var(--base), $alpha: 0.05);\n }\n\n &:active:not(.cat-button-disabled):not(.cat-button-loading) {\n background-color: cat-token-wrap(var(--base), $alpha: 0.1);\n }\n}\n\n.cat-button-text {\n background-color: transparent;\n color: cat-token-wrap(var(--text));\n text-decoration: $cat-link-text-decoration;\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n text-decoration: $cat-button-text-decoration-hover;\n background-color: rgba(var(--base), 0.05);\n }\n}\n\n@mixin theme($theme) {\n .cat-button-#{$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 --base: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n } @else {\n --base: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n }\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n --bg: #{cat-token('color.theme.#{$theme}.bgHover', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fillHover', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.textHover', $wrap: false)};\n }\n\n &:active:not(.cat-button-disabled):not(.cat-button-loading) {\n --bg: #{cat-token('color.theme.#{$theme}.bgActive', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fillActive', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.textActive', $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, $padding) {\n $-line-height: cat-body-line-height($fontSize);\n $-total-height: cat-size($size);\n\n .cat-button-#{$size} {\n min-width: cat-size($size);\n padding: ($-total-height - $-line-height) * 0.5 $padding;\n @include cat-body($fontSize);\n\n .cat-button-prefix {\n margin-right: 0.25rem;\n }\n\n .cat-button-suffix {\n margin-left: 0.25rem;\n }\n\n // normalize icon size for line height\n @if $fontSize == 'm' {\n cat-icon {\n margin-top: -0.125rem;\n margin-bottom: -0.125rem;\n }\n }\n\n &.cat-button-icon {\n width: $-total-height;\n padding-left: 0;\n padding-right: 0;\n }\n\n :host-context(nav) & {\n padding-left: $cat-nav-padding-horizontal;\n padding-right: $cat-nav-padding-horizontal;\n }\n }\n}\n\n@include size('xs', 's', 0.25rem);\n@include size('s', 'm', 0.5rem);\n@include size('m', 'm', 0.75rem);\n@include size('l', 'm', 1rem);\n@include size('xl', 'l', 1.25rem);\n\n// -- active state\n\n.cat-button-active::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 0.25rem;\n height: 100%;\n background: cat-token-wrap(var(--base));\n}\n\n// ----- context\n\n:host-context(nav) {\n width: 100%;\n\n .cat-button {\n box-shadow: none;\n border-radius: 0;\n justify-content: left;\n\n &:focus-visible {\n outline-offset: -2px;\n }\n }\n}\n\n:host(.cat-text-left) .cat-button {\n justify-content: left;\n}\n\n:host(.cat-text-right) .cat-button {\n justify-content: right;\n}\n","import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: true\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'secondary';\n\n /**\n * Show an active status indicator on the left side of the button.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n /**\n * Sets focus on the button. Use this method instead of `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n render() {\n if (this.url) {\n return (\n <a\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n );\n } else {\n return (\n <button\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return Boolean(this.icon) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return Boolean(this.icon) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return Boolean(this.icon) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? (\n <cat-icon icon={this.icon} size={this.iconSize} class=\"cat-button-prefix\" part=\"prefix\"></cat-icon>\n ) : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\">\n <slot></slot>\n </span>\n ),\n this.hasSuffixIcon ? (\n <cat-icon icon={this.icon} size={this.iconSize} class=\"cat-button-suffix\" part=\"suffix\"></cat-icon>\n ) : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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-button2.js","mappings":";;;;;AAAA,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAU,CAAC;AAInD,MAAM,WAAW,GAA2C;EACjE,EAAE,EAAE,uBAAuB;EAC3B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,uBAAuB;EAC1B,CAAC,EAAE,wBAAwB;EAC3B,EAAE,EAAE,wBAAwB;CAC7B,CAAC;SAEc,YAAY,CAAC,KAAc;EACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,YAAY,CAA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GAAa,KAE3D,YAAM,KAAK,EAAC,oBAAoB,EAAC,IAAI,EAAC,SAAS,IAC7C,eAAa,CACR,CACR;MACD,IAAI,CAAC,aAAa,IAChB,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAC,QAAQ,GAAY,IACjG,IAAI;MACR,IAAI,CAAC,OAAO,GAAG,mBAAa,IAAI,EAAE,IAAI,CAAC,WAAW,GAAgB,GAAG,IAAI;KAC1E,CAAC;GACH;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC3B;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/utils/breakpoints.ts","./src/utils/platform.ts","./src/utils/media-matcher.ts","./src/components/cat-button/cat-button.scss?tag=cat-button&encapsulation=shadow","./src/components/cat-button/cat-button.tsx"],"sourcesContent":["const _breakpoints = ['xs', 's', 'm', 'l', 'xl'] as const;\n\nexport type Breakpoint = typeof _breakpoints[number];\n\nexport const Breakpoints: { [breakpoint in Breakpoint]: string } = {\n xs: '(max-width: 539.98px)',\n s: '(max-width: 767.98px)',\n m: '(max-width: 991.98px)',\n l: '(max-width: 1199.98px)',\n xl: '(max-width: 1399.98px)'\n};\n\nexport function isBreakpoint(value: unknown): value is Breakpoint {\n return typeof value === 'string' && _breakpoints.includes(value as Breakpoint);\n}\n","// https://github.com/angular/components/blob/master/src/cdk/platform/platform.ts\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n hasV8BreakIterator = typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator;\n} catch {\n hasV8BreakIterator = false;\n}\n\nexport class Platform {\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n !!((window as any).chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT;\n\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);\n\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n /** Whether the current browser is Firefox. */\n FIREFOX: boolean = /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n /** Whether the current browser is Safari. */\n SAFARI: boolean = /safari/i.test(navigator.userAgent) && this.WEBKIT;\n}\n","import log from 'loglevel';\nimport { Platform } from './platform';\n\n// https://github.com/angular/components/blob/master/src/cdk/layout/media-matcher.ts\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\nexport class MediaMatcher {\n private _platform;\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor() {\n this._platform = new Platform();\n this._matchMedia = window.matchMedia.bind(window);\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT || this._platform.BLINK) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * Creates an empty stylesheet that is used to work around browser inconsistencies related to\n * `matchMedia`. At the time of writing, it handles the following cases:\n * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`\n * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.\n * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules\n * inside the `@media` match existing elements on the page. We work around it by having one rule\n * targeting the `body`. See https://github.com/angular/components/issues/23546.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head.appendChild(mediaQueryStyleNode);\n }\n if (mediaQueryStyleNode.sheet) {\n mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n log.error(e);\n }\n}\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'sass:map';\n\n$button-sizes: (\n 'xl': 3.5rem,\n 'l': 3rem,\n 'm': 2.5rem,\n 's': 2rem,\n 'xs': 1.5rem\n);\n\n:host {\n display: inline-block;\n max-width: 100%;\n vertical-align: middle;\n @include cat-select(none);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.cat-button {\n position: relative;\n font: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: cat-border-radius('m');\n text-decoration: none;\n width: 100%;\n box-sizing: border-box;\n cursor: pointer;\n transition: color cat-token('time.transition.s') linear, border-color cat-token('time.transition.s') linear,\n background-color cat-token('time.transition.s') linear, box-shadow cat-token('time.transition.s') linear;\n\n &:focus-visible {\n outline: 2px solid cat-token('color.ui.border.focus');\n outline-offset: 1px;\n }\n}\n\n// ----- content\n\n.cat-button-content {\n // flex: 1 1 auto;\n // text-align: center;\n\n .cat-button-ellipsed & {\n @include cat-ellipsis;\n }\n}\n\n// ----- disabled\n\n.cat-button-disabled {\n @include cat-disabled;\n}\n\n// ----- round\n\n.cat-button-round {\n border-radius: 10rem;\n}\n\n// ----- loading\n\n.cat-button-loading {\n cursor: default;\n\n cat-spinner {\n position: absolute;\n }\n\n > *:not(cat-spinner) {\n visibility: hidden;\n }\n}\n\n// ----- theme\n\n.cat-button-filled {\n background-color: cat-token-wrap(var(--bg));\n color: cat-token-wrap(var(--fill));\n font-weight: 600;\n @include cat-font-smooth;\n}\n\n.cat-button-outlined {\n background-color: cat-token('color.ui.background.body');\n box-shadow: inset 0 0 0 1px cat-token-wrap(var(--base), $alpha: 0.2);\n color: cat-token-wrap(var(--text));\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n background-color: cat-token-wrap(var(--base), $alpha: 0.05);\n }\n\n &:active:not(.cat-button-disabled):not(.cat-button-loading) {\n background-color: cat-token-wrap(var(--base), $alpha: 0.1);\n }\n}\n\n.cat-button-text {\n background-color: transparent;\n color: cat-token-wrap(var(--text));\n text-decoration: $cat-link-text-decoration;\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n text-decoration: $cat-button-text-decoration-hover;\n background-color: rgba(var(--base), 0.05);\n }\n}\n\n@mixin theme($theme) {\n .cat-button-#{$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 --base: #{cat-token('color.theme.#{$theme}.bg', $wrap: false)};\n } @else {\n --base: #{cat-token('color.theme.#{$theme}.text', $wrap: false)};\n }\n\n &:hover:not(.cat-button-disabled):not(.cat-button-loading) {\n --bg: #{cat-token('color.theme.#{$theme}.bgHover', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fillHover', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.textHover', $wrap: false)};\n }\n\n &:active:not(.cat-button-disabled):not(.cat-button-loading) {\n --bg: #{cat-token('color.theme.#{$theme}.bgActive', $wrap: false)};\n --fill: #{cat-token('color.theme.#{$theme}.fillActive', $wrap: false)};\n --text: #{cat-token('color.theme.#{$theme}.textActive', $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, $padding) {\n $-line-height: cat-body-line-height($fontSize);\n\n $-total-height: map.get($button-sizes, $size);\n $-padding-v: ($-total-height - $-line-height) * 0.5;\n $-padding-h: $padding;\n\n .cat-button-#{$size} {\n min-width: map.get($button-sizes, $size);\n padding: $-padding-v $-padding-h;\n\n @include cat-body($fontSize);\n\n .cat-button-prefix {\n margin-right: 0.25rem;\n }\n\n .cat-button-suffix {\n margin-left: 0.25rem;\n }\n\n // normalize icon size for line height\n @if $fontSize == 'm' {\n cat-icon {\n margin-top: -0.125rem;\n margin-bottom: -0.125rem;\n }\n }\n\n &.cat-button-icon {\n width: $-total-height;\n padding-left: 0;\n padding-right: 0;\n }\n\n :host-context(nav) & {\n padding-left: $cat-nav-padding-horizontal;\n padding-right: $cat-nav-padding-horizontal;\n }\n }\n\n :host(.cat-button-pull[size='#{$size}']) {\n margin: $-padding-v * -1 $-padding-h * -1;\n }\n\n :host(.cat-button-pull-h[size='#{$size}']) {\n margin-left: $-padding-h * -1;\n margin-right: $-padding-h * -1;\n }\n\n :host(.cat-button-pull-v[size='#{$size}']) {\n margin-top: $-padding-v * -1;\n margin-bottom: $-padding-v * -1;\n }\n\n :host(.cat-button-pull-t[size='#{$size}']) {\n margin-top: $-padding-v * -1;\n }\n\n :host(.cat-button-pull-l[size='#{$size}']) {\n margin-left: $-padding-h * -1;\n }\n\n :host(.cat-button-pull-b[size='#{$size}']) {\n margin-bottom: $-padding-v * -1;\n }\n\n :host(.cat-button-pull-r[size='#{$size}']) {\n margin-right: $-padding-h * -1;\n }\n}\n\n:host(.cat-button-pull:not([size])) {\n margin: -0.625rem -0.75rem;\n}\n\n:host(.cat-button-pull-h:not([size])) {\n margin-left: -0.75rem;\n margin-right: -0.75rem;\n}\n\n:host(.cat-button-pull-v:not([size])) {\n margin-top: -0.625rem;\n margin-bottom: -0.625rem;\n}\n\n:host(.cat-button-pull-t:not([size])) {\n margin-top: -0.625rem;\n}\n\n:host(.cat-button-pull-l:not([size])) {\n margin-left: -0.75rem;\n}\n\n:host(.cat-button-pull-b:not([size])) {\n margin-bottom: -0.625rem;\n}\n\n:host(.cat-button-pull-r:not([size])) {\n margin-right: -0.75rem;\n}\n\n@include size('xs', 's', 0.25rem);\n@include size('s', 'm', 0.5rem);\n@include size('m', 'm', 0.75rem);\n@include size('l', 'm', 1rem);\n@include size('xl', 'l', 1.25rem);\n\n// -- active state\n\n.cat-button-active::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 0.25rem;\n height: 100%;\n background: cat-token-wrap(var(--base));\n}\n\n// ----- context\n\n:host-context(nav) {\n width: 100%;\n\n .cat-button {\n box-shadow: none;\n border-radius: 0;\n justify-content: left;\n\n &:focus-visible {\n outline-offset: -2px;\n }\n }\n}\n\n:host(.cat-text-left) .cat-button {\n justify-content: left;\n}\n\n:host(.cat-text-right) .cat-button {\n justify-content: right;\n}\n","import { Component, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { Breakpoint, Breakpoints, isBreakpoint } from '../../utils/breakpoints';\nimport { MediaMatcher } from '../../utils/media-matcher';\n\n/**\n * Buttons are used for interface actions. Primary style should be used only\n * once per view for main call-to-action.\n *\n * @part button - The native anchor or button element.\n * @part content - The textual content of the button.\n * @part prefix - The prefix icon.\n * @part suffix - The suffix icon.\n */\n@Component({\n tag: 'cat-button',\n styleUrl: 'cat-button.scss',\n shadow: true\n})\nexport class CatButton {\n private button!: HTMLButtonElement | HTMLAnchorElement;\n private mediaMatcher?: MediaMatcher;\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n @State() _iconOnly = true;\n\n /**\n * The rendering style of the button.\n */\n @Prop() variant: 'filled' | 'outlined' | 'text' = 'outlined';\n\n /**\n * The color palette of the button.\n */\n @Prop() color: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' = 'secondary';\n\n /**\n * Show an active status indicator on the left side of the button.\n */\n @Prop() active = false;\n\n /**\n * The size of the button.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' = 'm';\n\n /**\n * The name of the button, which gets paired with the button's value when\n * submitted as part of a form. Corresponds with the native HTML name\n * attribute.\n */\n @Prop() name?: string;\n\n /**\n * The value of the button, which gets paired with the button's name when\n * submitted as part of a form. Corresponds with the native HTML value\n * attribute.\n */\n @Prop() value?: string;\n\n /**\n * Specifies that the button should be disabled. A disabled button is unusable\n * and un-clickable. Corresponds with the native HTML disabled attribute.\n */\n @Prop() disabled = false;\n\n /**\n * Displays the button in a loading state with a spinner. Just like a disabled\n * button, an inactive button is unusable and un-clickable. However, it\n * retains the current focus state.\n */\n @Prop() loading = false;\n\n /**\n * Allows the button to submit a form.\n */\n @Prop() submit = false;\n\n /**\n * Disables ellipse overflowing button content.\n */\n @Prop() noEllipsis = false;\n\n /**\n * Use round button edges.\n */\n @Prop() round = false;\n\n /**\n * A destination to link to, rendered in the href attribute of a link.\n */\n @Prop() url?: string;\n\n /**\n * Specifies where to open the linked document.\n */\n @Prop() urlTarget?: '_blank' | '_self';\n\n /**\n * The name of an icon to be displayed in the button.\n */\n @Prop() icon?: string;\n\n /**\n * Hide the actual button content and only display the icon.\n */\n @Prop() iconOnly: boolean | Breakpoint = false;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * Adds a unique identifier for the button. Please note that with this\n * particular component this ID is added inside the web component. If you need\n * an ID on the HTML element, use the regular `id` attribute instead.\n */\n @Prop() buttonId?: string;\n\n /**\n * Adds accessible label for the button that is only shown for screen\n * readers. Typically, this label text replaces the visible text on the\n * button for users who use assistive technology.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n @Watch('iconOnly')\n onIconOnlyChanged(value: boolean | Breakpoint): void {\n // teardown\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.mediaQueryList?.removeEventListener('change', this.mediaQueryListener!);\n this.mediaQueryList = undefined;\n this.mediaQueryListener = undefined;\n // setup\n if (isBreakpoint(value)) {\n this.mediaMatcher ??= new MediaMatcher();\n this.mediaQueryList = this.mediaMatcher.matchMedia(Breakpoints[value]);\n this.mediaQueryListener = (event: MediaQueryListEvent) => (this._iconOnly = event.matches);\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n this._iconOnly = this.mediaQueryList.matches;\n } else {\n this._iconOnly = value;\n }\n }\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() catClick!: EventEmitter<MouseEvent>;\n\n /**\n * Emitted when the button received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the button loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillLoad(): void {\n this.onIconOnlyChanged(this.iconOnly);\n }\n\n componentWillRender(): void {\n if (this.isIconButton && !this.a11yLabel) {\n log.warn('[A11y] Missing ARIA label on icon button', this);\n }\n }\n\n @Listen('click')\n haltDisabledEvents(event: Event): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n /**\n * Sets focus on the button. Use this method instead of `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n render() {\n if (this.url) {\n return (\n <a\n ref={el => (this.button = el as HTMLAnchorElement)}\n href={this.disabled ? undefined : this.url}\n target={this.urlTarget}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </a>\n );\n } else {\n return (\n <button\n ref={el => (this.button = el as HTMLButtonElement)}\n type={this.submit ? 'submit' : 'button'}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n aria-label={this.a11yLabel}\n id={this.buttonId}\n part=\"button\"\n class={{\n 'cat-button': true,\n 'cat-button-active': this.active,\n 'cat-button-icon': this.isIconButton,\n 'cat-button-round': this.round ?? this.isIconButton,\n 'cat-button-loading': this.loading,\n 'cat-button-disabled': this.disabled,\n 'cat-button-ellipsed': !this.noEllipsis && !this.isIconButton,\n [`cat-button-${this.variant}`]: Boolean(this.variant),\n [`cat-button-${this.color}`]: Boolean(this.color),\n [`cat-button-${this.size}`]: Boolean(this.size)\n }}\n onClick={this.onClick.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n >\n {this.content}\n </button>\n );\n }\n }\n\n private get iconSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 's';\n default:\n return 'l';\n }\n }\n\n private get spinnerSize(): 'xs' | 's' | 'm' | 'l' | 'xl' {\n switch (this.size) {\n case 'xs':\n return 'xs';\n default:\n return 'm';\n }\n }\n\n private get isIconButton() {\n return Boolean(this.icon) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return Boolean(this.icon) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return Boolean(this.icon) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? (\n <cat-icon icon={this.icon} size={this.iconSize} class=\"cat-button-prefix\" part=\"prefix\"></cat-icon>\n ) : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} size={this.iconSize}></cat-icon>\n ) : (\n <span class=\"cat-button-content\" part=\"content\">\n <slot></slot>\n </span>\n ),\n this.hasSuffixIcon ? (\n <cat-icon icon={this.icon} size={this.iconSize} class=\"cat-button-suffix\" part=\"suffix\"></cat-icon>\n ) : null,\n this.loading ? <cat-spinner size={this.spinnerSize}></cat-spinner> : null\n ];\n }\n\n private onClick(event: MouseEvent) {\n this.catClick.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}