@multiplatform.one/theme 9.17.0 → 10.0.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
@@ -1,1841 +1,1964 @@
1
1
  import * as Colors from "@tamagui/colors";
2
- import { PALETTE_BACKGROUND_OFFSET, createThemes as tamaguiCreateThemes } from "@tamagui/theme-builder";
3
- import { defaultChildrenThemes, v5Templates } from "@tamagui/themes/v5";
2
+ import { createThemes } from "@tamagui/themes/builder";
4
3
  import { aaTextContrastRatio, apcaContrast, contrastRatio, fillLabelLc, holdInkFloor, inSwitchOffBand, isLightGround, minContrastRatio, normalizeToHex, pickReadableForeground, plateContrastRatio, relativeLuminance, switchOffFillAlpha, switchOffGround, systemFillHex, systemFillLuminance } from "./colorRules.native.js";
5
4
  import { defaultBaseTheme } from "./defaults/base.native.js";
6
5
  import { darkHairlineContrast, pickSecondaryInk } from "./defaults/builderOptions.native.js";
7
- import { themeRampHues } from "./ramps.native.js";
6
+ import { themeRampHues, themeRamps } from "./ramps.native.js";
8
7
  import { pageSurfaces, pickIdentityInk, withAccentOnSurface, withIdentityInk } from "./accentInk.native.js";
9
8
  import { resolveThemeThroughParents } from "./dedupeInherited.native.js";
10
9
  import { tintHueNames, tintThemeScheme } from "./tintHues.native.js";
11
- function _type_of(obj) {
12
- "@swc/helpers - typeof";
10
+ import { PALETTE_BACKGROUND_OFFSET, buildPalettes, neutralPalette } from "./v5Palettes.native.js";
11
+ import { kebabThemeKey, resolveTemplate, v5Templates } from "./v5Templates.native.js";
13
12
 
14
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
13
+ function _type_of(obj) {
14
+ "@swc/helpers - typeof";
15
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
15
16
  }
16
17
  var intentInkFloor = {
17
- /** Stored hsla(35, 98%, 32%, 1); amber at OKLCH hue 64, 4.70:1 on $color2 (LC-288). */
18
- warning: "#a25f02",
19
- /** Stored hsla(154, 63%, 31%, 1); 4.53:1 on $color2, dE76 0.82. */
20
- success: "#1d8156"
18
+ /** Stored hsla(35, 98%, 32%, 1); amber at OKLCH hue 64, 4.70:1 on $color-2 (LC-288). */
19
+ warning: "#a25f02",
20
+ /** Stored hsla(154, 63%, 31%, 1); 4.53:1 on $color-2, dE76 0.82. */
21
+ success: "#1d8156"
21
22
  };
22
23
  function withIntentInkFloor(palette, ink) {
23
- if (palette.length !== 12) return palette;
24
- var stepped = [...palette];
25
- stepped[10] = ink;
26
- return stepped;
24
+ if (palette.length !== 12) return palette;
25
+ var stepped = [...palette];
26
+ stepped[10] = ink;
27
+ return stepped;
27
28
  }
28
29
  var warningPalette = {
29
- dark: Object.values(Colors.amberDark),
30
- light: withIntentInkFloor(Object.values(Colors.amber), intentInkFloor.warning)
30
+ dark: Object.values(Colors.amberDark),
31
+ light: withIntentInkFloor(Object.values(Colors.amber), intentInkFloor.warning)
31
32
  };
32
33
  var severityFillContrast = 3;
33
34
  function pickSeverityFill(themes, scheme, severity) {
34
- var _loop = function (_i2, _iter2) {
35
- var step = _iter2[_i2];
36
- var fill = luminanceOf(scope[`color${step}`]);
37
- if (fill == null) return "continue";
38
- if (tracks.every(function (track) {
39
- return contrastRatio(fill, track) >= severityFillContrast;
40
- })) {
41
- return {
42
- v: scope[`color${step}`]
43
- };
44
- }
45
- };
46
- var scope = themes[`${scheme}_${severity}`];
47
- if (!scope) return void 0;
48
- var tracks = Object.keys(themes).filter(function (name) {
49
- return new RegExp(`^${scheme}(_[a-z]+)?$`).test(name);
50
- }).filter(function (name) {
51
- return !/_(warning|error|success|accent)$/.test(name);
52
- }).map(function (name) {
53
- var _themes_name;
54
- return luminanceOf((_themes_name = themes[name]) === null || _themes_name === void 0 ? void 0 : _themes_name.color4);
55
- }).filter(function (value) {
56
- return value != null;
57
- });
58
- for (var _i = 0, _iter = [9, 10, 11]; _i < _iter.length; _i++) {
59
- var _ret = _loop(_i, _iter);
60
- if (_type_of(_ret) === "object") return _ret.v;
61
- }
62
- return scope.color11;
35
+ var _loop = function(_i2, _iter2) {
36
+ var step = _iter2[_i2];
37
+ var fill = luminanceOf(scope[`color-${step}`]);
38
+ if (fill == null) return "continue";
39
+ if (tracks.every(function(track) {
40
+ return contrastRatio(fill, track) >= severityFillContrast;
41
+ })) {
42
+ return { v: scope[`color-${step}`] };
43
+ }
44
+ };
45
+ var scope = themes[`${scheme}_${severity}`];
46
+ if (!scope) return void 0;
47
+ var tracks = Object.keys(themes).filter(function(name) {
48
+ return new RegExp(`^${scheme}(_[a-z]+)?$`).test(name);
49
+ }).filter(function(name) {
50
+ return !/_(warning|error|success|accent)$/.test(name);
51
+ }).map(function(name) {
52
+ var _themes_name;
53
+ return luminanceOf((_themes_name = themes[name]) === null || _themes_name === void 0 ? void 0 : _themes_name["color-4"]);
54
+ }).filter(function(value) {
55
+ return value != null;
56
+ });
57
+ for (var _i = 0, _iter = [
58
+ 9,
59
+ 10,
60
+ 11
61
+ ]; _i < _iter.length; _i++) {
62
+ var _ret = _loop(_i, _iter);
63
+ if (_type_of(_ret) === "object") return _ret.v;
64
+ }
65
+ return scope["color-11"];
63
66
  }
64
67
  function holdWarningRoleKeys(themes) {
65
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
66
- var scheme = _iter[_i];
67
- var root = themes[scheme];
68
- var warning = themes[`${scheme}_warning`];
69
- if (!root || !warning) continue;
70
- Object.assign(root, {
71
- warningSoft: warning.color3,
72
- warningMark: warning.color9,
73
- warningInk: warning.color11,
74
- warningFill: pickSeverityFill(themes, scheme, "warning"),
75
- errorFill: pickSeverityFill(themes, scheme, "error"),
76
- successFill: pickSeverityFill(themes, scheme, "success")
77
- });
78
- }
79
- return themes;
68
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
69
+ var scheme = _iter[_i];
70
+ var root = themes[scheme];
71
+ var warning = themes[`${scheme}_warning`];
72
+ if (!root || !warning) continue;
73
+ Object.assign(root, {
74
+ "warning-soft": warning["color-3"],
75
+ "warning-mark": warning["color-9"],
76
+ "warning-ink": warning["color-11"],
77
+ "warning-fill": pickSeverityFill(themes, scheme, "warning"),
78
+ "error-fill": pickSeverityFill(themes, scheme, "error"),
79
+ "success-fill": pickSeverityFill(themes, scheme, "success")
80
+ });
81
+ }
82
+ return themes;
80
83
  }
81
84
  var lightSurfaceGrouped = {
82
- ...v5Templates.light_surface1,
83
- background: PALETTE_BACKGROUND_OFFSET,
84
- backgroundHover: PALETTE_BACKGROUND_OFFSET + 1,
85
- backgroundPress: PALETTE_BACKGROUND_OFFSET + 2,
86
- backgroundFocus: PALETTE_BACKGROUND_OFFSET,
87
- backgroundActive: PALETTE_BACKGROUND_OFFSET
85
+ ...v5Templates.light_surface1,
86
+ background: PALETTE_BACKGROUND_OFFSET,
87
+ "background-hover": PALETTE_BACKGROUND_OFFSET + 1,
88
+ "background-press": PALETTE_BACKGROUND_OFFSET + 2,
89
+ "background-focus": PALETTE_BACKGROUND_OFFSET,
90
+ "background-active": PALETTE_BACKGROUND_OFFSET
88
91
  };
89
- var fillKeys = ["background", "backgroundHover", "backgroundPress", "backgroundFocus", "backgroundActive"];
90
- var edgeKeys = ["borderColor", "borderColorHover", "borderColorFocus", "borderColorPress"];
92
+ var fillKeys = [
93
+ "background",
94
+ "background-hover",
95
+ "background-press",
96
+ "background-focus",
97
+ "background-active"
98
+ ];
99
+ var edgeKeys = [
100
+ "border-color",
101
+ "border-color-hover",
102
+ "border-color-focus",
103
+ "border-color-press"
104
+ ];
91
105
  function liftOneStep(template) {
92
- var lifted = {
93
- ...template
94
- };
95
- for (var _i = 0, _iter = [...fillKeys, ...edgeKeys]; _i < _iter.length; _i++) {
96
- var key = _iter[_i];
97
- lifted[key] = template[key] + 1;
98
- }
99
- return lifted;
106
+ var lifted = { ...template };
107
+ for (var _i = 0, _iter = [...fillKeys, ...edgeKeys]; _i < _iter.length; _i++) {
108
+ var key = _iter[_i];
109
+ lifted[key] = template[key] + 1;
110
+ }
111
+ return lifted;
100
112
  }
101
113
  var darkSurfaceGrouped = {
102
- ...liftOneStep(v5Templates.dark_surface1),
103
- selectFill: PALETTE_BACKGROUND_OFFSET + 4,
104
- selectPress: PALETTE_BACKGROUND_OFFSET + 5
114
+ ...liftOneStep(v5Templates.dark_surface1),
115
+ "select-fill": PALETTE_BACKGROUND_OFFSET + 4,
116
+ "select-press": PALETTE_BACKGROUND_OFFSET + 5
105
117
  };
106
118
  var darkBasePage = {
107
- ...v5Templates.dark_base,
108
- background: PALETTE_BACKGROUND_OFFSET,
109
- backgroundActive: PALETTE_BACKGROUND_OFFSET,
110
- backgroundFocus: PALETTE_BACKGROUND_OFFSET + 1,
111
- backgroundHover: PALETTE_BACKGROUND_OFFSET + 1,
112
- backgroundPress: PALETTE_BACKGROUND_OFFSET + 1
119
+ ...v5Templates.dark_base,
120
+ background: PALETTE_BACKGROUND_OFFSET,
121
+ "background-active": PALETTE_BACKGROUND_OFFSET,
122
+ "background-focus": PALETTE_BACKGROUND_OFFSET + 1,
123
+ "background-hover": PALETTE_BACKGROUND_OFFSET + 1,
124
+ "background-press": PALETTE_BACKGROUND_OFFSET + 1
113
125
  };
114
126
  var houseTemplates = {
115
- ...v5Templates,
116
- light_surface1: lightSurfaceGrouped,
117
- dark_base: darkBasePage,
118
- dark_surface1: darkSurfaceGrouped,
119
- dark_surface2: liftOneStep(v5Templates.dark_surface2)
127
+ ...v5Templates,
128
+ light_surface1: lightSurfaceGrouped,
129
+ dark_base: darkBasePage,
130
+ dark_surface1: darkSurfaceGrouped,
131
+ dark_surface2: liftOneStep(v5Templates.dark_surface2)
120
132
  };
121
133
  var houseComponentThemes = {
122
- Button: {
123
- template: "surface2"
124
- },
125
- Input: {
126
- template: "surface1"
127
- },
128
- TextArea: {
129
- template: "surface1"
130
- },
131
- Progress: {
132
- template: "surface2"
133
- },
134
- ProgressIndicator: {
135
- template: "surface3"
136
- },
137
- Slider: {
138
- template: "surface2"
139
- },
140
- SliderActive: {
141
- template: "surface3"
142
- },
143
- SliderThumb: {
144
- template: "surface1"
145
- },
146
- Switch: {
147
- template: "surface2"
148
- },
149
- Card: {
150
- template: "surface1"
151
- },
152
- ListItem: {
153
- template: "surface1"
154
- },
155
- SelectTrigger: {
156
- template: "surface1"
157
- },
158
- SelectItem: {
159
- template: "surface1"
160
- },
161
- InputContainerFrame: {
162
- template: "surface1"
163
- }
134
+ Button: { template: "surface2" },
135
+ Input: { template: "surface1" },
136
+ TextArea: { template: "surface1" },
137
+ Progress: { template: "surface2" },
138
+ ProgressIndicator: { template: "surface3" },
139
+ Slider: { template: "surface2" },
140
+ SliderActive: { template: "surface3" },
141
+ SliderThumb: { template: "surface1" },
142
+ Switch: { template: "surface2" },
143
+ Card: { template: "surface1" },
144
+ ListItem: { template: "surface1" },
145
+ SelectTrigger: { template: "surface1" },
146
+ SelectItem: { template: "surface1" },
147
+ InputContainerFrame: { template: "surface1" }
164
148
  };
165
149
  var houseGrandChildrenThemes = {
166
- active: {
167
- template: "surface3"
168
- },
169
- alt1: {
170
- template: "surface1"
171
- },
172
- alt2: {
173
- template: "surface2"
174
- }
150
+ active: { template: "surface3" },
151
+ alt1: { template: "surface1" },
152
+ alt2: { template: "surface2" }
175
153
  };
176
154
  function sanitizeGetTheme(getTheme) {
177
- return function (props) {
178
- var out = {};
179
- var _iteratorNormalCompletion = true,
180
- _didIteratorError = false,
181
- _iteratorError = void 0;
182
- try {
183
- for (var _iterator = Object.entries(getTheme(props))[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
184
- var [key, value] = _step.value;
185
- if (value != null) out[key] = value;
186
- }
187
- } catch (err) {
188
- _didIteratorError = true;
189
- _iteratorError = err;
190
- } finally {
191
- try {
192
- if (!_iteratorNormalCompletion && _iterator.return != null) {
193
- _iterator.return();
194
- }
195
- } finally {
196
- if (_didIteratorError) {
197
- throw _iteratorError;
198
- }
199
- }
200
- }
201
- return out;
202
- };
155
+ return function(props) {
156
+ var out = {};
157
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
158
+ try {
159
+ for (var _iterator = Object.entries(getTheme(props))[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
160
+ var [key, value] = _step.value;
161
+ if (value != null) out[key] = value;
162
+ }
163
+ } catch (err) {
164
+ _didIteratorError = true;
165
+ _iteratorError = err;
166
+ } finally {
167
+ try {
168
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
169
+ _iterator.return();
170
+ }
171
+ } finally {
172
+ if (_didIteratorError) {
173
+ throw _iteratorError;
174
+ }
175
+ }
176
+ }
177
+ return out;
178
+ };
203
179
  }
204
- var tintNeutralTextKeys = ["color", "colorHover", "colorPress", "colorFocus", "color11", "color12", "placeholderColor"];
180
+ var tintNeutralTextKeys = [
181
+ "color",
182
+ "color-hover",
183
+ "color-press",
184
+ "color-focus",
185
+ "color-11",
186
+ "color-12",
187
+ "placeholder-color"
188
+ ];
205
189
  function neutralizeTintText(themes) {
206
- var out = {
207
- ...themes
208
- };
209
- var _iteratorNormalCompletion = true,
210
- _didIteratorError = false,
211
- _iteratorError = void 0;
212
- try {
213
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
214
- var [name, theme] = _step.value;
215
- var scheme = tintThemeScheme(name);
216
- if (!scheme) continue;
217
- var base = themes[scheme];
218
- if (!base) continue;
219
- var patched = {
220
- ...theme
221
- };
222
- var _iteratorNormalCompletion1 = true,
223
- _didIteratorError1 = false,
224
- _iteratorError1 = void 0;
225
- try {
226
- for (var _iterator1 = tintNeutralTextKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
227
- var key = _step1.value;
228
- if (key in patched && base[key] != null) patched[key] = base[key];
229
- }
230
- } catch (err) {
231
- _didIteratorError1 = true;
232
- _iteratorError1 = err;
233
- } finally {
234
- try {
235
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
236
- _iterator1.return();
237
- }
238
- } finally {
239
- if (_didIteratorError1) {
240
- throw _iteratorError1;
241
- }
242
- }
243
- }
244
- if (!("textMuted" in patched) && patched.color5 != null && base.textMuted != null) patched.textMuted = pickSecondaryInk(patched, base);
245
- out[name] = patched;
246
- }
247
- } catch (err) {
248
- _didIteratorError = true;
249
- _iteratorError = err;
250
- } finally {
251
- try {
252
- if (!_iteratorNormalCompletion && _iterator.return != null) {
253
- _iterator.return();
254
- }
255
- } finally {
256
- if (_didIteratorError) {
257
- throw _iteratorError;
258
- }
259
- }
260
- }
261
- return out;
190
+ var out = { ...themes };
191
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
192
+ try {
193
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
194
+ var [name, theme] = _step.value;
195
+ var scheme = tintThemeScheme(name);
196
+ if (!scheme) continue;
197
+ var base = themes[scheme];
198
+ if (!base) continue;
199
+ var patched = { ...theme };
200
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
201
+ try {
202
+ for (var _iterator1 = tintNeutralTextKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
203
+ var key = _step1.value;
204
+ if (key in patched && base[key] != null) patched[key] = base[key];
205
+ }
206
+ } catch (err) {
207
+ _didIteratorError1 = true;
208
+ _iteratorError1 = err;
209
+ } finally {
210
+ try {
211
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
212
+ _iterator1.return();
213
+ }
214
+ } finally {
215
+ if (_didIteratorError1) {
216
+ throw _iteratorError1;
217
+ }
218
+ }
219
+ }
220
+ if (!("text-muted" in patched) && patched["color-5"] != null && base["text-muted"] != null) patched["text-muted"] = pickSecondaryInk(patched, base);
221
+ out[name] = patched;
222
+ }
223
+ } catch (err) {
224
+ _didIteratorError = true;
225
+ _iteratorError = err;
226
+ } finally {
227
+ try {
228
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
229
+ _iterator.return();
230
+ }
231
+ } finally {
232
+ if (_didIteratorError) {
233
+ throw _iteratorError;
234
+ }
235
+ }
236
+ }
237
+ return out;
262
238
  }
