@carbon/charts 0.41.49 → 0.41.50

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 (242) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/demo/data/index.d.ts +9 -3
  3. package/build/demo/data/wordcloud.d.ts +14 -0
  4. package/build/src/charts/index.d.ts +1 -0
  5. package/build/src/charts/wordcloud.d.ts +6 -0
  6. package/build/src/components/graphs/wordcloud.d.ts +10 -0
  7. package/build/src/components/index.d.ts +1 -0
  8. package/build/src/configuration.d.ts +2 -1
  9. package/build/src/interfaces/charts.d.ts +23 -0
  10. package/build/src/interfaces/events.d.ts +9 -0
  11. package/bundle.js +1 -1
  12. package/charts/index.d.ts +1 -0
  13. package/charts/index.js +1 -0
  14. package/charts/index.js.map +1 -1
  15. package/charts/wordcloud.d.ts +6 -0
  16. package/charts/wordcloud.js +46 -0
  17. package/charts/wordcloud.js.map +1 -0
  18. package/components/essentials/tooltip-axis.js +1 -1
  19. package/components/essentials/tooltip-axis.js.map +1 -1
  20. package/components/graphs/boxplot.js +2 -2
  21. package/components/graphs/boxplot.js.map +1 -1
  22. package/components/graphs/wordcloud.d.ts +10 -0
  23. package/components/graphs/wordcloud.js +229 -0
  24. package/components/graphs/wordcloud.js.map +1 -0
  25. package/components/index.d.ts +1 -0
  26. package/components/index.js +1 -0
  27. package/components/index.js.map +1 -1
  28. package/configuration.d.ts +2 -1
  29. package/configuration.js +22 -0
  30. package/configuration.js.map +1 -1
  31. package/demo/data/bundle.js +1 -1
  32. package/demo/data/index.d.ts +9 -3
  33. package/demo/data/index.js +25 -8
  34. package/demo/data/index.js.map +1 -1
  35. package/demo/data/wordcloud.d.ts +14 -0
  36. package/demo/data/wordcloud.js +105 -0
  37. package/demo/data/wordcloud.js.map +1 -0
  38. package/demo/styles.css +2824 -28
  39. package/demo/styles.css.map +1 -1
  40. package/demo/styles.min.css +1 -1
  41. package/demo/styles.min.css.map +1 -1
  42. package/demo/tsconfig.tsbuildinfo +29 -15
  43. package/interfaces/charts.d.ts +23 -0
  44. package/interfaces/charts.js.map +1 -1
  45. package/interfaces/events.d.ts +9 -0
  46. package/interfaces/events.js +10 -0
  47. package/interfaces/events.js.map +1 -1
  48. package/package.json +8 -7
  49. package/styles/_type.scss +4 -2
  50. package/styles/graphs/_wordcloud.scss +7 -0
  51. package/styles/graphs/index.scss +1 -0
  52. package/styles/vendor/@carbon/colors/README.md +4 -3
  53. package/styles/vendor/@carbon/colors/es/index.js +13 -12
  54. package/styles/vendor/@carbon/colors/lib/index.js +98 -93
  55. package/styles/vendor/@carbon/colors/package.json +14 -10
  56. package/styles/vendor/@carbon/colors/scss/colors.scss +1 -1
  57. package/styles/vendor/@carbon/colors/scss/index.scss +1 -1
  58. package/styles/vendor/@carbon/colors/scss/mixins.scss +33 -13
  59. package/styles/vendor/@carbon/colors/umd/index.js +99 -94
  60. package/styles/vendor/@carbon/elements/README.md +0 -6
  61. package/styles/vendor/@carbon/elements/es/index.js +4 -11
  62. package/styles/vendor/@carbon/elements/lib/index.js +959 -13
  63. package/styles/vendor/@carbon/elements/package.json +17 -13
  64. package/styles/vendor/@carbon/elements/scss/colors/colors.scss +1 -1
  65. package/styles/vendor/@carbon/elements/scss/colors/index.scss +1 -1
  66. package/styles/vendor/@carbon/elements/scss/colors/mixins.scss +33 -13
  67. package/styles/vendor/@carbon/elements/scss/grid/_inlined/_mixins.scss +82 -22
  68. package/styles/vendor/@carbon/elements/scss/grid/_mixins.scss +82 -22
  69. package/styles/vendor/@carbon/elements/scss/grid/modules/_breakpoint.scss +266 -0
  70. package/styles/vendor/@carbon/{themes/node_modules/@carbon/colors/scss/colors.scss → elements/scss/grid/modules/_config.scss} +6 -6
  71. package/styles/vendor/@carbon/elements/scss/grid/modules/_css-grid.scss +350 -0
  72. package/styles/vendor/@carbon/elements/scss/grid/modules/_mixins.scss +323 -0
  73. package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/_breakpoint.scss +8 -3
  74. package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
  75. package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_convert.scss +40 -0
  76. package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_spacing.scss +9 -0
  77. package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_utilities.scss +41 -0
  78. package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
  79. package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
  80. package/styles/vendor/@carbon/elements/scss/layout/_breakpoint.scss +8 -3
  81. package/styles/vendor/@carbon/elements/scss/layout/modules/_breakpoint.scss +232 -0
  82. package/styles/vendor/@carbon/elements/scss/layout/modules/_convert.scss +40 -0
  83. package/styles/vendor/@carbon/elements/scss/layout/modules/_spacing.scss +9 -0
  84. package/styles/vendor/@carbon/elements/scss/layout/modules/_utilities.scss +41 -0
  85. package/styles/vendor/@carbon/elements/scss/layout/modules/generated/_fluid-spacing.scss +37 -0
  86. package/styles/vendor/@carbon/elements/scss/layout/modules/generated/_spacing.scss +85 -0
  87. package/styles/vendor/@carbon/elements/scss/motion/motion.scss +24 -0
  88. package/styles/vendor/@carbon/elements/scss/themes/generated/_mixins.scss +643 -138
  89. package/styles/vendor/@carbon/elements/scss/themes/generated/_themes.scss +154 -77
  90. package/styles/vendor/@carbon/elements/scss/themes/generated/_tokens.scss +157 -75
  91. package/styles/vendor/@carbon/elements/scss/themes/modules/_theme.scss +50 -0
  92. package/styles/vendor/@carbon/elements/scss/themes/modules/_themes.scss +8 -0
  93. package/styles/vendor/@carbon/elements/scss/themes/modules/_utilities.scss +18 -0
  94. package/styles/vendor/@carbon/elements/scss/themes/modules/generated/_themes.scss +247 -0
  95. package/styles/vendor/@carbon/elements/scss/type/_font-family.scss +2 -2
  96. package/styles/vendor/@carbon/elements/scss/type/_inlined/_font-family.scss +2 -2
  97. package/styles/vendor/@carbon/elements/scss/type/_inlined/_reset.scss +9 -3
  98. package/styles/vendor/@carbon/elements/scss/type/_inlined/_scale.scss +2 -2
  99. package/styles/vendor/@carbon/elements/scss/type/_inlined/_styles.scss +60 -57
  100. package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_mono.scss +72 -72
  101. package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_sans-condensed.scss +302 -0
  102. package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_sans.scss +84 -84
  103. package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_serif.scss +72 -72
  104. package/styles/vendor/@carbon/elements/scss/type/_reset.scss +9 -3
  105. package/styles/vendor/@carbon/elements/scss/type/_scale.scss +2 -2
  106. package/styles/vendor/@carbon/elements/scss/type/_styles.scss +60 -57
  107. package/styles/vendor/@carbon/elements/scss/type/font-face/_mono.scss +72 -72
  108. package/styles/vendor/@carbon/elements/scss/type/font-face/_sans-condensed.scss +302 -0
  109. package/styles/vendor/@carbon/elements/scss/type/font-face/_sans.scss +84 -84
  110. package/styles/vendor/@carbon/elements/scss/type/font-face/_serif.scss +72 -72
  111. package/styles/vendor/@carbon/elements/scss/type/modules/_classes.scss +42 -0
  112. package/styles/vendor/@carbon/elements/scss/type/modules/_font-family.scss +70 -0
  113. package/styles/vendor/@carbon/elements/scss/type/modules/_prefix.scss +11 -0
  114. package/styles/vendor/@carbon/elements/scss/type/modules/_reset.scss +92 -0
  115. package/styles/vendor/@carbon/elements/scss/type/modules/_scale.scss +56 -0
  116. package/styles/vendor/@carbon/elements/scss/type/modules/_styles.scss +713 -0
  117. package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/_breakpoint.scss +8 -3
  118. package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
  119. package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_convert.scss +40 -0
  120. package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_spacing.scss +9 -0
  121. package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_utilities.scss +41 -0
  122. package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
  123. package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
  124. package/styles/vendor/@carbon/elements/src/__tests__/PublicAPI-test.js +12 -0
  125. package/styles/vendor/@carbon/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap +306 -0
  126. package/styles/vendor/@carbon/elements/src/index.js +166 -4
  127. package/styles/vendor/@carbon/elements/umd/index.js +961 -17
  128. package/styles/vendor/@carbon/layout/README.md +0 -6
  129. package/styles/vendor/@carbon/layout/es/index.js +1 -1
  130. package/styles/vendor/@carbon/{themes/node_modules/@carbon/colors/scss → layout}/index.scss +5 -6
  131. package/styles/vendor/@carbon/layout/lib/index.js +30 -30
  132. package/styles/vendor/@carbon/layout/package.json +14 -10
  133. package/styles/vendor/@carbon/layout/scss/_breakpoint.scss +8 -3
  134. package/styles/vendor/@carbon/layout/scss/modules/_breakpoint.scss +232 -0
  135. package/styles/vendor/@carbon/layout/scss/modules/_convert.scss +40 -0
  136. package/styles/vendor/@carbon/layout/scss/modules/_spacing.scss +9 -0
  137. package/styles/vendor/@carbon/layout/scss/modules/_utilities.scss +41 -0
  138. package/styles/vendor/@carbon/layout/scss/modules/generated/_fluid-spacing.scss +37 -0
  139. package/styles/vendor/@carbon/layout/scss/modules/generated/_spacing.scss +85 -0
  140. package/styles/vendor/@carbon/layout/umd/index.js +31 -31
  141. package/styles/vendor/@carbon/motion/README.md +0 -6
  142. package/styles/vendor/@carbon/motion/es/index.js +8 -1
  143. package/styles/vendor/@carbon/motion/index.scss +56 -0
  144. package/styles/vendor/@carbon/motion/lib/index.js +14 -0
  145. package/styles/vendor/@carbon/motion/package.json +10 -6
  146. package/styles/vendor/@carbon/motion/scss/motion.scss +24 -0
  147. package/styles/vendor/@carbon/motion/src/index.js +16 -0
  148. package/styles/vendor/@carbon/motion/umd/index.js +15 -1
  149. package/styles/vendor/@carbon/themes/README.md +5 -4
  150. package/styles/vendor/@carbon/themes/es/index.js +719 -57
  151. package/styles/vendor/@carbon/themes/index.scss +9 -0
  152. package/styles/vendor/@carbon/themes/lib/index.js +1297 -251
  153. package/styles/vendor/@carbon/themes/metadata.yml +3 -0
  154. package/styles/vendor/@carbon/themes/package.json +23 -14
  155. package/styles/vendor/@carbon/themes/scss/_mixins.scss +27 -146
  156. package/styles/vendor/@carbon/themes/scss/_theme-maps.scss +3 -263
  157. package/styles/vendor/@carbon/themes/scss/_tokens.scss +2 -297
  158. package/styles/vendor/@carbon/themes/scss/generated/_mixins.scss +1851 -0
  159. package/styles/vendor/@carbon/themes/scss/generated/_themes.scss +1534 -0
  160. package/styles/vendor/@carbon/themes/scss/generated/_tokens.scss +1757 -0
  161. package/styles/vendor/@carbon/themes/scss/modules/_theme.scss +50 -0
  162. package/styles/vendor/@carbon/themes/scss/modules/_themes.scss +8 -0
  163. package/styles/vendor/@carbon/themes/scss/modules/_utilities.scss +18 -0
  164. package/styles/vendor/@carbon/themes/scss/modules/generated/_themes.scss +247 -0
  165. package/styles/vendor/@carbon/themes/scss/themes.scss +3 -2
  166. package/styles/vendor/@carbon/themes/src/g10.js +97 -5
  167. package/styles/vendor/@carbon/themes/src/g100.js +96 -4
  168. package/styles/vendor/@carbon/themes/src/g90.js +98 -6
  169. package/styles/vendor/@carbon/themes/src/index.js +5 -3
  170. package/styles/vendor/@carbon/themes/src/tokens.js +112 -2
  171. package/styles/vendor/@carbon/themes/src/tools.js +25 -0
  172. package/styles/vendor/@carbon/themes/src/v9.js +181 -0
  173. package/styles/vendor/@carbon/themes/src/white.js +98 -3
  174. package/styles/vendor/@carbon/themes/umd/index.js +1297 -254
  175. package/styles/vendor/@carbon/type/README.md +0 -6
  176. package/styles/vendor/@carbon/type/es/index.js +111 -82
  177. package/styles/vendor/@carbon/type/lib/index.js +132 -103
  178. package/styles/vendor/@carbon/type/package.json +12 -8
  179. package/styles/vendor/@carbon/type/scss/_font-family.scss +2 -2
  180. package/styles/vendor/@carbon/type/scss/_inlined/_font-family.scss +2 -2
  181. package/styles/vendor/@carbon/type/scss/_inlined/_reset.scss +9 -3
  182. package/styles/vendor/@carbon/type/scss/_inlined/_scale.scss +2 -2
  183. package/styles/vendor/@carbon/type/scss/_inlined/_styles.scss +60 -57
  184. package/styles/vendor/@carbon/type/scss/_inlined/font-face/_mono.scss +72 -72
  185. package/styles/vendor/@carbon/type/scss/_inlined/font-face/_sans-condensed.scss +302 -0
  186. package/styles/vendor/@carbon/type/scss/_inlined/font-face/_sans.scss +84 -84
  187. package/styles/vendor/@carbon/type/scss/_inlined/font-face/_serif.scss +72 -72
  188. package/styles/vendor/@carbon/type/scss/_reset.scss +9 -3
  189. package/styles/vendor/@carbon/type/scss/_scale.scss +2 -2
  190. package/styles/vendor/@carbon/type/scss/_styles.scss +60 -57
  191. package/styles/vendor/@carbon/type/scss/font-face/_mono.scss +72 -72
  192. package/styles/vendor/@carbon/type/scss/font-face/_sans-condensed.scss +302 -0
  193. package/styles/vendor/@carbon/type/scss/font-face/_sans.scss +84 -84
  194. package/styles/vendor/@carbon/type/scss/font-face/_serif.scss +72 -72
  195. package/styles/vendor/@carbon/type/scss/modules/_classes.scss +42 -0
  196. package/styles/vendor/@carbon/type/scss/modules/_font-family.scss +70 -0
  197. package/styles/vendor/@carbon/type/scss/modules/_prefix.scss +11 -0
  198. package/styles/vendor/@carbon/type/scss/modules/_reset.scss +92 -0
  199. package/styles/vendor/@carbon/type/scss/modules/_scale.scss +56 -0
  200. package/styles/vendor/@carbon/type/scss/modules/_styles.scss +713 -0
  201. package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/_breakpoint.scss +8 -3
  202. package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
  203. package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_convert.scss +40 -0
  204. package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_spacing.scss +9 -0
  205. package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_utilities.scss +41 -0
  206. package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
  207. package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
  208. package/styles/vendor/@carbon/type/src/__tests__/__snapshots__/styles-test.js.snap +32 -34
  209. package/styles/vendor/@carbon/type/src/__tests__/exports-test.js +1 -1
  210. package/styles/vendor/@carbon/type/src/__tests__/fluid-test.js +26 -26
  211. package/styles/vendor/@carbon/type/src/__tests__/styles-test.js +1 -1
  212. package/styles/vendor/@carbon/type/src/__tests__/tokens-test.js +2 -2
  213. package/styles/vendor/@carbon/type/src/fluid.js +1 -1
  214. package/styles/vendor/@carbon/type/src/index.js +1 -1
  215. package/styles/vendor/@carbon/type/src/styles.js +65 -64
  216. package/styles/vendor/@carbon/type/src/tokens.js +64 -31
  217. package/styles/vendor/@carbon/type/umd/index.js +134 -105
  218. package/styles-g10.css +570 -2
  219. package/styles-g10.css.map +1 -1
  220. package/styles-g10.min.css +1 -1
  221. package/styles-g10.min.css.map +1 -1
  222. package/styles-g100.css +574 -6
  223. package/styles-g100.css.map +1 -1
  224. package/styles-g100.min.css +1 -1
  225. package/styles-g100.min.css.map +1 -1
  226. package/styles-g90.css +574 -6
  227. package/styles-g90.css.map +1 -1
  228. package/styles-g90.min.css +1 -1
  229. package/styles-g90.min.css.map +1 -1
  230. package/styles.css +570 -2
  231. package/styles.css.map +1 -1
  232. package/styles.min.css +1 -1
  233. package/styles.min.css.map +1 -1
  234. package/tsconfig.tsbuildinfo +64 -14
  235. package/styles/vendor/@carbon/layout/docs/sass.md +0 -1899
  236. package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/LICENSE +0 -201
  237. package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/README.md +0 -154
  238. package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/es/index.js +0 -287
  239. package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/lib/index.js +0 -410
  240. package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/package.json +0 -51
  241. package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/scss/mixins.scss +0 -646
  242. package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/umd/index.js +0 -416
