@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.
Files changed (174) hide show
  1. package/dist/cjs/{app-globals-0e3b7fc6.js → app-globals-2988084b.js} +5 -5
  2. package/dist/cjs/app-globals-2988084b.js.map +1 -0
  3. package/dist/cjs/cura-accordion_8.cjs.entry.js +452 -0
  4. package/dist/cjs/cura-accordion_8.cjs.entry.js.map +1 -0
  5. package/dist/cjs/cura-button-outline.cjs.entry.js +83 -0
  6. package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -0
  7. package/dist/cjs/cura-button-transparent.cjs.entry.js +83 -0
  8. package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -0
  9. package/dist/cjs/cura-display.cjs.entry.js +74 -0
  10. package/dist/cjs/cura-display.cjs.entry.js.map +1 -0
  11. package/dist/cjs/cura-icons-view.cjs.entry.js +29 -0
  12. package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -0
  13. package/dist/cjs/cura-label.cjs.entry.js +69 -0
  14. package/dist/cjs/cura-label.cjs.entry.js.map +1 -0
  15. package/dist/cjs/cura.cjs.js +2 -2
  16. package/dist/cjs/index.cjs.js +7 -0
  17. package/dist/cjs/index.cjs.js.map +1 -1
  18. package/dist/cjs/loader.cjs.js +2 -2
  19. package/dist/collection/api/cura-api.type.js.map +1 -1
  20. package/dist/collection/api/modules/cura-theme-breakpoints-module.js +1 -1
  21. package/dist/collection/api/modules/cura-theme-breakpoints-module.js.map +1 -1
  22. package/dist/collection/api/modules/cura-theme-colors-module.js +1 -1
  23. package/dist/collection/api/modules/cura-theme-colors-module.js.map +1 -1
  24. package/dist/collection/api/theme-presets/static.js +2 -2
  25. package/dist/collection/api/theme-presets/static.js.map +1 -1
  26. package/dist/collection/collection-manifest.json +1 -0
  27. package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +10 -6
  28. package/dist/collection/components/cura-page-template/cura-page-template.css +13 -9
  29. package/dist/collection/components/forms/cura-label/cura-label.css +70 -0
  30. package/dist/collection/components/forms/cura-label/cura-label.js +190 -0
  31. package/dist/collection/components/forms/cura-label/cura-label.js.map +1 -0
  32. package/dist/collection/components/forms/cura-label/cura-label.stories.js +137 -0
  33. package/dist/collection/components/forms/cura-label/cura-label.stories.js.map +1 -0
  34. package/dist/collection/components/text/cura-display/cura-display.css +21 -38
  35. package/dist/collection/components/text/cura-display/cura-display.js +80 -49
  36. package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
  37. package/dist/collection/components/text/cura-display/cura-display.stories.js +78 -33
  38. package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
  39. package/dist/collection/components/text/cura-heading/cura-heading.css +50 -24
  40. package/dist/collection/components/text/cura-heading/cura-heading.js +94 -39
  41. package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
  42. package/dist/collection/components/text/cura-heading/cura-heading.stories.js +92 -36
  43. package/dist/collection/components/text/cura-heading/cura-heading.stories.js.map +1 -1
  44. package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +37 -38
  45. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +62 -41
  46. package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
  47. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +78 -46
  48. package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
  49. package/dist/collection/index.js +3 -1
  50. package/dist/collection/index.js.map +1 -1
  51. package/dist/components/cura-accordion-item.js +1 -1
  52. package/dist/components/cura-accordion-item.js.map +1 -1
  53. package/dist/components/cura-display.js +41 -35
  54. package/dist/components/cura-display.js.map +1 -1
  55. package/dist/components/cura-heading.js +34 -21
  56. package/dist/components/cura-heading.js.map +1 -1
  57. package/dist/components/cura-label.d.ts +11 -0
  58. package/dist/components/cura-label.js +91 -0
  59. package/dist/components/cura-label.js.map +1 -0
  60. package/dist/components/cura-page-template.js +1 -1
  61. package/dist/components/cura-page-template.js.map +1 -1
  62. package/dist/components/cura-paragraph.js +25 -23
  63. package/dist/components/cura-paragraph.js.map +1 -1
  64. package/dist/components/index.js +11 -5
  65. package/dist/components/index.js.map +1 -1
  66. package/dist/cura/cura.esm.js +1 -1
  67. package/dist/cura/cura.esm.js.map +1 -1
  68. package/dist/cura/cura.js +1 -1
  69. package/dist/cura/index.esm.js +1 -1
  70. package/dist/cura/index.esm.js.map +1 -1
  71. package/dist/cura/p-03047b3e.entry.js +2 -0
  72. package/dist/cura/p-03047b3e.entry.js.map +1 -0
  73. package/dist/cura/p-0c79c54e.entry.js +2 -0
  74. package/dist/cura/p-0c79c54e.entry.js.map +1 -0
  75. package/dist/cura/p-120926c5.system.js +2 -0
  76. package/dist/cura/p-120926c5.system.js.map +1 -0
  77. package/dist/cura/p-223924fb.system.entry.js +2 -0
  78. package/dist/cura/p-223924fb.system.entry.js.map +1 -0
  79. package/dist/cura/p-48426f60.system.js +2 -0
  80. package/dist/cura/p-48426f60.system.js.map +1 -0
  81. package/dist/cura/p-49813052.entry.js +2 -0
  82. package/dist/cura/p-49813052.entry.js.map +1 -0
  83. package/dist/cura/p-4bdbcdf0.system.entry.js +2 -0
  84. package/dist/cura/p-4bdbcdf0.system.entry.js.map +1 -0
  85. package/dist/cura/p-7c8f3c77.system.entry.js +2 -0
  86. package/dist/cura/p-7c8f3c77.system.entry.js.map +1 -0
  87. package/dist/cura/p-8b18b5f7.system.js +2 -0
  88. package/dist/cura/p-8b18b5f7.system.js.map +1 -0
  89. package/dist/cura/p-91b0f78e.entry.js +2 -0
  90. package/dist/cura/p-91b0f78e.entry.js.map +1 -0
  91. package/dist/cura/p-a0395f90.entry.js +2 -0
  92. package/dist/cura/p-a0395f90.entry.js.map +1 -0
  93. package/dist/cura/p-a7ef255f.entry.js +2 -0
  94. package/dist/cura/p-a7ef255f.entry.js.map +1 -0
  95. package/dist/cura/p-ca054b07.system.entry.js +2 -0
  96. package/dist/cura/p-ca054b07.system.entry.js.map +1 -0
  97. package/dist/cura/p-d47b9cfe.system.entry.js +2 -0
  98. package/dist/cura/p-d47b9cfe.system.entry.js.map +1 -0
  99. package/dist/cura/p-f8fffdc1.js +2 -0
  100. package/dist/cura/p-f8fffdc1.js.map +1 -0
  101. package/dist/cura/p-fc77814b.system.entry.js +2 -0
  102. package/dist/cura/p-fc77814b.system.entry.js.map +1 -0
  103. package/dist/esm/{app-globals-cc003eaf.js → app-globals-29001758.js} +5 -5
  104. package/dist/esm/app-globals-29001758.js.map +1 -0
  105. package/dist/esm/cura-accordion_8.entry.js +441 -0
  106. package/dist/esm/cura-accordion_8.entry.js.map +1 -0
  107. package/dist/esm/cura-button-outline.entry.js +79 -0
  108. package/dist/esm/cura-button-outline.entry.js.map +1 -0
  109. package/dist/esm/cura-button-transparent.entry.js +79 -0
  110. package/dist/esm/cura-button-transparent.entry.js.map +1 -0
  111. package/dist/esm/cura-display.entry.js +70 -0
  112. package/dist/esm/cura-display.entry.js.map +1 -0
  113. package/dist/esm/cura-icons-view.entry.js +25 -0
  114. package/dist/esm/cura-icons-view.entry.js.map +1 -0
  115. package/dist/esm/cura-label.entry.js +65 -0
  116. package/dist/esm/cura-label.entry.js.map +1 -0
  117. package/dist/esm/cura.js +2 -2
  118. package/dist/esm/index.js +4 -0
  119. package/dist/esm/index.js.map +1 -1
  120. package/dist/esm/loader.js +2 -2
  121. package/dist/esm-es5/app-globals-29001758.js +2 -0
  122. package/dist/esm-es5/app-globals-29001758.js.map +1 -0
  123. package/dist/esm-es5/cura-accordion_8.entry.js +2 -0
  124. package/dist/esm-es5/cura-accordion_8.entry.js.map +1 -0
  125. package/dist/esm-es5/cura-button-outline.entry.js +2 -0
  126. package/dist/esm-es5/cura-button-outline.entry.js.map +1 -0
  127. package/dist/esm-es5/cura-button-transparent.entry.js +2 -0
  128. package/dist/esm-es5/cura-button-transparent.entry.js.map +1 -0
  129. package/dist/esm-es5/cura-display.entry.js +2 -0
  130. package/dist/esm-es5/cura-display.entry.js.map +1 -0
  131. package/dist/esm-es5/cura-icons-view.entry.js +2 -0
  132. package/dist/esm-es5/cura-icons-view.entry.js.map +1 -0
  133. package/dist/esm-es5/cura-label.entry.js +2 -0
  134. package/dist/esm-es5/cura-label.entry.js.map +1 -0
  135. package/dist/esm-es5/cura.js +1 -1
  136. package/dist/esm-es5/cura.js.map +1 -1
  137. package/dist/esm-es5/index.js +1 -1
  138. package/dist/esm-es5/index.js.map +1 -1
  139. package/dist/esm-es5/loader.js +1 -1
  140. package/dist/esm-es5/loader.js.map +1 -1
  141. package/dist/types/api/cura-api.type.d.ts +1 -0
  142. package/dist/types/components/forms/cura-label/cura-label.d.ts +54 -0
  143. package/dist/types/components/forms/cura-label/cura-label.stories.d.ts +126 -0
  144. package/dist/types/components/text/cura-display/cura-display.d.ts +29 -18
  145. package/dist/types/components/text/cura-display/cura-display.stories.d.ts +52 -14
  146. package/dist/types/components/text/cura-heading/cura-heading.d.ts +34 -17
  147. package/dist/types/components/text/cura-heading/cura-heading.stories.d.ts +58 -6
  148. package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +24 -12
  149. package/dist/types/components/text/cura-paragraph/cura-paragraph.stories.d.ts +47 -9
  150. package/dist/types/components.d.ts +139 -46
  151. package/dist/types/index.d.ts +9 -0
  152. package/package.json +2 -4
  153. package/dist/cjs/app-globals-0e3b7fc6.js.map +0 -1
  154. package/dist/cjs/cura-accordion_12.cjs.entry.js +0 -674
  155. package/dist/cjs/cura-accordion_12.cjs.entry.js.map +0 -1
  156. package/dist/cura/p-319699df.entry.js +0 -2
  157. package/dist/cura/p-319699df.entry.js.map +0 -1
  158. package/dist/cura/p-50ea2036.system.js +0 -2
  159. package/dist/cura/p-50ea2036.system.js.map +0 -1
  160. package/dist/cura/p-5250cb43.system.js +0 -2
  161. package/dist/cura/p-5250cb43.system.js.map +0 -1
  162. package/dist/cura/p-5cc3c8bd.system.entry.js +0 -2
  163. package/dist/cura/p-5cc3c8bd.system.entry.js.map +0 -1
  164. package/dist/cura/p-788e035b.system.js +0 -2
  165. package/dist/cura/p-788e035b.system.js.map +0 -1
  166. package/dist/cura/p-d5c64a5f.js +0 -2
  167. package/dist/cura/p-d5c64a5f.js.map +0 -1
  168. package/dist/esm/app-globals-cc003eaf.js.map +0 -1
  169. package/dist/esm/cura-accordion_12.entry.js +0 -659
  170. package/dist/esm/cura-accordion_12.entry.js.map +0 -1
  171. package/dist/esm-es5/app-globals-cc003eaf.js +0 -2
  172. package/dist/esm-es5/app-globals-cc003eaf.js.map +0 -1
  173. package/dist/esm-es5/cura-accordion_12.entry.js +0 -2
  174. package/dist/esm-es5/cura-accordion_12.entry.js.map +0 -1
