orn-ui 0.2.9 → 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 +67 -52
  2. package/README.md +5 -9
  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 +197 -156
  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 +199 -158
  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 +223 -165
  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
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Geometría y escalas de Chart: todo lo que se puede probar sin montar un
3
- * árbol vive acá, sin React y sin dependencias. marks.tsx sólo traduce estos
4
- * números a estilos, y Chart.tsx sólo decide qué marca dibujar.
2
+ * Chart geometry and scales: everything that can be tested without mounting a
3
+ * tree lives here, without React and without dependencies. marks.tsx only
4
+ * translates these numbers into styles, and Chart.tsx only decides which mark to draw.
5
5
  *
6
- * Convenciones:
7
- * - Coordenadas de React Native: origen arriba-izquierda, `y` crece hacia abajo.
8
- * - Ángulos en grados, 0° a las 12 en punto, creciendo en sentido horario —
9
- * que es como se lee una torta y como gira `transform: rotate` en RN.
6
+ * Conventions:
7
+ * - React Native coordinates: origin at the top-left, `y` grows downward.
8
+ * - Angles in degrees, 0° at 12 o'clock, increasing clockwise —
9
+ * which is how a pie is read and how `transform: rotate` turns in RN.
10
10
  */
11
11
 
12
12
  export interface Point {
@@ -14,10 +14,10 @@ export interface Point {
14
14
  y: number;
15
15
  }
16
16
 
17
- /** Fila de datos: una categoría del eje x y un número por serie. */
17
+ /** Data row: an x-axis category and one number per series. */
18
18
  export type ChartRow = Record<string, string | number | null | undefined>;
19
19
 
20
- /** Lee una celda como número, o null si no lo es (hueco en la serie). */
20
+ /** Reads a cell as a number, or null if it isn't one (a gap in the series). */
21
21
  export function toNumber(value: unknown): number | null {
22
22
  return typeof value === 'number' && Number.isFinite(value) ? value : null;
23
23
  }
@@ -26,17 +26,17 @@ export function clamp(value: number, min: number, max: number): number {
26
26
  return Math.min(max, Math.max(min, value));
27
27
  }
28
28
 
29
- /** Mata el ruido de punto flotante que deja sumar `step` en un bucle. */
29
+ /** Kills the floating point noise left by adding `step` in a loop. */
30
30
  function tidy(value: number): number {
31
31
  return Number(value.toFixed(10));
32
32
  }
33
33
 
34
- // ── escalas ────────────────────────────────────────────────────────────────
34
+ // ── scales ─────────────────────────────────────────────────────────────────
35
35
 
36
36
  /**
37
- * El 1, 2, 5 o 10 (por su potencia de diez) más cercano por encima de `rough`.
38
- * Es lo que hace que los ticks caigan en números que alguien diría en voz
39
- * alta — 0, 250, 500 — y no en 0, 237, 474.
37
+ * The 1, 2, 5 or 10 (times its power of ten) closest above `rough`.
38
+ * It is what makes ticks land on numbers someone would say out loud —
39
+ * 0, 250, 500 — and not on 0, 237, 474.
40
40
  */
41
41
  export function niceStep(rough: number): number {
42
42
  if (!(rough > 0)) return 1;
@@ -47,18 +47,18 @@ export function niceStep(rough: number): number {
47
47
  }
48
48
 
49
49
  export interface Ticks {
50
- /** Extremo inferior redondeado hacia afuera. */
50
+ /** Lower end, rounded outward. */
51
51
  min: number;
52
- /** Extremo superior redondeado hacia afuera. */
52
+ /** Upper end, rounded outward. */
53
53
  max: number;
54
54
  step: number;
55
55
  values: number[];
56
56
  }
57
57
 
58
58
  /**
59
- * Dominio redondeado a valores legibles más la lista de ticks. `count` es una
60
- * intención, no una promesa: redondear hacia afuera puede dar uno más o uno
61
- * menos, y eso es preferible a un eje con números arbitrarios.
59
+ * Domain rounded to legible values plus the list of ticks. `count` is an
60
+ * intent, not a promise: rounding outward may give one more or one fewer,
61
+ * and that is preferable to an axis with arbitrary numbers.
62
62
  */
63
63
  export function niceScale(min: number, max: number, count = 5): Ticks {
64
64
  let lo = Math.min(min, max);
@@ -68,8 +68,8 @@ export function niceScale(min: number, max: number, count = 5): Ticks {
68
68
  hi = 1;
69
69
  }
70
70
  if (lo === hi) {
71
- // Un solo valor no define un rango. Se le inventa uno simétrico para que
72
- // la marca no quede ni pegada al borde ni ocupando el alto entero.
71
+ // A single value doesn't define a range. A symmetric one is made up so
72
+ // the mark neither sticks to the edge nor fills the whole height.
73
73
  const pad = Math.abs(lo) || 1;
74
74
  lo -= pad;
75
75
  hi += pad;
@@ -78,17 +78,17 @@ export function niceScale(min: number, max: number, count = 5): Ticks {
78
78
  const start = Math.floor(lo / step) * step;
79
79
  const end = Math.ceil(hi / step) * step;
80
80
  const values: number[] = [];
81
- // `end + step / 2` en vez de `end`: sumar step acumula error y el último
82
- // tick se perdería justo en los dominios que más se usan (0–100, 0–1).
81
+ // `end + step / 2` instead of `end`: adding step accumulates error and the
82
+ // last tick would be lost precisely in the most used domains (0–100, 0–1).
83
83
  for (let value = start; value <= end + step / 2; value += step) values.push(tidy(value));
84
84
  return { min: start, max: end, step, values };
85
85
  }
86
86
 
87
87
  /**
88
- * Ticks de un dominio que el consumidor fijó a mano. No redondea nada: si
89
- * alguien pide 0–100, el eje dice 0–100. Es lo contrario de `niceScale`, y es
90
- * lo que necesita un chart en vivo — un eje que se reacomoda en cada tick hace
91
- * saltar la línea aunque el dato no se haya movido.
88
+ * Ticks for a domain the consumer set by hand. It rounds nothing: if someone
89
+ * asks for 0–100, the axis says 0–100. It is the opposite of `niceScale`, and
90
+ * it is what a live chart needs — an axis that rearranges itself on every tick
91
+ * makes the line jump even though the data hasn't moved.
92
92
  */
93
93
  export function exactTicks(min: number, max: number, count = 5): Ticks {
94
94
  const lo = Math.min(min, max);
@@ -105,16 +105,16 @@ export function exactTicks(min: number, max: number, count = 5): Ticks {
105
105
  }
106
106
 
107
107
  /**
108
- * Une dos dominios quedándose con el más ancho. Es el modo 'sticky': el eje
109
- * crece cuando llega un valor que no entraba y no se vuelve a achicar, así
110
- * que lo que se ve moverse es el dato y no la escala.
108
+ * Merges two domains keeping the widest. It is the 'sticky' mode: the axis
109
+ * grows when a value arrives that didn't fit and never shrinks back, so what
110
+ * you see moving is the data and not the scale.
111
111
  */
112
112
  export function growExtent(previous: [number, number] | null, next: [number, number]): [number, number] {
113
113
  if (!previous) return next;
114
114
  return [Math.min(previous[0], next[0]), Math.max(previous[1], next[1])];
115
115
  }
116
116
 
117
- /** Interpolador lineal dominio → rango. Dominio degenerado cae al medio del rango. */
117
+ /** Linear domain → range interpolator. A degenerate domain falls to the middle of the range. */
118
118
  export function linearScale(domain: [number, number], range: [number, number]): (value: number) => number {
119
119
  const [d0, d1] = domain;
120
120
  const [r0, r1] = range;
@@ -124,13 +124,13 @@ export function linearScale(domain: [number, number], range: [number, number]):
124
124
  }
125
125
 
126
126
  export interface ExtentOptions {
127
- /** Las series se suman en vez de compararse (barras/áreas apiladas). */
127
+ /** The series are summed instead of compared (stacked bars/areas). */
128
128
  stacked?: boolean;
129
- /** Fuerza el 0 adentro del dominio: sin él, una barra corta miente. */
129
+ /** Forces 0 into the domain: without it, a short bar lies. */
130
130
  includeZero?: boolean;
131
131
  }
132
132
 
133
- /** Mínimo y máximo de las series pedidas. Sin datos devuelve [0, 1]. */
133
+ /** Minimum and maximum of the requested series. With no data it returns [0, 1]. */
134
134
  export function extent(rows: ChartRow[], keys: string[], options: ExtentOptions = {}): [number, number] {
135
135
  const { stacked = false, includeZero = false } = options;
136
136
  let min = Infinity;
@@ -138,8 +138,8 @@ export function extent(rows: ChartRow[], keys: string[], options: ExtentOptions
138
138
 
139
139
  for (const row of rows) {
140
140
  if (stacked) {
141
- // Positivos y negativos se apilan hacia lados opuestos del cero, así que
142
- // cada lado tiene su propio total y ninguno cancela al otro.
141
+ // Positives and negatives stack toward opposite sides of zero, so each
142
+ // side has its own total and neither cancels the other.
143
143
  let up = 0;
144
144
  let down = 0;
145
145
  for (const key of keys) {
@@ -168,21 +168,21 @@ export function extent(rows: ChartRow[], keys: string[], options: ExtentOptions
168
168
  return [min, max];
169
169
  }
170
170
 
171
- // ── apilado ────────────────────────────────────────────────────────────────
171
+ // ── stacking ───────────────────────────────────────────────────────────────
172
172
 
173
173
  export interface StackBand {
174
174
  key: string;
175
- /** Borde de la banda más cerca del cero. */
175
+ /** Edge of the band closest to zero. */
176
176
  from: number;
177
- /** Borde más lejos del cero. */
177
+ /** Edge furthest from zero. */
178
178
  to: number;
179
179
  value: number;
180
180
  }
181
181
 
182
182
  /**
183
- * Bandas apiladas de una fila. Los positivos crecen desde 0 hacia arriba y
184
- * los negativos desde 0 hacia abajo: una serie negativa no le come el alto a
185
- * las positivas, que es lo que pasa si se apila todo en un solo acumulador.
183
+ * Stacked bands of a row. Positives grow from 0 upward and negatives from 0
184
+ * downward: a negative series doesn't eat the positives' height, which is
185
+ * what happens if everything is stacked in a single accumulator.
186
186
  */
187
187
  export function stackRow(row: ChartRow, keys: string[]): StackBand[] {
188
188
  const bands: StackBand[] = [];
@@ -206,7 +206,7 @@ export function stackRow(row: ChartRow, keys: string[]): StackBand[] {
206
206
 
207
207
  const RAD = Math.PI / 180;
208
208
 
209
- /** Punto a `radius` del centro en el ángulo dado (0° arriba, horario). */
209
+ /** Point at `radius` from the center at the given angle (0° up, clockwise). */
210
210
  export function polar(center: Point, radius: number, angle: number): Point {
211
211
  return {
212
212
  x: center.x + radius * Math.sin(angle * RAD),
@@ -214,25 +214,25 @@ export function polar(center: Point, radius: number, angle: number): Point {
214
214
  };
215
215
  }
216
216
 
217
- /** Ángulo de un punto respecto del centro, normalizado a [0, 360). */
217
+ /** Angle of a point relative to the center, normalized to [0, 360). */
218
218
  export function angleOf(center: Point, point: Point): number {
219
219
  const degrees = Math.atan2(point.x - center.x, center.y - point.y) / RAD;
220
220
  return (degrees + 360) % 360;
221
221
  }
222
222
 
223
223
  export interface Arc {
224
- /** Índice de la fila que representa. */
224
+ /** Index of the row it represents. */
225
225
  index: number;
226
226
  start: number;
227
227
  sweep: number;
228
228
  value: number;
229
- /** Proporción sobre el total, 0–1. */
229
+ /** Share of the total, 0–1. */
230
230
  ratio: number;
231
231
  }
232
232
 
233
233
  /**
234
- * Arcos de una torta. Los negativos no existen en una torta (no hay "menos
235
- * porción"): se descartan en vez de invertirse. Total 0 ⇒ nada que dibujar.
234
+ * Arcs of a pie. Negatives don't exist in a pie (there is no "less slice"):
235
+ * they are dropped instead of inverted. Total 0 ⇒ nothing to draw.
236
236
  */
237
237
  export function arcsFor(values: number[]): Arc[] {
238
238
  const safe = values.map((value) => (Number.isFinite(value) && value > 0 ? value : 0));
@@ -250,7 +250,7 @@ export function arcsFor(values: number[]): Arc[] {
250
250
  return arcs;
251
251
  }
252
252
 
253
- /** El arco que contiene ese ángulo, o -1. */
253
+ /** The arc containing that angle, or -1. */
254
254
  export function arcAt(arcs: Arc[], angle: number): number {
255
255
  const normalized = (angle + 360) % 360;
256
256
  for (const arc of arcs) {
@@ -259,26 +259,26 @@ export function arcAt(arcs: Arc[], angle: number): number {
259
259
  return -1;
260
260
  }
261
261
 
262
- /** Ángulos de los ejes de un radar: el primero arriba, el resto en reparto parejo. */
262
+ /** Angles of a radar's axes: the first at the top, the rest evenly spread. */
263
263
  export function radarAngles(count: number): number[] {
264
264
  if (count <= 0) return [];
265
265
  return Array.from({ length: count }, (_, index) => (index * 360) / count);
266
266
  }
267
267
 
268
- // ── segmentos y curvas ─────────────────────────────────────────────────────
268
+ // ── segments and curves ────────────────────────────────────────────────────
269
269
 
270
270
  export interface SegmentBox {
271
271
  left: number;
272
272
  top: number;
273
273
  width: number;
274
274
  height: number;
275
- /** Grados para `transform: [{ rotate }]`. */
275
+ /** Degrees for `transform: [{ rotate }]`. */
276
276
  rotate: number;
277
277
  }
278
278
 
279
279
  /**
280
- * Caja de un segmento a→b: sin SVG, una línea es un rectángulo fino rotado
281
- * sobre su centro. Ancho = distancia, alto = grosor, rotación = la pendiente.
280
+ * Box of a segment a→b: without SVG, a line is a thin rectangle rotated
281
+ * around its center. Width = distance, height = thickness, rotation = the slope.
282
282
  */
283
283
  export function segmentBox(a: Point, b: Point, thickness: number): SegmentBox {
284
284
  const dx = b.x - a.x;
@@ -294,17 +294,17 @@ export function segmentBox(a: Point, b: Point, thickness: number): SegmentBox {
294
294
  }
295
295
 
296
296
  /**
297
- * Suaviza una polilínea con Catmull-Rom muestreada en `steps` tramos por vano.
298
- * La curva pasa por todos los puntos originales (a diferencia de un Bézier de
299
- * control libre), así que el dato sigue siendo el dato; sólo se agrega camino
300
- * entre medio, y el resultado se dibuja con los mismos segmentos rectos.
297
+ * Smooths a polyline with Catmull-Rom sampled in `steps` segments per span.
298
+ * The curve passes through all the original points (unlike a free-control
299
+ * Bézier), so the data is still the data; only path is added in between, and
300
+ * the result is drawn with the same straight segments.
301
301
  */
302
302
  export function smoothPoints(points: Point[], steps = 8): Point[] {
303
303
  if (points.length < 3 || steps < 2) return points;
304
304
  const out: Point[] = [points[0]!];
305
305
  for (let i = 0; i < points.length - 1; i += 1) {
306
- // Los extremos se duplican para que el primer y el último vano tengan
307
- // las cuatro referencias que pide la spline.
306
+ // The endpoints are duplicated so the first and last spans have the
307
+ // four references the spline asks for.
308
308
  const p0 = points[i - 1] ?? points[i]!;
309
309
  const p1 = points[i]!;
310
310
  const p2 = points[i + 1]!;
@@ -323,8 +323,8 @@ export function smoothPoints(points: Point[], steps = 8): Point[] {
323
323
  }
324
324
 
325
325
  /**
326
- * `y` de la polilínea en esa `x`, o null si cae fuera. Es lo que convierte una
327
- * línea en área: cada tira vertical pregunta su alto acá.
326
+ * The polyline's `y` at that `x`, or null if it falls outside. It is what
327
+ * turns a line into an area: each vertical strip asks for its height here.
328
328
  */
329
329
  export function sampleY(points: Point[], x: number): number | null {
330
330
  if (points.length === 0) return null;
@@ -340,14 +340,14 @@ export function sampleY(points: Point[], x: number): number | null {
340
340
  return null;
341
341
  }
342
342
 
343
- // ── formato ────────────────────────────────────────────────────────────────
343
+ // ── formatting ─────────────────────────────────────────────────────────────
344
344
 
345
345
  const UNITS = ['', 'k', 'M', 'B'];
346
346
 
347
347
  /**
348
- * Formato por defecto de ejes y tooltip: compacto, porque un eje de un chart
349
- * de 320px no tiene lugar para "1250000". El consumidor lo reemplaza entero
350
- * con `formatValue`.
348
+ * Default format for axes and tooltip: compact, because the axis of a 320px
349
+ * chart has no room for "1250000". The consumer replaces it entirely with
350
+ * `formatValue`.
351
351
  */
352
352
  export function formatNumber(value: number): string {
353
353
  if (!Number.isFinite(value)) return '';
@@ -369,12 +369,12 @@ export interface FanStrip {
369
369
  }
370
370
 
371
371
  /**
372
- * Descompone un polígono alrededor de un centro en porciones angulares: es lo
373
- * que permite rellenar un radar con la misma primitiva que dibuja una torta.
372
+ * Breaks a polygon around a center into angular slices: it is what lets a
373
+ * radar be filled with the same primitive that draws a pie.
374
374
  *
375
- * El corte va por el lado del polígono (parámetro `t`), no por el ángulo: el
376
- * radio de una cuerda no es lineal en el ángulo, y cortando por ángulo los
377
- * vértices quedarían redondeados justo donde el dato manda que haya una punta.
375
+ * The cut goes along the polygon's side (parameter `t`), not by angle: the
376
+ * radius of a chord isn't linear in the angle, and cutting by angle would
377
+ * round off the vertices exactly where the data says there should be a point.
378
378
  */
379
379
  export function fanStrips(center: Point, points: Point[], steps = 6): FanStrip[] {
380
380
  if (points.length < 3 || steps < 1) return [];
@@ -390,14 +390,14 @@ export function fanStrips(center: Point, points: Point[], steps = 6): FanStrip[]
390
390
  const t = s / steps;
391
391
  const point = { x: a.x + (b.x - a.x) * t, y: a.y + (b.y - a.y) * t };
392
392
  const angle = angleOf(center, point);
393
- // El salto de 360 a 0 cae en algún lado del recorrido: sin esto, esa
394
- // porción se dibujaría girando al revés y taparía todo el resto.
393
+ // The jump from 360 to 0 falls somewhere along the path: without this,
394
+ // that slice would be drawn turning backwards and cover everything else.
395
395
  let sweep = angle - previousAngle;
396
396
  if (sweep < 0) sweep += 360;
397
397
  if (sweep > 0) {
398
398
  const radius = (Math.hypot(previous.x - center.x, previous.y - center.y) + Math.hypot(point.x - center.x, point.y - center.y)) / 2;
399
- // Las porciones se solapan un pelo a propósito: sin el solape, el
400
- // antialias deja una costura clara entre tira y tira.
399
+ // The slices overlap a hair on purpose: without the overlap, the
400
+ // antialias leaves a light seam between strips.
401
401
  strips.push({ start: previousAngle, sweep: sweep + 0.4, radius });
402
402
  }
403
403
  previous = point;
@@ -407,23 +407,22 @@ export function fanStrips(center: Point, points: Point[], steps = 6): FanStrip[]
407
407
  return strips;
408
408
  }
409
409
 
410
- // ── diezmado ───────────────────────────────────────────────────────────────
410
+ // ── decimation ─────────────────────────────────────────────────────────────
411
411
 
412
412
  /**
413
- * LTTB (Largest-Triangle-Three-Buckets): elige `threshold` puntos de `values`
414
- * quedándose con la forma de la curva. Devuelve índices, no puntos, para que
415
- * quien llama pueda conservar la fila entera —todas sus series— y no sólo la
416
- * que se usó para decidir.
413
+ * LTTB (Largest-Triangle-Three-Buckets): picks `threshold` points from
414
+ * `values` while keeping the shape of the curve. Returns indexes, not points,
415
+ * so the caller can keep the whole row —all its series— and not only the one
416
+ * used to decide.
417
417
  *
418
- * Por qué no un muestreo cada N: cada N se come los picos, que son justo lo
419
- * que alguien mira en una serie temporal. LTTB parte el recorrido en baldes y
420
- * de cada uno se queda con el punto que forma el triángulo más grande con el
421
- * ya elegido y con el promedio del balde siguiente — o sea, con el que más
422
- * cambia la silueta. Primero y último se conservan siempre.
418
+ * Why not sample every N: every N eats the peaks, which are exactly what
419
+ * someone looks at in a time series. LTTB splits the path into buckets and
420
+ * from each one keeps the point that forms the largest triangle with the one
421
+ * already picked and with the average of the next bucket — that is, the one
422
+ * that changes the silhouette the most. First and last are always kept.
423
423
  *
424
- * `x` es el índice: las categorías de un chart están repartidas parejo sobre
425
- * el eje, así que la distancia horizontal entre dos puntos es su distancia de
426
- * índice.
424
+ * `x` is the index: a chart's categories are spread evenly along the axis, so
425
+ * the horizontal distance between two points is their index distance.
427
426
  */
428
427
  export function lttbIndices(values: (number | null)[], threshold: number): number[] {
429
428
  const total = values.length;
@@ -431,16 +430,16 @@ export function lttbIndices(values: (number | null)[], threshold: number): numbe
431
430
 
432
431
  const at = (index: number) => values[index] ?? 0;
433
432
  const selected = [0];
434
- // Un balde por punto intermedio: el primero y el último no se sortean. Con
435
- // `threshold < total` el balde mide más de un punto, así que ninguno queda
436
- // vacío y salen exactamente `threshold` índices, sin repetidos.
433
+ // One bucket per intermediate point: the first and the last aren't drawn.
434
+ // With `threshold < total` a bucket spans more than one point, so none is
435
+ // empty and exactly `threshold` indexes come out, with no repeats.
437
436
  const every = (total - 2) / (threshold - 2);
438
437
  let previous = 0;
439
438
 
440
439
  for (let bucket = 0; bucket < threshold - 2; bucket += 1) {
441
- // Promedio del balde *siguiente*: el tercer vértice del triángulo. Va
442
- // corrido un balde respecto de los candidatos, y ese corrimiento es el
443
- // algoritmo — comparar contra el propio balde no mira hacia adelante.
440
+ // Average of the *next* bucket: the triangle's third vertex. It is
441
+ // offset one bucket from the candidates, and that offset is the
442
+ // algorithm — comparing against the bucket itself doesn't look ahead.
444
443
  const avgStart = Math.floor((bucket + 1) * every) + 1;
445
444
  const avgEnd = Math.min(Math.floor((bucket + 2) * every) + 1, total);
446
445
  let avgX = 0;
@@ -1,42 +1,42 @@
1
1
  /**
2
- * Paleta categórica de Chart, derivada del theme.
2
+ * Chart's categorical palette, derived from the theme.
3
3
  *
4
- * No hay una lista de colores acá a propósito: si la hubiera, un `brand`
5
- * personalizado daría un chart que no se parece al resto de la app, y el modo
6
- * oscuro tendría que mantenerse a mano. Las primeras series reusan los acentos
7
- * del theme (que ya vienen con el contraste resuelto para su scheme) y, cuando
8
- * se acaban, se sigue rotando el tono del primario por el ángulo áureo: la
9
- * secuencia 137.5° es la que más tarda en repetir un tono parecido, que es
10
- * exactamente lo que se le pide a una paleta categórica.
4
+ * There is deliberately no list of colors here: if there were, a custom
5
+ * `brand` would produce a chart that doesn't look like the rest of the app,
6
+ * and dark mode would have to be maintained by hand. The first series reuse
7
+ * the theme's accents (which already come with contrast resolved for their
8
+ * scheme) and, when they run out, the primary's hue keeps rotating by the
9
+ * golden angle: the 137.5° sequence is the one that takes longest to repeat
10
+ * a similar hue, which is exactly what you ask of a categorical palette.
11
11
  *
12
- * Cada color se verifica contra `surface` a 3:1 — el mínimo de WCAG 1.4.11
13
- * para objetos gráficos, que es lo que es una barra — y se aclara u oscurece
14
- * hasta cumplirlo.
12
+ * Each color is checked against `surface` at 3:1 — the WCAG 1.4.11 minimum
13
+ * for graphical objects, which is what a bar is — and lightened or darkened
14
+ * until it meets it.
15
15
  */
16
16
  import { contrast, toHex, toHsl } from '../../theme/colors';
17
17
  import type { Theme } from '../../theme/types';
18
18
 
19
- /** Contraste mínimo de un objeto gráfico contra su fondo (WCAG 1.4.11). */
19
+ /** Minimum contrast of a graphical object against its background (WCAG 1.4.11). */
20
20
  export const GRAPHIC_CONTRAST = 3;
21
21
 
22
22
  const GOLDEN_ANGLE = 137.508;
23
23
 
24
- /** Acentos del theme en orden de aparición: tonos bien separados entre sí. */
24
+ /** Theme accents in order of appearance: hues well apart from one another. */
25
25
  function seeds(theme: Theme): string[] {
26
26
  const { primary, secondary, warning, success, error } = theme.colors;
27
27
  return [primary, secondary, warning, success, error];
28
28
  }
29
29
 
30
30
  /**
31
- * Empuja la luminosidad hasta despegar del fondo. El paso es chico y el tope
32
- * bajo porque el objetivo es corregir un color, no inventar otro: si en 12
33
- * intentos no llegó, se devuelve lo mejor que se consiguió.
31
+ * Pushes the lightness until it stands off the background. The step is small
32
+ * and the cap low because the goal is to correct a color, not invent another:
33
+ * if it didn't get there in 12 tries, the best achieved is returned.
34
34
  */
35
35
  function readable(hex: string, surface: string): string {
36
36
  if (contrast(hex, surface) >= GRAPHIC_CONTRAST) return hex;
37
37
 
38
38
  const hsl = toHsl(hex);
39
- // Sobre un fondo claro hay que oscurecer, sobre uno oscuro aclarar.
39
+ // Over a light background you have to darken, over a dark one lighten.
40
40
  const direction = toHsl(surface).l > 0.5 ? -1 : 1;
41
41
  let best = hex;
42
42
  let bestContrast = contrast(hex, surface);
@@ -63,9 +63,9 @@ function buildUnsafe(theme: Theme, count: number): string[] {
63
63
  out.push(readable(base[index]!, surface));
64
64
  continue;
65
65
  }
66
- // Pasados los acentos, se gira el tono del primario. `l` alterna un
67
- // escalón por vuelta para que dos tonos vecinos no se confundan si la
68
- // rotación los acerca.
66
+ // Once past the accents, the primary's hue is rotated. `l` alternates one
67
+ // step per turn so two neighboring hues aren't confused if the rotation
68
+ // brings them close.
69
69
  const seed = toHsl(base[0]!);
70
70
  const turn = index - base.length + 1;
71
71
  out.push(
@@ -83,10 +83,10 @@ function buildUnsafe(theme: Theme, count: number): string[] {
83
83
  }
84
84
 
85
85
  /**
86
- * Los helpers de color hablan hex. Un theme con un acento en `rgba()` es
87
- * legal para React Native y hace que `toHsl` tire: en ese caso se cae a los
88
- * acentos tal cual vinieron, ciclando. Un chart con colores repetidos es peor
89
- * que uno con colores derivados, pero muchísimo mejor que uno que no renderiza.
86
+ * The color helpers speak hex. A theme with an accent in `rgba()` is legal
87
+ * for React Native and makes `toHsl` throw: in that case it falls back to the
88
+ * accents as they came, cycling. A chart with repeated colors is worse than
89
+ * one with derived colors, but far better than one that doesn't render.
90
90
  */
91
91
  function build(theme: Theme, count: number): string[] {
92
92
  try {
@@ -97,12 +97,12 @@ function build(theme: Theme, count: number): string[] {
97
97
  }
98
98
  }
99
99
 
100
- // Una paleta por theme, y por theme el arreglo más largo pedido hasta ahora:
101
- // la cache se comparte entre todos los charts montados, que es el caso normal
102
- // (un dashboard con seis charts sobre el mismo theme).
100
+ // One palette per theme, and per theme the longest array requested so far:
101
+ // the cache is shared among all mounted charts, which is the normal case
102
+ // (a dashboard with six charts on the same theme).
103
103
  const cache = new WeakMap<Theme, string[]>();
104
104
 
105
- /** `count` colores estables para las series: el mismo índice da siempre el mismo color. */
105
+ /** `count` stable colors for the series: the same index always gives the same color. */
106
106
  export function seriesPalette(theme: Theme, count: number): string[] {
107
107
  const cached = cache.get(theme);
108
108
  if (cached && cached.length >= count) return cached.slice(0, count);
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Puente entre el proveedor montado y el código que no es un componente
3
- * (servicios, capa de API, interceptores). El proveedor se registra al montar y
4
- * se borra al desmontar, así que fuera del árbol nunca queda una referencia
5
- * viva a un contexto muerto.
2
+ * Bridge between the mounted provider and code that isn't a component
3
+ * (services, API layer, interceptors). The provider registers itself on mount
4
+ * and clears itself on unmount, so outside the tree there is never a live
5
+ * reference left to a dead context.
6
6
  */
7
7
  export interface ImperativeBridge<T> {
8
8
  set: (value: T | null) => void;
@@ -19,7 +19,7 @@ export function createImperativeBridge<T>(providerName: string): ImperativeBridg
19
19
  get: () => {
20
20
  if (!current && __DEV__) {
21
21
  console.warn(
22
- `orn-ui: se llamó a la API imperativa sin un <${providerName}> montado. La llamada se ignoró.`
22
+ `orn-ui: the imperative API was called without a mounted <${providerName}>. The call was ignored.`
23
23
  );
24
24
  }
25
25
  return current;