@fluentui-react-native/win32-theme 0.39.6 → 0.39.11

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 (44) hide show
  1. package/.cache/tsconfig.tsbuildinfo +1 -1
  2. package/CHANGELOG.md +66 -0
  3. package/lib/NativeModule/getThemingModule.native.d.ts.map +1 -1
  4. package/lib/NativeModule/getThemingModule.native.js +7 -2
  5. package/lib/NativeModule/getThemingModule.native.js.map +1 -1
  6. package/lib/NativeModule/hostThemeSetting.d.ts +8 -1
  7. package/lib/NativeModule/hostThemeSetting.d.ts.map +1 -1
  8. package/lib/NativeModule/hostThemeSetting.js +7 -14
  9. package/lib/NativeModule/hostThemeSetting.js.map +1 -1
  10. package/lib/NativeModule/index.d.ts +1 -1
  11. package/lib/NativeModule/index.d.ts.map +1 -1
  12. package/lib/NativeModule/officeThemingModule.d.ts +13 -8
  13. package/lib/NativeModule/officeThemingModule.d.ts.map +1 -1
  14. package/lib/__tests__/win32-theme.test.js +3 -0
  15. package/lib/__tests__/win32-theme.test.js.map +1 -1
  16. package/lib/createBrandedThemeWithAlias.js +1 -1
  17. package/lib/createBrandedThemeWithAlias.js.map +1 -1
  18. package/lib/createFontAliasTokens.js +1 -1
  19. package/lib/createFontAliasTokens.js.map +1 -1
  20. package/lib/createOfficeAliasTokens.js +1 -1
  21. package/lib/createOfficeAliasTokens.js.map +1 -1
  22. package/lib/createOfficeTheme.d.ts.map +1 -1
  23. package/lib/createOfficeTheme.js +108 -40
  24. package/lib/createOfficeTheme.js.map +1 -1
  25. package/lib/getOfficeTokens.d.ts +404 -1
  26. package/lib/getOfficeTokens.d.ts.map +1 -1
  27. package/lib/getOfficeTokens.js +1 -1
  28. package/lib/getOfficeTokens.js.map +1 -1
  29. package/package.json +4 -6
  30. package/src/NativeModule/getThemingModule.native.ts +8 -2
  31. package/src/NativeModule/hostThemeSetting.ts +15 -5
  32. package/src/NativeModule/index.ts +1 -0
  33. package/src/NativeModule/officeThemingModule.ts +17 -9
  34. package/src/__tests__/win32-theme.test.ts +4 -0
  35. package/src/createBrandedThemeWithAlias.ts +1 -1
  36. package/src/createFontAliasTokens.ts +1 -1
  37. package/src/createOfficeAliasTokens.ts +1 -1
  38. package/src/createOfficeTheme.ts +136 -51
  39. package/src/getOfficeTokens.ts +1 -2
  40. package/lib/highContrast/tokens-alias.d.ts +0 -2
  41. package/lib/highContrast/tokens-alias.d.ts.map +0 -1
  42. package/lib/highContrast/tokens-alias.js +0 -17
  43. package/lib/highContrast/tokens-alias.js.map +0 -1
  44. package/src/highContrast/tokens-alias.ts +0 -20
