@rededor/cura 0.2.0 → 0.3.0

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.
Files changed (96) hide show
  1. package/dist/cjs/app-globals-5f5b9fbf.js +398 -0
  2. package/dist/cjs/cura-display_3.cjs.entry.js +187 -0
  3. package/dist/cjs/cura-icon.cjs.entry.js +59 -0
  4. package/dist/cjs/{cura-icon_2.cjs.entry.js → cura-icons-view.cjs.entry.js} +2 -56
  5. package/dist/cjs/cura.cjs.js +3 -3
  6. package/dist/cjs/{index-9092c64d.js → index-8686299e.js} +29 -0
  7. package/dist/cjs/loader.cjs.js +3 -3
  8. package/dist/collection/api/cura-api.js +10 -1
  9. package/dist/collection/api/modules/cura-theme-colors-module.js +69 -0
  10. package/dist/collection/api/modules/cura-theme-fonts-module.js +35 -0
  11. package/dist/collection/api/modules/cura-theme-module.js +4 -0
  12. package/dist/collection/api/theme-presets/static.js +103 -0
  13. package/dist/collection/api/theme-presets/theme-default.js +28 -22
  14. package/dist/collection/api/theme-presets/theme-maternity.js +10 -12
  15. package/dist/collection/collection-manifest.json +3 -1
  16. package/dist/collection/components/cura-icon/cura-icon.css +1 -42
  17. package/dist/collection/components/cura-icon/cura-icon.js +15 -12
  18. package/dist/collection/components/cura-icons-view/cura-icons-view.js +1 -1
  19. package/dist/collection/components/text/cura-display/cura-display.css +61 -0
  20. package/dist/collection/components/text/cura-display/cura-display.js +110 -0
  21. package/dist/collection/components/text/cura-heading/cura-heading.css +69 -0
  22. package/dist/collection/components/text/cura-heading/cura-heading.js +136 -0
  23. package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +81 -0
  24. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +76 -0
  25. package/dist/components/{dummy-component.d.ts → cura-display.d.ts} +4 -4
  26. package/dist/components/cura-display.js +86 -0
  27. package/dist/components/cura-heading.d.ts +11 -0
  28. package/dist/components/cura-heading.js +95 -0
  29. package/dist/components/cura-icon2.js +12 -13
  30. package/dist/components/cura-icons-view.js +1 -1
  31. package/dist/components/cura-paragraph.d.ts +11 -0
  32. package/dist/components/cura-paragraph.js +69 -0
  33. package/dist/components/index.d.ts +3 -1
  34. package/dist/components/index.js +261 -36
  35. package/dist/cura/cura.esm.js +1 -1
  36. package/dist/cura/cura.js +1 -1
  37. package/dist/cura/p-22290742.entry.js +1 -0
  38. package/dist/cura/p-265c1706.js +1 -0
  39. package/dist/cura/p-3d8bbf37.system.js +1 -0
  40. package/dist/cura/p-5ae0d10c.system.entry.js +1 -0
  41. package/dist/cura/p-80dc1c9f.entry.js +1 -0
  42. package/dist/cura/p-9312a846.system.entry.js +1 -0
  43. package/dist/cura/p-a50716bc.js +2 -0
  44. package/dist/cura/p-a8dcaaed.system.js +1 -0
  45. package/dist/cura/p-d29b9e16.entry.js +1 -0
  46. package/dist/cura/p-e447016d.system.js +2 -0
  47. package/dist/cura/p-e8fadcfa.system.entry.js +1 -0
  48. package/dist/esm/app-globals-d7dd3a4d.js +396 -0
  49. package/dist/esm/cura-display_3.entry.js +181 -0
  50. package/dist/esm/cura-icon.entry.js +55 -0
  51. package/dist/esm/{cura-icon_2.entry.js → cura-icons-view.entry.js} +3 -56
  52. package/dist/esm/cura.js +3 -3
  53. package/dist/esm/{index-cec9b650.js → index-c3d31886.js} +29 -0
  54. package/dist/esm/loader.js +3 -3
  55. package/dist/esm-es5/app-globals-d7dd3a4d.js +1 -0
  56. package/dist/esm-es5/cura-display_3.entry.js +1 -0
  57. package/dist/esm-es5/cura-icon.entry.js +1 -0
  58. package/dist/esm-es5/cura-icons-view.entry.js +1 -0
  59. package/dist/esm-es5/cura.js +1 -1
  60. package/dist/esm-es5/index-c3d31886.js +2 -0
  61. package/dist/esm-es5/loader.js +1 -1
  62. package/dist/types/api/cura-api.type.d.ts +9 -0
  63. package/dist/types/api/modules/cura-theme-colors-module.d.ts +48 -0
  64. package/dist/types/api/modules/cura-theme-fonts-module.d.ts +24 -0
  65. package/dist/types/api/modules/cura-theme-module.d.ts +4 -0
  66. package/dist/types/api/theme-presets/static.d.ts +78 -0
  67. package/dist/types/api/theme-presets/theme-default.d.ts +28 -22
  68. package/dist/types/api/theme-presets/theme-maternity.d.ts +23 -19
  69. package/dist/types/api/theme-presets/theme-presets.d.ts +51 -41
  70. package/dist/types/components/cura-icon/cura-icon.d.ts +1 -1
  71. package/dist/types/components/text/cura-display/cura-display.d.ts +28 -0
  72. package/dist/types/components/text/cura-heading/cura-heading.d.ts +33 -0
  73. package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +22 -0
  74. package/dist/types/components.d.ts +83 -9
  75. package/package.json +2 -2
  76. package/dist/cjs/app-globals-af978331.js +0 -175
  77. package/dist/cjs/dummy-component.cjs.entry.js +0 -19
  78. package/dist/collection/components/dummy-component/dummy-component.css +0 -3
  79. package/dist/collection/components/dummy-component/dummy-component.js +0 -18
  80. package/dist/components/dummy-component.js +0 -33
  81. package/dist/cura/p-3132f4b7.system.js +0 -2
  82. package/dist/cura/p-70abb532.system.js +0 -1
  83. package/dist/cura/p-81ae13d7.entry.js +0 -1
  84. package/dist/cura/p-a0cd4b75.system.js +0 -1
  85. package/dist/cura/p-abcda1d1.js +0 -2
  86. package/dist/cura/p-ac79f9d1.entry.js +0 -1
  87. package/dist/cura/p-b4c69836.system.entry.js +0 -1
  88. package/dist/cura/p-d2dcd470.js +0 -1
  89. package/dist/cura/p-e1e4b2ea.system.entry.js +0 -1
  90. package/dist/esm/app-globals-962e5cc3.js +0 -173
  91. package/dist/esm/dummy-component.entry.js +0 -15
  92. package/dist/esm-es5/app-globals-962e5cc3.js +0 -1
  93. package/dist/esm-es5/cura-icon_2.entry.js +0 -1
  94. package/dist/esm-es5/dummy-component.entry.js +0 -1
  95. package/dist/esm-es5/index-cec9b650.js +0 -2
  96. package/dist/types/components/dummy-component/dummy-component.d.ts +0 -3
