@fluentui/react-text 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

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 (288) hide show
  1. package/CHANGELOG.json +511 -18
  2. package/CHANGELOG.md +195 -53
  3. package/MIGRATION.md +153 -103
  4. package/README.md +4 -4
  5. package/dist/index.d.ts +188 -0
  6. package/{lib → dist}/tsdoc-metadata.json +0 -0
  7. package/lib/Body1.js +2 -0
  8. package/lib/Body1.js.map +1 -0
  9. package/lib/Caption1.js +2 -0
  10. package/lib/Caption1.js.map +1 -0
  11. package/lib/Caption2.js +2 -0
  12. package/lib/Caption2.js.map +1 -0
  13. package/lib/Display.js.map +1 -1
  14. package/lib/LargeTitle.js.map +1 -1
  15. package/lib/Subtitle1.js +2 -0
  16. package/lib/Subtitle1.js.map +1 -0
  17. package/lib/Subtitle2.js +2 -0
  18. package/lib/Subtitle2.js.map +1 -0
  19. package/lib/Text.js.map +1 -1
  20. package/lib/Title1.js.map +1 -1
  21. package/lib/Title2.js.map +1 -1
  22. package/lib/Title3.js.map +1 -1
  23. package/lib/components/Body1/Body1.js +31 -0
  24. package/lib/components/Body1/Body1.js.map +1 -0
  25. package/lib/components/Body1/index.js +2 -0
  26. package/lib/components/Body1/index.js.map +1 -0
  27. package/lib/components/Caption1/Caption1.js +31 -0
  28. package/lib/components/Caption1/Caption1.js.map +1 -0
  29. package/lib/components/Caption1/index.js +2 -0
  30. package/lib/components/Caption1/index.js.map +1 -0
  31. package/lib/components/Caption2/Caption2.js +31 -0
  32. package/lib/components/Caption2/Caption2.js.map +1 -0
  33. package/lib/components/Caption2/index.js +2 -0
  34. package/lib/components/Caption2/index.js.map +1 -0
  35. package/lib/components/Display/Display.js +12 -8
  36. package/lib/components/Display/Display.js.map +1 -1
  37. package/lib/components/Display/index.js.map +1 -1
  38. package/lib/components/LargeTitle/LargeTitle.js +12 -8
  39. package/lib/components/LargeTitle/LargeTitle.js.map +1 -1
  40. package/lib/components/LargeTitle/index.js.map +1 -1
  41. package/lib/components/Subtitle1/Subtitle1.js +31 -0
  42. package/lib/components/Subtitle1/Subtitle1.js.map +1 -0
  43. package/lib/components/Subtitle1/index.js +2 -0
  44. package/lib/components/Subtitle1/index.js.map +1 -0
  45. package/lib/components/Subtitle2/Subtitle2.js +31 -0
  46. package/lib/components/Subtitle2/Subtitle2.js.map +1 -0
  47. package/lib/components/Subtitle2/index.js +2 -0
  48. package/lib/components/Subtitle2/index.js.map +1 -0
  49. package/lib/components/Text/Text.js +7 -7
  50. package/lib/components/Text/Text.js.map +1 -1
  51. package/lib/components/Text/Text.types.js.map +1 -1
  52. package/lib/components/Text/index.js.map +1 -1
  53. package/lib/components/Text/renderText.js +7 -7
  54. package/lib/components/Text/renderText.js.map +1 -1
  55. package/lib/components/Text/useText.js +28 -27
  56. package/lib/components/Text/useText.js.map +1 -1
  57. package/lib/components/Text/useTextStyles.js +17 -11
  58. package/lib/components/Text/useTextStyles.js.map +1 -1
  59. package/lib/components/Title1/Title1.js +12 -8
  60. package/lib/components/Title1/Title1.js.map +1 -1
  61. package/lib/components/Title1/index.js.map +1 -1
  62. package/lib/components/Title2/Title2.js +12 -8
  63. package/lib/components/Title2/Title2.js.map +1 -1
  64. package/lib/components/Title2/index.js.map +1 -1
  65. package/lib/components/Title3/Title3.js +12 -8
  66. package/lib/components/Title3/Title3.js.map +1 -1
  67. package/lib/components/Title3/index.js.map +1 -1
  68. package/lib/components/wrapper.js +13 -10
  69. package/lib/components/wrapper.js.map +1 -1
  70. package/lib/index.js +11 -10
  71. package/lib/index.js.map +1 -1
  72. package/lib-commonjs/Body1.js +10 -0
  73. package/lib-commonjs/Body1.js.map +1 -0
  74. package/lib-commonjs/Caption1.js +10 -0
  75. package/lib-commonjs/Caption1.js.map +1 -0
  76. package/lib-commonjs/Caption2.js +10 -0
  77. package/lib-commonjs/Caption2.js.map +1 -0
  78. package/lib-commonjs/Display.js +1 -1
  79. package/lib-commonjs/Display.js.map +1 -1
  80. package/lib-commonjs/LargeTitle.js +1 -1
  81. package/lib-commonjs/LargeTitle.js.map +1 -1
  82. package/lib-commonjs/Subtitle1.js +10 -0
  83. package/lib-commonjs/Subtitle1.js.map +1 -0
  84. package/lib-commonjs/Subtitle2.js +10 -0
  85. package/lib-commonjs/Subtitle2.js.map +1 -0
  86. package/lib-commonjs/Text.js +1 -1
  87. package/lib-commonjs/Text.js.map +1 -1
  88. package/lib-commonjs/Title1.js +1 -1
  89. package/lib-commonjs/Title1.js.map +1 -1
  90. package/lib-commonjs/Title2.js +1 -1
  91. package/lib-commonjs/Title2.js.map +1 -1
  92. package/lib-commonjs/Title3.js +1 -1
  93. package/lib-commonjs/Title3.js.map +1 -1
  94. package/lib-commonjs/components/Body1/Body1.js +41 -0
  95. package/lib-commonjs/components/Body1/Body1.js.map +1 -0
  96. package/lib-commonjs/components/Body1/index.js +10 -0
  97. package/lib-commonjs/components/Body1/index.js.map +1 -0
  98. package/lib-commonjs/components/Caption1/Caption1.js +41 -0
  99. package/lib-commonjs/components/Caption1/Caption1.js.map +1 -0
  100. package/lib-commonjs/components/Caption1/index.js +10 -0
  101. package/lib-commonjs/components/Caption1/index.js.map +1 -0
  102. package/lib-commonjs/components/Caption2/Caption2.js +41 -0
  103. package/lib-commonjs/components/Caption2/Caption2.js.map +1 -0
  104. package/lib-commonjs/components/Caption2/index.js +10 -0
  105. package/lib-commonjs/components/Caption2/index.js.map +1 -0
  106. package/lib-commonjs/components/Display/Display.js +20 -9
  107. package/lib-commonjs/components/Display/Display.js.map +1 -1
  108. package/lib-commonjs/components/Display/index.js +1 -1
  109. package/lib-commonjs/components/Display/index.js.map +1 -1
  110. package/lib-commonjs/components/LargeTitle/LargeTitle.js +20 -9
  111. package/lib-commonjs/components/LargeTitle/LargeTitle.js.map +1 -1
  112. package/lib-commonjs/components/LargeTitle/index.js +1 -1
  113. package/lib-commonjs/components/LargeTitle/index.js.map +1 -1
  114. package/lib-commonjs/components/Subtitle1/Subtitle1.js +41 -0
  115. package/lib-commonjs/components/Subtitle1/Subtitle1.js.map +1 -0
  116. package/lib-commonjs/components/Subtitle1/index.js +10 -0
  117. package/lib-commonjs/components/Subtitle1/index.js.map +1 -0
  118. package/lib-commonjs/components/Subtitle2/Subtitle2.js +41 -0
  119. package/lib-commonjs/components/Subtitle2/Subtitle2.js.map +1 -0
  120. package/lib-commonjs/components/Subtitle2/index.js +10 -0
  121. package/lib-commonjs/components/Subtitle2/index.js.map +1 -0
  122. package/lib-commonjs/components/Text/Text.js +8 -8
  123. package/lib-commonjs/components/Text/Text.js.map +1 -1
  124. package/lib-commonjs/components/Text/Text.types.js.map +1 -1
  125. package/lib-commonjs/components/Text/index.js +1 -1
  126. package/lib-commonjs/components/Text/index.js.map +1 -1
  127. package/lib-commonjs/components/Text/renderText.js +11 -12
  128. package/lib-commonjs/components/Text/renderText.js.map +1 -1
  129. package/lib-commonjs/components/Text/useText.js +31 -31
  130. package/lib-commonjs/components/Text/useText.js.map +1 -1
  131. package/lib-commonjs/components/Text/useTextStyles.js +21 -14
  132. package/lib-commonjs/components/Text/useTextStyles.js.map +1 -1
  133. package/lib-commonjs/components/Title1/Title1.js +20 -9
  134. package/lib-commonjs/components/Title1/Title1.js.map +1 -1
  135. package/lib-commonjs/components/Title1/index.js +1 -1
  136. package/lib-commonjs/components/Title1/index.js.map +1 -1
  137. package/lib-commonjs/components/Title2/Title2.js +20 -9
  138. package/lib-commonjs/components/Title2/Title2.js.map +1 -1
  139. package/lib-commonjs/components/Title2/index.js +1 -1
  140. package/lib-commonjs/components/Title2/index.js.map +1 -1
  141. package/lib-commonjs/components/Title3/Title3.js +20 -9
  142. package/lib-commonjs/components/Title3/Title3.js.map +1 -1
  143. package/lib-commonjs/components/Title3/index.js +1 -1
  144. package/lib-commonjs/components/Title3/index.js.map +1 -1
  145. package/lib-commonjs/components/wrapper.js +14 -11
  146. package/lib-commonjs/components/wrapper.js.map +1 -1
  147. package/lib-commonjs/index.js +173 -11
  148. package/lib-commonjs/index.js.map +1 -1
  149. package/package.json +18 -22
  150. package/dist/react-text.d.ts +0 -163
  151. package/lib/Body.d.ts +0 -1
  152. package/lib/Body.js +0 -2
  153. package/lib/Body.js.map +0 -1
  154. package/lib/Caption.d.ts +0 -1
  155. package/lib/Caption.js +0 -2
  156. package/lib/Caption.js.map +0 -1
  157. package/lib/Display.d.ts +0 -1
  158. package/lib/Headline.d.ts +0 -1
  159. package/lib/Headline.js +0 -2
  160. package/lib/Headline.js.map +0 -1
  161. package/lib/LargeTitle.d.ts +0 -1
  162. package/lib/Subheadline.d.ts +0 -1
  163. package/lib/Subheadline.js +0 -2
  164. package/lib/Subheadline.js.map +0 -1
  165. package/lib/Text.d.ts +0 -1
  166. package/lib/Title1.d.ts +0 -1
  167. package/lib/Title2.d.ts +0 -1
  168. package/lib/Title3.d.ts +0 -1
  169. package/lib/common/isConformant.d.ts +0 -4
  170. package/lib/common/isConformant.js +0 -16
  171. package/lib/common/isConformant.js.map +0 -1
  172. package/lib/components/Body/Body.d.ts +0 -6
  173. package/lib/components/Body/Body.js +0 -27
  174. package/lib/components/Body/Body.js.map +0 -1
  175. package/lib/components/Body/index.d.ts +0 -1
  176. package/lib/components/Body/index.js +0 -2
  177. package/lib/components/Body/index.js.map +0 -1
  178. package/lib/components/Caption/Caption.d.ts +0 -6
  179. package/lib/components/Caption/Caption.js +0 -27
  180. package/lib/components/Caption/Caption.js.map +0 -1
  181. package/lib/components/Caption/index.d.ts +0 -1
  182. package/lib/components/Caption/index.js +0 -2
  183. package/lib/components/Caption/index.js.map +0 -1
  184. package/lib/components/Display/Display.d.ts +0 -6
  185. package/lib/components/Display/index.d.ts +0 -1
  186. package/lib/components/Headline/Headline.d.ts +0 -6
  187. package/lib/components/Headline/Headline.js +0 -27
  188. package/lib/components/Headline/Headline.js.map +0 -1
  189. package/lib/components/Headline/index.d.ts +0 -1
  190. package/lib/components/Headline/index.js +0 -2
  191. package/lib/components/Headline/index.js.map +0 -1
  192. package/lib/components/LargeTitle/LargeTitle.d.ts +0 -6
  193. package/lib/components/LargeTitle/index.d.ts +0 -1
  194. package/lib/components/Subheadline/Subheadline.d.ts +0 -6
  195. package/lib/components/Subheadline/Subheadline.js +0 -27
  196. package/lib/components/Subheadline/Subheadline.js.map +0 -1
  197. package/lib/components/Subheadline/index.d.ts +0 -1
  198. package/lib/components/Subheadline/index.js +0 -2
  199. package/lib/components/Subheadline/index.js.map +0 -1
  200. package/lib/components/Text/Text.d.ts +0 -6
  201. package/lib/components/Text/Text.types.d.ts +0 -77
  202. package/lib/components/Text/index.d.ts +0 -5
  203. package/lib/components/Text/renderText.d.ts +0 -5
  204. package/lib/components/Text/useText.d.ts +0 -12
  205. package/lib/components/Text/useTextStyles.d.ts +0 -5
  206. package/lib/components/Title1/Title1.d.ts +0 -6
  207. package/lib/components/Title1/index.d.ts +0 -1
  208. package/lib/components/Title2/Title2.d.ts +0 -6
  209. package/lib/components/Title2/index.d.ts +0 -1
  210. package/lib/components/Title3/Title3.d.ts +0 -6
  211. package/lib/components/Title3/index.d.ts +0 -1
  212. package/lib/components/wrapper.d.ts +0 -7
  213. package/lib/index.d.ts +0 -10
  214. package/lib/typographyStyles/index.d.ts +0 -2
  215. package/lib/typographyStyles/index.js +0 -3
  216. package/lib/typographyStyles/index.js.map +0 -1
  217. package/lib/typographyStyles/typographyStyles.d.ts +0 -14
  218. package/lib/typographyStyles/typographyStyles.js +0 -76
  219. package/lib/typographyStyles/typographyStyles.js.map +0 -1
  220. package/lib-commonjs/Body.d.ts +0 -1
  221. package/lib-commonjs/Body.js +0 -10
  222. package/lib-commonjs/Body.js.map +0 -1
  223. package/lib-commonjs/Caption.d.ts +0 -1
  224. package/lib-commonjs/Caption.js +0 -10
  225. package/lib-commonjs/Caption.js.map +0 -1
  226. package/lib-commonjs/Display.d.ts +0 -1
  227. package/lib-commonjs/Headline.d.ts +0 -1
  228. package/lib-commonjs/Headline.js +0 -10
  229. package/lib-commonjs/Headline.js.map +0 -1
  230. package/lib-commonjs/LargeTitle.d.ts +0 -1
  231. package/lib-commonjs/Subheadline.d.ts +0 -1
  232. package/lib-commonjs/Subheadline.js +0 -10
  233. package/lib-commonjs/Subheadline.js.map +0 -1
  234. package/lib-commonjs/Text.d.ts +0 -1
  235. package/lib-commonjs/Title1.d.ts +0 -1
  236. package/lib-commonjs/Title2.d.ts +0 -1
  237. package/lib-commonjs/Title3.d.ts +0 -1
  238. package/lib-commonjs/common/isConformant.d.ts +0 -4
  239. package/lib-commonjs/common/isConformant.js +0 -27
  240. package/lib-commonjs/common/isConformant.js.map +0 -1
  241. package/lib-commonjs/components/Body/Body.d.ts +0 -6
  242. package/lib-commonjs/components/Body/Body.js +0 -30
  243. package/lib-commonjs/components/Body/Body.js.map +0 -1
  244. package/lib-commonjs/components/Body/index.d.ts +0 -1
  245. package/lib-commonjs/components/Body/index.js +0 -10
  246. package/lib-commonjs/components/Body/index.js.map +0 -1
  247. package/lib-commonjs/components/Caption/Caption.d.ts +0 -6
  248. package/lib-commonjs/components/Caption/Caption.js +0 -30
  249. package/lib-commonjs/components/Caption/Caption.js.map +0 -1
  250. package/lib-commonjs/components/Caption/index.d.ts +0 -1
  251. package/lib-commonjs/components/Caption/index.js +0 -10
  252. package/lib-commonjs/components/Caption/index.js.map +0 -1
  253. package/lib-commonjs/components/Display/Display.d.ts +0 -6
  254. package/lib-commonjs/components/Display/index.d.ts +0 -1
  255. package/lib-commonjs/components/Headline/Headline.d.ts +0 -6
  256. package/lib-commonjs/components/Headline/Headline.js +0 -30
  257. package/lib-commonjs/components/Headline/Headline.js.map +0 -1
  258. package/lib-commonjs/components/Headline/index.d.ts +0 -1
  259. package/lib-commonjs/components/Headline/index.js +0 -10
  260. package/lib-commonjs/components/Headline/index.js.map +0 -1
  261. package/lib-commonjs/components/LargeTitle/LargeTitle.d.ts +0 -6
  262. package/lib-commonjs/components/LargeTitle/index.d.ts +0 -1
  263. package/lib-commonjs/components/Subheadline/Subheadline.d.ts +0 -6
  264. package/lib-commonjs/components/Subheadline/Subheadline.js +0 -30
  265. package/lib-commonjs/components/Subheadline/Subheadline.js.map +0 -1
  266. package/lib-commonjs/components/Subheadline/index.d.ts +0 -1
  267. package/lib-commonjs/components/Subheadline/index.js +0 -10
  268. package/lib-commonjs/components/Subheadline/index.js.map +0 -1
  269. package/lib-commonjs/components/Text/Text.d.ts +0 -6
  270. package/lib-commonjs/components/Text/Text.types.d.ts +0 -77
  271. package/lib-commonjs/components/Text/index.d.ts +0 -5
  272. package/lib-commonjs/components/Text/renderText.d.ts +0 -5
  273. package/lib-commonjs/components/Text/useText.d.ts +0 -12
  274. package/lib-commonjs/components/Text/useTextStyles.d.ts +0 -5
  275. package/lib-commonjs/components/Title1/Title1.d.ts +0 -6
  276. package/lib-commonjs/components/Title1/index.d.ts +0 -1
  277. package/lib-commonjs/components/Title2/Title2.d.ts +0 -6
  278. package/lib-commonjs/components/Title2/index.d.ts +0 -1
  279. package/lib-commonjs/components/Title3/Title3.d.ts +0 -6
  280. package/lib-commonjs/components/Title3/index.d.ts +0 -1
  281. package/lib-commonjs/components/wrapper.d.ts +0 -7
  282. package/lib-commonjs/index.d.ts +0 -10
  283. package/lib-commonjs/typographyStyles/index.d.ts +0 -2
  284. package/lib-commonjs/typographyStyles/index.js +0 -11
  285. package/lib-commonjs/typographyStyles/index.js.map +0 -1
  286. package/lib-commonjs/typographyStyles/typographyStyles.d.ts +0 -14
  287. package/lib-commonjs/typographyStyles/typographyStyles.js +0 -109
  288. package/lib-commonjs/typographyStyles/typographyStyles.js.map +0 -1
