@multiplatform.one/theme 9.17.0 → 10.1.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 (1342) hide show
  1. package/dist/cjs/audit/constraintAudit.cjs +612 -510
  2. package/dist/cjs/audit/constraintAudit.native.cjs +978 -0
  3. package/dist/cjs/audit/constraintAudit.native.js +953 -887
  4. package/dist/cjs/audit/constraintAudit.native.js.map +1 -1
  5. package/dist/cjs/audit/designTokens.cjs +31 -35
  6. package/dist/cjs/audit/designTokens.native.cjs +70 -0
  7. package/dist/cjs/audit/designTokens.native.js +50 -58
  8. package/dist/cjs/audit/designTokens.native.js.map +1 -1
  9. package/dist/cjs/audit/diffReport.cjs +246 -236
  10. package/dist/cjs/audit/diffReport.native.cjs +502 -0
  11. package/dist/cjs/audit/diffReport.native.js +481 -496
  12. package/dist/cjs/audit/diffReport.native.js.map +1 -1
  13. package/dist/cjs/audit/index.cjs +25 -27
  14. package/dist/cjs/audit/index.native.cjs +41 -0
  15. package/dist/cjs/audit/index.native.js +25 -26
  16. package/dist/cjs/audit/index.native.js.map +1 -1
  17. package/dist/cjs/audit/themeMatrix.cjs +998 -886
  18. package/dist/cjs/audit/themeMatrix.native.cjs +1600 -0
  19. package/dist/cjs/audit/themeMatrix.native.js +1560 -1510
  20. package/dist/cjs/audit/themeMatrix.native.js.map +1 -1
  21. package/dist/cjs/dates.cjs +186 -224
  22. package/dist/cjs/dates.native.cjs +241 -0
  23. package/dist/cjs/dates.native.js +200 -246
  24. package/dist/cjs/dates.native.js.map +1 -1
  25. package/dist/cjs/devWarn.cjs +153 -129
  26. package/dist/cjs/devWarn.native.cjs +221 -0
  27. package/dist/cjs/devWarn.native.js +176 -153
  28. package/dist/cjs/devWarn.native.js.map +1 -1
  29. package/dist/cjs/expo.cjs +53 -66
  30. package/dist/cjs/expo.native.cjs +83 -0
  31. package/dist/cjs/expo.native.js +57 -69
  32. package/dist/cjs/expo.native.js.map +1 -1
  33. package/dist/cjs/figma/figmaTokens.cjs +317 -291
  34. package/dist/cjs/figma/figmaTokens.native.cjs +639 -0
  35. package/dist/cjs/figma/figmaTokens.native.js +577 -574
  36. package/dist/cjs/figma/figmaTokens.native.js.map +1 -1
  37. package/dist/cjs/font.cjs +27 -50
  38. package/dist/cjs/font.native.cjs +51 -0
  39. package/dist/cjs/font.native.js +34 -56
  40. package/dist/cjs/font.native.js.map +1 -1
  41. package/dist/cjs/fonts/createFontLoader.cjs +15 -21
  42. package/dist/cjs/fonts/createFontLoader.native.cjs +68 -0
  43. package/dist/cjs/fonts/createFontLoader.native.js +55 -55
  44. package/dist/cjs/fonts/createFontLoader.native.js.map +1 -1
  45. package/dist/cjs/fonts/index.cjs +9 -11
  46. package/dist/cjs/fonts/index.native.cjs +22 -0
  47. package/dist/cjs/fonts/index.native.js +9 -10
  48. package/dist/cjs/fonts/index.native.js.map +1 -1
  49. package/dist/cjs/fonts/interFaces.cjs +21 -23
  50. package/dist/cjs/fonts/interFaces.native.cjs +38 -0
  51. package/dist/cjs/fonts/interFaces.native.js +21 -22
  52. package/dist/cjs/fonts/interFaces.native.js.map +1 -1
  53. package/dist/cjs/fonts/types.cjs +9 -11
  54. package/dist/cjs/fonts/types.native.cjs +18 -0
  55. package/dist/cjs/fonts/types.native.js +9 -10
  56. package/dist/cjs/fonts/types.native.js.map +1 -1
  57. package/dist/cjs/index.cjs +16 -18
  58. package/dist/cjs/index.gnome.cjs +404 -398
  59. package/dist/cjs/index.gnome.native.cjs +465 -0
  60. package/dist/cjs/index.gnome.native.js +404 -397
  61. package/dist/cjs/index.gnome.native.js.map +1 -1
  62. package/dist/cjs/index.native.cjs +39 -0
  63. package/dist/cjs/index.native.js +16 -17
  64. package/dist/cjs/index.native.js.map +1 -1
  65. package/dist/cjs/keyboardFocusRing.cjs +61 -56
  66. package/dist/cjs/keyboardFocusRing.native.cjs +120 -0
  67. package/dist/cjs/keyboardFocusRing.native.js +63 -57
  68. package/dist/cjs/keyboardFocusRing.native.js.map +1 -1
  69. package/dist/cjs/menuRow.cjs +57 -55
  70. package/dist/cjs/menuRow.native.cjs +91 -0
  71. package/dist/cjs/menuRow.native.js +60 -57
  72. package/dist/cjs/menuRow.native.js.map +1 -1
  73. package/dist/cjs/nativeTwins.cjs +17 -19
  74. package/dist/cjs/nativeTwins.native.cjs +34 -0
  75. package/dist/cjs/nativeTwins.native.js +17 -18
  76. package/dist/cjs/nativeTwins.native.js.map +1 -1
  77. package/dist/cjs/numbers.cjs +138 -159
  78. package/dist/cjs/numbers.native.cjs +193 -0
  79. package/dist/cjs/numbers.native.js +153 -173
  80. package/dist/cjs/numbers.native.js.map +1 -1
  81. package/dist/cjs/theme/FontKnobStyles.cjs +129 -127
  82. package/dist/cjs/theme/FontKnobStyles.native.cjs +38 -0
  83. package/dist/cjs/theme/FontKnobStyles.native.js +19 -20
  84. package/dist/cjs/theme/FontKnobStyles.native.js.map +1 -1
  85. package/dist/cjs/theme/Heading.cjs +92 -148
  86. package/dist/cjs/theme/Heading.native.cjs +129 -0
  87. package/dist/cjs/theme/Heading.native.js +94 -149
  88. package/dist/cjs/theme/Heading.native.js.map +1 -1
  89. package/dist/cjs/theme/IconSlot.cjs +36 -54
  90. package/dist/cjs/theme/IconSlot.native.cjs +54 -0
  91. package/dist/cjs/theme/IconSlot.native.js +38 -60
  92. package/dist/cjs/theme/IconSlot.native.js.map +1 -1
  93. package/dist/cjs/theme/Intent.cjs +35 -43
  94. package/dist/cjs/theme/Intent.native.cjs +51 -0
  95. package/dist/cjs/theme/Intent.native.js +35 -42
  96. package/dist/cjs/theme/Intent.native.js.map +1 -1
  97. package/dist/cjs/theme/Preset.cjs +127 -130
  98. package/dist/cjs/theme/Preset.native.cjs +152 -0
  99. package/dist/cjs/theme/Preset.native.js +129 -131
  100. package/dist/cjs/theme/Preset.native.js.map +1 -1
  101. package/dist/cjs/theme/PresetContext.cjs +19 -21
  102. package/dist/cjs/theme/PresetContext.native.cjs +39 -0
  103. package/dist/cjs/theme/PresetContext.native.js +20 -21
  104. package/dist/cjs/theme/PresetContext.native.js.map +1 -1
  105. package/dist/cjs/theme/Surface.cjs +70 -78
  106. package/dist/cjs/theme/Surface.native.cjs +116 -0
  107. package/dist/cjs/theme/Surface.native.js +76 -84
  108. package/dist/cjs/theme/Surface.native.js.map +1 -1
  109. package/dist/cjs/theme/Text.cjs +105 -134
  110. package/dist/cjs/theme/Text.native.cjs +134 -0
  111. package/dist/cjs/theme/Text.native.js +105 -134
  112. package/dist/cjs/theme/Text.native.js.map +1 -1
  113. package/dist/cjs/theme/Tint.cjs +29 -36
  114. package/dist/cjs/theme/Tint.native.cjs +51 -0
  115. package/dist/cjs/theme/Tint.native.js +30 -36
  116. package/dist/cjs/theme/Tint.native.js.map +1 -1
  117. package/dist/cjs/theme/accentHue.cjs +54 -48
  118. package/dist/cjs/theme/accentHue.native.cjs +87 -0
  119. package/dist/cjs/theme/accentHue.native.js +62 -55
  120. package/dist/cjs/theme/accentHue.native.js.map +1 -1
  121. package/dist/cjs/theme/accentInk.cjs +113 -112
  122. package/dist/cjs/theme/accentInk.native.cjs +217 -0
  123. package/dist/cjs/theme/accentInk.native.js +182 -186
  124. package/dist/cjs/theme/accentInk.native.js.map +1 -1
  125. package/dist/cjs/theme/activateThemeConfig.cjs +20 -28
  126. package/dist/cjs/theme/activateThemeConfig.native.cjs +36 -0
  127. package/dist/cjs/theme/activateThemeConfig.native.js +20 -27
  128. package/dist/cjs/theme/activateThemeConfig.native.js.map +1 -1
  129. package/dist/cjs/theme/animations/css.cjs +19 -21
  130. package/dist/cjs/theme/animations/css.native.cjs +36 -0
  131. package/dist/cjs/theme/animations/css.native.js +20 -21
  132. package/dist/cjs/theme/animations/css.native.js.map +1 -1
  133. package/dist/cjs/theme/animations/index.cjs +9 -11
  134. package/dist/cjs/theme/animations/index.native.cjs +30 -0
  135. package/dist/cjs/theme/animations/index.native.js +19 -10
  136. package/dist/cjs/theme/animations/index.native.js.map +1 -1
  137. package/dist/cjs/theme/animations/reactNative.cjs +138 -143
  138. package/dist/cjs/theme/animations/reactNative.native.cjs +155 -0
  139. package/dist/cjs/theme/animations/reactNative.native.js +139 -143
  140. package/dist/cjs/theme/animations/reactNative.native.js.map +1 -1
  141. package/dist/cjs/theme/chartPalette.cjs +263 -209
  142. package/dist/cjs/theme/chartPalette.native.cjs +393 -0
  143. package/dist/cjs/theme/chartPalette.native.js +335 -285
  144. package/dist/cjs/theme/chartPalette.native.js.map +1 -1
  145. package/dist/cjs/theme/colorRules.cjs +276 -260
  146. package/dist/cjs/theme/colorRules.native.cjs +378 -0
  147. package/dist/cjs/theme/colorRules.native.js +308 -293
  148. package/dist/cjs/theme/colorRules.native.js.map +1 -1
  149. package/dist/cjs/theme/composeKnobs.cjs +176 -0
  150. package/dist/cjs/theme/composeKnobs.native.cjs +358 -0
  151. package/dist/cjs/theme/composeKnobs.native.js +360 -0
  152. package/dist/cjs/theme/composeKnobs.native.js.map +1 -0
  153. package/dist/cjs/theme/controlSizing.cjs +112 -0
  154. package/dist/cjs/theme/controlSizing.native.cjs +190 -0
  155. package/dist/cjs/theme/controlSizing.native.js +192 -0
  156. package/dist/cjs/theme/controlSizing.native.js.map +1 -0
  157. package/dist/cjs/theme/controlTiers.cjs +42 -44
  158. package/dist/cjs/theme/controlTiers.native.cjs +74 -0
  159. package/dist/cjs/theme/controlTiers.native.js +45 -46
  160. package/dist/cjs/theme/controlTiers.native.js.map +1 -1
  161. package/dist/cjs/theme/cookies.cjs +138 -137
  162. package/dist/cjs/theme/cookies.native.cjs +292 -0
  163. package/dist/cjs/theme/cookies.native.js +244 -259
  164. package/dist/cjs/theme/cookies.native.js.map +1 -1
  165. package/dist/cjs/theme/cornerSmoothing.cjs +69 -71
  166. package/dist/cjs/theme/cornerSmoothing.native.cjs +68 -0
  167. package/dist/cjs/theme/cornerSmoothing.native.js +34 -35
  168. package/dist/cjs/theme/cornerSmoothing.native.js.map +1 -1
  169. package/dist/cjs/theme/createDefaultThemeConfig.cjs +105 -109
  170. package/dist/cjs/theme/createDefaultThemeConfig.native.cjs +184 -0
  171. package/dist/cjs/theme/createDefaultThemeConfig.native.js +144 -151
  172. package/dist/cjs/theme/createDefaultThemeConfig.native.js.map +1 -1
  173. package/dist/cjs/theme/createThemes.cjs +1077 -997
  174. package/dist/cjs/theme/createThemes.native.cjs +1999 -0
  175. package/dist/cjs/theme/createThemes.native.js +1839 -1724
  176. package/dist/cjs/theme/createThemes.native.js.map +1 -1
  177. package/dist/cjs/theme/dedupeInherited.cjs +60 -62
  178. package/dist/cjs/theme/dedupeInherited.native.cjs +181 -0
  179. package/dist/cjs/theme/dedupeInherited.native.js +158 -169
  180. package/dist/cjs/theme/dedupeInherited.native.js.map +1 -1
  181. package/dist/cjs/theme/defaults/accent.cjs +17 -21
  182. package/dist/cjs/theme/defaults/accent.native.cjs +30 -0
  183. package/dist/cjs/theme/defaults/accent.native.js +17 -20
  184. package/dist/cjs/theme/defaults/accent.native.js.map +1 -1
  185. package/dist/cjs/theme/defaults/base.cjs +41 -45
  186. package/dist/cjs/theme/defaults/base.native.cjs +54 -0
  187. package/dist/cjs/theme/defaults/base.native.js +41 -44
  188. package/dist/cjs/theme/defaults/base.native.js.map +1 -1
  189. package/dist/cjs/theme/defaults/builderOptions.cjs +210 -190
  190. package/dist/cjs/theme/defaults/builderOptions.native.cjs +313 -0
  191. package/dist/cjs/theme/defaults/builderOptions.native.js +273 -259
  192. package/dist/cjs/theme/defaults/builderOptions.native.js.map +1 -1
  193. package/dist/cjs/theme/defaults/categoryFonts.cjs +34 -38
  194. package/dist/cjs/theme/defaults/categoryFonts.native.cjs +48 -0
  195. package/dist/cjs/theme/defaults/categoryFonts.native.js +34 -37
  196. package/dist/cjs/theme/defaults/categoryFonts.native.js.map +1 -1
  197. package/dist/cjs/theme/defaults/fonts.cjs +174 -206
  198. package/dist/cjs/theme/defaults/fonts.native.cjs +333 -0
  199. package/dist/cjs/theme/defaults/fonts.native.js +248 -293
  200. package/dist/cjs/theme/defaults/fonts.native.js.map +1 -1
  201. package/dist/cjs/theme/defaults/house.cjs +73 -23
  202. package/dist/cjs/theme/defaults/house.native.cjs +95 -0
  203. package/dist/cjs/theme/defaults/house.native.js +77 -26
  204. package/dist/cjs/theme/defaults/house.native.js.map +1 -1
  205. package/dist/cjs/theme/defaults/index.cjs +9 -11
  206. package/dist/cjs/theme/defaults/index.native.cjs +25 -0
  207. package/dist/cjs/theme/defaults/index.native.js +9 -10
  208. package/dist/cjs/theme/defaults/index.native.js.map +1 -1
  209. package/dist/cjs/theme/defaults/interFont.cjs +41 -0
  210. package/dist/cjs/theme/defaults/interFont.native.cjs +46 -0
  211. package/dist/cjs/theme/defaults/interFont.native.js +48 -0
  212. package/dist/cjs/theme/defaults/interFont.native.js.map +1 -0
  213. package/dist/cjs/theme/devtools/ColorLineVisualizer.cjs +176 -218
  214. package/dist/cjs/theme/devtools/ColorLineVisualizer.native.cjs +28 -0
  215. package/dist/cjs/theme/devtools/ColorLineVisualizer.native.js +15 -18
  216. package/dist/cjs/theme/devtools/ColorLineVisualizer.native.js.map +1 -1
  217. package/dist/cjs/theme/devtools/ThemeDevtoolsPanel.cjs +1303 -1271
  218. package/dist/cjs/theme/devtools/ThemeDevtoolsPanel.native.cjs +28 -0
  219. package/dist/cjs/theme/devtools/ThemeDevtoolsPanel.native.js +15 -18
  220. package/dist/cjs/theme/devtools/ThemeDevtoolsPanel.native.js.map +1 -1
  221. package/dist/cjs/theme/devtools/animationOptions.cjs +18 -22
  222. package/dist/cjs/theme/devtools/animationOptions.native.cjs +36 -0
  223. package/dist/cjs/theme/devtools/animationOptions.native.js +20 -28
  224. package/dist/cjs/theme/devtools/animationOptions.native.js.map +1 -1
  225. package/dist/cjs/theme/devtools/buildSnapshot.cjs +95 -80
  226. package/dist/cjs/theme/devtools/buildSnapshot.native.cjs +180 -0
  227. package/dist/cjs/theme/devtools/buildSnapshot.native.js +166 -158
  228. package/dist/cjs/theme/devtools/buildSnapshot.native.js.map +1 -1
  229. package/dist/cjs/theme/devtools/index.cjs +9 -11
  230. package/dist/cjs/theme/devtools/index.native.cjs +25 -0
  231. package/dist/cjs/theme/devtools/index.native.js +9 -10
  232. package/dist/cjs/theme/devtools/index.native.js.map +1 -1
  233. package/dist/cjs/theme/devtools/knobIcons.cjs +370 -441
  234. package/dist/cjs/theme/devtools/knobIcons.native.cjs +434 -0
  235. package/dist/cjs/theme/devtools/knobIcons.native.js +377 -447
  236. package/dist/cjs/theme/devtools/knobIcons.native.js.map +1 -1
  237. package/dist/cjs/theme/devtools/vizConstants.cjs +32 -34
  238. package/dist/cjs/theme/devtools/vizConstants.native.cjs +54 -0
  239. package/dist/cjs/theme/devtools/vizConstants.native.js +32 -33
  240. package/dist/cjs/theme/devtools/vizConstants.native.js.map +1 -1
  241. package/dist/cjs/theme/dynamicType.cjs +31 -33
  242. package/dist/cjs/theme/dynamicType.native.cjs +52 -0
  243. package/dist/cjs/theme/dynamicType.native.js +31 -32
  244. package/dist/cjs/theme/dynamicType.native.js.map +1 -1
  245. package/dist/cjs/theme/fieldFocus.cjs +44 -42
  246. package/dist/cjs/theme/fieldFocus.native.cjs +77 -0
  247. package/dist/cjs/theme/fieldFocus.native.js +48 -45
  248. package/dist/cjs/theme/fieldFocus.native.js.map +1 -1
  249. package/dist/cjs/theme/fillContrast.cjs +120 -108
  250. package/dist/cjs/theme/fillContrast.native.cjs +175 -0
  251. package/dist/cjs/theme/fillContrast.native.js +144 -133
  252. package/dist/cjs/theme/fillContrast.native.js.map +1 -1
  253. package/dist/cjs/theme/focusState.cjs +100 -87
  254. package/dist/cjs/theme/focusState.native.cjs +174 -0
  255. package/dist/cjs/theme/focusState.native.js +139 -86
  256. package/dist/cjs/theme/focusState.native.js.map +1 -1
  257. package/dist/cjs/theme/fontCategoryMetrics.cjs +71 -76
  258. package/dist/cjs/theme/fontCategoryMetrics.native.cjs +88 -0
  259. package/dist/cjs/theme/fontCategoryMetrics.native.js +71 -75
  260. package/dist/cjs/theme/fontCategoryMetrics.native.js.map +1 -1
  261. package/dist/cjs/theme/fontCategoryStacks.cjs +25 -29
  262. package/dist/cjs/theme/fontCategoryStacks.native.cjs +38 -0
  263. package/dist/cjs/theme/fontCategoryStacks.native.js +25 -28
  264. package/dist/cjs/theme/fontCategoryStacks.native.js.map +1 -1
  265. package/dist/cjs/theme/glyphPaint.cjs +37 -39
  266. package/dist/cjs/theme/glyphPaint.native.cjs +76 -0
  267. package/dist/cjs/theme/glyphPaint.native.js +58 -61
  268. package/dist/cjs/theme/glyphPaint.native.js.map +1 -1
  269. package/dist/cjs/theme/glyphTint.cjs +65 -61
  270. package/dist/cjs/theme/glyphTint.native.cjs +100 -0
  271. package/dist/cjs/theme/glyphTint.native.js +68 -62
  272. package/dist/cjs/theme/glyphTint.native.js.map +1 -1
  273. package/dist/cjs/theme/groupGeometry.cjs +44 -46
  274. package/dist/cjs/theme/groupGeometry.native.cjs +69 -0
  275. package/dist/cjs/theme/groupGeometry.native.js +46 -47
  276. package/dist/cjs/theme/groupGeometry.native.js.map +1 -1
  277. package/dist/cjs/theme/hairline.cjs +79 -85
  278. package/dist/cjs/theme/hairline.native.cjs +60 -0
  279. package/dist/cjs/theme/hairline.native.js +40 -51
  280. package/dist/cjs/theme/hairline.native.js.map +1 -1
  281. package/dist/cjs/theme/index.cjs +20 -20
  282. package/dist/cjs/theme/index.native.cjs +100 -0
  283. package/dist/cjs/theme/index.native.js +20 -19
  284. package/dist/cjs/theme/index.native.js.map +1 -1
  285. package/dist/cjs/theme/intents.cjs +39 -51
  286. package/dist/cjs/theme/intents.native.cjs +52 -0
  287. package/dist/cjs/theme/intents.native.js +39 -50
  288. package/dist/cjs/theme/intents.native.js.map +1 -1
  289. package/dist/cjs/theme/knobs.cjs +123 -120
  290. package/dist/cjs/theme/knobs.native.cjs +177 -0
  291. package/dist/cjs/theme/knobs.native.js +123 -119
  292. package/dist/cjs/theme/knobs.native.js.map +1 -1
  293. package/dist/cjs/theme/layoutTokens.cjs +129 -124
  294. package/dist/cjs/theme/layoutTokens.native.cjs +236 -0
  295. package/dist/cjs/theme/layoutTokens.native.js +173 -173
  296. package/dist/cjs/theme/layoutTokens.native.js.map +1 -1
  297. package/dist/cjs/theme/listRows.cjs +24 -26
  298. package/dist/cjs/theme/listRows.native.cjs +46 -0
  299. package/dist/cjs/theme/listRows.native.js +26 -27
  300. package/dist/cjs/theme/listRows.native.js.map +1 -1
  301. package/dist/cjs/theme/motion.cjs +64 -56
  302. package/dist/cjs/theme/motion.native.cjs +98 -0
  303. package/dist/cjs/theme/motion.native.js +70 -61
  304. package/dist/cjs/theme/motion.native.js.map +1 -1
  305. package/dist/cjs/theme/motionStops.cjs +28 -18
  306. package/dist/cjs/theme/motionStops.native.cjs +40 -0
  307. package/dist/cjs/theme/motionStops.native.js +29 -18
  308. package/dist/cjs/theme/motionStops.native.js.map +1 -1
  309. package/dist/cjs/theme/motionTiming.cjs +52 -54
  310. package/dist/cjs/theme/motionTiming.native.cjs +82 -0
  311. package/dist/cjs/theme/motionTiming.native.js +55 -56
  312. package/dist/cjs/theme/motionTiming.native.js.map +1 -1
  313. package/dist/cjs/theme/nativeFontFamily.cjs +15 -19
  314. package/dist/cjs/theme/nativeFontFamily.native.cjs +32 -0
  315. package/dist/cjs/theme/nativeFontFamily.native.js +17 -20
  316. package/dist/cjs/theme/nativeFontFamily.native.js.map +1 -1
  317. package/dist/cjs/theme/nativeMonoFamily.cjs +43 -27
  318. package/dist/cjs/theme/nativeMonoFamily.native.cjs +62 -0
  319. package/dist/cjs/theme/nativeMonoFamily.native.js +43 -26
  320. package/dist/cjs/theme/nativeMonoFamily.native.js.map +1 -1
  321. package/dist/cjs/theme/nativePresetSwitch.cjs +27 -31
  322. package/dist/cjs/theme/nativePresetSwitch.native.cjs +45 -0
  323. package/dist/cjs/theme/nativePresetSwitch.native.js +29 -32
  324. package/dist/cjs/theme/nativePresetSwitch.native.js.map +1 -1
  325. package/dist/cjs/theme/nativeSchemePreference.cjs +45 -51
  326. package/dist/cjs/theme/nativeSchemePreference.native.cjs +74 -0
  327. package/dist/cjs/theme/nativeSchemePreference.native.js +49 -54
  328. package/dist/cjs/theme/nativeSchemePreference.native.js.map +1 -1
  329. package/dist/cjs/theme/nativeTheme.cjs +72 -85
  330. package/dist/cjs/theme/nativeTheme.native.cjs +101 -0
  331. package/dist/cjs/theme/nativeTheme.native.js +75 -87
  332. package/dist/cjs/theme/nativeTheme.native.js.map +1 -1
  333. package/dist/cjs/theme/nativeTransitionProps.cjs +45 -53
  334. package/dist/cjs/theme/nativeTransitionProps.native.cjs +67 -0
  335. package/dist/cjs/theme/nativeTransitionProps.native.js +49 -61
  336. package/dist/cjs/theme/nativeTransitionProps.native.js.map +1 -1
  337. package/dist/cjs/theme/overlayFill.cjs +55 -41
  338. package/dist/cjs/theme/overlayFill.native.cjs +84 -0
  339. package/dist/cjs/theme/overlayFill.native.js +60 -45
  340. package/dist/cjs/theme/overlayFill.native.js.map +1 -1
  341. package/dist/cjs/theme/overlaySurfaces.cjs +291 -354
  342. package/dist/cjs/theme/overlaySurfaces.native.cjs +375 -0
  343. package/dist/cjs/theme/overlaySurfaces.native.js +306 -377
  344. package/dist/cjs/theme/overlaySurfaces.native.js.map +1 -1
  345. package/dist/cjs/theme/pageGutter.cjs +67 -76
  346. package/dist/cjs/theme/pageGutter.native.cjs +130 -0
  347. package/dist/cjs/theme/pageGutter.native.js +92 -102
  348. package/dist/cjs/theme/pageGutter.native.js.map +1 -1
  349. package/dist/cjs/theme/preset.types.cjs +9 -11
  350. package/dist/cjs/theme/preset.types.native.cjs +18 -0
  351. package/dist/cjs/theme/preset.types.native.js +9 -10
  352. package/dist/cjs/theme/preset.types.native.js.map +1 -1
  353. package/dist/cjs/theme/presetPreview.cjs +26 -30
  354. package/dist/cjs/theme/presetPreview.native.cjs +41 -0
  355. package/dist/cjs/theme/presetPreview.native.js +27 -30
  356. package/dist/cjs/theme/presetPreview.native.js.map +1 -1
  357. package/dist/cjs/theme/presetStore.cjs +200 -218
  358. package/dist/cjs/theme/presetStore.native.cjs +318 -0
  359. package/dist/cjs/theme/presetStore.native.js +245 -269
  360. package/dist/cjs/theme/presetStore.native.js.map +1 -1
  361. package/dist/cjs/theme/presetUserSync.cjs +47 -52
  362. package/dist/cjs/theme/presetUserSync.native.cjs +69 -0
  363. package/dist/cjs/theme/presetUserSync.native.js +49 -53
  364. package/dist/cjs/theme/presetUserSync.native.js.map +1 -1
  365. package/dist/cjs/theme/presets.cjs +111 -100
  366. package/dist/cjs/theme/presets.native.cjs +140 -0
  367. package/dist/cjs/theme/presets.native.js +111 -99
  368. package/dist/cjs/theme/presets.native.js.map +1 -1
  369. package/dist/cjs/theme/radiusClass.cjs +91 -99
  370. package/dist/cjs/theme/radiusClass.native.cjs +128 -0
  371. package/dist/cjs/theme/radiusClass.native.js +97 -104
  372. package/dist/cjs/theme/radiusClass.native.js.map +1 -1
  373. package/dist/cjs/theme/radiusClassTable.generated.cjs +133 -147
  374. package/dist/cjs/theme/radiusClassTable.generated.native.cjs +152 -0
  375. package/dist/cjs/theme/radiusClassTable.generated.native.js +133 -146
  376. package/dist/cjs/theme/radiusClassTable.generated.native.js.map +1 -1
  377. package/dist/cjs/theme/ramps.cjs +67 -58
  378. package/dist/cjs/theme/ramps.native.cjs +87 -0
  379. package/dist/cjs/theme/ramps.native.js +68 -58
  380. package/dist/cjs/theme/ramps.native.js.map +1 -1
  381. package/dist/cjs/theme/readableColor.cjs +196 -191
  382. package/dist/cjs/theme/readableColor.native.cjs +270 -0
  383. package/dist/cjs/theme/readableColor.native.js +225 -222
  384. package/dist/cjs/theme/readableColor.native.js.map +1 -1
  385. package/dist/cjs/theme/recipeInputs.cjs +268 -290
  386. package/dist/cjs/theme/recipeInputs.native.cjs +432 -0
  387. package/dist/cjs/theme/recipeInputs.native.js +367 -403
  388. package/dist/cjs/theme/recipeInputs.native.js.map +1 -1
  389. package/dist/cjs/theme/recipes.cjs +9 -11
  390. package/dist/cjs/theme/recipes.native.cjs +18 -0
  391. package/dist/cjs/theme/recipes.native.js +9 -10
  392. package/dist/cjs/theme/recipes.native.js.map +1 -1
  393. package/dist/cjs/theme/reducedMotion.cjs +27 -31
  394. package/dist/cjs/theme/reducedMotion.native.cjs +74 -0
  395. package/dist/cjs/theme/reducedMotion.native.js +49 -54
  396. package/dist/cjs/theme/reducedMotion.native.js.map +1 -1
  397. package/dist/cjs/theme/resolveKnobs.cjs +645 -764
  398. package/dist/cjs/theme/resolveKnobs.native.cjs +792 -0
  399. package/dist/cjs/theme/resolveKnobs.native.js +657 -778
  400. package/dist/cjs/theme/resolveKnobs.native.js.map +1 -1
  401. package/dist/cjs/theme/rowStates.cjs +44 -49
  402. package/dist/cjs/theme/rowStates.native.cjs +91 -0
  403. package/dist/cjs/theme/rowStates.native.js +60 -65
  404. package/dist/cjs/theme/rowStates.native.js.map +1 -1
  405. package/dist/cjs/theme/scale/ScaleStyles.cjs +33 -37
  406. package/dist/cjs/theme/scale/ScaleStyles.native.cjs +38 -0
  407. package/dist/cjs/theme/scale/ScaleStyles.native.js +19 -20
  408. package/dist/cjs/theme/scale/ScaleStyles.native.js.map +1 -1
  409. package/dist/cjs/theme/scale/activeScale.cjs +31 -33
  410. package/dist/cjs/theme/scale/activeScale.native.cjs +77 -0
  411. package/dist/cjs/theme/scale/activeScale.native.js +52 -57
  412. package/dist/cjs/theme/scale/activeScale.native.js.map +1 -1
  413. package/dist/cjs/theme/scale/deriveRecipeInputs.cjs +72 -88
  414. package/dist/cjs/theme/scale/deriveRecipeInputs.native.cjs +133 -0
  415. package/dist/cjs/theme/scale/deriveRecipeInputs.native.js +107 -126
  416. package/dist/cjs/theme/scale/deriveRecipeInputs.native.js.map +1 -1
  417. package/dist/cjs/theme/scale/generateScale.cjs +75 -81
  418. package/dist/cjs/theme/scale/generateScale.native.cjs +182 -0
  419. package/dist/cjs/theme/scale/generateScale.native.js +147 -163
  420. package/dist/cjs/theme/scale/generateScale.native.js.map +1 -1
  421. package/dist/cjs/theme/scale/index.cjs +55 -57
  422. package/dist/cjs/theme/scale/index.native.cjs +78 -0
  423. package/dist/cjs/theme/scale/index.native.js +55 -56
  424. package/dist/cjs/theme/scale/index.native.js.map +1 -1
  425. package/dist/cjs/theme/scale/installScaleConfig.cjs +15 -19
  426. package/dist/cjs/theme/scale/installScaleConfig.native.cjs +68 -0
  427. package/dist/cjs/theme/scale/installScaleConfig.native.js +45 -40
  428. package/dist/cjs/theme/scale/installScaleConfig.native.js.map +1 -1
  429. package/dist/cjs/theme/scale/scaleAttribute.cjs +18 -22
  430. package/dist/cjs/theme/scale/scaleAttribute.native.cjs +37 -0
  431. package/dist/cjs/theme/scale/scaleAttribute.native.js +18 -21
  432. package/dist/cjs/theme/scale/scaleAttribute.native.js.map +1 -1
  433. package/dist/cjs/theme/scale/scaleCss.cjs +69 -70
  434. package/dist/cjs/theme/scale/scaleCss.native.cjs +184 -0
  435. package/dist/cjs/theme/scale/scaleCss.native.js +163 -178
  436. package/dist/cjs/theme/scale/scaleCss.native.js.map +1 -1
  437. package/dist/cjs/theme/scale/scaleFonts.cjs +64 -66
  438. package/dist/cjs/theme/scale/scaleFonts.native.cjs +141 -0
  439. package/dist/cjs/theme/scale/scaleFonts.native.js +119 -131
  440. package/dist/cjs/theme/scale/scaleFonts.native.js.map +1 -1
  441. package/dist/cjs/theme/scale/scaleInputs.cjs +262 -193
  442. package/dist/cjs/theme/scale/scaleInputs.native.cjs +305 -0
  443. package/dist/cjs/theme/scale/scaleInputs.native.js +264 -194
  444. package/dist/cjs/theme/scale/scaleInputs.native.js.map +1 -1
  445. package/dist/cjs/theme/scale/themeScales.cjs +117 -110
  446. package/dist/cjs/theme/scale/themeScales.native.cjs +188 -0
  447. package/dist/cjs/theme/scale/themeScales.native.js +160 -155
  448. package/dist/cjs/theme/scale/themeScales.native.js.map +1 -1
  449. package/dist/cjs/theme/scale/useActiveScale.cjs +50 -52
  450. package/dist/cjs/theme/scale/useActiveScale.native.cjs +84 -0
  451. package/dist/cjs/theme/scale/useActiveScale.native.js +56 -57
  452. package/dist/cjs/theme/scale/useActiveScale.native.js.map +1 -1
  453. package/dist/cjs/theme/schemeStore.cjs +54 -56
  454. package/dist/cjs/theme/schemeStore.native.cjs +101 -0
  455. package/dist/cjs/theme/schemeStore.native.js +67 -68
  456. package/dist/cjs/theme/schemeStore.native.js.map +1 -1
  457. package/dist/cjs/theme/shared.cjs +94 -97
  458. package/dist/cjs/theme/shared.native.cjs +160 -0
  459. package/dist/cjs/theme/shared.native.js +130 -136
  460. package/dist/cjs/theme/shared.native.js.map +1 -1
  461. package/dist/cjs/theme/sizeRecipes.cjs +120 -116
  462. package/dist/cjs/theme/sizeRecipes.native.cjs +233 -0
  463. package/dist/cjs/theme/sizeRecipes.native.js +181 -187
  464. package/dist/cjs/theme/sizeRecipes.native.js.map +1 -1
  465. package/dist/cjs/theme/subsetThemes.cjs +31 -35
  466. package/dist/cjs/theme/subsetThemes.native.cjs +69 -0
  467. package/dist/cjs/theme/subsetThemes.native.js +56 -61
  468. package/dist/cjs/theme/subsetThemes.native.js.map +1 -1
  469. package/dist/cjs/theme/theme.cjs +163 -160
  470. package/dist/cjs/theme/theme.native.cjs +20 -0
  471. package/dist/cjs/theme/theme.native.js +9 -10
  472. package/dist/cjs/theme/theme.native.js.map +1 -1
  473. package/dist/cjs/theme/themeValue.cjs +40 -32
  474. package/dist/cjs/theme/themeValue.native.cjs +78 -0
  475. package/dist/cjs/theme/themeValue.native.js +57 -50
  476. package/dist/cjs/theme/themeValue.native.js.map +1 -1
  477. package/dist/cjs/theme/tileSizes.cjs +134 -163
  478. package/dist/cjs/theme/tileSizes.native.cjs +198 -0
  479. package/dist/cjs/theme/tileSizes.native.js +157 -187
  480. package/dist/cjs/theme/tileSizes.native.js.map +1 -1
  481. package/dist/cjs/theme/tintHues.cjs +48 -21
  482. package/dist/cjs/theme/tintHues.native.cjs +63 -0
  483. package/dist/cjs/theme/tintHues.native.js +48 -20
  484. package/dist/cjs/theme/tintHues.native.js.map +1 -1
  485. package/dist/cjs/theme/tokenNumber.cjs +18 -22
  486. package/dist/cjs/theme/tokenNumber.native.cjs +34 -0
  487. package/dist/cjs/theme/tokenNumber.native.js +20 -23
  488. package/dist/cjs/theme/tokenNumber.native.js.map +1 -1
  489. package/dist/cjs/theme/touchManipulation.cjs +31 -18
  490. package/dist/cjs/theme/touchManipulation.native.cjs +48 -0
  491. package/dist/cjs/theme/touchManipulation.native.js +31 -17
  492. package/dist/cjs/theme/touchManipulation.native.js.map +1 -1
  493. package/dist/cjs/theme/transitionProps.cjs +32 -37
  494. package/dist/cjs/theme/transitionProps.native.cjs +20 -0
  495. package/dist/cjs/theme/transitionProps.native.js +9 -10
  496. package/dist/cjs/theme/transitionProps.native.js.map +1 -1
  497. package/dist/cjs/theme/usePresetSwitch.cjs +46 -53
  498. package/dist/cjs/theme/usePresetSwitch.native.cjs +20 -0
  499. package/dist/cjs/theme/usePresetSwitch.native.js +9 -10
  500. package/dist/cjs/theme/usePresetSwitch.native.js.map +1 -1
  501. package/dist/cjs/theme/useResolvedKnobs.cjs +138 -126
  502. package/dist/cjs/theme/useResolvedKnobs.native.cjs +189 -0
  503. package/dist/cjs/theme/useResolvedKnobs.native.js +157 -151
  504. package/dist/cjs/theme/useResolvedKnobs.native.js.map +1 -1
  505. package/dist/cjs/theme/useSchemePreference.cjs +26 -30
  506. package/dist/cjs/theme/useSchemePreference.native.cjs +20 -0
  507. package/dist/cjs/theme/useSchemePreference.native.js +9 -10
  508. package/dist/cjs/theme/useSchemePreference.native.js.map +1 -1
  509. package/dist/cjs/theme/useTheme.cjs +147 -134
  510. package/dist/cjs/theme/useTheme.native.cjs +86 -0
  511. package/dist/cjs/theme/useTheme.native.js +68 -74
  512. package/dist/cjs/theme/useTheme.native.js.map +1 -1
  513. package/dist/cjs/theme/useTouchSurface.cjs +16 -20
  514. package/dist/cjs/theme/useTouchSurface.native.cjs +31 -0
  515. package/dist/cjs/theme/useTouchSurface.native.js +16 -19
  516. package/dist/cjs/theme/useTouchSurface.native.js.map +1 -1
  517. package/dist/cjs/theme/v3TokenRoles.cjs +49 -53
  518. package/dist/cjs/theme/v3TokenRoles.native.cjs +62 -0
  519. package/dist/cjs/theme/v3TokenRoles.native.js +49 -52
  520. package/dist/cjs/theme/v3TokenRoles.native.js.map +1 -1
  521. package/dist/cjs/theme/v5Palettes.cjs +293 -0
  522. package/dist/cjs/theme/v5Palettes.native.cjs +333 -0
  523. package/dist/cjs/theme/v5Palettes.native.js +335 -0
  524. package/dist/cjs/theme/v5Palettes.native.js.map +1 -0
  525. package/dist/cjs/theme/v5Templates.cjs +120 -0
  526. package/dist/cjs/theme/v5Templates.native.cjs +126 -0
  527. package/dist/cjs/theme/v5Templates.native.js +128 -0
  528. package/dist/cjs/theme/v5Templates.native.js.map +1 -0
  529. package/dist/esm/audit/constraintAudit.mjs +598 -492
  530. package/dist/esm/audit/constraintAudit.mjs.map +1 -1
  531. package/dist/esm/audit/constraintAudit.native.js +938 -869
  532. package/dist/esm/audit/constraintAudit.native.js.map +1 -1
  533. package/dist/esm/audit/designTokens.mjs +19 -17
  534. package/dist/esm/audit/designTokens.mjs.map +1 -1
  535. package/dist/esm/audit/designTokens.native.js +37 -40
  536. package/dist/esm/audit/designTokens.native.js.map +1 -1
  537. package/dist/esm/audit/diffReport.mjs +232 -219
  538. package/dist/esm/audit/diffReport.mjs.map +1 -1
  539. package/dist/esm/audit/diffReport.native.js +467 -480
  540. package/dist/esm/audit/diffReport.native.js.map +1 -1
  541. package/dist/esm/audit/index.mjs +3 -3
  542. package/dist/esm/audit/index.native.js +3 -3
  543. package/dist/esm/audit/themeMatrix.mjs +977 -861
  544. package/dist/esm/audit/themeMatrix.mjs.map +1 -1
  545. package/dist/esm/audit/themeMatrix.native.js +1538 -1485
  546. package/dist/esm/audit/themeMatrix.native.js.map +1 -1
  547. package/dist/esm/dates.mjs +161 -196
  548. package/dist/esm/dates.mjs.map +1 -1
  549. package/dist/esm/dates.native.js +175 -219
  550. package/dist/esm/dates.native.js.map +1 -1
  551. package/dist/esm/devWarn.mjs +124 -97
  552. package/dist/esm/devWarn.mjs.map +1 -1
  553. package/dist/esm/devWarn.native.js +147 -122
  554. package/dist/esm/devWarn.native.js.map +1 -1
  555. package/dist/esm/expo.mjs +36 -45
  556. package/dist/esm/expo.mjs.map +1 -1
  557. package/dist/esm/expo.native.js +40 -49
  558. package/dist/esm/expo.native.js.map +1 -1
  559. package/dist/esm/figma/figmaTokens.mjs +302 -272
  560. package/dist/esm/figma/figmaTokens.mjs.map +1 -1
  561. package/dist/esm/figma/figmaTokens.native.js +561 -555
  562. package/dist/esm/figma/figmaTokens.native.js.map +1 -1
  563. package/dist/esm/font.mjs +15 -32
  564. package/dist/esm/font.mjs.map +1 -1
  565. package/dist/esm/font.native.js +22 -39
  566. package/dist/esm/font.native.js.map +1 -1
  567. package/dist/esm/fonts/createFontLoader.mjs +2 -3
  568. package/dist/esm/fonts/createFontLoader.mjs.map +1 -1
  569. package/dist/esm/fonts/createFontLoader.native.js +42 -38
  570. package/dist/esm/fonts/createFontLoader.native.js.map +1 -1
  571. package/dist/esm/fonts/index.mjs +5 -4
  572. package/dist/esm/fonts/index.native.js +5 -4
  573. package/dist/esm/fonts/interFaces.mjs +7 -6
  574. package/dist/esm/fonts/interFaces.mjs.map +1 -1
  575. package/dist/esm/fonts/interFaces.native.js +7 -6
  576. package/dist/esm/fonts/interFaces.native.js.map +1 -1
  577. package/dist/esm/fonts/types.mjs +0 -2
  578. package/dist/esm/fonts/types.native.js +0 -2
  579. package/dist/esm/index.gnome.mjs +20 -19
  580. package/dist/esm/index.gnome.native.js +20 -19
  581. package/dist/esm/index.mjs +18 -10
  582. package/dist/esm/index.native.js +18 -10
  583. package/dist/esm/keyboardFocusRing.mjs +44 -35
  584. package/dist/esm/keyboardFocusRing.mjs.map +1 -1
  585. package/dist/esm/keyboardFocusRing.native.js +46 -37
  586. package/dist/esm/keyboardFocusRing.native.js.map +1 -1
  587. package/dist/esm/menuRow.mjs +38 -33
  588. package/dist/esm/menuRow.mjs.map +1 -1
  589. package/dist/esm/menuRow.native.js +41 -36
  590. package/dist/esm/menuRow.native.js.map +1 -1
  591. package/dist/esm/nativeTwins.mjs +2 -2
  592. package/dist/esm/nativeTwins.native.js +2 -2
  593. package/dist/esm/numbers.mjs +118 -136
  594. package/dist/esm/numbers.mjs.map +1 -1
  595. package/dist/esm/numbers.native.js +133 -151
  596. package/dist/esm/numbers.native.js.map +1 -1
  597. package/dist/esm/theme/FontKnobStyles.mjs +113 -107
  598. package/dist/esm/theme/FontKnobStyles.mjs.map +1 -1
  599. package/dist/esm/theme/FontKnobStyles.native.js +4 -3
  600. package/dist/esm/theme/FontKnobStyles.native.js.map +1 -1
  601. package/dist/esm/theme/Heading.mjs +75 -127
  602. package/dist/esm/theme/Heading.mjs.map +1 -1
  603. package/dist/esm/theme/Heading.native.js +78 -130
  604. package/dist/esm/theme/Heading.native.js.map +1 -1
  605. package/dist/esm/theme/IconSlot.mjs +24 -36
  606. package/dist/esm/theme/IconSlot.mjs.map +1 -1
  607. package/dist/esm/theme/IconSlot.native.js +25 -42
  608. package/dist/esm/theme/IconSlot.native.js.map +1 -1
  609. package/dist/esm/theme/Intent.mjs +23 -25
  610. package/dist/esm/theme/Intent.mjs.map +1 -1
  611. package/dist/esm/theme/Intent.native.js +24 -26
  612. package/dist/esm/theme/Intent.native.js.map +1 -1
  613. package/dist/esm/theme/Preset.mjs +115 -114
  614. package/dist/esm/theme/Preset.mjs.map +1 -1
  615. package/dist/esm/theme/Preset.native.js +118 -117
  616. package/dist/esm/theme/Preset.native.js.map +1 -1
  617. package/dist/esm/theme/PresetContext.mjs +5 -3
  618. package/dist/esm/theme/PresetContext.mjs.map +1 -1
  619. package/dist/esm/theme/PresetContext.native.js +6 -4
  620. package/dist/esm/theme/PresetContext.native.js.map +1 -1
  621. package/dist/esm/theme/Surface.mjs +48 -52
  622. package/dist/esm/theme/Surface.mjs.map +1 -1
  623. package/dist/esm/theme/Surface.native.js +55 -60
  624. package/dist/esm/theme/Surface.native.js.map +1 -1
  625. package/dist/esm/theme/Text.mjs +91 -116
  626. package/dist/esm/theme/Text.mjs.map +1 -1
  627. package/dist/esm/theme/Text.native.js +92 -118
  628. package/dist/esm/theme/Text.native.js.map +1 -1
  629. package/dist/esm/theme/Tint.mjs +16 -19
  630. package/dist/esm/theme/Tint.mjs.map +1 -1
  631. package/dist/esm/theme/Tint.native.js +18 -21
  632. package/dist/esm/theme/Tint.native.js.map +1 -1
  633. package/dist/esm/theme/accentHue.mjs +38 -28
  634. package/dist/esm/theme/accentHue.mjs.map +1 -1
  635. package/dist/esm/theme/accentHue.native.js +46 -36
  636. package/dist/esm/theme/accentHue.native.js.map +1 -1
  637. package/dist/esm/theme/accentInk.mjs +93 -88
  638. package/dist/esm/theme/accentInk.mjs.map +1 -1
  639. package/dist/esm/theme/accentInk.native.js +162 -163
  640. package/dist/esm/theme/accentInk.native.js.map +1 -1
  641. package/dist/esm/theme/activateThemeConfig.mjs +8 -10
  642. package/dist/esm/theme/activateThemeConfig.mjs.map +1 -1
  643. package/dist/esm/theme/activateThemeConfig.native.js +8 -10
  644. package/dist/esm/theme/activateThemeConfig.native.js.map +1 -1
  645. package/dist/esm/theme/animations/css.mjs +4 -3
  646. package/dist/esm/theme/animations/css.mjs.map +1 -1
  647. package/dist/esm/theme/animations/css.native.js +4 -3
  648. package/dist/esm/theme/animations/css.native.js.map +1 -1
  649. package/dist/esm/theme/animations/index.mjs +1 -2
  650. package/dist/esm/theme/animations/index.native.js +8 -1
  651. package/dist/esm/theme/animations/index.native.js.map +1 -1
  652. package/dist/esm/theme/animations/reactNative.mjs +126 -127
  653. package/dist/esm/theme/animations/reactNative.mjs.map +1 -1
  654. package/dist/esm/theme/animations/reactNative.native.js +126 -127
  655. package/dist/esm/theme/animations/reactNative.native.js.map +1 -1
  656. package/dist/esm/theme/chartPalette.mjs +247 -184
  657. package/dist/esm/theme/chartPalette.mjs.map +1 -1
  658. package/dist/esm/theme/chartPalette.native.js +319 -261
  659. package/dist/esm/theme/chartPalette.native.js.map +1 -1
  660. package/dist/esm/theme/colorRules.mjs +237 -218
  661. package/dist/esm/theme/colorRules.mjs.map +1 -1
  662. package/dist/esm/theme/colorRules.native.js +269 -252
  663. package/dist/esm/theme/colorRules.native.js.map +1 -1
  664. package/dist/esm/theme/composeKnobs.mjs +152 -0
  665. package/dist/esm/theme/composeKnobs.mjs.map +1 -0
  666. package/dist/esm/theme/composeKnobs.native.js +332 -0
  667. package/dist/esm/theme/composeKnobs.native.js.map +1 -0
  668. package/dist/esm/theme/controlSizing.mjs +88 -0
  669. package/dist/esm/theme/controlSizing.mjs.map +1 -0
  670. package/dist/esm/theme/controlSizing.native.js +164 -0
  671. package/dist/esm/theme/controlSizing.native.js.map +1 -0
  672. package/dist/esm/theme/controlTiers.mjs +25 -24
  673. package/dist/esm/theme/controlTiers.mjs.map +1 -1
  674. package/dist/esm/theme/controlTiers.native.js +28 -27
  675. package/dist/esm/theme/controlTiers.native.js.map +1 -1
  676. package/dist/esm/theme/cookies.mjs +114 -109
  677. package/dist/esm/theme/cookies.mjs.map +1 -1
  678. package/dist/esm/theme/cookies.native.js +219 -231
  679. package/dist/esm/theme/cookies.native.js.map +1 -1
  680. package/dist/esm/theme/cornerSmoothing.mjs +42 -40
  681. package/dist/esm/theme/cornerSmoothing.mjs.map +1 -1
  682. package/dist/esm/theme/cornerSmoothing.native.js +6 -5
  683. package/dist/esm/theme/cornerSmoothing.native.js.map +1 -1
  684. package/dist/esm/theme/createDefaultThemeConfig.mjs +91 -91
  685. package/dist/esm/theme/createDefaultThemeConfig.mjs.map +1 -1
  686. package/dist/esm/theme/createDefaultThemeConfig.native.js +130 -134
  687. package/dist/esm/theme/createDefaultThemeConfig.native.js.map +1 -1
  688. package/dist/esm/theme/createThemes.mjs +1057 -968
  689. package/dist/esm/theme/createThemes.mjs.map +1 -1
  690. package/dist/esm/theme/createThemes.native.js +1819 -1696
  691. package/dist/esm/theme/createThemes.native.js.map +1 -1
  692. package/dist/esm/theme/dedupeInherited.mjs +44 -43
  693. package/dist/esm/theme/dedupeInherited.mjs.map +1 -1
  694. package/dist/esm/theme/dedupeInherited.native.js +142 -151
  695. package/dist/esm/theme/dedupeInherited.native.js.map +1 -1
  696. package/dist/esm/theme/defaults/accent.mjs +5 -3
  697. package/dist/esm/theme/defaults/accent.mjs.map +1 -1
  698. package/dist/esm/theme/defaults/accent.native.js +5 -3
  699. package/dist/esm/theme/defaults/accent.native.js.map +1 -1
  700. package/dist/esm/theme/defaults/base.mjs +29 -27
  701. package/dist/esm/theme/defaults/base.mjs.map +1 -1
  702. package/dist/esm/theme/defaults/base.native.js +29 -27
  703. package/dist/esm/theme/defaults/base.native.js.map +1 -1
  704. package/dist/esm/theme/defaults/builderOptions.mjs +196 -172
  705. package/dist/esm/theme/defaults/builderOptions.mjs.map +1 -1
  706. package/dist/esm/theme/defaults/builderOptions.native.js +258 -241
  707. package/dist/esm/theme/defaults/builderOptions.native.js.map +1 -1
  708. package/dist/esm/theme/defaults/categoryFonts.mjs +22 -20
  709. package/dist/esm/theme/defaults/categoryFonts.mjs.map +1 -1
  710. package/dist/esm/theme/defaults/categoryFonts.native.js +22 -20
  711. package/dist/esm/theme/defaults/categoryFonts.native.js.map +1 -1
  712. package/dist/esm/theme/defaults/fonts.mjs +126 -154
  713. package/dist/esm/theme/defaults/fonts.mjs.map +1 -1
  714. package/dist/esm/theme/defaults/fonts.native.js +199 -241
  715. package/dist/esm/theme/defaults/fonts.native.js.map +1 -1
  716. package/dist/esm/theme/defaults/house.mjs +60 -6
  717. package/dist/esm/theme/defaults/house.mjs.map +1 -1
  718. package/dist/esm/theme/defaults/house.native.js +64 -10
  719. package/dist/esm/theme/defaults/house.native.js.map +1 -1
  720. package/dist/esm/theme/defaults/index.mjs +11 -7
  721. package/dist/esm/theme/defaults/index.native.js +11 -7
  722. package/dist/esm/theme/defaults/interFont.mjs +18 -0
  723. package/dist/esm/theme/defaults/interFont.mjs.map +1 -0
  724. package/dist/esm/theme/defaults/interFont.native.js +21 -0
  725. package/dist/esm/theme/defaults/interFont.native.js.map +1 -0
  726. package/dist/esm/theme/devtools/ColorLineVisualizer.mjs +162 -193
  727. package/dist/esm/theme/devtools/ColorLineVisualizer.mjs.map +1 -1
  728. package/dist/esm/theme/devtools/ColorLineVisualizer.native.js +2 -1
  729. package/dist/esm/theme/devtools/ColorLineVisualizer.native.js.map +1 -1
  730. package/dist/esm/theme/devtools/ThemeDevtoolsPanel.mjs +1311 -1273
  731. package/dist/esm/theme/devtools/ThemeDevtoolsPanel.mjs.map +1 -1
  732. package/dist/esm/theme/devtools/ThemeDevtoolsPanel.native.js +2 -1
  733. package/dist/esm/theme/devtools/ThemeDevtoolsPanel.native.js.map +1 -1
  734. package/dist/esm/theme/devtools/animationOptions.mjs +6 -4
  735. package/dist/esm/theme/devtools/animationOptions.mjs.map +1 -1
  736. package/dist/esm/theme/devtools/animationOptions.native.js +7 -10
  737. package/dist/esm/theme/devtools/animationOptions.native.js.map +1 -1
  738. package/dist/esm/theme/devtools/buildSnapshot.mjs +83 -62
  739. package/dist/esm/theme/devtools/buildSnapshot.mjs.map +1 -1
  740. package/dist/esm/theme/devtools/buildSnapshot.native.js +154 -141
  741. package/dist/esm/theme/devtools/buildSnapshot.native.js.map +1 -1
  742. package/dist/esm/theme/devtools/index.mjs +11 -7
  743. package/dist/esm/theme/devtools/index.native.js +11 -7
  744. package/dist/esm/theme/devtools/knobIcons.mjs +338 -400
  745. package/dist/esm/theme/devtools/knobIcons.mjs.map +1 -1
  746. package/dist/esm/theme/devtools/knobIcons.native.js +345 -407
  747. package/dist/esm/theme/devtools/knobIcons.native.js.map +1 -1
  748. package/dist/esm/theme/devtools/vizConstants.mjs +16 -15
  749. package/dist/esm/theme/devtools/vizConstants.mjs.map +1 -1
  750. package/dist/esm/theme/devtools/vizConstants.native.js +16 -15
  751. package/dist/esm/theme/devtools/vizConstants.native.js.map +1 -1
  752. package/dist/esm/theme/dynamicType.mjs +15 -14
  753. package/dist/esm/theme/dynamicType.mjs.map +1 -1
  754. package/dist/esm/theme/dynamicType.native.js +15 -14
  755. package/dist/esm/theme/dynamicType.native.js.map +1 -1
  756. package/dist/esm/theme/fieldFocus.mjs +26 -20
  757. package/dist/esm/theme/fieldFocus.mjs.map +1 -1
  758. package/dist/esm/theme/fieldFocus.native.js +30 -24
  759. package/dist/esm/theme/fieldFocus.native.js.map +1 -1
  760. package/dist/esm/theme/fillContrast.mjs +101 -85
  761. package/dist/esm/theme/fillContrast.mjs.map +1 -1
  762. package/dist/esm/theme/fillContrast.native.js +125 -111
  763. package/dist/esm/theme/fillContrast.native.js.map +1 -1
  764. package/dist/esm/theme/focusState.mjs +74 -58
  765. package/dist/esm/theme/focusState.mjs.map +1 -1
  766. package/dist/esm/theme/focusState.native.js +113 -58
  767. package/dist/esm/theme/focusState.native.js.map +1 -1
  768. package/dist/esm/theme/fontCategoryMetrics.mjs +57 -59
  769. package/dist/esm/theme/fontCategoryMetrics.mjs.map +1 -1
  770. package/dist/esm/theme/fontCategoryMetrics.native.js +57 -59
  771. package/dist/esm/theme/fontCategoryMetrics.native.js.map +1 -1
  772. package/dist/esm/theme/fontCategoryStacks.mjs +12 -11
  773. package/dist/esm/theme/fontCategoryStacks.mjs.map +1 -1
  774. package/dist/esm/theme/fontCategoryStacks.native.js +12 -11
  775. package/dist/esm/theme/fontCategoryStacks.native.js.map +1 -1
  776. package/dist/esm/theme/glyphPaint.mjs +24 -22
  777. package/dist/esm/theme/glyphPaint.mjs.map +1 -1
  778. package/dist/esm/theme/glyphPaint.native.js +45 -45
  779. package/dist/esm/theme/glyphPaint.native.js.map +1 -1
  780. package/dist/esm/theme/glyphTint.mjs +50 -43
  781. package/dist/esm/theme/glyphTint.mjs.map +1 -1
  782. package/dist/esm/theme/glyphTint.native.js +53 -45
  783. package/dist/esm/theme/glyphTint.native.js.map +1 -1
  784. package/dist/esm/theme/groupGeometry.mjs +28 -26
  785. package/dist/esm/theme/groupGeometry.mjs.map +1 -1
  786. package/dist/esm/theme/groupGeometry.native.js +30 -28
  787. package/dist/esm/theme/groupGeometry.native.js.map +1 -1
  788. package/dist/esm/theme/hairline.mjs +61 -64
  789. package/dist/esm/theme/hairline.mjs.map +1 -1
  790. package/dist/esm/theme/hairline.native.js +24 -32
  791. package/dist/esm/theme/hairline.native.js.map +1 -1
  792. package/dist/esm/theme/index.mjs +136 -67
  793. package/dist/esm/theme/index.native.js +136 -67
  794. package/dist/esm/theme/intents.mjs +26 -33
  795. package/dist/esm/theme/intents.mjs.map +1 -1
  796. package/dist/esm/theme/intents.native.js +26 -33
  797. package/dist/esm/theme/intents.native.js.map +1 -1
  798. package/dist/esm/theme/knobs.mjs +89 -82
  799. package/dist/esm/theme/knobs.mjs.map +1 -1
  800. package/dist/esm/theme/knobs.native.js +89 -82
  801. package/dist/esm/theme/knobs.native.js.map +1 -1
  802. package/dist/esm/theme/layoutTokens.mjs +94 -85
  803. package/dist/esm/theme/layoutTokens.mjs.map +1 -1
  804. package/dist/esm/theme/layoutTokens.native.js +134 -131
  805. package/dist/esm/theme/layoutTokens.native.js.map +1 -1
  806. package/dist/esm/theme/listRows.mjs +10 -8
  807. package/dist/esm/theme/listRows.mjs.map +1 -1
  808. package/dist/esm/theme/listRows.native.js +12 -10
  809. package/dist/esm/theme/listRows.native.js.map +1 -1
  810. package/dist/esm/theme/motion.mjs +46 -35
  811. package/dist/esm/theme/motion.mjs.map +1 -1
  812. package/dist/esm/theme/motion.native.js +52 -41
  813. package/dist/esm/theme/motion.native.js.map +1 -1
  814. package/dist/esm/theme/motionStops.mjs +16 -1
  815. package/dist/esm/theme/motionStops.mjs.map +1 -1
  816. package/dist/esm/theme/motionStops.native.js +16 -1
  817. package/dist/esm/theme/motionStops.native.js.map +1 -1
  818. package/dist/esm/theme/motionTiming.mjs +33 -32
  819. package/dist/esm/theme/motionTiming.mjs.map +1 -1
  820. package/dist/esm/theme/motionTiming.native.js +36 -35
  821. package/dist/esm/theme/motionTiming.native.js.map +1 -1
  822. package/dist/esm/theme/nativeFontFamily.mjs +2 -1
  823. package/dist/esm/theme/nativeFontFamily.mjs.map +1 -1
  824. package/dist/esm/theme/nativeFontFamily.native.js +5 -3
  825. package/dist/esm/theme/nativeFontFamily.native.js.map +1 -1
  826. package/dist/esm/theme/nativeMonoFamily.mjs +29 -10
  827. package/dist/esm/theme/nativeMonoFamily.mjs.map +1 -1
  828. package/dist/esm/theme/nativeMonoFamily.native.js +29 -10
  829. package/dist/esm/theme/nativeMonoFamily.native.js.map +1 -1
  830. package/dist/esm/theme/nativePresetSwitch.mjs +15 -13
  831. package/dist/esm/theme/nativePresetSwitch.mjs.map +1 -1
  832. package/dist/esm/theme/nativePresetSwitch.native.js +17 -15
  833. package/dist/esm/theme/nativePresetSwitch.native.js.map +1 -1
  834. package/dist/esm/theme/nativeSchemePreference.mjs +33 -33
  835. package/dist/esm/theme/nativeSchemePreference.mjs.map +1 -1
  836. package/dist/esm/theme/nativeSchemePreference.native.js +37 -37
  837. package/dist/esm/theme/nativeSchemePreference.native.js.map +1 -1
  838. package/dist/esm/theme/nativeTheme.mjs +61 -68
  839. package/dist/esm/theme/nativeTheme.mjs.map +1 -1
  840. package/dist/esm/theme/nativeTheme.native.js +65 -72
  841. package/dist/esm/theme/nativeTheme.native.js.map +1 -1
  842. package/dist/esm/theme/nativeTransitionProps.mjs +34 -36
  843. package/dist/esm/theme/nativeTransitionProps.mjs.map +1 -1
  844. package/dist/esm/theme/nativeTransitionProps.native.js +37 -44
  845. package/dist/esm/theme/nativeTransitionProps.native.js.map +1 -1
  846. package/dist/esm/theme/overlayFill.mjs +42 -24
  847. package/dist/esm/theme/overlayFill.mjs.map +1 -1
  848. package/dist/esm/theme/overlayFill.native.js +47 -29
  849. package/dist/esm/theme/overlayFill.native.js.map +1 -1
  850. package/dist/esm/theme/overlaySurfaces.mjs +258 -317
  851. package/dist/esm/theme/overlaySurfaces.mjs.map +1 -1
  852. package/dist/esm/theme/overlaySurfaces.native.js +273 -341
  853. package/dist/esm/theme/overlaySurfaces.native.js.map +1 -1
  854. package/dist/esm/theme/pageGutter.mjs +48 -53
  855. package/dist/esm/theme/pageGutter.mjs.map +1 -1
  856. package/dist/esm/theme/pageGutter.native.js +74 -81
  857. package/dist/esm/theme/pageGutter.native.js.map +1 -1
  858. package/dist/esm/theme/preset.types.mjs +0 -2
  859. package/dist/esm/theme/preset.types.native.js +0 -2
  860. package/dist/esm/theme/presetPreview.mjs +14 -12
  861. package/dist/esm/theme/presetPreview.mjs.map +1 -1
  862. package/dist/esm/theme/presetPreview.native.js +15 -13
  863. package/dist/esm/theme/presetPreview.native.js.map +1 -1
  864. package/dist/esm/theme/presetStore.mjs +177 -191
  865. package/dist/esm/theme/presetStore.mjs.map +1 -1
  866. package/dist/esm/theme/presetStore.native.js +220 -241
  867. package/dist/esm/theme/presetStore.native.js.map +1 -1
  868. package/dist/esm/theme/presetUserSync.mjs +34 -35
  869. package/dist/esm/theme/presetUserSync.mjs.map +1 -1
  870. package/dist/esm/theme/presetUserSync.native.js +36 -37
  871. package/dist/esm/theme/presetUserSync.native.js.map +1 -1
  872. package/dist/esm/theme/presets.mjs +93 -78
  873. package/dist/esm/theme/presets.mjs.map +1 -1
  874. package/dist/esm/theme/presets.native.js +93 -78
  875. package/dist/esm/theme/presets.native.js.map +1 -1
  876. package/dist/esm/theme/radiusClass.mjs +74 -78
  877. package/dist/esm/theme/radiusClass.mjs.map +1 -1
  878. package/dist/esm/theme/radiusClass.native.js +80 -84
  879. package/dist/esm/theme/radiusClass.native.js.map +1 -1
  880. package/dist/esm/theme/radiusClassTable.generated.mjs +116 -127
  881. package/dist/esm/theme/radiusClassTable.generated.mjs.map +1 -1
  882. package/dist/esm/theme/radiusClassTable.generated.native.js +116 -127
  883. package/dist/esm/theme/radiusClassTable.generated.native.js.map +1 -1
  884. package/dist/esm/theme/ramps.mjs +53 -41
  885. package/dist/esm/theme/ramps.mjs.map +1 -1
  886. package/dist/esm/theme/ramps.native.js +54 -42
  887. package/dist/esm/theme/ramps.native.js.map +1 -1
  888. package/dist/esm/theme/readableColor.mjs +174 -165
  889. package/dist/esm/theme/readableColor.mjs.map +1 -1
  890. package/dist/esm/theme/readableColor.native.js +203 -197
  891. package/dist/esm/theme/readableColor.native.js.map +1 -1
  892. package/dist/esm/theme/recipeInputs.mjs +239 -258
  893. package/dist/esm/theme/recipeInputs.mjs.map +1 -1
  894. package/dist/esm/theme/recipeInputs.native.js +338 -372
  895. package/dist/esm/theme/recipeInputs.native.js.map +1 -1
  896. package/dist/esm/theme/recipes.mjs +0 -2
  897. package/dist/esm/theme/recipes.native.js +0 -2
  898. package/dist/esm/theme/reducedMotion.mjs +15 -13
  899. package/dist/esm/theme/reducedMotion.mjs.map +1 -1
  900. package/dist/esm/theme/reducedMotion.native.js +37 -37
  901. package/dist/esm/theme/reducedMotion.native.js.map +1 -1
  902. package/dist/esm/theme/resolveKnobs.mjs +612 -727
  903. package/dist/esm/theme/resolveKnobs.mjs.map +1 -1
  904. package/dist/esm/theme/resolveKnobs.native.js +624 -742
  905. package/dist/esm/theme/resolveKnobs.native.js.map +1 -1
  906. package/dist/esm/theme/rowStates.mjs +28 -29
  907. package/dist/esm/theme/rowStates.mjs.map +1 -1
  908. package/dist/esm/theme/rowStates.native.js +44 -46
  909. package/dist/esm/theme/rowStates.native.js.map +1 -1
  910. package/dist/esm/theme/scale/ScaleStyles.mjs +19 -19
  911. package/dist/esm/theme/scale/ScaleStyles.mjs.map +1 -1
  912. package/dist/esm/theme/scale/ScaleStyles.native.js +4 -3
  913. package/dist/esm/theme/scale/ScaleStyles.native.js.map +1 -1
  914. package/dist/esm/theme/scale/activeScale.mjs +16 -14
  915. package/dist/esm/theme/scale/activeScale.mjs.map +1 -1
  916. package/dist/esm/theme/scale/activeScale.native.js +37 -39
  917. package/dist/esm/theme/scale/activeScale.native.js.map +1 -1
  918. package/dist/esm/theme/scale/deriveRecipeInputs.mjs +60 -70
  919. package/dist/esm/theme/scale/deriveRecipeInputs.mjs.map +1 -1
  920. package/dist/esm/theme/scale/deriveRecipeInputs.native.js +95 -109
  921. package/dist/esm/theme/scale/deriveRecipeInputs.native.js.map +1 -1
  922. package/dist/esm/theme/scale/generateScale.mjs +59 -61
  923. package/dist/esm/theme/scale/generateScale.mjs.map +1 -1
  924. package/dist/esm/theme/scale/generateScale.native.js +131 -144
  925. package/dist/esm/theme/scale/generateScale.native.js.map +1 -1
  926. package/dist/esm/theme/scale/index.mjs +3 -3
  927. package/dist/esm/theme/scale/index.native.js +3 -3
  928. package/dist/esm/theme/scale/installScaleConfig.mjs +3 -1
  929. package/dist/esm/theme/scale/installScaleConfig.mjs.map +1 -1
  930. package/dist/esm/theme/scale/installScaleConfig.native.js +32 -24
  931. package/dist/esm/theme/scale/installScaleConfig.native.js.map +1 -1
  932. package/dist/esm/theme/scale/scaleAttribute.mjs +3 -3
  933. package/dist/esm/theme/scale/scaleAttribute.mjs.map +1 -1
  934. package/dist/esm/theme/scale/scaleAttribute.native.js +3 -3
  935. package/dist/esm/theme/scale/scaleAttribute.native.js.map +1 -1
  936. package/dist/esm/theme/scale/scaleCss.mjs +55 -52
  937. package/dist/esm/theme/scale/scaleCss.mjs.map +1 -1
  938. package/dist/esm/theme/scale/scaleCss.native.js +148 -160
  939. package/dist/esm/theme/scale/scaleCss.native.js.map +1 -1
  940. package/dist/esm/theme/scale/scaleFonts.mjs +51 -49
  941. package/dist/esm/theme/scale/scaleFonts.mjs.map +1 -1
  942. package/dist/esm/theme/scale/scaleFonts.native.js +105 -114
  943. package/dist/esm/theme/scale/scaleFonts.native.js.map +1 -1
  944. package/dist/esm/theme/scale/scaleInputs.mjs +231 -159
  945. package/dist/esm/theme/scale/scaleInputs.mjs.map +1 -1
  946. package/dist/esm/theme/scale/scaleInputs.native.js +233 -161
  947. package/dist/esm/theme/scale/scaleInputs.native.js.map +1 -1
  948. package/dist/esm/theme/scale/themeScales.mjs +103 -92
  949. package/dist/esm/theme/scale/themeScales.mjs.map +1 -1
  950. package/dist/esm/theme/scale/themeScales.native.js +146 -138
  951. package/dist/esm/theme/scale/themeScales.native.js.map +1 -1
  952. package/dist/esm/theme/scale/useActiveScale.mjs +36 -34
  953. package/dist/esm/theme/scale/useActiveScale.mjs.map +1 -1
  954. package/dist/esm/theme/scale/useActiveScale.native.js +42 -40
  955. package/dist/esm/theme/scale/useActiveScale.native.js.map +1 -1
  956. package/dist/esm/theme/schemeStore.mjs +39 -37
  957. package/dist/esm/theme/schemeStore.mjs.map +1 -1
  958. package/dist/esm/theme/schemeStore.native.js +52 -50
  959. package/dist/esm/theme/schemeStore.native.js.map +1 -1
  960. package/dist/esm/theme/shared.mjs +77 -76
  961. package/dist/esm/theme/shared.mjs.map +1 -1
  962. package/dist/esm/theme/shared.native.js +113 -116
  963. package/dist/esm/theme/shared.native.js.map +1 -1
  964. package/dist/esm/theme/sizeRecipes.mjs +76 -69
  965. package/dist/esm/theme/sizeRecipes.mjs.map +1 -1
  966. package/dist/esm/theme/sizeRecipes.native.js +136 -140
  967. package/dist/esm/theme/sizeRecipes.native.js.map +1 -1
  968. package/dist/esm/theme/subsetThemes.mjs +18 -17
  969. package/dist/esm/theme/subsetThemes.mjs.map +1 -1
  970. package/dist/esm/theme/subsetThemes.native.js +43 -44
  971. package/dist/esm/theme/subsetThemes.native.js.map +1 -1
  972. package/dist/esm/theme/theme.mjs +150 -143
  973. package/dist/esm/theme/theme.mjs.map +1 -1
  974. package/dist/esm/theme/theme.native.js +1 -2
  975. package/dist/esm/theme/themeValue.mjs +26 -15
  976. package/dist/esm/theme/themeValue.mjs.map +1 -1
  977. package/dist/esm/theme/themeValue.native.js +43 -34
  978. package/dist/esm/theme/themeValue.native.js.map +1 -1
  979. package/dist/esm/theme/tileSizes.mjs +111 -137
  980. package/dist/esm/theme/tileSizes.mjs.map +1 -1
  981. package/dist/esm/theme/tileSizes.native.js +134 -162
  982. package/dist/esm/theme/tileSizes.native.js.map +1 -1
  983. package/dist/esm/theme/tintHues.mjs +34 -4
  984. package/dist/esm/theme/tintHues.mjs.map +1 -1
  985. package/dist/esm/theme/tintHues.native.js +34 -4
  986. package/dist/esm/theme/tintHues.native.js.map +1 -1
  987. package/dist/esm/theme/tokenNumber.mjs +6 -4
  988. package/dist/esm/theme/tokenNumber.mjs.map +1 -1
  989. package/dist/esm/theme/tokenNumber.native.js +8 -6
  990. package/dist/esm/theme/tokenNumber.native.js.map +1 -1
  991. package/dist/esm/theme/touchManipulation.mjs +17 -1
  992. package/dist/esm/theme/touchManipulation.mjs.map +1 -1
  993. package/dist/esm/theme/touchManipulation.native.js +17 -1
  994. package/dist/esm/theme/touchManipulation.native.js.map +1 -1
  995. package/dist/esm/theme/transitionProps.mjs +19 -19
  996. package/dist/esm/theme/transitionProps.mjs.map +1 -1
  997. package/dist/esm/theme/transitionProps.native.js +1 -2
  998. package/dist/esm/theme/usePresetSwitch.mjs +34 -35
  999. package/dist/esm/theme/usePresetSwitch.mjs.map +1 -1
  1000. package/dist/esm/theme/usePresetSwitch.native.js +1 -2
  1001. package/dist/esm/theme/useResolvedKnobs.mjs +121 -105
  1002. package/dist/esm/theme/useResolvedKnobs.mjs.map +1 -1
  1003. package/dist/esm/theme/useResolvedKnobs.native.js +139 -130
  1004. package/dist/esm/theme/useResolvedKnobs.native.js.map +1 -1
  1005. package/dist/esm/theme/useSchemePreference.mjs +14 -12
  1006. package/dist/esm/theme/useSchemePreference.mjs.map +1 -1
  1007. package/dist/esm/theme/useSchemePreference.native.js +1 -2
  1008. package/dist/esm/theme/useTheme.mjs +136 -117
  1009. package/dist/esm/theme/useTheme.mjs.map +1 -1
  1010. package/dist/esm/theme/useTheme.native.js +55 -56
  1011. package/dist/esm/theme/useTheme.native.js.map +1 -1
  1012. package/dist/esm/theme/useTouchSurface.mjs +4 -2
  1013. package/dist/esm/theme/useTouchSurface.mjs.map +1 -1
  1014. package/dist/esm/theme/useTouchSurface.native.js +4 -2
  1015. package/dist/esm/theme/useTouchSurface.native.js.map +1 -1
  1016. package/dist/esm/theme/v3TokenRoles.mjs +36 -35
  1017. package/dist/esm/theme/v3TokenRoles.mjs.map +1 -1
  1018. package/dist/esm/theme/v3TokenRoles.native.js +36 -35
  1019. package/dist/esm/theme/v3TokenRoles.native.js.map +1 -1
  1020. package/dist/esm/theme/v5Palettes.mjs +265 -0
  1021. package/dist/esm/theme/v5Palettes.mjs.map +1 -0
  1022. package/dist/esm/theme/v5Palettes.native.js +303 -0
  1023. package/dist/esm/theme/v5Palettes.native.js.map +1 -0
  1024. package/dist/esm/theme/v5Templates.mjs +97 -0
  1025. package/dist/esm/theme/v5Templates.mjs.map +1 -0
  1026. package/dist/esm/theme/v5Templates.native.js +101 -0
  1027. package/dist/esm/theme/v5Templates.native.js.map +1 -0
  1028. package/package.json +25 -27
  1029. package/src/audit/constraintAudit.spec.ts +15 -15
  1030. package/src/audit/constraintAudit.ts +6 -6
  1031. package/src/devWarn.spec.ts +10 -1
  1032. package/src/devWarn.ts +12 -2
  1033. package/src/expo.spec.ts +1 -1
  1034. package/src/expoConfig.spec.ts +6 -13
  1035. package/src/figma/figmaTokens.spec.ts +23 -22
  1036. package/src/figma/figmaTokens.ts +26 -12
  1037. package/src/fonts/createFontLoader.ts +27 -9
  1038. package/src/index.gnome.ts +21 -4
  1039. package/src/index.ts +17 -1
  1040. package/src/keyboardFocusRing.ts +4 -4
  1041. package/src/menuRow.palette.spec.ts +8 -8
  1042. package/src/menuRow.spec.ts +29 -17
  1043. package/src/menuRow.ts +21 -15
  1044. package/src/stateInTheValue.spec.tsx +136 -0
  1045. package/src/tamaguiProvides.spec.tsx +76 -0
  1046. package/src/theme/FontKnobStyles.tsx +2 -2
  1047. package/src/theme/Heading.titleCap.spec.tsx +78 -0
  1048. package/src/theme/Heading.tsx +2 -2
  1049. package/src/theme/IconSlot.spec.tsx +2 -2
  1050. package/src/theme/Intent.stories.tsx +7 -7
  1051. package/src/theme/Preset.stories.tsx +7 -7
  1052. package/src/theme/Surface.spec.tsx +34 -31
  1053. package/src/theme/Surface.stories.tsx +2 -2
  1054. package/src/theme/Surface.tsx +19 -17
  1055. package/src/theme/Text.tsx +58 -17
  1056. package/src/theme/ThemeProvider.stories.tsx +4 -6
  1057. package/src/theme/Tint.stories.tsx +8 -8
  1058. package/src/theme/accentFloor.spec.ts +21 -16
  1059. package/src/theme/accentHue.spec.ts +30 -27
  1060. package/src/theme/accentHue.ts +2 -2
  1061. package/src/theme/accentInk.ts +11 -11
  1062. package/src/theme/accentIntentInk.spec.ts +6 -6
  1063. package/src/theme/accentOnSurface.flip.spec.tsx +3 -5
  1064. package/src/theme/accentOnSurface.palette.spec.tsx +2 -2
  1065. package/src/theme/accentOnSurface.spec.tsx +4 -4
  1066. package/src/theme/activateThemeConfig.ts +0 -4
  1067. package/src/theme/animations/animations.spec.ts +58 -7
  1068. package/src/theme/animations/css.ts +1 -1
  1069. package/src/theme/animations/index.ts +4 -0
  1070. package/src/theme/animations/reactNative.ts +0 -3
  1071. package/src/theme/bodyLeading.theme.spec.tsx +130 -0
  1072. package/src/theme/boundaryFloor.spec.ts +14 -12
  1073. package/src/theme/cardLift.native.spec.ts +34 -0
  1074. package/src/theme/chartCategoricalSeverity.spec.ts +8 -8
  1075. package/src/theme/chartPalette.spec.ts +8 -8
  1076. package/src/theme/chartPalette.ts +7 -7
  1077. package/src/theme/colorRules.spec.ts +15 -15
  1078. package/src/theme/colorRules.ts +1 -1
  1079. package/src/theme/colorThemeAccent.spec.ts +19 -16
  1080. package/src/theme/composeKnobs.spec.ts +332 -0
  1081. package/src/theme/composeKnobs.ts +223 -0
  1082. package/src/theme/controlEdges.spec.ts +9 -9
  1083. package/src/theme/controlSizing.render.spec.tsx +96 -0
  1084. package/src/theme/controlSizing.spec.ts +171 -0
  1085. package/src/theme/controlSizing.ts +198 -0
  1086. package/src/theme/controlTiers.ts +8 -8
  1087. package/src/theme/createDefaultThemeConfig.spec.ts +75 -67
  1088. package/src/theme/createDefaultThemeConfig.ts +11 -5
  1089. package/src/theme/createThemeConfig.spec.ts +4 -5
  1090. package/src/theme/createThemes.spec.ts +19 -17
  1091. package/src/theme/createThemes.ts +511 -305
  1092. package/src/theme/defaults/accent.ts +1 -1
  1093. package/src/theme/defaults/base.ts +1 -1
  1094. package/src/theme/defaults/builderOptions.ts +43 -40
  1095. package/src/theme/defaults/fonts.spec.ts +14 -11
  1096. package/src/theme/defaults/fonts.theme.spec.tsx +3 -3
  1097. package/src/theme/defaults/fonts.ts +2 -5
  1098. package/src/theme/defaults/interFont.spec.ts +91 -0
  1099. package/src/theme/defaults/interFont.ts +50 -0
  1100. package/src/theme/defaults/neutralRamp.spec.ts +4 -3
  1101. package/src/theme/defaults/secondaryInk.spec.ts +41 -41
  1102. package/src/theme/devtools/ColorLineVisualizer.spec.tsx +3 -3
  1103. package/src/theme/devtools/ColorLineVisualizer.tsx +2 -2
  1104. package/src/theme/devtools/buildSnapshot.spec.ts +2 -2
  1105. package/src/theme/devtools/buildSnapshot.ts +2 -2
  1106. package/src/theme/dropTarget.spec.ts +12 -6
  1107. package/src/theme/fieldEdge.spec.ts +6 -6
  1108. package/src/theme/fieldFocus.spec.ts +12 -12
  1109. package/src/theme/fieldFocus.ts +3 -3
  1110. package/src/theme/fillContrast.spec.ts +13 -13
  1111. package/src/theme/fillContrast.ts +11 -8
  1112. package/src/theme/focusState.spec.ts +142 -27
  1113. package/src/theme/focusState.ts +69 -3
  1114. package/src/theme/focusVisibleRing.spec.tsx +186 -0
  1115. package/src/theme/glyphPaint.spec.ts +10 -8
  1116. package/src/theme/glyphPaint.ts +2 -2
  1117. package/src/theme/glyphTint.fillInk.spec.ts +98 -0
  1118. package/src/theme/glyphTint.ts +44 -1
  1119. package/src/theme/hairline.native.ts +2 -2
  1120. package/src/theme/hairline.spec.ts +2 -2
  1121. package/src/theme/hairline.ts +2 -2
  1122. package/src/theme/hairlineToken.spec.ts +37 -34
  1123. package/src/theme/houseGround.spec.ts +18 -14
  1124. package/src/theme/index.ts +2 -0
  1125. package/src/theme/intent.spec.tsx +7 -7
  1126. package/src/theme/intentFill.spec.ts +9 -3
  1127. package/src/theme/layoutTokens.spec.ts +2 -2
  1128. package/src/theme/layoutTokens.ts +2 -2
  1129. package/src/theme/layoutTokensHooks.spec.tsx +3 -3
  1130. package/src/theme/motion.spec.ts +30 -21
  1131. package/src/theme/mpo13Proof.spec.ts +15 -15
  1132. package/src/theme/mpo19Proof.spec.ts +64 -41
  1133. package/src/theme/namedInkFloor.spec.ts +14 -13
  1134. package/src/theme/nativeTheme.tsx +4 -7
  1135. package/src/theme/nativeTransitionProps.ts +11 -12
  1136. package/src/theme/oneThemeEngine.spec.ts +6 -6
  1137. package/src/theme/overlayChroma.spec.ts +4 -4
  1138. package/src/theme/overlayFill.ts +3 -3
  1139. package/src/theme/overlaySurfaces.focus.spec.tsx +29 -25
  1140. package/src/theme/overlaySurfaces.tsx +50 -56
  1141. package/src/theme/pageGutter.spec.tsx +8 -6
  1142. package/src/theme/pageGutter.tsx +3 -3
  1143. package/src/theme/presetPreview.ts +3 -3
  1144. package/src/theme/radiusClass.spec.ts +16 -12
  1145. package/src/theme/radiusClass.ts +1 -1
  1146. package/src/theme/rampRoles.spec.ts +4 -4
  1147. package/src/theme/ramps.spec.ts +8 -10
  1148. package/src/theme/ramps.ts +15 -13
  1149. package/src/theme/readableColor.hooks.spec.tsx +40 -25
  1150. package/src/theme/readableColor.ts +13 -13
  1151. package/src/theme/recipeInputs.ts +26 -27
  1152. package/src/theme/recipes.ts +27 -24
  1153. package/src/theme/resolveFontTokenFamily.spec.ts +2 -2
  1154. package/src/theme/resolveKnobs.spec.ts +239 -253
  1155. package/src/theme/resolveKnobs.ts +184 -171
  1156. package/src/theme/rowStates.spec.ts +12 -12
  1157. package/src/theme/rowStates.ts +5 -5
  1158. package/src/theme/scale/activeScale.spec.ts +2 -2
  1159. package/src/theme/scale/activeScale.ts +2 -4
  1160. package/src/theme/scale/deriveRecipeInputs.ts +12 -18
  1161. package/src/theme/scale/generateScale.spec.ts +42 -44
  1162. package/src/theme/scale/generateScale.ts +3 -3
  1163. package/src/theme/scale/installScaleConfig.native.spec.ts +6 -5
  1164. package/src/theme/scale/installScaleConfig.native.ts +0 -3
  1165. package/src/theme/scale/scaleCss.probe.spec.tsx +17 -11
  1166. package/src/theme/scale/scaleCss.spec.ts +7 -9
  1167. package/src/theme/scale/scaleCss.ts +3 -7
  1168. package/src/theme/scale/scaleFonts.ts +1 -1
  1169. package/src/theme/scale/scaleInputs.ts +120 -140
  1170. package/src/theme/scale/themeScales.ts +36 -10
  1171. package/src/theme/scale/useActiveScale.spec.tsx +4 -4
  1172. package/src/theme/scrimTokens.spec.ts +12 -9
  1173. package/src/theme/selectedState.spec.ts +32 -30
  1174. package/src/theme/selectionFill.spec.ts +13 -13
  1175. package/src/theme/semanticEntryText.spec.ts +12 -6
  1176. package/src/theme/severityChannel.spec.ts +10 -10
  1177. package/src/theme/shared.tsx +1 -8
  1178. package/src/theme/sheetGrabber.spec.ts +1 -1
  1179. package/src/theme/sheetHandle.spec.ts +4 -4
  1180. package/src/theme/sizeLadder.spec.ts +9 -9
  1181. package/src/theme/sizeRecipes.spec.ts +75 -74
  1182. package/src/theme/sizeRecipes.ts +8 -7
  1183. package/src/theme/switchThumb.spec.ts +24 -20
  1184. package/src/theme/syntaxFloor.spec.ts +7 -7
  1185. package/src/theme/theme.palette.spec.tsx +3 -3
  1186. package/src/theme/theme.tsx +4 -7
  1187. package/src/theme/themeValue.spec.ts +7 -7
  1188. package/src/theme/tokenNumber.spec.tsx +13 -4
  1189. package/src/theme/tokenNumber.ts +4 -4
  1190. package/src/theme/transitionProps.spec.ts +18 -30
  1191. package/src/theme/transitionProps.ts +13 -20
  1192. package/src/theme/useResolvedKnobs.ts +7 -7
  1193. package/src/theme/useResolvedKnobsBehavior.spec.tsx +20 -8
  1194. package/src/theme/v3TokenRoles.ts +23 -23
  1195. package/src/theme/v5Palettes.ts +300 -0
  1196. package/src/theme/v5Templates.ts +133 -0
  1197. package/types/devWarn.d.ts +1 -1
  1198. package/types/devWarn.d.ts.map +1 -1
  1199. package/types/figma/figmaTokens.d.ts +1 -1
  1200. package/types/figma/figmaTokens.d.ts.map +1 -1
  1201. package/types/fonts/createFontLoader.d.ts.map +1 -1
  1202. package/types/index.d.ts +9 -1
  1203. package/types/index.d.ts.map +1 -1
  1204. package/types/index.gnome.d.ts +12 -8
  1205. package/types/index.gnome.d.ts.map +1 -1
  1206. package/types/keyboardFocusRing.d.ts +2 -2
  1207. package/types/keyboardFocusRing.d.ts.map +1 -1
  1208. package/types/menuRow.d.ts +20 -15
  1209. package/types/menuRow.d.ts.map +1 -1
  1210. package/types/theme/Heading.d.ts +7 -7
  1211. package/types/theme/Heading.d.ts.map +1 -1
  1212. package/types/theme/Intent.d.ts +1 -1
  1213. package/types/theme/Intent.d.ts.map +1 -1
  1214. package/types/theme/Preset.d.ts +1 -1
  1215. package/types/theme/Preset.d.ts.map +1 -1
  1216. package/types/theme/Surface.d.ts +12 -12
  1217. package/types/theme/Surface.d.ts.map +1 -1
  1218. package/types/theme/Text.d.ts +4 -4
  1219. package/types/theme/Text.d.ts.map +1 -1
  1220. package/types/theme/Tint.d.ts +1 -1
  1221. package/types/theme/Tint.d.ts.map +1 -1
  1222. package/types/theme/accentInk.d.ts +1 -1
  1223. package/types/theme/accentInk.d.ts.map +1 -1
  1224. package/types/theme/activateThemeConfig.d.ts.map +1 -1
  1225. package/types/theme/animations/css.d.ts +1 -1
  1226. package/types/theme/animations/index.d.ts +126 -0
  1227. package/types/theme/animations/index.d.ts.map +1 -1
  1228. package/types/theme/animations/reactNative.d.ts +0 -126
  1229. package/types/theme/animations/reactNative.d.ts.map +1 -1
  1230. package/types/theme/colorRules.d.ts +1 -1
  1231. package/types/theme/colorRules.d.ts.map +1 -1
  1232. package/types/theme/composeKnobs.d.ts +56 -0
  1233. package/types/theme/composeKnobs.d.ts.map +1 -0
  1234. package/types/theme/controlSizing.d.ts +78 -0
  1235. package/types/theme/controlSizing.d.ts.map +1 -0
  1236. package/types/theme/createDefaultThemeConfig.d.ts.map +1 -1
  1237. package/types/theme/createThemes.d.ts +157 -387
  1238. package/types/theme/createThemes.d.ts.map +1 -1
  1239. package/types/theme/defaults/builderOptions.d.ts +3 -3
  1240. package/types/theme/defaults/builderOptions.d.ts.map +1 -1
  1241. package/types/theme/defaults/fonts.d.ts +6 -18
  1242. package/types/theme/defaults/fonts.d.ts.map +1 -1
  1243. package/types/theme/defaults/interFont.d.ts +39 -0
  1244. package/types/theme/defaults/interFont.d.ts.map +1 -0
  1245. package/types/theme/devtools/ThemeDevtoolsPanel.d.ts +1 -1
  1246. package/types/theme/devtools/ThemeDevtoolsPanel.d.ts.map +1 -1
  1247. package/types/theme/fieldFocus.d.ts +2 -2
  1248. package/types/theme/fieldFocus.d.ts.map +1 -1
  1249. package/types/theme/fillContrast.d.ts.map +1 -1
  1250. package/types/theme/focusState.d.ts +41 -0
  1251. package/types/theme/focusState.d.ts.map +1 -1
  1252. package/types/theme/glyphTint.d.ts +22 -0
  1253. package/types/theme/glyphTint.d.ts.map +1 -1
  1254. package/types/theme/hairline.d.ts +2 -2
  1255. package/types/theme/hairline.native.d.ts +2 -2
  1256. package/types/theme/index.d.ts +2 -0
  1257. package/types/theme/index.d.ts.map +1 -1
  1258. package/types/theme/layoutTokens.d.ts +1 -1
  1259. package/types/theme/layoutTokens.d.ts.map +1 -1
  1260. package/types/theme/nativeTheme.d.ts +1 -1
  1261. package/types/theme/nativeTheme.d.ts.map +1 -1
  1262. package/types/theme/nativeTransitionProps.d.ts +0 -1
  1263. package/types/theme/nativeTransitionProps.d.ts.map +1 -1
  1264. package/types/theme/overlayFill.d.ts +1 -1
  1265. package/types/theme/overlaySurfaces.d.ts +13 -18
  1266. package/types/theme/overlaySurfaces.d.ts.map +1 -1
  1267. package/types/theme/pageGutter.d.ts +3 -3
  1268. package/types/theme/pageGutter.d.ts.map +1 -1
  1269. package/types/theme/ramps.d.ts +4 -0
  1270. package/types/theme/ramps.d.ts.map +1 -1
  1271. package/types/theme/recipeInputs.d.ts +11 -11
  1272. package/types/theme/recipeInputs.d.ts.map +1 -1
  1273. package/types/theme/recipes.d.ts +29 -27
  1274. package/types/theme/recipes.d.ts.map +1 -1
  1275. package/types/theme/resolveKnobs.d.ts +28 -28
  1276. package/types/theme/resolveKnobs.d.ts.map +1 -1
  1277. package/types/theme/rowStates.d.ts +1 -1
  1278. package/types/theme/rowStates.d.ts.map +1 -1
  1279. package/types/theme/scale/ScaleStyles.d.ts +1 -1
  1280. package/types/theme/scale/ScaleStyles.d.ts.map +1 -1
  1281. package/types/theme/scale/activeScale.d.ts.map +1 -1
  1282. package/types/theme/scale/deriveRecipeInputs.d.ts.map +1 -1
  1283. package/types/theme/scale/installScaleConfig.native.d.ts.map +1 -1
  1284. package/types/theme/scale/scaleCss.d.ts.map +1 -1
  1285. package/types/theme/scale/scaleInputs.d.ts +12 -12
  1286. package/types/theme/scale/scaleInputs.d.ts.map +1 -1
  1287. package/types/theme/scale/themeScales.d.ts +1 -1
  1288. package/types/theme/scale/themeScales.d.ts.map +1 -1
  1289. package/types/theme/shared.d.ts.map +1 -1
  1290. package/types/theme/sizeRecipes.d.ts +5 -5
  1291. package/types/theme/sizeRecipes.d.ts.map +1 -1
  1292. package/types/theme/theme.d.ts +1 -1
  1293. package/types/theme/theme.d.ts.map +1 -1
  1294. package/types/theme/tokenNumber.d.ts +2 -2
  1295. package/types/theme/tokenNumber.d.ts.map +1 -1
  1296. package/types/theme/transitionProps.d.ts +3 -3
  1297. package/types/theme/transitionProps.d.ts.map +1 -1
  1298. package/types/theme/useResolvedKnobs.d.ts +2 -2
  1299. package/types/theme/v3TokenRoles.d.ts +23 -23
  1300. package/types/theme/v5Palettes.d.ts +45 -0
  1301. package/types/theme/v5Palettes.d.ts.map +1 -0
  1302. package/types/theme/v5Templates.d.ts +191 -0
  1303. package/types/theme/v5Templates.d.ts.map +1 -0
  1304. package/dist/cjs/theme/mergedTokens.cjs +0 -39
  1305. package/dist/cjs/theme/mergedTokens.native.js +0 -61
  1306. package/dist/cjs/theme/mergedTokens.native.js.map +0 -1
  1307. package/dist/esm/audit/index.mjs.map +0 -1
  1308. package/dist/esm/audit/index.native.js.map +0 -1
  1309. package/dist/esm/fonts/index.mjs.map +0 -1
  1310. package/dist/esm/fonts/index.native.js.map +0 -1
  1311. package/dist/esm/fonts/types.mjs.map +0 -1
  1312. package/dist/esm/fonts/types.native.js.map +0 -1
  1313. package/dist/esm/index.gnome.mjs.map +0 -1
  1314. package/dist/esm/index.gnome.native.js.map +0 -1
  1315. package/dist/esm/index.mjs.map +0 -1
  1316. package/dist/esm/index.native.js.map +0 -1
  1317. package/dist/esm/nativeTwins.mjs.map +0 -1
  1318. package/dist/esm/nativeTwins.native.js.map +0 -1
  1319. package/dist/esm/theme/animations/index.mjs.map +0 -1
  1320. package/dist/esm/theme/defaults/index.mjs.map +0 -1
  1321. package/dist/esm/theme/defaults/index.native.js.map +0 -1
  1322. package/dist/esm/theme/devtools/index.mjs.map +0 -1
  1323. package/dist/esm/theme/devtools/index.native.js.map +0 -1
  1324. package/dist/esm/theme/index.mjs.map +0 -1
  1325. package/dist/esm/theme/index.native.js.map +0 -1
  1326. package/dist/esm/theme/mergedTokens.mjs +0 -14
  1327. package/dist/esm/theme/mergedTokens.mjs.map +0 -1
  1328. package/dist/esm/theme/mergedTokens.native.js +0 -33
  1329. package/dist/esm/theme/mergedTokens.native.js.map +0 -1
  1330. package/dist/esm/theme/preset.types.mjs.map +0 -1
  1331. package/dist/esm/theme/preset.types.native.js.map +0 -1
  1332. package/dist/esm/theme/recipes.mjs.map +0 -1
  1333. package/dist/esm/theme/recipes.native.js.map +0 -1
  1334. package/dist/esm/theme/scale/index.mjs.map +0 -1
  1335. package/dist/esm/theme/scale/index.native.js.map +0 -1
  1336. package/dist/esm/theme/theme.native.js.map +0 -1
  1337. package/dist/esm/theme/transitionProps.native.js.map +0 -1
  1338. package/dist/esm/theme/usePresetSwitch.native.js.map +0 -1
  1339. package/dist/esm/theme/useSchemePreference.native.js.map +0 -1
  1340. package/src/theme/mergedTokens.ts +0 -20
  1341. package/types/theme/mergedTokens.d.ts +0 -11
  1342. package/types/theme/mergedTokens.d.ts.map +0 -1
