{"version":3,"names":["ProgressAnimation","h","width","height","viewBox","version","xmlns","stroke","fill","d","opacity","attributeName","from","to","dur","begin","repeatCount","buttonCss","Button","tabIndex","this","disabled","hasTabIndex","host","hasAttribute","getAttribute","render","Proxy","href","props","target","download","hasCustomIcon","querySelector","Object","assign","class","selected","loading","name","icon","label"],"sources":["src/components/icons/animated-loading.tsx","src/components/button/button.scss?tag=uic-button","src/components/button/button.tsx"],"sourcesContent":["import { h } from \"@stencil/core\";\n/* eslint-disable */\nexport const ProgressAnimation = () => (\n \n animated-loading\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n \n);\n","@import \"variants\";\n\n/**\n @prop --uic-button-min-width: min-width of the default button\n @prop --uic-button-height: height of the default button\n @prop --uic-icon-button-width: width of the icon-sized button\n @prop --uic-icon-button-height: height of the icon-sized button\n @prop --uic-stretched-button-width: width of the stretched-sized button\n @prop --uic-stretched-button-height: height of the stretched-sized button\n*/\n\nuic-button {\n display: inline-block;\n box-sizing: border-box;\n position: relative;\n padding: 8px;\n\n .uic-button__native-button {\n @include font(normal, bold);\n width: 100%;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n position: relative;\n border-radius: 0;\n border: 1px solid transparent;\n padding: 0 16px;\n outline: 2px solid transparent;\n outline-offset: -2px;\n user-select: none;\n cursor: pointer;\n text-decoration: none;\n // prevent distracting highlight when pressing\n -webkit-tap-highlight-color: transparent;\n\n .uic-button__loading {\n height: 100%;\n position: relative;\n }\n\n &.loading {\n pointer-events: none;\n\n .uic-button__label,\n .uic-button__icon {\n display: none;\n }\n\n svg {\n width: auto; // Added for safari. Else SVG has full width.\n }\n }\n\n &::before {\n @include absolute();\n content: \"\";\n background: transparent;\n }\n\n &:disabled {\n font-weight: normal;\n pointer-events: none;\n }\n }\n\n .uic-button__label {\n @include truncate();\n }\n\n &[loading],\n &[disabled]:not([disabled=\"false\"]) {\n pointer-events: none;\n }\n}\n\nuic-button[size=\"default\"] .uic-button__native-button {\n min-width: var(--uic-button-min-width);\n height: var(--uic-button-height);\n}\n\nuic-button[size=\"icon\"] .uic-button__native-button {\n width: var(--uic-icon-button-width);\n height: var(--uic-icon-button-height);\n padding: 0;\n}\n\nuic-button[size=\"icon-stretched\"] .uic-button__native-button {\n width: var(--uic-stretched-button-width);\n height: var(--uic-stretched-button-height);\n padding: 0;\n}\n\n// SLOT SUPPORT\n\nuic-button slot-fb {\n display: flex;\n}\n\nuic-button[size=\"default\"] .uic-button__icon--custom,\nuic-button[size=\"default\"][icon] .uic-button__icon {\n margin-right: 8px;\n}\n\n.uic-button__icon--custom {\n width: var(--uic-icon-width);\n height: var(--uic-icon-height);\n\n svg {\n width: 100%;\n height: 100%;\n }\n}\n","import { Component, ComponentInterface, Element, h, Prop } from \"@stencil/core\";\nimport { ProgressAnimation } from \"../icons\";\n\nexport type ButtonVariant = \"content\" | \"content-primary\" | \"footer\" | \"footer-primary\";\n\nexport type ButtonSize = \"icon\" | \"icon-stretched\" | \"default\";\n\n/**\n * @slot - Content is placed inside the button if provided without a slot name\n * @slot icon - Should be used to place a custom icon\n */\n@Component({\n tag: \"uic-button\",\n styleUrl: \"button.scss\"\n})\nexport class Button implements ComponentInterface {\n @Element() host: HTMLUicButtonElement;\n\n /**\n * The name of the icon to show next to the label.\n */\n @Prop()\n readonly icon?: string;\n\n /**\n * The text shown inside the button.\n * Please prefer the use of the default slot (content within the button element).\n * Becasue of a bug (https://github.com/ionic-team/stencil/issues/2054),\n * this text may not be visible when nesting button within other elements even if there is not default slot for the button.\n */\n @Prop() readonly label?: string;\n\n /**\n * The color variant to use. You can choose between color schemes that are suited for content or footer areas.\n * Use the `primary` variants to show visually more pronounced versions of these schemes.\n */\n @Prop({ reflect: true }) readonly variant: ButtonVariant = \"content\";\n\n /**\n * If set to `true`, the user cannot interact with the button.\n */\n @Prop({ reflect: true }) readonly disabled: boolean = false;\n\n /**\n * If set to `true`, the button is considered selected or toggled.\n */\n @Prop({ reflect: true }) readonly selected: boolean = false;\n\n /**\n * The size of the button.\n * Use `icon` for a button with just an icon.\n */\n @Prop({ reflect: true }) readonly size: ButtonSize = \"default\";\n\n /**\n * If set to `true`, the button is currently loading.\n */\n @Prop({ reflect: true }) readonly loading: boolean = false;\n\n /**\n * If a value is set, an tag with the specified href will be rendered instead of a button.\n */\n @Prop()\n readonly href?: string;\n\n /**\n * If the `href` value is set, this value will be used for target attribute of the tag.\n */\n @Prop()\n readonly target?: string;\n\n /**\n * If the `href` value is set, this value will be used for download attribute of the tag.\n */\n @Prop()\n readonly download?: string;\n\n private get tabIndex() {\n if (this.disabled) {\n return -1;\n }\n const hasTabIndex = this.host.hasAttribute(\"tabindex\");\n\n if (hasTabIndex) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return this.host.getAttribute(\"tabindex\") as any;\n }\n\n return 0;\n }\n\n render() {\n const Proxy = this.href ? \"a\" : \"button\";\n const props = this.href\n ? { href: this.href, target: this.target, download: this.download }\n : { tabIndex: this.tabIndex, disabled: this.disabled };\n const hasCustomIcon = !!this.host.querySelector(\"[slot='icon']\");\n\n return (\n \n \n {this.icon && }\n \n \n {this.label}\n \n {this.loading && {ProgressAnimation()}}\n \n );\n }\n}\n"],"mappings":"kDAEO,MAAMA,EAAoB,IAC7BC,EAAA,OAAKC,MAAM,OAAOC,OAAO,OAAOC,QAAQ,YAAYC,QAAQ,MAAMC,MAAM,8BACpEL,EAAA,iCACAA,EAAA,KAAGM,OAAO,OAAM,eAAc,IAAIC,KAAK,OAAM,YAAW,WACpDP,EAAA,QACIQ,EAAE,+MACFD,KAAK,eACLE,QAAQ,KAERT,EAAA,WAASU,cAAc,UAAUC,KAAK,IAAIC,GAAG,IAAIC,IAAI,OAAOC,MAAM,QAAQC,YAAY,gBAG1Ff,EAAA,QACIQ,EAAE,gVACFD,KAAK,eACLE,QAAQ,KAERT,EAAA,WAASU,cAAc,UAAUC,KAAK,IAAIC,GAAG,IAAIC,IAAI,OAAOC,MAAM,KAAKC,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