package/MIGRATION.md CHANGED
@@ -44,7 +44,7 @@ _This property suffered no changes and can be left as is._
44
44
 
45
45
  The `nowrap` property was changed to `wrap` and it is `true` by default. You can achieve the same result as `nowrap` by using:
46
46
 
47
- ```
47
+ ```tsx
48
48
  <Text wrap={false}>Not wrapped</Text>
49
49
  ```
50
50
 
@@ -69,7 +69,7 @@ Variants are now represented with tokens that you can override on a theme level.
69
69
 
70
70
  You can use them with Text as such:
71
71
 
72
- ```
72
+ ```tsx
73
73
  <Text size={300}>Text</Text>
74
74
  ```
75
75
 
@@ -88,8 +88,10 @@ _This property suffered no changes and can be left as is._
88
88
 
89
89
  To achieve the same result with the new `truncate` property, you'll need to do the following:
90
90
 
91
- ```
92
- <Text block truncate wrap={false}>Not wrapped</Text>
91
+ ```tsx
92
+ <Text block truncate wrap={false}>
93
+ Not wrapped
94
+ </Text>
93
95
  ```
94
96
 
95
97
  This is due to `truncate` changing the CSS property `text-overflow` to `ellipsis`.
@@ -109,7 +111,7 @@ While the name remains the same, the values are now represented with integer tok
109
111
 
110
112
  You can use them with Text as such:
111
113
 
112
- ```
114
+ ```tsx
113
115
  <Text size={300}>Text</Text>
114
116
  ```