@@ -5,46 +5,38 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
30
25
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
27
  var createThemes_exports = {};
35
28
  __export(createThemes_exports, {
36
- createThemesBuilder: () => createThemesBuilder,
37
- houseComponentThemes: () => houseComponentThemes,
38
- houseGrandChildrenThemes: () => houseGrandChildrenThemes,
39
- houseTemplates: () => houseTemplates,
40
- intentInkFloor: () => intentInkFloor,
41
- postPassThemeKeys: () => postPassThemeKeys,
42
- tintHueNames: () => import_tintHues.tintHueNames
29
+ createThemesBuilder: () => createThemesBuilder,
30
+ houseComponentThemes: () => houseComponentThemes,
31
+ houseGrandChildrenThemes: () => houseGrandChildrenThemes,
32
+ houseTemplates: () => houseTemplates,
33
+ intentInkFloor: () => intentInkFloor,
34
+ postPassThemeKeys: () => postPassThemeKeys,
35
+ tintHueNames: () => import_tintHues.tintHueNames
43
36
  });
44
37
  module.exports = __toCommonJS(createThemes_exports);
45
38
  var Colors = __toESM(require("@tamagui/colors"));
46
- var import_theme_builder = require("@tamagui/theme-builder");
47
- var import_v5 = require("@tamagui/themes/v5");
39
+ var import_builder = require("@tamagui/themes/builder");
48
40
  var import_colorRules = require("./colorRules.cjs");