263
- var semanticIntentNames = /* @__PURE__ */new Set(["error", "warning", "success"]);
264
- var entryControlNames = /* @__PURE__ */new Set(["Input", "TextArea"]);
239
+ var semanticIntentNames = /* @__PURE__ */ new Set([
240
+ "error",
241
+ "warning",
242
+ "success"
243
+ ]);
244
+ var entryControlNames = /* @__PURE__ */ new Set(["Input", "TextArea"]);
265
245
  function neutralizeSemanticEntryText(themes) {
266
- var out = {
267
- ...themes
268
- };
269
- var _iteratorNormalCompletion = true,
270
- _didIteratorError = false,
271
- _iteratorError = void 0;
272
- try {
273
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
274
- var [name, theme] = _step.value;
275
- var [scheme, intent, component, ...rest] = name.split("_");
276
- if (rest.length > 0 || scheme !== "light" && scheme !== "dark") continue;
277
- if (!intent || !semanticIntentNames.has(intent)) continue;
278
- var base = themes[scheme];
279
- if (!base) continue;
280
- if (component === void 0) {
281
- if (base.placeholderColor != null) out[name] = {
282
- ...theme,
283
- placeholderColor: base.placeholderColor
284
- };
285
- continue;
286
- }
287
- if (!entryControlNames.has(component)) continue;
288
- var neutral = {
289
- ...base,
290
- ...themes[`${scheme}_${component}`]
291
- };
292
- var patched = {
293
- ...theme
294
- };
295
- var _iteratorNormalCompletion1 = true,
296
- _didIteratorError1 = false,
297
- _iteratorError1 = void 0;
298
- try {
299
- for (var _iterator1 = tintNeutralTextKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
300
- var key = _step1.value;
301
- if (neutral[key] != null) patched[key] = neutral[key];
302
- }
303
- } catch (err) {
304
- _didIteratorError1 = true;
305
- _iteratorError1 = err;
306
- } finally {
307
- try {
308
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
309
- _iterator1.return();
310
- }
311
- } finally {
312
- if (_didIteratorError1) {
313
- throw _iteratorError1;
314
- }
315
- }
316
- }
317
- out[name] = patched;
318
- }
319
- } catch (err) {
320
- _didIteratorError = true;
321
- _iteratorError = err;
322
- } finally {
323
- try {
324
- if (!_iteratorNormalCompletion && _iterator.return != null) {
325
- _iterator.return();
326
- }
327
- } finally {
328
- if (_didIteratorError) {
329
- throw _iteratorError;
330
- }
331
- }
332
- }
333
- return out;
246
+ var out = { ...themes };
247
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
248
+ try {
249
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
250
+ var [name, theme] = _step.value;
251
+ var [scheme, intent, component, ...rest] = name.split("_");
252
+ if (rest.length > 0 || scheme !== "light" && scheme !== "dark") continue;
253
+ if (!intent || !semanticIntentNames.has(intent)) continue;
254
+ var base = themes[scheme];
255
+ if (!base) continue;
256
+ if (component === void 0) {
257
+ if (base["placeholder-color"] != null) out[name] = {
258
+ ...theme,
259
+ "placeholder-color": base["placeholder-color"]
260
+ };
261
+ continue;
262
+ }
263
+ if (!entryControlNames.has(component)) continue;
264
+ var neutral = {
265
+ ...base,
266
+ ...themes[`${scheme}_${component}`]
267
+ };
268
+ var patched = { ...theme };
269
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
270
+ try {
271
+ for (var _iterator1 = tintNeutralTextKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
272
+ var key = _step1.value;
273
+ if (neutral[key] != null) patched[key] = neutral[key];
274
+ }
275
+ } catch (err) {
276
+ _didIteratorError1 = true;
277
+ _iteratorError1 = err;
278
+ } finally {
279
+ try {
280
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
281
+ _iterator1.return();
282
+ }
283
+ } finally {
284
+ if (_didIteratorError1) {
285
+ throw _iteratorError1;
286
+ }
287
+ }
288
+ }
289
+ out[name] = patched;
290
+ }
291
+ } catch (err) {
292
+ _didIteratorError = true;
293
+ _iteratorError = err;
294
+ } finally {
295
+ try {
296
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
297
+ _iterator.return();
298
+ }
299
+ } finally {
300
+ if (_didIteratorError) {
301
+ throw _iteratorError;
302
+ }
303
+ }
304
+ }
305
+ return out;
334
306
  }
335
307
  function luminanceOf(color) {
336
- var hex = color ? normalizeToHex(color) : null;
337
- return hex ? relativeLuminance(hex) : null;
308
+ var hex = color ? normalizeToHex(color) : null;
309
+ return hex ? relativeLuminance(hex) : null;
338
310
  }
339
311
  function nearestHoldingStep(preferred, steps, holds) {
340
- var preferredLum = luminanceOf(preferred);
341
- if (preferredLum === null || holds(preferredLum)) return preferred;
342
- var best = preferred;
343
- var bestDistance = Number.POSITIVE_INFINITY;
344
- var _iteratorNormalCompletion = true,
345
- _didIteratorError = false,
346
- _iteratorError = void 0;
347
- try {
348
- for (var _iterator = steps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
349
- var step = _step.value;
350
- var lum = luminanceOf(step);
351
- if (step === void 0 || lum === null || !holds(lum)) continue;
352
- var distance = Math.abs(lum - preferredLum);
353
- if (distance < bestDistance) {
354
- bestDistance = distance;
355
- best = step;
356
- }
357
- }
358
- } catch (err) {
359
- _didIteratorError = true;
360
- _iteratorError = err;
361
- } finally {
362
- try {
363
- if (!_iteratorNormalCompletion && _iterator.return != null) {
364
- _iterator.return();
365
- }
366
- } finally {
367
- if (_didIteratorError) {
368
- throw _iteratorError;
369
- }
370
- }
371
- }
372
- return best;
312
+ var preferredLum = luminanceOf(preferred);
313
+ if (preferredLum === null || holds(preferredLum)) return preferred;
314
+ var best = preferred;
315
+ var bestDistance = Number.POSITIVE_INFINITY;
316
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
317
+ try {
318
+ for (var _iterator = steps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
319
+ var step = _step.value;
320
+ var lum = luminanceOf(step);
321
+ if (step === void 0 || lum === null || !holds(lum)) continue;
322
+ var distance = Math.abs(lum - preferredLum);
323
+ if (distance < bestDistance) {
324
+ bestDistance = distance;
325
+ best = step;
326
+ }
327
+ }
328
+ } catch (err) {
329
+ _didIteratorError = true;
330
+ _iteratorError = err;
331
+ } finally {
332
+ try {
333
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
334
+ _iterator.return();
335
+ }
336
+ } finally {
337
+ if (_didIteratorError) {
338
+ throw _iteratorError;
339
+ }
340
+ }
341
+ }
342
+ return best;
373
343
  }
374
344
  function holdAccentFloor(themes) {
375
- var _loop = function (_i2, _iter2) {
376
- var scheme = _iter2[_i2];
377
- var base = themes[scheme];
378
- if (!(base === null || base === void 0 ? void 0 : base.accentBackground) || !base.accentColor) return "continue";
379
- var paper = luminanceOf(base.color1);
380
- var ink = luminanceOf(base.color12);
381
- var surfaces = [base.color1, base.color2, base.color3, base.color4, ...(scheme === "dark" ? [base.color5] : [])].map(luminanceOf);
382
- if (paper === null || ink === null || surfaces.some(function (lum) {
383
- return lum === null;
384
- })) return "continue";
385
- var steps = Array.from({
386
- length: 12
387
- }, function (_, index) {
388
- return base[`accent${index + 1}`];
389
- });
390
- var fill = nearestHoldingStep(base.accentBackground, steps.slice(0, 10), function (lum) {
391
- return Math.max(contrastRatio(lum, paper), contrastRatio(lum, ink)) >= aaTextContrastRatio && contrastRatio(lum, paper) >= minContrastRatio;
392
- });
393
- var accentInk = nearestHoldingStep(base.accentColor, steps, function (lum) {
394
- return surfaces.every(function (surface) {
395
- return contrastRatio(lum, surface) >= aaTextContrastRatio;
396
- });
397
- });
398
- if (fill === base.accentBackground && accentInk === base.accentColor) return "continue";
399
- var _iteratorNormalCompletion = true,
400
- _didIteratorError = false,
401
- _iteratorError = void 0;
402
- try {
403
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
404
- var [name, theme] = _step.value;
405
- if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
406
- var inheritsFill = theme.accentBackground === base.accentBackground;
407
- var inheritsInk = theme.accentColor === base.accentColor;
408
- if (!inheritsFill && !inheritsInk) continue;
409
- out[name] = {
410
- ...theme,
411
- ...(inheritsFill ? {
412
- accentBackground: fill
413
- } : null),
414
- ...(inheritsInk ? {
415
- accentColor: accentInk
416
- } : null)
417
- };
418
- }
419
- } catch (err) {
420
- _didIteratorError = true;
421
- _iteratorError = err;
422
- } finally {
423
- try {
424
- if (!_iteratorNormalCompletion && _iterator.return != null) {
425
- _iterator.return();
426
- }
427
- } finally {
428
- if (_didIteratorError) {
429
- throw _iteratorError;
430
- }
431
- }
432
- }
433
- };
434
- var out = {
435
- ...themes
436
- };
437
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
438
- return out;
345
+ var _loop = function(_i2, _iter2) {
346
+ var scheme = _iter2[_i2];
347
+ var base = themes[scheme];
348
+ if (!(base === null || base === void 0 ? void 0 : base["accent-background"]) || !base["accent-color"]) return "continue";
349
+ var paper = luminanceOf(base["color-1"]);
350
+ var ink = luminanceOf(base["color-12"]);
351
+ var surfaces = [
352
+ base["color-1"],
353
+ base["color-2"],
354
+ base["color-3"],
355
+ base["color-4"],
356
+ ...scheme === "dark" ? [base["color-5"]] : []
357
+ ].map(luminanceOf);
358
+ if (paper === null || ink === null || surfaces.some(function(lum) {
359
+ return lum === null;
360
+ })) return "continue";
361
+ var steps = Array.from({ length: 12 }, function(_, index) {
362
+ return base[`accent-${index + 1}`];
363
+ });
364
+ var fill = nearestHoldingStep(base["accent-background"], steps.slice(0, 10), function(lum) {
365
+ return Math.max(contrastRatio(lum, paper), contrastRatio(lum, ink)) >= aaTextContrastRatio && contrastRatio(lum, paper) >= minContrastRatio;
366
+ });
367
+ var accentInk = nearestHoldingStep(base["accent-color"], steps, function(lum) {
368
+ return surfaces.every(function(surface) {
369
+ return contrastRatio(lum, surface) >= aaTextContrastRatio;
370
+ });
371
+ });
372
+ if (fill === base["accent-background"] && accentInk === base["accent-color"]) return "continue";
373
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
374
+ try {
375
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
376
+ var [name, theme] = _step.value;
377
+ if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
378
+ var inheritsFill = theme["accent-background"] === base["accent-background"];
379
+ var inheritsInk = theme["accent-color"] === base["accent-color"];
380
+ if (!inheritsFill && !inheritsInk) continue;
381
+ out[name] = {
382
+ ...theme,
383
+ ...inheritsFill ? { "accent-background": fill } : null,
384
+ ...inheritsInk ? { "accent-color": accentInk } : null
385
+ };
386
+ }
387
+ } catch (err) {
388
+ _didIteratorError = true;
389
+ _iteratorError = err;
390
+ } finally {
391
+ try {
392
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
393
+ _iterator.return();
394
+ }
395
+ } finally {
396
+ if (_didIteratorError) {
397
+ throw _iteratorError;
398
+ }
399
+ }
400
+ }
401
+ };
402
+ var out = { ...themes };
403
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
404
+ return out;
439
405
  }
440
406
  var selectionSurfaceContrastRatio = 1.16;
441
407
  var selectionSurfaceScope = /^(light|dark)(_[a-z]+)?$/;
442
408
  function holdSelectionSurface(themes) {
443
- var out = {
444
- ...themes
445
- };
446
- var _iteratorNormalCompletion = true,
447
- _didIteratorError = false,
448
- _iteratorError = void 0;
449
- try {
450
- var _loop = function () {
451
- var [scopeName, scope] = _step.value;
452
- if (!selectionSurfaceScope.test(scopeName) || /_(accent|active)$/.test(scopeName)) return "continue";
453
- var page = luminanceOf(scope.background);
454
- var [surface, next, last] = [scope.color4, scope.color5, scope.color6].map(function (color) {
455
- return color ? normalizeToHex(color) : null;
456
- });
457
- if (page === null || !surface || !next || !last) return "continue";
458
- if (contrastRatio(relativeLuminance(surface), page) >= selectionSurfaceContrastRatio) return "continue";
459
- var candidates = [...Array.from({
460
- length: 20
461
- }, function (_, index) {
462
- return mixHex(surface, next, (index + 1) / 20);
463
- }), ...Array.from({
464
- length: 20
465
- }, function (_, index) {
466
- return mixHex(next, last, (index + 1) / 20);
467
- })];
468
- var held = candidates.find(function (candidate) {
469
- return contrastRatio(relativeLuminance(candidate), page) >= selectionSurfaceContrastRatio;
470
- });
471
- if (!held) return "continue";
472
- var _iteratorNormalCompletion2 = true,
473
- _didIteratorError2 = false,
474
- _iteratorError2 = void 0;
475
- try {
476
- for (var _iterator2 = Object.entries(themes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
477
- var [name, theme] = _step1.value;
478
- if (name !== scopeName && !name.startsWith(`${scopeName}_`)) continue;
479
- if (theme.color4 !== scope.color4) continue;
480
- out[name] = {
481
- ...out[name],
482
- color4: held,
483
- ...(theme.borderColor === scope.color4 ? {
484
- borderColor: held
485
- } : null),
486
- ...(theme.selectFill === scope.color4 ? {
487
- selectFill: held
488
- } : null)
489
- };
490
- }
491
- } catch (err) {
492
- _didIteratorError2 = true;
493
- _iteratorError2 = err;
494
- } finally {
495
- try {
496
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
497
- _iterator2.return();
498
- }
499
- } finally {
500
- if (_didIteratorError2) {
501
- throw _iteratorError2;
502
- }
503
- }
504
- }
505
- };
506
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();
507
- } catch (err) {
508
- _didIteratorError = true;
509
- _iteratorError = err;
510
- } finally {
511
- try {
512
- if (!_iteratorNormalCompletion && _iterator.return != null) {
513
- _iterator.return();
514
- }
515
- } finally {
516
- if (_didIteratorError) {
517
- throw _iteratorError;
518
- }
519
- }
520
- }
521
- return out;
409
+ var out = { ...themes };
410
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
411
+ try {
412
+ var _loop = function() {
413
+ var [scopeName, scope] = _step.value;
414
+ if (!selectionSurfaceScope.test(scopeName) || /_(accent|active)$/.test(scopeName)) return "continue";
415
+ var page = luminanceOf(scope.background);
416
+ var [surface, next, last] = [
417
+ scope["color-4"],
418
+ scope["color-5"],
419
+ scope["color-6"]
420
+ ].map(function(color) {
421
+ return color ? normalizeToHex(color) : null;
422
+ });
423
+ if (page === null || !surface || !next || !last) return "continue";
424
+ if (contrastRatio(relativeLuminance(surface), page) >= selectionSurfaceContrastRatio) return "continue";
425
+ var candidates = [...Array.from({ length: 20 }, function(_, index) {
426
+ return mixHex(surface, next, (index + 1) / 20);
427
+ }), ...Array.from({ length: 20 }, function(_, index) {
428
+ return mixHex(next, last, (index + 1) / 20);
429
+ })];
430
+ var held = candidates.find(function(candidate) {
431
+ return contrastRatio(relativeLuminance(candidate), page) >= selectionSurfaceContrastRatio;
432
+ });
433
+ if (!held) return "continue";
434
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
435
+ try {
436
+ for (var _iterator2 = Object.entries(themes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
437
+ var [name, theme] = _step1.value;
438
+ if (name !== scopeName && !name.startsWith(`${scopeName}_`)) continue;
439
+ if (theme["color-4"] !== scope["color-4"]) continue;
440
+ out[name] = {
441
+ ...out[name],
442
+ "color-4": held,
443
+ ...theme["border-color"] === scope["color-4"] ? { "border-color": held } : null,
444
+ ...theme["select-fill"] === scope["color-4"] ? { "select-fill": held } : null
445
+ };
446
+ }
447
+ } catch (err) {
448
+ _didIteratorError2 = true;
449
+ _iteratorError2 = err;
450
+ } finally {
451
+ try {
452
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
453
+ _iterator2.return();
454
+ }
455
+ } finally {
456
+ if (_didIteratorError2) {
457
+ throw _iteratorError2;
458
+ }
459
+ }
460
+ }
461
+ };
462
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();
463
+ } catch (err) {
464
+ _didIteratorError = true;
465
+ _iteratorError = err;
466
+ } finally {
467
+ try {
468
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
469
+ _iterator.return();
470
+ }
471
+ } finally {
472
+ if (_didIteratorError) {
473
+ throw _iteratorError;
474
+ }
475
+ }
476
+ }
477
+ return out;
522
478
  }
523
479
  function ownerScope(scopes, name) {
524
- return scopes.filter(function (scope) {
525
- return name === scope || name.startsWith(`${scope}_`);
526
- }).reduce(function (longest, scope) {
527
- return scope.length > longest.length ? scope : longest;
528
- }, "");
480
+ return scopes.filter(function(scope) {
481
+ return name === scope || name.startsWith(`${scope}_`);
482
+ }).reduce(function(longest, scope) {
483
+ return scope.length > longest.length ? scope : longest;
484
+ }, "");
529
485
  }
530
486
  function clearsDarkGrounds(color, grounds) {
531
- var brightest = Math.max(...grounds);
532
- var luminance = luminanceOf(color);
533
- return luminance !== null && luminance > brightest && grounds.every(function (ground) {
534
- return contrastRatio(luminance, ground) >= darkHairlineContrast;
535
- });
487
+ var brightest = Math.max(...grounds);
488
+ var luminance = luminanceOf(color);
489
+ return luminance !== null && luminance > brightest && grounds.every(function(ground) {
490
+ return contrastRatio(luminance, ground) >= darkHairlineContrast;
491
+ });
536
492
  }
537
493
  function darkHairlineOf(scope) {
538
- var ramp = Array.from({
539
- length: 12
540
- }, function (_, index) {
541
- return scope[`color${index + 1}`];
542
- });
543
- var grounds = [scope.background, scope.color4].map(function (color) {
544
- return luminanceOf(color);
545
- });
546
- if (grounds.includes(null)) return void 0;
547
- var hairline = ramp.findIndex(function (color, index) {
548
- return index < 11 && clearsDarkGrounds(color, grounds);
549
- });
550
- return hairline < 0 ? void 0 : {
551
- ramp,
552
- hairline
553
- };
494
+ var ramp = Array.from({ length: 12 }, function(_, index) {
495
+ return scope[`color-${index + 1}`];
496
+ });
497
+ var grounds = [scope.background, scope["color-4"]].map(function(color) {
498
+ return luminanceOf(color);
499
+ });
500
+ if (grounds.includes(null)) return void 0;
501
+ var hairline = ramp.findIndex(function(color, index) {
502
+ return index < 11 && clearsDarkGrounds(color, grounds);
503
+ });
504
+ return hairline < 0 ? void 0 : {
505
+ ramp,
506
+ hairline
507
+ };
554
508
  }
