@rededor/cura 0.3.6 → 0.3.8
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.
- package/dist/cjs/{app-globals-a41d7f40.js → app-globals-ecab0d49.js} +43 -80
- package/dist/cjs/app-globals-ecab0d49.js.map +1 -0
- package/dist/cjs/cura-button_9.cjs.entry.js +519 -0
- package/dist/cjs/cura-button_9.cjs.entry.js.map +1 -0
- package/dist/cjs/cura.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/api/modules/cura-theme-colors-module.js +7 -2
- package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
- package/dist/collection/api/theme-presets/static.js +20 -62
- package/dist/collection/api/theme-presets/static.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-maternity.js +15 -15
- package/dist/collection/api/theme-presets/theme-maternity.js.map +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/buttons/cura-button/cura-button.css +128 -125
- package/dist/collection/components/buttons/cura-button/cura-button.js +36 -33
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +220 -0
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +308 -0
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +204 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +308 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.css +33 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +77 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js.map +1 -0
- package/dist/collection/components/text/cura-display/cura-display.js +3 -3
- package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +3 -3
- package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +3 -3
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
- package/dist/components/cura-button-outline.d.ts +11 -0
- package/dist/components/cura-button-outline.js +123 -0
- package/dist/components/cura-button-outline.js.map +1 -0
- package/dist/components/cura-button-transparent.d.ts +11 -0
- package/dist/components/cura-button-transparent.js +123 -0
- package/dist/components/cura-button-transparent.js.map +1 -0
- package/dist/components/cura-button.js +28 -18
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-display.js +3 -3
- package/dist/components/cura-display.js.map +1 -1
- package/dist/components/cura-heading.js +3 -3
- package/dist/components/cura-heading.js.map +1 -1
- package/dist/components/cura-loader-circle.d.ts +11 -0
- package/dist/components/cura-loader-circle.js +8 -0
- package/dist/components/cura-loader-circle.js.map +1 -0
- package/dist/components/cura-loader-circle2.js +51 -0
- package/dist/components/cura-loader-circle2.js.map +1 -0
- package/dist/components/cura-paragraph.js +3 -3
- package/dist/components/cura-paragraph.js.map +1 -1
- package/dist/components/index.js +48 -79
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/cura.js +1 -1
- package/dist/cura/p-25345c98.system.entry.js +2 -0
- package/dist/cura/p-25345c98.system.entry.js.map +1 -0
- package/dist/cura/p-57041fe8.js +2 -0
- package/dist/cura/p-57041fe8.js.map +1 -0
- package/dist/cura/p-ae80dcbd.system.js +2 -0
- package/dist/cura/p-ae80dcbd.system.js.map +1 -0
- package/dist/cura/p-bb730a40.entry.js +2 -0
- package/dist/cura/p-bb730a40.entry.js.map +1 -0
- package/dist/cura/p-fb838a73.system.js +2 -0
- package/dist/cura/p-fb838a73.system.js.map +1 -0
- package/dist/esm/{app-globals-8ed931e6.js → app-globals-51eaad0e.js} +43 -80
- package/dist/esm/app-globals-51eaad0e.js.map +1 -0
- package/dist/esm/cura-button_9.entry.js +507 -0
- package/dist/esm/cura-button_9.entry.js.map +1 -0
- package/dist/esm/cura.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm-es5/app-globals-51eaad0e.js +2 -0
- package/dist/esm-es5/app-globals-51eaad0e.js.map +1 -0
- package/dist/esm-es5/cura-button_9.entry.js +2 -0
- package/dist/esm-es5/cura-button_9.entry.js.map +1 -0
- package/dist/esm-es5/cura.js +1 -1
- package/dist/esm-es5/cura.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/types/api/theme-presets/static.d.ts +20 -40
- package/dist/types/components/buttons/cura-button/cura-button.d.ts +6 -4
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +61 -0
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +61 -0
- package/dist/types/components/loaders/cura-loader-circle/cura-loader-circle.d.ts +23 -0
- package/dist/types/components.d.ts +251 -4
- package/package.json +2 -2
- package/dist/cjs/app-globals-a41d7f40.js.map +0 -1
- package/dist/cjs/cura-button_6.cjs.entry.js +0 -336
- package/dist/cjs/cura-button_6.cjs.entry.js.map +0 -1
- package/dist/cura/p-36c8b693.system.js +0 -2
- package/dist/cura/p-36c8b693.system.js.map +0 -1
- package/dist/cura/p-4e3b7ddf.entry.js +0 -2
- package/dist/cura/p-4e3b7ddf.entry.js.map +0 -1
- package/dist/cura/p-4fc49972.system.js +0 -2
- package/dist/cura/p-4fc49972.system.js.map +0 -1
- package/dist/cura/p-8cd9f935.system.entry.js +0 -2
- package/dist/cura/p-8cd9f935.system.entry.js.map +0 -1
- package/dist/cura/p-bac0b4ab.js +0 -2
- package/dist/cura/p-bac0b4ab.js.map +0 -1
- package/dist/esm/app-globals-8ed931e6.js.map +0 -1
- package/dist/esm/cura-button_6.entry.js +0 -327
- package/dist/esm/cura-button_6.entry.js.map +0 -1
- package/dist/esm-es5/app-globals-8ed931e6.js +0 -2
- package/dist/esm-es5/app-globals-8ed931e6.js.map +0 -1
- package/dist/esm-es5/cura-button_6.entry.js +0 -2
- package/dist/esm-es5/cura-button_6.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-display.js","sourceRoot":"","sources":["../../../../src/components/text/cura-display/cura-display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAOlE,MAAM,OAAO,WAAW;;iBAMS,CAAC;gBAKF,SAAS;oBAKL,KAAK;qBAKJ,SAAS;;EAa3C,iBAAiB;IAChB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACvD,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzB,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;EAED,UAAU;IACR,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAI,IAAI,CAAC;IACzC,OAAO,OAAO,CAAC;EACjB,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,MAAM,GAAG;MACZ,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;MAChE,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE;MACnD,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;MACvC,qBAAqB,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;KAC1C,CAAA;IACD,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,IAAI,CAAC,eAAe,CAAC,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,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;QAAE,eAAa,CAAK;MACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;QAAE,eAAa,CAAK;MACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;QAAE,eAAa,CAAK;MACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;QAAE,eAAa,CAAK;MACzE,SAAS,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;QAAE,eAAa,CAAK;KAChF,CAAC;IACF,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;EAClD,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,QACD,IAAI,CAAC,aAAa,EAAE,CACjB,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Element, Prop } from '@stencil/core';\n\n@Component({\n tag: 'cura-display',\n styleUrl: 'cura-display.scss',\n shadow: true,\n})\nexport class CuraDisplay {\n\n /**\n * Heading level for semantics.\n * Values: 1(default)-6.\n */\n @Prop({reflect: true}) level = 1;\n /**\n * Heading style size.\n * Values: small | regular(default) | large.\n */\n @Prop({reflect: true}) size = 'regular';\n /**\n * Apply light color to text in dark background.\n * Values: boolean.\n */\n @Prop({reflect: true}) inverted = false;\n /**\n * Apply base system color to elements like <a> and <abbr>.\n * Values: String primary(default) | secondary | accent | neutral | success | error | warning | info.\n */\n @Prop({reflect: true}) spotColor = 'primary';\n \n /**\n * Host element <cura-heading>\n */\n @Element() host: HTMLElement;\n \n /**\n * Internal Props\n */\n weights: any;\n styles: any;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.setFontProperties();\n this.setColors();\n }\n\n getClasses() {\n const classes = {};\n classes[this.size.toLowerCase()] = true;\n return classes;\n }\n\n setFontProperties() {\n this.styles = {\n '--font-family': window.CuraAPI.theme.fonts.getFamily('display'),\n '--font-size': window.CuraAPI.theme.fonts.getSize(),\n '--font-weight-bold': this.weights.bold,\n '--font-weight-black': this.weights.black\n }\n this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());\n this.setHostProperty('--block-margin', '0.5em');\n }\n\n setColors() {\n const fontColor = this.inverted \n ? window.CuraAPI.theme.colors.getColor('neutral-white') \n : window.CuraAPI.theme.fonts.getColor();\n this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');\n this.styles['--color-link'] = this.inverted \n ? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)\n : window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`);\n }\n\n setHostProperty(prop: string, value: string) {\n this.host.style.setProperty(prop, value);\n }\n\n getHeadingTag() {\n const tags = {\n '1': <h1 style={this.styles} class={this.getClasses()}><slot></slot></h1>,\n '2': <h2 style={this.styles} class={this.getClasses()}><slot></slot></h2>,\n '3': <h3 style={this.styles} class={this.getClasses()}><slot></slot></h3>,\n '4': <h4 style={this.styles} class={this.getClasses()}><slot></slot></h4>,\n '5': <h5 style={this.styles} class={this.getClasses()}><slot></slot></h5>,\n '6': <h6 style={this.styles} class={this.getClasses()}><slot></slot></h6>,\n 'default': <h1 style={this.styles} class={this.getClasses()}><slot></slot></h1>\n };\n return tags[`${this.level}`] || tags['default'];\n }\n\n render() {\n return (\n <Host>\n { this.getHeadingTag() }\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -32,12 +32,12 @@ export class CuraHeading {
|
|
|
32
32
|
}
|
|
33
33
|
setColors() {
|
|
34
34
|
const fontColor = this.inverted
|
|
35
|
-
? window.CuraAPI.theme.colors.getColor('neutral-
|
|
35
|
+
? window.CuraAPI.theme.colors.getColor('neutral-white')
|
|
36
36
|
: window.CuraAPI.theme.fonts.getColor();
|
|
37
37
|
this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');
|
|
38
38
|
this.styles['--color-link'] = this.inverted
|
|
39
|
-
? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-
|
|
40
|
-
: window.CuraAPI.theme.colors.getColor(`${this.spotColor}-
|
|
39
|
+
? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)
|
|
40
|
+
: window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`);
|
|
41
41
|
}
|
|
42
42
|
setHostProperty(prop, value) {
|
|
43
43
|
this.host.style.setProperty(prop, value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-heading.js","sourceRoot":"","sources":["../../../../src/components/text/cura-heading/cura-heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOlE,MAAM,OAAO,WAAW;;iBAMS,CAAC;gBAKF,SAAS;kBAKP,SAAS;oBAKP,KAAK;qBAKJ,SAAS;;EAa5C,iBAAiB;IACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACvD,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzB,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;EAED,UAAU;IACR,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAI,IAAI,CAAC;IACzC,OAAO,CAAC,GAAG,IAAI,CAAC,MA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CAAC,UAAU,EAAE;QAAE,eAAa,CAAK;MACzE,SAAS,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;QAAE,eAAa,CAAK;KAChF,CAAC;IACF,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;EAClD,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,QACD,IAAI,CAAC,aAAa,EAAE,CACjB,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Element } from '@stencil/core';\n\n@Component({\n tag: 'cura-heading',\n styleUrl: 'cura-heading.scss',\n shadow: true,\n})\nexport class CuraHeading {\n\n /**\n * Heading level for semantics.\n * Values: 1(default)-6.\n */\n @Prop({reflect: true}) level = 1;\n /**\n * Heading style size.\n * Values: small | regular(default) | large.\n */\n @Prop({reflect: true}) size = 'regular';\n /**\n * Heading font weight.\n * Values: regular(default) | bold.\n */\n @Prop({reflect: true}) weight = 'regular';\n /**\n * Apply light color to text in dark background.\n * Values: boolean.\n */\n @Prop({reflect: true}) inverted = false;\n /**\n * Apply base system color to elements like <a> and <abbr>.\n * Values: String primary(default) | secondary | accent | neutral | success | error | warning | info.\n */\n @Prop({reflect: true}) spotColor = 'primary';\n\n /**\n * Host element <cura-heading>\n */\n @Element() host: HTMLElement;\n\n /**\n * Internal Props\n */\n weights: any;\n styles: any;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.setFontProperties();\n this.setColors();\n }\n\n getClasses() {\n const classes = {};\n classes[this.size.toLowerCase()] = true;\n classes[`${this.weight.toLowerCase()}-weight`] = true;\n return classes;\n }\n\n setFontProperties() {\n this.styles = {\n '--font-family': window.CuraAPI.theme.fonts.getFamily('heading'),\n '--font-size': window.CuraAPI.theme.fonts.getSize(),\n '--font-weight-regular': this.weights.regular,\n '--font-weight-medium': this.weights.medium,\n '--font-weight-bold': this.weights.bold,\n '--font-weight-black': this.weights.black\n }\n this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());\n this.setHostProperty('--block-margin', '0.5em');\n }\n\n setColors() {\n const fontColor = this.inverted \n ? window.CuraAPI.theme.colors.getColor('neutral-white') \n : window.CuraAPI.theme.fonts.getColor();\n this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');\n this.styles['--color-link'] = this.inverted \n ? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)\n : window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`);\n }\n\n setHostProperty(prop: string, value: string) {\n this.host.style.setProperty(prop, value);\n }\n\n getHeadingTag() {\n const tags = {\n '1': <h1 style={this.styles} class={this.getClasses()}><slot></slot></h1>,\n '2': <h2 style={this.styles} class={this.getClasses()}><slot></slot></h2>,\n '3': <h3 style={this.styles} class={this.getClasses()}><slot></slot></h3>,\n '4': <h4 style={this.styles} class={this.getClasses()}><slot></slot></h4>,\n '5': <h5 style={this.styles} class={this.getClasses()}><slot></slot></h5>,\n '6': <h6 style={this.styles} class={this.getClasses()}><slot></slot></h6>,\n 'default': <h1 style={this.styles} class={this.getClasses()}><slot></slot></h1>\n };\n return tags[`${this.level}`] || tags['default'];\n }\n\n render() {\n return (\n <Host>\n { this.getHeadingTag() }\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -28,12 +28,12 @@ export class CuraParagraph {
|
|
|
28
28
|
}
|
|
29
29
|
setColors() {
|
|
30
30
|
const fontColor = this.inverted
|
|
31
|
-
? window.CuraAPI.theme.colors.getColor('neutral-
|
|
31
|
+
? window.CuraAPI.theme.colors.getColor('neutral-white')
|
|
32
32
|
: window.CuraAPI.theme.fonts.getColor();
|
|
33
33
|
this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');
|
|
34
34
|
this.styles['--color-link'] = this.inverted
|
|
35
|
-
? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-
|
|
36
|
-
: window.CuraAPI.theme.colors.getColor(`${this.spotColor}-
|
|
35
|
+
? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)
|
|
36
|
+
: window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`);
|
|
37
37
|
}
|
|
38
38
|
setHostProperty(prop, value) {
|
|
39
39
|
this.host.style.setProperty(prop, value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-paragraph.js","sourceRoot":"","sources":["../../../../src/components/text/cura-paragraph/cura-paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAOlE,MAAM,OAAO,aAAa;;gBAMM,SAAS;oBAKL,KAAK;qBAKJ,SAAS;;EAa5C,iBAAiB;IACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACvD,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzB,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;EAED,YAAY;IACV,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1C,OAAO,SAAS,CAAC;EACnB,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,MAAM,GAAG;MACZ,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;MAC7D,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE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,IAAI,EAAE,KAAK,CAAC,CAAC;EAC3C,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,SAAG,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE;QAC/C,eAAa,CACX,CACC,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, Prop, h, Element } from '@stencil/core';\n\n@Component({\n tag: 'cura-paragraph',\n styleUrl: 'cura-paragraph.scss',\n shadow: true,\n})\nexport class CuraParagraph {\n\n /**\n * Set size of body text.\n * Values: regular (default) | large | small | caption.\n */\n @Prop({reflect: true}) size = 'regular';\n /**\n * Apply light color to text in dark background.\n * Values: boolean.\n */\n @Prop({reflect: true}) inverted = false;\n /**\n * Apply base system color to elements like <a> and <abbr>.\n * Values: String primary(default) | secondary | accent | neutral | success | error | warning | info.\n */\n @Prop({reflect: true}) spotColor = 'primary';\n \n /**\n * Host element <cura-paragraph>\n */\n @Element() host: HTMLElement;\n\n /**\n * Internal Props\n */\n weights: any;\n styles: any;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.setFontProperties();\n this.setColors();\n }\n\n setsizeClass() {\n const sizeclass = {};\n sizeclass[this.size.toLowerCase()] = true;\n return sizeclass;\n }\n\n setFontProperties() {\n this.styles = {\n '--font-family': window.CuraAPI.theme.fonts.getFamily('body'),\n '--font-size': window.CuraAPI.theme.fonts.getSize(),\n '--font-weight-regular': this.weights.regular,\n '--font-weight-medium': this.weights.medium,\n '--font-weight-bold': this.weights.bold\n }\n this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());\n this.setHostProperty('--block-margin', '1.25em');\n }\n\n setColors() {\n const fontColor = this.inverted \n ? window.CuraAPI.theme.colors.getColor('neutral-white') \n : window.CuraAPI.theme.fonts.getColor();\n this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');\n this.styles['--color-link'] = this.inverted \n ? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)\n : window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`);\n }\n\n setHostProperty(prop: string, value: string) {\n this.host.style.setProperty(prop, value);\n }\n\n render() {\n return (\n <Host>\n <p style={this.styles} class={this.setsizeClass()}>\n <slot></slot>\n </p>\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CuraButtonOutline extends Components.CuraButtonOutline, HTMLElement {}
|
|
4
|
+
export const CuraButtonOutline: {
|
|
5
|
+
prototype: CuraButtonOutline;
|
|
6
|
+
new (): CuraButtonOutline;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './cura-icon2.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './cura-loader-circle2.js';
|
|
4
|
+
|
|
5
|
+
const curaButtonOutlineCss = ":host{--border-radius:4px;display:inline-block;vertical-align:middle}:host button,:host a{outline:none;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;-webkit-transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;border-radius:var(--border-radius);background-color:transparent;border:none;-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-base);box-shadow:inset 0px 0px 0px 2px var(--color-base);padding:calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 13px)}:host button:not(.disabled):not(.isLoading):hover,:host a:not(.disabled):not(.isLoading):hover{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-light);box-shadow:inset 0px 0px 0px 2px var(--color-light)}:host button:not(.disabled):not(.isLoading):hover .label,:host a:not(.disabled):not(.isLoading):hover .label{color:var(--color-light)}:host button:not(.disabled):not(.isLoading):hover cura-icon,:host a:not(.disabled):not(.isLoading):hover cura-icon{--color:var(--color-light) !important}:host button:not(.disabled):not(.inverted):not(.isLoading):active,:host a:not(.disabled):not(.inverted):not(.isLoading):active{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-dark);box-shadow:inset 0px 0px 0px 2px var(--color-dark)}:host button:not(.disabled):not(.inverted):not(.isLoading):active .label,:host a:not(.disabled):not(.inverted):not(.isLoading):active .label{color:var(--color-dark)}:host button:not(.disabled):not(.inverted):not(.isLoading):active cura-icon,:host a:not(.disabled):not(.inverted):not(.isLoading):active cura-icon{--color:var(--color-dark) !important}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 11px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:1;-webkit-transition:opacity 0.2s linear;transition:opacity 0.2s linear}:host button.icon-right .button-container,:host a.icon-right .button-container{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host button .label,:host a .label{-ms-flex:1;flex:1;font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:1.43em;line-height:1.2em;text-align:var(--text-align, \"left\");color:var(--color-base)}:host button .label.inverted,:host a .label.inverted{color:var(--neutral-white)}:host button.medium .label,:host a.medium .label{font-size:1.14em}:host button.small .label,:host a.small .label{font-size:1em}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host a.medium.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.7px)}:host button.medium.icon-right cura-icon,:host a.medium.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.7px)}:host button.small.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.5px)}:host button.small.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.5px)}:host button.disabled,:host a.disabled{cursor:not-allowed;-webkit-box-shadow:inset 0px 0px 0px 2px var(--neutral-base);box-shadow:inset 0px 0px 0px 2px var(--neutral-base)}:host button.disabled .label,:host button.disabled .label.inverted,:host a.disabled .label,:host a.disabled .label.inverted{color:var(--neutral-dark)}:host button.disabled.inverted,:host a.disabled.inverted{opacity:0.6;-webkit-box-shadow:inset 0px 0px 0px 2px var(--neutral-white);box-shadow:inset 0px 0px 0px 2px var(--neutral-white)}:host button.disabled.inverted .label,:host button.disabled.inverted .label.inverted,:host a.disabled.inverted .label,:host a.disabled.inverted .label.inverted{color:var(--neutral-white)}:host button.disabled.inverted cura-icon,:host a.disabled.inverted cura-icon{--color:var(--neutral-white) !important}:host button.disabled.inverted cura-loader-circle,:host a.disabled.inverted cura-loader-circle{--color:var(--neutral-white) !important}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3.5px)}:host button.icon-only .label,:host a.icon-only .label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 2.75px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 1.5px)}:host button.inverted,:host a.inverted{-webkit-box-shadow:inset 0px 0px 0px 2px var(--neutral-white);box-shadow:inset 0px 0px 0px 2px var(--neutral-white)}:host button.inverted:not(.disabled):not(.isLoading):hover,:host a.inverted:not(.disabled):not(.isLoading):hover{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-lighter);box-shadow:inset 0px 0px 0px 2px var(--color-lighter)}:host button.inverted:not(.disabled):not(.isLoading):hover .label,:host a.inverted:not(.disabled):not(.isLoading):hover .label{color:var(--color-lighter)}:host button.inverted:not(.disabled):not(.isLoading):hover cura-icon,:host a.inverted:not(.disabled):not(.isLoading):hover cura-icon{--color:var(--color-lighter) !important}:host button.inverted:not(.disabled):not(.isLoading):active,:host a.inverted:not(.disabled):not(.isLoading):active{-webkit-box-shadow:inset 0px 0px 0px 2px var(--color-light);box-shadow:inset 0px 0px 0px 2px var(--color-light)}:host button.inverted:not(.disabled):not(.isLoading):active .label,:host a.inverted:not(.disabled):not(.isLoading):active .label{color:var(--color-light)}:host button.inverted:not(.disabled):not(.isLoading):active cura-icon,:host a.inverted:not(.disabled):not(.isLoading):active cura-icon{--color:var(--color-light) !important}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0.3}:host button.isLoading.icon-only .button-container,:host a.isLoading.icon-only .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}";
|
|
6
|
+
|
|
7
|
+
const CuraButtonOutline$1 = /*@__PURE__*/ proxyCustomElement(class CuraButtonOutline extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.size = 'large';
|
|
13
|
+
this.disabled = false;
|
|
14
|
+
this.isLoading = false;
|
|
15
|
+
this.iconName = undefined;
|
|
16
|
+
this.iconset = 'default';
|
|
17
|
+
this.iconPosition = 'left';
|
|
18
|
+
this.iconOnly = undefined;
|
|
19
|
+
this.href = undefined;
|
|
20
|
+
this.target = "_self";
|
|
21
|
+
this.color = 'accent';
|
|
22
|
+
this.fontColor = 'dark';
|
|
23
|
+
this.textAlign = 'left';
|
|
24
|
+
this.styles = {};
|
|
25
|
+
}
|
|
26
|
+
handleChangeColor() {
|
|
27
|
+
this.setColors();
|
|
28
|
+
}
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
31
|
+
this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
|
|
32
|
+
this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);
|
|
33
|
+
this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
|
|
34
|
+
this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);
|
|
35
|
+
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
36
|
+
this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
|
|
37
|
+
this.styles['--font-weight-medium'] = this.weights.medium;
|
|
38
|
+
this.styles['--text-align'] = this.textAlign;
|
|
39
|
+
this.setColors();
|
|
40
|
+
}
|
|
41
|
+
getClasses() {
|
|
42
|
+
const classes = {};
|
|
43
|
+
classes[`${this.size.toLowerCase()}`] = true;
|
|
44
|
+
classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
|
|
45
|
+
classes[`icon-only`] = this.iconOnly;
|
|
46
|
+
classes['inverted'] = this.fontColor === 'light';
|
|
47
|
+
classes['disabled'] = this.disabled;
|
|
48
|
+
classes['isLoading'] = this.isLoading;
|
|
49
|
+
return classes;
|
|
50
|
+
}
|
|
51
|
+
setColors() {
|
|
52
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`), '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`), '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`), '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`) });
|
|
53
|
+
}
|
|
54
|
+
getIcon() {
|
|
55
|
+
if (!this.iconName)
|
|
56
|
+
return '';
|
|
57
|
+
const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
|
|
58
|
+
const color = this.getSymbolColor();
|
|
59
|
+
return h("cura-icon", { name: this.iconName, iconset: this.iconset, size: iconSize, color: color });
|
|
60
|
+
}
|
|
61
|
+
getSymbolColor() {
|
|
62
|
+
return this.disabled
|
|
63
|
+
? 'neutral-dark'
|
|
64
|
+
: this.fontColor === 'light'
|
|
65
|
+
? 'neutral-white'
|
|
66
|
+
: `${this.color}-base`;
|
|
67
|
+
}
|
|
68
|
+
handleClick(e) {
|
|
69
|
+
if (this.disabled || this.isLoading)
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
return (h(Host, null, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e) }, h("span", { class: "button-container" }, this.getIcon(), h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e) }, h("span", { class: "button-container" }, this.getIcon(), h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() })))));
|
|
74
|
+
}
|
|
75
|
+
static get watchers() { return {
|
|
76
|
+
"color": ["handleChangeColor"]
|
|
77
|
+
}; }
|
|
78
|
+
static get style() { return curaButtonOutlineCss; }
|
|
79
|
+
}, [1, "cura-button-outline", {
|
|
80
|
+
"size": [513],
|
|
81
|
+
"disabled": [516],
|
|
82
|
+
"isLoading": [516, "is-loading"],
|
|
83
|
+
"iconName": [513, "icon-name"],
|
|
84
|
+
"iconset": [513],
|
|
85
|
+
"iconPosition": [513, "icon-position"],
|
|
86
|
+
"iconOnly": [516, "icon-only"],
|
|
87
|
+
"href": [513],
|
|
88
|
+
"target": [513],
|
|
89
|
+
"color": [1],
|
|
90
|
+
"fontColor": [513, "font-color"],
|
|
91
|
+
"textAlign": [513, "text-align"],
|
|
92
|
+
"styles": [32]
|
|
93
|
+
}]);
|
|
94
|
+
function defineCustomElement$1() {
|
|
95
|
+
if (typeof customElements === "undefined") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const components = ["cura-button-outline", "cura-icon", "cura-loader-circle"];
|
|
99
|
+
components.forEach(tagName => { switch (tagName) {
|
|
100
|
+
case "cura-button-outline":
|
|
101
|
+
if (!customElements.get(tagName)) {
|
|
102
|
+
customElements.define(tagName, CuraButtonOutline$1);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "cura-icon":
|
|
106
|
+
if (!customElements.get(tagName)) {
|
|
107
|
+
defineCustomElement$3();
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "cura-loader-circle":
|
|
111
|
+
if (!customElements.get(tagName)) {
|
|
112
|
+
defineCustomElement$2();
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
} });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const CuraButtonOutline = CuraButtonOutline$1;
|
|
119
|
+
const defineCustomElement = defineCustomElement$1;
|
|
120
|
+
|
|
121
|
+
export { CuraButtonOutline, defineCustomElement };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=cura-button-outline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-button-outline.js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,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAC9B,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,EAC/B,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IACnC,YAAM,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,OAAO,EAAE,EAChB,YAAM,KAAK,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAK,OAAO,EAAC,IAAE,eAAa,CAAO,CACjF,EACP,0BAAoB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,GAAuB,CACjF,CACV,CACM,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraButtonOutline"],"sources":["./src/components/buttons/cura-button-outline/cura-button-outline.scss?tag=cura-button-outline&encapsulation=shadow","./src/components/buttons/cura-button-outline/cura-button-outline.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n border: none;\n box-shadow: inset 0px 0px 0px 2px var(--color-base);\n\n &:not(.disabled):not(.isLoading):hover {\n box-shadow: inset 0px 0px 0px 2px var(--color-light);\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active { \n box-shadow: inset 0px 0px 0px 2px var(--color-dark);\n .label { color: var(--color-dark); }\n cura-icon { --color: var(--color-dark) !important; }\n }\n };\n\n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label() {\n color: var(--color-base);\n &.inverted { color: var(--neutral-white); }\n }\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n box-shadow: inset 0px 0px 0px 2px var(--neutral-base);\n .label, .label.inverted { color: var(--neutral-dark); }\n &.inverted {\n opacity: 0.6;\n box-shadow: inset 0px 0px 0px 2px var(--neutral-white);\n .label, .label.inverted { color: var(--neutral-white); }\n cura-icon { --color: var(--neutral-white) !important; }\n cura-loader-circle { --color: var(--neutral-white) !important; }\n }\n };\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n // Light version, inverted.\n &.inverted {\n box-shadow: inset 0px 0px 0px 2px var(--neutral-white);\n &:not(.disabled):not(.isLoading):hover { \n box-shadow: inset 0px 0px 0px 2px var(--color-lighter);\n .label { color: var(--color-lighter); }\n cura-icon { --color: var(--color-lighter) !important; }\n }\n &:not(.disabled):not(.isLoading):active {\n box-shadow: inset 0px 0px 0px 2px var(--color-light);\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n }\n\n // Loading State\n @include button-loading();\n\n }\n\n}\n","import { Component, Host, h, Prop, Watch, State } from '@stencil/core';\n\n@Component({\n tag: 'cura-button-outline',\n styleUrl: 'cura-button-outline.scss',\n shadow: true,\n})\nexport class CuraButtonOutline {\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({reflect: true}) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Disabled state. Boolean.\n */\n @Prop({reflect: true}) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({reflect: true}) isLoading = false;\n \n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({reflect: true}) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({reflect: true}) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({reflect: true}) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({reflect: true}) iconOnly: false;\n\n /**\n * Property href switch button to link.\n */\n @Prop({reflect: true}) href: string;\n /**\n * Set target if link.\n */\n @Prop({reflect: true}) target = \"_self\";\n\n /**\n * Color base from color scheme. Default: accent.\n */\n @Prop() color = 'accent';\n @Watch('color')\n handleChangeColor() {\n this.setColors();\n }\n /**\n * Set the font color to dark or light.\n */\n @Prop({reflect: true}) fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({reflect: true}) textAlign: 'left' | 'center' | 'right' = 'left';\n\n\n @State() styles = {};\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n \n getClasses() {\n const classes = {};\n classes[`${this.size.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['inverted'] = this.fontColor === 'light';\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n return classes;\n }\n\n setColors() {\n this.styles = {\n ...this.styles,\n '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`),\n '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`),\n '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`),\n '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`)\n };\n }\n\n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;\n const color = this.getSymbolColor();\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={color}></cura-icon>;\n }\n\n getSymbolColor() {\n return this.disabled \n ? 'neutral-dark' \n : this.fontColor === 'light' \n ? 'neutral-white' \n : `${this.color}-base`;\n }\n\n handleClick(e: Event) {\n if (this.disabled || this.isLoading) e.preventDefault();\n }\n\n render() {\n return (\n <Host>\n { this.href ? (\n <a href={this.disabled ? '' : this.href} \n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles} \n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CuraButtonTransparent extends Components.CuraButtonTransparent, HTMLElement {}
|
|
4
|
+
export const CuraButtonTransparent: {
|
|
5
|
+
prototype: CuraButtonTransparent;
|
|
6
|
+
new (): CuraButtonTransparent;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './cura-icon2.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './cura-loader-circle2.js';
|
|
4
|
+
|
|
5
|
+
const curaButtonTransparentCss = ":host{--border-radius:4px;display:inline-block;vertical-align:middle}:host button,:host a{outline:none;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;text-decoration:none !important;font-size:var(--font-size);cursor:pointer;-webkit-transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear;transition:background-color 0.07s linear, box-shadow 0.07s linear, border-color 0.07s linear, -webkit-box-shadow 0.07s linear;border-radius:var(--border-radius);background-color:transparent;border-width:0px;border-color:transparent;padding:calc(var(--base-spacing) * 3.5px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 13px);min-width:calc(var(--base-spacing) * 13px)}:host button:not(.disabled):not(.isLoading):hover .label,:host a:not(.disabled):not(.isLoading):hover .label{color:var(--color-light)}:host button:not(.disabled):not(.isLoading):hover cura-icon,:host a:not(.disabled):not(.isLoading):hover cura-icon{--color:var(--color-light) !important}:host button:not(.disabled):not(.inverted):not(.isLoading):active .label,:host a:not(.disabled):not(.inverted):not(.isLoading):active .label{color:var(--color-dark)}:host button:not(.disabled):not(.inverted):not(.isLoading):active cura-icon,:host a:not(.disabled):not(.inverted):not(.isLoading):active cura-icon{--color:var(--color-dark) !important}:host button.medium,:host a.medium{padding:calc(var(--base-spacing) * 2.75px) calc(var(--base-spacing) * 4px);min-height:calc(var(--base-spacing) * 11px);min-width:calc(var(--base-spacing) * 11px)}:host button.small,:host a.small{padding:calc(var(--base-spacing) * 1.5px) calc(var(--base-spacing) * 3px);min-height:calc(var(--base-spacing) * 8px);min-width:calc(var(--base-spacing) * 8px)}:host button .button-container,:host a .button-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:1;-webkit-transition:opacity 0.2s linear;transition:opacity 0.2s linear}:host button.icon-right .button-container,:host a.icon-right .button-container{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host button .label,:host a .label{-ms-flex:1;flex:1;font-family:var(--font-family);font-weight:var(--font-weight-medium);font-size:1.43em;line-height:1.2em;text-align:var(--text-align, \"left\");color:var(--color-base)}:host button .label.inverted,:host a .label.inverted{color:var(--neutral-white)}:host button.medium .label,:host a.medium .label{font-size:1.14em}:host button.small .label,:host a.small .label{font-size:1em}:host button.icon-left cura-icon,:host a.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 3px)}:host button.icon-right cura-icon,:host a.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 3px)}:host button.medium.icon-left cura-icon,:host a.medium.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.7px)}:host button.medium.icon-right cura-icon,:host a.medium.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.7px)}:host button.small.icon-left cura-icon,:host a.small.icon-left cura-icon{margin-right:calc(var(--base-spacing) * 2.5px)}:host button.small.icon-right cura-icon,:host a.small.icon-right cura-icon{margin-left:calc(var(--base-spacing) * 2.5px)}:host button.disabled,:host a.disabled{cursor:not-allowed;border-color:var(--neutral-base)}:host button.disabled .label,:host button.disabled .label.inverted,:host a.disabled .label,:host a.disabled .label.inverted{color:var(--neutral-dark)}:host button.disabled.inverted,:host a.disabled.inverted{opacity:0.6}:host button.disabled.inverted .label,:host button.disabled.inverted .label.inverted,:host a.disabled.inverted .label,:host a.disabled.inverted .label.inverted{color:var(--neutral-white)}:host button.disabled.inverted cura-icon,:host a.disabled.inverted cura-icon{--color:var(--neutral-white) !important}:host button.disabled.inverted cura-loader-circle,:host a.disabled.inverted cura-loader-circle{--color:var(--neutral-white) !important}:host button.icon-only,:host a.icon-only{padding:calc(var(--base-spacing) * 3.5px)}:host button.icon-only .label,:host a.icon-only .label{display:none}:host button.icon-only cura-icon,:host a.icon-only cura-icon{margin-left:0 !important;margin-right:0 !important}:host button.icon-only.medium,:host a.icon-only.medium{padding:calc(var(--base-spacing) * 2.75px)}:host button.icon-only.small,:host a.icon-only.small{padding:calc(var(--base-spacing) * 1.5px)}:host button.inverted:not(.isLoading):not(.disabled):hover .label,:host a.inverted:not(.isLoading):not(.disabled):hover .label{color:var(--color-lighter)}:host button.inverted:not(.isLoading):not(.disabled):hover cura-icon,:host a.inverted:not(.isLoading):not(.disabled):hover cura-icon{--color:var(--color-lighter) !important}:host button.inverted:not(.isLoading):not(.disabled):active .label,:host a.inverted:not(.isLoading):not(.disabled):active .label{color:var(--color-light)}:host button.inverted:not(.isLoading):not(.disabled):active cura-icon,:host a.inverted:not(.isLoading):not(.disabled):active cura-icon{--color:var(--color-light) !important}:host button cura-loader-circle,:host a cura-loader-circle{position:absolute;display:none}:host button.isLoading,:host a.isLoading{cursor:wait}:host button.isLoading .button-container,:host a.isLoading .button-container{opacity:0.3}:host button.isLoading.icon-only .button-container,:host a.isLoading.icon-only .button-container{opacity:0}:host button.isLoading cura-loader-circle,:host a.isLoading cura-loader-circle{display:block}";
|
|
6
|
+
|
|
7
|
+
const CuraButtonTransparent$1 = /*@__PURE__*/ proxyCustomElement(class CuraButtonTransparent extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.size = 'large';
|
|
13
|
+
this.disabled = false;
|
|
14
|
+
this.isLoading = false;
|
|
15
|
+
this.iconName = undefined;
|
|
16
|
+
this.iconset = 'default';
|
|
17
|
+
this.iconPosition = 'left';
|
|
18
|
+
this.iconOnly = undefined;
|
|
19
|
+
this.href = undefined;
|
|
20
|
+
this.target = "_self";
|
|
21
|
+
this.color = 'accent';
|
|
22
|
+
this.fontColor = 'dark';
|
|
23
|
+
this.textAlign = 'left';
|
|
24
|
+
this.styles = {};
|
|
25
|
+
}
|
|
26
|
+
handleChangeColor() {
|
|
27
|
+
this.setColors();
|
|
28
|
+
}
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
31
|
+
this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
|
|
32
|
+
this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);
|
|
33
|
+
this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
|
|
34
|
+
this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);
|
|
35
|
+
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
36
|
+
this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
|
|
37
|
+
this.styles['--font-weight-medium'] = this.weights.medium;
|
|
38
|
+
this.styles['--text-align'] = this.textAlign;
|
|
39
|
+
this.setColors();
|
|
40
|
+
}
|
|
41
|
+
getClasses() {
|
|
42
|
+
const classes = {};
|
|
43
|
+
classes[`${this.size.toLowerCase()}`] = true;
|
|
44
|
+
classes[`icon-${this.iconPosition.toLowerCase()}`] = true;
|
|
45
|
+
classes[`icon-only`] = this.iconOnly;
|
|
46
|
+
classes['inverted'] = this.fontColor === 'light';
|
|
47
|
+
classes['disabled'] = this.disabled;
|
|
48
|
+
classes['isLoading'] = this.isLoading;
|
|
49
|
+
return classes;
|
|
50
|
+
}
|
|
51
|
+
setColors() {
|
|
52
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`), '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`), '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`), '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`) });
|
|
53
|
+
}
|
|
54
|
+
getIcon() {
|
|
55
|
+
if (!this.iconName)
|
|
56
|
+
return '';
|
|
57
|
+
const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;
|
|
58
|
+
const color = this.getSymbolColor();
|
|
59
|
+
return h("cura-icon", { name: this.iconName, iconset: this.iconset, size: iconSize, color: color });
|
|
60
|
+
}
|
|
61
|
+
getSymbolColor() {
|
|
62
|
+
return this.disabled
|
|
63
|
+
? 'neutral-dark'
|
|
64
|
+
: this.fontColor === 'light'
|
|
65
|
+
? 'neutral-white'
|
|
66
|
+
: `${this.color}-base`;
|
|
67
|
+
}
|
|
68
|
+
handleClick(e) {
|
|
69
|
+
if (this.disabled || this.isLoading)
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
return (h(Host, null, this.href ? (h("a", { href: this.disabled ? '' : this.href, target: this.target, class: this.getClasses(), style: this.styles, onClick: (e) => this.handleClick(e) }, h("span", { class: "button-container" }, this.getIcon(), h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() }))) : (h("button", { class: this.getClasses(), style: this.styles, disabled: this.disabled || null, onClick: (e) => this.handleClick(e) }, h("span", { class: "button-container" }, this.getIcon(), h("span", { class: { label: true, inverted: this.fontColor === 'light' } }, h("slot", null))), h("cura-loader-circle", { size: this.size, color: this.getSymbolColor() })))));
|
|
74
|
+
}
|
|
75
|
+
static get watchers() { return {
|
|
76
|
+
"color": ["handleChangeColor"]
|
|
77
|
+
}; }
|
|
78
|
+
static get style() { return curaButtonTransparentCss; }
|
|
79
|
+
}, [1, "cura-button-transparent", {
|
|
80
|
+
"size": [513],
|
|
81
|
+
"disabled": [516],
|
|
82
|
+
"isLoading": [516, "is-loading"],
|
|
83
|
+
"iconName": [513, "icon-name"],
|
|
84
|
+
"iconset": [513],
|
|
85
|
+
"iconPosition": [513, "icon-position"],
|
|
86
|
+
"iconOnly": [516, "icon-only"],
|
|
87
|
+
"href": [513],
|
|
88
|
+
"target": [513],
|
|
89
|
+
"color": [1],
|
|
90
|
+
"fontColor": [513, "font-color"],
|
|
91
|
+
"textAlign": [513, "text-align"],
|
|
92
|
+
"styles": [32]
|
|
93
|
+
}]);
|
|
94
|
+
function defineCustomElement$1() {
|
|
95
|
+
if (typeof customElements === "undefined") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const components = ["cura-button-transparent", "cura-icon", "cura-loader-circle"];
|
|
99
|
+
components.forEach(tagName => { switch (tagName) {
|
|
100
|
+
case "cura-button-transparent":
|
|
101
|
+
if (!customElements.get(tagName)) {
|
|
102
|
+
customElements.define(tagName, CuraButtonTransparent$1);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "cura-icon":
|
|
106
|
+
if (!customElements.get(tagName)) {
|
|
107
|
+
defineCustomElement$3();
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "cura-loader-circle":
|
|
111
|
+
if (!customElements.get(tagName)) {
|
|
112
|
+
defineCustomElement$2();
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
} });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const CuraButtonTransparent = CuraButtonTransparent$1;
|
|
119
|
+
const defineCustomElement = defineCustomElement$1;
|
|
120
|
+
|
|
121
|
+
export { CuraButtonTransparent, defineCustomElement };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=cura-button-transparent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"cura-button-transparent.js","mappings":";;;;AAAA,MAAM,wBAAwB,GAAG,8vLAA8vL;;MCOlxLA,uBAAqB;;;;;gBAK6B,OAAO;oBAKjC,KAAK;qBAIJ,KAAK;;mBASP,SAAS;wBAIc,MAAM;;;kBAa9B,OAAO;iBAKvB,QAAQ;qBAQ6B,MAAM;qBAKK,MAAM;kBAGpD,EAAE;;EAdpB,iBAAiB;IACf,IAAI,CAAC,SAAS,EAAE,CAAC;GAClB;EAgBD,iBAAiB;IACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACvD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;IAC1E,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,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;;;;;;;;;;;;;;","names":["CuraButtonTransparent"],"sources":["./src/components/buttons/cura-button-transparent/cura-button-transparent.scss?tag=cura-button-transparent&encapsulation=shadow","./src/components/buttons/cura-button-transparent/cura-button-transparent.tsx"],"sourcesContent":["@import \"../../../scss/mixins/buttons.scss\";\n\n:host {\n @include button-host();\n\n button, a {\n @include button-element() {\n background-color: transparent;\n border-width: 0px;\n border-color: transparent;\n\n &:not(.disabled):not(.isLoading):hover {\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n\n &:not(.disabled):not(.inverted):not(.isLoading):active { \n .label { color: var(--color-dark); }\n cura-icon { --color: var(--color-dark) !important; }\n }\n }\n \n @include button-sizes();\n\n // Children Elements\n @include button-container();\n @include button-label() {\n color: var(--color-base);\n &.inverted { color: var(--neutral-white); }\n }\n @include button-icon();\n\n // Disabled state\n @include button-disabled() {\n border-color: var(--neutral-base);\n .label, .label.inverted { color: var(--neutral-dark); }\n &.inverted {\n opacity: 0.6;\n .label, .label.inverted { color: var(--neutral-white); }\n cura-icon { --color: var(--neutral-white) !important; }\n cura-loader-circle { --color: var(--neutral-white) !important; }\n }\n }\n\n // FAB / Icon-only\n @include button-icon-only-behavior();\n\n &.inverted {\n &:not(.isLoading):not(.disabled):hover { \n .label { color: var(--color-lighter); }\n cura-icon { --color: var(--color-lighter) !important; }\n }\n &:not(.isLoading):not(.disabled):active {\n .label { color: var(--color-light); }\n cura-icon { --color: var(--color-light) !important; }\n }\n }\n\n // Loading State\n @include button-loading();\n\n }\n}\n","import { Component, Host, h, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'cura-button-transparent',\n styleUrl: 'cura-button-transparent.scss',\n shadow: true,\n})\nexport class CuraButtonTransparent {\n\n /**\n * Button size: small | medium | large (default)\n */\n @Prop({reflect: true}) size: 'small' | 'medium' | 'large' = 'large';\n \n /**\n * Disabled state. Boolean.\n */\n @Prop({reflect: true}) disabled = false;\n /**\n * Loading state. Boolean.\n */\n @Prop({reflect: true}) isLoading = false;\n \n /**\n * Name of the icon to be used from iconset.\n */\n @Prop({reflect: true}) iconName: string;\n /**\n * Custom iconset if needed.\n */\n @Prop({reflect: true}) iconset = 'default';\n /**\n * Icon position: left (default) | right.\n */\n @Prop({reflect: true}) iconPosition: 'left' | 'right' = 'left';\n /**\n * Set button to FAB/icon only.\n */\n @Prop({reflect: true}) iconOnly: false;\n \n /**\n * Property href switch button to link.\n */\n @Prop({reflect: true}) href: string;\n /**\n * Set target if link.\n */\n @Prop({reflect: true}) target = \"_self\";\n \n /**\n * Color base from color scheme. Default: accent.\n */\n @Prop() color = 'accent';\n @Watch('color')\n handleChangeColor() {\n this.setColors();\n }\n /**\n * Set the font color to dark or light.\n */\n @Prop({reflect: true}) fontColor: 'dark' | 'light' = 'dark';\n /**\n * Set text aligment for the button label.\n * Vales: left (default) | center | right.\n */\n @Prop({reflect: true}) textAlign: 'left' | 'center' | 'right' = 'left';\n \n \n @State() styles = {};\n \n weights;\n \n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor(`neutral-dark`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--text-align'] = this.textAlign;\n this.setColors();\n }\n \n getClasses() {\n const classes = {};\n classes[`${this.size.toLowerCase()}`] = true;\n classes[`icon-${this.iconPosition.toLowerCase()}`] = true;\n classes[`icon-only`] = this.iconOnly;\n classes['inverted'] = this.fontColor === 'light';\n classes['disabled'] = this.disabled;\n classes['isLoading'] = this.isLoading;\n return classes;\n }\n \n setColors() {\n this.styles = {\n ...this.styles,\n '--color-lighter': window.CuraAPI.theme.colors.getColor(`${this.color}-lighter`),\n '--color-light': window.CuraAPI.theme.colors.getColor(`${this.color}-light`),\n '--color-base': window.CuraAPI.theme.colors.getColor(`${this.color}-base`),\n '--color-dark': window.CuraAPI.theme.colors.getColor(`${this.color}-dark`)\n };\n }\n \n getIcon() {\n if (!this.iconName) return '';\n const iconSize = this.size === 'small' ? 16 : this.size === 'medium' ? 20 : 24;\n const color = this.getSymbolColor();\n return <cura-icon name={this.iconName} iconset={this.iconset} size={iconSize} color={color}></cura-icon>;\n }\n \n getSymbolColor() {\n return this.disabled \n ? 'neutral-dark' \n : this.fontColor === 'light' \n ? 'neutral-white' \n : `${this.color}-base`;\n }\n \n handleClick(e: Event) {\n if (this.disabled || this.isLoading) e.preventDefault();\n }\n \n render() {\n return (\n <Host>\n { this.href ? (\n <a href={this.disabled ? '' : this.href} \n target={this.target}\n class={this.getClasses()}\n style={this.styles}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </a>\n ) : (\n <button class={this.getClasses()}\n style={this.styles} \n disabled={this.disabled || null}\n onClick={(e) => this.handleClick(e)}>\n <span class=\"button-container\">\n { this.getIcon() }\n <span class={{label: true, inverted: this.fontColor === 'light'}}><slot></slot></span>\n </span>\n <cura-loader-circle size={this.size} color={this.getSymbolColor()}></cura-loader-circle>\n </button>\n )}\n </Host>\n );\n }\n\n}\n"],"version":3}
|