49
41
  var import_base = require("./defaults/base.cjs");
50
42
  var import_builderOptions = require("./defaults/builderOptions.cjs");
@@ -52,1099 +44,1187 @@ var import_ramps = require("./ramps.cjs");
52
44
  var import_accentInk = require("./accentInk.cjs");
53
45
  var import_dedupeInherited = require("./dedupeInherited.cjs");
54
46
  var import_tintHues = require("./tintHues.cjs");
47
+ var import_v5Palettes = require("./v5Palettes.cjs");
48
+ var import_v5Templates = require("./v5Templates.cjs");
55
49
  const intentInkFloor = {
56
- /** Stored hsla(35, 98%, 32%, 1); amber at OKLCH hue 64, 4.70:1 on $color2 (LC-288). */
57
- warning: "#a25f02",
58
- /** Stored hsla(154, 63%, 31%, 1); 4.53:1 on $color2, dE76 0.82. */
59
- success: "#1d8156"
50
+ /** Stored hsla(35, 98%, 32%, 1); amber at OKLCH hue 64, 4.70:1 on $color-2 (LC-288). */
51
+ warning: "#a25f02",
52
+ /** Stored hsla(154, 63%, 31%, 1); 4.53:1 on $color-2, dE76 0.82. */
53
+ success: "#1d8156"
60
54
  };