@@ -0,0 +1,61 @@
1
+ :host {
2
+ display: block;
3
+ font-size: var(--font-size);
4
+ text-transform: uppercase;
5
+ }
6
+ :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
7
+ font-family: var(--font-family);
8
+ font-size: 4.285em;
9
+ font-weight: var(--font-weight-black);
10
+ color: var(--color-body);
11
+ line-height: 120%;
12
+ letter-spacing: -4%;
13
+ }
14
+ :host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
15
+ font-size: 6.21em;
16
+ }
17
+ :host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
18
+ font-size: 3em;
19
+ font-weight: var(--font-weight-bold);
20
+ }
21
+ @media screen and (min-width: 768px) and (max-width: 1366px) {
22
+ :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
23
+ font-size: 4.92em;
24
+ }
25
+ :host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
26
+ font-size: 7.07em;
27
+ }
28
+ :host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
29
+ font-size: 3.428em;
30
+ }
31
+ }
32
+ @media screen and (min-width: 1367px) {
33
+ :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
34
+ font-size: 6.14em;
35
+ line-height: 125%;
36
+ }
37
+ :host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
38
+ font-size: 8.857em;
39
+ letter-spacing: -6%;
40
+ }
41
+ :host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
42
+ font-size: 4.285em;
43
+ letter-spacing: -2%;
44
+ }
45
+ }
46
+ :host ::slotted(b), :host ::slotted(strong) {
47
+ font-weight: var(--font-weight-bold);
48
+ }
49
+ :host ::slotted(a) {
50
+ font-weight: var(--font-weight-bold);
51
+ color: var(--color-link);
52
+ text-decoration: none;
53
+ text-underline-offset: 10%;
54
+ cursor: pointer;
55
+ }
56
+ :host ::slotted(abbr) {
57
+ color: var(--color-link);
58
+ text-decoration: underline dashed 1px var(--color-link);
59
+ text-underline-offset: 10%;
60
+ cursor: default;
61
+ }
@@ -0,0 +1,110 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class CuraDisplay {
3
+ constructor() {
4
+ /**
5
+ * Heading level for semantics.
6
+ * Values: 1(default)-6.
7
+ */
8
+ this.level = 1;
9
+ /**
10
+ * Heading style size.
11
+ * Values: small | regular(default) | large.
12
+ */
13
+ this.size = 'regular';
14
+ }
15
+ connectedCallback() {
16
+ this.weights = window.CuraAPI.theme.fonts.getWeights();
17
+ this.setFontProperties();
18
+ this.setColors();
19
+ }
20
+ getClasses() {
21
+ const classes = {};
22
+ classes[this.size.toLowerCase()] = true;
23
+ return classes;
24
+ }
25
+ setFontProperties() {
26
+ this.styles = {
27
+ '--font-family': window.CuraAPI.theme.fonts.getFamily('display'),
28
+ '--font-size': window.CuraAPI.theme.fonts.getSize(),
29
+ '--font-weight-bold': this.weights.bold,
30
+ '--font-weight-black': this.weights.black
31
+ };
32
+ this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());
33
+ }
34
+ setColors() {
35
+ const fontColor = window.CuraAPI.theme.fonts.getColor();
36
+ this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');
37
+ this.styles['--color-link'] = window.CuraAPI.theme.colors.getColor('primary-700');
38
+ }
39
+ setHostProperty(prop, value) {
40
+ this.host.style.setProperty(prop, value);
41
+ }
42
+ getHeadingTag() {
43
+ const tags = {
44
+ '1': h("h1", { style: this.styles, class: this.getClasses() }, h("slot", null)),
45
+ '2': h("h2", { style: this.styles, class: this.getClasses() }, h("slot", null)),
46
+ '3': h("h3", { style: this.styles, class: this.getClasses() }, h("slot", null)),
47
+ '4': h("h4", { style: this.styles, class: this.getClasses() }, h("slot", null)),
48
+ '5': h("h5", { style: this.styles, class: this.getClasses() }, h("slot", null)),
49
+ '6': h("h6", { style: this.styles, class: this.getClasses() }, h("slot", null)),
50
+ 'default': h("h1", { style: this.styles, class: this.getClasses() }, h("slot", null))
51
+ };
52
+ return tags[`${this.level}`] || tags['default'];
53
+ }
54
+ render() {
55
+ return (h(Host, null, this.getHeadingTag()));
56
+ }
57
+ static get is() { return "cura-display"; }
58
+ static get encapsulation() { return "shadow"; }
59
+ static get originalStyleUrls() {
60
+ return {
61
+ "$": ["cura-display.scss"]
62
+ };
63
+ }
64
+ static get styleUrls() {
65
+ return {
66
+ "$": ["cura-display.css"]
67
+ };
68
+ }
69
+ static get properties() {
70
+ return {
71
+ "level": {
72
+ "type": "number",
73
+ "mutable": false,
74
+ "complexType": {
75
+ "original": "number",
76
+ "resolved": "number",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": false,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": "Heading level for semantics.\nValues: 1(default)-6."
84
+ },
85
+ "attribute": "level",
86
+ "reflect": true,
87
+ "defaultValue": "1"
88
+ },
89
+ "size": {
90
+ "type": "string",
91
+ "mutable": false,
92
+ "complexType": {
93
+ "original": "string",
94
+ "resolved": "string",
95
+ "references": {}
96
+ },
97
+ "required": false,
98
+ "optional": false,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": "Heading style size.\nValues: small | regular(default) | large."
102
+ },
103
+ "attribute": "size",
104
+ "reflect": true,
105
+ "defaultValue": "'regular'"
106
+ }
107
+ };
108
+ }
109
+ static get elementRef() { return "host"; }
110
+ }
@@ -0,0 +1,69 @@
1
+ :host {
2
+ display: block;
3
+ font-size: var(--font-size);
4
+ }
5
+ :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
6
+ font-family: var(--font-family);
7
+ font-size: 1.71em;
8
+ font-weight: var(--font-weight-regular);
9
+ color: var(--color-body);
10
+ line-height: 130%;
11
+ letter-spacing: 0%;
12
+ }
13
+ :host h1.bold-weight, :host h2.bold-weight, :host h3.bold-weight, :host h4.bold-weight, :host h5.bold-weight, :host h6.bold-weight {
14
+ font-weight: var(--font-weight-medium);
15
+ }
16
+ :host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
17
+ font-size: 2.07em;
18
+ letter-spacing: -2%;
19
+ }
20
+ :host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
21
+ font-size: 1.214em;
22
+ line-height: 150%;
23
+ letter-spacing: 0%;
24
+ }
25
+ :host h1.small.bold-weight, :host h2.small.bold-weight, :host h3.small.bold-weight, :host h4.small.bold-weight, :host h5.small.bold-weight, :host h6.small.bold-weight {
26
+ font-weight: var(--font-weight-bold);
27
+ }
28
+ @media screen and (min-width: 768px) and (max-width: 1366px) {
29
+ :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
30
+ font-size: 2em;
31
+ }
32
+ :host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
33
+ font-size: 2.357em;
34
+ }
35
+ :host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
36
+ font-size: 1.357em;
37
+ }
38
+ }
39
+ @media screen and (min-width: 1367px) {
40
+ :host h1, :host h2, :host h3, :host h4, :host h5, :host h6 {
41
+ font-size: 2.5em;
42
+ line-height: 135%;
43
+ letter-spacing: -2%;
44
+ }
45
+ :host h1.large, :host h2.large, :host h3.large, :host h4.large, :host h5.large, :host h6.large {
46
+ font-size: 2.92em;
47
+ }
48
+ :host h1.small, :host h2.small, :host h3.small, :host h4.small, :host h5.small, :host h6.small {
49
+ font-size: 1.71em;
50
+ line-height: 160%;
51
+ letter-spacing: 0%;
52
+ }
53
+ }
54
+ :host ::slotted(b), :host ::slotted(strong) {
55
+ font-weight: var(--font-weight-bold);
56
+ }
57
+ :host ::slotted(a) {
58
+ font-weight: var(--font-weight-bold);
59
+ color: var(--color-link);
60
+ text-decoration: none;
61
+ text-underline-offset: 10%;
62
+ cursor: pointer;
63
+ }
64
+ :host ::slotted(abbr) {
65
+ color: var(--color-link);
66
+ text-decoration: underline dashed 1px var(--color-link);
67
+ text-underline-offset: 10%;
68
+ cursor: default;
69
+ }
@@ -0,0 +1,136 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class CuraHeading {
3
+ constructor() {
4
+ /**
5
+ * Heading level for semantics.
6
+ * Values: 1(default)-6.
7
+ */
8
+ this.level = 1;
9
+ /**
10
+ * Heading style size.
11
+ * Values: small | regular(default) | large.
12
+ */
13
+ this.size = 'regular';
14
+ /**
15
+ * Heading font weight.
16
+ * Values: regular(default) | bold.
17
+ */
18
+ this.weight = 'regular';
19
+ }
20
+ connectedCallback() {
21
+ this.weights = window.CuraAPI.theme.fonts.getWeights();
22
+ this.setFontProperties();
23
+ this.setColors();
24
+ }
25
+ getClasses() {
26
+ const classes = {};
27
+ classes[this.size.toLowerCase()] = true;
28
+ classes[`${this.weight.toLowerCase()}-weight`] = true;
29
+ return classes;
30
+ }
31
+ setFontProperties() {
32
+ this.styles = {
33
+ '--font-family': window.CuraAPI.theme.fonts.getFamily('heading'),
34
+ '--font-size': window.CuraAPI.theme.fonts.getSize(),
35
+ '--font-weight-regular': this.weights.regular,
36
+ '--font-weight-medium': this.weights.medium,
37
+ '--font-weight-bold': this.weights.bold,
38
+ '--font-weight-black': this.weights.black
39
+ };
40
+ this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());
41
+ }
42
+ setColors() {
43
+ const fontColor = window.CuraAPI.theme.fonts.getColor();
44
+ this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');
45
+ this.styles['--color-link'] = window.CuraAPI.theme.colors.getColor('primary-700');
46
+ }
47
+ setHostProperty(prop, value) {
48
+ this.host.style.setProperty(prop, value);
49
+ }
50
+ getHeadingTag() {
51
+ const tags = {
52
+ '1': h("h1", { style: this.styles, class: this.getClasses() }, h("slot", null)),
53
+ '2': h("h2", { style: this.styles, class: this.getClasses() }, h("slot", null)),
54
+ '3': h("h3", { style: this.styles, class: this.getClasses() }, h("slot", null)),
55
+ '4': h("h4", { style: this.styles, class: this.getClasses() }, h("slot", null)),
56
+ '5': h("h5", { style: this.styles, class: this.getClasses() }, h("slot", null)),
57
+ '6': h("h6", { style: this.styles, class: this.getClasses() }, h("slot", null)),
58
+ 'default': h("h1", { style: this.styles, class: this.getClasses() }, h("slot", null))
59
+ };
60
+ return tags[`${this.level}`] || tags['default'];
61
+ }
62
+ render() {
63
+ return (h(Host, null, this.getHeadingTag()));
64
+ }
65
+ static get is() { return "cura-heading"; }
66
+ static get encapsulation() { return "shadow"; }
67
+ static get originalStyleUrls() {
68
+ return {
69
+ "$": ["cura-heading.scss"]
70
+ };
71
+ }
72
+ static get styleUrls() {
73
+ return {
74
+ "$": ["cura-heading.css"]
75
+ };
76
+ }
77
+ static get properties() {
78
+ return {
79
+ "level": {
80
+ "type": "number",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "number",
84
+ "resolved": "number",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": "Heading level for semantics.\nValues: 1(default)-6."
92
+ },
93
+ "attribute": "level",
94
+ "reflect": true,
95
+ "defaultValue": "1"
96
+ },
97
+ "size": {
98
+ "type": "string",
99
+ "mutable": false,
100
+ "complexType": {
101
+ "original": "string",
102
+ "resolved": "string",
103
+ "references": {}
104
+ },
105
+ "required": false,
106
+ "optional": false,
107
+ "docs": {
108
+ "tags": [],
109
+ "text": "Heading style size.\nValues: small | regular(default) | large."
110
+ },
111
+ "attribute": "size",
112
+ "reflect": true,
113
+ "defaultValue": "'regular'"
114
+ },
115
+ "weight": {
116
+ "type": "string",
117
+ "mutable": false,
118
+ "complexType": {
119
+ "original": "string",
120
+ "resolved": "string",
121
+ "references": {}
122
+ },
123
+ "required": false,
124
+ "optional": false,
125
+ "docs": {
126
+ "tags": [],
127
+ "text": "Heading font weight.\nValues: regular(default) | bold."
128
+ },
129
+ "attribute": "weight",
130
+ "reflect": true,
131
+ "defaultValue": "'regular'"
132
+ }
133
+ };
134
+ }
135
+ static get elementRef() { return "host"; }
136
+ }
@@ -0,0 +1,81 @@
1
+ :host {
2
+ display: block;
3
+ font-size: var(--font-size);
4
+ }
5
+ :host p {
6
+ font-family: var(--font-family);
7
+ font-size: var(--font-size);
8
+ font-weight: var(--font-weight-regular);
9
+ color: var(--color-body);
10
+ line-height: 140%;
11
+ letter-spacing: 2%;
12
+ }
13
+ :host p.large {
14
+ font-size: 1.21em;
15
+ line-height: 150%;
16
+ letter-spacing: 0%;
17
+ }
18
+ :host p.small {
19
+ font-size: 0.85em;
20
+ line-height: 135%;
21
+ letter-spacing: 4%;
22
+ }
23
+ :host p.caption {
24
+ font-size: 0.71em;
25
+ line-height: 135%;
26
+ letter-spacing: 6%;
27
+ }
28
+ @media screen and (min-width: 768px) and (max-width: 1366px) {
29
+ :host p {
30
+ font-size: 1.14em;
31
+ line-height: 145%;
32
+ }
33
+ :host p.large {
34
+ font-size: 1.35em;
35
+ line-height: 150%;
36
+ }
37
+ :host p.small {
38
+ font-size: 1em;
39
+ line-height: 135%;
40
+ }
41
+ :host p.caption {
42
+ font-size: 0.85em;
43
+ line-height: 135%;
44
+ letter-spacing: 6%;
45
+ }
46
+ }
47
+ @media screen and (min-width: 1367px) {
48
+ :host p {
49
+ font-size: 1.42em;
50
+ line-height: 150%;
51
+ letter-spacing: 0%;
52
+ }
53
+ :host p.large {
54
+ font-size: 1.71em;
55
+ line-height: 160%;
56
+ }
57
+ :host p.small {
58
+ font-size: 1.21em;
59
+ line-height: 145%;
60
+ letter-spacing: 0%;
61
+ }
62
+ :host p.caption {
63
+ font-size: 1em;
64
+ line-height: 145%;
65
+ letter-spacing: 2%;
66
+ }
67
+ }
68
+ :host ::slotted(b), :host ::slotted(strong) {
69
+ font-weight: var(--font-weight-bold);
70
+ }
71
+ :host ::slotted(a) {
72
+ font-weight: var(--font-weight-medium);
73
+ color: var(--color-link);
74
+ text-underline-offset: 10%;
75
+ }
76
+ :host ::slotted(abbr) {
77
+ color: var(--color-link);
78
+ text-decoration: underline dashed 1px var(--color-link);
79
+ text-underline-offset: 10%;
80
+ cursor: default;
81
+ }
@@ -0,0 +1,76 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class CuraParagraph {
3
+ constructor() {
4
+ /**
5
+ * Set size of body text.
6
+ * Values: regular (default) | large | small | caption.
7
+ */
8
+ this.size = 'regular';
9
+ }
10
+ connectedCallback() {
11
+ this.weights = window.CuraAPI.theme.fonts.getWeights();
12
+ this.setFontProperties();
13
+ this.setColors();
14
+ }
15
+ setsizeClass() {
16
+ const sizeclass = {};
17
+ sizeclass[this.size.toLowerCase()] = true;
18
+ return sizeclass;
19
+ }
20
+ setFontProperties() {
21
+ this.styles = {
22
+ '--font-family': window.CuraAPI.theme.fonts.getFamily('body'),
23
+ '--font-size': window.CuraAPI.theme.fonts.getSize(),
24
+ '--font-weight-regular': this.weights.regular,
25
+ '--font-weight-medium': this.weights.medium,
26
+ '--font-weight-bold': this.weights.bold
27
+ };
28
+ this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());
29
+ }
30
+ setColors() {
31
+ const fontColor = window.CuraAPI.theme.fonts.getColor();
32
+ this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor(`neutral-darker`);
33
+ this.styles['--color-link'] = window.CuraAPI.theme.colors.getColor('primary-700');
34
+ }
35
+ setHostProperty(prop, value) {
36
+ this.host.style.setProperty(prop, value);
37
+ }
38
+ render() {
39
+ return (h(Host, null, h("p", { style: this.styles, class: this.setsizeClass() }, h("slot", null))));
40
+ }
41
+ static get is() { return "cura-paragraph"; }
42
+ static get encapsulation() { return "shadow"; }
43
+ static get originalStyleUrls() {
44
+ return {
45
+ "$": ["cura-paragraph.scss"]
46
+ };
47
+ }
48
+ static get styleUrls() {
49
+ return {
50
+ "$": ["cura-paragraph.css"]
51
+ };
52
+ }
53
+ static get properties() {
54
+ return {
55
+ "size": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": "Set size of body text.\nValues: regular (default) | large | small | caption."
68
+ },
69
+ "attribute": "size",
70
+ "reflect": true,
71
+ "defaultValue": "'regular'"
72
+ }
73
+ };
74
+ }
75
+ static get elementRef() { return "host"; }
76
+ }
@@ -1,9 +1,9 @@
1
1
  import type { Components, JSX } from "../types/components";
