@fluentui/react-text 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.1

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 (124) hide show
  1. package/CHANGELOG.json +227 -16
  2. package/CHANGELOG.md +59 -10
  3. package/MIGRATION.md +153 -103
  4. package/dist/react-text.d.ts +28 -8
  5. package/lib/components/Body/Body.d.ts +1 -0
  6. package/lib/components/Body/Body.js +6 -4
  7. package/lib/components/Body/Body.js.map +1 -1
  8. package/lib/components/Caption/Caption.d.ts +1 -0
  9. package/lib/components/Caption/Caption.js +6 -4
  10. package/lib/components/Caption/Caption.js.map +1 -1
  11. package/lib/components/Display/Display.d.ts +1 -0
  12. package/lib/components/Display/Display.js +6 -4
  13. package/lib/components/Display/Display.js.map +1 -1
  14. package/lib/components/Headline/Headline.d.ts +1 -0
  15. package/lib/components/Headline/Headline.js +6 -4
  16. package/lib/components/Headline/Headline.js.map +1 -1
  17. package/lib/components/LargeTitle/LargeTitle.d.ts +1 -0
  18. package/lib/components/LargeTitle/LargeTitle.js +6 -4
  19. package/lib/components/LargeTitle/LargeTitle.js.map +1 -1
  20. package/lib/components/Subheadline/Subheadline.d.ts +1 -0
  21. package/lib/components/Subheadline/Subheadline.js +6 -4
  22. package/lib/components/Subheadline/Subheadline.js.map +1 -1
  23. package/lib/components/Text/Text.js +7 -7
  24. package/lib/components/Text/Text.js.map +1 -1
  25. package/lib/components/Text/Text.types.d.ts +4 -3
  26. package/lib/components/Text/renderText.d.ts +1 -1
  27. package/lib/components/Text/renderText.js +7 -7
  28. package/lib/components/Text/renderText.js.map +1 -1
  29. package/lib/components/Text/useText.d.ts +3 -3
  30. package/lib/components/Text/useText.js +22 -21
  31. package/lib/components/Text/useText.js.map +1 -1
  32. package/lib/components/Text/useTextStyles.d.ts +2 -1
  33. package/lib/components/Text/useTextStyles.js +15 -11
  34. package/lib/components/Text/useTextStyles.js.map +1 -1
  35. package/lib/components/Title1/Title1.d.ts +1 -0
  36. package/lib/components/Title1/Title1.js +6 -4
  37. package/lib/components/Title1/Title1.js.map +1 -1
  38. package/lib/components/Title2/Title2.d.ts +1 -0
  39. package/lib/components/Title2/Title2.js +6 -4
  40. package/lib/components/Title2/Title2.js.map +1 -1
  41. package/lib/components/Title3/Title3.d.ts +1 -0
  42. package/lib/components/Title3/Title3.js +6 -4
  43. package/lib/components/Title3/Title3.js.map +1 -1
  44. package/lib/components/wrapper.d.ts +1 -0
  45. package/lib/components/wrapper.js +13 -10
  46. package/lib/components/wrapper.js.map +1 -1
  47. package/lib/typographyStyles/typographyStyles.d.ts +10 -11
  48. package/lib/typographyStyles/typographyStyles.js +55 -71
  49. package/lib/typographyStyles/typographyStyles.js.map +1 -1
  50. package/lib-commonjs/Body.js +1 -1
  51. package/lib-commonjs/Caption.js +1 -1
  52. package/lib-commonjs/Display.js +1 -1
  53. package/lib-commonjs/Headline.js +1 -1
  54. package/lib-commonjs/LargeTitle.js +1 -1
  55. package/lib-commonjs/Subheadline.js +1 -1
  56. package/lib-commonjs/Text.js +1 -1
  57. package/lib-commonjs/Title1.js +1 -1
  58. package/lib-commonjs/Title2.js +1 -1
  59. package/lib-commonjs/Title3.js +1 -1
  60. package/lib-commonjs/components/Body/Body.d.ts +1 -0
  61. package/lib-commonjs/components/Body/Body.js +9 -9
  62. package/lib-commonjs/components/Body/Body.js.map +1 -1
  63. package/lib-commonjs/components/Body/index.js +1 -1
  64. package/lib-commonjs/components/Caption/Caption.d.ts +1 -0
  65. package/lib-commonjs/components/Caption/Caption.js +9 -9
  66. package/lib-commonjs/components/Caption/Caption.js.map +1 -1
  67. package/lib-commonjs/components/Caption/index.js +1 -1
  68. package/lib-commonjs/components/Display/Display.d.ts +1 -0
  69. package/lib-commonjs/components/Display/Display.js +9 -9
  70. package/lib-commonjs/components/Display/Display.js.map +1 -1
  71. package/lib-commonjs/components/Display/index.js +1 -1
  72. package/lib-commonjs/components/Headline/Headline.d.ts +1 -0
  73. package/lib-commonjs/components/Headline/Headline.js +9 -9
  74. package/lib-commonjs/components/Headline/Headline.js.map +1 -1
  75. package/lib-commonjs/components/Headline/index.js +1 -1
  76. package/lib-commonjs/components/LargeTitle/LargeTitle.d.ts +1 -0
  77. package/lib-commonjs/components/LargeTitle/LargeTitle.js +9 -9
  78. package/lib-commonjs/components/LargeTitle/LargeTitle.js.map +1 -1
  79. package/lib-commonjs/components/LargeTitle/index.js +1 -1
  80. package/lib-commonjs/components/Subheadline/Subheadline.d.ts +1 -0
  81. package/lib-commonjs/components/Subheadline/Subheadline.js +9 -9
  82. package/lib-commonjs/components/Subheadline/Subheadline.js.map +1 -1
  83. package/lib-commonjs/components/Subheadline/index.js +1 -1
  84. package/lib-commonjs/components/Text/Text.js +8 -8
  85. package/lib-commonjs/components/Text/Text.js.map +1 -1
  86. package/lib-commonjs/components/Text/Text.types.d.ts +4 -3
  87. package/lib-commonjs/components/Text/index.js +1 -1
  88. package/lib-commonjs/components/Text/renderText.d.ts +1 -1
  89. package/lib-commonjs/components/Text/renderText.js +11 -12
  90. package/lib-commonjs/components/Text/renderText.js.map +1 -1
  91. package/lib-commonjs/components/Text/useText.d.ts +3 -3
  92. package/lib-commonjs/components/Text/useText.js +25 -25
  93. package/lib-commonjs/components/Text/useText.js.map +1 -1
  94. package/lib-commonjs/components/Text/useTextStyles.d.ts +2 -1
  95. package/lib-commonjs/components/Text/useTextStyles.js +19 -14
  96. package/lib-commonjs/components/Text/useTextStyles.js.map +1 -1
  97. package/lib-commonjs/components/Title1/Title1.d.ts +1 -0
  98. package/lib-commonjs/components/Title1/Title1.js +9 -9
  99. package/lib-commonjs/components/Title1/Title1.js.map +1 -1
  100. package/lib-commonjs/components/Title1/index.js +1 -1
  101. package/lib-commonjs/components/Title2/Title2.d.ts +1 -0
  102. package/lib-commonjs/components/Title2/Title2.js +9 -9
  103. package/lib-commonjs/components/Title2/Title2.js.map +1 -1
  104. package/lib-commonjs/components/Title2/index.js +1 -1
  105. package/lib-commonjs/components/Title3/Title3.d.ts +1 -0
  106. package/lib-commonjs/components/Title3/Title3.js +9 -9
  107. package/lib-commonjs/components/Title3/Title3.js.map +1 -1
  108. package/lib-commonjs/components/Title3/index.js +1 -1
  109. package/lib-commonjs/components/wrapper.d.ts +1 -0
  110. package/lib-commonjs/components/wrapper.js +14 -11
  111. package/lib-commonjs/components/wrapper.js.map +1 -1
  112. package/lib-commonjs/index.js +1 -1
  113. package/lib-commonjs/typographyStyles/index.js +1 -1
  114. package/lib-commonjs/typographyStyles/index.js.map +1 -1
  115. package/lib-commonjs/typographyStyles/typographyStyles.d.ts +10 -11
  116. package/lib-commonjs/typographyStyles/typographyStyles.js +48 -89
  117. package/lib-commonjs/typographyStyles/typographyStyles.js.map +1 -1
  118. package/package.json +8 -10
  119. package/lib/common/isConformant.d.ts +0 -4
  120. package/lib/common/isConformant.js +0 -16
  121. package/lib/common/isConformant.js.map +0 -1
  122. package/lib-commonjs/common/isConformant.d.ts +0 -4
  123. package/lib-commonjs/common/isConformant.js +0 -27
  124. package/lib-commonjs/common/isConformant.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._