61
55
  function withIntentInkFloor(palette, ink) {
62
- if (palette.length !== 12) return palette;
63
- const stepped = [...palette];
64
- stepped[10] = ink;
65
- return stepped;
56
+ if (palette.length !== 12) return palette;
57
+ const stepped = [...palette];
58
+ stepped[10] = ink;
59
+ return stepped;
66
60
  }
67
61
  const warningPalette = {
68
- dark: Object.values(Colors.amberDark),
69
- light: withIntentInkFloor(Object.values(Colors.amber), intentInkFloor.warning)
62
+ dark: Object.values(Colors.amberDark),
63
+ light: withIntentInkFloor(Object.values(Colors.amber), intentInkFloor.warning)
70
64
  };
71
65
  const severityFillContrast = 3;
72
66
  function pickSeverityFill(themes, scheme, severity) {
73
- const scope = themes[`${scheme}_${severity}`];
74
- if (!scope) return void 0;
75
- const tracks = Object.keys(themes).filter(name => new RegExp(`^${scheme}(_[a-z]+)?$`).test(name)).filter(name => !/_(warning|error|success|accent)$/.test(name)).map(name => luminanceOf(themes[name]?.color4)).filter(value => value != null);
76
- for (const step of [9, 10, 11]) {
77
- const fill = luminanceOf(scope[`color${step}`]);
78
- if (fill == null) continue;
79
- if (tracks.every(track => (0, import_colorRules.contrastRatio)(fill, track) >= severityFillContrast)) {
80
- return scope[`color${step}`];
81
- }
82
- }
83
- return scope.color11;
67
+ const scope = themes[`${scheme}_${severity}`];
68
+ if (!scope) return void 0;
69
+ const tracks = Object.keys(themes).filter((name) => new RegExp(`^${scheme}(_[a-z]+)?$`).test(name)).filter((name) => !/_(warning|error|success|accent)$/.test(name)).map((name) => luminanceOf(themes[name]?.["color-4"])).filter((value) => value != null);
70
+ for (const step of [
71
+ 9,
72
+ 10,
73
+ 11
74
+ ]) {
75
+ const fill = luminanceOf(scope[`color-${step}`]);
76
+ if (fill == null) continue;
77
+ if (tracks.every((track) => (0, import_colorRules.contrastRatio)(fill, track) >= severityFillContrast)) {
78
+ return scope[`color-${step}`];
79
+ }
80
+ }
81
+ return scope["color-11"];
84
82
  }
85
83
  function holdWarningRoleKeys(themes) {
86
- for (const scheme of ["light", "dark"]) {
87
- const root = themes[scheme];
88
- const warning = themes[`${scheme}_warning`];
89
- if (!root || !warning) continue;
90
- Object.assign(root, {
91
- warningSoft: warning.color3,
92
- warningMark: warning.color9,
93
- warningInk: warning.color11,
94
- warningFill: pickSeverityFill(themes, scheme, "warning"),
95
- errorFill: pickSeverityFill(themes, scheme, "error"),
96
- successFill: pickSeverityFill(themes, scheme, "success")
97
- });
98
- }
99
- return themes;
84
+ for (const scheme of ["light", "dark"]) {
85
+ const root = themes[scheme];
86
+ const warning = themes[`${scheme}_warning`];
87
+ if (!root || !warning) continue;
88
+ Object.assign(root, {
89
+ "warning-soft": warning["color-3"],
90
+ "warning-mark": warning["color-9"],
91
+ "warning-ink": warning["color-11"],
92
+ "warning-fill": pickSeverityFill(themes, scheme, "warning"),
93
+ "error-fill": pickSeverityFill(themes, scheme, "error"),
94
+ "success-fill": pickSeverityFill(themes, scheme, "success")
95
+ });
96
+ }
97
+ return themes;
100
98
  }