@@ -10,82 +10,138 @@ 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 renderCuraHeading = (label, args) => {
16
+ const styles = args.cssMarginBlock || args.cssLineHeight ? `<style>
17
+ cura-heading { ${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-heading${args.size && (args.size !== 'medium' && args.size !== 'regular') ? `
25
+ size="${args.size}"` : ``}${args.level ? `
26
+ level="${args.level}"` : ''}${args.weight ? `
27
+ weight="${args.weight}"` : ''}${args.color ? `
28
+ color="${args.color}"` : ''}${args.spotColor ? `
29
+ spot-color="${args.spotColor}"` : ''}${args.marginBlock ? `
30
+ margin-block="${args.marginBlock}"` : ''}${args.lineHeight ? `
31
+ line-height="${args.lineHeight}"` : ''}>
32
+ ${label}
33
+ </cura-heading>
34
+ `;
35
+ return `${styles}${block}${block}${block}`;
36
+ };
13
37
  export default {
14
38
  title: 'Componentes/Text/Heading',
15
39
  tags: ['autodocs'],
16
40
  render: (_a) => {
17
41
  var { label } = _a, args = __rest(_a, ["label"]);
18
- // You can either use a function to create DOM elements or use a plain html string!
19
- // return `<div>${label}</div>`;
20
- return `<cura-heading
21
- level="${args.level}"
22
- spot-color="${args.spotColor}"
23
- size="${args.size}"
24
- inverted="${args.inverted}"
25
- weight="${args.weight}">
26
- ${label}
27
- </cura-heading>
28
- <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>`;
42
+ return renderCuraHeading(label, args);
29
43
  },
30
44
  argTypes: {
31
45
  label: {
32
46
  control: 'text',
33
- description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',
47
+ description: 'Define o texto do componente diretamente. Aceita tags HTML <i>Phrasing Content</i>.',
34
48
  name: 'Content'
35
49
  },
36
- inverted: {
37
- control: 'boolean',
38
- description: 'Inverte cores do texto para aplicação em fundo escuro.',
39
- table: {
40
- category: 'Properties',
41
- defaultValue: { summary: 'false' }
42
- }
43
- },
44
50
  size: {
45
51
  control: { type: 'select' },
46
- options: ['small', 'regular', 'large'],
47
- description: 'Tamanhos disponíveis.',
52
+ options: ['xsmall', 'small', 'medium', 'large'],
53
+ description: 'Define o tamanho do bloco de texto considerando `xsmall`, `small`, `medium` (default) e `large` como valores válidos.',
48
54
  table: {
49
55
  category: 'Properties',
50
- defaultValue: { summary: 'regular' }
56
+ defaultValue: { summary: 'medium' }
51
57
  }
52
58
  },
53
59
  weight: {
54
60
  control: { type: 'inline-radio' },
55
61
  options: ['regular', 'bold'],
56
- description: 'Espessura de fonte',
62
+ description: 'Espessura de fonte `regular` (default) ou `bold` para todo o texto. É possível aplicar parcialmente utilizando as tags `<b>` e `<strong>`.',
57
63
  table: {
58
64
  category: 'Properties',
59
65
  defaultValue: { summary: 'regular' }
60
66
  }
61
67
  },
68
+ color: {
69
+ control: { type: 'select' },
70
+ options: ['', ...colors],
71
+ description: 'Define a cor de texto do bloco. Aceita qualquer valor do esquema de cores do design system.',
72
+ table: {
73
+ category: 'Properties',
74
+ defaultValue: { summary: 'Cor de texto padrão do tema' }
75
+ }
76
+ },
62
77
  spotColor: {
63
78
  control: { type: 'select' },
64
- options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],
65
- description: 'Cor fundamental do Design System sem profundidade (ex: primary).',
79
+ options: ['', ...colors],
80
+ 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.',
81
+ name: 'spot-color',
66
82
  table: {
67
83
  category: 'Properties',
68
- defaultValue: { summary: 'primary' }
84
+ defaultValue: { summary: 'accent-dark' }
69
85
  }
70
86
  },
71
87
  level: {
72
88
  control: { type: 'number', min: 1, max: 6, step: 1 },
73
- description: 'Define a tag semântica do título. Ex. h1, h2, h3, etc.',
89
+ description: 'Define a tag semântica do título. Ex. h1, h2, h3, etc. A semântica é independente do estilo aplicado.',
74
90
  table: {
75
91
  category: 'Properties',
76
- defaultValue: { summary: 'primary' }
92
+ defaultValue: { summary: 1 }
77
93
  }
78
- }
94
+ },
95
+ marginBlock: {
96
+ control: 'text',
97
+ description: 'Define o tamanho do espaçamento superior e inferior do bloco. Valores válidos para a propriedade CSS `margin-block`.',
98
+ name: 'margin-block',
99
+ table: {
100
+ category: 'Properties',
101
+ defaultValue: { summary: '1.25em' }
102
+ }
103
+ },
104
+ lineHeight: {
105
+ control: 'text',
106
+ description: 'Define a altura de linha base a ser considerada pelo componente em sua responsividade. Valores válidos para a propriedade CSS `line-height`.',
107
+ name: 'line-height',
108
+ table: {
109
+ category: 'Properties',
110
+ defaultValue: { summary: '130%' }
111
+ }
112
+ },
113
+ cssMarginBlock: {
114
+ control: 'text',
115
+ 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.',
116
+ name: '--margin-block',
117
+ table: {
118
+ category: 'CSS Properties',
119
+ defaultValue: { summary: '1.25em' }
120
+ }
121
+ },
122
+ cssLineHeight: {
123
+ control: 'text',
124
+ 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.',
125
+ name: '--line-height',
126
+ table: {
127
+ category: 'CSS Properties',
128
+ defaultValue: { summary: '130%' }
129
+ }
130
+ },
79
131
  },
