@haiilo/catalyst 2.5.0 → 3.0.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 (48) hide show
  1. package/dist/catalyst/catalyst.css +2411 -2
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/index.cdn.js +1 -0
  5. package/dist/catalyst/p-52f9fea7.entry.js +2 -0
  6. package/dist/catalyst/{p-5bfc70e3.entry.js.map → p-52f9fea7.entry.js.map} +1 -1
  7. package/dist/catalyst/p-557c8009.entry.js +2 -0
  8. package/dist/catalyst/p-557c8009.entry.js.map +1 -0
  9. package/dist/catalyst/scss/_variables.tokens.scss +2 -2
  10. package/dist/catalyst/scss/core/_dialog.scss +66 -0
  11. package/dist/catalyst/scss/index.scss +1 -0
  12. package/dist/catalyst/scss/utils/_media.mixins.scss +1 -0
  13. package/dist/cjs/cat-alert_24.cjs.entry.js +7 -11
  14. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
  15. package/dist/cjs/cat-modal.cjs.entry.js +1 -1
  16. package/dist/cjs/cat-modal.cjs.entry.js.map +1 -1
  17. package/dist/cjs/catalyst.cjs.js +1 -1
  18. package/dist/cjs/loader.cjs.js +1 -1
  19. package/dist/collection/components/cat-button/cat-button.js +23 -6
  20. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  21. package/dist/collection/components/cat-icon/cat-icon.js +21 -9
  22. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  23. package/dist/collection/components/cat-modal/cat-modal.css +1 -1
  24. package/dist/collection/index.cdn.js +1 -0
  25. package/dist/collection/scss/_variables.tokens.scss +2 -2
  26. package/dist/collection/scss/core/_dialog.scss +66 -0
  27. package/dist/collection/scss/index.scss +1 -0
  28. package/dist/collection/scss/utils/_media.mixins.scss +1 -0
  29. package/dist/components/cat-button2.js +7 -6
  30. package/dist/components/cat-button2.js.map +1 -1
  31. package/dist/components/cat-dropdown2.js.map +1 -1
  32. package/dist/components/cat-icon2.js +2 -5
  33. package/dist/components/cat-icon2.js.map +1 -1
  34. package/dist/components/cat-modal.js +1 -1
  35. package/dist/components/cat-modal.js.map +1 -1
  36. package/dist/esm/cat-alert_24.entry.js +7 -11
  37. package/dist/esm/cat-alert_24.entry.js.map +1 -1
  38. package/dist/esm/cat-modal.entry.js +1 -1
  39. package/dist/esm/cat-modal.entry.js.map +1 -1
  40. package/dist/esm/catalyst.js +1 -1
  41. package/dist/esm/loader.js +1 -1
  42. package/dist/types/components/cat-button/cat-button.d.ts +5 -0
  43. package/dist/types/components/cat-icon/cat-icon.d.ts +5 -1
  44. package/dist/types/components.d.ts +17 -1
  45. package/package.json +2 -2
  46. package/dist/catalyst/p-2fdb52c9.entry.js +0 -2
  47. package/dist/catalyst/p-2fdb52c9.entry.js.map +0 -1
  48. package/dist/catalyst/p-5bfc70e3.entry.js +0 -2
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-e540e911.js');
6
6
  const firstTabbable = require('./first-tabbable-7966cf1c.js');
7
7
 
8
- const catModalCss = ":host{display:block}:host([hidden]){display:none}.modal-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgb(rgb(var(--cat-bg-backdrop, 0, 0, 0)), var(--cat-opacity-backdrop, 0.6));z-index:2;display:flex}.modal-wrapper[aria-hidden=true]{display:none}.modal{margin:auto;z-index:2;position:relative;background-color:white;border-radius:var(--cat-border-radius-l, 0.5rem);max-width:100%;padding:32px}.modal-header{display:flex;justify-content:end;align-self:stretch}.modal-header .close-button::part(button){box-shadow:unset}.modal-content{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;margin:16px 0}.modal-s{width:400px}.modal-m{width:600px}.modal-l{width:800px}";
8
+ const catModalCss = ":host{display:block}:host([hidden]){display:none}.modal-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgb(rgb(var(--cat-bg-backdrop, 27, 31, 38)), var(--cat-opacity-backdrop, 0.4));z-index:2;display:flex}.modal-wrapper[aria-hidden=true]{display:none}.modal{margin:auto;z-index:2;position:relative;background-color:white;border-radius:var(--cat-border-radius-l, 0.5rem);max-width:100%;padding:32px}.modal-header{display:flex;justify-content:end;align-self:stretch}.modal-header .close-button::part(button){box-shadow:unset}.modal-content{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch;margin:16px 0}.modal-s{width:400px}.modal-m{width:600px}.modal-l{width:800px}";
9
9
 