2
2
 
3
- interface DummyComponent extends Components.DummyComponent, HTMLElement {}
4
- export const DummyComponent: {
5
- prototype: DummyComponent;
6
- new (): DummyComponent;
3
+ interface CuraDisplay extends Components.CuraDisplay, HTMLElement {}
4
+ export const CuraDisplay: {
5
+ prototype: CuraDisplay;
6
+ new (): CuraDisplay;
7
7
  };
8
8
  /**
9
9
  * Used to define this component and all nested components recursively.
@@ -0,0 +1,86 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const curaDisplayCss = ":host{display:block;font-size:var(--font-size);text-transform:uppercase}:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-family:var(--font-family);font-size:4.285em;font-weight:var(--font-weight-black);color:var(--color-body);line-height:120%;letter-spacing:-4%}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:6.21em}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:3em;font-weight:var(--font-weight-bold)}@media screen and (min-width: 768px) and (max-width: 1366px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:4.92em}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:7.07em}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:3.428em}}@media screen and (min-width: 1367px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:6.14em;line-height:125%}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:8.857em;letter-spacing:-6%}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:4.285em;letter-spacing:-2%}}:host ::slotted(b),:host ::slotted(strong){font-weight:var(--font-weight-bold)}:host ::slotted(a){font-weight:var(--font-weight-bold);color:var(--color-link);text-decoration:none;text-underline-offset:10%;cursor:pointer}:host ::slotted(abbr){color:var(--color-link);-webkit-text-decoration:underline dashed 1px var(--color-link);text-decoration:underline dashed 1px var(--color-link);text-underline-offset:10%;cursor:default}";
4
+
5
+ const CuraDisplay$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ /**
11
+ * Heading level for semantics.
12
+ * Values: 1(default)-6.
13
+ */
14
+ this.level = 1;
15
+ /**
16
+ * Heading style size.
17
+ * Values: small | regular(default) | large.
18
+ */
19
+ this.size = 'regular';
20
+ }
21
+ connectedCallback() {
22
+ this.weights = window.CuraAPI.theme.fonts.getWeights();
23
+ this.setFontProperties();
24
+ this.setColors();
25
+ }
26
+ getClasses() {
27
+ const classes = {};
28
+ classes[this.size.toLowerCase()] = true;
29
+ return classes;
30
+ }
31
+ setFontProperties() {
32
+ this.styles = {
33
+ '--font-family': window.CuraAPI.theme.fonts.getFamily('display'),
34
+ '--font-size': window.CuraAPI.theme.fonts.getSize(),
35
+ '--font-weight-bold': this.weights.bold,
36
+ '--font-weight-black': this.weights.black
37
+ };
38
+ this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());
39
+ }
40
+ setColors() {
41
+ const fontColor = window.CuraAPI.theme.fonts.getColor();
42
+ this.styles['--color-body'] = fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker');
43
+ this.styles['--color-link'] = window.CuraAPI.theme.colors.getColor('primary-700');
44
+ }
45
+ setHostProperty(prop, value) {
46
+ this.host.style.setProperty(prop, value);
47
+ }
48
+ getHeadingTag() {
49
+ const tags = {
50
+ '1': h("h1", { style: this.styles, class: this.getClasses() }, h("slot", null)),
51
+ '2': h("h2", { style: this.styles, class: this.getClasses() }, h("slot", null)),
52
+ '3': h("h3", { style: this.styles, class: this.getClasses() }, h("slot", null)),
53
+ '4': h("h4", { style: this.styles, class: this.getClasses() }, h("slot", null)),
54
+ '5': h("h5", { style: this.styles, class: this.getClasses() }, h("slot", null)),
55
+ '6': h("h6", { style: this.styles, class: this.getClasses() }, h("slot", null)),
56
+ 'default': h("h1", { style: this.styles, class: this.getClasses() }, h("slot", null))
57
+ };
58
+ return tags[`${this.level}`] || tags['default'];
59
+ }
60
+ render() {
61
+ return (h(Host, null, this.getHeadingTag()));
62
+ }
63
+ get host() { return this; }
64
+ static get style() { return curaDisplayCss; }
65
+ }, [1, "cura-display", {
66
+ "level": [514],
67
+ "size": [513]
68
+ }]);
69
+ function defineCustomElement$1() {
70
+ if (typeof customElements === "undefined") {
71
+ return;
72
+ }
73
+ const components = ["cura-display"];
74
+ components.forEach(tagName => { switch (tagName) {
75
+ case "cura-display":
76
+ if (!customElements.get(tagName)) {
77
+ customElements.define(tagName, CuraDisplay$1);
78
+ }
79
+ break;
80
+ } });
81
+ }
82
+
83
+ const CuraDisplay = CuraDisplay$1;
84
+ const defineCustomElement = defineCustomElement$1;
85
+
86
+ export { CuraDisplay, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CuraHeading extends Components.CuraHeading, HTMLElement {}
4
+ export const CuraHeading: {
5
+ prototype: CuraHeading;
6
+ new (): CuraHeading;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;