80
132
  };
81
133
  export const Heading = {
82
134
  args: {
83
- label: 'Dolor sit <a href="https://www.rededorsaoluiz.com.br" target="_blank">amet</a>, consectetur adipiscing elit.',
84
- size: 'regular',
85
- weight: 'regular',
86
- level: 1,
87
- spotColor: 'primary',
88
- inverted: false,
135
+ label: 'Dolor sit <a href="https://www.rededorsaoluiz.com.br" target="_blank">amet</a>, consectetur <i>adipiscing</i> elit.',
136
+ size: 'medium',
137
+ weight: '',
138
+ level: '',
139
+ color: '',
140
+ spotColor: '',
141
+ marginBlock: '',
142
+ lineHeight: '',
143
+ cssMarginBlock: '',
144
+ cssLineHeight: ''
89
145
  },
90
146
  };
91
147
  //# sourceMappingURL=cura-heading.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cura-heading.stories.js","sourceRoot":"","sources":["../../../../src/components/text/cura-heading/cura-heading.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,eAAe;EACb,KAAK,EAAE,0BAA0B;EACjC,IAAI,EAAE,CAAC,UAAU,CAAC;EAClB,MAAM,EAAE,CAAC,EAAkB,EAAE,EAAE;QAAtB,EAAE,KAAK,OAAW,EAAN,IAAI,cAAhB,SAAkB,CAAF;IACvB,mFAAmF;IACnF,gCAAgC;IAChC,OAAO;WACA,IAAI,CAAC,KAAK;gBACL,IAAI,CAAC,SAAS;UACpB,IAAI,CAAC,IAAI;cACL,IAAI,CAAC,QAAQ;YACf,I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,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;MACpD,WAAW,EAAE,wDAAwD;MACrE,KAAK,EAAE;QACL,QAAQ,EAAE,YAAY;QACtB,YAAY,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC;OACpC;KACF;GACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;EACrB,IAAI,EAAE;IACJ,KAAK,EAAE,8GAA8G;IACrH,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,CAAC;IACR,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,KAAK;GAChB;CACF,CAAC","sourcesContent":["\nexport default {\n title: 'Componentes/Text/Heading',\n tags: ['autodocs'],\n render: ({ label, ...args }) => {\n // You can either use a function to create DOM elements or use a plain html string!\n // return `<div>${label}</div>`;\n return `<cura-heading\n level=\"${args.level}\"\n spot-color=\"${args.spotColor}\"\n size=\"${args.size}\"\n inverted=\"${args.inverted}\"\n weight=\"${args.weight}\">\n ${label}\n</cura-heading>\n<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>`;\n },\n argTypes: {\n label: {\n control: 'text',\n description: 'Texto puro com ou sem quebra de linha dentro do componente. Não é propriedade HTML.',\n name: 'Content'\n },\n inverted: {\n control: 'boolean',\n description: 'Inverte cores do texto para aplicação em fundo escuro.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'false'}\n }\n },\n size: {\n control: { type: 'select' },\n options: ['small', 'regular', 'large'],\n description: 'Tamanhos disponíveis.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'regular'}\n }\n },\n weight: {\n control: { type: 'inline-radio' },\n options: ['regular', 'bold'],\n description: 'Espessura de fonte',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'regular'}\n }\n },\n spotColor: {\n control: { type: 'select' },\n options: ['primary', 'secondary', 'accent', 'info', 'success', 'error', 'warning', 'neutral'],\n description: 'Cor fundamental do Design System sem profundidade (ex: primary).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'primary'}\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.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'primary'}\n }\n }\n },\n};\n\nexport const Heading = {\n args: {\n label: 'Dolor sit <a href=\"https://www.rededorsaoluiz.com.br\" target=\"_blank\">amet</a>, consectetur adipiscing elit.',\n size: 'regular',\n weight: 'regular',\n level: 1,\n spotColor: 'primary',\n inverted: false,\n },\n};\n"]}
