orn-ui 0.2.10 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/AGENTS.md +66 -51
  2. package/README.md +3 -7
  3. package/lib/commonjs/atoms/Avatar.js +77 -5
  4. package/lib/commonjs/atoms/Avatar.js.map +1 -1
  5. package/lib/commonjs/atoms/Badge.js +17 -8
  6. package/lib/commonjs/atoms/Badge.js.map +1 -1
  7. package/lib/commonjs/atoms/Button.js +108 -39
  8. package/lib/commonjs/atoms/Button.js.map +1 -1
  9. package/lib/commonjs/atoms/Card.js +24 -2
  10. package/lib/commonjs/atoms/Card.js.map +1 -1
  11. package/lib/commonjs/atoms/Checkbox.js +41 -10
  12. package/lib/commonjs/atoms/Checkbox.js.map +1 -1
  13. package/lib/commonjs/atoms/Divider.js +30 -5
  14. package/lib/commonjs/atoms/Divider.js.map +1 -1
  15. package/lib/commonjs/atoms/EmptyState.js +58 -20
  16. package/lib/commonjs/atoms/EmptyState.js.map +1 -1
  17. package/lib/commonjs/atoms/Fab.js +32 -12
  18. package/lib/commonjs/atoms/Fab.js.map +1 -1
  19. package/lib/commonjs/atoms/Gradient.js +102 -36
  20. package/lib/commonjs/atoms/Gradient.js.map +1 -1
  21. package/lib/commonjs/atoms/IconButton.js +25 -4
  22. package/lib/commonjs/atoms/IconButton.js.map +1 -1
  23. package/lib/commonjs/atoms/Image.js +61 -25
  24. package/lib/commonjs/atoms/Image.js.map +1 -1
  25. package/lib/commonjs/atoms/Input.js +105 -17
  26. package/lib/commonjs/atoms/Input.js.map +1 -1
  27. package/lib/commonjs/atoms/KeyValueRow.js +37 -9
  28. package/lib/commonjs/atoms/KeyValueRow.js.map +1 -1
  29. package/lib/commonjs/atoms/PressableScale.js +25 -5
  30. package/lib/commonjs/atoms/PressableScale.js.map +1 -1
  31. package/lib/commonjs/atoms/ShinyText.js +29 -29
  32. package/lib/commonjs/atoms/Skeleton.js +28 -13
  33. package/lib/commonjs/atoms/Skeleton.js.map +1 -1
  34. package/lib/commonjs/atoms/Spinner.js +81 -22
  35. package/lib/commonjs/atoms/Spinner.js.map +1 -1
  36. package/lib/commonjs/atoms/Text.js +56 -5
  37. package/lib/commonjs/atoms/Text.js.map +1 -1
  38. package/lib/commonjs/atoms/Transition.js +46 -43
  39. package/lib/commonjs/atoms/Transition.js.map +1 -1
  40. package/lib/commonjs/atoms/index.js +6 -0
  41. package/lib/commonjs/atoms/index.js.map +1 -1
  42. package/lib/commonjs/atoms/inputValidation.js +56 -0
  43. package/lib/commonjs/atoms/inputValidation.js.map +1 -0
  44. package/lib/commonjs/icons/Icon.js +4 -4
  45. package/lib/commonjs/icons/defaultIcons.js +576 -24
  46. package/lib/commonjs/icons/defaultIcons.js.map +1 -1
  47. package/lib/commonjs/icons/index.js +6 -0
  48. package/lib/commonjs/icons/index.js.map +1 -1
  49. package/lib/commonjs/molecules/AvatarHeader.js +47 -14
  50. package/lib/commonjs/molecules/AvatarHeader.js.map +1 -1
  51. package/lib/commonjs/molecules/FormActions.js +25 -9
  52. package/lib/commonjs/molecules/FormActions.js.map +1 -1
  53. package/lib/commonjs/molecules/InfoRow.js +30 -14
  54. package/lib/commonjs/molecules/InfoRow.js.map +1 -1
  55. package/lib/commonjs/molecules/OptionCard.js +37 -22
  56. package/lib/commonjs/molecules/OptionCard.js.map +1 -1
  57. package/lib/commonjs/molecules/SegmentedControl.js +103 -14
  58. package/lib/commonjs/molecules/SegmentedControl.js.map +1 -1
  59. package/lib/commonjs/molecules/Stepper.js +61 -16
  60. package/lib/commonjs/molecules/Stepper.js.map +1 -1
  61. package/lib/commonjs/molecules/Steps.js +105 -41
  62. package/lib/commonjs/molecules/Steps.js.map +1 -1
  63. package/lib/commonjs/molecules/SymmetricGrid.js +26 -18
  64. package/lib/commonjs/molecules/SymmetricGrid.js.map +1 -1
  65. package/lib/commonjs/organisms/Alert.js +49 -35
  66. package/lib/commonjs/organisms/Alert.js.map +1 -1
  67. package/lib/commonjs/organisms/AlertProvider.js +10 -10
  68. package/lib/commonjs/organisms/BottomSheet.js +137 -85
  69. package/lib/commonjs/organisms/BottomSheet.js.map +1 -1
  70. package/lib/commonjs/organisms/Chart.js +174 -154
  71. package/lib/commonjs/organisms/Chart.js.map +1 -1
  72. package/lib/commonjs/organisms/DateField.js +36 -20
  73. package/lib/commonjs/organisms/DateField.js.map +1 -1
  74. package/lib/commonjs/organisms/DatePicker.js +56 -33
  75. package/lib/commonjs/organisms/DatePicker.js.map +1 -1
  76. package/lib/commonjs/organisms/List.js +62 -34
  77. package/lib/commonjs/organisms/List.js.map +1 -1
  78. package/lib/commonjs/organisms/Modal.js +120 -82
  79. package/lib/commonjs/organisms/Modal.js.map +1 -1
  80. package/lib/commonjs/organisms/NavigationBar.js +63 -24
  81. package/lib/commonjs/organisms/NavigationBar.js.map +1 -1
  82. package/lib/commonjs/organisms/OptionWheel.js +64 -64
  83. package/lib/commonjs/organisms/OptionWheel.js.map +1 -1
  84. package/lib/commonjs/organisms/ReorderableList.js +48 -27
  85. package/lib/commonjs/organisms/ReorderableList.js.map +1 -1
  86. package/lib/commonjs/organisms/Screen.js +68 -35
  87. package/lib/commonjs/organisms/Screen.js.map +1 -1
  88. package/lib/commonjs/organisms/SearchList.js +56 -26
  89. package/lib/commonjs/organisms/SearchList.js.map +1 -1
  90. package/lib/commonjs/organisms/Select.js +45 -24
  91. package/lib/commonjs/organisms/Select.js.map +1 -1
  92. package/lib/commonjs/organisms/Slides.js +36 -23
  93. package/lib/commonjs/organisms/Slides.js.map +1 -1
  94. package/lib/commonjs/organisms/ThemeToggle.js +10 -9
  95. package/lib/commonjs/organisms/ThemeToggle.js.map +1 -1
  96. package/lib/commonjs/organisms/Timeline.js +73 -56
  97. package/lib/commonjs/organisms/Timeline.js.map +1 -1
  98. package/lib/commonjs/organisms/Toast.js +46 -15
  99. package/lib/commonjs/organisms/Toast.js.map +1 -1
  100. package/lib/commonjs/organisms/ToastProvider.js +14 -10
  101. package/lib/commonjs/organisms/ToastProvider.js.map +1 -1
  102. package/lib/commonjs/organisms/Wizard.js +40 -15
  103. package/lib/commonjs/organisms/Wizard.js.map +1 -1
  104. package/lib/commonjs/organisms/chart/frame.js +25 -25
  105. package/lib/commonjs/organisms/chart/frame.js.map +1 -1
  106. package/lib/commonjs/organisms/chart/marks.js +42 -42
  107. package/lib/commonjs/organisms/chart/math.js +84 -85
  108. package/lib/commonjs/organisms/chart/math.js.map +1 -1
  109. package/lib/commonjs/organisms/chart/palette.js +28 -28
  110. package/lib/commonjs/organisms/imperativeBridge.js +5 -5
  111. package/lib/commonjs/organisms/imperativeBridge.js.map +1 -1
  112. package/lib/commonjs/organisms/useSlides.js +53 -21
  113. package/lib/commonjs/organisms/useSlides.js.map +1 -1
  114. package/lib/commonjs/safe-area/SafeAreaUIProvider.js +9 -66
  115. package/lib/commonjs/safe-area/SafeAreaUIProvider.js.map +1 -1
  116. package/lib/commonjs/safe-area/index.js.map +1 -1
  117. package/lib/commonjs/theme/KeyboardAvoidance.js +206 -0
  118. package/lib/commonjs/theme/KeyboardAvoidance.js.map +1 -0
  119. package/lib/commonjs/theme/NativeOverlay.js +263 -0
  120. package/lib/commonjs/theme/NativeOverlay.js.map +1 -0
  121. package/lib/commonjs/theme/UIProvider.js +86 -33
  122. package/lib/commonjs/theme/UIProvider.js.map +1 -1
  123. package/lib/commonjs/theme/colors.js +17 -17
  124. package/lib/commonjs/theme/colors.js.map +1 -1
  125. package/lib/commonjs/theme/createStyles.js +19 -16
  126. package/lib/commonjs/theme/createStyles.js.map +1 -1
  127. package/lib/commonjs/theme/createTheme.js +6 -6
  128. package/lib/commonjs/theme/index.js +6 -0
  129. package/lib/commonjs/theme/index.js.map +1 -1
  130. package/lib/commonjs/theme/insets.js +1 -1
  131. package/lib/commonjs/theme/labels.js +29 -1
  132. package/lib/commonjs/theme/labels.js.map +1 -1
  133. package/lib/commonjs/theme/palettes.js +25 -23
  134. package/lib/commonjs/theme/palettes.js.map +1 -1
  135. package/lib/commonjs/theme/tokens.js +28 -14
  136. package/lib/commonjs/theme/tokens.js.map +1 -1
  137. package/lib/commonjs/theme/useKeyboardField.js +36 -0
  138. package/lib/commonjs/theme/useKeyboardField.js.map +1 -0
  139. package/lib/commonjs/theme/useReduceMotion.js +31 -0
  140. package/lib/commonjs/theme/useReduceMotion.js.map +1 -0
  141. package/lib/module/atoms/Avatar.js +79 -8
  142. package/lib/module/atoms/Avatar.js.map +1 -1
  143. package/lib/module/atoms/Badge.js +17 -8
  144. package/lib/module/atoms/Badge.js.map +1 -1
  145. package/lib/module/atoms/Button.js +110 -41
  146. package/lib/module/atoms/Button.js.map +1 -1
  147. package/lib/module/atoms/Card.js +24 -2
  148. package/lib/module/atoms/Card.js.map +1 -1
  149. package/lib/module/atoms/Checkbox.js +42 -11
  150. package/lib/module/atoms/Checkbox.js.map +1 -1
  151. package/lib/module/atoms/Divider.js +31 -6
  152. package/lib/module/atoms/Divider.js.map +1 -1
  153. package/lib/module/atoms/EmptyState.js +58 -20
  154. package/lib/module/atoms/EmptyState.js.map +1 -1
  155. package/lib/module/atoms/Fab.js +33 -13
  156. package/lib/module/atoms/Fab.js.map +1 -1
  157. package/lib/module/atoms/Gradient.js +103 -37
  158. package/lib/module/atoms/Gradient.js.map +1 -1
  159. package/lib/module/atoms/IconButton.js +25 -4
  160. package/lib/module/atoms/IconButton.js.map +1 -1
  161. package/lib/module/atoms/Image.js +61 -25
  162. package/lib/module/atoms/Image.js.map +1 -1
  163. package/lib/module/atoms/Input.js +108 -20
  164. package/lib/module/atoms/Input.js.map +1 -1
  165. package/lib/module/atoms/KeyValueRow.js +37 -9
  166. package/lib/module/atoms/KeyValueRow.js.map +1 -1
  167. package/lib/module/atoms/PressableScale.js +25 -5
  168. package/lib/module/atoms/PressableScale.js.map +1 -1
  169. package/lib/module/atoms/ShinyText.js +29 -29
  170. package/lib/module/atoms/Skeleton.js +30 -13
  171. package/lib/module/atoms/Skeleton.js.map +1 -1
  172. package/lib/module/atoms/Spinner.js +82 -23
  173. package/lib/module/atoms/Spinner.js.map +1 -1
  174. package/lib/module/atoms/Text.js +56 -5
  175. package/lib/module/atoms/Text.js.map +1 -1
  176. package/lib/module/atoms/Transition.js +41 -42
  177. package/lib/module/atoms/Transition.js.map +1 -1
  178. package/lib/module/atoms/index.js +1 -1
  179. package/lib/module/atoms/index.js.map +1 -1
  180. package/lib/module/atoms/inputValidation.js +52 -0
  181. package/lib/module/atoms/inputValidation.js.map +1 -0
  182. package/lib/module/icons/Icon.js +4 -4
  183. package/lib/module/icons/defaultIcons.js +574 -24
  184. package/lib/module/icons/defaultIcons.js.map +1 -1
  185. package/lib/module/icons/index.js +1 -1
  186. package/lib/module/icons/index.js.map +1 -1
  187. package/lib/module/molecules/AvatarHeader.js +47 -14
  188. package/lib/module/molecules/AvatarHeader.js.map +1 -1
  189. package/lib/module/molecules/FormActions.js +25 -9
  190. package/lib/module/molecules/FormActions.js.map +1 -1
  191. package/lib/module/molecules/InfoRow.js +30 -14
  192. package/lib/module/molecules/InfoRow.js.map +1 -1
  193. package/lib/module/molecules/OptionCard.js +37 -22
  194. package/lib/module/molecules/OptionCard.js.map +1 -1
  195. package/lib/module/molecules/SegmentedControl.js +107 -18
  196. package/lib/module/molecules/SegmentedControl.js.map +1 -1
  197. package/lib/module/molecules/Stepper.js +63 -18
  198. package/lib/module/molecules/Stepper.js.map +1 -1
  199. package/lib/module/molecules/Steps.js +107 -43
  200. package/lib/module/molecules/Steps.js.map +1 -1
  201. package/lib/module/molecules/SymmetricGrid.js +26 -18
  202. package/lib/module/molecules/SymmetricGrid.js.map +1 -1
  203. package/lib/module/organisms/Alert.js +51 -37
  204. package/lib/module/organisms/Alert.js.map +1 -1
  205. package/lib/module/organisms/AlertProvider.js +10 -10
  206. package/lib/module/organisms/BottomSheet.js +142 -88
  207. package/lib/module/organisms/BottomSheet.js.map +1 -1
  208. package/lib/module/organisms/Chart.js +176 -156
  209. package/lib/module/organisms/Chart.js.map +1 -1
  210. package/lib/module/organisms/DateField.js +36 -20
  211. package/lib/module/organisms/DateField.js.map +1 -1
  212. package/lib/module/organisms/DatePicker.js +56 -33
  213. package/lib/module/organisms/DatePicker.js.map +1 -1
  214. package/lib/module/organisms/List.js +62 -34
  215. package/lib/module/organisms/List.js.map +1 -1
  216. package/lib/module/organisms/Modal.js +122 -84
  217. package/lib/module/organisms/Modal.js.map +1 -1
  218. package/lib/module/organisms/NavigationBar.js +64 -25
  219. package/lib/module/organisms/NavigationBar.js.map +1 -1
  220. package/lib/module/organisms/OptionWheel.js +64 -64
  221. package/lib/module/organisms/OptionWheel.js.map +1 -1
  222. package/lib/module/organisms/ReorderableList.js +48 -27
  223. package/lib/module/organisms/ReorderableList.js.map +1 -1
  224. package/lib/module/organisms/Screen.js +70 -37
  225. package/lib/module/organisms/Screen.js.map +1 -1
  226. package/lib/module/organisms/SearchList.js +56 -26
  227. package/lib/module/organisms/SearchList.js.map +1 -1
  228. package/lib/module/organisms/Select.js +46 -25
  229. package/lib/module/organisms/Select.js.map +1 -1
  230. package/lib/module/organisms/Slides.js +37 -24
  231. package/lib/module/organisms/Slides.js.map +1 -1
  232. package/lib/module/organisms/ThemeToggle.js +11 -10
  233. package/lib/module/organisms/ThemeToggle.js.map +1 -1
  234. package/lib/module/organisms/Timeline.js +73 -56
  235. package/lib/module/organisms/Timeline.js.map +1 -1
  236. package/lib/module/organisms/Toast.js +47 -16
  237. package/lib/module/organisms/Toast.js.map +1 -1
  238. package/lib/module/organisms/ToastProvider.js +15 -11
  239. package/lib/module/organisms/ToastProvider.js.map +1 -1
  240. package/lib/module/organisms/Wizard.js +41 -16
  241. package/lib/module/organisms/Wizard.js.map +1 -1
  242. package/lib/module/organisms/chart/frame.js +25 -25
  243. package/lib/module/organisms/chart/frame.js.map +1 -1
  244. package/lib/module/organisms/chart/marks.js +42 -42
  245. package/lib/module/organisms/chart/math.js +84 -85
  246. package/lib/module/organisms/chart/math.js.map +1 -1
  247. package/lib/module/organisms/chart/palette.js +28 -28
  248. package/lib/module/organisms/imperativeBridge.js +5 -5
  249. package/lib/module/organisms/imperativeBridge.js.map +1 -1
  250. package/lib/module/organisms/useSlides.js +53 -21
  251. package/lib/module/organisms/useSlides.js.map +1 -1
  252. package/lib/module/safe-area/SafeAreaUIProvider.js +10 -65
  253. package/lib/module/safe-area/SafeAreaUIProvider.js.map +1 -1
  254. package/lib/module/safe-area/index.js +1 -0
  255. package/lib/module/safe-area/index.js.map +1 -1
  256. package/lib/module/theme/KeyboardAvoidance.js +198 -0
  257. package/lib/module/theme/KeyboardAvoidance.js.map +1 -0
  258. package/lib/module/theme/NativeOverlay.js +257 -0
  259. package/lib/module/theme/NativeOverlay.js.map +1 -0
  260. package/lib/module/theme/UIProvider.js +88 -35
  261. package/lib/module/theme/UIProvider.js.map +1 -1
  262. package/lib/module/theme/colors.js +17 -17
  263. package/lib/module/theme/colors.js.map +1 -1
  264. package/lib/module/theme/createStyles.js +20 -16
  265. package/lib/module/theme/createStyles.js.map +1 -1
  266. package/lib/module/theme/createTheme.js +6 -6
  267. package/lib/module/theme/index.js +1 -1
  268. package/lib/module/theme/index.js.map +1 -1
  269. package/lib/module/theme/insets.js +1 -1
  270. package/lib/module/theme/labels.js +29 -1
  271. package/lib/module/theme/labels.js.map +1 -1
  272. package/lib/module/theme/palettes.js +25 -23
  273. package/lib/module/theme/palettes.js.map +1 -1
  274. package/lib/module/theme/tokens.js +27 -13
  275. package/lib/module/theme/tokens.js.map +1 -1
  276. package/lib/module/theme/useKeyboardField.js +33 -0
  277. package/lib/module/theme/useKeyboardField.js.map +1 -0
  278. package/lib/module/theme/useReduceMotion.js +28 -0
  279. package/lib/module/theme/useReduceMotion.js.map +1 -0
  280. package/lib/typescript/atoms/Avatar.d.ts +35 -5
  281. package/lib/typescript/atoms/Avatar.d.ts.map +1 -1
  282. package/lib/typescript/atoms/Badge.d.ts +14 -3
  283. package/lib/typescript/atoms/Badge.d.ts.map +1 -1
  284. package/lib/typescript/atoms/Button.d.ts +34 -3
  285. package/lib/typescript/atoms/Button.d.ts.map +1 -1
  286. package/lib/typescript/atoms/Card.d.ts +13 -2
  287. package/lib/typescript/atoms/Card.d.ts.map +1 -1
  288. package/lib/typescript/atoms/Checkbox.d.ts +26 -1
  289. package/lib/typescript/atoms/Checkbox.d.ts.map +1 -1
  290. package/lib/typescript/atoms/Divider.d.ts +18 -1
  291. package/lib/typescript/atoms/Divider.d.ts.map +1 -1
  292. package/lib/typescript/atoms/EmptyState.d.ts +30 -3
  293. package/lib/typescript/atoms/EmptyState.d.ts.map +1 -1
  294. package/lib/typescript/atoms/Fab.d.ts +24 -4
  295. package/lib/typescript/atoms/Fab.d.ts.map +1 -1
  296. package/lib/typescript/atoms/Gradient.d.ts +21 -15
  297. package/lib/typescript/atoms/Gradient.d.ts.map +1 -1
  298. package/lib/typescript/atoms/IconButton.d.ts +18 -4
  299. package/lib/typescript/atoms/IconButton.d.ts.map +1 -1
  300. package/lib/typescript/atoms/Image.d.ts +39 -17
  301. package/lib/typescript/atoms/Image.d.ts.map +1 -1
  302. package/lib/typescript/atoms/Input.d.ts +57 -7
  303. package/lib/typescript/atoms/Input.d.ts.map +1 -1
  304. package/lib/typescript/atoms/KeyValueRow.d.ts +16 -4
  305. package/lib/typescript/atoms/KeyValueRow.d.ts.map +1 -1
  306. package/lib/typescript/atoms/PressableScale.d.ts +12 -5
  307. package/lib/typescript/atoms/PressableScale.d.ts.map +1 -1
  308. package/lib/typescript/atoms/ShinyText.d.ts +17 -17
  309. package/lib/typescript/atoms/ShinyText.d.ts.map +1 -1
  310. package/lib/typescript/atoms/Skeleton.d.ts +12 -7
  311. package/lib/typescript/atoms/Skeleton.d.ts.map +1 -1
  312. package/lib/typescript/atoms/Spinner.d.ts +29 -1
  313. package/lib/typescript/atoms/Spinner.d.ts.map +1 -1
  314. package/lib/typescript/atoms/Text.d.ts +46 -0
  315. package/lib/typescript/atoms/Text.d.ts.map +1 -1
  316. package/lib/typescript/atoms/Transition.d.ts +19 -15
  317. package/lib/typescript/atoms/Transition.d.ts.map +1 -1
  318. package/lib/typescript/atoms/index.d.ts +3 -3
  319. package/lib/typescript/atoms/index.d.ts.map +1 -1
  320. package/lib/typescript/atoms/inputValidation.d.ts +29 -0
  321. package/lib/typescript/atoms/inputValidation.d.ts.map +1 -0
  322. package/lib/typescript/icons/Icon.d.ts +4 -4
  323. package/lib/typescript/icons/defaultIcons.d.ts +19 -2
  324. package/lib/typescript/icons/defaultIcons.d.ts.map +1 -1
  325. package/lib/typescript/icons/index.d.ts +2 -2
  326. package/lib/typescript/icons/index.d.ts.map +1 -1
  327. package/lib/typescript/icons/types.d.ts +13 -3
  328. package/lib/typescript/icons/types.d.ts.map +1 -1
  329. package/lib/typescript/molecules/AvatarHeader.d.ts +23 -4
  330. package/lib/typescript/molecules/AvatarHeader.d.ts.map +1 -1
  331. package/lib/typescript/molecules/FormActions.d.ts +21 -4
  332. package/lib/typescript/molecules/FormActions.d.ts.map +1 -1
  333. package/lib/typescript/molecules/InfoRow.d.ts +17 -3
  334. package/lib/typescript/molecules/InfoRow.d.ts.map +1 -1
  335. package/lib/typescript/molecules/OptionCard.d.ts +20 -5
  336. package/lib/typescript/molecules/OptionCard.d.ts.map +1 -1
  337. package/lib/typescript/molecules/SegmentedControl.d.ts +18 -2
  338. package/lib/typescript/molecules/SegmentedControl.d.ts.map +1 -1
  339. package/lib/typescript/molecules/Stepper.d.ts +23 -7
  340. package/lib/typescript/molecules/Stepper.d.ts.map +1 -1
  341. package/lib/typescript/molecules/Steps.d.ts +18 -4
  342. package/lib/typescript/molecules/Steps.d.ts.map +1 -1
  343. package/lib/typescript/molecules/SymmetricGrid.d.ts +15 -5
  344. package/lib/typescript/molecules/SymmetricGrid.d.ts.map +1 -1
  345. package/lib/typescript/organisms/Alert.d.ts +28 -2
  346. package/lib/typescript/organisms/Alert.d.ts.map +1 -1
  347. package/lib/typescript/organisms/AlertProvider.d.ts +10 -10
  348. package/lib/typescript/organisms/AlertProvider.d.ts.map +1 -1
  349. package/lib/typescript/organisms/BottomSheet.d.ts +20 -5
  350. package/lib/typescript/organisms/BottomSheet.d.ts.map +1 -1
  351. package/lib/typescript/organisms/Chart.d.ts +86 -75
  352. package/lib/typescript/organisms/Chart.d.ts.map +1 -1
  353. package/lib/typescript/organisms/DateField.d.ts +17 -3
  354. package/lib/typescript/organisms/DateField.d.ts.map +1 -1
  355. package/lib/typescript/organisms/DatePicker.d.ts +7 -11
  356. package/lib/typescript/organisms/DatePicker.d.ts.map +1 -1
  357. package/lib/typescript/organisms/List.d.ts +30 -3
  358. package/lib/typescript/organisms/List.d.ts.map +1 -1
  359. package/lib/typescript/organisms/Modal.d.ts +30 -3
  360. package/lib/typescript/organisms/Modal.d.ts.map +1 -1
  361. package/lib/typescript/organisms/NavigationBar.d.ts +26 -7
  362. package/lib/typescript/organisms/NavigationBar.d.ts.map +1 -1
  363. package/lib/typescript/organisms/OptionWheel.d.ts +20 -16
  364. package/lib/typescript/organisms/OptionWheel.d.ts.map +1 -1
  365. package/lib/typescript/organisms/ReorderableList.d.ts +20 -11
  366. package/lib/typescript/organisms/ReorderableList.d.ts.map +1 -1
  367. package/lib/typescript/organisms/Screen.d.ts +27 -8
  368. package/lib/typescript/organisms/Screen.d.ts.map +1 -1
  369. package/lib/typescript/organisms/SearchList.d.ts +46 -3
  370. package/lib/typescript/organisms/SearchList.d.ts.map +1 -1
  371. package/lib/typescript/organisms/Select.d.ts +26 -6
  372. package/lib/typescript/organisms/Select.d.ts.map +1 -1
  373. package/lib/typescript/organisms/Slides.d.ts +44 -26
  374. package/lib/typescript/organisms/Slides.d.ts.map +1 -1
  375. package/lib/typescript/organisms/ThemeToggle.d.ts +6 -2
  376. package/lib/typescript/organisms/ThemeToggle.d.ts.map +1 -1
  377. package/lib/typescript/organisms/Timeline.d.ts +26 -9
  378. package/lib/typescript/organisms/Timeline.d.ts.map +1 -1
  379. package/lib/typescript/organisms/Toast.d.ts +19 -4
  380. package/lib/typescript/organisms/Toast.d.ts.map +1 -1
  381. package/lib/typescript/organisms/ToastProvider.d.ts +8 -8
  382. package/lib/typescript/organisms/ToastProvider.d.ts.map +1 -1
  383. package/lib/typescript/organisms/Wizard.d.ts +24 -6
  384. package/lib/typescript/organisms/Wizard.d.ts.map +1 -1
  385. package/lib/typescript/organisms/chart/frame.d.ts +21 -21
  386. package/lib/typescript/organisms/chart/frame.d.ts.map +1 -1
  387. package/lib/typescript/organisms/chart/marks.d.ts +28 -28
  388. package/lib/typescript/organisms/chart/marks.d.ts.map +1 -1
  389. package/lib/typescript/organisms/chart/math.d.ts +69 -70
  390. package/lib/typescript/organisms/chart/math.d.ts.map +1 -1
  391. package/lib/typescript/organisms/chart/palette.d.ts +2 -2
  392. package/lib/typescript/organisms/chart/palette.d.ts.map +1 -1
  393. package/lib/typescript/organisms/imperativeBridge.d.ts +4 -4
  394. package/lib/typescript/organisms/useSlides.d.ts +8 -16
  395. package/lib/typescript/organisms/useSlides.d.ts.map +1 -1
  396. package/lib/typescript/safe-area/SafeAreaUIProvider.d.ts +9 -7
  397. package/lib/typescript/safe-area/SafeAreaUIProvider.d.ts.map +1 -1
  398. package/lib/typescript/safe-area/index.d.ts.map +1 -1
  399. package/lib/typescript/theme/KeyboardAvoidance.d.ts +62 -0
  400. package/lib/typescript/theme/KeyboardAvoidance.d.ts.map +1 -0
  401. package/lib/typescript/theme/NativeOverlay.d.ts +43 -0
  402. package/lib/typescript/theme/NativeOverlay.d.ts.map +1 -0
  403. package/lib/typescript/theme/UIProvider.d.ts +38 -20
  404. package/lib/typescript/theme/UIProvider.d.ts.map +1 -1
  405. package/lib/typescript/theme/colors.d.ts +13 -13
  406. package/lib/typescript/theme/colors.d.ts.map +1 -1
  407. package/lib/typescript/theme/createStyles.d.ts +20 -14
  408. package/lib/typescript/theme/createStyles.d.ts.map +1 -1
  409. package/lib/typescript/theme/createTheme.d.ts +5 -5
  410. package/lib/typescript/theme/index.d.ts +1 -1
  411. package/lib/typescript/theme/index.d.ts.map +1 -1
  412. package/lib/typescript/theme/insets.d.ts +1 -1
  413. package/lib/typescript/theme/insets.d.ts.map +1 -1
  414. package/lib/typescript/theme/labels.d.ts +57 -2
  415. package/lib/typescript/theme/labels.d.ts.map +1 -1
  416. package/lib/typescript/theme/palettes.d.ts +25 -19
  417. package/lib/typescript/theme/palettes.d.ts.map +1 -1
  418. package/lib/typescript/theme/tokens.d.ts +15 -8
  419. package/lib/typescript/theme/tokens.d.ts.map +1 -1
  420. package/lib/typescript/theme/types.d.ts +7 -7
  421. package/lib/typescript/theme/types.d.ts.map +1 -1
  422. package/lib/typescript/theme/useKeyboardField.d.ts +17 -0
  423. package/lib/typescript/theme/useKeyboardField.d.ts.map +1 -0
  424. package/lib/typescript/theme/useReduceMotion.d.ts +7 -0
  425. package/lib/typescript/theme/useReduceMotion.d.ts.map +1 -0
  426. package/llms.txt +4 -4
  427. package/package.json +15 -14
  428. package/registry/alert-provider.json +4 -3
  429. package/registry/alert.json +3 -2
  430. package/registry/avatar-header.json +1 -1
  431. package/registry/avatar.json +3 -2
  432. package/registry/badge.json +1 -1
  433. package/registry/bottom-sheet.json +1 -1
  434. package/registry/button.json +3 -2
  435. package/registry/card.json +1 -1
  436. package/registry/chart.json +5 -5
  437. package/registry/checkbox.json +3 -2
  438. package/registry/core.json +31 -15
  439. package/registry/date-field.json +1 -1
  440. package/registry/date-picker.json +3 -2
  441. package/registry/divider.json +1 -1
  442. package/registry/empty-state.json +4 -2
  443. package/registry/fab.json +3 -2
  444. package/registry/form-actions.json +3 -2
  445. package/registry/gradient.json +1 -1
  446. package/registry/icon-button.json +3 -2
  447. package/registry/image.json +1 -1
  448. package/registry/index.json +79 -61
  449. package/registry/info-row.json +1 -1
  450. package/registry/input.json +5 -1
  451. package/registry/key-value-row.json +1 -1
  452. package/registry/list.json +3 -1
  453. package/registry/manifest.json +3 -1
  454. package/registry/modal.json +1 -1
  455. package/registry/navigation-bar.json +1 -1
  456. package/registry/option-card.json +3 -2
  457. package/registry/option-wheel.json +1 -1
  458. package/registry/pressable-scale.json +3 -2
  459. package/registry/reorderable-list.json +1 -1
  460. package/registry/screen.json +1 -1
  461. package/registry/search-list.json +7 -1
  462. package/registry/segmented-control.json +1 -1
  463. package/registry/select.json +1 -1
  464. package/registry/shiny-text.json +1 -1
  465. package/registry/skeleton.json +3 -2
  466. package/registry/slides.json +2 -2
  467. package/registry/spinner.json +1 -1
  468. package/registry/stepper.json +1 -1
  469. package/registry/steps.json +1 -1
  470. package/registry/symmetric-grid.json +1 -1
  471. package/registry/theme-toggle.json +1 -1
  472. package/registry/timeline.json +1 -1
  473. package/registry/title.json +1 -1
  474. package/registry/toast-provider.json +2 -2
  475. package/registry/toast.json +1 -1
  476. package/registry/transition.json +1 -1
  477. package/registry/wizard.json +1 -1
  478. package/src/atoms/Avatar.tsx +117 -26
  479. package/src/atoms/Badge.tsx +20 -9
  480. package/src/atoms/Button.tsx +102 -30
  481. package/src/atoms/Card.tsx +23 -3
  482. package/src/atoms/Checkbox.tsx +49 -12
  483. package/src/atoms/Divider.tsx +34 -4
  484. package/src/atoms/EmptyState.tsx +63 -16
  485. package/src/atoms/Fab.tsx +56 -9
  486. package/src/atoms/Gradient.tsx +92 -41
  487. package/src/atoms/IconButton.tsx +27 -4
  488. package/src/atoms/Image.tsx +74 -28
  489. package/src/atoms/Input.tsx +129 -19
  490. package/src/atoms/KeyValueRow.tsx +72 -28
  491. package/src/atoms/PressableScale.tsx +31 -7
  492. package/src/atoms/ShinyText.tsx +31 -31
  493. package/src/atoms/Skeleton.tsx +37 -17
  494. package/src/atoms/Spinner.tsx +87 -24
  495. package/src/atoms/Text.tsx +66 -6
  496. package/src/atoms/Transition.tsx +40 -44
  497. package/src/atoms/index.ts +3 -3
  498. package/src/atoms/inputValidation.ts +59 -0
  499. package/src/icons/Icon.tsx +4 -4
  500. package/src/icons/defaultIcons.tsx +445 -22
  501. package/src/icons/index.ts +2 -2
  502. package/src/icons/types.ts +26 -4
  503. package/src/molecules/AvatarHeader.tsx +88 -34
  504. package/src/molecules/FormActions.tsx +36 -6
  505. package/src/molecules/InfoRow.tsx +39 -12
  506. package/src/molecules/OptionCard.tsx +55 -20
  507. package/src/molecules/SegmentedControl.tsx +135 -15
  508. package/src/molecules/Stepper.tsx +73 -19
  509. package/src/molecules/Steps.tsx +121 -39
  510. package/src/molecules/SymmetricGrid.tsx +28 -12
  511. package/src/organisms/Alert.tsx +97 -26
  512. package/src/organisms/AlertProvider.tsx +13 -13
  513. package/src/organisms/BottomSheet.tsx +115 -43
  514. package/src/organisms/Chart.tsx +193 -164
  515. package/src/organisms/DateField.tsx +40 -15
  516. package/src/organisms/DatePicker.tsx +53 -32
  517. package/src/organisms/List.tsx +64 -15
  518. package/src/organisms/Modal.tsx +122 -63
  519. package/src/organisms/NavigationBar.tsx +73 -23
  520. package/src/organisms/OptionWheel.tsx +70 -66
  521. package/src/organisms/ReorderableList.tsx +49 -27
  522. package/src/organisms/Screen.tsx +79 -42
  523. package/src/organisms/SearchList.tsx +84 -20
  524. package/src/organisms/Select.tsx +63 -29
  525. package/src/organisms/Slides.tsx +63 -44
  526. package/src/organisms/ThemeToggle.tsx +15 -6
  527. package/src/organisms/Timeline.tsx +79 -62
  528. package/src/organisms/Toast.tsx +50 -15
  529. package/src/organisms/ToastProvider.tsx +17 -13
  530. package/src/organisms/Wizard.tsx +58 -21
  531. package/src/organisms/chart/frame.tsx +35 -35
  532. package/src/organisms/chart/marks.tsx +53 -53
  533. package/src/organisms/chart/math.ts +93 -94
  534. package/src/organisms/chart/palette.ts +28 -28
  535. package/src/organisms/imperativeBridge.ts +5 -5
  536. package/src/organisms/useSlides.ts +66 -31
  537. package/src/safe-area/SafeAreaUIProvider.tsx +9 -70
  538. package/src/safe-area/index.ts +1 -0
  539. package/src/theme/KeyboardAvoidance.tsx +216 -0
  540. package/src/theme/NativeOverlay.tsx +269 -0
  541. package/src/theme/UIProvider.tsx +109 -46
  542. package/src/theme/colors.ts +21 -21
  543. package/src/theme/createStyles.ts +23 -19
  544. package/src/theme/createTheme.ts +6 -6
  545. package/src/theme/index.ts +1 -1
  546. package/src/theme/insets.ts +1 -1
  547. package/src/theme/labels.ts +85 -2
  548. package/src/theme/palettes.ts +33 -25
  549. package/src/theme/tokens.ts +27 -13
  550. package/src/theme/types.ts +7 -7
  551. package/src/theme/useKeyboardField.ts +33 -0
  552. package/src/theme/useReduceMotion.ts +27 -0