555
- var darkEdgeStateKeys = ["borderColor", "borderColorHover", "borderColorFocus", "borderColorPress"];
509
+ var darkEdgeStateKeys = [
510
+ "border-color",
511
+ "border-color-hover",
512
+ "border-color-focus",
513
+ "border-color-press"
514
+ ];
556
515
  function darkEdgesOf(name, theme, scopeName, scope, param) {
557
- var {
558
- ramp,
559
- hairline
560
- } = param;
561
- var medium = hairline + 1;
562
- var surface = name === scopeName || theme.background === scope.color4;
563
- var step = ramp.indexOf(theme.borderColor);
564
- var shift = surface && step >= 0 ? medium - step : 0;
565
- var moved = {};
566
- if ("borderColorHairline" in theme || name === scopeName) moved.borderColorHairline = ramp[hairline];
567
- if (shift <= 0) return moved;
568
- var _iteratorNormalCompletion = true,
569
- _didIteratorError = false,
570
- _iteratorError = void 0;
571
- try {
572
- for (var _iterator = darkEdgeStateKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
573
- var key = _step.value;
574
- var at = ramp.indexOf(theme[key]);
575
- if (at >= 0) moved[key] = ramp[Math.min(11, at + shift)];
576
- }
577
- } catch (err) {
578
- _didIteratorError = true;
579
- _iteratorError = err;
580
- } finally {
581
- try {
582
- if (!_iteratorNormalCompletion && _iterator.return != null) {
583
- _iterator.return();
584
- }
585
- } finally {
586
- if (_didIteratorError) {
587
- throw _iteratorError;
588
- }
589
- }
590
- }
591
- return moved;
516
+ var { ramp, hairline } = param;
517
+ var medium = hairline + 1;
518
+ var surface = name === scopeName || theme.background === scope["color-4"];
519
+ var step = ramp.indexOf(theme["border-color"]);
520
+ var shift = surface && step >= 0 ? medium - step : 0;
521
+ var moved = {};
522
+ if ("border-color-hairline" in theme || name === scopeName) moved["border-color-hairline"] = ramp[hairline];
523
+ if (shift <= 0) return moved;
524
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
525
+ try {
526
+ for (var _iterator = darkEdgeStateKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
527
+ var key = _step.value;
528
+ var at = ramp.indexOf(theme[key]);
529
+ if (at >= 0) moved[key] = ramp[Math.min(11, at + shift)];
530
+ }
531
+ } catch (err) {
532
+ _didIteratorError = true;
533
+ _iteratorError = err;
534
+ } finally {
535
+ try {
536
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
537
+ _iterator.return();
538
+ }
539
+ } finally {
540
+ if (_didIteratorError) {
541
+ throw _iteratorError;
542
+ }
543
+ }
544
+ }
545
+ return moved;
592
546
  }
593
547
  function holdDarkEdges(themes) {
594
- var out = {
595
- ...themes
596
- };
597
- var scopes = Object.keys(themes).filter(function (name2) {
598
- return /^dark(_[a-z]+)?$/.test(name2);
599
- });
600
- var _iteratorNormalCompletion = true,
601
- _didIteratorError = false,
602
- _iteratorError = void 0;
603
- try {
604
- for (var _iterator = scopes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
605
- var scopeName = _step.value;
606
- if (/_(accent|active)$/.test(scopeName)) continue;
607
- var scope = themes[scopeName];
608
- var pick = darkHairlineOf(scope);
609
- if (!pick) continue;
610
- var _iteratorNormalCompletion1 = true,
611
- _didIteratorError1 = false,
612
- _iteratorError1 = void 0;
613
- try {
614
- for (var _iterator1 = Object.entries(themes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
615
- var [name, theme] = _step1.value;
616
- if (ownerScope(scopes, name) !== scopeName) continue;
617
- out[name] = {
618
- ...out[name],
619
- ...darkEdgesOf(name, theme, scopeName, scope, pick)
620
- };
621
- }
622
- } catch (err) {
623
- _didIteratorError1 = true;
624
- _iteratorError1 = err;
625
- } finally {
626
- try {
627
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
628
- _iterator1.return();
629
- }
630
- } finally {
631
- if (_didIteratorError1) {
632
- throw _iteratorError1;
633
- }
634
- }
635
- }
636
- }
637
- } catch (err) {
638
- _didIteratorError = true;
639
- _iteratorError = err;
640
- } finally {
641
- try {
642
- if (!_iteratorNormalCompletion && _iterator.return != null) {
643
- _iterator.return();
644
- }
645
- } finally {
646
- if (_didIteratorError) {
647
- throw _iteratorError;
648
- }
649
- }
650
- }
651
- return out;
548
+ var out = { ...themes };
549
+ var scopes = Object.keys(themes).filter(function(name2) {
550
+ return /^dark(_[a-z]+)?$/.test(name2);
551
+ });
552
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
553
+ try {
554
+ for (var _iterator = scopes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
555
+ var scopeName = _step.value;
556
+ if (/_(accent|active)$/.test(scopeName)) continue;
557
+ var scope = themes[scopeName];
558
+ var pick = darkHairlineOf(scope);
559
+ if (!pick) continue;
560
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
561
+ try {
562
+ for (var _iterator1 = Object.entries(themes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
563
+ var [name, theme] = _step1.value;
564
+ if (ownerScope(scopes, name) !== scopeName) continue;
565
+ out[name] = {
566
+ ...out[name],
567
+ ...darkEdgesOf(name, theme, scopeName, scope, pick)
568
+ };
569
+ }
570
+ } catch (err) {
571
+ _didIteratorError1 = true;
572
+ _iteratorError1 = err;
573
+ } finally {
574
+ try {
575
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
576
+ _iterator1.return();
577
+ }
578
+ } finally {
579
+ if (_didIteratorError1) {
580
+ throw _iteratorError1;
581
+ }
582
+ }
583
+ }
584
+ }
585
+ } catch (err) {
586
+ _didIteratorError = true;
587
+ _iteratorError = err;
588
+ } finally {
589
+ try {
590
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
591
+ _iterator.return();
592
+ }
593
+ } finally {
594
+ if (_didIteratorError) {
595
+ throw _iteratorError;
596
+ }
597
+ }
598
+ }
599
+ return out;
652
600
  }
653
601
  function firstClearing(neutral, grounds) {
654
- var lums = grounds.map(function (ground) {
655
- return luminanceOf(ground);
656
- });
657
- if (lums.includes(null)) return -1;
658
- var darkest = Math.min(...lums);
659
- var brightest = Math.max(...lums);
660
- var light = isLightGround(grounds[0]);
661
- return neutral.findIndex(function (color) {
662
- var lum = luminanceOf(color);
663
- return lum !== null && (light ? lum < darkest : lum > brightest) && lums.every(function (ground) {
664
- return contrastRatio(lum, ground) >= minContrastRatio;
665
- });
666
- });
602
+ var lums = grounds.map(function(ground) {
603
+ return luminanceOf(ground);
604
+ });
605
+ if (lums.includes(null)) return -1;
606
+ var darkest = Math.min(...lums);
607
+ var brightest = Math.max(...lums);
608
+ var light = isLightGround(grounds[0]);
609
+ return neutral.findIndex(function(color) {
610
+ var lum = luminanceOf(color);
611
+ return lum !== null && (light ? lum < darkest : lum > brightest) && lums.every(function(ground) {
612
+ return contrastRatio(lum, ground) >= minContrastRatio;
613
+ });
614
+ });
667
615
  }
668
616
  function inheritedValue(out, themes, name, key) {
669
- for (var at = name; at; at = at.slice(0, Math.max(0, at.lastIndexOf("_")))) {
670
- var _out_at;
671
- var _this;
672
- var value = (_this = (_out_at = out[at]) !== null && _out_at !== void 0 ? _out_at : themes[at]) === null || _this === void 0 ? void 0 : _this[key];
673
- if (value !== void 0) return value;
674
- if (!at.includes("_")) break;
675
- }
676
- return void 0;
617
+ for (var at = name; at; at = at.slice(0, Math.max(0, at.lastIndexOf("_")))) {
618
+ var _out_at;
619
+ var _this;
620
+ var value = (_this = (_out_at = out[at]) !== null && _out_at !== void 0 ? _out_at : themes[at]) === null || _this === void 0 ? void 0 : _this[key];
621
+ if (value !== void 0) return value;
622
+ if (!at.includes("_")) break;
623
+ }
624
+ return void 0;
677
625
  }
678
626
  function nearestStep(ramp, color) {
679
- var lum = luminanceOf(color);
680
- if (lum === null) return -1;
681
- return ramp.reduce(function (best, step, index) {
682
- var _luminanceOf, _luminanceOf1;
683
- return Math.abs(((_luminanceOf = luminanceOf(step)) !== null && _luminanceOf !== void 0 ? _luminanceOf : 2) - lum) < Math.abs(((_luminanceOf1 = luminanceOf(ramp[best])) !== null && _luminanceOf1 !== void 0 ? _luminanceOf1 : 2) - lum) ? index : best;
684
- }, 0);
627
+ var lum = luminanceOf(color);
628
+ if (lum === null) return -1;
629
+ return ramp.reduce(function(best, step, index) {
630
+ var _luminanceOf, _luminanceOf1;
631
+ return Math.abs(((_luminanceOf = luminanceOf(step)) !== null && _luminanceOf !== void 0 ? _luminanceOf : 2) - lum) < Math.abs(((_luminanceOf1 = luminanceOf(ramp[best])) !== null && _luminanceOf1 !== void 0 ? _luminanceOf1 : 2) - lum) ? index : best;
632
+ }, 0);
685
633
  }
686
634
  function fieldEdgesOf(themes, out, neutral, scopeName) {
687
- var scope = themes[scopeName];
688
- var field = `${scopeName}_Input`;
689
- var edge = firstClearing(neutral, [scope.background, inheritedValue(out, themes, field, "background")]);
690
- if (edge < 0) return void 0;
691
- var ramp = Array.from({
692
- length: 12
693
- }, function (_, index) {
694
- return scope[`color${index + 1}`];
695
- });
696
- var rest = nearestStep(ramp, inheritedValue(out, themes, field, "borderColor"));
697
- var hover = nearestStep(ramp, inheritedValue(out, themes, field, "borderColorHover"));
698
- return {
699
- borderColorField: neutral[edge],
700
- borderColorFieldHover: neutral[Math.min(11, Math.max(edge, edge + hover - rest))]
701
- };
635
+ var scope = themes[scopeName];
636
+ var field = `${scopeName}_Input`;
637
+ var edge = firstClearing(neutral, [scope.background, inheritedValue(out, themes, field, "background")]);
638
+ if (edge < 0) return void 0;
639
+ var ramp = Array.from({ length: 12 }, function(_, index) {
640
+ return scope[`color-${index + 1}`];
641
+ });
642
+ var rest = nearestStep(ramp, inheritedValue(out, themes, field, "border-color"));
643
+ var hover = nearestStep(ramp, inheritedValue(out, themes, field, "border-color-hover"));
644
+ return {
645
+ "border-color-field": neutral[edge],
646
+ "border-color-field-hover": neutral[Math.min(11, Math.max(edge, edge + hover - rest))]
647
+ };
702
648
  }
703
649
  function intentFieldEdges(themes, out, scopeName, pages) {
704
- var scope = themes[scopeName];
705
- var field = `${scopeName}_Input`;
706
- var ramp = Array.from({
707
- length: 12
708
- }, function (_, index) {
709
- return scope[`color${index + 1}`];
710
- });
711
- var edge = firstClearing(ramp, [...pages, inheritedValue(out, themes, field, "background")]);
712
- if (edge < 0) return {
713
- borderColorField: inheritedValue(out, themes, field, "borderColor"),
714
- borderColorFieldHover: inheritedValue(out, themes, field, "borderColorHover")
715
- };
716
- return {
717
- borderColorField: ramp[edge],
718
- borderColorFieldHover: ramp[Math.min(11, edge + 1)]
719
- };
650
+ var scope = themes[scopeName];
651
+ var field = `${scopeName}_Input`;
652
+ var ramp = Array.from({ length: 12 }, function(_, index) {
653
+ return scope[`color-${index + 1}`];
654
+ });
655
+ var edge = firstClearing(ramp, [...pages, inheritedValue(out, themes, field, "background")]);
656
+ if (edge < 0) return {
657
+ "border-color-field": inheritedValue(out, themes, field, "border-color"),
658
+ "border-color-field-hover": inheritedValue(out, themes, field, "border-color-hover")
659
+ };
660
+ return {
661
+ "border-color-field": ramp[edge],
662
+ "border-color-field-hover": ramp[Math.min(11, edge + 1)]
663
+ };
720
664
  }
721
665
  function controlEdgePatch(themes, out, scopeName, param) {
722
- var {
723
- scheme,
724
- neutral,
725
- pages,
726
- rootFields,
727
- rootControl
728
- } = param;
729
- var scope = themes[scopeName];
730
- var patch = {};
731
- if (scheme === "dark" && "switchTrackOff" in scope) patch.switchTrackOffBorder = scope.switchTrackOff;
732
- if (semanticIntentNames.has(scopeName.slice(scheme.length + 1))) return Object.assign(patch, intentFieldEdges(themes, out, scopeName, pages));
733
- var fields = fieldEdgesOf(themes, out, neutral, scopeName);
734
- if (fields) {
735
- var _iteratorNormalCompletion = true,
736
- _didIteratorError = false,
737
- _iteratorError = void 0;
738
- try {
739
- for (var _iterator = Object.entries(fields)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
740
- var [key, value] = _step.value;
741
- if (value !== rootFields[key]) patch[key] = value;
742
- }
743
- } catch (err) {
744
- _didIteratorError = true;
745
- _iteratorError = err;
746
- } finally {
747
- try {
748
- if (!_iteratorNormalCompletion && _iterator.return != null) {
749
- _iterator.return();
750
- }
751
- } finally {
752
- if (_didIteratorError) {
753
- throw _iteratorError;
754
- }
755
- }
756
- }
757
- }
758
- var control = firstClearing(neutral, [scope.background]);
759
- if (control >= 0 && control !== rootControl) patch.borderColorControl = neutral[control];
760
- return patch;
666
+ var { scheme, neutral, pages, rootFields, rootControl } = param;
667
+ var scope = themes[scopeName];
668
+ var patch = {};
669
+ if (scheme === "dark" && "switch-track-off" in scope) patch["switch-track-off-border"] = scope["switch-track-off"];
670
+ if (semanticIntentNames.has(scopeName.slice(scheme.length + 1))) return Object.assign(patch, intentFieldEdges(themes, out, scopeName, pages));
671
+ var fields = fieldEdgesOf(themes, out, neutral, scopeName);
672
+ if (fields) {
673
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
674
+ try {
675
+ for (var _iterator = Object.entries(fields)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
676
+ var [key, value] = _step.value;
677
+ if (value !== rootFields[key]) patch[key] = value;
678
+ }
679
+ } catch (err) {
680
+ _didIteratorError = true;
681
+ _iteratorError = err;
682
+ } finally {
683
+ try {
684
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
685
+ _iterator.return();
686
+ }
687
+ } finally {
688
+ if (_didIteratorError) {
689
+ throw _iteratorError;
690
+ }
691
+ }
692
+ }
693
+ }
694
+ var control = firstClearing(neutral, [scope.background]);
695
+ if (control >= 0 && control !== rootControl) patch["border-color-control"] = neutral[control];
696
+ return patch;
761
697
  }
762
698
  function holdControlEdges(themes) {
763
- var _loop = function (_i2, _iter2) {
764
- var scheme = _iter2[_i2];
765
- var root = themes[scheme];
766
- if (!root) return "continue";
767
- var neutral = Array.from({
768
- length: 12
769
- }, function (_, index) {
770
- return root[`color${index + 1}`];
771
- });
772
- var rootFields = fieldEdgesOf(themes, out, neutral, scheme);
773
- var rootControl = firstClearing(neutral, [root.background]);
774
- if (!rootFields || rootControl < 0) return "continue";
775
- out[scheme] = {
776
- ...out[scheme],
777
- ...rootFields,
778
- borderColorControl: neutral[rootControl],
779
- switchTrackOffBorder: scheme === "light" ? neutral[rootControl] : root.switchTrackOff
780
- };
781
- var scopes = Object.keys(themes).filter(function (name) {
782
- return new RegExp(`^${scheme}_[a-z]+$`).test(name) && !/_(accent|active)$/.test(name);
783
- });
784
- var pages = [root.background, ...scopes.filter(function (name) {
785
- return !semanticIntentNames.has(name.slice(scheme.length + 1));
786
- }).map(function (name) {
787
- return themes[name].background;
788
- })];
789
- var context = {
790
- scheme,
791
- neutral,
792
- pages,
793
- rootFields,
794
- rootControl
795
- };
796
- var _iteratorNormalCompletion = true,
797
- _didIteratorError = false,
798
- _iteratorError = void 0;
799
- try {
800
- for (var _iterator = scopes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
801
- var scopeName = _step.value;
802
- var patch = controlEdgePatch(themes, out, scopeName, context);
803
- if (Object.keys(patch).length > 0) out[scopeName] = {
804
- ...out[scopeName],
805
- ...patch
806
- };
807
- }
808
- } catch (err) {
809
- _didIteratorError = true;
810
- _iteratorError = err;
811
- } finally {
812
- try {
813
- if (!_iteratorNormalCompletion && _iterator.return != null) {
814
- _iterator.return();
815
- }
816
- } finally {
817
- if (_didIteratorError) {
818
- throw _iteratorError;
819
- }
820
- }
821
- }
822
- };
823
- var out = {
824
- ...themes
825
- };
826
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
827
- return out;
699
+ var _loop = function(_i2, _iter2) {
700
+ var scheme = _iter2[_i2];
701
+ var root = themes[scheme];
702
+ if (!root) return "continue";
703
+ var neutral = Array.from({ length: 12 }, function(_, index) {
704
+ return root[`color-${index + 1}`];
705
+ });
706
+ var rootFields = fieldEdgesOf(themes, out, neutral, scheme);
707
+ var rootControl = firstClearing(neutral, [root.background]);
708
+ if (!rootFields || rootControl < 0) return "continue";
709
+ out[scheme] = {
710
+ ...out[scheme],
711
+ ...rootFields,
712
+ "border-color-control": neutral[rootControl],
713
+ "switch-track-off-border": scheme === "light" ? neutral[rootControl] : root["switch-track-off"]
714
+ };
715
+ var scopes = Object.keys(themes).filter(function(name) {
716
+ return new RegExp(`^${scheme}_[a-z]+$`).test(name) && !/_(accent|active)$/.test(name);
717
+ });
718
+ var pages = [root.background, ...scopes.filter(function(name) {
719
+ return !semanticIntentNames.has(name.slice(scheme.length + 1));
720
+ }).map(function(name) {
721
+ return themes[name].background;
722
+ })];
723
+ var context = {
724
+ scheme,
725
+ neutral,
726
+ pages,
727
+ rootFields,
728
+ rootControl
729
+ };
730
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
731
+ try {
732
+ for (var _iterator = scopes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
733
+ var scopeName = _step.value;
734
+ var patch = controlEdgePatch(themes, out, scopeName, context);
735
+ if (Object.keys(patch).length > 0) out[scopeName] = {
736
+ ...out[scopeName],
737
+ ...patch
738
+ };
739
+ }
740
+ } catch (err) {
741
+ _didIteratorError = true;
742
+ _iteratorError = err;
743
+ } finally {
744
+ try {
745
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
746
+ _iterator.return();
747
+ }
748
+ } finally {
749
+ if (_didIteratorError) {
750
+ throw _iteratorError;
751
+ }
752
+ }
753
+ }
754
+ };
755
+ var out = { ...themes };
756
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
757
+ return out;
828
758
  }