1
+ {"version":3,"file":"cura-heading.stories.js","sourceRoot":"","sources":["../../../../src/components/text/cura-heading/cura-heading.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,GAA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orsWithDepths();\n\nconst renderCuraHeading = (label: string, args: any) => {\n const styles = args.cssMarginBlock || args.cssLineHeight ? `<style>\n cura-heading { ${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-heading${args.size && (args.size !== 'medium' && args.size !== 'regular') ? `\n size=\"${args.size}\"` : ``}${args.level ? `\n level=\"${args.level}\"` : ''}${args.weight ? `\n weight=\"${args.weight}\"` : ''}${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-heading>\n`;\n return `${styles}${block}${block}${block}`;\n}\n\nexport default {\n title: 'Componentes/Text/Heading',\n tags: ['autodocs'],\n render: ({ label, ...args }) => {\n return renderCuraHeading(label, args);\n },\n argTypes: {\n label: {\n control: 'text',\n description: 'Define o texto do componente diretamente. Aceita tags HTML <i>Phrasing Content</i>.',\n name: 'Content'\n },\n size: {\n control: { type: 'select' },\n options: ['xsmall', 'small', 'medium', 'large'],\n description: 'Define o tamanho do bloco de texto considerando `xsmall`, `small`, `medium` (default) e `large` como valores válidos.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'medium'}\n }\n },\n weight: {\n control: { type: 'inline-radio' },\n options: ['regular', 'bold'],\n description: 'Espessura de fonte `regular` (default) ou `bold` para todo o texto. É possível aplicar parcialmente utilizando as tags `<b>` e `<strong>`.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'regular'}\n }\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 Heading = {\n args: {\n label: 'Dolor sit <a href=\"https://www.rededorsaoluiz.com.br\" target=\"_blank\">amet</a>, consectetur <i>adipiscing</i> elit.',\n size: 'medium',\n weight: '',\n level: '',\n color: '',\n spotColor: '',\n marginBlock: '',\n lineHeight: '',\n cssMarginBlock: '',\n cssLineHeight: ''\n },\n};\n"]}
@@ -11,92 +11,87 @@
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 p {
27
31
  font-family: var(--font-family);
28
- font-size: var(--font-size);
32
+ font-size: var(--font-size-base);
29
33
  font-weight: var(--font-weight-regular);
30
34
  color: var(--color-body);
31
35
  line-height: var(--line-height);
32
- /* letter-spacing: 0.02em; */
33
- margin-block-start: var(--block-margin);
34
- margin-block-end: var(--block-margin);
36
+ margin-block: var(--margin-block);
37
+ letter-spacing: 0.28px;
35
38
  }
