@multiplatform.one/theme 9.17.0 → 10.1.0

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