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
@@ -11,7 +11,7 @@ import {
11
11
  type ViewStyle,
12
12
  } from 'react-native';
13
13
  import { createStyles } from '../theme/createStyles';
14
- import { useAllowFontScaling, useColors, useTheme } from '../theme/UIProvider';
14
+ import { useAllowFontScaling, useColors, useLabels, useTheme } from '../theme/UIProvider';
15
15
  import { useReduceMotion } from '../atoms/Transition';
16
16
  import { Gradient, type GradientDirection } from '../atoms/Gradient';
17
17
  import { useSlides, type SlidesOrientation } from './useSlides';
@@ -20,53 +20,59 @@ export type { SlidesOrientation } from './useSlides';
20
20
  export type SlidesIndicators = 'dots' | 'numbers' | 'none';
21
21
  export type SlidesIndicatorPlacement = 'overlay' | 'outside';
22
22
 
23
- /** Un color sólido, o dos o más para un degradado (ver `Gradient`). */
23
+ /** A solid color, or two or more for a gradient (see `Gradient`). */
24
24
  export type SlideBackground = string | string[];
25
25
 
26
26
  export interface SlidesProps<T> {
27
+ /** One item per slide. */
27
28
  data: T[];
29
+ /** Stable key per item. */
28
30
  keyExtractor: (item: T, index: number) => string;
29
- /** Contenido de la slide: imágenes, botones, lo que sea. Se dibuja sobre `background`. */
31
+ /** Slide content: images, buttons, anything. Drawn on top of `background`. */
30
32
  renderItem: (item: T, index: number) => React.ReactNode;
31
- /** Fondo por slide: `'#101014'` pinta plano, `['#004cef', '#00cae1']` degrada. */
33
+ /** Per-slide background: `'#101014'` paints flat, `['#004cef', '#00cae1']` paints a gradient. */
32
34
  background?: (item: T, index: number) => SlideBackground | undefined;
33
- /** Dirección del degradado cuando `background` devuelve varios colores. @default 'vertical' */
35
+ /** Gradient direction when `background` returns several colors. @default 'vertical' */
34
36
  gradientDirection?: GradientDirection;
35
- /** @default 'horizontal' */
37
+ /** Direction of the swipe. @default 'horizontal' */
36
38
  orientation?: SlidesOrientation;
37
- /** Círculos, círculos numerados, o ninguno. @default 'dots' */
39
+ /** Dots, numbered dots, or none. @default 'dots' */
38
40
  indicators?: SlidesIndicators;
39
41
  /**
40
- * 'overlay' los apoya sobre la slide, en blanco; 'outside' los saca fuera
41
- * del área deslizable, con los colores del tema.
42
+ * 'overlay' places them on the slide, in white; 'outside' moves them out of
43
+ * the swipeable area, in theme colors.
42
44
  * @default 'overlay'
43
45
  */
44
46
  indicatorPlacement?: SlidesIndicatorPlacement;
45
- /** Después de la última vuelve a la primera (y al revés). @default false */
47
+ /** After the last slide, wraps to the first (and vice versa). @default false */
46
48
  loop?: boolean;
47
- /** Avanza solo. Se pausa mientras el dedo arrastra. @default false */
49
+ /** Advances automatically. Pauses while a finger is dragging. @default false */
48
50
  autoPlay?: boolean;
49
- /** ms entre avances de `autoPlay`. @default 4000 */
51
+ /** Milliseconds between `autoPlay` advances. @default 4000 */
50
52
  interval?: number;
51
53
  /**
52
- * Botón para frenar el avance automático. Sólo aparece con `autoPlay`, y va
53
- * en `true` porque contenido que se mueve solo necesita una forma de
54
- * pausarlo (WCAG 2.2.2).
54
+ * Button that pauses auto-advance. Only shown with `autoPlay`; on by default
55
+ * because content that moves on its own needs a way to pause it
56
+ * (WCAG 2.2.2).
55
57
  * @default true
56
58
  */
57
59
  showAutoPlayToggle?: boolean;
58
- /** Hueco entre slides, en px. En 0 quedan pegadas. @default 0 */
60
+ /** Gap between slides, in px. At 0 they touch. @default 0 */
59
61
  spacing?: number;
60
- /** Índice controlado. Sin él, el componente maneja el suyo desde `defaultIndex`. */
62
+ /** Controlled index. Without it, the component manages its own from `defaultIndex`. */
61
63
  index?: number;
62
- /** @default 0 */
64
+ /** Starting slide when the index is uncontrolled. @default 0 */
63
65
  defaultIndex?: number;
66
+ /** Called with the new index when the active slide changes. */
64
67
  onIndexChange?: (index: number) => void;
65
- /** Alto del área deslizable. @default 240 */
68
+ /** Height of the swipeable area. @default 240 */
66
69
  height?: number;
67
- /** @default true */
70
+ /**
71
+ * Lets the user swipe between slides. When false, they change only through the indicators,
72
+ * `autoPlay` or `index`. @default true
73
+ */
68
74
  swipeEnabled?: boolean;
69
- /** Estilos de la caja visible de cada slide — padding, alineación, radio. */
75
+ /** Styles for each slide's visible box — padding, alignment, radius. */
70
76
  slideStyle?: StyleProp<ViewStyle>;
71
77
  style?: StyleProp<ViewStyle>;
72
78
  testID?: string;
@@ -80,15 +86,15 @@ const DEFAULT_HEIGHT = 240;
80
86
  const DEFAULT_INTERVAL = 4000;
81
87
 
82
88
  const useStyles = createStyles((theme) => ({
83
- // Deja redondear el bloque por `style` sin que el degradado se salga.
89
+ // Lets the block be rounded via `style` without the gradient spilling out.
84
90
  root: { overflow: 'hidden' },
85
91
  viewport: { flex: 1 },
86
- // La slide visible es la caja de adentro: con `spacing` la página es más
87
- // ancha que ella, y el fondo tiene que recortarse acá y no en la página, o
88
- // el degradado pinta también el hueco.
92
+ // The visible slide is the inner box: with `spacing` the page is wider
93
+ // than it, and the background has to be clipped here and not on the page, or
94
+ // the gradient paints the gap too.
89
95
  slide: { flex: 1, overflow: 'hidden' },
90
- // Con indicadores fuera y orientación vertical el contenedor es una fila:
91
- // sin flex la ventana no tiene ancho propio y colapsa a 0.
96
+ // With indicators outside and vertical orientation the container is a row:
97
+ // without flex the window has no width of its own and collapses to 0.
92
98
  viewportInRow: { flex: 1 },
93
99
  slideContent: { flex: 1 },
94
100
 
@@ -115,7 +121,7 @@ const useStyles = createStyles((theme) => ({
115
121
  gap: 3,
116
122
  },
117
123
  pauseBar: { width: 3, height: 12, borderRadius: 1 },
118
- // Triángulo con bordes: un "play" sin SVG ni set de íconos.
124
+ // Triangle made of borders: a "play" without SVG or an icon set.
119
125
  playTriangle: {
120
126
  width: 0,
121
127
  height: 0,
@@ -145,7 +151,7 @@ const useStyles = createStyles((theme) => ({
145
151
  interface DotProps {
146
152
  selected: boolean;
147
153
  isHorizontal: boolean;
148
- /** En overlay el contraste lo da la opacidad; afuera, el color. */
154
+ /** In overlay the contrast comes from opacity; outside, from color. */
149
155
  overlay: boolean;
150
156
  activeColor: string;
151
157
  inactiveColor: string;
@@ -153,9 +159,9 @@ interface DotProps {
153
159
  }
154
160
 
155
161
  /**
156
- * El punto activo se estira en vez de saltar: el cambio de golpe se lee como
157
- * "apareció otro punto", no como "el mismo se movió". Ancho y color son props
158
- * de layout/pintura, así que van por el driver de JS.
162
+ * The active dot stretches instead of jumping: an abrupt change reads as
163
+ * "another dot appeared", not as "the same one moved". Width and color are
164
+ * layout/paint props, so they go through the JS driver.
159
165
  */
160
166
  const Dot = memo(({ selected, isHorizontal, overlay, activeColor, inactiveColor, testID }: DotProps) => {
161
167
  const styles = useStyles();
@@ -191,13 +197,25 @@ Dot.displayName = 'SlidesDot';
191
197
 
192
198
  /**
193
199
  * Slides
194
- * Carrusel con fondo propio (color plano o degradado) y contenido libre:
195
- * `renderItem` decide si adentro va una imagen, texto o botones. El estado
196
- * vive en `useSlides`; acá sólo está el árbol.
200
+ * Carousel with its own background (flat color or gradient) and free-form
201
+ * content: `renderItem` decides whether an image, text or buttons go inside.
202
+ * The state lives in `useSlides`; only the tree is here.
203
+ *
204
+ * Sliding is a `ScrollView` with `pagingEnabled` instead of hand-made
205
+ * gestures: it is the only thing that gives native snapping on iOS and
206
+ * Android without `react-native-gesture-handler`, across the whole supported
207
+ * range of Expo SDKs.
197
208
  *
198
- * El deslizamiento es un `ScrollView` con `pagingEnabled` en vez de gestos a
199
- * mano: es lo único que da snap nativo en iOS y Android sin
200
- * `react-native-gesture-handler`, en todo el rango soportado (Expo SDK 54–57).
209
+ * Design:
210
+ * - Jakob's law: native paging swipe and dots under the slide, like the
211
+ * system's own onboarding carousels.
212
+ * - Similarity + Von Restorff: every indicator looks the same except the
213
+ * current one.
214
+ * - Continuity: the slides slide (a jump with Reduce Motion, and autoPlay
215
+ * stops); infinite mode clones the edges so the swipe never rewinds.
216
+ * - Fitts's law: indicators have padding around the dot as touch area.
217
+ * - Screen readers: each indicator is "Slide n of total" (`labels.slideOf`),
218
+ * and autoPlay can be paused from its own button.
201
219
  */
202
220
  export function Slides<T>({
203
221
  data,
@@ -223,6 +241,7 @@ export function Slides<T>({
223
241
  testID,
224
242
  }: SlidesProps<T>) {
225
243
  const colors = useColors();
244
+ const labels = useLabels();
226
245
  const styles = useStyles();
227
246
  const allowFontScaling = useAllowFontScaling();
228
247
 
@@ -296,7 +315,7 @@ export function Slides<T>({
296
315
  );
297
316
  };
298
317
 
299
- // Con reduce-motion el autoPlay ya está apagado: no hay nada que pausar.
318
+ // With reduce-motion autoPlay is already off: there is nothing to pause.
300
319
  const renderAutoPlayToggle = () => {
301
320
  if (!autoPlay || !showAutoPlayToggle || motionReduced || total < 2) return null;
302
321
  return (
@@ -306,7 +325,7 @@ export function Slides<T>({
306
325
  activeOpacity={0.7}
307
326
  onPress={toggleAutoPlay}
308
327
  accessibilityRole="button"
309
- accessibilityLabel={autoPlayPaused ? 'Resume automatic slides' : 'Pause automatic slides'}
328
+ accessibilityLabel={autoPlayPaused ? labels.resumeSlides : labels.pauseSlides}
310
329
  accessibilityState={{ selected: !autoPlayPaused }}
311
330
  >
312
331
  {autoPlayPaused ? (
@@ -346,7 +365,7 @@ export function Slides<T>({
346
365
  activeOpacity={0.7}
347
366
  onPress={() => goTo(position)}
348
367
  accessibilityRole="button"
349
- accessibilityLabel={`Slide ${position + 1} of ${total}`}
368
+ accessibilityLabel={labels.slideOf.replace('{n}', String(position + 1)).replace('{total}', String(total))}
350
369
  accessibilityState={{ selected: position === active }}
351
370
  >
352
371
  {renderIndicator(position)}
@@ -379,9 +398,9 @@ export function Slides<T>({
379
398
  pages.map(({ real, clone }) => {
380
399
  const item = data[real] as T;
381
400
  return (
382
- // El hueco se reparte a los dos lados de cada página: así la
383
- // separación entre dos slides es `spacing` entero y la página
384
- // sigue midiendo exactamente lo que pagina el ScrollView.
401
+ // The gap is split on both sides of each page: that way the
402
+ // separation between two slides is a full `spacing` and the page
403
+ // still measures exactly what the ScrollView pages by.
385
404
  <View
386
405
  key={clone ? `slides-clone-${clone}` : keyExtractor(item, real)}
387
406
  style={[
@@ -1,29 +1,38 @@
1
1
  import React, { memo, useMemo } from 'react';
2
2
  import { type StyleProp, type ViewStyle } from 'react-native';
3
- import { useThemeMode, type ThemeMode } from '../theme/UIProvider';
3
+ import { useLabels, useThemeMode, type ThemeMode } from '../theme/UIProvider';
4
4
  import { SegmentedControl } from '../molecules/SegmentedControl';
5
5
 
6
6
  export interface ThemeToggleProps {
7
7
  style?: StyleProp<ViewStyle>;
8
+ /** Text of each segment; any mode left out keeps its default (`labels.themeSystem`, `themeLight`, `themeDark`). */
8
9
  labels?: Partial<Record<ThemeMode, string>>;
9
10
  testID?: string;
10
11
  }
11
12
 
12
13
  const MODES: ThemeMode[] = ['system', 'light', 'dark'];
13
- const DEFAULT_LABELS: Record<ThemeMode, string> = { system: 'Auto', light: 'Light', dark: 'Dark' };
14
14
 
15
15
  /**
16
16
  * ThemeToggle
17
- * Conecta un SegmentedControl con UIProvider.setMode. Sin persistencia — el
18
- * consumidor la resuelve vía onModeChange en <UIProvider>.
17
+ * Connects a SegmentedControl to UIProvider.setMode. No persistence — the
18
+ * consumer handles it via onModeChange on <UIProvider>.
19
+ *
20
+ * Design: Jakob's law — the same Auto / Light / Dark choice as the system
21
+ * settings, in that order; Hick's law — three options, nothing to configure.
19
22
  */
20
23
  export const ThemeToggle = memo(({ style, labels: labelOverrides, testID }: ThemeToggleProps) => {
21
24
  const { mode, setMode } = useThemeMode();
25
+ const providerLabels = useLabels();
22
26
 
23
27
  const options = useMemo(() => {
24
- const labels = { ...DEFAULT_LABELS, ...labelOverrides };
28
+ const labels: Record<ThemeMode, string> = {
29
+ system: providerLabels.themeSystem,
30
+ light: providerLabels.themeLight,
31
+ dark: providerLabels.themeDark,
32
+ ...labelOverrides,
33
+ };
25
34
  return MODES.map((value) => ({ value, label: labels[value] }));
26
- }, [labelOverrides]);
35
+ }, [labelOverrides, providerLabels]);
27
36
 
28
37
  return <SegmentedControl options={options} value={mode} onChange={setMode} style={style} testID={testID} />;
29
38
  });
@@ -10,15 +10,15 @@ import type { IconName } from '../icons/types';
10
10
  export type TimelineStatus = 'done' | 'pending';
11
11
 
12
12
  /**
13
- * Qué puede hacer un toque.
14
- * - 'free': cualquier hito responde y la línea sigue a `items` para donde
15
- * vaya, adelante o atrás. Es el que sirve cuando el recorrido no es un
16
- * progreso, o cuando lo maneja otra cosa.
17
- * - 'sequential': sólo responde el que sigue al alcanzado, y la línea no
18
- * retrocede nunca. Avance estricto.
19
- * - 'revisit': responden el que sigue y todos los ya alcanzados, y la línea
20
- * tampoco retrocede. Es el caso de "puedo volver a mirar lo anterior sin
21
- * perder lo que llevo".
13
+ * What a tap can do.
14
+ * - 'free': any milestone responds and the line follows `items` wherever it
15
+ * goes, forward or back. It is the one to use when the path isn't
16
+ * progress, or when something else drives it.
17
+ * - 'sequential': only the one after the reached milestone responds, and the
18
+ * line never goes back. Strict progression.
19
+ * - 'revisit': the next one and all those already reached respond, and the
20
+ * line doesn't go back either. It is the "I can look at what came before
21
+ * without losing my progress" case.
22
22
  */
23
23
  export type TimelineAdvance = 'free' | 'sequential' | 'revisit';
24
24
 
@@ -33,6 +33,7 @@ export interface TimelineItem {
33
33
  }
34
34
 
35
35
  export interface TimelineProps {
36
+ /** The milestones, in order. Each has a label, optionally an icon or emoji, and its status. */
36
37
  items: TimelineItem[];
37
38
  /** Pixels the line bows away from the straight path. 0 draws it straight. @default 28 */
38
39
  curve?: number;
@@ -71,24 +72,24 @@ const DEFAULT_CURVE = 28;
71
72
  const DEFAULT_SPACING = 84;
72
73
  const NODE = 14;
73
74
  const LINE = 2;
74
- /** Tramos rectos por cada vano: con menos, la curva se ve poligonal. */
75
+ /** Straight segments per span: with fewer, the curve looks polygonal. */
75
76
  const SEGMENTS = 14;
76
77
  const DOT = 3;
77
- /** Un punto cada cuántos tramos: el camino entero va punteado por debajo. */
78
+ /** One dot every how many segments: the whole path is dotted underneath. */
78
79
  const DOT_EVERY = 2;
79
80
  const DEFAULT_DURATION = 420;
80
81
  /**
81
- * Cuánto tarda un tramo en encenderse, medido en hitos. Chico para que el
82
- * frente de la línea se lea como un borde y no como un degradado largo.
82
+ * How long a segment takes to light up, measured in milestones. Small so the
83
+ * front of the line reads as an edge and not as a long gradient.
83
84
  */
84
85
  const FADE = 0.06;
85
86
  /**
86
- * Capas del halo, de afuera hacia adentro. Son muchas y muy tenues a
87
- * propósito: con tres capas se ven los anillos, que es justo lo contrario de
88
- * un difuminado. Cuantos más escalones y más chico el salto de opacidad, más
89
- * cerca queda de un degradado.
87
+ * Halo layers, from the outside in. There are many and very faint on
88
+ * purpose: with three layers you see the rings, which is exactly the opposite
89
+ * of a blur. The more steps and the smaller the opacity jump, the closer it
90
+ * gets to a gradient.
90
91
  */
91
- /** Lo que el halo sobresale de la píldora: es lo que hay que dejarle de aire. */
92
+ /** How far the halo sticks out of the pill: that is the room it needs. */
92
93
  const GLOW_BLEED = 20;
93
94
  const GLOW_LAYERS = [
94
95
  { inset: -GLOW_BLEED, opacity: 0.03 },
@@ -113,7 +114,7 @@ const useStyles = createStyles((theme) => ({
113
114
  borderWidth: LINE,
114
115
  },
115
116
  nodePending: { backgroundColor: 'transparent', borderColor: theme.colors.border },
116
- // Ocupa el círculo entero menos el borde, así el relleno no lo tapa.
117
+ // Takes the whole circle minus the border, so the fill doesn't cover it.
117
118
  nodeFill: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, borderRadius: NODE / 2 },
118
119
  pill: {
119
120
  flexDirection: 'row',
@@ -124,10 +125,10 @@ const useStyles = createStyles((theme) => ({
124
125
  borderRadius: theme.tokens.radius.full,
125
126
  borderWidth: 1,
126
127
  borderColor: theme.colors.border,
127
- backgroundColor: theme.colors.surface,
128
+ backgroundColor: theme.colors.surfaceRaised,
128
129
  },
129
- // El foco se marca con el borde, no con el relleno: el relleno ya está
130
- // diciendo otra cosa (si el hito está alcanzado o no).
130
+ // Focus is marked with the border, not the fill: the fill is already
131
+ // saying something else (whether the milestone has been reached or not).
131
132
  pillSelected: { borderColor: theme.colors.primary, borderWidth: 2 },
132
133
  label: { fontSize: theme.tokens.fontSize.md, color: theme.colors.text },
133
134
  labelPending: { color: theme.colors.textLight },
@@ -137,29 +138,45 @@ const useStyles = createStyles((theme) => ({
137
138
  borderRadius: theme.tokens.radius.full,
138
139
  backgroundColor: theme.colors.text,
139
140
  },
140
- // La línea y los nodos viven en la misma capa y se posicionan con las mismas
141
- // coordenadas. Es lo único que garantiza que el círculo caiga sobre la
142
- // curva: en el flujo de la fila el nodo lo corre el flex —y los paddings que
143
- // cada lado necesita para no cortar su píldora—, así que terminaba a un
144
- // costado de la línea en vez de encima.
141
+ // The line and the nodes live in the same layer and are positioned with the
142
+ // same coordinates. It is the only thing that guarantees the circle lands on
143
+ // the curve: in the row's flow the node gets shifted by flex —and by the
144
+ // paddings each side needs so its pill isn't clipped—, so it ended up to one
145
+ // side of the line instead of on top of it.
145
146
  lineLayer: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, alignItems: 'center' },
146
- // Hueco del ancho del nodo en la fila: la píldora se separa del centro lo
147
- // mismo que antes, pero el círculo ya no se dibuja acá.
147
+ // Gap the width of the node in the row: the pill is set apart from the
148
+ // center the same as before, but the circle is no longer drawn here.
148
149
  nodeSlot: { width: NODE },
149
150
  segment: { position: 'absolute', width: LINE },
150
151
  dot: { position: 'absolute', width: DOT, height: DOT, borderRadius: DOT / 2 },
151
152
  }));
152
153
 
153
154
  /**
154
- * Desvío horizontal del nodo `index` respecto del eje. Una onda entera a lo
155
- * largo de la lista: el primero y el último caen sobre el eje, y los del medio
156
- * se van a un lado y al otro. Es lo que convierte una columna en un camino.
155
+ * Horizontal offset of node `index` from the axis. One full wave along the
156
+ * list: the first and the last fall on the axis, and the ones in the middle
157
+ * swing to one side and the other. It is what turns a column into a path.
157
158
  */
158
159
  function offsetAt(index: number, count: number, curve: number): number {
159
160
  if (count < 2) return 0;
160
161
  return curve * Math.sin((2 * Math.PI * index) / (count - 1));
161
162
  }
162
163
 
164
+ /**
165
+ * Timeline
166
+ * Milestones on a path: a line that bows from one to the next and fills up to
167
+ * the last one reached, with each label in a pill on alternating sides.
168
+ *
169
+ * Design:
170
+ * - Continuity (Gestalt): one curved line joins the milestones, so they read
171
+ * as a single path; the reached part of it is filled.
172
+ * - Similarity + figure/ground: reached and pending milestones differ only by
173
+ * fill, so status reads at a glance.
174
+ * - Common fate: when a milestone is reached the line travels there, gap by
175
+ * gap (in place with Reduce Motion).
176
+ * - Fitts's law: with `onItemPress` the whole pill is the target.
177
+ * - Screen readers: each milestone is checked or not; with `onItemPress` it
178
+ * is a button, disabled when `advance` doesn't let it respond.
179
+ */
163
180
  export const Timeline = memo(
164
181
  ({
165
182
  items,
@@ -182,9 +199,9 @@ export const Timeline = memo(
182
199
  const count = items.length;
183
200
 
184
201
  /**
185
- * Hasta dónde llegó el recorrido, en unidades de hito. Se cuenta desde el
186
- * principio y se corta en el primer pendiente: un hito cumplido después de
187
- * uno que no lo está no adelanta la línea, porque el camino es un camino.
202
+ * How far the path has gotten, in milestone units. It is counted from the
203
+ * start and cut at the first pending one: a milestone completed after one
204
+ * that isn't doesn't move the line forward, because a path is a path.
188
205
  */
189
206
  const reached = useMemo(() => {
190
207
  let last = -1;
@@ -196,9 +213,9 @@ export const Timeline = memo(
196
213
  }, [items]);
197
214
 
198
215
  /**
199
- * Marca de agua: salvo en 'free', la línea se queda en lo más lejos que
200
- * llegó. El progreso es del usuario, no del render — que el padre mande
201
- * una lista más corta no puede desandar lo que ya recorrió.
216
+ * High-water mark: except in 'free', the line stays at the furthest point
217
+ * it reached. Progress belongs to the user, not the render — the parent
218
+ * sending a shorter list can't undo the distance already covered.
202
219
  */
203
220
  const furthest = useRef(reached);
204
221
  if (advance === 'free') furthest.current = reached;
@@ -210,8 +227,8 @@ export const Timeline = memo(
210
227
  useEffect(() => {
211
228
  const animation = Animated.timing(progress, {
212
229
  toValue: lineTo,
213
- // Un hito por `duration`: avanzar tres de una vez tarda tres veces
214
- // más, así se ve el recorrido y no un salto.
230
+ // One milestone per `duration`: advancing three at once takes three
231
+ // times longer, so you see the path and not a jump.
215
232
  duration: reduceMotion ? 0 : duration,
216
233
  easing: Easing.inOut(Easing.cubic),
217
234
  useNativeDriver: true,
@@ -221,10 +238,10 @@ export const Timeline = memo(
221
238
  }, [lineTo, duration, reduceMotion, progress]);
222
239
 
223
240
  /**
224
- * Cada vano partido en tramos rectos cortos, cada uno con su largo y su
225
- * ángulo. Es la misma idea que `Gradient`: la plataforma no tiene curvas
226
- * sin dependencia nativa, así que la curva se compone con pedazos rectos
227
- * lo bastante chicos como para que el ojo no vea el quiebre.
241
+ * Each span split into short straight segments, each with its own length
242
+ * and angle. It is the same idea as `Gradient`: the platform has no curves
243
+ * without a native dependency, so the curve is composed from straight
244
+ * pieces small enough for the eye not to see the break.
228
245
  */
229
246
  const pieces = useMemo(() => {
230
247
  const out: {
@@ -254,11 +271,11 @@ export const Timeline = memo(
254
271
  x: (x1 + x2) / 2,
255
272
  y: (y1 + y2) / 2,
256
273
  length,
257
- // El tramo se dibuja vertical y se gira hasta la pendiente: el
258
- // ángulo se mide desde el eje Y, no desde el X.
274
+ // The segment is drawn vertically and rotated to the slope: the
275
+ // angle is measured from the Y axis, not the X.
259
276
  angle: `${Math.atan2(dx, dy) * (180 / Math.PI) * -1}deg`,
260
- // Posición del tramo medida en hitos: es la misma escala que
261
- // `progress`, así que comparar una cosa con la otra es directo.
277
+ // Segment position measured in milestones: it is the same scale as
278
+ // `progress`, so comparing one with the other is direct.
262
279
  at: to,
263
280
  dotted: step % DOT_EVERY === 0,
264
281
  });
@@ -280,7 +297,7 @@ export const Timeline = memo(
280
297
  testID={testID}
281
298
  >
282
299
  <View style={styles.lineLayer} pointerEvents="none">
283
- {/* El camino entero, punteado: es lo que falta recorrer. */}
300
+ {/* The whole path, dotted: it is what is left to travel. */}
284
301
  {pieces.map(
285
302
  (piece) =>
286
303
  piece.dotted && (
@@ -298,9 +315,9 @@ export const Timeline = memo(
298
315
  )
299
316
  )}
300
317
 
301
- {/* Y encima la línea llena, que se revela tramo a tramo a medida que
302
- `progress` avanza. Lo único que cambia por frame es `opacity`, o
303
- sea que el recorrido se dibuja en el hilo nativo. */}
318
+ {/* And on top the solid line, revealed segment by segment as
319
+ `progress` advances. The only thing that changes per frame is
320
+ `opacity`, which means the path is drawn on the native thread. */}
304
321
  {pieces.map((piece) => (
305
322
  <Animated.View
306
323
  key={`line-${piece.key}`}
@@ -333,8 +350,8 @@ export const Timeline = memo(
333
350
  },
334
351
  ]}
335
352
  >
336
- {/* El relleno es un nodo aparte encima del hueco: el color no se
337
- puede animar en el hilo nativo, la opacidad sí. */}
353
+ {/* The fill is a separate node on top of the hollow: color can't
354
+ be animated on the native thread, opacity can. */}
338
355
  <Animated.View
339
356
  style={[
340
357
  styles.nodeFill,
@@ -365,10 +382,10 @@ export const Timeline = memo(
365
382
  const pending = item.status === 'pending';
366
383
  const onRight = (index % 2 === 0) === (startSide === 'right');
367
384
  const offset = offsetAt(index, count, curve);
368
- // La fila entera se corre con la curva, píldora incluida, así que el
369
- // lado hacia el que se fue pierde ese espacio contra el borde. Se lo
370
- // devolvemos como padding, más lo que sobresale el halo: sin esto la
371
- // píldora de más afuera queda cortada al ras.
385
+ // The whole row shifts with the curve, pill included, so the side it
386
+ // moved toward loses that space against the edge. We give it back as
387
+ // padding, plus what the halo sticks out: without this the outermost
388
+ // pill gets clipped flush.
372
389
  const bleed = glow ? GLOW_BLEED : 0;
373
390
  const roomLeft = Math.max(0, -offset) + bleed;
374
391
  const roomRight = Math.max(0, offset) + bleed;
@@ -409,10 +426,10 @@ export const Timeline = memo(
409
426
  </View>
410
427
  );
411
428
 
412
- // 'sequential' deja tocar sólo el que sigue; 'revisit' también los
413
- // ya recorridos. El que no responde se marca como deshabilitado en
414
- // vez de quedarse mudo: un botón que no hace nada y no lo dice es
415
- // peor que un botón apagado.
429
+ // 'sequential' only allows tapping the next one; 'revisit' also the
430
+ // ones already covered. The one that doesn't respond is marked as
431
+ // disabled instead of staying silent: a button that does nothing
432
+ // and doesn't say so is worse than a disabled button.
416
433
  const reachable =
417
434
  advance === 'sequential'
418
435
  ? index === lineTo + 1