829
759
  var selectedTintContrastRatio = 1.1;
830
760
  var neutralSelectedTintContrastRatio = 1.25;
831
761
  var achromaticChannelSpread = 8;
832
762
  function isAchromaticRamp(steps) {
833
- return steps.every(function (step) {
834
- var hex = step ? normalizeToHex(step) : null;
835
- if (!hex) return false;
836
- var channels = [1, 3, 5].map(function (offset) {
837
- return Number.parseInt(hex.slice(offset, offset + 2), 16);
838
- });
839
- return Math.max(...channels) - Math.min(...channels) <= achromaticChannelSpread;
840
- });
763
+ return steps.every(function(step) {
764
+ var hex = step ? normalizeToHex(step) : null;
765
+ if (!hex) return false;
766
+ var channels = [
767
+ 1,
768
+ 3,
769
+ 5
770
+ ].map(function(offset) {
771
+ return Number.parseInt(hex.slice(offset, offset + 2), 16);
772
+ });
773
+ return Math.max(...channels) - Math.min(...channels) <= achromaticChannelSpread;
774
+ });
841
775
  }
842
776
  function holdSelectedState(themes) {
843
- var _loop = function (_i2, _iter2) {
844
- var scheme = _iter2[_i2];
845
- var base = themes[scheme];
846
- if (!(base === null || base === void 0 ? void 0 : base.accentColor)) return "continue";
847
- var steps = Array.from({
848
- length: 12
849
- }, function (_, index) {
850
- return base[`accent${index + 1}`];
851
- });
852
- var paint = selectedPaint(base, steps, base.accentColor);
853
- if (paint) out[scheme] = {
854
- ...base,
855
- ...paint
856
- };
857
- };
858
- var out = {
859
- ...themes
860
- };
861
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
862
- return out;
777
+ var _loop = function(_i2, _iter2) {
778
+ var scheme = _iter2[_i2];
779
+ var base = themes[scheme];
780
+ if (!(base === null || base === void 0 ? void 0 : base["accent-color"])) return "continue";
781
+ var steps = Array.from({ length: 12 }, function(_, index) {
782
+ return base[`accent-${index + 1}`];
783
+ });
784
+ var paint = selectedPaint(base, steps, base["accent-color"]);
785
+ if (paint) out[scheme] = {
786
+ ...base,
787
+ ...paint
788
+ };
789
+ };
790
+ var out = { ...themes };
791
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
792
+ return out;
863
793
  }
864
794
  function selectedPaint(scope, steps, accentColor) {
865
- var page = luminanceOf(scope.color1);
866
- var neutral = luminanceOf(scope.color4);
867
- if (page === null || neutral === null) return void 0;
868
- var grey = isAchromaticRamp(steps);
869
- var offNeutral = grey ? neutralSelectedTintContrastRatio : selectedTintContrastRatio;
870
- var tint = nearestHoldingStep(scope.color4, steps, function (lum2) {
871
- return contrastRatio(lum2, page) >= selectedTintContrastRatio && contrastRatio(lum2, neutral) >= offNeutral;
872
- });
873
- var tintLum = luminanceOf(tint);
874
- if (tint === scope.color4 || tintLum === null) return void 0;
875
- if (grey) {
876
- var strongest = tint;
877
- var strongestRatio = 0;
878
- var _iteratorNormalCompletion = true,
879
- _didIteratorError = false,
880
- _iteratorError = void 0;
881
- try {
882
- for (var _iterator = steps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
883
- var step = _step.value;
884
- var lum = luminanceOf(step);
885
- if (step === void 0 || lum === null) continue;
886
- var ratio = contrastRatio(lum, tintLum);
887
- if (ratio > strongestRatio) {
888
- strongest = step;
889
- strongestRatio = ratio;
890
- }
891
- }
892
- } catch (err) {
893
- _didIteratorError = true;
894
- _iteratorError = err;
895
- } finally {
896
- try {
897
- if (!_iteratorNormalCompletion && _iterator.return != null) {
898
- _iterator.return();
899
- }
900
- } finally {
901
- if (_didIteratorError) {
902
- throw _iteratorError;
903
- }
904
- }
905
- }
906
- if (strongestRatio >= aaTextContrastRatio) return {
907
- selectedBackground: tint,
908
- selectedColor: strongest
909
- };
910
- }
911
- var ink = nearestHoldingStep(accentColor, steps, function (lum2) {
912
- return contrastRatio(lum2, tintLum) >= aaTextContrastRatio;
913
- });
914
- return {
915
- selectedBackground: tint,
916
- selectedColor: ink
917
- };
795
+ var page = luminanceOf(scope["color-1"]);
796
+ var neutral = luminanceOf(scope["color-4"]);
797
+ if (page === null || neutral === null) return void 0;
798
+ var grey = isAchromaticRamp(steps);
799
+ var offNeutral = grey ? neutralSelectedTintContrastRatio : selectedTintContrastRatio;
800
+ var tint = nearestHoldingStep(scope["color-4"], steps, function(lum2) {
801
+ return contrastRatio(lum2, page) >= selectedTintContrastRatio && contrastRatio(lum2, neutral) >= offNeutral;
802
+ });
803
+ var tintLum = luminanceOf(tint);
804
+ if (tint === scope["color-4"] || tintLum === null) return void 0;
805
+ if (grey) {
806
+ var strongest = tint;
807
+ var strongestRatio = 0;
808
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
809
+ try {
810
+ for (var _iterator = steps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
811
+ var step = _step.value;
812
+ var lum = luminanceOf(step);
813
+ if (step === void 0 || lum === null) continue;
814
+ var ratio = contrastRatio(lum, tintLum);
815
+ if (ratio > strongestRatio) {
816
+ strongest = step;
817
+ strongestRatio = ratio;
818
+ }
819
+ }
820
+ } catch (err) {
821
+ _didIteratorError = true;
822
+ _iteratorError = err;
823
+ } finally {
824
+ try {
825
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
826
+ _iterator.return();
827
+ }
828
+ } finally {
829
+ if (_didIteratorError) {
830
+ throw _iteratorError;
831
+ }
832
+ }
833
+ }
834
+ if (strongestRatio >= aaTextContrastRatio) return {
835
+ "selected-background": tint,
836
+ "selected-color": strongest
837
+ };
838
+ }
839
+ var ink = nearestHoldingStep(accentColor, steps, function(lum2) {
840
+ return contrastRatio(lum2, tintLum) >= aaTextContrastRatio;
841
+ });
842
+ return {
843
+ "selected-background": tint,
844
+ "selected-color": ink
845
+ };
918
846
  }
919
847
  var switchStateContrastRatio = 1.5;
920
- var switchRaisedAlphas = [0.16, 0.2, 0.24, 0.28, 0.32, 0.36, 0.4];
921
- var switchRaisedAlphaStep = 0.04;
848
+ var switchRaisedAlphas = [
849
+ .16,
850
+ .2,
851
+ .24,
852
+ .28,
853
+ .32,
854
+ .36,
855
+ .4
856
+ ];
857
+ var switchRaisedAlphaStep = .04;
922
858
  function raisedGrounds(themes, scheme) {
923
- if (scheme === "light") return [];
924
- var hues = Object.entries(themes).filter(function (param) {
925
- var [name] = param;
926
- return new RegExp(`^${scheme}_[a-z]+$`).test(name);
927
- }).filter(function (param) {
928
- var [name] = param;
929
- return !/_(accent|active)$/.test(name);
930
- });
931
- return [themes[scheme], ...hues.map(function (param) {
932
- var [, theme] = param;
933
- return theme;
934
- })].flatMap(function (theme) {
935
- return [theme === null || theme === void 0 ? void 0 : theme.color4, theme === null || theme === void 0 ? void 0 : theme.color5];
936
- }).filter(function (color) {
937
- return typeof color === "string";
938
- });
859
+ if (scheme === "light") return [];
860
+ var hues = Object.entries(themes).filter(function(param) {
861
+ var [name] = param;
862
+ return new RegExp(`^${scheme}_[a-z]+$`).test(name);
863
+ }).filter(function(param) {
864
+ var [name] = param;
865
+ return !/_(accent|active)$/.test(name);
866
+ });
867
+ return [themes[scheme], ...hues.map(function(param) {
868
+ var [, theme] = param;
869
+ return theme;
870
+ })].flatMap(function(theme) {
871
+ return [theme === null || theme === void 0 ? void 0 : theme["color-4"], theme === null || theme === void 0 ? void 0 : theme["color-5"]];
872
+ }).filter(function(color) {
873
+ return typeof color === "string";
874
+ });
939
875
  }
940
876
  function holdSwitchTrack(themes) {
941
- var out = {
942
- ...themes
943
- };
944
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
945
- var scheme = _iter[_i];
946
- var base = themes[scheme];
947
- if (!base) continue;
948
- var paint = switchTrackPaint(base, base.accentBackground, switchOffGround(base), raisedGrounds(themes, scheme));
949
- if (paint) out[scheme] = {
950
- ...base,
951
- ...paint
952
- };
953
- if (scheme !== "dark" || !paint) continue;
954
- var _iteratorNormalCompletion = true,
955
- _didIteratorError = false,
956
- _iteratorError = void 0;
957
- try {
958
- for (var _iterator = semanticIntentNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
959
- var intent = _step.value;
960
- var scope = themes[`${scheme}_${intent}`];
961
- var track = intentSwitchTrack(base, scope, paint);
962
- if (track) out[`${scheme}_${intent}`] = {
963
- ...scope,
964
- ...track
965
- };
966
- }
967
- } catch (err) {
968
- _didIteratorError = true;
969
- _iteratorError = err;
970
- } finally {
971
- try {
972
- if (!_iteratorNormalCompletion && _iterator.return != null) {
973
- _iterator.return();
974
- }
975
- } finally {
976
- if (_didIteratorError) {
977
- throw _iteratorError;
978
- }
979
- }
980
- }
981
- }
982
- return out;
877
+ var out = { ...themes };
878
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
879
+ var scheme = _iter[_i];
880
+ var base = themes[scheme];
881
+ if (!base) continue;
882
+ var paint = switchTrackPaint(base, base["accent-background"], switchOffGround({
883
+ background: base.background,
884
+ color4: base["color-4"]
885
+ }), raisedGrounds(themes, scheme));
886
+ if (paint) out[scheme] = {
887
+ ...base,
888
+ ...paint
889
+ };
890
+ if (scheme !== "dark" || !paint) continue;
891
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
892
+ try {
893
+ for (var _iterator = semanticIntentNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
894
+ var intent = _step.value;
895
+ var scope = themes[`${scheme}_${intent}`];
896
+ var track = intentSwitchTrack(base, scope, paint);
897
+ if (track) out[`${scheme}_${intent}`] = {
898
+ ...scope,
899
+ ...track
900
+ };
901
+ }
902
+ } catch (err) {
903
+ _didIteratorError = true;
904
+ _iteratorError = err;
905
+ } finally {
906
+ try {
907
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
908
+ _iterator.return();
909
+ }
910
+ } finally {
911
+ if (_didIteratorError) {
912
+ throw _iteratorError;
913
+ }
914
+ }
915
+ }
916
+ }
917
+ return out;
983
918
  }
984
919
  function intentSwitchTrack(base, scope, paint) {
985
- var _scope_accentBackground;
986
- var off = luminanceOf(paint.switchTrackOff);
987
- if (!(scope === null || scope === void 0 ? void 0 : scope.color4) || !scope.color5 || off === null) return void 0;
988
- var holds = inSwitchOffBand(paint.switchTrackOff, scope.color4) && [scope.color4, scope.color5].every(function (ground) {
989
- var _luminanceOf;
990
- return contrastRatio(off, (_luminanceOf = luminanceOf(ground)) !== null && _luminanceOf !== void 0 ? _luminanceOf : off) >= plateContrastRatio;
991
- });
992
- if (holds) return void 0;
993
- return switchTrackPaint(base, (_scope_accentBackground = scope.accentBackground) !== null && _scope_accentBackground !== void 0 ? _scope_accentBackground : base.accentBackground, scope.color4, [base.color4, scope.color4, scope.color5]);
920
+ var _scope_accentbackground;
921
+ var off = luminanceOf(paint["switch-track-off"]);
922
+ if (!(scope === null || scope === void 0 ? void 0 : scope["color-4"]) || !scope["color-5"] || off === null) return void 0;
923
+ var holds = inSwitchOffBand(paint["switch-track-off"], scope["color-4"]) && [scope["color-4"], scope["color-5"]].every(function(ground) {
924
+ var _luminanceOf;
925
+ return contrastRatio(off, (_luminanceOf = luminanceOf(ground)) !== null && _luminanceOf !== void 0 ? _luminanceOf : off) >= plateContrastRatio;
926
+ });
927
+ if (holds) return void 0;
928
+ return switchTrackPaint(base, (_scope_accentbackground = scope["accent-background"]) !== null && _scope_accentbackground !== void 0 ? _scope_accentbackground : base["accent-background"], scope["color-4"], [
929
+ base["color-4"],
930
+ scope["color-4"],
931
+ scope["color-5"]
932
+ ]);
994
933
  }
995
934
  function switchTrackPaint(base, onFill, ground) {
996
- var raised = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : [];
997
- var _ref, _inBand_find;
998
- var on = luminanceOf(onFill);
999
- if (!ground || on === null) return void 0;
1000
- var alpha = switchOffFillAlpha[isLightGround(ground) ? "light" : "dark"];
1001
- var target = systemFillLuminance(ground, alpha);
1002
- if (target === null) return void 0;
1003
- var raisedLums = raised.map(function (color) {
1004
- return luminanceOf(color);
1005
- }).filter(function (lum) {
1006
- return lum !== null;
1007
- });
1008
- var greys = Array.from({
1009
- length: 12
1010
- }, function (_, index) {
1011
- return index + 1;
1012
- }).map(function (step) {
1013
- return {
1014
- color: base[`gray${step}`],
1015
- lum: luminanceOf(base[`gray${step}`]),
1016
- hover: base[`gray${Math.max(step - 1, 1)}`],
1017
- press: base[`gray${Math.min(step + 1, 12)}`]
1018
- };
1019
- }).filter(function (entry) {
1020
- return entry.lum !== null;
1021
- });
1022
- var fills = raised[0] ? switchRaisedAlphas.flatMap(function (fillAlpha) {
1023
- var color = systemFillHex(raised[0], fillAlpha);
1024
- var hover = systemFillHex(raised[0], fillAlpha - switchRaisedAlphaStep);
1025
- var press = systemFillHex(raised[0], fillAlpha + switchRaisedAlphaStep);
1026
- var lum = luminanceOf(color !== null && color !== void 0 ? color : void 0);
1027
- return color && hover && press && lum !== null ? [{
1028
- color,
1029
- lum,
1030
- hover,
1031
- press
1032
- }] : [];
1033
- }) : [];
1034
- var byTarget = function byTarget2(a, b) {
1035
- return Math.abs(a.lum - target) - Math.abs(b.lum - target);
1036
- };
1037
- var steps = [...greys].sort(byTarget);
1038
- var inBand = [...greys, ...fills].filter(function (entry) {
1039
- return inSwitchOffBand(entry.color, ground);
1040
- }).filter(function (entry) {
1041
- return raisedLums.every(function (lum) {
1042
- return contrastRatio(entry.lum, lum) >= plateContrastRatio;
1043
- });
1044
- }).sort(byTarget);
1045
- var pick = (_ref = (_inBand_find = inBand.find(function (entry) {
1046
- return contrastRatio(entry.lum, on) >= switchStateContrastRatio;
1047
- })) !== null && _inBand_find !== void 0 ? _inBand_find : inBand[0]) !== null && _ref !== void 0 ? _ref : steps[0];
1048
- if (!pick) return void 0;
1049
- return {
1050
- switchTrackOff: pick.color,
1051
- switchTrackOffHover: pick.hover,
1052
- switchTrackOffPress: pick.press
1053
- };
935
+ var raised = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : [];
936
+ var _ref, _inBand_find;
937
+ var on = luminanceOf(onFill);
938
+ if (!ground || on === null) return void 0;
939
+ var alpha = switchOffFillAlpha[isLightGround(ground) ? "light" : "dark"];
940
+ var target = systemFillLuminance(ground, alpha);
941
+ if (target === null) return void 0;
942
+ var raisedLums = raised.map(function(color) {
943
+ return luminanceOf(color);
944
+ }).filter(function(lum) {
945
+ return lum !== null;
946
+ });
947
+ var greys = Array.from({ length: 12 }, function(_, index) {
948
+ return index + 1;
949
+ }).map(function(step) {
950
+ return {
951
+ color: base[`gray-${step}`],
952
+ lum: luminanceOf(base[`gray-${step}`]),
953
+ hover: base[`gray-${Math.max(step - 1, 1)}`],
954
+ press: base[`gray-${Math.min(step + 1, 12)}`]
955
+ };
956
+ }).filter(function(entry) {
957
+ return entry.lum !== null;
958
+ });
959
+ var fills = raised[0] ? switchRaisedAlphas.flatMap(function(fillAlpha) {
960
+ var color = systemFillHex(raised[0], fillAlpha);
961
+ var hover = systemFillHex(raised[0], fillAlpha - switchRaisedAlphaStep);
962
+ var press = systemFillHex(raised[0], fillAlpha + switchRaisedAlphaStep);
963
+ var lum = luminanceOf(color !== null && color !== void 0 ? color : void 0);
964
+ return color && hover && press && lum !== null ? [{
965
+ color,
966
+ lum,
967
+ hover,
968
+ press
969
+ }] : [];
970
+ }) : [];
971
+ var byTarget = function byTarget2(a, b) {
972
+ return Math.abs(a.lum - target) - Math.abs(b.lum - target);
973
+ };
974
+ var steps = [...greys].sort(byTarget);
975
+ var inBand = [...greys, ...fills].filter(function(entry) {
976
+ return inSwitchOffBand(entry.color, ground);
977
+ }).filter(function(entry) {
978
+ return raisedLums.every(function(lum) {
979
+ return contrastRatio(entry.lum, lum) >= plateContrastRatio;
980
+ });
981
+ }).sort(byTarget);
982
+ var pick = (_ref = (_inBand_find = inBand.find(function(entry) {
983
+ return contrastRatio(entry.lum, on) >= switchStateContrastRatio;
984
+ })) !== null && _inBand_find !== void 0 ? _inBand_find : inBand[0]) !== null && _ref !== void 0 ? _ref : steps[0];
985
+ if (!pick) return void 0;
986
+ return {
987
+ "switch-track-off": pick.color,
988
+ "switch-track-off-hover": pick.hover,
989
+ "switch-track-off-press": pick.press
990
+ };
1054
991
  }