@@ -9,6 +9,7 @@ var _reactNative = require("react-native");
9
9
  var _colors = require("../theme/colors");
10
10
  var _createStyles = require("../theme/createStyles");
11
11
  var _UIProvider = require("../theme/UIProvider");
12
+ var _useReduceMotion = require("../theme/useReduceMotion");
12
13
  var _SegmentedControl = require("../molecules/SegmentedControl");
13
14
  var _marks = require("./chart/marks");
14
15
  var _frame = require("./chart/frame");
@@ -17,35 +18,43 @@ var _math = require("./chart/math");
17
18
  var _jsxRuntime = require("react/jsx-runtime");
18
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
20
  /**
20
- * Un filtro de la barra superior. Chart no filtra nada por su cuenta: muestra
21
- * el control y avisa. Quien tiene los datos decide qué significa "últimos 7
22
- * días", y eso no se puede adivinar desde acá.
21
+ * A filter in the top bar. Chart doesn't filter anything on its own: it shows
22
+ * the control and reports. Whoever has the data decides what "last 7 days"
23
+ * means, and that can't be guessed from here.
23
24
  */
24
25
 
25
- // 'pie' y 'donut' van separados aunque compartan todo: con un solo miembro
26
- // cuyo `type` fuera `'pie' | 'donut'`, TypeScript no saca ese miembro de la
27
- // unión al descartarlo, y el resto del componente deja de estrecharse.
26
+ /** Background the marks paint "holes" with (donut center, point rings). */
27
+ const ChartSurfaceContext = /*#__PURE__*/(0, _react.createContext)(undefined);
28
+ function useChartSurface() {
29
+ const theme = (0, _UIProvider.useTheme)();
30
+ return (0, _react.useContext)(ChartSurfaceContext) ?? theme.colors.surfaceRaised;
31
+ }
32
+
33
+ // 'pie' and 'donut' are kept separate even though they share everything: with
34
+ // a single member whose `type` were `'pie' | 'donut'`, TypeScript doesn't drop
35
+ // that member from the union when ruling it out, and the rest of the component
36
+ // stops narrowing.
28
37
 