101
99
  const lightSurfaceGrouped = {
102
- ...import_v5.v5Templates.light_surface1,
103
- background: import_theme_builder.PALETTE_BACKGROUND_OFFSET,
104
- backgroundHover: import_theme_builder.PALETTE_BACKGROUND_OFFSET + 1,
105
- backgroundPress: import_theme_builder.PALETTE_BACKGROUND_OFFSET + 2,
106
- backgroundFocus: import_theme_builder.PALETTE_BACKGROUND_OFFSET,
107
- backgroundActive: import_theme_builder.PALETTE_BACKGROUND_OFFSET
100
+ ...import_v5Templates.v5Templates.light_surface1,
101
+ background: import_v5Palettes.PALETTE_BACKGROUND_OFFSET,
102
+ "background-hover": import_v5Palettes.PALETTE_BACKGROUND_OFFSET + 1,
103
+ "background-press": import_v5Palettes.PALETTE_BACKGROUND_OFFSET + 2,
104
+ "background-focus": import_v5Palettes.PALETTE_BACKGROUND_OFFSET,
105
+ "background-active": import_v5Palettes.PALETTE_BACKGROUND_OFFSET
108
106
  };
109
- const fillKeys = ["background", "backgroundHover", "backgroundPress", "backgroundFocus", "backgroundActive"];
110
- const edgeKeys = ["borderColor", "borderColorHover", "borderColorFocus", "borderColorPress"];
107
+ const fillKeys = [
108
+ "background",
109
+ "background-hover",
110
+ "background-press",
111
+ "background-focus",
112
+ "background-active"
113
+ ];
114
+ const edgeKeys = [
115
+ "border-color",
116
+ "border-color-hover",
117
+ "border-color-focus",
118
+ "border-color-press"
119
+ ];
111
120
  function liftOneStep(template) {
112
- const lifted = {
113
- ...template
114
- };
115
- for (const key of [...fillKeys, ...edgeKeys]) lifted[key] = template[key] + 1;
116
- return lifted;
121
+ const lifted = { ...template };
122
+ for (const key of [...fillKeys, ...edgeKeys]) lifted[key] = template[key] + 1;
123
+ return lifted;
117
124
  }
118
125
  const darkSurfaceGrouped = {
119
- ...liftOneStep(import_v5.v5Templates.dark_surface1),
120
- selectFill: import_theme_builder.PALETTE_BACKGROUND_OFFSET + 4,
121
- selectPress: import_theme_builder.PALETTE_BACKGROUND_OFFSET + 5
126
+ ...liftOneStep(import_v5Templates.v5Templates.dark_surface1),
127
+ "select-fill": import_v5Palettes.PALETTE_BACKGROUND_OFFSET + 4,
128
+ "select-press": import_v5Palettes.PALETTE_BACKGROUND_OFFSET + 5
122
129
  };
123
130
  const darkBasePage = {
124
- ...import_v5.v5Templates.dark_base,
125
- background: import_theme_builder.PALETTE_BACKGROUND_OFFSET,
126
- backgroundActive: import_theme_builder.PALETTE_BACKGROUND_OFFSET,
127
- backgroundFocus: import_theme_builder.PALETTE_BACKGROUND_OFFSET + 1,
128
- backgroundHover: import_theme_builder.PALETTE_BACKGROUND_OFFSET + 1,
129
- backgroundPress: import_theme_builder.PALETTE_BACKGROUND_OFFSET + 1
131
+ ...import_v5Templates.v5Templates.dark_base,
132
+ background: import_v5Palettes.PALETTE_BACKGROUND_OFFSET,
133
+ "background-active": import_v5Palettes.PALETTE_BACKGROUND_OFFSET,
134
+ "background-focus": import_v5Palettes.PALETTE_BACKGROUND_OFFSET + 1,
135
+ "background-hover": import_v5Palettes.PALETTE_BACKGROUND_OFFSET + 1,
136
+ "background-press": import_v5Palettes.PALETTE_BACKGROUND_OFFSET + 1
130
137
  };
131
138
  const houseTemplates = {
132
- ...import_v5.v5Templates,
133
- light_surface1: lightSurfaceGrouped,
134
- dark_base: darkBasePage,
135
- dark_surface1: darkSurfaceGrouped,
136
- dark_surface2: liftOneStep(import_v5.v5Templates.dark_surface2)
139
+ ...import_v5Templates.v5Templates,
140
+ light_surface1: lightSurfaceGrouped,
141
+ dark_base: darkBasePage,
142
+ dark_surface1: darkSurfaceGrouped,
143
+ dark_surface2: liftOneStep(import_v5Templates.v5Templates.dark_surface2)
137
144
  };
138
145
  const houseComponentThemes = {
139
- Button: {
140
- template: "surface2"
141
- },
142
- Input: {
143
- template: "surface1"
144
- },
145
- TextArea: {
146
- template: "surface1"
147
- },
148
- Progress: {
149
- template: "surface2"
150
- },
151
- ProgressIndicator: {
152
- template: "surface3"
153
- },
154
- Slider: {
155
- template: "surface2"
156
- },
157
- SliderActive: {
158
- template: "surface3"
159
- },
160
- SliderThumb: {
161
- template: "surface1"
162
- },
163
- Switch: {
164
- template: "surface2"
165
- },
166
- Card: {
167
- template: "surface1"
168
- },
169
- ListItem: {
170
- template: "surface1"
171
- },
172
- SelectTrigger: {
173
- template: "surface1"
174
- },
175
- SelectItem: {
176
- template: "surface1"
177
- },
178
- InputContainerFrame: {
179
- template: "surface1"
180
- }
146
+ Button: { template: "surface2" },
147
+ Input: { template: "surface1" },
148
+ TextArea: { template: "surface1" },
149
+ Progress: { template: "surface2" },
150
+ ProgressIndicator: { template: "surface3" },
151
+ Slider: { template: "surface2" },
152
+ SliderActive: { template: "surface3" },
153
+ SliderThumb: { template: "surface1" },
154
+ Switch: { template: "surface2" },
155
+ Card: { template: "surface1" },
156
+ ListItem: { template: "surface1" },
157
+ SelectTrigger: { template: "surface1" },
158
+ SelectItem: { template: "surface1" },
159
+ InputContainerFrame: { template: "surface1" }
181
160
  };
182
161
  const houseGrandChildrenThemes = {
183
- active: {
184
- template: "surface3"
185
- },
186
- alt1: {
187
- template: "surface1"
188
- },
189
- alt2: {
190
- template: "surface2"
191
- }
162
+ active: { template: "surface3" },
163
+ alt1: { template: "surface1" },
164
+ alt2: { template: "surface2" }
192
165
  };
193
166
  function sanitizeGetTheme(getTheme) {
194
- return props => {
195
- const out = {};
196
- for (const [key, value] of Object.entries(getTheme(props))) {
197
- if (value != null) out[key] = value;
198
- }
199
- return out;
200
- };
167
+ return (props) => {
168
+ const out = {};
169
+ for (const [key, value] of Object.entries(getTheme(props))) {
170
+ if (value != null) out[key] = value;
171
+ }
172
+ return out;
173
+ };
201
174
  }
202
- const tintNeutralTextKeys = ["color", "colorHover", "colorPress", "colorFocus", "color11", "color12", "placeholderColor"];
175
+ const tintNeutralTextKeys = [
176
+ "color",
177
+ "color-hover",
178
+ "color-press",
179
+ "color-focus",
180
+ "color-11",
181
+ "color-12",
182
+ "placeholder-color"
183
+ ];
203
184
  function neutralizeTintText(themes) {
204
- const out = {
205
- ...themes
206
- };
207
- for (const [name, theme] of Object.entries(themes)) {
208
- const scheme = (0, import_tintHues.tintThemeScheme)(name);
209
- if (!scheme) continue;
210
- const base = themes[scheme];
211
- if (!base) continue;
212
- const patched = {
213
- ...theme
214
- };
215
- for (const key of tintNeutralTextKeys) {
216
- if (key in patched && base[key] != null) patched[key] = base[key];
217
- }
218
- if (!("textMuted" in patched) && patched.color5 != null && base.textMuted != null) patched.textMuted = (0, import_builderOptions.pickSecondaryInk)(patched, base);
219
- out[name] = patched;
220
- }
221
- return out;
185
+ const out = { ...themes };
186
+ for (const [name, theme] of Object.entries(themes)) {
187
+ const scheme = (0, import_tintHues.tintThemeScheme)(name);
188
+ if (!scheme) continue;
189
+ const base = themes[scheme];
190
+ if (!base) continue;
191
+ const patched = { ...theme };
192
+ for (const key of tintNeutralTextKeys) {
193
+ if (key in patched && base[key] != null) patched[key] = base[key];
194
+ }
195
+ if (!("text-muted" in patched) && patched["color-5"] != null && base["text-muted"] != null) patched["text-muted"] = (0, import_builderOptions.pickSecondaryInk)(patched, base);
196
+ out[name] = patched;
197
+ }
198
+ return out;
222
199
  }
223
- const semanticIntentNames = /* @__PURE__ */new Set(["error", "warning", "success"]);
224
- const entryControlNames = /* @__PURE__ */new Set(["Input", "TextArea"]);
200
+ const semanticIntentNames = /* @__PURE__ */ new Set([
201
+ "error",
202
+ "warning",
203
+ "success"
204
+ ]);
205
+ const entryControlNames = /* @__PURE__ */ new Set(["Input", "TextArea"]);
225
206
  function neutralizeSemanticEntryText(themes) {
226
- const out = {
227
- ...themes
228
- };
229
- for (const [name, theme] of Object.entries(themes)) {
230
- const [scheme, intent, component, ...rest] = name.split("_");
231
- if (rest.length > 0 || scheme !== "light" && scheme !== "dark") continue;
232
- if (!intent || !semanticIntentNames.has(intent)) continue;
233
- const base = themes[scheme];
234
- if (!base) continue;
235
- if (component === void 0) {
236
- if (base.placeholderColor != null) out[name] = {
237
- ...theme,
238
- placeholderColor: base.placeholderColor
239
- };
240
- continue;
241
- }
242
- if (!entryControlNames.has(component)) continue;
243
- const neutral = {
244
- ...base,
245
- ...themes[`${scheme}_${component}`]
246
- };
247
- const patched = {
248
- ...theme
249
- };
250
- for (const key of tintNeutralTextKeys) {
251
- if (neutral[key] != null) patched[key] = neutral[key];
252
- }
253
- out[name] = patched;
254
- }
255
- return out;
207
+ const out = { ...themes };
208
+ for (const [name, theme] of Object.entries(themes)) {
209
+ const [scheme, intent, component, ...rest] = name.split("_");
210
+ if (rest.length > 0 || scheme !== "light" && scheme !== "dark") continue;
211
+ if (!intent || !semanticIntentNames.has(intent)) continue;
212
+ const base = themes[scheme];
213
+ if (!base) continue;
214
+ if (component === void 0) {
215
+ if (base["placeholder-color"] != null) out[name] = {
216
+ ...theme,
217
+ "placeholder-color": base["placeholder-color"]
218
+ };
219
+ continue;
220
+ }
221
+ if (!entryControlNames.has(component)) continue;
222
+ const neutral = {
223
+ ...base,
224
+ ...themes[`${scheme}_${component}`]
225
+ };
226
+ const patched = { ...theme };
227
+ for (const key of tintNeutralTextKeys) {
228
+ if (neutral[key] != null) patched[key] = neutral[key];
229
+ }
230
+ out[name] = patched;
231
+ }
232
+ return out;
256
233
  }
257
234
  function luminanceOf(color) {
258
- const hex = color ? (0, import_colorRules.normalizeToHex)(color) : null;
259
- return hex ? (0, import_colorRules.relativeLuminance)(hex) : null;
235
+ const hex = color ? (0, import_colorRules.normalizeToHex)(color) : null;
236
+ return hex ? (0, import_colorRules.relativeLuminance)(hex) : null;
260
237
  }
261
238
  function nearestHoldingStep(preferred, steps, holds) {
262
- const preferredLum = luminanceOf(preferred);
263
- if (preferredLum === null || holds(preferredLum)) return preferred;
264
- let best = preferred;
265
- let bestDistance = Number.POSITIVE_INFINITY;
266
- for (const step of steps) {
267
- const lum = luminanceOf(step);
268
- if (step === void 0 || lum === null || !holds(lum)) continue;
269
- const distance = Math.abs(lum - preferredLum);
270
- if (distance < bestDistance) {
271
- bestDistance = distance;
272
- best = step;
273
- }
274
- }
275
- return best;
239
+ const preferredLum = luminanceOf(preferred);
240
+ if (preferredLum === null || holds(preferredLum)) return preferred;
241
+ let best = preferred;
242
+ let bestDistance = Number.POSITIVE_INFINITY;
243
+ for (const step of steps) {
244
+ const lum = luminanceOf(step);
245
+ if (step === void 0 || lum === null || !holds(lum)) continue;
246
+ const distance = Math.abs(lum - preferredLum);
247
+ if (distance < bestDistance) {
248
+ bestDistance = distance;
249
+ best = step;
250
+ }
251
+ }
252
+ return best;
276
253
  }
277
254
  function holdAccentFloor(themes) {
278
- const out = {
279
- ...themes
280
- };
281
- for (const scheme of ["light", "dark"]) {
282
- const base = themes[scheme];
283
- if (!base?.accentBackground || !base.accentColor) continue;
284
- const paper = luminanceOf(base.color1);
285
- const ink = luminanceOf(base.color12);
286
- const surfaces = [base.color1, base.color2, base.color3, base.color4, ...(scheme === "dark" ? [base.color5] : [])].map(luminanceOf);
287
- if (paper === null || ink === null || surfaces.some(lum => lum === null)) continue;
288
- const steps = Array.from({
289
- length: 12
290
- }, (_, index) => base[`accent${index + 1}`]);
291
- const fill = nearestHoldingStep(base.accentBackground, steps.slice(0, 10), lum => Math.max((0, import_colorRules.contrastRatio)(lum, paper), (0, import_colorRules.contrastRatio)(lum, ink)) >= import_colorRules.aaTextContrastRatio && (0, import_colorRules.contrastRatio)(lum, paper) >= import_colorRules.minContrastRatio);
292
- const accentInk = nearestHoldingStep(base.accentColor, steps, lum => surfaces.every(surface => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio));
293
- if (fill === base.accentBackground && accentInk === base.accentColor) continue;
294
- for (const [name, theme] of Object.entries(themes)) {
295
- if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
296
- const inheritsFill = theme.accentBackground === base.accentBackground;
297
- const inheritsInk = theme.accentColor === base.accentColor;
298
- if (!inheritsFill && !inheritsInk) continue;
299
- out[name] = {
300
- ...theme,
301
- ...(inheritsFill ? {
302
- accentBackground: fill
303
- } : null),
304
- ...(inheritsInk ? {
305
- accentColor: accentInk
306
- } : null)
307
- };
308
- }
309
- }
310
- return out;
255
+ const out = { ...themes };
256
+ for (const scheme of ["light", "dark"]) {
257
+ const base = themes[scheme];
258
+ if (!base?.["accent-background"] || !base["accent-color"]) continue;
259
+ const paper = luminanceOf(base["color-1"]);
260
+ const ink = luminanceOf(base["color-12"]);
261
+ const surfaces = [
262
+ base["color-1"],
263
+ base["color-2"],
264
+ base["color-3"],
265
+ base["color-4"],
266
+ ...scheme === "dark" ? [base["color-5"]] : []
267
+ ].map(luminanceOf);
268
+ if (paper === null || ink === null || surfaces.some((lum) => lum === null)) continue;
269
+ const steps = Array.from({ length: 12 }, (_, index) => base[`accent-${index + 1}`]);
270
+ const fill = nearestHoldingStep(base["accent-background"], steps.slice(0, 10), (lum) => Math.max((0, import_colorRules.contrastRatio)(lum, paper), (0, import_colorRules.contrastRatio)(lum, ink)) >= import_colorRules.aaTextContrastRatio && (0, import_colorRules.contrastRatio)(lum, paper) >= import_colorRules.minContrastRatio);
271
+ const accentInk = nearestHoldingStep(base["accent-color"], steps, (lum) => surfaces.every((surface) => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio));
272
+ if (fill === base["accent-background"] && accentInk === base["accent-color"]) continue;
273
+ for (const [name, theme] of Object.entries(themes)) {
274
+ if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
275
+ const inheritsFill = theme["accent-background"] === base["accent-background"];
276
+ const inheritsInk = theme["accent-color"] === base["accent-color"];
277
+ if (!inheritsFill && !inheritsInk) continue;
278
+ out[name] = {
279
+ ...theme,
280
+ ...inheritsFill ? { "accent-background": fill } : null,
281
+ ...inheritsInk ? { "accent-color": accentInk } : null
282
+ };
283
+ }
284
+ }
285
+ return out;
311
286
  }
312
287
  const selectionSurfaceContrastRatio = 1.16;
313
288
  const selectionSurfaceScope = /^(light|dark)(_[a-z]+)?$/;
314
289
  function holdSelectionSurface(themes) {
315
- const out = {
316
- ...themes
317
- };
318
- for (const [scopeName, scope] of Object.entries(themes)) {
319
- if (!selectionSurfaceScope.test(scopeName) || /_(accent|active)$/.test(scopeName)) continue;
320
- const page = luminanceOf(scope.background);
321
- const [surface, next, last] = [scope.color4, scope.color5, scope.color6].map(color => color ? (0, import_colorRules.normalizeToHex)(color) : null);
322
- if (page === null || !surface || !next || !last) continue;
323
- if ((0, import_colorRules.contrastRatio)((0, import_colorRules.relativeLuminance)(surface), page) >= selectionSurfaceContrastRatio) continue;
324
- const candidates = [...Array.from({
325
- length: 20
326
- }, (_, index) => mixHex(surface, next, (index + 1) / 20)), ...Array.from({
327
- length: 20
328
- }, (_, index) => mixHex(next, last, (index + 1) / 20))];
329
- const held = candidates.find(candidate => (0, import_colorRules.contrastRatio)((0, import_colorRules.relativeLuminance)(candidate), page) >= selectionSurfaceContrastRatio);
330
- if (!held) continue;
331
- for (const [name, theme] of Object.entries(themes)) {
332
- if (name !== scopeName && !name.startsWith(`${scopeName}_`)) continue;
333
- if (theme.color4 !== scope.color4) continue;
334
- out[name] = {
335
- ...out[name],
336
- color4: held,
337
- ...(theme.borderColor === scope.color4 ? {
338
- borderColor: held
339
- } : null),
340
- ...(theme.selectFill === scope.color4 ? {
341
- selectFill: held
342
- } : null)
343
- };
344
- }
345
- }
346
- return out;
290
+ const out = { ...themes };
291
+ for (const [scopeName, scope] of Object.entries(themes)) {
292
+ if (!selectionSurfaceScope.test(scopeName) || /_(accent|active)$/.test(scopeName)) continue;
293
+ const page = luminanceOf(scope.background);
294
+ const [surface, next, last] = [
295
+ scope["color-4"],
296
+ scope["color-5"],
297
+ scope["color-6"]
298
+ ].map((color) => color ? (0, import_colorRules.normalizeToHex)(color) : null);
299
+ if (page === null || !surface || !next || !last) continue;
300
+ if ((0, import_colorRules.contrastRatio)((0, import_colorRules.relativeLuminance)(surface), page) >= selectionSurfaceContrastRatio) continue;
301
+ const candidates = [...Array.from({ length: 20 }, (_, index) => mixHex(surface, next, (index + 1) / 20)), ...Array.from({ length: 20 }, (_, index) => mixHex(next, last, (index + 1) / 20))];
302
+ const held = candidates.find((candidate) => (0, import_colorRules.contrastRatio)((0, import_colorRules.relativeLuminance)(candidate), page) >= selectionSurfaceContrastRatio);
303
+ if (!held) continue;
304
+ for (const [name, theme] of Object.entries(themes)) {
305
+ if (name !== scopeName && !name.startsWith(`${scopeName}_`)) continue;
306
+ if (theme["color-4"] !== scope["color-4"]) continue;
307
+ out[name] = {
308
+ ...out[name],
309
+ "color-4": held,
310
+ ...theme["border-color"] === scope["color-4"] ? { "border-color": held } : null,
311
+ ...theme["select-fill"] === scope["color-4"] ? { "select-fill": held } : null
312
+ };
313
+ }
314
+ }
315
+ return out;
347
316
  }
348
317
  function ownerScope(scopes, name) {
349
- return scopes.filter(scope => name === scope || name.startsWith(`${scope}_`)).reduce((longest, scope) => scope.length > longest.length ? scope : longest, "");
318
+ return scopes.filter((scope) => name === scope || name.startsWith(`${scope}_`)).reduce((longest, scope) => scope.length > longest.length ? scope : longest, "");
350
319
  }
351
320
  function clearsDarkGrounds(color, grounds) {
352
- const brightest = Math.max(...grounds);
353
- const luminance = luminanceOf(color);
354
- return luminance !== null && luminance > brightest && grounds.every(ground => (0, import_colorRules.contrastRatio)(luminance, ground) >= import_builderOptions.darkHairlineContrast);
321
+ const brightest = Math.max(...grounds);
322
+ const luminance = luminanceOf(color);
323
+ return luminance !== null && luminance > brightest && grounds.every((ground) => (0, import_colorRules.contrastRatio)(luminance, ground) >= import_builderOptions.darkHairlineContrast);
355
324
  }
356
325
  function darkHairlineOf(scope) {
357
- const ramp = Array.from({
358
- length: 12
359
- }, (_, index) => scope[`color${index + 1}`]);
360
- const grounds = [scope.background, scope.color4].map(color => luminanceOf(color));
361
- if (grounds.includes(null)) return void 0;
362
- const hairline = ramp.findIndex((color, index) => index < 11 && clearsDarkGrounds(color, grounds));
363
- return hairline < 0 ? void 0 : {
364
- ramp,
365
- hairline
366
- };
326
+ const ramp = Array.from({ length: 12 }, (_, index) => scope[`color-${index + 1}`]);
327
+ const grounds = [scope.background, scope["color-4"]].map((color) => luminanceOf(color));
328
+ if (grounds.includes(null)) return void 0;
329
+ const hairline = ramp.findIndex((color, index) => index < 11 && clearsDarkGrounds(color, grounds));
330
+ return hairline < 0 ? void 0 : {
331
+ ramp,
332
+ hairline
333
+ };
367
334
  }