115
117
 
@@ -129,18 +131,20 @@ Northstar design tokens:
129
131
 
130
132
  - Color: `siteVariables.colors.brand[600]`
131
133
 
132
- ```
133
- const useStyles = makeStyles(theme => ({
134
+ ```tsx
135
+ import { makeStyles, Text } from '@fluentui/react-components';
136
+
137
+ const useStyles = makeStyles({
134
138
  root: {
135
- color: 'rgb(98, 100, 167)'
139
+ color: 'rgb(98, 100, 167)',
136
140
  },
137
- })
141
+ });
138
142
 
139
143
  const MyComponent = () => {
140
- const styles = useStyles()
144
+ const styles = useStyles();
141
145
 
142
- return <Text className={styles.root}>{...}</Text>
143
- }
146
+ return <Text className={styles.root}>{/* ... */}</Text>;
147
+ };
144
148
  ```
145
149
 
146
150
  ##### **teamsDarkTheme**
@@ -149,18 +153,20 @@ Northstar design tokens:
149
153
 
150
154
  - Color: `siteVariables.colors.brand[400]`
151
155
 
152
- ```
153
- const useStyles = makeStyles(theme => ({
156
+ ```tsx
157
+ import { makeStyles, Text } from '@fluentui/react-components';
158
+
159
+ const useStyles = makeStyles({
154
160
  root: {
155
- color: 'rgb(166, 167, 220)'
161
+ color: 'rgb(166, 167, 220)',
156
162
  },
157
- })
163
+ });
158
164
 
159
165
  const MyComponent = () => {
160
- const styles = useStyles()
166
+ const styles = useStyles();
161
167
 
162
- return <Text className={styles.root}>{...}</Text>
163
- }
168
+ return <Text className={styles.root}>{/* ... */}</Text>;
169
+ };
164
170
  ```
165
171
 
166
172
  ##### **teamsHighContrastTheme**
@@ -169,18 +175,20 @@ Northstar design tokens:
169
175
 
170
176
  - Color: `siteVariables.accessibleYellow`
171
177
 
172
- ```
173
- const useStyles = makeStyles(theme => ({
178
+ ```tsx
179
+ import { makeStyles, Text } from '@fluentui/react-components';
180
+
181
+ const useStyles = makeStyles({
174
182
  root: {
175
- color: 'rgb(255, 255, 1)'
183
+ color: 'rgb(255, 255, 1)',
176
184
  },
177
- })
185
+ });
178
186
 
179
187
  const MyComponent = () => {
180
- const styles = useStyles()
188
+ const styles = useStyles();
181
189
 
182
- return <Text className={styles.root}>{...}</Text>
183
- }
190
+ return <Text className={styles.root}>{/* ... */}</Text>;
191
+ };
184
192
  ```
185
193
 
186
194
  #### Using `atMention="me"`
@@ -192,19 +200,21 @@ Northstar design tokens:
192
200
  - Color: `siteVariables.colors.orange[400]`
193
201
  - Font weight: `siteVariables.fontWeightBold`
194
202
 
195
- ```
196
- const useStyles = makeStyles(theme => ({
203
+ ```tsx
204
+ import { makeStyles, Text } from '@fluentui/react-components';
205
+
206
+ const useStyles = makeStyles({
197
207
  root: {
198
- color: 'rgb(204, 74, 49)',
199
- fontWeight: 700
208
+ color: 'rgb(204, 74, 49)',
209
+ fontWeight: 700,
200
210
  },
201
- })
211
+ });
202
212
 
203
213
  const MyComponent = () => {
204
- const styles = useStyles()
214
+ const styles = useStyles();
205
215
 
206
- return <Text className={styles.root}>{...}</Text>
207
- }
216
+ return <Text className={styles.root}>{/* ... */}</Text>;
217
+ };
208
218
  ```
209
219
 
210
220
  ##### **teamsDarkTheme**
@@ -214,19 +224,21 @@ Northstar design tokens:
214
224
  - Color: `siteVariables.colors.orange[300]`
215
225
  - Font weight: `siteVariables.fontWeightBold`
216
226
 
217
- ```
218
- const useStyles = makeStyles(theme => ({
227
+ ```tsx
228
+ import { makeStyles, Text } from '@fluentui/react-components';
229
+
230
+ const useStyles = makeStyles({
219
231
  root: {
220
- color: 'rgb(233, 117, 72)',
221
- fontWeight: 700
232
+ color: 'rgb(233, 117, 72)',
233
+ fontWeight: 700,
222
234
  },
223
- })
235
+ });
224
236
 
225
237
  const MyComponent = () => {
226
- const styles = useStyles()
238
+ const styles = useStyles();
227
239
 
228
- return <Text className={styles.root}>{...}</Text>
229
- }
240
+ return <Text className={styles.root}>{/* ... */}</Text>;
241
+ };
230
242
  ```
231
243
 
232
244
  ##### **teamsHighContrastTheme**
@@ -236,37 +248,41 @@ Northstar design tokens:
236
248
  - Color: `siteVariables.accessibleYellow`
237
249
  - Font weight: `siteVariables.fontWeightBold`
238
250
 
239
- ```
240
- const useStyles = makeStyles(theme => ({
251
+ ```tsx
252
+ import { makeStyles, Text } from '@fluentui/react-components';
253
+
254
+ const useStyles = makeStyles({
241
255
  root: {
242
- color: 'rgb(255, 255, 1)',
243
- fontWeight: 700
256
+ color: 'rgb(255, 255, 1)',
257
+ fontWeight: 700,
244
258
  },
245
- })
259
+ });
246
260
 
247
261
  const MyComponent = () => {
248
- const styles = useStyles()
262
+ const styles = useStyles();
249
263
 
250
- return <Text className={styles.root}>{...}</Text>
251
- }
264
+ return <Text className={styles.root}>{/* ... */}</Text>;
265
+ };
252
266
  ```
253
267
 
254
268
  ### color
255
269
 
256
270
  This property was deprecated. Below is a simple example on how to achieve the same result:
257
271
 
258
- ```
259
- const useStyles = makeStyles(theme => ({
272
+ ```tsx
273
+ import { makeStyles, Text } from '@fluentui/react-components';
274
+
275
+ const useStyles = makeStyles({
260
276
  root: {
261
- color: //Your color here
277
+ color: '__ put your color there __',
262
278
  },
263
- })
279
+ });
264
280
 
265
281
  const MyComponent = () => {
266
- const styles = useStyles()
282
+ const styles = useStyles();
267
283
 
268
- return <Text className={styles.root}>{...}</Text>
269
- }
284
+ return <Text className={styles.root}>{/* ... */}</Text>;
285
+ };
270
286
  ```
271
287
 
272
288
  _Read more about the CSS prop: [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color)_
@@ -276,13 +292,13 @@ _Read more about the CSS prop: [color](https://developer.mozilla.org/en-US/docs/
276
292
  The `content` prop works the same way as the native `children` prop in React.
277
293
  You can either use:
278
294
 
279
- ```
295
+ ```tsx
280
296
  <Text children="Hello World!" />
281
297
  ```
