@fluentui/react-theme 9.0.0-alpha.9 → 9.0.0-beta.4

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 (309) hide show
  1. package/CHANGELOG.json +486 -1
  2. package/CHANGELOG.md +197 -2
  3. package/dist/react-theme.d.ts +367 -0
  4. package/lib/alias/dark.d.ts +3 -0
  5. package/lib/alias/dark.js +155 -0
  6. package/lib/alias/dark.js.map +1 -0
  7. package/lib/alias/highContrast.d.ts +3 -0
  8. package/lib/alias/highContrast.js +155 -0
  9. package/lib/alias/highContrast.js.map +1 -0
  10. package/lib/alias/light.d.ts +3 -0
  11. package/lib/alias/light.js +155 -0
  12. package/lib/alias/light.js.map +1 -0
  13. package/lib/alias/teamsDark.d.ts +3 -0
  14. package/lib/alias/teamsDark.js +155 -0
  15. package/lib/alias/teamsDark.js.map +1 -0
  16. package/lib/global/borderRadius.d.ts +2 -2
  17. package/lib/global/borderRadius.js +7 -7
  18. package/lib/global/borderRadius.js.map +1 -1
  19. package/lib/global/brandColors.d.ts +3 -0
  20. package/lib/global/brandColors.js +33 -0
  21. package/lib/global/brandColors.js.map +1 -0
  22. package/lib/global/colors.d.ts +14 -60
  23. package/lib/global/colors.js +823 -835
  24. package/lib/global/colors.js.map +1 -1
  25. package/lib/global/fonts.d.ts +5 -6
  26. package/lib/global/fonts.js +32 -48
  27. package/lib/global/fonts.js.map +1 -1
  28. package/lib/global/index.d.ts +0 -1
  29. package/lib/global/index.js +0 -1
  30. package/lib/global/index.js.map +1 -1
  31. package/lib/global/strokeWidths.d.ts +2 -2
  32. package/lib/global/strokeWidths.js +5 -5
  33. package/lib/global/strokeWidths.js.map +1 -1
  34. package/lib/index.d.ts +2 -4
  35. package/lib/index.js +1 -3
  36. package/lib/index.js.map +1 -1
  37. package/lib/themes/index.js.map +1 -1
  38. package/lib/themes/teams/darkTheme.d.ts +1 -1
  39. package/lib/themes/teams/darkTheme.js +3 -30
  40. package/lib/themes/teams/darkTheme.js.map +1 -1
  41. package/lib/themes/teams/highContrastTheme.d.ts +1 -1
  42. package/lib/themes/teams/highContrastTheme.js +2 -13
  43. package/lib/themes/teams/highContrastTheme.js.map +1 -1
  44. package/lib/themes/teams/index.js.map +1 -1
  45. package/lib/themes/teams/lightTheme.d.ts +1 -1
  46. package/lib/themes/teams/lightTheme.js +3 -13
  47. package/lib/themes/teams/lightTheme.js.map +1 -1
  48. package/lib/themes/web/darkTheme.d.ts +1 -1
  49. package/lib/themes/web/darkTheme.js +3 -13
  50. package/lib/themes/web/darkTheme.js.map +1 -1
  51. package/lib/themes/web/highContrastTheme.d.ts +1 -1
  52. package/lib/themes/web/highContrastTheme.js +2 -13
  53. package/lib/themes/web/highContrastTheme.js.map +1 -1
  54. package/lib/themes/web/index.js.map +1 -1
  55. package/lib/themes/web/lightTheme.d.ts +1 -1
  56. package/lib/themes/web/lightTheme.js +3 -13
  57. package/lib/themes/web/lightTheme.js.map +1 -1
  58. package/lib/tsdoc-metadata.json +11 -0
  59. package/lib/types.d.ts +241 -164
  60. package/lib/types.js +1 -0
  61. package/lib/types.js.map +1 -1
  62. package/lib/utils/createDarkTheme.d.ts +2 -0
  63. package/lib/utils/createDarkTheme.js +18 -0
  64. package/lib/utils/createDarkTheme.js.map +1 -0
  65. package/lib/utils/createHighContrastTheme.d.ts +2 -0
  66. package/lib/utils/createHighContrastTheme.js +18 -0
  67. package/lib/utils/createHighContrastTheme.js.map +1 -0
  68. package/lib/utils/createLightTheme.d.ts +2 -0
  69. package/lib/utils/createLightTheme.js +18 -0
  70. package/lib/utils/createLightTheme.js.map +1 -0
  71. package/lib/utils/createTeamsDarkTheme.d.ts +2 -0
  72. package/lib/utils/createTeamsDarkTheme.js +18 -0
  73. package/lib/utils/createTeamsDarkTheme.js.map +1 -0
  74. package/lib/utils/index.d.ts +6 -0
  75. package/lib/utils/index.js +7 -0
  76. package/lib/utils/index.js.map +1 -0
  77. package/lib/utils/mergeThemes.d.ts +2 -8
  78. package/lib/utils/mergeThemes.js +12 -49
  79. package/lib/utils/mergeThemes.js.map +1 -1
  80. package/lib/utils/shadows.d.ts +3 -2
  81. package/lib/utils/shadows.js +9 -9
  82. package/lib/utils/shadows.js.map +1 -1
  83. package/lib/utils/themeToCSSVariables.d.ts +2 -2
  84. package/lib/utils/themeToCSSVariables.js +9 -19
  85. package/lib/utils/themeToCSSVariables.js.map +1 -1
  86. package/lib-commonjs/alias/dark.d.ts +3 -0
  87. package/lib-commonjs/alias/dark.js +165 -0
  88. package/lib-commonjs/alias/dark.js.map +1 -0
  89. package/lib-commonjs/alias/highContrast.d.ts +3 -0
  90. package/lib-commonjs/alias/highContrast.js +165 -0
  91. package/lib-commonjs/alias/highContrast.js.map +1 -0
  92. package/lib-commonjs/alias/light.d.ts +3 -0
  93. package/lib-commonjs/alias/light.js +165 -0
  94. package/lib-commonjs/alias/light.js.map +1 -0
  95. package/lib-commonjs/alias/teamsDark.d.ts +3 -0
  96. package/lib-commonjs/alias/teamsDark.js +165 -0
  97. package/lib-commonjs/alias/teamsDark.js.map +1 -0
  98. package/lib-commonjs/global/borderRadius.d.ts +2 -2
  99. package/lib-commonjs/global/borderRadius.js +11 -7
  100. package/lib-commonjs/global/borderRadius.js.map +1 -1
  101. package/lib-commonjs/global/brandColors.d.ts +3 -0
  102. package/lib-commonjs/global/brandColors.js +39 -0
  103. package/lib-commonjs/global/brandColors.js.map +1 -0
  104. package/lib-commonjs/global/colors.d.ts +14 -60
  105. package/lib-commonjs/global/colors.js +825 -833
  106. package/lib-commonjs/global/colors.js.map +1 -1
  107. package/lib-commonjs/global/fonts.d.ts +5 -6
  108. package/lib-commonjs/global/fonts.js +33 -45
  109. package/lib-commonjs/global/fonts.js.map +1 -1
  110. package/lib-commonjs/global/index.d.ts +0 -1
  111. package/lib-commonjs/global/index.js +10 -3
  112. package/lib-commonjs/global/index.js.map +1 -1
  113. package/lib-commonjs/global/strokeWidths.d.ts +2 -2
  114. package/lib-commonjs/global/strokeWidths.js +9 -5
  115. package/lib-commonjs/global/strokeWidths.js.map +1 -1
  116. package/lib-commonjs/index.d.ts +2 -4
  117. package/lib-commonjs/index.js +9 -6
  118. package/lib-commonjs/index.js.map +1 -1
  119. package/lib-commonjs/themes/index.js +8 -2
  120. package/lib-commonjs/themes/index.js.map +1 -1
  121. package/lib-commonjs/themes/teams/darkTheme.d.ts +1 -1
  122. package/lib-commonjs/themes/teams/darkTheme.js +10 -30
  123. package/lib-commonjs/themes/teams/darkTheme.js.map +1 -1
  124. package/lib-commonjs/themes/teams/highContrastTheme.d.ts +1 -1
  125. package/lib-commonjs/themes/teams/highContrastTheme.js +9 -14
  126. package/lib-commonjs/themes/teams/highContrastTheme.js.map +1 -1
  127. package/lib-commonjs/themes/teams/index.js +9 -2
  128. package/lib-commonjs/themes/teams/index.js.map +1 -1
  129. package/lib-commonjs/themes/teams/lightTheme.d.ts +1 -1
  130. package/lib-commonjs/themes/teams/lightTheme.js +11 -14
  131. package/lib-commonjs/themes/teams/lightTheme.js.map +1 -1
  132. package/lib-commonjs/themes/web/darkTheme.d.ts +1 -1
  133. package/lib-commonjs/themes/web/darkTheme.js +11 -14
  134. package/lib-commonjs/themes/web/darkTheme.js.map +1 -1
  135. package/lib-commonjs/themes/web/highContrastTheme.d.ts +1 -1
  136. package/lib-commonjs/themes/web/highContrastTheme.js +9 -14
  137. package/lib-commonjs/themes/web/highContrastTheme.js.map +1 -1
  138. package/lib-commonjs/themes/web/index.js +9 -2
  139. package/lib-commonjs/themes/web/index.js.map +1 -1
  140. package/lib-commonjs/themes/web/lightTheme.d.ts +1 -1
  141. package/lib-commonjs/themes/web/lightTheme.js +11 -14
  142. package/lib-commonjs/themes/web/lightTheme.js.map +1 -1
  143. package/lib-commonjs/types.d.ts +241 -164
  144. package/lib-commonjs/types.js +4 -1
  145. package/lib-commonjs/types.js.map +1 -1
  146. package/lib-commonjs/utils/createDarkTheme.d.ts +2 -0
  147. package/lib-commonjs/utils/createDarkTheme.js +30 -0
  148. package/lib-commonjs/utils/createDarkTheme.js.map +1 -0
  149. package/lib-commonjs/utils/createHighContrastTheme.d.ts +2 -0
  150. package/lib-commonjs/utils/createHighContrastTheme.js +30 -0
  151. package/lib-commonjs/utils/createHighContrastTheme.js.map +1 -0
  152. package/lib-commonjs/utils/createLightTheme.d.ts +2 -0
  153. package/lib-commonjs/utils/createLightTheme.js +30 -0
  154. package/lib-commonjs/utils/createLightTheme.js.map +1 -0
  155. package/lib-commonjs/utils/createTeamsDarkTheme.d.ts +2 -0
  156. package/lib-commonjs/utils/createTeamsDarkTheme.js +30 -0
  157. package/lib-commonjs/utils/createTeamsDarkTheme.js.map +1 -0
  158. package/lib-commonjs/utils/index.d.ts +6 -0
  159. package/lib-commonjs/utils/index.js +28 -0
  160. package/lib-commonjs/utils/index.js.map +1 -0
  161. package/lib-commonjs/utils/mergeThemes.d.ts +2 -8
  162. package/lib-commonjs/utils/mergeThemes.js +19 -51
  163. package/lib-commonjs/utils/mergeThemes.js.map +1 -1
  164. package/lib-commonjs/utils/shadows.d.ts +3 -2
  165. package/lib-commonjs/utils/shadows.js +17 -11
  166. package/lib-commonjs/utils/shadows.js.map +1 -1
  167. package/lib-commonjs/utils/themeToCSSVariables.d.ts +2 -2
  168. package/lib-commonjs/utils/themeToCSSVariables.js +16 -20
  169. package/lib-commonjs/utils/themeToCSSVariables.js.map +1 -1
  170. package/package.json +11 -8
  171. package/just.config.ts +0 -3
  172. package/lib/global/utils.d.ts +0 -23
  173. package/lib/global/utils.js +0 -27
  174. package/lib/global/utils.js.map +0 -1
  175. package/lib/themes/teams/globalTheme.d.ts +0 -22
  176. package/lib/themes/teams/globalTheme.js +0 -3
  177. package/lib/themes/teams/globalTheme.js.map +0 -1
  178. package/lib/themes/web/globalTheme.d.ts +0 -22
  179. package/lib/themes/web/globalTheme.js +0 -3
  180. package/lib/themes/web/globalTheme.js.map +0 -1
  181. package/lib/utils/dark/colors.d.ts +0 -8
  182. package/lib/utils/dark/colors.js +0 -83
  183. package/lib/utils/dark/colors.js.map +0 -1
  184. package/lib/utils/dark/index.d.ts +0 -1
  185. package/lib/utils/dark/index.js +0 -2
  186. package/lib/utils/dark/index.js.map +0 -1
  187. package/lib/utils/highContrast/colors.d.ts +0 -6
  188. package/lib/utils/highContrast/colors.js +0 -83
  189. package/lib/utils/highContrast/colors.js.map +0 -1
  190. package/lib/utils/highContrast/index.d.ts +0 -1
  191. package/lib/utils/highContrast/index.js +0 -2
  192. package/lib/utils/highContrast/index.js.map +0 -1
  193. package/lib/utils/light/colors.d.ts +0 -8
  194. package/lib/utils/light/colors.js +0 -83
  195. package/lib/utils/light/colors.js.map +0 -1
  196. package/lib/utils/light/index.d.ts +0 -1
  197. package/lib/utils/light/index.js +0 -2
  198. package/lib/utils/light/index.js.map +0 -1
  199. package/lib-amd/global/borderRadius.d.ts +0 -2
  200. package/lib-amd/global/borderRadius.js +0 -13
  201. package/lib-amd/global/borderRadius.js.map +0 -1
  202. package/lib-amd/global/colors.d.ts +0 -61
  203. package/lib-amd/global/colors.js +0 -841
  204. package/lib-amd/global/colors.js.map +0 -1
  205. package/lib-amd/global/fonts.d.ts +0 -6
  206. package/lib-amd/global/fonts.js +0 -57
  207. package/lib-amd/global/fonts.js.map +0 -1
  208. package/lib-amd/global/index.d.ts +0 -5
  209. package/lib-amd/global/index.js +0 -10
  210. package/lib-amd/global/index.js.map +0 -1
  211. package/lib-amd/global/strokeWidths.d.ts +0 -2
  212. package/lib-amd/global/strokeWidths.js +0 -11
  213. package/lib-amd/global/strokeWidths.js.map +0 -1
  214. package/lib-amd/global/utils.d.ts +0 -23
  215. package/lib-amd/global/utils.js +0 -26
  216. package/lib-amd/global/utils.js.map +0 -1
  217. package/lib-amd/index.d.ts +0 -5
  218. package/lib-amd/index.js +0 -9
  219. package/lib-amd/index.js.map +0 -1
  220. package/lib-amd/themes/index.d.ts +0 -2
  221. package/lib-amd/themes/index.js +0 -7
  222. package/lib-amd/themes/index.js.map +0 -1
  223. package/lib-amd/themes/teams/darkTheme.d.ts +0 -2
  224. package/lib-amd/themes/teams/darkTheme.js +0 -30
  225. package/lib-amd/themes/teams/darkTheme.js.map +0 -1
  226. package/lib-amd/themes/teams/globalTheme.d.ts +0 -22
  227. package/lib-amd/themes/teams/globalTheme.js +0 -6
  228. package/lib-amd/themes/teams/globalTheme.js.map +0 -1
  229. package/lib-amd/themes/teams/highContrastTheme.d.ts +0 -2
  230. package/lib-amd/themes/teams/highContrastTheme.js +0 -13
  231. package/lib-amd/themes/teams/highContrastTheme.js.map +0 -1
  232. package/lib-amd/themes/teams/index.d.ts +0 -3
  233. package/lib-amd/themes/teams/index.js +0 -8
  234. package/lib-amd/themes/teams/index.js.map +0 -1
  235. package/lib-amd/themes/teams/lightTheme.d.ts +0 -2
  236. package/lib-amd/themes/teams/lightTheme.js +0 -13
  237. package/lib-amd/themes/teams/lightTheme.js.map +0 -1
  238. package/lib-amd/themes/web/darkTheme.d.ts +0 -2
  239. package/lib-amd/themes/web/darkTheme.js +0 -13
  240. package/lib-amd/themes/web/darkTheme.js.map +0 -1
  241. package/lib-amd/themes/web/globalTheme.d.ts +0 -22
  242. package/lib-amd/themes/web/globalTheme.js +0 -6
  243. package/lib-amd/themes/web/globalTheme.js.map +0 -1
  244. package/lib-amd/themes/web/highContrastTheme.d.ts +0 -2
  245. package/lib-amd/themes/web/highContrastTheme.js +0 -13
  246. package/lib-amd/themes/web/highContrastTheme.js.map +0 -1
  247. package/lib-amd/themes/web/index.d.ts +0 -3
  248. package/lib-amd/themes/web/index.js +0 -8
  249. package/lib-amd/themes/web/index.js.map +0 -1
  250. package/lib-amd/themes/web/lightTheme.d.ts +0 -2
  251. package/lib-amd/themes/web/lightTheme.js +0 -13
  252. package/lib-amd/themes/web/lightTheme.js.map +0 -1
  253. package/lib-amd/types.d.ts +0 -290
  254. package/lib-amd/types.js +0 -5
  255. package/lib-amd/types.js.map +0 -1
  256. package/lib-amd/utils/dark/colors.d.ts +0 -8
  257. package/lib-amd/utils/dark/colors.js +0 -87
  258. package/lib-amd/utils/dark/colors.js.map +0 -1
  259. package/lib-amd/utils/dark/index.d.ts +0 -1
  260. package/lib-amd/utils/dark/index.js +0 -6
  261. package/lib-amd/utils/dark/index.js.map +0 -1
  262. package/lib-amd/utils/highContrast/colors.d.ts +0 -6
  263. package/lib-amd/utils/highContrast/colors.js +0 -87
  264. package/lib-amd/utils/highContrast/colors.js.map +0 -1
  265. package/lib-amd/utils/highContrast/index.d.ts +0 -1
  266. package/lib-amd/utils/highContrast/index.js +0 -6
  267. package/lib-amd/utils/highContrast/index.js.map +0 -1
  268. package/lib-amd/utils/light/colors.d.ts +0 -8
  269. package/lib-amd/utils/light/colors.js +0 -87
  270. package/lib-amd/utils/light/colors.js.map +0 -1
  271. package/lib-amd/utils/light/index.d.ts +0 -1
  272. package/lib-amd/utils/light/index.js +0 -6
  273. package/lib-amd/utils/light/index.js.map +0 -1
  274. package/lib-amd/utils/mergeThemes.d.ts +0 -8
  275. package/lib-amd/utils/mergeThemes.js +0 -58
  276. package/lib-amd/utils/mergeThemes.js.map +0 -1
  277. package/lib-amd/utils/shadows.d.ts +0 -2
  278. package/lib-amd/utils/shadows.js +0 -16
  279. package/lib-amd/utils/shadows.js.map +0 -1
  280. package/lib-amd/utils/themeToCSSVariables.d.ts +0 -2
  281. package/lib-amd/utils/themeToCSSVariables.js +0 -27
  282. package/lib-amd/utils/themeToCSSVariables.js.map +0 -1
  283. package/lib-commonjs/global/utils.d.ts +0 -23
  284. package/lib-commonjs/global/utils.js +0 -29
  285. package/lib-commonjs/global/utils.js.map +0 -1
  286. package/lib-commonjs/themes/teams/globalTheme.d.ts +0 -22
  287. package/lib-commonjs/themes/teams/globalTheme.js +0 -5
  288. package/lib-commonjs/themes/teams/globalTheme.js.map +0 -1
  289. package/lib-commonjs/themes/web/globalTheme.d.ts +0 -22
  290. package/lib-commonjs/themes/web/globalTheme.js +0 -5
  291. package/lib-commonjs/themes/web/globalTheme.js.map +0 -1
  292. package/lib-commonjs/utils/dark/colors.d.ts +0 -8
  293. package/lib-commonjs/utils/dark/colors.js +0 -87
  294. package/lib-commonjs/utils/dark/colors.js.map +0 -1
  295. package/lib-commonjs/utils/dark/index.d.ts +0 -1
  296. package/lib-commonjs/utils/dark/index.js +0 -5
  297. package/lib-commonjs/utils/dark/index.js.map +0 -1
  298. package/lib-commonjs/utils/highContrast/colors.d.ts +0 -6
  299. package/lib-commonjs/utils/highContrast/colors.js +0 -87
  300. package/lib-commonjs/utils/highContrast/colors.js.map +0 -1
  301. package/lib-commonjs/utils/highContrast/index.d.ts +0 -1
  302. package/lib-commonjs/utils/highContrast/index.js +0 -5
  303. package/lib-commonjs/utils/highContrast/index.js.map +0 -1
  304. package/lib-commonjs/utils/light/colors.d.ts +0 -8
  305. package/lib-commonjs/utils/light/colors.js +0 -87
  306. package/lib-commonjs/utils/light/colors.js.map +0 -1
  307. package/lib-commonjs/utils/light/index.d.ts +0 -1
  308. package/lib-commonjs/utils/light/index.js +0 -5
  309. package/lib-commonjs/utils/light/index.js.map +0 -1
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createDarkTheme = void 0;
7
+
8
+ const dark_1 = /*#__PURE__*/require("../alias/dark");
9
+
10
+ const index_1 = /*#__PURE__*/require("../global/index");
11
+
12
+ const shadows_1 = /*#__PURE__*/require("./shadows");
13
+
14
+ const createDarkTheme = brand => {
15
+ const colorTokens = dark_1.generateColorTokens(brand);
16
+ return { ...index_1.borderRadius,
17
+ ...index_1.fontSizes,
18
+ ...index_1.lineHeights,
19
+ ...index_1.fontFamilies,
20
+ ...index_1.fontWeights,
21
+ ...index_1.strokeWidths,
22
+ ...colorTokens,
23
+ ...dark_1.colorPaletteTokens,
24
+ ...shadows_1.createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey),
25
+ ...shadows_1.createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, 'Brand')
26
+ };
27
+ };
28
+
29
+ exports.createDarkTheme = createDarkTheme;
30
+ //# sourceMappingURL=createDarkTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/createDarkTheme.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,MAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAGO,MAAM,eAAe,GAAoC,KAAK,IAAG;AACtE,QAAM,WAAW,GAAG,MAAA,CAAA,mBAAA,CAAoB,KAApB,CAApB;AAEA,SAAO,EACL,GAAG,OAAA,CAAA,YADE;AAEL,OAAG,OAAA,CAAA,SAFE;AAGL,OAAG,OAAA,CAAA,WAHE;AAIL,OAAG,OAAA,CAAA,YAJE;AAKL,OAAG,OAAA,CAAA,WALE;AAML,OAAG,OAAA,CAAA,YANE;AAQL,OAAG,WARE;AASL,OAAG,MAAA,CAAA,kBATE;AAWL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,yBAA/B,EAA0D,WAAW,CAAC,qBAAtE,CAXE;AAYL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,uBAA/B,EAAwD,WAAW,CAAC,mBAApE,EAAyF,OAAzF;AAZE,GAAP;AAcD,CAjBM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { Theme } from '../types';
2
+ export declare const createHighContrastTheme: () => Theme;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createHighContrastTheme = void 0;
7
+
8
+ const highContrast_1 = /*#__PURE__*/require("../alias/highContrast");
9
+
10
+ const index_1 = /*#__PURE__*/require("../global/index");
11
+
12
+ const shadows_1 = /*#__PURE__*/require("./shadows");
13
+
14
+ const createHighContrastTheme = () => {
15
+ const colorTokens = highContrast_1.generateColorTokens();
16
+ return { ...index_1.borderRadius,
17
+ ...index_1.fontSizes,
18
+ ...index_1.lineHeights,
19
+ ...index_1.fontFamilies,
20
+ ...index_1.fontWeights,
21
+ ...index_1.strokeWidths,
22
+ ...colorTokens,
23
+ ...highContrast_1.colorPaletteTokens,
24
+ ...shadows_1.createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey),
25
+ ...shadows_1.createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, 'Brand')
26
+ };
27
+ };
28
+
29
+ exports.createHighContrastTheme = createHighContrastTheme;
30
+ //# sourceMappingURL=createHighContrastTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/createHighContrastTheme.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,cAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAGO,MAAM,uBAAuB,GAAG,MAAY;AACjD,QAAM,WAAW,GAAG,cAAA,CAAA,mBAAA,EAApB;AAEA,SAAO,EACL,GAAG,OAAA,CAAA,YADE;AAEL,OAAG,OAAA,CAAA,SAFE;AAGL,OAAG,OAAA,CAAA,WAHE;AAIL,OAAG,OAAA,CAAA,YAJE;AAKL,OAAG,OAAA,CAAA,WALE;AAML,OAAG,OAAA,CAAA,YANE;AAQL,OAAG,WARE;AASL,OAAG,cAAA,CAAA,kBATE;AAWL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,yBAA/B,EAA0D,WAAW,CAAC,qBAAtE,CAXE;AAYL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,uBAA/B,EAAwD,WAAW,CAAC,mBAApE,EAAyF,OAAzF;AAZE,GAAP;AAcD,CAjBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { BrandVariants, Theme } from '../types';
2
+ export declare const createLightTheme: (brand: BrandVariants) => Theme;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createLightTheme = void 0;
7
+
8
+ const light_1 = /*#__PURE__*/require("../alias/light");
9
+
10
+ const index_1 = /*#__PURE__*/require("../global/index");
11
+
12
+ const shadows_1 = /*#__PURE__*/require("./shadows");
13
+
14
+ const createLightTheme = brand => {
15
+ const colorTokens = light_1.generateColorTokens(brand);
16
+ return { ...index_1.borderRadius,
17
+ ...index_1.fontSizes,
18
+ ...index_1.lineHeights,
19
+ ...index_1.fontFamilies,
20
+ ...index_1.fontWeights,
21
+ ...index_1.strokeWidths,
22
+ ...colorTokens,
23
+ ...light_1.colorPaletteTokens,
24
+ ...shadows_1.createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey),
25
+ ...shadows_1.createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, 'Brand')
26
+ };
27
+ };
28
+
29
+ exports.createLightTheme = createLightTheme;
30
+ //# sourceMappingURL=createLightTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/createLightTheme.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAGO,MAAM,gBAAgB,GAAoC,KAAK,IAAG;AACvE,QAAM,WAAW,GAAG,OAAA,CAAA,mBAAA,CAAoB,KAApB,CAApB;AAEA,SAAO,EACL,GAAG,OAAA,CAAA,YADE;AAEL,OAAG,OAAA,CAAA,SAFE;AAGL,OAAG,OAAA,CAAA,WAHE;AAIL,OAAG,OAAA,CAAA,YAJE;AAKL,OAAG,OAAA,CAAA,WALE;AAML,OAAG,OAAA,CAAA,YANE;AAQL,OAAG,WARE;AASL,OAAG,OAAA,CAAA,kBATE;AAWL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,yBAA/B,EAA0D,WAAW,CAAC,qBAAtE,CAXE;AAYL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,uBAA/B,EAAwD,WAAW,CAAC,mBAApE,EAAyF,OAAzF;AAZE,GAAP;AAcD,CAjBM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ import type { BrandVariants, Theme } from '../types';
2
+ export declare const createTeamsDarkTheme: (brand: BrandVariants) => Theme;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createTeamsDarkTheme = void 0;
7
+
8
+ const teamsDark_1 = /*#__PURE__*/require("../alias/teamsDark");
9
+
10
+ const index_1 = /*#__PURE__*/require("../global/index");
11
+
12
+ const shadows_1 = /*#__PURE__*/require("./shadows");
13
+
14
+ const createTeamsDarkTheme = brand => {
15
+ const colorTokens = teamsDark_1.generateColorTokens(brand);
16
+ return { ...index_1.borderRadius,
17
+ ...index_1.fontSizes,
18
+ ...index_1.lineHeights,
19
+ ...index_1.fontFamilies,
20
+ ...index_1.fontWeights,
21
+ ...index_1.strokeWidths,
22
+ ...colorTokens,
23
+ ...teamsDark_1.colorPaletteTokens,
24
+ ...shadows_1.createShadowTokens(colorTokens.colorNeutralShadowAmbient, colorTokens.colorNeutralShadowKey),
25
+ ...shadows_1.createShadowTokens(colorTokens.colorBrandShadowAmbient, colorTokens.colorBrandShadowKey, 'Brand')
26
+ };
27
+ };
28
+
29
+ exports.createTeamsDarkTheme = createTeamsDarkTheme;
30
+ //# sourceMappingURL=createTeamsDarkTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/createTeamsDarkTheme.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,WAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AAGO,MAAM,oBAAoB,GAAoC,KAAK,IAAG;AAC3E,QAAM,WAAW,GAAG,WAAA,CAAA,mBAAA,CAAoB,KAApB,CAApB;AAEA,SAAO,EACL,GAAG,OAAA,CAAA,YADE;AAEL,OAAG,OAAA,CAAA,SAFE;AAGL,OAAG,OAAA,CAAA,WAHE;AAIL,OAAG,OAAA,CAAA,YAJE;AAKL,OAAG,OAAA,CAAA,WALE;AAML,OAAG,OAAA,CAAA,YANE;AAQL,OAAG,WARE;AASL,OAAG,WAAA,CAAA,kBATE;AAWL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,yBAA/B,EAA0D,WAAW,CAAC,qBAAtE,CAXE;AAYL,OAAG,SAAA,CAAA,kBAAA,CAAmB,WAAW,CAAC,uBAA/B,EAAwD,WAAW,CAAC,mBAApE,EAAyF,OAAzF;AAZE,GAAP;AAcD,CAjBM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
@@ -0,0 +1,6 @@
1
+ export * from './createLightTheme';
2
+ export * from './createDarkTheme';
3
+ export * from './createTeamsDarkTheme';
4
+ export * from './createHighContrastTheme';
5
+ export { mergeThemes } from './mergeThemes';
6
+ export * from './themeToCSSVariables';
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mergeThemes = void 0;
7
+
8
+ const tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ tslib_1.__exportStar(require("./createLightTheme"), exports);
11
+
12
+ tslib_1.__exportStar(require("./createDarkTheme"), exports);
13
+
14
+ tslib_1.__exportStar(require("./createTeamsDarkTheme"), exports);
15
+
16
+ tslib_1.__exportStar(require("./createHighContrastTheme"), exports);
17
+
18
+ var mergeThemes_1 = /*#__PURE__*/require("./mergeThemes");
19
+
20
+ Object.defineProperty(exports, "mergeThemes", {
21
+ enumerable: true,
22
+ get: function () {
23
+ return mergeThemes_1.mergeThemes;
24
+ }
25
+ });
26
+
27
+ tslib_1.__exportStar(require("./themeToCSSVariables"), exports);
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA;;AAEA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,WAAA;AAAW;AAAX,CAAA;;AACT,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
@@ -1,8 +1,2 @@
1
- import { PartialTheme, Theme } from '../types';
2
- /**
3
- * Simple deep merge function. Takes all arguments and returns a deep copy of the objects merged
4
- * together in the order provided. If an object creates a circular reference, it will assign the
5
- * original reference.
6
- */
7
- export declare function merge<T = {}>(target: Partial<T>, ...args: (Partial<T> | null | undefined | false)[]): T;
8
- export declare function mergeThemes(a: Theme, b: PartialTheme | Theme): Theme;
1
+ import type { PartialTheme, Theme } from '../types';
2
+ export declare function mergeThemes(a: Theme | undefined, b: PartialTheme | Theme | undefined): Theme;
@@ -1,56 +1,24 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // TODO
4
- // We should consider removal merge() function from this file, ideally it should not be required
5
- // as probably themes will have flat shape
6
- /**
7
- * Simple deep merge function. Takes all arguments and returns a deep copy of the objects merged
8
- * together in the order provided. If an object creates a circular reference, it will assign the
9
- * original reference.
10
- */
11
- function merge(target) {
12
- var args = [];
13
- for (var _i = 1; _i < arguments.length; _i++) {
14
- args[_i - 1] = arguments[_i];
15
- }
16
- for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
17
- var arg = args_1[_a];
18
- _merge(target || {}, arg);
19
- }
20
- return target;
21
- }
22
- exports.merge = merge;
23
- /**
24
- * The _merge helper iterates through all props on source and assigns them to target.
25
- * When the value is an object, we will create a deep clone of the object. However if
26
- * there is a circular reference, the value will not be deep cloned and will persist
27
- * the reference.
28
- */
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
- function _merge(target, source, circularReferences) {
31
- if (circularReferences === void 0) { circularReferences = []; }
32
- circularReferences.push(source);
33
- for (var name_1 in source) {
34
- if (source.hasOwnProperty(name_1)) {
35
- if (name_1 !== '__proto__' && name_1 !== 'constructor' && name_1 !== 'prototype') {
36
- var value = source[name_1];
37
- if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
38
- var isCircularReference = circularReferences.indexOf(value) > -1;
39
- target[name_1] = (isCircularReference
40
- ? value
41
- : _merge(target[name_1] || {}, value, circularReferences));
42
- }
43
- else {
44
- target[name_1] = value;
45
- }
46
- }
47
- }
48
- }
49
- circularReferences.pop();
50
- return target;
51
- }
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mergeThemes = void 0;
7
+
52
8
  function mergeThemes(a, b) {
53
- return merge({}, a, b);
9
+ // Merge impacts perf: we should like to avoid it if it's possible
10
+ if (a && b) {
11
+ return { ...a,
12
+ ...b
13
+ };
14
+ }
15
+
16
+ if (a) {
17
+ return a;
18
+ }
19
+
20
+ return b;
54
21
  }