@@ -2,8 +2,8 @@ import type { ComponentProps } from '@fluentui/react-utilities';
2
2
  import type { ComponentState } from '@fluentui/react-utilities';
3
3
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
4
  import type { FunctionComponent } from 'react';
5
- import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
6
5
  import * as React_2 from 'react';
6
+ import type { Slot } from '@fluentui/react-utilities';
7
7
 
8
8
  /**
9
9
  * Text wrapper component for the Body typography variant
@@ -11,43 +11,57 @@ import * as React_2 from 'react';
11
11
  declare const Body_2: FunctionComponent<TextWrapperProps>;
12
12
  export { Body_2 as Body }
13
13
 
14
+ export declare const bodyClassName = "fui-Body";
15
+
14
16
  /**
15
17
  * Text wrapper component for the Caption typography variant
16
18
  */
17
19
  export declare const Caption: FunctionComponent<TextWrapperProps>;
18
20
 
21
+ export declare const captionClassName = "fui-Caption";
22
+
19
23
  /**
20
24
  * Text wrapper component for the Display typography variant
21
25
  */
22
26
  export declare const Display: FunctionComponent<TextWrapperProps>;
23
27
 
28
+ export declare const displayClassName = "fui-Display";
29
+
24
30
  /**
25
31
  * Text wrapper component for the Headline typography variant
26
32
  */