@@ -0,0 +1,713 @@
1
+ //
2
+ // Copyright IBM Corp. 2018, 2018
3
+ //
4
+ // This source code is licensed under the Apache-2.0 license found in the
5
+ // LICENSE file in the root directory of this source tree.
6
+ //
7
+
8
+ @use 'sass:map';
9
+ @use '@carbon/layout';
10
+ @use 'font-family';
11
+ @use 'scale';
12
+
13
+ /// @type Map
14
+ /// @access public
15
+ /// @group @carbon/type
16
+ $caption-01: (
17
+ font-size: scale.type-scale(1),
18
+ font-weight: font-family.font-weight('regular'),
19
+ line-height: 1.34,
20
+ letter-spacing: 0.32px,
21
+ ) !default;
22
+
23
+ /// @type Map
24
+ /// @access public
25
+ /// @group @carbon/type
26
+ $label-01: (
27
+ font-size: scale.type-scale(1),
28
+ font-weight: font-family.font-weight('regular'),
29
+ line-height: 1.34,
30
+ letter-spacing: 0.32px,
31
+ ) !default;
32
+
33
+ /// @type Map
34
+ /// @access public
35
+ /// @group @carbon/type
36
+ $helper-text-01: (
37
+ font-size: scale.type-scale(1),
38
+ line-height: 1.34,
39
+ letter-spacing: 0.32px,
40
+ ) !default;
41
+
42
+ /// @type Map
43
+ /// @access public
44
+ /// @group @carbon/type
45
+ $body-short-01: (
46
+ font-size: scale.type-scale(2),
47
+ font-weight: font-family.font-weight('regular'),
48
+ line-height: 1.29,
49
+ letter-spacing: 0.16px,
50
+ ) !default;
51
+
52
+ /// @type Map
53
+ /// @access public
54
+ /// @group @carbon/type
55
+ $body-long-01: (
56
+ font-size: scale.type-scale(2),
57
+ font-weight: font-family.font-weight('regular'),
58
+ line-height: 1.43,
59
+ letter-spacing: 0.16px,
60
+ ) !default;
61
+
62
+ /// @type Map
63
+ /// @access public
64
+ /// @group @carbon/type
65
+ $body-short-02: (
66
+ font-size: scale.type-scale(3),
67
+ font-weight: font-family.font-weight('regular'),
68
+ line-height: 1.375,
69
+ letter-spacing: 0,
70
+ ) !default;
71
+
72
+ /// @type Map
73
+ /// @access public
74
+ /// @group @carbon/type
75
+ $body-long-02: (
76
+ font-size: scale.type-scale(3),
77
+ font-weight: font-family.font-weight('regular'),
78
+ line-height: 1.5,
79
+ letter-spacing: 0,
80
+ ) !default;
81
+
82
+ /// @type Map
83
+ /// @access public
84
+ /// @group @carbon/type
85
+ $code-01: (
86
+ font-family: font-family.font-family('mono'),
87
+ font-size: scale.type-scale(1),
88
+ font-weight: font-family.font-weight('regular'),
89
+ line-height: 1.34,
90
+ letter-spacing: 0.32px,
91
+ ) !default;
92
+
93
+ /// @type Map
94
+ /// @access public
95
+ /// @group @carbon/type
96
+ $code-02: (
97
+ font-family: font-family.font-family('mono'),
98
+ font-size: scale.type-scale(2),
99
+ font-weight: font-family.font-weight('regular'),
100
+ line-height: 1.43,
101
+ letter-spacing: 0.32px,
102
+ ) !default;
103
+
104
+ /// @type Map
105
+ /// @access public
106
+ /// @group @carbon/type
107
+ $heading-01: (
108
+ font-size: scale.type-scale(2),
109
+ font-weight: font-family.font-weight('semibold'),
110
+ line-height: 1.29,
111
+ letter-spacing: 0.16px,
112
+ ) !default;
113
+
114
+ /// @type Map
115
+ /// @access public
116
+ /// @group @carbon/type
117
+ $productive-heading-01: $heading-01 !default;
118
+
119
+ /// @type Map
120
+ /// @access public
121
+ /// @group @carbon/type
122
+ $heading-02: (
123
+ font-size: scale.type-scale(3),
124
+ font-weight: font-family.font-weight('semibold'),
125
+ line-height: 1.375,
126
+ letter-spacing: 0,
127
+ ) !default;
128
+
129
+ /// @type Map
130
+ /// @access public
131
+ /// @group @carbon/type
132
+ $productive-heading-02: $heading-02 !default;
133
+
134
+ /// @type Map
135
+ /// @access public
136
+ /// @group @carbon/type
137
+ $productive-heading-03: (
138
+ font-size: scale.type-scale(5),
139
+ font-weight: font-family.font-weight('regular'),
140
+ line-height: 1.4,
141
+ letter-spacing: 0,
142
+ ) !default;
143
+
144
+ /// @type Map
145
+ /// @access public
146
+ /// @group @carbon/type
147
+ $productive-heading-04: (
148
+ font-size: scale.type-scale(7),
149
+ font-weight: font-family.font-weight('regular'),
150
+ line-height: 1.29,
151
+ letter-spacing: 0,
152
+ ) !default;
153
+
154
+ /// @type Map
155
+ /// @access public
156
+ /// @group @carbon/type
157
+ $productive-heading-05: (
158
+ font-size: scale.type-scale(8),
159
+ font-weight: font-family.font-weight('regular'),
160
+ line-height: 1.25,
161
+ letter-spacing: 0,
162
+ ) !default;
163
+
164
+ /// @type Map
165
+ /// @access public
166
+ /// @group @carbon/type
167
+ $productive-heading-06: (
168
+ font-size: scale.type-scale(8),
169
+ font-weight: font-family.font-weight('light'),
170
+ // Extra digit needed for precision in Chrome
171
+ line-height: 1.199,
172
+ letter-spacing: 0,
173
+ ) !default;
174
+
175
+ /// @type Map
176
+ /// @access public
177
+ /// @group @carbon/type
178
+ $productive-heading-07: (
179
+ font-size: scale.type-scale(10),
180
+ font-weight: font-family.font-weight('light'),
181
+ line-height: 1.19,
182
+ letter-spacing: 0,
183
+ ) !default;
184
+
185
+ /// @type Map
186
+ /// @access public
187
+ /// @group @carbon/type
188
+ $expressive-heading-01: map.merge(
189
+ $heading-01,
190
+ (
191
+ line-height: 1.25,
192
+ )
193
+ ) !default;
194
+
195
+ /// @type Map
196
+ /// @access public
197
+ /// @group @carbon/type
198
+ $expressive-heading-02: map.merge(
199
+ $heading-02,
200
+ (
201
+ line-height: 1.5,
202
+ )
203
+ ) !default;
204
+
205
+ /// @type Map
206
+ /// @access public
207
+ /// @group @carbon/type
208
+ $expressive-heading-03: (
209
+ font-size: scale.type-scale(5),
210
+ font-weight: font-family.font-weight('regular'),
211
+ line-height: 1.4,
212
+ letter-spacing: 0,
213
+ breakpoints: (
214
+ xlg: (
215
+ font-size: scale.type-scale(5),
216
+ line-height: 1.25,
217
+ ),
218
+ max: (
219
+ font-size: scale.type-scale(6),
220
+ line-height: 1.334,
221
+ ),
222
+ ),
223
+ ) !default;
224
+
225
+ /// @type Map
226
+ /// @access public
227
+ /// @group @carbon/type
228
+ $expressive-heading-04: (
229
+ font-size: scale.type-scale(7),
230
+ font-weight: font-family.font-weight('regular'),
231
+ line-height: 1.29,
232
+ letter-spacing: 0,
233
+ breakpoints: (
234
+ xlg: (
235
+ font-size: scale.type-scale(7),
236
+ line-height: 1.25,
237
+ ),
238
+ max: (
239
+ font-size: scale.type-scale(8),
240
+ ),
241
+ ),
242
+ ) !default;
243
+
244
+ /// @type Map
245
+ /// @access public
246
+ /// @group @carbon/type
247
+ $expressive-heading-05: (
248
+ font-size: scale.type-scale(8),
249
+ font-weight: font-family.font-weight('regular'),
250
+ line-height: 1.25,
251
+ letter-spacing: 0,
252
+ breakpoints: (
253
+ md: (
254
+ font-size: scale.type-scale(9),
255
+ font-weight: font-family.font-weight('light'),
256
+ line-height: 1.22,
257
+ ),
258
+ lg: (
259
+ font-size: scale.type-scale(10),
260
+ line-height: 1.19,
261
+ ),
262
+ xlg: (
263
+ font-size: scale.type-scale(11),
264
+ line-height: 1.17,
265
+ ),
266
+ max: (
267
+ font-size: scale.type-scale(13),
268
+ ),
269
+ ),
270
+ ) !default;
271
+
272
+ /// @type Map
273
+ /// @access public
274
+ /// @group @carbon/type
275
+ $expressive-heading-06: (
276
+ font-size: scale.type-scale(8),
277
+ font-weight: font-family.font-weight('semibold'),
278
+ line-height: 1.25,
279
+ letter-spacing: 0,
280
+ breakpoints: (
281
+ md: (
282
+ font-size: scale.type-scale(9),
283
+ line-height: 1.22,
284
+ ),
285
+ lg: (
286
+ font-size: scale.type-scale(10),
287
+ line-height: 1.19,
288
+ ),
289
+ xlg: (
290
+ font-size: scale.type-scale(11),
291
+ line-height: 1.17,
292
+ ),
293
+ max: (
294
+ font-size: scale.type-scale(13),
295
+ ),
296
+ ),
297
+ ) !default;
298
+
299
+ /// @type Map
300
+ /// @access public
301
+ /// @group @carbon/type
302
+ $expressive-paragraph-01: (
303
+ font-size: scale.type-scale(6),
304
+ font-weight: font-family.font-weight('light'),
305
+ line-height: 1.334,
306
+ letter-spacing: 0,
307
+ breakpoints: (
308
+ lg: (
309
+ font-size: scale.type-scale(7),
310
+ line-height: 1.29,
311
+ ),
312
+ max: (
313
+ font-size: scale.type-scale(8),
314
+ line-height: 1.25,
315
+ ),
316
+ ),
317
+ );
318
+
319
+ /// @type Map
320
+ /// @access public
321
+ /// @group @carbon/type
322
+ $quotation-01: (
323
+ font-size: scale.type-scale(5),
324
+ font-weight: font-family.font-weight('regular'),
325
+ line-height: 1.3,
326
+ letter-spacing: 0,
327
+ breakpoints: (
328
+ md: (
329
+ font-size: scale.type-scale(5),
330
+ ),
331
+ lg: (
332
+ font-size: scale.type-scale(6),
333
+ line-height: 1.334,
334
+ ),
335
+ xlg: (
336
+ font-size: scale.type-scale(7),
337
+ line-height: 1.29,
338
+ ),
339
+ max: (
340
+ font-size: scale.type-scale(8),
341
+ line-height: 1.25,
342
+ ),
343
+ ),
344
+ ) !default;
345
+
346
+ /// @type Map
347
+ /// @access public
348
+ /// @group @carbon/type
349
+ $quotation-02: (
350
+ font-size: scale.type-scale(8),
351
+ font-weight: font-family.font-weight('light'),
352
+ line-height: 1.25,
353
+ letter-spacing: 0,
354
+ breakpoints: (
355
+ md: (
356
+ font-size: scale.type-scale(9),
357
+ line-height: 1.22,
358
+ ),
359
+ lg: (
360
+ font-size: scale.type-scale(10),
361
+ line-height: 1.19,
362
+ ),
363
+ xlg: (
364
+ font-size: scale.type-scale(11),
365
+ line-height: 1.17,
366
+ ),
367
+ max: (
368
+ font-size: scale.type-scale(13),
369
+ ),
370
+ ),
371
+ ) !default;
372
+
373
+ /// @type Map
374
+ /// @access public
375
+ /// @group @carbon/type
376
+ $display-01: (
377
+ font-size: scale.type-scale(10),
378
+ font-weight: font-family.font-weight('light'),
379
+ line-height: 1.19,
380
+ letter-spacing: 0,
381
+ breakpoints: (
382
+ md: (
383
+ font-size: scale.type-scale(10),
384
+ ),
385
+ lg: (
386
+ font-size: scale.type-scale(12),
387
+ ),
388
+ xlg: (
389
+ font-size: scale.type-scale(13),
390
+ line-height: 1.17,
391
+ ),
392
+ max: (
393
+ font-size: scale.type-scale(15),
394
+ line-height: 1.13,
395
+ ),
396
+ ),
397
+ ) !default;
398
+
399
+ /// @type Map
400
+ /// @access public
401
+ /// @group @carbon/type
402
+ $display-02: (
403
+ font-size: scale.type-scale(10),
404
+ font-weight: font-family.font-weight('semibold'),
405
+ line-height: 1.19,
406
+ letter-spacing: 0,
407
+ breakpoints: (
408
+ md: (
409
+ font-size: scale.type-scale(10),
410
+ ),
411
+ lg: (
412
+ font-size: scale.type-scale(12),
413
+ ),
414
+ xlg: (
415
+ font-size: scale.type-scale(13),
416
+ line-height: 1.16,
417
+ ),
418
+ max: (
419
+ font-size: scale.type-scale(15),
420
+ line-height: 1.13,
421
+ ),
422
+ ),
423
+ ) !default;
424
+
425
+ /// @type Map
426
+ /// @access public
427
+ /// @group @carbon/type
428
+ $display-03: (
429
+ font-size: scale.type-scale(10),
430
+ font-weight: font-family.font-weight('light'),
431
+ line-height: 1.19,
432
+ letter-spacing: 0,
433
+ breakpoints: (
434
+ md: (
435
+ font-size: scale.type-scale(14),
436
+ line-height: 1.15,
437
+ ),
438
+ lg: (
439
+ font-size: scale.type-scale(17),
440
+ line-height: 1.11,
441
+ letter-spacing: -0.64px,
442
+ ),
443
+ xlg: (
444
+ font-size: scale.type-scale(20),
445
+ line-height: 1.07,
446
+ letter-spacing: -0.64px,
447
+ ),
448
+ max: (
449
+ font-size: scale.type-scale(23),
450
+ line-height: 1.05,
451
+ letter-spacing: -0.96px,
452
+ ),
453
+ ),
454
+ ) !default;
455
+
456
+ /// @type Map
457
+ /// @access public
458
+ /// @group @carbon/type
459
+ $display-04: (
460
+ font-size: scale.type-scale(10),
461
+ font-weight: font-family.font-weight('semibold'),
462
+ line-height: 1.19,
463
+ letter-spacing: 0,
464
+ breakpoints: (
465
+ md: (
466
+ font-size: scale.type-scale(14),
467
+ line-height: 1.15,
468
+ ),
469
+ lg: (
470
+ font-size: scale.type-scale(17),
471
+ line-height: 1.11,
472
+ letter-spacing: -0.64px,
473
+ ),
474
+ xlg: (
475
+ font-size: scale.type-scale(20),
476
+ line-height: 1.07,
477
+ letter-spacing: -0.64px,
478
+ ),
479
+ max: (
480
+ font-size: scale.type-scale(23),
481
+ line-height: 1.05,
482
+ letter-spacing: -0.96px,
483
+ ),
484
+ ),
485
+ ) !default;
486
+
487
+ /// @type Map
488
+ /// @access public
489
+ /// @group @carbon/type
490
+ $tokens: (
491
+ caption-01: $caption-01,
492
+ label-01: $label-01,
493
+ helper-text-01: $helper-text-01,
494
+ body-short-01: $body-short-01,
495
+ body-short-02: $body-short-02,
496
+ body-long-01: $body-long-01,
497
+ body-long-02: $body-long-02,
498
+ code-01: $code-01,
499
+ code-02: $code-02,
500
+ heading-01: $heading-01,
501
+ heading-02: $heading-02,
502
+ productive-heading-01: $productive-heading-01,
503
+ productive-heading-02: $productive-heading-02,
504
+ productive-heading-03: $productive-heading-03,
505
+ productive-heading-04: $productive-heading-04,
506
+ productive-heading-05: $productive-heading-05,
507
+ productive-heading-06: $productive-heading-06,
508
+ productive-heading-07: $productive-heading-07,
509
+ expressive-paragraph-01: $expressive-paragraph-01,
510
+ expressive-heading-01: $expressive-heading-01,
511
+ expressive-heading-02: $expressive-heading-02,
512
+ expressive-heading-03: $expressive-heading-03,
513
+ expressive-heading-04: $expressive-heading-04,
514
+ expressive-heading-05: $expressive-heading-05,
515
+ expressive-heading-06: $expressive-heading-06,
516
+ quotation-01: $quotation-01,
517
+ quotation-02: $quotation-02,
518
+ display-01: $display-01,
519
+ display-02: $display-02,
520
+ display-03: $display-03,
521
+ display-04: $display-04,
522
+ );
523
+
524
+ /// @param {Map} $map
525
+ /// @access public
526
+ /// @group @carbon/type
527
+ @mixin properties($map) {
528
+ @each $name, $value in $map {
529
+ #{$name}: $value;
530
+ }
531
+ }
532
+
533
+ /// @param {Number} $value - Number with units
534
+ /// @return {Number} Without units
535
+ /// @access public
536
+ /// @group @carbon/type
537
+ @function strip-unit($value) {
538
+ @return $value / ($value * 0 + 1);
539
+ }
540
+
541
+ /// This helper includes fluid type styles for the given token value. Fluid type
542
+ /// means that the `font-size` is computed using `calc()` in order to be
543
+ /// determined by the screen size instead of a breakpoint. As a result, fluid
544
+ /// styles should be used with caution in fixed width contexts.
545
+ ///
546
+ /// In addition, we make use of %-based line-heights so that the line-height of
547
+ /// each type style is computed correctly due to the dynamic nature of the
548
+ /// `font-size`.
549
+ ///
550
+ /// Most of the logic for this work comes from CSS Tricks:
551
+ /// https://css-tricks.com/snippets/css/fluid-typography/
552
+ ///
553
+ /// @param {Map} $type-styles - The value of a given type token
554
+ /// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use
555
+ /// @access public
556
+ /// @group @carbon/type
557
+ @mixin fluid-type($type-styles, $breakpoints: layout.$grid-breakpoints) {
558
+ // Include the initial styles for the given token by default without any
559
+ // media query guard. This includes `font-size` as a fallback in the case
560
+ // that a browser does not support `calc()`
561
+ @include properties(map.remove($type-styles, breakpoints));
562
+ // We also need to include the `sm` styles by default since they don't
563
+ // appear in the fluid styles for tokens
564
+ @include fluid-type-size($type-styles, sm, $breakpoints);
565
+
566
+ // Finally, we need to go through all the breakpoints defined in the type
567
+ // token and apply the properties and fluid type size for that given
568
+ // breakpoint
569
+ @each $name, $values in map.get($type-styles, breakpoints) {
570
+ @include layout.breakpoint($name) {
571
+ @include properties($values);
572
+ @include fluid-type-size($type-styles, $name, $breakpoints);
573
+ }
574
+ }
575
+ }
576
+
577
+ /// Computes the fluid `font-size` for a given type style and breakpoint
578
+ /// @param {Map} $type-styles - The styles for a given token
579
+ /// @param {String} $name - The name of the breakpoint to which we apply the fluid
580
+ /// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system
581
+ /// @access public
582
+ /// @group @carbon/type
583
+ @mixin fluid-type-size(
584
+ $type-styles,
585
+ $name,
586
+ $breakpoints: layout.$grid-breakpoints
587
+ ) {
588
+ // Get the information about the breakpoint we're currently working in. Useful
589
+ // for getting initial width information
590
+ $breakpoint: map.get($breakpoints, $name);
591
+
592
+ // Our fluid styles are captured under the 'breakpoints' property in our type
593
+ // styles map. These define what values to treat as `max-` variables below
594
+ $fluid-sizes: map.get($type-styles, breakpoints);
595
+ $fluid-breakpoint: ();
596
+ // Special case for `sm` because the styles for small are on the type style
597
+ // directly
598
+ @if $name == sm {
599
+ $fluid-breakpoint: map.remove($type-styles, breakpoints);
600
+ } @else {
601
+ $fluid-breakpoint: map.get($fluid-sizes, $name);
602
+ }
603
+
604
+ // Initialize our font-sizes to the default size for the type style
605
+ $max-font-size: map.get($type-styles, font-size);
606
+ $min-font-size: map.get($type-styles, font-size);
607
+ @if map.has-key($fluid-breakpoint, font-size) {
608
+ $min-font-size: map.get($fluid-breakpoint, font-size);
609
+ }
610
+
611
+ // Initialize our min and max width to the width of the current breakpoint
612
+ $max-vw: map.get($breakpoint, width);
613
+ $min-vw: map.get($breakpoint, width);
614
+
615
+ // We can use `breakpoint-next` to see if there is another breakpoint we can
616
+ // use to update `max-font-size` and `max-vw` with larger values
617
+ $next-breakpoint-available: layout.breakpoint-next($name, $breakpoints);
618
+ $next-fluid-breakpoint-name: null;
619
+
620
+ // We need to figure out what the next available fluid breakpoint is for our
621
+ // given $type-styles. In this loop we try and iterate through breakpoints
622
+ // until we either manually set $next-breakpoint-available to null or
623
+ // `breakpoint-next` returns null.
624
+ @while $next-breakpoint-available {
625
+ @if map.has-key($fluid-sizes, $next-breakpoint-available) {
626
+ $next-fluid-breakpoint-name: $next-breakpoint-available;
627
+ $next-breakpoint-available: null;
628
+ } @else {
629
+ $next-breakpoint-available: layout.breakpoint-next(
630
+ $next-breakpoint-available,
631
+ $breakpoints
632
+ );
633
+ }
634
+ }
635
+
636
+ // If we have found the next available fluid breakpoint name, then we know
637
+ // that we have values that we can use to set max-font-size and max-vw as both
638
+ // values derive from the next breakpoint
639
+ @if $next-fluid-breakpoint-name {
640
+ $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);
641
+ $max-font-size: map.get(
642
+ map.get($fluid-sizes, $next-fluid-breakpoint-name),
643
+ font-size
644
+ );
645
+ $max-vw: map.get($next-fluid-breakpoint, width);
646
+
647
+ // prettier-ignore
648
+ font-size: calc(#{$min-font-size} +
649
+ #{strip-unit($max-font-size - $min-font-size)} *
650
+ ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})
651
+ );
652
+ } @else {
653
+ // Otherwise, just default to setting the font size found from the type
654
+ // style or the given fluid breakpoint in the type style
655
+ font-size: $min-font-size;
656
+ }
657
+ }
658
+
659
+ // TODO move following variable and `custom-property` mixin into shared file for
660
+ // both `@carbon/type` and `@carbon/themes`
661
+
662
+ /// @access private
663
+ /// @group @carbon/type
664
+ $custom-property-prefix: 'cds' !default;
665
+
666
+ /// @access private
667
+ /// @group @carbon/type
668
+ @mixin custom-properties($name, $value) {
669
+ @each $property, $value in $value {
670
+ #{$property}: var(
671
+ --#{$custom-property-prefix}-#{$name}-#{$property},
672
+ #{$value}
673
+ );
674
+ }
675
+ }
676
+
677
+ /// Helper mixin to include the styles for a given token in any selector in your
678
+ /// project. Also includes an optional fluid option that will enable fluid
679
+ /// styles for the token if they are defined. Fluid styles will cause the
680
+ /// token's font-size to be computed based on the viewport size. As a result, use
681
+ /// with caution in fixed contexts.
682
+ /// @param {String} $name - The name of the token to get the styles for
683
+ /// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the
684
+ /// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use
685
+ /// @access public
686
+ /// @group @carbon/type
687
+ @mixin type-style(
688
+ $name,
689
+ $fluid: false,
690
+ $breakpoints: layout.$grid-breakpoints
691
+ ) {
692
+ @if not map.has-key($tokens, $name) {
693
+ @error 'Unable to find a token with the name: `#{$name}`';
694
+ }
695
+
696
+ $token: map.get($tokens, $name);
697
+
698
+ // If $fluid is set to true and the token has breakpoints defined for fluid
699
+ // styles, delegate to the fluid-type helper for the given token
700
+ @if $fluid == true and map.has-key($token, 'breakpoints') {
701
+ @include fluid-type($token, $breakpoints);
702
+ } @else {
703
+ @if global-variable-exists('feature-flags') and
704
+ map.get($feature-flags, 'enable-css-custom-properties')
705
+ {
706
+ @include custom-properties($name, $token);
707
+ } @else {
708
+ // Otherwise, we just include all the property declarations directly on the
709
+ // selector
710
+ @include properties(map.remove($token, 'breakpoints'));
711
+ }
712
+ }
713
+ }