1055
- var syntaxInkHues = ["purple", "green", "blue", "orange", "red"];
992
+ var syntaxInkHues = [
993
+ "purple",
994
+ "green",
995
+ "blue",
996
+ "orange",
997
+ "red"
998
+ ];
1056
999
  function mixHex(from, to, share) {
1057
- var channel = function channel2(offset) {
1058
- return 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");
1059
- };
1060
- return `#${channel(1)}${channel(3)}${channel(5)}`;
1000
+ var channel = function channel2(offset) {
1001
+ return 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");
1002
+ };
1003
+ return `#${channel(1)}${channel(3)}${channel(5)}`;
1061
1004
  }
1062
1005
  function holdSyntaxFloor(themes) {
1063
- var out = {
1064
- ...themes
1065
- };
1066
- var _iteratorNormalCompletion = true,
1067
- _didIteratorError = false,
1068
- _iteratorError = void 0;
1069
- try {
1070
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1071
- var [name, theme] = _step.value;
1072
- var surface = luminanceOf(theme.color3);
1073
- if (surface === null) continue;
1074
- var ink = {};
1075
- var _iteratorNormalCompletion1 = true,
1076
- _didIteratorError1 = false,
1077
- _iteratorError1 = void 0;
1078
- try {
1079
- for (var _iterator1 = syntaxInkHues[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1080
- var hue = _step1.value;
1081
- var from = theme[`${hue}11`] ? normalizeToHex(theme[`${hue}11`]) : null;
1082
- var to = theme[`${hue}12`] ? normalizeToHex(theme[`${hue}12`]) : null;
1083
- var wash = luminanceOf(theme[`${hue}3`]);
1084
- if (!from || !to || wash === null) continue;
1085
- for (var step = 0; step <= 20; step++) {
1086
- var candidate = mixHex(from, to, step / 20);
1087
- var lum = relativeLuminance(candidate);
1088
- if (contrastRatio(lum, surface) >= aaTextContrastRatio && contrastRatio(lum, wash) >= aaTextContrastRatio) {
1089
- ink[`syntax${hue[0].toUpperCase()}${hue.slice(1)}`] = candidate;
1090
- break;
1091
- }
1092
- }
1093
- }
1094
- } catch (err) {
1095
- _didIteratorError1 = true;
1096
- _iteratorError1 = err;
1097
- } finally {
1098
- try {
1099
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
1100
- _iterator1.return();
1101
- }
1102
- } finally {
1103
- if (_didIteratorError1) {
1104
- throw _iteratorError1;
1105
- }
1106
- }
1107
- }
1108
- if (Object.keys(ink).length > 0) out[name] = {
1109
- ...theme,
1110
- ...ink
1111
- };
1112
- }
1113
- } catch (err) {
1114
- _didIteratorError = true;
1115
- _iteratorError = err;
1116
- } finally {
1117
- try {
1118
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1119
- _iterator.return();
1120
- }
1121
- } finally {
1122
- if (_didIteratorError) {
1123
- throw _iteratorError;
1124
- }
1125
- }
1126
- }
1127
- return out;
1006
+ var out = { ...themes };
1007
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1008
+ try {
1009
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1010
+ var [name, theme] = _step.value;
1011
+ var surface = luminanceOf(theme["color-3"]);
1012
+ if (surface === null) continue;
1013
+ var ink = {};
1014
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
1015
+ try {
1016
+ for (var _iterator1 = syntaxInkHues[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1017
+ var hue = _step1.value;
1018
+ var from = theme[`${hue}-11`] ? normalizeToHex(theme[`${hue}-11`]) : null;
1019
+ var to = theme[`${hue}-12`] ? normalizeToHex(theme[`${hue}-12`]) : null;
1020
+ var wash = luminanceOf(theme[`${hue}-3`]);
1021
+ if (!from || !to || wash === null) continue;
1022
+ for (var step = 0; step <= 20; step++) {
1023
+ var candidate = mixHex(from, to, step / 20);
1024
+ var lum = relativeLuminance(candidate);
1025
+ if (contrastRatio(lum, surface) >= aaTextContrastRatio && contrastRatio(lum, wash) >= aaTextContrastRatio) {
1026
+ ink[`syntax-${hue}`] = candidate;
1027
+ break;
1028
+ }
1029
+ }
1030
+ }
1031
+ } catch (err) {
1032
+ _didIteratorError1 = true;
1033
+ _iteratorError1 = err;
1034
+ } finally {
1035
+ try {
1036
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
1037
+ _iterator1.return();
1038
+ }
1039
+ } finally {
1040
+ if (_didIteratorError1) {
1041
+ throw _iteratorError1;
1042
+ }
1043
+ }
1044
+ }
1045
+ if (Object.keys(ink).length > 0) out[name] = {
1046
+ ...theme,
1047
+ ...ink
1048
+ };
1049
+ }
1050
+ } catch (err) {
1051
+ _didIteratorError = true;
1052
+ _iteratorError = err;
1053
+ } finally {
1054
+ try {
1055
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1056
+ _iterator.return();
1057
+ }
1058
+ } finally {
1059
+ if (_didIteratorError) {
1060
+ throw _iteratorError;
1061
+ }
1062
+ }
1063
+ }
1064
+ return out;
1128
1065
  }
1129
1066
  var namedInkHues = themeRampHues;
1130
1067
  function holdNamedInkFloor(themes) {
1131
- var out = {
1132
- ...themes
1133
- };
1134
- var _iteratorNormalCompletion = true,
1135
- _didIteratorError = false,
1136
- _iteratorError = void 0;
1137
- try {
1138
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1139
- var [name, theme] = _step.value;
1140
- var surfaces = [luminanceOf(theme.background), luminanceOf(theme.color3)];
1141
- if (surfaces.some(function (surface) {
1142
- return surface === null;
1143
- })) continue;
1144
- var ink = {};
1145
- var _iteratorNormalCompletion1 = true,
1146
- _didIteratorError1 = false,
1147
- _iteratorError1 = void 0;
1148
- try {
1149
- for (var _iterator1 = namedInkHues[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1150
- var _loop = function (step2) {
1151
- var candidate = mixHex(from, to, step2 / 20);
1152
- var lum = relativeLuminance(candidate);
1153
- if (surfaces.every(function (surface) {
1154
- return contrastRatio(lum, surface) >= aaTextContrastRatio;
1155
- })) {
1156
- if (step2 > 0) ink[`${hue}11`] = candidate;
1157
- return "break";
1158
- }
1159
- };
1160
- var hue = _step1.value;
1161
- var from = theme[`${hue}11`] ? normalizeToHex(theme[`${hue}11`]) : null;
1162
- var to = theme[`${hue}12`] ? normalizeToHex(theme[`${hue}12`]) : null;
1163
- if (!from || !to) continue;
1164
- for (var step = 0; step <= 20; step++) {
1165
- var _ret = _loop(step);
1166
- if (_ret === "break") break;
1167
- }
1168
- }
1169
- } catch (err) {
1170
- _didIteratorError1 = true;
1171
- _iteratorError1 = err;
1172
- } finally {
1173
- try {
1174
- if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
1175
- _iterator1.return();
1176
- }
1177
- } finally {
1178
- if (_didIteratorError1) {
1179
- throw _iteratorError1;
1180
- }
1181
- }
1182
- }
1183
- if (Object.keys(ink).length > 0) out[name] = {
1184
- ...theme,
1185
- ...ink
1186
- };
1187
- }
1188
- } catch (err) {
1189
- _didIteratorError = true;
1190
- _iteratorError = err;
1191
- } finally {
1192
- try {
1193
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1194
- _iterator.return();
1195
- }
1196
- } finally {
1197
- if (_didIteratorError) {
1198
- throw _iteratorError;
1199
- }
1200
- }
1201
- }
1202
- return out;
1068
+ var out = { ...themes };
1069
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1070
+ try {
1071
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1072
+ var [name, theme] = _step.value;
1073
+ var surfaces = [luminanceOf(theme.background), luminanceOf(theme["color-3"])];
1074
+ if (surfaces.some(function(surface) {
1075
+ return surface === null;
1076
+ })) continue;
1077
+ var ink = {};
1078
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
1079
+ try {
1080
+ for (var _iterator1 = namedInkHues[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
1081
+ var _loop = function(step2) {
1082
+ var candidate = mixHex(from, to, step2 / 20);
1083
+ var lum = relativeLuminance(candidate);
1084
+ if (surfaces.every(function(surface) {
1085
+ return contrastRatio(lum, surface) >= aaTextContrastRatio;
1086
+ })) {
1087
+ if (step2 > 0) ink[`${hue}-11`] = candidate;
1088
+ return "break";
1089
+ }
1090
+ };
1091
+ var hue = _step1.value;
1092
+ var from = theme[`${hue}-11`] ? normalizeToHex(theme[`${hue}-11`]) : null;
1093
+ var to = theme[`${hue}-12`] ? normalizeToHex(theme[`${hue}-12`]) : null;
1094
+ if (!from || !to) continue;
1095
+ for (var step = 0; step <= 20; step++) {
1096
+ var _ret = _loop(step);
1097
+ if (_ret === "break") break;
1098
+ }
1099
+ }
1100
+ } catch (err) {
1101
+ _didIteratorError1 = true;
1102
+ _iteratorError1 = err;
1103
+ } finally {
1104
+ try {
1105
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
1106
+ _iterator1.return();
1107
+ }
1108
+ } finally {
1109
+ if (_didIteratorError1) {
1110
+ throw _iteratorError1;
1111
+ }
1112
+ }
1113
+ }
1114
+ if (Object.keys(ink).length > 0) out[name] = {
1115
+ ...theme,
1116
+ ...ink
1117
+ };
1118
+ }
1119
+ } catch (err) {
1120
+ _didIteratorError = true;
1121
+ _iteratorError = err;
1122
+ } finally {
1123
+ try {
1124
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1125
+ _iterator.return();
1126
+ }
1127
+ } finally {
1128
+ if (_didIteratorError) {
1129
+ throw _iteratorError;
1130
+ }
1131
+ }
1132
+ }
1133
+ return out;
1203
1134
  }
1204
1135
  function walkToHoldingInk(step11, step12, holds) {
1205
- var from = normalizeToHex(step11);
1206
- var to = normalizeToHex(step12);
1207
- if (!from || !to) return null;
1208
- if (holds(relativeLuminance(from))) return step11;
1209
- for (var step = 1; step <= 20; step++) {
1210
- var candidate = mixHex(from, to, step / 20);
1211
- if (holds(relativeLuminance(candidate))) return candidate;
1212
- }
1213
- return null;
1136
+ var from = normalizeToHex(step11);
1137
+ var to = normalizeToHex(step12);
1138
+ if (!from || !to) return null;
1139
+ if (holds(relativeLuminance(from))) return step11;
1140
+ for (var step = 1; step <= 20; step++) {
1141
+ var candidate = mixHex(from, to, step / 20);
1142
+ if (holds(relativeLuminance(candidate))) return candidate;
1143
+ }
1144
+ return null;
1214
1145
  }
1215
1146
  function labelHolds(label, fill) {
1216
- var lum = luminanceOf(label);
1217
- var fillLum = luminanceOf(fill);
1218
- return lum !== null && fillLum !== null && contrastRatio(lum, fillLum) >= aaTextContrastRatio && Math.abs(apcaContrast(label, fill)) >= fillLabelLc;
1147
+ var lum = luminanceOf(label);
1148
+ var fillLum = luminanceOf(fill);
1149
+ return lum !== null && fillLum !== null && contrastRatio(lum, fillLum) >= aaTextContrastRatio && Math.abs(apcaContrast(label, fill)) >= fillLabelLc;
1219
1150
  }
1220
1151
  function holdStateFill(ramp, fill, label, paper) {
1221
- var _ref, _holding_find;
1222
- var at = ramp.indexOf(fill);
1223
- if (at < 0) return fill;
1224
- var holding = [at + 1, at - 1, at + 2, at - 2].map(function (index) {
1225
- return ramp[index];
1226
- }).filter(function (step) {
1227
- return step !== void 0 && labelHolds(label, step);
1228
- });
1229
- return (_ref = (_holding_find = holding.find(function (step) {
1230
- return contrastRatio(luminanceOf(step), paper) >= minContrastRatio;
1231
- })) !== null && _holding_find !== void 0 ? _holding_find : holding[0]) !== null && _ref !== void 0 ? _ref : fill;
1152
+ var _ref, _holding_find;
1153
+ var at = ramp.indexOf(fill);
1154
+ if (at < 0) return fill;
1155
+ var holding = [
1156
+ at + 1,
1157
+ at - 1,
1158
+ at + 2,
1159
+ at - 2
1160
+ ].map(function(index) {
1161
+ return ramp[index];
1162
+ }).filter(function(step) {
1163
+ return step !== void 0 && labelHolds(label, step);
1164
+ });
1165
+ return (_ref = (_holding_find = holding.find(function(step) {
1166
+ return contrastRatio(luminanceOf(step), paper) >= minContrastRatio;
1167
+ })) !== null && _holding_find !== void 0 ? _holding_find : holding[0]) !== null && _ref !== void 0 ? _ref : fill;
1232
1168
  }
1233
1169
  function holdFillLabel(preferred, steps, labels, paper) {
1234
- var preferredLum = luminanceOf(preferred);
1235
- if (preferredLum === null) return void 0;
1236
- var labelOn = function labelOn2(step2) {
1237
- return labels.find(function (label2) {
1238
- return labelHolds(label2, step2);
1239
- });
1240
- };
1241
- var best;
1242
- var bestDistance = Number.POSITIVE_INFINITY;
1243
- for (var _i = 0, _iter = [preferred, ...steps]; _i < _iter.length; _i++) {
1244
- var step = _iter[_i];
1245
- var lum = luminanceOf(step);
1246
- if (step === void 0 || lum === null || contrastRatio(lum, paper) < minContrastRatio) continue;
1247
- var label = labelOn(step);
1248
- var distance = Math.abs(lum - preferredLum);
1249
- if (label && distance < bestDistance) {
1250
- bestDistance = distance;
1251
- best = {
1252
- fill: step,
1253
- label
1254
- };
1255
- }
1256
- }
1257
- return best;
1170
+ var preferredLum = luminanceOf(preferred);
1171
+ if (preferredLum === null) return void 0;
1172
+ var labelOn = function labelOn2(step2) {
1173
+ return labels.find(function(label2) {
1174
+ return labelHolds(label2, step2);
1175
+ });
1176
+ };
1177
+ var best;
1178
+ var bestDistance = Number.POSITIVE_INFINITY;
1179
+ for (var _i = 0, _iter = [preferred, ...steps]; _i < _iter.length; _i++) {
1180
+ var step = _iter[_i];
1181
+ var lum = luminanceOf(step);
1182
+ if (step === void 0 || lum === null || contrastRatio(lum, paper) < minContrastRatio) continue;
1183
+ var label = labelOn(step);
1184
+ var distance = Math.abs(lum - preferredLum);
1185
+ if (label && distance < bestDistance) {
1186
+ bestDistance = distance;
1187
+ best = {
1188
+ fill: step,
1189
+ label
1190
+ };
1191
+ }
1192
+ }
1193
+ return best;
1258
1194
  }