29
38
  const DEFAULT_HEIGHT = 220;
30
39
  const DEFAULT_TICKS = 4;
31
- /** Piso del canal de las etiquetas de valor, a la izquierda. */
40
+ /** Floor of the value-label gutter, on the left. */
32
41
  const VALUE_GUTTER = 38;
33
42
  /**
34
- * Ancho estimado de un caracter de etiqueta. React Native no mide texto sin
35
- * renderizarlo, y medir para decidir el layout haría aparecer el chart
36
- * corrido un frame; a `fontSize.xs` un dígito ronda 0.6em, y de más es mejor
37
- * que de menos — sobra aire, no se corta el número.
43
+ * Estimated width of a label character. React Native doesn't measure text
44
+ * without rendering it, and measuring to decide the layout would make the
45
+ * chart show up shifted for a frame; at `fontSize.xs` a digit is around
46
+ * 0.6em, and too much is better than too little — extra room, no clipped number.
38
47
  */
39
48
  const VALUE_CHAR = 6.5;
40
- /** Tope del canal: un eje ancho no puede comerse el plot. */
49
+ /** Gutter cap: a wide axis can't eat the plot. */
41
50
  const VALUE_GUTTER_MAX = 0.3;
42
- /** Canal de las categorías cuando van a la izquierda (barras horizontales). */
51
+ /** Category gutter when they go on the left (horizontal bars). */
43
52
  const CATEGORY_GUTTER = 64;