36
39
  :host p.large {
37
- font-size: 1.21em;
40
+ font-size: 1.214em;
38
41
  line-height: calc(var(--line-height) + 10%);
39
- /* line-height: 150%; */
40
- /* letter-spacing: normal; */
42
+ letter-spacing: 0px;
41
43
  }
42
44
  :host p.small {
43
45
  font-size: 0.85em;
44
46
  line-height: calc(var(--line-height) - 5%);
45
- /* line-height: 135%; */
46
- /* letter-spacing: 0.04em; */
47
+ letter-spacing: 0.48px;
47
48
  }
48
- :host p.caption {
49
- font-size: 0.71em;
49
+ :host p.caption, :host p.xsmall {
50
+ font-size: 0.714em;
50
51
  line-height: calc(var(--line-height) - 5%);
51
- /* line-height: 135%; */
52
- /* letter-spacing: 0.06em; */
52
+ letter-spacing: 0.6px;
53
53
  }
54
- @media (min-width: 768px) and (max-width: 1365px) {
54
+ @media (min-width: 769px) and (max-width: 1920px) {
55
55
  :host p {
56
- font-size: 1.14em;
56
+ font-size: 1.143em;
57
57
  line-height: calc(var(--line-height) + 5%);
58
- /* line-height: 145%; */
58
+ letter-spacing: 0.32px;
59
59
  }
60
60
  :host p.large {
61
- font-size: 1.35em;
61
+ font-size: 1.357em;
62
62
  line-height: calc(var(--line-height) + 10%);
63
- /* line-height: 150%; */
63
+ letter-spacing: 0px;
64
64
  }
65
65
  :host p.small {
66
66
  font-size: 1em;
67
67
  line-height: calc(var(--line-height) - 5%);
68
- /* line-height: 135%; */
68
+ letter-spacing: 0.56px;
69
69
  }
70
- :host p.caption {
70
+ :host p.caption, :host p.xsmall {
71
71
  font-size: 0.85em;
72
72
  line-height: calc(var(--line-height) - 5%);
73
- /* line-height: 135%; */
74
- /* letter-spacing: 0.06em; */
73
+ letter-spacing: 0.72px;
75
74
  }
76
75
  }
77
- @media (min-width: 1366px) {
76
+ @media (min-width: 1921px) {
78
77
  :host p {
79
- font-size: 1.42em;
78
+ font-size: 1.429em;
80
79
  line-height: calc(var(--line-height) + 10%);
81
- /* line-height: 150%; */
82
- /* letter-spacing: normal; */
80
+ letter-spacing: 0px;
83
81
  }
84
82
  :host p.large {
85
- font-size: 1.71em;
83
+ font-size: 1.714em;
86
84
  line-height: calc(var(--line-height) + 20%);
87
- /* line-height: 160%; */
88
85
  }
89
86
  :host p.small {
90
87
  font-size: 1.21em;
91
88
  line-height: calc(var(--line-height) + 5%);
92
- /* line-height: 145%; */
93
- /* letter-spacing: normal; */
89
+ letter-spacing: 0px;
94
90
  }
95
- :host p.caption {
91
+ :host p.caption, :host p.xsmall {
96
92
  font-size: 1em;
97
93
  line-height: calc(var(--line-height) + 5%);
98
- /* line-height: 145%; */
99
- /* letter-spacing: 0.02em; */
94
+ letter-spacing: 0.28px;
100
95
  }
101
96
  }
102
97
  :host ::slotted(b), :host ::slotted(strong) {
@@ -107,6 +102,10 @@
107
102
  color: var(--color-link);
108
103
  text-underline-offset: 10%;
109
104
  }
105
+ :host ::slotted(u) {
106
+ font-weight: var(--font-weight-medium);
107
+ text-underline-offset: 10%;
108
+ }
110
109
  :host ::slotted(abbr) {
111
110
  color: var(--color-link);
112
111
  text-decoration: underline dashed 1px var(--color-link);
@@ -1,17 +1,18 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  export class CuraParagraph {
3
3
  constructor() {
4
- this.size = 'regular';
5
- this.inverted = false;
6
- this.spotColor = 'primary';
4
+ this.theme = window.CuraAPI.theme;
5
+ this.size = 'medium';
6
+ this.spotColor = 'accent-dark';
7
7
  this.color = undefined;
8
+ this.marginBlock = '1.25em';
9
+ this.lineHeight = '140%';
8
10
  this.styles = {};
9
11
  }
10
12
  handleChangeColor() {
11
13
  this.setColors();
12
14
  }
13
15
  connectedCallback() {
14
- this.weights = window.CuraAPI.theme.fonts.getWeights();
15
16
  this.setFontProperties();
16
17
  this.setColors();
17
18
  }
@@ -21,31 +22,30 @@ export class CuraParagraph {
21
22
  return sizeclass;
22
23
  }
23
24
  setFontProperties() {
25
+ this.weights = this.theme.fonts.getWeights();
26
+ this.fontSizeBase = this.theme.fonts.getSize();
24
27
  this.styles = {
25
- '--font-family': window.CuraAPI.theme.fonts.getFamily('body'),
26
- '--font-size': window.CuraAPI.theme.fonts.getSize(),
28
+ '--font-family': this.theme.fonts.getFamily('body'),
27
29
  '--font-weight-regular': this.weights.regular,
28
30
  '--font-weight-medium': this.weights.medium,
29
31
  '--font-weight-bold': this.weights.bold
30
32
  };
31
- this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());
32
- this.setHostProperty('--block-margin', '1.25em');
33
- this.setHostProperty('--line-height', '140%');
34
33
  }
35
34
  setColors() {
36
- const fontColor = this.color ? window.CuraAPI.theme.colors.getColor(this.color) :
37
- this.inverted
38
- ? window.CuraAPI.theme.colors.getColor('neutral-white')
39
- : window.CuraAPI.theme.fonts.getColor();
40
- this.styles = Object.assign(Object.assign({}, this.styles), { '--color-body': fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker'), '--color-link': this.inverted
41
- ? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)
42
- : window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`) });
35
+ const fontColor = this.color
36
+ ? this.theme.colors.getColor(this.color)
37
+ : this.theme.fonts.getColor();
38
+ 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}`) });
43
39
  }
44
- setHostProperty(prop, value) {
45
- this.host.style.setProperty(prop, value);
40
+ hostCSSProperties() {
41
+ return {
42
+ '--margin-block': this.marginBlock,
43
+ '--font-size-base': this.fontSizeBase,
44
+ '--line-height': this.lineHeight
45
+ };
46
46
  }
47
47
  render() {
48
- return (h(Host, null, h("p", { style: this.styles, class: this.setsizeClass() }, h("slot", null))));
48
+ return (h(Host, { style: this.hostCSSProperties() }, h("p", { style: this.styles, class: this.setsizeClass() }, h("slot", null))));
49
49
  }
50
50
  static get is() { return "cura-paragraph"; }
51
51
  static get encapsulation() { return "shadow"; }
@@ -65,39 +65,39 @@ export class CuraParagraph {
65
65
  "type": "string",
66
66
  "mutable": false,
67
67
  "complexType": {
68
- "original": "'regular' | 'large' | 'small' | 'caption'",
69
- "resolved": "\"caption\" | \"large\" | \"regular\" | \"small\"",
68
+ "original": "'regular' | 'medium' | 'large' | 'small' | 'caption' | 'xsmall'",
69
+ "resolved": "\"caption\" | \"large\" | \"medium\" | \"regular\" | \"small\" | \"xsmall\"",
70
70
  "references": {}
71
71
  },
72
72
  "required": false,
73
73
  "optional": false,
74
74
  "docs": {
75
75
  "tags": [],
76
- "text": "Set size of body text.\nValues: regular (default) | large | small | caption."
76
+ "text": "Set size of body text.\nValues: regular (deprecated), medium (default) | large | small | caption (deprecated) | xsmall."
77
77
  },
78
78
  "attribute": "size",
79
79
  "reflect": true,
80
- "defaultValue": "'regular'"
80
+ "defaultValue": "'medium'"
81
81
  },
82
- "inverted": {
83
- "type": "boolean",
82
+ "spotColor": {
83
+ "type": "string",
84
84
  "mutable": false,
85
85
  "complexType": {
86
- "original": "boolean",
87
- "resolved": "boolean",
86
+ "original": "string",
87
+ "resolved": "string",
88
88
  "references": {}
89
89
  },
90
90
  "required": false,
91
91
  "optional": false,
92
92
  "docs": {
93
93
  "tags": [],
94
- "text": "Apply light color to text in dark background.\nValues: boolean."
94
+ "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'."
95
95
  },
96
- "attribute": "inverted",
96
+ "attribute": "spot-color",
97
97
  "reflect": true,
98
- "defaultValue": "false"
98
+ "defaultValue": "'accent-dark'"
99
99
  },
100
- "spotColor": {
100
+ "color": {
101
101
  "type": "string",
102
102
  "mutable": false,
103
103
  "complexType": {
@@ -109,28 +109,46 @@ export class CuraParagraph {
109
109
  "optional": false,
110
110
  "docs": {
111
111
  "tags": [],
112
- "text": "Apply base system color to elements like <a> and <abbr>.\nValues: String primary(default) | secondary | accent | neutral | success | error | warning | info."
112
+ "text": "Text color.\nValues: Color from design system scheme. Default to the font color from the theme."
113
113
  },
114
- "attribute": "spot-color",
114
+ "attribute": "color",
115
+ "reflect": false
116
+ },
117
+ "marginBlock": {
118
+ "type": "string",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "string",
122
+ "resolved": "string",
123
+ "references": {}
124
+ },
125
+ "required": false,
126
+ "optional": false,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": "CSS margin-block property values.\nDefault to 1.25em"
130
+ },
131
+ "attribute": "margin-block",
115
132
  "reflect": true,
116
- "defaultValue": "'primary'"
133
+ "defaultValue": "'1.25em'"
117
134
  },
118
- "color": {
119
- "type": "any",
135
+ "lineHeight": {
136
+ "type": "string",
120
137
  "mutable": false,
121
138
  "complexType": {
122
- "original": "any",
123
- "resolved": "any",
139
+ "original": "string",
140
+ "resolved": "string",
124
141
  "references": {}
125
142
  },
126
143
  "required": false,
127
144
  "optional": false,
128
145
  "docs": {
129
146
  "tags": [],
130
- "text": "Color base from color scheme. Default: theme font color."
147
+ "text": "CSS line-height property values.\nDefault to 140%"
131
148
  },
132
- "attribute": "color",
133
- "reflect": false
149
+ "attribute": "line-height",
150
+ "reflect": true,
151
+ "defaultValue": "'140%'"
134
152
  }
135
153
  };
136
154
  }
@@ -144,6 +162,9 @@ export class CuraParagraph {
144
162
  return [{
145
163
  "propName": "color",
146
164
  "methodName": "handleChangeColor"
165
+ }, {
166
+ "propName": "spotColor",
167
+ "methodName": "handleChangeColor"
147
168
  }];
148
169
  }
149
170
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cura-paragraph.js","sourceRoot":"","sources":["../../../../src/components/text/cura-paragraph/cura-paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,aAAa;;gBAMiD,SAAS;oBAKhD,KAAK;qBAKJ,SAAS;;kBAmB1B,EAAE;;EAbpB,iBAAiB;IACf,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;EAaD,iBAAiB;IACf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACvD,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACzB,IAAI,CAAC,SAAS,EAAE,CAAC;EACnB,CAAC;EAED,YAAY;IACV,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1C,OAAO,SAAS,CAAC;EACnB,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,MAAM,GAAG;MACZ,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;MAC7D,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE;MACnD,uBAAuB,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;MAC7C,sBAAsB,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;MAC3C,oBAAoB,EAAE,IAA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CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,SAAG,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE;QAC/C,eAAa,CACX,CACC,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, Prop, h, Element, Watch, State } from '@stencil/core';\n\n@Component({\n tag: 'cura-paragraph',\n styleUrl: 'cura-paragraph.scss',\n shadow: true,\n})\nexport class CuraParagraph {\n\n /**\n * Set size of body text.\n * Values: regular (default) | large | small | caption.\n */\n @Prop({reflect: true}) size: 'regular' | 'large' | 'small' | 'caption' = 'regular';\n /**\n * Apply light color to text in dark background.\n * Values: boolean.\n */\n @Prop({reflect: true}) inverted = false;\n /**\n * Apply base system color to elements like <a> and <abbr>.\n * Values: String primary(default) | secondary | accent | neutral | success | error | warning | info.\n */\n @Prop({reflect: true}) spotColor = 'primary';\n /**\n * Color base from color scheme. Default: theme font color.\n */\n @Prop() color;\n @Watch('color')\n handleChangeColor() {\n this.setColors();\n }\n\n /**\n * Host element <cura-paragraph>\n */\n @Element() host: HTMLElement;\n\n /**\n * Internal Props\n */\n weights: any;\n @State() styles = {};\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.setFontProperties();\n this.setColors();\n }\n\n setsizeClass() {\n const sizeclass = {};\n sizeclass[this.size.toLowerCase()] = true;\n return sizeclass;\n }\n\n setFontProperties() {\n this.styles = {\n '--font-family': window.CuraAPI.theme.fonts.getFamily('body'),\n '--font-size': window.CuraAPI.theme.fonts.getSize(),\n '--font-weight-regular': this.weights.regular,\n '--font-weight-medium': this.weights.medium,\n '--font-weight-bold': this.weights.bold\n }\n this.setHostProperty('--font-size', window.CuraAPI.theme.fonts.getSize());\n this.setHostProperty('--block-margin', '1.25em');\n this.setHostProperty('--line-height', '140%');\n }\n\n setColors() {\n const fontColor = this.color ? window.CuraAPI.theme.colors.getColor(this.color) :\n this.inverted\n ? window.CuraAPI.theme.colors.getColor('neutral-white')\n : window.CuraAPI.theme.fonts.getColor();\n this.styles = {\n ...this.styles,\n '--color-body': fontColor || window.CuraAPI.theme.colors.getColor('neutral-darker'),\n '--color-link': this.inverted\n ? window.CuraAPI.theme.colors.getColor(`${this.spotColor}-lighter`)\n : window.CuraAPI.theme.colors.getColor(`${this.spotColor}-dark`)\n };\n }\n\n setHostProperty(prop: string, value: string) {\n this.host.style.setProperty(prop, value);\n }\n\n render() {\n return (\n <Host>\n <p style={this.styles} class={this.setsizeClass()}>\n <slot></slot>\n </p>\n </Host>\n );\n }\n\n}\n"]}
1
+ {"version":3,"file":"cura-paragraph.js","sourceRoot":"","sources":["../../../../src/components/text/cura-paragraph/cura-paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,aAAa;;IAgDxB,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;gBA1CkE,QAAQ;qBAMpE,aAAa;;uBAiBX,QAAQ;sBAMT,MAAM;kBAYxB,EAAE;;EA1BpB,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,YAAY;IACV,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1C,OAAO,SAAS,CAAC;EACnB,CAAC;EAED,iBAAiB;IACf,IAAI,CAAC,OAAO,GAAG,IAA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EAAE;QAC/C,eAAa,CACX,CACC,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, Prop, h, Element, Watch, State } from '@stencil/core';\n\n@Component({\n tag: 'cura-paragraph',\n styleUrl: 'cura-paragraph.scss',\n shadow: true,\n})\nexport class CuraParagraph {\n\n /**\n * Set size of body text.\n * Values: regular (deprecated), medium (default) | large | small | caption (deprecated) | xsmall.\n */\n @Prop({reflect: true}) size: 'regular' | 'medium' | 'large' | 'small' | 'caption' | 'xsmall' = 'medium';\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 = '140%';\n\n /**\n * Host element <cura-paragraph>\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 setsizeClass() {\n const sizeclass = {};\n sizeclass[this.size.toLowerCase()] = true;\n return sizeclass;\n }\n\n setFontProperties() {\n this.weights = this.theme.fonts.getWeights();\n this.fontSizeBase = this.theme.fonts.getSize();\n this.styles = {\n '--font-family': this.theme.fonts.getFamily('body'),\n '--font-weight-regular': this.weights.regular,\n '--font-weight-medium': this.weights.medium,\n '--font-weight-bold': this.weights.bold\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 hostCSSProperties() {\n return {\n '--margin-block': this.marginBlock,\n '--font-size-base': this.fontSizeBase,\n '--line-height': this.lineHeight\n };\n }\n\n render() {\n return (\n <Host style={this.hostCSSProperties()}>\n <p style={this.styles} class={this.setsizeClass()}>\n <slot></slot>\n </p>\n </Host>\n );\n }\n\n}\n"]}