@rededor/cura 0.5.0 → 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 +3 -3
- package/dist/cjs/{index-72217b50.js → index-404d93e9.js} +247 -3
- package/dist/cjs/index-404d93e9.js.map +1 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- 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/cura-accordion.stories.js +1 -1
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +10 -6
- package/dist/collection/components/buttons/cura-button/cura-button.js +4 -3
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +4 -3
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +4 -3
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -1
- package/dist/collection/components/cura-icon/cura-icon.stories.js +1 -1
- package/dist/collection/components/cura-icon/cura-icon.stories.js.map +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.stories.js.map +1 -1
- 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/loaders/cura-loader-circle/cura-loader-circle.stories.js +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.stories.js.map +1 -1
- 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 +79 -34
- 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 +93 -37
- 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 +79 -47
- 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-button-outline.js +1 -1
- package/dist/components/cura-button-outline.js.map +1 -1
- package/dist/components/cura-button-transparent.js +1 -1
- package/dist/components/cura-button-transparent.js.map +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-button.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-46d20db3.js +3 -0
- package/dist/cura/p-46d20db3.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-c0c00396.system.js +3 -0
- package/dist/cura/p-c0c00396.system.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 +4 -4
- package/dist/esm/{index-9af0cdbd.js → index-d99da69e.js} +247 -3
- package/dist/esm/index-d99da69e.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +4 -4
- 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-d99da69e.js +3 -0
- package/dist/esm-es5/index-d99da69e.js.map +1 -0
- 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/buttons/cura-button/cura-button.d.ts +1 -1
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +1 -1
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +1 -1
- 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 +145 -52
- 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/cjs/index-72217b50.js.map +0 -1
- package/dist/cura/p-2cbf52f1.js +0 -3
- package/dist/cura/p-2cbf52f1.js.map +0 -1
- package/dist/cura/p-4cdbc8a1.system.entry.js +0 -2
- package/dist/cura/p-4cdbc8a1.system.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-788e035b.system.js +0 -2
- package/dist/cura/p-788e035b.system.js.map +0 -1
- package/dist/cura/p-8da635b7.system.js +0 -3
- package/dist/cura/p-8da635b7.system.js.map +0 -1
- package/dist/cura/p-c54ce246.entry.js +0 -2
- package/dist/cura/p-c54ce246.entry.js.map +0 -1
- package/dist/cura/p-d5c64a5f.js +0 -2
- package/dist/cura/p-d5c64a5f.js.map +0 -1
- package/dist/cura/p-f4232daa.system.js +0 -2
- package/dist/cura/p-f4232daa.system.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/index-9af0cdbd.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
- package/dist/esm-es5/index-9af0cdbd.js +0 -3
- package/dist/esm-es5/index-9af0cdbd.js.map +0 -1
|
@@ -11,59 +11,40 @@
|
|
|
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);
|
|
25
|
-
text-transform: uppercase;
|
|
28
|
+
font-size: var(--font-size-base);
|
|
26
29
|
}
|
|
27
30
|
:host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
|
|
28
31
|
font-family: var(--font-family);
|
|
29
|
-
font-size: 4.285em;
|
|
30
|
-
font-weight: var(--font-weight-black);
|
|
31
|
-
color: var(--color-body);
|
|
32
|
-
line-height: 120%;
|
|
33
|
-
letter-spacing: -4%;
|
|
34
|
-
margin-block-start: var(--block-margin);
|
|
35
|
-
margin-block-end: var(--block-margin);
|
|
36
|
-
}
|
|
37
|
-
:host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
|
|
38
|
-
font-size: 6.21em;
|
|
39
|
-
}
|
|
40
|
-
:host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
|
|
41
32
|
font-size: 3em;
|
|
42
33
|
font-weight: var(--font-weight-bold);
|
|
34
|
+
color: var(--color-body);
|
|
35
|
+
line-height: var(--line-height);
|
|
36
|
+
margin-block: var(--margin-block);
|
|
37
|
+
letter-spacing: 0px;
|
|
43
38
|
}
|
|
44
|
-
@media (min-width:
|
|
39
|
+
@media (min-width: 769px) and (max-width: 1920px) {
|
|
45
40
|
:host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
|
|
46
|
-
font-size:
|
|
47
|
-
}
|
|
48
|
-
:host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
|
|
49
|
-
font-size: 7.07em;
|
|
50
|
-
}
|
|
51
|
-
:host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
|
|
52
|
-
font-size: 3.428em;
|
|
41
|
+
font-size: 3.429em;
|
|
53
42
|
}
|
|
54
43
|
}
|
|
55
|
-
@media (min-width:
|
|
44
|
+
@media (min-width: 1921px) {
|
|
56
45
|
:host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
|
|
57
|
-
font-size:
|
|
58
|
-
line-height:
|
|
59
|
-
}
|
|
60
|
-
:host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
|
|
61
|
-
font-size: 8.857em;
|
|
62
|
-
letter-spacing: -6%;
|
|
63
|
-
}
|
|
64
|
-
:host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
|
|
65
|
-
font-size: 4.285em;
|
|
66
|
-
letter-spacing: -2%;
|
|
46
|
+
font-size: 4.286em;
|
|
47
|
+
line-height: calc(var(--line-height) + 5%);
|
|
67
48
|
}
|
|
68
49
|
}
|
|
69
50
|
:host ::slotted(b), :host ::slotted(strong) {
|
|
@@ -72,10 +53,12 @@
|
|
|
72
53
|
:host ::slotted(a) {
|
|
73
54
|
font-weight: var(--font-weight-bold);
|
|
74
55
|
color: var(--color-link);
|
|
75
|
-
text-decoration: none;
|
|
76
56
|
text-underline-offset: 10%;
|
|
77
57
|
cursor: pointer;
|
|
78
58
|
}
|
|
59
|
+
:host ::slotted(u) {
|
|
60
|
+
text-underline-offset: 10%;
|
|
61
|
+
}
|
|
79
62
|
:host ::slotted(abbr) {
|
|
80
63
|
color: var(--color-link);
|
|
81
64
|
text-decoration: underline dashed 1px var(--color-link);
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import { Host, h } from '@stencil/core';
|
|
2
2
|
export class CuraDisplay {
|
|
3
3
|
constructor() {
|
|
4
|
+
this.theme = window.CuraAPI.theme;
|
|
4
5
|
this.level = 1;
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
6
|
+
this.spotColor = 'accent-dark';
|
|
7
|
+
this.color = undefined;
|
|
8
|
+
this.marginBlock = '1.25em';
|
|
9
|
+
this.lineHeight = '120%';
|
|
10
|
+
this.styles = {};
|
|
11
|
+
}
|
|
12
|
+
handleChangeColor() {
|
|
13
|
+
this.setColors();
|
|
8
14
|
}
|
|
9
15
|
connectedCallback() {
|
|
10
|
-
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
11
16
|
this.setFontProperties();
|
|
12
17
|
this.setColors();
|
|
13
18
|
}
|
|
14
|
-
getClasses() {
|
|
15
|
-
const classes = {};
|
|
16
|
-
classes[this.size.toLowerCase()] = true;
|
|
17
|
-
return classes;
|
|
18
|
-
}
|
|
19
19
|
setFontProperties() {
|
|
20
|
+
this.weights = this.theme.fonts.getWeights();
|
|
21
|
+
this.fontSizeBase = this.theme.fonts.getSize();
|
|
20
22
|
this.styles = {
|
|
21
23
|
'--font-family': window.CuraAPI.theme.fonts.getFamily('display'),
|
|
22
24
|
'--font-size': window.CuraAPI.theme.fonts.getSize(),
|
|
23
|
-
'--font-weight-bold': this.weights.bold
|
|
24
|
-
'--font-weight-black': this.weights.black
|
|
25
|
+
'--font-weight-bold': this.weights.bold
|
|
25
26
|
};
|
|
26
|
-
this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());
|
|
27
|
-
this.setHostProperty('--block-margin', '0.5em');
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)
|
|
36
|
-
: window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`);
|
|
28
|
+
hostCSSProperties() {
|
|
29
|
+
return {
|
|
30
|
+
'--margin-block': this.marginBlock,
|
|
31
|
+
'--font-size-base': this.fontSizeBase,
|
|
32
|
+
'--line-height': this.lineHeight
|
|
33
|
+
};
|
|
37
34
|
}
|
|
38
|
-
|
|
39
|
-
this.
|
|
35
|
+
setColors() {
|
|
36
|
+
const fontColor = this.color
|
|
37
|
+
? this.theme.colors.getColor(this.color)
|
|
38
|
+
: this.theme.fonts.getColor();
|
|
39
|
+
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}`) });
|
|
40
40
|
}
|
|
41
41
|
getHeadingTag() {
|
|
42
42
|
const tags = {
|
|
43
|
-
'1': h("h1", { style: this.styles
|
|
44
|
-
'2': h("h2", { style: this.styles
|
|
45
|
-
'3': h("h3", { style: this.styles
|
|
46
|
-
'4': h("h4", { style: this.styles
|
|
47
|
-
'5': h("h5", { style: this.styles
|
|
48
|
-
'6': h("h6", { style: this.styles
|
|
49
|
-
'default': h("h1", { style: this.styles
|
|
43
|
+
'1': h("h1", { style: this.styles }, h("slot", null)),
|
|
44
|
+
'2': h("h2", { style: this.styles }, h("slot", null)),
|
|
45
|
+
'3': h("h3", { style: this.styles }, h("slot", null)),
|
|
46
|
+
'4': h("h4", { style: this.styles }, h("slot", null)),
|
|
47
|
+
'5': h("h5", { style: this.styles }, h("slot", null)),
|
|
48
|
+
'6': h("h6", { style: this.styles }, h("slot", null)),
|
|
49
|
+
'default': h("h1", { style: this.styles }, h("slot", null))
|
|
50
50
|
};
|
|
51
51
|
return tags[`${this.level}`] || tags['default'];
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
return (h(Host,
|
|
54
|
+
return (h(Host, { style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "cura-display"; }
|
|
57
57
|
static get encapsulation() { return "shadow"; }
|
|
@@ -71,21 +71,21 @@ export class CuraDisplay {
|
|
|
71
71
|
"type": "number",
|
|
72
72
|
"mutable": false,
|
|
73
73
|
"complexType": {
|
|
74
|
-
"original": "
|
|
75
|
-
"resolved": "
|
|
74
|
+
"original": "1 | 2 | 3 | 4 | 5 | 6",
|
|
75
|
+
"resolved": "1 | 2 | 3 | 4 | 5 | 6",
|
|
76
76
|
"references": {}
|
|
77
77
|
},
|
|
78
78
|
"required": false,
|
|
79
79
|
"optional": false,
|
|
80
80
|
"docs": {
|
|
81
81
|
"tags": [],
|
|
82
|
-
"text": "Heading level for semantics
|
|
82
|
+
"text": "Heading level for semantics. Will render the related HTML tag <h1>, <h2>, ...\nValues: 1(default) to 6."
|
|
83
83
|
},
|
|
84
84
|
"attribute": "level",
|
|
85
85
|
"reflect": true,
|
|
86
86
|
"defaultValue": "1"
|
|
87
87
|
},
|
|
88
|
-
"
|
|
88
|
+
"spotColor": {
|
|
89
89
|
"type": "string",
|
|
90
90
|
"mutable": false,
|
|
91
91
|
"complexType": {
|
|
@@ -97,31 +97,48 @@ export class CuraDisplay {
|
|
|
97
97
|
"optional": false,
|
|
98
98
|
"docs": {
|
|
99
99
|
"tags": [],
|
|
100
|
-
"text": "
|
|
100
|
+
"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'."
|
|
101
101
|
},
|
|
102
|
-
"attribute": "
|
|
102
|
+
"attribute": "spot-color",
|
|
103
103
|
"reflect": true,
|
|
104
|
-
"defaultValue": "'
|
|
104
|
+
"defaultValue": "'accent-dark'"
|
|
105
105
|
},
|
|
106
|
-
"
|
|
107
|
-
"type": "
|
|
106
|
+
"color": {
|
|
107
|
+
"type": "string",
|
|
108
108
|
"mutable": false,
|
|
109
109
|
"complexType": {
|
|
110
|
-
"original": "
|
|
111
|
-
"resolved": "
|
|
110
|
+
"original": "string",
|
|
111
|
+
"resolved": "string",
|
|
112
112
|
"references": {}
|
|
113
113
|
},
|
|
114
114
|
"required": false,
|
|
115
115
|
"optional": false,
|
|
116
116
|
"docs": {
|
|
117
117
|
"tags": [],
|
|
118
|
-
"text": "
|
|
118
|
+
"text": "Text color.\nValues: Color from design system scheme. Default to the font color from the theme."
|
|
119
119
|
},
|
|
120
|
-
"attribute": "
|
|
120
|
+
"attribute": "color",
|
|
121
|
+
"reflect": false
|
|
122
|
+
},
|
|
123
|
+
"marginBlock": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"mutable": false,
|
|
126
|
+
"complexType": {
|
|
127
|
+
"original": "string",
|
|
128
|
+
"resolved": "string",
|
|
129
|
+
"references": {}
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"optional": false,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": "CSS margin-block property values.\nDefault to 1.25em"
|
|
136
|
+
},
|
|
137
|
+
"attribute": "margin-block",
|
|
121
138
|
"reflect": true,
|
|
122
|
-
"defaultValue": "
|
|
139
|
+
"defaultValue": "'1.25em'"
|
|
123
140
|
},
|
|
124
|
-
"
|
|
141
|
+
"lineHeight": {
|
|
125
142
|
"type": "string",
|
|
126
143
|
"mutable": false,
|
|
127
144
|
"complexType": {
|
|
@@ -133,14 +150,28 @@ export class CuraDisplay {
|
|
|
133
150
|
"optional": false,
|
|
134
151
|
"docs": {
|
|
135
152
|
"tags": [],
|
|
136
|
-
"text": "
|
|
153
|
+
"text": "CSS line-height property values.\nDefault to 140%"
|
|
137
154
|
},
|
|
138
|
-
"attribute": "
|
|
155
|
+
"attribute": "line-height",
|
|
139
156
|
"reflect": true,
|
|
140
|
-
"defaultValue": "'
|
|
157
|
+
"defaultValue": "'120%'"
|
|
141
158
|
}
|
|
142
159
|
};
|
|
143
160
|
}
|
|
161
|
+
static get states() {
|
|
162
|
+
return {
|
|
163
|
+
"styles": {}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
144
166
|
static get elementRef() { return "host"; }
|
|
167
|
+
static get watchers() {
|
|
168
|
+
return [{
|
|
169
|
+
"propName": "color",
|
|
170
|
+
"methodName": "handleChangeColor"
|
|
171
|
+
}, {
|
|
172
|
+
"propName": "spotColor",
|
|
173
|
+
"methodName": "handleChangeColor"
|
|
174
|
+
}];
|
|
175
|
+
}
|
|
145
176
|
}
|
|
146
177
|
//# sourceMappingURL=cura-display.js.map
|
|
@@ -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,EAA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, 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
|
-
title: '
|
|
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;AA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,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"]}
|