44
- /** Canal de las etiquetas de abajo. */
53
+ /** Gutter for the bottom labels. */
45
54
  const BOTTOM_GUTTER = 16;
46
- /** Fracción del ancho de banda que ocupan las barras; el resto es aire. */
55
+ /** Fraction of the band width taken by the bars; the rest is room. */
47
56
  const BAND_FILL = 0.7;
48
- /** Aire alrededor del radar para que entren las etiquetas de los ejes. */
57
+ /** Room around the radar so the axis labels fit. */
49
58
  const RADAR_INSET = 26;
50
59
  const DIM_OPACITY = 0.3;
51
60
  const useStyles = (0, _createStyles.createStyles)(theme => ({
@@ -87,7 +96,7 @@ const useStyles = (0, _createStyles.createStyles)(theme => ({
87
96
  }
88
97
  }));
89
98
 
90
- /** Estado controlado o propio, con el mismo contrato en los dos casos. */
99
+ /** Controlled or own state, with the same contract in both cases. */
91
100
  function useControlled(controlled, fallback) {
92
101
  const [own, setOwn] = (0, _react.useState)(fallback);
93
102
  const isControlled = controlled !== undefined;
@@ -95,10 +104,10 @@ function useControlled(controlled, fallback) {
95
104
  }
96
105
 
97
106
  /**
98
- * Resuelve el dominio del eje de valores a partir de lo que pidió el
99
- * consumidor. En 'sticky' la referencia vive en un ref: lo que importa no es
100
- * el dominio de este render sino el más ancho que se haya visto, y guardarlo
101
- * en estado dispararía un render de más por cada tick que ensancha el eje.
107
+ * Resolves the value axis domain from what the consumer asked for. In
108
+ * 'sticky' the reference lives in a ref: what matters isn't this render's
109
+ * domain but the widest one seen so far, and keeping it in state would fire
110
+ * an extra render for every tick that widens the axis.
102
111
  */
103
112
  function useDomain(measured, domain) {
104
113
  const widest = (0, _react.useRef)(null);
@@ -112,19 +121,20 @@ function useDomain(measured, domain) {
112
121
 
113
122
  /**
114
123
  * Chart
115
- * Barras (verticales, horizontales, agrupadas, apiladas), línea, área, torta,
116
- * dona y radar en un solo componente, porque lo que cambia entre ellos es la
117
- * marca que se dibuja y no el resto: datos, escala, ejes, leyenda, tooltip,
118
- * selección y filtros son los mismos seis mecanismos en todos.
124
+ * Bars (vertical, horizontal, grouped, stacked), line, area, pie, donut and
125
+ * radar in a single component, because what changes between them is the mark
126
+ * being drawn and not the rest: data, scale, axes, legend, tooltip, selection
127
+ * and filters are the same six mechanisms in all of them.
119
128
  *
120
- * Se dibuja con `View`: React Native no trae lienzo vectorial y la librería no
121
- * puede agregar uno. Las tres primitivas están en `chart/marks.tsx` y la
122
- * geometría entera, sin React, en `chart/math.ts`.
129
+ * It is drawn with `View`: React Native ships no vector canvas and the library
130
+ * can't add one. The three primitives are in `chart/marks.tsx` and the whole
131
+ * geometry, without React, in `chart/math.ts`.
123
132
  *
124
- * Gestalt: destino común — al tocar una categoría, todo lo que no es ella baja
125
- * a {@link DIM_OPACITY} a la vez, así que lo resaltado se lee como un grupo y
126
- * no como una marca suelta. La leyenda usa similitud: el mismo color que la
127
- * serie, y por eso puede apagarla sin que haga falta explicar qué apaga.
133
+ * Gestalt: common fate — when you tap a category, everything that isn't it
134
+ * drops to {@link DIM_OPACITY} at once, so what is highlighted reads as a group
135
+ * and not as a loose mark. The legend uses similarity: the same color as the
136
+ * series, which is why it can turn it off without having to explain what it
137
+ * turns off.
128
138
  */
129
139
  function Chart(props) {
130
140
  const {
@@ -143,10 +153,11 @@ function Chart(props) {
143
153
  onSelect,
144
154
  tooltip = true,
145
155
  formatValue = _math.formatNumber,
146
- animate = true,
156
+ animate: animateProp = true,
147
157
  duration,
148
158
  emptyText,
149
159
  accessibilityLabel,
160
+ surfaceColor,
150
161
  style,
151
162
  testID
152
163
  } = props;
@@ -154,6 +165,9 @@ function Chart(props) {
154
165
  const styles = useStyles();
155
166
  const allowFontScaling = (0, _UIProvider.useAllowFontScaling)();
156
167
  const uiLabels = (0, _UIProvider.useLabels)();
168
+ // Reduce Motion: the marks appear in their final shape instead of growing.
169
+ const reduceMotion = (0, _useReduceMotion.useReduceMotion)();
170
+ const animate = animateProp && !reduceMotion;
157
171
  const [width, setWidth] = (0, _react.useState)(0);
158
172
  const [hidden, setHidden, hiddenIsControlled] = useControlled(hiddenKeys, defaultHiddenKeys ?? []);
159
173
  const [pick, setPick, selectionIsControlled] = useControlled(selected, null);
@@ -162,15 +176,15 @@ function Chart(props) {
162
176
  const decimate = polyline ? props.decimate : false;
163
177
 
164
178
  /**
165
- * Lo que se dibuja: la ventana de `data`, y de ahí los puntos que caben.
166
- * El diezmado corre sobre la fila entera, elegida con la primera serie
167
- * visible: las series comparten eje x, así que quedarse con índices
168
- * distintos por serie rompería la alineación, la capa de toque y el tooltip.
179
+ * What gets drawn: the window of `data`, and from that the points that fit.
180
+ * Decimation runs over the whole row, chosen with the first visible series:
181
+ * the series share the x axis, so keeping different indexes per series would
182
+ * break the alignment, the touch layer and the tooltip.
169
183
  */
170
184
  const rows = (0, _react.useMemo)(() => {
171
185
  const windowed = windowSize && windowSize > 0 ? data.slice(-windowSize) : data;
172
186
  if (!polyline || decimate === false || width === 0) return windowed;
173
- // Un punto cada dos píxeles: más no se ve y sí se paga.
187
+ // One point every two pixels: more can't be seen but still has to be paid for.
174
188
  const target = typeof decimate === 'number' ? decimate : Math.floor(width / 2);
175
189
  if (windowed.length <= target) return windowed;
176
190
  const lead = series.find(item => !hidden.includes(item.key))?.key ?? series[0]?.key;
@@ -181,10 +195,10 @@ function Chart(props) {
181
195
  const ids = (0, _react.useMemo)(() => rows.map((row, index) => selectBy ? selectBy(row, index) : String(index)), [rows, selectBy]);
182
196
 
183
197
  /**
184
- * La selección se guarda por `id` y se resuelve contra las filas de ahora:
185
- * si el dato se corrió, el resaltado lo sigue; si salió de la ventana,
186
- * desaparece. Reusar el índice a ciegas señalaría el dato que quedó en ese
187
- * lugar, que no es el que nadie eligió.
198
+ * The selection is stored by `id` and resolved against the current rows:
199
+ * if the datum shifted, the highlight follows it; if it left the window, it
200
+ * disappears. Blindly reusing the index would point at the datum that ended
201
+ * up in that spot, which isn't the one anyone picked.
188
202
  */
189
203
  const selection = (0, _react.useMemo)(() => {
190
204
  if (!pick) return null;
@@ -200,8 +214,8 @@ function Chart(props) {
200
214
  };
201
215
  }, [pick, ids, rows, labels]);
202
216
 
203
- // En torta las categorías son las filas; en el resto, las columnas. De eso
204
- // dependen el color, la leyenda y qué apaga un toque en ella.
217
+ // In a pie the categories are the rows; in the rest, the columns. The
218
+ // color, the legend and what a tap on it turns off depend on that.
205
219
  const palette = (0, _palette.seriesPalette)(theme, Math.max(1, isPie ? rows.length : series.length));
206
220
  const entries = (0, _react.useMemo)(() => isPie ? labels.map((label, index) => ({
207
221
  key: label,
@@ -221,9 +235,9 @@ function Chart(props) {
221
235
  }, [hidden, hiddenIsControlled, setHidden, onHiddenKeysChange]);
222
236
 
223
237
  /**
224
- * Los plots avisan qué se tocó —fila y serie— y la selección entera se
225
- * arma acá: es el único lugar que conoce `selectBy`, las etiquetas y las
226
- * filas de verdad, y así los tres no repiten el armado.
238
+ * The plots report what was tapped —row and series— and the whole selection
239
+ * is built here: it is the only place that knows `selectBy`, the labels and
240
+ * the actual rows, so the three don't repeat the building.
227
241
  */
228
242
  const applySelection = (0, _react.useCallback)(hit => {
229
243
  const row = hit ? rows[hit.index] : undefined;
@@ -235,9 +249,9 @@ function Chart(props) {
235
249
  seriesKey: hit.seriesKey,
236
250
  value: (0, _math.toNumber)(row[hit.seriesKey]) ?? 0
237
251
  } : null;
238
- // Tocar lo ya elegido lo suelta: sin eso no habría forma de volver al
239
- // chart entero sin tocar afuera, y "afuera" en una pantalla con scroll
240
- // no siempre existe.
252
+ // Tapping what is already selected releases it: without that there would
253
+ // be no way back to the whole chart without tapping outside, and
254
+ // "outside" doesn't always exist on a scrolling screen.
241
255
  const same = next && selection && next.id === selection.id && next.seriesKey === selection.seriesKey;
242
256
  const value = same ? null : next;
243
257
  if (!selectionIsControlled) setPick(value);
@@ -262,77 +276,80 @@ function Chart(props) {
262
276
  tooltip,
263
277
  testID
264
278
  };
265
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
266
- style: [styles.root, style],
267
- testID: testID,
268
- accessible: false,
269
- children: [filters && filters.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
270
- style: styles.filters,
271
- children: filters.map(filter => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SegmentedControl.SegmentedControl, {
272
- options: filter.options,
273
- value: filter.value,
274
- onChange: filter.onChange,
275
- testID: testID && `${testID}-filter-${filter.key}`
276
- }, filter.key))
277
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
278
- style: [styles.plot, {
279
- height
280
- }],
281
- onLayout: onLayout,
282
- accessible: true,
283
- accessibilityRole: "image",
284
- accessibilityLabel: accessibilityLabel,
285
- testID: testID && `${testID}-plot`,
286
- children: [width === 0 || empty ? null : props.type === 'pie' || props.type === 'donut' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PiePlot, {
287
- ...shared,
288
- donut: props.type === 'donut',
289
- innerRadius: props.innerRadius,
290
- sliceLabels: props.sliceLabels ?? 'percent',
291
- valueKey: series[0]?.key ?? ''
292
- }) : props.type === 'radar' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RadarPlot, {
293
- ...shared,
294
- domain: props.domain,
295
- levels: props.levels ?? 4,
296
- fill: props.fill ?? true,
297
- thickness: props.thickness ?? 2,
298
- dots: props.dots ?? true
299
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(CartesianPlot, {
300
- ...shared,
301
- type: props.type,
302
- orientation: props.type === 'bar' ? props.orientation ?? 'vertical' : 'vertical',
303
- stacked: props.type === 'bar' || props.type === 'area' ? props.stacked ?? false : false,
304
- barRadius: props.type === 'bar' ? props.barRadius ?? theme.tokens.radius.xs : 0,
305
- smooth: props.type !== 'bar' ? props.smooth ?? false : false,
306
- thickness: props.type !== 'bar' ? props.thickness ?? 2 : 0,
307
- dots: props.type === 'line' ? props.dots ?? true : props.type === 'area' ? props.dots ?? false : false,
308
- fillOpacity: props.type === 'area' ? props.fillOpacity ?? 0.22 : 0,
309
- domain: props.domain,
310
- grid: props.grid ?? true,
311
- ticks: props.ticks ?? DEFAULT_TICKS,
312
- xAxis: props.xAxis ?? true,
313
- yAxis: props.yAxis ?? true
314
- }), empty ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
315
- style: styles.empty,
316
- testID: testID && `${testID}-empty`,
317
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
318
- allowFontScaling: allowFontScaling,
319
- style: styles.emptyText,
320
- children: emptyText ?? uiLabels.noResultsTitle
321
- })
279
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartSurfaceContext.Provider, {
280
+ value: surfaceColor ?? theme.colors.surfaceRaised,
281
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
282
+ style: [styles.root, style],
283
+ testID: testID,
284
+ accessible: false,
285
+ children: [filters && filters.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
286
+ style: styles.filters,
287
+ children: filters.map(filter => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SegmentedControl.SegmentedControl, {
288
+ options: filter.options,
289
+ value: filter.value,
290
+ onChange: filter.onChange,
291
+ testID: testID && `${testID}-filter-${filter.key}`
292
+ }, filter.key))
293
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
294
+ style: [styles.plot, {
295
+ height
296
+ }],
297
+ onLayout: onLayout,
298
+ accessible: true,
299
+ accessibilityRole: "image",
300
+ accessibilityLabel: accessibilityLabel,
301
+ testID: testID && `${testID}-plot`,
302
+ children: [width === 0 || empty ? null : props.type === 'pie' || props.type === 'donut' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PiePlot, {
303
+ ...shared,
304
+ donut: props.type === 'donut',
305
+ innerRadius: props.innerRadius,
306
+ sliceLabels: props.sliceLabels ?? 'percent',
307
+ valueKey: series[0]?.key ?? ''
308
+ }) : props.type === 'radar' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RadarPlot, {
309
+ ...shared,
310
+ domain: props.domain,
311
+ levels: props.levels ?? 4,
312
+ fill: props.fill ?? true,
313
+ thickness: props.thickness ?? 2,
314
+ dots: props.dots ?? true
315
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(CartesianPlot, {
316
+ ...shared,
317
+ type: props.type,
318
+ orientation: props.type === 'bar' ? props.orientation ?? 'vertical' : 'vertical',
319
+ stacked: props.type === 'bar' || props.type === 'area' ? props.stacked ?? false : false,
320
+ barRadius: props.type === 'bar' ? props.barRadius ?? theme.tokens.radius.xs : 0,
321
+ smooth: props.type !== 'bar' ? props.smooth ?? false : false,
322
+ thickness: props.type !== 'bar' ? props.thickness ?? 2 : 0,
323
+ dots: props.type === 'line' ? props.dots ?? true : props.type === 'area' ? props.dots ?? false : false,
324
+ fillOpacity: props.type === 'area' ? props.fillOpacity ?? 0.22 : 0,
325
+ domain: props.domain,
326
+ grid: props.grid ?? true,
327
+ ticks: props.ticks ?? DEFAULT_TICKS,
328
+ xAxis: props.xAxis ?? true,
329
+ yAxis: props.yAxis ?? true
330
+ }), empty ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
331
+ style: styles.empty,
332
+ testID: testID && `${testID}-empty`,
333
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
334
+ allowFontScaling: allowFontScaling,
335
+ style: styles.emptyText,
336
+ children: emptyText ?? uiLabels.noResultsTitle
337
+ })
338
+ }) : null]
339
+ }), showLegend ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_frame.Legend, {
340
+ items: entries,
341
+ hidden: hidden,
342
+ onToggle: toggleable ? applyHidden : undefined,
343
+ testID: testID && `${testID}-legend`
322
344
  }) : null]
323
- }), showLegend ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_frame.Legend, {
324
- items: entries,
325
- hidden: hidden,
326
- onToggle: toggleable ? applyHidden : undefined,
327
- testID: testID && `${testID}-legend`
328
- }) : null]
345
+ })
329
346
  });
330
347
  }