1259
1195
  function holdColorThemeAccent(themes) {
1260
- var _loop = function (_i2, _iter2) {
1261
- var scheme = _iter2[_i2];
1262
- var base = themes[scheme];
1263
- if (!base) return "continue";
1264
- var _iteratorNormalCompletion = true,
1265
- _didIteratorError = false,
1266
- _iteratorError = void 0;
1267
- try {
1268
- var _loop2 = function () {
1269
- var hue = _step.value;
1270
- var _ref, _walkToHoldingInk, _ref1, _switchOffGround;
1271
- var scopeName = `${scheme}_${hue}`;
1272
- var scope = themes[scopeName];
1273
- var ramp = Array.from({
1274
- length: 12
1275
- }, function (_, index) {
1276
- return base[`${hue}${index + 1}`];
1277
- });
1278
- if (!scope || ramp.some(function (step) {
1279
- return !step;
1280
- })) return "continue";
1281
- var paper = luminanceOf(scope.color1);
1282
- var ink = luminanceOf(scope.color12);
1283
- var surfaces = [scope.color1, scope.color2, scope.color3, scope.color4, ...(scheme === "dark" ? [scope.color5] : [])].map(luminanceOf);
1284
- if (paper === null || ink === null || surfaces.some(function (lum) {
1285
- return lum === null;
1286
- })) return "continue";
1287
- var labels = [scope.color1, scope.color12].sort(function (a, b) {
1288
- return luminanceOf(b) - luminanceOf(a);
1289
- });
1290
- var solid = holdFillLabel(ramp[8], ramp.slice(0, 11), labels, paper);
1291
- var holdsInk = function holdsInk2(lum) {
1292
- return surfaces.every(function (surface) {
1293
- return contrastRatio(lum, surface) >= aaTextContrastRatio;
1294
- });
1295
- };
1296
- var fill = (_ref = solid === null || solid === void 0 ? void 0 : solid.fill) !== null && _ref !== void 0 ? _ref : nearestHoldingStep(ramp[8], ramp.slice(0, 11), function (lum) {
1297
- return Math.max(contrastRatio(lum, paper), contrastRatio(lum, ink)) >= aaTextContrastRatio && contrastRatio(lum, paper) >= minContrastRatio;
1298
- });
1299
- var accentInk = (_walkToHoldingInk = walkToHoldingInk(ramp[10], ramp[11], holdsInk)) !== null && _walkToHoldingInk !== void 0 ? _walkToHoldingInk : nearestHoldingStep(ramp[10], ramp, holdsInk);
1300
- var onFill = (_ref1 = solid === null || solid === void 0 ? void 0 : solid.label) !== null && _ref1 !== void 0 ? _ref1 : holdInkFloor(fill, pickReadableForeground(fill, scope.color1, scope.color12));
1301
- var fillHover = holdStateFill(ramp, fill, onFill, paper);
1302
- var accent = {
1303
- accentBackground: fill,
1304
- accentColor: accentInk,
1305
- ...selectedPaint(scope, ramp, accentInk)
1306
- };
1307
- var rootOn = luminanceOf(base.switchTrackOff);
1308
- var fillLum = luminanceOf(fill);
1309
- var switchGround = (_switchOffGround = switchOffGround(scope)) !== null && _switchOffGround !== void 0 ? _switchOffGround : scope.background;
1310
- var rootHolds = rootOn === null || fillLum === null || contrastRatio(rootOn, fillLum) >= switchStateContrastRatio && inSwitchOffBand(base.switchTrackOff, switchGround) && (isLightGround(scope.background) ? [] : [scope.color4, scope.color5]).every(function (ground) {
1311
- var _luminanceOf;
1312
- return contrastRatio(rootOn, (_luminanceOf = luminanceOf(ground)) !== null && _luminanceOf !== void 0 ? _luminanceOf : rootOn) >= plateContrastRatio;
1313
- });
1314
- var trackGrounds = isLightGround(scope.background) ? [] : [base.color4, scope.color4, scope.color5];
1315
- var track = rootHolds ? void 0 : switchTrackPaint(base, fill, switchGround, trackGrounds);
1316
- var _iteratorNormalCompletion2 = true,
1317
- _didIteratorError2 = false,
1318
- _iteratorError2 = void 0;
1319
- try {
1320
- var _loop3 = function () {
1321
- var [name, theme] = _step1.value;
1322
- if (name === scopeName) {
1323
- out[name] = {
1324
- ...theme,
1325
- ...accent,
1326
- ...track
1327
- };
1328
- } else if (name.startsWith(`${scopeName}_`)) {
1329
- var owned = Object.keys(accent).filter(function (key) {
1330
- return key in theme;
1331
- });
1332
- if (owned.length > 0) {
1333
- out[name] = {
1334
- ...theme,
1335
- ...Object.fromEntries(owned.map(function (key) {
1336
- return [key, accent[key]];
1337
- }))
1338
- };
1339
- }
1340
- }
1341
- };
1342
- for (var _iterator2 = Object.entries(themes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) _loop3();
1343
- } catch (err) {
1344
- _didIteratorError2 = true;
1345
- _iteratorError2 = err;
1346
- } finally {
1347
- try {
1348
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
1349
- _iterator2.return();
1350
- }
1351
- } finally {
1352
- if (_didIteratorError2) {
1353
- throw _iteratorError2;
1354
- }
1355
- }
1356
- }
1357
- out[`${scopeName}_accent`] = {
1358
- background: fill,
1359
- backgroundHover: fillHover,
1360
- backgroundPress: fillHover,
1361
- backgroundFocus: fillHover,
1362
- backgroundActive: fill,
1363
- borderColor: fill,
1364
- borderColorHover: fillHover,
1365
- borderColorFocus: fillHover,
1366
- borderColorPress: fillHover,
1367
- color: onFill,
1368
- colorHover: onFill,
1369
- colorPress: onFill,
1370
- colorFocus: onFill,
1371
- placeholderColor: onFill,
1372
- boundaryColor: onFill,
1373
- outlineColor: onFill,
1374
- color10: onFill,
1375
- color11: onFill,
1376
- color12: onFill,
1377
- textMuted: onFill,
1378
- accentBackground: onFill,
1379
- accentColor: onFill
1380
- };
1381
- };
1382
- for (var _iterator = childrenHues[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop2();
1383
- } catch (err) {
1384
- _didIteratorError = true;
1385
- _iteratorError = err;
1386
- } finally {
1387
- try {
1388
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1389
- _iterator.return();
1390
- }
1391
- } finally {
1392
- if (_didIteratorError) {
1393
- throw _iteratorError;
1394
- }
1395
- }
1396
- }
1397
- };
1398
- var out = {
1399
- ...themes
1400
- };
1401
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
1402
- return out;
1196
+ var _loop = function(_i2, _iter2) {
1197
+ var scheme = _iter2[_i2];
1198
+ var base = themes[scheme];
1199
+ if (!base) return "continue";
1200
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1201
+ try {
1202
+ var _loop2 = function() {
1203
+ var hue = _step.value;
1204
+ var _ref, _walkToHoldingInk, _ref1, _switchOffGround;
1205
+ var scopeName = `${scheme}_${hue}`;
1206
+ var scope = themes[scopeName];
1207
+ var ramp = Array.from({ length: 12 }, function(_, index) {
1208
+ return base[`${hue}-${index + 1}`];
1209
+ });
1210
+ if (!scope || ramp.some(function(step) {
1211
+ return !step;
1212
+ })) return "continue";
1213
+ var paper = luminanceOf(scope["color-1"]);
1214
+ var ink = luminanceOf(scope["color-12"]);
1215
+ var surfaces = [
1216
+ scope["color-1"],
1217
+ scope["color-2"],
1218
+ scope["color-3"],
1219
+ scope["color-4"],
1220
+ ...scheme === "dark" ? [scope["color-5"]] : []
1221
+ ].map(luminanceOf);
1222
+ if (paper === null || ink === null || surfaces.some(function(lum) {
1223
+ return lum === null;
1224
+ })) return "continue";
1225
+ var labels = [scope["color-1"], scope["color-12"]].sort(function(a, b) {
1226
+ return luminanceOf(b) - luminanceOf(a);
1227
+ });
1228
+ var solid = holdFillLabel(ramp[8], ramp.slice(0, 11), labels, paper);
1229
+ var holdsInk = function holdsInk2(lum) {
1230
+ return surfaces.every(function(surface) {
1231
+ return contrastRatio(lum, surface) >= aaTextContrastRatio;
1232
+ });
1233
+ };
1234
+ var fill = (_ref = solid === null || solid === void 0 ? void 0 : solid.fill) !== null && _ref !== void 0 ? _ref : nearestHoldingStep(ramp[8], ramp.slice(0, 11), function(lum) {
1235
+ return Math.max(contrastRatio(lum, paper), contrastRatio(lum, ink)) >= aaTextContrastRatio && contrastRatio(lum, paper) >= minContrastRatio;
1236
+ });
1237
+ var accentInk = (_walkToHoldingInk = walkToHoldingInk(ramp[10], ramp[11], holdsInk)) !== null && _walkToHoldingInk !== void 0 ? _walkToHoldingInk : nearestHoldingStep(ramp[10], ramp, holdsInk);
1238
+ var onFill = (_ref1 = solid === null || solid === void 0 ? void 0 : solid.label) !== null && _ref1 !== void 0 ? _ref1 : holdInkFloor(fill, pickReadableForeground(fill, scope["color-1"], scope["color-12"]));
1239
+ var fillHover = holdStateFill(ramp, fill, onFill, paper);
1240
+ var accent = {
1241
+ "accent-background": fill,
1242
+ "accent-color": accentInk,
1243
+ ...selectedPaint(scope, ramp, accentInk)
1244
+ };
1245
+ var rootOn = luminanceOf(base["switch-track-off"]);
1246
+ var fillLum = luminanceOf(fill);
1247
+ var switchGround = (_switchOffGround = switchOffGround({
1248
+ background: scope.background,
1249
+ color4: scope["color-4"]
1250
+ })) !== null && _switchOffGround !== void 0 ? _switchOffGround : scope.background;
1251
+ var rootHolds = rootOn === null || fillLum === null || contrastRatio(rootOn, fillLum) >= switchStateContrastRatio && inSwitchOffBand(base["switch-track-off"], switchGround) && (isLightGround(scope.background) ? [] : [scope["color-4"], scope["color-5"]]).every(function(ground) {
1252
+ var _luminanceOf;
1253
+ return contrastRatio(rootOn, (_luminanceOf = luminanceOf(ground)) !== null && _luminanceOf !== void 0 ? _luminanceOf : rootOn) >= plateContrastRatio;
1254
+ });
1255
+ var trackGrounds = isLightGround(scope.background) ? [] : [
1256
+ base["color-4"],
1257
+ scope["color-4"],
1258
+ scope["color-5"]
1259
+ ];
1260
+ var track = rootHolds ? void 0 : switchTrackPaint(base, fill, switchGround, trackGrounds);
1261
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
1262
+ try {
1263
+ var _loop3 = function() {
1264
+ var [name, theme] = _step1.value;
1265
+ if (name === scopeName) {
1266
+ out[name] = {
1267
+ ...theme,
1268
+ ...accent,
1269
+ ...track
1270
+ };
1271
+ } else if (name.startsWith(`${scopeName}_`)) {
1272
+ var owned = Object.keys(accent).filter(function(key) {
1273
+ return key in theme;
1274
+ });
1275
+ if (owned.length > 0) {
1276
+ out[name] = {
1277
+ ...theme,
1278
+ ...Object.fromEntries(owned.map(function(key) {
1279
+ return [key, accent[key]];
1280
+ }))
1281
+ };
1282
+ }
1283
+ }
1284
+ };
1285
+ for (var _iterator2 = Object.entries(themes)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) _loop3();
1286
+ } catch (err) {
1287
+ _didIteratorError2 = true;
1288
+ _iteratorError2 = err;
1289
+ } finally {
1290
+ try {
1291
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
1292
+ _iterator2.return();
1293
+ }
1294
+ } finally {
1295
+ if (_didIteratorError2) {
1296
+ throw _iteratorError2;
1297
+ }
1298
+ }
1299
+ }
1300
+ out[`${scopeName}_accent`] = {
1301
+ background: fill,
1302
+ "background-hover": fillHover,
1303
+ "background-press": fillHover,
1304
+ "background-focus": fillHover,
1305
+ "background-active": fill,
1306
+ "border-color": fill,
1307
+ "border-color-hover": fillHover,
1308
+ "border-color-focus": fillHover,
1309
+ "border-color-press": fillHover,
1310
+ color: onFill,
1311
+ "color-hover": onFill,
1312
+ "color-press": onFill,
1313
+ "color-focus": onFill,
1314
+ "placeholder-color": onFill,
1315
+ "boundary-color": onFill,
1316
+ "outline-color": onFill,
1317
+ "color-10": onFill,
1318
+ "color-11": onFill,
1319
+ "color-12": onFill,
1320
+ "text-muted": onFill,
1321
+ "accent-background": onFill,
1322
+ "accent-color": onFill
1323
+ };
1324
+ };
1325
+ for (var _iterator = childrenHues[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop2();
1326
+ } catch (err) {
1327
+ _didIteratorError = true;
1328
+ _iteratorError = err;
1329
+ } finally {
1330
+ try {
1331
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1332
+ _iterator.return();
1333
+ }
1334
+ } finally {
1335
+ if (_didIteratorError) {
1336
+ throw _iteratorError;
1337
+ }
1338
+ }
1339
+ }
1340
+ };
1341
+ var out = { ...themes };
1342
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
1343
+ return out;
1403
1344
  }
1404
- var houseAccentKeys = ["accentBackground", "accentColor", "selectedBackground", "selectedColor"];
1345
+ var houseAccentKeys = [
1346
+ "accent-background",
1347
+ "accent-color",
1348
+ "selected-background",
1349
+ "selected-color"
1350
+ ];
1405
1351
  function isFullRamp(steps) {
1406
- return !steps.includes(void 0);
1352
+ return !steps.includes(void 0);
1407
1353
  }
1408
1354
  function selectedStandOff(base, tint) {
1409
- var tintLum = luminanceOf(tint);
1410
- var grounds = [base.color1, base.color4].map(luminanceOf);
1411
- if (tintLum === null || grounds.includes(null)) return 0;
1412
- return Math.min(...grounds.map(function (ground) {
1413
- return contrastRatio(tintLum, ground);
1414
- }));
1355
+ var tintLum = luminanceOf(tint);
1356
+ var grounds = [base["color-1"], base["color-4"]].map(luminanceOf);
1357
+ if (tintLum === null || grounds.includes(null)) return 0;
1358
+ return Math.min(...grounds.map(function(ground) {
1359
+ return contrastRatio(tintLum, ground);
1360
+ }));
1415
1361
  }
1416
1362
  function rootSelectedPair(base, scope, ramp, accentColor, houseStandOff) {
1417
- var _selectedPaint;
1418
- var scopePair = {
1419
- selectedBackground: scope.selectedBackground,
1420
- selectedColor: scope.selectedColor
1421
- };
1422
- if (selectedStandOff(base, scope.selectedBackground) >= houseStandOff) return scopePair;
1423
- return (_selectedPaint = selectedPaint(base, ramp, accentColor)) !== null && _selectedPaint !== void 0 ? _selectedPaint : scopePair;
1363
+ var _selectedPaint;
1364
+ var scopePair = {
1365
+ "selected-background": scope["selected-background"],
1366
+ "selected-color": scope["selected-color"]
1367
+ };
1368
+ if (selectedStandOff(base, scope["selected-background"]) >= houseStandOff) return scopePair;
1369
+ return (_selectedPaint = selectedPaint(base, ramp, accentColor)) !== null && _selectedPaint !== void 0 ? _selectedPaint : scopePair;
1424
1370
  }
1425
1371
  function houseAccentOf(base, scope, hue, houseStandOff) {
1426
- var _walkToHoldingInk;
1427
- var steps = Array.from({
1428
- length: 12
1429
- }, function (_, index) {
1430
- return base[`accent${index + 1}`];
1431
- });
1432
- if (!isAchromaticRamp(steps)) return null;
1433
- var ramp = Array.from({
1434
- length: 12
1435
- }, function (_, index) {
1436
- return base[`${hue}${index + 1}`] || void 0;
1437
- });
1438
- var surfaces = [base.color1, base.color2, base.color3, base.color4].map(luminanceOf);
1439
- if (!isFullRamp(ramp) || surfaces.includes(null)) return null;
1440
- var holdsInk = function holdsInk2(lum) {
1441
- return surfaces.every(function (surface) {
1442
- return contrastRatio(lum, surface) >= aaTextContrastRatio;
1443
- });
1444
- };
1445
- var accentColor = (_walkToHoldingInk = walkToHoldingInk(ramp[10], ramp[11], holdsInk)) !== null && _walkToHoldingInk !== void 0 ? _walkToHoldingInk : nearestHoldingStep(ramp[10], ramp, holdsInk);
1446
- return {
1447
- accent: {
1448
- accentBackground: scope.accentBackground,
1449
- accentColor,
1450
- ...rootSelectedPair(base, scope, ramp, accentColor, houseStandOff)
1451
- },
1452
- accentSteps: Object.fromEntries(ramp.map(function (step, index) {
1453
- return [`accent${index + 1}`, step];
1454
- }))
1455
- };
1372
+ var _walkToHoldingInk;
1373
+ var steps = Array.from({ length: 12 }, function(_, index) {
1374
+ return base[`accent-${index + 1}`];
1375
+ });
1376
+ if (!isAchromaticRamp(steps)) return null;
1377
+ var ramp = Array.from({ length: 12 }, function(_, index) {
1378
+ return base[`${hue}-${index + 1}`] || void 0;
1379
+ });
1380
+ var surfaces = [
1381
+ base["color-1"],
1382
+ base["color-2"],
1383
+ base["color-3"],
1384
+ base["color-4"]
1385
+ ].map(luminanceOf);
1386
+ if (!isFullRamp(ramp) || surfaces.includes(null)) return null;
1387
+ var holdsInk = function holdsInk2(lum) {
1388
+ return surfaces.every(function(surface) {
1389
+ return contrastRatio(lum, surface) >= aaTextContrastRatio;
1390
+ });
1391
+ };
1392
+ var accentColor = (_walkToHoldingInk = walkToHoldingInk(ramp[10], ramp[11], holdsInk)) !== null && _walkToHoldingInk !== void 0 ? _walkToHoldingInk : nearestHoldingStep(ramp[10], ramp, holdsInk);
1393
+ return {
1394
+ accent: {
1395
+ "accent-background": scope["accent-background"],
1396
+ "accent-color": accentColor,
1397
+ ...rootSelectedPair(base, scope, ramp, accentColor, houseStandOff)
1398
+ },
1399
+ accentSteps: Object.fromEntries(ramp.map(function(step, index) {
1400
+ return [`accent-${index + 1}`, step];
1401
+ }))
1402
+ };
1456
1403
  }
1457
1404
  function heldTheme(name, theme, scheme, base, solid, param) {
1458
- var {
1459
- accent,
1460
- accentSteps
1461
- } = param;
1462
- if (name === scheme) return {
1463
- ...theme,
1464
- ...accent,
1465
- ...accentSteps
1466
- };
1467
- var [, scope] = name.split("_");
1468
- if (!name.startsWith(`${scheme}_`) || childrenHues.includes(scope)) return null;
1469
- if (scope === "accent") return {
1470
- ...solid
1471
- };
1472
- var followed = houseAccentKeys.filter(function (key) {
1473
- return key in theme && theme[key] === base[key];
1474
- });
1475
- if (followed.length === 0) return null;
1476
- return {
1477
- ...theme,
1478
- ...Object.fromEntries(followed.map(function (key) {
1479
- return [key, accent[key]];
1480
- }))
1481
- };
1405
+ var { accent, accentSteps } = param;
1406
+ if (name === scheme) return {
1407
+ ...theme,
1408
+ ...accent,
1409
+ ...accentSteps
1410
+ };
1411
+ var [, scope] = name.split("_");
1412
+ if (!name.startsWith(`${scheme}_`) || childrenHues.includes(scope)) return null;
1413
+ if (scope === "accent") return { ...solid };
1414
+ var followed = houseAccentKeys.filter(function(key) {
1415
+ return key in theme && theme[key] === base[key];
1416
+ });
1417
+ if (followed.length === 0) return null;
1418
+ return {
1419
+ ...theme,
1420
+ ...Object.fromEntries(followed.map(function(key) {
1421
+ return [key, accent[key]];
1422
+ }))
1423
+ };
1482
1424
  }
1483
1425
  function holdHouseAccent(themes, hue) {
1484
- var out = {
1485
- ...themes
1486
- };
1487
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
1488
- var scheme = _iter[_i];
1489
- var _themes_;
1490
- var base = themes[scheme];
1491
- var scope = themes[`${scheme}_${hue}`];
1492
- var solid = themes[`${scheme}_${hue}_accent`];
1493
- if (!base || !scope || !solid) continue;
1494
- var houseStandOff = selectedStandOff(base, (_themes_ = themes[`${scheme}_blue`]) === null || _themes_ === void 0 ? void 0 : _themes_.selectedBackground);
1495
- var house = houseAccentOf(base, scope, hue, houseStandOff);
1496
- if (!house) continue;
1497
- var _iteratorNormalCompletion = true,
1498
- _didIteratorError = false,
1499
- _iteratorError = void 0;
1500
- try {
1501
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1502
- var [name, theme] = _step.value;
1503
- var held = heldTheme(name, theme, scheme, base, solid, house);
1504
- if (held) out[name] = held;
1505
- }
1506
- } catch (err) {
1507
- _didIteratorError = true;
1508
- _iteratorError = err;
1509
- } finally {
1510
- try {
1511
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1512
- _iterator.return();
1513
- }
1514
- } finally {
1515
- if (_didIteratorError) {
1516
- throw _iteratorError;
1517
- }
1518
- }
1519
- }
1520
- }
1521
- return out;
1426
+ var out = { ...themes };
1427
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
1428
+ var scheme = _iter[_i];
1429
+ var _themes_;
1430
+ var base = themes[scheme];
1431
+ var scope = themes[`${scheme}_${hue}`];
1432
+ var solid = themes[`${scheme}_${hue}_accent`];
1433
+ if (!base || !scope || !solid) continue;
1434
+ var houseStandOff = selectedStandOff(base, (_themes_ = themes[`${scheme}_blue`]) === null || _themes_ === void 0 ? void 0 : _themes_["selected-background"]);
1435
+ var house = houseAccentOf(base, scope, hue, houseStandOff);
1436
+ if (!house) continue;
1437
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1438
+ try {
1439
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1440
+ var [name, theme] = _step.value;
1441
+ var held = heldTheme(name, theme, scheme, base, solid, house);
1442
+ if (held) out[name] = held;
1443
+ }
1444
+ } catch (err) {
1445
+ _didIteratorError = true;
1446
+ _iteratorError = err;
1447
+ } finally {
1448
+ try {
1449
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1450
+ _iterator.return();
1451
+ }
1452
+ } finally {
1453
+ if (_didIteratorError) {
1454
+ throw _iteratorError;
1455
+ }
1456
+ }
1457
+ }
1458
+ }
1459
+ return out;
1522
1460
  }
