@chipmobilesdk/rn-theme 1.2.0 → 1.3.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.
Files changed (257) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +3 -1
  3. package/lib/commonjs/color/categorical.js +35 -0
  4. package/lib/commonjs/color/categorical.js.map +1 -0
  5. package/lib/commonjs/color/contrast.js +199 -0
  6. package/lib/commonjs/color/contrast.js.map +1 -0
  7. package/lib/commonjs/color/parse.js +110 -0
  8. package/lib/commonjs/color/parse.js.map +1 -0
  9. package/lib/commonjs/color/roles.js +235 -0
  10. package/lib/commonjs/color/roles.js.map +1 -0
  11. package/lib/commonjs/index.js +94 -0
  12. package/lib/commonjs/index.js.map +1 -0
  13. package/lib/commonjs/integration/navigationTheme.js +43 -0
  14. package/lib/commonjs/integration/navigationTheme.js.map +1 -0
  15. package/lib/commonjs/package.json +1 -0
  16. package/lib/commonjs/presets/byTone.js +28 -0
  17. package/lib/commonjs/presets/byTone.js.map +1 -0
  18. package/lib/commonjs/presets/layout.js +67 -0
  19. package/lib/commonjs/presets/layout.js.map +1 -0
  20. package/lib/commonjs/presets/themePresets.js +115 -0
  21. package/lib/commonjs/presets/themePresets.js.map +1 -0
  22. package/lib/commonjs/theme/buildThemes.js +211 -0
  23. package/lib/commonjs/theme/buildThemes.js.map +1 -0
  24. package/lib/commonjs/theme/errors.js +49 -0
  25. package/lib/commonjs/theme/errors.js.map +1 -0
  26. package/lib/commonjs/theme/overrides.js +125 -0
  27. package/lib/commonjs/theme/overrides.js.map +1 -0
  28. package/lib/commonjs/theme/validateThemeConfig.js +157 -0
  29. package/lib/commonjs/theme/validateThemeConfig.js.map +1 -0
  30. package/lib/commonjs/tokens/defaults.js +132 -0
  31. package/lib/commonjs/tokens/defaults.js.map +1 -0
  32. package/lib/commonjs/tokens/typography.js +136 -0
  33. package/lib/commonjs/tokens/typography.js.map +1 -0
  34. package/lib/commonjs/types/brand.js +2 -0
  35. package/lib/commonjs/types/brand.js.map +1 -0
  36. package/lib/commonjs/types/colors.js +2 -0
  37. package/lib/commonjs/types/colors.js.map +1 -0
  38. package/lib/commonjs/types/index.js +2 -0
  39. package/lib/commonjs/types/index.js.map +1 -0
  40. package/lib/commonjs/types/theme.js +6 -0
  41. package/lib/commonjs/types/theme.js.map +1 -0
  42. package/lib/commonjs/types/tokens.js +2 -0
  43. package/lib/commonjs/types/tokens.js.map +1 -0
  44. package/lib/commonjs/types/typography.js +2 -0
  45. package/lib/commonjs/types/typography.js.map +1 -0
  46. package/lib/commonjs/unistyles/createUnistylesConfig.js +113 -0
  47. package/lib/commonjs/unistyles/createUnistylesConfig.js.map +1 -0
  48. package/lib/commonjs/unistyles/themeMode.js +39 -0
  49. package/lib/commonjs/unistyles/themeMode.js.map +1 -0
  50. package/lib/commonjs/vendor/mcu/LICENSE +191 -0
  51. package/lib/commonjs/vendor/mcu/hct/cam16.js +362 -0
  52. package/lib/commonjs/vendor/mcu/hct/cam16.js.map +1 -0
  53. package/lib/commonjs/vendor/mcu/hct/hct.js +183 -0
  54. package/lib/commonjs/vendor/mcu/hct/hct.js.map +1 -0
  55. package/lib/commonjs/vendor/mcu/hct/hct_solver.js +401 -0
  56. package/lib/commonjs/vendor/mcu/hct/hct_solver.js.map +1 -0
  57. package/lib/commonjs/vendor/mcu/hct/viewing_conditions.js +116 -0
  58. package/lib/commonjs/vendor/mcu/hct/viewing_conditions.js.map +1 -0
  59. package/lib/commonjs/vendor/mcu/index.js +27 -0
  60. package/lib/commonjs/vendor/mcu/index.js.map +1 -0
  61. package/lib/commonjs/vendor/mcu/palettes/tonal_palette.js +177 -0
  62. package/lib/commonjs/vendor/mcu/palettes/tonal_palette.js.map +1 -0
  63. package/lib/commonjs/vendor/mcu/utils/color_utils.js +298 -0
  64. package/lib/commonjs/vendor/mcu/utils/color_utils.js.map +1 -0
  65. package/lib/commonjs/vendor/mcu/utils/math_utils.js +158 -0
  66. package/lib/commonjs/vendor/mcu/utils/math_utils.js.map +1 -0
  67. package/lib/module/color/categorical.js +31 -0
  68. package/lib/module/color/categorical.js.map +1 -0
  69. package/lib/module/color/contrast.js +194 -0
  70. package/lib/module/color/contrast.js.map +1 -0
  71. package/lib/module/color/parse.js +101 -0
  72. package/lib/module/color/parse.js.map +1 -0
  73. package/lib/module/color/roles.js +229 -0
  74. package/lib/module/color/roles.js.map +1 -0
  75. package/lib/module/index.js +23 -0
  76. package/lib/module/index.js.map +1 -0
  77. package/lib/module/integration/navigationTheme.js +39 -0
  78. package/lib/module/integration/navigationTheme.js.map +1 -0
  79. package/lib/module/package.json +1 -0
  80. package/lib/module/presets/byTone.js +24 -0
  81. package/lib/module/presets/byTone.js.map +1 -0
  82. package/lib/module/presets/layout.js +63 -0
  83. package/lib/module/presets/layout.js.map +1 -0
  84. package/lib/module/presets/themePresets.js +110 -0
  85. package/lib/module/presets/themePresets.js.map +1 -0
  86. package/lib/module/theme/buildThemes.js +208 -0
  87. package/lib/module/theme/buildThemes.js.map +1 -0
  88. package/lib/module/theme/errors.js +43 -0
  89. package/lib/module/theme/errors.js.map +1 -0
  90. package/lib/module/theme/overrides.js +119 -0
  91. package/lib/module/theme/overrides.js.map +1 -0
  92. package/lib/module/theme/validateThemeConfig.js +152 -0
  93. package/lib/module/theme/validateThemeConfig.js.map +1 -0
  94. package/lib/module/tokens/defaults.js +120 -0
  95. package/lib/module/tokens/defaults.js.map +1 -0
  96. package/lib/module/tokens/typography.js +129 -0
  97. package/lib/module/tokens/typography.js.map +1 -0
  98. package/lib/module/types/brand.js +2 -0
  99. package/lib/module/types/brand.js.map +1 -0
  100. package/lib/module/types/colors.js +2 -0
  101. package/lib/module/types/colors.js.map +1 -0
  102. package/lib/module/types/index.js +2 -0
  103. package/lib/module/types/index.js.map +1 -0
  104. package/lib/module/types/theme.js +4 -0
  105. package/lib/module/types/theme.js.map +1 -0
  106. package/lib/module/types/tokens.js +2 -0
  107. package/lib/module/types/tokens.js.map +1 -0
  108. package/lib/module/types/typography.js +2 -0
  109. package/lib/module/types/typography.js.map +1 -0
  110. package/lib/module/unistyles/createUnistylesConfig.js +109 -0
  111. package/lib/module/unistyles/createUnistylesConfig.js.map +1 -0
  112. package/lib/module/unistyles/themeMode.js +36 -0
  113. package/lib/module/unistyles/themeMode.js.map +1 -0
  114. package/lib/module/vendor/mcu/LICENSE +191 -0
  115. package/lib/module/vendor/mcu/hct/cam16.js +356 -0
  116. package/lib/module/vendor/mcu/hct/cam16.js.map +1 -0
  117. package/lib/module/vendor/mcu/hct/hct.js +178 -0
  118. package/lib/module/vendor/mcu/hct/hct.js.map +1 -0
  119. package/lib/module/vendor/mcu/hct/hct_solver.js +396 -0
  120. package/lib/module/vendor/mcu/hct/hct_solver.js.map +1 -0
  121. package/lib/module/vendor/mcu/hct/viewing_conditions.js +110 -0
  122. package/lib/module/vendor/mcu/hct/viewing_conditions.js.map +1 -0
  123. package/lib/module/vendor/mcu/index.js +8 -0
  124. package/lib/module/vendor/mcu/index.js.map +1 -0
  125. package/lib/module/vendor/mcu/palettes/tonal_palette.js +172 -0
  126. package/lib/module/vendor/mcu/palettes/tonal_palette.js.map +1 -0
  127. package/lib/module/vendor/mcu/utils/color_utils.js +277 -0
  128. package/lib/module/vendor/mcu/utils/color_utils.js.map +1 -0
  129. package/lib/module/vendor/mcu/utils/math_utils.js +146 -0
  130. package/lib/module/vendor/mcu/utils/math_utils.js.map +1 -0
  131. package/lib/typescript/commonjs/color/categorical.d.ts +7 -0
  132. package/lib/typescript/commonjs/color/categorical.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/color/contrast.d.ts +26 -0
  134. package/lib/typescript/commonjs/color/contrast.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/color/parse.d.ts +25 -0
  136. package/lib/typescript/commonjs/color/parse.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/color/roles.d.ts +26 -0
  138. package/lib/typescript/commonjs/color/roles.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/index.d.ts +18 -0
  140. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/integration/navigationTheme.d.ts +30 -0
  142. package/lib/typescript/commonjs/integration/navigationTheme.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/package.json +1 -0
  144. package/lib/typescript/commonjs/presets/byTone.d.ts +19 -0
  145. package/lib/typescript/commonjs/presets/byTone.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/presets/layout.d.ts +63 -0
  147. package/lib/typescript/commonjs/presets/layout.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/presets/themePresets.d.ts +11 -0
  149. package/lib/typescript/commonjs/presets/themePresets.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/theme/buildThemes.d.ts +18 -0
  151. package/lib/typescript/commonjs/theme/buildThemes.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/theme/errors.d.ts +23 -0
  153. package/lib/typescript/commonjs/theme/errors.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/theme/overrides.d.ts +11 -0
  155. package/lib/typescript/commonjs/theme/overrides.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/theme/validateThemeConfig.d.ts +6 -0
  157. package/lib/typescript/commonjs/theme/validateThemeConfig.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/tokens/defaults.d.ts +23 -0
  159. package/lib/typescript/commonjs/tokens/defaults.d.ts.map +1 -0
  160. package/lib/typescript/commonjs/tokens/typography.d.ts +14 -0
  161. package/lib/typescript/commonjs/tokens/typography.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/types/brand.d.ts +21 -0
  163. package/lib/typescript/commonjs/types/brand.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/types/colors.d.ts +76 -0
  165. package/lib/typescript/commonjs/types/colors.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/types/index.d.ts +6 -0
  167. package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/types/theme.d.ts +140 -0
  169. package/lib/typescript/commonjs/types/theme.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/types/tokens.d.ts +79 -0
  171. package/lib/typescript/commonjs/types/tokens.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/types/typography.d.ts +53 -0
  173. package/lib/typescript/commonjs/types/typography.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/unistyles/createUnistylesConfig.d.ts +52 -0
  175. package/lib/typescript/commonjs/unistyles/createUnistylesConfig.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/unistyles/themeMode.d.ts +13 -0
  177. package/lib/typescript/commonjs/unistyles/themeMode.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/vendor/mcu/hct/cam16.d.ts +132 -0
  179. package/lib/typescript/commonjs/vendor/mcu/hct/cam16.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/vendor/mcu/hct/hct.d.ts +93 -0
  181. package/lib/typescript/commonjs/vendor/mcu/hct/hct.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/vendor/mcu/hct/hct_solver.d.ts +147 -0
  183. package/lib/typescript/commonjs/vendor/mcu/hct/hct_solver.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/vendor/mcu/hct/viewing_conditions.d.ts +75 -0
  185. package/lib/typescript/commonjs/vendor/mcu/hct/viewing_conditions.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/vendor/mcu/index.d.ts +4 -0
  187. package/lib/typescript/commonjs/vendor/mcu/index.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/vendor/mcu/palettes/tonal_palette.d.ts +56 -0
  189. package/lib/typescript/commonjs/vendor/mcu/palettes/tonal_palette.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/vendor/mcu/utils/color_utils.d.ts +129 -0
  191. package/lib/typescript/commonjs/vendor/mcu/utils/color_utils.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/vendor/mcu/utils/math_utils.d.ts +83 -0
  193. package/lib/typescript/commonjs/vendor/mcu/utils/math_utils.d.ts.map +1 -0
  194. package/lib/typescript/module/color/categorical.d.ts +7 -0
  195. package/lib/typescript/module/color/categorical.d.ts.map +1 -0
  196. package/lib/typescript/module/color/contrast.d.ts +26 -0
  197. package/lib/typescript/module/color/contrast.d.ts.map +1 -0
  198. package/lib/typescript/module/color/parse.d.ts +25 -0
  199. package/lib/typescript/module/color/parse.d.ts.map +1 -0
  200. package/lib/typescript/module/color/roles.d.ts +26 -0
  201. package/lib/typescript/module/color/roles.d.ts.map +1 -0
  202. package/lib/typescript/module/index.d.ts +18 -0
  203. package/lib/typescript/module/index.d.ts.map +1 -0
  204. package/lib/typescript/module/integration/navigationTheme.d.ts +30 -0
  205. package/lib/typescript/module/integration/navigationTheme.d.ts.map +1 -0
  206. package/lib/typescript/module/package.json +1 -0
  207. package/lib/typescript/module/presets/byTone.d.ts +19 -0
  208. package/lib/typescript/module/presets/byTone.d.ts.map +1 -0
  209. package/lib/typescript/module/presets/layout.d.ts +63 -0
  210. package/lib/typescript/module/presets/layout.d.ts.map +1 -0
  211. package/lib/typescript/module/presets/themePresets.d.ts +11 -0
  212. package/lib/typescript/module/presets/themePresets.d.ts.map +1 -0
  213. package/lib/typescript/module/theme/buildThemes.d.ts +18 -0
  214. package/lib/typescript/module/theme/buildThemes.d.ts.map +1 -0
  215. package/lib/typescript/module/theme/errors.d.ts +23 -0
  216. package/lib/typescript/module/theme/errors.d.ts.map +1 -0
  217. package/lib/typescript/module/theme/overrides.d.ts +11 -0
  218. package/lib/typescript/module/theme/overrides.d.ts.map +1 -0
  219. package/lib/typescript/module/theme/validateThemeConfig.d.ts +6 -0
  220. package/lib/typescript/module/theme/validateThemeConfig.d.ts.map +1 -0
  221. package/lib/typescript/module/tokens/defaults.d.ts +23 -0
  222. package/lib/typescript/module/tokens/defaults.d.ts.map +1 -0
  223. package/lib/typescript/module/tokens/typography.d.ts +14 -0
  224. package/lib/typescript/module/tokens/typography.d.ts.map +1 -0
  225. package/lib/typescript/module/types/brand.d.ts +21 -0
  226. package/lib/typescript/module/types/brand.d.ts.map +1 -0
  227. package/lib/typescript/module/types/colors.d.ts +76 -0
  228. package/lib/typescript/module/types/colors.d.ts.map +1 -0
  229. package/lib/typescript/module/types/index.d.ts +6 -0
  230. package/lib/typescript/module/types/index.d.ts.map +1 -0
  231. package/lib/typescript/module/types/theme.d.ts +140 -0
  232. package/lib/typescript/module/types/theme.d.ts.map +1 -0
  233. package/lib/typescript/module/types/tokens.d.ts +79 -0
  234. package/lib/typescript/module/types/tokens.d.ts.map +1 -0
  235. package/lib/typescript/module/types/typography.d.ts +53 -0
  236. package/lib/typescript/module/types/typography.d.ts.map +1 -0
  237. package/lib/typescript/module/unistyles/createUnistylesConfig.d.ts +52 -0
  238. package/lib/typescript/module/unistyles/createUnistylesConfig.d.ts.map +1 -0
  239. package/lib/typescript/module/unistyles/themeMode.d.ts +13 -0
  240. package/lib/typescript/module/unistyles/themeMode.d.ts.map +1 -0
  241. package/lib/typescript/module/vendor/mcu/hct/cam16.d.ts +132 -0
  242. package/lib/typescript/module/vendor/mcu/hct/cam16.d.ts.map +1 -0
  243. package/lib/typescript/module/vendor/mcu/hct/hct.d.ts +93 -0
  244. package/lib/typescript/module/vendor/mcu/hct/hct.d.ts.map +1 -0
  245. package/lib/typescript/module/vendor/mcu/hct/hct_solver.d.ts +147 -0
  246. package/lib/typescript/module/vendor/mcu/hct/hct_solver.d.ts.map +1 -0
  247. package/lib/typescript/module/vendor/mcu/hct/viewing_conditions.d.ts +75 -0
  248. package/lib/typescript/module/vendor/mcu/hct/viewing_conditions.d.ts.map +1 -0
  249. package/lib/typescript/module/vendor/mcu/index.d.ts +4 -0
  250. package/lib/typescript/module/vendor/mcu/index.d.ts.map +1 -0
  251. package/lib/typescript/module/vendor/mcu/palettes/tonal_palette.d.ts +56 -0
  252. package/lib/typescript/module/vendor/mcu/palettes/tonal_palette.d.ts.map +1 -0
  253. package/lib/typescript/module/vendor/mcu/utils/color_utils.d.ts +129 -0
  254. package/lib/typescript/module/vendor/mcu/utils/color_utils.d.ts.map +1 -0
  255. package/lib/typescript/module/vendor/mcu/utils/math_utils.d.ts +83 -0
  256. package/lib/typescript/module/vendor/mcu/utils/math_utils.d.ts.map +1 -0
  257. package/package.json +40 -16
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @license
5
+ * Copyright 2021 Google LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+
20
+ // Vendored from material-foundation/material-color-utilities v0.4.0
21
+ // (commit dd62982dfdefdfc9232ce8d76e122fb1c6d188ae, typescript/). Modified:
22
+ // relative import specifiers drop the `.js` suffix so Metro and Jest resolve them.
23
+ // This file is automatically generated. Do not modify it.
24
+
25
+ /**
26
+ * Utility methods for mathematical operations.
27
+ */
28
+
29
+ /**
30
+ * The signum function.
31
+ *
32
+ * @return 1 if num > 0, -1 if num < 0, and 0 if num = 0
33
+ */
34
+ export function signum(num) {
35
+ if (num < 0) {
36
+ return -1;
37
+ } else if (num === 0) {
38
+ return 0;
39
+ } else {
40
+ return 1;
41
+ }
42
+ }
43
+
44
+ /**
45
+ * The linear interpolation function.
46
+ *
47
+ * @return start if amount = 0 and stop if amount = 1
48
+ */
49
+ export function lerp(start, stop, amount) {
50
+ return (1.0 - amount) * start + amount * stop;
51
+ }
52
+
53
+ /**
54
+ * Clamps an integer between two integers.
55
+ *
56
+ * @return input when min <= input <= max, and either min or max
57
+ * otherwise.
58
+ */
59
+ export function clampInt(min, max, input) {
60
+ if (input < min) {
61
+ return min;
62
+ } else if (input > max) {
63
+ return max;
64
+ }
65
+ return input;
66
+ }
67
+
68
+ /**
69
+ * Clamps an integer between two floating-point numbers.
70
+ *
71
+ * @return input when min <= input <= max, and either min or max
72
+ * otherwise.
73
+ */
74
+ export function clampDouble(min, max, input) {
75
+ if (input < min) {
76
+ return min;
77
+ } else if (input > max) {
78
+ return max;
79
+ }
80
+ return input;
81
+ }
82
+
83
+ /**
84
+ * Sanitizes a degree measure as an integer.
85
+ *
86
+ * @return a degree measure between 0 (inclusive) and 360
87
+ * (exclusive).
88
+ */
89
+ export function sanitizeDegreesInt(degrees) {
90
+ degrees = degrees % 360;
91
+ if (degrees < 0) {
92
+ degrees = degrees + 360;
93
+ }
94
+ return degrees;
95
+ }
96
+
97
+ /**
98
+ * Sanitizes a degree measure as a floating-point number.
99
+ *
100
+ * @return a degree measure between 0.0 (inclusive) and 360.0
101
+ * (exclusive).
102
+ */
103
+ export function sanitizeDegreesDouble(degrees) {
104
+ degrees = degrees % 360.0;
105
+ if (degrees < 0) {
106
+ degrees = degrees + 360.0;
107
+ }
108
+ return degrees;
109
+ }
110
+
111
+ /**
112
+ * Sign of direction change needed to travel from one angle to
113
+ * another.
114
+ *
115
+ * For angles that are 180 degrees apart from each other, both
116
+ * directions have the same travel distance, so either direction is
117
+ * shortest. The value 1.0 is returned in this case.
118
+ *
119
+ * @param from The angle travel starts from, in degrees.
120
+ * @param to The angle travel ends at, in degrees.
121
+ * @return -1 if decreasing from leads to the shortest travel
122
+ * distance, 1 if increasing from leads to the shortest travel
123
+ * distance.
124
+ */
125
+ export function rotationDirection(from, to) {
126
+ const increasingDifference = sanitizeDegreesDouble(to - from);
127
+ return increasingDifference <= 180.0 ? 1.0 : -1.0;
128
+ }
129
+
130
+ /**
131
+ * Distance of two points on a circle, represented using degrees.
132
+ */
133
+ export function differenceDegrees(a, b) {
134
+ return 180.0 - Math.abs(Math.abs(a - b) - 180.0);
135
+ }
136
+
137
+ /**
138
+ * Multiplies a 1x3 row vector with a 3x3 matrix.
139
+ */
140
+ export function matrixMultiply(row, matrix) {
141
+ const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];
142
+ const b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];
143
+ const c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];
144
+ return [a, b, c];
145
+ }
146
+ //# sourceMappingURL=math_utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["signum","num","lerp","start","stop","amount","clampInt","min","max","input","clampDouble","sanitizeDegreesInt","degrees","sanitizeDegreesDouble","rotationDirection","from","to","increasingDifference","differenceDegrees","a","b","Math","abs","matrixMultiply","row","matrix","c"],"sourceRoot":"../../../../../src","sources":["vendor/mcu/utils/math_utils.ts"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import type { ColorScheme } from '../types/colors';
2
+ /**
3
+ * Categorical series colours for charts, starting at the primary hue
4
+ * (spec US-11). Status colours stay free for status.
5
+ */
6
+ export declare function buildCategorical(primary: string, scheme: ColorScheme): string[];
7
+ //# sourceMappingURL=categorical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorical.d.ts","sourceRoot":"","sources":["../../../../src/color/categorical.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAkBnD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAS/E"}
@@ -0,0 +1,26 @@
1
+ /** WCAG 2.x minimum ratio for text (1.4.3). */
2
+ export declare const TEXT_CONTRAST = 4.5;
3
+ /** WCAG 2.x minimum ratio for non-text boundaries (1.4.11). */
4
+ export declare const NON_TEXT_CONTRAST = 3;
5
+ export interface ContrastFailure {
6
+ /** Theme path of the foreground value, e.g. `color.onPrimary`. */
7
+ foreground: string;
8
+ /** Theme path of the background value, e.g. `color.primary`. */
9
+ background: string;
10
+ ratio: number;
11
+ target: number;
12
+ }
13
+ /**
14
+ * WCAG contrast ratio of two colour strings. Translucent colours are
15
+ * composited first: the background over `base` (default white), then the
16
+ * foreground over the result.
17
+ */
18
+ export declare function contrastRatio(foreground: string, background: string, base?: string): number;
19
+ /**
20
+ * Checks every contrast pair the package guarantees against the given theme
21
+ * and returns the ones below target. An empty list means the theme passes.
22
+ * `color.disabled` is never audited: inactive components are exempt from
23
+ * WCAG 1.4.3.
24
+ */
25
+ export declare function auditTheme(theme: object): ContrastFailure[];
26
+ //# sourceMappingURL=contrast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../../../src/color/contrast.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAKnC,MAAM,WAAW,eAAe;IAC/B,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AA+JD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAkB3F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,CAyB3D"}
@@ -0,0 +1,25 @@
1
+ /** A colour channel set: red/green/blue 0–255, alpha 0–1. */
2
+ export interface Rgba {
3
+ r: number;
4
+ g: number;
5
+ b: number;
6
+ a: number;
7
+ }
8
+ /**
9
+ * Parses the colour formats the package accepts: `#RGB`, `#RGBA`, `#RRGGBB`,
10
+ * `#RRGGBBAA`, `rgb(r, g, b)` and `rgba(r, g, b, a)`. Returns `null` for
11
+ * anything else, including named colours and `hsl()`.
12
+ */
13
+ export declare function parseColor(value: unknown): Rgba | null;
14
+ export declare function isValidColor(value: unknown): value is string;
15
+ export declare function isOpaqueColor(value: unknown): value is string;
16
+ /** ARGB integer of an opaque colour string; throws for anything else. */
17
+ export declare function argbFromColor(value: string): number;
18
+ export declare function hexFromArgb(argb: number): string;
19
+ export declare function formatColor({ r, g, b, a }: Rgba): string;
20
+ /**
21
+ * Applies an opacity to a colour, multiplying any alpha it already has.
22
+ * Returns `#RRGGBBAA` (or `#RRGGBB` when the result is opaque).
23
+ */
24
+ export declare function withAlpha(color: string, alpha: number): string;
25
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/color/parse.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,MAAM,WAAW,IAAI;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV;AAOD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CA0BtD;AAoBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE5D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE7D;AAED,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQnD;AAMD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKhD;AAED,wBAAgB,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,GAAG,MAAM,CAIxD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAY9D"}
@@ -0,0 +1,26 @@
1
+ import { TonalPalette } from '../vendor/mcu';
2
+ import type { BrandColors, SeedColors } from '../types/brand';
3
+ import type { AccentRoleName, ColorRoles, ColorScheme, StandardToneName, ToneColors } from '../types/colors';
4
+ /**
5
+ * 0.2.x light semantic colours, kept as default seeds so their hues carry over.
6
+ */
7
+ export declare const DEFAULT_SEEDS: Required<Omit<SeedColors, 'neutral'>>;
8
+ /** Material 3 opacities applied to `onSurface` and the scrim. */
9
+ /** The same figure as `opacity.disabledContent`, from its one definition (THM-07). */
10
+ export declare const DISABLED_CONTENT_OPACITY: number;
11
+ export interface PaletteInput {
12
+ brandColors: BrandColors;
13
+ seeds?: SeedColors;
14
+ tones?: Record<string, string>;
15
+ }
16
+ interface Palettes {
17
+ accent: Record<AccentRoleName, TonalPalette>;
18
+ neutral: TonalPalette;
19
+ neutralVariant: TonalPalette;
20
+ custom: Record<string, TonalPalette>;
21
+ }
22
+ export declare function buildPalettes(input: PaletteInput): Palettes;
23
+ export declare function buildColorRoles(palettes: Palettes, scheme: ColorScheme): ColorRoles;
24
+ export declare function buildTones<TTone extends string>(palettes: Palettes, color: ColorRoles, scheme: ColorScheme): Record<StandardToneName | TTone, ToneColors>;
25
+ export {};
26
+ //# sourceMappingURL=roles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../../src/color/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EACX,cAAc,EACd,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,iBAAiB,CAAC;AAIzB;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAK/D,CAAC;AASF,iEAAiE;AACjE,sFAAsF;AACtF,eAAO,MAAM,wBAAwB,QAAkC,CAAC;AAuDxE,MAAM,WAAW,YAAY;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,UAAU,QAAQ;IACjB,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC7C,OAAO,EAAE,YAAY,CAAC;IACtB,cAAc,EAAE,YAAY,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACrC;AAmCD,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,CAqB3D;AAMD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CA+DnF;AAeD,wBAAgB,UAAU,CAAC,KAAK,SAAS,MAAM,EAC9C,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,GACjB,MAAM,CAAC,gBAAgB,GAAG,KAAK,EAAE,UAAU,CAAC,CAsB9C"}
@@ -0,0 +1,18 @@
1
+ export { buildThemes } from './theme/buildThemes';
2
+ export type { BuildThemesOptions } from './theme/buildThemes';
3
+ export { ThemeConfigError, ThemeContrastError } from './theme/errors';
4
+ export type { ThemeErrorCode } from './theme/errors';
5
+ export { createUnistylesConfig } from './unistyles/createUnistylesConfig';
6
+ export type { UnistylesConfig, UnistylesConfigOptions } from './unistyles/createUnistylesConfig';
7
+ export { applyThemeMode } from './unistyles/themeMode';
8
+ export type { ThemeMode, ThemeModeRuntime } from './unistyles/themeMode';
9
+ export { DEFAULT_BREAKPOINTS } from './tokens/defaults';
10
+ export { auditTheme, contrastRatio } from './color/contrast';
11
+ export type { ContrastFailure } from './color/contrast';
12
+ export { withAlpha } from './color/parse';
13
+ export { layout, presets } from './presets/layout';
14
+ export { byTone } from './presets/byTone';
15
+ export { toNavigationTheme } from './integration/navigationTheme';
16
+ export type { NavigationTheme } from './integration/navigationTheme';
17
+ export type * from './types';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGrE,mBAAmB,SAAS,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { ColorRoles, ColorScheme } from '../types/colors';
2
+ import type { FontToken, FontWeightName } from '../types/typography';
3
+ /**
4
+ * The theme shape React Navigation expects, declared here so the package needs
5
+ * no navigation dependency (spec AC-9.3).
6
+ */
7
+ export interface NavigationTheme {
8
+ dark: boolean;
9
+ colors: {
10
+ primary: string;
11
+ background: string;
12
+ card: string;
13
+ text: string;
14
+ border: string;
15
+ notification: string;
16
+ };
17
+ fonts: {
18
+ regular: FontToken;
19
+ medium: FontToken;
20
+ bold: FontToken;
21
+ heavy: FontToken;
22
+ };
23
+ }
24
+ interface NavigationSource {
25
+ color: ColorRoles;
26
+ font: Record<FontWeightName, FontToken>;
27
+ }
28
+ export declare function toNavigationTheme(theme: NavigationSource, scheme: ColorScheme): NavigationTheme;
29
+ export {};
30
+ //# sourceMappingURL=navigationTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigationTheme.d.ts","sourceRoot":"","sources":["../../../../src/integration/navigationTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,KAAK,EAAE;QACN,OAAO,EAAE,SAAS,CAAC;QACnB,MAAM,EAAE,SAAS,CAAC;QAClB,IAAI,EAAE,SAAS,CAAC;QAChB,KAAK,EAAE,SAAS,CAAC;KACjB,CAAC;CACF;AAED,UAAU,gBAAgB;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;CACxC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,GAAG,eAAe,CAoB/F"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,19 @@
1
+ import type { ToneColors } from '../types/colors';
2
+ /**
3
+ * Builds a variant map with one entry per tone of the theme.
4
+ *
5
+ * Call it inline under a literal `variants` key, with the stylesheet's own
6
+ * `theme` argument:
7
+ *
8
+ * ```ts
9
+ * toneText: { variants: { tone: byTone(theme, t => ({ color: t.onContainer })) } },
10
+ * ```
11
+ *
12
+ * The Unistyles Babel plugin reads dependencies statically: a variants object
13
+ * built elsewhere, or a `theme` read through an alias, hides them and the
14
+ * style stops updating on theme or variant changes.
15
+ */
16
+ export declare function byTone<TTheme extends {
17
+ tone: Record<string, ToneColors>;
18
+ }, TStyle>(theme: TTheme, build: (tone: ToneColors, name: keyof TTheme['tone'] & string) => TStyle): Record<keyof TTheme['tone'] & string, TStyle>;
19
+ //# sourceMappingURL=byTone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byTone.d.ts","sourceRoot":"","sources":["../../../../src/presets/byTone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,MAAM,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CAAE,EAAE,MAAM,EACjF,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,KAAK,MAAM,GACtE,MAAM,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,CAQ/C"}
@@ -0,0 +1,63 @@
1
+ import type { TextStyle } from 'react-native';
2
+ /**
3
+ * Theme-independent flex presets. Spread them inside `StyleSheet.create` or
4
+ * put them in a style array; styles built only from these carry no theme
5
+ * dependency, so Unistyles never recalculates them on a theme change.
6
+ */
7
+ export declare const layout: {
8
+ readonly row: {
9
+ readonly flexDirection: "row";
10
+ };
11
+ readonly column: {
12
+ readonly flexDirection: "column";
13
+ };
14
+ readonly rowCenter: {
15
+ readonly flexDirection: "row";
16
+ readonly alignItems: "center";
17
+ };
18
+ readonly rowBetween: {
19
+ readonly flexDirection: "row";
20
+ readonly alignItems: "center";
21
+ readonly justifyContent: "space-between";
22
+ };
23
+ readonly center: {
24
+ readonly alignItems: "center";
25
+ readonly justifyContent: "center";
26
+ };
27
+ readonly fill: {
28
+ readonly flex: 1;
29
+ };
30
+ readonly wrap: {
31
+ readonly flexDirection: "row";
32
+ readonly flexWrap: "wrap";
33
+ };
34
+ readonly absoluteFill: {
35
+ readonly position: "absolute";
36
+ readonly top: 0;
37
+ readonly right: 0;
38
+ readonly bottom: 0;
39
+ readonly left: 0;
40
+ };
41
+ readonly selfStart: {
42
+ readonly alignSelf: "flex-start";
43
+ };
44
+ readonly selfCenter: {
45
+ readonly alignSelf: "center";
46
+ };
47
+ readonly selfEnd: {
48
+ readonly alignSelf: "flex-end";
49
+ };
50
+ };
51
+ interface TextPresetsStatic {
52
+ /**
53
+ * For a `Text` used as an icon: Android sizes text boxes from asymmetric
54
+ * font metrics, so a centred glyph sits high or low beside a label unless
55
+ * font padding is removed and the glyph centred in its box. iOS ignores both.
56
+ */
57
+ glyphAlign: Pick<TextStyle, 'includeFontPadding' | 'textAlignVertical'>;
58
+ /** Equal-width digits, so columns of times or amounts do not jitter. */
59
+ tabularNums: Pick<TextStyle, 'fontVariant'>;
60
+ }
61
+ export declare const presets: TextPresetsStatic;
62
+ export {};
63
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/presets/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAY2B,CAAC;AAE/C,UAAU,iBAAiB;IAC1B;;;;OAIG;IACH,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,oBAAoB,GAAG,mBAAmB,CAAC,CAAC;IACxE,wEAAwE;IACxE,WAAW,EAAE,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;CAC5C;AAID,eAAO,MAAM,OAAO,EAAE,iBAGrB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { BaseTheme } from '../types/theme';
2
+ type PresetKey = 'text' | 'stack' | 'inline' | 'border' | 'box';
3
+ type TokenSource = Omit<BaseTheme, PresetKey | 'tone'>;
4
+ export declare const PRESET_KEYS: readonly PresetKey[];
5
+ /**
6
+ * Token-reading presets, built from the theme's final (overridden) tokens so
7
+ * they follow every override — e.g. `radius.md = 0` reaches `box.outlined`.
8
+ */
9
+ export declare function buildPresets(tokens: TokenSource): Pick<BaseTheme, PresetKey>;
10
+ export {};
11
+ //# sourceMappingURL=themePresets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themePresets.d.ts","sourceRoot":"","sources":["../../../../src/presets/themePresets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,SAAS,EAOT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAChE,KAAK,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAAiD,CAAC;AAoE9F;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAY5E"}
@@ -0,0 +1,18 @@
1
+ import { type Platform } from '../tokens/typography';
2
+ import type { EmptyExtension, ThemeConfig, Themes } from '../types/theme';
3
+ export interface BuildThemesOptions {
4
+ /** Platform whose font resolution applies. Defaults to the running platform. */
5
+ platform?: Platform;
6
+ /**
7
+ * `borderWidth.hairline`. Defaults to React Native's `StyleSheet.hairlineWidth`,
8
+ * or 1 where React Native is not loaded, so `buildThemes` runs on Node (THM-04).
9
+ */
10
+ hairlineWidth?: number;
11
+ }
12
+ /**
13
+ * Builds every theme from brand config — pure, with no Unistyles dependency
14
+ * (spec AC-9.4). `createUnistylesConfig` wraps this; call it directly to feed
15
+ * tokens to other libraries or tests.
16
+ */
17
+ export declare function buildThemes<TExt extends object = EmptyExtension, TTone extends string = never, TName extends string = never>(config: ThemeConfig<TExt, TTone, TName>, options?: BuildThemesOptions): Themes<TExt, TTone, TName>;
18
+ //# sourceMappingURL=buildThemes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildThemes.d.ts","sourceRoot":"","sources":["../../../../src/theme/buildThemes.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAgD,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnG,OAAO,KAAK,EAEX,cAAc,EAEd,WAAW,EAEX,MAAM,EACN,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,kBAAkB;IAClC,gFAAgF;IAChF,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAyKD;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,IAAI,SAAS,MAAM,GAAG,cAAc,EACpC,KAAK,SAAS,MAAM,GAAG,KAAK,EAC5B,KAAK,SAAS,MAAM,GAAG,KAAK,EAE5B,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EACvC,OAAO,CAAC,EAAE,kBAAkB,GAC1B,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAkD5B"}
@@ -0,0 +1,23 @@
1
+ import { SdkError } from '@chipmobilesdk/rn-core';
2
+ import type { ContrastFailure } from '../color/contrast';
3
+ /**
4
+ * The package's error codes (THM-09): `invalid_config` for a config or override
5
+ * the package rejects, `contrast` for a theme that breaks a contrast guarantee.
6
+ */
7
+ export type ThemeErrorCode = 'invalid_config' | 'contrast';
8
+ /**
9
+ * Invalid configuration or override; `path` names the offending field. An
10
+ * `SdkError` (`@chipmobilesdk/rn-core`) with `pkg: 'rn-theme'`.
11
+ */
12
+ export declare class ThemeConfigError extends SdkError<ThemeErrorCode> {
13
+ readonly path: string;
14
+ constructor(path: string, message: string);
15
+ }
16
+ /** Thrown in `strict` mode when a theme breaks a contrast guarantee. */
17
+ export declare class ThemeContrastError extends SdkError<ThemeErrorCode> {
18
+ readonly themeName: string;
19
+ readonly failures: ContrastFailure[];
20
+ constructor(themeName: string, failures: ContrastFailure[]);
21
+ }
22
+ export declare function describeFailures(failures: ContrastFailure[]): string;
23
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/theme/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAE3D;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ,CAAC,cAAc,CAAC;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAKzC;AAED,wEAAwE;AACxE,qBAAa,kBAAmB,SAAQ,QAAQ,CAAC,cAAc,CAAC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC;gBAEzB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE;CAQ1D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,MAAM,CAOpE"}
@@ -0,0 +1,11 @@
1
+ type PlainObject = Record<string, unknown>;
2
+ export declare function isPlainObject(value: unknown): value is PlainObject;
3
+ /**
4
+ * Merges `overrides` into a fresh copy of `base`, validating as it goes:
5
+ * keys must exist in `base`, colours must parse, numbers must be finite.
6
+ * Arrays are replaced whole. `base` itself is never mutated.
7
+ */
8
+ export declare function mergeOverrides<T>(base: T, overrides: unknown, path: string, segments?: string[]): T;
9
+ export declare function pick(source: unknown, keys: readonly string[]): PlainObject | undefined;
10
+ export {};
11
+ //# sourceMappingURL=overrides.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overrides.d.ts","sourceRoot":"","sources":["../../../../src/theme/overrides.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AA2ED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC/B,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAAM,EAAO,GACrB,CAAC,CAsCH;AAED,wBAAgB,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,GAAG,SAAS,CActF"}
@@ -0,0 +1,6 @@
1
+ /** Validates the config shape; override values are validated while merging. */
2
+ export declare function validateThemeConfig(config: unknown): void;
3
+ export declare function themeNamesOf(config: {
4
+ themes?: object;
5
+ }): string[];
6
+ //# sourceMappingURL=validateThemeConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateThemeConfig.d.ts","sourceRoot":"","sources":["../../../../src/theme/validateThemeConfig.ts"],"names":[],"mappings":"AAoLA,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiBzD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAElE"}
@@ -0,0 +1,23 @@
1
+ import type { BorderWidthTokens, MotionTokens, OpacityTokens, RadiusTokens, ShadowTokens, SizeTokens, SpacingTokens, ZIndexTokens } from '../types/tokens';
2
+ export declare function buildSpacing(): SpacingTokens;
3
+ export declare function buildRadius(): RadiusTokens;
4
+ /** `hairline` is the device's thinnest line, resolved by `buildThemes` (THM-04). */
5
+ export declare function buildBorderWidth(hairline: number): BorderWidthTokens;
6
+ export declare function buildSize(): SizeTokens;
7
+ /**
8
+ * The opacity scale, as one definition. `color.disabled` is derived from
9
+ * `disabledContent` rather than from a second copy of 0.38 (THM-07).
10
+ */
11
+ export declare const DEFAULT_OPACITY: OpacityTokens;
12
+ export declare function buildOpacity(): OpacityTokens;
13
+ export declare function buildMotion(): MotionTokens;
14
+ export declare function buildZIndex(): ZIndexTokens;
15
+ export declare function buildShadows(shadowColor: string): ShadowTokens;
16
+ export declare const DEFAULT_MAX_FONT_SCALE = 2;
17
+ /** Material 3 window size classes, in points. */
18
+ export declare const DEFAULT_BREAKPOINTS: {
19
+ compact: number;
20
+ medium: number;
21
+ expanded: number;
22
+ };
23
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../src/tokens/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,aAAa,EACb,YAAY,EACZ,MAAM,iBAAiB,CAAC;AAKzB,wBAAgB,YAAY,IAAI,aAAa,CAe5C;AAED,wBAAgB,WAAW,IAAI,YAAY,CAE1C;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAEpE;AAED,wBAAgB,SAAS,IAAI,UAAU,CAEtC;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,aAO7B,CAAC;AAEF,wBAAgB,YAAY,IAAI,aAAa,CAE5C;AAED,wBAAgB,WAAW,IAAI,YAAY,CAU1C;AAED,wBAAgB,WAAW,IAAI,YAAY,CAE1C;AAkBD,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAe9D;AAED,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,iDAAiD;AACjD,eAAO,MAAM,mBAAmB;;;;CAA6C,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { FontToken, FontWeightName, FontWeights, Typography, TypographyConfig } from '../types/typography';
2
+ export type Platform = 'ios' | 'android';
3
+ export declare const FONT_WEIGHTS: FontWeights;
4
+ /**
5
+ * Resolves the family and weight a style needs for one named weight on one
6
+ * platform (spec US-2).
7
+ */
8
+ export declare function buildFonts(config: TypographyConfig | undefined, platform: Platform): {
9
+ family: string;
10
+ font: Record<FontWeightName, FontToken>;
11
+ };
12
+ export declare function buildTypography(config: TypographyConfig | undefined, font: Record<FontWeightName, FontToken>, family: string): Typography;
13
+ export declare function buildFontWeight(): FontWeights;
14
+ //# sourceMappingURL=typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../../src/tokens/typography.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,SAAS,EACT,cAAc,EACd,WAAW,EAEX,UAAU,EACV,gBAAgB,EAIhB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAKzC,eAAO,MAAM,YAAY,EAAE,WAM1B,CAAC;AAgDF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EAAE,QAAQ,EAAE,QAAQ;;;EAsClF;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,IAAI,EAAE,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,EACvC,MAAM,EAAE,MAAM,GACZ,UAAU,CAsBZ;AAED,wBAAgB,eAAe,IAAI,WAAW,CAE7C"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Opaque brand colours. Each keeps its hue and chroma; roles take fixed tones.
3
+ *
4
+ * Accepted colour strings everywhere in the package: `#RGB`, `#RGBA`,
5
+ * `#RRGGBB`, `#RRGGBBAA`, `rgb(r, g, b)`, `rgba(r, g, b, a)`.
6
+ */
7
+ export interface BrandColors {
8
+ primary: string;
9
+ secondary: string;
10
+ tertiary: string;
11
+ }
12
+ /** Optional opaque seeds replacing the default neutral and semantic hues. */
13
+ export interface SeedColors {
14
+ /** Without it, neutrals take the primary hue at a very low chroma. */
15
+ neutral?: string;
16
+ error?: string;
17
+ success?: string;
18
+ warning?: string;
19
+ info?: string;
20
+ }
21
+ //# sourceMappingURL=brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../../../src/types/brand.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IAC1B,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd"}