331
348
  Chart.displayName = 'Chart';
332
349
 
333
- // ── lo que comparten los tres plots ────────────────────────────────────────
350
+ // ── what the three plots share ─────────────────────────────────────────────
334
351
 
335
- /** Filas del tooltip para una categoría del eje x. */
352
+ /** Tooltip rows for a category on the x axis. */
336
353
  function tooltipRowsAt(rows, index, visible, format) {
337
354
  const row = rows[index];
338
355
  if (!row) return [];
@@ -347,12 +364,12 @@ function tooltipRowsAt(rows, index, visible, format) {
347
364
  }).filter(item => item !== null);
348
365
  }
349
366
 
350
- // ── barras, línea y área ───────────────────────────────────────────────────
367
+ // ── bars, line and area ────────────────────────────────────────────────────
351
368
 
352
- /** Ancho de una tira del relleno de área, en píxeles. Más fino = más vistas. */
369
+ /** Width of one strip of the area fill, in pixels. Thinner = more views. */
353
370
  const STRIP_WIDTH = 4;
354
371
  const MAX_STRIPS = 140;
355
- /** Aire entre dos barras del mismo grupo. */
372
+ /** Room between two bars of the same group. */
356
373
  const GROUP_GAP = 2;
357
374
  const CartesianPlot = /*#__PURE__*/(0, _react.memo)(props => {
358
375
  const {
@@ -383,27 +400,28 @@ const CartesianPlot = /*#__PURE__*/(0, _react.memo)(props => {
383
400
  yAxis
384
401
  } = props;
385
402
  const theme = (0, _UIProvider.useTheme)();
403
+ const surface = useChartSurface();
386
404
  const horizontal = type === 'bar' && orientation === 'horizontal';
387
405
  const keys = (0, _react.useMemo)(() => visible.map(entry => entry.key), [visible]);
388
406
  const bottomGutter = xAxis ? BOTTOM_GUTTER : 0;
389
407
 
390
- // La línea puede no tocar el cero (una temperatura, un ranking); una barra
391
- // sí tiene que hacerlo, porque su largo es el que dice el valor.
408
+ // The line may not touch zero (a temperature, a ranking); a bar does have
409
+ // to, because its length is what states the value.
392
410
  const measured = (0, _react.useMemo)(() => (0, _math.extent)(rows, keys, {
393
411
  stacked,
394
412
  includeZero: type !== 'line'
395
413
  }), [rows, keys, stacked, type]);
396
414
  const [low, high] = useDomain(measured, domain);
397
415
 
398
- // Un dominio a mano se respeta tal cual; uno medido (o 'sticky') se
399
- // redondea, que es lo que hace legible el eje.
416
+ // A hand-set domain is respected as is; a measured one (or 'sticky') is
417
+ // rounded, which is what makes the axis legible.
400
418
  const nice = (0, _react.useMemo)(() => Array.isArray(domain) ? (0, _math.exactTicks)(low, high, tickCount) : (0, _math.niceScale)(low, high, tickCount), [domain, low, high, tickCount]);
401
419
 
402
420
  /**
403
- * El canal sale de la etiqueta más larga, no de una constante: con un
404
- * `formatValue` propio ("$3000", "1.250 ms") un ancho fijo corta el número
405
- * y el eje pasa a decir "$30…". Los ticks no dependen del ancho del plot,
406
- * así que se pueden medir antes de repartirlo.
421
+ * The gutter comes from the longest label, not from a constant: with a
422
+ * custom `formatValue` ("$3000", "1.250 ms") a fixed width clips the number
423
+ * and the axis ends up saying "$30…". The ticks don't depend on the plot's
424
+ * width, so they can be measured before splitting it up.
407
425
  */
408
426
  const leftGutter = (0, _react.useMemo)(() => {
409
427
  if (!yAxis) return 0;
@@ -424,7 +442,7 @@ const CartesianPlot = /*#__PURE__*/(0, _react.memo)(props => {
424
442
  const baseline = scale.toPixel((0, _math.clamp)(0, scale.nice.min, scale.nice.max));
425
443
  const stacks = (0, _react.useMemo)(() => stacked ? rows.map(row => (0, _math.stackRow)(row, keys)) : null, [stacked, rows, keys]);
426
444
 
427
- /** Puntos de una serie: `to` es el valor, `from` el piso desde donde se rellena. */
445
+ /** A series' points: `to` is the value, `from` the floor it is filled from. */
428
446
  const pointsFor = (0, _react.useCallback)((key, edge) => {
429
447
  const out = [];
430
448
  rows.forEach((row, index) => {
@@ -447,8 +465,8 @@ const CartesianPlot = /*#__PURE__*/(0, _react.memo)(props => {
447
465
  return out;
448
466
  }, [rows, stacks, centerOf, scale, baseline]);
449
467
  const pickAt = (0, _react.useCallback)((index, event) => {
450
- // Sobre qué serie cayó el dedo: la que tiene su marca más cerca del
451
- // toque en el eje de valores. Con una sola serie es siempre esa.
468
+ // Which series the finger landed on: the one whose mark is closest to
469
+ // the touch on the value axis. With a single series it is always that one.
452
470
  const touch = (horizontal ? event?.nativeEvent?.locationX : event?.nativeEvent?.locationY) ?? 0;
453
471
  let bestKey = keys[0] ?? '';
454
472
  let bestDistance = Infinity;
@@ -556,10 +574,10 @@ const CartesianPlot = /*#__PURE__*/(0, _react.memo)(props => {
556
574
  },
557
575
  children: [type === 'area' ?
558
576
  /*#__PURE__*/
559
- // La opacidad va en el grupo, no en cada tira: el medio
560
- // píxel de solape que tapa la costura del antialias se
561
- // compone dos veces y deja una raya vertical cada cuatro
562
- // píxeles. Atenuado el grupo entero, se pinta una sola vez.
577
+ // Opacity goes on the group, not on each strip: the half
578
+ // pixel of overlap that hides the antialias seam is
579
+ // composited twice and leaves a vertical stripe every four
580
+ // pixels. Dimming the whole group, it is painted only once.
563
581
  (0, _jsxRuntime.jsx)(_reactNative.View, {
564
582
  pointerEvents: "none",
565
583
  style: {
@@ -596,7 +614,7 @@ const CartesianPlot = /*#__PURE__*/(0, _react.memo)(props => {
596
614
  }), dots ? raw.map((point, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_marks.Dot, {
597
615
  point: point,
598
616
  color: entry.color,
599
- ringColor: theme.colors.surface,
617
+ ringColor: surface,
600
618
  size: selection?.index === index ? 8 : 6,
601
619
  testID: testID && `${testID}-dot-${entry.key}-${index}`
602
620
  }, index)) : null]
@@ -676,15 +694,15 @@ const CartesianPlot = /*#__PURE__*/(0, _react.memo)(props => {
676
694
  });
677
695
  CartesianPlot.displayName = 'CartesianPlot';
678
696
 
679
- // ── torta y dona ───────────────────────────────────────────────────────────
697
+ // ── pie and donut ──────────────────────────────────────────────────────────
680
698
 
681
699
  const DONUT_RADIUS = 0.6;
682
- /** Cuánto sale la porción elegida, en píxeles. */
700
+ /** How far the selected slice pops out, in pixels. */
683
701
  const EXPLODE = 8;
684
- /** Dónde cae la etiqueta, como fracción entre el agujero y el borde. */
702
+ /** Where the label falls, as a fraction between the hole and the edge. */
685
703
  const LABEL_AT = 0.62;
686
704
 
687
- /** Blanco o negro, el que se lea encima del color. Un color raro no rompe: cae en `text`. */
705
+ /** White or black, whichever reads over the color. An odd color doesn't break: it falls back to `text`. */
688
706
  function inkOn(background, theme) {
689
707
  try {
690
708
  return (0, _colors.contrast)(background, theme.colors.white) >= (0, _colors.contrast)(background, theme.colors.black) ? theme.colors.white : theme.colors.black;
@@ -711,6 +729,7 @@ const PiePlot = /*#__PURE__*/(0, _react.memo)(props => {
711
729
  valueKey
712
730
  } = props;
713
731
  const theme = (0, _UIProvider.useTheme)();
732
+ const surface = useChartSurface();
714
733
  const styles = useStyles();
715
734
  const allowFontScaling = (0, _UIProvider.useAllowFontScaling)();
716
735
  const center = {
@@ -720,8 +739,8 @@ const PiePlot = /*#__PURE__*/(0, _react.memo)(props => {
720
739
  const radius = Math.max(0, Math.min(width, height) / 2 - 2);
721
740
  const hole = (0, _math.clamp)(innerRadius ?? (donut ? DONUT_RADIUS : 0), 0, 0.9) * radius;
722
741
  const arcs = (0, _react.useMemo)(() => {
723
- // Una categoría apagada vale 0: sale de la torta y el resto se reparte el
724
- // 100%, que es lo que espera quien la apagó desde la leyenda.
742
+ // A turned-off category is worth 0: it leaves the pie and the rest share
743
+ // the 100%, which is what whoever turned it off from the legend expects.
725
744
  const values = rows.map((row, index) => visible.some(entry => entry.key === labels[index]) ? (0, _math.toNumber)(row[valueKey]) ?? 0 : 0);
726
745
  return (0, _math.arcsFor)(values);
727
746
  }, [rows, labels, visible, valueKey]);
@@ -731,8 +750,8 @@ const PiePlot = /*#__PURE__*/(0, _react.memo)(props => {
731
750
  y: event?.nativeEvent?.locationY ?? 0
732
751
  };
733
752
  const distance = Math.hypot(point.x - center.x, point.y - center.y);
734
- // El agujero de una dona no es parte de ninguna porción, y afuera del
735
- // círculo tampoco: los dos sueltan la selección.
753
+ // A donut's hole isn't part of any slice, and neither is the area
754
+ // outside the circle: both release the selection.
736
755
  if (distance > radius || distance < hole) return onPick(null);
737
756
  const index = (0, _math.arcAt)(arcs, (0, _math.angleOf)(center, point));
738
757
  if (index === -1) return onPick(null);
@@ -764,11 +783,11 @@ const PiePlot = /*#__PURE__*/(0, _react.memo)(props => {
764
783
  width: hole * 2,
765
784
  height: hole * 2,
766
785
  borderRadius: hole,
767
- backgroundColor: theme.colors.surface
786
+ backgroundColor: surface
768
787
  }
769
788
  }) : null, sliceLabels === 'none' ? null : arcs.map(arc => {
770
- // Una porción muy fina no tiene dónde escribir: la etiqueta se
771
- // saldría encima de las vecinas y no se leería ninguna.
789
+ // A very thin slice has nowhere to write: the label would spill
790
+ // over its neighbors and none would be readable.
772
791
  if (arc.sweep < 18) return null;
773
792
  const at = (0, _math.polar)(center, hole + (radius - hole) * LABEL_AT, arc.start + arc.sweep / 2);
774
793
  const color = entries[arc.index]?.color ?? theme.colors.primary;
@@ -813,7 +832,7 @@ PiePlot.displayName = 'PiePlot';
813
832
 
814
833
  // ── radar ──────────────────────────────────────────────────────────────────
815
834
 
816
- /** Tiras por lado del polígono cuando se rellena. Más = borde más limpio, más vistas. */
835
+ /** Strips per side of the polygon when it is filled. More = cleaner edge, more views. */
817
836
  const RADAR_STEPS = 5;
818
837
  const RADAR_FILL_OPACITY = 0.18;
819
838
  const RADAR_LABEL_WIDTH = 56;
@@ -836,6 +855,7 @@ const RadarPlot = /*#__PURE__*/(0, _react.memo)(props => {
836
855
  dots
837
856
  } = props;
838
857
  const theme = (0, _UIProvider.useTheme)();
858
+ const surface = useChartSurface();
839
859
  const styles = useStyles();
840
860
  const allowFontScaling = (0, _UIProvider.useAllowFontScaling)();
841
861
  const center = {
@@ -846,8 +866,8 @@ const RadarPlot = /*#__PURE__*/(0, _react.memo)(props => {
846
866
  const angles = (0, _react.useMemo)(() => (0, _math.radarAngles)(rows.length), [rows.length]);
847
867
  const keys = (0, _react.useMemo)(() => visible.map(entry => entry.key), [visible]);
848
868
 
849
- // El radar mide desde el centro, y el centro es 0: un mínimo distinto de
850
- // cero haría que dos valores parecidos se vean lejísimos.
869
+ // The radar measures from the center, and the center is 0: a minimum other
870
+ // than zero would make two similar values look miles apart.
851
871
  const measured = (0, _react.useMemo)(() => [0, (0, _math.extent)(rows, keys, {
852
872
  includeZero: true
853
873
  })[1]], [rows, keys]);
@@ -892,11 +912,11 @@ const RadarPlot = /*#__PURE__*/(0, _react.memo)(props => {
892
912
  },
893
913
  children: [fill ?
894
914
  /*#__PURE__*/
895
- // La opacidad va en el grupo, no en cada tira. Por tira, el
896
- // solape de 0.4° que tapa la costura del antialias se compone
897
- // dos veces y deja un radio más oscuro por corte: el relleno
898
- // termina pareciendo una telaraña. Aplicada al grupo, las tiras
899
- // se pintan opacas entre sí y el conjunto se atenúa una vez.
915
+ // Opacity goes on the group, not on each strip. Per strip, the
916
+ // 0.4° overlap that hides the antialias seam is composited
917
+ // twice and leaves a darker radius at each cut: the fill ends
918
+ // up looking like a spider web. Applied to the group, the strips
919
+ // paint opaque against each other and the whole is dimmed once.
900
920
  (0, _jsxRuntime.jsx)(_reactNative.View, {
901
921
  pointerEvents: "none",
902
922
  style: {
@@ -924,7 +944,7 @@ const RadarPlot = /*#__PURE__*/(0, _react.memo)(props => {
924
944
  }), dots ? points.map((point, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_marks.Dot, {
925
945
  point: point,
926
946
  color: entry.color,
927
- ringColor: theme.colors.surface,
947
+ ringColor: surface,
928
948
  size: selection?.index === index ? 8 : 6
929
949
  }, index)) : null]
930
950
  }, entry.key);