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,EAAE,CAAC;IAC3D,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAEjE,QACI,EAAC,KAAK,kBACF,KAAK,EAAE;QACH,2BAA2B,EAAE,IAAI;QACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;OACxB,IACG,KAAK,GAET,YACI,KAAK,EAAE;QACH,kBAAkB,EAAE,IAAI;QACxB,0BAA0B,EAAE,aAAa;OAC5C,IAED,YAAM,IAAI,EAAC,MAAM,IACZ,IAAI,CAAC,IAAI,IAAI,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,GAAa,CACjD,CACJ,EACP,YAAM,KAAK,EAAC,mBAAmB,IAC3B,gBAAO,IAAI,CAAC,KAAK,CAAQ,CACtB,EACN,IAAI,CAAC,OAAO,KACT,YAAM,KAAK,EAAC,qBAAqB,IAC5B,iBAAiB,EAAE,CACjB,CACV,CACG,EACV;GACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"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\nexport const ProgressAnimation = () => (\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, h, Prop, ComponentInterface, Element } from \"@stencil/core\";\nimport { ProgressAnimation } from \"../icons\";\n\nexport type ButtonVariant =\n | \"content\"\n | \"content-primary\"\n | \"footer\"\n | \"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 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() 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 }) variant: ButtonVariant = \"content\";\n\n /**\n * If set to `true`, the user cannot interact with the button.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * If set to `true`, the button is considered selected or toggled.\n */\n @Prop({ reflect: true }) selected = false;\n\n /**\n * The size of the button.\n * Use `icon` for a button with just an icon.\n */\n @Prop({ reflect: true }) size: ButtonSize = \"default\";\n\n /**\n * If set to `true`, the button is currently loading.\n */\n @Prop({ reflect: true }) loading = 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 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 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 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 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 \n {this.icon && }\n \n \n \n {this.label}\n \n {this.loading && (\n \n {ProgressAnimation()}\n \n )}\n \n );\n }\n}\n"],"version":3}