@rededor/cura 0.5.1 → 0.5.2
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-0e3b7fc6.js → app-globals-2988084b.js} +5 -5
- package/dist/cjs/app-globals-2988084b.js.map +1 -0
- package/dist/cjs/cura-accordion_8.cjs.entry.js +452 -0
- package/dist/cjs/cura-accordion_8.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-button-outline.cjs.entry.js +83 -0
- package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-button-transparent.cjs.entry.js +83 -0
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-display.cjs.entry.js +74 -0
- package/dist/cjs/cura-display.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-icons-view.cjs.entry.js +29 -0
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-label.cjs.entry.js +69 -0
- package/dist/cjs/cura-label.cjs.entry.js.map +1 -0
- package/dist/cjs/cura.cjs.js +2 -2
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/api/cura-api.type.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-breakpoints-module.js +1 -1
- package/dist/collection/api/modules/cura-theme-breakpoints-module.js.map +1 -1
- package/dist/collection/api/modules/cura-theme-colors-module.js +1 -1
- package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
- package/dist/collection/api/theme-presets/static.js +2 -2
- package/dist/collection/api/theme-presets/static.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +10 -6
- package/dist/collection/components/cura-page-template/cura-page-template.css +13 -9
- package/dist/collection/components/forms/cura-label/cura-label.css +70 -0
- package/dist/collection/components/forms/cura-label/cura-label.js +190 -0
- package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -0
- package/dist/collection/components/forms/cura-label/cura-label.stories.js +137 -0
- package/dist/collection/components/forms/cura-label/cura-label.stories.js.map +1 -0
- package/dist/collection/components/text/cura-display/cura-display.css +21 -38
- package/dist/collection/components/text/cura-display/cura-display.js +80 -49
- package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
- package/dist/collection/components/text/cura-display/cura-display.stories.js +78 -33
- package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.css +50 -24
- package/dist/collection/components/text/cura-heading/cura-heading.js +94 -39
- package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.stories.js +92 -36
- package/dist/collection/components/text/cura-heading/cura-heading.stories.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +37 -38
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +62 -41
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +78 -46
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
- package/dist/collection/index.js +3 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/components/cura-accordion-item.js +1 -1
- package/dist/components/cura-accordion-item.js.map +1 -1
- package/dist/components/cura-display.js +41 -35
- package/dist/components/cura-display.js.map +1 -1
- package/dist/components/cura-heading.js +34 -21
- package/dist/components/cura-heading.js.map +1 -1
- package/dist/components/cura-label.d.ts +11 -0
- package/dist/components/cura-label.js +91 -0
- package/dist/components/cura-label.js.map +1 -0
- package/dist/components/cura-page-template.js +1 -1
- package/dist/components/cura-page-template.js.map +1 -1
- package/dist/components/cura-paragraph.js +25 -23
- package/dist/components/cura-paragraph.js.map +1 -1
- package/dist/components/index.js +11 -5
- 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/index.esm.js +1 -1
- package/dist/cura/index.esm.js.map +1 -1
- package/dist/cura/p-03047b3e.entry.js +2 -0
- package/dist/cura/p-03047b3e.entry.js.map +1 -0
- package/dist/cura/p-0c79c54e.entry.js +2 -0
- package/dist/cura/p-0c79c54e.entry.js.map +1 -0
- package/dist/cura/p-120926c5.system.js +2 -0
- package/dist/cura/p-120926c5.system.js.map +1 -0
- package/dist/cura/p-223924fb.system.entry.js +2 -0
- package/dist/cura/p-223924fb.system.entry.js.map +1 -0
- package/dist/cura/p-48426f60.system.js +2 -0
- package/dist/cura/p-48426f60.system.js.map +1 -0
- package/dist/cura/p-49813052.entry.js +2 -0
- package/dist/cura/p-49813052.entry.js.map +1 -0
- package/dist/cura/p-4bdbcdf0.system.entry.js +2 -0
- package/dist/cura/p-4bdbcdf0.system.entry.js.map +1 -0
- package/dist/cura/p-7c8f3c77.system.entry.js +2 -0
- package/dist/cura/p-7c8f3c77.system.entry.js.map +1 -0
- package/dist/cura/p-8b18b5f7.system.js +2 -0
- package/dist/cura/p-8b18b5f7.system.js.map +1 -0
- package/dist/cura/p-91b0f78e.entry.js +2 -0
- package/dist/cura/p-91b0f78e.entry.js.map +1 -0
- package/dist/cura/p-a0395f90.entry.js +2 -0
- package/dist/cura/p-a0395f90.entry.js.map +1 -0
- package/dist/cura/p-a7ef255f.entry.js +2 -0
- package/dist/cura/p-a7ef255f.entry.js.map +1 -0
- package/dist/cura/p-ca054b07.system.entry.js +2 -0
- package/dist/cura/p-ca054b07.system.entry.js.map +1 -0
- package/dist/cura/p-d47b9cfe.system.entry.js +2 -0
- package/dist/cura/p-d47b9cfe.system.entry.js.map +1 -0
- package/dist/cura/p-f8fffdc1.js +2 -0
- package/dist/cura/p-f8fffdc1.js.map +1 -0
- package/dist/cura/p-fc77814b.system.entry.js +2 -0
- package/dist/cura/p-fc77814b.system.entry.js.map +1 -0
- package/dist/esm/{app-globals-cc003eaf.js → app-globals-29001758.js} +5 -5
- package/dist/esm/app-globals-29001758.js.map +1 -0
- package/dist/esm/cura-accordion_8.entry.js +441 -0
- package/dist/esm/cura-accordion_8.entry.js.map +1 -0
- package/dist/esm/cura-button-outline.entry.js +79 -0
- package/dist/esm/cura-button-outline.entry.js.map +1 -0
- package/dist/esm/cura-button-transparent.entry.js +79 -0
- package/dist/esm/cura-button-transparent.entry.js.map +1 -0
- package/dist/esm/cura-display.entry.js +70 -0
- package/dist/esm/cura-display.entry.js.map +1 -0
- package/dist/esm/cura-icons-view.entry.js +25 -0
- package/dist/esm/cura-icons-view.entry.js.map +1 -0
- package/dist/esm/cura-label.entry.js +65 -0
- package/dist/esm/cura-label.entry.js.map +1 -0
- package/dist/esm/cura.js +2 -2
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm-es5/app-globals-29001758.js +2 -0
- package/dist/esm-es5/app-globals-29001758.js.map +1 -0
- package/dist/esm-es5/cura-accordion_8.entry.js +2 -0
- package/dist/esm-es5/cura-accordion_8.entry.js.map +1 -0
- package/dist/esm-es5/cura-button-outline.entry.js +2 -0
- package/dist/esm-es5/cura-button-outline.entry.js.map +1 -0
- package/dist/esm-es5/cura-button-transparent.entry.js +2 -0
- package/dist/esm-es5/cura-button-transparent.entry.js.map +1 -0
- package/dist/esm-es5/cura-display.entry.js +2 -0
- package/dist/esm-es5/cura-display.entry.js.map +1 -0
- package/dist/esm-es5/cura-icons-view.entry.js +2 -0
- package/dist/esm-es5/cura-icons-view.entry.js.map +1 -0
- package/dist/esm-es5/cura-label.entry.js +2 -0
- package/dist/esm-es5/cura-label.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/index.js +1 -1
- package/dist/esm-es5/index.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/cura-api.type.d.ts +1 -0
- package/dist/types/components/forms/cura-label/cura-label.d.ts +54 -0
- package/dist/types/components/forms/cura-label/cura-label.stories.d.ts +126 -0
- package/dist/types/components/text/cura-display/cura-display.d.ts +29 -18
- package/dist/types/components/text/cura-display/cura-display.stories.d.ts +52 -14
- package/dist/types/components/text/cura-heading/cura-heading.d.ts +34 -17
- package/dist/types/components/text/cura-heading/cura-heading.stories.d.ts +58 -6
- package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +24 -12
- package/dist/types/components/text/cura-paragraph/cura-paragraph.stories.d.ts +47 -9
- package/dist/types/components.d.ts +139 -46
- package/dist/types/index.d.ts +9 -0
- package/package.json +2 -4
- package/dist/cjs/app-globals-0e3b7fc6.js.map +0 -1
- package/dist/cjs/cura-accordion_12.cjs.entry.js +0 -674
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +0 -1
- package/dist/cura/p-319699df.entry.js +0 -2
- package/dist/cura/p-319699df.entry.js.map +0 -1
- package/dist/cura/p-50ea2036.system.js +0 -2
- package/dist/cura/p-50ea2036.system.js.map +0 -1
- package/dist/cura/p-5250cb43.system.js +0 -2
- package/dist/cura/p-5250cb43.system.js.map +0 -1
- package/dist/cura/p-5cc3c8bd.system.entry.js +0 -2
- package/dist/cura/p-5cc3c8bd.system.entry.js.map +0 -1
- package/dist/cura/p-788e035b.system.js +0 -2
- package/dist/cura/p-788e035b.system.js.map +0 -1
- package/dist/cura/p-d5c64a5f.js +0 -2
- package/dist/cura/p-d5c64a5f.js.map +0 -1
- package/dist/esm/app-globals-cc003eaf.js.map +0 -1
- package/dist/esm/cura-accordion_12.entry.js +0 -659
- package/dist/esm/cura-accordion_12.entry.js.map +0 -1
- package/dist/esm-es5/app-globals-cc003eaf.js +0 -2
- package/dist/esm-es5/app-globals-cc003eaf.js.map +0 -1
- package/dist/esm-es5/cura-accordion_12.entry.js +0 -2
- package/dist/esm-es5/cura-accordion_12.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;
|
|
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,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,WAAW;;IA+CtB,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;iBAzCyB,CAAC;qBAMpB,aAAa;;uBAiBX,QAAQ;sBAMT,MAAM;kBAaxB,EAAE;;EA3BpB,iBAAiB;IACf,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;EA2BD,iBAAiB;IACf,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzB,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IAC7C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC/C,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;KACxC,CAAC;EACJ,CAAC;EAED,iBAAiB;IACf,OAAO;MACL,gBAAgB,EAAE,IAAI,CAAC,WAAW;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AAC;EAClD,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,IACjC,IAAI,CAAC,aAAa,EAAE,CACjB,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Element, Prop, State, Watch } 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. Will render the related HTML tag <h1>, <h2>, ...\n * Values: 1(default) to 6.\n */\n @Prop({reflect: true}) level: 1 | 2 | 3 | 4 | 5 | 6 = 1;\n\n /**\n * Apply design system color to interactive elements like <a> and <abbr> inside the text.\n * Values: Color from design system scheme. Default to 'accent-dark'.\n */\n @Prop({reflect: true}) spotColor = 'accent-dark';\n\n /**\n * Text color.\n * Values: Color from design system scheme. Default to the font color from the theme.\n */\n @Prop() color: string;\n @Watch('color')\n @Watch('spotColor')\n handleChangeColor() {\n this.setColors();\n }\n\n /**\n * CSS margin-block property values.\n * Default to 1.25em\n */\n @Prop({reflect: true}) marginBlock = '1.25em';\n\n /**\n * CSS line-height property values.\n * Default to 140%\n */\n @Prop({reflect: true}) lineHeight = '120%';\n\n /**\n * Host element <cura-display>\n */\n @Element() host: HTMLElement;\n\n /**\n * Internal Props\n */\n weights: any;\n fontSizeBase: string;\n theme = window.CuraAPI.theme;\n @State() styles = {};\n\n connectedCallback() {\n this.setFontProperties();\n this.setColors();\n }\n\n setFontProperties() {\n this.weights = this.theme.fonts.getWeights();\n this.fontSizeBase = this.theme.fonts.getSize();\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 };\n }\n\n hostCSSProperties() {\n return {\n '--margin-block': this.marginBlock,\n '--font-size-base': this.fontSizeBase,\n '--line-height': this.lineHeight\n };\n }\n\n setColors() {\n const fontColor = this.color\n ? this.theme.colors.getColor(this.color)\n : this.theme.fonts.getColor();\n this.styles = {\n ...this.styles,\n '--color-body': fontColor || this.theme.colors.getColor('neutral-darker'),\n '--color-link': this.theme.colors.getColor(`${this.spotColor}`)\n };\n }\n\n getHeadingTag() {\n const tags = {\n '1': <h1 style={this.styles}><slot></slot></h1>,\n '2': <h2 style={this.styles}><slot></slot></h2>,\n '3': <h3 style={this.styles}><slot></slot></h3>,\n '4': <h4 style={this.styles}><slot></slot></h4>,\n '5': <h5 style={this.styles}><slot></slot></h5>,\n '6': <h6 style={this.styles}><slot></slot></h6>,\n 'default': <h1 style={this.styles}><slot></slot></h1>\n };\n return tags[`${this.level}`] || tags['default'];\n }\n\n render() {\n return (\n <Host style={this.hostCSSProperties()}>\n { this.getHeadingTag() }\n </Host>\n );\n }\n\n}\n"]}
|
|
@@ -10,71 +10,116 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
+
import { getColorsWithDepths } from "../../../utils/utils";
|
|
14
|
+
const colors = getColorsWithDepths();
|
|
15
|
+
const renderCuraDisplay = (label, args) => {
|
|
16
|
+
const styles = args.cssMarginBlock || args.cssLineHeight ? `<style>
|
|
17
|
+
cura-display { ${args.cssMarginBlock ? `
|
|
18
|
+
--margin-block: ${args.cssMarginBlock} !important;` : ``}${args.cssLineHeight ? `
|
|
19
|
+
--line-height: ${args.cssLineHeight} !important;` : ``}
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
|
|
23
|
+
` : '';
|
|
24
|
+
const block = `<cura-display${args.level ? `
|
|
25
|
+
level="${args.level}"` : ''}${args.color ? `
|
|
26
|
+
color="${args.color}"` : ''}${args.spotColor ? `
|
|
27
|
+
spot-color="${args.spotColor}"` : ''}${args.marginBlock ? `
|
|
28
|
+
margin-block="${args.marginBlock}"` : ''}${args.lineHeight ? `
|
|
29
|
+
line-height="${args.lineHeight}"` : ''}>
|
|
30
|
+
${label}
|
|
31
|
+
</cura-display>
|
|
32
|
+
`;
|
|
33
|
+
return `${styles}${block}${block}${block}`;
|
|
34
|
+
};
|
|
13
35
|
export default {
|
|
14
36
|
title: 'Componentes/Text/Display',
|
|
15
37
|
tags: ['autodocs'],
|
|
16
38
|
render: (_a) => {
|
|
17
39
|
var { label } = _a, args = __rest(_a, ["label"]);
|
|
18
|
-
|
|
19
|
-
// return `<div>${label}</div>`;
|
|
20
|
-
return `<cura-display
|
|
21
|
-
level="${args.level}"
|
|
22
|
-
spot-color="${args.spotColor}"
|
|
23
|
-
size="${args.size}"
|
|
24
|
-
inverted="${args.inverted}">
|
|
25
|
-
${label}
|
|
26
|
-
</cura-display>
|
|
27
|
-
<cura-paragraph>Proin quis turpis et turpis efficitur dictum. Suspendisse egestas posuere libero. Sed non dapibus urna. Sed luctus tincidunt nibh, eu tincidunt justo. Curabitur at ullamcorper mauris, feugiat fermentum nulla. Quisque sed nibh in odio blandit mollis at quis dolor. Sed urna lacus, ultricies ac vulputate at, luctus eu ex. Duis at elit facilisis, iaculis orci sed, suscipit nisl. Phasellus semper lorem sed tincidunt semper. Morbi lobortis eu mi sed ultricies. Sed consequat id orci at iaculis.</cura-paragraph>`;
|
|
40
|
+
return renderCuraDisplay(label, args);
|
|
28
41
|
},
|
|
29
42
|
argTypes: {
|
|
30
43
|
label: {
|
|
31
44
|
control: 'text',
|
|
32
|
-
description: '
|
|
45
|
+
description: 'Define o texto do componente diretamente.',
|
|
33
46
|
name: 'Content'
|
|
34
47
|
},
|
|
35
|
-
|
|
36
|
-
control: 'boolean',
|
|
37
|
-
description: 'Inverte cores do texto para aplicação em fundo escuro.',
|
|
38
|
-
table: {
|
|
39
|
-
category: 'Properties',
|
|
40
|
-
defaultValue: { summary: 'false' }
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
size: {
|
|
48
|
+
color: {
|
|
44
49
|
control: { type: 'select' },
|
|
45
|
-
options: ['
|
|
46
|
-
description: '
|
|
50
|
+
options: ['', ...colors],
|
|
51
|
+
description: 'Define a cor de texto do bloco. Aceita qualquer valor do esquema de cores do design system.',
|
|
47
52
|
table: {
|
|
48
53
|
category: 'Properties',
|
|
49
|
-
defaultValue: { summary: '
|
|
54
|
+
defaultValue: { summary: 'Cor de texto padrão do tema' }
|
|
50
55
|
}
|
|
51
56
|
},
|
|
52
57
|
spotColor: {
|
|
53
58
|
control: { type: 'select' },
|
|
54
|
-
options: ['
|
|
55
|
-
description: '
|
|
59
|
+
options: ['', ...colors],
|
|
60
|
+
description: 'Define a cor dos itens de interação dentro do bloco de texto como as tags `<a>`. Aceita qualquer valor do esquema de cores do design system.',
|
|
61
|
+
name: 'spot-color',
|
|
56
62
|
table: {
|
|
57
63
|
category: 'Properties',
|
|
58
|
-
defaultValue: { summary: '
|
|
64
|
+
defaultValue: { summary: 'accent-dark' }
|
|
59
65
|
}
|
|
60
66
|
},
|
|
61
67
|
level: {
|
|
62
68
|
control: { type: 'number', min: 1, max: 6, step: 1 },
|
|
63
|
-
description: 'Define a tag semântica do título. Ex. h1, h2, h3, etc.',
|
|
69
|
+
description: 'Define a tag semântica do título. Ex. h1, h2, h3, etc. A semântica é independente do estilo aplicado.',
|
|
64
70
|
table: {
|
|
65
71
|
category: 'Properties',
|
|
66
|
-
defaultValue: { summary:
|
|
72
|
+
defaultValue: { summary: 1 }
|
|
67
73
|
}
|
|
68
|
-
}
|
|
74
|
+
},
|
|
75
|
+
marginBlock: {
|
|
76
|
+
control: 'text',
|
|
77
|
+
description: 'Define o tamanho do espaçamento superior e inferior do bloco. Valores válidos para a propriedade CSS `margin-block`.',
|
|
78
|
+
name: 'margin-block',
|
|
79
|
+
table: {
|
|
80
|
+
category: 'Properties',
|
|
81
|
+
defaultValue: { summary: '1.25em' }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
lineHeight: {
|
|
85
|
+
control: 'text',
|
|
86
|
+
description: 'Define a altura de linha base a ser considerada pelo componente em sua responsividade. Valores válidos para a propriedade CSS `line-height`.',
|
|
87
|
+
name: 'line-height',
|
|
88
|
+
table: {
|
|
89
|
+
category: 'Properties',
|
|
90
|
+
defaultValue: { summary: '130%' }
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
cssMarginBlock: {
|
|
94
|
+
control: 'text',
|
|
95
|
+
description: 'Permite a definição da propriedade `margin-block` por folhas de estilo. É necessário o uso do `!important` conforme o exemplo de código.',
|
|
96
|
+
name: '--margin-block',
|
|
97
|
+
table: {
|
|
98
|
+
category: 'CSS Properties',
|
|
99
|
+
defaultValue: { summary: '1.25em' }
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
cssLineHeight: {
|
|
103
|
+
control: 'text',
|
|
104
|
+
description: 'Permite a definição da propriedade `line-height` por folhas de estilo. É necessário o uso do `!important` conforme o exemplo de código.',
|
|
105
|
+
name: '--line-height',
|
|
106
|
+
table: {
|
|
107
|
+
category: 'CSS Properties',
|
|
108
|
+
defaultValue: { summary: '130%' }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
69
111
|
},
|
|
70
112
|
};
|
|
71
113
|
export const Display = {
|
|
72
114
|
args: {
|
|
73
115
|
label: 'Dolor sit <a href="https://www.rededorsaoluiz.com.br" target="_blank">amet</a>, consectetur adipiscing elit.',
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
spotColor: '
|
|
77
|
-
|
|
116
|
+
level: '',
|
|
117
|
+
color: '',
|
|
118
|
+
spotColor: '',
|
|
119
|
+
marginBlock: '',
|
|
120
|
+
lineHeight: '',
|
|
121
|
+
cssMarginBlock: '',
|
|
122
|
+
cssLineHeight: ''
|
|
78
123
|
},
|
|
79
124
|
};
|
|
80
125
|
//# sourceMappingURL=cura-display.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-display.stories.js","sourceRoot":"","sources":["../../../../src/components/text/cura-display/cura-display.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cura-display.stories.js","sourceRoot":"","sources":["../../../../src/components/text/cura-display/cura-display.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;AAErC,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,IAAS,EAAE,EAAE;EACrD,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;mBAC1C,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;sBACnB,IAAI,CAAC,cAAc,cAAc,CAAC,CAAC,CAAC,EAAE,GAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;qBAChE,IAAI,CAAC,aAAa,cAAc,CAAC,CAAC,CAAC,EAAE;;;;CAIzD,CAAC,CAAC,CAAC,EAAE,CAAC;EACL,MAAM,KAAK,GAAG,gBAAgB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;WAClC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;WAClC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;kBAC1C,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;iBAC9C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE;IACpC,KAAK;;CAER,CAAC;EACA,OA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,WAAW,EAAE;MACX,OAAO,EAAE,MAAM;MACf,WAAW,EAAE,sHAAsH;MACnI,IAAI,EAAE,cAAc;MACpB,KAAK,EAAE;QACL,QAAQ,EAAE,YAAY;QACtB,YAAY,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAC;OACnC;KACF;IACD,UAAU,EAAE;MACV,OAAO,EAAE,MAAM;MACf,WAAW,EAAE,8IAA8I;MAC3J,IAAI,EAAE,aAAa;MACnB,KAAK,EAAE;QACL,QAAQ,EAAE,YAAY;QACtB,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAC;OACjC;KACF;IACD,cAAc,EAAE;MACd,OAAO,EAAE,MAAM;MACf,WAAW,EAAE,0IAA0I;MACvJ,IAAI,EAAE,gBAAgB;MACtB,KAAK,EAAE;QACL,QAAQ,EAAE,gBAAgB;QAC1B,YAAY,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAC;OACnC;KACF;IACD,aAAa,EAAE;MACb,OAAO,EAAE,MAAM;MACf,WAAW,EAAE,yIAAyI;MACtJ,IAAI,EAAE,eAAe;MACrB,KAAK,EAAE;QACL,QAAQ,EAAE,gBAAgB;QAC1B,YAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAC;OACjC;KACF;GACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;EACrB,IAAI,EAAE;IACJ,KAAK,EAAE,8GAA8G;IACrH,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,EAAE;IAClB,aAAa,EAAE,EAAE;GAClB;CACF,CAAC","sourcesContent":["import { getColorsWithDepths } from \"../../../utils/utils\";\n\nconst colors = getColorsWithDepths();\n\nconst renderCuraDisplay = (label: string, args: any) => {\n const styles = args.cssMarginBlock || args.cssLineHeight ? `<style>\n cura-display { ${args.cssMarginBlock ? `\n --margin-block: ${args.cssMarginBlock} !important;` : ``}${ args.cssLineHeight ? `\n --line-height: ${args.cssLineHeight} !important;` : ``}\n }\n</style>\n\n` : '';\n const block = `<cura-display${args.level ? `\n level=\"${args.level}\"` : ''}${args.color ? `\n color=\"${args.color}\"` : ''}${args.spotColor ? `\n spot-color=\"${args.spotColor}\"` : ''}${args.marginBlock ? `\n margin-block=\"${args.marginBlock}\"` : ''}${args.lineHeight ? `\n line-height=\"${args.lineHeight}\"` : ''}>\n ${label}\n</cura-display>\n`;\n return `${styles}${block}${block}${block}`;\n}\n\nexport default {\n title: 'Componentes/Text/Display',\n tags: ['autodocs'],\n render: ({ label, ...args }) => {\n return renderCuraDisplay(label, args);\n },\n argTypes: {\n label: {\n control: 'text',\n description: 'Define o texto do componente diretamente.',\n name: 'Content'\n },\n color: {\n control: { type: 'select' },\n options: ['', ...colors],\n description: 'Define a cor de texto do bloco. Aceita qualquer valor do esquema de cores do design system.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'Cor de texto padrão do tema'}\n }\n },\n spotColor: {\n control: { type: 'select' },\n options: ['', ...colors],\n description: 'Define a cor dos itens de interação dentro do bloco de texto como as tags `<a>`. Aceita qualquer valor do esquema de cores do design system.',\n name: 'spot-color',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'accent-dark'}\n }\n },\n level: {\n control: { type: 'number', min: 1, max: 6, step: 1 },\n description: 'Define a tag semântica do título. Ex. h1, h2, h3, etc. A semântica é independente do estilo aplicado.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 1}\n }\n },\n marginBlock: {\n control: 'text',\n description: 'Define o tamanho do espaçamento superior e inferior do bloco. Valores válidos para a propriedade CSS `margin-block`.',\n name: 'margin-block',\n table: {\n category: 'Properties',\n defaultValue: { summary: '1.25em'}\n }\n },\n lineHeight: {\n control: 'text',\n description: 'Define a altura de linha base a ser considerada pelo componente em sua responsividade. Valores válidos para a propriedade CSS `line-height`.',\n name: 'line-height',\n table: {\n category: 'Properties',\n defaultValue: { summary: '130%'}\n }\n },\n cssMarginBlock: {\n control: 'text',\n description: 'Permite a definição da propriedade `margin-block` por folhas de estilo. É necessário o uso do `!important` conforme o exemplo de código.',\n name: '--margin-block',\n table: {\n category: 'CSS Properties',\n defaultValue: { summary: '1.25em'}\n }\n },\n cssLineHeight: {\n control: 'text',\n description: 'Permite a definição da propriedade `line-height` por folhas de estilo. É necessário o uso do `!important` conforme o exemplo de código.',\n name: '--line-height',\n table: {\n category: 'CSS Properties',\n defaultValue: { summary: '130%'}\n }\n },\n },\n};\n\nexport const Display = {\n args: {\n label: 'Dolor sit <a href=\"https://www.rededorsaoluiz.com.br\" target=\"_blank\">amet</a>, consectetur adipiscing elit.',\n level: '',\n color: '',\n spotColor: '',\n marginBlock: '',\n lineHeight: '',\n cssMarginBlock: '',\n cssLineHeight: ''\n },\n};\n"]}
|
|
@@ -11,82 +11,108 @@
|
|
|
11
11
|
* Responsive media for large only.
|
|
12
12
|
* Use: @include large-only() { ... }
|
|
13
13
|
*/
|
|
14
|
-
/**
|
|
15
|
-
* Responsive media for large and up.
|
|
16
|
-
* Use: @include large-up() { ... }
|
|
17
|
-
*/
|
|
18
14
|
/**
|
|
19
15
|
* Responsive media for xlarge only.
|
|
20
16
|
* Use: @include xlarge-only() { ... }
|
|
21
17
|
*/
|
|
18
|
+
/**
|
|
19
|
+
* Responsive media for medium to large.
|
|
20
|
+
* Use: @include medium-large() { ... }
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Responsive media for large and up.
|
|
24
|
+
* Use: @include large-up() { ... }
|
|
25
|
+
*/
|
|
22
26
|
:host {
|
|
23
27
|
display: block;
|
|
24
|
-
font-size: var(--font-size);
|
|
28
|
+
font-size: var(--font-size-base);
|
|
25
29
|
}
|
|
26
30
|
:host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
|
|
27
31
|
font-family: var(--font-family);
|
|
28
|
-
font-size: 1.
|
|
32
|
+
font-size: 1.714em;
|
|
29
33
|
font-weight: var(--font-weight-regular);
|
|
30
34
|
color: var(--color-body);
|
|
31
|
-
line-height:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
margin-block-end: var(--block-margin);
|
|
35
|
+
line-height: var(--line-height);
|
|
36
|
+
margin-block: var(--margin-block);
|
|
37
|
+
letter-spacing: 0px;
|
|
35
38
|
}
|
|
36
39
|
:host h1.bold-weight, :host h2.bold-weight, :host h3.bold-weight, :host h4.bold-weight, :host h5.bold-weight, :host h6.bold-weight {
|
|
37
40
|
font-weight: var(--font-weight-medium);
|
|
38
41
|
}
|
|
39
42
|
:host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
|
|
40
|
-
font-size: 2.
|
|
41
|
-
letter-spacing: -
|
|
43
|
+
font-size: 2.071em;
|
|
44
|
+
letter-spacing: -0.58px;
|
|
42
45
|
}
|
|
43
46
|
:host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
|
|
44
47
|
font-size: 1.214em;
|
|
45
|
-
line-height:
|
|
46
|
-
|
|
48
|
+
line-height: calc(var(--line-height) + 20%);
|
|
49
|
+
}
|
|
50
|
+
:host h1.small.bold-weight, :host h1.small ::slotted(b), :host h1.small ::slotted(strong), :host h2.small.bold-weight, :host h2.small ::slotted(b), :host h2.small ::slotted(strong), :host h3.small.bold-weight, :host h3.small ::slotted(b), :host h3.small ::slotted(strong), :host h4.small.bold-weight, :host h4.small ::slotted(b), :host h4.small ::slotted(strong), :host h5.small.bold-weight, :host h5.small ::slotted(b), :host h5.small ::slotted(strong), :host h6.small.bold-weight, :host h6.small ::slotted(b), :host h6.small ::slotted(strong) {
|
|
51
|
+
font-weight: var(--font-weight-bold);
|
|
52
|
+
}
|
|
53
|
+
:host h1.xsmall, :host h2.xsmall, :host h3.xsmall, :host h4.xsmall, :host h5.xsmall, :host h6.xsmall {
|
|
54
|
+
font-size: 0.714em;
|
|
55
|
+
font-weight: var(--font-weight-medium);
|
|
56
|
+
letter-spacing: 0.6px;
|
|
47
57
|
}
|
|
48
|
-
:host h1.
|
|
58
|
+
:host h1.xsmall.bold-weight, :host h1.xsmall ::slotted(b), :host h1.xsmall ::slotted(strong), :host h2.xsmall.bold-weight, :host h2.xsmall ::slotted(b), :host h2.xsmall ::slotted(strong), :host h3.xsmall.bold-weight, :host h3.xsmall ::slotted(b), :host h3.xsmall ::slotted(strong), :host h4.xsmall.bold-weight, :host h4.xsmall ::slotted(b), :host h4.xsmall ::slotted(strong), :host h5.xsmall.bold-weight, :host h5.xsmall ::slotted(b), :host h5.xsmall ::slotted(strong), :host h6.xsmall.bold-weight, :host h6.xsmall ::slotted(b), :host h6.xsmall ::slotted(strong) {
|
|
49
59
|
font-weight: var(--font-weight-bold);
|
|
50
60
|
}
|
|
51
|
-
@media (min-width:
|
|
61
|
+
@media (min-width: 769px) and (max-width: 1920px) {
|
|
52
62
|
:host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
|
|
53
63
|
font-size: 2em;
|
|
54
64
|
}
|
|
55
65
|
:host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
|
|
56
66
|
font-size: 2.357em;
|
|
67
|
+
letter-spacing: -0.66px;
|
|
57
68
|
}
|
|
58
69
|
:host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
|
|
59
70
|
font-size: 1.357em;
|
|
60
71
|
}
|
|
72
|
+
:host h1.xsmall, :host h2.xsmall, :host h3.xsmall, :host h4.xsmall, :host h5.xsmall, :host h6.xsmall {
|
|
73
|
+
font-size: 0.857em;
|
|
74
|
+
line-height: calc(var(--line-height) + 3%);
|
|
75
|
+
letter-spacing: 0.72px;
|
|
76
|
+
}
|
|
61
77
|
}
|
|
62
|
-
@media (min-width:
|
|
78
|
+
@media (min-width: 1921px) {
|
|
63
79
|
:host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
|
|
64
80
|
font-size: 2.5em;
|
|
65
|
-
line-height:
|
|
66
|
-
letter-spacing: -
|
|
81
|
+
line-height: calc(var(--line-height) + 5%);
|
|
82
|
+
letter-spacing: -0.82px;
|
|
67
83
|
}
|
|
68
84
|
:host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
|
|
69
|
-
font-size: 2.
|
|
85
|
+
font-size: 2.929em;
|
|
70
86
|
}
|
|
71
87
|
:host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
|
|
72
|
-
font-size: 1.
|
|
73
|
-
line-height:
|
|
88
|
+
font-size: 1.714em;
|
|
89
|
+
line-height: calc(var(--line-height) + 30%);
|
|
74
90
|
letter-spacing: 0%;
|
|
75
91
|
}
|
|
92
|
+
:host h1.xsmall, :host h2.xsmall, :host h3.xsmall, :host h4.xsmall, :host h5.xsmall, :host h6.xsmall {
|
|
93
|
+
font-size: 1em;
|
|
94
|
+
line-height: calc(var(--line-height) + 12.857%);
|
|
95
|
+
letter-spacing: 0.28px;
|
|
96
|
+
}
|
|
76
97
|
}
|
|
77
98
|
:host ::slotted(b), :host ::slotted(strong) {
|
|
78
|
-
font-weight: var(--font-weight-
|
|
99
|
+
font-weight: var(--font-weight-medium);
|
|
79
100
|
}
|
|
80
101
|
:host ::slotted(a) {
|
|
81
102
|
font-weight: var(--font-weight-bold);
|
|
82
103
|
color: var(--color-link);
|
|
83
|
-
text-decoration: none;
|
|
84
104
|
text-underline-offset: 10%;
|
|
85
105
|
cursor: pointer;
|
|
86
106
|
}
|
|
107
|
+
:host ::slotted(u) {
|
|
108
|
+
text-underline-offset: 10%;
|
|
109
|
+
}
|
|
87
110
|
:host ::slotted(abbr) {
|
|
88
111
|
color: var(--color-link);
|
|
89
112
|
text-decoration: underline dashed 1px var(--color-link);
|
|
90
113
|
text-underline-offset: 10%;
|
|
91
114
|
cursor: default;
|
|
115
|
+
}
|
|
116
|
+
:host ::slotted(i), :host ::slotted(em) {
|
|
117
|
+
font-weight: var(--font-weight-medium);
|
|
92
118
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
2
|
export class CuraHeading {
|
|
3
3
|
constructor() {
|
|
4
|
+
this.theme = window.CuraAPI.theme;
|
|
4
5
|
this.level = 1;
|
|
5
|
-
this.size = '
|
|
6
|
+
this.size = 'medium';
|
|
6
7
|
this.weight = 'regular';
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
8
|
+
this.spotColor = 'accent-dark';
|
|
9
|
+
this.color = undefined;
|
|
10
|
+
this.marginBlock = '1.25em';
|
|
11
|
+
this.lineHeight = '130%';
|
|
12
|
+
this.styles = {};
|
|
13
|
+
}
|
|
14
|
+
handleChangeColor() {
|
|
15
|
+
this.setColors();
|
|
9
16
|
}
|
|
10
17
|
connectedCallback() {
|
|
11
|
-
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
12
18
|
this.setFontProperties();
|
|
13
19
|
this.setColors();
|
|
14
20
|
}
|
|
@@ -19,28 +25,28 @@ export class CuraHeading {
|
|
|
19
25
|
return classes;
|
|
20
26
|
}
|
|
21
27
|
setFontProperties() {
|
|
28
|
+
this.weights = this.theme.fonts.getWeights();
|
|
29
|
+
this.fontSizeBase = this.theme.fonts.getSize();
|
|
22
30
|
this.styles = {
|
|
23
31
|
'--font-family': window.CuraAPI.theme.fonts.getFamily('heading'),
|
|
24
|
-
'--font-size': window.CuraAPI.theme.fonts.getSize(),
|
|
25
32
|
'--font-weight-regular': this.weights.regular,
|
|
26
33
|
'--font-weight-medium': this.weights.medium,
|
|
27
34
|
'--font-weight-bold': this.weights.bold,
|
|
28
35
|
'--font-weight-black': this.weights.black
|
|
29
36
|
};
|
|
30
|
-
this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());
|
|
31
|
-
this.setHostProperty('--block-margin', '0.5em');
|
|
32
37
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)
|
|
40
|
-
: window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`);
|
|
38
|
+
hostCSSProperties() {
|
|
39
|
+
return {
|
|
40
|
+
'--margin-block': this.marginBlock,
|
|
41
|
+
'--font-size-base': this.fontSizeBase,
|
|
42
|
+
'--line-height': this.lineHeight
|
|
43
|
+
};
|
|
41
44
|
}
|
|
42
|
-
|
|
43
|
-
this.
|
|
45
|
+
setColors() {
|
|
46
|
+
const fontColor = this.color
|
|
47
|
+
? this.theme.colors.getColor(this.color)
|
|
48
|
+
: this.theme.fonts.getColor();
|
|
49
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-body': fontColor || this.theme.colors.getColor('neutral-darker'), '--color-link': this.theme.colors.getColor(`${this.spotColor}`) });
|
|
44
50
|
}
|
|
45
51
|
getHeadingTag() {
|
|
46
52
|
const tags = {
|
|
@@ -55,7 +61,7 @@ export class CuraHeading {
|
|
|
55
61
|
return tags[`${this.level}`] || tags['default'];
|
|
56
62
|
}
|
|
57
63
|
render() {
|
|
58
|
-
return (h(Host,
|
|
64
|
+
return (h(Host, { style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
59
65
|
}
|
|
60
66
|
static get is() { return "cura-heading"; }
|
|
61
67
|
static get encapsulation() { return "shadow"; }
|
|
@@ -75,15 +81,15 @@ export class CuraHeading {
|
|
|
75
81
|
"type": "number",
|
|
76
82
|
"mutable": false,
|
|
77
83
|
"complexType": {
|
|
78
|
-
"original": "
|
|
79
|
-
"resolved": "
|
|
84
|
+
"original": "1 | 2 | 3 | 4 | 5 | 6",
|
|
85
|
+
"resolved": "1 | 2 | 3 | 4 | 5 | 6",
|
|
80
86
|
"references": {}
|
|
81
87
|
},
|
|
82
88
|
"required": false,
|
|
83
89
|
"optional": false,
|
|
84
90
|
"docs": {
|
|
85
91
|
"tags": [],
|
|
86
|
-
"text": "Heading level for semantics
|
|
92
|
+
"text": "Heading level for semantics. Will render the related HTML tag <h1>, <h2>, ...\nValues: 1(default) to 6."
|
|
87
93
|
},
|
|
88
94
|
"attribute": "level",
|
|
89
95
|
"reflect": true,
|
|
@@ -93,57 +99,57 @@ export class CuraHeading {
|
|
|
93
99
|
"type": "string",
|
|
94
100
|
"mutable": false,
|
|
95
101
|
"complexType": {
|
|
96
|
-
"original": "
|
|
97
|
-
"resolved": "
|
|
102
|
+
"original": "'regular' | 'medium' | 'large' | 'small' | 'caption' | 'xsmall'",
|
|
103
|
+
"resolved": "\"caption\" | \"large\" | \"medium\" | \"regular\" | \"small\" | \"xsmall\"",
|
|
98
104
|
"references": {}
|
|
99
105
|
},
|
|
100
106
|
"required": false,
|
|
101
107
|
"optional": false,
|
|
102
108
|
"docs": {
|
|
103
109
|
"tags": [],
|
|
104
|
-
"text": "Heading style size.\nValues: small |
|
|
110
|
+
"text": "Heading style size.\nValues: regular (deprecated), medium (default) | large | small | caption (deprecated) | xsmall."
|
|
105
111
|
},
|
|
106
112
|
"attribute": "size",
|
|
107
113
|
"reflect": true,
|
|
108
|
-
"defaultValue": "'
|
|
114
|
+
"defaultValue": "'medium'"
|
|
109
115
|
},
|
|
110
116
|
"weight": {
|
|
111
117
|
"type": "string",
|
|
112
118
|
"mutable": false,
|
|
113
119
|
"complexType": {
|
|
114
|
-
"original": "
|
|
115
|
-
"resolved": "
|
|
120
|
+
"original": "'regular' | 'bold'",
|
|
121
|
+
"resolved": "\"bold\" | \"regular\"",
|
|
116
122
|
"references": {}
|
|
117
123
|
},
|
|
118
124
|
"required": false,
|
|
119
125
|
"optional": false,
|
|
120
126
|
"docs": {
|
|
121
127
|
"tags": [],
|
|
122
|
-
"text": "Heading font weight.\nValues: regular(default) | bold."
|
|
128
|
+
"text": "Heading font weight. It is possible to use regular HTML tags like <b> or <strong> as well.\nValues: regular (default) | bold."
|
|
123
129
|
},
|
|
124
130
|
"attribute": "weight",
|
|
125
131
|
"reflect": true,
|
|
126
132
|
"defaultValue": "'regular'"
|
|
127
133
|
},
|
|
128
|
-
"
|
|
129
|
-
"type": "
|
|
134
|
+
"spotColor": {
|
|
135
|
+
"type": "string",
|
|
130
136
|
"mutable": false,
|
|
131
137
|
"complexType": {
|
|
132
|
-
"original": "
|
|
133
|
-
"resolved": "
|
|
138
|
+
"original": "string",
|
|
139
|
+
"resolved": "string",
|
|
134
140
|
"references": {}
|
|
135
141
|
},
|
|
136
142
|
"required": false,
|
|
137
143
|
"optional": false,
|
|
138
144
|
"docs": {
|
|
139
145
|
"tags": [],
|
|
140
|
-
"text": "Apply
|
|
146
|
+
"text": "Apply design system color to interactive elements like <a> and <abbr> inside the text.\nValues: Color from design system scheme. Default to 'accent-dark'."
|
|
141
147
|
},
|
|
142
|
-
"attribute": "
|
|
148
|
+
"attribute": "spot-color",
|
|
143
149
|
"reflect": true,
|
|
144
|
-
"defaultValue": "
|
|
150
|
+
"defaultValue": "'accent-dark'"
|
|
145
151
|
},
|
|
146
|
-
"
|
|
152
|
+
"color": {
|
|
147
153
|
"type": "string",
|
|
148
154
|
"mutable": false,
|
|
149
155
|
"complexType": {
|
|
@@ -155,14 +161,63 @@ export class CuraHeading {
|
|
|
155
161
|
"optional": false,
|
|
156
162
|
"docs": {
|
|
157
163
|
"tags": [],
|
|
158
|
-
"text": "
|
|
164
|
+
"text": "Text color.\nValues: Color from design system scheme. Default to the font color from the theme."
|
|
159
165
|
},
|
|
160
|
-
"attribute": "
|
|
166
|
+
"attribute": "color",
|
|
167
|
+
"reflect": false
|
|
168
|
+
},
|
|
169
|
+
"marginBlock": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"mutable": false,
|
|
172
|
+
"complexType": {
|
|
173
|
+
"original": "string",
|
|
174
|
+
"resolved": "string",
|
|
175
|
+
"references": {}
|
|
176
|
+
},
|
|
177
|
+
"required": false,
|
|
178
|
+
"optional": false,
|
|
179
|
+
"docs": {
|
|
180
|
+
"tags": [],
|
|
181
|
+
"text": "CSS margin-block property values.\nDefault to 1.25em"
|
|
182
|
+
},
|
|
183
|
+
"attribute": "margin-block",
|
|
184
|
+
"reflect": true,
|
|
185
|
+
"defaultValue": "'1.25em'"
|
|
186
|
+
},
|
|
187
|
+
"lineHeight": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"mutable": false,
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "string",
|
|
192
|
+
"resolved": "string",
|
|
193
|
+
"references": {}
|
|
194
|
+
},
|
|
195
|
+
"required": false,
|
|
196
|
+
"optional": false,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [],
|
|
199
|
+
"text": "CSS line-height property values.\nDefault to 140%"
|
|
200
|
+
},
|
|
201
|
+
"attribute": "line-height",
|
|
161
202
|
"reflect": true,
|
|
162
|
-
"defaultValue": "'
|
|
203
|
+
"defaultValue": "'130%'"
|
|
163
204
|
}
|
|
164
205
|
};
|
|
165
206
|
}
|
|
207
|
+
static get states() {
|
|
208
|
+
return {
|
|
209
|
+
"styles": {}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
166
212
|
static get elementRef() { return "host"; }
|
|
213
|
+
static get watchers() {
|
|
214
|
+
return [{
|
|
215
|
+
"propName": "color",
|
|
216
|
+
"methodName": "handleChangeColor"
|
|
217
|
+
}, {
|
|
218
|
+
"propName": "spotColor",
|
|
219
|
+
"methodName": "handleChangeColor"
|
|
220
|
+
}];
|
|
221
|
+
}
|
|
167
222
|
}
|
|
168
223
|
//# sourceMappingURL=cura-heading.js.map
|
|
@@ -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;
|
|
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,KAAK,EAAE,KAAK,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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,IAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,IACjC,IAAI,CAAC,aAAa,EAAE,CACjB,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, h, Prop, Element, Watch, State } 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. Will render the related HTML tag <h1>, <h2>, ...\n * Values: 1(default) to 6.\n */\n @Prop({reflect: true}) level: 1 | 2 | 3 | 4 | 5 | 6 = 1;\n\n /**\n * Heading style size.\n * Values: regular (deprecated), medium (default) | large | small | caption (deprecated) | xsmall.\n */\n @Prop({reflect: true}) size: 'regular' | 'medium' | 'large' | 'small' | 'caption' | 'xsmall' = 'medium';\n\n /**\n * Heading font weight. It is possible to use regular HTML tags like <b> or <strong> as well.\n * Values: regular (default) | bold.\n */\n @Prop({reflect: true}) weight: 'regular' | 'bold' = 'regular';\n\n /**\n * Apply design system color to interactive elements like <a> and <abbr> inside the text.\n * Values: Color from design system scheme. Default to 'accent-dark'.\n */\n @Prop({reflect: true}) spotColor = 'accent-dark';\n\n /**\n * Text color.\n * Values: Color from design system scheme. Default to the font color from the theme.\n */\n @Prop() color: string;\n @Watch('color')\n @Watch('spotColor')\n handleChangeColor() {\n this.setColors();\n }\n\n /**\n * CSS margin-block property values.\n * Default to 1.25em\n */\n @Prop({reflect: true}) marginBlock = '1.25em';\n\n /**\n * CSS line-height property values.\n * Default to 140%\n */\n @Prop({reflect: true}) lineHeight = '130%';\n\n /**\n * Host element <cura-heading>\n */\n @Element() host: HTMLElement;\n\n /**\n * Internal Props\n */\n weights: any;\n fontSizeBase: string;\n @State() styles = {};\n theme = window.CuraAPI.theme;\n\n connectedCallback() {\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.weights = this.theme.fonts.getWeights();\n this.fontSizeBase = this.theme.fonts.getSize();\n this.styles = {\n '--font-family': window.CuraAPI.theme.fonts.getFamily('heading'),\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 }\n\n hostCSSProperties() {\n return {\n '--margin-block': this.marginBlock,\n '--font-size-base': this.fontSizeBase,\n '--line-height': this.lineHeight\n };\n }\n\n setColors() {\n const fontColor = this.color\n ? this.theme.colors.getColor(this.color)\n : this.theme.fonts.getColor();\n this.styles = {\n ...this.styles,\n '--color-body': fontColor || this.theme.colors.getColor('neutral-darker'),\n '--color-link': this.theme.colors.getColor(`${this.spotColor}`)\n };\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 style={this.hostCSSProperties()}>\n { this.getHeadingTag() }\n </Host>\n );\n }\n\n}\n"]}
|