10
10
  const CatModal = class {
11
11
  constructor(hostRef) {
@@ -1 +1 @@
1
- {"file":"cat-modal.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,WAAW,GAAG,0sBAA0sB;;MCSjtB,QAAQ;EALrB;;IAYW,cAAS,GAAG,KAAK,CAAC;;;;IAKnB,SAAI,GAAoB,GAAG,CAAC;GA2ErC;EAzEC,gBAAgB;IACd,IAAI,IAAI,CAAC,KAAK,EAAE;MACd,IAAI,CAAC,IAAI,GAAGA,6BAAyB,CAAC,IAAI,CAAC,KAAK,EAAE;QAChD,eAAe,EAAE;UACf,aAAa,EAAE,IAAI;SACpB;QACD,YAAY,EAAEC,2BAAa,CAAC,IAAI,CAAC,WAAW,CAAC;QAC7C,iBAAiB,EAAE,IAAI;QACvB,uBAAuB,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QAC3F,YAAY,EAAE,OAAO,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAC5C,cAAc,EAAE,qBAAqB,IACnC,qBAAqB,YAAY,WAAW;YACvCA,2BAAa,CAAC,qBAAqB,CAAiB;YACrD,qBAAqB;OAC5B,CAAC,CAAC;KACJ;GACF;EAED,kBAAkB;;IAChB,IAAI,IAAI,CAAC,SAAS;MAAE,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,EAAE,CAAC;IAC1C,IA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,CAAC,CAAC;MAEH,IAAI,OAAO,CAAC,aAAa,KAAK,QAAQ,CAAC,IAAI,EAAE;QAC3C,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;OACjD;KACF;GACF;;;;;;;","names":["focusTrap.createFocusTrap","firstTabbable","h"],"sources":["./src/components/cat-modal/cat-modal.scss?tag=cat-modal&encapsulation=shadow","./src/components/cat-modal/cat-modal.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.modal-wrapper {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgb(cat-token('color.ui.background.backdrop'), cat-token('opacity.backdrop'));\n z-index: 2;\n display: flex;\n\n &[aria-hidden='true'] {\n display: none;\n }\n}\n\n.modal {\n margin: auto;\n z-index: 2;\n position: relative;\n background-color: cat-token('color.ui.background.body');\n border-radius: cat-border-radius('l');\n max-width: 100%;\n padding: 32px;\n}\n\n.modal-header {\n display: flex;\n justify-content: end;\n align-self: stretch;\n\n .close-button::part(button) {\n box-shadow: unset;\n }\n}\n\n.modal-content {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n align-self: stretch;\n margin: 16px 0;\n}\n\n@mixin size($size) {\n .modal-#{$size} {\n width: cat-token('size.modal.#{$size}');\n }\n}\n\n@include size('s');\n@include size('m');\n@include size('l');\n","import { Component, Element, h, Method, Prop, State } from '@stencil/core';\nimport * as focusTrap from 'focus-trap';\nimport firstTabbable from '../../utils/first-tabbable';\n\n@Component({\n tag: 'cat-modal',\n styleUrl: 'cat-modal.scss',\n shadow: true\n})\nexport class CatModal {\n private trap?: focusTrap.FocusTrap;\n private modal?: HTMLElement;\n private closeButton?: HTMLElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() isVisible = false;\n\n /**\n * The size of the modal.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n componentDidLoad(): void {\n if (this.modal) {\n this.trap = focusTrap.createFocusTrap(this.modal, {\n tabbableOptions: {\n getShadowRoot: true\n },\n initialFocus: firstTabbable(this.closeButton),\n allowOutsideClick: true,\n clickOutsideDeactivates: event => !this.modal || !event.composedPath().includes(this.modal),\n onDeactivate: () => (this.isVisible = false),\n setReturnFocus: previousActiveElement =>\n previousActiveElement instanceof HTMLElement\n ? (firstTabbable(previousActiveElement) as HTMLElement)\n : previousActiveElement\n });\n }\n }\n\n componentDidUpdate(): void {\n if (this.isVisible) this.trap?.activate();\n this.updateAccessibility(this.hostElement);\n }\n\n /**\n * Shows the modal.\n */\n @Method()\n async show(): Promise<void> {\n this.isVisible = true;\n }\n\n render() {\n return (\n <div aria-modal role=\"dialog\" aria-hidden={!this.isVisible ? 'true' : 'false'} class=\"modal-wrapper\">\n <div ref={el => (this.modal = el)} class={{ modal: true, [`modal-${this.size}`]: Boolean(this.size) }}>\n <div class=\"modal-header\">\n <cat-button\n ref={el => (this.closeButton = el)}\n icon=\"cross-outlined\"\n class=\"close-button\"\n size=\"s\"\n iconOnly\n a11yLabel=\"close\"\n onCatClick={this.onClick.bind(this)}\n ></cat-button>\n </div>\n <div class=\"modal-content\">\n <slot></slot>\n </div>\n </div>\n </div>\n );\n }\n\n private onClick() {\n this.trap?.deactivate();\n }\n\n private updateAccessibility(element: HTMLElement) {\n if (element.parentElement) {\n Array.from(element.parentElement.children).forEach(elementSibling => {\n if (elementSibling !== element) {\n this.isVisible\n ? elementSibling.setAttribute('aria-hidden', 'true')\n : elementSibling.removeAttribute('aria-hidden');\n }\n });\n\n if (element.parentElement !== document.body) {\n this.updateAccessibility(element.parentElement);\n }\n }\n }\n}\n"],"version":3}
1
+ {"file":"cat-modal.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,WAAW,GAAG,6sBAA6sB;;MCSptB,QAAQ;EALrB;;IAYW,cAAS,GAAG,KAAK,CAAC;;;;IAKnB,SAAI,GAAoB,GAAG,CAAC;GA2ErC;EAzEC,gBAAgB;IACd,I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AAE,CAAC,EAClC,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,GAAG,EACR,QAAQ,QACR,SAAS,EAAC,OAAO,EACjB,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GACvB,CACV,EACNA,iBAAK,KAAK,EAAC,eAAe,IACxBA,qBAAa,CACT,CACF,CACF,EACN;GACH;EAEO,OAAO;;IACb,MAAA,IAAI,CAAC,IAAI,0CAAE,UAAU,EAAE,CAAC;GACzB;EAEO,mBAAmB,CAAC,OAAoB;IAC9C,IAAI,OAAO,CAAC,aAAa,EAAE;MACzB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,cAAc;QAC/D,IAAI,cAAc,KAAK,OAAO,EAAE;UAC9B,IAAI,CAAC,SAAS;cACV,cAAc,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;cAClD,cAAc,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACnD;OACF,CAAC,CAAC;MAEH,IAAI,OAAO,CAAC,aAAa,KAAK,QAAQ,CAAC,IAAI,EAAE;QAC3C,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;OACjD;KACF;GACF;;;;;;;","names":["focusTrap.createFocusTrap","firstTabbable","h"],"sources":["./src/components/cat-modal/cat-modal.scss?tag=cat-modal&encapsulation=shadow","./src/components/cat-modal/cat-modal.tsx"],"sourcesContent":["@use 'variables' as *;\n@use 'mixins' as *;\n\n:host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.modal-wrapper {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgb(cat-token('color.ui.background.backdrop'), cat-token('opacity.backdrop'));\n z-index: 2;\n display: flex;\n\n &[aria-hidden='true'] {\n display: none;\n }\n}\n\n.modal {\n margin: auto;\n z-index: 2;\n position: relative;\n background-color: cat-token('color.ui.background.body');\n border-radius: cat-border-radius('l');\n max-width: 100%;\n padding: 32px;\n}\n\n.modal-header {\n display: flex;\n justify-content: end;\n align-self: stretch;\n\n .close-button::part(button) {\n box-shadow: unset;\n }\n}\n\n.modal-content {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n align-self: stretch;\n margin: 16px 0;\n}\n\n@mixin size($size) {\n .modal-#{$size} {\n width: cat-token('size.modal.#{$size}');\n }\n}\n\n@include size('s');\n@include size('m');\n@include size('l');\n","import { Component, Element, h, Method, Prop, State } from '@stencil/core';\nimport * as focusTrap from 'focus-trap';\nimport firstTabbable from '../../utils/first-tabbable';\n\n@Component({\n tag: 'cat-modal',\n styleUrl: 'cat-modal.scss',\n shadow: true\n})\nexport class CatModal {\n private trap?: focusTrap.FocusTrap;\n private modal?: HTMLElement;\n private closeButton?: HTMLElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() isVisible = false;\n\n /**\n * The size of the modal.\n */\n @Prop() size: 's' | 'm' | 'l' = 'm';\n\n componentDidLoad(): void {\n if (this.modal) {\n this.trap = focusTrap.createFocusTrap(this.modal, {\n tabbableOptions: {\n getShadowRoot: true\n },\n initialFocus: firstTabbable(this.closeButton),\n allowOutsideClick: true,\n clickOutsideDeactivates: event => !this.modal || !event.composedPath().includes(this.modal),\n onDeactivate: () => (this.isVisible = false),\n setReturnFocus: previousActiveElement =>\n previousActiveElement instanceof HTMLElement\n ? (firstTabbable(previousActiveElement) as HTMLElement)\n : previousActiveElement\n });\n }\n }\n\n componentDidUpdate(): void {\n if (this.isVisible) this.trap?.activate();\n this.updateAccessibility(this.hostElement);\n }\n\n /**\n * Shows the modal.\n */\n @Method()\n async show(): Promise<void> {\n this.isVisible = true;\n }\n\n render() {\n return (\n <div aria-modal role=\"dialog\" aria-hidden={!this.isVisible ? 'true' : 'false'} class=\"modal-wrapper\">\n <div ref={el => (this.modal = el)} class={{ modal: true, [`modal-${this.size}`]: Boolean(this.size) }}>\n <div class=\"modal-header\">\n <cat-button\n ref={el => (this.closeButton = el)}\n icon=\"cross-outlined\"\n class=\"close-button\"\n size=\"s\"\n iconOnly\n a11yLabel=\"close\"\n onCatClick={this.onClick.bind(this)}\n ></cat-button>\n </div>\n <div class=\"modal-content\">\n <slot></slot>\n </div>\n </div>\n </div>\n );\n }\n\n private onClick() {\n this.trap?.deactivate();\n }\n\n private updateAccessibility(element: HTMLElement) {\n if (element.parentElement) {\n Array.from(element.parentElement.children).forEach(elementSibling => {\n if (elementSibling !== element) {\n this.isVisible\n ? elementSibling.setAttribute('aria-hidden', 'true')\n : elementSibling.removeAttribute('aria-hidden');\n }\n });\n\n if (element.parentElement !== document.body) {\n this.updateAccessibility(element.parentElement);\n }\n }\n }\n}\n"],"version":3}
@@ -15,7 +15,7 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["cat-alert_24.cjs",[[1,"cat-select-demo"],[1,"cat-input",{"requiredMarker":[1,"required-marker"],"autoComplete":[1,"auto-complete"],"clearable":[4],"disabled":[4],"hint":[1],"icon":[1],"iconRight":[4,"icon-right"],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"max":[8],"maxLength":[2,"max-length"],"min":[8],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"textPrefix":[1,"text-prefix"],"textSuffix":[1,"text-suffix"],"readonly":[4],"required":[4],"round":[4],"type":[1],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64],"clear":[64]}],[1,"cat-pagination",{"page":[1026],"pageCount":[2,"page-count"],"activePadding":[2,"active-padding"],"sidePadding":[2,"side-padding"],"size":[1],"variant":[1],"round":[4],"compact":[4],"iconPrev":[1,"icon-prev"],"iconNext":[1,"icon-next"]}],[1,"cat-tabs",{"activeTab":[1,"active-tab"],"tabsAlign":[1,"tabs-align"],"tabs":[32],"activeTabId":[32]},[[0,"keydown","onKeydown"]]],[1,"cat-alert",{"color":[513],"icon":[1],"noIcon":[4,"no-icon"]}],[1,"cat-badge",{"variant":[513],"color":[513],"size":[513],"round":[516],"pulse":[516]}],[1,"cat-card"],[1,"cat-form-group",{"requiredMarker":[1,"required-marker"]}],[1,"cat-label",{"requiredMarker":[1,"required-marker"],"for":[1],"required":[4]}],[1,"cat-radio",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-radio-group",{"name":[1],"value":[1025],"disabled":[4],"a11yLabel":[1,"a11y-label"],"labelLeft":[4,"label-left"]},[[0,"keydown","onKeydown"],[0,"input","onInput"],[2,"blur","onBlur"]]],[1,"cat-tab",{"label":[513],"icon":[513],"iconOnly":[520,"icon-only"],"iconRight":[516,"icon-right"],"url":[513],"urlTarget":[513,"url-target"],"deactivated":[516]},[[0,"click","onClick"]]],[1,"cat-textarea",{"requiredMarker":[1,"required-marker"],"disabled":[4],"hint":[1],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"maxLength":[2,"max-length"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-toggle",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-tooltip",{"content":[1],"disabled":[4],"placement":[1],"round":[4],"size":[1],"showDelay":[2,"show-delay"],"hideDelay":[2,"hide-delay"],"longTouchDuration":[2,"long-touch-duration"]},[[0,"keydown","handleKeyDown"]]],[1,"cat-select",{"requiredMarker":[1,"required-marker"],"multiple":[4],"debounce":[2],"placement":[1],"value":[1025],"disabled":[4],"placeholder":[1],"hint":[1],"identifier":[1],"label":[1],"name":[1],"labelHidden":[4,"label-hidden"],"required":[4],"clearable":[4],"tags":[4],"tagHint":[1,"tag-hint"],"noItems":[1,"no-items"],"connector":[32],"state":[32],"hasSlottedLabel":[32],"connect":[64]},[[0,"blur","onBlur"],[0,"keydown","onKeyDown"],[0,"keyup","onKeyUp"]]],[1,"cat-dropdown",{"placement":[1],"noAutoClose":[4,"no-auto-close"],"overflow":[4],"close":[64]},[[0,"catClick","clickHandler"]]],[1,"cat-avatar",{"size":[1],"round":[4],"label":[1],"initials":[1],"src":[1],"icon":[1],"url":[1],"urlTarget":[1,"url-target"],"backgroundImage":[32]}],[1,"cat-checkbox",{"checked":[1028],"disabled":[4],"identifier":[1],"indeterminate":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-scrollable",{"noShadowX":[4,"no-shadow-x"],"noShadowY":[4,"no-shadow-y"],"noOverflowX":[4,"no-overflow-x"],"noOverflowY":[4,"no-overflow-y"],"noOverscroll":[4,"no-overscroll"],"noScrolledInit":[4,"no-scrolled-init"],"scrolledBuffer":[2,"scrolled-buffer"]}],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-button",{"variant":[1],"color":[1],"active":[4],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"noEllipsis":[4,"no-ellipsis"],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconOnly":[8,"icon-only"],"iconRight":[4,"icon-right"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"a11yCurrent":[1,"a11y-current"],"_iconOnly":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-icon",{"icon":[1],"size":[1],"a11yLabel":[1,"a11y-label"]}]]],["cat-modal.cjs",[[1,"cat-modal",{"size":[1],"isVisible":[32],"show":[64]}]]]], options);
18
+ return index.bootstrapLazy([["cat-alert_24.cjs",[[1,"cat-select-demo"],[1,"cat-input",{"requiredMarker":[1,"required-marker"],"autoComplete":[1,"auto-complete"],"clearable":[4],"disabled":[4],"hint":[1],"icon":[1],"iconRight":[4,"icon-right"],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"max":[8],"maxLength":[2,"max-length"],"min":[8],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"textPrefix":[1,"text-prefix"],"textSuffix":[1,"text-suffix"],"readonly":[4],"required":[4],"round":[4],"type":[1],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64],"clear":[64]}],[1,"cat-pagination",{"page":[1026],"pageCount":[2,"page-count"],"activePadding":[2,"active-padding"],"sidePadding":[2,"side-padding"],"size":[1],"variant":[1],"round":[4],"compact":[4],"iconPrev":[1,"icon-prev"],"iconNext":[1,"icon-next"]}],[1,"cat-tabs",{"activeTab":[1,"active-tab"],"tabsAlign":[1,"tabs-align"],"tabs":[32],"activeTabId":[32]},[[0,"keydown","onKeydown"]]],[1,"cat-alert",{"color":[513],"icon":[1],"noIcon":[4,"no-icon"]}],[1,"cat-badge",{"variant":[513],"color":[513],"size":[513],"round":[516],"pulse":[516]}],[1,"cat-card"],[1,"cat-form-group",{"requiredMarker":[1,"required-marker"]}],[1,"cat-label",{"requiredMarker":[1,"required-marker"],"for":[1],"required":[4]}],[1,"cat-radio",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-radio-group",{"name":[1],"value":[1025],"disabled":[4],"a11yLabel":[1,"a11y-label"],"labelLeft":[4,"label-left"]},[[0,"keydown","onKeydown"],[0,"input","onInput"],[2,"blur","onBlur"]]],[1,"cat-tab",{"label":[513],"icon":[513],"iconOnly":[520,"icon-only"],"iconRight":[516,"icon-right"],"url":[513],"urlTarget":[513,"url-target"],"deactivated":[516]},[[0,"click","onClick"]]],[1,"cat-textarea",{"requiredMarker":[1,"required-marker"],"disabled":[4],"hint":[1],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"maxLength":[2,"max-length"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-toggle",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-tooltip",{"content":[1],"disabled":[4],"placement":[1],"round":[4],"size":[1],"showDelay":[2,"show-delay"],"hideDelay":[2,"hide-delay"],"longTouchDuration":[2,"long-touch-duration"]},[[0,"keydown","handleKeyDown"]]],[1,"cat-select",{"requiredMarker":[1,"required-marker"],"multiple":[4],"debounce":[2],"placement":[1],"value":[1025],"disabled":[4],"placeholder":[1],"hint":[1],"identifier":[1],"label":[1],"name":[1],"labelHidden":[4,"label-hidden"],"required":[4],"clearable":[4],"tags":[4],"tagHint":[1,"tag-hint"],"noItems":[1,"no-items"],"connector":[32],"state":[32],"hasSlottedLabel":[32],"connect":[64]},[[0,"blur","onBlur"],[0,"keydown","onKeyDown"],[0,"keyup","onKeyUp"]]],[1,"cat-dropdown",{"placement":[1],"noAutoClose":[4,"no-auto-close"],"overflow":[4],"close":[64]},[[0,"catClick","clickHandler"]]],[1,"cat-avatar",{"size":[1],"round":[4],"label":[1],"initials":[1],"src":[1],"icon":[1],"url":[1],"urlTarget":[1,"url-target"],"backgroundImage":[32]}],[1,"cat-checkbox",{"checked":[1028],"disabled":[4],"identifier":[1],"indeterminate":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-scrollable",{"noShadowX":[4,"no-shadow-x"],"noShadowY":[4,"no-shadow-y"],"noOverflowX":[4,"no-overflow-x"],"noOverflowY":[4,"no-overflow-y"],"noOverscroll":[4,"no-overscroll"],"noScrolledInit":[4,"no-scrolled-init"],"scrolledBuffer":[2,"scrolled-buffer"]}],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-button",{"variant":[1],"color":[1],"active":[4],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"noEllipsis":[4,"no-ellipsis"],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconSrc":[1,"icon-src"],"iconOnly":[8,"icon-only"],"iconRight":[4,"icon-right"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"a11yCurrent":[1,"a11y-current"],"_iconOnly":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-icon",{"icon":[1],"iconSrc":[1,"icon-src"],"size":[1],"a11yLabel":[1,"a11y-label"]}]]],["cat-modal.cjs",[[1,"cat-modal",{"size":[1],"isVisible":[32],"show":[64]}]]]], options);
19
19
  });
20
20
 
21
21
  //# sourceMappingURL=catalyst.cjs.js.map
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["cat-alert_24.cjs",[[1,"cat-select-demo"],[1,"cat-input",{"requiredMarker":[1,"required-marker"],"autoComplete":[1,"auto-complete"],"clearable":[4],"disabled":[4],"hint":[1],"icon":[1],"iconRight":[4,"icon-right"],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"max":[8],"maxLength":[2,"max-length"],"min":[8],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"textPrefix":[1,"text-prefix"],"textSuffix":[1,"text-suffix"],"readonly":[4],"required":[4],"round":[4],"type":[1],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64],"clear":[64]}],[1,"cat-pagination",{"page":[1026],"pageCount":[2,"page-count"],"activePadding":[2,"active-padding"],"sidePadding":[2,"side-padding"],"size":[1],"variant":[1],"round":[4],"compact":[4],"iconPrev":[1,"icon-prev"],"iconNext":[1,"icon-next"]}],[1,"cat-tabs",{"activeTab":[1,"active-tab"],"tabsAlign":[1,"tabs-align"],"tabs":[32],"activeTabId":[32]},[[0,"keydown","onKeydown"]]],[1,"cat-alert",{"color":[513],"icon":[1],"noIcon":[4,"no-icon"]}],[1,"cat-badge",{"variant":[513],"color":[513],"size":[513],"round":[516],"pulse":[516]}],[1,"cat-card"],[1,"cat-form-group",{"requiredMarker":[1,"required-marker"]}],[1,"cat-label",{"requiredMarker":[1,"required-marker"],"for":[1],"required":[4]}],[1,"cat-radio",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-radio-group",{"name":[1],"value":[1025],"disabled":[4],"a11yLabel":[1,"a11y-label"],"labelLeft":[4,"label-left"]},[[0,"keydown","onKeydown"],[0,"input","onInput"],[2,"blur","onBlur"]]],[1,"cat-tab",{"label":[513],"icon":[513],"iconOnly":[520,"icon-only"],"iconRight":[516,"icon-right"],"url":[513],"urlTarget":[513,"url-target"],"deactivated":[516]},[[0,"click","onClick"]]],[1,"cat-textarea",{"requiredMarker":[1,"required-marker"],"disabled":[4],"hint":[1],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"maxLength":[2,"max-length"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-toggle",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-tooltip",{"content":[1],"disabled":[4],"placement":[1],"round":[4],"size":[1],"showDelay":[2,"show-delay"],"hideDelay":[2,"hide-delay"],"longTouchDuration":[2,"long-touch-duration"]},[[0,"keydown","handleKeyDown"]]],[1,"cat-select",{"requiredMarker":[1,"required-marker"],"multiple":[4],"debounce":[2],"placement":[1],"value":[1025],"disabled":[4],"placeholder":[1],"hint":[1],"identifier":[1],"label":[1],"name":[1],"labelHidden":[4,"label-hidden"],"required":[4],"clearable":[4],"tags":[4],"tagHint":[1,"tag-hint"],"noItems":[1,"no-items"],"connector":[32],"state":[32],"hasSlottedLabel":[32],"connect":[64]},[[0,"blur","onBlur"],[0,"keydown","onKeyDown"],[0,"keyup","onKeyUp"]]],[1,"cat-dropdown",{"placement":[1],"noAutoClose":[4,"no-auto-close"],"overflow":[4],"close":[64]},[[0,"catClick","clickHandler"]]],[1,"cat-avatar",{"size":[1],"round":[4],"label":[1],"initials":[1],"src":[1],"icon":[1],"url":[1],"urlTarget":[1,"url-target"],"backgroundImage":[32]}],[1,"cat-checkbox",{"checked":[1028],"disabled":[4],"identifier":[1],"indeterminate":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-scrollable",{"noShadowX":[4,"no-shadow-x"],"noShadowY":[4,"no-shadow-y"],"noOverflowX":[4,"no-overflow-x"],"noOverflowY":[4,"no-overflow-y"],"noOverscroll":[4,"no-overscroll"],"noScrolledInit":[4,"no-scrolled-init"],"scrolledBuffer":[2,"scrolled-buffer"]}],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-button",{"variant":[1],"color":[1],"active":[4],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"noEllipsis":[4,"no-ellipsis"],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconOnly":[8,"icon-only"],"iconRight":[4,"icon-right"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"a11yCurrent":[1,"a11y-current"],"_iconOnly":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-icon",{"icon":[1],"size":[1],"a11yLabel":[1,"a11y-label"]}]]],["cat-modal.cjs",[[1,"cat-modal",{"size":[1],"isVisible":[32],"show":[64]}]]]], options);
17
+ return index.bootstrapLazy([["cat-alert_24.cjs",[[1,"cat-select-demo"],[1,"cat-input",{"requiredMarker":[1,"required-marker"],"autoComplete":[1,"auto-complete"],"clearable":[4],"disabled":[4],"hint":[1],"icon":[1],"iconRight":[4,"icon-right"],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"max":[8],"maxLength":[2,"max-length"],"min":[8],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"textPrefix":[1,"text-prefix"],"textSuffix":[1,"text-suffix"],"readonly":[4],"required":[4],"round":[4],"type":[1],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64],"clear":[64]}],[1,"cat-pagination",{"page":[1026],"pageCount":[2,"page-count"],"activePadding":[2,"active-padding"],"sidePadding":[2,"side-padding"],"size":[1],"variant":[1],"round":[4],"compact":[4],"iconPrev":[1,"icon-prev"],"iconNext":[1,"icon-next"]}],[1,"cat-tabs",{"activeTab":[1,"active-tab"],"tabsAlign":[1,"tabs-align"],"tabs":[32],"activeTabId":[32]},[[0,"keydown","onKeydown"]]],[1,"cat-alert",{"color":[513],"icon":[1],"noIcon":[4,"no-icon"]}],[1,"cat-badge",{"variant":[513],"color":[513],"size":[513],"round":[516],"pulse":[516]}],[1,"cat-card"],[1,"cat-form-group",{"requiredMarker":[1,"required-marker"]}],[1,"cat-label",{"requiredMarker":[1,"required-marker"],"for":[1],"required":[4]}],[1,"cat-radio",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-radio-group",{"name":[1],"value":[1025],"disabled":[4],"a11yLabel":[1,"a11y-label"],"labelLeft":[4,"label-left"]},[[0,"keydown","onKeydown"],[0,"input","onInput"],[2,"blur","onBlur"]]],[1,"cat-tab",{"label":[513],"icon":[513],"iconOnly":[520,"icon-only"],"iconRight":[516,"icon-right"],"url":[513],"urlTarget":[513,"url-target"],"deactivated":[516]},[[0,"click","onClick"]]],[1,"cat-textarea",{"requiredMarker":[1,"required-marker"],"disabled":[4],"hint":[1],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"maxLength":[2,"max-length"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"value":[1032],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-toggle",{"checked":[1028],"disabled":[4],"identifier":[1],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-tooltip",{"content":[1],"disabled":[4],"placement":[1],"round":[4],"size":[1],"showDelay":[2,"show-delay"],"hideDelay":[2,"hide-delay"],"longTouchDuration":[2,"long-touch-duration"]},[[0,"keydown","handleKeyDown"]]],[1,"cat-select",{"requiredMarker":[1,"required-marker"],"multiple":[4],"debounce":[2],"placement":[1],"value":[1025],"disabled":[4],"placeholder":[1],"hint":[1],"identifier":[1],"label":[1],"name":[1],"labelHidden":[4,"label-hidden"],"required":[4],"clearable":[4],"tags":[4],"tagHint":[1,"tag-hint"],"noItems":[1,"no-items"],"connector":[32],"state":[32],"hasSlottedLabel":[32],"connect":[64]},[[0,"blur","onBlur"],[0,"keydown","onKeyDown"],[0,"keyup","onKeyUp"]]],[1,"cat-dropdown",{"placement":[1],"noAutoClose":[4,"no-auto-close"],"overflow":[4],"close":[64]},[[0,"catClick","clickHandler"]]],[1,"cat-avatar",{"size":[1],"round":[4],"label":[1],"initials":[1],"src":[1],"icon":[1],"url":[1],"urlTarget":[1,"url-target"],"backgroundImage":[32]}],[1,"cat-checkbox",{"checked":[1028],"disabled":[4],"identifier":[1],"indeterminate":[4],"label":[1],"labelHidden":[4,"label-hidden"],"name":[1],"required":[4],"value":[1032],"hint":[1],"labelLeft":[4,"label-left"],"hasSlottedLabel":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]}],[1,"cat-scrollable",{"noShadowX":[4,"no-shadow-x"],"noShadowY":[4,"no-shadow-y"],"noOverflowX":[4,"no-overflow-x"],"noOverflowY":[4,"no-overflow-y"],"noOverscroll":[4,"no-overscroll"],"noScrolledInit":[4,"no-scrolled-init"],"scrolledBuffer":[2,"scrolled-buffer"]}],[1,"cat-skeleton",{"effect":[1],"variant":[1],"size":[1],"lines":[2]}],[1,"cat-button",{"variant":[1],"color":[1],"active":[4],"size":[1],"name":[1],"value":[1],"disabled":[4],"loading":[4],"submit":[4],"noEllipsis":[4,"no-ellipsis"],"round":[4],"url":[1],"urlTarget":[1,"url-target"],"icon":[1],"iconSrc":[1,"icon-src"],"iconOnly":[8,"icon-only"],"iconRight":[4,"icon-right"],"buttonId":[1,"button-id"],"a11yLabel":[1,"a11y-label"],"a11yCurrent":[1,"a11y-current"],"_iconOnly":[32],"doFocus":[64],"doBlur":[64],"doClick":[64]},[[0,"click","haltDisabledEvents"]]],[1,"cat-spinner",{"size":[1],"a11yLabel":[1,"a11y-label"]}],[1,"cat-icon",{"icon":[1],"iconSrc":[1,"icon-src"],"size":[1],"a11yLabel":[1,"a11y-label"]}]]],["cat-modal.cjs",[[1,"cat-modal",{"size":[1],"isVisible":[32],"show":[64]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -166,20 +166,20 @@ export class CatButton {
166
166
  }
167
167
  }
168
168
  get isIconButton() {
169
- return Boolean(this.icon) && this._iconOnly;
169
+ return (Boolean(this.icon) || Boolean(this.iconSrc)) && this._iconOnly;
170
170
  }
171
171
  get hasPrefixIcon() {
172
- return Boolean(this.icon) && !this._iconOnly && !this.iconRight;
172
+ return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && !this.iconRight;
173
173
  }
174
174
  get hasSuffixIcon() {
175
- return Boolean(this.icon) && !this._iconOnly && this.iconRight;
175
+ return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && this.iconRight;
176
176
  }
177
177
  get content() {
178
178
  return [
179
- this.hasPrefixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "prefix" }) : null,
180
- this.isIconButton ? (h("cat-icon", { icon: this.icon, size: this.iconSize })) : (h("span", { class: "cat-button-content", part: "content" },
179
+ this.hasPrefixIcon ? (h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize, part: "prefix" })) : null,
180
+ this.isIconButton ? (h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize })) : (h("span", { class: "cat-button-content", part: "content" },
181
181
  h("slot", null))),
182
- this.hasSuffixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "suffix" }) : null,
182
+ this.hasSuffixIcon ? (h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize, part: "suffix" })) : null,
183
183
  this.loading ? h("cat-spinner", { size: this.spinnerSize }) : null
184
184
  ];
185
185
  }
@@ -448,6 +448,23 @@ export class CatButton {
448
448
  "attribute": "icon",
449
449
  "reflect": false
450
450
  },
451
+ "iconSrc": {
452
+ "type": "string",
453
+ "mutable": false,
454
+ "complexType": {
455
+ "original": "string",
456
+ "resolved": "string | undefined",
457
+ "references": {}
458
+ },
459
+ "required": false,
460
+ "optional": true,
461
+ "docs": {
462
+ "tags": [],
463
+ "text": "The SVG source of an icon to be displayed in the button. This takes\nprecenedence over the `icon` name."
464
+ },
465
+ "attribute": "icon-src",
466
+ "reflect": false
467
+ },
451
468
  "iconOnly": {
452
469
  "type": "any",
453
470
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;EALtB;IAWW,cAAS,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACK,YAAO,GAAmC,UAAU,CAAC;IAE7D;;OAEG;IACK,UAAK,GAA+D,WAAW,CAAC;IAExF;;OAEG;IACK,WAAM,GAAG,KAAK,CAAC;IAEvB;;OAEG;IACK,SAAI,GAAkC,GAAG,CAAC;IAgBlD;;;OAGG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;;;OAIG;IACK,YAAO,GAAG,KAAK,CAAC;IAExB;;OAE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EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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 * Set the button into an active state.\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 /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: 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 * Programmatically move focus to the button. Use this method instead of\n * `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\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 aria-current={this.a11yCurrent}\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,\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 aria-current={this.a11yCurrent}\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 ? <cat-icon icon={this.icon} size={this.iconSize} part=\"prefix\"></cat-icon> : 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 ? <cat-icon icon={this.icon} size={this.iconSize} part=\"suffix\"></cat-icon> : 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"]}
1
+ {"version":3,"file":"cat-button.js","sourceRoot":"","sources":["../../../src/components/cat-button/cat-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;GAQG;AAMH,MAAM,OAAO,SAAS;EALtB;IAWW,cAAS,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACK,YAAO,GAAmC,UAAU,CAAC;IAE7D;;OAEG;IACK,UAAK,GAA+D,WAAW,CAAC;IAExF;;OAEG;IACK,WAAM,GAAG,KAAK,CAAC;IAEvB;;OAEG;IACK,SAAI,GAAkC,GAAG,CAAC;IAgBlD;;;OAGG;IACK,aAAQ,GAAG,KAAK,CAAC;IAEzB;;;;OAIG;IACK,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,CAAC,IAAI;KAC1E,CAAC;EACJ,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,OAAO,CAAC,KAAiB;IAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC5B,CAAC;EAEO,MAAM,CAAC,KAAiB;IAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, 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 * Set the button into an active state.\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 * The SVG source of an icon to be displayed in the button. This takes\n * precenedence over the `icon` name.\n */\n @Prop() iconSrc?: 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 /**\n * Sets the `aria-current` attribute on the button.\n */\n @Prop({ attribute: 'a11y-current' }) a11yCurrent?: 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 * Programmatically move focus to the button. Use this method instead of\n * `button.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this.button.focus(options);\n }\n\n /**\n * Programmatically remove focus from the button. Use this method instead of\n * `button.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.button.blur();\n }\n\n /**\n * Programmatically simulate a click on the button.\n */\n @Method()\n async doClick(): Promise<void> {\n this.button.click();\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 aria-current={this.a11yCurrent}\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,\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 aria-current={this.a11yCurrent}\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) || Boolean(this.iconSrc)) && this._iconOnly;\n }\n\n private get hasPrefixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && !this.iconRight;\n }\n\n private get hasSuffixIcon() {\n return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && this.iconRight;\n }\n\n private get content() {\n return [\n this.hasPrefixIcon ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} size={this.iconSize} part=\"prefix\"></cat-icon>\n ) : null,\n this.isIconButton ? (\n <cat-icon icon={this.icon} iconSrc={this.iconSrc} 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} iconSrc={this.iconSrc} size={this.iconSize} 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"]}
@@ -8,17 +8,13 @@ import { catIconRegistry as icons } from './cat-icon-registry';
8
8
  */