282
298
 
283
299
  Or the common and recomended way:
284
300
 
285
- ```
301
+ ```tsx
286
302
  <Text>Hello World!</Text>
287
303
  ```
288
304
 
@@ -297,6 +313,8 @@ Northstar design tokens:
297
313
  - Color: `siteVariables.colors.grey[250]`
298
314
 
299
315
  ```
316
+ import { makeStyles, Text } from '@fluentui/react-components';
317
+
300
318
  const useStyles = makeStyles(theme => ({
301
319
  root: {
302
320
  color: 'rgb(200, 198, 196)'
@@ -317,6 +335,8 @@ Northstar design tokens:
317
335
  - Color: `siteVariables.colors.grey[450]`
318
336
 
319
337
  ```
338
+ import { makeStyles, Text } from '@fluentui/react-components';
339
+
320
340
  const useStyles = makeStyles(theme => ({
321
341
  root: {
322
342
  color: 'rgb(96, 94, 92)'
@@ -337,6 +357,8 @@ Northstar design tokens:
337
357
  - Color: `siteVariables.accessibleGreen`
338
358
 
339
359
  ```
360
+ import { makeStyles, Text } from '@fluentui/react-components';
361
+
340
362
  const useStyles = makeStyles(theme => ({
341
363
  root: {
342
364
  color: 'rgb(63, 242, 63)'
@@ -361,6 +383,8 @@ Northstar design tokens:
361
383
  - Color: `siteVariables.colorScheme.red.foreground`
362
384
 
363
385
  ```
386
+ import { makeStyles, Text } from '@fluentui/react-components';
387
+
364
388
  const useStyles = makeStyles(theme => ({
365
389
  root: {
366
390
  color: 'rgb(196, 49, 75)'
@@ -381,6 +405,8 @@ Northstar design tokens:
381
405
  - Color: `siteVariables.colors.red[300]`
382
406
 
383
407
  ```
408
+ import { makeStyles, Text } from '@fluentui/react-components';
409
+
384
410
  const useStyles = makeStyles(theme => ({
385
411
  root: {
386
412
  color: 'rgb(231, 53, 80)'
@@ -401,6 +427,8 @@ Northstar design tokens:
401
427
  - Color: `siteVariables.red`
402
428
 
403
429
  ```
430
+ import { makeStyles, Text } from '@fluentui/react-components';
431
+
404
432
  const useStyles = makeStyles(theme => ({
405
433
  root: {
406
434
  color: 'rgb(255, 0, 0)'
@@ -426,6 +454,8 @@ Northstar design tokens:
426
454
  - Font weight: `siteVariables.fontWeightBold`
427
455
 
428
456
  ```
457
+ import { makeStyles, Text } from '@fluentui/react-components';
458
+
429
459
  const useStyles = makeStyles(theme => ({
430
460
  root: {
431
461
  color: 'rgb(196, 49, 75)',
@@ -448,6 +478,8 @@ Northstar design tokens:
448
478
  - Font weight: `siteVariables.fontWeightBold`
449
479
 
450
480
  ```
481
+ import { makeStyles, Text } from '@fluentui/react-components';
482
+
451
483
  const useStyles = makeStyles(theme => ({
452
484
  root: {
453
485
  color: 'rgb(231, 53, 80)',
@@ -470,6 +502,8 @@ Northstar design tokens:
470
502
  - Font weight: `siteVariables.fontWeightBold`
471
503
 
472
504
  ```
505
+ import { makeStyles, Text } from '@fluentui/react-components';
506
+
473
507
  const useStyles = makeStyles(theme => ({
474
508
  root: {
475
509
  color: 'rgb(255, 0, 0)',
@@ -495,6 +529,8 @@ Northstar design tokens:
495
529
  - Color: `siteVariables.colors.green[600]`
496
530
 
497
531
  ```
532
+ import { makeStyles, Text } from '@fluentui/react-components';
533
+
498
534
  const useStyles = makeStyles(theme => ({
499
535
  root: {
500
536
  color: 'rgb(35, 123, 75)'
@@ -515,6 +551,8 @@ Northstar design tokens:
515
551
  - Color: `siteVariables.colors.green[200]`
516
552
 
517
553
  ```
554
+ import { makeStyles, Text } from '@fluentui/react-components';
555
+
518
556
  const useStyles = makeStyles(theme => ({
519
557
  root: {
520
558
  color: 'rgb(146, 195, 83)'
@@ -534,36 +572,40 @@ Northstar design tokens:
534
572
 
535
573
  - Color: `siteVariables.colors.green[200]`
536
574
 
537
- ```
538
- const useStyles = makeStyles(theme => ({
575
+ ```tsx
576
+ import { makeStyles, Text } from '@fluentui/react-components';
577
+
578
+ const useStyles = makeStyles({
539
579
  root: {
540
- color: 'rgb(146, 195, 83)'
580
+ color: 'rgb(146, 195, 83)',
541
581
  },
542
- })
582
+ });
543
583
 
544
584
  const MyComponent = () => {
545
- const styles = useStyles()
585
+ const styles = useStyles();
546
586
 
547
- return <Text className={styles.root}>{...}</Text>
548
- }
587
+ return <Text className={styles.root}>{/* ... */}</Text>;
588
+ };
549
589
  ```
550
590
 
551
591
  ### temporary [DEPRECATED]
552
592
 
553
593
  This property was deprecated. Given that this property depends on the applied style, you can find below examples on how to achieve the same results in the default, dark and high contrast themes:
554
594
 
555
- ```
556
- const useStyles = makeStyles(theme => ({
595
+ ```tsx
596
+ import { makeStyles, Text } from '@fluentui/react-components';
597
+
598
+ const useStyles = makeStyles({
557
599
  root: {
558
- fontStyle: 'italic'
600
+ fontStyle: 'italic',
559
601
  },
560
- })
602
+ });
561
603
 
562
604
  const MyComponent = () => {
563
- const styles = useStyles()
605
+ const styles = useStyles();
564
606
 
565
- return <Text className={styles.root}>{...}</Text>
566
- }
607
+ return <Text className={styles.root}>{/* ... */}</Text>;
608
+ };
567
609
  ```
568
610
 
569
611
  ### timestamp [DEPRECATED]
@@ -576,18 +618,20 @@ Northstar design tokens:
576
618
 
577
619
  - Color: `siteVariables.colorScheme.default.foreground1`
578
620
 
579
- ```
580
- const useStyles = makeStyles(theme => ({
621
+ ```tsx
622
+ import { makeStyles, Text } from '@fluentui/react-components';
623
+
624
+ const useStyles = makeStyles({
581
625
  root: {
582
- color: 'rgb(72, 70, 68)'
626
+ color: 'rgb(72, 70, 68)',
583
627
  },
584
- })
628
+ });
585
629
 
586
630
  const MyComponent = () => {
587
- const styles = useStyles()
631
+ const styles = useStyles();
588
632
 
589
- return <Text className={styles.root}>{...}</Text>
590
- }
633
+ return <Text className={styles.root}>{/* ... */}</Text>;
634
+ };
591
635
  ```
592
636
 
593
637
  #### **teamsDarkTheme**
@@ -596,18 +640,20 @@ Northstar design tokens:
596
640
 
597
641
  - Color: `siteVariables.colorScheme.default.foreground1`
598
642
 
599
- ```
600
- const useStyles = makeStyles(theme => ({
643
+ ```tsx
644
+ import { makeStyles, Text } from '@fluentui/react-components';
645
+
646
+ const useStyles = makeStyles({
601
647
  root: {
602
- color: 'rgb(138, 136, 134)'
648
+ color: 'rgb(138, 136, 134)',
603
649
  },
604
- })
650
+ });
605
651
 
606
652
  const MyComponent = () => {
607
- const styles = useStyles()
653
+ const styles = useStyles();
608
654
 
609
- return <Text className={styles.root}>{...}</Text>
610
- }
655
+ return <Text className={styles.root}>{/* ... */}</Text>;
656
+ };
611
657
  ```
612
658
 
613
659
  #### **teamsHighContrastTheme**
@@ -616,23 +662,25 @@ Northstar design tokens:
616
662
 
617
663
  - Color: `siteVariables.colors.white`
618
664
 
619
- ```
620
- const useStyles = makeStyles(theme => ({
665
+ ```tsx
666
+ import { makeStyles, Text } from '@fluentui/react-components';
667
+
668
+ const useStyles = makeStyles({
621
669
  root: {
622
- color: 'rgb(255, 255, 255)'
670
+ color: 'rgb(255, 255, 255)',
623
671
  },
624
- })
672
+ });
625
673
 
626
674
  const MyComponent = () => {
627
- const styles = useStyles()
675
+ const styles = useStyles();
628
676
 
629
- return <Text className={styles.root}>{...}</Text>
630
- }
677
+ return <Text className={styles.root}>{/* ... */}</Text>;
678
+ };
631
679
  ```
632
680
 
633
681
  ### variables [DEPRECATED]
634
682
 
635
- For v9, this feature is no longer supported. The alternative is to apply styles through `make-styles`. Below is an example of a migration:
683
+ For v9, this feature is no longer supported. The alternative is to apply styles through `makeStyles()` (see [Griffel](https://github.com/microsoft/griffel) docs for more details). Below is an example of a migration:
636
684
 
637
685
  #### v0 (Northstar) implementation
638
686
 
@@ -644,18 +692,20 @@ const MyComponent = () => {
644
692
 
645
693
  #### v9 (Fluent UI) implementation
646
694
 
647
- ```
648
- const useStyles = makeStyles(theme => ({
695
+ ```tsx
696
+ import { makeStyles, Text } from '@fluentui/react-components';
697
+
698
+ const useStyles = makeStyles({
649
699
  red: {
650
- color: 'red'
700
+ color: 'red',
651
701
  },
652
- })
702
+ });
653
703
 
654
704
  const MyComponent = () => {
655
- const styles = useStyles()
705
+ const styles = useStyles();
656
706
 
657
- return <Text className={styles.root}>{...}</Text>
658
- }
707
+ return <Text className={styles.root}>{/* ... */}</Text>;
708
+ };
659
709
  ```
660
710
 
661
711
  ### weight
@@ -677,4 +727,4 @@ _This property suffered no changes and can be left as is._
677
727
 
678
728
  ### styles
679
729
 
680
- _This property suffered no changes and can be used as is. However, we highly recommend that you migrate to a `make-styles` styling solution for performance reasons._
730
+ _This property suffered no changes and can be used as is. However, we highly recommend that you migrate to `makeStyles()` (a [Griffel](https://github.com/microsoft/griffel) styling solution) for performance reasons._
package/README.md CHANGED
@@ -74,8 +74,8 @@ By default, Text and all the typography wrappers render a `<span>` element. You
74
74
 
75
75
  ```html
76
76
  <div>
77
- <Headline as="h1">Headline</Headline>
78
- <Subheadline as="h2">Subheadline</Subheadline>
77
+ <Subtitle1 as="h1">Subtitle1</Subtitle1>
78
+ <Subtitle2 as="h2">Subtitle2</Subtitle2>
79
79
  <Text as="p">This is simple example</Text>
80
80
  </div>
81
81
  ```
@@ -84,8 +84,8 @@ This will result in the following DOM structure:
84
84
 
85
85
  ```html
86
86
  <div>
87
- <h1>Headline</h1>
88
- <h2>Subheadline</h2>
87
+ <h1>Subtitle1</h1>
88
+ <h2>Subtitle2</h2>
89
89
  <p>This is simple example</p>
90
90
  </div>
91
91
  ```