27
33
  export declare const Headline: FunctionComponent<TextWrapperProps>;
28
34
 
35
+ export declare const headlineClassName = "fui-Headline";
36
+
29
37
  /**
30
38
  * Text wrapper component for the Large Title typography variant
31
39
  */
32
40
  export declare const LargeTitle: FunctionComponent<TextWrapperProps>;
33
41
 
42
+ export declare const largeTitleClassName = "fui-LargeTitle";
43
+
34
44
  /**
35
45
  * Render the final JSX of Text
36
46
  */
37
- export declare const renderText: (state: TextState) => JSX.Element;
47
+ export declare const renderText_unstable: (state: TextState) => JSX.Element;
38
48
 
39
49
  /**
40
50
  * Text wrapper component for the Subheadline typography variant
41
51
  */
42
52
  export declare const Subheadline: FunctionComponent<TextWrapperProps>;
43
53
 
54
+ export declare const subheadlineClassName = "fui-Subheadline";
55
+
44
56
  /**
45
57
  * Typography and styling abstraction component used to ensure consistency of text.
46
58
  */
47
59
  declare const Text_2: ForwardRefComponent<TextProps>;
48
60
  export { Text_2 as Text }
49
61
 
50
- export declare type TextCommons = {
62
+ export declare const textClassName = "fui-Text";
63
+
64
+ declare type TextCommons = {
51
65
  /**
52
66
  * Wraps the text content on white spaces.
53
67
  *
@@ -119,7 +133,7 @@ export declare type TextProps = ComponentProps<TextSlots> & Partial<TextCommons>
119
133
  * Text slots
120
134
  */
121
135
  export declare type TextSlots = {
122
- root: IntrinsicShorthandProps<'span', 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'pre'>;
136
+ root: Slot<'span', 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'pre'>;
123
137
  };
124
138
 
125
139
  /**
@@ -134,30 +148,36 @@ declare type TextWrapperProps = Omit<TextProps, 'font' | 'size'>;
134
148
  */
135
149
  export declare const Title1: FunctionComponent<TextWrapperProps>;
136
150
 
151
+ export declare const title1ClassName = "fui-Title1";
152
+
137
153
  /**
138
154
  * Text wrapper component for the Title 2 typography variant
139
155
  */
140
156
  export declare const Title2: FunctionComponent<TextWrapperProps>;
141
157
 
158
+ export declare const title2ClassName = "fui-Title2";
159
+
142
160
  /**
143
161
  * Text wrapper component for the Title 3 typography variant
144
162
  */
145
163
  export declare const Title3: FunctionComponent<TextWrapperProps>;
146
164
 
165
+ export declare const title3ClassName = "fui-Title3";
166
+
147
167
  /**
148
168
  * Create the state required to render Text.
149
169
  *
150
- * The returned state can be modified with hooks such as useTextStyles,
151
- * before being passed to renderText.
170
+ * The returned state can be modified with hooks such as useTextStyles_unstable,
171
+ * before being passed to renderText_unstable.
152
172
  *
153
173
  * @param props - props from this instance of Text
154
174
  * @param ref - reference to root HTMLElement of Text
155
175
  */
156
- export declare const useText: (props: TextProps, ref: React_2.Ref<HTMLElement>) => TextState;
176
+ export declare const useText_unstable: (props: TextProps, ref: React_2.Ref<HTMLElement>) => TextState;
157
177
 
158
178
  /**
159
179
  * Apply styling to the Text slots based on the state
160
180
  */
161
- export declare const useTextStyles: (state: TextState) => TextState;
181
+ export declare const useTextStyles_unstable: (state: TextState) => TextState;
162
182
 
163
183
  export { }
@@ -1,5 +1,6 @@
1
1
  import type { FunctionComponent } from 'react';
2
2
  import { TextWrapperProps } from '../wrapper';
3
+ export declare const bodyClassName = "fui-Body";
3
4
  /**
4
5
  * Text wrapper component for the Body typography variant
5
6
  */
@@ -1,11 +1,12 @@
1
- import { __styles } from '@fluentui/react-make-styles';
1
+ import { __styles } from '@griffel/react';
2
2
  import { typographyStyles } from '../../typographyStyles/index';
3
3
  import { createWrapper } from '../wrapper';
4
+ export const bodyClassName = 'fui-Body';
4
5
  /**
5
6
  * Styles for the root slot
6
7
  */
7
8
 
8
- var useStyles = /*#__PURE__*/__styles({
9
+ const useStyles = /*#__PURE__*/__styles({
9
10
  "root": {
10
11
  "Bahqtrf": "fk6fouc",
11
12
  "Be2twd7": "fkhj508",
@@ -20,8 +21,9 @@ var useStyles = /*#__PURE__*/__styles({
20
21
  */
21
22
 
22
23
 
23
- export var Body = /*#__PURE__*/createWrapper({
24
- useStyles: useStyles,
24
+ export const Body = /*#__PURE__*/createWrapper({
25
+ useStyles,
26
+ className: bodyClassName,
25
27
  displayName: 'Body'
26
28
  });
27
29
  //# sourceMappingURL=Body.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Body/Body.tsx"],"names":[],"mappings":"AACA,yBAA2B,6BAA3B;AACA,SAAS,gBAAT,QAAiC,8BAAjC;AACA,SAAS,aAAT,QAAgD,YAAhD;AAEA;;AAEG;;AACH,IAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAIA;;AAEG;;;AACH,OAAO,IAAM,IAAI,gBAAwC,aAAa,CAAC;AAAE,EAAA,SAAS,EAAA,SAAX;AAAa,EAAA,WAAW,EAAE;AAA1B,CAAD,CAA/D","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/Body/Body.tsx"],"names":[],"mappings":"AACA,yBAA2B,gBAA3B;AACA,SAAS,gBAAT,QAAiC,8BAAjC;AACA,SAAS,aAAT,QAAgD,YAAhD;AAEA,OAAO,MAAM,aAAa,GAAG,UAAtB;AAEP;;AAEG;;AACH,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAIA;;AAEG;;;AACH,OAAO,MAAM,IAAI,gBAAwC,aAAa,CAAC;AACrE,EAAA,SADqE;AAErE,EAAA,SAAS,EAAE,aAF0D;AAGrE,EAAA,WAAW,EAAE;AAHwD,CAAD,CAA/D","sourceRoot":""}