9
9
  export class CatIcon {
10
10
  constructor() {
11
- /**
12
- * The name of the icon.
13
- */
14
- this.icon = '';
15
11
  /**
16
12
  * The size of the icon.
17
13
  */
18
14
  this.size = 'm';
19
15
  }
20
16
  render() {
21
- return (h("span", { innerHTML: icons.getIcon(this.icon), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
17
+ return (h("span", { innerHTML: this.iconSrc || (this.icon ? icons.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
22
18
  icon: true,
23
19
  [`icon-${this.size}`]: this.size !== 'inline'
24
20
  } }));
@@ -37,18 +33,34 @@ export class CatIcon {
37
33
  "mutable": false,
38
34
  "complexType": {
39
35
  "original": "string",
40
- "resolved": "string",
36
+ "resolved": "string | undefined",
41
37
  "references": {}
42
38
  },
43
39
  "required": false,
44
- "optional": false,
40
+ "optional": true,
45
41
  "docs": {
46
42
  "tags": [],
47
43
  "text": "The name of the icon."
48
44
  },
49
45
  "attribute": "icon",
50
- "reflect": false,
51
- "defaultValue": "''"
46
+ "reflect": false
47
+ },
48
+ "iconSrc": {
49
+ "type": "string",
50
+ "mutable": false,
51
+ "complexType": {
52
+ "original": "string",
53
+ "resolved": "string | undefined",
54
+ "references": {}
55
+ },
56
+ "required": false,
57
+ "optional": true,
58
+ "docs": {
59
+ "tags": [],
60
+ "text": "The SVG source of the icon. This takes precenedence over the `icon` name."
61
+ },
62
+ "attribute": "icon-src",
63
+ "reflect": false
52
64
  },
53
65
  "size": {
54
66
  "type": "string",
@@ -1 +1 @@
1
- {"version":3,"file":"cat-icon.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,eAAe,IAAI,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;GAKG;AAMH,MAAM,OAAO,OAAO;EALpB;IAME;;OAEG;IACK,SAAI,GAAG,EAAE,CAAC;IAElB;;OAEG;IACK,SAAI,GAA6C,GAAG,CAAC;GAsB9D;EAdC,MAAM;IACJ,OAAO,CACL,YACE,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBACvB,IAAI,CAAC,SAAS,iBACb,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAC3C,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,CAAC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;OAC9C,GACK,CACT,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { catIconRegistry as icons } from './cat-icon-registry';\n\n/**\n * Icons are used to provide additional meaning or in places where text label\n * doesn't fit.\n *\n * @part icon - The span element wrapping the SVG icon.\n */\n@Component({\n tag: 'cat-icon',\n styleUrl: 'cat-icon.scss',\n shadow: true\n})\nexport class CatIcon {\n /**\n * The name of the icon.\n */\n @Prop() icon = '';\n\n /**\n * The size of the icon.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the icon that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <span\n innerHTML={icons.getIcon(this.icon)}\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n part=\"icon\"\n class={{\n icon: true,\n [`icon-${this.size}`]: this.size !== 'inline'\n }}\n ></span>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cat-icon.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,eAAe,IAAI,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;GAKG;AAMH,MAAM,OAAO,OAAO;EALpB;IAgBE;;OAEG;IACK,SAAI,GAA6C,GAAG,CAAC;GAsB9D;EAdC,MAAM;IACJ,OAAO,CACL,YACE,SAAS,EAAE,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,gBAC1D,IAAI,CAAC,SAAS,iBACb,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAC3C,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,CAAC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;OAC9C,GACK,CACT,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { catIconRegistry as icons } from './cat-icon-registry';\n\n/**\n * Icons are used to provide additional meaning or in places where text label\n * doesn't fit.\n *\n * @part icon - The span element wrapping the SVG icon.\n */\n@Component({\n tag: 'cat-icon',\n styleUrl: 'cat-icon.scss',\n shadow: true\n})\nexport class CatIcon {\n /**\n * The name of the icon.\n */\n @Prop() icon?: string;\n\n /**\n * The SVG source of the icon. This takes precenedence over the `icon` name.\n */\n @Prop() iconSrc?: string;\n\n /**\n * The size of the icon.\n */\n @Prop() size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'inline' = 'm';\n\n /**\n * Adds accessible label for the icon that is only shown for screen\n * readers. The `aria-hidden` attribute will be set if no label is present.\n */\n @Prop({ attribute: 'a11y-label' }) a11yLabel?: string;\n\n render() {\n return (\n <span\n innerHTML={this.iconSrc || (this.icon ? icons.getIcon(this.icon) : '')}\n aria-label={this.a11yLabel}\n aria-hidden={this.a11yLabel ? null : 'true'}\n part=\"icon\"\n class={{\n icon: true,\n [`icon-${this.size}`]: this.size !== 'inline'\n }}\n ></span>\n );\n }\n}\n"]}
@@ -17,7 +17,7 @@
17
17
  right: 0;
18
18
  bottom: 0;
19
19
  left: 0;
20
- background-color: rgb(rgb(var(--cat-bg-backdrop, 0, 0, 0)), var(--cat-opacity-backdrop, 0.6));
20
+ background-color: rgb(rgb(var(--cat-bg-backdrop, 27, 31, 38)), var(--cat-opacity-backdrop, 0.4));
21
21
  z-index: 2;
22
22
  display: flex;
23
23
  }
@@ -23,6 +23,7 @@
23
23
 
24
24
  catIconRegistry.addIcons(ci);
25
25
  catI18nRegistry.set({
26
+ 'dialog.close': 'Close',
26
27
  'input.clear': 'Clear',
27
28
  'input.optional': 'Optional',
28
29
  'input.required': 'Required',
@@ -49,7 +49,7 @@
49
49
 
50
50
  @function cat-token-wrap($value, $alpha: 1) {
51
51
  @if meta.type-of($value) == 'string' {
52
- @if $alpha < 1 {
52
+ @if meta.type-of($alpha) != 'number' or $alpha < 1 {
53
53
  @return rgba($value, $alpha);
54
54
  } @else {
55
55
  @return rgb($value);
@@ -80,7 +80,7 @@
80
80
  @if string.index($key, 'color.') == 1 {
81
81
  @if $wrap {
82
82
  @return cat-token-wrap($value, $alpha);
83
- } @else if $alpha < 1 {
83
+ } @else if meta.type-of($alpha) != 'number' or $alpha < 1 {
84
84
  @return $value, $alpha;
85
85
  }
86
86
  }
@@ -0,0 +1,66 @@
1
+ @use '../variables' as *;
2
+ @use '../mixins' as *;
3
+
4
+ /**
5
+ * Dialog makes assumptions about the DOM structure of the dialog content.
6
+ * The following selectors are used to style the dialog content based on its
7
+ * position in the DOM hierarchy.
8
+ *
9
+ * .cat-backdrop
10
+ * |- .cat-dialog
11
+ * |- .cat-dialog-header
12
+ * |- .cat-dialog-header-content
13
+ * |- .cat-dialog-content
14
+ * |- .cat-dialog-actions
15
+ **/
16
+
17
+ $-dialog-padding: 1.5rem;
18
+
19
+ .cat-backdrop {
20
+ background-color: cat-token('color.ui.background.backdrop', cat-token('opacity.backdrop'));
21
+ }
22
+
23
+ .cat-dialog {
24
+ background-color: cat-token('color.ui.background.body');
25
+ border-radius: cat-border-radius('l');
26
+ @include cat-elevation(7);
27
+ container: dialog / inline-size;
28
+ }
29
+
30
+ .cat-dialog-header {
31
+ display: flex;
32
+ align-items: center;
33
+ gap: 1rem;
34
+ padding: $-dialog-padding;
35
+ }
36
+
37
+ .cat-dialog-header-content {
38
+ flex: 1 1 auto;
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 0.5rem;
42
+ word-wrap: break-word;
43
+ word-break: break-word;
44
+ }
45
+
46
+ .cat-dialog-content {
47
+ overflow: auto;
48
+ padding: 0 $-dialog-padding;
49
+
50
+ > *:last-child {
51
+ margin-bottom: 0;
52
+ }
53
+ }
54
+
55
+ .cat-dialog-actions {
56
+ display: flex;
57
+ padding: $-dialog-padding;
58
+ gap: 0.5rem;
59
+ flex-wrap: wrap;
60
+
61
+ @container dialog (max-width: 360px) {
62
+ cat-button {
63
+ width: 100%;
64
+ }
65
+ }
66
+ }
@@ -10,6 +10,7 @@
10
10
 
11
11
  // -- Core
12
12
  @import 'core/base';
13
+ @import 'core/dialog';
13
14
  @import 'core/form';
14
15
  @import 'core/nav';
15
16
  @import 'core/notification';
@@ -3,6 +3,7 @@
3
3
  // ---- Responsive
4
4
 
5
5
  @mixin until($size, $media-type: screen) {
6
+ @debug 'until', $size;
6
7
  @media #{$media-type} and (max-width: #{cat-token('size.screen.#{$size}') - 1px}) {
7
8
  @content;
8
9
  }
@@ -281,19 +281,19 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
281
281
  }
282
282
  }
283
283
  get isIconButton() {
284
- return Boolean(this.icon) && this._iconOnly;
284
+ return (Boolean(this.icon) || Boolean(this.iconSrc)) && this._iconOnly;
285
285
  }
286
286
  get hasPrefixIcon() {
287
- return Boolean(this.icon) && !this._iconOnly && !this.iconRight;
287
+ return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && !this.iconRight;
288
288
  }
289
289
  get hasSuffixIcon() {
290
- return Boolean(this.icon) && !this._iconOnly && this.iconRight;
290
+ return (Boolean(this.icon) || Boolean(this.iconSrc)) && !this._iconOnly && this.iconRight;
291
291
  }
292
292
  get content() {
293
293
  return [
294
- this.hasPrefixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "prefix" }) : null,
295
- this.isIconButton ? (h("cat-icon", { icon: this.icon, size: this.iconSize })) : (h("span", { class: "cat-button-content", part: "content" }, h("slot", null))),
296
- this.hasSuffixIcon ? h("cat-icon", { icon: this.icon, size: this.iconSize, part: "suffix" }) : null,
294
+ this.hasPrefixIcon ? (h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize, part: "prefix" })) : null,
295
+ this.isIconButton ? (h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize })) : (h("span", { class: "cat-button-content", part: "content" }, h("slot", null))),
296
+ this.hasSuffixIcon ? (h("cat-icon", { icon: this.icon, iconSrc: this.iconSrc, size: this.iconSize, part: "suffix" })) : null,
297
297
  this.loading ? h("cat-spinner", { size: this.spinnerSize }) : null
298
298
  ];
299
299
  }
@@ -325,6 +325,7 @@ const CatButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
325
325
  "url": [1],
326
326
  "urlTarget": [1, "url-target"],
327
327
  "icon": [1],
328
+ "iconSrc": [1, "icon-src"],
328
329
  "iconOnly": [8, "icon-only"],
329
330
  "iconRight": [4, "icon-right"],
330
331
  "buttonId": [1, "button-id"],