@@ -1,4 +1,407 @@
1
- export declare function getOfficeAliasTokens(officeTheme: string): any;
1
+ export declare function getOfficeAliasTokens(officeTheme: string): {
2
+ body1: {
3
+ fontFamily: string;
4
+ fontLineHeight: number;
5
+ fontSize: number;
6
+ fontWeight: string;
7
+ };
8
+ body1Strong: {
9
+ fontFamily: string;
10
+ fontLineHeight: number;
11
+ fontSize: number;
12
+ fontWeight: string;
13
+ };
14
+ body2: {
15
+ fontFamily: string;
16
+ fontLineHeight: number;
17
+ fontSize: number;
18
+ fontWeight: string;
19
+ };
20
+ body2Strong: {
21
+ fontFamily: string;
22
+ fontLineHeight: number;
23
+ fontSize: number;
24
+ fontWeight: string;
25
+ };
26
+ brandBackground: {
27
+ rest: string;
28
+ hover: string;
29
+ pressed: string;
30
+ selected: string;
31
+ };
32
+ brandBackground2: {
33
+ rest: string;
34
+ };
35
+ brandBackgroundStatic: {
36
+ rest: string;
37
+ };
38
+ brandForeground1: {
39
+ rest: string;
40
+ };
41
+ brandForeground2: {
42
+ rest: string;
43
+ };
44
+ brandForegroundLink: {
45
+ rest: string;
46
+ hover: string;
47
+ pressed: string;
48
+ selected: string;
49
+ };
50
+ brandStroke1: {
51
+ rest: string;
52
+ };
53
+ brandStroke2: {
54
+ rest: string;
55
+ };
56
+ caption1: {
57
+ fontFamily: string;
58
+ fontLineHeight: number;
59
+ fontSize: number;
60
+ fontWeight: string;
61
+ };
62
+ compoundBrandBackground1: {
63
+ rest: string;
64
+ hover: string;
65
+ pressed: string;
66
+ };
67
+ compoundBrandForeground1: {
68
+ rest: string;
69
+ hover: string;
70
+ pressed: string;
71
+ };
72
+ compoundBrandStroke1: {
73
+ rest: string;
74
+ hover: string;
75
+ pressed: string;
76
+ };
77
+ dangerBackground1: {
78
+ rest: string;
79
+ };
80
+ dangerBackground2: {
81
+ rest: string;
82
+ };
83
+ dangerBackground3: {
84
+ rest: string;
85
+ };
86
+ dangerBorder1: {
87
+ rest: string;
88
+ };
89
+ dangerBorder2: {
90
+ rest: string;
91
+ };
92
+ dangerBorderActive: {
93
+ rest: string;
94
+ };
95
+ dangerForeground1: {
96
+ rest: string;
97
+ };
98
+ dangerForeground2: {
99
+ rest: string;
100
+ };
101
+ dangerForeground3: {
102
+ rest: string;
103
+ };
104
+ dangerForegroundInverted: {
105
+ rest: string;
106
+ };
107
+ display: {
108
+ fontFamily: string;
109
+ fontLineHeight: number;
110
+ fontSize: number;
111
+ fontWeight: string;
112
+ };
113
+ largeTitle: {
114
+ fontFamily: string;
115
+ fontLineHeight: number;
116
+ fontSize: number;
117
+ fontWeight: string;
118
+ };
119
+ neutralBackground1: {
120
+ rest: string;
121
+ hover: string;
122
+ pressed: string;
123
+ selected: string;
124
+ };
125
+ neutralBackground2: {
126
+ rest: string;
127
+ hover: string;
128
+ pressed: string;
129
+ selected: string;
130
+ };
131
+ neutralBackground3: {
132
+ rest: string;
133
+ hover: string;
134
+ pressed: string;
135
+ selected: string;
136
+ };
137
+ neutralBackground4: {
138
+ rest: string;
139
+ hover: string;
140
+ pressed: string;
141
+ selected: string;
142
+ };
143
+ neutralBackground5: {
144
+ rest: string;
145
+ hover: string;
146
+ pressed: string;
147
+ selected: string;
148
+ };
149
+ neutralBackground6: {
150
+ rest: string;
151
+ };
152
+ neutralBackgroundDisabled: {
153
+ rest: string;
154
+ };
155
+ neutralBackgroundInverted: {
156
+ rest: string;
157
+ };
158
+ neutralForeground1: {
159
+ rest: string;
160
+ hover: string;
161
+ pressed: string;
162
+ selected: string;
163
+ };
164
+ neutralForeground2: {
165
+ rest: string;
166
+ hover: string;
167
+ pressed: string;
168
+ brandHover: string;
169
+ brandPressed: string;
170
+ brandSelected: string;
171
+ selected: string;
172
+ };
173
+ neutralForeground3: {
174
+ rest: string;
175
+ hover: string;
176
+ pressed: string;
177
+ brandHover: string;
178
+ brandPressed: string;
179
+ brandSelected: string;
180
+ selected: string;
181
+ };
182
+ neutralForeground4: {
183
+ rest: string;
184
+ };
185
+ neutralForegroundDisabled: {
186
+ rest: string;
187
+ };
188
+ neutralForegroundInverted: {
189
+ rest: string;
190
+ };
191
+ neutralForegroundInvertedLink: {
192
+ rest: string;
193
+ hover: string;
194
+ pressed: string;
195
+ selected: string;
196
+ };
197
+ neutralForegroundOnBrand: {
198
+ rest: string;
199
+ hover: string;
200
+ pressed: string;
201
+ selected: string;
202
+ };
203
+ neutralStencil1: {
204
+ rest: string;
205
+ };
206
+ neutralStencil2: {
207
+ rest: string;
208
+ };
209
+ neutralStroke1: {
210
+ rest: string;
211
+ hover: string;
212
+ pressed: string;
213
+ selected: string;
214
+ };
215
+ neutralStroke2: {
216
+ rest: string;
217
+ };
218
+ neutralStroke3: {
219
+ rest: string;
220
+ };
221
+ neutralStrokeAccessible: {
222
+ rest: string;
223
+ hover: string;
224
+ pressed: string;
225
+ selected: string;
226
+ };
227
+ neutralStrokeDisabled: {
228
+ rest: string;
229
+ };
230
+ outofofficeBackground1: {
231
+ rest: string;
232
+ };
233
+ outofofficeBackground2: {
234
+ rest: string;
235
+ };
236
+ outofofficeBackground3: {
237
+ rest: string;
238
+ };
239
+ outofofficeBorder1: {
240
+ rest: string;
241
+ };
242
+ outofofficeBorder2: {
243
+ rest: string;
244
+ };
245
+ outofofficeBorderActive: {
246
+ rest: string;
247
+ };
248
+ outofofficeForeground1: {
249
+ rest: string;
250
+ };
251
+ outofofficeForeground2: {
252
+ rest: string;
253
+ };
254
+ outofofficeForeground3: {
255
+ rest: string;
256
+ };
257
+ severeBackground1: {
258
+ rest: string;
259
+ };
260
+ severeBackground2: {
261
+ rest: string;
262
+ };
263
+ severeBackground3: {
264
+ rest: string;
265
+ };
266
+ severeBorder1: {
267
+ rest: string;
268
+ };
269
+ severeBorder2: {
270
+ rest: string;
271
+ };
272
+ severeBorderActive: {
273
+ rest: string;
274
+ };
275
+ severeForeground1: {
276
+ rest: string;
277
+ };
278
+ severeForeground2: {
279
+ rest: string;
280
+ };
281
+ severeForeground3: {
282
+ rest: string;
283
+ };
284
+ strokeFocus1: {
285
+ rest: string;
286
+ };
287
+ strokeFocus2: {
288
+ rest: string;
289
+ };
290
+ subtitle1: {
291
+ fontFamily: string;
292
+ fontLineHeight: number;
293
+ fontSize: number;
294
+ fontWeight: string;
295
+ };
296
+ subtitle1Strong: {
297
+ fontFamily: string;
298
+ fontLineHeight: number;
299
+ fontSize: number;
300
+ fontWeight: string;
301
+ };
302
+ subtitle2: {
303
+ fontFamily: string;
304
+ fontLineHeight: number;
305
+ fontSize: number;
306
+ fontWeight: string;
307
+ };
308
+ subtitle2Strong: {
309
+ fontFamily: string;
310
+ fontLineHeight: number;
311
+ fontSize: number;
312
+ fontWeight: string;
313
+ };
314
+ subtleBackground: {
315
+ rest: string;
316
+ hover: string;
317
+ pressed: string;
318
+ selected: string;
319
+ };
320
+ successBackground1: {
321
+ rest: string;
322
+ };
323
+ successBackground2: {
324
+ rest: string;
325
+ };
326
+ successBackground3: {
327
+ rest: string;
328
+ };
329
+ successBorder1: {
330
+ rest: string;
331
+ };
332
+ successBorder2: {
333
+ rest: string;
334
+ };
335
+ successBorderActive: {
336
+ rest: string;
337
+ };
338
+ successForeground1: {
339
+ rest: string;
340
+ };
341
+ successForeground2: {
342
+ rest: string;
343
+ };
344
+ successForeground3: {
345
+ rest: string;
346
+ };
347
+ successForegroundInverted: {
348
+ rest: string;
349
+ };
350
+ title1: {
351
+ fontFamily: string;
352
+ fontLineHeight: number;
353
+ fontSize: number;
354
+ fontWeight: string;
355
+ };
356
+ title1Strong: {
357
+ fontFamily: string;
358
+ fontLineHeight: number;
359
+ fontSize: number;
360
+ fontWeight: string;
361
+ };
362
+ transparentBackground: {
363
+ rest: string;
364
+ hover: string;
365
+ pressed: string;
366
+ selected: string;
367
+ };
368
+ transparentStroke: {
369
+ rest: string;
370
+ hover: string;
371
+ pressed: string;
372
+ disabled: string;
373
+ };
374
+ warningBackground1: {
375
+ rest: string;
376
+ };
377
+ warningBackground2: {
378
+ rest: string;
379
+ };
380
+ warningBackground3: {
381
+ rest: string;
382
+ };
383
+ warningBorder1: {
384
+ rest: string;
385
+ };
386
+ warningBorder2: {
387
+ rest: string;
388
+ };
389
+ warningBorderActive: {
390
+ rest: string;
391
+ };
392
+ warningForeground1: {
393
+ rest: string;
394
+ };
395
+ warningForeground2: {
396
+ rest: string;
397
+ };
398
+ warningForeground3: {
399
+ rest: string;
400
+ };
401
+ warningForegroundInverted: {
402
+ rest: string;
403
+ };
404
+ };
2
405
  export declare function getOfficeShadowTokens(officeTheme: string): {
3
406
  shadow16: {
4
407
  color: string;
@@ -1 +1 @@
1
- {"version":3,"file":"getOfficeTokens.d.ts","sourceRoot":"","sources":["../src/getOfficeTokens.ts"],"names":[],"mappings":"AAUA,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,OAYvD;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYxD"}
@@ -5,7 +5,7 @@ import colorfulShadowTokens from '@fluentui-react-native/design-tokens-win32/col
5
5
  import darkGrayAliasTokens from '@fluentui-react-native/design-tokens-win32/darkgray/tokens-aliases.json';
6
6
  import darkGrayShadowTokens from '@fluentui-react-native/design-tokens-win32/darkgray/tokens-shadow.json';
7
7
  import hcShadowTokens from '@fluentui-react-native/design-tokens-win32/hc/tokens-shadow.json';
8
- import { hcAliasTokens } from './highContrast/tokens-alias';
8
+ import { hcAliasTokens } from '@fluentui-react-native/design/tokens/legacy';
9
9
  export function getOfficeAliasTokens(officeTheme) {
10
10
  if (officeTheme === 'White' || officeTheme === 'Colorful') {
11
11
  return colorfulAliasTokens;
@@ -1 +1 @@
1
- {"version":3,"file":"getOfficeTokens.js","sourceRoot":"","sources":["../src/getOfficeTokens.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,sEAAsE,CAAC;AACpG,OAAO,iBAAiB,MAAM,qEAAqE,CAAC;AACpG,OAAO,mBAAmB,MAAM,yEAAyE,CAAC;AAC1G,OAAO,oBAAoB,MAAM,wEAAwE,CAAC;AAC1G,OAAO,mBAAmB,MAAM,yEAAyE,CAAC;AAC1G,OAAO,oBAAoB,MAAM,wEAAwE,CAAC;AAC1G,OAAO,cAAc,MAAM,kEAAkE,CAAC;AAE9F,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,UAAU,oBAAoB,CAAC,WAAmB;IACtD,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;QAC1D,OAAO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AI,WAAW,KAAK,UAAU,EAAE,CAAC;QAC1D,OAAO,mBAAmB,CAAC;IAC7B,CAAC;SAAM,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,mBAAmB,CAAC;IAC7B,CAAC;SAAM,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;QACnC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;SAAM,IAAI,WAAW,KAAK,cAAc,EAAE,CAAC;QAC1C,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,WAAmB;IACvD,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;QAC1D,OAAO,oBAAoB,CAAC;IAC9B,CAAC;SAAM,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,oBAAoB,CAAC;IAC9B,CAAC;SAAM,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;QACnC,OAAO,iBAAiB,CAAC;IAC3B,CAAC;SAAM,IAAI,WAAW,KAAK,cAAc,EAAE,CAAC;QAC1C,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/win32-theme",
3
- "version": "0.39.6",
3
+ "version": "0.39.11",
4
4
  "description": "Win32 office theme that works with the theming native module",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -33,12 +33,10 @@
33
33
  "update-snapshots": "fluentui-scripts jest -u"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui-react-native/default-theme": "0.27.6",
37
- "@fluentui-react-native/design": "0.2.0",
36
+ "@fluentui-react-native/default-theme": "0.27.11",
37
+ "@fluentui-react-native/design": "0.4.0",
38
38
  "@fluentui-react-native/design-tokens-win32": "^0.53.0",
39
- "@fluentui-react-native/framework-base": "0.5.0",
40
- "@fluentui-react-native/theme-tokens": "0.29.0",
41
- "@fluentui-react-native/theming-utils": "0.27.6"
39
+ "@fluentui-react-native/framework-base": "0.7.0"
42
40
  },
43
41
  "devDependencies": {
44
42
  "@babel/core": "^7.20.0",
@@ -1,7 +1,7 @@
1
1
  import { NativeEventEmitter, TurboModuleRegistry } from 'react-native';
2
2
 
3
3
  import { fallbackGetPalette, fallbackOfficeModule } from './fallbackOfficeModule';
4
- import { setCurrentHostThemeSetting } from './hostThemeSetting';
4
+ import { setCurrentHostThemeState } from './hostThemeSetting';
5
5
  import type { OfficeThemingModule } from './officeThemingModule';
6
6
 
7
7
  /**
@@ -22,6 +22,7 @@ function themeGetConstants(): ReturnType<OfficeThemingModule['getConstants']> {
22
22
  let themingModule: OfficeThemingModule = undefined;
23
23
  let themingModuleConstants: ReturnType<OfficeThemingModule['getConstants']> = undefined;
24
24
  let themingModuleEmitter: NativeEventEmitter = undefined;
25
+
25
26
  export function getThemingModule(): [OfficeThemingModule, NativeEventEmitter | undefined] {
26
27
  if (!themingModule) {
27
28
  const module = TurboModuleRegistry.get<OfficeThemingModule>('Theming');
@@ -30,7 +31,12 @@ export function getThemingModule(): [OfficeThemingModule, NativeEventEmitter | u
30
31
  if (!isInstantiated) {
31
32
  // We need to store the host theme so that when themes are created
32
33
  // they can use this information.
33
- setCurrentHostThemeSetting(module.getConstants().initialHostThemeSetting);
34
+ const initialConstants = module.getConstants();
35
+ setCurrentHostThemeState({
36
+ hostThemeSetting: initialConstants.initialHostThemeSetting ?? '',
37
+ colorScheme: initialConstants.initialColorScheme,
38
+ isHighContrast: initialConstants.initialIsHighContrast,
39
+ });
34
40
  isInstantiated = true;
35
41
  }
36
42
 
@@ -7,12 +7,22 @@
7
7
  // Unfortunately, native changes take a long time to roundtrip,
8
8
  // so as a workaround we store a copy of that information instead to last the
9
9
  // entire lifetime of the instance.
10
- let currentHostThemeSetting: string = '';
10
+ export interface CurrentHostThemeState {
11
+ hostThemeSetting: string;
12
+ colorScheme?: 'light' | 'dark';
13
+ isHighContrast?: boolean;
14
+ }
11
15
 
12
- export const getCurrentHostThemeSetting = () => {
13
- return currentHostThemeSetting;
16
+ let currentHostThemeState: CurrentHostThemeState = { hostThemeSetting: '' };
17
+
18
+ export const getCurrentHostThemeSetting = () => currentHostThemeState.hostThemeSetting;
19
+
20
+ export const getCurrentHostThemeState = () => currentHostThemeState;
21
+
22
+ export const setCurrentHostThemeSetting = (hostThemeSetting: string) => {
23
+ currentHostThemeState = { hostThemeSetting };
14
24
  };
15
25
 
16
- export const setCurrentHostThemeSetting = (newHostThemeSetting: string) => {
17
- currentHostThemeSetting = newHostThemeSetting;
26
+ export const setCurrentHostThemeState = (state: CurrentHostThemeState) => {
27
+ currentHostThemeState = state;
18
28
  };
@@ -6,6 +6,7 @@ export type {
6
6
  CxxException,
7
7
  NativeColorRamps,
8
8
  NativeColorNames,
9
+ OfficeThemingConstants,
9
10
  OfficeThemingModule,
10
11
  IEventEmitter,
11
12
  } from './officeThemingModule';
@@ -1,11 +1,15 @@
1
1
  import type { NativeModule, ColorValue } from 'react-native';
2
2
 
3
- import type { OfficePalette, Typography } from '@fluentui-react-native/design/theming';
3
+ import type { OfficePalette, ThemeColorScheme, Typography } from '@fluentui-react-native/design/theming';
4
4
 
5
5
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
6
6
  type ObjectBase = {};
7
7
 
8
- export type PlatformDefaultsChangedArgs = { hostThemeSetting: string };
8
+ export type PlatformDefaultsChangedArgs = {
9
+ hostThemeSetting: string;
10
+ colorScheme?: ThemeColorScheme;
11
+ isHighContrast?: boolean;
12
+ };
9
13
  export type PlatformDefaultsChangedCallback = (args?: PlatformDefaultsChangedArgs) => void;
10
14
 
11
15
  export interface CxxException {
@@ -27,15 +31,19 @@ export interface NativeColorNames {
27
31
  Sepias: string[];
28
32
  }
29
33
 
34
+ export interface OfficeThemingConstants {
35
+ typography: ObjectBase;
36
+ fluentTypography: Typography;
37
+ ramps: NativeColorRamps;
38
+ rampNames: NativeColorNames;
39
+ initialHostThemeSetting?: string;
40
+ initialColorScheme?: ThemeColorScheme;
41
+ initialIsHighContrast?: boolean;
42
+ }
43
+
30
44
  export interface OfficeThemingModule extends NativeModule {
31
45
  getPalette(palette?: string): OfficePalette | CxxException;
32
- getConstants(): {
33
- typography: ObjectBase; // TODO: figure out why this is not a real type
34
- fluentTypography: Typography;
35
- ramps: NativeColorRamps;
36
- rampNames: NativeColorNames;
37
- initialHostThemeSetting?: string;
38
- };
46
+ getConstants(): OfficeThemingConstants;
39
47
  }
40
48
 
41
49
  export interface IEventEmitter {
@@ -41,6 +41,10 @@ it('createOfficeTheme test', () => {
41
41
  expect(officeTheme).toMatchSnapshot();
42
42
  });
43
43
 
44
+ it('preserves high contrast identity on the direct legacy theme path', () => {
45
+ expect(createOfficeTheme({ paletteName: 'TaskPane', appearance: 'highContrast' }).theme.host.appearance).toBe('highContrast');
46
+ });
47
+
44
48
  it.concurrent.each(officeThemes)('createBrandedThemeWithAlias test themeName: %s', async (themeName: string) => {
45
49
  setCurrentHostThemeSetting('Colorful');
46
50
  const officeTheme = createOfficeTheme({ paletteName: 'TaskPane', appearance: 'light' }).theme;
@@ -1,6 +1,6 @@
1
1
  import type { ColorValue } from 'react-native';
2
2
 
3
- import { globalTokens } from '@fluentui-react-native/theme-tokens';
3
+ import { globalTokens } from '@fluentui-react-native/design/tokens/legacy';
4
4
  import type { Theme, PartialTheme, AliasColorTokens } from '@fluentui-react-native/design/theming';
5
5
 
6
6
  export function createBrandedThemeWithAlias(themeName: string, theme: Theme): PartialTheme {
@@ -1,6 +1,6 @@
1
1
  import { memoize } from '@fluentui-react-native/framework-base';
2
2
  import type { Variants } from '@fluentui-react-native/design/theming';
3
- import { mapFontPipelineToTheme } from '@fluentui-react-native/theming-utils';
3
+ import { mapFontPipelineToTheme } from '@fluentui-react-native/design/theming';
4
4
 
5
5
  import { getOfficeAliasTokens } from './getOfficeTokens';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { memoize } from '@fluentui-react-native/framework-base';
2
2
  import type { AliasColorTokens, ThemeShadowDefinition } from '@fluentui-react-native/design/theming';
3
- import { mapPipelineToShadow, mapPipelineToTheme } from '@fluentui-react-native/theming-utils';
3
+ import { mapPipelineToShadow, mapPipelineToTheme } from '@fluentui-react-native/design/theming';
4
4
 
5
5
  import { getOfficeAliasTokens, getOfficeShadowTokens } from './getOfficeTokens';
6
6