22
+
55
23
  exports.mergeThemes = mergeThemes;
56
24
  //# sourceMappingURL=mergeThemes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeThemes.js","sourceRoot":"../src/","sources":["utils/mergeThemes.ts"],"names":[],"mappings":";;AAEA,OAAO;AACP,gGAAgG;AAChG,0CAA0C;AAE1C;;;;GAIG;AACH,SAAgB,KAAK,CAAS,MAAkB;IAAE,cAAkD;SAAlD,UAAkD,EAAlD,qBAAkD,EAAlD,IAAkD;QAAlD,6BAAkD;;IAClG,KAAkB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;QAAnB,IAAM,GAAG,aAAA;QACZ,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,GAAiB,CAAC,CAAC;KACzC;IAED,OAAO,MAAW,CAAC;AACrB,CAAC;AAND,sBAMC;AAED;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAS,MAAM,CAAmB,MAAS,EAAE,MAAS,EAAE,kBAA8B;IAA9B,mCAAA,EAAA,uBAA8B;IACpF,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhC,KAAK,IAAM,MAAI,IAAI,MAAM,EAAE;QACzB,IAAI,MAAM,CAAC,cAAc,CAAC,MAAI,CAAC,EAAE;YAC/B,IAAI,MAAI,KAAK,WAAW,IAAI,MAAI,KAAK,aAAa,IAAI,MAAI,KAAK,WAAW,EAAE;gBAC1E,IAAM,KAAK,GAAgC,MAAM,CAAC,MAAI,CAAC,CAAC;gBACxD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBACxE,IAAM,mBAAmB,GAAG,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;oBACnE,MAAM,CAAC,MAAI,CAAC,GAAG,CAAC,mBAAmB;wBACjC,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAgC,CAAC;iBAC3F;qBAAM;oBACL,MAAM,CAAC,MAAI,CAAC,GAAG,KAAK,CAAC;iBACtB;aACF;SACF;KACF;IAED,kBAAkB,CAAC,GAAG,EAAE,CAAC;IAEzB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,WAAW,CAAC,CAAQ,EAAE,CAAuB;IAC3D,OAAO,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAU,CAAC;AAClC,CAAC;AAFD,kCAEC","sourcesContent":["import { PartialTheme, Theme } from '../types';\n\n// TODO\n// We should consider removal merge() function from this file, ideally it should not be required\n// as probably themes will have flat shape\n\n/**\n * Simple deep merge function. Takes all arguments and returns a deep copy of the objects merged\n * together in the order provided. If an object creates a circular reference, it will assign the\n * original reference.\n */\nexport function merge<T = {}>(target: Partial<T>, ...args: (Partial<T> | null | undefined | false)[]): T {\n for (const arg of args) {\n _merge(target || {}, arg as Partial<T>);\n }\n\n return target as T;\n}\n\n/**\n * The _merge helper iterates through all props on source and assigns them to target.\n * When the value is an object, we will create a deep clone of the object. However if\n * there is a circular reference, the value will not be deep cloned and will persist\n * the reference.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _merge<T extends Object>(target: T, source: T, circularReferences: any[] = []): T {\n circularReferences.push(source);\n\n for (const name in source) {\n if (source.hasOwnProperty(name)) {\n if (name !== '__proto__' && name !== 'constructor' && name !== 'prototype') {\n const value: T[Extract<keyof T, string>] = source[name];\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n const isCircularReference = circularReferences.indexOf(value) > -1;\n target[name] = (isCircularReference\n ? value\n : _merge(target[name] || {}, value, circularReferences)) as T[Extract<keyof T, string>];\n } else {\n target[name] = value;\n }\n }\n }\n }\n\n circularReferences.pop();\n\n return target;\n}\n\nexport function mergeThemes(a: Theme, b: PartialTheme | Theme): Theme {\n return merge({}, a, b) as Theme;\n}\n"]}