368
- const darkEdgeStateKeys = ["borderColor", "borderColorHover", "borderColorFocus", "borderColorPress"];
369
- function darkEdgesOf(name, theme, scopeName, scope, {
370
- ramp,
371
- hairline
372
- }) {
373
- const medium = hairline + 1;
374
- const surface = name === scopeName || theme.background === scope.color4;
375
- const step = ramp.indexOf(theme.borderColor);
376
- const shift = surface && step >= 0 ? medium - step : 0;
377
- const moved = {};
378
- if ("borderColorHairline" in theme || name === scopeName) moved.borderColorHairline = ramp[hairline];
379
- if (shift <= 0) return moved;
380
- for (const key of darkEdgeStateKeys) {
381
- const at = ramp.indexOf(theme[key]);
382
- if (at >= 0) moved[key] = ramp[Math.min(11, at + shift)];
383
- }
384
- return moved;
335
+ const darkEdgeStateKeys = [
336
+ "border-color",
337
+ "border-color-hover",
338
+ "border-color-focus",
339
+ "border-color-press"
340
+ ];
341
+ function darkEdgesOf(name, theme, scopeName, scope, { ramp, hairline }) {
342
+ const medium = hairline + 1;
343
+ const surface = name === scopeName || theme.background === scope["color-4"];
344
+ const step = ramp.indexOf(theme["border-color"]);
345
+ const shift = surface && step >= 0 ? medium - step : 0;
346
+ const moved = {};
347
+ if ("border-color-hairline" in theme || name === scopeName) moved["border-color-hairline"] = ramp[hairline];
348
+ if (shift <= 0) return moved;
349
+ for (const key of darkEdgeStateKeys) {
350
+ const at = ramp.indexOf(theme[key]);
351
+ if (at >= 0) moved[key] = ramp[Math.min(11, at + shift)];
352
+ }
353
+ return moved;
385
354
  }
386
355
  function holdDarkEdges(themes) {
387
- const out = {
388
- ...themes
389
- };
390
- const scopes = Object.keys(themes).filter(name => /^dark(_[a-z]+)?$/.test(name));
391
- for (const scopeName of scopes) {
392
- if (/_(accent|active)$/.test(scopeName)) continue;
393
- const scope = themes[scopeName];
394
- const pick = darkHairlineOf(scope);
395
- if (!pick) continue;
396
- for (const [name, theme] of Object.entries(themes)) {
397
- if (ownerScope(scopes, name) !== scopeName) continue;
398
- out[name] = {
399
- ...out[name],
400
- ...darkEdgesOf(name, theme, scopeName, scope, pick)
401
- };
402
- }
403
- }
404
- return out;
356
+ const out = { ...themes };
357
+ const scopes = Object.keys(themes).filter((name) => /^dark(_[a-z]+)?$/.test(name));
358
+ for (const scopeName of scopes) {
359
+ if (/_(accent|active)$/.test(scopeName)) continue;
360
+ const scope = themes[scopeName];
361
+ const pick = darkHairlineOf(scope);
362
+ if (!pick) continue;
363
+ for (const [name, theme] of Object.entries(themes)) {
364
+ if (ownerScope(scopes, name) !== scopeName) continue;
365
+ out[name] = {
366
+ ...out[name],
367
+ ...darkEdgesOf(name, theme, scopeName, scope, pick)
368
+ };
369
+ }
370
+ }
371
+ return out;
405
372
  }
406
373
  function firstClearing(neutral, grounds) {
407
- const lums = grounds.map(ground => luminanceOf(ground));
408
- if (lums.includes(null)) return -1;
409
- const darkest = Math.min(...lums);
410
- const brightest = Math.max(...lums);
411
- const light = (0, import_colorRules.isLightGround)(grounds[0]);
412
- return neutral.findIndex(color => {
413
- const lum = luminanceOf(color);
414
- return lum !== null && (light ? lum < darkest : lum > brightest) && lums.every(ground => (0, import_colorRules.contrastRatio)(lum, ground) >= import_colorRules.minContrastRatio);
415
- });
374
+ const lums = grounds.map((ground) => luminanceOf(ground));
375
+ if (lums.includes(null)) return -1;
376
+ const darkest = Math.min(...lums);
377
+ const brightest = Math.max(...lums);
378
+ const light = (0, import_colorRules.isLightGround)(grounds[0]);
379
+ return neutral.findIndex((color) => {
380
+ const lum = luminanceOf(color);
381
+ return lum !== null && (light ? lum < darkest : lum > brightest) && lums.every((ground) => (0, import_colorRules.contrastRatio)(lum, ground) >= import_colorRules.minContrastRatio);
382
+ });
416
383
  }
417
384
  function inheritedValue(out, themes, name, key) {
418
- for (let at = name; at; at = at.slice(0, Math.max(0, at.lastIndexOf("_")))) {
419
- const value = (out[at] ?? themes[at])?.[key];
420
- if (value !== void 0) return value;
421
- if (!at.includes("_")) break;
422
- }
423
- return void 0;
385
+ for (let at = name; at; at = at.slice(0, Math.max(0, at.lastIndexOf("_")))) {
386
+ const value = (out[at] ?? themes[at])?.[key];
387
+ if (value !== void 0) return value;
388
+ if (!at.includes("_")) break;
389
+ }
390
+ return void 0;
424
391
  }
425
392
  function nearestStep(ramp, color) {
426
- const lum = luminanceOf(color);
427
- if (lum === null) return -1;
428
- return ramp.reduce((best, step, index) => Math.abs((luminanceOf(step) ?? 2) - lum) < Math.abs((luminanceOf(ramp[best]) ?? 2) - lum) ? index : best, 0);
393
+ const lum = luminanceOf(color);
394
+ if (lum === null) return -1;
395
+ return ramp.reduce((best, step, index) => Math.abs((luminanceOf(step) ?? 2) - lum) < Math.abs((luminanceOf(ramp[best]) ?? 2) - lum) ? index : best, 0);
429
396
  }
430
397
  function fieldEdgesOf(themes, out, neutral, scopeName) {
431
- const scope = themes[scopeName];
432
- const field = `${scopeName}_Input`;
433
- const edge = firstClearing(neutral, [scope.background, inheritedValue(out, themes, field, "background")]);
434
- if (edge < 0) return void 0;
435
- const ramp = Array.from({
436
- length: 12
437
- }, (_, index) => scope[`color${index + 1}`]);
438
- const rest = nearestStep(ramp, inheritedValue(out, themes, field, "borderColor"));
439
- const hover = nearestStep(ramp, inheritedValue(out, themes, field, "borderColorHover"));
440
- return {
441
- borderColorField: neutral[edge],
442
- borderColorFieldHover: neutral[Math.min(11, Math.max(edge, edge + hover - rest))]
443
- };
398
+ const scope = themes[scopeName];
399
+ const field = `${scopeName}_Input`;
400
+ const edge = firstClearing(neutral, [scope.background, inheritedValue(out, themes, field, "background")]);
401
+ if (edge < 0) return void 0;
402
+ const ramp = Array.from({ length: 12 }, (_, index) => scope[`color-${index + 1}`]);
403
+ const rest = nearestStep(ramp, inheritedValue(out, themes, field, "border-color"));
404
+ const hover = nearestStep(ramp, inheritedValue(out, themes, field, "border-color-hover"));
405
+ return {
406
+ "border-color-field": neutral[edge],
407
+ "border-color-field-hover": neutral[Math.min(11, Math.max(edge, edge + hover - rest))]
408
+ };
444
409
  }
445
410
  function intentFieldEdges(themes, out, scopeName, pages) {
446
- const scope = themes[scopeName];
447
- const field = `${scopeName}_Input`;
448
- const ramp = Array.from({
449
- length: 12
450
- }, (_, index) => scope[`color${index + 1}`]);
451
- const edge = firstClearing(ramp, [...pages, inheritedValue(out, themes, field, "background")]);
452
- if (edge < 0) return {
453
- borderColorField: inheritedValue(out, themes, field, "borderColor"),
454
- borderColorFieldHover: inheritedValue(out, themes, field, "borderColorHover")
455
- };
456
- return {
457
- borderColorField: ramp[edge],
458
- borderColorFieldHover: ramp[Math.min(11, edge + 1)]
459
- };
411
+ const scope = themes[scopeName];
412
+ const field = `${scopeName}_Input`;
413
+ const ramp = Array.from({ length: 12 }, (_, index) => scope[`color-${index + 1}`]);
414
+ const edge = firstClearing(ramp, [...pages, inheritedValue(out, themes, field, "background")]);
415
+ if (edge < 0) return {
416
+ "border-color-field": inheritedValue(out, themes, field, "border-color"),
417
+ "border-color-field-hover": inheritedValue(out, themes, field, "border-color-hover")
418
+ };
419
+ return {
420
+ "border-color-field": ramp[edge],
421
+ "border-color-field-hover": ramp[Math.min(11, edge + 1)]
422
+ };
460
423
  }
461
- function controlEdgePatch(themes, out, scopeName, {
462
- scheme,
463
- neutral,
464
- pages,
465
- rootFields,
466
- rootControl
467
- }) {
468
- const scope = themes[scopeName];
469
- const patch = {};
470
- if (scheme === "dark" && "switchTrackOff" in scope) patch.switchTrackOffBorder = scope.switchTrackOff;
471
- if (semanticIntentNames.has(scopeName.slice(scheme.length + 1))) return Object.assign(patch, intentFieldEdges(themes, out, scopeName, pages));
472
- const fields = fieldEdgesOf(themes, out, neutral, scopeName);
473
- if (fields) {
474
- for (const [key, value] of Object.entries(fields)) if (value !== rootFields[key]) patch[key] = value;
475
- }
476
- const control = firstClearing(neutral, [scope.background]);
477
- if (control >= 0 && control !== rootControl) patch.borderColorControl = neutral[control];
478
- return patch;
424
+ function controlEdgePatch(themes, out, scopeName, { scheme, neutral, pages, rootFields, rootControl }) {
425
+ const scope = themes[scopeName];
426
+ const patch = {};
427
+ if (scheme === "dark" && "switch-track-off" in scope) patch["switch-track-off-border"] = scope["switch-track-off"];
428
+ if (semanticIntentNames.has(scopeName.slice(scheme.length + 1))) return Object.assign(patch, intentFieldEdges(themes, out, scopeName, pages));
429
+ const fields = fieldEdgesOf(themes, out, neutral, scopeName);
430
+ if (fields) {
431
+ for (const [key, value] of Object.entries(fields)) if (value !== rootFields[key]) patch[key] = value;
432
+ }
433
+ const control = firstClearing(neutral, [scope.background]);
434
+ if (control >= 0 && control !== rootControl) patch["border-color-control"] = neutral[control];
435
+ return patch;
479
436
  }
480
437
  function holdControlEdges(themes) {
481
- const out = {
482
- ...themes
483
- };
484
- for (const scheme of ["light", "dark"]) {
485
- const root = themes[scheme];
486
- if (!root) continue;
487
- const neutral = Array.from({
488
- length: 12
489
- }, (_, index) => root[`color${index + 1}`]);
490
- const rootFields = fieldEdgesOf(themes, out, neutral, scheme);
491
- const rootControl = firstClearing(neutral, [root.background]);
492
- if (!rootFields || rootControl < 0) continue;
493
- out[scheme] = {
494
- ...out[scheme],
495
- ...rootFields,
496
- borderColorControl: neutral[rootControl],
497
- switchTrackOffBorder: scheme === "light" ? neutral[rootControl] : root.switchTrackOff
498
- };
499
- const scopes = Object.keys(themes).filter(name => new RegExp(`^${scheme}_[a-z]+$`).test(name) && !/_(accent|active)$/.test(name));
500
- const pages = [root.background, ...scopes.filter(name => !semanticIntentNames.has(name.slice(scheme.length + 1))).map(name => themes[name].background)];
501
- const context = {
502
- scheme,
503
- neutral,
504
- pages,
505
- rootFields,
506
- rootControl
507
- };
508
- for (const scopeName of scopes) {
509
- const patch = controlEdgePatch(themes, out, scopeName, context);
510
- if (Object.keys(patch).length > 0) out[scopeName] = {
511
- ...out[scopeName],
512
- ...patch
513
- };
514
- }
515
- }
516
- return out;
438
+ const out = { ...themes };
439
+ for (const scheme of ["light", "dark"]) {
440
+ const root = themes[scheme];
441
+ if (!root) continue;
442
+ const neutral = Array.from({ length: 12 }, (_, index) => root[`color-${index + 1}`]);
443
+ const rootFields = fieldEdgesOf(themes, out, neutral, scheme);
444
+ const rootControl = firstClearing(neutral, [root.background]);
445
+ if (!rootFields || rootControl < 0) continue;
446
+ out[scheme] = {
447
+ ...out[scheme],
448
+ ...rootFields,
449
+ "border-color-control": neutral[rootControl],
450
+ "switch-track-off-border": scheme === "light" ? neutral[rootControl] : root["switch-track-off"]
451
+ };
452
+ const scopes = Object.keys(themes).filter((name) => new RegExp(`^${scheme}_[a-z]+$`).test(name) && !/_(accent|active)$/.test(name));
453
+ const pages = [root.background, ...scopes.filter((name) => !semanticIntentNames.has(name.slice(scheme.length + 1))).map((name) => themes[name].background)];
454
+ const context = {
455
+ scheme,
456
+ neutral,
457
+ pages,
458
+ rootFields,
459
+ rootControl
460
+ };
461
+ for (const scopeName of scopes) {
462
+ const patch = controlEdgePatch(themes, out, scopeName, context);
463
+ if (Object.keys(patch).length > 0) out[scopeName] = {
464
+ ...out[scopeName],
465
+ ...patch
466
+ };
467
+ }
468
+ }
469
+ return out;
517
470
  }
518
471
  const selectedTintContrastRatio = 1.1;
519
472
  const neutralSelectedTintContrastRatio = 1.25;
520
473
  const achromaticChannelSpread = 8;
521
474
  function isAchromaticRamp(steps) {
522
- return steps.every(step => {
523
- const hex = step ? (0, import_colorRules.normalizeToHex)(step) : null;
524
- if (!hex) return false;
525
- const channels = [1, 3, 5].map(offset => Number.parseInt(hex.slice(offset, offset + 2), 16));
526
- return Math.max(...channels) - Math.min(...channels) <= achromaticChannelSpread;
527
- });
475
+ return steps.every((step) => {
476
+ const hex = step ? (0, import_colorRules.normalizeToHex)(step) : null;
477
+ if (!hex) return false;
478
+ const channels = [
479
+ 1,
480
+ 3,
481
+ 5
482
+ ].map((offset) => Number.parseInt(hex.slice(offset, offset + 2), 16));
483
+ return Math.max(...channels) - Math.min(...channels) <= achromaticChannelSpread;
484
+ });
528
485
  }
529
486
  function holdSelectedState(themes) {
530
- const out = {
531
- ...themes
532
- };
533
- for (const scheme of ["light", "dark"]) {
534
- const base = themes[scheme];
535
- if (!base?.accentColor) continue;
536
- const steps = Array.from({
537
- length: 12
538
- }, (_, index) => base[`accent${index + 1}`]);
539
- const paint = selectedPaint(base, steps, base.accentColor);
540
- if (paint) out[scheme] = {
541
- ...base,
542
- ...paint
543
- };
544
- }
545
- return out;
487
+ const out = { ...themes };
488
+ for (const scheme of ["light", "dark"]) {
489
+ const base = themes[scheme];
490
+ if (!base?.["accent-color"]) continue;
491
+ const steps = Array.from({ length: 12 }, (_, index) => base[`accent-${index + 1}`]);
492
+ const paint = selectedPaint(base, steps, base["accent-color"]);
493
+ if (paint) out[scheme] = {
494
+ ...base,
495
+ ...paint
496
+ };
497
+ }
498
+ return out;
546
499
  }
547
500
  function selectedPaint(scope, steps, accentColor) {
548
- const page = luminanceOf(scope.color1);
549
- const neutral = luminanceOf(scope.color4);
550
- if (page === null || neutral === null) return void 0;
551
- const grey = isAchromaticRamp(steps);
552
- const offNeutral = grey ? neutralSelectedTintContrastRatio : selectedTintContrastRatio;
553
- const tint = nearestHoldingStep(scope.color4, steps, lum => (0, import_colorRules.contrastRatio)(lum, page) >= selectedTintContrastRatio && (0, import_colorRules.contrastRatio)(lum, neutral) >= offNeutral);
554
- const tintLum = luminanceOf(tint);
555
- if (tint === scope.color4 || tintLum === null) return void 0;
556
- if (grey) {
557
- let strongest = tint;
558
- let strongestRatio = 0;
559
- for (const step of steps) {
560
- const lum = luminanceOf(step);
561
- if (step === void 0 || lum === null) continue;
562
- const ratio = (0, import_colorRules.contrastRatio)(lum, tintLum);
563
- if (ratio > strongestRatio) {
564
- strongest = step;
565
- strongestRatio = ratio;
566
- }
567
- }
568
- if (strongestRatio >= import_colorRules.aaTextContrastRatio) return {
569
- selectedBackground: tint,
570
- selectedColor: strongest
571
- };
572
- }
573
- const ink = nearestHoldingStep(accentColor, steps, lum => (0, import_colorRules.contrastRatio)(lum, tintLum) >= import_colorRules.aaTextContrastRatio);
574
- return {
575
- selectedBackground: tint,
576
- selectedColor: ink
577
- };
501
+ const page = luminanceOf(scope["color-1"]);
502
+ const neutral = luminanceOf(scope["color-4"]);
503
+ if (page === null || neutral === null) return void 0;
504
+ const grey = isAchromaticRamp(steps);
505
+ const offNeutral = grey ? neutralSelectedTintContrastRatio : selectedTintContrastRatio;
506
+ const tint = nearestHoldingStep(scope["color-4"], steps, (lum) => (0, import_colorRules.contrastRatio)(lum, page) >= selectedTintContrastRatio && (0, import_colorRules.contrastRatio)(lum, neutral) >= offNeutral);
507
+ const tintLum = luminanceOf(tint);
508
+ if (tint === scope["color-4"] || tintLum === null) return void 0;
509
+ if (grey) {
510
+ let strongest = tint;
511
+ let strongestRatio = 0;
512
+ for (const step of steps) {
513
+ const lum = luminanceOf(step);
514
+ if (step === void 0 || lum === null) continue;
515
+ const ratio = (0, import_colorRules.contrastRatio)(lum, tintLum);
516
+ if (ratio > strongestRatio) {
517
+ strongest = step;
518
+ strongestRatio = ratio;
519
+ }
520
+ }
521
+ if (strongestRatio >= import_colorRules.aaTextContrastRatio) return {
522
+ "selected-background": tint,
523
+ "selected-color": strongest
524
+ };
525
+ }
526
+ const ink = nearestHoldingStep(accentColor, steps, (lum) => (0, import_colorRules.contrastRatio)(lum, tintLum) >= import_colorRules.aaTextContrastRatio);
527
+ return {
528
+ "selected-background": tint,
529
+ "selected-color": ink
530
+ };
578
531
  }
579
532
  const switchStateContrastRatio = 1.5;
580
- const switchRaisedAlphas = [0.16, 0.2, 0.24, 0.28, 0.32, 0.36, 0.4];
581
- const switchRaisedAlphaStep = 0.04;
533
+ const switchRaisedAlphas = [
534
+ .16,
535
+ .2,
536
+ .24,
537
+ .28,
538
+ .32,
539
+ .36,
540
+ .4
541
+ ];
542
+ const switchRaisedAlphaStep = .04;
582
543
  function raisedGrounds(themes, scheme) {
583
- if (scheme === "light") return [];
584
- const hues = Object.entries(themes).filter(([name]) => new RegExp(`^${scheme}_[a-z]+$`).test(name)).filter(([name]) => !/_(accent|active)$/.test(name));
585
- return [themes[scheme], ...hues.map(([, theme]) => theme)].flatMap(theme => [theme?.color4, theme?.color5]).filter(color => typeof color === "string");
544
+ if (scheme === "light") return [];
545
+ const hues = Object.entries(themes).filter(([name]) => new RegExp(`^${scheme}_[a-z]+$`).test(name)).filter(([name]) => !/_(accent|active)$/.test(name));
546
+ return [themes[scheme], ...hues.map(([, theme]) => theme)].flatMap((theme) => [theme?.["color-4"], theme?.["color-5"]]).filter((color) => typeof color === "string");
586
547
  }
587
548
  function holdSwitchTrack(themes) {
588
- const out = {
589
- ...themes
590
- };
591
- for (const scheme of ["light", "dark"]) {
592
- const base = themes[scheme];
593
- if (!base) continue;
594
- const paint = switchTrackPaint(base, base.accentBackground, (0, import_colorRules.switchOffGround)(base), raisedGrounds(themes, scheme));
595
- if (paint) out[scheme] = {
596
- ...base,
597
- ...paint
598
- };
599
- if (scheme !== "dark" || !paint) continue;
600
- for (const intent of semanticIntentNames) {
601
- const scope = themes[`${scheme}_${intent}`];
602
- const track = intentSwitchTrack(base, scope, paint);
603
- if (track) out[`${scheme}_${intent}`] = {
604
- ...scope,
605
- ...track
606
- };
607
- }
608
- }
609
- return out;
549
+ const out = { ...themes };
550
+ for (const scheme of ["light", "dark"]) {
551
+ const base = themes[scheme];
552
+ if (!base) continue;
553
+ const paint = switchTrackPaint(base, base["accent-background"], (0, import_colorRules.switchOffGround)({
554
+ background: base.background,
555
+ color4: base["color-4"]
556
+ }), raisedGrounds(themes, scheme));
557
+ if (paint) out[scheme] = {
558
+ ...base,
559
+ ...paint
560
+ };
561
+ if (scheme !== "dark" || !paint) continue;
562
+ for (const intent of semanticIntentNames) {
563
+ const scope = themes[`${scheme}_${intent}`];
564
+ const track = intentSwitchTrack(base, scope, paint);
565
+ if (track) out[`${scheme}_${intent}`] = {
566
+ ...scope,
567
+ ...track
568
+ };
569
+ }
570
+ }
571
+ return out;
610
572
  }
611
573
  function intentSwitchTrack(base, scope, paint) {
612
- const off = luminanceOf(paint.switchTrackOff);
613
- if (!scope?.color4 || !scope.color5 || off === null) return void 0;
614
- const holds = (0, import_colorRules.inSwitchOffBand)(paint.switchTrackOff, scope.color4) && [scope.color4, scope.color5].every(ground => (0, import_colorRules.contrastRatio)(off, luminanceOf(ground) ?? off) >= import_colorRules.plateContrastRatio);
615
- if (holds) return void 0;
616
- return switchTrackPaint(base, scope.accentBackground ?? base.accentBackground, scope.color4, [base.color4, scope.color4, scope.color5]);
574
+ const off = luminanceOf(paint["switch-track-off"]);
575
+ if (!scope?.["color-4"] || !scope["color-5"] || off === null) return void 0;
576
+ const holds = (0, import_colorRules.inSwitchOffBand)(paint["switch-track-off"], scope["color-4"]) && [scope["color-4"], scope["color-5"]].every((ground) => (0, import_colorRules.contrastRatio)(off, luminanceOf(ground) ?? off) >= import_colorRules.plateContrastRatio);
577
+ if (holds) return void 0;
578
+ return switchTrackPaint(base, scope["accent-background"] ?? base["accent-background"], scope["color-4"], [
579
+ base["color-4"],
580
+ scope["color-4"],
581
+ scope["color-5"]
582
+ ]);
617
583
  }
618
584
  function switchTrackPaint(base, onFill, ground, raised = []) {
619
- const on = luminanceOf(onFill);
620
- if (!ground || on === null) return void 0;
621
- const alpha = import_colorRules.switchOffFillAlpha[(0, import_colorRules.isLightGround)(ground) ? "light" : "dark"];
622
- const target = (0, import_colorRules.systemFillLuminance)(ground, alpha);
623
- if (target === null) return void 0;
624
- const raisedLums = raised.map(color => luminanceOf(color)).filter(lum => lum !== null);
625
- const greys = Array.from({
626
- length: 12
627
- }, (_, index) => index + 1).map(step => ({
628
- color: base[`gray${step}`],
629
- lum: luminanceOf(base[`gray${step}`]),
630
- hover: base[`gray${Math.max(step - 1, 1)}`],
631
- press: base[`gray${Math.min(step + 1, 12)}`]
632
- })).filter(entry => entry.lum !== null);
633
- const fills = raised[0] ? switchRaisedAlphas.flatMap(fillAlpha => {
634
- const color = (0, import_colorRules.systemFillHex)(raised[0], fillAlpha);
635
- const hover = (0, import_colorRules.systemFillHex)(raised[0], fillAlpha - switchRaisedAlphaStep);
636
- const press = (0, import_colorRules.systemFillHex)(raised[0], fillAlpha + switchRaisedAlphaStep);
637
- const lum = luminanceOf(color ?? void 0);
638
- return color && hover && press && lum !== null ? [{
639
- color,
640
- lum,
641
- hover,
642
- press
643
- }] : [];
644
- }) : [];
645
- const byTarget = (a, b) => Math.abs(a.lum - target) - Math.abs(b.lum - target);
646
- const steps = [...greys].sort(byTarget);
647
- const inBand = [...greys, ...fills].filter(entry => (0, import_colorRules.inSwitchOffBand)(entry.color, ground)).filter(entry => raisedLums.every(lum => (0, import_colorRules.contrastRatio)(entry.lum, lum) >= import_colorRules.plateContrastRatio)).sort(byTarget);
648
- const pick = inBand.find(entry => (0, import_colorRules.contrastRatio)(entry.lum, on) >= switchStateContrastRatio) ?? inBand[0] ?? steps[0];
649
- if (!pick) return void 0;
650
- return {
651
- switchTrackOff: pick.color,
652
- switchTrackOffHover: pick.hover,
653
- switchTrackOffPress: pick.press
654
- };
585
+ const on = luminanceOf(onFill);
586
+ if (!ground || on === null) return void 0;
587
+ const alpha = import_colorRules.switchOffFillAlpha[(0, import_colorRules.isLightGround)(ground) ? "light" : "dark"];
588
+ const target = (0, import_colorRules.systemFillLuminance)(ground, alpha);
589
+ if (target === null) return void 0;
590
+ const raisedLums = raised.map((color) => luminanceOf(color)).filter((lum) => lum !== null);
591
+ const greys = Array.from({ length: 12 }, (_, index) => index + 1).map((step) => ({
592
+ color: base[`gray-${step}`],
593
+ lum: luminanceOf(base[`gray-${step}`]),
594
+ hover: base[`gray-${Math.max(step - 1, 1)}`],
595
+ press: base[`gray-${Math.min(step + 1, 12)}`]
596
+ })).filter((entry) => entry.lum !== null);
597
+ const fills = raised[0] ? switchRaisedAlphas.flatMap((fillAlpha) => {
598
+ const color = (0, import_colorRules.systemFillHex)(raised[0], fillAlpha);
599
+ const hover = (0, import_colorRules.systemFillHex)(raised[0], fillAlpha - switchRaisedAlphaStep);
600
+ const press = (0, import_colorRules.systemFillHex)(raised[0], fillAlpha + switchRaisedAlphaStep);
601
+ const lum = luminanceOf(color ?? void 0);
602
+ return color && hover && press && lum !== null ? [{
603
+ color,
604
+ lum,
605
+ hover,
606
+ press
607
+ }] : [];
608
+ }) : [];
609
+ const byTarget = (a, b) => Math.abs(a.lum - target) - Math.abs(b.lum - target);
610
+ const steps = [...greys].sort(byTarget);
611
+ const inBand = [...greys, ...fills].filter((entry) => (0, import_colorRules.inSwitchOffBand)(entry.color, ground)).filter((entry) => raisedLums.every((lum) => (0, import_colorRules.contrastRatio)(entry.lum, lum) >= import_colorRules.plateContrastRatio)).sort(byTarget);
612
+ const pick = inBand.find((entry) => (0, import_colorRules.contrastRatio)(entry.lum, on) >= switchStateContrastRatio) ?? inBand[0] ?? steps[0];
613
+ if (!pick) return void 0;
614
+ return {
615
+ "switch-track-off": pick.color,
616
+ "switch-track-off-hover": pick.hover,
617
+ "switch-track-off-press": pick.press
618
+ };
655
619
  }
656
- const syntaxInkHues = ["purple", "green", "blue", "orange", "red"];
620
+ const syntaxInkHues = [
621
+ "purple",
622
+ "green",
623
+ "blue",
624
+ "orange",
625
+ "red"
626
+ ];
657
627
  function mixHex(from, to, share) {
658
- const channel = offset => Math.round(Number.parseInt(from.slice(offset, offset + 2), 16) * (1 - share) + Number.parseInt(to.slice(offset, offset + 2), 16) * share).toString(16).padStart(2, "0");
659
- return `#${channel(1)}${channel(3)}${channel(5)}`;
628
+ const channel = (offset) => Math.round(Number.parseInt(from.slice(offset, offset + 2), 16) * (1 - share) + Number.parseInt(to.slice(offset, offset + 2), 16) * share).toString(16).padStart(2, "0");
629
+ return `#${channel(1)}${channel(3)}${channel(5)}`;
660
630
  }
661
631
  function holdSyntaxFloor(themes) {
662
- const out = {
663
- ...themes
664
- };
665
- for (const [name, theme] of Object.entries(themes)) {
666
- const surface = luminanceOf(theme.color3);
667
- if (surface === null) continue;
668
- const ink = {};
669
- for (const hue of syntaxInkHues) {
670
- const from = theme[`${hue}11`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}11`]) : null;
671
- const to = theme[`${hue}12`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}12`]) : null;
672
- const wash = luminanceOf(theme[`${hue}3`]);
673
- if (!from || !to || wash === null) continue;
674
- for (let step = 0; step <= 20; step++) {
675
- const candidate = mixHex(from, to, step / 20);
676
- const lum = (0, import_colorRules.relativeLuminance)(candidate);
677
- if ((0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio && (0, import_colorRules.contrastRatio)(lum, wash) >= import_colorRules.aaTextContrastRatio) {
678
- ink[`syntax${hue[0].toUpperCase()}${hue.slice(1)}`] = candidate;
679
- break;
680
- }
681
- }
682
- }
683
- if (Object.keys(ink).length > 0) out[name] = {
684
- ...theme,
685
- ...ink
686
- };
687
- }
688
- return out;
632
+ const out = { ...themes };
633
+ for (const [name, theme] of Object.entries(themes)) {
634
+ const surface = luminanceOf(theme["color-3"]);
635
+ if (surface === null) continue;
636
+ const ink = {};
637
+ for (const hue of syntaxInkHues) {
638
+ const from = theme[`${hue}-11`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}-11`]) : null;
639
+ const to = theme[`${hue}-12`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}-12`]) : null;
640
+ const wash = luminanceOf(theme[`${hue}-3`]);
641
+ if (!from || !to || wash === null) continue;
642
+ for (let step = 0; step <= 20; step++) {
643
+ const candidate = mixHex(from, to, step / 20);
644
+ const lum = (0, import_colorRules.relativeLuminance)(candidate);
645
+ if ((0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio && (0, import_colorRules.contrastRatio)(lum, wash) >= import_colorRules.aaTextContrastRatio) {
646
+ ink[`syntax-${hue}`] = candidate;
647
+ break;
648
+ }
649
+ }
650
+ }
651
+ if (Object.keys(ink).length > 0) out[name] = {
652
+ ...theme,
653
+ ...ink
654
+ };
655
+ }
656
+ return out;
689
657
  }
