@webority/mobile-ui 0.128.0 → 0.130.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 (312) hide show
  1. package/dist/canvas-kit/kit.js +8340 -8095
  2. package/dist/canvas-kit/manifest.json +492 -333
  3. package/dist/canvas-kit/release.json +6 -6
  4. package/lib/commonjs/components/Accordion/Accordion.js +1 -1
  5. package/lib/commonjs/components/AppBar/AppBar.js +1 -1
  6. package/lib/commonjs/components/AppIcon/AppIcon.js +1 -1
  7. package/lib/commonjs/components/AppIcon/catalog.g.js +1 -1
  8. package/lib/commonjs/components/AppIcon/glyphs.g.js +1 -1
  9. package/lib/commonjs/components/AppIcon/variants.g.js +1 -1
  10. package/lib/commonjs/components/AppLockOverlay/AppLockOverlay.js +1 -1
  11. package/lib/commonjs/components/Avatar/Avatar.js +1 -1
  12. package/lib/commonjs/components/Banner/Banner.js +1 -1
  13. package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
  14. package/lib/commonjs/components/Box/Box.js +1 -1
  15. package/lib/commonjs/components/Button/Button.js +1 -1
  16. package/lib/commonjs/components/Card/Card.js +1 -1
  17. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
  18. package/lib/commonjs/components/Composer/Composer.js +1 -1
  19. package/lib/commonjs/components/Confirm/confirm.js +1 -1
  20. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
  21. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +1 -1
  22. package/lib/commonjs/components/Descriptions/Descriptions.js +1 -1
  23. package/lib/commonjs/components/Dialog/Dialog.js +1 -1
  24. package/lib/commonjs/components/Drawer/Drawer.js +1 -1
  25. package/lib/commonjs/components/FieldBase/ChoiceText.js +1 -1
  26. package/lib/commonjs/components/FieldBase/FieldBase.js +1 -1
  27. package/lib/commonjs/components/FieldBase/useFloatingLabel.js +1 -1
  28. package/lib/commonjs/components/FilePicker/FilePicker.js +1 -1
  29. package/lib/commonjs/components/FileViewer/FileViewer.js +1 -1
  30. package/lib/commonjs/components/FileViewer/FileViewerImage.js +1 -0
  31. package/lib/commonjs/components/FileViewer/fileSource.js +1 -0
  32. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
  33. package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
  34. package/lib/commonjs/components/FormField/FormField.js +1 -1
  35. package/lib/commonjs/components/IconBadge/IconBadge.js +1 -1
  36. package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
  37. package/lib/commonjs/components/InlineSelect/InlineSelect.js +1 -1
  38. package/lib/commonjs/components/Input/Input.js +1 -1
  39. package/lib/commonjs/components/ListItem/ListItem.js +1 -1
  40. package/lib/commonjs/components/Markdown/Markdown.js +1 -1
  41. package/lib/commonjs/components/Menu/Menu.js +1 -1
  42. package/lib/commonjs/components/Menu/MenuSurface.js +1 -1
  43. package/lib/commonjs/components/Menu/useContextMenu.js +1 -1
  44. package/lib/commonjs/components/Modal/Modal.js +1 -1
  45. package/lib/commonjs/components/NumberInput/NumberInput.js +1 -1
  46. package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
  47. package/lib/commonjs/components/OTPInput/OTPResendRow.js +1 -0
  48. package/lib/commonjs/components/OTPInput/index.js +1 -1
  49. package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
  50. package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  51. package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +1 -1
  52. package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
  53. package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
  54. package/lib/commonjs/components/Radio/Radio.js +1 -1
  55. package/lib/commonjs/components/Rating/Rating.js +1 -1
  56. package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
  57. package/lib/commonjs/components/SectionHeader/SectionHeader.js +1 -1
  58. package/lib/commonjs/components/Select/Select.js +1 -1
  59. package/lib/commonjs/components/SliderField/SliderField.js +1 -1
  60. package/lib/commonjs/components/SquircleImage/SquircleImage.js +1 -1
  61. package/lib/commonjs/components/Text/Text.js +1 -1
  62. package/lib/commonjs/components/Text/textInk.js +1 -0
  63. package/lib/commonjs/components/TimePicker/TimePicker.js +1 -1
  64. package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
  65. package/lib/commonjs/components/Tour/Tour.js +1 -1
  66. package/lib/commonjs/components/index.js +1 -1
  67. package/lib/commonjs/components/not-drawn.json +1 -0
  68. package/lib/commonjs/form/HookFormField.js +1 -1
  69. package/lib/commonjs/hooks/index.js +1 -1
  70. package/lib/commonjs/hooks/useFieldErrorScroll.js +1 -0
  71. package/lib/commonjs/hooks/useResendCountdown.js +1 -0
  72. package/lib/commonjs/icons.js +1 -0
  73. package/lib/commonjs/index.js +1 -1
  74. package/lib/commonjs/navigation/DiscardGuard.js +1 -1
  75. package/lib/commonjs/navigation/index.js +1 -1
  76. package/lib/commonjs/navigation/useNavigationTheme.js +1 -0
  77. package/lib/commonjs/sizes.js +1 -0
  78. package/lib/commonjs/squircle.js +1 -0
  79. package/lib/commonjs/utils/feedback.js +1 -1
  80. package/lib/commonjs/utils/hapticUtils.js +1 -1
  81. package/lib/module/components/Accordion/Accordion.js +1 -1
  82. package/lib/module/components/AppBar/AppBar.js +1 -1
  83. package/lib/module/components/AppIcon/AppIcon.js +1 -1
  84. package/lib/module/components/AppIcon/catalog.g.js +1 -1
  85. package/lib/module/components/AppIcon/glyphs.g.js +1 -1
  86. package/lib/module/components/AppIcon/variants.g.js +1 -1
  87. package/lib/module/components/AppLockOverlay/AppLockOverlay.js +1 -1
  88. package/lib/module/components/Avatar/Avatar.js +1 -1
  89. package/lib/module/components/Banner/Banner.js +1 -1
  90. package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
  91. package/lib/module/components/Box/Box.js +1 -1
  92. package/lib/module/components/Button/Button.js +1 -1
  93. package/lib/module/components/Card/Card.js +1 -1
  94. package/lib/module/components/Checkbox/Checkbox.js +1 -1
  95. package/lib/module/components/Composer/Composer.js +1 -1
  96. package/lib/module/components/Confirm/confirm.js +1 -1
  97. package/lib/module/components/DatePicker/DatePicker.js +1 -1
  98. package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
  99. package/lib/module/components/Descriptions/Descriptions.js +1 -1
  100. package/lib/module/components/Dialog/Dialog.js +1 -1
  101. package/lib/module/components/Drawer/Drawer.js +1 -1
  102. package/lib/module/components/FieldBase/ChoiceText.js +1 -1
  103. package/lib/module/components/FieldBase/FieldBase.js +1 -1
  104. package/lib/module/components/FieldBase/useFloatingLabel.js +1 -1
  105. package/lib/module/components/FilePicker/FilePicker.js +1 -1
  106. package/lib/module/components/FileViewer/FileViewer.js +1 -1
  107. package/lib/module/components/FileViewer/FileViewerImage.js +1 -0
  108. package/lib/module/components/FileViewer/fileSource.js +1 -0
  109. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
  110. package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
  111. package/lib/module/components/FormField/FormField.js +1 -1
  112. package/lib/module/components/IconBadge/IconBadge.js +1 -1
  113. package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
  114. package/lib/module/components/InlineSelect/InlineSelect.js +1 -1
  115. package/lib/module/components/Input/Input.js +1 -1
  116. package/lib/module/components/ListItem/ListItem.js +1 -1
  117. package/lib/module/components/Markdown/Markdown.js +1 -1
  118. package/lib/module/components/Menu/Menu.js +1 -1
  119. package/lib/module/components/Menu/MenuSurface.js +1 -1
  120. package/lib/module/components/Menu/useContextMenu.js +1 -1
  121. package/lib/module/components/Modal/Modal.js +1 -1
  122. package/lib/module/components/NumberInput/NumberInput.js +1 -1
  123. package/lib/module/components/OTPInput/OTPInput.js +1 -1
  124. package/lib/module/components/OTPInput/OTPResendRow.js +1 -0
  125. package/lib/module/components/OTPInput/index.js +1 -1
  126. package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
  127. package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  128. package/lib/module/components/PickerTrigger/PickerTrigger.js +1 -1
  129. package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
  130. package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
  131. package/lib/module/components/Radio/Radio.js +1 -1
  132. package/lib/module/components/Rating/Rating.js +1 -1
  133. package/lib/module/components/SearchBar/SearchBar.js +1 -1
  134. package/lib/module/components/SectionHeader/SectionHeader.js +1 -1
  135. package/lib/module/components/Select/Select.js +1 -1
  136. package/lib/module/components/SliderField/SliderField.js +1 -1
  137. package/lib/module/components/SquircleImage/SquircleImage.js +1 -1
  138. package/lib/module/components/Text/Text.js +1 -1
  139. package/lib/module/components/Text/textInk.js +1 -0
  140. package/lib/module/components/TimePicker/TimePicker.js +1 -1
  141. package/lib/module/components/Tooltip/Tooltip.js +1 -1
  142. package/lib/module/components/Tour/Tour.js +1 -1
  143. package/lib/module/components/index.js +1 -1
  144. package/lib/module/components/not-drawn.json +1 -0
  145. package/lib/module/form/HookFormField.js +1 -1
  146. package/lib/module/hooks/index.js +1 -1
  147. package/lib/module/hooks/useFieldErrorScroll.js +1 -0
  148. package/lib/module/hooks/useResendCountdown.js +1 -0
  149. package/lib/module/icons.js +1 -0
  150. package/lib/module/index.js +1 -1
  151. package/lib/module/navigation/DiscardGuard.js +1 -1
  152. package/lib/module/navigation/index.js +1 -1
  153. package/lib/module/navigation/useNavigationTheme.js +1 -0
  154. package/lib/module/sizes.js +1 -0
  155. package/lib/module/squircle.js +1 -0
  156. package/lib/module/utils/feedback.js +1 -1
  157. package/lib/module/utils/hapticUtils.js +1 -1
  158. package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +2 -1
  159. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +2 -1
  160. package/lib/typescript/commonjs/components/AppIcon/AppIcon.d.ts +6 -3
  161. package/lib/typescript/commonjs/components/AppIcon/catalog.g.d.ts +1 -1
  162. package/lib/typescript/commonjs/components/AppIcon/glyphs.g.d.ts +1 -0
  163. package/lib/typescript/commonjs/components/AppIcon/index.d.ts +1 -1
  164. package/lib/typescript/commonjs/components/AppLockOverlay/AppLockOverlay.d.ts +3 -3
  165. package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +7 -0
  166. package/lib/typescript/commonjs/components/Banner/Banner.d.ts +3 -2
  167. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +4 -4
  168. package/lib/typescript/commonjs/components/Box/Box.d.ts +2 -2
  169. package/lib/typescript/commonjs/components/Button/Button.d.ts +3 -0
  170. package/lib/typescript/commonjs/components/Card/Card.d.ts +6 -7
  171. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +2 -1
  172. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +2 -1
  173. package/lib/typescript/commonjs/components/Composer/Composer.d.ts +4 -0
  174. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +7 -17
  175. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +7 -17
  176. package/lib/typescript/commonjs/components/Descriptions/Descriptions.d.ts +2 -2
  177. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +1 -1
  178. package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +4 -4
  179. package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +8 -6
  180. package/lib/typescript/commonjs/components/FileViewer/FileViewer.d.ts +5 -33
  181. package/lib/typescript/commonjs/components/FileViewer/FileViewerImage.d.ts +5 -0
  182. package/lib/typescript/commonjs/components/FileViewer/fileSource.d.ts +24 -0
  183. package/lib/typescript/commonjs/components/FileViewer/index.d.ts +1 -1
  184. package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +8 -0
  185. package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +3 -3
  186. package/lib/typescript/commonjs/components/IconBadge/IconBadge.d.ts +4 -0
  187. package/lib/typescript/commonjs/components/IconBadge/index.d.ts +1 -1
  188. package/lib/typescript/commonjs/components/Input/Input.d.ts +3 -2
  189. package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +7 -7
  190. package/lib/typescript/commonjs/components/Markdown/Markdown.d.ts +3 -1
  191. package/lib/typescript/commonjs/components/Menu/Menu.d.ts +3 -3
  192. package/lib/typescript/commonjs/components/Menu/useContextMenu.d.ts +1 -1
  193. package/lib/typescript/commonjs/components/Modal/Modal.d.ts +14 -4
  194. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +2 -0
  195. package/lib/typescript/commonjs/components/OTPInput/OTPResendRow.d.ts +25 -0
  196. package/lib/typescript/commonjs/components/OTPInput/index.d.ts +2 -0
  197. package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +5 -5
  198. package/lib/typescript/commonjs/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -2
  199. package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +7 -2
  200. package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +1 -1
  201. package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +2 -0
  202. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +2 -0
  203. package/lib/typescript/commonjs/components/Rating/Rating.d.ts +2 -0
  204. package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +5 -3
  205. package/lib/typescript/commonjs/components/SectionHeader/SectionHeader.d.ts +2 -0
  206. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +2 -0
  207. package/lib/typescript/commonjs/components/Select/Select.d.ts +4 -3
  208. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +2 -0
  209. package/lib/typescript/commonjs/components/SliderField/SliderField.d.ts +2 -2
  210. package/lib/typescript/commonjs/components/SquircleImage/SquircleImage.d.ts +4 -3
  211. package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +2 -0
  212. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +2 -0
  213. package/lib/typescript/commonjs/components/Text/Text.d.ts +2 -0
  214. package/lib/typescript/commonjs/components/Text/textInk.d.ts +14 -0
  215. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +7 -18
  216. package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +4 -3
  217. package/lib/typescript/commonjs/components/Tour/Tour.d.ts +1 -1
  218. package/lib/typescript/commonjs/components/index.d.ts +5 -6
  219. package/lib/typescript/commonjs/form/HookFormField.d.ts +4 -4
  220. package/lib/typescript/commonjs/hooks/index.d.ts +4 -0
  221. package/lib/typescript/commonjs/hooks/useFieldErrorScroll.d.ts +28 -0
  222. package/lib/typescript/commonjs/hooks/useResendCountdown.d.ts +16 -0
  223. package/lib/typescript/commonjs/icons.d.ts +3 -0
  224. package/lib/typescript/commonjs/index.d.ts +9 -8
  225. package/lib/typescript/commonjs/navigation/index.d.ts +1 -0
  226. package/lib/typescript/commonjs/navigation/useNavigationTheme.d.ts +7 -0
  227. package/lib/typescript/commonjs/sizes.d.ts +2 -0
  228. package/lib/typescript/commonjs/squircle.d.ts +2 -0
  229. package/lib/typescript/commonjs/utils/feedback.d.ts +2 -2
  230. package/lib/typescript/commonjs/utils/hapticUtils.d.ts +2 -0
  231. package/lib/typescript/module/components/Accordion/Accordion.d.ts +2 -1
  232. package/lib/typescript/module/components/AppBar/AppBar.d.ts +2 -1
  233. package/lib/typescript/module/components/AppIcon/AppIcon.d.ts +6 -3
  234. package/lib/typescript/module/components/AppIcon/catalog.g.d.ts +1 -1
  235. package/lib/typescript/module/components/AppIcon/glyphs.g.d.ts +1 -0
  236. package/lib/typescript/module/components/AppIcon/index.d.ts +1 -1
  237. package/lib/typescript/module/components/AppLockOverlay/AppLockOverlay.d.ts +3 -3
  238. package/lib/typescript/module/components/Avatar/Avatar.d.ts +7 -0
  239. package/lib/typescript/module/components/Banner/Banner.d.ts +3 -2
  240. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +4 -4
  241. package/lib/typescript/module/components/Box/Box.d.ts +2 -2
  242. package/lib/typescript/module/components/Button/Button.d.ts +3 -0
  243. package/lib/typescript/module/components/Card/Card.d.ts +6 -7
  244. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +2 -1
  245. package/lib/typescript/module/components/Chip/Chip.d.ts +2 -1
  246. package/lib/typescript/module/components/Composer/Composer.d.ts +4 -0
  247. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +7 -17
  248. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +7 -17
  249. package/lib/typescript/module/components/Descriptions/Descriptions.d.ts +2 -2
  250. package/lib/typescript/module/components/Dialog/Dialog.d.ts +1 -1
  251. package/lib/typescript/module/components/Drawer/Drawer.d.ts +4 -4
  252. package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +8 -6
  253. package/lib/typescript/module/components/FileViewer/FileViewer.d.ts +5 -33
  254. package/lib/typescript/module/components/FileViewer/FileViewerImage.d.ts +5 -0
  255. package/lib/typescript/module/components/FileViewer/fileSource.d.ts +24 -0
  256. package/lib/typescript/module/components/FileViewer/index.d.ts +1 -1
  257. package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +8 -0
  258. package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +3 -3
  259. package/lib/typescript/module/components/IconBadge/IconBadge.d.ts +4 -0
  260. package/lib/typescript/module/components/IconBadge/index.d.ts +1 -1
  261. package/lib/typescript/module/components/Input/Input.d.ts +3 -2
  262. package/lib/typescript/module/components/ListItem/ListItem.d.ts +7 -7
  263. package/lib/typescript/module/components/Markdown/Markdown.d.ts +3 -1
  264. package/lib/typescript/module/components/Menu/Menu.d.ts +3 -3
  265. package/lib/typescript/module/components/Menu/useContextMenu.d.ts +1 -1
  266. package/lib/typescript/module/components/Modal/Modal.d.ts +14 -4
  267. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +2 -0
  268. package/lib/typescript/module/components/OTPInput/OTPResendRow.d.ts +25 -0
  269. package/lib/typescript/module/components/OTPInput/index.d.ts +2 -0
  270. package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +5 -5
  271. package/lib/typescript/module/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -2
  272. package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +7 -2
  273. package/lib/typescript/module/components/PickerTrigger/index.d.ts +1 -1
  274. package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +2 -0
  275. package/lib/typescript/module/components/Radio/Radio.d.ts +2 -0
  276. package/lib/typescript/module/components/Rating/Rating.d.ts +2 -0
  277. package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +5 -3
  278. package/lib/typescript/module/components/SectionHeader/SectionHeader.d.ts +2 -0
  279. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +2 -0
  280. package/lib/typescript/module/components/Select/Select.d.ts +4 -3
  281. package/lib/typescript/module/components/Slider/Slider.d.ts +2 -0
  282. package/lib/typescript/module/components/SliderField/SliderField.d.ts +2 -2
  283. package/lib/typescript/module/components/SquircleImage/SquircleImage.d.ts +4 -3
  284. package/lib/typescript/module/components/Stepper/Stepper.d.ts +2 -0
  285. package/lib/typescript/module/components/Switch/Switch.d.ts +2 -0
  286. package/lib/typescript/module/components/Text/Text.d.ts +2 -0
  287. package/lib/typescript/module/components/Text/textInk.d.ts +14 -0
  288. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +7 -18
  289. package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +4 -3
  290. package/lib/typescript/module/components/Tour/Tour.d.ts +1 -1
  291. package/lib/typescript/module/components/index.d.ts +5 -6
  292. package/lib/typescript/module/form/HookFormField.d.ts +4 -4
  293. package/lib/typescript/module/hooks/index.d.ts +4 -0
  294. package/lib/typescript/module/hooks/useFieldErrorScroll.d.ts +28 -0
  295. package/lib/typescript/module/hooks/useResendCountdown.d.ts +16 -0
  296. package/lib/typescript/module/icons.d.ts +3 -0
  297. package/lib/typescript/module/index.d.ts +9 -8
  298. package/lib/typescript/module/navigation/index.d.ts +1 -0
  299. package/lib/typescript/module/navigation/useNavigationTheme.d.ts +7 -0
  300. package/lib/typescript/module/sizes.d.ts +2 -0
  301. package/lib/typescript/module/squircle.d.ts +2 -0
  302. package/lib/typescript/module/utils/feedback.d.ts +2 -2
  303. package/lib/typescript/module/utils/hapticUtils.d.ts +2 -0
  304. package/package.json +37 -7
  305. package/lib/commonjs/components/Notation/Notation.js +0 -1
  306. package/lib/commonjs/components/Notation/index.js +0 -1
  307. package/lib/module/components/Notation/Notation.js +0 -1
  308. package/lib/module/components/Notation/index.js +0 -1
  309. package/lib/typescript/commonjs/components/Notation/Notation.d.ts +0 -53
  310. package/lib/typescript/commonjs/components/Notation/index.d.ts +0 -3
  311. package/lib/typescript/module/components/Notation/Notation.d.ts +0 -53
  312. package/lib/typescript/module/components/Notation/index.d.ts +0 -3
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useDebounce}from"../../hooks/useDebounce.js";import{radiusOf,resolveFieldSize,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{FieldBase,FieldLabel,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{normalizeSuggestion,SearchRecents,SearchScopeBar,SearchSuggestions}from"./SearchPanel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SEARCH_BAR_LABELS=Object.freeze({placeholder:"Search…",recents:"Recent searches",clearAll:"Clear all",clearAllRecents:"Clear all recent searches",searchAgain:"Searches again",removeRecent:e=>`Remove ${e} from recent searches`,scope:"Search scope",clearSearch:"Clear search",searching:e=>`Searching ${e}`,suggestionCount:e=>1===e?"1 suggestion":`${e} suggestions`,removed:e=>`Removed ${e}`,recentsCleared:"Recent searches cleared"});const DEFAULT_PANEL_ROWS=8,HOLD_RELEASE_MS=50,SearchBar=forwardRef((e,l)=>{const{value:s,onChangeText:a,onSubmit:o,onFocus:t,onBlur:r,placeholder:n,autoFocus:i=!1,disabled:c=!1,onClear:u,leftIcon:d,debounceMs:p,size:b="md",variant:h,borderRadius:f,label:m,labelMode:S="top",labelStyle:g,scopes:v,scope:C,onScopeChange:x,recents:R,maxRecents:j=DEFAULT_PANEL_ROWS,onSelectRecent:y,onRemove:F,onClearRecents:_,suggestions:L,maxSuggestions:k=DEFAULT_PANEL_ROWS,onSelect:B,haptic:E,labels:A,style:I,inputStyle:T,accessibilityLabel:w,testID:z,...V}=e;warnInvalidValue("SearchBar","size",e.size,["sm","md","lg"]),warnInvalidValue("SearchBar","variant",e.variant,["outline","filled","underline"]),warnInvalidValue("SearchBar","labelMode",e.labelMode,["top","float"]);const H=useTheme(),M=useMemo(()=>({...DEFAULT_SEARCH_BAR_LABELS,...A}),[A]),D=n??M.placeholder,O=h??H.settings.components["search-bar"]?.defaultVariant??H.settings.components.field?.defaultVariant??"filled",P="underline"===O,N=resolveFieldSize(H,b),U=radiusOf(H,H.components["search-bar"][b].radius),W=resolveFieldTextStyle(H,{disabled:c}),$=useRef(null),q=useMemo(()=>mergeRefs($,l),[l]),K=useCallback(()=>{c||$.current?.focus()},[c]),G=useMemo(()=>buildStyles(H),[H]),J="string"==typeof s?s:"",[Q,X]=useState(!1),Y=useCallback(e=>{X(!0),t?.(e)},[t]),Z=useCallback(e=>{X(!1),r?.(e)},[r]),[ee,le]=useState(J),se=useDebounce(ee,p??0);useEffect(()=>{void 0!==p&&J!==ee&&le(J)},[J,p]);const ae=useRef(J);useEffect(()=>{void 0!==p&&se!==ae.current&&(ae.current=se,a(se))},[se,p,a]);const oe=useCallback(e=>{void 0===p?a(e):le(e)},[p,a]),te=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e),void 0!==p&&(le(""),ae.current=""),a(""),u?.()},[E,p,a,u]),re=useCallback(()=>{o?.(void 0!==p?ee:J)},[o,p,ee,J]),ne=void 0!==p?ee:J,ie=ne.length>0,[ce,ue]=useControllableState({value:C,defaultValue:v?.[0]?.value??"",onChange:x}),de=useCallback(e=>{ue(e);const l=v?.find(l=>l.value===e)?.label;l&&announce(M.searching(l))},[v,ue,M]),[pe,be]=useState(!1),he=useRef(null),fe=useCallback(()=>{he.current&&(clearTimeout(he.current),he.current=null)},[]),me=useCallback(()=>{fe(),be(!0)},[fe]),Se=useCallback(()=>{fe(),he.current=setTimeout(()=>be(!1),50)},[fe]);useEffect(()=>fe,[fe]);const ge=!c&&(Q||pe),ve=useMemo(()=>(R??[]).slice(0,j),[R,j]),Ce=useMemo(()=>(L??[]).slice(0,k).map(normalizeSuggestion),[L,k]),xe=ge&&!ie&&ve.length>0,Re=ge&&ie&&Ce.length>0,je=Re?Ce.length:0,ye=je>0?M.suggestionCount(je):"";useEffect(()=>{ye&&announce(ye)},[ye]);const Fe=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e)},[E]),Le=useCallback(e=>{Fe(),$.current?.blur(),be(!1),y?.(e)},[Fe,y]),ke=useCallback(e=>{Fe(),$.current?.blur(),be(!1),B?.(e)},[Fe,B]),Be=useCallback(e=>{Fe(),F?.(e),announce(M.removed(e)),K()},[Fe,F,K,M]),Ee=useCallback(()=>{Fe(),_?.(),announce(M.recentsCleared),K()},[Fe,_,K,M]),Ae={size:N.icon,color:c?H.colors["text-disabled"]:H.colors["text-subtle"],disabled:c},Ie=d?renderSlotIcon(d,Ae):(H.settings.icons.search??defaultIcons.search)(Ae),Te=Boolean(m)&&"float"===S,we=useFloatingLabel({label:m,enabled:Te,floated:Q||ie,variant:O,sizeTokens:N,leadingOffset:N.icon+H.space.md,trailingOffset:ie?N.icon+H.space.md:0,paddingLeft:P?H.space.none:N["padding-x"],color:H.colors["field-label"],style:g}),ze=ie&&!c?_jsx(Pressable,{onPress:te,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:M.clearSearch,children:(H.settings.icons.close??defaultIcons.close)({size:N.icon,color:H.colors["text-muted"]})}):null;return _jsxs(View,{style:I,testID:z,children:[m&&!Te?_jsx(FieldLabel,{size:b,style:g,children:m}):null,_jsx(View,{style:G.root,children:_jsxs(View,{style:G.fieldWrap,children:[_jsx(FieldBase,{size:b,variant:O,focused:Q,disabled:c,filled:ie,minHeight:N["min-height"],paddingHorizontal:P?H.space.none:N["padding-x"],borderRadius:f??U,leading:Ie,trailing:ze,topNotch:we.topNotch,onPress:K,pressFeedback:!1,accessibilityRole:"search",accessibilityLabel:w??D,children:_jsx(TextInput,{ref:q,style:[G.input,{fontSize:N.text,color:W.color,...W.weightStyle},T],value:ne,onChangeText:oe,onSubmitEditing:re,onFocus:Y,onBlur:Z,placeholder:!Te||Q||ie?D:void 0,placeholderTextColor:W.placeholderColor,autoFocus:i,editable:!c,returnKeyType:"search",selectionColor:resolveVariantColors(H,O).borderFocusedRepresentative,accessibilityLabel:w??D,accessibilityState:{disabled:c},"aria-disabled":c,...V})}),we.node]})}),v&&v.length>0?_jsx(SearchScopeBar,{scopes:v,scope:ce||(v[0]?.value??""),disabled:c,haptic:E,labels:M,onChange:de}):null,xe?_jsx(SearchRecents,{recents:ve,labels:M,onSelect:Le,onRemove:F?Be:void 0,onClear:_?Ee:void 0,onHold:me,onRelease:Se}):null,Re?_jsx(SearchSuggestions,{suggestions:Ce,query:ne,onSelect:ke,onHold:me,onRelease:Se}):null]})});SearchBar.displayName="SearchBar";const buildStyles=e=>StyleSheet.create({root:{flexDirection:"row",alignItems:"center",width:"100%",position:"relative",overflow:"visible"},fieldWrap:{flex:1,position:"relative",overflow:"visible"},input:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SearchBar};export default SearchBar;
1
+ "use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useDebounce}from"../../hooks/useDebounce.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{FieldBase,FieldLabel,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{normalizeSuggestion,SearchRecents,SearchScopeBar,SearchSuggestions}from"./SearchPanel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SEARCH_BAR_LABELS=Object.freeze({placeholder:"Search…",recents:"Recent searches",clearAll:"Clear all",clearAllRecents:"Clear all recent searches",searchAgain:"Searches again",removeRecent:e=>`Remove ${e} from recent searches`,scope:"Search scope",clearSearch:"Clear search",searching:e=>`Searching ${e}`,suggestionCount:e=>1===e?"1 suggestion":`${e} suggestions`,removed:e=>`Removed ${e}`,recentsCleared:"Recent searches cleared"});const DEFAULT_PANEL_ROWS=8,HOLD_RELEASE_MS=50,SearchBar=forwardRef((e,l)=>{const{value:s,onChangeText:a,onSubmit:o,onFocus:t,onBlur:r,placeholder:n,autoFocus:i=!1,disabled:c=!1,onClear:u,leftIcon:d,debounceMs:p,size:h="md",variant:b,radius:m,label:f,labelMode:S="top",labelStyle:g,scopes:v,scope:C,onScopeChange:x,recents:R,maxRecents:j=DEFAULT_PANEL_ROWS,onSelectRecent:y,onRemove:F,onClearRecents:_,suggestions:L,maxSuggestions:k=DEFAULT_PANEL_ROWS,onSelect:B,haptic:E,labels:A,style:I,inputStyle:T,accessibilityLabel:w,testID:z,...V}=e;warnInvalidValue("SearchBar","size",e.size,["sm","md","lg"]),warnInvalidValue("SearchBar","variant",e.variant,["outline","filled","underline"]),warnInvalidValue("SearchBar","labelMode",e.labelMode,["top","float"]);const H=useTheme(),M=useMemo(()=>({...DEFAULT_SEARCH_BAR_LABELS,...A}),[A]),D=n??M.placeholder,P=b??H.settings.components["search-bar"]?.defaultVariant??H.settings.components.field?.defaultVariant??"filled",O="underline"===P,N=resolveFieldSize(H,h),U=m??H.components["search-bar"][h].radius,W=resolveFieldTextStyle(H,{disabled:c}),$=useRef(null),q=useMemo(()=>mergeRefs($,l),[l]),K=useCallback(()=>{c||$.current?.focus()},[c]),G=useMemo(()=>buildStyles(H),[H]),J="string"==typeof s?s:"",[Q,X]=useState(!1),Y=useCallback(e=>{X(!0),t?.(e)},[t]),Z=useCallback(e=>{X(!1),r?.(e)},[r]),[ee,le]=useState(J),se=useDebounce(ee,p??0);useEffect(()=>{void 0!==p&&J!==ee&&le(J)},[J,p]);const ae=useRef(J);useEffect(()=>{void 0!==p&&se!==ae.current&&(ae.current=se,a(se))},[se,p,a]);const oe=useCallback(e=>{void 0===p?a(e):le(e)},[p,a]),te=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e),void 0!==p&&(le(""),ae.current=""),a(""),u?.()},[E,p,a,u]),re=useCallback(()=>{o?.(void 0!==p?ee:J)},[o,p,ee,J]),ne=void 0!==p?ee:J,ie=ne.length>0,[ce,ue]=useControllableState({value:C,defaultValue:v?.[0]?.value??"",onChange:x}),de=useCallback(e=>{ue(e);const l=v?.find(l=>l.value===e)?.label;l&&announce(M.searching(l))},[v,ue,M]),[pe,he]=useState(!1),be=useRef(null),me=useCallback(()=>{be.current&&(clearTimeout(be.current),be.current=null)},[]),fe=useCallback(()=>{me(),he(!0)},[me]),Se=useCallback(()=>{me(),be.current=setTimeout(()=>he(!1),50)},[me]);useEffect(()=>me,[me]);const ge=!c&&(Q||pe),ve=useMemo(()=>(R??[]).slice(0,j),[R,j]),Ce=useMemo(()=>(L??[]).slice(0,k).map(normalizeSuggestion),[L,k]),xe=ge&&!ie&&ve.length>0,Re=ge&&ie&&Ce.length>0,je=Re?Ce.length:0,ye=je>0?M.suggestionCount(je):"";useEffect(()=>{ye&&announce(ye)},[ye]);const Fe=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e)},[E]),Le=useCallback(e=>{Fe(),$.current?.blur(),he(!1),y?.(e)},[Fe,y]),ke=useCallback(e=>{Fe(),$.current?.blur(),he(!1),B?.(e)},[Fe,B]),Be=useCallback(e=>{Fe(),F?.(e),announce(M.removed(e)),K()},[Fe,F,K,M]),Ee=useCallback(()=>{Fe(),_?.(),announce(M.recentsCleared),K()},[Fe,_,K,M]),Ae={size:N.icon,color:c?H.colors["text-disabled"]:H.colors["text-subtle"],disabled:c},Ie=d?renderSlotIcon(d,Ae):(H.settings.icons.search??defaultIcons.search)(Ae),Te=Boolean(f)&&"float"===S,we=useFloatingLabel({label:f,enabled:Te,floated:Q||ie,variant:P,sizeTokens:N,leadingOffset:N.icon+H.space.md,trailingOffset:ie?N.icon+H.space.md:0,paddingLeft:O?H.space.none:N["padding-x"],color:H.colors["field-label"],style:g}),ze=ie&&!c?_jsx(Pressable,{onPress:te,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:M.clearSearch,children:(H.settings.icons.close??defaultIcons.close)({size:N.icon,color:H.colors["text-muted"]})}):null;return _jsxs(View,{style:I,testID:z,children:[f&&!Te?_jsx(FieldLabel,{size:h,style:g,children:f}):null,_jsx(View,{style:G.root,children:_jsxs(View,{style:G.fieldWrap,children:[_jsx(FieldBase,{size:h,variant:P,focused:Q,disabled:c,filled:ie,minHeight:N["min-height"],paddingHorizontal:O?H.space.none:N["padding-x"],radius:U,leading:Ie,trailing:ze,topNotch:we.topNotch,onPress:K,pressFeedback:!1,accessibilityRole:"search",accessibilityLabel:w??D,children:_jsx(TextInput,{ref:q,style:[G.input,{fontSize:N.text,color:W.color,...W.weightStyle},T],value:ne,onChangeText:oe,onSubmitEditing:re,onFocus:Y,onBlur:Z,placeholder:!Te||Q||ie?D:void 0,placeholderTextColor:W.placeholderColor,autoFocus:i,editable:!c,returnKeyType:"search",selectionColor:resolveVariantColors(H,P).borderFocusedRepresentative,accessibilityLabel:w??D,accessibilityState:{disabled:c},"aria-disabled":c,...V})}),we.node]})}),v&&v.length>0?_jsx(SearchScopeBar,{scopes:v,scope:ce||(v[0]?.value??""),disabled:c,haptic:E,labels:M,onChange:de}):null,xe?_jsx(SearchRecents,{recents:ve,labels:M,onSelect:Le,onRemove:F?Be:void 0,onClear:_?Ee:void 0,onHold:fe,onRelease:Se}):null,Re?_jsx(SearchSuggestions,{suggestions:Ce,query:ne,onSelect:ke,onHold:fe,onRelease:Se}):null]})});SearchBar.displayName="SearchBar";const buildStyles=e=>StyleSheet.create({root:{flexDirection:"row",alignItems:"center",width:"100%",position:"relative",overflow:"visible"},fieldWrap:{flex:1,position:"relative",overflow:"visible"},input:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SearchBar};export default SearchBar;
@@ -1 +1 @@
1
- "use strict";import{useMemo}from"react";import{View}from"react-native";import{useTheme}from"../../theme/index.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{Button}from"../Button/index.js";import{RequiredMark}from"../FieldBase/index.js";import{Text}from"../Text/Text.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SECTION_HEADER_LABELS=Object.freeze({required:e=>`${e}, required`});export const SectionHeader=e=>{const{children:t,variant:r,flush:i,required:s=!1,action:a,labels:o,style:n,testID:l}=e;warnInvalidValue("SectionHeader","variant",e.variant,["title","caps","sub"]);const c=useTheme(),m=c.settings.components["section-header"],u=r??m?.defaultVariant??"title",d=i??m?.defaultFlush??!1,p=useMemo(()=>({...DEFAULT_SECTION_HEADER_LABELS,...o}),[o]),x=useMemo(()=>({marginTop:d?0:c.space.lg,marginBottom:c.space.sm}),[c,d]),v=useMemo(()=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:c.space.sm}),[c]),f=useMemo(()=>({flex:1}),[]),j="caps"===u?{variant:"overline",color:"tertiary",weight:void 0}:"sub"===u?{variant:"label",color:"primary",weight:"semibold"}:{variant:"title",color:void 0,weight:void 0},h=_jsxs(Text,{variant:j.variant,color:j.color,weight:j.weight,accessibilityRole:"header",accessibilityLabel:s&&"string"==typeof t?p.required(t):void 0,style:a?f:[x,n],testID:l,children:[t,s?_jsx(RequiredMark,{}):null]});return a?_jsxs(View,{style:[v,x,n],children:[h,_jsx(Button,{variant:"link",size:"sm",label:a.label,onPress:a.onPress,testID:a.testID})]}):h};export default SectionHeader;
1
+ "use strict";import{useMemo}from"react";import{View}from"react-native";import{useTheme}from"../../theme/index.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{Button}from"../Button/index.js";import{RequiredMark}from"../FieldBase/index.js";import{Text}from"../Text/Text.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SECTION_HEADER_LABELS=Object.freeze({required:e=>`${e}, required`});export const SectionHeader=e=>{const{children:t,variant:r,flush:i,flushBottom:s=!1,required:a=!1,action:o,labels:n,style:l,testID:m}=e;warnInvalidValue("SectionHeader","variant",e.variant,["title","caps","sub"]);const c=useTheme(),u=c.settings.components["section-header"],d=r??u?.defaultVariant??"title",p=i??u?.defaultFlush??!1,x=useMemo(()=>({...DEFAULT_SECTION_HEADER_LABELS,...n}),[n]),f=useMemo(()=>({marginTop:p?0:c.space.lg,marginBottom:s?0:c.space.sm}),[c,p,s]),v=useMemo(()=>({flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:c.space.sm}),[c]),h=useMemo(()=>({flex:1}),[]),j="caps"===d?{variant:"overline",color:"tertiary",weight:void 0}:"sub"===d?{variant:"label",color:"primary",weight:"semibold"}:{variant:"title",color:void 0,weight:void 0},b=_jsxs(Text,{variant:j.variant,color:j.color,weight:j.weight,accessibilityRole:"header",accessibilityLabel:a&&"string"==typeof t?x.required(t):void 0,style:o?h:[f,l],testID:m,children:[t,a?_jsx(RequiredMark,{}):null]});return o?_jsxs(View,{style:[v,f,l],children:[b,_jsx(Button,{variant:"link",size:"sm",label:o.label,onPress:o.onPress,testID:o.testID})]}):b};export default SectionHeader;
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,RequiredMark,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{NotationInkContext}from"../Notation/Notation.js";import{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SELECT_LABELS={placeholder:"Select…",noSelection:"No selection",selected:e=>`Selected: ${e}`,fallbackName:"Select",sheetName:"Options",searchPlaceholder:DEFAULT_OPTION_SHEET_LABELS.searchPlaceholder,empty:DEFAULT_OPTION_SHEET_LABELS.empty};const sameSelectValue=(e,t)=>String(e)===String(t),containsValue=(e,t)=>e.some(e=>sameSelectValue(e,t)),Select=forwardRef((e,t)=>{warnInvalidValue("Select","size",e.size,["sm","md","lg"]),warnInvalidValue("Select","variant",e.variant,["outline","filled","underline"]);const{options:l,getOptionLabel:i,getOptionValue:o,isOptionDisabled:r,getOptionDescription:n,getOptionIcon:s,placeholder:a,onVisibleChange:c,searchable:d=!1,haptic:p,labels:u,label:h,help:x,title:S,required:m=!1,error:f,helperText:b,prefix:g,numberOfLines:v=1,disabled:y=!1,size:T="md",variant:C,leftIcon:j,rightIcon:L,chevronColor:_,chevronSize:F,borderRadius:O,accessibilityLabel:V,labelStyle:E,style:I,triggerStyle:k,textStyle:z,optionStyle:A,selectedOptionStyle:H,optionTextStyle:N,selectedOptionTextStyle:w,testID:P}=e,D=!0===e.multi,B=u?{...DEFAULT_SELECT_LABELS,...u}:DEFAULT_SELECT_LABELS,R=useCallback(e=>i?i(e):e.label??"",[i]),M=useCallback(e=>o?o(e):e.value,[o]),U=useCallback(e=>r?r(e):!0===e.disabled,[r]),q=useCallback(e=>n?n(e):e.description,[n]),$=useCallback(e=>s?s(e):e.icon,[s]),G=useTheme(),J=useMemo(()=>buildStyles(G),[G]),K=resolveFieldSize(G,T),Q=resolveFieldTextStyle(G,{disabled:y}),W=C??G.settings.components.select?.defaultVariant??G.settings.components.field?.defaultVariant??"outline",X=O??K.radius,[Y,Z]=useState(!1),ee=useMemo(()=>{if(D){const t=e.value??[];return l.filter(e=>containsValue(t,M(e)))}const t=e.value;if(null==t)return[];const i=l.find(e=>sameSelectValue(M(e),t));return i?[i]:[]},[D,l,e.value,M]),te=useCallback(()=>{if(y)return;const e=resolveHaptic(p,"selection");e&&triggerHaptic(e),Z(!0)},[y,p]),le=useCallback(()=>{Z(!1)},[]),ie=useCallback(t=>{if(U(t))return;const l=M(t),i=resolveHaptic(p,"selection");if(i&&triggerHaptic(i),D){const t=e.value??[],i=containsValue(t,l)?t.filter(e=>!sameSelectValue(e,l)):[...t,l];return void e.onChange(i)}e.onChange(l),le()},[D,e,le,U,M,p]),oe=0===ee.length?a??B.placeholder:ee.map(e=>R(e)).join(", "),re=0===ee.length,ne=!0===f||hasFieldText(f),se=hasFieldText(h),ae=fieldTextAsString(h),ce=Math.round(1.4*K.text),de=useMemo(()=>({fontSize:K.text,color:Q.placeholderColor}),[K.text,Q.placeholderColor]),pe={color:y?G.colors["field-icon-disabled"]:Y?G.colors["field-icon-focus"]:G.colors["field-icon"],size:K.icon,disabled:y,focused:Y,error:ne},ue=0===ee.length?a??B.noSelection:B.selected(ee.map(e=>R(e)).join(", ")),he=V??`${ae??B.fallbackName}. ${ue}`;return _jsxs(View,{style:[J.container,I],testID:P,children:[se?_jsx(FieldLabel,{size:T,required:m,help:x,style:E,children:h}):null,_jsx(View,{ref:t,collapsable:!1,children:_jsxs(FieldBase,{size:T,variant:W,disabled:y,error:ne,filled:ee.length>0,onPress:te,borderRadius:X,paddingHorizontal:"underline"===W?G.space.none:void 0,accessibilityRole:"button",accessibilityLabel:he,accessibilityState:{disabled:y,expanded:Y},"aria-disabled":y,"aria-expanded":Y,style:k,slotAlign:1===v?"center":"top",slotLineHeight:1===v?void 0:ce,leading:j?_jsx(View,{children:renderSlotIcon(j,pe)}):null,trailing:L?_jsx(View,{children:renderSlotIcon(L,pe)}):_jsx(Chevron,{color:_??(y?G.colors["text-disabled"]:G.colors["text-subtle"]),size:F??K.icon,open:Y,style:J.chevron}),children:[hasFieldText(g)?"string"==typeof g||"number"==typeof g?_jsx(Text,{variant:"body",style:[J.prefix,{color:Q.placeholderColor,fontSize:K.text,lineHeight:1===v?void 0:ce,marginRight:G.space.xs}],children:g}):_jsx(View,{style:[J.prefixNode,{minHeight:1===v?void 0:ce,justifyContent:"center",marginRight:G.space.xs}],children:_jsx(Text,{variant:"body",style:[J.prefix,{color:Q.placeholderColor,fontSize:K.text,lineHeight:1===v?void 0:ce}],children:_jsx(NotationInkContext.Provider,{value:de,children:g})})}):null,_jsxs(Text,{variant:"body",style:[J.triggerText,{color:re?Q.placeholderColor:Q.color,fontSize:K.text,lineHeight:1===v?void 0:ce,...Q.weightStyle},z],numberOfLines:v,children:[oe,re&&m&&!se?_jsx(RequiredMark,{}):null]})]})}),_jsx(FieldMessage,{size:T,error:ne,text:ne?f:b}),_jsx(OptionSheet,{visible:Y,onClose:le,onVisibleChange:c,haptic:p,title:S??ae,accessibilityLabel:ae??(se?S:void 0)??a??B.sheetName,options:l,getOptionLabel:R,getOptionValue:M,isOptionDisabled:U,getOptionDescription:q,getOptionIcon:$,value:e.value,onChange:(e,t)=>ie(t),multi:D,searchable:d,labels:{searchPlaceholder:B.searchPlaceholder,empty:B.empty},optionStyle:A,selectedOptionStyle:H,optionTextStyle:N,selectedOptionTextStyle:w,searchSelectionColor:resolveVariantColors(G,W).borderFocusedRepresentative})]})});Select.displayName="Select";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},label:{includeFontPadding:!1},triggerText:{flex:1,includeFontPadding:!1},errorText:{includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},chevron:{marginLeft:e.space.sm}});export{Select};export default Select;
1
+ "use strict";import{forwardRef,useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,RequiredMark,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{TextInkContext}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SELECT_LABELS={placeholder:"Select…",noSelection:"No selection",selected:e=>`Selected: ${e}`,fallbackName:"Select",sheetName:"Options",searchPlaceholder:DEFAULT_OPTION_SHEET_LABELS.searchPlaceholder,empty:DEFAULT_OPTION_SHEET_LABELS.empty};const sameSelectValue=(e,t)=>String(e)===String(t),containsValue=(e,t)=>e.some(e=>sameSelectValue(e,t)),Select=forwardRef((e,t)=>{warnInvalidValue("Select","size",e.size,["sm","md","lg"]),warnInvalidValue("Select","variant",e.variant,["outline","filled","underline"]);const{options:l,getOptionLabel:i,getOptionValue:o,isOptionDisabled:n,getOptionDescription:r,getOptionIcon:s,placeholder:a,onOpenChange:c,searchable:d=!1,haptic:p,labels:u,label:h,help:x,title:S,required:m=!1,error:f,helperText:g,prefix:b,numberOfLines:v=1,disabled:y=!1,size:T="md",variant:C,leftIcon:j,rightIcon:L,chevronColor:_,chevronSize:O,radius:F,accessibilityLabel:E,labelStyle:V,style:I,triggerStyle:k,textStyle:z,optionStyle:A,selectedOptionStyle:H,optionTextStyle:w,selectedOptionTextStyle:P,testID:D}=e,B=!0===e.multi,N=u?{...DEFAULT_SELECT_LABELS,...u}:DEFAULT_SELECT_LABELS,M=useCallback(e=>i?i(e):e.label??"",[i]),R=useCallback(e=>o?o(e):e.value,[o]),U=useCallback(e=>n?n(e):!0===e.disabled,[n]),q=useCallback(e=>r?r(e):e.description,[r]),$=useCallback(e=>s?s(e):e.icon,[s]),G=useTheme(),J=useMemo(()=>buildStyles(G),[G]),K=resolveFieldSize(G,T),Q=resolveFieldTextStyle(G,{disabled:y}),W=C??G.settings.components.select?.defaultVariant??G.settings.components.field?.defaultVariant??"outline",[X,Y]=useState(!1),Z=useMemo(()=>{if(B){const t=e.value??[];return l.filter(e=>containsValue(t,R(e)))}const t=e.value;if(null==t)return[];const i=l.find(e=>sameSelectValue(R(e),t));return i?[i]:[]},[B,l,e.value,R]),ee=useCallback(()=>{if(y)return;const e=resolveHaptic(p,"selection");e&&triggerHaptic(e),Y(!0)},[y,p]),te=useCallback(()=>{Y(!1)},[]),le=useCallback(t=>{if(U(t))return;const l=R(t),i=resolveHaptic(p,"selection");if(i&&triggerHaptic(i),B){const t=e.value??[],i=containsValue(t,l)?t.filter(e=>!sameSelectValue(e,l)):[...t,l];return void e.onChange(i)}e.onChange(l),te()},[B,e,te,U,R,p]),ie=0===Z.length?a??N.placeholder:Z.map(e=>M(e)).join(", "),oe=0===Z.length,ne=!0===f||hasFieldText(f),re=hasFieldText(h),se=fieldTextAsString(h),ae=Math.round(1.4*K.text),ce=useMemo(()=>({fontSize:K.text,color:Q.placeholderColor}),[K.text,Q.placeholderColor]),de={color:y?G.colors["field-icon-disabled"]:X?G.colors["field-icon-focus"]:G.colors["field-icon"],size:K.icon,disabled:y,focused:X,error:ne},pe=0===Z.length?a??N.noSelection:N.selected(Z.map(e=>M(e)).join(", ")),ue=E??`${se??N.fallbackName}. ${pe}`;return _jsxs(View,{style:[J.container,I],testID:D,children:[re?_jsx(FieldLabel,{size:T,required:m,help:x,style:V,children:h}):null,_jsx(View,{ref:t,collapsable:!1,children:_jsxs(FieldBase,{size:T,variant:W,disabled:y,error:ne,filled:Z.length>0,onPress:ee,radius:F,paddingHorizontal:"underline"===W?G.space.none:void 0,accessibilityRole:"button",accessibilityLabel:ue,accessibilityState:{disabled:y,expanded:X},"aria-disabled":y,"aria-expanded":X,style:k,slotAlign:1===v?"center":"top",slotLineHeight:1===v?void 0:ae,leading:j?_jsx(View,{children:renderSlotIcon(j,de)}):null,trailing:L?_jsx(View,{children:renderSlotIcon(L,de)}):_jsx(Chevron,{color:_??(y?G.colors["text-disabled"]:G.colors["text-subtle"]),size:O??K.icon,open:X,style:J.chevron}),children:[hasFieldText(b)?"string"==typeof b||"number"==typeof b?_jsx(Text,{variant:"body",style:[J.prefix,{color:Q.placeholderColor,fontSize:K.text,lineHeight:1===v?void 0:ae,marginRight:G.space.xs}],children:b}):_jsx(View,{style:[J.prefixNode,{minHeight:1===v?void 0:ae,justifyContent:"center",marginRight:G.space.xs}],children:_jsx(Text,{variant:"body",style:[J.prefix,{color:Q.placeholderColor,fontSize:K.text,lineHeight:1===v?void 0:ae}],children:_jsx(TextInkContext.Provider,{value:ce,children:b})})}):null,_jsxs(Text,{variant:"body",style:[J.triggerText,{color:oe?Q.placeholderColor:Q.color,fontSize:K.text,lineHeight:1===v?void 0:ae,...Q.weightStyle},z],numberOfLines:v,children:[ie,oe&&m&&!re?_jsx(RequiredMark,{}):null]})]})}),_jsx(FieldMessage,{size:T,error:ne,text:ne?f:g}),_jsx(OptionSheet,{open:X,onClose:te,onOpenChange:c,haptic:p,title:S??se,accessibilityLabel:se??(re?S:void 0)??a??N.sheetName,options:l,getOptionLabel:M,getOptionValue:R,isOptionDisabled:U,getOptionDescription:q,getOptionIcon:$,value:e.value,onChange:(e,t)=>le(t),multi:B,searchable:d,labels:{searchPlaceholder:N.searchPlaceholder,empty:N.empty},optionStyle:A,selectedOptionStyle:H,optionTextStyle:w,selectedOptionTextStyle:P,searchSelectionColor:resolveVariantColors(G,W).borderFocusedRepresentative})]})});Select.displayName="Select";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},label:{includeFontPadding:!1},triggerText:{flex:1,includeFontPadding:!1},errorText:{includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},chevron:{marginLeft:e.space.sm}});export{Select};export default Select;
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{AppIcon,renderSlotIcon}from"../AppIcon/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{IconButton}from"../IconButton/index.js";import{Slider}from"../Slider/index.js";import{CountingText,clampValue,sliderToneInk,snapValue,useValueDraft}from"../Slider/valueText.js";import{Text}from"../Text/index.js";import{Tooltip}from"../Tooltip/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SLIDER_FIELD_LABELS=Object.freeze({about:e=>`About ${e}`,decrease:"Decrease",increase:"Increase",fallbackName:"Value",low:e=>`${e} low`,high:e=>`${e} high`,current:e=>`${e} value`});const DEFAULT_INPUT_WIDTH=72,defaultFormatValue=e=>String(e),stepDecimals=e=>String(e).split(".")[1]?.length??0,ValueBox=({draft:e,error:l,disabled:t,width:i,accessibilityLabel:a,styles:s,style:o,testID:r})=>{const n=useTheme(),d=resolveFieldSize(n,"sm"),c=resolveFieldTextStyle(n,{disabled:t}),u=useRef(null),m=useCallback(()=>{t||u.current?.focus()},[t]);return _jsx(FieldBase,{size:"sm",focused:e.editing,disabled:t,error:l,filled:!0,width:i,onPress:m,pressFeedback:!1,paddingHorizontal:n.space.sm,gap:n.space.xs,trailing:l?_jsx(AppIcon,{name:"info-circle",size:d.icon,color:n.colors["danger-text"]}):void 0,style:o,children:_jsx(TextInput,{ref:u,style:[s.boxInput,{color:c.color,fontSize:d.text,...c.weightStyle}],value:e.text,onChangeText:e.onChangeText,onFocus:e.onFocus,onBlur:e.onBlur,onSubmitEditing:e.onBlur,editable:!t,keyboardType:"decimal-pad",returnKeyType:"done",textAlign:"center",selectionColor:n.colors.primary,accessibilityLabel:a,accessibilityState:{disabled:t},"aria-disabled":t,testID:r})})},SliderField=forwardRef((e,l)=>{const{label:t,unit:i,info:a,required:s=!1,helperText:o,error:r,min:n=0,max:d=100,step:c=1,disabled:u=!1,tone:m="primary",size:p,variant:b,haptic:x,showBubble:h=!0,showBounds:f=!0,showInput:y=!1,showStepper:I=!1,startIcon:S,endIcon:g,startLabel:j,endLabel:w,formatValue:v=defaultFormatValue,parseInput:T,animationDuration:_,inputWidth:F=DEFAULT_INPUT_WIDTH,labels:V,accessibilityLabel:D,style:L,labelStyle:B,boundStyle:z,sliderStyle:C,inputStyle:A,testID:k}=e;warnInvalidValue("SliderField","tone",e.tone,["primary","success","warning","danger","info","neutral"]),warnInvalidValue("SliderField","size",e.size,["sm","md","lg"]),warnInvalidValue("SliderField","variant",e.variant,["default","inset","minimal","bar"]);const E=useMemo(()=>({...DEFAULT_SLIDER_FIELD_LABELS,...V}),[V]),M=useTheme(),$=useMemo(()=>buildStyles(M),[M]),R=_??M.motion.duration.fast,P=!0===e.range,N=!0===r||hasFieldText(r),W=stepDecimals(c),[U,H]=useControllableState({value:e.value,defaultValue:e.defaultValue??(P?[n,d]:n),onChange:e.onChange}),[q,K]=P?U:[U,d],O=clampValue(Math.min(q,K),n,d),G=clampValue(Math.max(q,K),n,d),J=useValueDraft({value:O,min:n,max:d,step:c,format:v,parse:T,onChange:e=>H(P?[Math.min(e,G),G]:e)}),Q=useValueDraft({value:G,min:n,max:d,step:c,format:v,parse:T,onChange:e=>H([O,Math.max(e,O)])}),stepBy=e=>{const l=snapValue(O+e*c,n,d,c);l!==O&&H(l)},X={color:u?M.colors["text-disabled"]:M.colors["text-muted"],size:resolveFieldSize(M,"md").icon,disabled:u},Y=[$.bubbleText,{color:sliderToneInk(M,m)}],boundText=e=>_jsx(Text,{variant:"bodySmall",style:[$.bound,{color:u?M.colors["text-disabled"]:M.colors["text-muted"]},z],children:e}),Z={min:n,max:d,step:c,disabled:u,tone:m,size:p,variant:b,haptic:x,showLabel:!!h&&"always",renderLabel:h?e=>_jsx(CountingText,{value:e,format:v,decimals:W,duration:R,style:Y,testID:k&&!P?`${k}-bubble`:void 0}):void 0,accessibilityLabel:D??t,style:C,testID:k?`${k}-slider`:void 0};return _jsxs(View,{ref:l,style:[$.container,L],testID:k,children:[t?_jsxs(View,{style:$.labelRow,children:[_jsx(FieldLabel,{required:s,style:B,children:t}),i?_jsx(Text,{variant:"caption",style:{color:M.colors["text-subtle"]},children:i}):null,a?_jsx(Tooltip,{content:a,trigger:"press",placement:"top",children:_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:E.about(t),hitSlop:8,...hitSlopMarker(8),style:$.infoButton,children:_jsx(AppIcon,{name:"info-circle",variant:"bold",size:16,color:M.colors["text-subtle"]})})}):null]}):null,_jsxs(View,{style:[$.row,h?$.rowWithBubble:null],children:[S?_jsx(View,{children:renderSlotIcon(S,X)}):null,I&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"minus",size:e.size,color:e.color}),onPress:()=>stepBy(-1),accessibilityLabel:E.decrease,variant:"ghost",tone:"neutral",size:"sm",disabled:u||O<=n,haptic:x,testID:k?`${k}-minus`:void 0}):null,P&&y?_jsx(ValueBox,{draft:J,error:N,disabled:u,width:F,accessibilityLabel:E.low(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input-low`:void 0}):f?boundText(j??v(n)):null,_jsx(View,{style:$.sliderWrap,children:_jsx(Slider,P?{...Z,range:!0,value:[O,G],onChange:H}:{...Z,value:O,onChange:H})}),P&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:F,accessibilityLabel:E.high(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input-high`:void 0}):f?boundText(w??v(d)):null,I&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"add",size:e.size,color:e.color}),onPress:()=>stepBy(1),accessibilityLabel:E.increase,variant:"ghost",tone:"neutral",size:"sm",disabled:u||O>=d,haptic:x,testID:k?`${k}-plus`:void 0}):null,g?_jsx(View,{children:renderSlotIcon(g,X)}):null,!P&&y?_jsx(ValueBox,{draft:J,error:N,disabled:u,width:F,accessibilityLabel:E.current(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input`:void 0}):null]}),_jsx(FieldMessage,{text:N?r:o,error:N})]})});SliderField.displayName="SliderField";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",gap:e.space.xs},infoButton:{marginLeft:e.space.xxs},row:{flexDirection:"row",alignItems:"center",gap:e.space.sm},rowWithBubble:{marginTop:e.space.lg},sliderWrap:{flex:1,paddingHorizontal:e.space.sm},bound:{fontVariant:["tabular-nums"]},bubbleText:{fontVariant:["tabular-nums"]},boxInput:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SliderField};export default SliderField;
1
+ "use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{AppIcon,renderSlotIcon}from"../AppIcon/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{IconButton}from"../IconButton/index.js";import{Slider}from"../Slider/index.js";import{CountingText,clampValue,sliderToneInk,snapValue,useValueDraft}from"../Slider/valueText.js";import{Text}from"../Text/index.js";import{Tooltip}from"../Tooltip/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SLIDER_FIELD_LABELS=Object.freeze({about:e=>`About ${e}`,decrease:"Decrease",increase:"Increase",fallbackName:"Value",low:e=>`${e} low`,high:e=>`${e} high`,current:e=>`${e} value`});const DEFAULT_INPUT_WIDTH=72,defaultFormatValue=e=>String(e),stepDecimals=e=>String(e).split(".")[1]?.length??0,ValueBox=({draft:e,error:l,disabled:t,width:i,accessibilityLabel:a,styles:s,style:o,testID:r})=>{const n=useTheme(),d=resolveFieldSize(n,"sm"),c=resolveFieldTextStyle(n,{disabled:t}),u=useRef(null),m=useCallback(()=>{t||u.current?.focus()},[t]);return _jsx(FieldBase,{size:"sm",focused:e.editing,disabled:t,error:l,filled:!0,width:i,onPress:m,pressFeedback:!1,paddingHorizontal:n.space.sm,gap:n.space.xs,trailing:l?_jsx(AppIcon,{name:"info-circle",size:d.icon,color:n.colors["danger-text"]}):void 0,style:o,children:_jsx(TextInput,{ref:u,style:[s.boxInput,{color:c.color,fontSize:d.text,...c.weightStyle}],value:e.text,onChangeText:e.onChangeText,onFocus:e.onFocus,onBlur:e.onBlur,onSubmitEditing:e.onBlur,editable:!t,keyboardType:"decimal-pad",returnKeyType:"done",textAlign:"center",selectionColor:n.colors.primary,accessibilityLabel:a,accessibilityState:{disabled:t},"aria-disabled":t,testID:r})})},SliderField=forwardRef((e,l)=>{const{label:t,unit:i,info:a,required:s=!1,helperText:o,error:r,min:n=0,max:d=100,step:c=1,disabled:u=!1,tone:m="primary",size:p,variant:b,haptic:x,showBubble:h=!0,showBounds:f=!0,showInput:y=!1,showStepper:I=!1,leftIcon:g,rightIcon:S,startLabel:j,endLabel:w,formatValue:v=defaultFormatValue,parseInput:T,animationDuration:_,inputWidth:F=DEFAULT_INPUT_WIDTH,labels:V,accessibilityLabel:D,style:L,labelStyle:B,boundStyle:z,sliderStyle:C,inputStyle:A,testID:k}=e;warnInvalidValue("SliderField","tone",e.tone,["primary","success","warning","danger","info","neutral"]),warnInvalidValue("SliderField","size",e.size,["sm","md","lg"]),warnInvalidValue("SliderField","variant",e.variant,["default","inset","minimal","bar"]);const E=useMemo(()=>({...DEFAULT_SLIDER_FIELD_LABELS,...V}),[V]),M=useTheme(),$=useMemo(()=>buildStyles(M),[M]),R=_??M.motion.duration.fast,P=!0===e.range,N=!0===r||hasFieldText(r),W=stepDecimals(c),[U,H]=useControllableState({value:e.value,defaultValue:e.defaultValue??(P?[n,d]:n),onChange:e.onChange}),[q,K]=P?U:[U,d],O=clampValue(Math.min(q,K),n,d),G=clampValue(Math.max(q,K),n,d),J=useValueDraft({value:O,min:n,max:d,step:c,format:v,parse:T,onChange:e=>H(P?[Math.min(e,G),G]:e)}),Q=useValueDraft({value:G,min:n,max:d,step:c,format:v,parse:T,onChange:e=>H([O,Math.max(e,O)])}),stepBy=e=>{const l=snapValue(O+e*c,n,d,c);l!==O&&H(l)},X={color:u?M.colors["text-disabled"]:M.colors["text-muted"],size:resolveFieldSize(M,"md").icon,disabled:u},Y=[$.bubbleText,{color:sliderToneInk(M,m)}],boundText=e=>_jsx(Text,{variant:"bodySmall",style:[$.bound,{color:u?M.colors["text-disabled"]:M.colors["text-muted"]},z],children:e}),Z={min:n,max:d,step:c,disabled:u,tone:m,size:p,variant:b,haptic:x,showLabel:!!h&&"always",renderLabel:h?e=>_jsx(CountingText,{value:e,format:v,decimals:W,duration:R,style:Y,testID:k&&!P?`${k}-bubble`:void 0}):void 0,accessibilityLabel:D??t,style:C,testID:k?`${k}-slider`:void 0};return _jsxs(View,{ref:l,style:[$.container,L],testID:k,children:[t?_jsxs(View,{style:$.labelRow,children:[_jsx(FieldLabel,{required:s,style:B,children:t}),i?_jsx(Text,{variant:"caption",style:{color:M.colors["text-subtle"]},children:i}):null,a?_jsx(Tooltip,{content:a,trigger:"press",placement:"top",children:_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:E.about(t),hitSlop:8,...hitSlopMarker(8),style:$.infoButton,children:_jsx(AppIcon,{name:"info-circle",variant:"bold",size:16,color:M.colors["text-subtle"]})})}):null]}):null,_jsxs(View,{style:[$.row,h?$.rowWithBubble:null],children:[g?_jsx(View,{children:renderSlotIcon(g,X)}):null,I&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"minus",size:e.size,color:e.color}),onPress:()=>stepBy(-1),accessibilityLabel:E.decrease,variant:"ghost",tone:"neutral",size:"sm",disabled:u||O<=n,haptic:x,testID:k?`${k}-minus`:void 0}):null,P&&y?_jsx(ValueBox,{draft:J,error:N,disabled:u,width:F,accessibilityLabel:E.low(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input-low`:void 0}):f?boundText(j??v(n)):null,_jsx(View,{style:$.sliderWrap,children:_jsx(Slider,P?{...Z,range:!0,value:[O,G],onChange:H}:{...Z,value:O,onChange:H})}),P&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:F,accessibilityLabel:E.high(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input-high`:void 0}):f?boundText(w??v(d)):null,I&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"add",size:e.size,color:e.color}),onPress:()=>stepBy(1),accessibilityLabel:E.increase,variant:"ghost",tone:"neutral",size:"sm",disabled:u||O>=d,haptic:x,testID:k?`${k}-plus`:void 0}):null,S?_jsx(View,{children:renderSlotIcon(S,X)}):null,!P&&y?_jsx(ValueBox,{draft:J,error:N,disabled:u,width:F,accessibilityLabel:E.current(t??E.fallbackName),styles:$,style:A,testID:k?`${k}-input`:void 0}):null]}),_jsx(FieldMessage,{text:N?r:o,error:N})]})});SliderField.displayName="SliderField";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",gap:e.space.xs},infoButton:{marginLeft:e.space.xxs},row:{flexDirection:"row",alignItems:"center",gap:e.space.sm},rowWithBubble:{marginTop:e.space.lg},sliderWrap:{flex:1,paddingHorizontal:e.space.sm},bound:{fontVariant:["tabular-nums"]},bubbleText:{fontVariant:["tabular-nums"]},boxInput:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SliderField};export default SliderField;
@@ -1 +1 @@
1
- "use strict";import{Image}from"expo-image";import{Platform,StyleSheet,View}from"react-native";import Svg,{Path}from"react-native-svg";import{useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{squirclePath}from"../../utils/squircle.js";import{useSquircle}from"../SquircleFill/SquircleFill.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const CornerMask=({width:e,height:o,radius:r,color:t,smoothing:i})=>{const s=`M 0 0 H ${e} V ${o} H 0 Z ${squirclePath({width:e,height:o,radius:r,smoothing:i})}`;return _jsx(View,{pointerEvents:"none",style:StyleSheet.absoluteFill,children:_jsx(Svg,{width:e,height:o,viewBox:`0 0 ${e} ${o}`,children:_jsx(Path,{d:s,fill:t,fillRule:"evenodd"})})})},SquircleImage=({borderRadius:e,cornerColor:o,style:r,onLayout:t,...i})=>{const s=useTheme(),l=useSquircle(e>0,e,t),a={borderRadius:e,overflow:"hidden"};if("ios"===Platform.OS){const e={...a,...smoothCorners};return _jsx(Image,{...i,onLayout:l.onLayout,style:[r,e]})}const n=l.active?l.size:null;return _jsxs(View,{style:[r,a],onLayout:l.onLayout,children:[_jsx(Image,{...i,style:StyleSheet.absoluteFill}),n?_jsx(CornerMask,{width:n.width,height:n.height,radius:e,color:o??s.colors.bg,smoothing:s.cornerSmoothing}):null]})};SquircleImage.displayName="SquircleImage";export{SquircleImage};export default SquircleImage;
1
+ "use strict";import{Image}from"expo-image";import{Platform,StyleSheet,View}from"react-native";import Svg,{Path}from"react-native-svg";import{radiusOf,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{squirclePath}from"../../utils/squircle.js";import{useSquircle}from"../SquircleFill/SquircleFill.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const CornerMask=({width:e,height:r,radius:o,color:t,smoothing:i})=>{const s=`M 0 0 H ${e} V ${r} H 0 Z ${squirclePath({width:e,height:r,radius:o,smoothing:i})}`;return _jsx(View,{pointerEvents:"none",style:StyleSheet.absoluteFill,children:_jsx(Svg,{width:e,height:r,viewBox:`0 0 ${e} ${r}`,children:_jsx(Path,{d:s,fill:t,fillRule:"evenodd"})})})},SquircleImage=({radius:e,cornerColor:r,style:o,onLayout:t,...i})=>{const s=useTheme(),l=radiusOf(s,e),a=useSquircle(l>0,l,t),u={borderRadius:l,overflow:"hidden"};if("ios"===Platform.OS){const e={...u,...smoothCorners};return _jsx(Image,{...i,onLayout:a.onLayout,style:[o,e]})}const n=a.active?a.size:null;return _jsxs(View,{style:[o,u],onLayout:a.onLayout,children:[_jsx(Image,{...i,style:StyleSheet.absoluteFill}),n?_jsx(CornerMask,{width:n.width,height:n.height,radius:l,color:r??s.colors.bg,smoothing:s.cornerSmoothing}):null]})};SquircleImage.displayName="SquircleImage";export{SquircleImage};export default SquircleImage;
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useMemo}from"react";import{Text as RNText}from"react-native";import{fontFor,useTheme}from"../../theme/index.js";import{TEXT_NAMES}from"../../theme/tokens.generated.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{NotationInkContext,useNotationInk}from"../Notation/Notation.js";import{jsx as _jsx}from"react/jsx-runtime";const VARIANTS={display:{size:"4xl",weight:"bold",line:"display",color:"primary",heading:!0,fontFamily:"display"},h1:{size:"3xl",weight:"bold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h2:{size:"2xl",weight:"semibold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h3:{size:"xl",weight:"semibold",line:"heading",color:"primary",heading:!0},title:{size:"lg",weight:"semibold",line:"body",color:"primary",fontFamily:"display"},body:{size:"base",weight:"normal",line:"body",color:"primary"},bodySmall:{size:"sm",weight:"normal",line:"body",color:"secondary"},caption:{size:"xs",weight:"normal",line:"body",color:"tertiary"},label:{size:"sm",weight:"medium",line:"body",color:"secondary"},overline:{size:"xs",weight:"semibold",line:"body",color:"secondary",uppercase:!0,letterSpacing:"wide"}},TEXT_ROLE_COLOR={textStrong:"text",primary:"text-body",secondary:"text-muted",tertiary:"text-subtle",inverse:"text-inverse",disabled:"text-disabled",link:"link",brand:"primary"},SEMANTIC={success:!0,warning:!0,danger:!0,info:!0,neutral:!0},COLOR_NAMES=["primary","secondary","tertiary","inverse","disabled","link","textStrong","brand","success","warning","danger","info","neutral"];export const resolveColor=(e,t)=>Object.hasOwn(TEXT_ROLE_COLOR,t)?e.colors[TEXT_ROLE_COLOR[t]]:Object.hasOwn(SEMANTIC,t)?e.colors[`${t}-text`]:t;const resolveVariantColor=(e,t)=>Object.hasOwn(TEXT_ROLE_COLOR,t)||Object.hasOwn(SEMANTIC,t)?resolveColor(e,t):e.colors[t],Text=forwardRef((e,t)=>{const{variant:i="body",color:o,weight:r,size:n,align:a,italic:l,underline:s,style:d,children:c,...m}=e,y=useTheme(),g=Object.hasOwn(VARIANTS,i),p=y.settings.textVariants,x=!g&&p&&Object.hasOwn(p,i)?p[i]:void 0;g||x||warnInvalidValue("Text","variant",e.variant,[...Object.keys(VARIANTS),...Object.keys(p??{})]),warnInvalidValue("Text","color",o,COLOR_NAMES),warnInvalidValue("Text","size",n,TEXT_NAMES);const h=void 0!==o&&COLOR_NAMES.includes(o)?o:void 0,u=useMemo(()=>{if(x){const e=n??x.size,t=y.text[e].size;return{fontSize:t,lineHeight:x.lineHeight??Math.round(t*y.leading[x.heading?"heading":"body"]),color:void 0!==h?resolveColor(y,h):x.color?resolveVariantColor(y,x.color):resolveColor(y,"primary"),textAlign:a,textTransform:x.uppercase?"uppercase":void 0,letterSpacing:x.letterSpacing?y["letter-spacing"][x.letterSpacing]:void 0,fontStyle:l||x.italic?"italic":void 0,fontVariant:x.fontVariant,textDecorationLine:s?"underline":void 0,...fontFor(y,r??x.weight??"normal",x.fontFamily)}}const e=VARIANTS[g?i:"body"],t=y.text[n??e.size].size;return{fontSize:t,lineHeight:Math.round(t*y.leading[e.line]),color:resolveColor(y,h??e.color),textAlign:a,textTransform:e.uppercase?"uppercase":void 0,letterSpacing:e.letterSpacing?y["letter-spacing"][e.letterSpacing]:void 0,fontStyle:l?"italic":void 0,textDecorationLine:s?"underline":void 0,...fontFor(y,r??e.weight,e.fontFamily)}},[y,x,g,i,h,r,n,a,l,s]),b=useNotationInk([u,d],y.text.base.size,y.colors["text-body"]),f=g?VARIANTS[i].heading:x?.heading,T="string"==typeof c||"number"==typeof c;return _jsx(RNText,{ref:t,style:[u,d],maxFontSizeMultiplier:y.settings.maxFontSizeMultiplier,accessibilityRole:f?"header":m.accessibilityRole,...m,children:T?c:_jsx(NotationInkContext.Provider,{value:b,children:c})})});Text.displayName="Text";export{Text};export default Text;
1
+ "use strict";import{forwardRef,useMemo}from"react";import{Text as RNText}from"react-native";import{fontFor,useTheme}from"../../theme/index.js";import{TEXT_NAMES}from"../../theme/tokens.generated.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{TextInkContext,useTextInk}from"./textInk.js";import{jsx as _jsx}from"react/jsx-runtime";const VARIANTS={display:{size:"4xl",weight:"bold",line:"display",color:"primary",heading:!0,fontFamily:"display"},h1:{size:"3xl",weight:"bold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h2:{size:"2xl",weight:"semibold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h3:{size:"xl",weight:"semibold",line:"heading",color:"primary",heading:!0},title:{size:"lg",weight:"semibold",line:"body",color:"primary",fontFamily:"display"},body:{size:"base",weight:"normal",line:"body",color:"primary"},bodySmall:{size:"sm",weight:"normal",line:"body",color:"secondary"},caption:{size:"xs",weight:"normal",line:"body",color:"tertiary"},label:{size:"sm",weight:"medium",line:"body",color:"secondary"},overline:{size:"xs",weight:"semibold",line:"body",color:"secondary",uppercase:!0,letterSpacing:"wide"}},TEXT_ROLE_COLOR={textStrong:"text",primary:"text-body",secondary:"text-muted",tertiary:"text-subtle",inverse:"text-inverse",disabled:"text-disabled",link:"link",brand:"primary-text"},SEMANTIC={success:!0,warning:!0,danger:!0,info:!0,neutral:!0},COLOR_NAMES=["primary","secondary","tertiary","inverse","disabled","link","textStrong","brand","success","warning","danger","info","neutral"];export const resolveColor=(e,t)=>Object.hasOwn(TEXT_ROLE_COLOR,t)?e.colors[TEXT_ROLE_COLOR[t]]:Object.hasOwn(SEMANTIC,t)?e.colors[`${t}-text`]:t;const resolveVariantColor=(e,t)=>Object.hasOwn(TEXT_ROLE_COLOR,t)||Object.hasOwn(SEMANTIC,t)?resolveColor(e,t):e.colors[t],decorationOf=(e,t)=>e&&t?"underline line-through":e?"underline":t?"line-through":void 0,Text=forwardRef((e,t)=>{const{variant:i="body",color:o,weight:r,size:n,align:a,italic:l,underline:s,strikethrough:d,style:c,children:m,...x}=e,g=useTheme(),y=Object.hasOwn(VARIANTS,i),h=g.settings.textVariants,p=!y&&h&&Object.hasOwn(h,i)?h[i]:void 0;y||p||warnInvalidValue("Text","variant",e.variant,[...Object.keys(VARIANTS),...Object.keys(h??{})]),warnInvalidValue("Text","color",o,COLOR_NAMES),warnInvalidValue("Text","size",n,TEXT_NAMES);const u=void 0!==o&&COLOR_NAMES.includes(o)?o:void 0,b=useMemo(()=>{if(p){const e=n??p.size,t=g.text[e].size;return{fontSize:t,lineHeight:p.lineHeight??Math.round(t*g.leading[p.heading?"heading":"body"]),color:void 0!==u?resolveColor(g,u):p.color?resolveVariantColor(g,p.color):resolveColor(g,"primary"),textAlign:a,textTransform:p.uppercase?"uppercase":void 0,letterSpacing:p.letterSpacing?g["letter-spacing"][p.letterSpacing]:void 0,fontStyle:l||p.italic?"italic":void 0,fontVariant:p.fontVariant,textDecorationLine:decorationOf(s,d),...fontFor(g,r??p.weight??"normal",p.fontFamily)}}const e=VARIANTS[y?i:"body"],t=g.text[n??e.size].size;return{fontSize:t,lineHeight:Math.round(t*g.leading[e.line]),color:resolveColor(g,u??e.color),textAlign:a,textTransform:e.uppercase?"uppercase":void 0,letterSpacing:e.letterSpacing?g["letter-spacing"][e.letterSpacing]:void 0,fontStyle:l?"italic":void 0,textDecorationLine:decorationOf(s,d),...fontFor(g,r??e.weight,e.fontFamily)}},[g,p,y,i,u,r,n,a,l,s,d]),T=useTextInk([b,c],g.text.base.size,g.colors["text-body"]),f=y?VARIANTS[i].heading:p?.heading,O="string"==typeof m||"number"==typeof m;return _jsx(RNText,{ref:t,style:[b,c],maxFontSizeMultiplier:g.settings.maxFontSizeMultiplier,accessibilityRole:f?"header":x.accessibilityRole,...x,children:O?m:_jsx(TextInkContext.Provider,{value:T,children:m})})});Text.displayName="Text";export{Text};export default Text;
@@ -0,0 +1 @@
1
+ "use strict";import{createContext,useMemo}from"react";import{StyleSheet}from"react-native";export const TextInkContext=createContext(null);export const useTextInk=(t,e,o)=>{const r=StyleSheet.flatten(t),n=r?.fontSize??e,c=r?.color??o;return useMemo(()=>({fontSize:n,color:c}),[n,c])};
@@ -1 +1 @@
1
- "use strict";import{useCallback,useEffect,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import Button from"../Button/Button.js";import{Modal}from"../Modal/index.js";import{PickerTrigger}from"../PickerTrigger/PickerTrigger.js";import{Text}from"../Text/index.js";import{WheelPicker}from"../WheelPicker/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"});const range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{visible:t,value:i,onChange:r,onClose:a,format:o="12h",minuteStep:s=1,labels:n,testID:l,style:u,containerStyle:m,headerLabelStyle:c,footerButtonStyle:p,label:d,placeholder:h,helperText:f,error:b,required:g,disabled:y,size:M,variant:x,clearable:S,onClear:v,formatValue:k,triggerStyle:T,haptic:P}=e;warnInvalidValue("TimePicker","format",e.format,["12h","24h"]),warnInvalidValue("TimePicker","minuteStep",e.minuteStep?.toString(),["1","5","15","30"]),warnInvalidValue("TimePicker","size",e.size,["sm","md","lg"]),warnInvalidValue("TimePicker","variant",e.variant,["outline","filled","underline"]);const j=useMemo(()=>({...DEFAULT_TIME_PICKER_LABELS,...n}),[n]),H=void 0!==e.visible,[I,_]=useState(!1),w=H?t:I,C=H?l:l?`${l}-modal`:void 0,D=useTheme(),B=useMemo(()=>buildStyles(D),[D]),$=useCallback(()=>{H?a?.():_(!1)},[H,a]),A=useMemo(()=>"24h"===o?range(0,23):range(1,12),[o]),L=useMemo(()=>range(0,59,s),[s]),F=useMemo(()=>["AM","PM"],[]),E=useMemo(()=>{const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,s),{displayHour:a,period:n}=from24h(e,o);return{displayHour:a,minute:r,period:n,hour24:e}},[i,o,s]),[V,N]=useState(()=>{const e=A.indexOf(E.displayHour);return e>=0?e:0}),[O,z]=useState(()=>{const e=L.indexOf(E.minute);return e>=0?e:0}),[W,R]=useState(()=>"PM"===E.period?1:0);useEffect(()=>{if(!w)return;const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,s),{displayHour:a,period:n}=from24h(e,o),l=A.indexOf(a);N(l>=0?l:0);const u=L.indexOf(r);z(u>=0?u:0),R("PM"===n?1:0)},[w,i,o,s,A,L]);const U=useCallback((e,t)=>{"hour"===e?N(Math.max(0,A.indexOf(Number(t)))):"minute"===e?z(Math.max(0,L.indexOf(Number(t)))):R("PM"===t?1:0)},[A,L]),q=useCallback(()=>{!1!==P&&triggerHaptic("selection"),$()},[$,P]),K=useCallback(()=>{const e=A[V]??0,t=F[W]??"AM",i=to24h(e,t,o),a=L[O]??0;!1!==P&&triggerHaptic("notificationSuccess"),r?.({hour:i,minute:a}),$()},[A,V,F,W,L,O,o,r,$,P]),G=useMemo(()=>{const e=A[V]??0,t=L[O]??0;if("24h"===o)return`${pad2(e)}:${pad2(t)}`;const i=F[W]??"AM";return`${pad2(e)}:${pad2(t)} ${i}`},[A,V,L,O,F,W,o]),J=useMemo(()=>A.map(e=>({value:e,label:pad2(e),accessibilityLabel:j.hourItem(e)})),[A,j]),Q=useMemo(()=>L.map(e=>({value:e,label:pad2(e),accessibilityLabel:j.minuteItem(e)})),[L,j]),X=useMemo(()=>F.map(e=>({value:e,label:e})),[F]),Y=useMemo(()=>{const e=[{key:"hour",label:j.hour,items:J,value:A[V]??0,separator:":",testID:"time-picker-hour"},{key:"minute",label:j.minute,items:Q,value:L[O]??0,gapAfter:"12h"===o?D.space.md:void 0,testID:"time-picker-minute"}];return"12h"===o&&e.push({key:"period",label:j.period,items:X,value:F[W]??"AM",testID:"time-picker-period"}),e},[J,Q,X,A,V,L,O,F,W,o,D.space.md,j]),Z=useCallback(e=>{if("24h"===o)return`${pad2(e.hour)}:${pad2(e.minute)}`;const{displayHour:t,period:i}=from24h(e.hour,"12h");return`${t}:${pad2(e.minute)} ${i}`},[o]),ee=!H&&i&&Number.isFinite(i.hour)&&Number.isFinite(i.minute)?(k??Z)(i):void 0,te=_jsxs(Modal,{visible:w,onClose:$,presentation:"bottom",accessibilityLabel:j.title,haptic:P,contentStyle:[u,m],testID:C,children:[_jsx(Text,{variant:"title",align:"center",accessibilityRole:"header",style:[B.title,c],children:j.title}),_jsx(View,{style:B.summaryWrap,accessibilityLiveRegion:"polite",accessibilityLabel:j.selected(G),children:_jsx(Text,{variant:"h2",weight:"bold",color:"brand",style:B.summary,children:G})}),_jsx(WheelPicker,{columns:Y,onChange:U,haptic:P,style:B.wheels}),_jsxs(View,{style:B.footer,children:[_jsx(Button,{label:j.cancel,haptic:!1,variant:"ghost",tone:"neutral",onPress:q,style:[B.footerBtn,p],accessibilityHint:j.cancelHint,testID:"time-picker-cancel"}),_jsx(Button,{label:j.confirm,variant:"solid",tone:"primary",haptic:!1,onPress:K,style:[B.footerBtn,p],accessibilityHint:j.confirmHint,testID:"time-picker-confirm"})]})]});return H?te:_jsxs(_Fragment,{children:[_jsx(PickerTrigger,{label:d,placeholder:h,helperText:f,error:b,required:g,disabled:y,size:M,variant:x,clearable:S,onClear:v,value:ee,onPress:()=>_(!0),triggerStyle:T,testID:l}),te]})},buildStyles=e=>StyleSheet.create({title:{marginBottom:e.space.sm},summaryWrap:{alignItems:"center",marginBottom:e.space.md},summary:{letterSpacing:e["letter-spacing"].wide},wheels:{marginBottom:e.space.lg},footer:{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:e.space.sm},footerBtn:{paddingHorizontal:e.space.lg}});export{TimePicker};export default TimePicker;
1
+ "use strict";import{useCallback,useEffect,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import Button from"../Button/Button.js";import{Modal}from"../Modal/index.js";import{PickerTrigger}from"../PickerTrigger/PickerTrigger.js";import{Text}from"../Text/index.js";import{WheelPicker}from"../WheelPicker/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"});const range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{open:t,value:i,onChange:r,onClose:a,format:l="12h",minuteStep:o=1,labels:s,testID:n,style:u,containerStyle:m,headerLabelStyle:c,footerButtonStyle:p,formatValue:d,haptic:h,triggerLabels:g,label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:v,size:k,variant:T,clearable:I,onClear:P,leftIcon:j,trailing:H,triggerStyle:_,valueStyle:w,labelStyle:C,messageStyle:D,accessibilityLabel:L}=e,B={label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:v,size:k,variant:T,clearable:I,onClear:P,leftIcon:j,trailing:H,triggerStyle:_,valueStyle:w,labelStyle:C,messageStyle:D,accessibilityLabel:L};warnInvalidValue("TimePicker","format",e.format,["12h","24h"]),warnInvalidValue("TimePicker","minuteStep",e.minuteStep?.toString(),["1","5","15","30"]),warnInvalidValue("TimePicker","size",e.size,["sm","md","lg"]),warnInvalidValue("TimePicker","variant",e.variant,["outline","filled","underline"]);const $=useMemo(()=>({...DEFAULT_TIME_PICKER_LABELS,...s}),[s]),A=void 0!==e.open,[F,E]=useState(!1),V=A?t:F,N=A?n:n?`${n}-modal`:void 0,O=useTheme(),z=useMemo(()=>buildStyles(O),[O]),W=useCallback(()=>{A?a?.():E(!1)},[A,a]),R=useMemo(()=>"24h"===l?range(0,23):range(1,12),[l]),U=useMemo(()=>range(0,59,o),[o]),q=useMemo(()=>["AM","PM"],[]),K=useMemo(()=>{const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,o),{displayHour:a,period:s}=from24h(e,l);return{displayHour:a,minute:r,period:s,hour24:e}},[i,l,o]),[G,J]=useState(()=>{const e=R.indexOf(K.displayHour);return e>=0?e:0}),[Q,X]=useState(()=>{const e=U.indexOf(K.minute);return e>=0?e:0}),[Y,Z]=useState(()=>"PM"===K.period?1:0);useEffect(()=>{if(!V)return;const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,o),{displayHour:a,period:s}=from24h(e,l),n=R.indexOf(a);J(n>=0?n:0);const u=U.indexOf(r);X(u>=0?u:0),Z("PM"===s?1:0)},[V,i,l,o,R,U]);const ee=useCallback((e,t)=>{"hour"===e?J(Math.max(0,R.indexOf(Number(t)))):"minute"===e?X(Math.max(0,U.indexOf(Number(t)))):Z("PM"===t?1:0)},[R,U]),te=useCallback(()=>{!1!==h&&triggerHaptic("selection"),W()},[W,h]),ie=useCallback(()=>{const e=R[G]??0,t=q[Y]??"AM",i=to24h(e,t,l),a=U[Q]??0;!1!==h&&triggerHaptic("notificationSuccess"),r?.({hour:i,minute:a}),W()},[R,G,q,Y,U,Q,l,r,W,h]),re=useMemo(()=>{const e=R[G]??0,t=U[Q]??0;if("24h"===l)return`${pad2(e)}:${pad2(t)}`;const i=q[Y]??"AM";return`${pad2(e)}:${pad2(t)} ${i}`},[R,G,U,Q,q,Y,l]),ae=useMemo(()=>R.map(e=>({value:e,label:pad2(e),accessibilityLabel:$.hourItem(e)})),[R,$]),le=useMemo(()=>U.map(e=>({value:e,label:pad2(e),accessibilityLabel:$.minuteItem(e)})),[U,$]),oe=useMemo(()=>q.map(e=>({value:e,label:e})),[q]),se=useMemo(()=>{const e=[{key:"hour",label:$.hour,items:ae,value:R[G]??0,separator:":",testID:"time-picker-hour"},{key:"minute",label:$.minute,items:le,value:U[Q]??0,gapAfter:"12h"===l?O.space.md:void 0,testID:"time-picker-minute"}];return"12h"===l&&e.push({key:"period",label:$.period,items:oe,value:q[Y]??"AM",testID:"time-picker-period"}),e},[ae,le,oe,R,G,U,Q,q,Y,l,O.space.md,$]),ne=useCallback(e=>{if("24h"===l)return`${pad2(e.hour)}:${pad2(e.minute)}`;const{displayHour:t,period:i}=from24h(e.hour,"12h");return`${t}:${pad2(e.minute)} ${i}`},[l]),ue=!A&&i&&Number.isFinite(i.hour)&&Number.isFinite(i.minute)?(d??ne)(i):void 0,me=_jsxs(Modal,{open:V,onClose:W,presentation:"bottom",accessibilityLabel:$.title,haptic:h,contentStyle:[m,u],testID:N,children:[_jsx(Text,{variant:"title",align:"center",accessibilityRole:"header",style:[z.title,c],children:$.title}),_jsx(View,{style:z.summaryWrap,accessibilityLiveRegion:"polite",accessibilityLabel:$.selected(re),children:_jsx(Text,{variant:"h2",weight:"bold",color:"brand",style:z.summary,children:re})}),_jsx(WheelPicker,{columns:se,onChange:ee,haptic:h,style:z.wheels}),_jsxs(View,{style:z.footer,children:[_jsx(Button,{label:$.cancel,haptic:!1,variant:"ghost",tone:"neutral",onPress:te,style:[z.footerBtn,p],accessibilityHint:$.cancelHint,testID:"time-picker-cancel"}),_jsx(Button,{label:$.confirm,variant:"solid",tone:"primary",haptic:!1,onPress:ie,style:[z.footerBtn,p],accessibilityHint:$.confirmHint,testID:"time-picker-confirm"})]})]});return A?me:_jsxs(_Fragment,{children:[_jsx(PickerTrigger,{...B,labels:g,value:ue,onPress:()=>E(!0),testID:n}),me]})},buildStyles=e=>StyleSheet.create({title:{marginBottom:e.space.sm},summaryWrap:{alignItems:"center",marginBottom:e.space.md},summary:{letterSpacing:e["letter-spacing"].wide},wheels:{marginBottom:e.space.lg},footer:{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:e.space.sm},footerBtn:{paddingHorizontal:e.space.lg}});export{TimePicker};export default TimePicker;
@@ -1 +1 @@
1
- "use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Modal,Platform,Pressable,StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,setNativeValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{smoothCorners}from"../../utils/corners.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{claimAnchoredSurface}from"../../utils/placement.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{FOCUS_DELAY_MS,focusHost}from"../Menu/focusHost.js";import{ModalSafeArea,useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{ToastHost}from"../Toast/ToastProvider.js";import{RichTooltipBody}from"./RichTooltipBody.js";import{resolveTooltipPosition}from"./tooltipPosition.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TOOLTIP_LABELS=Object.freeze({close:"Close tooltip",longPressHint:"Long press for more info",fallbackName:"Tooltip"});const PRESS_AUTO_HIDE_MS=4e3,ARROW_HALF_WIDTH=4,ARROW_HEIGHT=6,ARROW_CORNER_PADDING=12,DEFAULT_MAX_WIDTH=240,RICH_MAX_WIDTH=280,MESSAGE_LINE_HEIGHT=18,EXIT_DURATION_MS=150,Tooltip=e=>{const{content:t,children:o,variant:r="plain",title:s,action:n,placement:i="auto",visible:a,onVisibleChange:l,hideOnContentPress:u=!0,maxWidth:c,showArrow:m=!0,accessibilityLabel:f,style:d,containerStyle:p,arrowStyle:h,messageStyle:g,labels:b,testID:S}=e;warnInvalidValue("Tooltip","variant",e.variant,["plain","rich"]),warnInvalidValue("Tooltip","placement",e.placement,["top","bottom","left","right","auto"]),warnInvalidValue("Tooltip","trigger",e.trigger,["longPress","press","manual"]);const T="rich"===r,y=e.trigger??(T?"press":"longPress"),R=useMemo(()=>({...DEFAULT_TOOLTIP_LABELS,...b}),[b]),_=useTheme(),v=usePresenceMotion(),w=useSafeAreaInsets(),[A,j]=useModalInsets(),x=useMemo(()=>({...w,top:A.top,bottom:A.bottom}),[w,A]),P=useWindowDimensions(),E=useMemo(()=>buildStyles(_),[_]),M=_.space.sm,C=_.space.sm,I=c??(T?280:240),L="press"===y&&!T,O=(_.settings.components.tooltip?.enableScaleAnimation??!1)&&!v.reduced,V="manual"===y||"boolean"==typeof a,[D,H]=useState(!1),W=V?Boolean(a):D,[F,k]=useState(null),[N,B]=useState({width:0,height:0}),U=useRef(null),z=useRef(null),G=useRef(null),X=useRef(null),Y=useRef(null),q=useRef(!1),J=useRef(!1),K=useRef(createAnimatedValue(W||!O?1:.85)).current,Q=useRef(createAnimatedValue(W?1:0)).current,Z=useRef(null),$=useRef(!1),[ee,te]=useState(W),oe=useCallback(e=>{V||H(e),l?.(e)},[V,l]),re=useCallback(()=>{U.current&&U.current.measureInWindow((e,t,o,r)=>{k({x:e,y:t,width:o,height:r})})},[]),se=useCallback(e=>{re(),oe(!0)},[re,oe]),ne=useCallback(()=>{oe(!1)},[oe]),ie=useRef(ne);ie.current=ne;const ae=useCallback(()=>{if(!q.current)return;q.current=!1;const e=Y.current;Y.current=null,e?e():T&&focusHost(z.current??U.current)},[T]);useEffect(()=>{if(W)return J.current=!0,q.current=!1,claimAnchoredSurface(()=>ie.current());J.current&&(J.current=!1,q.current=!0)},[W]),useEffect(()=>{W&&te(!0)},[W]);const le=useRef(ee);useEffect(()=>{le.current&&!ee&&"ios"!==Platform.OS&&ae(),le.current=ee},[ee,ae]);const ue=useCallback(()=>{Y.current=n?.onPress??null,ne()},[n,ne]);useEffect(()=>{if(!$.current)return $.current=!0,W&&(re(),L&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{ne()},4e3))),()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)};let e;if(W){re();const t=[Animated.timing(Q,{toValue:1,duration:v.duration("fast"),useNativeDriver:!0})];O?t.push(Animated.spring(K,{toValue:1,damping:_.motion.spring.snappy.damping,stiffness:_.motion.spring.snappy.stiffness,mass:_.motion.spring.snappy.mass,useNativeDriver:!0})):setNativeValue(K,1),e=Animated.parallel(t),e.start(),L&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{ne()},4e3))}else{const t=[Animated.timing(Q,{toValue:0,duration:v.reduced?v.duration("fast"):150,easing:Easing.bezier(..._.motion.ease.accelerate),useNativeDriver:!0})];O&&t.push(Animated.timing(K,{toValue:.85,duration:150,easing:Easing.bezier(..._.motion.ease.accelerate),useNativeDriver:!0})),e=Animated.parallel(t),e.start(({finished:e})=>{e&&te(!1)}),Z.current&&(clearTimeout(Z.current),Z.current=null)}return()=>{e?.stop(),Z.current&&(clearTimeout(Z.current),Z.current=null)}},[W]);const handleContentLayout=e=>{const{width:t,height:o}=e.nativeEvent.layout;t===N.width&&o===N.height||B({width:t,height:o})},ce=useMemo(()=>resolveTooltipPosition({anchor:F,size:N,placement:i,rich:T,viewport:{width:P.width,height:P.height,insets:x},maxWidth:I,gap:M,padding:C,arrowCornerPadding:12}),[F,N,i,T,P.width,P.height,x,I,M,C]),me=null!==F&&N.width>0,fe=W&&me;useEffect(()=>{if(!T||!fe)return;const e="web"===Platform.OS?X:G,t=setTimeout(()=>focusHost(e.current),FOCUS_DELAY_MS);return()=>clearTimeout(t)},[T,fe]),useEffect(()=>{!T&&fe&&"ios"===Platform.OS&&"string"==typeof t&&announce(t)},[T,fe,t]);const de=o.props,pe=useMemo(()=>mergeRefs(de.ref,z),[de.ref]),he={};"longPress"!==y||de.contextMenu?"press"===y&&(he.onPress=e=>{de.onPress?.(e),se(e)}):(he.onLongPress=se,he.accessibilityHint=R.longPressHint),T&&(he.ref=pe);const ge=React.cloneElement(o,he),be=f??("string"==typeof t?t:R.fallbackName),Se=useMemo(()=>{if(!m)return null;const e={position:"absolute",width:0,height:0,backgroundColor:"transparent",borderStyle:"solid",borderLeftWidth:4,borderRightWidth:4,borderBottomWidth:6,borderTopWidth:0,borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:T?_.colors.surface:_.colors["surface-inverse"]};return"top"===ce.placement?{...e,bottom:-6,left:ce.arrowOffset-4,transform:[{rotate:"180deg"}]}:"bottom"===ce.placement?{...e,top:-6,left:ce.arrowOffset-4}:"left"===ce.placement?{...e,right:-6,top:ce.arrowOffset-4,transform:[{rotate:"90deg"}]}:{...e,left:-6,top:ce.arrowOffset-4,transform:[{rotate:"-90deg"}]}},[m,ce,_,T]),Te={position:"absolute",top:ce.top,left:ce.left,maxWidth:I,opacity:W&&!me?0:Q,transform:[{scale:K}]},ye=Se?_jsx(View,{style:[Se,h],pointerEvents:"none"}):null;return _jsxs(_Fragment,{children:[_jsx(View,{ref:U,collapsable:!1,onLayout:re,testID:S,children:ge}),_jsx(Modal,{visible:ee,transparent:!0,statusBarTranslucent:!0,presentationStyle:"overFullScreen",animationType:"none",onRequestClose:ne,onDismiss:ae,children:_jsxs(ModalSafeArea,{onInsets:j,children:[T?_jsxs(_Fragment,{children:[_jsx(Pressable,{style:StyleSheet.absoluteFill,onPress:u?ne:void 0,accessibilityLabel:R.close,accessibilityRole:"button"}),ee?_jsxs(Animated.View,{onLayout:handleContentLayout,style:[Te,d,p],children:[_jsx(RichTooltipBody,{title:s,content:t,action:n,onAction:ue,focusRef:G,actionRef:X,messageStyle:g}),ye]}):null]}):_jsx(Pressable,{style:StyleSheet.absoluteFill,onPress:u?ne:void 0,accessibilityLabel:R.close,accessibilityRole:"button",children:ee?_jsxs(Animated.View,{accessibilityRole:"web"===Platform.OS?"tooltip":void 0,accessibilityLiveRegion:"polite",accessibilityLabel:be,onLayout:handleContentLayout,style:[Te,d,p],children:[_jsx(View,{style:[E.tooltip,{backgroundColor:_.colors["surface-inverse"],borderRadius:_.radius.md,...smoothCorners,paddingHorizontal:_.space.md,paddingVertical:_.space.sm,..._.shadow.popover,shadowColor:_.shadow.popover.shadowColor}],children:"string"==typeof t?_jsx(Text,{variant:"bodySmall",color:"inverse",style:{lineHeight:18,...StyleSheet.flatten(g)},children:t}):t}),ye]}):null}),_jsx(ToastHost,{})]})})]})},buildStyles=e=>StyleSheet.create({tooltip:{overflow:"hidden"}});export{Tooltip};export default Tooltip;
1
+ "use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Platform,StyleSheet,useWindowDimensions,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,setNativeValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{smoothCorners}from"../../utils/corners.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{claimAnchoredSurface}from"../../utils/placement.js";import{warnInvalidValue}from"../../utils/warnInvalidValue.js";import{FOCUS_DELAY_MS,focusHost}from"../Menu/focusHost.js";import{Modal}from"../Modal/index.js";import{useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{RichTooltipBody}from"./RichTooltipBody.js";import{resolveTooltipPosition}from"./tooltipPosition.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TOOLTIP_LABELS=Object.freeze({close:"Close tooltip",longPressHint:"Long press for more info",fallbackName:"Tooltip"});const PRESS_AUTO_HIDE_MS=4e3,ARROW_HALF_WIDTH=4,ARROW_HEIGHT=6,ARROW_CORNER_PADDING=12,DEFAULT_MAX_WIDTH=240,RICH_MAX_WIDTH=280,MESSAGE_LINE_HEIGHT=18,EXIT_DURATION_MS=150,Tooltip=e=>{const{content:t,children:o,variant:r="plain",title:s,action:n,placement:i="auto",open:a,onOpenChange:l,hideOnContentPress:u=!0,maxWidth:c,showArrow:m=!0,accessibilityLabel:p,style:f,containerStyle:d,arrowStyle:h,messageStyle:g,labels:b,testID:T}=e;warnInvalidValue("Tooltip","variant",e.variant,["plain","rich"]),warnInvalidValue("Tooltip","placement",e.placement,["top","bottom","left","right","auto"]),warnInvalidValue("Tooltip","trigger",e.trigger,["longPress","press","manual"]);const S="rich"===r,w=e.trigger??(S?"press":"longPress"),y=useMemo(()=>({...DEFAULT_TOOLTIP_LABELS,...b}),[b]),R=useTheme(),A=usePresenceMotion(),_=useSafeAreaInsets(),[v,x]=useModalInsets(),j=useMemo(()=>({..._,top:v.top,bottom:v.bottom}),[_,v]),C=useWindowDimensions(),E=useMemo(()=>buildStyles(R),[R]),I=R.space.sm,M=R.space.sm,P=c??(S?280:240),L="press"===w&&!S,O=(R.settings.components.tooltip?.enableScaleAnimation??!1)&&!A.reduced,D="manual"===w||"boolean"==typeof a,[V,H]=useState(!1),W=D?Boolean(a):V,[k,N]=useState(null),[F,B]=useState({width:0,height:0}),U=useRef(null),z=useRef(null),G=useRef(null),X=useRef(null),Y=useRef(null),q=useRef(!1),J=useRef(!1),K=useRef(createAnimatedValue(W||!O?1:.85)).current,Q=useRef(createAnimatedValue(W?1:0)).current,Z=useRef(null),$=useRef(!1),[ee,te]=useState(W),oe=useCallback(e=>{D||H(e),l?.(e)},[D,l]),re=useCallback(()=>{U.current&&U.current.measureInWindow((e,t,o,r)=>{N({x:e,y:t,width:o,height:r})})},[]),se=useCallback(e=>{re(),oe(!0)},[re,oe]),ne=useCallback(()=>{oe(!1)},[oe]),ie=useRef(ne);ie.current=ne;const ae=useCallback(()=>{if(!q.current)return;q.current=!1;const e=Y.current;Y.current=null,e?e():S&&focusHost(z.current??U.current)},[S]);useEffect(()=>{if(W)return J.current=!0,q.current=!1,claimAnchoredSurface(()=>ie.current());J.current&&(J.current=!1,q.current=!0)},[W]),useEffect(()=>{W&&te(!0)},[W]);const le=useCallback(()=>{Y.current=n?.onPress??null,ne()},[n,ne]);useEffect(()=>{if(!$.current)return $.current=!0,W&&(re(),L&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{ne()},4e3))),()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)};let e;if(W){re();const t=[Animated.timing(Q,{toValue:1,duration:A.duration("fast"),useNativeDriver:!0})];O?t.push(Animated.spring(K,{toValue:1,damping:R.motion.spring.snappy.damping,stiffness:R.motion.spring.snappy.stiffness,mass:R.motion.spring.snappy.mass,useNativeDriver:!0})):setNativeValue(K,1),e=Animated.parallel(t),e.start(),L&&(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{ne()},4e3))}else{const t=[Animated.timing(Q,{toValue:0,duration:A.reduced?A.duration("fast"):150,easing:Easing.bezier(...R.motion.ease.accelerate),useNativeDriver:!0})];O&&t.push(Animated.timing(K,{toValue:.85,duration:150,easing:Easing.bezier(...R.motion.ease.accelerate),useNativeDriver:!0})),e=Animated.parallel(t),e.start(({finished:e})=>{e&&te(!1)}),Z.current&&(clearTimeout(Z.current),Z.current=null)}return()=>{e?.stop(),Z.current&&(clearTimeout(Z.current),Z.current=null)}},[W]);const handleContentLayout=e=>{const{width:t,height:o}=e.nativeEvent.layout;t===F.width&&o===F.height||B({width:t,height:o})},ue=useMemo(()=>resolveTooltipPosition({anchor:k,size:F,placement:i,rich:S,viewport:{width:C.width,height:C.height,insets:j},maxWidth:P,gap:I,padding:M,arrowCornerPadding:12}),[k,F,i,S,C.width,C.height,j,P,I,M]),ce=null!==k&&F.width>0,me=W&&ce;useEffect(()=>{if(!S||!me)return;const e="web"===Platform.OS?X:G,t=setTimeout(()=>focusHost(e.current),FOCUS_DELAY_MS);return()=>clearTimeout(t)},[S,me]),useEffect(()=>{!S&&me&&"ios"===Platform.OS&&"string"==typeof t&&announce(t)},[S,me,t]);const pe=o.props,fe=useMemo(()=>mergeRefs(pe.ref,z),[pe.ref]),de={};"longPress"!==w||pe.contextMenu?"press"===w&&(de.onPress=e=>{pe.onPress?.(e),se(e)}):(de.onLongPress=se,de.accessibilityHint=y.longPressHint),S&&(de.ref=fe);const he=React.cloneElement(o,de),ge=p??("string"==typeof t?t:y.fallbackName),be=useMemo(()=>{if(!m)return null;const e={position:"absolute",width:0,height:0,backgroundColor:"transparent",borderStyle:"solid",borderLeftWidth:4,borderRightWidth:4,borderBottomWidth:6,borderTopWidth:0,borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:S?R.colors.surface:R.colors["surface-inverse"]};return"top"===ue.placement?{...e,bottom:-6,left:ue.arrowOffset-4,transform:[{rotate:"180deg"}]}:"bottom"===ue.placement?{...e,top:-6,left:ue.arrowOffset-4}:"left"===ue.placement?{...e,right:-6,top:ue.arrowOffset-4,transform:[{rotate:"90deg"}]}:{...e,left:-6,top:ue.arrowOffset-4,transform:[{rotate:"-90deg"}]}},[m,ue,R,S]),Te={position:"absolute",top:ue.top,left:ue.left,maxWidth:P,opacity:W&&!ce?0:Q,transform:[{scale:K}]},Se=be?_jsx(View,{style:[be,h],pointerEvents:"none"}):null;return _jsxs(_Fragment,{children:[_jsx(View,{ref:U,collapsable:!1,onLayout:re,testID:T,children:he}),_jsxs(Modal,{open:ee,onClose:ne,presentation:"fullScreen",bare:!0,backdropOpacity:0,backdropPressClose:u,haptic:!1,labels:{close:y.close},onInsetsChange:x,onDismissed:ae,children:[ee&&S?_jsxs(Animated.View,{onLayout:handleContentLayout,style:[Te,d,f],children:[_jsx(RichTooltipBody,{title:s,content:t,action:n,onAction:le,focusRef:G,actionRef:X,messageStyle:g}),Se]}):null,ee&&!S?_jsxs(Animated.View,{accessibilityRole:"web"===Platform.OS?"tooltip":void 0,accessibilityLiveRegion:"polite",accessibilityLabel:ge,onLayout:handleContentLayout,style:[Te,d,f],children:[_jsx(View,{style:[E.tooltip,{backgroundColor:R.colors["surface-inverse"],borderRadius:R.radius.md,...smoothCorners,paddingHorizontal:R.space.md,paddingVertical:R.space.sm,...R.shadow.popover,shadowColor:R.shadow.popover.shadowColor}],children:"string"==typeof t?_jsx(Text,{variant:"bodySmall",color:"inverse",style:{lineHeight:18,...StyleSheet.flatten(g)},children:t}):t}),Se]}):null]})]})},buildStyles=e=>StyleSheet.create({tooltip:{overflow:"hidden"}});export{Tooltip};export default Tooltip;
@@ -1 +1 @@
1
- "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,StyleSheet,useWindowDimensions,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_TOUR_LABELS=Object.freeze({back:"Back",next:"Next",skip:"Skip",done:"Done",position:(e,t)=>`Step ${e} of ${t}`});const MAX_CARD_WIDTH=360,HIGHLIGHT_BORDER_WIDTH=2,measureInWindow=e=>new Promise(t=>{const i=e.current;i?i.measureInWindow((e,i,s,n)=>t({x:e,y:i,width:s,height:n})):t(null)}),isOnScreen=(e,t)=>e.width>0&&e.height>0&&e.x<t.width&&e.y<t.height&&e.x+e.width>0&&e.y+e.height>0,Tour=({tourId:e,steps:t,visible:i,onClose:s,seenStore:n,labels:r,haptic:o,testID:a})=>{const c=useTheme(),l=usePresenceMotion().duration("fast"),u=useMemo(()=>buildStyles(c),[c]),d=useWindowDimensions(),h=useRef(d);h.current=d;const m=c.space.sm,p=c.space.sm,x=useMemo(()=>({...DEFAULT_TOUR_LABELS,...r}),[r]),[f,b]=useState(null),[g,y]=useState(0),w=useRef(createAnimatedValue(0)).current,j=useRef(t);j.current=t;const S=useRef(x);S.current=x;const _=useRef(s);_.current=s;const v=useRef(n);v.current=n;const k=useCallback(async(e,t)=>{for(let i=e;i>=0&&i<j.current.length;i+=t){const e=await measureInWindow(j.current[i].target);if(e&&isOnScreen(e,h.current))return{index:i,rect:e}}return null},[]);useEffect(()=>{if(!i)return void b(null);let t=!1;return(async()=>{const i=v.current;if(i&&await i.isSeen(e))return void(t||_.current("alreadySeen"));const s=await k(0,1);t||(s?(y(s.index),b(s)):_.current("noTargets"))})(),()=>{t=!0}},[i,e,k]),useEffect(()=>{if(!f)return;const e=j.current[f.index],t=S.current.position(f.index+1,j.current.length);AccessibilityInfo.announceForAccessibility([t,e.title,e.description].filter(Boolean).join(". ")),w.setValue(0);const i=Animated.timing(w,{toValue:1,duration:l,useNativeDriver:!0});return i.start(),()=>i.stop()},[f,w,l]);const T=useCallback(async t=>{b(null),await(v.current?.markSeen(e)),_.current(t)},[e]),C=useCallback(async()=>{if(!f)return;const e=await k(f.index+1,1);e?b(e):await T("finished")},[f,k,T]),D=useCallback(async()=>{if(!f)return;const e=await k(f.index-1,-1);e&&b(e)},[f,k]),M=useCallback(()=>{T("skipped")},[T]),R=f?t[f.index]:void 0,I=!!f&&f.index===t.length-1,A=c.space.xs,V=f?{x:f.rect.x-A,y:f.rect.y-A,width:f.rect.width+2*A,height:f.rect.height+2*A}:null,B=Math.min(d.width-2*p,360),E=V?(()=>{const e=V.x+V.width/2,t=Math.max(p,Math.min(e-B/2,d.width-B-p)),i=V.y,s=d.height-(V.y+V.height);return s>=i?{left:t,top:V.y+V.height+m,maxHeight:Math.max(s-m-p,0)}:{left:t,bottom:d.height-V.y+m,maxHeight:Math.max(i-m-p,0)}})():null,L=c.colors.scrim,W=V?Math.min(R?.radius?c.radius[R.radius]+A:c.radius.md,Math.min(V.width,V.height)/2):0,P=Math.max(d.width,d.height);return _jsx(Modal,{visible:null!==f,onClose:M,presentation:"fullScreen",backdropPressClose:!1,backdropStyle:u.transparent,contentStyle:u.transparent,accessibilityLabel:R?.title??R?.description,haptic:o,testID:a,children:V&&E&&R?_jsxs(View,{style:StyleSheet.absoluteFill,children:[_jsx(View,{style:[u.dim,{borderColor:L,borderWidth:P,top:V.y-P,left:V.x-P,width:V.width+2*P,height:V.height+2*P,borderRadius:W+P}]}),_jsx(View,{pointerEvents:"none",style:[u.highlight,{top:V.y,left:V.x,width:V.width,height:V.height,borderRadius:W}]}),_jsxs(Animated.View,{accessibilityLiveRegion:"polite",style:[u.card,E,{width:B,opacity:w}],testID:a?`${a}-card`:void 0,children:[_jsx(Text,{variant:"caption",children:x.position((f?.index??0)+1,t.length)}),R.title?_jsx(Text,{variant:"title",accessibilityRole:"header",children:R.title}):null,_jsx(Text,{variant:"bodySmall",children:R.description}),_jsxs(View,{style:u.actions,children:[_jsx(Button,{label:x.skip,variant:"ghost",size:"sm",haptic:o,onPress:M,testID:a?`${a}-skip`:void 0}),_jsxs(View,{style:u.navigation,children:[f&&f.index>g?_jsx(Button,{label:x.back,variant:"outline",size:"sm",haptic:o,onPress:()=>{D()},testID:a?`${a}-back`:void 0}):null,_jsx(Button,{label:I?x.done:x.next,size:"sm",haptic:o,onPress:()=>{C()},testID:a?`${a}-next`:void 0})]})]})]})]}):null})};Tour.displayName="Tour";const buildStyles=e=>StyleSheet.create({transparent:{backgroundColor:"transparent"},dim:{position:"absolute"},highlight:{position:"absolute",borderWidth:2,borderColor:e.colors.primary,borderRadius:e.radius.md,...smoothCorners},card:{position:"absolute",backgroundColor:e.colors.surface,borderRadius:e.radius.lg,...smoothCorners,padding:e.space.lg,gap:e.space.sm,...e.shadow.popover},actions:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:e.space.xs},navigation:{flexDirection:"row",gap:e.space.sm}});export{Tour};export default Tour;
1
+ "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,StyleSheet,useWindowDimensions,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_TOUR_LABELS=Object.freeze({back:"Back",next:"Next",skip:"Skip",done:"Done",position:(e,t)=>`Step ${e} of ${t}`});const MAX_CARD_WIDTH=360,HIGHLIGHT_BORDER_WIDTH=2,measureInWindow=e=>new Promise(t=>{const i=e.current;i?i.measureInWindow((e,i,s,n)=>t({x:e,y:i,width:s,height:n})):t(null)}),isOnScreen=(e,t)=>e.width>0&&e.height>0&&e.x<t.width&&e.y<t.height&&e.x+e.width>0&&e.y+e.height>0,Tour=({tourId:e,steps:t,open:i,onClose:s,seenStore:n,labels:r,haptic:o,testID:a})=>{const c=useTheme(),l=usePresenceMotion().duration("fast"),u=useMemo(()=>buildStyles(c),[c]),d=useWindowDimensions(),h=useRef(d);h.current=d;const m=c.space.sm,p=c.space.sm,x=useMemo(()=>({...DEFAULT_TOUR_LABELS,...r}),[r]),[f,b]=useState(null),[g,y]=useState(0),w=useRef(createAnimatedValue(0)).current,j=useRef(t);j.current=t;const S=useRef(x);S.current=x;const _=useRef(s);_.current=s;const k=useRef(n);k.current=n;const T=useCallback(async(e,t)=>{for(let i=e;i>=0&&i<j.current.length;i+=t){const e=await measureInWindow(j.current[i].target);if(e&&isOnScreen(e,h.current))return{index:i,rect:e}}return null},[]);useEffect(()=>{if(!i)return void b(null);let t=!1;return(async()=>{const i=k.current;if(i&&await i.isSeen(e))return void(t||_.current("alreadySeen"));const s=await T(0,1);t||(s?(y(s.index),b(s)):_.current("noTargets"))})(),()=>{t=!0}},[i,e,T]),useEffect(()=>{if(!f)return;const e=j.current[f.index],t=S.current.position(f.index+1,j.current.length);AccessibilityInfo.announceForAccessibility([t,e.title,e.description].filter(Boolean).join(". ")),w.setValue(0);const i=Animated.timing(w,{toValue:1,duration:l,useNativeDriver:!0});return i.start(),()=>i.stop()},[f,w,l]);const v=useCallback(async t=>{b(null),await(k.current?.markSeen(e)),_.current(t)},[e]),C=useCallback(async()=>{if(!f)return;const e=await T(f.index+1,1);e?b(e):await v("finished")},[f,T,v]),D=useCallback(async()=>{if(!f)return;const e=await T(f.index-1,-1);e&&b(e)},[f,T]),M=useCallback(()=>{v("skipped")},[v]),R=f?t[f.index]:void 0,I=!!f&&f.index===t.length-1,A=c.space.xs,V=f?{x:f.rect.x-A,y:f.rect.y-A,width:f.rect.width+2*A,height:f.rect.height+2*A}:null,B=Math.min(d.width-2*p,360),E=V?(()=>{const e=V.x+V.width/2,t=Math.max(p,Math.min(e-B/2,d.width-B-p)),i=V.y,s=d.height-(V.y+V.height);return s>=i?{left:t,top:V.y+V.height+m,maxHeight:Math.max(s-m-p,0)}:{left:t,bottom:d.height-V.y+m,maxHeight:Math.max(i-m-p,0)}})():null,L=c.colors.scrim,W=V?Math.min(R?.radius?c.radius[R.radius]+A:c.radius.md,Math.min(V.width,V.height)/2):0,P=Math.max(d.width,d.height);return _jsx(Modal,{open:null!==f,onClose:M,presentation:"fullScreen",backdropPressClose:!1,backdropStyle:u.transparent,contentStyle:u.transparent,accessibilityLabel:R?.title??R?.description,haptic:o,testID:a,children:V&&E&&R?_jsxs(View,{style:StyleSheet.absoluteFill,children:[_jsx(View,{style:[u.dim,{borderColor:L,borderWidth:P,top:V.y-P,left:V.x-P,width:V.width+2*P,height:V.height+2*P,borderRadius:W+P}]}),_jsx(View,{pointerEvents:"none",style:[u.highlight,{top:V.y,left:V.x,width:V.width,height:V.height,borderRadius:W}]}),_jsxs(Animated.View,{accessibilityLiveRegion:"polite",style:[u.card,E,{width:B,opacity:w}],testID:a?`${a}-card`:void 0,children:[_jsx(Text,{variant:"caption",children:x.position((f?.index??0)+1,t.length)}),R.title?_jsx(Text,{variant:"title",accessibilityRole:"header",children:R.title}):null,_jsx(Text,{variant:"bodySmall",children:R.description}),_jsxs(View,{style:u.actions,children:[_jsx(Button,{label:x.skip,variant:"ghost",size:"sm",haptic:o,onPress:M,testID:a?`${a}-skip`:void 0}),_jsxs(View,{style:u.navigation,children:[f&&f.index>g?_jsx(Button,{label:x.back,variant:"outline",size:"sm",haptic:o,onPress:()=>{D()},testID:a?`${a}-back`:void 0}):null,_jsx(Button,{label:I?x.done:x.next,size:"sm",haptic:o,onPress:()=>{C()},testID:a?`${a}-next`:void 0})]})]})]})]}):null})};Tour.displayName="Tour";const buildStyles=e=>StyleSheet.create({transparent:{backgroundColor:"transparent"},dim:{position:"absolute"},highlight:{position:"absolute",borderWidth:2,borderColor:e.colors.primary,borderRadius:e.radius.md,...smoothCorners},card:{position:"absolute",backgroundColor:e.colors.surface,borderRadius:e.radius.lg,...smoothCorners,padding:e.space.lg,gap:e.space.sm,...e.shadow.popover},actions:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:e.space.xs},navigation:{flexDirection:"row",gap:e.space.sm}});export{Tour};export default Tour;
@@ -1 +1 @@
1
- "use strict";export{Accordion,AccordionGroup}from"./Accordion/index.js";export{AmountSlider,DEFAULT_AMOUNT_SLIDER_LABELS}from"./AmountSlider/index.js";export{AnimatePresence}from"./AnimatePresence/index.js";export{AppBar,DEFAULT_APP_BAR_LABELS}from"./AppBar/index.js";export{AppLockOverlay,DEFAULT_APP_LOCK_OVERLAY_LABELS}from"./AppLockOverlay/index.js";export{AsyncBlock,DEFAULT_ASYNC_BLOCK_LABELS}from"./AsyncBlock/index.js";export{AuthedImage,authedImageCacheStats,clearAuthedImageCache,getAuthedImageCacheLimit,setAuthedImageCacheLimit}from"./AuthedImage/index.js";export{Autocomplete,DEFAULT_AUTOCOMPLETE_LABELS}from"./Autocomplete/index.js";export{Avatar,AvatarGroup,avatarToneColors,DEFAULT_AVATAR_LABELS}from"./Avatar/index.js";export{Badge,DEFAULT_BADGE_LABELS}from"./Badge/index.js";export{Banner,DEFAULT_BANNER_LABELS}from"./Banner/index.js";export{BarChart}from"./BarChart/index.js";export{BottomNavigation,DEFAULT_BOTTOM_NAVIGATION_LABELS}from"./BottomNavigation/index.js";export{BottomSheet,DEFAULT_BOTTOM_SHEET_LABELS,useBottomSheet}from"./BottomSheet/index.js";export{Box,Row,Spacer,Stack}from"./Box/index.js";export{Button,buttonLabelInk}from"./Button/index.js";export{Calendar,DEFAULT_CALENDAR_LABELS}from"./Calendar/index.js";export{Card,DEFAULT_CARD_LABELS}from"./Card/index.js";export{Carousel,DEFAULT_CAROUSEL_LABELS}from"./Carousel/index.js";export{Checkbox}from"./Checkbox/index.js";export{Chip}from"./Chip/index.js";export{ChoiceGroup}from"./ChoiceGroup/index.js";export{Composer,DEFAULT_COMPOSER_LABELS}from"./Composer/index.js";export{Confetti}from"./Confetti/index.js";export{ConfirmHost,confirm}from"./Confirm/index.js";export{DatePicker,DEFAULT_DATE_PICKER_LABELS}from"./DatePicker/index.js";export{DateRangePicker,DEFAULT_DATE_RANGE_PICKER_LABELS}from"./DateRangePicker/index.js";export{DateSeparator,DEFAULT_DATE_SEPARATOR_LABELS,dayLabel}from"./DateSeparator/index.js";export{cleanDecimalText,DEFAULT_DECIMAL_INPUT_LABELS,DecimalInput,isUnclearDecimalComma,parseDecimalText,pointDecimalText}from"./DecimalInput/index.js";export{Descriptions}from"./Descriptions/index.js";export{Dialog}from"./Dialog/index.js";export{Divider}from"./Divider/index.js";export{DEFAULT_DRAWER_LABELS,Drawer}from"./Drawer/index.js";export{EmptyState}from"./EmptyState/index.js";export{DEFAULT_ERROR_BOUNDARY_LABELS,ErrorBoundary,useErrorHandler,withErrorBoundary}from"./ErrorBoundary/index.js";export{DEFAULT_FILE_PICKER_LABELS,FilePicker,formatFileSize}from"./FilePicker/index.js";export{FileViewer}from"./FileViewer/index.js";export{FilterChipRow}from"./FilterChipRow/index.js";export{DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS,FloatingActionButton,FloatingActionButtonGroup}from"./FloatingActionButton/index.js";export{DEFAULT_FORCE_UPDATE_DIALOG_LABELS,ForceUpdateDialog}from"./ForceUpdateDialog/index.js";export{DEFAULT_FORM_FIELD_LABELS,FormField}from"./FormField/index.js";export{IconBadge}from"./IconBadge/index.js";export{IconButton}from"./IconButton/index.js";export{DEFAULT_IMAGE_GALLERY_LABELS,ImageGallery}from"./ImageGallery/index.js";export{DEFAULT_INLINE_SELECT_LABELS,InlineSelect}from"./InlineSelect/index.js";export{DEFAULT_INPUT_LABELS,Input}from"./Input/index.js";export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView/index.js";export{DEFAULT_KEYBOARD_TOOLBAR_LABELS,KeyboardToolbar}from"./KeyboardToolbar/index.js";export{ListItem}from"./ListItem/index.js";export{ListSection}from"./ListSection/index.js";export{DEFAULT_LOADER_OVERLAY_LABELS,LoaderOverlay,loader,useLoader}from"./LoaderOverlay/index.js";export{Markdown}from"./Markdown/index.js";export{DEFAULT_MENU_LABELS,Menu}from"./Menu/index.js";export{DEFAULT_MESSAGE_BUBBLE_LABELS,MessageBubble}from"./MessageBubble/index.js";export{DEFAULT_MESSAGE_LIST_LABELS,MessageList}from"./MessageList/index.js";export{DEFAULT_MODAL_LABELS,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal/index.js";export{Notation,parseNotation,sym}from"./Notation/index.js";export{DEFAULT_NUMBER_INPUT_LABELS,NumberInput}from"./NumberInput/index.js";export{DEFAULT_ONBOARDING_PAGER_LABELS,OnboardingPager}from"./OnboardingPager/index.js";export{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"./OptionSheet/index.js";export{DEFAULT_OTP_INPUT_LABELS,OTPInput}from"./OTPInput/index.js";export{DEFAULT_PAGED_LIST_FOOTER_LABELS,PagedListFooter}from"./PagedListFooter/index.js";export{DEFAULT_PERMISSION_PROMPT_LABELS,PermissionPrompt,usePermissionPrompt}from"./PermissionPrompt/index.js";export{ALL_CALLING_CODES,DEFAULT_CALLING_CODES,DEFAULT_PHONE_NUMBER_INPUT_LABELS,formatE164,PhoneNumberInput,parseE164}from"./PhoneNumberInput/index.js";export{DEFAULT_PICKER_TRIGGER_LABELS,PickerTrigger}from"./PickerTrigger/index.js";export{DEFAULT_PROFILE_COMPLETION_LABELS,ProfileCompletion}from"./ProfileCompletion/index.js";export{DEFAULT_PROFILE_PICKER_LABELS,ProfilePicker}from"./ProfilePicker/index.js";export{DEFAULT_PROGRESS_BAR_LABELS,ProgressBar}from"./ProgressBar/index.js";export{ProgressRing}from"./ProgressRing/index.js";export{Radio,RadioDot,RadioGroup}from"./Radio/index.js";export{DEFAULT_RATING_LABELS,Rating}from"./Rating/index.js";export{DEFAULT_REPEATER_LABELS,Repeater}from"./Repeater/index.js";export{applyMarkdownAction,DEFAULT_RICH_TEXT_EDITOR_LABELS,RichTextEditor}from"./RichTextEditor/index.js";export{DEFAULT_SCANNER_OVERLAY_LABELS,ScannerOverlay}from"./ScannerOverlay/index.js";export{Screen}from"./Screen/index.js";export{DEFAULT_SEARCH_BAR_LABELS,SearchBar,useRecentSearches}from"./SearchBar/index.js";export{DEFAULT_SECTION_HEADER_LABELS,SectionHeader}from"./SectionHeader/index.js";export{SegmentedControl}from"./SegmentedControl/index.js";export{DEFAULT_SELECT_LABELS,Select}from"./Select/index.js";export{DEFAULT_SIGNATURE_PAD_LABELS,SignaturePad}from"./SignaturePad/index.js";export{DEFAULT_SKELETON_LABELS,Skeleton,SkeletonCircle,SkeletonClockProvider,SkeletonContent,SkeletonList,SkeletonProvider,SkeletonSkip,SkeletonText,useSkeletonClock,useSkeletonDefaults}from"./Skeleton/index.js";export{Slider}from"./Slider/index.js";export{DEFAULT_SLIDER_FIELD_LABELS,SliderField}from"./SliderField/index.js";export{DEFAULT_SLIDE_TO_CONFIRM_LABELS,SlideToConfirm}from"./SlideToConfirm/index.js";export{DEFAULT_SORTABLE_LIST_LABELS,SortableList}from"./SortableList/index.js";export{DEFAULT_SPARKLINE_LABELS,Sparkline}from"./Sparkline/index.js";export{DEFAULT_SPINNER_LABELS,Spinner}from"./Spinner/index.js";export{SquircleImage}from"./SquircleImage/index.js";export{SquircleView}from"./SquircleView/index.js";export{StatTile}from"./StatTile/index.js";export{StatusBadge}from"./StatusBadge/index.js";export{defineStatusMap}from"./StatusBadge/statusMap.js";export{Stepper}from"./Stepper/index.js";export{Swipeable}from"./Swipeable/index.js";export{Switch}from"./Switch/index.js";export{Tabs}from"./Tabs/index.js";export{TagInput}from"./TagInput/index.js";export{Text}from"./Text/index.js";export{Timeline}from"./Timeline/index.js";export{DEFAULT_TIME_PICKER_LABELS,TimePicker}from"./TimePicker/index.js";export{DEFAULT_TOAST_LABELS,Toast,ToastHost,ToastProvider,toast,useToast}from"./Toast/index.js";export{DEFAULT_TOOLTIP_LABELS,Tooltip}from"./Tooltip/index.js";export{DEFAULT_TOUR_LABELS,Tour}from"./Tour/index.js";export{DEFAULT_TYPING_INDICATOR_LABELS,TypingIndicator}from"./TypingIndicator/index.js";export{DEFAULT_WHEEL_PICKER_LABELS,WheelPicker}from"./WheelPicker/index.js";export{ZoomableImage}from"./ZoomableImage/index.js";
1
+ "use strict";export{Accordion,AccordionGroup}from"./Accordion/index.js";export{AmountSlider,DEFAULT_AMOUNT_SLIDER_LABELS}from"./AmountSlider/index.js";export{AnimatePresence}from"./AnimatePresence/index.js";export{AppBar,DEFAULT_APP_BAR_LABELS}from"./AppBar/index.js";export{AppLockOverlay,DEFAULT_APP_LOCK_OVERLAY_LABELS}from"./AppLockOverlay/index.js";export{AsyncBlock,DEFAULT_ASYNC_BLOCK_LABELS}from"./AsyncBlock/index.js";export{AuthedImage,authedImageCacheStats,clearAuthedImageCache,getAuthedImageCacheLimit,setAuthedImageCacheLimit}from"./AuthedImage/index.js";export{Autocomplete,DEFAULT_AUTOCOMPLETE_LABELS}from"./Autocomplete/index.js";export{Avatar,AvatarGroup,avatarToneColors,DEFAULT_AVATAR_LABELS}from"./Avatar/index.js";export{Badge,DEFAULT_BADGE_LABELS}from"./Badge/index.js";export{Banner,DEFAULT_BANNER_LABELS}from"./Banner/index.js";export{BarChart}from"./BarChart/index.js";export{BottomNavigation,DEFAULT_BOTTOM_NAVIGATION_LABELS}from"./BottomNavigation/index.js";export{BottomSheet,DEFAULT_BOTTOM_SHEET_LABELS,useBottomSheet}from"./BottomSheet/index.js";export{Box,Row,Spacer,Stack}from"./Box/index.js";export{Button,buttonLabelInk}from"./Button/index.js";export{Calendar,DEFAULT_CALENDAR_LABELS}from"./Calendar/index.js";export{Card,DEFAULT_CARD_LABELS}from"./Card/index.js";export{Carousel,DEFAULT_CAROUSEL_LABELS}from"./Carousel/index.js";export{Checkbox}from"./Checkbox/index.js";export{Chip}from"./Chip/index.js";export{ChoiceGroup}from"./ChoiceGroup/index.js";export{Composer,DEFAULT_COMPOSER_LABELS}from"./Composer/index.js";export{Confetti}from"./Confetti/index.js";export{ConfirmHost,confirm}from"./Confirm/index.js";export{DatePicker,DEFAULT_DATE_PICKER_LABELS}from"./DatePicker/index.js";export{DateRangePicker,DEFAULT_DATE_RANGE_PICKER_LABELS}from"./DateRangePicker/index.js";export{DateSeparator,DEFAULT_DATE_SEPARATOR_LABELS,dayLabel}from"./DateSeparator/index.js";export{cleanDecimalText,DEFAULT_DECIMAL_INPUT_LABELS,DecimalInput,isUnclearDecimalComma,parseDecimalText,pointDecimalText}from"./DecimalInput/index.js";export{Descriptions}from"./Descriptions/index.js";export{Dialog}from"./Dialog/index.js";export{Divider}from"./Divider/index.js";export{DEFAULT_DRAWER_LABELS,Drawer}from"./Drawer/index.js";export{EmptyState}from"./EmptyState/index.js";export{DEFAULT_ERROR_BOUNDARY_LABELS,ErrorBoundary,useErrorHandler,withErrorBoundary}from"./ErrorBoundary/index.js";export{DEFAULT_FILE_PICKER_LABELS,FilePicker,formatFileSize}from"./FilePicker/index.js";export{FileViewer}from"./FileViewer/index.js";export{FilterChipRow}from"./FilterChipRow/index.js";export{DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS,FloatingActionButton,FloatingActionButtonGroup}from"./FloatingActionButton/index.js";export{DEFAULT_FORCE_UPDATE_DIALOG_LABELS,ForceUpdateDialog}from"./ForceUpdateDialog/index.js";export{DEFAULT_FORM_FIELD_LABELS,FormField}from"./FormField/index.js";export{IconBadge}from"./IconBadge/index.js";export{IconButton}from"./IconButton/index.js";export{DEFAULT_IMAGE_GALLERY_LABELS,ImageGallery}from"./ImageGallery/index.js";export{DEFAULT_INLINE_SELECT_LABELS,InlineSelect}from"./InlineSelect/index.js";export{DEFAULT_INPUT_LABELS,Input}from"./Input/index.js";export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView/index.js";export{DEFAULT_KEYBOARD_TOOLBAR_LABELS,KeyboardToolbar}from"./KeyboardToolbar/index.js";export{ListItem}from"./ListItem/index.js";export{ListSection}from"./ListSection/index.js";export{DEFAULT_LOADER_OVERLAY_LABELS,LoaderOverlay,loader,useLoader}from"./LoaderOverlay/index.js";export{Markdown}from"./Markdown/index.js";export{DEFAULT_MENU_LABELS,Menu}from"./Menu/index.js";export{DEFAULT_MESSAGE_BUBBLE_LABELS,MessageBubble}from"./MessageBubble/index.js";export{DEFAULT_MESSAGE_LIST_LABELS,MessageList}from"./MessageList/index.js";export{DEFAULT_MODAL_LABELS,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal/index.js";export{DEFAULT_NUMBER_INPUT_LABELS,NumberInput}from"./NumberInput/index.js";export{DEFAULT_ONBOARDING_PAGER_LABELS,OnboardingPager}from"./OnboardingPager/index.js";export{DEFAULT_OPTION_SHEET_LABELS,OptionSheet}from"./OptionSheet/index.js";export{DEFAULT_OTP_INPUT_LABELS,DEFAULT_OTP_RESEND_ROW_LABELS,OTPInput,OTPResendRow}from"./OTPInput/index.js";export{DEFAULT_PAGED_LIST_FOOTER_LABELS,PagedListFooter}from"./PagedListFooter/index.js";export{DEFAULT_PERMISSION_PROMPT_LABELS,PermissionPrompt,usePermissionPrompt}from"./PermissionPrompt/index.js";export{ALL_CALLING_CODES,DEFAULT_CALLING_CODES,DEFAULT_PHONE_NUMBER_INPUT_LABELS,formatE164,PhoneNumberInput,parseE164}from"./PhoneNumberInput/index.js";export{DEFAULT_PICKER_TRIGGER_LABELS,PickerTrigger}from"./PickerTrigger/index.js";export{DEFAULT_PROFILE_COMPLETION_LABELS,ProfileCompletion}from"./ProfileCompletion/index.js";export{DEFAULT_PROFILE_PICKER_LABELS,ProfilePicker}from"./ProfilePicker/index.js";export{DEFAULT_PROGRESS_BAR_LABELS,ProgressBar}from"./ProgressBar/index.js";export{ProgressRing}from"./ProgressRing/index.js";export{Radio,RadioDot,RadioGroup}from"./Radio/index.js";export{DEFAULT_RATING_LABELS,Rating}from"./Rating/index.js";export{DEFAULT_REPEATER_LABELS,Repeater}from"./Repeater/index.js";export{applyMarkdownAction,DEFAULT_RICH_TEXT_EDITOR_LABELS,RichTextEditor}from"./RichTextEditor/index.js";export{DEFAULT_SCANNER_OVERLAY_LABELS,ScannerOverlay}from"./ScannerOverlay/index.js";export{Screen}from"./Screen/index.js";export{DEFAULT_SEARCH_BAR_LABELS,SearchBar,useRecentSearches}from"./SearchBar/index.js";export{DEFAULT_SECTION_HEADER_LABELS,SectionHeader}from"./SectionHeader/index.js";export{SegmentedControl}from"./SegmentedControl/index.js";export{DEFAULT_SELECT_LABELS,Select}from"./Select/index.js";export{DEFAULT_SIGNATURE_PAD_LABELS,SignaturePad}from"./SignaturePad/index.js";export{DEFAULT_SKELETON_LABELS,Skeleton,SkeletonCircle,SkeletonClockProvider,SkeletonContent,SkeletonList,SkeletonProvider,SkeletonSkip,SkeletonText,useSkeletonClock,useSkeletonDefaults}from"./Skeleton/index.js";export{Slider}from"./Slider/index.js";export{DEFAULT_SLIDER_FIELD_LABELS,SliderField}from"./SliderField/index.js";export{DEFAULT_SLIDE_TO_CONFIRM_LABELS,SlideToConfirm}from"./SlideToConfirm/index.js";export{DEFAULT_SORTABLE_LIST_LABELS,SortableList}from"./SortableList/index.js";export{DEFAULT_SPARKLINE_LABELS,Sparkline}from"./Sparkline/index.js";export{DEFAULT_SPINNER_LABELS,Spinner}from"./Spinner/index.js";export{SquircleImage}from"./SquircleImage/index.js";export{SquircleView}from"./SquircleView/index.js";export{StatTile}from"./StatTile/index.js";export{StatusBadge}from"./StatusBadge/index.js";export{defineStatusMap}from"./StatusBadge/statusMap.js";export{Stepper}from"./Stepper/index.js";export{Swipeable}from"./Swipeable/index.js";export{Switch}from"./Switch/index.js";export{Tabs}from"./Tabs/index.js";export{TagInput}from"./TagInput/index.js";export{Text}from"./Text/index.js";export{TextInkContext,useTextInk}from"./Text/textInk.js";export{Timeline}from"./Timeline/index.js";export{DEFAULT_TIME_PICKER_LABELS,TimePicker}from"./TimePicker/index.js";export{DEFAULT_TOAST_LABELS,Toast,ToastHost,ToastProvider,toast,useToast}from"./Toast/index.js";export{DEFAULT_TOOLTIP_LABELS,Tooltip}from"./Tooltip/index.js";export{DEFAULT_TOUR_LABELS,Tour}from"./Tour/index.js";export{DEFAULT_TYPING_INDICATOR_LABELS,TypingIndicator}from"./TypingIndicator/index.js";export{DEFAULT_WHEEL_PICKER_LABELS,WheelPicker}from"./WheelPicker/index.js";export{ZoomableImage}from"./ZoomableImage/index.js";
@@ -13,6 +13,7 @@
13
13
  "SkeletonProvider": "Shares skeleton settings with the skeletons below it and draws nothing of its own.",
14
14
  "SkeletonSkip": "Marks a subtree the skeleton walker leaves alone and draws its children unchanged.",
15
15
  "Stack": "Layout primitive. Canvas lays out a screen with its own frame nodes, so the kit draws the components placed inside them.",
16
+ "TextInkContext": "Passes the text colour a surface sets to the Text inside it and draws nothing of its own.",
16
17
  "ThemeProvider": "Supplies the theme to the app and draws nothing of its own.",
17
18
  "ToastHost": "Shows the queued toasts at the app root; the Toast description draws how a toast looks.",
18
19
  "ToastProvider": "Holds the toast queue and draws nothing of its own."
@@ -1 +1 @@
1
- "use strict";import React from"react";import{FormField}from"../components/FormField/FormField.js";import{useHookFormField}from"./useHookFormField.js";import{jsx as _jsx}from"react/jsx-runtime";const assignRef=(e,r)=>{"function"==typeof e?e(r):e&&(e.current=r)};export const HookFormField=e=>{const{label:r,helperText:o,required:t,layout:l,labelStyle:i,helperStyle:n,errorStyle:s,containerStyle:a,inputContainerStyle:c,accessibilityLabel:m,testID:u,children:F,hideError:d,...p}=e,y=useHookFormField(p),f="function"==typeof F;let h=null;if(f)h=F(y);else if(React.isValidElement(F)){const e=F.props;h=React.cloneElement(F,{value:y.value,error:y.error,onChangeText:r=>{y.onChangeText(r),e.onChangeText?.(r)},onBlur:r=>{y.onBlur(),e.onBlur?.(r)},ref:r=>{y.ref(r),assignRef(e.ref,r)}})}const x=!f||React.isValidElement(h)&&"error"in h.props;return _jsx(FormField,{label:r,helperText:o,required:t,layout:l,labelStyle:i,helperStyle:n,errorStyle:s,containerStyle:a,inputContainerStyle:c,accessibilityLabel:m,testID:u,error:d??x?void 0:y.error,children:h})};HookFormField.displayName="HookFormField";
1
+ "use strict";import React from"react";import{FormField}from"../components/FormField/FormField.js";import{useHookFormField}from"./useHookFormField.js";import{jsx as _jsx}from"react/jsx-runtime";const assignRef=(e,r)=>{"function"==typeof e?e(r):e&&(e.current=r)};export const HookFormField=e=>{const{label:r,help:o,helperText:l,helperLines:t,labels:i,required:n,layout:s,labelStyle:a,helperStyle:c,errorStyle:m,containerStyle:p,inputContainerStyle:u,accessibilityLabel:F,testID:d,children:y,hideError:f,...h}=e,b=useHookFormField(h),x="function"==typeof y;let S=null;if(x)S=y(b);else if(React.isValidElement(y)){const e=y.props;S=React.cloneElement(y,{value:b.value,error:b.error,onChangeText:r=>{b.onChangeText(r),e.onChangeText?.(r)},onBlur:r=>{b.onBlur(),e.onBlur?.(r)},ref:r=>{b.ref(r),assignRef(e.ref,r)}})}const j=!x||React.isValidElement(S)&&"error"in S.props;return _jsx(FormField,{label:r,help:o,helperText:l,helperLines:t,labels:i,required:n,layout:s,labelStyle:a,helperStyle:c,errorStyle:m,containerStyle:p,inputContainerStyle:u,accessibilityLabel:F,testID:d,error:f??j?void 0:b.error,children:S})};HookFormField.displayName="HookFormField";
@@ -1 +1 @@
1
- "use strict";export{useControllableState}from"./useControllableState.js";export{useDebounce}from"./useDebounce.js";export{createDragToDismissController,DRAG_DISMISS_DISTANCE,DRAG_DISMISS_VELOCITY,useDragToDismiss}from"./useDragToDismiss.js";export{useFieldChain}from"./useFieldChain.js";export{FLICK_TOLERANCE,useFlickGuard}from"./useFlickGuard.js";export{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"./usePresenceMotion.js";export{PRESS_ANIMATION_PRESETS,usePressAnimation}from"./usePressAnimation.js";export{useReducedMotion}from"./useReducedMotion.js";export{useRefreshControl}from"./useRefreshControl.js";export{useScrollDirection}from"./useScrollDirection.js";export{useToggle}from"./useToggle.js";
1
+ "use strict";export{useControllableState}from"./useControllableState.js";export{useDebounce}from"./useDebounce.js";export{createDragToDismissController,DRAG_DISMISS_DISTANCE,DRAG_DISMISS_VELOCITY,useDragToDismiss}from"./useDragToDismiss.js";export{useFieldChain}from"./useFieldChain.js";export{FieldErrorScrollContext,useFieldErrorAnchor,useFieldErrorScroll}from"./useFieldErrorScroll.js";export{FLICK_TOLERANCE,useFlickGuard}from"./useFlickGuard.js";export{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"./usePresenceMotion.js";export{PRESS_ANIMATION_PRESETS,usePressAnimation}from"./usePressAnimation.js";export{useReducedMotion}from"./useReducedMotion.js";export{useRefreshControl}from"./useRefreshControl.js";export{useResendCountdown}from"./useResendCountdown.js";export{useScrollDirection}from"./useScrollDirection.js";export{useToggle}from"./useToggle.js";
@@ -0,0 +1 @@
1
+ "use strict";import{createContext,useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";export const FieldErrorScrollContext=createContext(null);export const useFieldErrorAnchor=(e,t)=>{const r=useContext(FieldErrorScrollContext),n=useRef(null),o=Boolean(e);return useEffect(()=>{if(r&&o)return r.add(n)},[r,o]),useCallback(e=>{n.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t])};export const useFieldErrorScroll=({scrollRef:e,offset:t=16})=>{const r=useRef(new Set),n=useMemo(()=>({add:e=>(r.current.add(e),()=>{r.current.delete(e)})}),[]),o=useRef(null),u=useRef(0),c=useCallback(e=>{u.current=e.nativeEvent.layout.y},[]),[s,l]=useState(0),a=useCallback(()=>l(e=>e+1),[]);return useEffect(()=>{if(0===s)return;let n=!1;const c=requestAnimationFrame(()=>{const c=o.current,s=[...r.current].map(e=>e.current).filter(e=>"function"==typeof e?.measureLayout);if(!c||0===s.length)return;let l=s.length,a=Number.POSITIVE_INFINITY;const settle=()=>{l-=1,n||l>0||!Number.isFinite(a)||e.current?.scrollTo({y:Math.max(0,u.current+a-t),animated:!0})};for(const e of s)e.measureLayout(c,(e,t)=>{a=Math.min(a,t),settle()},settle)});return()=>{n=!0,cancelAnimationFrame(c)}},[s,e,t]),{registry:n,containerRef:o,onContainerLayout:c,scrollToFirstError:a}};
@@ -0,0 +1 @@
1
+ "use strict";import{useEffect,useState}from"react";import{AppState}from"react-native";export const useResendCountdown=({resendSeconds:e,expirySeconds:t,startedAtMs:n})=>{const[r,o]=useState(()=>Date.now());useEffect(()=>{const isSettled=r=>{const o=Math.floor((r-n)/1e3);return e-o<=0&&(null==t||t-o<=0)},r=Date.now();if(o(r),isSettled(r))return;const s=setInterval(()=>{const e=Date.now();o(e),isSettled(e)&&clearInterval(s)},1e3);return()=>clearInterval(s)},[n,e,t]),useEffect(()=>{const e=AppState.addEventListener("change",e=>{"active"===e&&o(Date.now())});return()=>e.remove()},[]);const s=Math.floor((r-n)/1e3);return{resendSecondsLeft:Math.max(0,e-s),expirySecondsLeft:null==t?null:Math.max(0,t-s)}};
@@ -0,0 +1 @@
1
+ "use strict";export{CURATED_ICON_NAMES,defaultIcons,ICON_NAMES}from"./components/AppIcon/index.js";export{textOf}from"./theme/index.js";
@@ -1 +1 @@
1
- "use strict";export{PHONE_CHROME_INSETS}from"./canvasKit/index.js";export*from"./components/index.js";export{APP_ICON_SIZES,AppIcon,CURATED_ICON_NAMES,defaultIcons,ICON_NAMES,ICONSAX_SUFFIX,renderSlotIcon}from"./components/AppIcon/index.js";export{deletePath,getPath,HookFormField,isFieldFilled,setPath,useFormCompletion,useHookFormField}from"./form/index.js";export{FLICK_TOLERANCE,PRESENCE_REDUCE_MOTION,PRESS_ANIMATION_PRESETS,useControllableState,useDebounce,useFieldChain,useFlickGuard,usePresenceMotion,usePressAnimation,useReducedMotion,useRefreshControl,useScrollDirection,useToggle}from"./hooks/index.js";export{NetworkStatusBanner}from"./network/index.js";export{COLOR_NAMES,DURATION_NAMES,darkTheme,EASE_NAMES,FONT_NAMES,KitThemeBridge,LEADING_NAMES,LETTER_SPACING_NAMES,lightTheme,makeStyles,mergeBrand,RADIUS_NAMES,radiusOf,resolveBadgeSize,resolveButtonSize,resolveCheckboxSize,resolveChipSize,resolveEmptyStateSize,resolveFieldSize,resolveFloatingActionButtonSize,resolveListItemSize,resolveOtpInputSize,resolveRadioSize,resolveSegmentedControlSize,resolveSliderSize,resolveSwitchSize,resolveTabsSize,SHADOW_NAMES,SIZE_NAMES,SPACE_NAMES,spaceOf,TEXT_NAMES,ThemeProvider,textOf,useTheme,useThemeMode,WEIGHT_NAMES}from"./theme/index.js";export{announce,Breakpoints,configureFeedback,feedback,hapticForIntent,isFeedbackEnabled,isScreenSize,isTablet,SQUIRCLE_MIN_RADIUS,SQUIRCLE_SMOOTHING,setHapticImplementation,shadowStyle,smoothCorners,squircleApplies,squircleHostRadius,squirclePath,triggerHaptic,useScreenDimensions,warnUnknownProps}from"./utils/index.js";
1
+ "use strict";export{PHONE_CHROME_INSETS}from"./canvasKit/index.js";export{Accordion,AccordionGroup,ALL_CALLING_CODES,AmountSlider,AnimatePresence,AppBar,AppLockOverlay,AsyncBlock,AuthedImage,Autocomplete,Avatar,AvatarGroup,authedImageCacheStats,Badge,Banner,BarChart,BottomNavigation,BottomSheet,Box,Button,buttonLabelInk,Calendar,Card,Carousel,Checkbox,Chip,ChoiceGroup,Composer,Confetti,ConfirmHost,clearAuthedImageCache,confirm,DatePicker,DateRangePicker,DateSeparator,DEFAULT_CALLING_CODES,DecimalInput,Descriptions,Dialog,Divider,Drawer,defineStatusMap,EmptyState,ErrorBoundary,FilePicker,FileViewer,FilterChipRow,FloatingActionButton,FloatingActionButtonGroup,ForceUpdateDialog,FormField,formatE164,formatFileSize,getAuthedImageCacheLimit,IconBadge,IconButton,ImageGallery,InlineSelect,Input,KeyboardAwareScrollView,KeyboardToolbar,ListItem,ListSection,LoaderOverlay,loader,Markdown,Menu,MessageBubble,MessageList,MODAL_DISMISS_GRACE_MS,Modal,NumberInput,OnboardingPager,OptionSheet,OTPInput,OTPResendRow,PagedListFooter,PermissionPrompt,PhoneNumberInput,PickerTrigger,ProfileCompletion,ProfilePicker,ProgressBar,ProgressRing,Radio,RadioDot,RadioGroup,Rating,Repeater,RichTextEditor,Row,ScannerOverlay,Screen,SearchBar,SectionHeader,SegmentedControl,Select,SignaturePad,Skeleton,SkeletonCircle,SkeletonClockProvider,SkeletonContent,SkeletonList,SkeletonProvider,SkeletonSkip,SkeletonText,Slider,SliderField,SlideToConfirm,SortableList,Spacer,Sparkline,Spinner,SquircleImage,SquircleView,Stack,StatTile,StatusBadge,Stepper,Swipeable,Switch,setAuthedImageCacheLimit,Tabs,TagInput,Text,TextInkContext,Timeline,TimePicker,Toast,ToastHost,ToastProvider,Tooltip,Tour,TypingIndicator,toast,useBottomSheet,useErrorHandler,useRecentSearches,useTextInk,useToast,WheelPicker,withErrorBoundary,ZoomableImage}from"./components/index.js";export{AppIcon}from"./components/AppIcon/index.js";export{HookFormField,useHookFormField}from"./form/index.js";export{useDebounce,useFieldChain,useRefreshControl,useScrollDirection}from"./hooks/index.js";export{NetworkStatusBanner}from"./network/index.js";export{KitThemeBridge,lightTheme,makeStyles,ThemeProvider,useTheme,useThemeMode}from"./theme/index.js";export{setHapticImplementation,triggerHaptic}from"./utils/index.js";
@@ -1 +1 @@
1
- "use strict";import{useNavigation,usePreventRemove}from"@react-navigation/native";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Dialog}from"../components/Dialog/index.js";import{jsx as _jsx}from"react/jsx-runtime";export const DEFAULT_DISCARD_GUARD_LABELS={title:"Discard your changes?",message:"The details you entered will be lost.",keep:"Keep editing",discard:"Discard"};export const DiscardGuard=forwardRef(({when:e,labels:t,testID:s},a)=>{const r=useNavigation(),n=useMemo(()=>({...DEFAULT_DISCARD_GUARD_LABELS,...t}),[t]),[l,o]=useState(null),[i,u]=useState(!1),c=useRef(null);usePreventRemove(e&&!i,({data:e})=>o(e.action)),useEffect(()=>{if(i&&c.current){const e=c.current;c.current=null,e()}},[i]);const d=useCallback(e=>{i?e():(c.current=e,u(!0))},[i]);useImperativeHandle(a,()=>({leave:d}),[d]);return _jsx(Dialog,{visible:null!==l,onClose:()=>o(null),title:n.title,message:n.message,actions:[{label:n.keep,tone:"neutral",onPress:()=>o(null)},{label:n.discard,tone:"danger",onPress:()=>{const e=l;o(null),d(()=>{e&&r.dispatch(e)})}}],testID:s})});DiscardGuard.displayName="DiscardGuard";
1
+ "use strict";import{useNavigation,usePreventRemove}from"@react-navigation/native";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Dialog}from"../components/Dialog/index.js";import{jsx as _jsx}from"react/jsx-runtime";export const DEFAULT_DISCARD_GUARD_LABELS={title:"Discard your changes?",message:"The details you entered will be lost.",keep:"Keep editing",discard:"Discard"};export const DiscardGuard=forwardRef(({when:e,labels:t,testID:s},a)=>{const r=useNavigation(),n=useMemo(()=>({...DEFAULT_DISCARD_GUARD_LABELS,...t}),[t]),[o,l]=useState(null),[i,u]=useState(!1),c=useRef(null);usePreventRemove(e&&!i,({data:e})=>l(e.action)),useEffect(()=>{if(i&&c.current){const e=c.current;c.current=null,e()}},[i]);const d=useCallback(e=>{i?e():(c.current=e,u(!0))},[i]);useImperativeHandle(a,()=>({leave:d}),[d]);return _jsx(Dialog,{open:null!==o,onClose:()=>l(null),title:n.title,message:n.message,actions:[{label:n.keep,tone:"neutral",onPress:()=>l(null)},{label:n.discard,tone:"danger",onPress:()=>{const e=o;l(null),d(()=>{e&&r.dispatch(e)})}}],testID:s})});DiscardGuard.displayName="DiscardGuard";
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_DISCARD_GUARD_LABELS,DiscardGuard}from"./DiscardGuard.js";export{NavigationScreen}from"./NavigationScreen.js";
1
+ "use strict";export{DEFAULT_DISCARD_GUARD_LABELS,DiscardGuard}from"./DiscardGuard.js";export{NavigationScreen}from"./NavigationScreen.js";export{useNavigationTheme}from"./useNavigationTheme.js";
@@ -0,0 +1 @@
1
+ "use strict";import{useMemo}from"react";import{useTheme}from"../theme/index.js";export const useNavigationTheme=()=>{const o=useTheme();return useMemo(()=>({dark:"dark"===o.mode,colors:{primary:o.colors.primary,background:o.colors.bg,card:o.colors.surface,text:o.colors.text,border:o.colors.border,notification:o.colors.primary},fonts:{regular:{fontFamily:o.font.ui.normal??"",fontWeight:o.weight.normal},medium:{fontFamily:o.font.ui.medium??"",fontWeight:o.weight.medium},bold:{fontFamily:o.font.ui.semibold??"",fontWeight:o.weight.semibold},heavy:{fontFamily:o.font.ui.bold??"",fontWeight:o.weight.bold}}}),[o])};
@@ -0,0 +1 @@
1
+ "use strict";export{resolveBadgeSize,resolveButtonSize,resolveCheckboxSize,resolveChipSize,resolveEmptyStateSize,resolveFieldSize,resolveFloatingActionButtonSize,resolveListItemSize,resolveOtpInputSize,resolveRadioSize,resolveSegmentedControlSize,resolveSliderSize,resolveSwitchSize,resolveTabsSize}from"./theme/index.js";
@@ -0,0 +1 @@
1
+ "use strict";export{squircleApplies,squircleHostRadius,squirclePath}from"./utils/index.js";
@@ -1 +1 @@
1
- "use strict";import{triggerHaptic}from"./hapticUtils.js";const INTENT_HAPTIC={tap:"impactLight",select:"selection",longPress:"impactMedium",created:"impactMedium",deleted:"notificationWarning",restored:"notificationSuccess",toggledOn:"impactMedium",toggledOff:"impactLight",succeeded:"notificationSuccess",warned:"notificationWarning",failed:"notificationError"};let hapticsEnabled=!0;export const configureFeedback=e=>{hapticsEnabled=e.haptics};export const isFeedbackEnabled=()=>hapticsEnabled;const fire=e=>{hapticsEnabled&&triggerHaptic(INTENT_HAPTIC[e])};export const hapticForIntent=e=>INTENT_HAPTIC[e];export const feedback={tap:()=>fire("tap"),select:()=>fire("select"),longPress:()=>fire("longPress"),created:()=>fire("created"),deleted:()=>fire("deleted"),restored:()=>fire("restored"),toggled:e=>fire(e?"toggledOn":"toggledOff"),succeeded:()=>fire("succeeded"),warned:()=>fire("warned"),failed:()=>fire("failed"),fire:fire};
1
+ "use strict";import{isHapticsEnabled,setHapticsEnabled,triggerHaptic}from"./hapticUtils.js";const INTENT_HAPTIC={tap:"impactLight",select:"selection",longPress:"impactMedium",created:"impactMedium",deleted:"notificationWarning",restored:"notificationSuccess",toggledOn:"impactMedium",toggledOff:"impactLight",succeeded:"notificationSuccess",warned:"notificationWarning",failed:"notificationError"};export const configureFeedback=e=>{setHapticsEnabled(e.haptics)};export const isFeedbackEnabled=()=>isHapticsEnabled();const fire=e=>{triggerHaptic(INTENT_HAPTIC[e])};export const hapticForIntent=e=>INTENT_HAPTIC[e];export const feedback={tap:()=>fire("tap"),select:()=>fire("select"),longPress:()=>fire("longPress"),created:()=>fire("created"),deleted:()=>fire("deleted"),restored:()=>fire("restored"),toggled:e=>fire(e?"toggledOn":"toggledOff"),succeeded:()=>fire("succeeded"),warned:()=>fire("warned"),failed:()=>fire("failed"),fire:fire};
@@ -1 +1 @@
1
- "use strict";import*as Haptics from"expo-haptics";import{Platform}from"react-native";let hapticImpl=null;const EXPO_HANDLERS={selection:()=>Haptics.selectionAsync(),impactLight:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light),impactMedium:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),impactHeavy:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy),notificationSuccess:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),notificationWarning:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning),notificationError:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),longPress:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),tick:()=>Haptics.selectionAsync(),denseTick:()=>Haptics.selectionAsync(),confirm:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),reject:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),gestureStart:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)},ANDROID_HAPTICS={longPress:"Long_Press",tick:"Segment_Tick",denseTick:"Segment_Frequent_Tick",confirm:"Confirm",reject:"Reject",gestureStart:"Gesture_Start"},androidHandler=t=>{const c=ANDROID_HAPTICS[t];return"android"===Platform.OS&&c&&"function"==typeof Haptics.performAndroidHapticsAsync&&Haptics.AndroidHaptics?.[c]?()=>Haptics.performAndroidHapticsAsync(Haptics.AndroidHaptics[c]):null};export const triggerHaptic=(t="selection")=>{if(hapticImpl)try{return void hapticImpl(t)}catch{}const c=androidHandler(t)??EXPO_HANDLERS[t];try{c().catch(()=>{})}catch{}};export const setHapticImplementation=t=>{hapticImpl=t};export const resolveHaptic=(t,c)=>!1===t?null:t??c;
1
+ "use strict";import*as Haptics from"expo-haptics";import{Platform}from"react-native";let hapticImpl=null;const EXPO_HANDLERS={selection:()=>Haptics.selectionAsync(),impactLight:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light),impactMedium:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),impactHeavy:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy),notificationSuccess:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),notificationWarning:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning),notificationError:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),longPress:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),tick:()=>Haptics.selectionAsync(),denseTick:()=>Haptics.selectionAsync(),confirm:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),reject:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),gestureStart:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)},ANDROID_HAPTICS={longPress:"Long_Press",tick:"Segment_Tick",denseTick:"Segment_Frequent_Tick",confirm:"Confirm",reject:"Reject",gestureStart:"Gesture_Start"},androidHandler=t=>{const c=ANDROID_HAPTICS[t];return"android"===Platform.OS&&c&&"function"==typeof Haptics.performAndroidHapticsAsync&&Haptics.AndroidHaptics?.[c]?()=>Haptics.performAndroidHapticsAsync(Haptics.AndroidHaptics[c]):null};let hapticsEnabled=!0;export const setHapticsEnabled=t=>{hapticsEnabled=t};export const isHapticsEnabled=()=>hapticsEnabled;export const triggerHaptic=(t="selection")=>{if(!hapticsEnabled)return;if(hapticImpl)try{return void hapticImpl(t)}catch{}const c=androidHandler(t)??EXPO_HANDLERS[t];try{c().catch(()=>{})}catch{}};export const setHapticImplementation=t=>{hapticImpl=t};export const resolveHaptic=(t,c)=>!1===t?null:t??c;
@@ -13,12 +13,13 @@ export interface AccordionProps {
13
13
  disabled?: boolean;
14
14
  variant?: AccordionVariant;
15
15
  accessibilityLabel?: string;
16
+ /** The outer box. Applied last on that node, so it wins over containerStyle. */
16
17
  style?: StyleProp<ViewStyle>;
17
18
  headerStyle?: StyleProp<ViewStyle>;
18
19
  contentStyle?: StyleProp<ViewStyle>;
19
20
  /** Style applied to the animated wrapper around the expandable content. */
20
21
  contentWrapperStyle?: StyleProp<ViewStyle>;
21
- /** Style applied to the outermost container View. */
22
+ /** Alias of style, applied before it on the same node. Use style. */
22
23
  containerStyle?: StyleProp<ViewStyle>;
23
24
  testID?: string;
24
25
  /**
@@ -106,8 +106,9 @@ export interface AppBarProps {
106
106
  * area and a bottom hairline border fades in.
107
107
  */
108
108
  scrollY?: Animated.Value | Animated.AnimatedInterpolation<number>;
109
+ /** The outer box. Applied last on that node, so it wins over containerStyle. */
109
110
  style?: StyleProp<ViewStyle>;
110
- /** Alias for `style` applied to the outer container (animated when collapsing). */
111
+ /** Alias of style, applied before it on the same node. Use style. */
111
112
  containerStyle?: StyleProp<ViewStyle>;
112
113
  /** Style applied to the title Animated.Text. */
113
114
  titleStyle?: StyleProp<ViewStyle>;
@@ -4,7 +4,7 @@
4
4
  * Draws the same Iconsax glyphs webority-ui's `AppIcon` draws on the web,
5
5
  * keyed by the same names, so a feature that says `<AppIcon name="send" />`
6
6
  * looks identical in the portal and in the app. Two tiers, both generated
7
- * from webority-ui by `scripts/sync-icons.mjs` (never hand-edit them):
7
+ * from webority-ui's icon map by `scripts/gen-icons.mjs` (never hand-edit them):
8
8
  *
9
9
  * - the curated set: the design system's semantic names ("plus",
10
10
  * "eye-off", "alert-circle") in `glyphs.g.ts` (linear, evaluated at
@@ -21,6 +21,7 @@
21
21
  import type React from "react";
22
22
  import type { StyleProp, ViewStyle } from "react-native";
23
23
  import type { Size } from "../../types/vocabulary";
24
+ import type { TextColor } from "../Text/Text";
24
25
  import type { IconName } from "./catalog.g";
25
26
  import { ICON_NAMES } from "./catalog.g";
26
27
  import type { CuratedIconName } from "./glyphs.g";
@@ -40,6 +41,8 @@ export type AppIconName = IconName | IconsaxShadowedName;
40
41
  /** `linear` is the default Iconsax style; the rest come from the lazy modules. */
41
42
  export type IconVariant = "linear" | IconVariantName;
42
43
  export type AppIconSize = Size;
44
+ /** A text role or tone name, resolved as Text resolves it, or any raw colour string. */
45
+ export type AppIconColor = TextColor | (string & {});
43
46
  /** Pixel sizes behind the size tokens; a raw number is accepted too. */
44
47
  export declare const APP_ICON_SIZES: Record<AppIconSize, number>;
45
48
  export interface AppIconProps {
@@ -51,8 +54,8 @@ export interface AppIconProps {
51
54
  name: AppIconName;
52
55
  /** Size token or a pixel number. Default `'md'` (22). */
53
56
  size?: AppIconSize | number;
54
- /** Any colour string. Default `theme.colors["text-body"]`. */
55
- color?: string;
57
+ /** A text role or tone name ("tertiary", "success", "brand") or any colour string. Default theme.colors["text-body"]. */
58
+ color?: AppIconColor;
56
59
  /** Iconsax style. Default `'linear'`. Names missing in a style fall back to linear. */
57
60
  variant?: IconVariant;
58
61
  style?: StyleProp<ViewStyle>;