@webority/mobile-ui 0.164.0 → 0.167.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 (998) hide show
  1. package/LICENSE.txt +1 -1
  2. package/dist/canvas-kit/kit.js +10 -10
  3. package/dist/canvas-kit/manifest.json +27 -13
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/lib/commonjs/components/Accordion/Accordion.js +1 -1
  6. package/lib/commonjs/components/AmountSlider/AmountSlider.js +1 -1
  7. package/lib/commonjs/components/AmountSlider/index.js +1 -1
  8. package/lib/commonjs/components/AppBar/AppBar.js +1 -1
  9. package/lib/commonjs/components/AppBar/index.js +1 -1
  10. package/lib/commonjs/components/AppLockOverlay/AppLockOverlay.js +1 -1
  11. package/lib/commonjs/components/AppLockOverlay/index.js +1 -1
  12. package/lib/commonjs/components/AsyncBlock/AsyncBlock.js +1 -1
  13. package/lib/commonjs/components/AsyncBlock/index.js +1 -1
  14. package/lib/commonjs/components/AuthedImage/AuthedImage.js +1 -1
  15. package/lib/commonjs/components/Autocomplete/Autocomplete.js +1 -1
  16. package/lib/commonjs/components/Autocomplete/index.js +1 -1
  17. package/lib/commonjs/components/Avatar/Avatar.js +1 -1
  18. package/lib/commonjs/components/Avatar/index.js +1 -1
  19. package/lib/commonjs/components/Badge/Badge.js +1 -1
  20. package/lib/commonjs/components/Badge/index.js +1 -1
  21. package/lib/commonjs/components/Banner/Banner.js +1 -1
  22. package/lib/commonjs/components/Banner/index.js +1 -1
  23. package/lib/commonjs/components/BarChart/BarChart.js +1 -1
  24. package/lib/commonjs/components/BarChart/index.js +1 -1
  25. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
  26. package/lib/commonjs/components/BottomNavigation/index.js +1 -1
  27. package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
  28. package/lib/commonjs/components/BottomSheet/index.js +1 -1
  29. package/lib/commonjs/components/Button/Button.js +1 -1
  30. package/lib/commonjs/components/Calendar/Calendar.js +1 -1
  31. package/lib/commonjs/components/Calendar/index.js +1 -1
  32. package/lib/commonjs/components/Card/Card.js +1 -1
  33. package/lib/commonjs/components/Card/index.js +1 -1
  34. package/lib/commonjs/components/Carousel/Carousel.js +1 -1
  35. package/lib/commonjs/components/Carousel/index.js +1 -1
  36. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
  37. package/lib/commonjs/components/Chip/Chip.js +1 -1
  38. package/lib/commonjs/components/Chip/index.js +1 -1
  39. package/lib/commonjs/components/Composer/Composer.js +1 -1
  40. package/lib/commonjs/components/Composer/index.js +1 -1
  41. package/lib/commonjs/components/Confirm/confirm.js +1 -1
  42. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
  43. package/lib/commonjs/components/DatePicker/index.js +1 -1
  44. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +1 -1
  45. package/lib/commonjs/components/DateRangePicker/index.js +1 -1
  46. package/lib/commonjs/components/DateSeparator/DateSeparator.js +1 -1
  47. package/lib/commonjs/components/DateSeparator/index.js +1 -1
  48. package/lib/commonjs/components/DecimalInput/DecimalInput.js +1 -1
  49. package/lib/commonjs/components/DecimalInput/index.js +1 -1
  50. package/lib/commonjs/components/Dialog/Dialog.js +1 -1
  51. package/lib/commonjs/components/Drawer/Drawer.js +1 -1
  52. package/lib/commonjs/components/Drawer/index.js +1 -1
  53. package/lib/commonjs/components/ErrorBoundary/ErrorBoundary.js +1 -1
  54. package/lib/commonjs/components/ErrorBoundary/index.js +1 -1
  55. package/lib/commonjs/components/FieldBase/FieldBase.js +1 -1
  56. package/lib/commonjs/components/FilePicker/FilePicker.js +1 -1
  57. package/lib/commonjs/components/FilePicker/index.js +1 -1
  58. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
  59. package/lib/commonjs/components/FloatingActionButton/index.js +1 -1
  60. package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
  61. package/lib/commonjs/components/ForceUpdateDialog/index.js +1 -1
  62. package/lib/commonjs/components/FormField/FormField.js +1 -1
  63. package/lib/commonjs/components/FormField/index.js +1 -1
  64. package/lib/commonjs/components/IconBadge/IconBadge.js +1 -1
  65. package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
  66. package/lib/commonjs/components/ImageGallery/index.js +1 -1
  67. package/lib/commonjs/components/InlineSelect/InlineSelect.js +1 -1
  68. package/lib/commonjs/components/InlineSelect/index.js +1 -1
  69. package/lib/commonjs/components/Input/Input.js +1 -1
  70. package/lib/commonjs/components/Input/index.js +1 -1
  71. package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +1 -1
  72. package/lib/commonjs/components/KeyboardToolbar/index.js +1 -1
  73. package/lib/commonjs/components/ListItem/ListItem.js +1 -1
  74. package/lib/commonjs/components/LoaderOverlay/LoaderOverlay.js +1 -1
  75. package/lib/commonjs/components/LoaderOverlay/index.js +1 -1
  76. package/lib/commonjs/components/Menu/Menu.js +1 -1
  77. package/lib/commonjs/components/Menu/index.js +1 -1
  78. package/lib/commonjs/components/Menu/menuModel.js +1 -1
  79. package/lib/commonjs/components/Menu/useContextMenu.js +1 -1
  80. package/lib/commonjs/components/MessageBubble/MessageBubble.js +1 -1
  81. package/lib/commonjs/components/MessageBubble/index.js +1 -1
  82. package/lib/commonjs/components/MessageList/MessageList.js +1 -1
  83. package/lib/commonjs/components/MessageList/index.js +1 -1
  84. package/lib/commonjs/components/Modal/Modal.js +1 -1
  85. package/lib/commonjs/components/Modal/index.js +1 -1
  86. package/lib/commonjs/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
  87. package/lib/commonjs/components/NonModalBottomSheet/index.js +1 -1
  88. package/lib/commonjs/components/NumberInput/NumberInput.js +1 -1
  89. package/lib/commonjs/components/NumberInput/index.js +1 -1
  90. package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
  91. package/lib/commonjs/components/OTPInput/OTPResendRow.js +1 -1
  92. package/lib/commonjs/components/OTPInput/index.js +1 -1
  93. package/lib/commonjs/components/OnboardingPager/OnboardingPager.js +1 -1
  94. package/lib/commonjs/components/OnboardingPager/index.js +1 -1
  95. package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
  96. package/lib/commonjs/components/OptionSheet/index.js +1 -1
  97. package/lib/commonjs/components/PagedListFooter/PagedListFooter.js +1 -1
  98. package/lib/commonjs/components/PagedListFooter/index.js +1 -1
  99. package/lib/commonjs/components/PermissionPrompt/PermissionPrompt.js +1 -1
  100. package/lib/commonjs/components/PermissionPrompt/index.js +1 -1
  101. package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  102. package/lib/commonjs/components/PhoneNumberInput/index.js +1 -1
  103. package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +1 -1
  104. package/lib/commonjs/components/PickerTrigger/index.js +1 -1
  105. package/lib/commonjs/components/ProfileCompletion/ProfileCompletion.js +1 -1
  106. package/lib/commonjs/components/ProfileCompletion/index.js +1 -1
  107. package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
  108. package/lib/commonjs/components/ProfilePicker/index.js +1 -1
  109. package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
  110. package/lib/commonjs/components/ProgressBar/index.js +1 -1
  111. package/lib/commonjs/components/Radio/Radio.js +1 -1
  112. package/lib/commonjs/components/Rating/Rating.js +1 -1
  113. package/lib/commonjs/components/Rating/index.js +1 -1
  114. package/lib/commonjs/components/Repeater/Repeater.js +1 -1
  115. package/lib/commonjs/components/Repeater/index.js +1 -1
  116. package/lib/commonjs/components/RichTextEditor/RichTextEditor.js +1 -1
  117. package/lib/commonjs/components/RichTextEditor/index.js +1 -1
  118. package/lib/commonjs/components/RichTextEditor/markdownActions.js +1 -1
  119. package/lib/commonjs/components/ScannerOverlay/ScannerOverlay.js +1 -1
  120. package/lib/commonjs/components/ScannerOverlay/index.js +1 -1
  121. package/lib/commonjs/components/Screen/Screen.js +1 -1
  122. package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
  123. package/lib/commonjs/components/SearchBar/SearchPanel.js +1 -1
  124. package/lib/commonjs/components/SearchBar/index.js +1 -1
  125. package/lib/commonjs/components/SectionHeader/SectionHeader.js +1 -1
  126. package/lib/commonjs/components/SectionHeader/index.js +1 -1
  127. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +1 -1
  128. package/lib/commonjs/components/Select/Select.js +1 -1
  129. package/lib/commonjs/components/Select/index.js +1 -1
  130. package/lib/commonjs/components/SignaturePad/SignaturePad.js +1 -1
  131. package/lib/commonjs/components/SignaturePad/index.js +1 -1
  132. package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
  133. package/lib/commonjs/components/Skeleton/SkeletonContent.js +1 -1
  134. package/lib/commonjs/components/Skeleton/index.js +1 -1
  135. package/lib/commonjs/components/SlideToConfirm/SlideToConfirm.js +1 -1
  136. package/lib/commonjs/components/SlideToConfirm/index.js +1 -1
  137. package/lib/commonjs/components/Slider/Slider.js +1 -1
  138. package/lib/commonjs/components/SliderField/SliderField.js +1 -1
  139. package/lib/commonjs/components/SliderField/index.js +1 -1
  140. package/lib/commonjs/components/SortableList/SortableList.js +1 -1
  141. package/lib/commonjs/components/SortableList/index.js +1 -1
  142. package/lib/commonjs/components/Sparkline/Sparkline.js +1 -1
  143. package/lib/commonjs/components/Sparkline/index.js +1 -1
  144. package/lib/commonjs/components/Spinner/Spinner.js +1 -1
  145. package/lib/commonjs/components/Spinner/index.js +1 -1
  146. package/lib/commonjs/components/Stepper/Stepper.js +1 -1
  147. package/lib/commonjs/components/Stepper/index.js +1 -1
  148. package/lib/commonjs/components/Swipeable/Swipeable.js +1 -1
  149. package/lib/commonjs/components/Switch/Switch.js +1 -1
  150. package/lib/commonjs/components/TagInput/TagInput.js +1 -1
  151. package/lib/commonjs/components/TimePicker/TimePicker.js +1 -1
  152. package/lib/commonjs/components/TimePicker/index.js +1 -1
  153. package/lib/commonjs/components/Toast/Toast.js +1 -1
  154. package/lib/commonjs/components/Toast/ToastProvider.js +1 -1
  155. package/lib/commonjs/components/Toast/index.js +1 -1
  156. package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
  157. package/lib/commonjs/components/Tooltip/index.js +1 -1
  158. package/lib/commonjs/components/Tour/Tour.js +1 -1
  159. package/lib/commonjs/components/Tour/index.js +1 -1
  160. package/lib/commonjs/components/TypingIndicator/TypingIndicator.js +1 -1
  161. package/lib/commonjs/components/TypingIndicator/index.js +1 -1
  162. package/lib/commonjs/components/WheelPicker/Wheel.js +1 -1
  163. package/lib/commonjs/components/WheelPicker/WheelPicker.js +1 -1
  164. package/lib/commonjs/components/WheelPicker/index.js +1 -1
  165. package/lib/commonjs/components/index.js +1 -1
  166. package/lib/commonjs/form/HookFormField.js +1 -1
  167. package/lib/commonjs/hooks/useDragToDismiss.js +1 -1
  168. package/lib/commonjs/hooks/useRefreshControl.js +1 -1
  169. package/lib/commonjs/index.js +1 -1
  170. package/lib/commonjs/navigation/DiscardGuard.js +1 -1
  171. package/lib/commonjs/navigation/index.js +1 -1
  172. package/lib/commonjs/network/NetworkStatusBanner.js +1 -1
  173. package/lib/commonjs/text/index.js +1 -0
  174. package/lib/commonjs/text/phone/amountSlider.g.js +1 -0
  175. package/lib/commonjs/text/phone/asyncBlock.g.js +1 -0
  176. package/lib/commonjs/text/phone/authedImage.g.js +1 -0
  177. package/lib/commonjs/text/phone/autocomplete.g.js +1 -0
  178. package/lib/commonjs/text/phone/avatar.g.js +1 -0
  179. package/lib/commonjs/text/phone/badge.g.js +1 -0
  180. package/lib/commonjs/text/phone/banner.g.js +1 -0
  181. package/lib/commonjs/text/phone/bar.g.js +1 -0
  182. package/lib/commonjs/text/phone/barChart.g.js +1 -0
  183. package/lib/commonjs/text/phone/bottomNavigation.g.js +1 -0
  184. package/lib/commonjs/text/phone/bottomSheet.g.js +1 -0
  185. package/lib/commonjs/text/phone/button.g.js +1 -0
  186. package/lib/commonjs/text/phone/calendar.g.js +1 -0
  187. package/lib/commonjs/text/phone/card.g.js +1 -0
  188. package/lib/commonjs/text/phone/carousel.g.js +1 -0
  189. package/lib/commonjs/text/phone/catalogue.g.js +1 -0
  190. package/lib/commonjs/text/phone/chip.g.js +1 -0
  191. package/lib/commonjs/text/phone/composer.g.js +1 -0
  192. package/lib/commonjs/text/phone/confirm.g.js +1 -0
  193. package/lib/commonjs/text/phone/datePicker.g.js +1 -0
  194. package/lib/commonjs/text/phone/dateRangePicker.g.js +1 -0
  195. package/lib/commonjs/text/phone/dateSeparator.g.js +1 -0
  196. package/lib/commonjs/text/phone/decimalInput.g.js +1 -0
  197. package/lib/commonjs/text/phone/discardGuard.g.js +1 -0
  198. package/lib/commonjs/text/phone/drawer.g.js +1 -0
  199. package/lib/commonjs/text/phone/errorBoundary.g.js +1 -0
  200. package/lib/commonjs/text/phone/filePicker.g.js +1 -0
  201. package/lib/commonjs/text/phone/floatingActionButton.g.js +1 -0
  202. package/lib/commonjs/text/phone/forceUpdateDialog.g.js +1 -0
  203. package/lib/commonjs/text/phone/formField.g.js +1 -0
  204. package/lib/commonjs/text/phone/imageGallery.g.js +1 -0
  205. package/lib/commonjs/text/phone/index.g.js +1 -0
  206. package/lib/commonjs/text/phone/inlineSelect.g.js +1 -0
  207. package/lib/commonjs/text/phone/input.g.js +1 -0
  208. package/lib/commonjs/text/phone/keyboardToolbar.g.js +1 -0
  209. package/lib/commonjs/text/phone/loaderOverlay.g.js +1 -0
  210. package/lib/commonjs/text/phone/lockOverlay.g.js +1 -0
  211. package/lib/commonjs/text/phone/menu.g.js +1 -0
  212. package/lib/commonjs/text/phone/messageBubble.g.js +1 -0
  213. package/lib/commonjs/text/phone/messageList.g.js +1 -0
  214. package/lib/commonjs/text/phone/modal.g.js +1 -0
  215. package/lib/commonjs/text/phone/networkStatusBanner.g.js +1 -0
  216. package/lib/commonjs/text/phone/nonModalBottomSheet.g.js +1 -0
  217. package/lib/commonjs/text/phone/numberInput.g.js +1 -0
  218. package/lib/commonjs/text/phone/onboardingPager.g.js +1 -0
  219. package/lib/commonjs/text/phone/optionSheet.g.js +1 -0
  220. package/lib/commonjs/text/phone/otpInput.g.js +1 -0
  221. package/lib/commonjs/text/phone/pagedListFooter.g.js +1 -0
  222. package/lib/commonjs/text/phone/permissionPrompt.g.js +1 -0
  223. package/lib/commonjs/text/phone/phoneNumberInput.g.js +1 -0
  224. package/lib/commonjs/text/phone/pickerTrigger.g.js +1 -0
  225. package/lib/commonjs/text/phone/profileCompletion.g.js +1 -0
  226. package/lib/commonjs/text/phone/profilePicker.g.js +1 -0
  227. package/lib/commonjs/text/phone/progressBar.g.js +1 -0
  228. package/lib/commonjs/text/phone/rating.g.js +1 -0
  229. package/lib/commonjs/text/phone/refreshControl.g.js +1 -0
  230. package/lib/commonjs/text/phone/repeater.g.js +1 -0
  231. package/lib/commonjs/text/phone/richTextEditor.g.js +1 -0
  232. package/lib/commonjs/text/phone/scannerOverlay.g.js +1 -0
  233. package/lib/commonjs/text/phone/searchBar.g.js +1 -0
  234. package/lib/commonjs/text/phone/sectionHeader.g.js +1 -0
  235. package/lib/commonjs/text/phone/select.g.js +1 -0
  236. package/lib/commonjs/text/phone/signaturePad.g.js +1 -0
  237. package/lib/commonjs/text/phone/skeleton.g.js +1 -0
  238. package/lib/commonjs/text/phone/slideToConfirm.g.js +1 -0
  239. package/lib/commonjs/text/phone/slider.g.js +1 -0
  240. package/lib/commonjs/text/phone/sliderField.g.js +1 -0
  241. package/lib/commonjs/text/phone/sortableList.g.js +1 -0
  242. package/lib/commonjs/text/phone/sparkline.g.js +1 -0
  243. package/lib/commonjs/text/phone/spinner.g.js +1 -0
  244. package/lib/commonjs/text/phone/stepper.g.js +1 -0
  245. package/lib/commonjs/text/phone/timePicker.g.js +1 -0
  246. package/lib/commonjs/text/phone/toast.g.js +1 -0
  247. package/lib/commonjs/text/phone/tooltip.g.js +1 -0
  248. package/lib/commonjs/text/phone/tour.g.js +1 -0
  249. package/lib/commonjs/text/phone/typingIndicator.g.js +1 -0
  250. package/lib/commonjs/text/phone/wheelPicker.g.js +1 -0
  251. package/lib/commonjs/text/textStore.js +1 -0
  252. package/lib/commonjs/theme/merge.js +1 -1
  253. package/lib/commonjs/theme/tokens.generated.js +1 -1
  254. package/lib/module/components/Accordion/Accordion.js +1 -1
  255. package/lib/module/components/AmountSlider/AmountSlider.js +1 -1
  256. package/lib/module/components/AmountSlider/index.js +1 -1
  257. package/lib/module/components/AppBar/AppBar.js +1 -1
  258. package/lib/module/components/AppBar/index.js +1 -1
  259. package/lib/module/components/AppLockOverlay/AppLockOverlay.js +1 -1
  260. package/lib/module/components/AppLockOverlay/index.js +1 -1
  261. package/lib/module/components/AsyncBlock/AsyncBlock.js +1 -1
  262. package/lib/module/components/AsyncBlock/index.js +1 -1
  263. package/lib/module/components/AuthedImage/AuthedImage.js +1 -1
  264. package/lib/module/components/Autocomplete/Autocomplete.js +1 -1
  265. package/lib/module/components/Autocomplete/index.js +1 -1
  266. package/lib/module/components/Avatar/Avatar.js +1 -1
  267. package/lib/module/components/Avatar/index.js +1 -1
  268. package/lib/module/components/Badge/Badge.js +1 -1
  269. package/lib/module/components/Badge/index.js +1 -1
  270. package/lib/module/components/Banner/Banner.js +1 -1
  271. package/lib/module/components/Banner/index.js +1 -1
  272. package/lib/module/components/BarChart/BarChart.js +1 -1
  273. package/lib/module/components/BarChart/index.js +1 -1
  274. package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
  275. package/lib/module/components/BottomNavigation/index.js +1 -1
  276. package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
  277. package/lib/module/components/BottomSheet/index.js +1 -1
  278. package/lib/module/components/Button/Button.js +1 -1
  279. package/lib/module/components/Calendar/Calendar.js +1 -1
  280. package/lib/module/components/Calendar/index.js +1 -1
  281. package/lib/module/components/Card/Card.js +1 -1
  282. package/lib/module/components/Card/index.js +1 -1
  283. package/lib/module/components/Carousel/Carousel.js +1 -1
  284. package/lib/module/components/Carousel/index.js +1 -1
  285. package/lib/module/components/Checkbox/Checkbox.js +1 -1
  286. package/lib/module/components/Chip/Chip.js +1 -1
  287. package/lib/module/components/Chip/index.js +1 -1
  288. package/lib/module/components/Composer/Composer.js +1 -1
  289. package/lib/module/components/Composer/index.js +1 -1
  290. package/lib/module/components/Confirm/confirm.js +1 -1
  291. package/lib/module/components/DatePicker/DatePicker.js +1 -1
  292. package/lib/module/components/DatePicker/index.js +1 -1
  293. package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
  294. package/lib/module/components/DateRangePicker/index.js +1 -1
  295. package/lib/module/components/DateSeparator/DateSeparator.js +1 -1
  296. package/lib/module/components/DateSeparator/index.js +1 -1
  297. package/lib/module/components/DecimalInput/DecimalInput.js +1 -1
  298. package/lib/module/components/DecimalInput/index.js +1 -1
  299. package/lib/module/components/Dialog/Dialog.js +1 -1
  300. package/lib/module/components/Drawer/Drawer.js +1 -1
  301. package/lib/module/components/Drawer/index.js +1 -1
  302. package/lib/module/components/ErrorBoundary/ErrorBoundary.js +1 -1
  303. package/lib/module/components/ErrorBoundary/index.js +1 -1
  304. package/lib/module/components/FieldBase/FieldBase.js +1 -1
  305. package/lib/module/components/FilePicker/FilePicker.js +1 -1
  306. package/lib/module/components/FilePicker/index.js +1 -1
  307. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
  308. package/lib/module/components/FloatingActionButton/index.js +1 -1
  309. package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
  310. package/lib/module/components/ForceUpdateDialog/index.js +1 -1
  311. package/lib/module/components/FormField/FormField.js +1 -1
  312. package/lib/module/components/FormField/index.js +1 -1
  313. package/lib/module/components/IconBadge/IconBadge.js +1 -1
  314. package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
  315. package/lib/module/components/ImageGallery/index.js +1 -1
  316. package/lib/module/components/InlineSelect/InlineSelect.js +1 -1
  317. package/lib/module/components/InlineSelect/index.js +1 -1
  318. package/lib/module/components/Input/Input.js +1 -1
  319. package/lib/module/components/Input/index.js +1 -1
  320. package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +1 -1
  321. package/lib/module/components/KeyboardToolbar/index.js +1 -1
  322. package/lib/module/components/ListItem/ListItem.js +1 -1
  323. package/lib/module/components/LoaderOverlay/LoaderOverlay.js +1 -1
  324. package/lib/module/components/LoaderOverlay/index.js +1 -1
  325. package/lib/module/components/Menu/Menu.js +1 -1
  326. package/lib/module/components/Menu/index.js +1 -1
  327. package/lib/module/components/Menu/menuModel.js +1 -1
  328. package/lib/module/components/Menu/useContextMenu.js +1 -1
  329. package/lib/module/components/MessageBubble/MessageBubble.js +1 -1
  330. package/lib/module/components/MessageBubble/index.js +1 -1
  331. package/lib/module/components/MessageList/MessageList.js +1 -1
  332. package/lib/module/components/MessageList/index.js +1 -1
  333. package/lib/module/components/Modal/Modal.js +1 -1
  334. package/lib/module/components/Modal/index.js +1 -1
  335. package/lib/module/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
  336. package/lib/module/components/NonModalBottomSheet/index.js +1 -1
  337. package/lib/module/components/NumberInput/NumberInput.js +1 -1
  338. package/lib/module/components/NumberInput/index.js +1 -1
  339. package/lib/module/components/OTPInput/OTPInput.js +1 -1
  340. package/lib/module/components/OTPInput/OTPResendRow.js +1 -1
  341. package/lib/module/components/OTPInput/index.js +1 -1
  342. package/lib/module/components/OnboardingPager/OnboardingPager.js +1 -1
  343. package/lib/module/components/OnboardingPager/index.js +1 -1
  344. package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
  345. package/lib/module/components/OptionSheet/index.js +1 -1
  346. package/lib/module/components/PagedListFooter/PagedListFooter.js +1 -1
  347. package/lib/module/components/PagedListFooter/index.js +1 -1
  348. package/lib/module/components/PermissionPrompt/PermissionPrompt.js +1 -1
  349. package/lib/module/components/PermissionPrompt/index.js +1 -1
  350. package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
  351. package/lib/module/components/PhoneNumberInput/index.js +1 -1
  352. package/lib/module/components/PickerTrigger/PickerTrigger.js +1 -1
  353. package/lib/module/components/PickerTrigger/index.js +1 -1
  354. package/lib/module/components/ProfileCompletion/ProfileCompletion.js +1 -1
  355. package/lib/module/components/ProfileCompletion/index.js +1 -1
  356. package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
  357. package/lib/module/components/ProfilePicker/index.js +1 -1
  358. package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
  359. package/lib/module/components/ProgressBar/index.js +1 -1
  360. package/lib/module/components/Radio/Radio.js +1 -1
  361. package/lib/module/components/Rating/Rating.js +1 -1
  362. package/lib/module/components/Rating/index.js +1 -1
  363. package/lib/module/components/Repeater/Repeater.js +1 -1
  364. package/lib/module/components/Repeater/index.js +1 -1
  365. package/lib/module/components/RichTextEditor/RichTextEditor.js +1 -1
  366. package/lib/module/components/RichTextEditor/index.js +1 -1
  367. package/lib/module/components/RichTextEditor/markdownActions.js +1 -1
  368. package/lib/module/components/ScannerOverlay/ScannerOverlay.js +1 -1
  369. package/lib/module/components/ScannerOverlay/index.js +1 -1
  370. package/lib/module/components/Screen/Screen.js +1 -1
  371. package/lib/module/components/SearchBar/SearchBar.js +1 -1
  372. package/lib/module/components/SearchBar/SearchPanel.js +1 -1
  373. package/lib/module/components/SearchBar/index.js +1 -1
  374. package/lib/module/components/SectionHeader/SectionHeader.js +1 -1
  375. package/lib/module/components/SectionHeader/index.js +1 -1
  376. package/lib/module/components/SegmentedControl/SegmentedControl.js +1 -1
  377. package/lib/module/components/Select/Select.js +1 -1
  378. package/lib/module/components/Select/index.js +1 -1
  379. package/lib/module/components/SignaturePad/SignaturePad.js +1 -1
  380. package/lib/module/components/SignaturePad/index.js +1 -1
  381. package/lib/module/components/Skeleton/Skeleton.js +1 -1
  382. package/lib/module/components/Skeleton/SkeletonContent.js +1 -1
  383. package/lib/module/components/Skeleton/index.js +1 -1
  384. package/lib/module/components/SlideToConfirm/SlideToConfirm.js +1 -1
  385. package/lib/module/components/SlideToConfirm/index.js +1 -1
  386. package/lib/module/components/Slider/Slider.js +1 -1
  387. package/lib/module/components/SliderField/SliderField.js +1 -1
  388. package/lib/module/components/SliderField/index.js +1 -1
  389. package/lib/module/components/SortableList/SortableList.js +1 -1
  390. package/lib/module/components/SortableList/index.js +1 -1
  391. package/lib/module/components/Sparkline/Sparkline.js +1 -1
  392. package/lib/module/components/Sparkline/index.js +1 -1
  393. package/lib/module/components/Spinner/Spinner.js +1 -1
  394. package/lib/module/components/Spinner/index.js +1 -1
  395. package/lib/module/components/Stepper/Stepper.js +1 -1
  396. package/lib/module/components/Stepper/index.js +1 -1
  397. package/lib/module/components/Swipeable/Swipeable.js +1 -1
  398. package/lib/module/components/Switch/Switch.js +1 -1
  399. package/lib/module/components/TagInput/TagInput.js +1 -1
  400. package/lib/module/components/TimePicker/TimePicker.js +1 -1
  401. package/lib/module/components/TimePicker/index.js +1 -1
  402. package/lib/module/components/Toast/Toast.js +1 -1
  403. package/lib/module/components/Toast/ToastProvider.js +1 -1
  404. package/lib/module/components/Toast/index.js +1 -1
  405. package/lib/module/components/Tooltip/Tooltip.js +1 -1
  406. package/lib/module/components/Tooltip/index.js +1 -1
  407. package/lib/module/components/Tour/Tour.js +1 -1
  408. package/lib/module/components/Tour/index.js +1 -1
  409. package/lib/module/components/TypingIndicator/TypingIndicator.js +1 -1
  410. package/lib/module/components/TypingIndicator/index.js +1 -1
  411. package/lib/module/components/WheelPicker/Wheel.js +1 -1
  412. package/lib/module/components/WheelPicker/WheelPicker.js +1 -1
  413. package/lib/module/components/WheelPicker/index.js +1 -1
  414. package/lib/module/components/index.js +1 -1
  415. package/lib/module/form/HookFormField.js +1 -1
  416. package/lib/module/hooks/useDragToDismiss.js +1 -1
  417. package/lib/module/hooks/useRefreshControl.js +1 -1
  418. package/lib/module/index.js +1 -1
  419. package/lib/module/navigation/DiscardGuard.js +1 -1
  420. package/lib/module/navigation/index.js +1 -1
  421. package/lib/module/network/NetworkStatusBanner.js +1 -1
  422. package/lib/module/text/index.js +1 -0
  423. package/lib/module/text/phone/amountSlider.g.js +1 -0
  424. package/lib/module/text/phone/asyncBlock.g.js +1 -0
  425. package/lib/module/text/phone/authedImage.g.js +1 -0
  426. package/lib/module/text/phone/autocomplete.g.js +1 -0
  427. package/lib/module/text/phone/avatar.g.js +1 -0
  428. package/lib/module/text/phone/badge.g.js +1 -0
  429. package/lib/module/text/phone/banner.g.js +1 -0
  430. package/lib/module/text/phone/bar.g.js +1 -0
  431. package/lib/module/text/phone/barChart.g.js +1 -0
  432. package/lib/module/text/phone/bottomNavigation.g.js +1 -0
  433. package/lib/module/text/phone/bottomSheet.g.js +1 -0
  434. package/lib/module/text/phone/button.g.js +1 -0
  435. package/lib/module/text/phone/calendar.g.js +1 -0
  436. package/lib/module/text/phone/card.g.js +1 -0
  437. package/lib/module/text/phone/carousel.g.js +1 -0
  438. package/lib/module/text/phone/catalogue.g.js +1 -0
  439. package/lib/module/text/phone/chip.g.js +1 -0
  440. package/lib/module/text/phone/composer.g.js +1 -0
  441. package/lib/module/text/phone/confirm.g.js +1 -0
  442. package/lib/module/text/phone/datePicker.g.js +1 -0
  443. package/lib/module/text/phone/dateRangePicker.g.js +1 -0
  444. package/lib/module/text/phone/dateSeparator.g.js +1 -0
  445. package/lib/module/text/phone/decimalInput.g.js +1 -0
  446. package/lib/module/text/phone/discardGuard.g.js +1 -0
  447. package/lib/module/text/phone/drawer.g.js +1 -0
  448. package/lib/module/text/phone/errorBoundary.g.js +1 -0
  449. package/lib/module/text/phone/filePicker.g.js +1 -0
  450. package/lib/module/text/phone/floatingActionButton.g.js +1 -0
  451. package/lib/module/text/phone/forceUpdateDialog.g.js +1 -0
  452. package/lib/module/text/phone/formField.g.js +1 -0
  453. package/lib/module/text/phone/imageGallery.g.js +1 -0
  454. package/lib/module/text/phone/index.g.js +1 -0
  455. package/lib/module/text/phone/inlineSelect.g.js +1 -0
  456. package/lib/module/text/phone/input.g.js +1 -0
  457. package/lib/module/text/phone/keyboardToolbar.g.js +1 -0
  458. package/lib/module/text/phone/loaderOverlay.g.js +1 -0
  459. package/lib/module/text/phone/lockOverlay.g.js +1 -0
  460. package/lib/module/text/phone/menu.g.js +1 -0
  461. package/lib/module/text/phone/messageBubble.g.js +1 -0
  462. package/lib/module/text/phone/messageList.g.js +1 -0
  463. package/lib/module/text/phone/modal.g.js +1 -0
  464. package/lib/module/text/phone/networkStatusBanner.g.js +1 -0
  465. package/lib/module/text/phone/nonModalBottomSheet.g.js +1 -0
  466. package/lib/module/text/phone/numberInput.g.js +1 -0
  467. package/lib/module/text/phone/onboardingPager.g.js +1 -0
  468. package/lib/module/text/phone/optionSheet.g.js +1 -0
  469. package/lib/module/text/phone/otpInput.g.js +1 -0
  470. package/lib/module/text/phone/pagedListFooter.g.js +1 -0
  471. package/lib/module/text/phone/permissionPrompt.g.js +1 -0
  472. package/lib/module/text/phone/phoneNumberInput.g.js +1 -0
  473. package/lib/module/text/phone/pickerTrigger.g.js +1 -0
  474. package/lib/module/text/phone/profileCompletion.g.js +1 -0
  475. package/lib/module/text/phone/profilePicker.g.js +1 -0
  476. package/lib/module/text/phone/progressBar.g.js +1 -0
  477. package/lib/module/text/phone/rating.g.js +1 -0
  478. package/lib/module/text/phone/refreshControl.g.js +1 -0
  479. package/lib/module/text/phone/repeater.g.js +1 -0
  480. package/lib/module/text/phone/richTextEditor.g.js +1 -0
  481. package/lib/module/text/phone/scannerOverlay.g.js +1 -0
  482. package/lib/module/text/phone/searchBar.g.js +1 -0
  483. package/lib/module/text/phone/sectionHeader.g.js +1 -0
  484. package/lib/module/text/phone/select.g.js +1 -0
  485. package/lib/module/text/phone/signaturePad.g.js +1 -0
  486. package/lib/module/text/phone/skeleton.g.js +1 -0
  487. package/lib/module/text/phone/slideToConfirm.g.js +1 -0
  488. package/lib/module/text/phone/slider.g.js +1 -0
  489. package/lib/module/text/phone/sliderField.g.js +1 -0
  490. package/lib/module/text/phone/sortableList.g.js +1 -0
  491. package/lib/module/text/phone/sparkline.g.js +1 -0
  492. package/lib/module/text/phone/spinner.g.js +1 -0
  493. package/lib/module/text/phone/stepper.g.js +1 -0
  494. package/lib/module/text/phone/timePicker.g.js +1 -0
  495. package/lib/module/text/phone/toast.g.js +1 -0
  496. package/lib/module/text/phone/tooltip.g.js +1 -0
  497. package/lib/module/text/phone/tour.g.js +1 -0
  498. package/lib/module/text/phone/typingIndicator.g.js +1 -0
  499. package/lib/module/text/phone/wheelPicker.g.js +1 -0
  500. package/lib/module/text/textStore.js +1 -0
  501. package/lib/module/theme/merge.js +1 -1
  502. package/lib/module/theme/tokens.generated.js +1 -1
  503. package/lib/text/en.json +508 -0
  504. package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +1 -3
  505. package/lib/typescript/commonjs/components/AmountSlider/AmountSlider.d.ts +3 -11
  506. package/lib/typescript/commonjs/components/AmountSlider/index.d.ts +2 -2
  507. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +4 -8
  508. package/lib/typescript/commonjs/components/AppBar/index.d.ts +2 -2
  509. package/lib/typescript/commonjs/components/AppLockOverlay/AppLockOverlay.d.ts +2 -10
  510. package/lib/typescript/commonjs/components/AppLockOverlay/index.d.ts +2 -2
  511. package/lib/typescript/commonjs/components/AsyncBlock/AsyncBlock.d.ts +2 -8
  512. package/lib/typescript/commonjs/components/AsyncBlock/index.d.ts +2 -2
  513. package/lib/typescript/commonjs/components/AuthedImage/AuthedImage.d.ts +2 -7
  514. package/lib/typescript/commonjs/components/Autocomplete/Autocomplete.d.ts +3 -7
  515. package/lib/typescript/commonjs/components/Autocomplete/index.d.ts +2 -2
  516. package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +4 -13
  517. package/lib/typescript/commonjs/components/Avatar/index.d.ts +2 -2
  518. package/lib/typescript/commonjs/components/Badge/Badge.d.ts +2 -6
  519. package/lib/typescript/commonjs/components/Badge/index.d.ts +2 -2
  520. package/lib/typescript/commonjs/components/Banner/Banner.d.ts +4 -9
  521. package/lib/typescript/commonjs/components/Banner/index.d.ts +2 -2
  522. package/lib/typescript/commonjs/components/BarChart/BarChart.d.ts +2 -7
  523. package/lib/typescript/commonjs/components/BarChart/index.d.ts +2 -2
  524. package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +2 -7
  525. package/lib/typescript/commonjs/components/BottomNavigation/index.d.ts +2 -2
  526. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +4 -7
  527. package/lib/typescript/commonjs/components/BottomSheet/index.d.ts +2 -2
  528. package/lib/typescript/commonjs/components/Button/Button.d.ts +4 -8
  529. package/lib/typescript/commonjs/components/Button/index.d.ts +1 -1
  530. package/lib/typescript/commonjs/components/Calendar/Calendar.d.ts +2 -8
  531. package/lib/typescript/commonjs/components/Calendar/index.d.ts +2 -2
  532. package/lib/typescript/commonjs/components/Card/Card.d.ts +4 -12
  533. package/lib/typescript/commonjs/components/Card/index.d.ts +2 -2
  534. package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +4 -8
  535. package/lib/typescript/commonjs/components/Carousel/index.d.ts +2 -2
  536. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +1 -3
  537. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +3 -8
  538. package/lib/typescript/commonjs/components/Chip/index.d.ts +2 -2
  539. package/lib/typescript/commonjs/components/Composer/Composer.d.ts +2 -6
  540. package/lib/typescript/commonjs/components/Composer/index.d.ts +2 -2
  541. package/lib/typescript/commonjs/components/Confirm/confirm.d.ts +2 -3
  542. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +5 -21
  543. package/lib/typescript/commonjs/components/DatePicker/index.d.ts +2 -2
  544. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +6 -11
  545. package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts +2 -2
  546. package/lib/typescript/commonjs/components/DateSeparator/DateSeparator.d.ts +3 -7
  547. package/lib/typescript/commonjs/components/DateSeparator/index.d.ts +2 -2
  548. package/lib/typescript/commonjs/components/DecimalInput/DecimalInput.d.ts +3 -6
  549. package/lib/typescript/commonjs/components/DecimalInput/index.d.ts +2 -2
  550. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +3 -3
  551. package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +3 -7
  552. package/lib/typescript/commonjs/components/Drawer/index.d.ts +2 -2
  553. package/lib/typescript/commonjs/components/ErrorBoundary/ErrorBoundary.d.ts +2 -7
  554. package/lib/typescript/commonjs/components/ErrorBoundary/index.d.ts +2 -2
  555. package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +5 -3
  556. package/lib/typescript/commonjs/components/FilePicker/FilePicker.d.ts +2 -29
  557. package/lib/typescript/commonjs/components/FilePicker/index.d.ts +2 -2
  558. package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +4 -14
  559. package/lib/typescript/commonjs/components/FloatingActionButton/index.d.ts +2 -2
  560. package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +6 -10
  561. package/lib/typescript/commonjs/components/ForceUpdateDialog/index.d.ts +2 -2
  562. package/lib/typescript/commonjs/components/FormField/FormField.d.ts +5 -7
  563. package/lib/typescript/commonjs/components/FormField/index.d.ts +2 -2
  564. package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +4 -9
  565. package/lib/typescript/commonjs/components/ImageGallery/index.d.ts +2 -2
  566. package/lib/typescript/commonjs/components/InlineSelect/InlineSelect.d.ts +2 -8
  567. package/lib/typescript/commonjs/components/InlineSelect/index.d.ts +2 -2
  568. package/lib/typescript/commonjs/components/Input/Input.d.ts +6 -10
  569. package/lib/typescript/commonjs/components/Input/index.d.ts +2 -2
  570. package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +2 -7
  571. package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +2 -2
  572. package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +2 -1
  573. package/lib/typescript/commonjs/components/LoaderOverlay/LoaderOverlay.d.ts +2 -6
  574. package/lib/typescript/commonjs/components/LoaderOverlay/index.d.ts +2 -2
  575. package/lib/typescript/commonjs/components/Menu/Menu.d.ts +4 -3
  576. package/lib/typescript/commonjs/components/Menu/MenuSurface.d.ts +3 -2
  577. package/lib/typescript/commonjs/components/Menu/index.d.ts +1 -2
  578. package/lib/typescript/commonjs/components/Menu/menuModel.d.ts +0 -6
  579. package/lib/typescript/commonjs/components/Menu/useContextMenu.d.ts +3 -2
  580. package/lib/typescript/commonjs/components/MessageBubble/MessageBubble.d.ts +2 -13
  581. package/lib/typescript/commonjs/components/MessageBubble/index.d.ts +2 -2
  582. package/lib/typescript/commonjs/components/MessageList/MessageList.d.ts +2 -10
  583. package/lib/typescript/commonjs/components/MessageList/index.d.ts +2 -2
  584. package/lib/typescript/commonjs/components/Modal/Modal.d.ts +4 -6
  585. package/lib/typescript/commonjs/components/Modal/index.d.ts +2 -2
  586. package/lib/typescript/commonjs/components/NonModalBottomSheet/NonModalBottomSheet.d.ts +3 -6
  587. package/lib/typescript/commonjs/components/NonModalBottomSheet/index.d.ts +2 -2
  588. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +4 -10
  589. package/lib/typescript/commonjs/components/NumberInput/index.d.ts +2 -2
  590. package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +2 -5
  591. package/lib/typescript/commonjs/components/OTPInput/OTPResendRow.d.ts +2 -10
  592. package/lib/typescript/commonjs/components/OTPInput/index.d.ts +4 -4
  593. package/lib/typescript/commonjs/components/OnboardingPager/OnboardingPager.d.ts +2 -12
  594. package/lib/typescript/commonjs/components/OnboardingPager/index.d.ts +2 -2
  595. package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +3 -14
  596. package/lib/typescript/commonjs/components/OptionSheet/index.d.ts +2 -2
  597. package/lib/typescript/commonjs/components/PagedListFooter/PagedListFooter.d.ts +2 -7
  598. package/lib/typescript/commonjs/components/PagedListFooter/index.d.ts +2 -2
  599. package/lib/typescript/commonjs/components/PermissionPrompt/PermissionPrompt.d.ts +2 -12
  600. package/lib/typescript/commonjs/components/PermissionPrompt/index.d.ts +2 -2
  601. package/lib/typescript/commonjs/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -14
  602. package/lib/typescript/commonjs/components/PhoneNumberInput/index.d.ts +2 -2
  603. package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +3 -9
  604. package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +2 -2
  605. package/lib/typescript/commonjs/components/ProfileCompletion/ProfileCompletion.d.ts +2 -6
  606. package/lib/typescript/commonjs/components/ProfileCompletion/index.d.ts +2 -2
  607. package/lib/typescript/commonjs/components/ProfilePicker/ProfilePicker.d.ts +3 -12
  608. package/lib/typescript/commonjs/components/ProfilePicker/index.d.ts +2 -2
  609. package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +3 -8
  610. package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +2 -2
  611. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +1 -3
  612. package/lib/typescript/commonjs/components/Rating/Rating.d.ts +3 -8
  613. package/lib/typescript/commonjs/components/Rating/index.d.ts +2 -2
  614. package/lib/typescript/commonjs/components/Repeater/Repeater.d.ts +2 -7
  615. package/lib/typescript/commonjs/components/Repeater/index.d.ts +1 -1
  616. package/lib/typescript/commonjs/components/RichTextEditor/RichTextEditor.d.ts +2 -3
  617. package/lib/typescript/commonjs/components/RichTextEditor/index.d.ts +2 -2
  618. package/lib/typescript/commonjs/components/ScannerOverlay/ScannerOverlay.d.ts +2 -28
  619. package/lib/typescript/commonjs/components/ScannerOverlay/index.d.ts +2 -2
  620. package/lib/typescript/commonjs/components/Screen/Screen.d.ts +1 -0
  621. package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +3 -16
  622. package/lib/typescript/commonjs/components/SearchBar/SearchPanel.d.ts +3 -3
  623. package/lib/typescript/commonjs/components/SearchBar/index.d.ts +2 -2
  624. package/lib/typescript/commonjs/components/SectionHeader/SectionHeader.d.ts +3 -5
  625. package/lib/typescript/commonjs/components/SectionHeader/index.d.ts +2 -2
  626. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +1 -3
  627. package/lib/typescript/commonjs/components/Select/Select.d.ts +7 -12
  628. package/lib/typescript/commonjs/components/Select/index.d.ts +1 -1
  629. package/lib/typescript/commonjs/components/SignaturePad/SignaturePad.d.ts +2 -35
  630. package/lib/typescript/commonjs/components/SignaturePad/index.d.ts +2 -2
  631. package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +2 -6
  632. package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +3 -2
  633. package/lib/typescript/commonjs/components/Skeleton/SkeletonList.d.ts +3 -2
  634. package/lib/typescript/commonjs/components/Skeleton/index.d.ts +2 -2
  635. package/lib/typescript/commonjs/components/SlideToConfirm/SlideToConfirm.d.ts +2 -7
  636. package/lib/typescript/commonjs/components/SlideToConfirm/index.d.ts +2 -2
  637. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +6 -3
  638. package/lib/typescript/commonjs/components/SliderField/SliderField.d.ts +3 -11
  639. package/lib/typescript/commonjs/components/SliderField/index.d.ts +2 -2
  640. package/lib/typescript/commonjs/components/SortableList/SortableList.d.ts +2 -6
  641. package/lib/typescript/commonjs/components/SortableList/index.d.ts +2 -2
  642. package/lib/typescript/commonjs/components/Sparkline/Sparkline.d.ts +2 -6
  643. package/lib/typescript/commonjs/components/Sparkline/index.d.ts +2 -2
  644. package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +2 -5
  645. package/lib/typescript/commonjs/components/Spinner/index.d.ts +2 -2
  646. package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +3 -15
  647. package/lib/typescript/commonjs/components/Stepper/index.d.ts +2 -2
  648. package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +1 -1
  649. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +1 -3
  650. package/lib/typescript/commonjs/components/TagInput/TagInput.d.ts +1 -0
  651. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +6 -19
  652. package/lib/typescript/commonjs/components/TimePicker/index.d.ts +2 -2
  653. package/lib/typescript/commonjs/components/Toast/Toast.d.ts +2 -7
  654. package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts +3 -2
  655. package/lib/typescript/commonjs/components/Toast/index.d.ts +2 -2
  656. package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +3 -10
  657. package/lib/typescript/commonjs/components/Tooltip/index.d.ts +2 -2
  658. package/lib/typescript/commonjs/components/Tour/Tour.d.ts +2 -9
  659. package/lib/typescript/commonjs/components/Tour/index.d.ts +2 -2
  660. package/lib/typescript/commonjs/components/TypingIndicator/TypingIndicator.d.ts +2 -5
  661. package/lib/typescript/commonjs/components/TypingIndicator/index.d.ts +2 -2
  662. package/lib/typescript/commonjs/components/WheelPicker/WheelPicker.d.ts +2 -15
  663. package/lib/typescript/commonjs/components/WheelPicker/index.d.ts +2 -2
  664. package/lib/typescript/commonjs/components/index.d.ts +129 -129
  665. package/lib/typescript/commonjs/form/HookFormField.d.ts +1 -1
  666. package/lib/typescript/commonjs/hooks/useDragToDismiss.d.ts +2 -0
  667. package/lib/typescript/commonjs/index.d.ts +2 -0
  668. package/lib/typescript/commonjs/navigation/DiscardGuard.d.ts +2 -8
  669. package/lib/typescript/commonjs/navigation/index.d.ts +2 -2
  670. package/lib/typescript/commonjs/text/index.d.ts +8 -0
  671. package/lib/typescript/commonjs/text/phone/amountSlider.g.d.ts +10 -0
  672. package/lib/typescript/commonjs/text/phone/asyncBlock.g.d.ts +8 -0
  673. package/lib/typescript/commonjs/text/phone/authedImage.g.d.ts +7 -0
  674. package/lib/typescript/commonjs/text/phone/autocomplete.g.d.ts +6 -0
  675. package/lib/typescript/commonjs/text/phone/avatar.g.d.ts +13 -0
  676. package/lib/typescript/commonjs/text/phone/badge.g.d.ts +6 -0
  677. package/lib/typescript/commonjs/text/phone/banner.g.d.ts +5 -0
  678. package/lib/typescript/commonjs/text/phone/bar.g.d.ts +5 -0
  679. package/lib/typescript/commonjs/text/phone/barChart.g.d.ts +8 -0
  680. package/lib/typescript/commonjs/text/phone/bottomNavigation.g.d.ts +7 -0
  681. package/lib/typescript/commonjs/text/phone/bottomSheet.g.d.ts +7 -0
  682. package/lib/typescript/commonjs/text/phone/button.g.d.ts +5 -0
  683. package/lib/typescript/commonjs/text/phone/calendar.g.d.ts +12 -0
  684. package/lib/typescript/commonjs/text/phone/card.g.d.ts +8 -0
  685. package/lib/typescript/commonjs/text/phone/carousel.g.d.ts +7 -0
  686. package/lib/typescript/commonjs/text/phone/catalogue.g.d.ts +153 -0
  687. package/lib/typescript/commonjs/text/phone/chip.g.d.ts +5 -0
  688. package/lib/typescript/commonjs/text/phone/composer.g.d.ts +7 -0
  689. package/lib/typescript/commonjs/text/phone/confirm.g.d.ts +5 -0
  690. package/lib/typescript/commonjs/text/phone/datePicker.g.d.ts +18 -0
  691. package/lib/typescript/commonjs/text/phone/dateRangePicker.g.d.ts +8 -0
  692. package/lib/typescript/commonjs/text/phone/dateSeparator.g.d.ts +6 -0
  693. package/lib/typescript/commonjs/text/phone/decimalInput.g.d.ts +5 -0
  694. package/lib/typescript/commonjs/text/phone/discardGuard.g.d.ts +8 -0
  695. package/lib/typescript/commonjs/text/phone/drawer.g.d.ts +6 -0
  696. package/lib/typescript/commonjs/text/phone/errorBoundary.g.d.ts +7 -0
  697. package/lib/typescript/commonjs/text/phone/filePicker.g.d.ts +20 -0
  698. package/lib/typescript/commonjs/text/phone/floatingActionButton.g.d.ts +8 -0
  699. package/lib/typescript/commonjs/text/phone/forceUpdateDialog.g.d.ts +9 -0
  700. package/lib/typescript/commonjs/text/phone/formField.g.d.ts +5 -0
  701. package/lib/typescript/commonjs/text/phone/imageGallery.g.d.ts +8 -0
  702. package/lib/typescript/commonjs/text/phone/index.g.d.ts +76 -0
  703. package/lib/typescript/commonjs/text/phone/inlineSelect.g.d.ts +8 -0
  704. package/lib/typescript/commonjs/text/phone/input.g.d.ts +6 -0
  705. package/lib/typescript/commonjs/text/phone/keyboardToolbar.g.d.ts +7 -0
  706. package/lib/typescript/commonjs/text/phone/loaderOverlay.g.d.ts +5 -0
  707. package/lib/typescript/commonjs/text/phone/lockOverlay.g.d.ts +10 -0
  708. package/lib/typescript/commonjs/text/phone/menu.g.d.ts +6 -0
  709. package/lib/typescript/commonjs/text/phone/messageBubble.g.d.ts +14 -0
  710. package/lib/typescript/commonjs/text/phone/messageList.g.d.ts +11 -0
  711. package/lib/typescript/commonjs/text/phone/modal.g.d.ts +5 -0
  712. package/lib/typescript/commonjs/text/phone/networkStatusBanner.g.d.ts +6 -0
  713. package/lib/typescript/commonjs/text/phone/nonModalBottomSheet.g.d.ts +7 -0
  714. package/lib/typescript/commonjs/text/phone/numberInput.g.d.ts +7 -0
  715. package/lib/typescript/commonjs/text/phone/onboardingPager.g.d.ts +9 -0
  716. package/lib/typescript/commonjs/text/phone/optionSheet.g.d.ts +13 -0
  717. package/lib/typescript/commonjs/text/phone/otpInput.g.d.ts +12 -0
  718. package/lib/typescript/commonjs/text/phone/pagedListFooter.g.d.ts +7 -0
  719. package/lib/typescript/commonjs/text/phone/permissionPrompt.g.d.ts +21 -0
  720. package/lib/typescript/commonjs/text/phone/phoneNumberInput.g.d.ts +12 -0
  721. package/lib/typescript/commonjs/text/phone/pickerTrigger.g.d.ts +8 -0
  722. package/lib/typescript/commonjs/text/phone/profileCompletion.g.d.ts +6 -0
  723. package/lib/typescript/commonjs/text/phone/profilePicker.g.d.ts +9 -0
  724. package/lib/typescript/commonjs/text/phone/progressBar.g.d.ts +5 -0
  725. package/lib/typescript/commonjs/text/phone/rating.g.d.ts +5 -0
  726. package/lib/typescript/commonjs/text/phone/refreshControl.g.d.ts +7 -0
  727. package/lib/typescript/commonjs/text/phone/repeater.g.d.ts +7 -0
  728. package/lib/typescript/commonjs/text/phone/richTextEditor.g.d.ts +15 -0
  729. package/lib/typescript/commonjs/text/phone/scannerOverlay.g.d.ts +16 -0
  730. package/lib/typescript/commonjs/text/phone/searchBar.g.d.ts +17 -0
  731. package/lib/typescript/commonjs/text/phone/sectionHeader.g.d.ts +5 -0
  732. package/lib/typescript/commonjs/text/phone/select.g.d.ts +9 -0
  733. package/lib/typescript/commonjs/text/phone/signaturePad.g.d.ts +24 -0
  734. package/lib/typescript/commonjs/text/phone/skeleton.g.d.ts +5 -0
  735. package/lib/typescript/commonjs/text/phone/slideToConfirm.g.d.ts +7 -0
  736. package/lib/typescript/commonjs/text/phone/slider.g.d.ts +5 -0
  737. package/lib/typescript/commonjs/text/phone/sliderField.g.d.ts +11 -0
  738. package/lib/typescript/commonjs/text/phone/sortableList.g.d.ts +6 -0
  739. package/lib/typescript/commonjs/text/phone/sparkline.g.d.ts +6 -0
  740. package/lib/typescript/commonjs/text/phone/spinner.g.d.ts +5 -0
  741. package/lib/typescript/commonjs/text/phone/stepper.g.d.ts +13 -0
  742. package/lib/typescript/commonjs/text/phone/timePicker.g.d.ts +15 -0
  743. package/lib/typescript/commonjs/text/phone/toast.g.d.ts +7 -0
  744. package/lib/typescript/commonjs/text/phone/tooltip.g.d.ts +7 -0
  745. package/lib/typescript/commonjs/text/phone/tour.g.d.ts +9 -0
  746. package/lib/typescript/commonjs/text/phone/typingIndicator.g.d.ts +5 -0
  747. package/lib/typescript/commonjs/text/phone/wheelPicker.g.d.ts +15 -0
  748. package/lib/typescript/commonjs/text/textStore.d.ts +20 -0
  749. package/lib/typescript/commonjs/theme/tokens.generated.d.ts +1 -1
  750. package/lib/typescript/commonjs/theme/types.d.ts +10 -4
  751. package/lib/typescript/module/components/Accordion/Accordion.d.ts +1 -3
  752. package/lib/typescript/module/components/AmountSlider/AmountSlider.d.ts +3 -11
  753. package/lib/typescript/module/components/AmountSlider/index.d.ts +2 -2
  754. package/lib/typescript/module/components/AppBar/AppBar.d.ts +4 -8
  755. package/lib/typescript/module/components/AppBar/index.d.ts +2 -2
  756. package/lib/typescript/module/components/AppLockOverlay/AppLockOverlay.d.ts +2 -10
  757. package/lib/typescript/module/components/AppLockOverlay/index.d.ts +2 -2
  758. package/lib/typescript/module/components/AsyncBlock/AsyncBlock.d.ts +2 -8
  759. package/lib/typescript/module/components/AsyncBlock/index.d.ts +2 -2
  760. package/lib/typescript/module/components/AuthedImage/AuthedImage.d.ts +2 -7
  761. package/lib/typescript/module/components/Autocomplete/Autocomplete.d.ts +3 -7
  762. package/lib/typescript/module/components/Autocomplete/index.d.ts +2 -2
  763. package/lib/typescript/module/components/Avatar/Avatar.d.ts +4 -13
  764. package/lib/typescript/module/components/Avatar/index.d.ts +2 -2
  765. package/lib/typescript/module/components/Badge/Badge.d.ts +2 -6
  766. package/lib/typescript/module/components/Badge/index.d.ts +2 -2
  767. package/lib/typescript/module/components/Banner/Banner.d.ts +4 -9
  768. package/lib/typescript/module/components/Banner/index.d.ts +2 -2
  769. package/lib/typescript/module/components/BarChart/BarChart.d.ts +2 -7
  770. package/lib/typescript/module/components/BarChart/index.d.ts +2 -2
  771. package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +2 -7
  772. package/lib/typescript/module/components/BottomNavigation/index.d.ts +2 -2
  773. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +4 -7
  774. package/lib/typescript/module/components/BottomSheet/index.d.ts +2 -2
  775. package/lib/typescript/module/components/Button/Button.d.ts +4 -8
  776. package/lib/typescript/module/components/Button/index.d.ts +1 -1
  777. package/lib/typescript/module/components/Calendar/Calendar.d.ts +2 -8
  778. package/lib/typescript/module/components/Calendar/index.d.ts +2 -2
  779. package/lib/typescript/module/components/Card/Card.d.ts +4 -12
  780. package/lib/typescript/module/components/Card/index.d.ts +2 -2
  781. package/lib/typescript/module/components/Carousel/Carousel.d.ts +4 -8
  782. package/lib/typescript/module/components/Carousel/index.d.ts +2 -2
  783. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +1 -3
  784. package/lib/typescript/module/components/Chip/Chip.d.ts +3 -8
  785. package/lib/typescript/module/components/Chip/index.d.ts +2 -2
  786. package/lib/typescript/module/components/Composer/Composer.d.ts +2 -6
  787. package/lib/typescript/module/components/Composer/index.d.ts +2 -2
  788. package/lib/typescript/module/components/Confirm/confirm.d.ts +2 -3
  789. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +5 -21
  790. package/lib/typescript/module/components/DatePicker/index.d.ts +2 -2
  791. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +6 -11
  792. package/lib/typescript/module/components/DateRangePicker/index.d.ts +2 -2
  793. package/lib/typescript/module/components/DateSeparator/DateSeparator.d.ts +3 -7
  794. package/lib/typescript/module/components/DateSeparator/index.d.ts +2 -2
  795. package/lib/typescript/module/components/DecimalInput/DecimalInput.d.ts +3 -6
  796. package/lib/typescript/module/components/DecimalInput/index.d.ts +2 -2
  797. package/lib/typescript/module/components/Dialog/Dialog.d.ts +3 -3
  798. package/lib/typescript/module/components/Drawer/Drawer.d.ts +3 -7
  799. package/lib/typescript/module/components/Drawer/index.d.ts +2 -2
  800. package/lib/typescript/module/components/ErrorBoundary/ErrorBoundary.d.ts +2 -7
  801. package/lib/typescript/module/components/ErrorBoundary/index.d.ts +2 -2
  802. package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +5 -3
  803. package/lib/typescript/module/components/FilePicker/FilePicker.d.ts +2 -29
  804. package/lib/typescript/module/components/FilePicker/index.d.ts +2 -2
  805. package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +4 -14
  806. package/lib/typescript/module/components/FloatingActionButton/index.d.ts +2 -2
  807. package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +6 -10
  808. package/lib/typescript/module/components/ForceUpdateDialog/index.d.ts +2 -2
  809. package/lib/typescript/module/components/FormField/FormField.d.ts +5 -7
  810. package/lib/typescript/module/components/FormField/index.d.ts +2 -2
  811. package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +4 -9
  812. package/lib/typescript/module/components/ImageGallery/index.d.ts +2 -2
  813. package/lib/typescript/module/components/InlineSelect/InlineSelect.d.ts +2 -8
  814. package/lib/typescript/module/components/InlineSelect/index.d.ts +2 -2
  815. package/lib/typescript/module/components/Input/Input.d.ts +6 -10
  816. package/lib/typescript/module/components/Input/index.d.ts +2 -2
  817. package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +2 -7
  818. package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +2 -2
  819. package/lib/typescript/module/components/ListItem/ListItem.d.ts +2 -1
  820. package/lib/typescript/module/components/LoaderOverlay/LoaderOverlay.d.ts +2 -6
  821. package/lib/typescript/module/components/LoaderOverlay/index.d.ts +2 -2
  822. package/lib/typescript/module/components/Menu/Menu.d.ts +4 -3
  823. package/lib/typescript/module/components/Menu/MenuSurface.d.ts +3 -2
  824. package/lib/typescript/module/components/Menu/index.d.ts +1 -2
  825. package/lib/typescript/module/components/Menu/menuModel.d.ts +0 -6
  826. package/lib/typescript/module/components/Menu/useContextMenu.d.ts +3 -2
  827. package/lib/typescript/module/components/MessageBubble/MessageBubble.d.ts +2 -13
  828. package/lib/typescript/module/components/MessageBubble/index.d.ts +2 -2
  829. package/lib/typescript/module/components/MessageList/MessageList.d.ts +2 -10
  830. package/lib/typescript/module/components/MessageList/index.d.ts +2 -2
  831. package/lib/typescript/module/components/Modal/Modal.d.ts +4 -6
  832. package/lib/typescript/module/components/Modal/index.d.ts +2 -2
  833. package/lib/typescript/module/components/NonModalBottomSheet/NonModalBottomSheet.d.ts +3 -6
  834. package/lib/typescript/module/components/NonModalBottomSheet/index.d.ts +2 -2
  835. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +4 -10
  836. package/lib/typescript/module/components/NumberInput/index.d.ts +2 -2
  837. package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +2 -5
  838. package/lib/typescript/module/components/OTPInput/OTPResendRow.d.ts +2 -10
  839. package/lib/typescript/module/components/OTPInput/index.d.ts +4 -4
  840. package/lib/typescript/module/components/OnboardingPager/OnboardingPager.d.ts +2 -12
  841. package/lib/typescript/module/components/OnboardingPager/index.d.ts +2 -2
  842. package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +3 -14
  843. package/lib/typescript/module/components/OptionSheet/index.d.ts +2 -2
  844. package/lib/typescript/module/components/PagedListFooter/PagedListFooter.d.ts +2 -7
  845. package/lib/typescript/module/components/PagedListFooter/index.d.ts +2 -2
  846. package/lib/typescript/module/components/PermissionPrompt/PermissionPrompt.d.ts +2 -12
  847. package/lib/typescript/module/components/PermissionPrompt/index.d.ts +2 -2
  848. package/lib/typescript/module/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -14
  849. package/lib/typescript/module/components/PhoneNumberInput/index.d.ts +2 -2
  850. package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +3 -9
  851. package/lib/typescript/module/components/PickerTrigger/index.d.ts +2 -2
  852. package/lib/typescript/module/components/ProfileCompletion/ProfileCompletion.d.ts +2 -6
  853. package/lib/typescript/module/components/ProfileCompletion/index.d.ts +2 -2
  854. package/lib/typescript/module/components/ProfilePicker/ProfilePicker.d.ts +3 -12
  855. package/lib/typescript/module/components/ProfilePicker/index.d.ts +2 -2
  856. package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +3 -8
  857. package/lib/typescript/module/components/ProgressBar/index.d.ts +2 -2
  858. package/lib/typescript/module/components/Radio/Radio.d.ts +1 -3
  859. package/lib/typescript/module/components/Rating/Rating.d.ts +3 -8
  860. package/lib/typescript/module/components/Rating/index.d.ts +2 -2
  861. package/lib/typescript/module/components/Repeater/Repeater.d.ts +2 -7
  862. package/lib/typescript/module/components/Repeater/index.d.ts +1 -1
  863. package/lib/typescript/module/components/RichTextEditor/RichTextEditor.d.ts +2 -3
  864. package/lib/typescript/module/components/RichTextEditor/index.d.ts +2 -2
  865. package/lib/typescript/module/components/ScannerOverlay/ScannerOverlay.d.ts +2 -28
  866. package/lib/typescript/module/components/ScannerOverlay/index.d.ts +2 -2
  867. package/lib/typescript/module/components/Screen/Screen.d.ts +1 -0
  868. package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +3 -16
  869. package/lib/typescript/module/components/SearchBar/SearchPanel.d.ts +3 -3
  870. package/lib/typescript/module/components/SearchBar/index.d.ts +2 -2
  871. package/lib/typescript/module/components/SectionHeader/SectionHeader.d.ts +3 -5
  872. package/lib/typescript/module/components/SectionHeader/index.d.ts +2 -2
  873. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +1 -3
  874. package/lib/typescript/module/components/Select/Select.d.ts +7 -12
  875. package/lib/typescript/module/components/Select/index.d.ts +1 -1
  876. package/lib/typescript/module/components/SignaturePad/SignaturePad.d.ts +2 -35
  877. package/lib/typescript/module/components/SignaturePad/index.d.ts +2 -2
  878. package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +2 -6
  879. package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +3 -2
  880. package/lib/typescript/module/components/Skeleton/SkeletonList.d.ts +3 -2
  881. package/lib/typescript/module/components/Skeleton/index.d.ts +2 -2
  882. package/lib/typescript/module/components/SlideToConfirm/SlideToConfirm.d.ts +2 -7
  883. package/lib/typescript/module/components/SlideToConfirm/index.d.ts +2 -2
  884. package/lib/typescript/module/components/Slider/Slider.d.ts +6 -3
  885. package/lib/typescript/module/components/SliderField/SliderField.d.ts +3 -11
  886. package/lib/typescript/module/components/SliderField/index.d.ts +2 -2
  887. package/lib/typescript/module/components/SortableList/SortableList.d.ts +2 -6
  888. package/lib/typescript/module/components/SortableList/index.d.ts +2 -2
  889. package/lib/typescript/module/components/Sparkline/Sparkline.d.ts +2 -6
  890. package/lib/typescript/module/components/Sparkline/index.d.ts +2 -2
  891. package/lib/typescript/module/components/Spinner/Spinner.d.ts +2 -5
  892. package/lib/typescript/module/components/Spinner/index.d.ts +2 -2
  893. package/lib/typescript/module/components/Stepper/Stepper.d.ts +3 -15
  894. package/lib/typescript/module/components/Stepper/index.d.ts +2 -2
  895. package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +1 -1
  896. package/lib/typescript/module/components/Switch/Switch.d.ts +1 -3
  897. package/lib/typescript/module/components/TagInput/TagInput.d.ts +1 -0
  898. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +6 -19
  899. package/lib/typescript/module/components/TimePicker/index.d.ts +2 -2
  900. package/lib/typescript/module/components/Toast/Toast.d.ts +2 -7
  901. package/lib/typescript/module/components/Toast/ToastProvider.d.ts +3 -2
  902. package/lib/typescript/module/components/Toast/index.d.ts +2 -2
  903. package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +3 -10
  904. package/lib/typescript/module/components/Tooltip/index.d.ts +2 -2
  905. package/lib/typescript/module/components/Tour/Tour.d.ts +2 -9
  906. package/lib/typescript/module/components/Tour/index.d.ts +2 -2
  907. package/lib/typescript/module/components/TypingIndicator/TypingIndicator.d.ts +2 -5
  908. package/lib/typescript/module/components/TypingIndicator/index.d.ts +2 -2
  909. package/lib/typescript/module/components/WheelPicker/WheelPicker.d.ts +2 -15
  910. package/lib/typescript/module/components/WheelPicker/index.d.ts +2 -2
  911. package/lib/typescript/module/components/index.d.ts +129 -129
  912. package/lib/typescript/module/form/HookFormField.d.ts +1 -1
  913. package/lib/typescript/module/hooks/useDragToDismiss.d.ts +2 -0
  914. package/lib/typescript/module/index.d.ts +2 -0
  915. package/lib/typescript/module/navigation/DiscardGuard.d.ts +2 -8
  916. package/lib/typescript/module/navigation/index.d.ts +2 -2
  917. package/lib/typescript/module/text/index.d.ts +8 -0
  918. package/lib/typescript/module/text/phone/amountSlider.g.d.ts +10 -0
  919. package/lib/typescript/module/text/phone/asyncBlock.g.d.ts +8 -0
  920. package/lib/typescript/module/text/phone/authedImage.g.d.ts +7 -0
  921. package/lib/typescript/module/text/phone/autocomplete.g.d.ts +6 -0
  922. package/lib/typescript/module/text/phone/avatar.g.d.ts +13 -0
  923. package/lib/typescript/module/text/phone/badge.g.d.ts +6 -0
  924. package/lib/typescript/module/text/phone/banner.g.d.ts +5 -0
  925. package/lib/typescript/module/text/phone/bar.g.d.ts +5 -0
  926. package/lib/typescript/module/text/phone/barChart.g.d.ts +8 -0
  927. package/lib/typescript/module/text/phone/bottomNavigation.g.d.ts +7 -0
  928. package/lib/typescript/module/text/phone/bottomSheet.g.d.ts +7 -0
  929. package/lib/typescript/module/text/phone/button.g.d.ts +5 -0
  930. package/lib/typescript/module/text/phone/calendar.g.d.ts +12 -0
  931. package/lib/typescript/module/text/phone/card.g.d.ts +8 -0
  932. package/lib/typescript/module/text/phone/carousel.g.d.ts +7 -0
  933. package/lib/typescript/module/text/phone/catalogue.g.d.ts +153 -0
  934. package/lib/typescript/module/text/phone/chip.g.d.ts +5 -0
  935. package/lib/typescript/module/text/phone/composer.g.d.ts +7 -0
  936. package/lib/typescript/module/text/phone/confirm.g.d.ts +5 -0
  937. package/lib/typescript/module/text/phone/datePicker.g.d.ts +18 -0
  938. package/lib/typescript/module/text/phone/dateRangePicker.g.d.ts +8 -0
  939. package/lib/typescript/module/text/phone/dateSeparator.g.d.ts +6 -0
  940. package/lib/typescript/module/text/phone/decimalInput.g.d.ts +5 -0
  941. package/lib/typescript/module/text/phone/discardGuard.g.d.ts +8 -0
  942. package/lib/typescript/module/text/phone/drawer.g.d.ts +6 -0
  943. package/lib/typescript/module/text/phone/errorBoundary.g.d.ts +7 -0
  944. package/lib/typescript/module/text/phone/filePicker.g.d.ts +20 -0
  945. package/lib/typescript/module/text/phone/floatingActionButton.g.d.ts +8 -0
  946. package/lib/typescript/module/text/phone/forceUpdateDialog.g.d.ts +9 -0
  947. package/lib/typescript/module/text/phone/formField.g.d.ts +5 -0
  948. package/lib/typescript/module/text/phone/imageGallery.g.d.ts +8 -0
  949. package/lib/typescript/module/text/phone/index.g.d.ts +76 -0
  950. package/lib/typescript/module/text/phone/inlineSelect.g.d.ts +8 -0
  951. package/lib/typescript/module/text/phone/input.g.d.ts +6 -0
  952. package/lib/typescript/module/text/phone/keyboardToolbar.g.d.ts +7 -0
  953. package/lib/typescript/module/text/phone/loaderOverlay.g.d.ts +5 -0
  954. package/lib/typescript/module/text/phone/lockOverlay.g.d.ts +10 -0
  955. package/lib/typescript/module/text/phone/menu.g.d.ts +6 -0
  956. package/lib/typescript/module/text/phone/messageBubble.g.d.ts +14 -0
  957. package/lib/typescript/module/text/phone/messageList.g.d.ts +11 -0
  958. package/lib/typescript/module/text/phone/modal.g.d.ts +5 -0
  959. package/lib/typescript/module/text/phone/networkStatusBanner.g.d.ts +6 -0
  960. package/lib/typescript/module/text/phone/nonModalBottomSheet.g.d.ts +7 -0
  961. package/lib/typescript/module/text/phone/numberInput.g.d.ts +7 -0
  962. package/lib/typescript/module/text/phone/onboardingPager.g.d.ts +9 -0
  963. package/lib/typescript/module/text/phone/optionSheet.g.d.ts +13 -0
  964. package/lib/typescript/module/text/phone/otpInput.g.d.ts +12 -0
  965. package/lib/typescript/module/text/phone/pagedListFooter.g.d.ts +7 -0
  966. package/lib/typescript/module/text/phone/permissionPrompt.g.d.ts +21 -0
  967. package/lib/typescript/module/text/phone/phoneNumberInput.g.d.ts +12 -0
  968. package/lib/typescript/module/text/phone/pickerTrigger.g.d.ts +8 -0
  969. package/lib/typescript/module/text/phone/profileCompletion.g.d.ts +6 -0
  970. package/lib/typescript/module/text/phone/profilePicker.g.d.ts +9 -0
  971. package/lib/typescript/module/text/phone/progressBar.g.d.ts +5 -0
  972. package/lib/typescript/module/text/phone/rating.g.d.ts +5 -0
  973. package/lib/typescript/module/text/phone/refreshControl.g.d.ts +7 -0
  974. package/lib/typescript/module/text/phone/repeater.g.d.ts +7 -0
  975. package/lib/typescript/module/text/phone/richTextEditor.g.d.ts +15 -0
  976. package/lib/typescript/module/text/phone/scannerOverlay.g.d.ts +16 -0
  977. package/lib/typescript/module/text/phone/searchBar.g.d.ts +17 -0
  978. package/lib/typescript/module/text/phone/sectionHeader.g.d.ts +5 -0
  979. package/lib/typescript/module/text/phone/select.g.d.ts +9 -0
  980. package/lib/typescript/module/text/phone/signaturePad.g.d.ts +24 -0
  981. package/lib/typescript/module/text/phone/skeleton.g.d.ts +5 -0
  982. package/lib/typescript/module/text/phone/slideToConfirm.g.d.ts +7 -0
  983. package/lib/typescript/module/text/phone/slider.g.d.ts +5 -0
  984. package/lib/typescript/module/text/phone/sliderField.g.d.ts +11 -0
  985. package/lib/typescript/module/text/phone/sortableList.g.d.ts +6 -0
  986. package/lib/typescript/module/text/phone/sparkline.g.d.ts +6 -0
  987. package/lib/typescript/module/text/phone/spinner.g.d.ts +5 -0
  988. package/lib/typescript/module/text/phone/stepper.g.d.ts +13 -0
  989. package/lib/typescript/module/text/phone/timePicker.g.d.ts +15 -0
  990. package/lib/typescript/module/text/phone/toast.g.d.ts +7 -0
  991. package/lib/typescript/module/text/phone/tooltip.g.d.ts +7 -0
  992. package/lib/typescript/module/text/phone/tour.g.d.ts +9 -0
  993. package/lib/typescript/module/text/phone/typingIndicator.g.d.ts +5 -0
  994. package/lib/typescript/module/text/phone/wheelPicker.g.d.ts +15 -0
  995. package/lib/typescript/module/text/textStore.d.ts +20 -0
  996. package/lib/typescript/module/theme/tokens.generated.d.ts +1 -1
  997. package/lib/typescript/module/theme/types.d.ts +10 -4
  998. package/package.json +12 -13