1523
1461
  function holdHouseIdentityInk(themes, hue) {
1524
- var out = {
1525
- ...themes
1526
- };
1527
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
1528
- var scheme = _iter[_i];
1529
- var _themes_;
1530
- var base = themes[scheme];
1531
- var hueInk = (_themes_ = themes[`${scheme}_${hue}`]) === null || _themes_ === void 0 ? void 0 : _themes_.identityInk;
1532
- if (!(base === null || base === void 0 ? void 0 : base.identityInk) || !hueInk || base.identityInk === hueInk) continue;
1533
- if (!accentIsHue(base, hue)) continue;
1534
- var _iteratorNormalCompletion = true,
1535
- _didIteratorError = false,
1536
- _iteratorError = void 0;
1537
- try {
1538
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1539
- var [name, theme] = _step.value;
1540
- if (takesHueInk(themes, scheme, name, theme, base, hueInk)) out[name] = {
1541
- ...theme,
1542
- identityInk: hueInk
1543
- };
1544
- }
1545
- } catch (err) {
1546
- _didIteratorError = true;
1547
- _iteratorError = err;
1548
- } finally {
1549
- try {
1550
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1551
- _iterator.return();
1552
- }
1553
- } finally {
1554
- if (_didIteratorError) {
1555
- throw _iteratorError;
1556
- }
1557
- }
1558
- }
1559
- }
1560
- return out;
1462
+ var out = { ...themes };
1463
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) {
1464
+ var scheme = _iter[_i];
1465
+ var _themes_;
1466
+ var base = themes[scheme];
1467
+ var hueInk = (_themes_ = themes[`${scheme}_${hue}`]) === null || _themes_ === void 0 ? void 0 : _themes_["identity-ink"];
1468
+ if (!(base === null || base === void 0 ? void 0 : base["identity-ink"]) || !hueInk || base["identity-ink"] === hueInk) continue;
1469
+ if (!accentIsHue(base, hue)) continue;
1470
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1471
+ try {
1472
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1473
+ var [name, theme] = _step.value;
1474
+ if (takesHueInk(themes, scheme, name, theme, base, hueInk)) out[name] = {
1475
+ ...theme,
1476
+ "identity-ink": hueInk
1477
+ };
1478
+ }
1479
+ } catch (err) {
1480
+ _didIteratorError = true;
1481
+ _iteratorError = err;
1482
+ } finally {
1483
+ try {
1484
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1485
+ _iterator.return();
1486
+ }
1487
+ } finally {
1488
+ if (_didIteratorError) {
1489
+ throw _iteratorError;
1490
+ }
1491
+ }
1492
+ }
1493
+ }
1494
+ return out;
1561
1495
  }
1562
1496
  function accentIsHue(base, hue) {
1563
- return Array.from({
1564
- length: 12
1565
- }, function (_, index) {
1566
- return index + 1;
1567
- }).every(function (step) {
1568
- return base[`accent${step}`] !== void 0 && base[`accent${step}`] === base[`${hue}${step}`];
1569
- });
1497
+ return Array.from({ length: 12 }, function(_, index) {
1498
+ return index + 1;
1499
+ }).every(function(step) {
1500
+ return base[`accent-${step}`] !== void 0 && base[`accent-${step}`] === base[`${hue}-${step}`];
1501
+ });
1570
1502
  }
1571
1503
  function takesHueInk(themes, scheme, name, theme, base, hueInk) {
1572
- if (name !== scheme && !name.startsWith(`${scheme}_`)) return false;
1573
- var scope = name.split("_")[1];
1574
- if (scope === "accent" || childrenHues.includes(scope)) return false;
1575
- if (theme.identityInk !== base.identityInk) return false;
1576
- var values = resolveThemeThroughParents(themes, name);
1577
- return pickIdentityInk([hueInk], pageSurfaces(name, values)) === hueInk;
1504
+ if (name !== scheme && !name.startsWith(`${scheme}_`)) return false;
1505
+ var scope = name.split("_")[1];
1506
+ if (scope === "accent" || childrenHues.includes(scope)) return false;
1507
+ if (theme["identity-ink"] !== base["identity-ink"]) return false;
1508
+ var values = resolveThemeThroughParents(themes, name);
1509
+ return pickIdentityInk([hueInk], pageSurfaces(name, values)) === hueInk;
1578
1510
  }
1579
1511
  var defaultLightShadows = {
1580
- shadow1: "rgba(0,0,0,0.04)",
1581
- shadow2: "rgba(0,0,0,0.08)",
1582
- shadow3: "rgba(0,0,0,0.12)",
1583
- shadow4: "rgba(0,0,0,0.22)",
1584
- shadow5: "rgba(0,0,0,0.33)",
1585
- shadow6: "rgba(0,0,0,0.44)"
1512
+ shadow1: "rgba(0,0,0,0.04)",
1513
+ shadow2: "rgba(0,0,0,0.08)",
1514
+ shadow3: "rgba(0,0,0,0.12)",
1515
+ shadow4: "rgba(0,0,0,0.22)",
1516
+ shadow5: "rgba(0,0,0,0.33)",
1517
+ shadow6: "rgba(0,0,0,0.44)"
1586
1518
  };
1587
1519
  var defaultDarkShadows = {
1588
- shadow1: "rgba(0,0,0,0.15)",
1589
- shadow2: "rgba(0,0,0,0.23)",
1590
- shadow3: "rgba(0,0,0,0.33)",
1591
- shadow4: "rgba(0,0,0,0.45)",
1592
- shadow5: "rgba(0,0,0,0.65)",
1593
- shadow6: "rgba(0,0,0,0.8)"
1520
+ shadow1: "rgba(0,0,0,0.15)",
1521
+ shadow2: "rgba(0,0,0,0.23)",
1522
+ shadow3: "rgba(0,0,0,0.33)",
1523
+ shadow4: "rgba(0,0,0,0.45)",
1524
+ shadow5: "rgba(0,0,0,0.65)",
1525
+ shadow6: "rgba(0,0,0,0.8)"
1594
1526
  };
1595
- var childrenHues = ["blue", "red", "green", "yellow", "orange", "pink", "purple", "gray", "sky", "plum"];
1527
+ var childrenHues = [
1528
+ "blue",
1529
+ "red",
1530
+ "green",
1531
+ "yellow",
1532
+ "orange",
1533
+ "pink",
1534
+ "purple",
1535
+ "gray",
1536
+ "sky",
1537
+ "plum"
1538
+ ];
1596
1539
  var radixHues = {
1597
- sky: {
1598
- light: Colors.sky,
1599
- dark: Colors.skyDark
1600
- },
1601
- plum: {
1602
- light: Colors.plum,
1603
- dark: Colors.plumDark
1604
- }
1540
+ sky: {
1541
+ light: Colors.sky,
1542
+ dark: Colors.skyDark
1543
+ },
1544
+ plum: {
1545
+ light: Colors.plum,
1546
+ dark: Colors.plumDark
1547
+ }
1605
1548
  };
1606
1549
  function holdFocusRingAccent(themes, hue) {
1607
- var _loop = function (_i2, _iter2) {
1608
- var scheme = _iter2[_i2];
1609
- var _themes_;
1610
- var base = themes[scheme];
1611
- if (!base) return "continue";
1612
- var grounds = [base.color1, base.color2].map(luminanceOf);
1613
- if (grounds.some(function (lum) {
1614
- return lum === null;
1615
- })) return "continue";
1616
- var holds = function holds2(color) {
1617
- var lum = luminanceOf(color);
1618
- return lum !== null && isChromatic(color) && grounds.every(function (ground) {
1619
- return contrastRatio(lum, ground) >= minContrastRatio;
1620
- });
1621
- };
1622
- var rootRing = [base.accentColor, (_themes_ = themes[`${scheme}_${hue}`]) === null || _themes_ === void 0 ? void 0 : _themes_.accentColor].find(holds);
1623
- var _iteratorNormalCompletion = true,
1624
- _didIteratorError = false,
1625
- _iteratorError = void 0;
1626
- try {
1627
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1628
- var [name, theme] = _step.value;
1629
- var _parts_;
1630
- var _themes_1;
1631
- if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
1632
- if (theme.outlineColor === void 0) continue;
1633
- var parts = name.split("_");
1634
- if (parts.includes("accent")) continue;
1635
- var _$hue = childrenHues.includes((_parts_ = parts[1]) !== null && _parts_ !== void 0 ? _parts_ : "") ? parts[1] : void 0;
1636
- var scopeInk = _$hue ? (_themes_1 = themes[`${scheme}_${_$hue}`]) === null || _themes_1 === void 0 ? void 0 : _themes_1.accentColor : void 0;
1637
- var ring = holds(scopeInk) ? scopeInk : rootRing;
1638
- if (!ring || ring === theme.outlineColor) continue;
1639
- out[name] = {
1640
- ...theme,
1641
- outlineColor: ring
1642
- };
1643
- }
1644
- } catch (err) {
1645
- _didIteratorError = true;
1646
- _iteratorError = err;
1647
- } finally {
1648
- try {
1649
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1650
- _iterator.return();
1651
- }
1652
- } finally {
1653
- if (_didIteratorError) {
1654
- throw _iteratorError;
1655
- }
1656
- }
1657
- }
1658
- };
1659
- var out = {
1660
- ...themes
1661
- };
1662
- for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
1663
- return out;
1550
+ var _loop = function(_i2, _iter2) {
1551
+ var scheme = _iter2[_i2];
1552
+ var _themes_;
1553
+ var base = themes[scheme];
1554
+ if (!base) return "continue";
1555
+ var grounds = [base["color-1"], base["color-2"]].map(luminanceOf);
1556
+ if (grounds.some(function(lum) {
1557
+ return lum === null;
1558
+ })) return "continue";
1559
+ var holds = function holds2(color) {
1560
+ var lum = luminanceOf(color);
1561
+ return lum !== null && isChromatic(color) && grounds.every(function(ground) {
1562
+ return contrastRatio(lum, ground) >= minContrastRatio;
1563
+ });
1564
+ };
1565
+ var rootRing = [base["accent-color"], (_themes_ = themes[`${scheme}_${hue}`]) === null || _themes_ === void 0 ? void 0 : _themes_["accent-color"]].find(holds);
1566
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1567
+ try {
1568
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1569
+ var [name, theme] = _step.value;
1570
+ var _parts_;
1571
+ var _themes_1;
1572
+ if (name !== scheme && !name.startsWith(`${scheme}_`)) continue;
1573
+ if (theme["outline-color"] === void 0) continue;
1574
+ var parts = name.split("_");
1575
+ if (parts.includes("accent")) continue;
1576
+ var _$hue = childrenHues.includes((_parts_ = parts[1]) !== null && _parts_ !== void 0 ? _parts_ : "") ? parts[1] : void 0;
1577
+ var scopeInk = _$hue ? (_themes_1 = themes[`${scheme}_${_$hue}`]) === null || _themes_1 === void 0 ? void 0 : _themes_1["accent-color"] : void 0;
1578
+ var ring = holds(scopeInk) ? scopeInk : rootRing;
1579
+ if (!ring || ring === theme["outline-color"]) continue;
1580
+ out[name] = {
1581
+ ...theme,
1582
+ "outline-color": ring
1583
+ };
1584
+ }
1585
+ } catch (err) {
1586
+ _didIteratorError = true;
1587
+ _iteratorError = err;
1588
+ } finally {
1589
+ try {
1590
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1591
+ _iterator.return();
1592
+ }
1593
+ } finally {
1594
+ if (_didIteratorError) {
1595
+ throw _iteratorError;
1596
+ }
1597
+ }
1598
+ }
1599
+ };
1600
+ var out = { ...themes };
1601
+ for (var _i = 0, _iter = ["light", "dark"]; _i < _iter.length; _i++) _loop(_i, _iter);
1602
+ return out;
1664
1603
  }
1665
1604
  function isChromatic(color) {
1666
- var hex = color ? normalizeToHex(color) : null;
1667
- if (!hex) return false;
1668
- var channels = [1, 3, 5].map(function (index) {
1669
- return Number.parseInt(hex.slice(index, index + 2), 16);
1670
- });
1671
- return Math.max(...channels) - Math.min(...channels) >= 24;
1605
+ var hex = color ? normalizeToHex(color) : null;
1606
+ if (!hex) return false;
1607
+ var channels = [
1608
+ 1,
1609
+ 3,
1610
+ 5
1611
+ ].map(function(index) {
1612
+ return Number.parseInt(hex.slice(index, index + 2), 16);
1613
+ });
1614
+ return Math.max(...channels) - Math.min(...channels) >= 24;
1672
1615
  }
1673
1616
  function withAlpha(color, alpha) {
1674
- var hsla = color.match(/^hsla?\(([^,]+),\s*([^,]+),\s*([^,)]+)/);
1675
- if (hsla) return `hsla(${hsla[1].trim()}, ${hsla[2].trim()}, ${hsla[3].trim()}, ${alpha})`;
1676
- var hex = normalizeToHex(color);
1677
- if (!hex) return void 0;
1678
- var [r, g, b] = [1, 3, 5].map(function (index) {
1679
- return Number.parseInt(hex.slice(index, index + 2), 16);
1680
- });
1681
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
1617
+ var hsla = color.match(/^hsla?\(([^,]+),\s*([^,]+),\s*([^,)]+)/);
1618
+ if (hsla) return `hsla(${hsla[1].trim()}, ${hsla[2].trim()}, ${hsla[3].trim()}, ${alpha})`;
1619
+ var hex = normalizeToHex(color);
1620
+ if (!hex) return void 0;
1621
+ var [r, g, b] = [
1622
+ 1,
1623
+ 3,
1624
+ 5
1625
+ ].map(function(index) {
1626
+ return Number.parseInt(hex.slice(index, index + 2), 16);
1627
+ });
1628
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
1682
1629
  }
1683
1630
  function holdScrims(themes, alphas) {
1684
- var out = {
1685
- ...themes
1686
- };
1687
- var _iteratorNormalCompletion = true,
1688
- _didIteratorError = false,
1689
- _iteratorError = void 0;
1690
- try {
1691
- for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1692
- var [name, theme] = _step.value;
1693
- var [scheme, hue, ...rest] = name.split("_");
1694
- if (scheme !== "light" && scheme !== "dark") continue;
1695
- if (rest.length > 0 || hue !== void 0 && !childrenHues.includes(hue)) continue;
1696
- var scrimDialog = theme.background ? withAlpha(theme.background, alphas[scheme].dialog) : void 0;
1697
- out[name] = {
1698
- ...theme,
1699
- ...(scrimDialog ? {
1700
- scrimDialog
1701
- } : {}),
1702
- scrimSheet: `rgba(0, 0, 0, ${alphas[scheme].sheet})`
1703
- };
1704
- }
1705
- } catch (err) {
1706
- _didIteratorError = true;
1707
- _iteratorError = err;
1708
- } finally {
1709
- try {
1710
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1711
- _iterator.return();
1712
- }
1713
- } finally {
1714
- if (_didIteratorError) {
1715
- throw _iteratorError;
1716
- }
1717
- }
1718
- }
1719
- return out;
1631
+ var out = { ...themes };
1632
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1633
+ try {
1634
+ for (var _iterator = Object.entries(themes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1635
+ var [name, theme] = _step.value;
1636
+ var [scheme, hue, ...rest] = name.split("_");
1637
+ if (scheme !== "light" && scheme !== "dark") continue;
1638
+ if (rest.length > 0 || hue !== void 0 && !childrenHues.includes(hue)) continue;
1639
+ var scrimDialog = theme.background ? withAlpha(theme.background, alphas[scheme].dialog) : void 0;
1640
+ out[name] = {
1641
+ ...theme,
1642
+ ...scrimDialog ? { "scrim-dialog": scrimDialog } : {},
1643
+ "scrim-sheet": `rgba(0, 0, 0, ${alphas[scheme].sheet})`
1644
+ };
1645
+ }
1646
+ } catch (err) {
1647
+ _didIteratorError = true;
1648
+ _iteratorError = err;
1649
+ } finally {
1650
+ try {
1651
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1652
+ _iterator.return();
1653
+ }
1654
+ } finally {
1655
+ if (_didIteratorError) {
1656
+ throw _iteratorError;
1657
+ }
1658
+ }
1659
+ }
1660
+ return out;
1661
+ }
1662
+ var postPassThemeKeys = [
1663
+ "accent-on-surface",
1664
+ "border-color-control",
1665
+ "border-color-field",
1666
+ "border-color-field-hover",
1667
+ "border-color-hairline",
1668
+ "error-fill",
1669
+ "identity-ink",
1670
+ "overlay-fill",
1671
+ "scrim-dialog",
1672
+ "scrim-sheet",
1673
+ "selected-background",
1674
+ "selected-color",
1675
+ "success-fill",
1676
+ "switch-track-off",
1677
+ "switch-track-off-border",
1678
+ "switch-track-off-hover",
1679
+ "switch-track-off-press",
1680
+ "warning-fill",
1681
+ "warning-ink",
1682
+ "warning-mark",
1683
+ "warning-soft"
1684
+ ];
1685
+ var walkThemeTree = createThemes;
1686
+ function buildThemeTree(maps, added) {
1687
+ var stateNames = Object.keys(maps.states);
1688
+ var within = function within2(parent, names) {
1689
+ return names.some(function(name) {
1690
+ return parent.startsWith(name) || parent.endsWith(name);
1691
+ });
1692
+ };
1693
+ var nameOf = function nameOf2(path) {
1694
+ return path ? `light_${path}` : "light";
1695
+ };
1696
+ var templateOnly = function templateOnly2(definition) {
1697
+ return { template: definition.template || "base" };
1698
+ };
1699
+ var firstWins = function firstWins2() {
1700
+ for (var _len = arguments.length, groups = new Array(_len), _key = 0; _key < _len; _key++) {
1701
+ groups[_key] = arguments[_key];
1702
+ }
1703
+ var merged = {};
1704
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1705
+ try {
1706
+ for (var _iterator = groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1707
+ var group = _step.value;
1708
+ for (var name in group) if (!(name in merged)) merged[name] = group[name];
1709
+ }
1710
+ } catch (err) {
1711
+ _didIteratorError = true;
1712
+ _iteratorError = err;
1713
+ } finally {
1714
+ try {
1715
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1716
+ _iterator.return();
1717
+ }
1718
+ } finally {
1719
+ if (_didIteratorError) {
1720
+ throw _iteratorError;
1721
+ }
1722
+ }
1723
+ }
1724
+ return merged;
1725
+ };
1726
+ var states = function states2(path) {
1727
+ return within(nameOf(path), ["accent"]) ? {} : Object.fromEntries(Object.entries(maps.states).filter(function(param) {
1728
+ var [name] = param;
1729
+ return !nameOf(path).endsWith(`_${name}`);
1730
+ }).map(function(param) {
1731
+ var [name, definition] = param;
1732
+ return [name, templateOnly(definition)];
1733
+ }));
1734
+ };
1735
+ var components = function components2(path) {
1736
+ return within(nameOf(path), stateNames) ? {} : Object.fromEntries(Object.entries(maps.components).map(function(param) {
1737
+ var [name, definition] = param;
1738
+ return [name, templateOnly(definition)];
1739
+ }));
1740
+ };
1741
+ var addedUnder = function addedUnder2(path) {
1742
+ var _ref;
1743
+ return Object.fromEntries([...(_ref = added === null || added === void 0 ? void 0 : added.children.get(path)) !== null && _ref !== void 0 ? _ref : []].map(function(name) {
1744
+ return [name, function(param) {
1745
+ var { parent } = param;
1746
+ return (added === null || added === void 0 ? void 0 : added.exists([
1747
+ parent.scheme,
1748
+ path,
1749
+ name
1750
+ ].filter(Boolean).join("_"))) ? {} : null;
1751
+ }];
1752
+ }));
1753
+ };
1754
+ return {
1755
+ light: {
1756
+ scheme: "light",
1757
+ palette: "base",
1758
+ template: "base"
1759
+ },
1760
+ dark: {
1761
+ scheme: "dark",
1762
+ palette: "base",
1763
+ template: "base"
1764
+ },
1765
+ children: firstWins({ accent: {
1766
+ palette: "accent",
1767
+ template: "base",
1768
+ children: components("accent")
1769
+ } }, Object.fromEntries(maps.children.map(function(name) {
1770
+ return [name, {
1771
+ palette: name,
1772
+ template: "base",
1773
+ children: firstWins(states(name), components(name), addedUnder(name))
1774
+ }];
1775
+ })), states(""), components(""), addedUnder(""))
1776
+ };
1777
+ }
1778
+ function rampThemeValues(ramp) {
1779
+ return Object.fromEntries(Object.entries(ramp).map(function(param) {
1780
+ var [key, value] = param;
1781
+ return [kebabThemeKey(key), value];
1782
+ }));
1720
1783
  }