1
+ {"version":3,"sources":["../../src/utils/mergeThemes.ts"],"names":[],"mappings":";;;;;;;AAEA,SAAgB,WAAhB,CAA4B,CAA5B,EAAkD,CAAlD,EAAqF;AACnF;AACA,MAAI,CAAC,IAAI,CAAT,EAAY;AACV,WAAO,EAAE,GAAG,CAAL;AAAQ,SAAG;AAAX,KAAP;AACD;;AAED,MAAI,CAAJ,EAAO;AACL,WAAO,CAAP;AACD;;AAED,SAAO,CAAP;AACD;;AAXD,OAAA,CAAA,WAAA,GAAA,WAAA","sourceRoot":""}
@@ -1,2 +1,3 @@
1
- import { ShadowLevelTokens } from '../types';
2
- export declare function createShadowLevelTokens(ambientColor: string, keyColor: string): ShadowLevelTokens;
1
+ import type { ShadowBrandTokens, ShadowTokens } from '../types';
2
+ export declare function createShadowTokens(ambientColor: string, keyColor: string, tokenSuffix: 'Brand'): ShadowBrandTokens;
3
+ export declare function createShadowTokens(ambientColor: string, keyColor: string): ShadowTokens;
@@ -1,14 +1,20 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function createShadowLevelTokens(ambientColor, keyColor) {
4
- return {
5
- shadow2: "0 0 2px " + ambientColor + ", 0 1px 2px " + keyColor,
6
- shadow4: "0 0 2px " + ambientColor + ", 0 2px 4px " + keyColor,
7
- shadow8: "0 0 2px " + ambientColor + ", 0 4px 8px " + keyColor,
8
- shadow16: "0 0 2px " + ambientColor + ", 0 6px 16px " + keyColor,
9
- shadow28: "0 0 8px " + ambientColor + ", 0 14px 28px " + keyColor,
10
- shadow64: "0 0 8px " + ambientColor + ", 0 32px 64px " + keyColor,
11
- };
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createShadowTokens = void 0;
7
+
8
+ function createShadowTokens(ambientColor, keyColor, tokenSuffix = '') {
9
+ return {
10
+ [`shadow2${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 1px 2px ${keyColor}`,
11
+ [`shadow4${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 2px 4px ${keyColor}`,
12
+ [`shadow8${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 4px 8px ${keyColor}`,
13
+ [`shadow16${tokenSuffix}`]: `0 0 2px ${ambientColor}, 0 8px 16px ${keyColor}`,
14
+ [`shadow28${tokenSuffix}`]: `0 0 8px ${ambientColor}, 0 14px 28px ${keyColor}`,
15
+ [`shadow64${tokenSuffix}`]: `0 0 8px ${ambientColor}, 0 32px 64px ${keyColor}`
16
+ };
12
17
  }
13
- exports.createShadowLevelTokens = createShadowLevelTokens;
18
+
19
+ exports.createShadowTokens = createShadowTokens;
14
20
  //# sourceMappingURL=shadows.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadows.js","sourceRoot":"../src/","sources":["utils/shadows.ts"],"names":[],"mappings":";;AAEA,SAAgB,uBAAuB,CAAC,YAAoB,EAAE,QAAgB;IAC5E,OAAO;QACL,OAAO,EAAE,aAAW,YAAY,oBAAe,QAAU;QACzD,OAAO,EAAE,aAAW,YAAY,oBAAe,QAAU;QACzD,OAAO,EAAE,aAAW,YAAY,oBAAe,QAAU;QACzD,QAAQ,EAAE,aAAW,YAAY,qBAAgB,QAAU;QAC3D,QAAQ,EAAE,aAAW,YAAY,sBAAiB,QAAU;QAC5D,QAAQ,EAAE,aAAW,YAAY,sBAAiB,QAAU;KAC7D,CAAC;AACJ,CAAC;AATD,0DASC","sourcesContent":["import { ShadowLevelTokens } from '../types';\n\nexport function createShadowLevelTokens(ambientColor: string, keyColor: string): ShadowLevelTokens {\n return {\n shadow2: `0 0 2px ${ambientColor}, 0 1px 2px ${keyColor}`,\n shadow4: `0 0 2px ${ambientColor}, 0 2px 4px ${keyColor}`,\n shadow8: `0 0 2px ${ambientColor}, 0 4px 8px ${keyColor}`,\n shadow16: `0 0 2px ${ambientColor}, 0 6px 16px ${keyColor}`,\n shadow28: `0 0 8px ${ambientColor}, 0 14px 28px ${keyColor}`,\n shadow64: `0 0 8px ${ambientColor}, 0 32px 64px ${keyColor}`,\n };\n}\n"]}
1
+ {"version":3,"sources":["../../src/utils/shadows.ts"],"names":[],"mappings":";;;;;;;AAKA,SAAgB,kBAAhB,CAAmC,YAAnC,EAAyD,QAAzD,EAA2E,WAAA,GAA4B,EAAvG,EAAyG;AACvG,SAAO;AACL,KAAC,UAAU,WAAW,EAAtB,GAA2B,WAAW,YAAY,eAAe,QAAQ,EADpE;AAEL,KAAC,UAAU,WAAW,EAAtB,GAA2B,WAAW,YAAY,eAAe,QAAQ,EAFpE;AAGL,KAAC,UAAU,WAAW,EAAtB,GAA2B,WAAW,YAAY,eAAe,QAAQ,EAHpE;AAIL,KAAC,WAAW,WAAW,EAAvB,GAA4B,WAAW,YAAY,gBAAgB,QAAQ,EAJtE;AAKL,KAAC,WAAW,WAAW,EAAvB,GAA4B,WAAW,YAAY,iBAAiB,QAAQ,EALvE;AAML,KAAC,WAAW,WAAW,EAAvB,GAA4B,WAAW,YAAY,iBAAiB,QAAQ;AANvE,GAAP;AAQD;;AATD,OAAA,CAAA,kBAAA,GAAA,kBAAA","sourceRoot":""}
@@ -1,2 +1,2 @@
1
- import { Theme } from '../types';
2
- export declare function themeToCSSVariables(theme: Theme): Record<string, string>;
1
+ import type { Theme } from '../types';
2
+ export declare function themeToCSSVariables(theme: Theme): Record<string, string | number>;
@@ -1,25 +1,21 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function flattenThemeToCSSVariables(
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- themePart, parentKey, result) {
6
- if (parentKey === void 0) { parentKey = ''; }
7
- if (result === void 0) { result = {}; }
8
- for (var propertyName in themePart) {
9
- if (Object.prototype.hasOwnProperty.call(themePart, propertyName)) {
10
- var variableName = parentKey ? parentKey + '-' + propertyName : "--" + propertyName;
11
- if (typeof themePart[propertyName] === 'object') {
12
- flattenThemeToCSSVariables(themePart[propertyName], variableName, result);
13
- }
14
- else {
15
- result[variableName] = themePart[propertyName];
16
- }
17
- }
18
- }
19
- return result;
20
- }
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.themeToCSSVariables = void 0;
7
+
21
8
  function themeToCSSVariables(theme) {
22
- return flattenThemeToCSSVariables(theme);
9
+ const result = {};
10
+
11
+ for (const propertyName in theme) {
12
+ if (Object.prototype.hasOwnProperty.call(theme, propertyName)) {
13
+ result[`--${propertyName}`] = theme[propertyName];
14
+ }
15
+ }
16
+
17
+ return result;
23
18
  }
19
+
24
20
  exports.themeToCSSVariables = themeToCSSVariables;
25
21
  //# sourceMappingURL=themeToCSSVariables.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"themeToCSSVariables.js","sourceRoot":"../src/","sources":["utils/themeToCSSVariables.ts"],"names":[],"mappings":";;AAEA,SAAS,0BAA0B;AACjC,8DAA8D;AAC9D,SAA8B,EAC9B,SAAsB,EACtB,MAAmC;IADnC,0BAAA,EAAA,cAAsB;IACtB,uBAAA,EAAA,WAAmC;IAEnC,KAAK,IAAM,YAAY,IAAI,SAAS,EAAE;QACpC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE;YACjE,IAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,OAAK,YAAc,CAAC;YAEtF,IAAI,OAAO,SAAS,CAAC,YAAY,CAAC,KAAK,QAAQ,EAAE;gBAC/C,0BAA0B,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aAC3E;iBAAM;gBACL,MAAM,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;aAChD;SACF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,mBAAmB,CAAC,KAAY;IAC9C,OAAO,0BAA0B,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC;AAFD,kDAEC","sourcesContent":["import { Theme } from '../types';\n\nfunction flattenThemeToCSSVariables(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n themePart: Record<string, any>,\n parentKey: string = '',\n result: Record<string, string> = {},\n) {\n for (const propertyName in themePart) {\n if (Object.prototype.hasOwnProperty.call(themePart, propertyName)) {\n const variableName = parentKey ? parentKey + '-' + propertyName : `--${propertyName}`;\n\n if (typeof themePart[propertyName] === 'object') {\n flattenThemeToCSSVariables(themePart[propertyName], variableName, result);\n } else {\n result[variableName] = themePart[propertyName];\n }\n }\n }\n return result;\n}\n\nexport function themeToCSSVariables(theme: Theme): Record<string, string> {\n return flattenThemeToCSSVariables(theme);\n}\n"]}
1
+ {"version":3,"sources":["../../src/utils/themeToCSSVariables.ts"],"names":[],"mappings":";;;;;;;AAEA,SAAgB,mBAAhB,CAAoC,KAApC,EAAgD;AAC9C,QAAM,MAAM,GAA2C,EAAvD;;AAEA,OAAK,MAAM,YAAX,IAA2B,KAA3B,EAAkC;AAChC,QAAI,MAAM,CAAC,SAAP,CAAiB,cAAjB,CAAgC,IAAhC,CAAqC,KAArC,EAA4C,YAA5C,CAAJ,EAA+D;AAC7D,MAAA,MAAM,CAAC,KAAK,YAAY,EAAlB,CAAN,GAA8B,KAAK,CAAC,YAAD,CAAnC;AACD;AACF;;AAED,SAAO,MAAP;AACD;;AAVD,OAAA,CAAA,mBAAA,GAAA,mBAAA","sourceRoot":""}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@fluentui/react-theme",
3
- "version": "9.0.0-alpha.9",
3
+ "version": "9.0.0-beta.4",
4
4
  "description": "Fluent UI themes",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
7
  "typings": "lib/index.d.ts",
8
+ "sideEffects": false,
8
9
  "repository": {
9
10
  "type": "git",
10
11
  "url": "https://github.com/microsoft/fluentui"
@@ -12,17 +13,20 @@
12
13
  "license": "MIT",
13
14
  "scripts": {
14
15
  "build": "just-scripts build",
16
+ "bundle-size": "bundle-size measure",
15
17
  "clean": "just-scripts clean",
16
18
  "code-style": "just-scripts code-style",
17
19
  "just": "just-scripts",
18
20
  "lint": "just-scripts lint",
19
- "start": "just-scripts dev:storybook",
20
- "start-test": "just-scripts jest-watch",
21
- "test": "just-scripts test",
22
- "update-snapshots": "just-scripts jest -u"
21
+ "start": "yarn storybook",
22
+ "storybook": "start-storybook",
23
+ "test": "jest",
24
+ "docs": "api-extractor run --config=config/api-extractor.local.json --local",
25
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-theme/src && yarn docs",
26
+ "type-check": "tsc -b tsconfig.json"
23
27
  },
24
28
  "devDependencies": {
25
- "@fluentui/eslint-plugin": "^1.1.1",
29
+ "@fluentui/eslint-plugin": "*",
26
30
  "@fluentui/scripts": "^1.0.0",
27
31
  "@types/react": "16.9.42",
28
32
  "@types/react-dom": "16.9.10",
@@ -30,7 +34,7 @@
30
34
  "react-dom": "16.8.6"
31
35
  },
32
36
  "dependencies": {
33
- "tslib": "^1.10.0"
37
+ "tslib": "^2.1.0"
34
38
  },
35
39
  "peerDependencies": {
36
40
  "@types/react": ">=16.8.0 <18.0.0",
@@ -39,7 +43,6 @@
39
43
  "react-dom": ">=16.8.0 <18.0.0"
40
44
  },
41
45
  "beachball": {
42
- "tag": "alpha",
43
46
  "disallowedChangeTypes": [
44
47
  "major",
45
48
  "minor",
package/just.config.ts DELETED
@@ -1,3 +0,0 @@
1
- import { preset } from '@fluentui/scripts';
2
-
3
- preset();
@@ -1,23 +0,0 @@
1
- import { BrandVariants } from '../types';
2
- export declare const createGlobalTheme: (brand: BrandVariants) => {
3
- color: {
4
- black: string;
5
- white: string;
6
- hyperlink: string;
7
- disabled: string;
8
- selected: string;
9
- };
10
- palette: import("../types").GlobalSharedColors & {
11
- brand: BrandVariants;
12
- grey: Record<import("../types").Greys, string>;
13
- };
14
- type: {
15
- fontSizes: import("../types").FontSizes;
16
- fontWeights: import("../types").FontWeights;
17
- fontFamilies: import("../types").FontFamilies;
18
- lineHeights: import("../types").FontSizes;
19
- alignment: import("../types").TextAlignments;
20
- };
21
- borderRadius: import("../types").BorderRadius;
22
- strokeWidth: import("../types").StrokeWidths;
23
- };
@@ -1,27 +0,0 @@
1
- import { __assign } from "tslib";
2
- import { borderRadius } from './borderRadius';
3
- import { sharedColors, black, white, hyperlink, selected, disabled, grey } from './colors';
4
- import { textAlignments, fontFamilies, fontWeights, fontSizes, lineHeights } from './fonts';
5
- import { strokeWidths } from './strokeWidths';
6
- export var createGlobalTheme = function (brand) {
7
- return {
8
- color: {
9
- black: black,
10
- white: white,
11
- hyperlink: hyperlink,
12
- selected: selected,
13
- disabled: disabled,
14
- },
15
- palette: __assign(__assign({}, sharedColors), { brand: brand, grey: grey }),
16
- type: {
17
- alignment: textAlignments,
18
- fontFamilies: fontFamilies,
19
- fontSizes: fontSizes,
20
- fontWeights: fontWeights,
21
- lineHeights: lineHeights,
22
- },
23
- borderRadius: borderRadius,
24
- strokeWidth: strokeWidths,
25
- };
26
- };
27
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"../src/","sources":["global/utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,KAAoB;IACpD,OAAO;QACL,KAAK,EAAE;YACL,KAAK,OAAA;YACL,KAAK,OAAA;YACL,SAAS,WAAA;YACT,QAAQ,UAAA;YACR,QAAQ,UAAA;SACT;QACD,OAAO,wBACF,YAAY,KACf,KAAK,EAAE,KAAK,EACZ,IAAI,MAAA,GACL;QACD,IAAI,EAAE;YACJ,SAAS,EAAE,cAAc;YACzB,YAAY,EAAE,YAAY;YAC1B,SAAS,EAAE,SAAS;YACpB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,WAAW;SACzB;QACD,YAAY,EAAE,YAAY;QAC1B,WAAW,EAAE,YAAY;KAC1B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { borderRadius } from './borderRadius';\nimport { sharedColors, black, white, hyperlink, selected, disabled, grey } from './colors';\nimport { textAlignments, fontFamilies, fontWeights, fontSizes, lineHeights } from './fonts';\nimport { strokeWidths } from './strokeWidths';\nimport { Theme, BrandVariants } from '../types';\n\nexport const createGlobalTheme = (brand: BrandVariants): Theme['global'] => {\n return {\n color: {\n black,\n white,\n hyperlink,\n selected,\n disabled,\n },\n palette: {\n ...sharedColors,\n brand: brand,\n grey,\n },\n type: {\n alignment: textAlignments,\n fontFamilies: fontFamilies,\n fontSizes: fontSizes,\n fontWeights: fontWeights,\n lineHeights: lineHeights,\n },\n borderRadius: borderRadius,\n strokeWidth: strokeWidths,\n };\n};\n"]}
@@ -1,22 +0,0 @@
1
- export declare const globalTheme: {
2
- color: {
3
- black: string;
4
- white: string;
5
- hyperlink: string;
6
- disabled: string;
7
- selected: string;
8
- };
9
- palette: import("../..").GlobalSharedColors & {
10
- brand: import("../..").BrandVariants;
11
- grey: Record<import("../..").Greys, string>;
12
- };
13
- type: {
14
- fontSizes: import("../..").FontSizes;
15
- fontWeights: import("../..").FontWeights;
16
- fontFamilies: import("../..").FontFamilies;
17
- lineHeights: import("../..").FontSizes;
18
- alignment: import("../..").TextAlignments;
19
- };
20
- borderRadius: import("../..").BorderRadius;
21
- strokeWidth: import("../..").StrokeWidths;
22
- };
@@ -1,3 +0,0 @@
1
- import { brandColors, createGlobalTheme } from '../../global/index';
2
- export var globalTheme = createGlobalTheme(brandColors.teams);
3
- //# sourceMappingURL=globalTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"globalTheme.js","sourceRoot":"../src/","sources":["themes/teams/globalTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,CAAC,IAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC","sourcesContent":["import { brandColors, createGlobalTheme } from '../../global/index';\n\nexport const globalTheme = createGlobalTheme(brandColors.teams);\n"]}
@@ -1,22 +0,0 @@
1
- export declare const globalTheme: {
2
- color: {
3
- black: string;
4
- white: string;
5
- hyperlink: string;
6
- disabled: string;
7
- selected: string;
8
- };
9
- palette: import("../..").GlobalSharedColors & {
10
- brand: import("../..").BrandVariants;
11
- grey: Record<import("../..").Greys, string>;
12
- };
13
- type: {
14
- fontSizes: import("../..").FontSizes;
15
- fontWeights: import("../..").FontWeights;
16
- fontFamilies: import("../..").FontFamilies;
17
- lineHeights: import("../..").FontSizes;
18
- alignment: import("../..").TextAlignments;
19
- };
20
- borderRadius: import("../..").BorderRadius;
21
- strokeWidth: import("../..").StrokeWidths;
22
- };
@@ -1,3 +0,0 @@
1
- import { brandColors, createGlobalTheme } from '../../global/index';
2
- export var globalTheme = createGlobalTheme(brandColors.web);
3
- //# sourceMappingURL=globalTheme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"globalTheme.js","sourceRoot":"../src/","sources":["themes/web/globalTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,CAAC,IAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import { brandColors, createGlobalTheme } from '../../global/index';\n\nexport const globalTheme = createGlobalTheme(brandColors.web);\n"]}
@@ -1,8 +0,0 @@
1
- import { NeutralColorTokens, ColorVariants, SharedColorTokens, GlobalSharedColors, BackgroundColorTokens, BrandVariants, BrandColorTokens } from '../../types';
2
- export declare const subtleColorTokens: BackgroundColorTokens;
3
- export declare const transparentColorTokens: BackgroundColorTokens;
4
- export declare function createBrandColorTokens(brand: BrandVariants): BrandColorTokens;
5
- export declare function createNeutralColorTokens(brand: ColorVariants, customValues?: {
6
- [P in keyof NeutralColorTokens]?: string;
7
- }): NeutralColorTokens;
8
- export declare const sharedColorTokens: Record<keyof GlobalSharedColors, SharedColorTokens>;