690
658
  const namedInkHues = import_ramps.themeRampHues;
691
659
  function holdNamedInkFloor(themes) {
692
- const out = {
693
- ...themes
694
- };
695
- for (const [name, theme] of Object.entries(themes)) {
696
- const surfaces = [luminanceOf(theme.background), luminanceOf(theme.color3)];
697
- if (surfaces.some(surface => surface === null)) continue;
698
- const ink = {};
699
- for (const hue of namedInkHues) {
700
- const from = theme[`${hue}11`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}11`]) : null;
701
- const to = theme[`${hue}12`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}12`]) : null;
702
- if (!from || !to) continue;
703
- for (let step = 0; step <= 20; step++) {
704
- const candidate = mixHex(from, to, step / 20);
705
- const lum = (0, import_colorRules.relativeLuminance)(candidate);
706
- if (surfaces.every(surface => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio)) {
707
- if (step > 0) ink[`${hue}11`] = candidate;
708
- break;
709
- }
710
- }
711
- }
712
- if (Object.keys(ink).length > 0) out[name] = {
713
- ...theme,
714
- ...ink
715
- };
716
- }
717
- return out;
660
+ const out = { ...themes };
661
+ for (const [name, theme] of Object.entries(themes)) {
662
+ const surfaces = [luminanceOf(theme.background), luminanceOf(theme["color-3"])];
663
+ if (surfaces.some((surface) => surface === null)) continue;
664
+ const ink = {};
665
+ for (const hue of namedInkHues) {
666
+ const from = theme[`${hue}-11`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}-11`]) : null;
667
+ const to = theme[`${hue}-12`] ? (0, import_colorRules.normalizeToHex)(theme[`${hue}-12`]) : null;
668
+ if (!from || !to) continue;
669
+ for (let step = 0; step <= 20; step++) {
670
+ const candidate = mixHex(from, to, step / 20);
671
+ const lum = (0, import_colorRules.relativeLuminance)(candidate);
672
+ if (surfaces.every((surface) => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio)) {
673
+ if (step > 0) ink[`${hue}-11`] = candidate;
674
+ break;
675
+ }
676
+ }
677
+ }
678
+ if (Object.keys(ink).length > 0) out[name] = {
679
+ ...theme,
680
+ ...ink
681
+ };
682
+ }
683
+ return out;
718
684
  }
719
685
  function walkToHoldingInk(step11, step12, holds) {
720
- const from = (0, import_colorRules.normalizeToHex)(step11);
721
- const to = (0, import_colorRules.normalizeToHex)(step12);
722
- if (!from || !to) return null;
723
- if (holds((0, import_colorRules.relativeLuminance)(from))) return step11;
724
- for (let step = 1; step <= 20; step++) {
725
- const candidate = mixHex(from, to, step / 20);
726
- if (holds((0, import_colorRules.relativeLuminance)(candidate))) return candidate;
727
- }
728
- return null;
686
+ const from = (0, import_colorRules.normalizeToHex)(step11);
687
+ const to = (0, import_colorRules.normalizeToHex)(step12);
688
+ if (!from || !to) return null;
689
+ if (holds((0, import_colorRules.relativeLuminance)(from))) return step11;
690
+ for (let step = 1; step <= 20; step++) {
691
+ const candidate = mixHex(from, to, step / 20);
692
+ if (holds((0, import_colorRules.relativeLuminance)(candidate))) return candidate;
693
+ }
694
+ return null;
729
695
  }
730
696
  function labelHolds(label, fill) {
731
- const lum = luminanceOf(label);
732
- const fillLum = luminanceOf(fill);
733
- return lum !== null && fillLum !== null && (0, import_colorRules.contrastRatio)(lum, fillLum) >= import_colorRules.aaTextContrastRatio && Math.abs((0, import_colorRules.apcaContrast)(label, fill)) >= import_colorRules.fillLabelLc;
697
+ const lum = luminanceOf(label);
698
+ const fillLum = luminanceOf(fill);
699
+ return lum !== null && fillLum !== null && (0, import_colorRules.contrastRatio)(lum, fillLum) >= import_colorRules.aaTextContrastRatio && Math.abs((0, import_colorRules.apcaContrast)(label, fill)) >= import_colorRules.fillLabelLc;
734
700
  }
735
701
  function holdStateFill(ramp, fill, label, paper) {
736
- const at = ramp.indexOf(fill);
737
- if (at < 0) return fill;
738
- const holding = [at + 1, at - 1, at + 2, at - 2].map(index => ramp[index]).filter(step => step !== void 0 && labelHolds(label, step));
739
- return holding.find(step => (0, import_colorRules.contrastRatio)(luminanceOf(step), paper) >= import_colorRules.minContrastRatio) ?? holding[0] ?? fill;
702
+ const at = ramp.indexOf(fill);
703
+ if (at < 0) return fill;
704
+ const holding = [
705
+ at + 1,
706
+ at - 1,
707
+ at + 2,
708
+ at - 2
709
+ ].map((index) => ramp[index]).filter((step) => step !== void 0 && labelHolds(label, step));
710
+ return holding.find((step) => (0, import_colorRules.contrastRatio)(luminanceOf(step), paper) >= import_colorRules.minContrastRatio) ?? holding[0] ?? fill;
740
711
  }
741
712
  function holdFillLabel(preferred, steps, labels, paper) {
742
- const preferredLum = luminanceOf(preferred);
743
- if (preferredLum === null) return void 0;
744
- const labelOn = step => labels.find(label => labelHolds(label, step));
745
- let best;
746
- let bestDistance = Number.POSITIVE_INFINITY;
747
- for (const step of [preferred, ...steps]) {
748
- const lum = luminanceOf(step);
749
- if (step === void 0 || lum === null || (0, import_colorRules.contrastRatio)(lum, paper) < import_colorRules.minContrastRatio) continue;
750
- const label = labelOn(step);
751
- const distance = Math.abs(lum - preferredLum);
752
- if (label && distance < bestDistance) {
753
- bestDistance = distance;
754
- best = {
755
- fill: step,
756
- label
757
- };
758
- }
759
- }
760
- return best;
713
+ const preferredLum = luminanceOf(preferred);
714
+ if (preferredLum === null) return void 0;
715
+ const labelOn = (step) => labels.find((label) => labelHolds(label, step));
716
+ let best;
717
+ let bestDistance = Number.POSITIVE_INFINITY;
718
+ for (const step of [preferred, ...steps]) {
719
+ const lum = luminanceOf(step);
720
+ if (step === void 0 || lum === null || (0, import_colorRules.contrastRatio)(lum, paper) < import_colorRules.minContrastRatio) continue;
721
+ const label = labelOn(step);
722
+ const distance = Math.abs(lum - preferredLum);
723
+ if (label && distance < bestDistance) {
724
+ bestDistance = distance;
725
+ best = {
726
+ fill: step,
727
+ label
728
+ };
729
+ }
730
+ }
731
+ return best;
761
732
  }
762
733
  function holdColorThemeAccent(themes) {
763
- const out = {
764
- ...themes
765
- };
766
- for (const scheme of ["light", "dark"]) {
767
- const base = themes[scheme];
768
- if (!base) continue;
769
- for (const hue of childrenHues) {
770
- const scopeName = `${scheme}_${hue}`;
771
- const scope = themes[scopeName];
772
- const ramp = Array.from({
773
- length: 12
774
- }, (_, index) => base[`${hue}${index + 1}`]);
775
- if (!scope || ramp.some(step => !step)) continue;
776
- const paper = luminanceOf(scope.color1);
777
- const ink = luminanceOf(scope.color12);
778
- const surfaces = [scope.color1, scope.color2, scope.color3, scope.color4, ...(scheme === "dark" ? [scope.color5] : [])].map(luminanceOf);
779
- if (paper === null || ink === null || surfaces.some(lum => lum === null)) continue;
780
- const labels = [scope.color1, scope.color12].sort((a, b) => luminanceOf(b) - luminanceOf(a));
781
- const solid = holdFillLabel(ramp[8], ramp.slice(0, 11), labels, paper);
782
- const holdsInk = lum => surfaces.every(surface => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio);
783
- const fill = solid?.fill ?? nearestHoldingStep(ramp[8], ramp.slice(0, 11), lum => Math.max((0, import_colorRules.contrastRatio)(lum, paper), (0, import_colorRules.contrastRatio)(lum, ink)) >= import_colorRules.aaTextContrastRatio && (0, import_colorRules.contrastRatio)(lum, paper) >= import_colorRules.minContrastRatio);
784
- const accentInk = walkToHoldingInk(ramp[10], ramp[11], holdsInk) ?? nearestHoldingStep(ramp[10], ramp, holdsInk);
785
- const onFill = solid?.label ?? (0, import_colorRules.holdInkFloor)(fill, (0, import_colorRules.pickReadableForeground)(fill, scope.color1, scope.color12));
786
- const fillHover = holdStateFill(ramp, fill, onFill, paper);
787
- const accent = {
788
- accentBackground: fill,
789
- accentColor: accentInk,
790
- ...selectedPaint(scope, ramp, accentInk)
791
- };
792
- const rootOn = luminanceOf(base.switchTrackOff);
793
- const fillLum = luminanceOf(fill);
794
- const switchGround = (0, import_colorRules.switchOffGround)(scope) ?? scope.background;
795
- const rootHolds = rootOn === null || fillLum === null || (0, import_colorRules.contrastRatio)(rootOn, fillLum) >= switchStateContrastRatio && (0, import_colorRules.inSwitchOffBand)(base.switchTrackOff, switchGround) && ((0, import_colorRules.isLightGround)(scope.background) ? [] : [scope.color4, scope.color5]).every(ground => (0, import_colorRules.contrastRatio)(rootOn, luminanceOf(ground) ?? rootOn) >= import_colorRules.plateContrastRatio);
796
- const trackGrounds = (0, import_colorRules.isLightGround)(scope.background) ? [] : [base.color4, scope.color4, scope.color5];
797
- const track = rootHolds ? void 0 : switchTrackPaint(base, fill, switchGround, trackGrounds);
798
- for (const [name, theme] of Object.entries(themes)) {
799
- if (name === scopeName) {
800
- out[name] = {
801
- ...theme,
802
- ...accent,
803
- ...track
804
- };
805
- } else if (name.startsWith(`${scopeName}_`)) {
806
- const owned = Object.keys(accent).filter(key => key in theme);
807
- if (owned.length > 0) {
808
- out[name] = {
809
- ...theme,
810
- ...Object.fromEntries(owned.map(key => [key, accent[key]]))
811
- };
812
- }
813
- }
814
- }
815
- out[`${scopeName}_accent`] = {
816
- background: fill,
817
- backgroundHover: fillHover,
818
- backgroundPress: fillHover,
819
- backgroundFocus: fillHover,
820
- backgroundActive: fill,
821
- borderColor: fill,
822
- borderColorHover: fillHover,
823
- borderColorFocus: fillHover,
824
- borderColorPress: fillHover,
825
- color: onFill,
826
- colorHover: onFill,
827
- colorPress: onFill,
828
- colorFocus: onFill,
829
- placeholderColor: onFill,
830
- boundaryColor: onFill,
831
- outlineColor: onFill,
832
- color10: onFill,
833
- color11: onFill,
834
- color12: onFill,
835
- textMuted: onFill,
836
- accentBackground: onFill,
837
- accentColor: onFill
838
- };
839
- }
840
- }
841
- return out;
734
+ const out = { ...themes };
735
+ for (const scheme of ["light", "dark"]) {
736
+ const base = themes[scheme];
737
+ if (!base) continue;
738
+ for (const hue of childrenHues) {
739
+ const scopeName = `${scheme}_${hue}`;
740
+ const scope = themes[scopeName];
741
+ const ramp = Array.from({ length: 12 }, (_, index) => base[`${hue}-${index + 1}`]);
742
+ if (!scope || ramp.some((step) => !step)) continue;
743
+ const paper = luminanceOf(scope["color-1"]);
744
+ const ink = luminanceOf(scope["color-12"]);
745
+ const surfaces = [
746
+ scope["color-1"],
747
+ scope["color-2"],
748
+ scope["color-3"],
749
+ scope["color-4"],
750
+ ...scheme === "dark" ? [scope["color-5"]] : []
751
+ ].map(luminanceOf);
752
+ if (paper === null || ink === null || surfaces.some((lum) => lum === null)) continue;
753
+ const labels = [scope["color-1"], scope["color-12"]].sort((a, b) => luminanceOf(b) - luminanceOf(a));
754
+ const solid = holdFillLabel(ramp[8], ramp.slice(0, 11), labels, paper);
755
+ const holdsInk = (lum) => surfaces.every((surface) => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio);
756
+ const fill = solid?.fill ?? nearestHoldingStep(ramp[8], ramp.slice(0, 11), (lum) => Math.max((0, import_colorRules.contrastRatio)(lum, paper), (0, import_colorRules.contrastRatio)(lum, ink)) >= import_colorRules.aaTextContrastRatio && (0, import_colorRules.contrastRatio)(lum, paper) >= import_colorRules.minContrastRatio);
757
+ const accentInk = walkToHoldingInk(ramp[10], ramp[11], holdsInk) ?? nearestHoldingStep(ramp[10], ramp, holdsInk);
758
+ const onFill = solid?.label ?? (0, import_colorRules.holdInkFloor)(fill, (0, import_colorRules.pickReadableForeground)(fill, scope["color-1"], scope["color-12"]));
759
+ const fillHover = holdStateFill(ramp, fill, onFill, paper);
760
+ const accent = {
761
+ "accent-background": fill,
762
+ "accent-color": accentInk,
763
+ ...selectedPaint(scope, ramp, accentInk)
764
+ };
765
+ const rootOn = luminanceOf(base["switch-track-off"]);
766
+ const fillLum = luminanceOf(fill);
767
+ const switchGround = (0, import_colorRules.switchOffGround)({
768
+ background: scope.background,
769
+ color4: scope["color-4"]
770
+ }) ?? scope.background;
771
+ const rootHolds = rootOn === null || fillLum === null || (0, import_colorRules.contrastRatio)(rootOn, fillLum) >= switchStateContrastRatio && (0, import_colorRules.inSwitchOffBand)(base["switch-track-off"], switchGround) && ((0, import_colorRules.isLightGround)(scope.background) ? [] : [scope["color-4"], scope["color-5"]]).every((ground) => (0, import_colorRules.contrastRatio)(rootOn, luminanceOf(ground) ?? rootOn) >= import_colorRules.plateContrastRatio);
772
+ const trackGrounds = (0, import_colorRules.isLightGround)(scope.background) ? [] : [
773
+ base["color-4"],
774
+ scope["color-4"],
775
+ scope["color-5"]
776
+ ];
777
+ const track = rootHolds ? void 0 : switchTrackPaint(base, fill, switchGround, trackGrounds);
778
+ for (const [name, theme] of Object.entries(themes)) {
779
+ if (name === scopeName) {
780
+ out[name] = {
781
+ ...theme,
782
+ ...accent,
783
+ ...track
784
+ };
785
+ } else if (name.startsWith(`${scopeName}_`)) {
786
+ const owned = Object.keys(accent).filter((key) => key in theme);
787
+ if (owned.length > 0) {
788
+ out[name] = {
789
+ ...theme,
790
+ ...Object.fromEntries(owned.map((key) => [key, accent[key]]))
791
+ };
792
+ }
793
+ }
794
+ }
795
+ out[`${scopeName}_accent`] = {
796
+ background: fill,
797
+ "background-hover": fillHover,
798
+ "background-press": fillHover,
799
+ "background-focus": fillHover,
800
+ "background-active": fill,
801
+ "border-color": fill,
802
+ "border-color-hover": fillHover,
803
+ "border-color-focus": fillHover,
804
+ "border-color-press": fillHover,
805
+ color: onFill,
806
+ "color-hover": onFill,
807
+ "color-press": onFill,
808
+ "color-focus": onFill,
809
+ "placeholder-color": onFill,
810
+ "boundary-color": onFill,
811
+ "outline-color": onFill,
812
+ "color-10": onFill,
813
+ "color-11": onFill,
814
+ "color-12": onFill,
815
+ "text-muted": onFill,
816
+ "accent-background": onFill,
817
+ "accent-color": onFill
818
+ };
819
+ }
820
+ }
821
+ return out;
842
822
  }
843
- const houseAccentKeys = ["accentBackground", "accentColor", "selectedBackground", "selectedColor"];
823
+ const houseAccentKeys = [
824
+ "accent-background",
825
+ "accent-color",
826
+ "selected-background",
827
+ "selected-color"
828
+ ];
844
829
  function isFullRamp(steps) {
845
- return !steps.includes(void 0);
830
+ return !steps.includes(void 0);
846
831
  }
847
832
  function selectedStandOff(base, tint) {
848
- const tintLum = luminanceOf(tint);
849
- const grounds = [base.color1, base.color4].map(luminanceOf);
850
- if (tintLum === null || grounds.includes(null)) return 0;
851
- return Math.min(...grounds.map(ground => (0, import_colorRules.contrastRatio)(tintLum, ground)));
833
+ const tintLum = luminanceOf(tint);
834
+ const grounds = [base["color-1"], base["color-4"]].map(luminanceOf);
835
+ if (tintLum === null || grounds.includes(null)) return 0;
836
+ return Math.min(...grounds.map((ground) => (0, import_colorRules.contrastRatio)(tintLum, ground)));
852
837
  }
853
838
  function rootSelectedPair(base, scope, ramp, accentColor, houseStandOff) {
854
- const scopePair = {
855
- selectedBackground: scope.selectedBackground,
856
- selectedColor: scope.selectedColor
857
- };
858
- if (selectedStandOff(base, scope.selectedBackground) >= houseStandOff) return scopePair;
859
- return selectedPaint(base, ramp, accentColor) ?? scopePair;
839
+ const scopePair = {
840
+ "selected-background": scope["selected-background"],
841
+ "selected-color": scope["selected-color"]
842
+ };
843
+ if (selectedStandOff(base, scope["selected-background"]) >= houseStandOff) return scopePair;
844
+ return selectedPaint(base, ramp, accentColor) ?? scopePair;
860
845
  }
861
846
  function houseAccentOf(base, scope, hue, houseStandOff) {
862
- const steps = Array.from({
863
- length: 12
864
- }, (_, index) => base[`accent${index + 1}`]);
865
- if (!isAchromaticRamp(steps)) return null;
866
- const ramp = Array.from({
867
- length: 12
868
- }, (_, index) => base[`${hue}${index + 1}`] || void 0);
869
- const surfaces = [base.color1, base.color2, base.color3, base.color4].map(luminanceOf);
870
- if (!isFullRamp(ramp) || surfaces.includes(null)) return null;
871
- const holdsInk = lum => surfaces.every(surface => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio);
872
- const accentColor = walkToHoldingInk(ramp[10], ramp[11], holdsInk) ?? nearestHoldingStep(ramp[10], ramp, holdsInk);
873
- return {
874
- accent: {
875
- accentBackground: scope.accentBackground,
876
- accentColor,
877
- ...rootSelectedPair(base, scope, ramp, accentColor, houseStandOff)
878
- },
879
- accentSteps: Object.fromEntries(ramp.map((step, index) => [`accent${index + 1}`, step]))
880
- };
847
+ const steps = Array.from({ length: 12 }, (_, index) => base[`accent-${index + 1}`]);
848
+ if (!isAchromaticRamp(steps)) return null;
849
+ const ramp = Array.from({ length: 12 }, (_, index) => base[`${hue}-${index + 1}`] || void 0);
850
+ const surfaces = [
851
+ base["color-1"],
852
+ base["color-2"],
853
+ base["color-3"],
854
+ base["color-4"]
855
+ ].map(luminanceOf);
856
+ if (!isFullRamp(ramp) || surfaces.includes(null)) return null;
857
+ const holdsInk = (lum) => surfaces.every((surface) => (0, import_colorRules.contrastRatio)(lum, surface) >= import_colorRules.aaTextContrastRatio);
858
+ const accentColor = walkToHoldingInk(ramp[10], ramp[11], holdsInk) ?? nearestHoldingStep(ramp[10], ramp, holdsInk);
859
+ return {
860
+ accent: {
861
+ "accent-background": scope["accent-background"],
862
+ "accent-color": accentColor,
863
+ ...rootSelectedPair(base, scope, ramp, accentColor, houseStandOff)
864
+ },
865
+ accentSteps: Object.fromEntries(ramp.map((step, index) => [`accent-${index + 1}`, step]))
866
+ };
881
867
  }
882
- function heldTheme(name, theme, scheme, base, solid, {
883
- accent,
884
- accentSteps
885
- }) {
886
- if (name === scheme) return {
887
- ...theme,
888
- ...accent,
889
- ...accentSteps
890
- };
891
- const [, scope] = name.split("_");
892
- if (!name.startsWith(`${scheme}_`) || childrenHues.includes(scope)) return null;
893
- if (scope === "accent") return {
894
- ...solid
895
- };
896
- const followed = houseAccentKeys.filter(key => key in theme && theme[key] === base[key]);
897
- if (followed.length === 0) return null;
898
- return {
899
- ...theme,
900
- ...Object.fromEntries(followed.map(key => [key, accent[key]]))
901
- };
868
+ function heldTheme(name, theme, scheme, base, solid, { accent, accentSteps }) {
869
+ if (name === scheme) return {
870
+ ...theme,
871
+ ...accent,
872
+ ...accentSteps
873
+ };
874
+ const [, scope] = name.split("_");
875
+ if (!name.startsWith(`${scheme}_`) || childrenHues.includes(scope)) return null;
876
+ if (scope === "accent") return { ...solid };
877
+ const followed = houseAccentKeys.filter((key) => key in theme && theme[key] === base[key]);
878
+ if (followed.length === 0) return null;
879
+ return {
880
+ ...theme,
881
+ ...Object.fromEntries(followed.map((key) => [key, accent[key]]))
882
+ };
902
883
  }
903
884
  function holdHouseAccent(themes, hue) {
904
- const out = {
905
- ...themes
906
- };
907
- for (const scheme of ["light", "dark"]) {
908
- const base = themes[scheme];
909
- const scope = themes[`${scheme}_${hue}`];
910
- const solid = themes[`${scheme}_${hue}_accent`];
911
- if (!base || !scope || !solid) continue;
912
- const houseStandOff = selectedStandOff(base, themes[`${scheme}_blue`]?.selectedBackground);
913
- const house = houseAccentOf(base, scope, hue, houseStandOff);
914
- if (!house) continue;
915
- for (const [name, theme] of Object.entries(themes)) {
916
- const held = heldTheme(name, theme, scheme, base, solid, house);
917
- if (held) out[name] = held;
918
- }
919
- }
920
- return out;
885
+ const out = { ...themes };
886
+ for (const scheme of ["light", "dark"]) {
887
+ const base = themes[scheme];
888
+ const scope = themes[`${scheme}_${hue}`];
889
+ const solid = themes[`${scheme}_${hue}_accent`];
890
+ if (!base || !scope || !solid) continue;
891
+ const houseStandOff = selectedStandOff(base, themes[`${scheme}_blue`]?.["selected-background"]);
892
+ const house = houseAccentOf(base, scope, hue, houseStandOff);
893
+ if (!house) continue;
894
+ for (const [name, theme] of Object.entries(themes)) {
895
+ const held = heldTheme(name, theme, scheme, base, solid, house);
896
+ if (held) out[name] = held;
897
+ }
898
+ }
899
+ return out;
921
900
  }
922
901
  function holdHouseIdentityInk(themes, hue) {
923
- const out = {
924
- ...themes
925
- };
926
- for (const scheme of ["light", "dark"]) {
927
- const base = themes[scheme];
928
- const hueInk = themes[`${scheme}_${hue}`]?.identityInk;
929
- if (!base?.identityInk || !hueInk || base.identityInk === hueInk) continue;
930
- if (!accentIsHue(base, hue)) continue;
931
- for (const [name, theme] of Object.entries(themes)) {
932
- if (takesHueInk(themes, scheme, name, theme, base, hueInk)) out[name] = {
933
- ...theme,
934
- identityInk: hueInk
935
- };
936
- }
937
- }
938
- return out;
902
+ const out = { ...themes };
903
+ for (const scheme of ["light", "dark"]) {
904
+ const base = themes[scheme];
905
+ const hueInk = themes[`${scheme}_${hue}`]?.["identity-ink"];
906
+ if (!base?.["identity-ink"] || !hueInk || base["identity-ink"] === hueInk) continue;
907
+ if (!accentIsHue(base, hue)) continue;
908
+ for (const [name, theme] of Object.entries(themes)) {
909
+ if (takesHueInk(themes, scheme, name, theme, base, hueInk)) out[name] = {
910
+ ...theme,
911
+ "identity-ink": hueInk
912
+ };
913
+ }
914
+ }
915
+ return out;
939
916
  }
940
917
  function accentIsHue(base, hue) {
941
- return Array.from({
942
- length: 12
943
- }, (_, index) => index + 1).every(step => base[`accent${step}`] !== void 0 && base[`accent${step}`] === base[`${hue}${step}`]);
918
+ return Array.from({ length: 12 }, (_, index) => index + 1).every((step) => base[`accent-${step}`] !== void 0 && base[`accent-${step}`] === base[`${hue}-${step}`]);
944
919
  }
945
920
  function takesHueInk(themes, scheme, name, theme, base, hueInk) {
946
- if (name !== scheme && !name.startsWith(`${scheme}_`)) return false;
947
- const scope = name.split("_")[1];
948
- if (scope === "accent" || childrenHues.includes(scope)) return false;
949
- if (theme.identityInk !== base.identityInk) return false;
950
- const values = (0, import_dedupeInherited.resolveThemeThroughParents)(themes, name);
951
- return (0, import_accentInk.pickIdentityInk)([hueInk], (0, import_accentInk.pageSurfaces)(name, values)) === hueInk;
921
+ if (name !== scheme && !name.startsWith(`${scheme}_`)) return false;
922
+ const scope = name.split("_")[1];
923
+ if (scope === "accent" || childrenHues.includes(scope)) return false;
924
+ if (theme["identity-ink"] !== base["identity-ink"]) return false;
925
+ const values = (0, import_dedupeInherited.resolveThemeThroughParents)(themes, name);
926
+ return (0, import_accentInk.pickIdentityInk)([hueInk], (0, import_accentInk.pageSurfaces)(name, values)) === hueInk;
952
927
  }
953
928
  const defaultLightShadows = {
954
- shadow1: "rgba(0,0,0,0.04)",
955
- shadow2: "rgba(0,0,0,0.08)",
956
- shadow3: "rgba(0,0,0,0.12)",
957
- shadow4: "rgba(0,0,0,0.22)",
958
- shadow5: "rgba(0,0,0,0.33)",
959
- shadow6: "rgba(0,0,0,0.44)"
929
+ shadow1: "rgba(0,0,0,0.04)",
930
+ shadow2: "rgba(0,0,0,0.08)",
931
+ shadow3: "rgba(0,0,0,0.12)",
932
+ shadow4: "rgba(0,0,0,0.22)",
933
+ shadow5: "rgba(0,0,0,0.33)",
934
+ shadow6: "rgba(0,0,0,0.44)"
960
935
  };
961
936
  const defaultDarkShadows = {
962
- shadow1: "rgba(0,0,0,0.15)",
963
- shadow2: "rgba(0,0,0,0.23)",
964
- shadow3: "rgba(0,0,0,0.33)",
965
- shadow4: "rgba(0,0,0,0.45)",
966
- shadow5: "rgba(0,0,0,0.65)",
967
- shadow6: "rgba(0,0,0,0.8)"
937
+ shadow1: "rgba(0,0,0,0.15)",
938
+ shadow2: "rgba(0,0,0,0.23)",
939
+ shadow3: "rgba(0,0,0,0.33)",
940
+ shadow4: "rgba(0,0,0,0.45)",
941
+ shadow5: "rgba(0,0,0,0.65)",
942
+ shadow6: "rgba(0,0,0,0.8)"
968
943
  };
969
- const childrenHues = ["blue", "red", "green", "yellow", "orange", "pink", "purple", "gray", "sky", "plum"];
944
+ const childrenHues = [
945
+ "blue",
946
+ "red",
947
+ "green",
948
+ "yellow",
949
+ "orange",
950
+ "pink",
951
+ "purple",
952
+ "gray",
953
+ "sky",
954
+ "plum"
955
+ ];
970
956
  const radixHues = {
971
- sky: {
972
- light: Colors.sky,
973
- dark: Colors.skyDark
974
- },
975
- plum: {
976
- light: Colors.plum,
977
- dark: Colors.plumDark
978
- }
957
+ sky: {
958
+ light: Colors.sky,
959
+ dark: Colors.skyDark
960
+ },
961
+ plum: {
962
+ light: Colors.plum,
963
+ dark: Colors.plumDark
964
+ }
979
965
  };
980
966
  function holdFocusRingAccent(themes, hue) {
981
- const out = {
982
- ...themes
983
- };
984
- for (const scheme of ["light", "dark"]) {
985
- const base = themes[scheme];
986
- if (!base) continue;
987
- const grounds = [base.color1, base.color2].map(luminanceOf);
988
- if (grounds.some(lum => lum === null)) continue;
989
- const holds = color => {
990
- const lum = luminanceOf(color);
991
- return lum !== null && isChromatic(color) && grounds.every(ground => (0, import_colorRules.contrastRatio)(lum, ground) >= import_colorRules.minContrastRatio);
992
- };
993
- const rootRing = [base.accentColor, themes[`${scheme}_${hue}`]?.accentColor].find(holds);
994
- for (const [name, theme] of Object.entries(themes)) {
995
- if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
996
- if (theme.outlineColor === void 0) continue;
997
- const parts = name.split("_");
998
- if (parts.includes("accent")) continue;
999
- const hue2 = childrenHues.includes(parts[1] ?? "") ? parts[1] : void 0;
1000
- const scopeInk = hue2 ? themes[`${scheme}_${hue2}`]?.accentColor : void 0;
1001
- const ring = holds(scopeInk) ? scopeInk : rootRing;
1002
- if (!ring || ring === theme.outlineColor) continue;
1003
- out[name] = {
1004
- ...theme,
1005
- outlineColor: ring
1006
- };
1007
- }
1008
- }
1009
- return out;
967
+ const out = { ...themes };
968
+ for (const scheme of ["light", "dark"]) {
969
+ const base = themes[scheme];
970
+ if (!base) continue;
971
+ const grounds = [base["color-1"], base["color-2"]].map(luminanceOf);
972
+ if (grounds.some((lum) => lum === null)) continue;
973
+ const holds = (color) => {
974
+ const lum = luminanceOf(color);
975
+ return lum !== null && isChromatic(color) && grounds.every((ground) => (0, import_colorRules.contrastRatio)(lum, ground) >= import_colorRules.minContrastRatio);
976
+ };
977
+ const rootRing = [base["accent-color"], themes[`${scheme}_${hue}`]?.["accent-color"]].find(holds);
978
+ for (const [name, theme] of Object.entries(themes)) {
979
+ if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
980
+ if (theme["outline-color"] === void 0) continue;
981
+ const parts = name.split("_");
982
+ if (parts.includes("accent")) continue;
983
+ const hue2 = childrenHues.includes(parts[1] ?? "") ? parts[1] : void 0;
984
+ const scopeInk = hue2 ? themes[`${scheme}_${hue2}`]?.["accent-color"] : void 0;
985
+ const ring = holds(scopeInk) ? scopeInk : rootRing;
986
+ if (!ring || ring === theme["outline-color"]) continue;
987
+ out[name] = {
988
+ ...theme,
989
+ "outline-color": ring
990
+ };
991
+ }
992
+ }
993
+ return out;
1010
994
  }
1011
995
  function isChromatic(color) {
1012
- const hex = color ? (0, import_colorRules.normalizeToHex)(color) : null;
1013
- if (!hex) return false;
1014
- const channels = [1, 3, 5].map(index => Number.parseInt(hex.slice(index, index + 2), 16));
1015
- return Math.max(...channels) - Math.min(...channels) >= 24;
996
+ const hex = color ? (0, import_colorRules.normalizeToHex)(color) : null;
997
+ if (!hex) return false;
998
+ const channels = [
999
+ 1,
1000
+ 3,
1001
+ 5
1002
+ ].map((index) => Number.parseInt(hex.slice(index, index + 2), 16));
1003
+ return Math.max(...channels) - Math.min(...channels) >= 24;
1016
1004
  }
1017
1005
  function withAlpha(color, alpha) {
1018
- const hsla = color.match(/^hsla?\(([^,]+),\s*([^,]+),\s*([^,)]+)/);
1019
- if (hsla) return `hsla(${hsla[1].trim()}, ${hsla[2].trim()}, ${hsla[3].trim()}, ${alpha})`;
1020
- const hex = (0, import_colorRules.normalizeToHex)(color);
1021
- if (!hex) return void 0;
1022
- const [r, g, b] = [1, 3, 5].map(index => Number.parseInt(hex.slice(index, index + 2), 16));
1023
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
1006
+ const hsla = color.match(/^hsla?\(([^,]+),\s*([^,]+),\s*([^,)]+)/);
1007
+ if (hsla) return `hsla(${hsla[1].trim()}, ${hsla[2].trim()}, ${hsla[3].trim()}, ${alpha})`;
1008
+ const hex = (0, import_colorRules.normalizeToHex)(color);
1009
+ if (!hex) return void 0;
1010
+ const [r, g, b] = [
1011
+ 1,
1012
+ 3,
1013
+ 5
1014
+ ].map((index) => Number.parseInt(hex.slice(index, index + 2), 16));
1015
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
1024
1016
  }
1025
1017
  function holdScrims(themes, alphas) {
1026
- const out = {
1027
- ...themes
1028
- };
1029
- for (const [name, theme] of Object.entries(themes)) {
1030
- const [scheme, hue, ...rest] = name.split("_");
1031
- if (scheme !== "light" && scheme !== "dark") continue;
1032
- if (rest.length > 0 || hue !== void 0 && !childrenHues.includes(hue)) continue;
1033
- const scrimDialog = theme.background ? withAlpha(theme.background, alphas[scheme].dialog) : void 0;
1034
- out[name] = {
1035
- ...theme,
1036
- ...(scrimDialog ? {
1037
- scrimDialog
1038
- } : {}),
1039
- scrimSheet: `rgba(0, 0, 0, ${alphas[scheme].sheet})`
1040
- };
1041
- }
1042
- return out;
1018
+ const out = { ...themes };
1019
+ for (const [name, theme] of Object.entries(themes)) {
1020
+ const [scheme, hue, ...rest] = name.split("_");
1021
+ if (scheme !== "light" && scheme !== "dark") continue;
1022
+ if (rest.length > 0 || hue !== void 0 && !childrenHues.includes(hue)) continue;
1023
+ const scrimDialog = theme.background ? withAlpha(theme.background, alphas[scheme].dialog) : void 0;
1024
+ out[name] = {
1025
+ ...theme,
1026
+ ...scrimDialog ? { "scrim-dialog": scrimDialog } : {},
1027
+ "scrim-sheet": `rgba(0, 0, 0, ${alphas[scheme].sheet})`
1028
+ };
1029
+ }
1030
+ return out;
1031
+ }
1032
+ const postPassThemeKeys = [
1033
+ "accent-on-surface",
1034
+ "border-color-control",
1035
+ "border-color-field",
1036
+ "border-color-field-hover",
1037
+ "border-color-hairline",
1038
+ "error-fill",
1039
+ "identity-ink",
1040
+ "overlay-fill",
1041
+ "scrim-dialog",
1042
+ "scrim-sheet",
1043
+ "selected-background",
1044
+ "selected-color",
1045
+ "success-fill",
1046
+ "switch-track-off",
1047
+ "switch-track-off-border",
1048
+ "switch-track-off-hover",
1049
+ "switch-track-off-press",
1050
+ "warning-fill",
1051
+ "warning-ink",
1052
+ "warning-mark",
1053
+ "warning-soft"
1054
+ ];
1055
+ const walkThemeTree = import_builder.createThemes;
1056
+ function buildThemeTree(maps, added) {
1057
+ const stateNames = Object.keys(maps.states);
1058
+ const within = (parent, names) => names.some((name) => parent.startsWith(name) || parent.endsWith(name));
1059
+ const nameOf = (path) => path ? `light_${path}` : "light";
1060
+ const templateOnly = (definition) => ({ template: definition.template || "base" });
1061
+ const firstWins = (...groups) => {
1062
+ const merged = {};
1063
+ for (const group of groups) {
1064
+ for (const name in group) if (!(name in merged)) merged[name] = group[name];
1065
+ }
1066
+ return merged;
1067
+ };
1068
+ const states = (path) => within(nameOf(path), ["accent"]) ? {} : Object.fromEntries(Object.entries(maps.states).filter(([name]) => !nameOf(path).endsWith(`_${name}`)).map(([name, definition]) => [name, templateOnly(definition)]));
1069
+ const components = (path) => within(nameOf(path), stateNames) ? {} : Object.fromEntries(Object.entries(maps.components).map(([name, definition]) => [name, templateOnly(definition)]));
1070
+ const addedUnder = (path) => Object.fromEntries([...added?.children.get(path) ?? []].map((name) => [name, ({ parent }) => added?.exists([
1071
+ parent.scheme,
1072
+ path,
1073
+ name
1074
+ ].filter(Boolean).join("_")) ? {} : null]));
1075
+ return {
1076
+ light: {
1077
+ scheme: "light",
1078
+ palette: "base",
1079
+ template: "base"
1080
+ },
1081
+ dark: {
1082
+ scheme: "dark",
1083
+ palette: "base",
1084
+ template: "base"
1085
+ },
1086
+ children: firstWins({ accent: {
1087
+ palette: "accent",
1088
+ template: "base",
1089
+ children: components("accent")
1090
+ } }, Object.fromEntries(maps.children.map((name) => [name, {
1091
+ palette: name,
1092
+ template: "base",
1093
+ children: firstWins(states(name), components(name), addedUnder(name))
1094
+ }])), states(""), components(""), addedUnder(""))
1095
+ };
1096
+ }
1097
+ function rampThemeValues(ramp) {
1098
+ return Object.fromEntries(Object.entries(ramp).map(([key, value]) => [(0, import_v5Templates.kebabThemeKey)(key), value]));
1043
1099
  }
1044
- const postPassThemeKeys = ["accentOnSurface", "borderColorControl", "borderColorField", "borderColorFieldHover", "borderColorHairline", "errorFill", "identityInk", "overlayFill", "scrimDialog", "scrimSheet", "selectedBackground", "selectedColor", "successFill", "switchTrackOff", "switchTrackOffBorder", "switchTrackOffHover", "switchTrackOffPress", "warningFill", "warningInk", "warningMark", "warningSoft"];
1045
1100
  function createThemesBuilder(baseTheme, accentTheme, options, accentHue = "blue") {
1046
- const getTheme = options?.getTheme ? sanitizeGetTheme(options.getTheme) : void 0;
1047
- const base = {
1048
- palette: {
1049
- dark: baseTheme.darkPalette,
1050
- light: baseTheme.lightPalette
1051
- },
1052
- extra: {
1053
- light: {
1054
- ...Object.assign({}, ...Object.values(import_v5.defaultChildrenThemes).map(theme => theme.light)),
1055
- ...Object.assign({}, ...Object.values(radixHues).map(hue => hue.light)),
1056
- ...baseTheme.lightShadows,
1057
- shadowColor: baseTheme.lightShadows?.shadow3 || defaultLightShadows.shadow3
1058
- },
1059
- dark: {
1060
- ...Object.assign({}, ...Object.values(import_v5.defaultChildrenThemes).map(theme => theme.dark)),
1061
- ...Object.assign({}, ...Object.values(radixHues).map(hue => hue.dark)),
1062
- ...baseTheme.darkShadows,
1063
- shadowColor: baseTheme.darkShadows?.shadow3 || defaultDarkShadows.shadow3
1064
- }
1065
- }
1066
- };
1067
- const childrenThemes = {
1068
- ...Object.fromEntries(childrenHues.map(name => {
1069
- const {
1070
- light,
1071
- dark
1072
- } = name === "sky" || name === "plum" ? radixHues[name] : import_v5.defaultChildrenThemes[name];
1073
- return [name, {
1074
- palette: {
1075
- light: Object.values(light),
1076
- dark: Object.values(dark)
1077
- }
1078
- }];
1079
- })),
1080
- warning: {
1081
- palette: warningPalette
1082
- },
1083
- error: {
1084
- palette: {
1085
- dark: Object.values(Colors.redDark),
1086
- light: Object.values(Colors.red)
1087
- }
1088
- },
1089
- success: {
1090
- palette: {
1091
- dark: Object.values(Colors.greenDark),
1092
- light: withIntentInkFloor(Object.values(Colors.green), intentInkFloor.success)
1093
- }
1094
- }
1095
- };
1096
- const createThemesProps = {
1097
- templates: houseTemplates,
1098
- componentThemes: options?.componentThemes ?? houseComponentThemes,
1099
- grandChildrenThemes: options?.grandChildrenThemes ?? houseGrandChildrenThemes,
1100
- base,
1101
- childrenThemes,
1102
- accent: {
1103
- palette: {
1104
- dark: accentTheme.darkPalette,
1105
- light: accentTheme.lightPalette
1106
- }
1107
- }
1108
- };
1109
- if (getTheme) {
1110
- createThemesProps.getTheme = getTheme;
1111
- }
1112
- const initialTheme = (0, import_theme_builder.createThemes)(createThemesProps);
1113
- const scrimAlphas = {
1114
- light: baseTheme.lightScrims ?? import_base.defaultBaseTheme.lightScrims,
1115
- dark: baseTheme.darkScrims ?? import_base.defaultBaseTheme.darkScrims
1116
- };
1117
- const themes = holdScrims(holdHouseIdentityInk((0, import_accentInk.withIdentityInk)((0, import_accentInk.withAccentOnSurface)(holdWarningRoleKeys(holdFocusRingAccent(holdControlEdges(holdHouseAccent(holdColorThemeAccent(holdSwitchTrack(holdSyntaxFloor(holdNamedInkFloor(holdSelectedState(holdAccentFloor(holdDarkEdges(holdSelectionSurface(neutralizeSemanticEntryText(neutralizeTintText(initialTheme)))))))))), accentHue)), accentHue)))), accentHue), scrimAlphas);
1118
- return {
1119
- themes() {
1120
- return themes;
1121
- },
1122
- addTheme(name, theme) {
1123
- const addThemeProps = {
1124
- templates: houseTemplates,
1125
- componentThemes: options?.componentThemes ?? houseComponentThemes,
1126
- grandChildrenThemes: options?.grandChildrenThemes ?? houseGrandChildrenThemes,
1127
- base,
1128
- childrenThemes,
1129
- accent: {
1130
- palette: {
1131
- dark: theme.darkPalette,
1132
- light: theme.lightPalette
1133
- }
1134
- }
1135
- };
1136
- if (getTheme) {
1137
- addThemeProps.getTheme = getTheme;
1138
- }
1139
- const createdTheme = (0, import_theme_builder.createThemes)(addThemeProps);
1140
- const held = holdScrims((0, import_accentInk.withIdentityInk)((0, import_accentInk.withAccentOnSurface)({
1141
- dark: createdTheme.dark_accent,
1142
- light: createdTheme.light_accent
1143
- })), scrimAlphas);
1144
- return {
1145
- [`dark_${name}`]: held.dark,
1146
- [`light_${name}`]: held.light
1147
- };
1148
- }
1149
- };
1150
- }
1101
+ const getTheme = options?.getTheme ? sanitizeGetTheme(options.getTheme) : void 0;
1102
+ const namedColors = (scheme) => ({
1103
+ ...Object.assign({}, ...import_ramps.themeRampHues.map((hue) => rampThemeValues(import_ramps.themeRamps[hue][scheme]))),
1104
+ ...Object.assign({}, ...Object.values(radixHues).map((hue) => rampThemeValues(hue[scheme]))),
1105
+ ...Object.fromEntries(import_v5Palettes.neutralPalette.map((color, index) => [`neutral-${index + 1}`, color]))
1106
+ });
1107
+ const base = {
1108
+ palette: {
1109
+ dark: baseTheme.darkPalette,
1110
+ light: baseTheme.lightPalette
1111
+ },
1112
+ extra: {
1113
+ light: {
1114
+ ...namedColors("light"),
1115
+ ...rampThemeValues({ ...baseTheme.lightShadows }),
1116
+ "shadow-color": baseTheme.lightShadows?.shadow3 || defaultLightShadows.shadow3
1117
+ },
1118
+ dark: {
1119
+ ...namedColors("dark"),
1120
+ ...rampThemeValues({ ...baseTheme.darkShadows }),
1121
+ "shadow-color": baseTheme.darkShadows?.shadow3 || defaultDarkShadows.shadow3
1122
+ }
1123
+ }
1124
+ };
1125
+ const childrenThemes = {
1126
+ ...Object.fromEntries(childrenHues.map((name) => {
1127
+ const { light, dark } = name === "sky" || name === "plum" ? radixHues[name] : import_ramps.themeRamps[name];
1128
+ return [name, { palette: {
1129
+ light: Object.values(light),
1130
+ dark: Object.values(dark)
1131
+ } }];
1132
+ })),
1133
+ warning: { palette: warningPalette },
1134
+ error: { palette: {
1135
+ dark: Object.values(Colors.redDark),
1136
+ light: Object.values(Colors.red)
1137
+ } },
1138
+ success: { palette: {
1139
+ dark: Object.values(Colors.greenDark),
1140
+ light: withIntentInkFloor(Object.values(Colors.green), intentInkFloor.success)
1141
+ } }
1142
+ };
1143
+ const maps = {
1144
+ children: Object.keys(childrenThemes),
1145
+ states: options?.grandChildrenThemes ?? houseGrandChildrenThemes,
1146
+ components: (options?.componentThemes ?? houseComponentThemes) || {}
1147
+ };
1148
+ const templates = houseTemplates;
1149
+ const buildRawThemes = (accent) => {
1150
+ const palettes = (0, import_v5Palettes.buildPalettes)({
1151
+ base: base.palette,
1152
+ accent,
1153
+ ...Object.fromEntries(Object.entries(childrenThemes).map(([name, child]) => [name, child.palette]))
1154
+ });
1155
+ const rootValues = (scheme) => ({
1156
+ ...base.extra[scheme],
1157
+ ...Object.fromEntries(Array.from({ length: 12 }, (_, index) => [`accent-${index + 1}`, palettes[`${scheme}_accent`][import_v5Palettes.PALETTE_BACKGROUND_OFFSET + index]]))
1158
+ });
1159
+ const raw = walkThemeTree({ color: {} }, buildThemeTree(maps), { getTheme: ({ recipe, name }) => {
1160
+ const scheme = recipe.scheme;
1161
+ const paletteName = recipe.palette === "base" ? scheme : `${scheme}_${recipe.palette}`;
1162
+ const palette = palettes[paletteName];
1163
+ if (!palette) throw new Error(`No palette for theme ${name}: ${paletteName}`);
1164
+ const template = templates[recipe.template] ?? templates[`${scheme}_${recipe.template}`];
1165
+ if (!template) throw new Error(`No template for theme ${name}: ${recipe.template}`);
1166
+ const theme = {
1167
+ ...(0, import_v5Templates.resolveTemplate)(palette, template),
1168
+ ...name === scheme ? rootValues(scheme) : null
1169
+ };
1170
+ if (!getTheme) return theme;
1171
+ const parentNames = name.split("_").slice(0, -1);
1172
+ return {
1173
+ ...theme,
1174
+ ...getTheme({
1175
+ name,
1176
+ theme,
1177
+ scheme,
1178
+ parentName: parentNames.join("_"),
1179
+ parentNames,
1180
+ level: parentNames.length + 1,
1181
+ palette
1182
+ })
1183
+ };
1184
+ } });
1185
+ return Object.fromEntries(Object.entries(raw).map(([name, theme]) => [name, { ...theme }]));
1186
+ };
1187
+ const initialTheme = buildRawThemes({
1188
+ dark: accentTheme.darkPalette,
1189
+ light: accentTheme.lightPalette
1190
+ });
1191
+ const scrimAlphas = {
1192
+ light: baseTheme.lightScrims ?? import_base.defaultBaseTheme.lightScrims,
1193
+ dark: baseTheme.darkScrims ?? import_base.defaultBaseTheme.darkScrims
1194
+ };
1195
+ const held = holdScrims(holdHouseIdentityInk((0, import_accentInk.withIdentityInk)((0, import_accentInk.withAccentOnSurface)(holdWarningRoleKeys(holdFocusRingAccent(holdControlEdges(holdHouseAccent(holdColorThemeAccent(holdSwitchTrack(holdSyntaxFloor(holdNamedInkFloor(holdSelectedState(holdAccentFloor(holdDarkEdges(holdSelectionSurface(neutralizeSemanticEntryText(neutralizeTintText(initialTheme)))))))))), accentHue)), accentHue)))), accentHue), scrimAlphas);
1196
+ const addedChildren = /* @__PURE__ */ new Map();
1197
+ for (const name of Object.keys(held)) {
1198
+ if (name in initialTheme) continue;
1199
+ const [, ...path] = name.split("_");
1200
+ const child = path.pop();
1201
+ if (!child || path.length > 1 || !(name.slice(0, -child.length - 1) in initialTheme)) {
1202
+ throw new Error(`A theme pass added "${name}", which has no place in the theme tree`);
1203
+ }
1204
+ const parent = path.join("_");
1205
+ addedChildren.set(parent, (addedChildren.get(parent) ?? /* @__PURE__ */ new Set()).add(child));
1206
+ }
1207
+ const themes = walkThemeTree({ color: {} }, buildThemeTree(maps, {
1208
+ children: addedChildren,
1209
+ exists: (name) => name in held
1210
+ }), { getTheme: ({ name }) => held[name] ?? {} });
1211
+ return {
1212
+ themes() {
1213
+ return themes;
1214
+ },
1215
+ addTheme(name, theme) {
1216
+ const createdTheme = buildRawThemes({
1217
+ dark: theme.darkPalette,
1218
+ light: theme.lightPalette
1219
+ });
1220
+ const held2 = holdScrims((0, import_accentInk.withIdentityInk)((0, import_accentInk.withAccentOnSurface)({
1221
+ dark: createdTheme.dark_accent,
1222
+ light: createdTheme.light_accent
1223
+ })), scrimAlphas);
1224
+ return {
1225
+ [`dark_${name}`]: held2.dark,
1226
+ [`light_${name}`]: held2.light
1227
+ };
1228
+ }
1229
+ };
1230
+ }