@fluentui-react-native/win32-theme 0.16.4 → 0.19.0
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.
- package/CHANGELOG.json +105 -1
- package/CHANGELOG.md +33 -2
- package/lib/createFontAliasTokens.d.ts +5 -0
- package/lib/createFontAliasTokens.d.ts.map +1 -0
- package/lib/createFontAliasTokens.js +9 -0
- package/lib/createFontAliasTokens.js.map +1 -0
- package/lib/createOfficeAliasTokens.d.ts +5 -3
- package/lib/createOfficeAliasTokens.d.ts.map +1 -1
- package/lib/createOfficeAliasTokens.js +9 -4
- package/lib/createOfficeAliasTokens.js.map +1 -1
- package/lib/createOfficeTheme.d.ts.map +1 -1
- package/lib/createOfficeTheme.js +18 -3
- package/lib/createOfficeTheme.js.map +1 -1
- package/lib/getOfficeTokens.d.ts +379 -0
- package/lib/getOfficeTokens.d.ts.map +1 -0
- package/lib/getOfficeTokens.js +39 -0
- package/lib/getOfficeTokens.js.map +1 -0
- package/lib/getThemeTypography.d.ts +3 -0
- package/lib/getThemeTypography.d.ts.map +1 -0
- package/lib/getThemeTypography.js +22 -0
- package/lib/getThemeTypography.js.map +1 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/createFontAliasTokens.d.ts +5 -0
- package/lib-commonjs/createFontAliasTokens.d.ts.map +1 -0
- package/lib-commonjs/createFontAliasTokens.js +12 -0
- package/lib-commonjs/createFontAliasTokens.js.map +1 -0
- package/lib-commonjs/createOfficeAliasTokens.d.ts +5 -3
- package/lib-commonjs/createOfficeAliasTokens.d.ts.map +1 -1
- package/lib-commonjs/createOfficeAliasTokens.js +10 -5
- package/lib-commonjs/createOfficeAliasTokens.js.map +1 -1
- package/lib-commonjs/createOfficeTheme.d.ts.map +1 -1
- package/lib-commonjs/createOfficeTheme.js +17 -2
- package/lib-commonjs/createOfficeTheme.js.map +1 -1
- package/lib-commonjs/getOfficeTokens.d.ts +379 -0
- package/lib-commonjs/getOfficeTokens.d.ts.map +1 -0
- package/lib-commonjs/getOfficeTokens.js +45 -0
- package/lib-commonjs/getOfficeTokens.js.map +1 -0
- package/lib-commonjs/getThemeTypography.d.ts +3 -0
- package/lib-commonjs/getThemeTypography.d.ts.map +1 -0
- package/lib-commonjs/getThemeTypography.js +26 -0
- package/lib-commonjs/getThemeTypography.js.map +1 -0
- package/lib-commonjs/index.d.ts +3 -1
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +6 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +7 -7
- package/src/createFontAliasTokens.ts +11 -0
- package/src/createOfficeAliasTokens.ts +12 -5
- package/src/createOfficeTheme.ts +20 -3
- package/src/getOfficeTokens.ts +36 -0
- package/src/getThemeTypography.ts +38 -0
- package/src/index.ts +3 -1
- package/lib/getOfficeAliasTokens.d.ts +0 -2
- package/lib/getOfficeAliasTokens.d.ts.map +0 -1
- package/lib/getOfficeAliasTokens.js +0 -20
- package/lib/getOfficeAliasTokens.js.map +0 -1
- package/lib-commonjs/getOfficeAliasTokens.d.ts +0 -2
- package/lib-commonjs/getOfficeAliasTokens.d.ts.map +0 -1
- package/lib-commonjs/getOfficeAliasTokens.js +0 -25
- package/lib-commonjs/getOfficeAliasTokens.js.map +0 -1
- package/src/getOfficeAliasTokens.ts +0 -18
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOfficeShadowTokens = exports.getOfficeAliasTokens = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var tokens_aliases_json_1 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/colorful/tokens-aliases.json"));
|
|
6
|
+
var tokens_aliases_json_2 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/darkgray/tokens-aliases.json"));
|
|
7
|
+
var tokens_aliases_json_3 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/black/tokens-aliases.json"));
|
|
8
|
+
var tokens_alias_1 = require("./highContrast/tokens-alias");
|
|
9
|
+
var tokens_shadow_json_1 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/colorful/tokens-shadow.json"));
|
|
10
|
+
var tokens_shadow_json_2 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/darkgray/tokens-shadow.json"));
|
|
11
|
+
var tokens_shadow_json_3 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/black/tokens-shadow.json"));
|
|
12
|
+
var tokens_shadow_json_4 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/hc/tokens-shadow.json"));
|
|
13
|
+
function getOfficeAliasTokens(officeTheme) {
|
|
14
|
+
if (officeTheme === 'White' || officeTheme === 'Colorful') {
|
|
15
|
+
return tokens_aliases_json_1.default;
|
|
16
|
+
}
|
|
17
|
+
else if (officeTheme === 'DarkGray') {
|
|
18
|
+
return tokens_aliases_json_2.default;
|
|
19
|
+
}
|
|
20
|
+
else if (officeTheme === 'Black') {
|
|
21
|
+
return tokens_aliases_json_3.default;
|
|
22
|
+
}
|
|
23
|
+
else if (officeTheme === 'HighContrast') {
|
|
24
|
+
return tokens_alias_1.hcAliasTokens;
|
|
25
|
+
}
|
|
26
|
+
return tokens_aliases_json_1.default;
|
|
27
|
+
}
|
|
28
|
+
exports.getOfficeAliasTokens = getOfficeAliasTokens;
|
|
29
|
+
function getOfficeShadowTokens(officeTheme) {
|
|
30
|
+
if (officeTheme === 'White' || officeTheme === 'Colorful') {
|
|
31
|
+
return tokens_shadow_json_1.default.shadow;
|
|
32
|
+
}
|
|
33
|
+
else if (officeTheme === 'DarkGray') {
|
|
34
|
+
return tokens_shadow_json_2.default.shadow;
|
|
35
|
+
}
|
|
36
|
+
else if (officeTheme === 'Black') {
|
|
37
|
+
return tokens_shadow_json_3.default.shadow;
|
|
38
|
+
}
|
|
39
|
+
else if (officeTheme === 'HighContrast') {
|
|
40
|
+
return tokens_shadow_json_4.default.shadow;
|
|
41
|
+
}
|
|
42
|
+
return tokens_aliases_json_1.default;
|
|
43
|
+
}
|
|
44
|
+
exports.getOfficeShadowTokens = getOfficeShadowTokens;
|
|
45
|
+
//# sourceMappingURL=getOfficeTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getOfficeTokens.js","sourceRoot":"","sources":["../src/getOfficeTokens.ts"],"names":[],"mappings":";;;;AAAA,6IAA0G;AAC1G,6IAA0G;AAC1G,0IAAoG;AACpG,4DAA4D;AAC5D,2IAA0G;AAC1G,2IAA0G;AAC1G,wIAAoG;AACpG,qIAA8F;AAE9F,SAAgB,oBAAoB,CAAC,WAAmB;IACtD,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,UAAU,EAAE;QACzD,OAAO,6BAAmB,CAAC;KAC5B;SAAM,IAAI,WAAW,KAAK,UAAU,EAAE;QACrC,OAAO,6BAAmB,CAAC;KAC5B;SAAM,IAAI,WAAW,KAAK,OAAO,EAAE;QAClC,OAAO,6BAAgB,CAAC;KACzB;SAAM,IAAI,WAAW,KAAK,cAAc,EAAE;QACzC,OAAO,4BAAa,CAAC;KACtB;IAED,OAAO,6BAAmB,CAAC;AAC7B,CAAC;AAZD,oDAYC;AAED,SAAgB,qBAAqB,CAAC,WAAmB;IACvD,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,UAAU,EAAE;QACzD,OAAO,4BAAoB,CAAC,MAAM,CAAC;KACpC;SAAM,IAAI,WAAW,KAAK,UAAU,EAAE;QACrC,OAAO,4BAAoB,CAAC,MAAM,CAAC;KACpC;SAAM,IAAI,WAAW,KAAK,OAAO,EAAE;QAClC,OAAO,4BAAiB,CAAC,MAAM,CAAC;KACjC;SAAM,IAAI,WAAW,KAAK,cAAc,EAAE;QACzC,OAAO,4BAAc,CAAC,MAAM,CAAC;KAC9B;IAED,OAAO,6BAAmB,CAAC;AAC7B,CAAC;AAZD,sDAYC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getThemeTypography.d.ts","sourceRoot":"","sources":["../src/getThemeTypography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,oCAAoC,CAAC;AAI1E,wBAAgB,eAAe,IAAI,UAAU,CAiC5C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.win32Typography = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var default_theme_1 = require("@fluentui-react-native/default-theme");
|
|
6
|
+
var createFontAliasTokens_1 = require("./createFontAliasTokens");
|
|
7
|
+
function win32Typography() {
|
|
8
|
+
var win32Dict = {
|
|
9
|
+
sizes: default_theme_1.defaultFluentTheme.typography.sizes,
|
|
10
|
+
weights: default_theme_1.defaultFluentTheme.typography.weights,
|
|
11
|
+
// hard coded until we support new fontFamily format
|
|
12
|
+
families: {
|
|
13
|
+
primary: 'Segoe UI',
|
|
14
|
+
secondary: 'Segoe UI Semibold',
|
|
15
|
+
cursive: 'System',
|
|
16
|
+
monospace: 'Consolas',
|
|
17
|
+
sansSerif: 'System',
|
|
18
|
+
serif: 'System',
|
|
19
|
+
numeric: 'Bahnschrift',
|
|
20
|
+
},
|
|
21
|
+
variants: (0, tslib_1.__assign)({ captionStandard: { face: 'primary', size: 'caption', weight: 'regular' }, secondaryStandard: { face: 'primary', size: 'secondary', weight: 'regular' }, secondarySemibold: { face: 'primary', size: 'secondary', weight: 'semiBold' }, bodyStandard: { face: 'primary', size: 'body', weight: 'regular' }, bodySemibold: { face: 'primary', size: 'body', weight: 'semiBold' }, subheaderStandard: { face: 'primary', size: 'subheader', weight: 'regular' }, subheaderSemibold: { face: 'primary', size: 'subheader', weight: 'semiBold' }, headerStandard: { face: 'primary', size: 'header', weight: 'regular' }, headerSemibold: { face: 'primary', size: 'header', weight: 'semiBold' }, heroStandard: { face: 'primary', size: 'hero', weight: 'regular' }, heroSemibold: { face: 'primary', size: 'hero', weight: 'semiBold' }, heroLargeStandard: { face: 'primary', size: 'heroLarge', weight: 'regular' }, heroLargeSemibold: { face: 'primary', size: 'heroLarge', weight: 'semiBold' } }, (0, createFontAliasTokens_1.createFontAliasTokens)()),
|
|
22
|
+
};
|
|
23
|
+
return win32Dict;
|
|
24
|
+
}
|
|
25
|
+
exports.win32Typography = win32Typography;
|
|
26
|
+
//# sourceMappingURL=getThemeTypography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getThemeTypography.js","sourceRoot":"","sources":["../src/getThemeTypography.ts"],"names":[],"mappings":";;;;AACA,sEAA0E;AAC1E,iEAAgE;AAEhE,SAAgB,eAAe;IAC7B,IAAM,SAAS,GAAG;QAChB,KAAK,EAAE,kCAAkB,CAAC,UAAU,CAAC,KAAK;QAC1C,OAAO,EAAE,kCAAkB,CAAC,UAAU,CAAC,OAAO;QAC9C,oDAAoD;QACpD,QAAQ,EAAE;YACR,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE,mBAAmB;YAC9B,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,UAAU;YACrB,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,aAAa;SACvB;QACD,QAAQ,EAAE,wBACR,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,EACxE,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5E,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,EAC7E,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAClE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,EACnE,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5E,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,EAC7E,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EACtE,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,EACvE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAClE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,EACnE,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5E,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,IAC1E,IAAA,6CAAqB,GAAE,CACf;KACd,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAjCD,0CAiCC"}
|
package/lib-commonjs/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { createPartialOfficeTheme } from './createPartialOfficeTheme';
|
|
|
3
3
|
export { fallbackGetPalette, fallbackOfficeModule, getThemingModule } from './NativeModule/index';
|
|
4
4
|
export type { CxxException, IEventEmitter, NativeColorNames, NativeColorRamps, OfficeThemingModule, PlatformDefaultsChangedArgs, PlatformDefaultsChangedCallback, } from './NativeModule/index';
|
|
5
5
|
export { paletteFromOfficeColors } from './paletteFromOfficeColors';
|
|
6
|
-
export { createOfficeAliasTokens } from './createOfficeAliasTokens';
|
|
6
|
+
export { createOfficeColorAliasTokens as createOfficeAliasTokens } from './createOfficeAliasTokens';
|
|
7
|
+
export { createFontAliasTokens } from './createFontAliasTokens';
|
|
7
8
|
export { createBrandedThemeWithAlias, getCurrentBrandAliasTokens } from './createBrandedThemeWithAlias';
|
|
9
|
+
export { win32Typography } from './getThemeTypography';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,4BAA4B,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCurrentBrandAliasTokens = exports.createBrandedThemeWithAlias = exports.createOfficeAliasTokens = exports.paletteFromOfficeColors = exports.getThemingModule = exports.fallbackOfficeModule = exports.fallbackGetPalette = exports.createPartialOfficeTheme = exports.createOfficeTheme = void 0;
|
|
3
|
+
exports.win32Typography = exports.getCurrentBrandAliasTokens = exports.createBrandedThemeWithAlias = exports.createFontAliasTokens = exports.createOfficeAliasTokens = exports.paletteFromOfficeColors = exports.getThemingModule = exports.fallbackOfficeModule = exports.fallbackGetPalette = exports.createPartialOfficeTheme = exports.createOfficeTheme = void 0;
|
|
4
4
|
var createOfficeTheme_1 = require("./createOfficeTheme");
|
|
5
5
|
Object.defineProperty(exports, "createOfficeTheme", { enumerable: true, get: function () { return createOfficeTheme_1.createOfficeTheme; } });
|
|
6
6
|
var createPartialOfficeTheme_1 = require("./createPartialOfficeTheme");
|
|
@@ -12,8 +12,12 @@ Object.defineProperty(exports, "getThemingModule", { enumerable: true, get: func
|
|
|
12
12
|
var paletteFromOfficeColors_1 = require("./paletteFromOfficeColors");
|
|
13
13
|
Object.defineProperty(exports, "paletteFromOfficeColors", { enumerable: true, get: function () { return paletteFromOfficeColors_1.paletteFromOfficeColors; } });
|
|
14
14
|
var createOfficeAliasTokens_1 = require("./createOfficeAliasTokens");
|
|
15
|
-
Object.defineProperty(exports, "createOfficeAliasTokens", { enumerable: true, get: function () { return createOfficeAliasTokens_1.
|
|
15
|
+
Object.defineProperty(exports, "createOfficeAliasTokens", { enumerable: true, get: function () { return createOfficeAliasTokens_1.createOfficeColorAliasTokens; } });
|
|
16
|
+
var createFontAliasTokens_1 = require("./createFontAliasTokens");
|
|
17
|
+
Object.defineProperty(exports, "createFontAliasTokens", { enumerable: true, get: function () { return createFontAliasTokens_1.createFontAliasTokens; } });
|
|
16
18
|
var createBrandedThemeWithAlias_1 = require("./createBrandedThemeWithAlias");
|
|
17
19
|
Object.defineProperty(exports, "createBrandedThemeWithAlias", { enumerable: true, get: function () { return createBrandedThemeWithAlias_1.createBrandedThemeWithAlias; } });
|
|
18
20
|
Object.defineProperty(exports, "getCurrentBrandAliasTokens", { enumerable: true, get: function () { return createBrandedThemeWithAlias_1.getCurrentBrandAliasTokens; } });
|
|
21
|
+
var getThemeTypography_1 = require("./getThemeTypography");
|
|
22
|
+
Object.defineProperty(exports, "win32Typography", { enumerable: true, get: function () { return getThemeTypography_1.win32Typography; } });
|
|
19
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AACjC,8CAAkG;AAAzF,2GAAA,kBAAkB,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAUnE,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AACjC,8CAAkG;AAAzF,2GAAA,kBAAkB,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAUnE,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,qEAAoG;AAA3F,kIAAA,4BAA4B,OAA2B;AAChE,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,6EAAwG;AAA/F,0IAAA,2BAA2B,OAAA;AAAE,yIAAA,0BAA0B,OAAA;AAChE,2DAAuD;AAA9C,qHAAA,eAAe,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/win32-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Win32 office theme that works with the theming native module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@fluentui-react-native/default-theme": ">=0.
|
|
31
|
-
"@fluentui-react-native/design-tokens-win32": "^0.
|
|
30
|
+
"@fluentui-react-native/default-theme": ">=0.13.0 <1.0.0",
|
|
31
|
+
"@fluentui-react-native/design-tokens-win32": "^0.13.0",
|
|
32
32
|
"@fluentui-react-native/memo-cache": "^1.1.7",
|
|
33
|
-
"@fluentui-react-native/theme-tokens": ">=0.
|
|
34
|
-
"@fluentui-react-native/theme-types": ">=0.
|
|
35
|
-
"@fluentui-react-native/theme": ">=0.6.
|
|
36
|
-
"@fluentui-react-native/theming-utils": ">=0.
|
|
33
|
+
"@fluentui-react-native/theme-tokens": ">=0.18.0 <1.0.0",
|
|
34
|
+
"@fluentui-react-native/theme-types": ">=0.17.0 <1.0.0",
|
|
35
|
+
"@fluentui-react-native/theme": ">=0.6.11 <1.0.0",
|
|
36
|
+
"@fluentui-react-native/theming-utils": ">=0.13.0 <1.0.0",
|
|
37
37
|
"tslib": "^2.3.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getOfficeAliasTokens } from './getOfficeTokens';
|
|
2
|
+
import { Variants } from '@fluentui-react-native/theme-types';
|
|
3
|
+
import { memoize } from '@fluentui-react-native/memo-cache';
|
|
4
|
+
import { mapFontPipelineToTheme } from '@fluentui-react-native/theming-utils';
|
|
5
|
+
|
|
6
|
+
function createFontAliasTokensWorker(): Partial<Variants> {
|
|
7
|
+
const aliasTokens = getOfficeAliasTokens('Colorful');
|
|
8
|
+
return mapFontPipelineToTheme(aliasTokens);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const createFontAliasTokens = memoize(createFontAliasTokensWorker);
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { getOfficeAliasTokens } from './
|
|
2
|
-
import { AliasColorTokens } from '@fluentui-react-native/theme-types';
|
|
1
|
+
import { getOfficeAliasTokens, getOfficeShadowTokens } from './getOfficeTokens';
|
|
2
|
+
import { AliasColorTokens, ThemeShadowDefinition } from '@fluentui-react-native/theme-types';
|
|
3
3
|
import { memoize } from '@fluentui-react-native/memo-cache';
|
|
4
|
-
import { mapPipelineToTheme } from '@fluentui-react-native/theming-utils';
|
|
4
|
+
import { mapPipelineToShadow, mapPipelineToTheme } from '@fluentui-react-native/theming-utils';
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
function createOfficeColorAliasTokensWorker(officeTheme: string): AliasColorTokens {
|
|
7
7
|
const aliasTokens = getOfficeAliasTokens(officeTheme);
|
|
8
8
|
return mapPipelineToTheme(aliasTokens);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const createOfficeColorAliasTokens = memoize(createOfficeColorAliasTokensWorker);
|
|
12
|
+
|
|
13
|
+
function createOfficeShadowAliasTokensWorker(officeTheme: string): ThemeShadowDefinition {
|
|
14
|
+
const aliasTokens = getOfficeShadowTokens(officeTheme);
|
|
15
|
+
return mapPipelineToShadow(aliasTokens);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const createOfficeShadowAliasTokens = memoize(createOfficeShadowAliasTokensWorker);
|
package/src/createOfficeTheme.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { getThemingModule } from './NativeModule/getThemingModule';
|
|
|
4
4
|
import { CxxException, PlatformDefaultsChangedArgs } from './NativeModule/officeThemingModule';
|
|
5
5
|
import { OfficePalette, Theme, ThemeOptions } from '@fluentui-react-native/theme-types';
|
|
6
6
|
import { createPartialOfficeTheme } from './createPartialOfficeTheme';
|
|
7
|
-
import {
|
|
7
|
+
import { createOfficeColorAliasTokens, createOfficeShadowAliasTokens } from './createOfficeAliasTokens';
|
|
8
8
|
import { createBrandedThemeWithAlias } from './createBrandedThemeWithAlias';
|
|
9
9
|
import { createAliasesFromPalette } from './createAliasesFromPalette';
|
|
10
|
+
import { win32Typography } from './getThemeTypography';
|
|
10
11
|
|
|
11
12
|
function handlePaletteCall(palette: OfficePalette | CxxException): OfficePalette | undefined {
|
|
12
13
|
const exception = palette as CxxException;
|
|
@@ -39,7 +40,20 @@ export function createOfficeTheme(options: ThemeOptions = {}): ThemeReference {
|
|
|
39
40
|
return {};
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
return {
|
|
43
|
+
return {
|
|
44
|
+
shadows: { ...createOfficeShadowAliasTokens(ref.themeName) },
|
|
45
|
+
typography: win32Typography(),
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
() => {
|
|
49
|
+
if (!ref.themeName || ref.themeName === '') {
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
colors: { ...createOfficeColorAliasTokens(ref.themeName) },
|
|
55
|
+
typography: win32Typography(),
|
|
56
|
+
};
|
|
43
57
|
},
|
|
44
58
|
(theme: Theme) => {
|
|
45
59
|
return createBrandedThemeWithAlias(ref.themeName, theme);
|
|
@@ -49,7 +63,10 @@ export function createOfficeTheme(options: ThemeOptions = {}): ThemeReference {
|
|
|
49
63
|
return {};
|
|
50
64
|
}
|
|
51
65
|
|
|
52
|
-
return {
|
|
66
|
+
return {
|
|
67
|
+
colors: createAliasesFromPalette(theme.host.palette, ref.themeName === 'HighContrast'),
|
|
68
|
+
typography: win32Typography(),
|
|
69
|
+
};
|
|
53
70
|
},
|
|
54
71
|
);
|
|
55
72
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import colorfulAliasTokens from '@fluentui-react-native/design-tokens-win32/colorful/tokens-aliases.json';
|
|
2
|
+
import darkGrayAliasTokens from '@fluentui-react-native/design-tokens-win32/darkgray/tokens-aliases.json';
|
|
3
|
+
import blackAliasTokens from '@fluentui-react-native/design-tokens-win32/black/tokens-aliases.json';
|
|
4
|
+
import { hcAliasTokens } from './highContrast/tokens-alias';
|
|
5
|
+
import colorfulShadowTokens from '@fluentui-react-native/design-tokens-win32/colorful/tokens-shadow.json';
|
|
6
|
+
import darkGrayShadowTokens from '@fluentui-react-native/design-tokens-win32/darkgray/tokens-shadow.json';
|
|
7
|
+
import blackShadowTokens from '@fluentui-react-native/design-tokens-win32/black/tokens-shadow.json';
|
|
8
|
+
import hcShadowTokens from '@fluentui-react-native/design-tokens-win32/hc/tokens-shadow.json';
|
|
9
|
+
|
|
10
|
+
export function getOfficeAliasTokens(officeTheme: string) {
|
|
11
|
+
if (officeTheme === 'White' || officeTheme === 'Colorful') {
|
|
12
|
+
return colorfulAliasTokens;
|
|
13
|
+
} else if (officeTheme === 'DarkGray') {
|
|
14
|
+
return darkGrayAliasTokens;
|
|
15
|
+
} else if (officeTheme === 'Black') {
|
|
16
|
+
return blackAliasTokens;
|
|
17
|
+
} else if (officeTheme === 'HighContrast') {
|
|
18
|
+
return hcAliasTokens;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return colorfulAliasTokens;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function getOfficeShadowTokens(officeTheme: string) {
|
|
25
|
+
if (officeTheme === 'White' || officeTheme === 'Colorful') {
|
|
26
|
+
return colorfulShadowTokens.shadow;
|
|
27
|
+
} else if (officeTheme === 'DarkGray') {
|
|
28
|
+
return darkGrayShadowTokens.shadow;
|
|
29
|
+
} else if (officeTheme === 'Black') {
|
|
30
|
+
return blackShadowTokens.shadow;
|
|
31
|
+
} else if (officeTheme === 'HighContrast') {
|
|
32
|
+
return hcShadowTokens.shadow;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return colorfulAliasTokens;
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Typography, Variants } from '@fluentui-react-native/theme-types';
|
|
2
|
+
import { defaultFluentTheme } from '@fluentui-react-native/default-theme';
|
|
3
|
+
import { createFontAliasTokens } from './createFontAliasTokens';
|
|
4
|
+
|
|
5
|
+
export function win32Typography(): Typography {
|
|
6
|
+
const win32Dict = {
|
|
7
|
+
sizes: defaultFluentTheme.typography.sizes,
|
|
8
|
+
weights: defaultFluentTheme.typography.weights,
|
|
9
|
+
// hard coded until we support new fontFamily format
|
|
10
|
+
families: {
|
|
11
|
+
primary: 'Segoe UI',
|
|
12
|
+
secondary: 'Segoe UI Semibold',
|
|
13
|
+
cursive: 'System',
|
|
14
|
+
monospace: 'Consolas',
|
|
15
|
+
sansSerif: 'System',
|
|
16
|
+
serif: 'System',
|
|
17
|
+
numeric: 'Bahnschrift',
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
captionStandard: { face: 'primary', size: 'caption', weight: 'regular' },
|
|
21
|
+
secondaryStandard: { face: 'primary', size: 'secondary', weight: 'regular' },
|
|
22
|
+
secondarySemibold: { face: 'primary', size: 'secondary', weight: 'semiBold' },
|
|
23
|
+
bodyStandard: { face: 'primary', size: 'body', weight: 'regular' },
|
|
24
|
+
bodySemibold: { face: 'primary', size: 'body', weight: 'semiBold' },
|
|
25
|
+
subheaderStandard: { face: 'primary', size: 'subheader', weight: 'regular' },
|
|
26
|
+
subheaderSemibold: { face: 'primary', size: 'subheader', weight: 'semiBold' },
|
|
27
|
+
headerStandard: { face: 'primary', size: 'header', weight: 'regular' },
|
|
28
|
+
headerSemibold: { face: 'primary', size: 'header', weight: 'semiBold' },
|
|
29
|
+
heroStandard: { face: 'primary', size: 'hero', weight: 'regular' },
|
|
30
|
+
heroSemibold: { face: 'primary', size: 'hero', weight: 'semiBold' },
|
|
31
|
+
heroLargeStandard: { face: 'primary', size: 'heroLarge', weight: 'regular' },
|
|
32
|
+
heroLargeSemibold: { face: 'primary', size: 'heroLarge', weight: 'semiBold' },
|
|
33
|
+
...createFontAliasTokens(),
|
|
34
|
+
} as Variants,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return win32Dict;
|
|
38
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -11,5 +11,7 @@ export type {
|
|
|
11
11
|
PlatformDefaultsChangedCallback,
|
|
12
12
|
} from './NativeModule/index';
|
|
13
13
|
export { paletteFromOfficeColors } from './paletteFromOfficeColors';
|
|
14
|
-
export { createOfficeAliasTokens } from './createOfficeAliasTokens';
|
|
14
|
+
export { createOfficeColorAliasTokens as createOfficeAliasTokens } from './createOfficeAliasTokens';
|
|
15
|
+
export { createFontAliasTokens } from './createFontAliasTokens';
|
|
15
16
|
export { createBrandedThemeWithAlias, getCurrentBrandAliasTokens } from './createBrandedThemeWithAlias';
|
|
17
|
+
export { win32Typography } from './getThemeTypography';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOfficeAliasTokens.d.ts","sourceRoot":"","sources":["../src/getOfficeAliasTokens.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,OAYvD"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import colorfulAliasTokens from '@fluentui-react-native/design-tokens-win32/colorful/tokens-aliases.json';
|
|
2
|
-
import darkGrayAliasTokens from '@fluentui-react-native/design-tokens-win32/darkgray/tokens-aliases.json';
|
|
3
|
-
import blackAliasTokens from '@fluentui-react-native/design-tokens-win32/black/tokens-aliases.json';
|
|
4
|
-
import { hcAliasTokens } from './highContrast/tokens-alias';
|
|
5
|
-
export function getOfficeAliasTokens(officeTheme) {
|
|
6
|
-
if (officeTheme === 'White' || officeTheme === 'Colorful') {
|
|
7
|
-
return colorfulAliasTokens;
|
|
8
|
-
}
|
|
9
|
-
else if (officeTheme === 'DarkGray') {
|
|
10
|
-
return darkGrayAliasTokens;
|
|
11
|
-
}
|
|
12
|
-
else if (officeTheme === 'Black') {
|
|
13
|
-
return blackAliasTokens;
|
|
14
|
-
}
|
|
15
|
-
else if (officeTheme === 'HighContrast') {
|
|
16
|
-
return hcAliasTokens;
|
|
17
|
-
}
|
|
18
|
-
return colorfulAliasTokens;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=getOfficeAliasTokens.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOfficeAliasTokens.js","sourceRoot":"","sources":["../src/getOfficeAliasTokens.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,yEAAyE,CAAC;AAC1G,OAAO,mBAAmB,MAAM,yEAAyE,CAAC;AAC1G,OAAO,gBAAgB,MAAM,sEAAsE,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,UAAU,oBAAoB,CAAC,WAAmB;IACtD,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,UAAU,EAAE;QACzD,OAAO,mBAAmB,CAAC;KAC5B;SAAM,IAAI,WAAW,KAAK,UAAU,EAAE;QACrC,OAAO,mBAAmB,CAAC;KAC5B;SAAM,IAAI,WAAW,KAAK,OAAO,EAAE;QAClC,OAAO,gBAAgB,CAAC;KACzB;SAAM,IAAI,WAAW,KAAK,cAAc,EAAE;QACzC,OAAO,aAAa,CAAC;KACtB;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOfficeAliasTokens.d.ts","sourceRoot":"","sources":["../src/getOfficeAliasTokens.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,OAYvD"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOfficeAliasTokens = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var tokens_aliases_json_1 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/colorful/tokens-aliases.json"));
|
|
6
|
-
var tokens_aliases_json_2 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/darkgray/tokens-aliases.json"));
|
|
7
|
-
var tokens_aliases_json_3 = (0, tslib_1.__importDefault)(require("@fluentui-react-native/design-tokens-win32/black/tokens-aliases.json"));
|
|
8
|
-
var tokens_alias_1 = require("./highContrast/tokens-alias");
|
|
9
|
-
function getOfficeAliasTokens(officeTheme) {
|
|
10
|
-
if (officeTheme === 'White' || officeTheme === 'Colorful') {
|
|
11
|
-
return tokens_aliases_json_1.default;
|
|
12
|
-
}
|
|
13
|
-
else if (officeTheme === 'DarkGray') {
|
|
14
|
-
return tokens_aliases_json_2.default;
|
|
15
|
-
}
|
|
16
|
-
else if (officeTheme === 'Black') {
|
|
17
|
-
return tokens_aliases_json_3.default;
|
|
18
|
-
}
|
|
19
|
-
else if (officeTheme === 'HighContrast') {
|
|
20
|
-
return tokens_alias_1.hcAliasTokens;
|
|
21
|
-
}
|
|
22
|
-
return tokens_aliases_json_1.default;
|
|
23
|
-
}
|
|
24
|
-
exports.getOfficeAliasTokens = getOfficeAliasTokens;
|
|
25
|
-
//# sourceMappingURL=getOfficeAliasTokens.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getOfficeAliasTokens.js","sourceRoot":"","sources":["../src/getOfficeAliasTokens.ts"],"names":[],"mappings":";;;;AAAA,6IAA0G;AAC1G,6IAA0G;AAC1G,0IAAoG;AACpG,4DAA4D;AAE5D,SAAgB,oBAAoB,CAAC,WAAmB;IACtD,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,UAAU,EAAE;QACzD,OAAO,6BAAmB,CAAC;KAC5B;SAAM,IAAI,WAAW,KAAK,UAAU,EAAE;QACrC,OAAO,6BAAmB,CAAC;KAC5B;SAAM,IAAI,WAAW,KAAK,OAAO,EAAE;QAClC,OAAO,6BAAgB,CAAC;KACzB;SAAM,IAAI,WAAW,KAAK,cAAc,EAAE;QACzC,OAAO,4BAAa,CAAC;KACtB;IAED,OAAO,6BAAmB,CAAC;AAC7B,CAAC;AAZD,oDAYC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import colorfulAliasTokens from '@fluentui-react-native/design-tokens-win32/colorful/tokens-aliases.json';
|
|
2
|
-
import darkGrayAliasTokens from '@fluentui-react-native/design-tokens-win32/darkgray/tokens-aliases.json';
|
|
3
|
-
import blackAliasTokens from '@fluentui-react-native/design-tokens-win32/black/tokens-aliases.json';
|
|
4
|
-
import { hcAliasTokens } from './highContrast/tokens-alias';
|
|
5
|
-
|
|
6
|
-
export function getOfficeAliasTokens(officeTheme: string) {
|
|
7
|
-
if (officeTheme === 'White' || officeTheme === 'Colorful') {
|
|
8
|
-
return colorfulAliasTokens;
|
|
9
|
-
} else if (officeTheme === 'DarkGray') {
|
|
10
|
-
return darkGrayAliasTokens;
|
|
11
|
-
} else if (officeTheme === 'Black') {
|
|
12
|
-
return blackAliasTokens;
|
|
13
|
-
} else if (officeTheme === 'HighContrast') {
|
|
14
|
-
return hcAliasTokens;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return colorfulAliasTokens;
|
|
18
|
-
}
|