1721
- var postPassThemeKeys = ["accentOnSurface", "borderColorControl", "borderColorField", "borderColorFieldHover", "borderColorHairline", "errorFill", "identityInk", "overlayFill", "scrimDialog", "scrimSheet", "selectedBackground", "selectedColor", "successFill", "switchTrackOff", "switchTrackOffBorder", "switchTrackOffHover", "switchTrackOffPress", "warningFill", "warningInk", "warningMark", "warningSoft"];
1722
1784
  function createThemesBuilder(baseTheme, accentTheme, options) {
1723
- var accentHue = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "blue";
1724
- var _ref, _ref1, _baseTheme_lightScrims, _baseTheme_darkScrims;
1725
- var _baseTheme_lightShadows, _baseTheme_darkShadows;
1726
- var getTheme = (options === null || options === void 0 ? void 0 : options.getTheme) ? sanitizeGetTheme(options.getTheme) : void 0;
1727
- var base = {
1728
- palette: {
1729
- dark: baseTheme.darkPalette,
1730
- light: baseTheme.lightPalette
1731
- },
1732
- extra: {
1733
- light: {
1734
- ...Object.assign({}, ...Object.values(defaultChildrenThemes).map(function (theme) {
1735
- return theme.light;
1736
- })),
1737
- ...Object.assign({}, ...Object.values(radixHues).map(function (hue) {
1738
- return hue.light;
1739
- })),
1740
- ...baseTheme.lightShadows,
1741
- shadowColor: ((_baseTheme_lightShadows = baseTheme.lightShadows) === null || _baseTheme_lightShadows === void 0 ? void 0 : _baseTheme_lightShadows.shadow3) || defaultLightShadows.shadow3
1742
- },
1743
- dark: {
1744
- ...Object.assign({}, ...Object.values(defaultChildrenThemes).map(function (theme) {
1745
- return theme.dark;
1746
- })),
1747
- ...Object.assign({}, ...Object.values(radixHues).map(function (hue) {
1748
- return hue.dark;
1749
- })),
1750
- ...baseTheme.darkShadows,
1751
- shadowColor: ((_baseTheme_darkShadows = baseTheme.darkShadows) === null || _baseTheme_darkShadows === void 0 ? void 0 : _baseTheme_darkShadows.shadow3) || defaultDarkShadows.shadow3
1752
- }
1753
- }
1754
- };
1755
- var childrenThemes = {
1756
- ...Object.fromEntries(childrenHues.map(function (name) {
1757
- var {
1758
- light,
1759
- dark
1760
- } = name === "sky" || name === "plum" ? radixHues[name] : defaultChildrenThemes[name];
1761
- return [name, {
1762
- palette: {
1763
- light: Object.values(light),
1764
- dark: Object.values(dark)
1765
- }
1766
- }];
1767
- })),
1768
- warning: {
1769
- palette: warningPalette
1770
- },
1771
- error: {
1772
- palette: {
1773
- dark: Object.values(Colors.redDark),
1774
- light: Object.values(Colors.red)
1775
- }
1776
- },
1777
- success: {
1778
- palette: {
1779
- dark: Object.values(Colors.greenDark),
1780
- light: withIntentInkFloor(Object.values(Colors.green), intentInkFloor.success)
1781
- }
1782
- }
1783
- };
1784
- var createThemesProps = {
1785
- templates: houseTemplates,
1786
- componentThemes: (_ref = options === null || options === void 0 ? void 0 : options.componentThemes) !== null && _ref !== void 0 ? _ref : houseComponentThemes,
1787
- grandChildrenThemes: (_ref1 = options === null || options === void 0 ? void 0 : options.grandChildrenThemes) !== null && _ref1 !== void 0 ? _ref1 : houseGrandChildrenThemes,
1788
- base,
1789
- childrenThemes,
1790
- accent: {
1791
- palette: {
1792
- dark: accentTheme.darkPalette,
1793
- light: accentTheme.lightPalette
1794
- }
1795
- }
1796
- };
1797
- if (getTheme) {
1798
- createThemesProps.getTheme = getTheme;
1799
- }
1800
- var initialTheme = tamaguiCreateThemes(createThemesProps);
1801
- var scrimAlphas = {
1802
- light: (_baseTheme_lightScrims = baseTheme.lightScrims) !== null && _baseTheme_lightScrims !== void 0 ? _baseTheme_lightScrims : defaultBaseTheme.lightScrims,
1803
- dark: (_baseTheme_darkScrims = baseTheme.darkScrims) !== null && _baseTheme_darkScrims !== void 0 ? _baseTheme_darkScrims : defaultBaseTheme.darkScrims
1804
- };
1805
- var themes = holdScrims(holdHouseIdentityInk(withIdentityInk(withAccentOnSurface(holdWarningRoleKeys(holdFocusRingAccent(holdControlEdges(holdHouseAccent(holdColorThemeAccent(holdSwitchTrack(holdSyntaxFloor(holdNamedInkFloor(holdSelectedState(holdAccentFloor(holdDarkEdges(holdSelectionSurface(neutralizeSemanticEntryText(neutralizeTintText(initialTheme)))))))))), accentHue)), accentHue)))), accentHue), scrimAlphas);
1806
- return {
1807
- themes() {
1808
- return themes;
1809
- },
1810
- addTheme(name, theme) {
1811
- var _ref2, _ref12;
1812
- var addThemeProps = {
1813
- templates: houseTemplates,
1814
- componentThemes: (_ref2 = options === null || options === void 0 ? void 0 : options.componentThemes) !== null && _ref2 !== void 0 ? _ref2 : houseComponentThemes,
1815
- grandChildrenThemes: (_ref12 = options === null || options === void 0 ? void 0 : options.grandChildrenThemes) !== null && _ref12 !== void 0 ? _ref12 : houseGrandChildrenThemes,
1816
- base,
1817
- childrenThemes,
1818
- accent: {
1819
- palette: {
1820
- dark: theme.darkPalette,
1821
- light: theme.lightPalette
1822
- }
1823
- }
1824
- };
1825
- if (getTheme) {
1826
- addThemeProps.getTheme = getTheme;
1827
- }
1828
- var createdTheme = tamaguiCreateThemes(addThemeProps);
1829
- var held = holdScrims(withIdentityInk(withAccentOnSurface({
1830
- dark: createdTheme.dark_accent,
1831
- light: createdTheme.light_accent
1832
- })), scrimAlphas);
1833
- return {
1834
- [`dark_${name}`]: held.dark,
1835
- [`light_${name}`]: held.light
1836
- };
1837
- }
1838
- };
1785
+ var accentHue = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "blue";
1786
+ var _ref, _ref1, _baseTheme_lightScrims, _baseTheme_darkScrims;
1787
+ var _baseTheme_lightShadows, _baseTheme_darkShadows;
1788
+ var getTheme = (options === null || options === void 0 ? void 0 : options.getTheme) ? sanitizeGetTheme(options.getTheme) : void 0;
1789
+ var namedColors = function namedColors2(scheme) {
1790
+ return {
1791
+ ...Object.assign({}, ...themeRampHues.map(function(hue) {
1792
+ return rampThemeValues(themeRamps[hue][scheme]);
1793
+ })),
1794
+ ...Object.assign({}, ...Object.values(radixHues).map(function(hue) {
1795
+ return rampThemeValues(hue[scheme]);
1796
+ })),
1797
+ ...Object.fromEntries(neutralPalette.map(function(color, index) {
1798
+ return [`neutral-${index + 1}`, color];
1799
+ }))
1800
+ };
1801
+ };
1802
+ var base = {
1803
+ palette: {
1804
+ dark: baseTheme.darkPalette,
1805
+ light: baseTheme.lightPalette
1806
+ },
1807
+ extra: {
1808
+ light: {
1809
+ ...namedColors("light"),
1810
+ ...rampThemeValues({ ...baseTheme.lightShadows }),
1811
+ "shadow-color": ((_baseTheme_lightShadows = baseTheme.lightShadows) === null || _baseTheme_lightShadows === void 0 ? void 0 : _baseTheme_lightShadows.shadow3) || defaultLightShadows.shadow3
1812
+ },
1813
+ dark: {
1814
+ ...namedColors("dark"),
1815
+ ...rampThemeValues({ ...baseTheme.darkShadows }),
1816
+ "shadow-color": ((_baseTheme_darkShadows = baseTheme.darkShadows) === null || _baseTheme_darkShadows === void 0 ? void 0 : _baseTheme_darkShadows.shadow3) || defaultDarkShadows.shadow3
1817
+ }
1818
+ }
1819
+ };
1820
+ var childrenThemes = {
1821
+ ...Object.fromEntries(childrenHues.map(function(name2) {
1822
+ var { light, dark } = name2 === "sky" || name2 === "plum" ? radixHues[name2] : themeRamps[name2];
1823
+ return [name2, { palette: {
1824
+ light: Object.values(light),
1825
+ dark: Object.values(dark)
1826
+ } }];
1827
+ })),
1828
+ warning: { palette: warningPalette },
1829
+ error: { palette: {
1830
+ dark: Object.values(Colors.redDark),
1831
+ light: Object.values(Colors.red)
1832
+ } },
1833
+ success: { palette: {
1834
+ dark: Object.values(Colors.greenDark),
1835
+ light: withIntentInkFloor(Object.values(Colors.green), intentInkFloor.success)
1836
+ } }
1837
+ };
1838
+ var maps = {
1839
+ children: Object.keys(childrenThemes),
1840
+ states: (_ref = options === null || options === void 0 ? void 0 : options.grandChildrenThemes) !== null && _ref !== void 0 ? _ref : houseGrandChildrenThemes,
1841
+ components: ((_ref1 = options === null || options === void 0 ? void 0 : options.componentThemes) !== null && _ref1 !== void 0 ? _ref1 : houseComponentThemes) || {}
1842
+ };
1843
+ var templates = houseTemplates;
1844
+ var buildRawThemes = function buildRawThemes2(accent) {
1845
+ var palettes = buildPalettes({
1846
+ base: base.palette,
1847
+ accent,
1848
+ ...Object.fromEntries(Object.entries(childrenThemes).map(function(param) {
1849
+ var [name2, child2] = param;
1850
+ return [name2, child2.palette];
1851
+ }))
1852
+ });
1853
+ var rootValues = function rootValues2(scheme) {
1854
+ return {
1855
+ ...base.extra[scheme],
1856
+ ...Object.fromEntries(Array.from({ length: 12 }, function(_, index) {
1857
+ return [`accent-${index + 1}`, palettes[`${scheme}_accent`][PALETTE_BACKGROUND_OFFSET + index]];
1858
+ }))
1859
+ };
1860
+ };
1861
+ var raw = walkThemeTree({ color: {} }, buildThemeTree(maps), { getTheme: function getTheme1(param) {
1862
+ var { recipe, name: name2 } = param;
1863
+ var _templates_recipe_template;
1864
+ var scheme = recipe.scheme;
1865
+ var paletteName = recipe.palette === "base" ? scheme : `${scheme}_${recipe.palette}`;
1866
+ var palette = palettes[paletteName];
1867
+ if (!palette) throw new Error(`No palette for theme ${name2}: ${paletteName}`);
1868
+ var template = (_templates_recipe_template = templates[recipe.template]) !== null && _templates_recipe_template !== void 0 ? _templates_recipe_template : templates[`${scheme}_${recipe.template}`];
1869
+ if (!template) throw new Error(`No template for theme ${name2}: ${recipe.template}`);
1870
+ var theme = {
1871
+ ...resolveTemplate(palette, template),
1872
+ ...name2 === scheme ? rootValues(scheme) : null
1873
+ };
1874
+ if (!getTheme) return theme;
1875
+ var parentNames = name2.split("_").slice(0, -1);
1876
+ return {
1877
+ ...theme,
1878
+ ...getTheme({
1879
+ name: name2,
1880
+ theme,
1881
+ scheme,
1882
+ parentName: parentNames.join("_"),
1883
+ parentNames,
1884
+ level: parentNames.length + 1,
1885
+ palette
1886
+ })
1887
+ };
1888
+ } });
1889
+ return Object.fromEntries(Object.entries(raw).map(function(param) {
1890
+ var [name2, theme] = param;
1891
+ return [name2, { ...theme }];
1892
+ }));
1893
+ };
1894
+ var initialTheme = buildRawThemes({
1895
+ dark: accentTheme.darkPalette,
1896
+ light: accentTheme.lightPalette
1897
+ });
1898
+ var scrimAlphas = {
1899
+ light: (_baseTheme_lightScrims = baseTheme.lightScrims) !== null && _baseTheme_lightScrims !== void 0 ? _baseTheme_lightScrims : defaultBaseTheme.lightScrims,
1900
+ dark: (_baseTheme_darkScrims = baseTheme.darkScrims) !== null && _baseTheme_darkScrims !== void 0 ? _baseTheme_darkScrims : defaultBaseTheme.darkScrims
1901
+ };
1902
+ var held = holdScrims(holdHouseIdentityInk(withIdentityInk(withAccentOnSurface(holdWarningRoleKeys(holdFocusRingAccent(holdControlEdges(holdHouseAccent(holdColorThemeAccent(holdSwitchTrack(holdSyntaxFloor(holdNamedInkFloor(holdSelectedState(holdAccentFloor(holdDarkEdges(holdSelectionSurface(neutralizeSemanticEntryText(neutralizeTintText(initialTheme)))))))))), accentHue)), accentHue)))), accentHue), scrimAlphas);
1903
+ var addedChildren = /* @__PURE__ */ new Map();
1904
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
1905
+ try {
1906
+ for (var _iterator = Object.keys(held)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1907
+ var name = _step.value;
1908
+ var _addedChildren_get;
1909
+ if (name in initialTheme) continue;
1910
+ var [, ...path] = name.split("_");
1911
+ var child = path.pop();
1912
+ if (!child || path.length > 1 || !(name.slice(0, -child.length - 1) in initialTheme)) {
1913
+ throw new Error(`A theme pass added "${name}", which has no place in the theme tree`);
1914
+ }
1915
+ var parent = path.join("_");
1916
+ addedChildren.set(parent, ((_addedChildren_get = addedChildren.get(parent)) !== null && _addedChildren_get !== void 0 ? _addedChildren_get : /* @__PURE__ */ new Set()).add(child));
1917
+ }
1918
+ } catch (err) {
1919
+ _didIteratorError = true;
1920
+ _iteratorError = err;
1921
+ } finally {
1922
+ try {
1923
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1924
+ _iterator.return();
1925
+ }
1926
+ } finally {
1927
+ if (_didIteratorError) {
1928
+ throw _iteratorError;
1929
+ }
1930
+ }
1931
+ }
1932
+ var themes = walkThemeTree({ color: {} }, buildThemeTree(maps, {
1933
+ children: addedChildren,
1934
+ exists: function exists(name2) {
1935
+ return name2 in held;
1936
+ }
1937
+ }), { getTheme: function getTheme2(param) {
1938
+ var { name: name2 } = param;
1939
+ var _held_name;
1940
+ return (_held_name = held[name2]) !== null && _held_name !== void 0 ? _held_name : {};
1941
+ } });
1942
+ return {
1943
+ themes() {
1944
+ return themes;
1945
+ },
1946
+ addTheme(name2, theme) {
1947
+ var createdTheme = buildRawThemes({
1948
+ dark: theme.darkPalette,
1949
+ light: theme.lightPalette
1950
+ });
1951
+ var held2 = holdScrims(withIdentityInk(withAccentOnSurface({
1952
+ dark: createdTheme.dark_accent,
1953
+ light: createdTheme.light_accent
1954
+ })), scrimAlphas);
1955
+ return {
1956
+ [`dark_${name2}`]: held2.dark,
1957
+ [`light_${name2}`]: held2.light
1958
+ };
1959
+ }
1960
+ };
1839
1961
  }
1962
+
1840
1963
  export { createThemesBuilder, houseComponentThemes, houseGrandChildrenThemes, houseTemplates, intentInkFloor, postPassThemeKeys, tintHueNames };
1841
1964
  //# sourceMappingURL=createThemes.native.js.map