@@ -1 +1 @@
1
- "use strict";import React,{forwardRef,useMemo}from"react";import{Animated,Pressable,StyleSheet,Text,useWindowDimensions,View}from"react-native";import Svg,{Path}from"react-native-svg";import{useFlickGuard}from"../../hooks/useFlickGuard.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{fontFor,resolveCheckboxSize,resolveListItemSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{themeStyles}from"../../utils/themeStyles.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Button}from"../Button/index.js";import{IconBadge}from"../IconBadge/index.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{webOnly}from"../Menu/webOnly.js";import{Skeleton}from"../Skeleton/index.js";import{Swipeable}from"../Swipeable/index.js";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const Chevron=({color:e})=>{const t=useTheme();return _jsx(_Fragment,{children:(t.settings.icons.chevronRight??defaultIcons.chevronRight)({size:20,color:e})})},BADGE_SIZE={sm:"sm",md:"md",lg:"lg"},RIGHT_BELOW_FONT_SCALE=1.2,MENU_ROW_MIN_HEIGHT=48,WEB_CHECKABLE_ROLE=webOnly({role:"menuitemcheckbox"}),SelectionBox=({checked:e,disabled:t})=>{const i=useTheme(),s=resolveCheckboxSize(i,"md")["box-size"],l=Math.round(.72*s);return _jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{width:s,height:s,alignItems:"center",justifyContent:"center",borderWidth:i.size.border,borderRadius:i.radius.sm,...smoothCorners,borderColor:e?i.colors.primary:i.colors.border,backgroundColor:e?i.colors.primary:t?i.colors["surface-disabled"]:"transparent"},children:e?_jsx(Svg,{width:l,height:l,viewBox:"0 0 24 24",children:_jsx(Path,{d:"M5 12.5l4.5 4.5L19 7.5",stroke:i.colors["on-primary"],strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})}):null})},isActionList=e=>Array.isArray(e)&&e.length>0&&e.every(e=>null!=e&&"object"==typeof e&&!React.isValidElement(e)&&"label"in e),renderActions=e=>isActionList(e)?e.map(e=>_jsx(Button,{size:"sm",variant:e.variant??"outline",tone:e.tone,leftIcon:e.icon,disabled:e.disabled,testID:e.testID,label:e.label,onPress:e.onPress},e.label)):e,ListItemRoot=React.memo(forwardRef((e,t)=>{const{title:i,loading:s=!1,subtitle:l,description:o,children:n,titleLines:r,subtitleLines:a=1,leading:c,icon:d,iconTone:m="primary",trailing:u,rightPlacement:h="auto",selectable:p=!1,checked:x=!1,onCheckedChange:g,actions:b,onPress:y,onFocus:f,haptic:j,selected:S=!1,expanded:_,disabled:w=!1,size:v="md",variant:I="list",divider:L=!1,chevron:k=!1,leftActions:V,rightActions:C,contextMenu:R,accessibilityLabel:A,accessibilityHint:B,style:z,containerStyle:T,titleStyle:E,subtitleStyle:F,descriptionStyle:P,leftSlotStyle:D,rightSlotStyle:H,testID:M}=e;assertValidValue("ListItem","size",e.size,["sm","md","lg"]),assertValidValue("ListItem","iconTone",e.iconTone,["primary","success","warning","danger","info","neutral"]),assertValidValue("ListItem","rightPlacement",e.rightPlacement,["auto","side","below"]),assertValidValue("ListItem","variant",e.variant,["list","menu"]);const O="menu"===I,W=r??(O?2:1),G=O?e.checked:void 0,N=useTheme(),K=useMemo(()=>resolveListItemSize(N,v),[N,v]),U=stylesFor(N),{fontScale:Z}=useWindowDimensions(),q=!!u&&("below"===h||"auto"===h&&Z>1.2),J=useContextMenu(w?void 0:R,{haptic:j||!1,testID:M}),Q=useMemo(()=>mergeRefs(t,J.hostRef),[t,J.hostRef]),X=p||!!y,Y=X||J.enabled,$=Y&&!w,{style:ee,pressIn:te,pressOut:ie}=usePressAnimation({enabled:$&&!O}),se=useFlickGuard(),le=A??("string"==typeof i?i:void 0),isText=e=>"string"==typeof e||"number"==typeof e,oe=c??(void 0===d?null:_jsx(IconBadge,{icon:d,tone:m,size:BADGE_SIZE[v]})),ne=p?_jsxs(View,{style:U.selectionLead,children:[_jsx(SelectionBox,{checked:x,disabled:w}),oe?_jsx(View,{style:U.selectionLeadContent,children:oe}):null]}):oe,re=null!=b&&!1!==b&&!(Array.isArray(b)&&0===b.length),ae=L&&!re,ce=_jsxs(View,{style:[U.row,{paddingVertical:O?N.space.sm:K["padding-y"],minHeight:O?48:K["min-height"],backgroundColor:S?N.colors["surface-selected"]:"transparent"},ae?U.divider:null,w&&!O?U.disabled:null,T],children:[ne?_jsx(View,{style:[U.leftSlot,D],children:ne}):null,_jsxs(View,{style:U.middle,children:[null==i||isText(i)?_jsx(Text,{style:[U.title,{fontSize:O?N.text.base.size:K["title-text"],...fontFor(N,O?"normal":"medium"),color:w?N.colors["text-disabled"]:N.colors["text-body"]},E],numberOfLines:W,children:i??" "}):i,null==l||""===l?null:isText(l)?_jsx(Text,{style:[U.subtitle,{fontSize:O?N.text.xs.size:K["subtitle-text"],color:w?N.colors["text-disabled"]:N.colors["text-muted"]},O?U.menuSubtitle:null,F],numberOfLines:a,children:l}):l,null==o||""===o?null:isText(o)?_jsx(Text,{style:[U.description,{fontSize:K["subtitle-text"],color:w?N.colors["text-disabled"]:N.colors["text-subtle"]},P],numberOfLines:2,children:o}):o,null!=n&&!1!==n?_jsx(View,{style:U.body,children:n}):null,q?_jsx(View,{style:[U.rightBelow,H],children:u}):null]}),u&&!q||k?_jsxs(View,{style:[U.rightSlot,q?null:H],children:[q?null:u,k?_jsx(View,{style:u&&!q?U.chevronWithRight:null,children:_jsx(Chevron,{color:w?N.colors["text-disabled"]:N.colors["text-subtle"]})}):null]}):null]}),de=Y?_jsx(Pressable,{ref:Q,onPress:e=>{$&&X&&!se.isFlick(e)&&(j&&triggerHaptic(j),p?g?.(!x):y?.(e))},onPressIn:e=>{se.onPressIn(e),te()},onPressOut:ie,disabled:!$,onFocus:f,accessibilityRole:p?"checkbox":O?"menuitem":y?"button":void 0,accessibilityLabel:le,accessibilityHint:B,accessibilityState:p?{checked:x,disabled:!$,expanded:_}:{selected:S,disabled:!$,expanded:_,...void 0!==G?{checked:G}:null},"aria-disabled":!$,"aria-expanded":_,...p?{"aria-checked":x}:void 0!==G?{"aria-checked":G}:{"aria-selected":S},...void 0!==G?WEB_CHECKABLE_ROLE:null,testID:M,android_ripple:{color:N.colors["surface-pressed"],borderless:!1},style:({pressed:e})=>[z,e?U.pressed:null],...J.hostProps,children:_jsx(Animated.View,{style:ee,children:ce})}):_jsx(View,{ref:t,accessibilityRole:"none",accessibilityLabel:le,accessibilityHint:B,accessibilityState:{selected:S,disabled:w},"aria-selected":S,"aria-disabled":w,testID:M,style:z,children:ce}),me=V&&V.length>0||C&&C.length>0,ue=re?_jsxs(View,{style:[S?{backgroundColor:N.colors["surface-selected"]}:null,L?U.divider:null],children:[de,_jsx(View,{style:U.actions,children:renderActions(b)})]}):de,he=me?_jsx(Swipeable,{leftActions:V,rightActions:C,accessibilityLabel:le,children:ue}):ue;return s?_jsx(ListItemSkeleton,{...e}):J.enabled?_jsxs(_Fragment,{children:[he,J.renderSurface(_jsx(View,{style:U.preview,children:ce}))]}):he})),ListItemSkeleton=({subtitle:e,description:t,leading:i,icon:s,trailing:l,chevron:o,size:n="md",variant:r="list",containerStyle:a,style:c})=>{const d=useTheme(),m=resolveListItemSize(d,n),u=Math.round(1.15*m["title-text"]),h=Math.round(1.15*m["subtitle-text"]),p="menu"===r;return _jsxs(View,{style:[{flexDirection:"row",alignItems:"center",paddingHorizontal:d.space.md,paddingVertical:p?d.space.sm:m["padding-y"],minHeight:p?48:m["min-height"]},a,c],children:[void 0!==i||void 0!==s?_jsx(View,{style:{marginRight:d.space.sm},children:_jsx(Skeleton,{shape:"circle",width:40,height:40})}):null,_jsxs(View,{style:{flex:1},children:[_jsx(Skeleton,{shape:"text",width:"70%",height:u,style:{marginBottom:d.space.xs}}),void 0!==e?_jsx(Skeleton,{shape:"text",width:"50%",height:h,style:void 0!==t?{marginBottom:d.space.xs}:void 0}):null,void 0!==t?_jsx(Skeleton,{shape:"text",width:"85%",height:h}):null]}),void 0!==l||o?_jsx(View,{style:{marginLeft:d.space.sm},children:_jsx(Skeleton,{width:20,height:20,radius:"sm"})}):null]})};ListItemSkeleton.displayName="ListItemSkeleton";const ListItem=Object.assign(ListItemRoot,{Skeleton:ListItemSkeleton});ListItem.displayName="ListItem";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.space.md},divider:{borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:e.colors.border},pressed:{backgroundColor:e.colors["surface-pressed"]},disabled:{opacity:.55},leftSlot:{marginRight:e.space.md,alignItems:"center",justifyContent:"center"},middle:{flex:1,flexDirection:"column",justifyContent:"center"},selectionLead:{flexDirection:"row",alignItems:"center"},selectionLeadContent:{marginLeft:e.space.sm},body:{marginTop:e.space.xs},rightBelow:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",marginTop:e.space.xs},rightSlot:{marginLeft:e.space.md,alignItems:"center",justifyContent:"center",flexDirection:"row"},actions:{flexDirection:"row",flexWrap:"wrap",gap:e.space.sm,paddingHorizontal:e.space.md,paddingBottom:e.space.md},chevronWithRight:{marginLeft:e.space.xs},preview:{flex:1,backgroundColor:e.colors.surface,borderRadius:e.radius.md,...smoothCorners,overflow:"hidden"},title:{letterSpacing:e["letter-spacing"].normal},subtitle:{marginTop:e.space.xxs,...fontFor(e,"normal")},menuSubtitle:{marginTop:0},description:{marginTop:e.space.xxs,...fontFor(e,"normal")}}),stylesFor=themeStyles(buildStyles);export{ListItem};export default ListItem;
1
+ "use strict";import React,{forwardRef,useMemo}from"react";import{Animated,Pressable,StyleSheet,Text,useWindowDimensions,View}from"react-native";import Svg,{Path}from"react-native-svg";import{useFlickGuard}from"../../hooks/useFlickGuard.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{fontFor,resolveCheckboxSize,resolveListItemSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{themeStyles}from"../../utils/themeStyles.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Button}from"../Button/index.js";import{IconBadge}from"../IconBadge/index.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{webOnly}from"../Menu/webOnly.js";import{Skeleton}from"../Skeleton/index.js";import{Swipeable}from"../Swipeable/index.js";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const Chevron=({color:e})=>{const t=useTheme();return _jsx(_Fragment,{children:(t.settings.icons.chevronRight??defaultIcons.chevronRight)({size:20,color:e})})},BADGE_SIZE={sm:"sm",md:"md",lg:"lg"},RIGHT_BELOW_FONT_SCALE=1.2,MENU_ROW_MIN_HEIGHT=48,WEB_CHECKABLE_ROLE=webOnly({role:"menuitemcheckbox"}),SelectionBox=({checked:e,disabled:t})=>{const i=useTheme(),s=resolveCheckboxSize(i,"md")["box-size"],l=Math.round(.72*s);return _jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{width:s,height:s,alignItems:"center",justifyContent:"center",borderWidth:i.size.border,borderRadius:i.radius.sm,...smoothCorners,borderColor:e?i.colors.primary:i.colors.border,backgroundColor:e?i.colors.primary:t?i.colors["surface-disabled"]:"transparent"},children:e?_jsx(Svg,{width:l,height:l,viewBox:"0 0 24 24",children:_jsx(Path,{d:"M5 12.5l4.5 4.5L19 7.5",stroke:i.colors["on-primary"],strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})}):null})},isActionList=e=>Array.isArray(e)&&e.length>0&&e.every(e=>null!=e&&"object"==typeof e&&!React.isValidElement(e)&&"label"in e),renderActions=e=>isActionList(e)?e.map(e=>_jsx(Button,{size:"sm",variant:e.variant??"outline",tone:e.tone,leftIcon:e.icon,disabled:e.disabled,testID:e.testID,label:e.label,onPress:e.onPress},e.label)):e,ListItemRoot=React.memo(forwardRef((e,t)=>{const{title:i,loading:s=!1,subtitle:l,description:o,children:n,titleLines:r,subtitleLines:a=1,leading:c,icon:d,iconTone:m="primary",trailing:u,rightPlacement:h="auto",selectable:p=!1,checked:x=!1,onCheckedChange:g,actions:b,onPress:f,onFocus:y,haptic:j,selected:S=!1,expanded:w,disabled:_=!1,size:v="md",variant:I="list",divider:L=!1,chevron:k=!1,leftActions:V,rightActions:C,contextMenu:R,accessibilityLabel:A,accessibilityHint:B,style:z,rowStyle:T,titleStyle:E,subtitleStyle:F,descriptionStyle:P,leftSlotStyle:D,rightSlotStyle:H,testID:M}=e;assertValidValue("ListItem","size",e.size,["sm","md","lg"]),assertValidValue("ListItem","iconTone",e.iconTone,["primary","success","warning","danger","info","neutral"]),assertValidValue("ListItem","rightPlacement",e.rightPlacement,["auto","side","below"]),assertValidValue("ListItem","variant",e.variant,["list","menu"]);const O="menu"===I,W=r??(O?2:1),G=O?e.checked:void 0,N=useTheme(),K=useMemo(()=>resolveListItemSize(N,v),[N,v]),U=stylesFor(N),{fontScale:Z}=useWindowDimensions(),q=!!u&&("below"===h||"auto"===h&&Z>1.2),J=useContextMenu(_?void 0:R,{haptic:j||!1,testID:M}),Q=useMemo(()=>mergeRefs(t,J.hostRef),[t,J.hostRef]),X=p||!!f,Y=X||J.enabled,$=Y&&!_,{style:ee,pressIn:te,pressOut:ie}=usePressAnimation({enabled:$&&!O}),se=useFlickGuard(),le=A??("string"==typeof i?i:void 0),isText=e=>"string"==typeof e||"number"==typeof e,oe=c??(void 0===d?null:_jsx(IconBadge,{icon:d,tone:m,size:BADGE_SIZE[v]})),ne=p?_jsxs(View,{style:U.selectionLead,children:[_jsx(SelectionBox,{checked:x,disabled:_}),oe?_jsx(View,{style:U.selectionLeadContent,children:oe}):null]}):oe,re=null!=b&&!1!==b&&!(Array.isArray(b)&&0===b.length),ae=L&&!re,ce=_jsxs(View,{style:[U.row,{paddingVertical:O?N.space.sm:K["padding-y"],minHeight:O?48:K["min-height"],backgroundColor:S?N.colors["surface-selected"]:"transparent"},ae?U.divider:null,_&&!O?U.disabled:null,T],children:[ne?_jsx(View,{style:[U.leftSlot,D],children:ne}):null,_jsxs(View,{style:U.middle,children:[null==i||isText(i)?_jsx(Text,{style:[U.title,{fontSize:O?N.text.base.size:K["title-text"],...fontFor(N,O?"normal":"medium"),color:_?N.colors["text-disabled"]:N.colors["text-body"]},E],numberOfLines:W,children:i??" "}):i,null==l||""===l?null:isText(l)?_jsx(Text,{style:[U.subtitle,{fontSize:O?N.text.xs.size:K["subtitle-text"],color:_?N.colors["text-disabled"]:N.colors["text-muted"]},O?U.menuSubtitle:null,F],numberOfLines:a,children:l}):l,null==o||""===o?null:isText(o)?_jsx(Text,{style:[U.description,{fontSize:K["subtitle-text"],color:_?N.colors["text-disabled"]:N.colors["text-subtle"]},P],numberOfLines:2,children:o}):o,null!=n&&!1!==n?_jsx(View,{style:U.body,children:n}):null,q?_jsx(View,{style:[U.rightBelow,H],children:u}):null]}),u&&!q||k?_jsxs(View,{style:[U.rightSlot,q?null:H],children:[q?null:u,k?_jsx(View,{style:u&&!q?U.chevronWithRight:null,children:_jsx(Chevron,{color:_?N.colors["text-disabled"]:N.colors["text-subtle"]})}):null]}):null]}),de=Y?_jsx(Pressable,{ref:Q,onPress:e=>{$&&X&&!se.isFlick(e)&&(j&&triggerHaptic(j),p?g?.(!x):f?.(e))},onPressIn:e=>{se.onPressIn(e),te()},onPressOut:ie,disabled:!$,onFocus:y,accessibilityRole:p?"checkbox":O?"menuitem":f?"button":void 0,accessibilityLabel:le,accessibilityHint:B,accessibilityState:p?{checked:x,disabled:!$,expanded:w}:{selected:S,disabled:!$,expanded:w,...void 0!==G?{checked:G}:null},"aria-disabled":!$,"aria-expanded":w,...p?{"aria-checked":x}:void 0!==G?{"aria-checked":G}:{"aria-selected":S},...void 0!==G?WEB_CHECKABLE_ROLE:null,testID:M,android_ripple:{color:N.colors["surface-pressed"],borderless:!1},style:({pressed:e})=>[z,e?U.pressed:null],...J.hostProps,children:_jsx(Animated.View,{style:ee,children:ce})}):_jsx(View,{ref:t,accessibilityRole:"none",accessibilityLabel:le,accessibilityHint:B,accessibilityState:{selected:S,disabled:_},"aria-selected":S,"aria-disabled":_,testID:M,style:z,children:ce}),me=V&&V.length>0||C&&C.length>0,ue=re?_jsxs(View,{style:[S?{backgroundColor:N.colors["surface-selected"]}:null,L?U.divider:null],children:[de,_jsx(View,{style:U.actions,children:renderActions(b)})]}):de,he=me?_jsx(Swipeable,{leftActions:V,rightActions:C,accessibilityLabel:le,children:ue}):ue;return s?_jsx(ListItemSkeleton,{...e}):J.enabled?_jsxs(_Fragment,{children:[he,J.renderSurface(_jsx(View,{style:U.preview,children:ce}))]}):he})),ListItemSkeleton=({subtitle:e,description:t,leading:i,icon:s,trailing:l,chevron:o,size:n="md",variant:r="list",style:a})=>{const c=useTheme(),d=resolveListItemSize(c,n),m=Math.round(1.15*d["title-text"]),u=Math.round(1.15*d["subtitle-text"]),h="menu"===r;return _jsxs(View,{style:[{flexDirection:"row",alignItems:"center",paddingHorizontal:c.space.md,paddingVertical:h?c.space.sm:d["padding-y"],minHeight:h?48:d["min-height"]},a],children:[void 0!==i||void 0!==s?_jsx(View,{style:{marginRight:c.space.sm},children:_jsx(Skeleton,{shape:"circle",width:40,height:40})}):null,_jsxs(View,{style:{flex:1},children:[_jsx(Skeleton,{shape:"text",width:"70%",height:m,style:{marginBottom:c.space.xs}}),void 0!==e?_jsx(Skeleton,{shape:"text",width:"50%",height:u,style:void 0!==t?{marginBottom:c.space.xs}:void 0}):null,void 0!==t?_jsx(Skeleton,{shape:"text",width:"85%",height:u}):null]}),void 0!==l||o?_jsx(View,{style:{marginLeft:c.space.sm},children:_jsx(Skeleton,{width:20,height:20,radius:"sm"})}):null]})};ListItemSkeleton.displayName="ListItemSkeleton";const ListItem=Object.assign(ListItemRoot,{Skeleton:ListItemSkeleton});ListItem.displayName="ListItem";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.space.md},divider:{borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:e.colors.border},pressed:{backgroundColor:e.colors["surface-pressed"]},disabled:{opacity:.55},leftSlot:{marginRight:e.space.md,alignItems:"center",justifyContent:"center"},middle:{flex:1,flexDirection:"column",justifyContent:"center"},selectionLead:{flexDirection:"row",alignItems:"center"},selectionLeadContent:{marginLeft:e.space.sm},body:{marginTop:e.space.xs},rightBelow:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",marginTop:e.space.xs},rightSlot:{marginLeft:e.space.md,alignItems:"center",justifyContent:"center",flexDirection:"row"},actions:{flexDirection:"row",flexWrap:"wrap",gap:e.space.sm,paddingHorizontal:e.space.md,paddingBottom:e.space.md},chevronWithRight:{marginLeft:e.space.xs},preview:{flex:1,backgroundColor:e.colors.surface,borderRadius:e.radius.md,...smoothCorners,overflow:"hidden"},title:{letterSpacing:e["letter-spacing"].normal},subtitle:{marginTop:e.space.xxs,...fontFor(e,"normal")},menuSubtitle:{marginTop:0},description:{marginTop:e.space.xxs,...fontFor(e,"normal")}}),stylesFor=themeStyles(buildStyles);export{ListItem};export default ListItem;
@@ -1 +1 @@
1
- "use strict";import{useEffect,useMemo,useRef,useState,useSyncExternalStore}from"react";import{AccessibilityInfo,Animated,BackHandler,Easing,StyleSheet}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_SHOW_DELAY_MS=150,DEFAULT_MIN_VISIBLE_MS=400;let state={refCount:0,message:void 0};const listeners=new Set,notify=()=>{for(const e of listeners)e()},subscribe=e=>(listeners.add(e),()=>{listeners.delete(e)}),getState=()=>state,show=e=>{state={refCount:state.refCount+1,message:e??state.message},notify()},hide=()=>{if(state.refCount<=0)return;const e=state.refCount-1;state={refCount:e,message:0===e?void 0:state.message},notify()},reset=()=>{0===state.refCount&&void 0===state.message||(state={refCount:0,message:void 0},notify())},isVisible=()=>state.refCount>0,wrap=async(e,t)=>{show(t);try{return await("function"==typeof e?e():e)}finally{hide()}};export const loader={show:show,hide:hide,wrap:wrap,isVisible:isVisible,reset:reset};export const useLoader=()=>loader;export const DEFAULT_LOADER_OVERLAY_LABELS={loading:"Loading"};export const LoaderOverlay=({renderIndicator:e,backdropColor:t,showDelayMs:s=150,minVisibleMs:r=400,labels:n,testID:i})=>{const o=useTheme(),a=usePresenceMotion().duration("default"),u=useSyncExternalStore(subscribe,getState),[l,c]=useState(!1),f=useRef(null),m=useRef(null),d=useRef(null),y=useRef(createAnimatedValue(0)).current,b=u.refCount>0;useEffect(()=>{if(b)return null!==m.current&&(clearTimeout(m.current),m.current=null),void(l||null!==f.current||(f.current=setTimeout(()=>{f.current=null,0!==getState().refCount&&(d.current=Date.now(),c(!0))},s)));if(null!==f.current&&(clearTimeout(f.current),f.current=null),l&&null===m.current){const e=null!==d.current?Date.now()-d.current:r,t=Math.max(0,r-e);m.current=setTimeout(()=>{m.current=null,d.current=null,c(!1)},t)}},[b,l,s,r]),useEffect(()=>()=>{null!==f.current&&clearTimeout(f.current),null!==m.current&&clearTimeout(m.current)},[]),useEffect(()=>{l?Animated.timing(y,{toValue:1,duration:a,easing:Easing.bezier(...o.motion.ease["in-out"]),useNativeDriver:nativeDriver}).start():y.setValue(0)},[l,a,y,o]),useEffect(()=>{if(!l)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>!0);return()=>{e.remove()}},[l]);const S=u.message;useEffect(()=>{l&&S&&AccessibilityInfo.announceForAccessibility(S)},[l,S]);const g=useMemo(()=>buildStyles(),[]),E=useMemo(()=>({...DEFAULT_LOADER_OVERLAY_LABELS,...n}),[n]);return l?_jsx(Animated.View,{pointerEvents:"auto",testID:i,accessible:!0,accessibilityViewIsModal:!0,accessibilityLiveRegion:"polite",accessibilityLabel:S??E.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,style:[g.overlay,{backgroundColor:t??o.colors.scrim,opacity:y}],children:e?e(S):_jsx(Spinner,{size:"lg",message:S})}):null};const buildStyles=()=>StyleSheet.create({overlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center",zIndex:1e3}});
1
+ "use strict";import{useEffect,useMemo,useRef,useState,useSyncExternalStore}from"react";import{AccessibilityInfo,Animated,BackHandler,Easing,StyleSheet}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{LOADER_OVERLAY_TEXT}from"../../text/phone/loaderOverlay.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_SHOW_DELAY_MS=150,DEFAULT_MIN_VISIBLE_MS=400;let state={refCount:0,message:void 0};const listeners=new Set,notify=()=>{for(const e of listeners)e()},subscribe=e=>(listeners.add(e),()=>{listeners.delete(e)}),getState=()=>state,show=e=>{state={refCount:state.refCount+1,message:e??state.message},notify()},hide=()=>{if(state.refCount<=0)return;const e=state.refCount-1;state={refCount:e,message:0===e?void 0:state.message},notify()},reset=()=>{0===state.refCount&&void 0===state.message||(state={refCount:0,message:void 0},notify())},isVisible=()=>state.refCount>0,wrap=async(e,t)=>{show(t);try{return await("function"==typeof e?e():e)}finally{hide()}};export const loader={show:show,hide:hide,wrap:wrap,isVisible:isVisible,reset:reset};export const useLoader=()=>loader;export const LoaderOverlay=({renderIndicator:e,backdropColor:t,showDelayMs:r=150,minVisibleMs:s=400,labels:n,testID:i})=>{const o=useTheme(),a=usePresenceMotion().duration("default"),u=useSyncExternalStore(subscribe,getState),[l,c]=useState(!1),f=useRef(null),m=useRef(null),d=useRef(null),y=useRef(createAnimatedValue(0)).current,b=u.refCount>0;useEffect(()=>{if(b)return null!==m.current&&(clearTimeout(m.current),m.current=null),void(l||null!==f.current||(f.current=setTimeout(()=>{f.current=null,0!==getState().refCount&&(d.current=Date.now(),c(!0))},r)));if(null!==f.current&&(clearTimeout(f.current),f.current=null),l&&null===m.current){const e=null!==d.current?Date.now()-d.current:s,t=Math.max(0,s-e);m.current=setTimeout(()=>{m.current=null,d.current=null,c(!1)},t)}},[b,l,r,s]),useEffect(()=>()=>{null!==f.current&&clearTimeout(f.current),null!==m.current&&clearTimeout(m.current)},[]),useEffect(()=>{l?Animated.timing(y,{toValue:1,duration:a,easing:Easing.bezier(...o.motion.ease["in-out"]),useNativeDriver:nativeDriver}).start():y.setValue(0)},[l,a,y,o]),useEffect(()=>{if(!l)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>!0);return()=>{e.remove()}},[l]);const S=u.message;useEffect(()=>{l&&S&&AccessibilityInfo.announceForAccessibility(S)},[l,S]);const p=useMemo(()=>buildStyles(),[]),g=useMobileUiText("loaderOverlay",LOADER_OVERLAY_TEXT),v=useMemo(()=>({...g,...n}),[g,n]);return l?_jsx(Animated.View,{pointerEvents:"auto",testID:i,accessible:!0,accessibilityViewIsModal:!0,accessibilityLiveRegion:"polite",accessibilityLabel:S??v.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,style:[p.overlay,{backgroundColor:t??o.colors.scrim,opacity:y}],children:e?e(S):_jsx(Spinner,{size:"lg",message:S})}):null};const buildStyles=()=>StyleSheet.create({overlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center",zIndex:1e3}});
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_LOADER_OVERLAY_LABELS,LoaderOverlay,loader,useLoader}from"./LoaderOverlay.js";
1
+ "use strict";export{LoaderOverlay,loader,useLoader}from"./LoaderOverlay.js";
@@ -1 +1 @@
1
- "use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{MenuSurface}from"./MenuSurface.js";import{DEFAULT_MENU_LABELS}from"./menuModel.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const Menu=e=>{const{items:t,trigger:a,title:s,topActions:l,placement:o="bottom",presentation:r="auto",unavailable:n="disable",open:u,onOpenChange:i,haptic:c,accessibilityLabel:m,labels:p,testID:f}=e;assertValidValue("Menu","placement",e.placement,["top","bottom","auto"]),assertValidValue("Menu","presentation",e.presentation,["auto","popover","sheet"]),assertValidValue("Menu","unavailable",e.unavailable,["disable","hide"]);const b=useMemo(()=>({...DEFAULT_MENU_LABELS,...p}),[p]),[d,M]=useControllableState({value:u,defaultValue:!1,onChange:i}),[h,j]=useState(null),[V,x]=useState(d),g=useRef(null),S=useRef(null);useEffect(()=>{d?(x(!0),g.current?.measureInWindow((e,t,a,s)=>{j({x:e,y:t,width:a,height:s})})):j(null)},[d]);const _=useCallback(()=>M(!1),[M]),C=useCallback(()=>S.current??g.current,[]),E=a.props,L=E.ref,R={ref:useMemo(()=>mergeRefs(L,S),[L]),"aria-expanded":d,onPress:e=>{E.onPress?.(e),M(!0)}};return _jsxs(_Fragment,{children:[_jsx(View,{ref:g,collapsable:!1,testID:f,children:React.cloneElement(a,R)}),V?_jsx(MenuSurface,{open:d,anchor:h,items:t,title:s,topActions:l,placement:o,presentation:r,unavailable:n,onClose:_,restoreFocusTo:C,haptic:c,accessibilityLabel:m,labels:b,testID:f}):null]})};export{Menu};export default Menu;
1
+ "use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useMobileUiText}from"../../text/index.js";import{MENU_TEXT}from"../../text/phone/menu.g.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{MenuSurface}from"./MenuSurface.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const Menu=e=>{const{items:t,trigger:a,title:s,topActions:l,placement:o="bottom",presentation:n="auto",unavailable:r="disable",open:u,onOpenChange:i,haptic:m,accessibilityLabel:c,labels:p,testID:f}=e;assertValidValue("Menu","placement",e.placement,["top","bottom","auto"]),assertValidValue("Menu","presentation",e.presentation,["auto","popover","sheet"]),assertValidValue("Menu","unavailable",e.unavailable,["disable","hide"]);const b=useMobileUiText("menu",MENU_TEXT),d=useMemo(()=>({...b,...p}),[b,p]),[x,M]=useControllableState({value:u,defaultValue:!1,onChange:i}),[h,j]=useState(null),[V,g]=useState(x),C=useRef(null),S=useRef(null);useEffect(()=>{x?(g(!0),C.current?.measureInWindow((e,t,a,s)=>{j({x:e,y:t,width:a,height:s})})):j(null)},[x]);const _=useCallback(()=>M(!1),[M]),R=useCallback(()=>S.current??C.current,[]),v=a.props,E=v.ref,T={ref:useMemo(()=>mergeRefs(E,S),[E]),"aria-expanded":x,onPress:e=>{v.onPress?.(e),M(!0)}};return _jsxs(_Fragment,{children:[_jsx(View,{ref:C,collapsable:!1,testID:f,children:React.cloneElement(a,T)}),V?_jsx(MenuSurface,{open:x,anchor:h,items:t,title:s,topActions:l,placement:o,presentation:n,unavailable:r,onClose:_,restoreFocusTo:R,haptic:m,accessibilityLabel:c,labels:d,testID:f}):null]})};export{Menu};export default Menu;
@@ -1 +1 @@
1
- "use strict";export{default,Menu}from"./Menu.js";export{DEFAULT_MENU_LABELS}from"./menuModel.js";
1
+ "use strict";export{default,Menu}from"./Menu.js";
@@ -1 +1 @@
1
- "use strict";import{Logger}from"@webority/mobile-core";export const DEFAULT_MENU_LABELS={close:"Close menu",back:"Back"};export const MAX_GROUPS=3;export const MAX_TOP_ACTIONS=3;export const SHEET_ITEM_THRESHOLD=7;export const ACTION_PREFIX="menu:";const isGrouped=e=>e.length>0&&Array.isArray(e[0]),isShown=(e,o)=>!(e.hidden||"hide"===o&&e.disabled),visibleItem=(e,o)=>{if(!isShown(e,o))return null;if(!e.submenu)return e;const t=e.submenu.filter(e=>isShown(e,o));return t.length>0?{...e,submenu:t}:null};export const visibleGroups=(e,o)=>{const t=isGrouped(e)?e:[e];__DEV__&&t.length>3&&Logger.warn(`[@webority/mobile-ui] Menu ${t.length} groups given; a menu keeps to 3.`);const n=[];for(const e of t){const t=[];for(const n of e){const e=visibleItem(n,o);e&&t.push(e)}t.length>0&&n.push(t)}return n};export const visibleTopActions=(e,o)=>{if(!e)return[];__DEV__&&e.length>3&&Logger.warn("[@webority/mobile-ui] Menu topActions takes at most 3; the rest are not shown.");return e.slice(0,3).filter(e=>isShown(e,o)&&!e.submenu)};export const wantsSheet=(e,o)=>{let t=o.length;for(const o of e)for(const e of o)if(t+=1,e.description)return!0;return t>7};export const menuActions=(e,o)=>{const t=[],add=(e,o)=>{if(e.disabled)return;if(e.submenu){for(const o of e.submenu)add(o,e);return}const n=e.accessibilityLabel??e.label;t.push({name:`menu:${o?`${o.key}/`:""}${e.key}`,label:o?`${o.label}, ${n}`:n,item:e})};for(const e of o)add(e);for(const o of e)for(const e of o)add(e);return t};
1
+ "use strict";import{Logger}from"@webority/mobile-core";export const MAX_GROUPS=3;export const MAX_TOP_ACTIONS=3;export const SHEET_ITEM_THRESHOLD=7;export const ACTION_PREFIX="menu:";const isGrouped=e=>e.length>0&&Array.isArray(e[0]),isShown=(e,o)=>!(e.hidden||"hide"===o&&e.disabled),visibleItem=(e,o)=>{if(!isShown(e,o))return null;if(!e.submenu)return e;const t=e.submenu.filter(e=>isShown(e,o));return t.length>0?{...e,submenu:t}:null};export const visibleGroups=(e,o)=>{const t=isGrouped(e)?e:[e];__DEV__&&t.length>3&&Logger.warn(`[@webority/mobile-ui] Menu ${t.length} groups given; a menu keeps to 3.`);const n=[];for(const e of t){const t=[];for(const n of e){const e=visibleItem(n,o);e&&t.push(e)}t.length>0&&n.push(t)}return n};export const visibleTopActions=(e,o)=>{if(!e)return[];__DEV__&&e.length>3&&Logger.warn("[@webority/mobile-ui] Menu topActions takes at most 3; the rest are not shown.");return e.slice(0,3).filter(e=>isShown(e,o)&&!e.submenu)};export const wantsSheet=(e,o)=>{let t=o.length;for(const o of e)for(const e of o)if(t+=1,e.description)return!0;return t>7};export const menuActions=(e,o)=>{const t=[],add=(e,o)=>{if(e.disabled)return;if(e.submenu){for(const o of e.submenu)add(o,e);return}const n=e.accessibilityLabel??e.label;t.push({name:`menu:${o?`${o.key}/`:""}${e.key}`,label:o?`${o.label}, ${n}`:n,item:e})};for(const e of o)add(e);for(const o of e)for(const e of o)add(e);return t};
@@ -1 +1 @@
1
- "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{MenuSurface}from"./MenuSurface.js";import{DEFAULT_MENU_LABELS,menuActions,visibleGroups,visibleTopActions}from"./menuModel.js";import{webOnly}from"./webOnly.js";import{jsx as _jsx}from"react/jsx-runtime";export const useContextMenu=(e,t={})=>{const s=useRef(null),[n,i]=useState(!1),[o,a]=useState(!1),[l,r]=useState(null);assertValidValue("ContextMenu","unavailable",e?.unavailable,["hide","disable"]),assertValidValue("ContextMenu","presentation",e?.presentation,["auto","popover","sheet"]),assertValidValue("ContextMenu","placement",e?.placement,["top","bottom","auto"]);const c=e?.unavailable??"hide",u=e?.items,p=e?.topActions,m=useMemo(()=>u?visibleGroups(u,c):[],[u,c]),b=useMemo(()=>visibleTopActions(p,c),[p,c]),f=useMemo(()=>menuActions(m,b),[m,b]),v=m.length>0||b.length>0,d=useRef(e);d.current=e;const h=useRef(t);h.current=t;const A=useRef(f);A.current=f;const M=useCallback(e=>{e&&a(!0),i(e),d.current?.onOpenChange?.(e)},[]);useEffect(()=>{!v&&n&&M(!1)},[v,n,M]);const C=useCallback(()=>{s.current?.measureInWindow((e,t,s,n)=>{r({x:e,y:t,width:s,height:n}),M(!0)})},[M]),x=useCallback(()=>{const e=resolveHaptic(h.current.haptic,"longPress");e&&triggerHaptic(e),C()},[C]),g=useCallback(e=>{const t=A.current.find(t=>t.name===e.nativeEvent.actionName);if(!t)return void h.current.onAccessibilityAction?.(e);const s=resolveHaptic(h.current.haptic,"selection");s&&triggerHaptic(s),t.item.onPress?.()},[]),y=t.accessibilityActions,S=useMemo(()=>[...y??[],...f.map(e=>({name:e.name,label:e.label}))],[y,f]),V=useMemo(()=>v?{onLongPress:x,accessibilityActions:S,onAccessibilityAction:g,...webOnly({onContextMenu:e=>{e.preventDefault?.(),C()}})}:{},[v,x,S,g,C]),j=useCallback(()=>M(!1),[M]),E=useCallback(()=>s.current,[]);return{enabled:v,hostRef:s,hostProps:V,renderSurface:s=>e&&v&&o?_jsx(MenuSurface,{open:n,anchor:l,items:e.items,title:e.title,topActions:e.topActions,placement:e.placement??"bottom",presentation:e.presentation??"auto",unavailable:c,context:!0,preview:!1===e.preview?void 0:e.preview??s,onClose:j,restoreFocusTo:E,haptic:t.haptic,accessibilityLabel:e.accessibilityLabel,labels:{...DEFAULT_MENU_LABELS,...e.labels},testID:t.testID?`${t.testID}-context`:void 0}):null}};
1
+ "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{useMobileUiText}from"../../text/index.js";import{MENU_TEXT}from"../../text/phone/menu.g.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{MenuSurface}from"./MenuSurface.js";import{menuActions,visibleGroups,visibleTopActions}from"./menuModel.js";import{webOnly}from"./webOnly.js";import{jsx as _jsx}from"react/jsx-runtime";export const useContextMenu=(e,t={})=>{const s=useMobileUiText("menu",MENU_TEXT),i=useRef(null),[n,o]=useState(!1),[a,r]=useState(!1),[l,c]=useState(null);assertValidValue("ContextMenu","unavailable",e?.unavailable,["hide","disable"]),assertValidValue("ContextMenu","presentation",e?.presentation,["auto","popover","sheet"]),assertValidValue("ContextMenu","placement",e?.placement,["top","bottom","auto"]);const u=e?.unavailable??"hide",p=e?.items,m=e?.topActions,b=useMemo(()=>p?visibleGroups(p,u):[],[p,u]),f=useMemo(()=>visibleTopActions(m,u),[m,u]),v=useMemo(()=>menuActions(b,f),[b,f]),M=b.length>0||f.length>0,d=useRef(e);d.current=e;const h=useRef(t);h.current=t;const x=useRef(v);x.current=v;const C=useCallback(e=>{e&&r(!0),o(e),d.current?.onOpenChange?.(e)},[]);useEffect(()=>{!M&&n&&C(!1)},[M,n,C]);const g=useCallback(()=>{i.current?.measureInWindow((e,t,s,i)=>{c({x:e,y:t,width:s,height:i}),C(!0)})},[C]),A=useCallback(()=>{const e=resolveHaptic(h.current.haptic,"longPress");e&&triggerHaptic(e),g()},[g]),j=useCallback(e=>{const t=x.current.find(t=>t.name===e.nativeEvent.actionName);if(!t)return void h.current.onAccessibilityAction?.(e);const s=resolveHaptic(h.current.haptic,"selection");s&&triggerHaptic(s),t.item.onPress?.()},[]),y=t.accessibilityActions,V=useMemo(()=>[...y??[],...v.map(e=>({name:e.name,label:e.label}))],[y,v]),T=useMemo(()=>M?{onLongPress:A,accessibilityActions:V,onAccessibilityAction:j,...webOnly({onContextMenu:e=>{e.preventDefault?.(),g()}})}:{},[M,A,V,j,g]),w=useCallback(()=>C(!1),[C]),S=useCallback(()=>i.current,[]);return{enabled:M,hostRef:i,hostProps:T,renderSurface:i=>e&&M&&a?_jsx(MenuSurface,{open:n,anchor:l,items:e.items,title:e.title,topActions:e.topActions,placement:e.placement??"bottom",presentation:e.presentation??"auto",unavailable:u,context:!0,preview:!1===e.preview?void 0:e.preview??i,onClose:w,restoreFocusTo:S,haptic:t.haptic,accessibilityLabel:e.accessibilityLabel,labels:{...s,...e.labels},testID:t.testID?`${t.testID}-context`:void 0}):null}};
@@ -1 +1 @@
1
- "use strict";import{markdownToPlainText}from"@webority/markdown-core";import{formatTime}from"@webority/mobile-core";import{useCallback,useEffect,useMemo,useRef}from"react";import{Pressable,StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{Markdown}from"../Markdown/index.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_MESSAGE_BUBBLE_LABELS=Object.freeze({you:"You",sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",retry:"Try again",copy:"Copy",replyTo:e=>e?`Reply to ${e}`:"Reply"});const MAX_WIDTH="85%",STATUS_ICON=14,statusIcon=e=>{switch(e){case"sending":return"clock";case"sent":return"check";case"failed":return"alert-circle";default:return"check-check"}},statusColour=(e,s)=>{switch(s){case"read":return e.colors["info-text"];case"failed":return e.colors["danger-text"];default:return e.colors["text-subtle"]}};export const MessageBubble=({side:e,text:s,children:t,markdown:o,groupPosition:r="single",author:n,time:i,status:a,replyTo:l,streaming:c=!1,error:u,onRetry:d,actions:m,onCopy:b,onLongPress:p,footer:x,labels:y,haptic:f,style:h,testID:g})=>{assertValidValue("MessageBubble","side",e,["mine","theirs"]),assertValidValue("MessageBubble","groupPosition",r,["single","first","middle","last"]),assertValidValue("MessageBubble","status",a,["sending","sent","delivered","read","failed"]);const T=useTheme(),j=useMemo(()=>buildStyles(T),[T]),L=y?{...DEFAULT_MESSAGE_BUBBLE_LABELS,...y}:DEFAULT_MESSAGE_BUBBLE_LABELS,_="mine"===e,B=!u&&(o??"theirs"===e),P="single"===r||"first"===r,S="single"===r||"last"===r,M=null==i?"":formatTime(i),E=("failed"===a||Boolean(u))&&Boolean(d),A=_?L.you:n??"",k=useMemo(()=>{const e=[];return b&&!m?.some(e=>"copy"===e.name)&&e.push({name:"copy",label:L.copy,onPress:()=>b(s)}),m&&e.push(...m),l?.onPress&&e.push({name:"openReply",label:L.replyTo(l.author),onPress:l.onPress}),E&&d&&e.push({name:"retry",label:L.retry,onPress:d}),e},[m,b,s,l,E,d,L]),v=(m?.length??0)>0||Boolean(b),w=useMemo(()=>v?{items:k.map(({name:e,label:s,onPress:t})=>({key:e,label:s,onPress:t}))}:void 0,[v,k]),I=useContextMenu(w,{haptic:f,testID:g}),C=I.hostProps.onLongPress,R=!t||(m?.length??0)>0,V=a&&_?L[a]:"",D=useMemo(()=>B&&null==t?markdownToPlainText(s):s,[B,t,s]),$=[A,M,D,l?`${L.replyTo(l.author)}: ${l.text}`:"",V].filter(Boolean).join(", "),U=useRef(c);useEffect(()=>{U.current&&!c&&!u&&s&&announce(A?`${A}, ${D}`:D),U.current=c},[c,u,s,D,A]);const z=useRef(u);useEffect(()=>{u&&u!==z.current&&announce(u,{polite:!1}),z.current=u},[u]);const H=useCallback(e=>{C?.(e),p?.()},[C,p]),F=useCallback(e=>{k.find(s=>s.name===e.nativeEvent.actionName)?.onPress()},[k]),O=T.radius.xl,G=T.radius.sm,N=_?{borderTopRightRadius:P?O:G,borderBottomRightRadius:S?O:G}:{borderTopLeftRadius:P?O:G,borderBottomLeftRadius:S?O:G},W=t??(B?_jsx(Markdown,{children:s}):_jsx(Text,{variant:"body",children:s})),q=l?_jsxs(Pressable,{onPress:l.onPress,disabled:!l.onPress,accessibilityRole:l.onPress?"button":void 0,accessibilityLabel:`${L.replyTo(l.author)}: ${l.text}`,style:j.quote,children:[l.author?_jsx(Text,{variant:"caption",weight:"semibold",color:"link",numberOfLines:1,children:l.author}):null,_jsx(Text,{variant:"bodySmall",color:"secondary",numberOfLines:2,children:l.text})]}):null,X=[j.bubble,_?j.mine:j.theirs,N],Y=R?{accessible:!0,accessibilityLabel:$,accessibilityState:{busy:c},"aria-busy":c,accessibilityActions:k.map(({name:e,label:s})=>({name:e,label:s})),onAccessibilityAction:F}:{accessible:!1},J=v?_jsxs(Pressable,{ref:I.hostRef,...I.hostProps,onLongPress:H,delayLongPress:350,style:X,testID:g?`${g}-bubble`:void 0,...Y,children:[q,W]}):_jsxs(View,{style:X,testID:g?`${g}-bubble`:void 0,...Y,children:[q,W]}),K=S&&(""!==M||_&&a);return _jsxs(View,{style:[j.root,_?j.rootMine:j.rootTheirs,{marginTop:P?T.space.sm:T.space.xxs},h],accessibilityState:{busy:c},"aria-busy":c,testID:g,children:[!_&&P&&n?_jsx(Text,{variant:"caption",color:"secondary",style:j.author,numberOfLines:1,importantForAccessibility:R?"no-hide-descendants":"auto",accessibilityElementsHidden:R,children:n}):null,J,I.renderSurface(),K?_jsxs(View,{style:[j.meta,_?j.metaMine:null],importantForAccessibility:R?"no-hide-descendants":"auto",accessibilityElementsHidden:R,children:[M?_jsx(Text,{variant:"caption",color:"tertiary",children:M}):null,_&&a?_jsx(AppIcon,{name:statusIcon(a),size:14,color:statusColour(T,a),accessibilityLabel:L[a],testID:g?`${g}-status-${a}`:void 0}):null]}):null,u?_jsx(Text,{variant:"bodySmall",color:"danger",style:_?j.endText:null,children:u}):null,E?_jsx(Button,{label:L.retry,variant:"link",size:"sm",leftIcon:"refresh-cw",onPress:d,testID:g?`${g}-retry`:void 0}):null,x]})};const buildStyles=e=>StyleSheet.create({root:{maxWidth:"85%",gap:e.space.xs},rootMine:{alignSelf:"flex-end",alignItems:"flex-end"},rootTheirs:{alignSelf:"flex-start",alignItems:"flex-start"},author:{paddingHorizontal:e.space.md},bubble:{borderRadius:e.radius.xl,...smoothCorners,paddingHorizontal:e.space.md,paddingVertical:e.space.sm,gap:e.space.xs},mine:{backgroundColor:e.colors["primary-soft"]},theirs:{backgroundColor:e.colors["bg-subtle"]},quote:{borderLeftWidth:3,borderLeftColor:e.colors.primary,paddingLeft:e.space.sm,paddingVertical:e.space.xs},meta:{flexDirection:"row",alignItems:"center",gap:e.space.xs,paddingHorizontal:e.space.xs},metaMine:{justifyContent:"flex-end"},endText:{textAlign:"right"}});export default MessageBubble;
1
+ "use strict";import{markdownToPlainText}from"@webority/markdown-core";import{formatTime}from"@webority/mobile-core";import{useCallback,useEffect,useMemo,useRef}from"react";import{Platform,Pressable,StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{MESSAGE_BUBBLE_TEXT}from"../../text/phone/messageBubble.g.js";import{useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{Markdown}from"../Markdown/index.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const replyLabel=(e,s)=>s?fillText(e.replyTo,{author:s}):e.reply,MAX_WIDTH="85%",STATUS_ICON=14,statusIcon=e=>{switch(e){case"sending":return"clock";case"sent":return"check";case"failed":return"alert-circle";default:return"check-check"}},statusColour=(e,s)=>{switch(s){case"read":return e.colors["info-text"];case"failed":return e.colors["danger-text"];default:return e.colors["text-subtle"]}};export const MessageBubble=({side:e,text:s,children:t,markdown:o,groupPosition:r="single",author:a,time:i,status:n,replyTo:l,streaming:c=!1,error:u,onRetry:d,actions:m,onCopy:b,onLongPress:p,footer:x,labels:f,haptic:h,style:y,testID:g})=>{assertValidValue("MessageBubble","side",e,["mine","theirs"]),assertValidValue("MessageBubble","groupPosition",r,["single","first","middle","last"]),assertValidValue("MessageBubble","status",n,["sending","sent","delivered","read","failed"]);const T=useTheme(),j=useMemo(()=>buildStyles(T),[T]),P=useMobileUiText("messageBubble",MESSAGE_BUBBLE_TEXT),M=useMemo(()=>f?{...P,...f}:P,[P,f]),B="mine"===e,_=!u&&(o??"theirs"===e),L="single"===r||"first"===r,S="single"===r||"last"===r,k=null==i?"":formatTime(i),w=("failed"===n||Boolean(u))&&Boolean(d),I=B?M.you:a??"",v=useMemo(()=>{const e=[];return b&&!m?.some(e=>"copy"===e.name)&&e.push({name:"copy",label:M.copy,onPress:()=>b(s)}),m&&e.push(...m),l?.onPress&&e.push({name:"openReply",label:replyLabel(M,l.author),onPress:l.onPress}),w&&d&&e.push({name:"retry",label:M.retry,onPress:d}),e},[m,b,s,l,w,d,M]),C=(m?.length??0)>0||Boolean(b),V=useMemo(()=>C?{items:v.map(({name:e,label:s,onPress:t})=>({key:e,label:s,onPress:t}))}:void 0,[C,v]),E=useContextMenu(V,{haptic:h,testID:g}),R=E.hostProps.onLongPress,A=!t||(m?.length??0)>0,$=n&&B?M[n]:"",D=useMemo(()=>_&&null==t?markdownToPlainText(s):s,[_,t,s]),H=[I,k,D,l?`${replyLabel(M,l.author)}: ${l.text}`:"",$].filter(Boolean).join(", "),z=useRef(c);useEffect(()=>{z.current&&!c&&!u&&s&&announce(I?`${I}, ${D}`:D),z.current=c},[c,u,s,D,I]);const O=useRef(u);useEffect(()=>{u&&u!==O.current&&announce(u,{polite:!1}),O.current=u},[u]);const U=useCallback(e=>{R?.(e),p?.()},[R,p]),W=useCallback(e=>{v.find(s=>s.name===e.nativeEvent.actionName)?.onPress()},[v]),X=T.radius.xl,q=T.radius.sm,F=B?{borderTopRightRadius:L?X:q,borderBottomRightRadius:S?X:q}:{borderTopLeftRadius:L?X:q,borderBottomLeftRadius:S?X:q},G=t??(_?_jsx(Markdown,{children:s}):_jsx(Text,{variant:"body",children:s})),N=l?_jsxs(Pressable,{onPress:l.onPress,disabled:!l.onPress,accessibilityRole:l.onPress?"button":void 0,accessibilityLabel:`${replyLabel(M,l.author)}: ${l.text}`,style:j.quote,children:[l.author?_jsx(Text,{variant:"caption",weight:"semibold",color:"link",numberOfLines:1,children:l.author}):null,_jsx(Text,{variant:"bodySmall",color:"secondary",numberOfLines:2,children:l.text})]}):null,J=[j.bubble,B?j.mine:j.theirs,F],K=A?{accessible:!0,accessibilityLabel:H,accessibilityState:{busy:c},"aria-busy":c,accessibilityActions:v.map(({name:e,label:s})=>({name:e,label:s})),onAccessibilityAction:W}:{accessible:!1},Q=C?_jsxs(Pressable,{ref:E.hostRef,...E.hostProps,onLongPress:U,delayLongPress:350,style:J,testID:g?`${g}-bubble`:void 0,...K,children:[N,G]}):_jsxs(View,{style:J,testID:g?`${g}-bubble`:void 0,...K,children:[N,G]}),Y=S&&(""!==k||B&&n);return _jsxs(View,{style:[j.root,B?j.rootMine:j.rootTheirs,{marginTop:L?T.space.sm:T.space.xxs},y],accessibilityState:{busy:c},"aria-busy":c,testID:g,children:[!B&&L&&a?_jsx(Text,{variant:"caption",color:"secondary",style:j.author,numberOfLines:1,importantForAccessibility:A?"no-hide-descendants":"auto",accessibilityElementsHidden:A,..."web"===Platform.OS?{"aria-hidden":!0}:null,children:a}):null,Q,E.renderSurface(),Y?_jsxs(View,{style:[j.meta,B?j.metaMine:null],importantForAccessibility:A?"no-hide-descendants":"auto",accessibilityElementsHidden:A,children:[k?_jsx(Text,{variant:"caption",color:"tertiary",children:k}):null,B&&n?_jsx(AppIcon,{name:statusIcon(n),size:14,color:statusColour(T,n),accessibilityLabel:M[n],testID:g?`${g}-status-${n}`:void 0}):null]}):null,u?_jsx(Text,{variant:"bodySmall",color:"danger",style:B?j.endText:null,children:u}):null,w?_jsx(Button,{label:M.retry,variant:"link",size:"sm",leftIcon:"refresh-cw",onPress:d,testID:g?`${g}-retry`:void 0}):null,x]})};const buildStyles=e=>StyleSheet.create({root:{maxWidth:"85%",gap:e.space.xs},rootMine:{alignSelf:"flex-end",alignItems:"flex-end"},rootTheirs:{alignSelf:"flex-start",alignItems:"flex-start"},author:{paddingHorizontal:e.space.md},bubble:{borderRadius:e.radius.xl,...smoothCorners,paddingHorizontal:e.space.md,paddingVertical:e.space.sm,gap:e.space.xs},mine:{backgroundColor:e.colors["primary-soft"]},theirs:{backgroundColor:e.colors["bg-subtle"]},quote:{borderLeftWidth:3,borderLeftColor:e.colors.primary,paddingLeft:e.space.sm,paddingVertical:e.space.xs},meta:{flexDirection:"row",alignItems:"center",gap:e.space.xs,paddingHorizontal:e.space.xs},metaMine:{justifyContent:"flex-end"},endText:{textAlign:"right"}});export default MessageBubble;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_MESSAGE_BUBBLE_LABELS,default,MessageBubble}from"./MessageBubble.js";
1
+ "use strict";export{default,MessageBubble}from"./MessageBubble.js";
@@ -1 +1 @@
1
- "use strict";import{formatDate}from"@webority/mobile-core";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{FlatList,StyleSheet,View}from"react-native";import{KeyboardChatScrollView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{smoothCorners}from"../../utils/corners.js";import{Badge}from"../Badge/index.js";import{DateSeparator,dayLabel}from"../DateSeparator/index.js";import{IconButton}from"../IconButton/index.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_MESSAGE_LIST_LABELS=Object.freeze({today:"Today",yesterday:"Yesterday",jumpToLatest:"Jump to the latest message",newMessages:e=>1===e?"1 new message":`${e} new messages`,unread:"New messages",loadingOlder:"Loading earlier messages"});const JUMP_AT=160,FOLLOW_AT=48,KEEP_POSITION={minIndexForVisible:0,autoscrollToTopThreshold:160},positionOf=(e,t)=>e?t?"middle":"last":t?"first":"single";export function MessageList({messages:e,keyExtractor:t,renderMessage:o,getAuthorKey:s,getDate:n,firstUnreadKey:r,onLoadOlder:a,loadingOlder:i=!1,hasOlder:l=!0,typing:d,empty:u,getAnnouncement:c,followNew:m,keyboardAware:p=!0,keyboardOffset:f,labels:y,now:x,onScroll:g,onContentSizeChange:b,contentContainerStyle:S,style:h,testID:j,...w}){const L=useTheme(),_=useSafeAreaInsets(),v=useReducedMotion(),C=useMemo(()=>buildStyles(L),[L]),E=useMemo(()=>({...DEFAULT_MESSAGE_LIST_LABELS,...y}),[y]),T=f??_.bottom,O=useRef(null),I=useRef(!1),k=useRef(!0),M=useRef(0),[A,D]=useState(!1),[V,P]=useState(0),R=useMemo(()=>{const o=n?e.map(e=>formatDate(n(e))):null,a=s?e.map(s):null,i=void 0===r?-1:e.findIndex(e=>t(e)===r);return e.map((t,s)=>{const r=s===e.length-1,l=null!==o&&(r||o[s]!==o[s+1]),d=null!==a&&!r&&a[s+1]===a[s]&&!l&&s!==i,u=null!==a&&s>0&&a[s-1]===a[s]&&(null===o||o[s-1]===o[s])&&s-1!==i;return{groupPosition:positionOf(d,u),day:l&&n?dayLabel(n(t),{now:x,labels:E}):null,unread:s===i}})},[e,n,s,r,t,x,E]),B=useCallback(()=>{k.current=!0,O.current?.scrollToOffset({offset:0,animated:!v}),P(0)},[v]),F=e[0],z=void 0===F?null:t(F),K=useRef(z);useEffect(()=>{const o=K.current;if(K.current=z,null===o||null===z||o===z)return;const s=e.findIndex(e=>t(e)===o);if(-1===s)return void P(0);const n=e.slice(0,s).reverse();for(const e of n){const t=c?.(e);t&&announce(t)}m&&n.some(m)?B():I.current&&P(e=>e+n.length)},[z,e,t,c,m,B]);const N=useCallback(e=>{k.current=e.nativeEvent.contentOffset.y<=48;const t=e.nativeEvent.contentOffset.y>160;t!==I.current&&(I.current=t,D(t),t||P(0)),g?.(e)},[g]),U=useCallback((e,t)=>{const o=t>M.current;M.current=t,o&&k.current&&O.current?.scrollToOffset({offset:0,animated:!1}),b?.(e,t)},[b]),$=useCallback(()=>{l&&!i&&a?.()},[l,i,a]),G=useCallback(({item:e,index:t})=>{const s=R[t];return _jsxs(View,{children:[s?.day?_jsx(DateSeparator,{label:s.day}):null,s?.unread?_jsx(DateSeparator,{label:E.unread,emphasis:!0}):null,o({item:e,index:t,groupPosition:s?.groupPosition??"single"})]})},[R,E.unread,o]),H=useCallback(e=>t(e),[t]),J=useCallback(e=>_jsx(KeyboardChatScrollView,{...e,inverted:!0,offset:T}),[T]),W=V>0?`${E.newMessages(V)}. ${E.jumpToLatest}`:E.jumpToLatest;return _jsxs(View,{style:[C.root,h],children:[_jsx(FlatList,{keyboardShouldPersistTaps:"handled",maintainVisibleContentPosition:KEEP_POSITION,...w,ref:O,data:e,renderItem:G,keyExtractor:H,inverted:!0,onScroll:N,onContentSizeChange:U,onEndReached:a?$:void 0,ListHeaderComponent:d?_jsx(View,{children:d}):void 0,ListFooterComponent:i?_jsx(Spinner,{size:"sm",accessibilityLabel:E.loadingOlder,style:C.older}):void 0,ListEmptyComponent:u?_jsx(View,{style:C.fill,children:u}):void 0,renderScrollComponent:p?J:void 0,contentContainerStyle:[C.content,0===e.length?C.grow:null,S],testID:j}),A?_jsxs(View,{style:C.jump,pointerEvents:"box-none",children:[_jsx(View,{style:C.jumpDisc,children:_jsx(IconButton,{icon:"arrow-down",accessibilityLabel:W,variant:"ghost",tone:"neutral",onPress:B,testID:j?`${j}-jump`:void 0})}),V>0?_jsx(View,{style:C.count,pointerEvents:"none",importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,children:_jsx(Badge,{value:V,max:99,tone:"primary",size:"sm"})}):null]}):null]})}const buildStyles=e=>StyleSheet.create({root:{flex:1},content:{paddingHorizontal:e.space.md,paddingVertical:e.space.sm},grow:{flexGrow:1},fill:{flex:1},older:{paddingVertical:e.space.md},jump:{position:"absolute",right:e.space.md,bottom:e.space.md},jumpDisc:{borderRadius:e.radius.pill,...smoothCorners,backgroundColor:e.colors.surface,...e.shadow.elevated},count:{position:"absolute",top:-e.space.xs,right:-e.space.xs}});export default MessageList;
1
+ "use strict";import{formatDate}from"@webority/mobile-core";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{FlatList,StyleSheet,View}from"react-native";import{KeyboardChatScrollView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{pluralText,useMobileUiText}from"../../text/index.js";import{MESSAGE_LIST_TEXT}from"../../text/phone/messageList.g.js";import{useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{smoothCorners}from"../../utils/corners.js";import{Badge}from"../Badge/index.js";import{DateSeparator,dayLabel}from"../DateSeparator/index.js";import{IconButton}from"../IconButton/index.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const JUMP_AT=160,FOLLOW_AT=48,KEEP_POSITION={minIndexForVisible:0,autoscrollToTopThreshold:160},positionOf=(e,t)=>e?t?"middle":"last":t?"first":"single";export function MessageList({messages:e,keyExtractor:t,renderMessage:o,getAuthorKey:n,getDate:s,firstUnreadKey:r,onLoadOlder:i,loadingOlder:a=!1,hasOlder:l=!0,typing:u,empty:c,getAnnouncement:d,followNew:m,keyboardAware:p=!0,keyboardOffset:f,labels:x,now:b,onScroll:y,onContentSizeChange:g,contentContainerStyle:h,style:j,testID:S,...v}){const C=useTheme(),T=useSafeAreaInsets(),_=useReducedMotion(),w=useMemo(()=>buildStyles(C),[C]),E=useMobileUiText("messageList",MESSAGE_LIST_TEXT),L=useMemo(()=>({...E,...x}),[E,x]),I=f??T.bottom,O=useRef(null),k=useRef(!1),M=useRef(!0),V=useRef(0),[D,P]=useState(!1),[R,A]=useState(0),B=useMemo(()=>{const o=s?e.map(e=>formatDate(s(e))):null,i=n?e.map(n):null,a=void 0===r?-1:e.findIndex(e=>t(e)===r);return e.map((t,n)=>{const r=n===e.length-1,l=null!==o&&(r||o[n]!==o[n+1]),u=null!==i&&!r&&i[n+1]===i[n]&&!l&&n!==a,c=null!==i&&n>0&&i[n-1]===i[n]&&(null===o||o[n-1]===o[n])&&n-1!==a;return{groupPosition:positionOf(u,c),day:l&&s?dayLabel(s(t),{now:b,labels:L}):null,unread:n===a}})},[e,s,n,r,t,b,L]),F=useCallback(()=>{M.current=!0,O.current?.scrollToOffset({offset:0,animated:!_}),A(0)},[_]),K=e[0],z=void 0===K?null:t(K),U=useRef(z);useEffect(()=>{const o=U.current;if(U.current=z,null===o||null===z||o===z)return;const n=e.findIndex(e=>t(e)===o);if(-1===n)return void A(0);const s=e.slice(0,n).reverse();for(const e of s){const t=d?.(e);t&&announce(t)}m&&s.some(m)?F():k.current&&A(e=>e+s.length)},[z,e,t,d,m,F]);const G=useCallback(e=>{M.current=e.nativeEvent.contentOffset.y<=48;const t=e.nativeEvent.contentOffset.y>160;t!==k.current&&(k.current=t,P(t),t||A(0)),y?.(e)},[y]),H=useCallback((e,t)=>{const o=t>V.current;V.current=t,o&&M.current&&O.current?.scrollToOffset({offset:0,animated:!1}),g?.(e,t)},[g]),N=useCallback(()=>{l&&!a&&i?.()},[l,a,i]),$=useCallback(({item:e,index:t})=>{const n=B[t];return _jsxs(View,{children:[n?.day?_jsx(DateSeparator,{label:n.day}):null,n?.unread?_jsx(DateSeparator,{label:L.unread,emphasis:!0}):null,o({item:e,index:t,groupPosition:n?.groupPosition??"single"})]})},[B,L.unread,o]),X=useCallback(e=>t(e),[t]),J=useCallback(e=>_jsx(KeyboardChatScrollView,{...e,inverted:!0,offset:I}),[I]),W=R>0?`${pluralText(L,"newMessages",R)}. ${L.jumpToLatest}`:L.jumpToLatest;return _jsxs(View,{style:[w.root,j],children:[_jsx(FlatList,{keyboardShouldPersistTaps:"handled",maintainVisibleContentPosition:KEEP_POSITION,...v,ref:O,data:e,renderItem:$,keyExtractor:X,inverted:!0,onScroll:G,onContentSizeChange:H,onEndReached:i?N:void 0,ListHeaderComponent:u?_jsx(View,{children:u}):void 0,ListFooterComponent:a?_jsx(Spinner,{size:"sm",accessibilityLabel:L.loadingOlder,style:w.older}):void 0,ListEmptyComponent:c?_jsx(View,{style:w.fill,children:c}):void 0,renderScrollComponent:p?J:void 0,contentContainerStyle:[w.content,0===e.length?w.grow:null,h],testID:S}),D?_jsxs(View,{style:w.jump,pointerEvents:"box-none",children:[_jsx(View,{style:w.jumpDisc,children:_jsx(IconButton,{icon:"arrow-down",accessibilityLabel:W,variant:"ghost",tone:"neutral",onPress:F,testID:S?`${S}-jump`:void 0})}),R>0?_jsx(View,{style:w.count,pointerEvents:"none",importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,children:_jsx(Badge,{value:R,max:99,tone:"primary",size:"sm"})}):null]}):null]})}const buildStyles=e=>StyleSheet.create({root:{flex:1},content:{paddingHorizontal:e.space.md,paddingVertical:e.space.sm},grow:{flexGrow:1},fill:{flex:1},older:{paddingVertical:e.space.md},jump:{position:"absolute",right:e.space.md,bottom:e.space.md},jumpDisc:{borderRadius:e.radius.pill,...smoothCorners,backgroundColor:e.colors.surface,...e.shadow.elevated},count:{position:"absolute",top:-e.space.xs,right:-e.space.xs}});export default MessageList;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_MESSAGE_LIST_LABELS,default,MessageList}from"./MessageList.js";
1
+ "use strict";export{default,MessageList}from"./MessageList.js";
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,Dimensions,Easing,Keyboard,Platform,Pressable,Modal as RNModal,StyleSheet,useWindowDimensions,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{transparentOf,withAlpha}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{computePlacement,placementMaxHeight,placementRoom}from"../../utils/placement.js";import{squircleHostRadius}from"../../utils/squircle.js";import{ModalSafeArea,useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{ToastHost}from"../Toast/ToastProvider.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_MODAL_LABELS=Object.freeze({close:"Close modal"});const MODAL_PRESENTATIONS=["centered","bottom","fullScreen","anchored"];export const MODAL_DISMISS_GRACE_MS=300;const SCALE_START_VALUE=.9,Modal=forwardRef((e,t)=>{assertValidValue("Modal","presentation",e.presentation,MODAL_PRESENTATIONS);const{open:o,onClose:r,presentation:i="centered",backdropOpacity:s,backdropPressClose:n=!0,animationDuration:a,animateMount:l=!0,accessibilityLabel:c,hardwareBackPress:u=!0,children:d,contentStyle:m,backdropStyle:p,restoreFocusRef:f,onDismissed:h,haptic:g,labels:b,anchor:v,placement:S="auto",align:A="center",testID:y,bare:x=!1,onInsetsChange:M}=e,C=useTheme(),w=useMemo(()=>({...DEFAULT_MODAL_LABELS,...b}),[b]),D=usePresenceMotion(),[R,V]=useModalInsets();useEffect(()=>{M?.(R)},[R,M]);const{width:j,height:E}=useWindowDimensions(),[T,_]=useState({width:0,height:0}),L=a??D.duration("default"),N=Dimensions.get("window").height,H=useRef(!l&&o),I=H.current,P=useRef(createAnimatedValue(I?1:.9)).current,k=useRef(createAnimatedValue(I?1:0)).current,O=useRef(createAnimatedValue(I?0:N)).current,z=useRef(createAnimatedValue(I?1:0)).current,W=useRef(null),q=useRef(!1),[F,B]=useState(o),U=useMemo(()=>buildStyles(C),[C]),K=useMemo(()=>{if("anchored"!==i||void 0===v)return null;const e={width:j,height:E,insets:{top:R.top,bottom:R.bottom,left:0,right:0}},t=computePlacement(v,T,e,S,{align:A});return{...t,maxHeight:placementMaxHeight(t.placement,placementRoom(v,e))}},[i,v,T,S,A,j,E,R.top,R.bottom]),G=useMemo(()=>{const e=C.colors.scrim;return"number"!=typeof s?"anchored"===i?transparentOf(e):e:withAlpha(e,s)??e},[C.colors.scrim,s,i]),Y=useMemo(()=>z.interpolate({inputRange:[0,1],outputRange:[transparentOf(G),G]}),[z,G]);useEffect(()=>{o&&(Keyboard.dismiss(),B(!0))},[o]),useEffect(()=>{const e=[];if(o&&F&&H.current)H.current=!1;else if(o&&F){const t=Animated.timing(z,{toValue:1,duration:D.duration("default"),useNativeDriver:!1});if(t.start(),e.push(t),D.reduced||"anchored"===i){k.setValue(0),O.setValue(0),P.setValue(1);const t=Animated.timing(k,{toValue:1,duration:L,useNativeDriver:nativeDriver});t.start(),e.push(t)}else if("bottom"===i){k.setValue(1);const t=Animated.spring(O,{toValue:0,damping:C.motion.spring.gentle.damping,stiffness:C.motion.spring.gentle.stiffness,mass:C.motion.spring.gentle.mass,useNativeDriver:nativeDriver});t.start(),e.push(t)}else{const t=Animated.parallel([Animated.spring(P,{toValue:1,damping:C.motion.spring.gentle.damping,stiffness:C.motion.spring.gentle.stiffness,mass:C.motion.spring.gentle.mass,useNativeDriver:nativeDriver}),Animated.timing(k,{toValue:1,duration:L,useNativeDriver:nativeDriver})]);t.start(),e.push(t)}}else if(F){const t=D.duration("fast"),o=Easing.bezier(...C.motion.ease.accelerate),r=Animated.timing(k,{toValue:0,duration:t,easing:o,useNativeDriver:nativeDriver}),s=D.reduced||"anchored"===i?r:"bottom"===i?Animated.timing(O,{toValue:N,duration:t,easing:o,useNativeDriver:nativeDriver}):Animated.parallel([Animated.timing(P,{toValue:.9,duration:t,easing:o,useNativeDriver:nativeDriver}),r]),n=Animated.parallel([s,Animated.timing(z,{toValue:0,duration:D.duration("default"),useNativeDriver:!1})]);n.start(({finished:e})=>{e&&(O.setValue(N),B(!1))}),e.push(n)}return()=>e.forEach(e=>{e.stop()})},[o,F,i,L,P,k,z,O,N,C.motion.spring.gentle.damping,C.motion.spring.gentle.stiffness,C.motion.spring.gentle.mass,D,C.motion.ease.accelerate]),useEffect(()=>{if("web"===Platform.OS)return;let e,t;return o?(e=setTimeout(()=>{W.current&&AccessibilityInfo.sendAccessibilityEvent(W.current,"focus")},150),q.current=!0):q.current&&(q.current=!1,f?.current&&(t=setTimeout(()=>{const e=f.current;e&&AccessibilityInfo.sendAccessibilityEvent(e,"focus")},L))),()=>{e&&clearTimeout(e),t&&clearTimeout(t)}},[o,L,f]);const J=useRef(h);J.current=h;const Q=useRef(!1);useEffect(()=>{if(o)return void(Q.current=!0);if(!Q.current)return;Q.current=!1;const e=setTimeout(()=>J.current?.(),300);return()=>clearTimeout(e)},[o]);const X=useCallback(()=>{if(!n)return;const e=resolveHaptic(g,"selection");e&&triggerHaptic(e),r()},[n,r,g]),Z=useCallback(()=>{u&&r()},[u,r]),$=useSquircle(!x&&"bottom"!==i&&"fullScreen"!==i&&"anchored"!==i,C.radius.xl),ee=useCallback(e=>{$.onLayout(e);const{width:t,height:o}=e.nativeEvent.layout;_(e=>e.width===t&&e.height===o?e:{width:t,height:o})},[$.onLayout]),te=useMemo(()=>x?"bottom"===i?U.bottomContent:"fullScreen"===i?U.fullScreenContent:U.bareCentredContent:"anchored"===i?[U.anchoredContent,{left:K?.x,top:K?.y,maxHeight:K?.maxHeight,backgroundColor:C.colors.surface,borderRadius:C.radius.lg,...smoothCorners},C.shadow.modal]:"fullScreen"===i?[U.fullScreenContent,{backgroundColor:C.colors.surface}]:"bottom"===i?[U.bottomContent,{backgroundColor:C.colors.surface,borderTopLeftRadius:C.radius.xl,borderTopRightRadius:C.radius.xl,...smoothCorners,paddingTop:C.space.lg,paddingHorizontal:C.space.lg,paddingBottom:C.space.lg+R.bottom},C.shadow.modal]:[U.centeredContent,{backgroundColor:C.colors.surface,borderRadius:$.active&&$.size?squircleHostRadius($.size.width,$.size.height,C.radius.xl):C.radius.xl,...smoothCorners,padding:C.space.xl},C.shadow.modal],[i,C,U,R.bottom,$.active,$.size,K,x]),oe=useMemo(()=>"anchored"===i?U.anchoredWrapper:"bottom"===i?U.bottomWrapper:"fullScreen"===i?U.fullScreenWrapper:U.centeredWrapper,[i,U]),re=useMemo(()=>"bottom"===i?{opacity:k,transform:[{translateY:O}]}:"fullScreen"===i||"anchored"===i?{opacity:k}:{opacity:k,transform:[{scale:P}]},[i,P,k,O]);if("anchored"===i&&void 0===v)throw new Error('[@webority/mobile-ui] Modal: presentation "anchored" needs an anchor.');if(x&&"anchored"===i)throw new Error('[@webority/mobile-ui] Modal: presentation "anchored" bare does not combine with presentation anchored.');return _jsx(RNModal,{visible:F,transparent:!0,statusBarTranslucent:!0,navigationBarTranslucent:!0,animationType:"none",onRequestClose:Z,testID:y,children:_jsx(View,{ref:e=>{W.current=e,"function"==typeof t?t(e):t&&(t.current=e)},style:U.root,accessible:!1,accessibilityViewIsModal:!0,accessibilityRole:"alert",accessibilityLabel:c,children:_jsxs(ModalSafeArea,{onInsets:V,children:[_jsxs(Animated.View,{collapsable:!1,style:[StyleSheet.absoluteFill,oe,{backgroundColor:Y},p],children:[_jsx(Pressable,{style:StyleSheet.absoluteFill,onPress:X,accessibilityRole:n?"button":void 0,accessibilityLabel:n?w.close:void 0,accessible:!!n&&void 0,importantForAccessibility:n?void 0:"no",disabled:!n}),_jsxs(Animated.View,{style:[te,re,T.height>0||"anchored"!==i?null:U.unmeasured,m],onLayout:ee,pointerEvents:x&&"fullScreen"===i?"box-none":"auto",needsOffscreenAlphaCompositing:!0,children:[$.active&&$.size?_jsx(SquircleFill,{width:$.size.width,height:$.size.height,radius:C.radius.xl,fill:C.colors.surface}):null,d]})]}),_jsx(ToastHost,{})]})})})});Modal.displayName="Modal";const buildStyles=e=>StyleSheet.create({root:{flex:1},centeredWrapper:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:e.space.lg},centeredContent:{maxWidth:"90%",width:"90%"},bottomWrapper:{flex:1,justifyContent:"flex-end"},bottomContent:{width:"100%"},fullScreenWrapper:{flex:1},fullScreenContent:{flex:1},anchoredWrapper:{flex:1},anchoredContent:{position:"absolute"},unmeasured:{opacity:0},bareCentredContent:{alignSelf:"center"}});export{Modal};export default Modal;
1
+ "use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,Dimensions,Easing,Keyboard,Platform,Pressable,Modal as RNModal,StyleSheet,useWindowDimensions,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{MODAL_TEXT}from"../../text/phone/modal.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{transparentOf,withAlpha}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{computePlacement,placementMaxHeight,placementRoom}from"../../utils/placement.js";import{squircleHostRadius}from"../../utils/squircle.js";import{ModalSafeArea,useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{ToastHost}from"../Toast/ToastProvider.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const MODAL_PRESENTATIONS=["centered","bottom","fullScreen","anchored"];export const MODAL_DISMISS_GRACE_MS=300;const SCALE_START_VALUE=.9,Modal=forwardRef((e,t)=>{assertValidValue("Modal","presentation",e.presentation,MODAL_PRESENTATIONS);const{open:o,onClose:r,presentation:i="centered",backdropOpacity:s,backdropPressClose:n=!0,animationDuration:a,animateMount:l=!0,accessibilityLabel:c,hardwareBackPress:u=!0,children:d,contentStyle:m,backdropStyle:p,restoreFocusRef:f,onDismissed:h,haptic:g,labels:b,anchor:v,placement:S="auto",align:x="center",testID:y,bare:A=!1,onInsetsChange:M}=e,w=useTheme(),C=useMobileUiText("modal",MODAL_TEXT),D=useMemo(()=>({...C,...b}),[C,b]),R=usePresenceMotion(),[V,T]=useModalInsets();useEffect(()=>{M?.(V)},[V,M]);const{width:j,height:E}=useWindowDimensions(),[_,I]=useState({width:0,height:0}),N=a??R.duration("default"),k=Dimensions.get("window").height,H=useRef(!l&&o),P=H.current,L=useRef(createAnimatedValue(P?1:.9)).current,O=useRef(createAnimatedValue(P?1:0)).current,W=useRef(createAnimatedValue(P?0:k)).current,q=useRef(createAnimatedValue(P?1:0)).current,z=useRef(null),F=useRef(!1),[B,U]=useState(o),K=useMemo(()=>buildStyles(w),[w]),X=useMemo(()=>{if("anchored"!==i||void 0===v)return null;const e={width:j,height:E,insets:{top:V.top,bottom:V.bottom,left:0,right:0}},t=computePlacement(v,_,e,S,{align:x});return{...t,maxHeight:placementMaxHeight(t.placement,placementRoom(v,e))}},[i,v,_,S,x,j,E,V.top,V.bottom]),G=useMemo(()=>{const e=w.colors.scrim;return"number"!=typeof s?"anchored"===i?transparentOf(e):e:withAlpha(e,s)??e},[w.colors.scrim,s,i]),Y=useMemo(()=>q.interpolate({inputRange:[0,1],outputRange:[transparentOf(G),G]}),[q,G]);useEffect(()=>{o&&(Keyboard.dismiss(),U(!0))},[o]),useEffect(()=>{const e=[];if(o&&B&&H.current)H.current=!1;else if(o&&B){const t=Animated.timing(q,{toValue:1,duration:R.duration("default"),useNativeDriver:!1});if(t.start(),e.push(t),R.reduced||"anchored"===i){O.setValue(0),W.setValue(0),L.setValue(1);const t=Animated.timing(O,{toValue:1,duration:N,useNativeDriver:nativeDriver});t.start(),e.push(t)}else if("bottom"===i){O.setValue(1);const t=Animated.spring(W,{toValue:0,damping:w.motion.spring.gentle.damping,stiffness:w.motion.spring.gentle.stiffness,mass:w.motion.spring.gentle.mass,useNativeDriver:nativeDriver});t.start(),e.push(t)}else{const t=Animated.parallel([Animated.spring(L,{toValue:1,damping:w.motion.spring.gentle.damping,stiffness:w.motion.spring.gentle.stiffness,mass:w.motion.spring.gentle.mass,useNativeDriver:nativeDriver}),Animated.timing(O,{toValue:1,duration:N,useNativeDriver:nativeDriver})]);t.start(),e.push(t)}}else if(B){const t=R.duration("fast"),o=Easing.bezier(...w.motion.ease.accelerate),r=Animated.timing(O,{toValue:0,duration:t,easing:o,useNativeDriver:nativeDriver}),s=R.reduced||"anchored"===i?r:"bottom"===i?Animated.timing(W,{toValue:k,duration:t,easing:o,useNativeDriver:nativeDriver}):Animated.parallel([Animated.timing(L,{toValue:.9,duration:t,easing:o,useNativeDriver:nativeDriver}),r]),n=Animated.parallel([s,Animated.timing(q,{toValue:0,duration:R.duration("default"),useNativeDriver:!1})]);n.start(({finished:e})=>{e&&(W.setValue(k),U(!1))}),e.push(n)}return()=>e.forEach(e=>{e.stop()})},[o,B,i,N,L,O,q,W,k,w.motion.spring.gentle.damping,w.motion.spring.gentle.stiffness,w.motion.spring.gentle.mass,R,w.motion.ease.accelerate]),useEffect(()=>{if("web"===Platform.OS)return;let e,t;return o?(e=setTimeout(()=>{z.current&&AccessibilityInfo.sendAccessibilityEvent(z.current,"focus")},150),F.current=!0):F.current&&(F.current=!1,f?.current&&(t=setTimeout(()=>{const e=f.current;e&&AccessibilityInfo.sendAccessibilityEvent(e,"focus")},N))),()=>{e&&clearTimeout(e),t&&clearTimeout(t)}},[o,N,f]);const $=useRef(h);$.current=h;const J=useRef(!1);useEffect(()=>{if(o)return void(J.current=!0);if(!J.current)return;J.current=!1;const e=setTimeout(()=>$.current?.(),300);return()=>clearTimeout(e)},[o]);const Q=useCallback(()=>{if(!n)return;const e=resolveHaptic(g,"selection");e&&triggerHaptic(e),r()},[n,r,g]),Z=useCallback(()=>{u&&r()},[u,r]),ee=useSquircle(!A&&"bottom"!==i&&"fullScreen"!==i&&"anchored"!==i,w.radius.xl),te=useCallback(e=>{ee.onLayout(e);const{width:t,height:o}=e.nativeEvent.layout;I(e=>e.width===t&&e.height===o?e:{width:t,height:o})},[ee.onLayout]),oe=useMemo(()=>A?"bottom"===i?K.bottomContent:"fullScreen"===i?K.fullScreenContent:K.bareCentredContent:"anchored"===i?[K.anchoredContent,{left:X?.x,top:X?.y,maxHeight:X?.maxHeight,backgroundColor:w.colors.surface,borderRadius:w.radius.lg,...smoothCorners},w.shadow.modal]:"fullScreen"===i?[K.fullScreenContent,{backgroundColor:w.colors.surface}]:"bottom"===i?[K.bottomContent,{backgroundColor:w.colors.surface,borderTopLeftRadius:w.radius.xl,borderTopRightRadius:w.radius.xl,...smoothCorners,paddingTop:w.space.lg,paddingHorizontal:w.space.lg,paddingBottom:w.space.lg+V.bottom},w.shadow.modal]:[K.centeredContent,{backgroundColor:w.colors.surface,borderRadius:ee.active&&ee.size?squircleHostRadius(ee.size.width,ee.size.height,w.radius.xl):w.radius.xl,...smoothCorners,padding:w.space.xl},w.shadow.modal],[i,w,K,V.bottom,ee.active,ee.size,X,A]),re=useMemo(()=>"anchored"===i?K.anchoredWrapper:"bottom"===i?K.bottomWrapper:"fullScreen"===i?K.fullScreenWrapper:K.centeredWrapper,[i,K]),ie=useMemo(()=>"bottom"===i?{opacity:O,transform:[{translateY:W}]}:"fullScreen"===i||"anchored"===i?{opacity:O}:{opacity:O,transform:[{scale:L}]},[i,L,O,W]);if("anchored"===i&&void 0===v)throw new Error('[@webority/mobile-ui] Modal: presentation "anchored" needs an anchor.');if(A&&"anchored"===i)throw new Error('[@webority/mobile-ui] Modal: presentation "anchored" bare does not combine with presentation anchored.');return _jsx(RNModal,{visible:B,transparent:!0,statusBarTranslucent:!0,navigationBarTranslucent:!0,animationType:"none",onRequestClose:Z,testID:y,children:_jsx(View,{ref:e=>{z.current=e,"function"==typeof t?t(e):t&&(t.current=e)},style:K.root,accessible:!1,accessibilityViewIsModal:!0,accessibilityRole:"alert",accessibilityLabel:c,children:_jsxs(ModalSafeArea,{onInsets:T,children:[_jsxs(Animated.View,{collapsable:!1,style:[StyleSheet.absoluteFill,re,{backgroundColor:Y},p],children:[_jsx(Pressable,{style:StyleSheet.absoluteFill,onPress:Q,accessibilityRole:n?"button":void 0,accessibilityLabel:n?D.close:void 0,accessible:!!n&&void 0,importantForAccessibility:n?void 0:"no",disabled:!n,testID:y?`${y}-backdrop`:void 0}),_jsxs(Animated.View,{style:[oe,ie,_.height>0||"anchored"!==i?null:K.unmeasured,m],onLayout:te,pointerEvents:A&&"fullScreen"===i?"box-none":"auto",needsOffscreenAlphaCompositing:!0,children:[ee.active&&ee.size?_jsx(SquircleFill,{width:ee.size.width,height:ee.size.height,radius:w.radius.xl,fill:w.colors.surface}):null,d]})]}),_jsx(ToastHost,{})]})})})});Modal.displayName="Modal";const buildStyles=e=>StyleSheet.create({root:{flex:1},centeredWrapper:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:e.space.lg},centeredContent:{maxWidth:"90%",width:"90%"},bottomWrapper:{flex:1,justifyContent:"flex-end"},bottomContent:{width:"100%"},fullScreenWrapper:{flex:1},fullScreenContent:{flex:1},anchoredWrapper:{flex:1},anchoredContent:{position:"absolute"},unmeasured:{opacity:0},bareCentredContent:{alignSelf:"center"}});export{Modal};export default Modal;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_MODAL_LABELS,default,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal.js";
1
+ "use strict";export{default,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal.js";
@@ -1 +1 @@
1
- "use strict";import{useCallback,useEffect,useEffectEvent,useMemo,useRef,useState}from"react";import{Dimensions,ScrollView,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_NON_MODAL_BOTTOM_SHEET_LABELS=Object.freeze({dragHandle:"Drag handle"});const ERROR_PREFIX="[@webority/mobile-ui] NonModalBottomSheet: ",SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,OVERSHOOT_TO_CLOSE=80,PERCENT_PATTERN=/^(\d+(?:\.\d+)?|\.\d+)%$/,parsePercent=e=>{if("string"!=typeof e)return;const t=PERCENT_PATTERN.exec(e);if(!t)return;const n=Number(t[1]);return n>0&&n<=100?n:void 0},isValidSnapPoint=e=>"number"==typeof e?Number.isFinite(e)&&e>0:void 0!==parsePercent(e),validateProps=(e,t)=>{if(0===e.length)throw new Error(`${ERROR_PREFIX}snapPoints needs at least one snap point.`);for(const t of e)if(!isValidSnapPoint(t))throw new Error(`${ERROR_PREFIX}snap point ${String(t)} is not a positive number or a percentage up to 100%.`);if(null!=t&&(!Number.isInteger(t)||t<0||t>=e.length))throw new Error(`${ERROR_PREFIX}snapIndex ${t} is outside the snap points.`)},resolveNonModalSnapPoints=(e,t)=>e.map(e=>"number"==typeof e?e:parseFloat(e)/100*t).sort((e,t)=>e-t),topAt=(e,t,n)=>{const o=e[n];if(void 0===o)throw new Error(`${ERROR_PREFIX}snap index ${n} has no snap point.`);return Math.max(0,t-o)},NonModalBottomSheet=e=>{const{open:t,onClose:n,snapPoints:o,snapIndex:s,onSnapChange:r,enablePanDownToClose:a=!0,scrollable:i=!1,title:l,header:c,footer:u,labels:d,handleIndicatorStyle:h,containerStyle:m,children:p,accessibilityLabel:f,testID:E}=e;validateProps(o,s);const S=useMemo(()=>({...DEFAULT_NON_MODAL_BOTTOM_SHEET_LABELS,...d}),[d]),v=useTheme(),b=usePresenceMotion(),R=b.reduced,g=useMemo(()=>buildStyles(v),[v]),[_,w]=useState(()=>Dimensions.get("window").height),x=useCallback(e=>{const t=e.nativeEvent.layout.height;t>0&&w(t)},[]),N=useMemo(()=>resolveNonModalSnapPoints(o,_),[o,_]),y=N[N.length-1]??0,O=_,T=Math.max(0,_-y),C=useCallback(e=>topAt(N,_,e),[N,_]),[M,P]=useState(!1),[I,A]=useState(-1),j=useRef(-1),D=useRef(n);D.current=n;const V=useRef(r);V.current=r;const k=useSharedValue(O),L=useSharedValue(O),F=useCallback(()=>{j.current<0&&P(!1)},[]),$=useCallback(()=>{if(j.current=-1,A(-1),R)return k.value=O,void F();k.value=withTiming(O,{duration:b.duration("fast"),easing:Easing.bezier(...v.motion.ease.accelerate),reduceMotion:PRESENCE_REDUCE_MOTION},e=>{"worklet";e&&scheduleOnRN(F)})},[O,b,R,v.motion.ease.accelerate,k,F]),B=useCallback(e=>{const t=C(e);k.value=R?t:withSpring(t,SPRING_CONFIG)},[R,C,k]),G=useCallback((e,t)=>{e!==j.current&&(j.current=e,A(e),B(e),t&&V.current?.(e))},[B]),H=useEffectEvent(e=>{if(!e)return void(j.current>=0&&$());const t=s??0;P(!0);const n=C(t);R?k.value=n:(k.value=O,k.value=withSpring(n,SPRING_CONFIG)),j.current=t,A(t)});useEffect(()=>{H(t)},[t]);const U=useEffectEvent(e=>{t&&M&&e!==j.current&&G(e,!1)});useEffect(()=>{null!=s&&U(s)},[s]);const X=useEffectEvent(e=>{const t=j.current;t>=0&&(k.value=topAt(N,e,t))});useEffect(()=>{X(_)},[_]);const Y=useCallback(e=>{if(e<0)return triggerHaptic("selection"),$(),void D.current();e!==j.current?G(e,!0):B(e)},[G,B,$]),z=useCallback(e=>{const t=j.current;t<0||G(Math.min(Math.max(t+e,0),N.length-1),!0)},[G,N.length]),q=useMemo(()=>N.map(e=>_-e),[N,_]),J=useMemo(()=>{const e=q,t=T,n=a;return{testID:E?`${E}-pan-gesture`:"non-modal-bottom-sheet-pan-gesture",activeOffsetY:[-10,10],onActivate:()=>{"worklet";L.value=k.value},onUpdate:e=>{"worklet";const n=L.value+e.translationY;k.value=n<t?t+.25*(n-t):n},onDeactivate:t=>{"worklet";const o=k.value,s=e[0];if(void 0===s)return;if(t.velocityY>1e3)return void scheduleOnRN(Y,n?-1:0);if(n&&o-s>80)return void scheduleOnRN(Y,-1);let r=0,a=1/0,i=0;for(const t of e){const e=Math.abs(o-t);e<a&&(a=e,r=i),i++}scheduleOnRN(Y,r)}}},[L,a,Y,T,q,E,k]),K=usePanGesture(J),Q=useAnimatedStyle(()=>({top:Math.max(k.value,T)}),[T]),W=useAnimatedStyle(()=>{const e=Math.max(k.value,T),t=_-e;return{height:Math.max(0,Math.min(t,y))}},[_,y,T]);return M?_jsx(View,{collapsable:!1,style:StyleSheet.absoluteFill,pointerEvents:"box-none",onLayout:x,testID:E,children:_jsx(Animated.View,{accessibilityLabel:f,testID:E?`${E}-sheet`:void 0,style:[g.sheet,{height:y,backgroundColor:v.colors.surface,borderTopLeftRadius:v.radius.xl,borderTopRightRadius:v.radius.xl,...smoothCorners,...v.shadow.modal},m,Q],children:_jsxs(Animated.View,{style:[g.body,W],children:[_jsx(GestureDetector,{gesture:K,children:_jsx(View,{style:g.handleRow,accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:S.dragHandle,accessibilityHint:"Swipe up or down to change the height of the sheet",accessibilityValue:{text:`Snap point ${I+1} of ${N.length}`},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:e=>{"increment"===e.nativeEvent.actionName?z(1):"decrement"===e.nativeEvent.actionName&&z(-1)},testID:E?`${E}-handle`:void 0,children:_jsx(View,{style:[g.handle,{backgroundColor:v.colors.border},h]})})}),null!=l?_jsx(Text,{variant:"title",accessibilityRole:"header",children:l}):null,c,i?_jsx(ScrollView,{style:g.scrollContent,children:p}):_jsx(View,{style:g.content,children:p}),u]})})}):null};NonModalBottomSheet.displayName="NonModalBottomSheet";const buildStyles=e=>StyleSheet.create({sheet:{position:"absolute",left:0,right:0,overflow:"hidden"},body:{overflow:"hidden"},handleRow:{alignItems:"center",justifyContent:"center",alignSelf:"stretch",paddingTop:e.space.md,paddingBottom:e.space.xl},handle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},content:{flex:1,overflow:"hidden"},scrollContent:{flex:1}});export{NonModalBottomSheet};export default NonModalBottomSheet;
1
+ "use strict";import{useCallback,useEffect,useEffectEvent,useMemo,useRef,useState}from"react";import{Dimensions,ScrollView,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{fillText,useMobileUiText}from"../../text/index.js";import{NON_MODAL_BOTTOM_SHEET_TEXT}from"../../text/phone/nonModalBottomSheet.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ERROR_PREFIX="[@webority/mobile-ui] NonModalBottomSheet: ",SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,OVERSHOOT_TO_CLOSE=80,PERCENT_PATTERN=/^(\d+(?:\.\d+)?|\.\d+)%$/,parsePercent=e=>{if("string"!=typeof e)return;const t=PERCENT_PATTERN.exec(e);if(!t)return;const o=Number(t[1]);return o>0&&o<=100?o:void 0},isValidSnapPoint=e=>"number"==typeof e?Number.isFinite(e)&&e>0:void 0!==parsePercent(e),validateProps=(e,t)=>{if(0===e.length)throw new Error(`${ERROR_PREFIX}snapPoints needs at least one snap point.`);for(const t of e)if(!isValidSnapPoint(t))throw new Error(`${ERROR_PREFIX}snap point ${String(t)} is not a positive number or a percentage up to 100%.`);if(null!=t&&(!Number.isInteger(t)||t<0||t>=e.length))throw new Error(`${ERROR_PREFIX}snapIndex ${t} is outside the snap points.`)},resolveNonModalSnapPoints=(e,t)=>e.map(e=>"number"==typeof e?e:parseFloat(e)/100*t).sort((e,t)=>e-t),topAt=(e,t,o)=>{const n=e[o];if(void 0===n)throw new Error(`${ERROR_PREFIX}snap index ${o} has no snap point.`);return Math.max(0,t-n)},NonModalBottomSheet=e=>{const{open:t,onClose:o,snapPoints:n,snapIndex:s,onSnapChange:i,enablePanDownToClose:r=!0,scrollable:a=!1,title:l,header:c,footer:u,labels:d,handleIndicatorStyle:h,sheetStyle:m,children:p,accessibilityLabel:f,testID:E}=e;validateProps(n,s);const b=useMobileUiText("nonModalBottomSheet",NON_MODAL_BOTTOM_SHEET_TEXT),v=useMemo(()=>({...b,...d}),[b,d]),S=useTheme(),R=usePresenceMotion(),x=R.reduced,g=useMemo(()=>buildStyles(S),[S]),[T,w]=useState(()=>Dimensions.get("window").height),_=useCallback(e=>{const t=e.nativeEvent.layout.height;t>0&&w(t)},[]),N=useMemo(()=>resolveNonModalSnapPoints(n,T),[n,T]),y=N[N.length-1]??0,M=T,O=Math.max(0,T-y),C=useCallback(e=>topAt(N,T,e),[N,T]),[P,I]=useState(!1),[j,A]=useState(-1),V=useRef(-1),k=useRef(o);k.current=o;const D=useRef(i);D.current=i;const F=useSharedValue(M),B=useSharedValue(M),G=useCallback(()=>{V.current<0&&I(!1)},[]),L=useCallback(()=>{if(V.current=-1,A(-1),x)return F.value=M,void G();F.value=withTiming(M,{duration:R.duration("fast"),easing:Easing.bezier(...S.motion.ease.accelerate),reduceMotion:PRESENCE_REDUCE_MOTION},e=>{"worklet";e&&scheduleOnRN(G)})},[M,R,x,S.motion.ease.accelerate,F,G]),$=useCallback(e=>{const t=C(e);F.value=x?t:withSpring(t,SPRING_CONFIG)},[x,C,F]),H=useCallback((e,t)=>{e!==V.current&&(V.current=e,A(e),$(e),t&&D.current?.(e))},[$]),X=useEffectEvent(e=>{if(!e)return void(V.current>=0&&L());const t=s??0;I(!0);const o=C(t);x?F.value=o:(F.value=M,F.value=withSpring(o,SPRING_CONFIG)),V.current=t,A(t)});useEffect(()=>{X(t)},[t]);const U=useEffectEvent(e=>{t&&P&&e!==V.current&&H(e,!1)});useEffect(()=>{null!=s&&U(s)},[s]);const Y=useEffectEvent(e=>{const t=V.current;t>=0&&(F.value=topAt(N,e,t))});useEffect(()=>{Y(T)},[T]);const z=useCallback(e=>{if(e<0)return triggerHaptic("selection"),L(),void k.current();e!==V.current?H(e,!0):$(e)},[H,$,L]),q=useCallback(e=>{const t=V.current;t<0||H(Math.min(Math.max(t+e,0),N.length-1),!0)},[H,N.length]),J=useMemo(()=>N.map(e=>T-e),[N,T]),K=useMemo(()=>{const e=J,t=O,o=r;return{testID:E?`${E}-pan-gesture`:"non-modal-bottom-sheet-pan-gesture",activeOffsetY:[-10,10],onActivate:()=>{"worklet";B.value=F.value},onUpdate:e=>{"worklet";const o=B.value+e.translationY;F.value=o<t?t+.25*(o-t):o},onDeactivate:t=>{"worklet";const n=F.value,s=e[0];if(void 0===s)return;if(t.velocityY>1e3)return void scheduleOnRN(z,o?-1:0);if(o&&n-s>80)return void scheduleOnRN(z,-1);let i=0,r=1/0,a=0;for(const t of e){const e=Math.abs(n-t);e<r&&(r=e,i=a),a++}scheduleOnRN(z,i)}}},[B,r,z,O,J,E,F]),Q=usePanGesture(K),W=useAnimatedStyle(()=>({top:Math.max(F.value,O)}),[O]),Z=useAnimatedStyle(()=>{const e=Math.max(F.value,O),t=T-e;return{height:Math.max(0,Math.min(t,y))}},[T,y,O]);return P?_jsx(View,{collapsable:!1,style:StyleSheet.absoluteFill,pointerEvents:"box-none",onLayout:_,testID:E,children:_jsx(Animated.View,{accessibilityLabel:f,testID:E?`${E}-sheet`:void 0,style:[g.sheet,{height:y,backgroundColor:S.colors.surface,borderTopLeftRadius:S.radius.xl,borderTopRightRadius:S.radius.xl,...smoothCorners,...S.shadow.modal},m,W],children:_jsxs(Animated.View,{style:[g.body,Z],children:[_jsx(GestureDetector,{gesture:Q,children:_jsx(View,{style:g.handleRow,accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:v.dragHandle,accessibilityHint:v.swipeHintText,accessibilityValue:{text:fillText(v.snapPointText,{position:j+1,total:N.length})},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:e=>{"increment"===e.nativeEvent.actionName?q(1):"decrement"===e.nativeEvent.actionName&&q(-1)},testID:E?`${E}-handle`:void 0,children:_jsx(View,{style:[g.handle,{backgroundColor:S.colors.border},h]})})}),null!=l?_jsx(Text,{variant:"title",accessibilityRole:"header",children:l}):null,c,a?_jsx(ScrollView,{style:g.scrollContent,children:p}):_jsx(View,{style:g.content,children:p}),u]})})}):null};NonModalBottomSheet.displayName="NonModalBottomSheet";const buildStyles=e=>StyleSheet.create({sheet:{position:"absolute",left:0,right:0,overflow:"hidden"},body:{overflow:"hidden"},handleRow:{alignItems:"center",justifyContent:"center",alignSelf:"stretch",paddingTop:e.space.md,paddingBottom:e.space.xl},handle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},content:{flex:1,overflow:"hidden"},scrollContent:{flex:1}});export{NonModalBottomSheet};export default NonModalBottomSheet;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_NON_MODAL_BOTTOM_SHEET_LABELS,default,NonModalBottomSheet}from"./NonModalBottomSheet.js";
1
+ "use strict";export{default,NonModalBottomSheet}from"./NonModalBottomSheet.js";
@@ -1 +1 @@
1
- "use strict";import React,{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const NUMBER_INPUT_SIZES=["sm","md","lg"],NUMBER_INPUT_VARIANTS=["inline","horizontal"];export const DEFAULT_NUMBER_INPUT_LABELS=Object.freeze({decrease:"Decrease",increase:"Increase",input:"Number input"});const DEFAULT_LONG_PRESS_DELAY=500,DEFAULT_LONG_PRESS_INTERVAL=80,roundToPrecision=(e,t)=>{if(!Number.isFinite(e))return 0;if(t<=0)return Math.round(e);const i=10**t;return Math.round(e*i)/i},clamp=(e,t,i)=>e<t?t:e>i?i:e,formatValue=(e,t,i)=>Number.isFinite(e)?t&&i>0?e.toFixed(i):String(Math.trunc(e)):"",sanitizeTyped=(e,t)=>{if(!e)return"";let i=e.replace(/[^0-9.-]/g,"");if(i=i.replace(/(?!^)-/g,""),t){const e=i.indexOf(".");-1!==e&&(i=i.slice(0,e+1)+i.slice(e+1).replace(/\./g,""))}else i=i.replace(/\./g,"");return i},NumberInput=forwardRef((e,t)=>{const{value:i,defaultValue:s,onChange:l,min:r=Number.NEGATIVE_INFINITY,max:a=Number.POSITIVE_INFINITY,step:n=1,allowDecimal:o=!1,precision:c=0,label:u,help:d,helperText:b,error:m,disabled:p=!1,size:f="md",variant:x="inline",unit:h,haptic:y,labels:S,accessibilityLabel:T,style:N,containerStyle:g,inputStyle:I,buttonStyle:_,unitStyle:F,labelStyle:j,textInputProps:E,testID:V}=e;assertValidValue("NumberInput","size",e.size,NUMBER_INPUT_SIZES),assertValidValue("NumberInput","variant",e.variant,NUMBER_INPUT_VARIANTS);const R=useMemo(()=>({...DEFAULT_NUMBER_INPUT_LABELS,...S}),[S]),[v,C]=useControllableState({value:i,defaultValue:s??e.min??0,onChange:l}),L=useTheme(),P=resolveFieldSize(L,f),z=resolveFieldTextStyle(L,{disabled:p}),A=useMemo(()=>buildStyles(L),[L]),w=useRef(null),[U,k]=useState(formatValue(v,o,c)),[M,B]=useState(!1),[D,H]=useState(!1),O=useCallback(()=>{p||w.current?.focus()},[p]),G=useRef(null),W=useRef(null),Y=useCallback(()=>{null!==G.current&&(clearTimeout(G.current),G.current=null),null!==W.current&&(clearInterval(W.current),W.current=null)},[]);useEffect(()=>Y,[Y]),useEffect(()=>{M||k(formatValue(v,o,c))},[v,o,c,M]);const Z=v<=r,$=v>=a,q=!p,J=useCallback(e=>{const t=roundToPrecision(e,o?c:0),i=clamp(t,r,a);i!==v&&C(i)},[o,a,r,C,c,v]),K=useCallback(()=>{if(!q||Z)return;const e=resolveHaptic(y,"selection");e&&triggerHaptic(e),J(v-n)},[Z,q,y,J,n,v]),Q=useCallback(()=>{if(!q||$)return;const e=resolveHaptic(y,"selection");e&&triggerHaptic(e),J(v+n)},[$,q,y,J,n,v]);React.useImperativeHandle(t,()=>({focus:()=>w.current?.focus(),blur:()=>w.current?.blur(),clear:()=>{k(""),Number.isFinite(r)&&r>0?C(r):C(0<r?r:Math.min(a,0))}}),[a,r,C]);const X=useCallback(e=>{q&&(Y(),G.current=setTimeout(()=>{W.current=setInterval(()=>{"inc"===e?Q():K()},80)},500))},[Y,K,Q,q]),ee=useCallback(e=>{const t=sanitizeTyped(e,o);k(t);const i=Number(t);""!==t&&"-"!==t&&"."!==t&&Number.isFinite(i)&&i>=r&&i<=a&&i!==v&&C(roundToPrecision(i,o?c:0))},[o,a,r,C,c,v]),te=useCallback(()=>{B(!1),H(!1);const e=Number(U);if(""===U||!Number.isFinite(e))return void k(formatValue(v,o,c));const t=roundToPrecision(e,o?c:0),i=clamp(t,r,a);i!==v&&C(i),k(formatValue(i,o,c))},[o,U,a,r,C,c,v]),ie=useCallback(()=>{B(!0),H(!0)},[]),se=Z||p?L.colors["text-disabled"]:L.colors["text-body"],le=$||p?L.colors["text-disabled"]:L.colors["text-body"],re=P.icon+8,renderStepper=(e,t,i,s,l,r)=>_jsx(Pressable,{onPress:t,onLongPress:()=>X(e),onPressOut:Y,delayLongPress:500,disabled:i,accessibilityRole:"button",accessibilityLabel:s,accessibilityState:{disabled:i},"aria-disabled":i,style:({pressed:e})=>[{width:re,height:re,alignItems:"center",justifyContent:"center",borderRadius:L.radius.pill,...smoothCorners},e&&!i?{backgroundColor:L.colors["surface-pressed"]}:null,_],testID:`${V??"numberinput"}-${"inc"===e?"plus":"minus"}`,children:_jsx(Text,{variant:"body",weight:"semibold",style:{fontSize:P.icon,color:l,fontWeight:L.weight.semibold,lineHeight:P.icon+2},children:r})}),ae=T??fieldTextAsString(u)??R.input,ne=!0===m||hasFieldText(m),oe=_jsx(FieldBase,{size:f,disabled:p,error:ne,filled:!0,focused:D,onPress:O,pressFeedback:!1,leading:renderStepper("dec",K,Z||p,R.decrease,se,"−"),trailing:renderStepper("inc",Q,$||p,R.increase,le,"+"),children:_jsxs(View,{style:A.inputRow,children:[_jsx(TextInput,{ref:w,value:U,onChangeText:ee,onFocus:ie,onBlur:te,editable:!p,keyboardType:o?"decimal-pad":"number-pad",selectTextOnFocus:!0,accessibilityRole:"adjustable",accessibilityLabel:ae,accessibilityValue:{now:Number.isFinite(v)?v:0},accessibilityState:{disabled:p},"aria-disabled":p,accessibilityActions:[{name:"increment",label:R.increase},{name:"decrement",label:R.decrease}],onAccessibilityAction:e=>{"increment"===e.nativeEvent.actionName&&Q(),"decrement"===e.nativeEvent.actionName&&K()},style:[A.input,{fontSize:P.text,color:z.color,...z.weightStyle},I],...E}),h?_jsx(Text,{variant:"bodySmall",style:[A.unit,{fontSize:P.text,color:z.placeholderColor},F],children:h}):null]})}),ce=hasFieldText(u)?_jsx(FieldLabel,{size:f,help:d,style:j,children:u}):null,ue=_jsx(FieldMessage,{size:f,error:ne,text:ne?m:b});return _jsxs(View,"horizontal"===x?{style:[A.horizontalContainer,g,N],testID:V,accessibilityState:{disabled:p},"aria-disabled":p,children:[_jsx(View,{style:A.horizontalLabelWrap,children:ce}),_jsxs(View,{children:[oe,ue]})]}:{style:[g,N],testID:V,accessibilityState:{disabled:p},"aria-disabled":p,children:[ce,oe,ue]})});NumberInput.displayName="NumberInput";const buildStyles=e=>StyleSheet.create({inputRow:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},input:{flex:1,textAlign:"center",padding:e.space.none,margin:e.space.none,includeFontPadding:!1},unit:{marginLeft:e.space.xs},label:{marginBottom:e.space.xs},helper:{marginTop:e.space.xs},horizontalContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},horizontalLabelWrap:{flexShrink:1,paddingRight:e.space.md}});export{NumberInput};export default NumberInput;
1
+ "use strict";import React,{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{useMobileUiText}from"../../text/index.js";import{NUMBER_INPUT_TEXT}from"../../text/phone/numberInput.g.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const NUMBER_INPUT_SIZES=["sm","md","lg"],NUMBER_INPUT_VARIANTS=["inline","horizontal"],DEFAULT_LONG_PRESS_DELAY=500,DEFAULT_LONG_PRESS_INTERVAL=80,roundToPrecision=(e,t)=>{if(!Number.isFinite(e))return 0;if(t<=0)return Math.round(e);const i=10**t;return Math.round(e*i)/i},clamp=(e,t,i)=>e<t?t:e>i?i:e,formatValue=(e,t,i)=>Number.isFinite(e)?t&&i>0?e.toFixed(i):String(Math.trunc(e)):"",sanitizeTyped=(e,t)=>{if(!e)return"";let i=e.replace(/[^0-9.-]/g,"");if(i=i.replace(/(?!^)-/g,""),t){const e=i.indexOf(".");-1!==e&&(i=i.slice(0,e+1)+i.slice(e+1).replace(/\./g,""))}else i=i.replace(/\./g,"");return i},NumberInput=forwardRef((e,t)=>{const{value:i,defaultValue:s,onChange:l,min:r=Number.NEGATIVE_INFINITY,max:a=Number.POSITIVE_INFINITY,step:n=1,allowDecimal:o=!1,precision:c=0,label:u,help:d,helperText:m,error:b,disabled:p=!1,size:f="md",variant:x="inline",unit:h,haptic:T,labels:y,accessibilityLabel:S,style:g,inputStyle:I,buttonStyle:N,unitStyle:_,labelStyle:F,textInputProps:j,testID:V}=e;assertValidValue("NumberInput","size",e.size,NUMBER_INPUT_SIZES),assertValidValue("NumberInput","variant",e.variant,NUMBER_INPUT_VARIANTS);const v=useMobileUiText("numberInput",NUMBER_INPUT_TEXT),R=useMemo(()=>({...v,...y}),[v,y]),[C,E]=useControllableState({value:i,defaultValue:s??e.min??0,onChange:l}),P=useTheme(),z=resolveFieldSize(P,f),w=resolveFieldTextStyle(P,{disabled:p}),M=useMemo(()=>buildStyles(P),[P]),L=useRef(null),[U,k]=useState(formatValue(C,o,c)),[A,B]=useState(!1),[D,H]=useState(!1),O=useCallback(()=>{p||L.current?.focus()},[p]),G=useRef(null),W=useRef(null),Y=useCallback(()=>{null!==G.current&&(clearTimeout(G.current),G.current=null),null!==W.current&&(clearInterval(W.current),W.current=null)},[]);useEffect(()=>Y,[Y]),useEffect(()=>{A||k(formatValue(C,o,c))},[C,o,c,A]);const $=C<=r,X=C>=a,Z=!p,q=useCallback(e=>{const t=roundToPrecision(e,o?c:0),i=clamp(t,r,a);i!==C&&E(i)},[o,a,r,E,c,C]),J=useCallback(()=>{if(!Z||$)return;const e=resolveHaptic(T,"selection");e&&triggerHaptic(e),q(C-n)},[$,Z,T,q,n,C]),K=useCallback(()=>{if(!Z||X)return;const e=resolveHaptic(T,"selection");e&&triggerHaptic(e),q(C+n)},[X,Z,T,q,n,C]);React.useImperativeHandle(t,()=>({focus:()=>L.current?.focus(),blur:()=>L.current?.blur(),clear:()=>{k(""),Number.isFinite(r)&&r>0?E(r):E(0<r?r:Math.min(a,0))}}),[a,r,E]);const Q=useCallback(e=>{Z&&(Y(),G.current=setTimeout(()=>{W.current=setInterval(()=>{"inc"===e?K():J()},80)},500))},[Y,J,K,Z]),ee=useCallback(e=>{const t=sanitizeTyped(e,o);k(t);const i=Number(t);""!==t&&"-"!==t&&"."!==t&&Number.isFinite(i)&&i>=r&&i<=a&&i!==C&&E(roundToPrecision(i,o?c:0))},[o,a,r,E,c,C]),te=useCallback(()=>{B(!1),H(!1);const e=Number(U);if(""===U||!Number.isFinite(e))return void k(formatValue(C,o,c));const t=roundToPrecision(e,o?c:0),i=clamp(t,r,a);i!==C&&E(i),k(formatValue(i,o,c))},[o,U,a,r,E,c,C]),ie=useCallback(()=>{B(!0),H(!0)},[]),se=$||p?P.colors["text-disabled"]:P.colors["text-body"],le=X||p?P.colors["text-disabled"]:P.colors["text-body"],re=z.icon+8,renderStepper=(e,t,i,s,l,r)=>_jsx(Pressable,{onPress:t,onLongPress:()=>Q(e),onPressOut:Y,delayLongPress:500,disabled:i,accessibilityRole:"button",accessibilityLabel:s,accessibilityState:{disabled:i},"aria-disabled":i,style:({pressed:e})=>[{width:re,height:re,alignItems:"center",justifyContent:"center",borderRadius:P.radius.pill,...smoothCorners},e&&!i?{backgroundColor:P.colors["surface-pressed"]}:null,N],testID:`${V??"numberinput"}-${"inc"===e?"plus":"minus"}`,children:_jsx(Text,{variant:"body",weight:"semibold",style:{fontSize:z.icon,color:l,fontWeight:P.weight.semibold,lineHeight:z.icon+2},children:r})}),ae=S??fieldTextAsString(u)??R.input,ne=!0===b||hasFieldText(b),oe=_jsx(FieldBase,{testID:V?`${V}-field`:void 0,size:f,disabled:p,error:ne,filled:!0,focused:D,onPress:O,pressFeedback:!1,leading:renderStepper("dec",J,$||p,R.decrease,se,"−"),trailing:renderStepper("inc",K,X||p,R.increase,le,"+"),children:_jsxs(View,{style:M.inputRow,children:[_jsx(TextInput,{ref:L,value:U,onChangeText:ee,onFocus:ie,onBlur:te,editable:!p,keyboardType:o?"decimal-pad":"number-pad",selectTextOnFocus:!0,accessibilityRole:"adjustable",accessibilityLabel:ae,accessibilityValue:{now:Number.isFinite(C)?C:0},accessibilityState:{disabled:p},"aria-disabled":p,accessibilityActions:[{name:"increment",label:R.increase},{name:"decrement",label:R.decrease}],onAccessibilityAction:e=>{"increment"===e.nativeEvent.actionName&&K(),"decrement"===e.nativeEvent.actionName&&J()},style:[M.input,{fontSize:z.text,color:w.color,...w.weightStyle},I],...j}),h?_jsx(Text,{variant:"bodySmall",style:[M.unit,{fontSize:z.text,color:w.placeholderColor},_],children:h}):null]})}),ce=hasFieldText(u)?_jsx(FieldLabel,{size:f,help:d,style:F,children:u}):null,ue=_jsx(FieldMessage,{size:f,error:ne,text:ne?b:m});return _jsxs(View,"horizontal"===x?{style:[M.horizontalContainer,g],testID:V,accessibilityState:{disabled:p},"aria-disabled":p,children:[_jsx(View,{style:M.horizontalLabelWrap,children:ce}),_jsxs(View,{children:[oe,ue]})]}:{style:[g],testID:V,accessibilityState:{disabled:p},"aria-disabled":p,children:[ce,oe,ue]})});NumberInput.displayName="NumberInput";const buildStyles=e=>StyleSheet.create({inputRow:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},input:{flex:1,textAlign:"center",padding:e.space.none,margin:e.space.none,includeFontPadding:!1},unit:{marginLeft:e.space.xs},label:{marginBottom:e.space.xs},helper:{marginTop:e.space.xs},horizontalContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},horizontalLabelWrap:{flexShrink:1,paddingRight:e.space.md}});export{NumberInput};export default NumberInput;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_NUMBER_INPUT_LABELS,default,NumberInput}from"./NumberInput.js";
1
+ "use strict";export{default,NumberInput}from"./NumberInput.js";
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState,useReducedMotion}from"../../hooks/index.js";import{createAnimatedValue,fontFor,resolveOtpInputSize,setNativeValue,useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{FieldBase,FieldMessage,hasFieldText}from"../FieldBase/FieldBase.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_OTP_INPUT_LABELS=Object.freeze({field:e=>`Enter ${e}-digit code`});const cellAt=(e,t)=>{const n=e[t];if(void 0===n)throw new Error(`OTP cell ${t} is outside the ${e.length} cells.`);return n},sanitizeChar=(e,t)=>e?"number-pad"===t?e.replace(/\D/g,""):e:"",OTPInput=forwardRef((e,t)=>{const{value:n,defaultValue:i,onChange:r,onComplete:s,length:a=6,keyboardType:o="number-pad",autoFocus:l=!1,autoFocusDelay:u=0,disabled:c=!1,error:d,size:m="md",secure:p=!1,haptic:f,labels:g,onFocus:h,accessibilityLabel:b,style:y,cellStyle:x,textStyle:v,testID:T}=e;assertValidValue("OTPInput","size",e.size,["sm","md","lg"]),assertValidValue("OTPInput","keyboardType",e.keyboardType,["number-pad","default"]);const j=g?{...DEFAULT_OTP_INPUT_LABELS,...g}:DEFAULT_OTP_INPUT_LABELS,[A,V]=useControllableState({value:n,defaultValue:i??"",onChange:r}),E=useTheme(),C=useMemo(()=>buildStyles(E),[E]),k=resolveOtpInputSize(E,m),S=E.components["otp-input"][m].radius,w=useRef([]),[I,_]=useState(-1),[D,F]=useState(0),O=useRef(null),P=useRef(createAnimatedValue(0)).current,M=useRef(new Map),z=useMemo(()=>{const e=M.current,t=[];for(let n=0;n<a;n+=1){let i=e.get(n);i||(i=new Animated.Value(0),e.set(n,i)),t.push(i)}for(const t of Array.from(e.keys()))t>=a&&e.delete(t);return t},[a]),R=useRef(-1),L=E.settings.components["otp-input"]?.shakeOnError??!1,N=useReducedMotion(),B=!0===d||hasFieldText(d);useEffect(()=>{let e;return null===O.current||!B||O.current||(f&&triggerHaptic("notificationError"),L&&!N&&(setNativeValue(P,0),e=Animated.sequence([Animated.timing(P,{toValue:1,duration:E.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver}),Animated.timing(P,{toValue:-1,duration:E.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver}),Animated.timing(P,{toValue:1,duration:E.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver}),Animated.timing(P,{toValue:0,duration:E.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver})]),e.start())),O.current=B,()=>e?.stop()},[B,P,L,f,N,E.motion.duration.instant]),useEffect(()=>{const e=R.current;if(R.current=I,e===I)return;if(-1===e&&-1===I)return;const t=[];return z.forEach((n,i)=>{const r=i===I?1:0;if(i!==I&&i!==e)return;const s=Animated.timing(n,{toValue:r,duration:E.motion.duration.fast,easing:Easing.bezier(...E.motion.ease["in-out"]),useNativeDriver:nativeDriver});s.start(),t.push(s)}),()=>t.forEach(e=>{e.stop()})},[I,z,E]);const H=useCallback(e=>{const t=w.current[e];t&&t.focus()},[]);useImperativeHandle(t,()=>({focus:()=>H(0),blur:()=>{const e=w.current[Math.max(I,0)];e?.blur()},clear:()=>{V(""),H(0)}}),[H,I,V]),useEffect(()=>{if(l&&!c){const e=setTimeout(()=>H(0),u);return()=>clearTimeout(e)}},[l,u,c,H]);const U=useMemo(()=>{const e=new Array(a).fill("");for(let t=0;t<Math.min(A.length,a);t+=1)e[t]=A.charAt(t);return e},[A,a]),W=useMemo(()=>U.map((e,t)=>({key:`otp-cell-${t}`,index:t,char:e})),[U]),$=useCallback(e=>{const t=e.slice(0,a);t!==A&&(V(t),t.length===a&&s&&s(t))},[a,V,s,A]),q=useCallback((e,t)=>{const n=t.replace(/\u200B/g,""),i=sanitizeChar(n,o);if(!i){const t=U.slice(),n=cellAt(U,e).length>0;if(t[e]="",$(t.join("").slice(0,a)),!n&&e>0){const t=U.slice();t[e-1]="",$(t.join("")),H(e-1)}return}const r=cellAt(U,e),s=r&&i.length>a&&i.startsWith(r)?i.slice(r.length):i;if(s.length>=a){const t=s.slice(0,a),n=A.length;return $(t),t.length!==n&&f&&triggerHaptic(f),void w.current[e]?.blur()}const l=U.slice();let u=e;for(let e=0;e<i.length&&u<a;e+=1)l[u]=i.charAt(e),u+=1;const c=l.join("").slice(0,a),d=A.length;$(c),c.length!==d&&f&&triggerHaptic(f);const m=Math.min(u,a-1);u>=a?w.current[e]?.blur():H(m)},[U,H,o,a,f,$,A]),G=useCallback((e,t)=>{if("Backspace"!==t.nativeEvent.key)return;if(0===cellAt(U,e).length){if(e>0){const t=U.slice();t[e-1]="",$(t.join("")),H(e-1)}}else{const t=U.slice();t[e]="",$(t.join(""))}},[U,H,$]),K=useCallback((e,t)=>{_(e),h?.(t)},[h]),X=useCallback(()=>{_(-1)},[]),J=useCallback(()=>{if(c)return;const e=U.indexOf("");H(-1===e?a-1:e)},[U,c,H,a]),Q=useCallback(e=>{F(e.nativeEvent.layout.width)},[]),Y=b??j.field(a),Z=D>0?Math.max(24,Math.min(k.cell,Math.floor((D-k.gap*(a-1))/a))):k.cell,ee=P.interpolate({inputRange:[-1,1],outputRange:[-6,6]});return _jsxs(View,{style:y,onLayout:Q,accessible:!0,accessibilityRole:"none",accessibilityLabel:Y,accessibilityValue:{text:n},accessibilityState:{disabled:c},"aria-disabled":c,testID:T,children:[_jsx(Pressable,{onPress:J,disabled:c,accessible:!1,children:_jsx(Animated.View,{style:[C.row,{columnGap:k.gap,transform:[{translateX:ee}]}],children:W.map(({key:e,index:t,char:n})=>{const i=I===t,r=n.length>0,s=B?E.colors["danger-border"]:E.colors["focus-ring"],l=z[t];if(!l)return null;const u=p&&r?"●":n;return _jsxs(View,{style:C.cellWrapper,children:[_jsxs(FieldBase,{size:m,width:Z,height:Z,radius:S,borderWidth:1.5,focused:i,error:B,filled:r,disabled:c,paddingHorizontal:E.space.none,paddingVertical:E.space.none,gap:E.space.none,style:x,children:[_jsx(TextInput,{ref:e=>{w.current[t]=e},value:(p&&r?"":n)||"​",onChangeText:e=>q(t,e),onKeyPress:e=>G(t,e),onFocus:e=>K(t,e),onBlur:X,keyboardType:o,editable:!c,selectTextOnFocus:!0,caretHidden:r,maxLength:a+1,textContentType:"oneTimeCode",autoComplete:0===t?"sms-otp":"off",importantForAutofill:0===t?"yes":"no",style:[C.input,{fontSize:k.text,color:E.colors["text-body"],...fontFor(E,"semibold")},v]}),p&&r?_jsx(View,{pointerEvents:"none",style:C.maskOverlay,children:_jsx(Text,{variant:"body",weight:"semibold",style:[{fontSize:k.text},v],children:u})}):null]}),_jsx(Animated.View,{style:[C.underline,{backgroundColor:s,opacity:l}]})]},e)})})}),_jsx(FieldMessage,{size:m,error:!0,text:d})]})});OTPInput.displayName="OTPInput";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},cellWrapper:{alignItems:"center"},input:{width:"100%",height:"100%",textAlign:"center",padding:e.space.none},maskOverlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center"},underline:{marginTop:e.space.xs,height:2,width:"60%",borderRadius:e.radius.pill,...smoothCorners}});export{OTPInput};export default OTPInput;
1
+ "use strict";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState,useReducedMotion}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{OTP_INPUT_TEXT}from"../../text/phone/otpInput.g.js";import{createAnimatedValue,fontFor,resolveOtpInputSize,setNativeValue,useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{FieldBase,FieldMessage,hasFieldText}from"../FieldBase/FieldBase.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const cellAt=(e,t)=>{const i=e[t];if(void 0===i)throw new Error(`OTP cell ${t} is outside the ${e.length} cells.`);return i},sanitizeChar=(e,t)=>e?"number-pad"===t?e.replace(/\D/g,""):e:"",OTPInput=forwardRef((e,t)=>{const{value:i,defaultValue:n,onChange:s,onComplete:r,length:a=6,keyboardType:o="number-pad",autoFocus:l=!1,autoFocusDelay:u=0,disabled:c=!1,error:d,size:m="md",secure:p=!1,haptic:f,labels:g,onFocus:h,accessibilityLabel:b,style:x,cellStyle:y,textStyle:v,testID:T}=e;assertValidValue("OTPInput","size",e.size,["sm","md","lg"]),assertValidValue("OTPInput","keyboardType",e.keyboardType,["number-pad","default"]);const j=useMobileUiText("otpInput",OTP_INPUT_TEXT),V=useMemo(()=>({...j,...g}),[j,g]),[C,k]=useControllableState({value:i,defaultValue:n??"",onChange:s}),A=useTheme(),I=useMemo(()=>buildStyles(A),[A]),w=resolveOtpInputSize(A,m),E=A.components["otp-input"][m].radius,S=useRef([]),[M,D]=useState(-1),[F,O]=useState(0),P=useRef(null),_=useRef(createAnimatedValue(0)).current,R=useRef(new Map),z=useMemo(()=>{const e=R.current,t=[];for(let i=0;i<a;i+=1){let n=e.get(i);n||(n=new Animated.Value(0),e.set(i,n)),t.push(n)}for(const t of Array.from(e.keys()))t>=a&&e.delete(t);return t},[a]),N=useRef(-1),H=A.settings.components["otp-input"]?.shakeOnError??!1,B=useReducedMotion(),L=!0===d||hasFieldText(d);useEffect(()=>{let e;return null===P.current||!L||P.current||(f&&triggerHaptic("notificationError"),H&&!B&&(setNativeValue(_,0),e=Animated.sequence([Animated.timing(_,{toValue:1,duration:A.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver}),Animated.timing(_,{toValue:-1,duration:A.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver}),Animated.timing(_,{toValue:1,duration:A.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver}),Animated.timing(_,{toValue:0,duration:A.motion.duration.instant,easing:Easing.linear,useNativeDriver:nativeDriver})]),e.start())),P.current=L,()=>e?.stop()},[L,_,H,f,B,A.motion.duration.instant]),useEffect(()=>{const e=N.current;if(N.current=M,e===M)return;if(-1===e&&-1===M)return;const t=[];return z.forEach((i,n)=>{const s=n===M?1:0;if(n!==M&&n!==e)return;const r=Animated.timing(i,{toValue:s,duration:A.motion.duration.fast,easing:Easing.bezier(...A.motion.ease["in-out"]),useNativeDriver:nativeDriver});r.start(),t.push(r)}),()=>t.forEach(e=>{e.stop()})},[M,z,A]);const U=useCallback(e=>{const t=S.current[e];t&&t.focus()},[]);useImperativeHandle(t,()=>({focus:()=>U(0),blur:()=>{const e=S.current[Math.max(M,0)];e?.blur()},clear:()=>{k(""),U(0)}}),[U,M,k]),useEffect(()=>{if(l&&!c){const e=setTimeout(()=>U(0),u);return()=>clearTimeout(e)}},[l,u,c,U]);const W=useMemo(()=>{const e=new Array(a).fill("");for(let t=0;t<Math.min(C.length,a);t+=1)e[t]=C.charAt(t);return e},[C,a]),X=useMemo(()=>W.map((e,t)=>({key:`otp-cell-${t}`,index:t,char:e})),[W]),$=useCallback(e=>{const t=e.slice(0,a);t!==C&&(k(t),t.length===a&&r&&r(t))},[a,k,r,C]),q=useCallback((e,t)=>{const i=t.replace(/\u200B/g,""),n=sanitizeChar(i,o);if(!n){const t=W.slice(),i=cellAt(W,e).length>0;if(t[e]="",$(t.join("").slice(0,a)),!i&&e>0){const t=W.slice();t[e-1]="",$(t.join("")),U(e-1)}return}const s=cellAt(W,e),r=s&&n.length>a&&n.startsWith(s)?n.slice(s.length):n;if(r.length>=a){const t=r.slice(0,a),i=C.length;return $(t),t.length!==i&&f&&triggerHaptic(f),void S.current[e]?.blur()}const l=W.slice();let u=e;for(let e=0;e<n.length&&u<a;e+=1)l[u]=n.charAt(e),u+=1;const c=l.join("").slice(0,a),d=C.length;$(c),c.length!==d&&f&&triggerHaptic(f);const m=Math.min(u,a-1);u>=a?S.current[e]?.blur():U(m)},[W,U,o,a,f,$,C]),G=useCallback((e,t)=>{if("Backspace"!==t.nativeEvent.key)return;if(0===cellAt(W,e).length){if(e>0){const t=W.slice();t[e-1]="",$(t.join("")),U(e-1)}}else{const t=W.slice();t[e]="",$(t.join(""))}},[W,U,$]),K=useCallback((e,t)=>{D(e),h?.(t)},[h]),J=useCallback(()=>{D(-1)},[]),Q=useCallback(()=>{if(c)return;const e=W.indexOf("");U(-1===e?a-1:e)},[W,c,U,a]),Y=useCallback(e=>{O(e.nativeEvent.layout.width)},[]),Z=b??fillText(V.field,{length:a}),ee=F>0?Math.max(24,Math.min(w.cell,Math.floor((F-w.gap*(a-1))/a))):w.cell,te=_.interpolate({inputRange:[-1,1],outputRange:[-6,6]});return _jsxs(View,{style:x,onLayout:Y,accessible:!0,accessibilityRole:"none",accessibilityLabel:Z,accessibilityValue:{text:i},accessibilityState:{disabled:c},"aria-disabled":c,testID:T,children:[_jsx(Pressable,{onPress:Q,disabled:c,accessible:!1,children:_jsx(Animated.View,{style:[I.row,{columnGap:w.gap,transform:[{translateX:te}]}],children:X.map(({key:e,index:t,char:i})=>{const n=M===t,s=i.length>0,r=L?A.colors["danger-border"]:A.colors["focus-ring"],l=z[t];if(!l)return null;const u=p&&s?"●":i;return _jsxs(View,{style:I.cellWrapper,children:[_jsxs(FieldBase,{size:m,width:ee,height:ee,radius:E,borderWidth:1.5,focused:n,error:L,filled:s,disabled:c,paddingHorizontal:A.space.none,paddingVertical:A.space.none,gap:A.space.none,style:y,children:[_jsx(TextInput,{ref:e=>{S.current[t]=e},value:(p&&s?"":i)||"​",onChangeText:e=>q(t,e),onKeyPress:e=>G(t,e),onFocus:e=>K(t,e),onBlur:J,keyboardType:o,editable:!c,selectTextOnFocus:!0,caretHidden:s,maxLength:a+1,textContentType:"oneTimeCode",autoComplete:0===t?"sms-otp":"off",importantForAutofill:0===t?"yes":"no",style:[I.input,{fontSize:w.text,color:A.colors["text-body"],...fontFor(A,"semibold")},v]}),p&&s?_jsx(View,{pointerEvents:"none",style:I.maskOverlay,children:_jsx(Text,{variant:"body",weight:"semibold",style:[{fontSize:w.text},v],children:u})}):null]}),_jsx(Animated.View,{style:[I.underline,{backgroundColor:r,opacity:l}]})]},e)})})}),_jsx(FieldMessage,{size:m,error:!0,text:d})]})});OTPInput.displayName="OTPInput";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},cellWrapper:{alignItems:"center"},input:{width:"100%",height:"100%",textAlign:"center",padding:e.space.none},maskOverlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center"},underline:{marginTop:e.space.xs,height:2,width:"60%",borderRadius:e.radius.pill,...smoothCorners}});export{OTPInput};export default OTPInput;
@@ -1 +1 @@
1
- "use strict";import{View}from"react-native";import{makeStyles}from"../../theme/index.js";import{Button}from"../Button/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_OTP_RESEND_ROW_LABELS=Object.freeze({expiresIn:e=>`Code expires in ${e}`,expired:"Code expired",resendIn:e=>`Resend code in ${e}`,resendWaitSpoken:e=>`You can ask for a new code in ${e} seconds`,resend:"Resend code",sendNew:"Send a new code"});const TOUCH_TARGET=44,countdownText=e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,useStyles=makeStyles(e=>({row:{alignItems:"center",columnGap:e.space.md,flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",minHeight:44,rowGap:e.space.xs,width:"100%"}})),OTPResendRow=({resendSecondsLeft:e,expirySecondsLeft:n,onResend:s,resending:t=!1,labels:o,style:r,testID:i})=>{const d=useStyles(),a=o?{...DEFAULT_OTP_RESEND_ROW_LABELS,...o}:DEFAULT_OTP_RESEND_ROW_LABELS,x=0===n,c=x||0===e;return _jsxs(View,{style:[d.row,r],children:[null==n?_jsx(View,{}):_jsx(Text,{variant:"caption",testID:i?`${i}-expiry`:void 0,children:x?a.expired:a.expiresIn(countdownText(n))}),c?_jsx(Button,{variant:"link",label:x?a.sendNew:a.resend,onPress:s,disabled:t,testID:i?`${i}-resend`:void 0}):_jsx(Text,{variant:"caption",accessibilityLabel:a.resendWaitSpoken(e),testID:i?`${i}-resend-wait`:void 0,children:a.resendIn(countdownText(e))})]})};OTPResendRow.displayName="OTPResendRow";export{OTPResendRow};
1
+ "use strict";import{useMemo}from"react";import{View}from"react-native";import{fillText,pluralText,useMobileUiText}from"../../text/index.js";import{OTP_INPUT_TEXT}from"../../text/phone/otpInput.g.js";import{makeStyles}from"../../theme/index.js";import{Button}from"../Button/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const TOUCH_TARGET=44,countdownText=e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,useStyles=makeStyles(e=>({row:{alignItems:"center",columnGap:e.space.md,flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",minHeight:44,rowGap:e.space.xs,width:"100%"}})),OTPResendRow=({resendSecondsLeft:e,expirySecondsLeft:t,onResend:s,resending:n=!1,labels:i,style:o,testID:r})=>{const a=useStyles(),x=useMobileUiText("otpInput",OTP_INPUT_TEXT),l=useMemo(()=>({...x,...i}),[x,i]),d=0===t,p=d||0===e;return _jsxs(View,{style:[a.row,o],children:[null==t?_jsx(View,{}):_jsx(Text,{variant:"caption",testID:r?`${r}-expiry`:void 0,children:d?l.expired:fillText(l.expiresIn,{time:countdownText(t)})}),p?_jsx(Button,{variant:"link",label:d?l.sendNew:l.resend,onPress:s,disabled:n,testID:r?`${r}-resend`:void 0}):_jsx(Text,{variant:"caption",accessibilityLabel:pluralText(l,"resendWaitSpoken",e,{seconds:e}),testID:r?`${r}-resend-wait`:void 0,children:fillText(l.resendIn,{time:countdownText(e)})})]})};OTPResendRow.displayName="OTPResendRow";export{OTPResendRow};
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_OTP_INPUT_LABELS,default,OTPInput}from"./OTPInput.js";export{DEFAULT_OTP_RESEND_ROW_LABELS,OTPResendRow}from"./OTPResendRow.js";
1
+ "use strict";export{default,OTPInput}from"./OTPInput.js";export{OTPResendRow}from"./OTPResendRow.js";
@@ -1 +1 @@
1
- "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,ScrollView,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Carousel}from"../Carousel/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_ONBOARDING_PAGER_LABELS=Object.freeze({skip:"Skip",next:"Next",done:"Get started",step:(e,t)=>`Step ${e} of ${t}`,pageControl:"Page"});const ONBOARDING_MAX_PAGES=6,CONTROL_HEIGHT=44,DOT_SIZE=8,DOT_ACTIVE_WIDTH=24,OnboardingPager=({pages:e,onDone:t,onSkip:o,labels:s,safeArea:n=!0,haptic:a="selection",testID:i})=>{const r=useTheme(),l=useSafeAreaInsets(),c=useReducedMotion(),u=useMemo(()=>buildStyles(r),[r]),d=useMemo(()=>s?{...DEFAULT_ONBOARDING_PAGER_LABELS,...s}:DEFAULT_ONBOARDING_PAGER_LABELS,[s]),p=useMemo(()=>e.slice(0,6),[e]),m=p.length,g=d.step,b=useRef(null),[x,f]=useState(0),h=x>=m-1,y=useCallback(e=>{e<0||e>=m||b.current?.scrollTo(e,!c)},[m,c]),j=useCallback(e=>y(x+e),[y,x]),S=useCallback(()=>{h?t():y(x+1)},[h,t,y,x]),_=useRef(x);useEffect(()=>{if(_.current===x)return;_.current=x;const e=p[x];e&&announce(`${g(x+1,m)}, ${e.title}`)},[x,p,m,g]);const A=useCallback((e,t)=>_jsx(ScrollView,{style:u.page,contentContainerStyle:u.pageContent,showsVerticalScrollIndicator:!1,bounces:!1,children:_jsxs(View,{accessible:!0,accessibilityLabel:`${g(t+1,m)}, ${e.title}. ${e.body}`,style:u.pageGroup,children:[e.art?_jsx(View,{style:u.art,children:e.art}):null,_jsx(Text,{variant:"h2",align:"center",children:e.title}),_jsx(Text,{variant:"body",color:"secondary",align:"center",children:e.body})]})}),[u,g,m]);return 0===m?null:_jsxs(View,{style:[u.root,n?{paddingTop:l.top,paddingBottom:l.bottom}:null],testID:i,children:[_jsx(View,{style:u.skipRow,children:_jsx(Button,{label:d.skip,variant:"ghost",tone:"neutral",hitSlop:{top:2,bottom:2,left:8,right:8},haptic:a,onPress:o,testID:i?`${i}-skip`:void 0})}),_jsx(Carousel,{ref:b,data:p,renderItem:A,keyExtractor:e=>e.key,onIndexChange:f,showPagination:!1,containerStyle:u.carousel,testID:i?`${i}-pages`:void 0}),_jsxs(View,{style:u.footer,children:[m>1?_jsx(PageControl,{keys:p.map(e=>e.key),index:x,label:d.pageControl,valueText:g(x+1,m),reduceMotion:c,theme:r,onStep:j,testID:i?`${i}-dots`:void 0}):null,_jsx(Button,{label:h?d.done:d.next,size:"lg",fullWidth:!0,haptic:a,onPress:S,testID:i?`${i}-next`:void 0})]})]})};OnboardingPager.displayName="OnboardingPager";const PageControl=({keys:e,index:t,label:o,valueText:s,reduceMotion:n,theme:a,onStep:i,testID:r})=>{const l=useCallback(e=>{"increment"===e.nativeEvent.actionName?i(1):"decrement"===e.nativeEvent.actionName&&i(-1)},[i]);return _jsxs(View,{accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:o,accessibilityValue:{min:0,max:e.length-1,now:t,text:s},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:l,style:controlStyles.control,testID:r,children:[_jsx(View,{style:controlStyles.dots,pointerEvents:"none",children:e.map((e,o)=>_jsx(Dot,{active:o===t,reduceMotion:n,theme:a},e))}),_jsx(Pressable,{accessible:!1,importantForAccessibility:"no",style:controlStyles.back,onPress:()=>i(-1),testID:r?`${r}-back`:void 0}),_jsx(Pressable,{accessible:!1,importantForAccessibility:"no",style:controlStyles.forward,onPress:()=>i(1),testID:r?`${r}-forward`:void 0})]})},Dot=({active:e,reduceMotion:t,theme:o})=>{const s=useRef(createAnimatedValue(e?1:0)).current;return useEffect(()=>{const n=Animated.timing(s,{toValue:e?1:0,duration:t?0:o.motion.duration.default,easing:Easing.bezier(...o.motion.ease["in-out"]),useNativeDriver:!1});return n.start(),()=>n.stop()},[e,t,s,o]),_jsx(Animated.View,{style:{width:s.interpolate({inputRange:[0,1],outputRange:[8,24]}),height:8,marginHorizontal:o.space.xs,borderRadius:4,...smoothCorners,backgroundColor:s.interpolate({inputRange:[0,1],outputRange:[o.colors.border,o.colors.primary]})}})},controlStyles=StyleSheet.create({control:{alignSelf:"center",height:44,minWidth:88,alignItems:"center",justifyContent:"center"},dots:{flexDirection:"row",alignItems:"center"},back:{position:"absolute",top:0,bottom:0,start:0,width:"50%"},forward:{position:"absolute",top:0,bottom:0,end:0,width:"50%"}}),buildStyles=e=>StyleSheet.create({root:{flex:1,backgroundColor:e.colors.bg},skipRow:{minHeight:44,paddingHorizontal:e.space.lg,alignItems:"flex-end",justifyContent:"center"},carousel:{flex:1},page:{flex:1},pageContent:{flexGrow:1,justifyContent:"center",paddingHorizontal:e.space.xl,paddingVertical:e.space.lg},pageGroup:{alignItems:"stretch",gap:e.space.md},art:{alignItems:"center",alignSelf:"stretch",marginBottom:e.space.xl},footer:{paddingHorizontal:e.space.lg,paddingBottom:e.space.lg,gap:e.space.sm}});export{OnboardingPager};export default OnboardingPager;
1
+ "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,ScrollView,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{fillText,useMobileUiText}from"../../text/index.js";import{ONBOARDING_PAGER_TEXT}from"../../text/phone/onboardingPager.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Carousel}from"../Carousel/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ONBOARDING_MAX_PAGES=6,CONTROL_HEIGHT=44,DOT_SIZE=8,DOT_ACTIVE_WIDTH=24,OnboardingPager=({pages:e,onDone:t,onSkip:o,labels:s,safeArea:n=!0,haptic:i="selection",testID:a})=>{const r=useTheme(),l=useSafeAreaInsets(),c=useReducedMotion(),u=useMemo(()=>buildStyles(r),[r]),d=useMobileUiText("onboardingPager",ONBOARDING_PAGER_TEXT),m=useMemo(()=>s?{...d,...s}:d,[d,s]),p=useMemo(()=>e.slice(0,6),[e]),g=p.length,b=useCallback((e,t)=>fillText(m.step,{position:e,total:t}),[m.step]),x=useRef(null),[f,h]=useState(0),y=f>=g-1,j=useCallback(e=>{e<0||e>=g||x.current?.scrollTo(e,!c)},[g,c]),_=useCallback(e=>j(f+e),[j,f]),S=useCallback(()=>{y?t():j(f+1)},[y,t,j,f]),I=useRef(f);useEffect(()=>{if(I.current===f)return;I.current=f;const e=p[f];e&&announce(`${b(f+1,g)}, ${e.title}`)},[f,p,g,b]);const C=useCallback((e,t)=>_jsx(ScrollView,{style:u.page,contentContainerStyle:u.pageContent,showsVerticalScrollIndicator:!1,bounces:!1,children:_jsxs(View,{accessible:!0,accessibilityLabel:`${b(t+1,g)}, ${e.title}. ${e.body}`,style:u.pageGroup,children:[e.art?_jsx(View,{style:u.art,children:e.art}):null,_jsx(Text,{variant:"h2",align:"center",children:e.title}),_jsx(Text,{variant:"body",color:"secondary",align:"center",children:e.body})]})}),[u,b,g]);return 0===g?null:_jsxs(View,{style:[u.root,n?{paddingTop:l.top,paddingBottom:l.bottom}:null],testID:a,children:[_jsx(View,{style:u.skipRow,children:_jsx(Button,{label:m.skip,variant:"ghost",tone:"neutral",hitSlop:{top:2,bottom:2,left:8,right:8},haptic:i,onPress:o,testID:a?`${a}-skip`:void 0})}),_jsx(Carousel,{ref:x,data:p,renderItem:C,keyExtractor:e=>e.key,onIndexChange:h,showPagination:!1,style:u.carousel,testID:a?`${a}-pages`:void 0}),_jsxs(View,{style:u.footer,children:[g>1?_jsx(PageControl,{keys:p.map(e=>e.key),index:f,label:m.pageControl,valueText:b(f+1,g),reduceMotion:c,theme:r,onStep:_,testID:a?`${a}-dots`:void 0}):null,_jsx(Button,{label:y?m.done:m.next,size:"lg",fullWidth:!0,haptic:i,onPress:S,testID:a?`${a}-next`:void 0})]})]})};OnboardingPager.displayName="OnboardingPager";const PageControl=({keys:e,index:t,label:o,valueText:s,reduceMotion:n,theme:i,onStep:a,testID:r})=>{const l=useCallback(e=>{"increment"===e.nativeEvent.actionName?a(1):"decrement"===e.nativeEvent.actionName&&a(-1)},[a]);return _jsxs(View,{accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:o,accessibilityValue:{min:0,max:e.length-1,now:t,text:s},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:l,style:controlStyles.control,testID:r,children:[_jsx(View,{style:controlStyles.dots,pointerEvents:"none",children:e.map((e,o)=>_jsx(Dot,{active:o===t,reduceMotion:n,theme:i},e))}),_jsx(Pressable,{accessible:!1,importantForAccessibility:"no",style:controlStyles.back,onPress:()=>a(-1),testID:r?`${r}-back`:void 0}),_jsx(Pressable,{accessible:!1,importantForAccessibility:"no",style:controlStyles.forward,onPress:()=>a(1),testID:r?`${r}-forward`:void 0})]})},Dot=({active:e,reduceMotion:t,theme:o})=>{const s=useRef(createAnimatedValue(e?1:0)).current;return useEffect(()=>{const n=Animated.timing(s,{toValue:e?1:0,duration:t?0:o.motion.duration.default,easing:Easing.bezier(...o.motion.ease["in-out"]),useNativeDriver:!1});return n.start(),()=>n.stop()},[e,t,s,o]),_jsx(Animated.View,{style:{width:s.interpolate({inputRange:[0,1],outputRange:[8,24]}),height:8,marginHorizontal:o.space.xs,borderRadius:4,...smoothCorners,backgroundColor:s.interpolate({inputRange:[0,1],outputRange:[o.colors.border,o.colors.primary]})}})},controlStyles=StyleSheet.create({control:{alignSelf:"center",height:44,minWidth:88,alignItems:"center",justifyContent:"center"},dots:{flexDirection:"row",alignItems:"center"},back:{position:"absolute",top:0,bottom:0,start:0,width:"50%"},forward:{position:"absolute",top:0,bottom:0,end:0,width:"50%"}}),buildStyles=e=>StyleSheet.create({root:{flex:1,backgroundColor:e.colors.bg},skipRow:{minHeight:44,paddingHorizontal:e.space.lg,alignItems:"flex-end",justifyContent:"center"},carousel:{flex:1},page:{flex:1},pageContent:{flexGrow:1,justifyContent:"center",paddingHorizontal:e.space.xl,paddingVertical:e.space.lg},pageGroup:{alignItems:"stretch",gap:e.space.md},art:{alignItems:"center",alignSelf:"stretch",marginBottom:e.space.xl},footer:{paddingHorizontal:e.space.lg,paddingBottom:e.space.lg,gap:e.space.sm}});export{OnboardingPager};export default OnboardingPager;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_ONBOARDING_PAGER_LABELS,default,OnboardingPager}from"./OnboardingPager.js";
1
+ "use strict";export{default,OnboardingPager}from"./OnboardingPager.js";
@@ -1 +1 @@
1
- "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Dimensions,FlatList,Pressable,StatusBar,StyleSheet,TextInput,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useNativeGesture}from"react-native-gesture-handler";import{useKeyboardState}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useDragToDismiss}from"../../hooks/useDragToDismiss.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{selectOptionAction,selectOptionDescription,selectOptionDisabled,selectOptionIcon,selectOptionLabel,selectOptionValue}from"./optionAccessors.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const SEARCH_ICON_SIZE=18;export const DEFAULT_OPTION_SHEET_LABELS=Object.freeze({searchPlaceholder:"Search…",empty:"No options",done:"Done",closePicker:"Close picker",fallbackName:"Options",searchOptions:"Search options",clearSearch:"Clear search",jumpToLetter:"Jump to letter",jumpTo:e=>`Jump to ${e}`});const hostStyle=StyleSheet.create({host:{padding:0,paddingTop:0,paddingHorizontal:0,paddingBottom:0,backgroundColor:"transparent",borderTopLeftRadius:0,borderTopRightRadius:0,shadowOpacity:0,elevation:0}}).host;function OptionSheetPanel(e){const{onClose:t,title:o,options:s,sections:i,renderSectionHeader:r,renderOption:l,alphabetIndex:n=!1,labels:a,getOptionLabel:c,getOptionValue:d,getOptionDescription:p,isOptionDisabled:u,getOptionIcon:h,destructiveOf:m,getOptionAction:g,value:b,onChange:x,multi:y=!1,searchable:f=!1,searchSelectionColor:S,accessibilityLabel:T,optionStyle:j,selectedOptionStyle:w,optionTextStyle:C,selectedOptionTextStyle:_,testID:k}=e,L=c??selectOptionLabel,O=d??selectOptionValue,I=p??selectOptionDescription,R=u??selectOptionDisabled,V=h??selectOptionIcon,D=g??selectOptionAction,v=useTheme(),P=useSafeAreaInsets(),H=useMemo(()=>buildStyles(v),[v]),[M,A]=useState(""),B=Dimensions.get("window").height,z=Math.round(.7*B),E=useRef(createAnimatedValue(0)).current,{handleGesture:F,opacity:W}=useDragToDismiss({drag:E,travel:z,onDismiss:t}),N=useNativeGesture(),G=useKeyboardState(e=>e.height),U=Math.max(0,Math.round(G)),$=Math.max(P.top,StatusBar.currentHeight??0)+v.space.sm,J=U>0,K=J?Math.max(0,Math.min(z,B-U-$)):z,Y=useMemo(()=>{const e=f?M.trim().toLowerCase():"",matches=t=>0===e.length||L(t).toLowerCase().includes(e)||(I(t)??"").toLowerCase().includes(e);if(!i)return s.filter(matches).map(e=>({kind:"option",option:e}));const t=[];return i.forEach((e,o)=>{const s=e.options.filter(matches);if(0!==s.length){t.push({kind:"header",title:e.title});for(const e of s)t.push({kind:"option",option:e,section:o})}}),t},[f,M,s,i,L,I]),Z=useCallback(()=>{t()},[t]),Q=useRef(null),X=useMemo(()=>{const e=new Map;if(!n)return e;let t=0;if(i)for(const[e,o]of Y.entries())"header"===o.kind&&(t=e+1);for(const[o,s]of Y.entries()){if(o<t||"option"!==s.kind)continue;const i=L(s.option).trim().charAt(0).toUpperCase(),r=/^[A-Z]$/.test(i)?i:"#";e.has(r)||e.set(r,o)}return e},[n,Y,i,L]),q=n&&X.size>0&&0===M.trim().length,ee=useMemo(()=>[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ",...X.has("#")?["#"]:[]],[X]),te=useCallback(e=>{const t=X.get(e);void 0!==t&&Q.current?.scrollToIndex({index:t,animated:!0,viewPosition:0})},[X]),oe=useRef(null),se=useCallback(()=>{null!==oe.current&&(clearTimeout(oe.current),oe.current=null)},[]),ie=useCallback(e=>{Q.current?.scrollToOffset({offset:e.averageItemLength*e.index,animated:!1}),se(),oe.current=setTimeout(()=>{oe.current=null,Q.current?.scrollToIndex({index:e.index,animated:!0,viewPosition:0})},50)},[se]);useEffect(()=>se,[se]);return _jsx(GestureHandlerRootView,{style:H.gestureRoot,children:_jsxs(Animated.View,{testID:k,accessibilityViewIsModal:!0,accessibilityLabel:T??o??a.fallbackName,style:[H.sheet,{maxHeight:K,marginBottom:U,paddingBottom:J?v.space.lg:P.bottom+v.space.lg,backgroundColor:v.colors.surface,borderTopLeftRadius:v.radius.xl,borderTopRightRadius:v.radius.xl,...smoothCorners,opacity:W,transform:[{translateY:E}],...v.shadow.modal}],children:[_jsx(GestureDetector,{gesture:F,children:_jsxs(View,{children:[_jsx(View,{style:H.sheetHandleRow,children:_jsx(View,{style:[H.sheetHandle,{backgroundColor:v.colors.border}]})}),o?_jsx(Text,{variant:"title",style:[H.sheetTitle,{paddingHorizontal:v.space.lg,marginBottom:v.space.sm}],children:o}):null]})}),f?_jsx(View,{style:[H.searchWrap,{marginHorizontal:v.space.lg,marginBottom:v.space.sm}],children:_jsxs(View,{style:[H.searchBox,{backgroundColor:v.colors["bg-subtle"],borderColor:v.colors.border,borderRadius:v.radius.md,...smoothCorners,paddingHorizontal:v.space.md,gap:v.space.sm}],children:[(v.settings.icons.search??defaultIcons.search)({size:18,color:v.colors["text-subtle"]}),_jsx(TextInput,{value:M,onChangeText:A,placeholder:a.searchPlaceholder,placeholderTextColor:v.colors["text-subtle"],selectionColor:S??v.colors["focus-ring"],accessibilityLabel:a.searchOptions,style:[H.searchInput,{color:v.colors["text-body"],fontSize:v.text.base.size,paddingVertical:v.space.sm}]}),M.length>0?_jsx(Pressable,{onPress:()=>A(""),hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:a.clearSearch,children:(v.settings.icons.close??defaultIcons.close)({size:18,color:v.colors["text-muted"]})}):null]})}):null,_jsxs(View,{style:[H.listWrap,q?H.listRow:null],children:[_jsx(GestureDetector,{gesture:N,children:_jsx(FlatList,{ref:Q,data:Y,keyExtractor:e=>"header"===e.kind?`h:${e.title}`:`o:${e.section??""}:${String(O(e.option))}`,renderItem:({item:e,index:t})=>{if("header"===e.kind)return _jsx(View,{accessible:!0,accessibilityRole:"header",style:[H.sectionHeader,{paddingHorizontal:v.space.lg,paddingTop:v.space.md}],children:r?r(e.title):_jsx(Text,{variant:"caption",weight:"semibold",color:"tertiary",style:H.sectionTitle,children:e.title.toUpperCase()})});const o=e.option,s=L(o),i=O(o),n=I(o),a=V(o),c=(d=i,Array.isArray(b)?b.some(e=>String(e)===String(d)):null!=b&&String(b)===String(d));var d;const p=R(o),u=m?.(o)??!1,h=D(o);return _jsxs(Pressable,{onPress:()=>{if(h)return h(),void Z();x(i,o)},disabled:p,android_ripple:{color:v.colors["surface-pressed"],borderless:!1},accessibilityRole:"button",accessibilityLabel:s,accessibilityState:{selected:c,disabled:p},"aria-selected":c,"aria-disabled":p,style:({pressed:e})=>[H.optionRow,{backgroundColor:c?v.colors["surface-selected"]:e?v.colors["surface-pressed"]:"transparent",opacity:p?.5:1,paddingHorizontal:v.space.lg,paddingVertical:v.space.md},j,c?w:null],children:[l?_jsx(View,{style:H.optionTextWrap,children:l({option:o,selected:c,disabled:p,index:t})}):_jsxs(_Fragment,{children:[a?_jsx(View,{style:H.optionIcon,children:a}):null,_jsxs(View,{style:H.optionTextWrap,children:[_jsx(Text,{variant:"body",weight:c?"semibold":"medium",color:u?"danger":c?"brand":void 0,style:[H.optionLabel,C,c?_:null],children:s}),n?_jsx(Text,{variant:"bodySmall",color:"tertiary",numberOfLines:2,style:H.optionDescription,children:n}):null]})]}),y?_jsx(View,{style:[H.checkbox,{borderColor:c?v.colors.primary:v.colors.border,backgroundColor:c?v.colors.primary:"transparent"}],children:c?_jsx(View,{style:H.checkboxTick}):null}):c?"icon"===v.settings.components["option-sheet"]?.selectedMarker?_jsx(View,{style:H.singleSelectedIcon,children:(v.settings.icons.selectedTick??defaultIcons.selectedTick)({size:20,color:v.colors.primary})}):_jsx(View,{style:[H.singleSelectedDot,{backgroundColor:v.colors.primary}]}):null]})},onScrollToIndexFailed:ie,overScrollMode:"never",bounces:!1,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!q,style:q?H.listBesideRail:null,ListEmptyComponent:_jsx(Text,{variant:"bodySmall",color:"tertiary",align:"center",style:{paddingVertical:v.space.xl},children:a.empty})})}),q?_jsx(View,{style:[H.rail,{paddingRight:v.space.xs}],accessibilityRole:"list",accessibilityLabel:a.jumpToLetter,testID:"option-sheet-alphabet",children:ee.map(e=>{const t=X.has(e);return _jsx(Pressable,{onPress:()=>te(e),disabled:!t,hitSlop:{left:8,right:8},...hitSlopMarker({left:8,right:8}),accessibilityRole:"button",accessibilityLabel:a.jumpTo(e),accessibilityState:{disabled:!t},"aria-disabled":!t,style:H.railLetter,children:_jsx(Text,{variant:"caption",weight:"semibold",color:t?"brand":"tertiary",style:[H.railLetterText,{opacity:t?1:.45}],children:e})},e)})}):null]}),y?_jsx(View,{style:[H.sheetFooter,{borderTopColor:v.colors["border-subtle"],paddingHorizontal:v.space.lg,paddingVertical:v.space.md}],children:_jsx(Pressable,{onPress:Z,accessibilityRole:"button",accessibilityLabel:a.done,style:({pressed:e})=>[H.doneButton,{backgroundColor:e?v.colors["primary-pressed"]:v.colors.primary,borderRadius:v.radius.md,...smoothCorners,paddingVertical:v.space.sm,paddingHorizontal:v.space.lg}],children:_jsx(Text,{variant:"body",weight:"semibold",style:{color:v.colors["on-primary"]},children:a.done})})}):null]})})}export function OptionSheet(e){const{open:t,onOpenChange:o,onAfterClose:s,labels:i,onClose:r,haptic:l,...n}=e,a=useMemo(()=>({...DEFAULT_OPTION_SHEET_LABELS,...i}),[i]),c=useRef(o);c.current=o;const d=useRef(!1);return useEffect(()=>{d.current!==t&&(d.current=t,c.current?.(t))},[t]),_jsx(Modal,{open:t,onClose:r,presentation:"bottom",onDismissed:s,haptic:l,contentStyle:hostStyle,labels:{close:a.closePicker},accessibilityLabel:n.accessibilityLabel??n.title??a.fallbackName,children:_jsx(OptionSheetPanel,{...n,onClose:r,labels:a})})}OptionSheet.displayName="OptionSheet";const buildStyles=e=>StyleSheet.create({gestureRoot:{width:"100%"},sheet:{paddingBottom:e.space.lg,overflow:"hidden"},sheetHandleRow:{alignItems:"center",paddingTop:e.space.sm,paddingBottom:e.space.sm},sheetHandle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},sheetTitle:{includeFontPadding:!1},searchWrap:{width:"auto"},searchBox:{flexDirection:"row",alignItems:"center",borderWidth:1},searchInput:{flex:1,includeFontPadding:!1},optionRow:{flexDirection:"row",alignItems:"center"},sectionHeader:{paddingBottom:e.space.xs},listWrap:{flexShrink:1},listRow:{flexDirection:"row"},listBesideRail:{flex:1},rail:{justifyContent:"space-between",alignItems:"center",alignSelf:"stretch",paddingVertical:e.space.xs},railLetter:{paddingHorizontal:e.space.xs,minHeight:14,justifyContent:"center"},railLetterText:{includeFontPadding:!1,lineHeight:Math.round(e.text.xs.size*e.leading.heading)},sectionTitle:{includeFontPadding:!1,letterSpacing:.6},optionIcon:{marginRight:e.space.md},optionTextWrap:{flex:1},optionLabel:{includeFontPadding:!1},optionDescription:{includeFontPadding:!1,marginTop:e.space.xxs},checkbox:{width:22,height:22,borderRadius:e.radius.sm,...smoothCorners,borderWidth:2,alignItems:"center",justifyContent:"center",marginLeft:e.space.md},checkboxTick:{width:10,height:6,borderLeftWidth:2,borderBottomWidth:2,borderColor:e.colors["on-primary"],transform:[{rotate:"-45deg"},{translateY:-1}]},singleSelectedDot:{width:8,height:8,borderRadius:e.radius.pill,...smoothCorners,marginLeft:e.space.md},singleSelectedIcon:{marginLeft:e.space.md},sheetFooter:{borderTopWidth:StyleSheet.hairlineWidth,alignItems:"flex-end"},doneButton:{alignSelf:"flex-end"}});export default OptionSheet;
1
+ "use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Dimensions,FlatList,Pressable,StatusBar,StyleSheet,TextInput,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useNativeGesture}from"react-native-gesture-handler";import{useKeyboardState}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useDragToDismiss}from"../../hooks/useDragToDismiss.js";import{fillText,useMobileUiText}from"../../text/index.js";import{OPTION_SHEET_TEXT}from"../../text/phone/optionSheet.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{selectOptionAction,selectOptionDescription,selectOptionDisabled,selectOptionIcon,selectOptionLabel,selectOptionValue}from"./optionAccessors.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const SEARCH_ICON_SIZE=18,hostStyle=StyleSheet.create({host:{padding:0,paddingTop:0,paddingHorizontal:0,paddingBottom:0,backgroundColor:"transparent",borderTopLeftRadius:0,borderTopRightRadius:0,shadowOpacity:0,elevation:0}}).host;function OptionSheetPanel(e){const{onClose:t,title:o,options:s,sections:i,renderSectionHeader:r,renderOption:l,alphabetIndex:n=!1,labels:a,getOptionLabel:c,getOptionValue:d,getOptionDescription:p,isOptionDisabled:u,getOptionIcon:h,destructiveOf:m,getOptionAction:g,value:b,onChange:x,multi:f=!1,searchable:y=!1,searchSelectionColor:S,accessibilityLabel:T,optionStyle:j,selectedOptionStyle:w,optionTextStyle:C,selectedOptionTextStyle:_,testID:I}=e,k=c??selectOptionLabel,O=d??selectOptionValue,R=p??selectOptionDescription,L=u??selectOptionDisabled,V=h??selectOptionIcon,D=g??selectOptionAction,v=useTheme(),H=useSafeAreaInsets(),M=useMemo(()=>buildStyles(v),[v]),[P,A]=useState(""),B=Dimensions.get("window").height,z=Math.round(.7*B),E=useRef(createAnimatedValue(0)).current,{handleGesture:F,opacity:W}=useDragToDismiss({drag:E,travel:z,onDismiss:t,testID:I}),G=useNativeGesture(),N=useKeyboardState(e=>e.height),U=Math.max(0,Math.round(N)),$=Math.max(H.top,StatusBar.currentHeight??0)+v.space.sm,K=U>0,X=K?Math.max(0,Math.min(z,B-U-$)):z,Y=useMemo(()=>{const e=y?P.trim().toLowerCase():"",matches=t=>0===e.length||k(t).toLowerCase().includes(e)||(R(t)??"").toLowerCase().includes(e);if(!i)return s.filter(matches).map(e=>({kind:"option",option:e}));const t=[];return i.forEach((e,o)=>{const s=e.options.filter(matches);if(0!==s.length){t.push({kind:"header",title:e.title});for(const e of s)t.push({kind:"option",option:e,section:o})}}),t},[y,P,s,i,k,R]),Z=useCallback(()=>{t()},[t]),J=useRef(null),Q=useMemo(()=>{const e=new Map;if(!n)return e;let t=0;if(i)for(const[e,o]of Y.entries())"header"===o.kind&&(t=e+1);for(const[o,s]of Y.entries()){if(o<t||"option"!==s.kind)continue;const i=k(s.option).trim().charAt(0).toUpperCase(),r=/^[A-Z]$/.test(i)?i:"#";e.has(r)||e.set(r,o)}return e},[n,Y,i,k]),q=n&&Q.size>0&&0===P.trim().length,ee=useMemo(()=>[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ",...Q.has("#")?["#"]:[]],[Q]),te=useCallback(e=>{const t=Q.get(e);void 0!==t&&J.current?.scrollToIndex({index:t,animated:!0,viewPosition:0})},[Q]),oe=useRef(null),se=useCallback(()=>{null!==oe.current&&(clearTimeout(oe.current),oe.current=null)},[]),ie=useCallback(e=>{J.current?.scrollToOffset({offset:e.averageItemLength*e.index,animated:!1}),se(),oe.current=setTimeout(()=>{oe.current=null,J.current?.scrollToIndex({index:e.index,animated:!0,viewPosition:0})},50)},[se]);useEffect(()=>se,[se]);return _jsx(GestureHandlerRootView,{style:M.gestureRoot,children:_jsxs(Animated.View,{testID:I,accessibilityViewIsModal:!0,accessibilityLabel:T??o??a.fallbackName,style:[M.sheet,{maxHeight:X,marginBottom:U,paddingBottom:K?v.space.lg:H.bottom+v.space.lg,backgroundColor:v.colors.surface,borderTopLeftRadius:v.radius.xl,borderTopRightRadius:v.radius.xl,...smoothCorners,opacity:W,transform:[{translateY:E}],...v.shadow.modal}],children:[_jsx(GestureDetector,{gesture:F,children:_jsxs(View,{children:[_jsx(View,{style:M.sheetHandleRow,children:_jsx(View,{style:[M.sheetHandle,{backgroundColor:v.colors.border}]})}),o?_jsx(Text,{variant:"title",style:[M.sheetTitle,{paddingHorizontal:v.space.lg,marginBottom:v.space.sm}],children:o}):null]})}),y?_jsx(View,{style:[M.searchWrap,{marginHorizontal:v.space.lg,marginBottom:v.space.sm}],children:_jsxs(View,{style:[M.searchBox,{backgroundColor:v.colors["bg-subtle"],borderColor:v.colors.border,borderRadius:v.radius.md,...smoothCorners,paddingHorizontal:v.space.md,gap:v.space.sm}],children:[(v.settings.icons.search??defaultIcons.search)({size:18,color:v.colors["text-subtle"]}),_jsx(TextInput,{value:P,onChangeText:A,placeholder:a.searchPlaceholder,placeholderTextColor:v.colors["text-subtle"],selectionColor:S??v.colors["focus-ring"],accessibilityLabel:a.searchOptions,style:[M.searchInput,{color:v.colors["text-body"],fontSize:v.text.base.size,paddingVertical:v.space.sm}]}),P.length>0?_jsx(Pressable,{onPress:()=>A(""),hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:a.clearSearch,children:(v.settings.icons.close??defaultIcons.close)({size:18,color:v.colors["text-muted"]})}):null]})}):null,_jsxs(View,{style:[M.listWrap,q?M.listRow:null],children:[_jsx(GestureDetector,{gesture:G,children:_jsx(FlatList,{ref:J,data:Y,keyExtractor:e=>"header"===e.kind?`h:${e.title}`:`o:${e.section??""}:${String(O(e.option))}`,renderItem:({item:e,index:t})=>{if("header"===e.kind)return _jsx(View,{accessible:!0,accessibilityRole:"header",style:[M.sectionHeader,{paddingHorizontal:v.space.lg,paddingTop:v.space.md}],children:r?r(e.title):_jsx(Text,{variant:"caption",weight:"semibold",color:"tertiary",style:M.sectionTitle,children:e.title.toUpperCase()})});const o=e.option,s=k(o),i=O(o),n=R(o),a=V(o),c=(d=i,Array.isArray(b)?b.some(e=>String(e)===String(d)):null!=b&&String(b)===String(d));var d;const p=L(o),u=m?.(o)??!1,h=D(o);return _jsxs(Pressable,{onPress:()=>{if(h)return h(),void Z();x(i,o)},disabled:p,android_ripple:{color:v.colors["surface-pressed"],borderless:!1},accessibilityRole:"button",accessibilityLabel:s,accessibilityState:{selected:c,disabled:p},"aria-selected":c,"aria-disabled":p,style:({pressed:e})=>[M.optionRow,{backgroundColor:c?v.colors["surface-selected"]:e?v.colors["surface-pressed"]:"transparent",opacity:p?.5:1,paddingHorizontal:v.space.lg,paddingVertical:v.space.md},j,c?w:null],children:[l?_jsx(View,{style:M.optionTextWrap,children:l({option:o,selected:c,disabled:p,index:t})}):_jsxs(_Fragment,{children:[a?_jsx(View,{style:M.optionIcon,children:a}):null,_jsxs(View,{style:M.optionTextWrap,children:[_jsx(Text,{variant:"body",weight:c?"semibold":"medium",color:u?"danger":c?"brand":void 0,style:[M.optionLabel,C,c?_:null],children:s}),n?_jsx(Text,{variant:"bodySmall",color:"tertiary",numberOfLines:2,style:M.optionDescription,children:n}):null]})]}),f?_jsx(View,{style:[M.checkbox,{borderColor:c?v.colors.primary:v.colors.border,backgroundColor:c?v.colors.primary:"transparent"}],children:c?_jsx(View,{style:M.checkboxTick}):null}):c?"icon"===v.settings.components["option-sheet"]?.selectedMarker?_jsx(View,{style:M.singleSelectedIcon,children:(v.settings.icons.selectedTick??defaultIcons.selectedTick)({size:20,color:v.colors.primary})}):_jsx(View,{style:[M.singleSelectedDot,{backgroundColor:v.colors.primary}]}):null]})},onScrollToIndexFailed:ie,overScrollMode:"never",bounces:!1,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:!q,style:q?M.listBesideRail:null,ListEmptyComponent:_jsx(Text,{variant:"bodySmall",color:"tertiary",align:"center",style:{paddingVertical:v.space.xl},children:a.empty})})}),q?_jsx(View,{style:[M.rail,{paddingRight:v.space.xs}],accessibilityRole:"list",accessibilityLabel:a.jumpToLetter,testID:"option-sheet-alphabet",children:ee.map(e=>{const t=Q.has(e);return _jsx(Pressable,{onPress:()=>te(e),disabled:!t,hitSlop:{left:8,right:8},...hitSlopMarker({left:8,right:8}),accessibilityRole:"button",accessibilityLabel:fillText(a.jumpTo,{letter:e}),accessibilityState:{disabled:!t},"aria-disabled":!t,style:M.railLetter,children:_jsx(Text,{variant:"caption",weight:"semibold",color:t?"brand":"tertiary",style:[M.railLetterText,{opacity:t?1:.45}],children:e})},e)})}):null]}),f?_jsx(View,{style:[M.sheetFooter,{borderTopColor:v.colors["border-subtle"],paddingHorizontal:v.space.lg,paddingVertical:v.space.md}],children:_jsx(Pressable,{onPress:Z,accessibilityRole:"button",accessibilityLabel:a.done,style:({pressed:e})=>[M.doneButton,{backgroundColor:e?v.colors["primary-pressed"]:v.colors.primary,borderRadius:v.radius.md,...smoothCorners,paddingVertical:v.space.sm,paddingHorizontal:v.space.lg}],children:_jsx(Text,{variant:"body",weight:"semibold",style:{color:v.colors["on-primary"]},children:a.done})})}):null]})})}export function OptionSheet(e){const{open:t,onOpenChange:o,onAfterClose:s,labels:i,onClose:r,haptic:l,...n}=e,a=useMobileUiText("optionSheet",OPTION_SHEET_TEXT),c=useMemo(()=>({...a,...i}),[a,i]),d=useRef(o);d.current=o;const p=useRef(!1);return useEffect(()=>{p.current!==t&&(p.current=t,d.current?.(t))},[t]),_jsx(Modal,{open:t,onClose:r,presentation:"bottom",onDismissed:s,haptic:l,contentStyle:hostStyle,labels:{close:c.closePicker},accessibilityLabel:n.accessibilityLabel??n.title??c.fallbackName,children:_jsx(OptionSheetPanel,{...n,onClose:r,labels:c})})}OptionSheet.displayName="OptionSheet";const buildStyles=e=>StyleSheet.create({gestureRoot:{width:"100%"},sheet:{paddingBottom:e.space.lg,overflow:"hidden"},sheetHandleRow:{alignItems:"center",paddingTop:e.space.sm,paddingBottom:e.space.sm},sheetHandle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},sheetTitle:{includeFontPadding:!1},searchWrap:{width:"auto"},searchBox:{flexDirection:"row",alignItems:"center",borderWidth:1},searchInput:{flex:1,includeFontPadding:!1},optionRow:{flexDirection:"row",alignItems:"center"},sectionHeader:{paddingBottom:e.space.xs},listWrap:{flexShrink:1},listRow:{flexDirection:"row"},listBesideRail:{flex:1},rail:{justifyContent:"space-between",alignItems:"center",alignSelf:"stretch",paddingVertical:e.space.xs},railLetter:{paddingHorizontal:e.space.xs,minHeight:14,justifyContent:"center"},railLetterText:{includeFontPadding:!1,lineHeight:Math.round(e.text.xs.size*e.leading.heading)},sectionTitle:{includeFontPadding:!1,letterSpacing:.6},optionIcon:{marginRight:e.space.md},optionTextWrap:{flex:1},optionLabel:{includeFontPadding:!1},optionDescription:{includeFontPadding:!1,marginTop:e.space.xxs},checkbox:{width:22,height:22,borderRadius:e.radius.sm,...smoothCorners,borderWidth:2,alignItems:"center",justifyContent:"center",marginLeft:e.space.md},checkboxTick:{width:10,height:6,borderLeftWidth:2,borderBottomWidth:2,borderColor:e.colors["on-primary"],transform:[{rotate:"-45deg"},{translateY:-1}]},singleSelectedDot:{width:8,height:8,borderRadius:e.radius.pill,...smoothCorners,marginLeft:e.space.md},singleSelectedIcon:{marginLeft:e.space.md},sheetFooter:{borderTopWidth:StyleSheet.hairlineWidth,alignItems:"flex-end"},doneButton:{alignSelf:"flex-end"}});export default OptionSheet;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_OPTION_SHEET_LABELS,default,OptionSheet}from"./OptionSheet.js";
1
+ "use strict";export{default,OptionSheet}from"./OptionSheet.js";
@@ -1 +1 @@
1
- "use strict";import{useMemo}from"react";import{View}from"react-native";import{makeStyles}from"../../theme/index.js";import{Button}from"../Button/index.js";import{Spinner}from"../Spinner/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const useStyles=makeStyles(e=>({root:{alignItems:"center",flexDirection:"row",gap:e.space.sm,justifyContent:"center",paddingVertical:e.space.md}}));export const DEFAULT_PAGED_LIST_FOOTER_LABELS=Object.freeze({loadingMore:"Loading more",retry:"Try again",failed:"Could not load more"});export function PagedListFooter({paging:e,labels:t,testID:r}){const o=useStyles(),s=useMemo(()=>({...DEFAULT_PAGED_LIST_FOOTER_LABELS,...t}),[t]);return e.errorMore?_jsxs(View,{style:o.root,accessibilityLiveRegion:"polite",testID:r,children:[_jsx(Text,{variant:"caption",color:"danger",children:s.failed}),_jsx(Button,{label:s.retry,variant:"ghost",size:"sm",onPress:e.retryMore,testID:r?`${r}-retry`:void 0})]}):e.loadingMore?_jsx(View,{style:o.root,testID:r,children:_jsx(Spinner,{size:"sm",accessibilityLabel:s.loadingMore})}):null}
1
+ "use strict";import{useMemo}from"react";import{View}from"react-native";import{useMobileUiText}from"../../text/index.js";import{PAGED_LIST_FOOTER_TEXT}from"../../text/phone/pagedListFooter.g.js";import{makeStyles}from"../../theme/index.js";import{Button}from"../Button/index.js";import{Spinner}from"../Spinner/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const useStyles=makeStyles(e=>({root:{alignItems:"center",flexDirection:"row",gap:e.space.sm,justifyContent:"center",paddingVertical:e.space.md}}));export function PagedListFooter({paging:e,labels:t,testID:r}){const s=useStyles(),o=useMobileUiText("pagedListFooter",PAGED_LIST_FOOTER_TEXT),i=useMemo(()=>({...o,...t}),[o,t]);return e.errorMore?_jsxs(View,{style:s.root,accessibilityLiveRegion:"polite",testID:r,children:[_jsx(Text,{variant:"caption",color:"danger",children:i.failed}),_jsx(Button,{label:i.retry,variant:"ghost",size:"sm",onPress:e.retryMore,testID:r?`${r}-retry`:void 0})]}):e.loadingMore?_jsx(View,{style:s.root,testID:r,children:_jsx(Spinner,{size:"sm",accessibilityLabel:i.loadingMore})}):null}
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_PAGED_LIST_FOOTER_LABELS,PagedListFooter}from"./PagedListFooter.js";
1
+ "use strict";export{PagedListFooter}from"./PagedListFooter.js";