@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{useEffect,useMemo,useRef}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{Button}from"../Button/index.js";import{IconBadge}from"../IconBadge/index.js";import{Text}from"../Text/index.js";import{usePermissionPrompt}from"./usePermissionPrompt.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PERMISSION_PROMPT_LABELS=Object.freeze({proceed:"Continue",cancel:"Cancel",openSettings:"Open Settings",access:Object.freeze({camera:"Camera access",microphone:"Microphone access",photos:"Photo access",photosAdd:"Photo access",mediaLibrary:"Media library access",location:"Location access",locationAlways:"Location access",contacts:"Contacts access",calendar:"Calendar access",reminders:"Reminders access",notifications:"Notification access",bluetooth:"Bluetooth access",storage:"Storage access"}),notAvailable:e=>`${e} is not available on this device.`,offWithSettings:e=>`${e} is off for this app. You can turn it on in Settings.`,off:e=>`${e} is off, so this cannot be used right now.`});const unavailableMessage=(e,s,t,n)=>{const a=n.access[e];return"unavailable"===s?n.notAvailable(a):t?n.offWithSettings(a):n.off(a)};export const PermissionPrompt=e=>{const{kind:s,title:t,reason:n,icon:a,onResult:i,fallback:o,haptic:c="selection",labels:l,style:r,testID:u}=e;assertValidValue("PermissionPrompt","kind",s,Object.keys(DEFAULT_PERMISSION_PROMPT_LABELS.access));const m=l?{...DEFAULT_PERMISSION_PROMPT_LABELS,...l}:DEFAULT_PERMISSION_PROMPT_LABELS,p=useTheme(),d=useMemo(()=>buildStyles(p),[p]),h=usePermissionPrompt(s,{onResult:i}),f=unavailableMessage(s,h.status,h.showSettings,m),g=useRef(!1);if(useEffect(()=>{"explain"!==h.view?("unavailable"===h.view&&g.current&&announce(f),g.current=!1):g.current=!0},[h.view,f]),"explain"!==h.view&&"unavailable"!==h.view)return _jsx(View,{style:r,testID:u});const x="explain"===h.view;return _jsxs(View,{style:[d.root,r],testID:u,children:[_jsxs(View,{style:d.header,children:[a?_jsx(IconBadge,{icon:a,size:"lg",tone:x?"primary":"neutral"}):null,_jsx(Text,{variant:"h3",align:"center",children:t}),_jsx(Text,{variant:"body",color:"secondary",align:"center",children:x?n:f})]}),_jsxs(View,x?{style:d.actions,children:[_jsx(Button,{haptic:c,label:m.proceed,size:"lg",fullWidth:!0,loading:h.requesting,onPress:()=>{h.request()}}),h.cancellable?_jsx(Button,{haptic:c,label:m.cancel,size:"lg",fullWidth:!0,variant:"ghost",tone:"neutral",disabled:h.requesting,onPress:h.cancel}):null]}:{style:d.actions,children:[o?_jsx(Button,{haptic:c,label:o.label,size:"lg",fullWidth:!0,onPress:o.onPress}):null,h.showSettings?_jsx(View,{style:d.link,children:_jsx(Button,{haptic:c,label:m.openSettings,variant:"link",onPress:()=>{h.openSettings()}})}):null]})]})};const buildStyles=e=>StyleSheet.create({root:{gap:e.space.lg,paddingVertical:e.space.lg},header:{alignItems:"center",gap:e.space.sm},actions:{gap:e.space.sm},link:{alignItems:"center",paddingVertical:e.space.sm}});export default PermissionPrompt;
1
+ "use strict";import{useEffect,useMemo,useRef}from"react";import{StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{PERMISSION_PROMPT_TEXT}from"../../text/phone/permissionPrompt.g.js";import{useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{Button}from"../Button/index.js";import{IconBadge}from"../IconBadge/index.js";import{Text}from"../Text/index.js";import{usePermissionPrompt}from"./usePermissionPrompt.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ACCESS_TEXT_KEY={camera:"accessCamera",microphone:"accessMicrophone",photos:"accessPhotos",photosAdd:"accessPhotos",mediaLibrary:"accessMediaLibrary",location:"accessLocation",locationAlways:"accessLocation",contacts:"accessContacts",calendar:"accessCalendar",reminders:"accessReminders",notifications:"accessNotifications",bluetooth:"accessBluetooth",storage:"accessStorage"},unavailableMessage=(e,s,t,i)=>{const a=i[ACCESS_TEXT_KEY[e]];return fillText("unavailable"===s?i.notAvailable:t?i.offWithSettings:i.off,{access:a})};export const PermissionPrompt=e=>{const{kind:s,title:t,reason:i,icon:a,onResult:n,fallback:o,haptic:r="selection",labels:l,style:c,testID:u}=e;assertValidValue("PermissionPrompt","kind",s,Object.keys(ACCESS_TEXT_KEY));const m=useMobileUiText("permissionPrompt",PERMISSION_PROMPT_TEXT),p=useMemo(()=>({...m,...l}),[m,l]),d=useTheme(),x=useMemo(()=>buildStyles(d),[d]),h=usePermissionPrompt(s,{onResult:n}),f=unavailableMessage(s,h.status,h.showSettings,p),g=useRef(!1);if(useEffect(()=>{"explain"!==h.view?("unavailable"===h.view&&g.current&&announce(f),g.current=!1):g.current=!0},[h.view,f]),"explain"!==h.view&&"unavailable"!==h.view)return _jsx(View,{style:c,testID:u});const j="explain"===h.view;return _jsxs(View,{style:[x.root,c],testID:u,children:[_jsxs(View,{style:x.header,children:[a?_jsx(IconBadge,{icon:a,size:"lg",tone:j?"primary":"neutral"}):null,_jsx(Text,{variant:"h3",align:"center",children:t}),_jsx(Text,{variant:"body",color:"secondary",align:"center",children:j?i:f})]}),_jsxs(View,j?{style:x.actions,children:[_jsx(Button,{haptic:r,label:p.proceed,size:"lg",fullWidth:!0,loading:h.requesting,onPress:()=>{h.request()}}),h.cancellable?_jsx(Button,{haptic:r,label:p.cancel,size:"lg",fullWidth:!0,variant:"ghost",tone:"neutral",disabled:h.requesting,onPress:h.cancel}):null]}:{style:x.actions,children:[o?_jsx(Button,{haptic:r,label:o.label,size:"lg",fullWidth:!0,onPress:o.onPress}):null,h.showSettings?_jsx(View,{style:x.link,children:_jsx(Button,{haptic:r,label:p.openSettings,variant:"link",onPress:()=>{h.openSettings()}})}):null]})]})};const buildStyles=e=>StyleSheet.create({root:{gap:e.space.lg,paddingVertical:e.space.lg},header:{alignItems:"center",gap:e.space.sm},actions:{gap:e.space.sm},link:{alignItems:"center",paddingVertical:e.space.sm}});export default PermissionPrompt;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_PERMISSION_PROMPT_LABELS,default,PermissionPrompt}from"./PermissionPrompt.js";export{usePermissionPrompt}from"./usePermissionPrompt.js";
1
+ "use strict";export{default,PermissionPrompt}from"./PermissionPrompt.js";export{usePermissionPrompt}from"./usePermissionPrompt.js";
@@ -1 +1 @@
1
- "use strict";import{countryFlagEmoji,formatPhoneAsTyped,getFormatterConfig,getPhoneCountries,isSupportedCountry,isValidNationalNumber,maxNationalNumberLength,splitPhoneNumber}from"@webority/mobile-core";import{PHONE_COUNTRY_NAMES}from"@webority/mobile-core/phone/countries";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,RequiredPlaceholder,resolveFieldTextStyle}from"../FieldBase/index.js";import{Chevron}from"../FieldBase/Chevron.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PHONE_NUMBER_INPUT_LABELS=Object.freeze({placeholder:"Phone number",popular:"Popular",allCountries:"All countries",countrySheetTitle:"Country code",countrySearchPlaceholder:"Search…",invalid:"Enter a valid number",invalidMobile:"Enter a valid mobile number",countryButton:e=>`Country code, currently +${e}`});export const DEFAULT_CALLING_CODES=[{iso:"AU",code:"61",label:"Australia"},{iso:"CA",code:"1",label:"Canada"},{iso:"IN",code:"91",label:"India"},{iso:"SA",code:"966",label:"Saudi Arabia"},{iso:"SG",code:"65",label:"Singapore"},{iso:"AE",code:"971",label:"United Arab Emirates"},{iso:"GB",code:"44",label:"United Kingdom"},{iso:"US",code:"1",label:"United States"}];export const ALL_CALLING_CODES=getPhoneCountries().map(e=>({iso:e.iso,code:e.callingCode,label:PHONE_COUNTRY_NAMES[e.iso]??e.iso})).sort((e,t)=>e.label.localeCompare(t.label));const digitsOnly=e=>e.replace(/[^0-9]/g,"");export const formatE164=e=>`+${e.callingCode}${e.nationalNumber}`;export const parseE164=(e,t,o)=>{const i=e.replace(/[^0-9]/g,"");if(!i)return null;const n=splitPhoneNumber(`+${i}`);let l=n?.callingCode,r=n?.nationalNumber??"";if(!l){const e=Array.from(new Set(t.map(e=>e.code))).sort((e,t)=>t.length-e.length);if(l=e.find(e=>i.startsWith(e)),!l)return null;r=i.slice(l.length)}const a=t.filter(e=>e.code===l),s=a.find(e=>e.iso===o)?.iso??a.find(e=>e.iso===n?.country)?.iso??n?.country??a[0]?.iso??"";return{callingCode:l,nationalNumber:r,iso:s}};const planOf=e=>isSupportedCountry(e)?e:null,assertDefaultCountryVisible=(e,t)=>{if(void 0!==e&&!t.some(t=>t.iso===e))throw new RangeError(`PhoneNumberInput: defaultCountry "${e}" is not among the visible countries. Add it to countries, or remove it from hiddenCountries.`)};export const PhoneNumberInput=forwardRef((e,t)=>{const{value:o,defaultValue:i,onChange:n,e164:l,onChangeE164:r,returnKeyType:a,submitBehavior:s,onSubmitEditing:u,onComplete:d,onValidityChange:c,countries:p=ALL_CALLING_CODES,popularCountries:m,hiddenCountries:b,showFlag:f=!0,renderFlag:h,renderCountry:g,showAlphabetIndex:y,defaultCountry:N,validation:C="any",maxLength:x,formatAsYouType:S=!0,countryLocked:v=!1,label:E,labelMode:T="top",labelStyle:F,placeholder:P,helperText:I,error:L,invalidMessage:_,required:j,disabled:A=!1,size:O="md",variant:V,radius:M,labels:w,haptic:B,accessibilityLabel:D,countryAccessibilityLabel:U,onFocus:k,onBlur:z,style:R,testID:$}=e;assertValidValue("PhoneNumberInput","size",e.size,["sm","md","lg"]),assertValidValue("PhoneNumberInput","variant",e.variant,["outline","filled","underline"]),assertValidValue("PhoneNumberInput","labelMode",e.labelMode,["top","float"]),assertValidValue("PhoneNumberInput","validation",!1===e.validation?void 0:e.validation,["any","mobile"]);const H=useTheme(),W=useMemo(()=>buildStyles(H),[H]),q=useRef(null),G=useMemo(()=>w?{...DEFAULT_PHONE_NUMBER_INPUT_LABELS,...w}:DEFAULT_PHONE_NUMBER_INPUT_LABELS,[w]),Y=P??G.placeholder,K=useMemo(()=>/-([A-Za-z]{2})(?:-|$)/.exec(getFormatterConfig().locale)?.[1]?.toUpperCase(),[]),Z=useMemo(()=>b?.length?p.filter(e=>!b.includes(e.iso)):p,[p,b]),J=useMemo(()=>{if(!m?.length)return;const e=m.map(e=>Z.find(t=>t.iso===e)).filter(e=>void 0!==e);return e.length?[{title:G.popular,options:e},{title:G.allCountries,options:Z}]:void 0},[m,G.popular,G.allCountries,Z]),Q=useCallback((e,t,o)=>{if(!e)return null;if(h)return h(e);if(!f)return null;const i=countryFlagEmoji(e.iso);return i?_jsx(Text,{variant:"body",style:[W.flag,{fontSize:t}],testID:o,children:i}):null},[h,f,W.flag]),X=useCallback(e=>{const t=planOf(e),o=t?maxNationalNumberLength(t,!1===C?"any":C):Number.POSITIVE_INFINITY;return x?Math.min(o,x):o},[x,C]),ee=useCallback((e,t)=>e.slice(0,X(t)),[X]),te=useCallback((e,t)=>{const o=planOf(t)??void 0,i=splitPhoneNumber(e,o);if(!i)return null;const n=i.country??t,l=p.find(e=>e.iso===n);return{callingCode:l?.code??i.callingCode,nationalNumber:ee(i.nationalNumber,n),iso:l?.iso??n}},[p,ee]);useState(()=>assertDefaultCountryVisible(N,Z));const oe=useMemo(()=>{const e=Z.find(e=>e.iso===(N??K))??Z[0]??p[0],t={callingCode:e?.code??"",nationalNumber:"",iso:e?.iso??""};return"string"==typeof i?te(i,t.iso)??t:i??t},[p,Z,N,K,i,te]),ie=useCallback(e=>{if(!1===C)return e.nationalNumber.length>0;const t=planOf(e.iso);return t?isValidNationalNumber(e.nationalNumber,t,C):e.nationalNumber.length>0},[C]),[ne,le]=useState(oe.iso),re=useMemo(()=>{if(void 0===l)return;const e=l?parseE164(l,p,ne):null;if(e)return{...e,nationalNumber:ee(e.nationalNumber,e.iso)};const t=p.find(e=>e.iso===ne);return{callingCode:t?.code??oe.callingCode,nationalNumber:"",iso:ne}},[l,p,ne,oe.callingCode,ee]),ae=useCallback(e=>{le(e.iso),n?.(e),r?.(e.nationalNumber?formatE164(e):"",{country:p.find(t=>t.iso===e.iso),national:e.nationalNumber,valid:ie(e)})},[n,r,p,ie]),[se,ue]=useControllableState({value:o??re,defaultValue:oe,onChange:ae}),[de,ce]=useState(!1),pe=useCallback(()=>{A||q.current?.focus()},[A]),[me,be]=useState(!1),[fe,he]=useState(!1),[ge,ye]=useState(!1),Ne=useRef(!1);useEffect(()=>{ge||(Ne.current=!1)},[ge]);const Ce=resolveFieldSize(H,O),xe=resolveFieldTextStyle(H,{disabled:A}),Se=V??H.settings.components.field?.defaultVariant??"outline",ve="underline"===Se,Ee=H.space.md,[Te,Fe]=useState(0),Pe=Te+Ee+1+Ee,Ie=se.nationalNumber.length>0,Le=j&&!E&&!Ie&&Y.length>0,je=de||Ie,Ae=Boolean(E)&&"float"===T&&Te>0,Oe=useFloatingLabel({label:E,enabled:Ae,floated:je,required:j,variant:Se,sizeTokens:Ce,leadingOffset:Pe,paddingLeft:ve?H.space.none:Ce["padding-x"],color:H.colors["field-label"],style:F}),Ve=useMemo(()=>p.find(e=>e.iso===se.iso),[p,se.iso]),Me=planOf(se.iso),we=S&&Me?formatPhoneAsTyped(se.nationalNumber,Me):se.nationalNumber,Be=X(se.iso),De=0===se.nationalNumber.length||me||!Number.isFinite(Be)?void 0:we.length+Math.max(0,Be-se.nationalNumber.length),Ue=ie(se);useEffect(()=>{Ie||he(!1)},[Ie]);const ke=Me?maxNationalNumberLength(Me,!1===C?"any":C):Number.POSITIVE_INFINITY,ze=se.nationalNumber.length>=ke,Re=!1!==C&&!1!==_&&Ie&&!Ue&&(fe||ze),$e="mobile"===C?G.invalidMobile:G.invalid,He=hasFieldText(L)?L:Re?_||$e:void 0,We=!0===L||hasFieldText(He),qe=useRef(Ue),Ge=useRef(se);Ge.current=se,useEffect(()=>{qe.current!==Ue&&(qe.current=Ue,c?.(Ue),Ue&&d?.(formatE164(Ge.current)))},[Ue,d,c]);const Ye=useCallback(e=>{if(e.includes("+")){const t=te(e,se.iso);if(t&&!v&&Z.some(e=>e.iso===t.iso))return void ue(t);if(t&&t.iso===se.iso)return void ue(t)}ue({...se,nationalNumber:ee(digitsOnly(e),se.iso)})},[Z,v,se,te,ee,ue]),Ke=useCallback(e=>{ue({callingCode:e.code,iso:e.iso,nationalNumber:ee(se.nationalNumber,e.iso)}),ye(!1);const t=resolveHaptic(B,"selection");t&&triggerHaptic(t)},[se,B,ee,ue]);useImperativeHandle(t,()=>({focus:()=>q.current?.focus(),blur:()=>q.current?.blur(),clear:()=>ue({...Ge.current,nationalNumber:""}),isFocused:()=>q.current?.isFocused()??!1,getValue:()=>Ge.current,getE164:()=>formatE164(Ge.current),getFormatted:()=>{const e=Ge.current,t=planOf(e.iso);return t?formatPhoneAsTyped(e.nationalNumber,t):e.nationalNumber},isValid:()=>ie(Ge.current),getCountry:()=>p.find(e=>e.iso===Ge.current.iso)}),[p,ie,ue]);const Ze=A||v,Je=_jsx(FieldBase,{size:O,variant:Se,radius:M,topNotch:Oe.topNotch,focused:de,disabled:A,error:We,filled:Ie,onPress:pe,pressFeedback:!1,leadingDivider:!0,paddingLeft:ve?H.space.none:void 0,leading:_jsxs(Pressable,{onPress:()=>{Ze||(Ne.current=!0,ye(!0))},disabled:Ze,accessibilityRole:"button",accessibilityLabel:U??G.countryButton(se.callingCode),accessibilityState:{disabled:Ze},"aria-disabled":Ze,hitSlop:6,...hitSlopMarker(6),onLayout:e=>{const{width:t}=e.nativeEvent.layout;Fe(e=>e===t?e:t)},style:W.codeTrigger,testID:$?`${$}-code`:void 0,children:[Q(Ve,Ce.text,$?`${$}-flag`:void 0),_jsx(Text,{variant:"body",style:[W.codeText,{color:xe.color,fontSize:Ce.text}],children:`+${se.callingCode}`}),v?null:_jsx(Chevron,{color:A?H.colors["field-icon-disabled"]:H.colors["field-icon"],size:Ce.icon,open:ge})]}),children:_jsxs(View,{style:W.inputWrap,children:[_jsx(TextInput,{ref:q,value:we,maxLength:De,onChangeText:Ye,returnKeyType:a,submitBehavior:s,onSubmitEditing:u,onSelectionChange:e=>{const{start:t,end:o}=e.nativeEvent.selection;be(t!==o)},onFocus:()=>{ce(!0),k?.()},onBlur:()=>{ce(!1),Ie&&!Ne.current&&he(!0),z?.()},editable:!A,placeholder:Ae&&!je||Le?void 0:Y,placeholderTextColor:xe.placeholderColor,accessibilityLabel:D??E??Y,selectionColor:H.colors["field-caret"],keyboardType:"phone-pad",textContentType:"telephoneNumber",autoComplete:"tel",style:[W.input,{color:xe.color,fontSize:Ce.text,...xe.weightStyle,paddingLeft:ve?H.space.none:void 0}],testID:$?`${$}-input`:void 0}),Le?_jsx(RequiredPlaceholder,{text:Y,color:xe.placeholderColor,fontSize:Ce.text,weightStyle:xe.weightStyle}):null]})});return _jsxs(View,{style:R,testID:$,children:[E&&"top"===T?_jsx(FieldLabel,{size:O,required:j,children:E}):null,_jsxs(View,{style:W.fieldWrapper,children:[Je,Oe.node]}),_jsx(FieldMessage,{size:O,error:We,text:We?He:I}),_jsx(OptionSheet,{open:ge,haptic:B,onClose:()=>ye(!1),title:G.countrySheetTitle,options:Z,sections:J,getOptionLabel:e=>`${e.label} (+${e.code})`,getOptionValue:e=>e.iso,getOptionIcon:e=>Q(e,H.text.lg.size),renderOption:g?({option:e,selected:t})=>g(e,{selected:t}):void 0,value:Ve?.iso,onChange:(e,t)=>Ke(t),searchable:Z.length>8,labels:{searchPlaceholder:G.countrySearchPlaceholder},alphabetIndex:y??Z.length>20})]})});PhoneNumberInput.displayName="PhoneNumberInput";const buildStyles=e=>StyleSheet.create({fieldWrapper:{position:"relative",overflow:"visible"},codeTrigger:{flexDirection:"row",alignItems:"center",gap:e.space.xxs},flag:{includeFontPadding:!1,marginRight:e.space.xs},codeText:{...fontFor(e,"semibold"),fontWeight:"600",includeFontPadding:!1,writingDirection:"ltr"},input:{padding:e.space.none,margin:e.space.none,includeFontPadding:!1,writingDirection:"ltr"},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"}});export default PhoneNumberInput;
1
+ "use strict";import{countryFlagEmoji,formatPhoneAsTyped,getFormatterConfig,getPhoneCountries,isSupportedCountry,isValidNationalNumber,maxNationalNumberLength,splitPhoneNumber}from"@webority/mobile-core";import{PHONE_COUNTRY_NAMES}from"@webority/mobile-core/phone/countries";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{PHONE_NUMBER_INPUT_TEXT}from"../../text/phone/phoneNumberInput.g.js";import{fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,RequiredPlaceholder,resolveFieldTextStyle}from"../FieldBase/index.js";import{Chevron}from"../FieldBase/Chevron.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_CALLING_CODES=[{iso:"AU",code:"61",label:"Australia"},{iso:"CA",code:"1",label:"Canada"},{iso:"IN",code:"91",label:"India"},{iso:"SA",code:"966",label:"Saudi Arabia"},{iso:"SG",code:"65",label:"Singapore"},{iso:"AE",code:"971",label:"United Arab Emirates"},{iso:"GB",code:"44",label:"United Kingdom"},{iso:"US",code:"1",label:"United States"}];export const ALL_CALLING_CODES=getPhoneCountries().map(e=>({iso:e.iso,code:e.callingCode,label:PHONE_COUNTRY_NAMES[e.iso]??e.iso})).sort((e,t)=>e.label.localeCompare(t.label));const digitsOnly=e=>e.replace(/[^0-9]/g,"");export const formatE164=e=>`+${e.callingCode}${e.nationalNumber}`;export const parseE164=(e,t,o)=>{const i=e.replace(/[^0-9]/g,"");if(!i)return null;const n=splitPhoneNumber(`+${i}`);let l=n?.callingCode,a=n?.nationalNumber??"";if(!l){const e=Array.from(new Set(t.map(e=>e.code))).sort((e,t)=>t.length-e.length);if(l=e.find(e=>i.startsWith(e)),!l)return null;a=i.slice(l.length)}const r=t.filter(e=>e.code===l),s=r.find(e=>e.iso===o)?.iso??r.find(e=>e.iso===n?.country)?.iso??n?.country??r[0]?.iso??"";return{callingCode:l,nationalNumber:a,iso:s}};const planOf=e=>isSupportedCountry(e)?e:null,assertDefaultCountryVisible=(e,t)=>{if(void 0!==e&&!t.some(t=>t.iso===e))throw new RangeError(`PhoneNumberInput: defaultCountry "${e}" is not among the visible countries. Add it to countries, or remove it from hiddenCountries.`)};export const PhoneNumberInput=forwardRef((e,t)=>{const{value:o,defaultValue:i,onChange:n,e164:l,onChangeE164:a,returnKeyType:r,submitBehavior:s,onSubmitEditing:u,onComplete:d,onValidityChange:c,countries:p=ALL_CALLING_CODES,popularCountries:m,hiddenCountries:b,showFlag:f=!0,renderFlag:h,renderCountry:g,showAlphabetIndex:N,defaultCountry:x,validation:C="any",maxLength:y,formatAsYouType:v=!0,countryLocked:S=!1,label:T,labelMode:I="top",labelStyle:F,placeholder:E,helperText:P,error:j,invalidMessage:_,required:L,disabled:V=!1,size:O="md",variant:M,radius:A,labels:w,haptic:k,accessibilityLabel:z,countryAccessibilityLabel:D,onFocus:R,onBlur:U,style:B,testID:$}=e;assertValidValue("PhoneNumberInput","size",e.size,["sm","md","lg"]),assertValidValue("PhoneNumberInput","variant",e.variant,["outline","filled","underline"]),assertValidValue("PhoneNumberInput","labelMode",e.labelMode,["top","float"]),assertValidValue("PhoneNumberInput","validation",!1===e.validation?void 0:e.validation,["any","mobile"]);const H=useTheme(),W=useMemo(()=>buildStyles(H),[H]),q=useRef(null),G=useMobileUiText("phoneNumberInput",PHONE_NUMBER_INPUT_TEXT),Y=useMemo(()=>({...G,...w}),[G,w]),K=E??Y.placeholder,X=useMemo(()=>/-([A-Za-z]{2})(?:-|$)/.exec(getFormatterConfig().locale)?.[1]?.toUpperCase(),[]),Z=useMemo(()=>b?.length?p.filter(e=>!b.includes(e.iso)):p,[p,b]),J=useMemo(()=>{if(!m?.length)return;const e=m.map(e=>Z.find(t=>t.iso===e)).filter(e=>void 0!==e);return e.length?[{title:Y.popular,options:e},{title:Y.allCountries,options:Z}]:void 0},[m,Y.popular,Y.allCountries,Z]),Q=useCallback((e,t,o)=>{if(!e)return null;if(h)return h(e);if(!f)return null;const i=countryFlagEmoji(e.iso);return i?_jsx(Text,{variant:"body",style:[W.flag,{fontSize:t}],testID:o,children:i}):null},[h,f,W.flag]),ee=useCallback(e=>{const t=planOf(e),o=t?maxNationalNumberLength(t,!1===C?"any":C):Number.POSITIVE_INFINITY;return y?Math.min(o,y):o},[y,C]),te=useCallback((e,t)=>e.slice(0,ee(t)),[ee]),oe=useCallback((e,t)=>{const o=planOf(t)??void 0,i=splitPhoneNumber(e,o);if(!i)return null;const n=i.country??t,l=p.find(e=>e.iso===n);return{callingCode:l?.code??i.callingCode,nationalNumber:te(i.nationalNumber,n),iso:l?.iso??n}},[p,te]);useState(()=>assertDefaultCountryVisible(x,Z));const ie=useMemo(()=>{const e=Z.find(e=>e.iso===(x??X))??Z[0]??p[0],t={callingCode:e?.code??"",nationalNumber:"",iso:e?.iso??""};return"string"==typeof i?oe(i,t.iso)??t:i??t},[p,Z,x,X,i,oe]),ne=useCallback(e=>{if(!1===C)return e.nationalNumber.length>0;const t=planOf(e.iso);return t?isValidNationalNumber(e.nationalNumber,t,C):e.nationalNumber.length>0},[C]),[le,ae]=useState(ie.iso),re=useMemo(()=>{if(void 0===l)return;const e=l?parseE164(l,p,le):null;if(e)return{...e,nationalNumber:te(e.nationalNumber,e.iso)};const t=p.find(e=>e.iso===le);return{callingCode:t?.code??ie.callingCode,nationalNumber:"",iso:le}},[l,p,le,ie.callingCode,te]),se=useCallback(e=>{ae(e.iso),n?.(e),a?.(e.nationalNumber?formatE164(e):"",{country:p.find(t=>t.iso===e.iso),national:e.nationalNumber,valid:ne(e)})},[n,a,p,ne]),[ue,de]=useControllableState({value:o??re,defaultValue:ie,onChange:se}),[ce,pe]=useState(!1),me=useCallback(()=>{V||q.current?.focus()},[V]),[be,fe]=useState(!1),[he,ge]=useState(!1),[Ne,xe]=useState(!1),Ce=useRef(!1);useEffect(()=>{Ne||(Ce.current=!1)},[Ne]);const ye=resolveFieldSize(H,O),ve=resolveFieldTextStyle(H,{disabled:V}),Se=M??H.settings.components.field?.defaultVariant??"outline",Te="underline"===Se,Ie=H.space.md,[Fe,Ee]=useState(0),Pe=Fe+Ie+1+Ie,je=ue.nationalNumber.length>0,Le=L&&!T&&!je&&K.length>0,Ve=ce||je,Oe=Boolean(T)&&"float"===I&&Fe>0,Me=useFloatingLabel({label:T,enabled:Oe,floated:Ve,required:L,variant:Se,sizeTokens:ye,leadingOffset:Pe,paddingLeft:Te?H.space.none:ye["padding-x"],color:H.colors["field-label"],style:F}),Ae=useMemo(()=>p.find(e=>e.iso===ue.iso),[p,ue.iso]),we=planOf(ue.iso),ke=v&&we?formatPhoneAsTyped(ue.nationalNumber,we):ue.nationalNumber,ze=ee(ue.iso),De=0===ue.nationalNumber.length||be||!Number.isFinite(ze)?void 0:ke.length+Math.max(0,ze-ue.nationalNumber.length),Re=ne(ue);useEffect(()=>{je||ge(!1)},[je]);const Ue=we?maxNationalNumberLength(we,!1===C?"any":C):Number.POSITIVE_INFINITY,Be=ue.nationalNumber.length>=Ue,$e=!1!==C&&!1!==_&&je&&!Re&&(he||Be),He="mobile"===C?Y.invalidMobile:Y.invalid,We=hasFieldText(j)?j:$e?_||He:void 0,qe=!0===j||hasFieldText(We),Ge=useRef(Re),Ye=useRef(ue);Ye.current=ue,useEffect(()=>{Ge.current!==Re&&(Ge.current=Re,c?.(Re),Re&&d?.(formatE164(Ye.current)))},[Re,d,c]);const Ke=useCallback(e=>{if(e.includes("+")){const t=oe(e,ue.iso);if(t&&!S&&Z.some(e=>e.iso===t.iso))return void de(t);if(t&&t.iso===ue.iso)return void de(t)}de({...ue,nationalNumber:te(digitsOnly(e),ue.iso)})},[Z,S,ue,oe,te,de]),Xe=useCallback(e=>{de({callingCode:e.code,iso:e.iso,nationalNumber:te(ue.nationalNumber,e.iso)}),xe(!1);const t=resolveHaptic(k,"selection");t&&triggerHaptic(t)},[ue,k,te,de]);useImperativeHandle(t,()=>({focus:()=>q.current?.focus(),blur:()=>q.current?.blur(),clear:()=>de({...Ye.current,nationalNumber:""}),isFocused:()=>q.current?.isFocused()??!1,getValue:()=>Ye.current,getE164:()=>formatE164(Ye.current),getFormatted:()=>{const e=Ye.current,t=planOf(e.iso);return t?formatPhoneAsTyped(e.nationalNumber,t):e.nationalNumber},isValid:()=>ne(Ye.current),getCountry:()=>p.find(e=>e.iso===Ye.current.iso)}),[p,ne,de]);const Ze=V||S,Je=_jsx(FieldBase,{testID:$?`${$}-field`:void 0,size:O,variant:Se,radius:A,topNotch:Me.topNotch,focused:ce,disabled:V,error:qe,filled:je,onPress:me,pressFeedback:!1,leadingDivider:!0,paddingLeft:Te?H.space.none:void 0,leading:_jsxs(Pressable,{onPress:()=>{Ze||(Ce.current=!0,xe(!0))},disabled:Ze,accessibilityRole:"button",accessibilityLabel:D??fillText(Y.countryButton,{callingCode:ue.callingCode}),accessibilityState:{disabled:Ze},"aria-disabled":Ze,hitSlop:6,...hitSlopMarker(6),onLayout:e=>{const{width:t}=e.nativeEvent.layout;Ee(e=>e===t?e:t)},style:W.codeTrigger,testID:$?`${$}-code`:void 0,children:[Q(Ae,ye.text,$?`${$}-flag`:void 0),_jsx(Text,{variant:"body",style:[W.codeText,{color:ve.color,fontSize:ye.text}],children:`+${ue.callingCode}`}),S?null:_jsx(Chevron,{color:V?H.colors["field-icon-disabled"]:H.colors["field-icon"],size:ye.icon,open:Ne})]}),children:_jsxs(View,{style:W.inputWrap,children:[_jsx(TextInput,{ref:q,value:ke,maxLength:De,onChangeText:Ke,returnKeyType:r,submitBehavior:s,onSubmitEditing:u,onSelectionChange:e=>{const{start:t,end:o}=e.nativeEvent.selection;fe(t!==o)},onFocus:()=>{pe(!0),R?.()},onBlur:()=>{pe(!1),je&&!Ce.current&&ge(!0),U?.()},editable:!V,placeholder:Oe&&!Ve||Le?void 0:K,placeholderTextColor:ve.placeholderColor,accessibilityLabel:z??T??K,selectionColor:H.colors["field-caret"],keyboardType:"phone-pad",textContentType:"telephoneNumber",autoComplete:"tel",style:[W.input,{color:ve.color,fontSize:ye.text,...ve.weightStyle,paddingLeft:Te?H.space.none:void 0}],testID:$?`${$}-input`:void 0}),Le?_jsx(RequiredPlaceholder,{text:K,color:ve.placeholderColor,fontSize:ye.text,weightStyle:ve.weightStyle}):null]})});return _jsxs(View,{style:B,testID:$,children:[T&&"top"===I?_jsx(FieldLabel,{size:O,required:L,children:T}):null,_jsxs(View,{style:W.fieldWrapper,children:[Je,Me.node]}),_jsx(FieldMessage,{size:O,error:qe,text:qe?We:P}),_jsx(OptionSheet,{open:Ne,haptic:k,onClose:()=>xe(!1),title:Y.countrySheetTitle,options:Z,sections:J,getOptionLabel:e=>`${e.label} (+${e.code})`,getOptionValue:e=>e.iso,getOptionIcon:e=>Q(e,H.text.lg.size),renderOption:g?({option:e,selected:t})=>g(e,{selected:t}):void 0,value:Ae?.iso,onChange:(e,t)=>Xe(t),searchable:Z.length>8,labels:{searchPlaceholder:Y.countrySearchPlaceholder},alphabetIndex:N??Z.length>20})]})});PhoneNumberInput.displayName="PhoneNumberInput";const buildStyles=e=>StyleSheet.create({fieldWrapper:{position:"relative",overflow:"visible"},codeTrigger:{flexDirection:"row",alignItems:"center",gap:e.space.xxs},flag:{includeFontPadding:!1,marginRight:e.space.xs},codeText:{...fontFor(e,"semibold"),fontWeight:"600",includeFontPadding:!1,writingDirection:"ltr"},input:{padding:e.space.none,margin:e.space.none,includeFontPadding:!1,writingDirection:"ltr"},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"}});export default PhoneNumberInput;
@@ -1 +1 @@
1
- "use strict";export{ALL_CALLING_CODES,DEFAULT_CALLING_CODES,DEFAULT_PHONE_NUMBER_INPUT_LABELS,default,formatE164,PhoneNumberInput,parseE164}from"./PhoneNumberInput.js";
1
+ "use strict";export{ALL_CALLING_CODES,DEFAULT_CALLING_CODES,default,formatE164,PhoneNumberInput,parseE164}from"./PhoneNumberInput.js";
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,RequiredMark,resolveFieldTextStyle}from"../FieldBase/index.js";import{Chevron}from"../FieldBase/Chevron.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PICKER_TRIGGER_LABELS=Object.freeze({placeholder:"Select…",selection:"Selection",noSelection:"No selection",clear:"Clear"});const PickerTrigger=forwardRef((e,l)=>{assertValidValue("PickerTrigger","size",e.size,["sm","md","lg"]),assertValidValue("PickerTrigger","variant",e.variant,["outline","filled","underline"]);const{value:i,placeholder:t,label:r,help:s,helperText:o,error:a,required:n=!1,onPress:d,clearable:c=!1,onClear:x,leftIcon:u,trailing:g,disabled:m=!1,size:b="md",variant:y,style:T,triggerStyle:h,valueStyle:S,labelStyle:f,messageStyle:p,accessibilityLabel:F,labels:j,testID:v}=e,_=j?{...DEFAULT_PICKER_TRIGGER_LABELS,...j}:DEFAULT_PICKER_TRIGGER_LABELS,R=useTheme(),P=useMemo(()=>buildStyles(R),[R]),L=resolveFieldSize(R,b),z=resolveFieldTextStyle(R,{disabled:m}),E="string"==typeof i&&i.length>0,V=!0===a||hasFieldText(a),w=hasFieldText(r),I=E?i:t??_.placeholder,k=E?z.color:z.placeholderColor,C=E?`${fieldTextAsString(r)??_.selection}: ${i}`:t??_.noSelection,A=F??C,B={disabled:m},D=void 0===g,G=c&&E&&!m;return _jsxs(View,{style:[P.root,T],testID:v,children:[w?_jsx(FieldLabel,{size:b,required:n,help:s,style:f,children:r}):null,_jsx(FieldBase,{size:b,variant:y,disabled:m,error:V,filled:E,onPress:d,leading:u,trailing:G||D||null!==g?_jsxs(View,{style:P.trailingRow,children:[G?_jsx(Text,{variant:"body",onPress:()=>{m||x?.()},accessibilityRole:"button",accessibilityLabel:_.clear,style:{fontSize:L.icon,color:R.colors["text-muted"],paddingHorizontal:R.space.xs},children:"×"}):null,void 0!==g?g:D?_jsx(Chevron,{size:L.icon,color:m?R.colors["text-disabled"]:R.colors["text-subtle"]}):null]}):null,accessibilityLabel:A,accessibilityState:B,accessibilityRole:"button",style:h,children:_jsxs(Text,{variant:"body",numberOfLines:1,style:[P.valueText,{color:k,fontSize:L.text,...z.weightStyle},S],children:[I,E||!n||w?null:_jsx(RequiredMark,{})]})}),_jsx(FieldMessage,{size:b,error:V,text:V?a:o,style:p})]})});PickerTrigger.displayName="PickerTrigger";const buildStyles=e=>StyleSheet.create({root:{width:"100%"},label:{includeFontPadding:!1},valueText:{flex:1,includeFontPadding:!1},message:{includeFontPadding:!1},trailingRow:{flexDirection:"row",alignItems:"center"}});export{PickerTrigger};export default PickerTrigger;
1
+ "use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{useMobileUiText}from"../../text/index.js";import{PICKER_TRIGGER_TEXT}from"../../text/phone/pickerTrigger.g.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,RequiredMark,resolveFieldTextStyle}from"../FieldBase/index.js";import{Chevron}from"../FieldBase/Chevron.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const PickerTrigger=forwardRef((e,i)=>{assertValidValue("PickerTrigger","size",e.size,["sm","md","lg"]),assertValidValue("PickerTrigger","variant",e.variant,["outline","filled","underline"]);const{value:l,placeholder:r,label:t,help:s,helperText:o,error:a,required:d=!1,onPress:n,clearable:c=!1,onClear:x,leftIcon:u,trailing:g,disabled:m=!1,size:T="md",variant:b,style:y,triggerStyle:h,valueStyle:f,labelStyle:p,messageStyle:j,accessibilityLabel:S,labels:v,testID:F}=e,P=useMobileUiText("pickerTrigger",PICKER_TRIGGER_TEXT),_=useMemo(()=>({...P,...v}),[P,v]),R=useTheme(),z=useMemo(()=>buildStyles(R),[R]),k=resolveFieldSize(R,T),V=resolveFieldTextStyle(R,{disabled:m}),w="string"==typeof l&&l.length>0,M=!0===a||hasFieldText(a),I=hasFieldText(t),C=w?l:r??_.placeholder,E=w?V.color:V.placeholderColor,L=w?`${fieldTextAsString(t)??_.selection}: ${l}`:r??_.noSelection,q=S??L,B={disabled:m},G=void 0===g,D=c&&w&&!m;return _jsxs(View,{style:[z.root,y],testID:F,children:[I?_jsx(FieldLabel,{size:T,required:d,help:s,style:p,children:t}):null,_jsx(FieldBase,{size:T,variant:b,disabled:m,error:M,filled:w,onPress:n,leading:u,trailing:D||G||null!==g?_jsxs(View,{style:z.trailingRow,children:[D?_jsx(Text,{variant:"body",onPress:()=>{m||x?.()},accessibilityRole:"button",accessibilityLabel:_.clear,style:{fontSize:k.icon,color:R.colors["text-muted"],paddingHorizontal:R.space.xs},children:"×"}):null,void 0!==g?g:G?_jsx(Chevron,{size:k.icon,color:m?R.colors["text-disabled"]:R.colors["text-subtle"]}):null]}):null,accessibilityLabel:q,accessibilityState:B,accessibilityRole:"button",style:h,children:_jsxs(Text,{variant:"body",numberOfLines:1,style:[z.valueText,{color:E,fontSize:k.text,...V.weightStyle},f],children:[C,w||!d||I?null:_jsx(RequiredMark,{})]})}),_jsx(FieldMessage,{size:T,error:M,text:M?a:o,style:j})]})});PickerTrigger.displayName="PickerTrigger";const buildStyles=e=>StyleSheet.create({root:{width:"100%"},label:{includeFontPadding:!1},valueText:{flex:1,includeFontPadding:!1},message:{includeFontPadding:!1},trailingRow:{flexDirection:"row",alignItems:"center"}});export{PickerTrigger};export default PickerTrigger;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_PICKER_TRIGGER_LABELS,default,PickerTrigger}from"./PickerTrigger.js";
1
+ "use strict";export{default,PickerTrigger}from"./PickerTrigger.js";
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{AppIcon}from"../AppIcon/index.js";import{Avatar}from"../Avatar/index.js";import{IconBadge}from"../IconBadge/index.js";import{ProgressRing}from"../ProgressRing/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PROFILE_COMPLETION_LABELS=Object.freeze({summary:(e,r)=>`${e}, profile ${r}% complete`,avatar:e=>`${e}'s avatar`});const AVATAR_PX={sm:32,md:48,lg:64,xl:80},toneColor=(e,r)=>{switch(r){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors["text-muted"];default:return e.colors.primary}},DEFAULT_RING_WIDTH=3,DEFAULT_RING_GAP=1,ProfileCompletion=forwardRef((e,r)=>{const{progress:t,title:s,subtitle:o,description:i,source:a,ImageComponent:l,size:n="md",avatarTone:c="neutral",avatarBackgroundColor:m,avatarColor:d,ringWidth:u,ringGap:p=DEFAULT_RING_GAP,ringVariant:g="banded",tone:x,ringColor:f,animated:y=!0,showCompleteBadge:b=!0,trailing:_,labels:h,accessibilityLabel:j,style:I,titleStyle:V,subtitleStyle:A,descriptionStyle:C,testID:P}=e;assertValidValue("ProfileCompletion","size",e.size,["sm","md","lg","xl"]),assertValidValue("ProfileCompletion","ringVariant",e.ringVariant,["banded","single"]),assertValidValue("ProfileCompletion","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const T=useTheme(),w=useMemo(()=>buildStyles(T),[T]),L=useMemo(()=>({...DEFAULT_PROFILE_COMPLETION_LABELS,...h}),[h]),v=u??3,R=AVATAR_PX[n]+2*(p+v),S=Math.min(100,Math.max(0,Number.isNaN(t)?0:t)),D=Math.round(S),E=j??L.summary(s,D),M=P??"profile-completion",G=b&&S>=100,N=Math.max(16,Math.round(.3*R)),O=R/2*(1+Math.SQRT1_2)-v/2,B=f??("banded"===g&&null==x?T.colors.success:toneColor(T,x??"primary"));return _jsxs(View,{ref:r,style:[w.root,I],testID:P,children:[_jsxs(View,{style:w.summary,accessible:!0,accessibilityRole:"summary",accessibilityLabel:E,accessibilityValue:{min:0,max:100,now:D},testID:`${M}-summary`,children:[_jsxs(View,{style:{width:R,height:R},children:[_jsx(ProgressRing,{progress:S/100,size:R,strokeWidth:v,tone:x??"primary",ringColor:f,colorByProgress:"banded"===g&&null==x&&null==f,animated:y,testID:`${M}-ring`,children:_jsx(Avatar,{name:s,source:a,ImageComponent:l,size:n,tone:c,backgroundColor:m,color:d,accessibilityLabel:L.avatar(s)})}),G?_jsx(IconBadge,{dimension:N,fill:"surface",icon:_jsx(AppIcon,{name:"verify",variant:"bold",size:N-2,color:B}),pointerEvents:"none",style:[w.badge,{left:O-N/2,top:O-N/2}],testID:`${M}-complete-badge`}):null]}),_jsxs(View,{style:w.body,children:[_jsx(Text,{variant:"h3",numberOfLines:2,style:V,children:s}),o?_jsx(Text,{variant:"label",color:"tertiary",numberOfLines:1,style:[w.subtitle,A],children:o}):null,i?_jsx(Text,{variant:"body",color:"secondary",style:C,children:i}):null]})]}),null!=_?_jsx(View,{style:w.trailing,children:_}):null]})});ProfileCompletion.displayName="ProfileCompletion";const buildStyles=e=>StyleSheet.create({root:{flexDirection:"row",alignItems:"center",columnGap:e.space.md},summary:{flex:1,flexDirection:"row",alignItems:"center",columnGap:e.space.md},body:{flex:1,rowGap:e.space.xxs},badge:{position:"absolute"},subtitle:{textTransform:"uppercase",letterSpacing:e["letter-spacing"].wide},trailing:{alignSelf:"flex-start"}});export{ProfileCompletion};export default ProfileCompletion;
1
+ "use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{PROFILE_COMPLETION_TEXT}from"../../text/phone/profileCompletion.g.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{AppIcon}from"../AppIcon/index.js";import{Avatar}from"../Avatar/index.js";import{IconBadge}from"../IconBadge/index.js";import{ProgressRing}from"../ProgressRing/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const AVATAR_PX={sm:32,md:48,lg:64,xl:80},toneColor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors["text-muted"];default:return e.colors.primary}},DEFAULT_RING_WIDTH=3,DEFAULT_RING_GAP=1,ProfileCompletion=forwardRef((e,t)=>{const{progress:r,title:i,subtitle:o,description:s,source:l,ImageComponent:a,size:n="md",avatarTone:m="neutral",avatarBackgroundColor:c,avatarColor:d,ringWidth:u,ringGap:p=DEFAULT_RING_GAP,ringVariant:x="banded",tone:f,ringColor:g,animated:y=!0,showCompleteBadge:b=!0,trailing:h,labels:T,accessibilityLabel:_,style:j,titleStyle:I,subtitleStyle:C,descriptionStyle:V,testID:P}=e;assertValidValue("ProfileCompletion","size",e.size,["sm","md","lg","xl"]),assertValidValue("ProfileCompletion","ringVariant",e.ringVariant,["banded","single"]),assertValidValue("ProfileCompletion","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const w=useTheme(),A=useMemo(()=>buildStyles(w),[w]),v=useMobileUiText("profileCompletion",PROFILE_COMPLETION_TEXT),R=useMemo(()=>({...v,...T}),[v,T]),M=u??3,L=AVATAR_PX[n]+2*(p+M),S=Math.min(100,Math.max(0,Number.isNaN(r)?0:r)),D=Math.round(S),E=_??fillText(R.summary,{title:i,percent:D}),G=P??"profile-completion",N=b&&S>=100,O=Math.max(16,Math.round(.3*L)),z=L/2*(1+Math.SQRT1_2)-M/2,B=g??("banded"===x&&null==f?w.colors.success:toneColor(w,f??"primary"));return _jsxs(View,{ref:t,style:[A.root,j],testID:P,children:[_jsxs(View,{style:A.summary,accessible:!0,accessibilityRole:"summary",accessibilityLabel:E,accessibilityValue:{min:0,max:100,now:D},testID:`${G}-summary`,children:[_jsxs(View,{style:{width:L,height:L},children:[_jsx(ProgressRing,{progress:S/100,size:L,strokeWidth:M,tone:f??"primary",ringColor:g,colorByProgress:"banded"===x&&null==f&&null==g,animated:y,testID:`${G}-ring`,children:_jsx(Avatar,{name:i,source:l,ImageComponent:a,size:n,tone:m,backgroundColor:c,color:d,accessibilityLabel:fillText(R.avatar,{title:i})})}),N?_jsx(IconBadge,{dimension:O,fill:"surface",icon:_jsx(AppIcon,{name:"verify",variant:"bold",size:O-2,color:B}),pointerEvents:"none",style:[A.badge,{left:z-O/2,top:z-O/2}],testID:`${G}-complete-badge`}):null]}),_jsxs(View,{style:A.body,children:[_jsx(Text,{variant:"h3",numberOfLines:2,style:I,children:i}),o?_jsx(Text,{variant:"label",color:"tertiary",numberOfLines:1,style:[A.subtitle,C],children:o}):null,s?_jsx(Text,{variant:"body",color:"secondary",style:V,children:s}):null]})]}),null!=h?_jsx(View,{style:A.trailing,children:h}):null]})});ProfileCompletion.displayName="ProfileCompletion";const buildStyles=e=>StyleSheet.create({root:{flexDirection:"row",alignItems:"center",columnGap:e.space.md},summary:{flex:1,flexDirection:"row",alignItems:"center",columnGap:e.space.md},body:{flex:1,rowGap:e.space.xxs},badge:{position:"absolute"},subtitle:{textTransform:"uppercase",letterSpacing:e["letter-spacing"].wide},trailing:{alignSelf:"flex-start"}});export{ProfileCompletion};export default ProfileCompletion;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_PROFILE_COMPLETION_LABELS,default,ProfileCompletion}from"./ProfileCompletion.js";
1
+ "use strict";export{default,ProfileCompletion}from"./ProfileCompletion.js";
@@ -1 +1 @@
1
- "use strict";import{useCallback,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{blendOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{AppIcon}from"../AppIcon/index.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Avatar}from"../Avatar/index.js";import{FieldLabel,FieldMessage,fieldTextAsString,hasFieldText}from"../FieldBase/index.js";import{matchesAccept}from"../FilePicker/FilePicker.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{Spinner}from"../Spinner/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PROFILE_PICKER_LABELS=Object.freeze({pick:"Change profile photo",remove:"Remove photo",sheetTitle:"Change photo",errorTooLarge:e=>`The photo is larger than ${e} MB.`,errorWrongType:"That file is not a supported image."});const DEFAULT_ACCEPT=["image/*"],SHEET_ICON_SIZE=20,SOFT_FILL_OPACITY=.14,SIZE_PX={sm:72,md:120,lg:160},clamp=(e,r,t)=>Math.min(t,Math.max(r,e)),toneFor=(e,r)=>{switch(r){case"success":return{base:e.colors.success,on:e.colors["on-success"]};case"warning":return{base:e.colors.warning,on:e.colors["on-warning"]};case"danger":return{base:e.colors.danger,on:e.colors["on-danger"]};case"info":return{base:e.colors.info,on:e.colors["on-info"]};case"neutral":return{base:e.colors["text-muted"],on:e.colors["on-neutral-strong"]};default:return{base:e.colors.primary,on:e.colors["on-primary"]}}},badgeLookFor=(e,r,t)=>{const o=toneFor(e,r),s=o.base,i=e.colors.bg,n="neutral"===r;let l;switch(t){case"soft":l={fill:n?e.colors["bg-muted"]:blendOf(s,.14,i,e.colors["bg-subtle"]),ring:i,icon:s};break;case"outline":l={fill:i,ring:n?e.colors.border:s,icon:s};break;default:l={fill:s,ring:i,icon:o.on}}return l},resolveRadius=(e,r)=>"circle"===e?r/2:"rounded"===e?Math.max(6,Math.round(.22*r)):0,REMOVE_VALUE="__profile-picker-remove__";function ProfilePicker(e){const{ref:r,value:t,name:o,sources:s,onPick:i,onRemove:n,loading:l=!1,disabled:a=!1,accept:c=DEFAULT_ACCEPT,maxSizeMB:d,size:u="md",shape:m="circle",badgeIcon:p="camera",tone:g,variant:h,avatarTone:f,avatarBackgroundColor:b,avatarColor:y,label:x,required:k=!1,helperText:v,error:C,layout:_="stacked",title:j,subtitle:P,ImageComponent:S,labels:T,haptic:I,onError:E,accessibilityLabel:F,style:V,testID:A}=e;assertValidValue("ProfilePicker","size",e.size,["sm","md","lg"]),assertValidValue("ProfilePicker","shape",e.shape,["circle","rounded","square"]),assertValidValue("ProfilePicker","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("ProfilePicker","variant",e.variant,["solid","soft","outline"]),assertValidValue("ProfilePicker","layout",e.layout,["stacked","inline","profile"]);const w=useTheme(),L=w.settings.components["profile-picker"],M=g??L?.defaultTone??"primary",O=h??L?.defaultVariant??"solid",R=useMemo(()=>badgeLookFor(w,M,O),[w,M,O]),D=f??L?.defaultAvatarTone,H=useMemo(()=>({...DEFAULT_PROFILE_PICKER_LABELS,...T}),[T]),[z,B]=useState(null),[U,$]=useState(null),[q,W]=useState(!1),[Z,G]=useState(t);t!==Z&&(G(t),B(null));const K=l||a,N=z??t??null,X=useMemo(()=>N?{uri:N}:void 0,[N]),Q=C??U??void 0,Y=!K&&(null!==z||Boolean(t)&&Boolean(n)),J=s.length>0||Y,ee=SIZE_PX[u],re=resolveRadius(m,ee),te=re*(1-Math.SQRT1_2),oe=clamp(Math.round(.28*ee),24,44),se=te-oe/2,ie=Math.max(0,-se),ne=useCallback(e=>{$(e),E?.(e),!1!==I&&triggerHaptic("notificationError")},[E,I]),le=useCallback(async e=>{let r;try{r=await e.pick()}catch(e){return void ne(e instanceof Error?e.message:String(e))}const t=r?.[0];if(!t)return;if("number"==typeof d&&"number"==typeof t.size&&t.size>1024*d*1024)return void ne(H.errorTooLarge(d));if(t.type&&!matchesAccept(t.type,c))return void ne(H.errorWrongType);$(null),B(t.uri);const o=resolveHaptic(I,"selection");o&&triggerHaptic(o),i?.(t)},[d,c,H,I,i,ne]),ae=useCallback(()=>{if(K)return;ue.current=null;const[e]=s;void 0===e||1!==s.length||Y?(s.length>0||Y)&&W(!0):le(e)},[K,s,Y,le]),ce=useCallback(()=>{B(null),$(null);const e=resolveHaptic(I,"selection");e&&triggerHaptic(e),n?.()},[I,n]),de=useMemo(()=>{const e=s.map(e=>({kind:"source",source:e}));return Y&&e.push({kind:"remove"}),e},[s,Y]),ue=useRef(null),me=useCallback(e=>{ue.current||(W(!1),"remove"===e.kind?ce():ue.current=e.source)},[ce]),pe=useRef(le);pe.current=le;const ge=useCallback(()=>{const e=ue.current;ue.current=null,e&&pe.current(e)},[]),he=A??"profile-picker",fe=F??(J?H.pick:o),be=_jsx(View,{style:{width:ee,height:ee,marginBottom:ie,marginRight:ie},children:_jsxs(Pressable,{onPress:ae,disabled:K||!J,accessibilityRole:J?"button":"image",accessibilityLabel:fe,accessibilityHint:fieldTextAsString(Q),accessibilityState:J?{disabled:K,busy:l}:{busy:l},"aria-disabled":J?K:void 0,"aria-busy":l,testID:`${he}-button`,style:({pressed:e})=>[{width:ee,height:ee,borderRadius:re,...smoothCorners},{opacity:a?.55:e?.85:1}],children:[_jsx(View,{importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,pointerEvents:"none",children:_jsx(Avatar,{dimension:ee,shape:m,name:o||void 0,source:X,ImageComponent:S,tone:D,backgroundColor:b,color:y,placeholderIcon:"user"})}),l?_jsx(View,{style:[styles.fill,styles.overlay,{borderRadius:re,...smoothCorners,backgroundColor:w.colors.scrim}],testID:`${he}-loading`,children:_jsx(Spinner,{size:ee>=100?"md":"sm",color:w.colors["on-primary"]})}):null,!a&&J?_jsx(View,{pointerEvents:"none",testID:`${he}-badge`,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,style:[styles.badge,{width:oe,height:oe,borderRadius:w.radius.pill,...smoothCorners,right:se,bottom:se,backgroundColor:R.fill,borderColor:R.ring}],children:renderSlotIcon(p,{color:R.icon,size:Math.round(.55*oe),disabled:!1})}):null]})}),ye="stacked"!==_?_jsxs(View,{style:[styles.meta,"profile"===_?styles.metaCentred:null],children:[j?_jsx(Text,{variant:"body",weight:"semibold",style:[styles.title,"profile"===_?styles.textCentred:null],children:j}):null,P?_jsx(Text,{variant:"bodySmall",color:"secondary",style:[styles.subtitle,"profile"===_?styles.textCentred:null,{marginTop:w.space.xxs}],children:P}):null,_jsx(FieldMessage,{text:Q??v,error:hasFieldText(Q)})]}):_jsx(FieldMessage,{text:Q??v,error:hasFieldText(Q)});return _jsxs(View,{ref:r,style:V,testID:A,children:[x?_jsx(FieldLabel,{required:k,children:x}):null,_jsxs(View,{style:"inline"===_?[styles.row,{columnGap:w.space.md}]:["profile"===_?styles.columnCentred:styles.column,{rowGap:w.space.xs}],children:[be,ye]}),_jsx(OptionSheet,{open:q,haptic:I,onClose:()=>W(!1),onAfterClose:ge,title:H.sheetTitle,options:de,getOptionLabel:e=>"remove"===e.kind?H.remove:e.source.label,getOptionValue:e=>"remove"===e.kind?REMOVE_VALUE:e.source.key,destructiveOf:e=>"remove"===e.kind,getOptionDescription:e=>"remove"===e.kind?void 0:e.source.description,getOptionIcon:e=>"remove"===e.kind?_jsx(AppIcon,{name:"trash",size:20,color:w.colors["danger-text"]}):e.source.icon,onChange:(e,r)=>me(r)})]})}ProfilePicker.displayName="ProfilePicker";const styles=StyleSheet.create({fill:{alignItems:"center",justifyContent:"center",overflow:"hidden"},overlay:{...StyleSheet.absoluteFill},badge:{position:"absolute",alignItems:"center",justifyContent:"center",borderWidth:2},row:{flexDirection:"row",alignItems:"center"},column:{alignItems:"flex-start"},columnCentred:{alignItems:"center"},meta:{flexShrink:1},metaCentred:{alignItems:"center"},title:{includeFontPadding:!1},subtitle:{includeFontPadding:!1},textCentred:{textAlign:"center"}});export{ProfilePicker};export default ProfilePicker;
1
+ "use strict";import{useCallback,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{PROFILE_PICKER_TEXT}from"../../text/phone/profilePicker.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{blendOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{AppIcon}from"../AppIcon/index.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Avatar}from"../Avatar/index.js";import{FieldLabel,FieldMessage,fieldTextAsString,hasFieldText}from"../FieldBase/index.js";import{matchesAccept}from"../FilePicker/FilePicker.js";import{OptionSheet}from"../OptionSheet/OptionSheet.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 DEFAULT_ACCEPT=["image/*"],SHEET_ICON_SIZE=20,SOFT_FILL_OPACITY=.14,SIZE_PX={sm:72,md:120,lg:160},clamp=(e,r,t)=>Math.min(t,Math.max(r,e)),toneFor=(e,r)=>{switch(r){case"success":return{base:e.colors.success,on:e.colors["on-success"]};case"warning":return{base:e.colors.warning,on:e.colors["on-warning"]};case"danger":return{base:e.colors.danger,on:e.colors["on-danger"]};case"info":return{base:e.colors.info,on:e.colors["on-info"]};case"neutral":return{base:e.colors["text-muted"],on:e.colors["on-neutral-strong"]};default:return{base:e.colors.primary,on:e.colors["on-primary"]}}},badgeLookFor=(e,r,t)=>{const o=toneFor(e,r),s=o.base,i=e.colors.bg,l="neutral"===r;let n;switch(t){case"soft":n={fill:l?e.colors["bg-muted"]:blendOf(s,.14,i,e.colors["bg-subtle"]),ring:i,icon:s};break;case"outline":n={fill:i,ring:l?e.colors.border:s,icon:s};break;default:n={fill:s,ring:i,icon:o.on}}return n},resolveRadius=(e,r)=>"circle"===e?r/2:"rounded"===e?Math.max(6,Math.round(.22*r)):0,REMOVE_VALUE="__profile-picker-remove__";function ProfilePicker(e){const{ref:r,value:t,name:o,sources:s,onPick:i,onRemove:l,loading:n=!1,disabled:a=!1,accept:c=DEFAULT_ACCEPT,maxSizeMB:d,size:u="md",shape:m="circle",badgeIcon:p="camera",tone:f,variant:g,avatarTone:b,avatarBackgroundColor:h,avatarColor:x,label:y,required:k=!1,helperText:v,error:j,layout:C="stacked",title:P,subtitle:_,ImageComponent:T,labels:I,haptic:S,onError:E,accessibilityLabel:V,style:F,testID:w}=e;assertValidValue("ProfilePicker","size",e.size,["sm","md","lg"]),assertValidValue("ProfilePicker","shape",e.shape,["circle","rounded","square"]),assertValidValue("ProfilePicker","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("ProfilePicker","variant",e.variant,["solid","soft","outline"]),assertValidValue("ProfilePicker","layout",e.layout,["stacked","inline","profile"]);const A=useTheme(),M=A.settings.components["profile-picker"],O=f??M?.defaultTone??"primary",R=g??M?.defaultVariant??"solid",L=useMemo(()=>badgeLookFor(A,O,R),[A,O,R]),H=b??M?.defaultAvatarTone,z=useMobileUiText("profilePicker",PROFILE_PICKER_TEXT),D=useMemo(()=>({...z,...I}),[z,I]),[B,U]=useState(null),[X,$]=useState(null),[q,Z]=useState(!1),[G,K]=useState(t);t!==G&&(K(t),U(null));const N=n||a,W=B??t??null,Q=useMemo(()=>W?{uri:W}:void 0,[W]),Y=j??X??void 0,J=!N&&(null!==B||Boolean(t)&&Boolean(l)),ee=s.length>0||J,re=SIZE_PX[u],te=resolveRadius(m,re),oe=te*(1-Math.SQRT1_2),se=clamp(Math.round(.28*re),24,44),ie=oe-se/2,le=Math.max(0,-ie),ne=useCallback(e=>{$(e),E?.(e),!1!==S&&triggerHaptic("notificationError")},[E,S]),ae=useCallback(async e=>{let r;try{r=await e.pick()}catch(e){return void ne(e instanceof Error?e.message:String(e))}const t=r?.[0];if(!t)return;if("number"==typeof d&&"number"==typeof t.size&&t.size>1024*d*1024)return void ne(fillText(D.errorTooLarge,{maxSizeMB:d}));if(t.type&&!matchesAccept(t.type,c))return void ne(D.errorWrongType);$(null),U(t.uri);const o=resolveHaptic(S,"selection");o&&triggerHaptic(o),i?.(t)},[d,c,D,S,i,ne]),ce=useCallback(()=>{if(N)return;me.current=null;const[e]=s;void 0===e||1!==s.length||J?(s.length>0||J)&&Z(!0):ae(e)},[N,s,J,ae]),de=useCallback(()=>{U(null),$(null);const e=resolveHaptic(S,"selection");e&&triggerHaptic(e),l?.()},[S,l]),ue=useMemo(()=>{const e=s.map(e=>({kind:"source",source:e}));return J&&e.push({kind:"remove"}),e},[s,J]),me=useRef(null),pe=useCallback(e=>{me.current||(Z(!1),"remove"===e.kind?de():me.current=e.source)},[de]),fe=useRef(ae);fe.current=ae;const ge=useCallback(()=>{const e=me.current;me.current=null,e&&fe.current(e)},[]),be=w??"profile-picker",he=V??(ee?D.pick:o),xe=_jsx(View,{style:{width:re,height:re,marginBottom:le,marginRight:le},children:_jsxs(Pressable,{onPress:ce,disabled:N||!ee,accessibilityRole:ee?"button":"image",accessibilityLabel:he,accessibilityHint:fieldTextAsString(Y),accessibilityState:ee?{disabled:N,busy:n}:{busy:n},"aria-disabled":ee?N:void 0,"aria-busy":n,testID:`${be}-button`,style:({pressed:e})=>[{width:re,height:re,borderRadius:te,...smoothCorners},{opacity:a?.55:e?.85:1}],children:[_jsx(View,{importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,pointerEvents:"none",children:_jsx(Avatar,{testID:w?`${w}-avatar`:void 0,dimension:re,shape:m,name:o||void 0,source:Q,ImageComponent:T,tone:H,backgroundColor:h,color:x,placeholderIcon:"user"})}),n?_jsx(View,{style:[styles.fill,styles.overlay,{borderRadius:te,...smoothCorners,backgroundColor:A.colors.scrim}],testID:`${be}-loading`,children:_jsx(Spinner,{size:re>=100?"md":"sm",color:A.colors["on-primary"]})}):null,!a&&ee?_jsx(View,{pointerEvents:"none",testID:`${be}-badge`,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,style:[styles.badge,{width:se,height:se,borderRadius:A.radius.pill,...smoothCorners,right:ie,bottom:ie,backgroundColor:L.fill,borderColor:L.ring}],children:renderSlotIcon(p,{color:L.icon,size:Math.round(.55*se),disabled:!1})}):null]})}),ye="stacked"!==C?_jsxs(View,{style:[styles.meta,"profile"===C?styles.metaCentred:null],children:[P?_jsx(Text,{variant:"body",weight:"semibold",style:[styles.title,"profile"===C?styles.textCentred:null],children:P}):null,_?_jsx(Text,{variant:"bodySmall",color:"secondary",style:[styles.subtitle,"profile"===C?styles.textCentred:null,{marginTop:A.space.xxs}],children:_}):null,_jsx(FieldMessage,{text:Y??v,error:hasFieldText(Y)})]}):_jsx(FieldMessage,{text:Y??v,error:hasFieldText(Y)});return _jsxs(View,{ref:r,style:F,testID:w,children:[y?_jsx(FieldLabel,{required:k,children:y}):null,_jsxs(View,{style:"inline"===C?[styles.row,{columnGap:A.space.md}]:["profile"===C?styles.columnCentred:styles.column,{rowGap:A.space.xs}],children:[xe,ye]}),_jsx(OptionSheet,{open:q,haptic:S,onClose:()=>Z(!1),onAfterClose:ge,title:D.sheetTitle,options:ue,getOptionLabel:e=>"remove"===e.kind?D.remove:e.source.label,getOptionValue:e=>"remove"===e.kind?REMOVE_VALUE:e.source.key,destructiveOf:e=>"remove"===e.kind,getOptionDescription:e=>"remove"===e.kind?void 0:e.source.description,getOptionIcon:e=>"remove"===e.kind?_jsx(AppIcon,{name:"trash",size:20,color:A.colors["danger-text"]}):e.source.icon,onChange:(e,r)=>pe(r)})]})}ProfilePicker.displayName="ProfilePicker";const styles=StyleSheet.create({fill:{alignItems:"center",justifyContent:"center",overflow:"hidden"},overlay:{...StyleSheet.absoluteFill},badge:{position:"absolute",alignItems:"center",justifyContent:"center",borderWidth:2},row:{flexDirection:"row",alignItems:"center"},column:{alignItems:"flex-start"},columnCentred:{alignItems:"center"},meta:{flexShrink:1},metaCentred:{alignItems:"center"},title:{includeFontPadding:!1},subtitle:{includeFontPadding:!1},textCentred:{textAlign:"center"}});export{ProfilePicker};export default ProfilePicker;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_PROFILE_PICKER_LABELS,default,ProfilePicker}from"./ProfilePicker.js";
1
+ "use strict";export{default,ProfilePicker}from"./ProfilePicker.js";
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{createAnimatedValue,Gradient,setNativeValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_PROGRESS_BAR_LABELS=Object.freeze({loading:"Loading"});const toneColor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},DETERMINATE_ANIMATION_DURATION=400,INDETERMINATE_LOOP_DURATION=1500,INDETERMINATE_WIDTH="30%",GLOW_LOCATIONS=[0,.35,.5,.65,1],glowOf=e=>{const t=tintOf(e,0,"transparent"),r=tintOf(e,.6,e);return{colors:[t,r,e,r,t],locations:GLOW_LOCATIONS,start:{x:0,y:.5},end:{x:1,y:.5}}},clampProgress=e=>"number"!=typeof e||Number.isNaN(e)||e<0?0:e>1?1:e,ProgressBar=forwardRef((e,t)=>{const r=useTheme(),s=useReducedMotion(),{progress:i,label:n,showPercent:a=!1,valueLabel:o,indeterminate:l,height:u=6,radius:c,tone:d="primary",trackColor:m,barColor:g,gradient:p,segments:f,animated:h=!0,style:y,containerStyle:b,barStyle:w,accessibilityLabel:x,labels:R,testID:A}=e;assertValidValue("ProgressBar","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const j=useMemo(()=>({...DEFAULT_PROGRESS_BAR_LABELS,...R}),[R]),v=l??"number"!=typeof i,_=clampProgress(i),V=useRef(createAnimatedValue(_)).current,E=useRef(createAnimatedValue(0)).current,O=useRef(createAnimatedValue(0)).current,S=useRef(0),T=useMemo(()=>buildStyles(r),[r]),N=c??r.radius.pill,D=m??r.colors["surface-disabled"],B=g??toneColor(r,d),L=useMemo(()=>{if(null==p)return null;if("string"!=typeof p)return p;const e=r.settings.gradients[p];if(void 0===e){const e=Object.keys(r.settings.gradients);throw new RangeError(`[@webority/mobile-ui] <ProgressBar> received gradient="${p}", which is not a gradient in theme.settings.gradients (${e.length>0?`known: ${e.map(e=>`"${e}"`).join(", ")}`:"the theme defines none"}). Pass a known gradient name or a GradientDefinition, or omit the prop.`)}return e},[p,r.settings.gradients]),I=useMemo(()=>glowOf(B),[B]),M=Array.isArray(f)&&f.length>0,P=useMemo(()=>(f??[]).map((e,t)=>({key:`segment-${t}`,segment:e})),[f]);useEffect(()=>{v||(h?Animated.timing(V,{toValue:_,duration:400,easing:Easing.bezier(...r.motion.ease["in-out"]),useNativeDriver:!1}).start():V.setValue(_))},[h,_,V,v,r]),useEffect(()=>{if(!v)return;setNativeValue(E,0);const e=Animated.loop(Animated.timing(E,{toValue:1,duration:1500,easing:Easing.inOut(Easing.ease),useNativeDriver:nativeDriver}));return e.start(),()=>{e.stop()}},[v,E]);const C=V.interpolate({inputRange:[0,1],outputRange:["0%","100%"]}),k=E.interpolate({inputRange:[0,1],outputRange:[-1,1]}),G=E.interpolate({inputRange:[0,.5,1],outputRange:[.4,1,.4]}),F=a&&!v&&!M,$=null!=n||F||null!=o,U=_jsx(View,{ref:t,accessibilityRole:"progressbar",accessibilityLabel:x??("string"==typeof n?n:void 0),accessibilityValue:v?{text:j.loading}:{min:0,max:100,now:Math.round(100*_)},testID:A,onLayout:e=>{const t=e.nativeEvent.layout.width;S.current=t,setNativeValue(O,t)},style:[T.track,{height:u,borderRadius:N,...smoothCorners,backgroundColor:D},b,y],children:M?_jsx(View,{style:[T.segments,{height:u}],children:P.map(({key:e,segment:t})=>_jsx(View,{style:{width:100*clampProgress(t.value)+"%",height:u,backgroundColor:t.color??toneColor(r,t.tone??"primary")}},e))}):_jsx(Animated.View,v?{style:[T.indeterminateBar,{height:u,width:s?"100%":"30%",opacity:s?G:1,transform:s?[]:[{translateX:Animated.multiply(k,O)}]},w],children:_jsx(Gradient,{gradient:I,style:StyleSheet.absoluteFill})}:{style:[T.determinateBar,{height:u,borderRadius:N,...smoothCorners,backgroundColor:L?"transparent":B,width:C,overflow:L?"hidden":void 0},w],children:L?_jsx(Gradient,{gradient:L,style:StyleSheet.absoluteFill}):null})});return $?_jsxs(View,{style:T.wrapper,children:[_jsxs(View,{style:[T.labelRow,{marginBottom:r.space.xs}],children:["string"==typeof n||"number"==typeof n?_jsx(Text,{variant:"label",color:"primary",style:T.label,children:n}):_jsx(View,{style:T.label,children:n}),null!=o?"string"==typeof o||"number"==typeof o?_jsx(Text,{variant:"label",color:"secondary",accessible:!1,importantForAccessibility:"no",children:o}):o:F?_jsx(Text,{variant:"label",color:"secondary",accessible:!1,importantForAccessibility:"no",children:`${Math.round(100*_)}%`}):null]}),U]}):U});ProgressBar.displayName="ProgressBar";const buildStyles=e=>StyleSheet.create({wrapper:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",columnGap:e.space.sm},label:{flexShrink:1},track:{width:"100%",overflow:"hidden"},determinateBar:{position:"absolute",left:0,top:0},indeterminateBar:{position:"absolute",left:0,top:0},segments:{flexDirection:"row",width:"100%"}});export{ProgressBar};export default ProgressBar;
1
+ "use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useMobileUiText}from"../../text/index.js";import{PROGRESS_BAR_TEXT}from"../../text/phone/progressBar.g.js";import{createAnimatedValue,Gradient,setNativeValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const toneColor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},DETERMINATE_ANIMATION_DURATION=400,INDETERMINATE_LOOP_DURATION=1500,INDETERMINATE_WIDTH="30%",GLOW_LOCATIONS=[0,.35,.5,.65,1],glowOf=e=>{const t=tintOf(e,0,"transparent"),r=tintOf(e,.6,e);return{colors:[t,r,e,r,t],locations:GLOW_LOCATIONS,start:{x:0,y:.5},end:{x:1,y:.5}}},clampProgress=e=>"number"!=typeof e||Number.isNaN(e)||e<0?0:e>1?1:e,ProgressBar=forwardRef((e,t)=>{const r=useTheme(),s=useReducedMotion(),{progress:i,label:o,showPercent:n=!1,valueLabel:a,indeterminate:l,height:u=6,radius:c,tone:d="primary",trackColor:m,barColor:g,gradient:p,segments:f,animated:h=!0,style:y,barStyle:b,accessibilityLabel:w,labels:x,testID:R}=e;assertValidValue("ProgressBar","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const j=useMobileUiText("progressBar",PROGRESS_BAR_TEXT),v=useMemo(()=>({...j,...x}),[j,x]),A=l??"number"!=typeof i,T=clampProgress(i),V=useRef(createAnimatedValue(T)).current,_=useRef(createAnimatedValue(0)).current,E=useRef(createAnimatedValue(0)).current,N=useRef(0),O=useMemo(()=>buildStyles(r),[r]),S=c??r.radius.pill,M=m??r.colors["surface-disabled"],B=g??toneColor(r,d),D=useMemo(()=>{if(null==p)return null;if("string"!=typeof p)return p;const e=r.settings.gradients[p];if(void 0===e){const e=Object.keys(r.settings.gradients);throw new RangeError(`[@webority/mobile-ui] <ProgressBar> received gradient="${p}", which is not a gradient in theme.settings.gradients (${e.length>0?`known: ${e.map(e=>`"${e}"`).join(", ")}`:"the theme defines none"}). Pass a known gradient name or a GradientDefinition, or omit the prop.`)}return e},[p,r.settings.gradients]),I=useMemo(()=>glowOf(B),[B]),P=Array.isArray(f)&&f.length>0,C=useMemo(()=>(f??[]).map((e,t)=>({key:`segment-${t}`,segment:e})),[f]);useEffect(()=>{A||(h?Animated.timing(V,{toValue:T,duration:400,easing:Easing.bezier(...r.motion.ease["in-out"]),useNativeDriver:!1}).start():V.setValue(T))},[h,T,V,A,r]),useEffect(()=>{if(!A)return;setNativeValue(_,0);const e=Animated.loop(Animated.timing(_,{toValue:1,duration:1500,easing:Easing.inOut(Easing.ease),useNativeDriver:nativeDriver}));return e.start(),()=>{e.stop()}},[A,_]);const k=V.interpolate({inputRange:[0,1],outputRange:["0%","100%"]}),G=_.interpolate({inputRange:[0,1],outputRange:[-1,1]}),L=_.interpolate({inputRange:[0,.5,1],outputRange:[.4,1,.4]}),$=n&&!A&&!P,F=null!=o||$||null!=a,U=_jsx(View,{ref:t,accessibilityRole:"progressbar",accessibilityLabel:w??("string"==typeof o?o:void 0),accessibilityValue:A?{text:v.loading}:{min:0,max:100,now:Math.round(100*T)},testID:R,onLayout:e=>{const t=e.nativeEvent.layout.width;N.current=t,setNativeValue(E,t)},style:[O.track,{height:u,borderRadius:S,...smoothCorners,backgroundColor:M},y],children:P?_jsx(View,{style:[O.segments,{height:u}],children:C.map(({key:e,segment:t})=>_jsx(View,{style:{width:100*clampProgress(t.value)+"%",height:u,backgroundColor:t.color??toneColor(r,t.tone??"primary")}},e))}):_jsx(Animated.View,A?{style:[O.indeterminateBar,{height:u,width:s?"100%":"30%",opacity:s?L:1,transform:s?[]:[{translateX:Animated.multiply(G,E)}]},b],children:_jsx(Gradient,{gradient:I,style:StyleSheet.absoluteFill})}:{style:[O.determinateBar,{height:u,borderRadius:S,...smoothCorners,backgroundColor:D?"transparent":B,width:k,overflow:D?"hidden":void 0},b],children:D?_jsx(Gradient,{gradient:D,style:StyleSheet.absoluteFill}):null})});return F?_jsxs(View,{style:O.wrapper,children:[_jsxs(View,{style:[O.labelRow,{marginBottom:r.space.xs}],children:["string"==typeof o||"number"==typeof o?_jsx(Text,{variant:"label",color:"primary",style:O.label,children:o}):_jsx(View,{style:O.label,children:o}),null!=a?"string"==typeof a||"number"==typeof a?_jsx(Text,{variant:"label",color:"secondary",accessible:!1,importantForAccessibility:"no",children:a}):a:$?_jsx(Text,{variant:"label",color:"secondary",accessible:!1,importantForAccessibility:"no",children:`${Math.round(100*T)}%`}):null]}),U]}):U});ProgressBar.displayName="ProgressBar";const buildStyles=e=>StyleSheet.create({wrapper:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",columnGap:e.space.sm},label:{flexShrink:1},track:{width:"100%",overflow:"hidden"},determinateBar:{position:"absolute",left:0,top:0},indeterminateBar:{position:"absolute",left:0,top:0},segments:{flexDirection:"row",width:"100%"}});export{ProgressBar};export default ProgressBar;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_PROGRESS_BAR_LABELS,default,ProgressBar}from"./ProgressBar.js";
1
+ "use strict";export{default,ProgressBar}from"./ProgressBar.js";
@@ -1 +1 @@
1
- "use strict";import{Logger}from"@webority/mobile-core";import{createContext,forwardRef,useContext,useMemo}from"react";import{Pressable,StyleSheet}from"react-native";import{spaceOf,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{fieldTextAsString,hasFieldText}from"../FieldBase/index.js";import{ChoiceText,hasChoiceDetail}from"../FieldBase/ChoiceText.js";import{RadioDot}from"./RadioDot.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const RadioGroupContext=createContext(null);export const useRadioGroup=()=>useContext(RadioGroupContext);const toneColor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;default:return e.colors.primary}},Radio=forwardRef((e,t)=>{const{value:r,selected:o,onChange:i,disabled:s=!1,label:a,helperText:l,description:c,error:n,size:d="md",tone:p="primary",accessibilityLabel:u,haptic:m,style:h,containerStyle:x,circleStyle:f,dotStyle:b,labelStyle:g,testID:y,hitSlop:S,...R}=e;assertValidValue("Radio","size",e.size,["sm","md","lg"]),assertValidValue("Radio","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const w=useTheme(),C=useMemo(()=>buildStyles(w),[w]),T=useRadioGroup();__DEV__&&void 0===r&&Logger.warn("[@webority/mobile-ui] Radio was rendered without a `value`. Selection compares against it, so the group cannot track which option is chosen.");const j=T?T.selectedValue===r:!!o,V=T&&T.disabled||s,D=toneColor(w,p),_=spaceOf(w,w.components.radio["label-gap"]),v=S??6,H=u??fieldTextAsString(a),k="string"==typeof n?n:void 0,L={description:c,helperText:l,error:k},z=!0===T?.error||!0===n||hasFieldText(n);return _jsxs(Pressable,{ref:t,onPress:e=>{if(V)return;const t=resolveHaptic(m,"selection");t&&triggerHaptic(t),T?T.onChange(r):i?.(r)},disabled:V,accessibilityRole:"radio",accessibilityLabel:H,accessibilityHint:R.accessibilityHint??fieldTextAsString(l)??fieldTextAsString(c),accessibilityState:{checked:j,disabled:V},"aria-checked":j,"aria-disabled":V,testID:y,hitSlop:v,...hitSlopMarker(v),...R,style:({pressed:e})=>[C.row,hasChoiceDetail(L)?C.rowTop:null,{opacity:V?.55:e?.85:1},x,h],children:[_jsx(RadioDot,{selected:j,color:D,disabled:V&&!j,size:d,style:[!z||j||V?null:{borderColor:w.colors["field-border-error"]},f],dotStyle:b}),_jsx(ChoiceText,{label:a,helperText:l,description:c,error:k,disabled:V,style:{marginLeft:_},labelStyle:g})]})});Radio.displayName="Radio";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},rowTop:{alignItems:"flex-start"}});export{Radio};export default Radio;
1
+ "use strict";import{Logger}from"@webority/mobile-core";import{createContext,forwardRef,useContext,useMemo}from"react";import{Pressable,StyleSheet}from"react-native";import{spaceOf,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{fieldTextAsString,hasFieldText}from"../FieldBase/index.js";import{ChoiceText,hasChoiceDetail}from"../FieldBase/ChoiceText.js";import{RadioDot}from"./RadioDot.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const RadioGroupContext=createContext(null);export const useRadioGroup=()=>useContext(RadioGroupContext);const toneColor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;default:return e.colors.primary}},Radio=forwardRef((e,t)=>{const{value:r,selected:o,onChange:i,disabled:s=!1,label:a,helperText:l,description:c,error:n,size:d="md",tone:p="primary",accessibilityLabel:u,haptic:m,style:h,circleStyle:x,dotStyle:f,labelStyle:b,testID:g,hitSlop:y,...S}=e;assertValidValue("Radio","size",e.size,["sm","md","lg"]),assertValidValue("Radio","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const R=useTheme(),w=useMemo(()=>buildStyles(R),[R]),C=useRadioGroup();__DEV__&&void 0===r&&Logger.warn("[@webority/mobile-ui] Radio was rendered without a `value`. Selection compares against it, so the group cannot track which option is chosen.");const T=C?C.selectedValue===r:!!o,j=C&&C.disabled||s,V=toneColor(R,p),D=spaceOf(R,R.components.radio["label-gap"]),_=y??6,v=u??fieldTextAsString(a),H="string"==typeof n?n:void 0,k={description:c,helperText:l,error:H},L=!0===C?.error||!0===n||hasFieldText(n);return _jsxs(Pressable,{ref:t,onPress:e=>{if(j)return;const t=resolveHaptic(m,"selection");t&&triggerHaptic(t),C?C.onChange(r):i?.(r)},disabled:j,accessibilityRole:"radio",accessibilityLabel:v,accessibilityHint:S.accessibilityHint??fieldTextAsString(l)??fieldTextAsString(c),accessibilityState:{checked:T,disabled:j},"aria-checked":T,"aria-disabled":j,testID:g,hitSlop:_,...hitSlopMarker(_),...S,style:({pressed:e})=>[w.row,hasChoiceDetail(k)?w.rowTop:null,{opacity:j?.55:e?.85:1},h],children:[_jsx(RadioDot,{selected:T,color:V,disabled:j&&!T,size:d,style:[!L||T||j?null:{borderColor:R.colors["field-border-error"]},x],dotStyle:f}),_jsx(ChoiceText,{label:a,helperText:l,description:c,error:H,disabled:j,style:{marginLeft:D},labelStyle:b})]})});Radio.displayName="Radio";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},rowTop:{alignItems:"flex-start"}});export{Radio};export default Radio;
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const RATING_SIZES=["sm","md","lg"],RATING_TONES=["primary","success","warning","danger","info","neutral"];export const DEFAULT_RATING_LABELS=Object.freeze({value:(e,t)=>`${e} of ${t} stars`});const sizePxMap={sm:16,md:24,lg:32},resolveSize=e=>sizePxMap[e],PULSE_SCALE=1.2,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},clampToStep=(e,t,s)=>{const i=Math.max(0,Math.min(t,e)),r=Math.round(i/s)*s;return Number(r.toFixed(2))},Star=({index:e,filled:t,size:s,filledColor:i,emptyColor:r,scale:a})=>{const n=Math.max(0,Math.min(1,t-e));return _jsxs(Animated.View,{style:[starStyles.starWrap,{width:s,height:s,transform:[{scale:a}]}],children:[_jsx(Text,{variant:"body",style:[starStyles.glyph,{color:r,fontSize:s,lineHeight:s}],accessible:!1,children:"☆"}),n>0?_jsx(View,{pointerEvents:"none",style:[starStyles.fillClip,{width:s*n,height:s}],children:_jsx(Text,{variant:"body",style:[starStyles.glyph,{color:i,fontSize:s,lineHeight:s}],accessible:!1,children:"★"})}):null]})},RatingRoot=forwardRef((e,t)=>{const{value:s,onChange:i,max:r=5,allowHalf:a=!0,readonly:n=!1,size:o="md",tone:l="warning",label:c,loading:m=!1,haptic:u,labels:d,accessibilityLabel:p,style:y,containerStyle:g,starContainerStyle:f,testID:h}=e;assertValidValue("Rating","size",e.size,RATING_SIZES),assertValidValue("Rating","tone",e.tone,RATING_TONES);const x=useMemo(()=>({...DEFAULT_RATING_LABELS,...d}),[d]),S=useTheme(),b=useMemo(()=>buildStyles(S),[S]),v=!n&&"function"==typeof i,w=a?.5:1,R=resolveSize(o),j=toneColorFor(S,l),_=S.colors.border,A=useRef(R),k=useCallback(e=>{A.current=e.nativeEvent.layout.width},[]),T=useRef(new Map),V=useMemo(()=>{const e=T.current,t=[];for(let s=0;s<r;s+=1){let i=e.get(s);i||(i=new Animated.Value(1),e.set(s,i)),t.push(i)}for(const t of Array.from(e.keys()))t>=r&&e.delete(t);return t},[r]),C=S.settings.components.rating?.pulseOnPress??!1,E=useCallback(e=>{const t=V[e];if(!t)throw new Error(`Rating has no star at index ${e}; the pulse index must be below max.`);Animated.sequence([Animated.timing(t,{toValue:1.2,duration:S.motion.duration.fast,easing:Easing.bezier(...S.motion.ease["in-out"]),useNativeDriver:nativeDriver}),Animated.spring(t,{toValue:1,damping:S.motion.spring.bouncy.damping,stiffness:S.motion.spring.bouncy.stiffness,mass:S.motion.spring.bouncy.mass,useNativeDriver:nativeDriver})]).start()},[S.motion,V]),M=useCallback((e,t)=>{if(!v||!i)return;const s=clampToStep(e,r,w),a=resolveHaptic(u,"selection");a&&triggerHaptic(a),C&&"number"==typeof t&&E(t),i(s)},[v,i,r,w,E,u,C]),z=useCallback(e=>t=>{if(!v)return;const s=A.current||R,i=t.nativeEvent.locationX??s;let r;r=a&&i<s/2?e+.5:e+1,M(r,e)},[v,R,a,M]),N=useCallback(e=>{v&&("increment"===e.nativeEvent.actionName?M(s+w):"decrement"===e.nativeEvent.actionName&&M(s-w))},[v,s,w,M]),D=x.value(s,r),I=p??c??D,L=[];for(const[e,t]of V.entries()){const i=_jsx(Star,{index:e,filled:s,size:R,filledColor:j,emptyColor:_,scale:t},e);L.push(v?_jsx(Pressable,{onPress:z(e),onLayout:0===e?k:void 0,hitSlop:4,...hitSlopMarker(4),accessible:!1,style:b.starPress,children:i},e):_jsx(View,{onLayout:0===e?k:void 0,style:b.starPress,children:i},e))}const P=_jsxs(View,{style:[b.wrapper,g,y],ref:t,testID:h,children:[c?_jsx(Text,{variant:"bodySmall",color:"secondary",style:b.label,children:c}):null,_jsx(View,{style:[b.row,f],accessible:!0,accessibilityRole:v?"adjustable":"text",accessibilityLabel:I,accessibilityValue:v?{min:0,max:r,now:s,text:D}:void 0,accessibilityActions:v?[{name:"increment"},{name:"decrement"}]:void 0,onAccessibilityAction:v?N:void 0,children:L})]});return m?_jsx(RatingSkeleton,{...e}):P});RatingRoot.displayName="Rating";const RatingSkeleton=({max:e=5,size:t="md",label:s,containerStyle:i,starContainerStyle:r,style:a})=>{const n=useTheme(),o=resolveSize(t),l=Math.max(1,e),c=useMemo(()=>Array.from({length:l},(e,t)=>({key:`sk-star-${t}`,index:t})),[l]);return _jsxs(View,{style:[{alignItems:"flex-start"},i,a],accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==s?_jsx(Skeleton,{shape:"text",width:80,height:14,style:{marginBottom:n.space.xs}}):null,_jsx(View,{style:[{flexDirection:"row"},r],children:c.map(({key:e,index:t})=>_jsx(Skeleton,{width:o,height:o,radius:Math.round(.25*o),style:t<l-1?{marginRight:n.space.xs}:void 0},e))})]})};RatingSkeleton.displayName="RatingSkeleton";const Rating=Object.assign(RatingRoot,{Skeleton:RatingSkeleton}),starStyles=StyleSheet.create({starWrap:{position:"relative",alignItems:"flex-start",justifyContent:"center"},glyph:{textAlign:"left",includeFontPadding:!1},fillClip:{position:"absolute",top:0,left:0,overflow:"hidden"}}),buildStyles=e=>StyleSheet.create({wrapper:{flexDirection:"column"},row:{flexDirection:"row",alignItems:"center"},starPress:{marginRight:e.space.xs},label:{marginBottom:e.space.xs}});export{Rating};export default Rating;
1
+ "use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{RATING_TEXT}from"../../text/phone/rating.g.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const RATING_SIZES=["sm","md","lg"],RATING_TONES=["primary","success","warning","danger","info","neutral"],sizePxMap={sm:16,md:24,lg:32},resolveSize=e=>sizePxMap[e],PULSE_SCALE=1.2,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},clampToStep=(e,t,s)=>{const i=Math.max(0,Math.min(t,e)),r=Math.round(i/s)*s;return Number(r.toFixed(2))},Star=({index:e,filled:t,size:s,filledColor:i,emptyColor:r,scale:a})=>{const n=Math.max(0,Math.min(1,t-e));return _jsxs(Animated.View,{style:[starStyles.starWrap,{width:s,height:s,transform:[{scale:a}]}],children:[_jsx(Text,{variant:"body",style:[starStyles.glyph,{color:r,fontSize:s,lineHeight:s}],accessible:!1,children:"☆"}),n>0?_jsx(View,{pointerEvents:"none",style:[starStyles.fillClip,{width:s*n,height:s}],children:_jsx(Text,{variant:"body",style:[starStyles.glyph,{color:i,fontSize:s,lineHeight:s}],accessible:!1,children:"★"})}):null]})},RatingRoot=forwardRef((e,t)=>{const{value:s,onChange:i,max:r=5,allowHalf:a=!0,readonly:n=!1,size:o="md",tone:l="warning",label:c,loading:m=!1,haptic:u,labels:d,accessibilityLabel:p,style:g,starContainerStyle:x,testID:y}=e;assertValidValue("Rating","size",e.size,RATING_SIZES),assertValidValue("Rating","tone",e.tone,RATING_TONES);const f=useMobileUiText("rating",RATING_TEXT),h=useMemo(()=>({...f,...d}),[f,d]),b=useTheme(),S=useMemo(()=>buildStyles(b),[b]),v=!n&&"function"==typeof i,w=a?.5:1,R=resolveSize(o),j=toneColorFor(b,l),T=b.colors.border,_=useRef(R),k=useCallback(e=>{_.current=e.nativeEvent.layout.width},[]),V=useRef(new Map),A=useMemo(()=>{const e=V.current,t=[];for(let s=0;s<r;s+=1){let i=e.get(s);i||(i=new Animated.Value(1),e.set(s,i)),t.push(i)}for(const t of Array.from(e.keys()))t>=r&&e.delete(t);return t},[r]),C=b.settings.components.rating?.pulseOnPress??!1,M=useCallback(e=>{const t=A[e];if(!t)throw new Error(`Rating has no star at index ${e}; the pulse index must be below max.`);Animated.sequence([Animated.timing(t,{toValue:1.2,duration:b.motion.duration.fast,easing:Easing.bezier(...b.motion.ease["in-out"]),useNativeDriver:nativeDriver}),Animated.spring(t,{toValue:1,damping:b.motion.spring.bouncy.damping,stiffness:b.motion.spring.bouncy.stiffness,mass:b.motion.spring.bouncy.mass,useNativeDriver:nativeDriver})]).start()},[b.motion,A]),E=useCallback((e,t)=>{if(!v||!i)return;const s=clampToStep(e,r,w),a=resolveHaptic(u,"selection");a&&triggerHaptic(a),C&&"number"==typeof t&&M(t),i(s)},[v,i,r,w,M,u,C]),N=useCallback(e=>t=>{if(!v)return;const s=_.current||R,i=t.nativeEvent.locationX??s;let r;r=a&&i<s/2?e+.5:e+1,E(r,e)},[v,R,a,E]),z=useCallback(e=>{v&&("increment"===e.nativeEvent.actionName?E(s+w):"decrement"===e.nativeEvent.actionName&&E(s-w))},[v,s,w,E]),I=fillText(h.value,{value:s,max:r}),D=p??c??I,P=[];for(const[e,t]of A.entries()){const i=_jsx(Star,{index:e,filled:s,size:R,filledColor:j,emptyColor:T,scale:t},e);P.push(v?_jsx(Pressable,{onPress:N(e),onLayout:0===e?k:void 0,hitSlop:4,...hitSlopMarker(4),accessible:!1,style:S.starPress,children:i},e):_jsx(View,{onLayout:0===e?k:void 0,style:S.starPress,children:i},e))}const H=_jsxs(View,{style:[S.wrapper,g],ref:t,testID:y,children:[c?_jsx(Text,{variant:"bodySmall",color:"secondary",style:S.label,children:c}):null,_jsx(View,{style:[S.row,x],accessible:!0,accessibilityRole:v?"adjustable":"text",accessibilityLabel:D,accessibilityValue:v?{min:0,max:r,now:s,text:I}:void 0,accessibilityActions:v?[{name:"increment"},{name:"decrement"}]:void 0,onAccessibilityAction:v?z:void 0,children:P})]});return m?_jsx(RatingSkeleton,{...e}):H});RatingRoot.displayName="Rating";const RatingSkeleton=({max:e=5,size:t="md",label:s,starContainerStyle:i,style:r})=>{const a=useTheme(),n=resolveSize(t),o=Math.max(1,e),l=useMemo(()=>Array.from({length:o},(e,t)=>({key:`sk-star-${t}`,index:t})),[o]);return _jsxs(View,{style:[{alignItems:"flex-start"},r],accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[void 0!==s?_jsx(Skeleton,{shape:"text",width:80,height:14,style:{marginBottom:a.space.xs}}):null,_jsx(View,{style:[{flexDirection:"row"},i],children:l.map(({key:e,index:t})=>_jsx(Skeleton,{width:n,height:n,radius:Math.round(.25*n),style:t<o-1?{marginRight:a.space.xs}:void 0},e))})]})};RatingSkeleton.displayName="RatingSkeleton";const Rating=Object.assign(RatingRoot,{Skeleton:RatingSkeleton}),starStyles=StyleSheet.create({starWrap:{position:"relative",alignItems:"flex-start",justifyContent:"center"},glyph:{textAlign:"left",includeFontPadding:!1},fillClip:{position:"absolute",top:0,left:0,overflow:"hidden"}}),buildStyles=e=>StyleSheet.create({wrapper:{flexDirection:"column"},row:{flexDirection:"row",alignItems:"center"},starPress:{marginRight:e.space.xs},label:{marginBottom:e.space.xs}});export{Rating};export default Rating;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_RATING_LABELS,default,Rating}from"./Rating.js";
1
+ "use strict";export{default,Rating}from"./Rating.js";
@@ -1 +1 @@
1
- "use strict";import{useCallback,useMemo,useRef}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{IconButton}from"../IconButton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";let rowIdCounter=0;const nextRowId=()=>(rowIdCounter+=1,`row-${rowIdCounter}`);export const DEFAULT_REPEATER_LABELS=Object.freeze({add:"Add another",empty:"",row:null,removeRow:e=>`Remove ${e}`,fallbackRow:e=>`row ${e+1}`});export const Repeater=({value:e,onChange:t,createRow:r,renderRow:o,labels:n,renderRowHeader:s,onRemove:i,minRows:a=0,maxRows:l,removable:c=!0,disabled:m=!1,haptic:u,style:p,testID:d})=>{const x=useTheme(),w=useMemo(()=>({...DEFAULT_REPEATER_LABELS,...n}),[n]),h=useRef([]);if(h.current.length<e.length)for(;h.current.length<e.length;)h.current.push(nextRowId());else h.current.length>e.length&&(h.current.length=e.length);const f="number"==typeof l&&e.length>=l,g=c&&e.length>a,R=useCallback(e=>{const t=resolveHaptic(u,e);t&&triggerHaptic(t)},[u]),j=useCallback(()=>{m||f||(t([...e,r()]),R("impactLight"))},[f,r,m,R,t,e]),v=useCallback((r,o)=>{t(e.map((e,t)=>t===r?o:e))},[t,e]),b=useCallback(r=>{if(m||!g)return;const o=e[r];if(void 0===o)throw new Error(`Repeater: no row at index ${r} to remove.`);h.current=h.current.filter((e,t)=>t!==r),i?.(r,o),t(e.filter((e,t)=>t!==r)),R("notificationWarning")},[g,m,R,t,i,e]);return _jsxs(View,{style:[{gap:x.space.md},p],testID:d,children:[0===e.length&&w.empty.length>0?_jsx(Text,{variant:"bodySmall",color:"tertiary",children:w.empty}):null,e.map((e,t)=>{const r={item:e,index:t,update:e=>v(t,e),remove:()=>b(t),canRemove:g};return _jsxs(View,{style:{gap:x.space.xs},children:[s?s(r):w.row||g&&!m?_jsxs(View,{style:styles.rowHeader,children:[w.row?_jsx(Text,{variant:"overline",color:"tertiary",children:w.row(t)}):_jsx(View,{}),g&&!m?_jsx(IconButton,{icon:({color:e,size:t})=>_jsx(AppIcon,{name:"x",size:t,color:e}),onPress:()=>b(t),accessibilityLabel:w.removeRow(w.row?w.row(t):w.fallbackRow(t)),size:"sm",tone:"danger",variant:"ghost",haptic:!1,testID:d?`${d}-remove-${t}`:void 0}):null]}):null,o(r)]},h.current[t])}),f||m?null:_jsx(Button,{label:w.add,onPress:j,variant:"outline",size:"sm",haptic:!1,testID:d?`${d}-add`:void 0})]})};const styles=StyleSheet.create({rowHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",minHeight:24}});export default Repeater;
1
+ "use strict";import{useCallback,useMemo,useRef}from"react";import{StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{REPEATER_TEXT}from"../../text/phone/repeater.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{IconButton}from"../IconButton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";let rowIdCounter=0;const nextRowId=()=>(rowIdCounter+=1,`row-${rowIdCounter}`);export const Repeater=({value:e,onChange:t,createRow:r,renderRow:o,labels:n,renderRowHeader:s,onRemove:i,minRows:l=0,maxRows:a,removable:c=!0,disabled:m=!1,haptic:u,style:p,testID:x})=>{const d=useTheme(),h=useMobileUiText("repeater",REPEATER_TEXT),w=useMemo(()=>({...h,empty:"",row:null,...n}),[h,n]),f=useRef([]);if(f.current.length<e.length)for(;f.current.length<e.length;)f.current.push(nextRowId());else f.current.length>e.length&&(f.current.length=e.length);const g="number"==typeof a&&e.length>=a,j=c&&e.length>l,R=useCallback(e=>{const t=resolveHaptic(u,e);t&&triggerHaptic(t)},[u]),v=useCallback(()=>{m||g||(t([...e,r()]),R("impactLight"))},[g,r,m,R,t,e]),b=useCallback((r,o)=>{t(e.map((e,t)=>t===r?o:e))},[t,e]),y=useCallback(r=>{if(m||!j)return;const o=e[r];if(void 0===o)throw new Error(`Repeater: no row at index ${r} to remove.`);f.current=f.current.filter((e,t)=>t!==r),i?.(r,o),t(e.filter((e,t)=>t!==r)),R("notificationWarning")},[j,m,R,t,i,e]);return _jsxs(View,{style:[{gap:d.space.md},p],testID:x,children:[0===e.length&&w.empty.length>0?_jsx(Text,{variant:"bodySmall",color:"tertiary",children:w.empty}):null,e.map((e,t)=>{const r={item:e,index:t,update:e=>b(t,e),remove:()=>y(t),canRemove:j};return _jsxs(View,{style:{gap:d.space.xs},children:[s?s(r):w.row||j&&!m?_jsxs(View,{style:styles.rowHeader,children:[w.row?_jsx(Text,{variant:"overline",color:"tertiary",children:w.row(t)}):_jsx(View,{}),j&&!m?_jsx(IconButton,{icon:({color:e,size:t})=>_jsx(AppIcon,{name:"x",size:t,color:e}),onPress:()=>y(t),accessibilityLabel:fillText(w.removeRow,{name:w.row?w.row(t):fillText(w.fallbackRow,{index:t+1})}),size:"sm",tone:"danger",variant:"ghost",haptic:!1,testID:x?`${x}-remove-${t}`:void 0}):null]}):null,o(r)]},f.current[t])}),g||m?null:_jsx(Button,{label:w.add,onPress:v,variant:"outline",size:"sm",haptic:!1,testID:x?`${x}-add`:void 0})]})};const styles=StyleSheet.create({rowHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",minHeight:24}});export default Repeater;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_REPEATER_LABELS,default,Repeater}from"./Repeater.js";
1
+ "use strict";export{default,Repeater}from"./Repeater.js";
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useMemo,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{fontFor,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{applyMarkdownAction,normalizeSelection}from"./markdownActions.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_RICH_TEXT_EDITOR_LABELS=Object.freeze({bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",code:"Inline code",link:"Link",heading1:"Heading 1",heading2:"Heading 2",bulletList:"Bulleted list",numberedList:"Numbered list",quote:"Quote"});const ACTION_GLYPH={bold:"B",italic:"I",strikethrough:"S",code:"</>",link:"link",heading1:"H1",heading2:"H2",bulletList:"•",numberedList:"1.",quote:">"},DEFAULT_ACTIONS=["bold","italic","strikethrough","code","link","heading1","heading2","bulletList","numberedList","quote"],DEFAULT_MIN_HEIGHT=160,TOOLBAR_GLYPH_MAX_SCALE=1.5;export const RichTextEditor=forwardRef((e,t)=>{const{value:o,onChangeText:i,placeholder:s,actions:l=DEFAULT_ACTIONS,disabled:r=!1,loading:n=!1,minHeight:a=DEFAULT_MIN_HEIGHT,autoFocus:d=!1,accessibilityLabel:c,haptic:h,labels:u,style:b,toolbarStyle:m,inputStyle:p,testID:x}=e,g=useTheme(),T=useMemo(()=>buildStyles(g),[g]),S=useMemo(()=>u?{...DEFAULT_RICH_TEXT_EDITOR_LABELS,...u}:DEFAULT_RICH_TEXT_EDITOR_LABELS,[u]),y=o??"",[_,k]=useState({start:0,end:0}),[f,L]=useState(!1),[I,E]=useState(null),j=useCallback(e=>{k(e.nativeEvent.selection),E(null)},[]),C=useCallback(e=>{E(null),i?.(e)},[i]),H=useCallback(e=>{if(r)return;const t=resolveHaptic(h,"selection");t&&triggerHaptic(t);const o=applyMarkdownAction({text:y,selection:normalizeSelection(_,y.length)},e);k(o.selection),E(o.selection),i?.(o.text)},[r,h,i,_,y]);return n?_jsx(RichTextEditorSkeleton,{actionCount:l.length,minHeight:a,style:b,testID:x}):_jsxs(View,{testID:x,style:[T.container,{borderColor:f?g.colors["focus-ring"]:g.colors.border,opacity:r?.55:1},b],children:[_jsx(View,{style:[T.toolbar,m],children:l.map(e=>_jsx(ToolbarButton,{action:e,label:S[e],disabled:r,onPress:H,styles:T,theme:g,testID:x?`${x}-${e}`:void 0},e))}),_jsx(TextInput,{ref:t,value:y,onChangeText:C,onSelectionChange:j,onFocus:()=>L(!0),onBlur:()=>L(!1),selection:I??void 0,editable:!r,autoFocus:d,multiline:!0,textAlignVertical:"top",placeholder:s,placeholderTextColor:g.colors["text-subtle"],accessibilityLabel:c,style:[T.input,{minHeight:a},p],testID:x?`${x}-input`:void 0})]})});RichTextEditor.displayName="RichTextEditor";const ToolbarButton=({action:e,label:t,disabled:o,onPress:i,styles:s,theme:l,testID:r})=>{const n={color:o?l.colors["text-disabled"]:l.colors["text-body"],..."bold"===e?{fontWeight:l.weight.bold}:{},..."italic"===e?{fontStyle:"italic"}:{},..."strikethrough"===e?{textDecorationLine:"line-through"}:{}};return _jsx(Pressable,{onPress:()=>i(e),disabled:o,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},"aria-disabled":o,hitSlop:4,...hitSlopMarker(4),testID:r,style:({pressed:e})=>[s.button,{backgroundColor:e?l.colors["surface-pressed"]:l.colors["bg-subtle"]}],children:_jsx(Text,{variant:"body",maxFontSizeMultiplier:Math.min(l.settings.maxFontSizeMultiplier??1.5,1.5),style:[s.buttonLabel,n],children:ACTION_GLYPH[e]})})};ToolbarButton.displayName="RichTextEditorToolbarButton";const RichTextEditorSkeleton=({actionCount:e,minHeight:t,style:o,testID:i})=>{const s=useTheme(),l=useMemo(()=>buildStyles(s),[s]),r=Array.from({length:Math.max(1,e)},(e,t)=>t);return _jsxs(View,{testID:i,style:[l.container,o],children:[_jsx(View,{style:l.toolbar,children:r.map(e=>_jsx(Skeleton,{width:34,height:30,radius:"sm"},e))}),_jsxs(View,{style:[l.skeletonBody,{minHeight:t}],children:[_jsx(Skeleton,{shape:"text",width:"94%",height:14}),_jsx(Skeleton,{shape:"text",width:"100%",height:14}),_jsx(Skeleton,{shape:"text",width:"72%",height:14})]})]})};RichTextEditorSkeleton.displayName="RichTextEditorSkeleton";const buildStyles=e=>StyleSheet.create({container:{borderWidth:e.size.border,borderColor:e.colors.border,borderRadius:e.radius.md,...smoothCorners,backgroundColor:e.colors.bg,overflow:"hidden"},toolbar:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,padding:e.space.xs,borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:e.colors["border-subtle"],backgroundColor:e.colors["bg-subtle"]},button:{minWidth:34,height:30,paddingHorizontal:e.space.xs,borderRadius:e.radius.sm,...smoothCorners,alignItems:"center",justifyContent:"center"},buttonLabel:{...fontFor(e,"medium"),fontSize:e.text.sm.size},input:{...fontFor(e,"normal"),color:e.colors["text-body"],fontSize:e.text.base.size,lineHeight:1.5*e.text.base.size,paddingHorizontal:e.space.md,paddingVertical:e.space.sm},skeletonBody:{paddingHorizontal:e.space.md,paddingVertical:e.space.sm,gap:e.space.sm}});export default RichTextEditor;
1
+ "use strict";import{forwardRef,useCallback,useMemo,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useMobileUiText}from"../../text/index.js";import{RICH_TEXT_EDITOR_TEXT}from"../../text/phone/richTextEditor.g.js";import{fontFor,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{applyMarkdownAction,normalizeSelection}from"./markdownActions.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ACTION_GLYPH={bold:"B",italic:"I",strikethrough:"S",code:"</>",link:"link",heading1:"H1",heading2:"H2",bulletList:"•",numberedList:"1.",quote:">"},DEFAULT_ACTIONS=["bold","italic","strikethrough","code","link","heading1","heading2","bulletList","numberedList","quote"],DEFAULT_MIN_HEIGHT=160,TOOLBAR_GLYPH_MAX_SCALE=1.5;export const RichTextEditor=forwardRef((e,t)=>{const{value:o,onChangeText:i,placeholder:s,actions:r=DEFAULT_ACTIONS,disabled:l=!1,loading:n=!1,minHeight:a=DEFAULT_MIN_HEIGHT,autoFocus:d=!1,accessibilityLabel:c,haptic:h,labels:u,style:b,toolbarStyle:m,inputStyle:x,testID:p}=e,g=useTheme(),T=useMemo(()=>buildStyles(g),[g]),S=useMobileUiText("richTextEditor",RICH_TEXT_EDITOR_TEXT),y=useMemo(()=>u?{...S,...u}:S,[S,u]),f=o??"",[_,k]=useState({start:0,end:0}),[j,C]=useState(!1),[I,E]=useState(null),H=useCallback(e=>{k(e.nativeEvent.selection),E(null)},[]),w=useCallback(e=>{E(null),i?.(e)},[i]),L=useCallback(e=>{if(l)return;const t=resolveHaptic(h,"selection");t&&triggerHaptic(t);const o=applyMarkdownAction({text:f,selection:normalizeSelection(_,f.length)},e);k(o.selection),E(o.selection),i?.(o.text)},[l,h,i,_,f]);return n?_jsx(RichTextEditorSkeleton,{actionCount:r.length,minHeight:a,style:b,testID:p}):_jsxs(View,{testID:p,style:[T.container,{borderColor:j?g.colors["focus-ring"]:g.colors.border,opacity:l?.55:1},b],children:[_jsx(View,{style:[T.toolbar,m],children:r.map(e=>_jsx(ToolbarButton,{action:e,label:y[e],disabled:l,onPress:L,styles:T,theme:g,testID:p?`${p}-${e}`:void 0},e))}),_jsx(TextInput,{ref:t,value:f,onChangeText:w,onSelectionChange:H,onFocus:()=>C(!0),onBlur:()=>C(!1),selection:I??void 0,editable:!l,autoFocus:d,multiline:!0,textAlignVertical:"top",placeholder:s,placeholderTextColor:g.colors["text-subtle"],accessibilityLabel:c,style:[T.input,{minHeight:a},x],testID:p?`${p}-input`:void 0})]})});RichTextEditor.displayName="RichTextEditor";const ToolbarButton=({action:e,label:t,disabled:o,onPress:i,styles:s,theme:r,testID:l})=>{const n={color:o?r.colors["text-disabled"]:r.colors["text-body"],..."bold"===e?{fontWeight:r.weight.bold}:{},..."italic"===e?{fontStyle:"italic"}:{},..."strikethrough"===e?{textDecorationLine:"line-through"}:{}};return _jsx(Pressable,{onPress:()=>i(e),disabled:o,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:o},"aria-disabled":o,hitSlop:4,...hitSlopMarker(4),testID:l,style:({pressed:e})=>[s.button,{backgroundColor:e?r.colors["surface-pressed"]:r.colors["bg-subtle"]}],children:_jsx(Text,{variant:"body",maxFontSizeMultiplier:Math.min(r.settings.maxFontSizeMultiplier??1.5,1.5),style:[s.buttonLabel,n],children:ACTION_GLYPH[e]})})};ToolbarButton.displayName="RichTextEditorToolbarButton";const RichTextEditorSkeleton=({actionCount:e,minHeight:t,style:o,testID:i})=>{const s=useTheme(),r=useMemo(()=>buildStyles(s),[s]),l=Array.from({length:Math.max(1,e)},(e,t)=>t);return _jsxs(View,{testID:i,style:[r.container,o],children:[_jsx(View,{style:r.toolbar,children:l.map(e=>_jsx(Skeleton,{width:34,height:30,radius:"sm"},e))}),_jsxs(View,{style:[r.skeletonBody,{minHeight:t}],children:[_jsx(Skeleton,{shape:"text",width:"94%",height:14}),_jsx(Skeleton,{shape:"text",width:"100%",height:14}),_jsx(Skeleton,{shape:"text",width:"72%",height:14})]})]})};RichTextEditorSkeleton.displayName="RichTextEditorSkeleton";const buildStyles=e=>StyleSheet.create({container:{borderWidth:e.size.border,borderColor:e.colors.border,borderRadius:e.radius.md,...smoothCorners,backgroundColor:e.colors.bg,overflow:"hidden"},toolbar:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:e.space.xs,padding:e.space.xs,borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:e.colors["border-subtle"],backgroundColor:e.colors["bg-subtle"]},button:{minWidth:34,height:30,paddingHorizontal:e.space.xs,borderRadius:e.radius.sm,...smoothCorners,alignItems:"center",justifyContent:"center"},buttonLabel:{...fontFor(e,"medium"),fontSize:e.text.sm.size},input:{...fontFor(e,"normal"),color:e.colors["text-body"],fontSize:e.text.base.size,lineHeight:1.5*e.text.base.size,paddingHorizontal:e.space.md,paddingVertical:e.space.sm},skeletonBody:{paddingHorizontal:e.space.md,paddingVertical:e.space.sm,gap:e.space.sm}});export default RichTextEditor;
@@ -1 +1 @@
1
- "use strict";export{applyMarkdownAction}from"./markdownActions.js";export{DEFAULT_RICH_TEXT_EDITOR_LABELS,RichTextEditor}from"./RichTextEditor.js";
1
+ "use strict";export{applyMarkdownAction}from"./markdownActions.js";export{RichTextEditor}from"./RichTextEditor.js";
@@ -1 +1 @@
1
- "use strict";const INLINE_MARKERS={bold:"**",italic:"*",strikethrough:"~~",code:"`"},WHOLE_LINK=/^\[([^\]]*)\]\(([^)\s]*)\)$/,LINK_URL_PLACEHOLDER="url",BLOCK_RULES={heading1:{has:e=>/^#\s/.test(e),prefix:()=>"# "},heading2:{has:e=>/^##\s/.test(e),prefix:()=>"## "},bulletList:{has:e=>/^[-*+]\s/.test(e),prefix:()=>"- "},numberedList:{has:e=>/^\d+[.)]\s/.test(e),prefix:e=>`${e+1}. `},quote:{has:e=>/^>\s?/.test(e),prefix:()=>"> "}},ANY_BLOCK_PREFIX=/^(?:#{1,6}\s+|[-*+]\s+|\d+[.)]\s+|>\s?)/,isBlockAction=e=>e in BLOCK_RULES,clamp=(e,t)=>!Number.isFinite(e)||e<0?0:Math.min(Math.trunc(e),t);export const normalizeSelection=(e,t)=>{const s=clamp(e.start,t),n=clamp(e.end,t);return{start:Math.min(s,n),end:Math.max(s,n)}};const caret=e=>({start:e,end:e}),applyInlineMarker=(e,t,s)=>{const{start:n,end:r}=t,i=e.slice(n,r),l=s.length,a="*"===s;if(i.length>=2*l&&i.startsWith(s)&&i.endsWith(s)&&!(a&&i.startsWith("**")&&i.endsWith("**"))){const t=i.slice(l,i.length-l);return{text:e.slice(0,n)+t+e.slice(r),selection:{start:n,end:n+t.length}}}const c=e.slice(Math.max(0,n-l),n),o=e.slice(r,r+l);if(n>=l&&c===s&&o===s&&!(a&&"**"===e.slice(Math.max(0,n-2),n)))return{text:e.slice(0,n-l)+i+e.slice(r+l),selection:{start:n-l,end:r-l}};return{text:e.slice(0,n)+s+i+s+e.slice(r),selection:n===r?caret(n+l):{start:n+l,end:r+l}}},applyLink=(e,t)=>{const{start:s,end:n}=t,r=e.slice(s,n),i=WHOLE_LINK.exec(r);if(i){const t=i[1];if(void 0===t)throw new Error("WHOLE_LINK always captures the label in group 1 when it matches");return{text:e.slice(0,s)+t+e.slice(n),selection:{start:s,end:s+t.length}}}const l=`[${r}](url)`,a=e.slice(0,s)+l+e.slice(n);if(s===n)return{text:a,selection:caret(s+1)};const c=s+r.length+3;return{text:a,selection:{start:c,end:c+3}}},applyBlockPrefix=(e,t,s)=>{const n=BLOCK_RULES[s],r=e.split("\n"),i=[];let l=0;for(const e of r)i.push(l),l+=e.length+1;const lineIndexAt=e=>{let t=0;for(const[s,n]of i.entries())n<=e&&(t=s);return t},a=lineIndexAt(t.start),c=lineIndexAt(t.end),o=r.slice(a,c+1),h=o.every(e=>n.has(e)),p=o.map((e,t)=>({before:e,after:h?e.replace(ANY_BLOCK_PREFIX,""):n.prefix(t)+e.replace(ANY_BLOCK_PREFIX,"")})),f=p.map(e=>e.after),[d]=p;if(void 0===d)throw new Error("applyBlockPrefix: the selection always covers at least one line");const x=i[a];if(void 0===x)throw new Error("applyBlockPrefix: the first selected line always has an offset");const L=d.after.length-d.before.length,u=p.reduce((e,t)=>e+(t.after.length-t.before.length),0),E=[...r.slice(0,a),...f,...r.slice(c+1)].join("\n");return{text:E,selection:normalizeSelection({start:Math.max(x,t.start+L),end:t.end+u},E.length)}};export const applyMarkdownAction=(e,t)=>{const s=e.text??"",n=normalizeSelection(e.selection,s.length);return isBlockAction(t)?applyBlockPrefix(s,n,t):"link"===t?applyLink(s,n):applyInlineMarker(s,n,INLINE_MARKERS[t])};
1
+ "use strict";import{readText}from"../../text/index.js";import{RICH_TEXT_EDITOR_TEXT}from"../../text/phone/richTextEditor.g.js";const INLINE_MARKERS={bold:"**",italic:"*",strikethrough:"~~",code:"`"},WHOLE_LINK=/^\[([^\]]*)\]\(([^)\s]*)\)$/,BLOCK_RULES={heading1:{has:e=>/^#\s/.test(e),prefix:()=>"# "},heading2:{has:e=>/^##\s/.test(e),prefix:()=>"## "},bulletList:{has:e=>/^[-*+]\s/.test(e),prefix:()=>"- "},numberedList:{has:e=>/^\d+[.)]\s/.test(e),prefix:e=>`${e+1}. `},quote:{has:e=>/^>\s?/.test(e),prefix:()=>"> "}},ANY_BLOCK_PREFIX=/^(?:#{1,6}\s+|[-*+]\s+|\d+[.)]\s+|>\s?)/,isBlockAction=e=>e in BLOCK_RULES,clamp=(e,t)=>!Number.isFinite(e)||e<0?0:Math.min(Math.trunc(e),t);export const normalizeSelection=(e,t)=>{const s=clamp(e.start,t),n=clamp(e.end,t);return{start:Math.min(s,n),end:Math.max(s,n)}};const caret=e=>({start:e,end:e}),applyInlineMarker=(e,t,s)=>{const{start:n,end:r}=t,i=e.slice(n,r),l=s.length,a="*"===s;if(i.length>=2*l&&i.startsWith(s)&&i.endsWith(s)&&!(a&&i.startsWith("**")&&i.endsWith("**"))){const t=i.slice(l,i.length-l);return{text:e.slice(0,n)+t+e.slice(r),selection:{start:n,end:n+t.length}}}const c=e.slice(Math.max(0,n-l),n),o=e.slice(r,r+l);if(n>=l&&c===s&&o===s&&!(a&&"**"===e.slice(Math.max(0,n-2),n)))return{text:e.slice(0,n-l)+i+e.slice(r+l),selection:{start:n-l,end:r-l}};return{text:e.slice(0,n)+s+i+s+e.slice(r),selection:n===r?caret(n+l):{start:n+l,end:r+l}}},applyLink=(e,t)=>{const s=readText("richTextEditor",RICH_TEXT_EDITOR_TEXT).linkUrlPlaceholder,{start:n,end:r}=t,i=e.slice(n,r),l=WHOLE_LINK.exec(i);if(l){const t=l[1];if(void 0===t)throw new Error("WHOLE_LINK always captures the label in group 1 when it matches");return{text:e.slice(0,n)+t+e.slice(r),selection:{start:n,end:n+t.length}}}const a=`[${i}](${s})`,c=e.slice(0,n)+a+e.slice(r);if(n===r)return{text:c,selection:caret(n+1)};const o=n+i.length+3;return{text:c,selection:{start:o,end:o+s.length}}},applyBlockPrefix=(e,t,s)=>{const n=BLOCK_RULES[s],r=e.split("\n"),i=[];let l=0;for(const e of r)i.push(l),l+=e.length+1;const lineIndexAt=e=>{let t=0;for(const[s,n]of i.entries())n<=e&&(t=s);return t},a=lineIndexAt(t.start),c=lineIndexAt(t.end),o=r.slice(a,c+1),h=o.every(e=>n.has(e)),p=o.map((e,t)=>({before:e,after:h?e.replace(ANY_BLOCK_PREFIX,""):n.prefix(t)+e.replace(ANY_BLOCK_PREFIX,"")})),d=p.map(e=>e.after),[f]=p;if(void 0===f)throw new Error("applyBlockPrefix: the selection always covers at least one line");const x=i[a];if(void 0===x)throw new Error("applyBlockPrefix: the first selected line always has an offset");const E=f.after.length-f.before.length,m=p.reduce((e,t)=>e+(t.after.length-t.before.length),0),u=[...r.slice(0,a),...d,...r.slice(c+1)].join("\n");return{text:u,selection:normalizeSelection({start:Math.max(x,t.start+E),end:t.end+m},u.length)}};export const applyMarkdownAction=(e,t)=>{const s=e.text??"",n=normalizeSelection(e.selection,s.length);return isBlockAction(t)?applyBlockPrefix(s,n,t):"link"===t?applyLink(s,n):applyInlineMarker(s,n,INLINE_MARKERS[t])};
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,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{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{EmptyState}from"../EmptyState/index.js";import{IconButton}from"../IconButton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const MIN_FRAME=240,DEFAULT_FRAME=260,MARK_LENGTH=32,MARK_THICKNESS=4,BREATHE_SCALE=1.03,SNAP_SCALE=1.08,T=4,CORNERS=[{key:"tl",style:{top:0,left:0,borderTopWidth:4,borderLeftWidth:4}},{key:"tr",style:{top:0,right:0,borderTopWidth:4,borderRightWidth:4}},{key:"bl",style:{bottom:0,left:0,borderBottomWidth:4,borderLeftWidth:4}},{key:"br",style:{bottom:0,right:0,borderBottomWidth:4,borderRightWidth:4}}];export const DEFAULT_SCANNER_OVERLAY_LABELS=Object.freeze({hint:"Point the camera at the code",found:"Code found",invalid:"This code cannot be used. Try another.",torchOn:"Turn torch on",torchOff:"Turn torch off",manualEntry:"Enter code instead",gallery:"Upload from gallery",noPermissionTitle:"Camera access is off",noPermissionMessage:"Allow camera access to scan a code.",permissionAction:"Allow camera access",noCameraTitle:"No camera found",noCameraMessage:"This device has no camera available. You can still add the code another way."});const ScannerOverlay=forwardRef((e,t)=>{assertValidValue("ScannerOverlay","state",e.state,["scanning","found","invalid","noPermission","noCamera"]);const{children:o,state:n,helperText:i,labels:s,torch:r=!1,onTorchChange:a,onManualEntry:l,onGallery:c,onPermissionAction:d,frameSize:m=DEFAULT_FRAME,haptic:u,style:h,testID:f}=e,p=n??"scanning",g=useTheme(),y=useSafeAreaInsets(),x=useReducedMotion(),b=useMemo(()=>buildStyles(g),[g]),v=useMemo(()=>({...DEFAULT_SCANNER_OVERLAY_LABELS,...s}),[s]),j=i??v.hint,[S,A]=useState({width:0,height:0}),[E,_]=useState(0),w="scanning"===p||"found"===p||"invalid"===p,V=useRef(createAnimatedValue(1)).current,C=g.motion.duration.slower,R=g.motion.duration.default;useEffect(()=>{if(V.setValue(1),x)return;let e;return"scanning"===p&&C>0?e=Animated.loop(Animated.sequence([Animated.timing(V,{toValue:1.03,duration:2*C,useNativeDriver:nativeDriver}),Animated.timing(V,{toValue:1,duration:2*C,useNativeDriver:nativeDriver})])):"found"===p&&R>0&&(V.setValue(1.08),e=Animated.timing(V,{toValue:1,duration:R,useNativeDriver:nativeDriver})),e?.start(),()=>e?.stop()},[p,x,C,R,V]);const M=useRef(p);useEffect(()=>{M.current!==p&&(M.current=p,!1!==u&&("found"===p?triggerHaptic("notificationSuccess"):"invalid"===p&&triggerHaptic("notificationError")))},[p,u]);const{found:L,invalid:I}=v,{noPermissionTitle:P,noPermissionMessage:k}=v,{noCameraTitle:D,noCameraMessage:N}=v;useEffect(()=>{switch(p){case"scanning":announce(j);break;case"found":announce(L);break;case"invalid":announce(I,{polite:!1});break;case"noPermission":announce(`${P}. ${k}`);break;case"noCamera":announce(`${D}. ${N}`)}},[p,j,L,I,P,k,D,N]);const O=Math.max(240,Math.min(m,S.width-2*g.space.xl)),F=(S.width-O)/2,B=Math.max(g.space.md,(S.height-E-O)/2),H=S.width>0&&S.height>0,z={borderColor:"found"===p?g.colors.success:"invalid"===p?g.colors.danger:g.colors["on-scrim"],width:32,height:32},W="found"===p||"invalid"===p?_jsx(View,{style:[b.pill,{backgroundColor:"found"===p?g.colors.success:g.colors.danger}],children:_jsx(Text,{variant:"bodySmall",weight:"semibold",align:"center",style:{color:"found"===p?g.colors["on-success"]:g.colors["on-danger"]},children:"found"===p?L:I})}):_jsx(Text,{variant:"bodySmall",align:"center",style:{color:g.colors["on-scrim"]},children:j}),U=w&&null!=a,$=w?"glass":"outline";return _jsxs(View,{ref:t,testID:f,onLayout:e=>{const{width:t,height:o}=e.nativeEvent.layout;A(e=>e.width===t&&e.height===o?e:{width:t,height:o})},style:[b.root,!w&&{backgroundColor:g.colors.bg},h],children:[w?_jsx(View,{style:StyleSheet.absoluteFill,children:o}):null,w&&H?_jsx(_Fragment,{children:_jsxs(View,{pointerEvents:"none",style:StyleSheet.absoluteFill,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:[_jsx(View,{style:[b.scrim,{left:0,right:0,top:0,height:B}]}),_jsx(View,{style:[b.scrim,{left:0,right:0,top:B+O,bottom:0}]}),_jsx(View,{style:[b.scrim,{left:0,width:F,top:B,height:O}]}),_jsx(View,{style:[b.scrim,{left:F+O,right:0,top:B,height:O}]}),_jsx(Animated.View,{style:{position:"absolute",left:F,top:B,width:O,height:O,transform:[{scale:V}]},children:CORNERS.map(e=>_jsx(View,{style:[b.mark,z,e.style]},e.key))})]})}):null,w?null:_jsx(View,{style:b.panel,children:_jsx(EmptyState,{fill:!0,icon:_jsx(AppIcon,{name:"noPermission"===p?"camera":"camera-slash",size:48,color:g.colors["text-subtle"]}),title:"noPermission"===p?P:D,description:"noPermission"===p?k:N,action:"noPermission"===p&&d?{label:v.permissionAction,onPress:d}:void 0})}),_jsxs(View,{pointerEvents:"box-none",onLayout:e=>{const{height:t}=e.nativeEvent.layout;_(e=>e===t?e:t)},style:[b.bar,{paddingBottom:Math.max(y.bottom,g.space.md)}],children:[w&&H?_jsx(View,{pointerEvents:"none",style:b.message,children:W}):null,_jsxs(View,{style:b.actions,children:[U?_jsx(IconButton,{icon:r?"flash":"flash-slash",variant:"glass",size:"lg",active:r,haptic:u,accessibilityLabel:r?v.torchOff:v.torchOn,onPress:()=>a?.(!r)}):null,c?_jsx(Button,{label:v.gallery,leftIcon:"gallery",variant:$,tone:"neutral",size:"lg",haptic:u,onPress:c}):null,l?_jsx(Button,{label:v.manualEntry,leftIcon:"keyboard",variant:$,tone:"neutral",size:"lg",haptic:u,onPress:l}):null]})]})]})});ScannerOverlay.displayName="ScannerOverlay";const buildStyles=e=>StyleSheet.create({root:{flex:1,overflow:"hidden"},scrim:{position:"absolute",backgroundColor:e.colors.scrim},mark:{position:"absolute"},message:{alignItems:"center",paddingHorizontal:e.space.xl},pill:{paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners},panel:{...StyleSheet.absoluteFill,justifyContent:"center"},bar:{position:"absolute",left:0,right:0,bottom:0,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.space.sm,paddingHorizontal:e.space.md},actions:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"center",gap:e.space.sm}});export{ScannerOverlay};export default ScannerOverlay;
1
+ "use strict";import{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useMobileUiText}from"../../text/index.js";import{SCANNER_OVERLAY_TEXT}from"../../text/phone/scannerOverlay.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{EmptyState}from"../EmptyState/index.js";import{IconButton}from"../IconButton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const MIN_FRAME=240,DEFAULT_FRAME=260,MARK_LENGTH=32,MARK_THICKNESS=4,BREATHE_SCALE=1.03,SNAP_SCALE=1.08,T=4,CORNERS=[{key:"tl",style:{top:0,left:0,borderTopWidth:4,borderLeftWidth:4}},{key:"tr",style:{top:0,right:0,borderTopWidth:4,borderRightWidth:4}},{key:"bl",style:{bottom:0,left:0,borderBottomWidth:4,borderLeftWidth:4}},{key:"br",style:{bottom:0,right:0,borderBottomWidth:4,borderRightWidth:4}}],ScannerOverlay=forwardRef((e,t)=>{assertValidValue("ScannerOverlay","state",e.state,["scanning","found","invalid","noPermission","noCamera"]);const{children:i,state:o,helperText:n,labels:s,torch:r=!1,onTorchChange:a,onManualEntry:l,onGallery:c,onPermissionAction:d,frameSize:m=DEFAULT_FRAME,haptic:u,style:h,testID:p}=e,f=o??"scanning",g=useTheme(),y=useSafeAreaInsets(),x=useReducedMotion(),b=useMemo(()=>buildStyles(g),[g]),v=useMobileUiText("scannerOverlay",SCANNER_OVERLAY_TEXT),j=useMemo(()=>({...v,...s}),[v,s]),S=n??j.hint,[_,E]=useState({width:0,height:0}),[w,A]=useState(0),V="scanning"===f||"found"===f||"invalid"===f,R=useRef(createAnimatedValue(1)).current,C=g.motion.duration.slower,M=g.motion.duration.default;useEffect(()=>{if(R.setValue(1),x)return;let e;return"scanning"===f&&C>0?e=Animated.loop(Animated.sequence([Animated.timing(R,{toValue:1.03,duration:2*C,useNativeDriver:nativeDriver}),Animated.timing(R,{toValue:1,duration:2*C,useNativeDriver:nativeDriver})])):"found"===f&&M>0&&(R.setValue(1.08),e=Animated.timing(R,{toValue:1,duration:M,useNativeDriver:nativeDriver})),e?.start(),()=>e?.stop()},[f,x,C,M,R]);const I=useRef(f);useEffect(()=>{I.current!==f&&(I.current=f,!1!==u&&("found"===f?triggerHaptic("notificationSuccess"):"invalid"===f&&triggerHaptic("notificationError")))},[f,u]);const{found:k,invalid:D}=j,{noPermissionTitle:N,noPermissionMessage:O}=j,{noCameraTitle:P,noCameraMessage:F}=j;useEffect(()=>{switch(f){case"scanning":announce(S);break;case"found":announce(k);break;case"invalid":announce(D,{polite:!1});break;case"noPermission":announce(`${N}. ${O}`);break;case"noCamera":announce(`${P}. ${F}`)}},[f,S,k,D,N,O,P,F]);const L=Math.max(240,Math.min(m,_.width-2*g.space.xl)),B=(_.width-L)/2,H=Math.max(g.space.md,(_.height-w-L)/2),W=_.width>0&&_.height>0,z={borderColor:"found"===f?g.colors.success:"invalid"===f?g.colors.danger:g.colors["on-scrim"],width:32,height:32},U="found"===f||"invalid"===f?_jsx(View,{style:[b.pill,{backgroundColor:"found"===f?g.colors.success:g.colors.danger}],children:_jsx(Text,{variant:"bodySmall",weight:"semibold",align:"center",style:{color:"found"===f?g.colors["on-success"]:g.colors["on-danger"]},children:"found"===f?k:D})}):_jsx(Text,{variant:"bodySmall",align:"center",style:{color:g.colors["on-scrim"]},children:S}),$=V&&null!=a,K=V?"glass":"outline";return _jsxs(View,{ref:t,testID:p,onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;E(e=>e.width===t&&e.height===i?e:{width:t,height:i})},style:[b.root,!V&&{backgroundColor:g.colors.bg},h],children:[V?_jsx(View,{style:StyleSheet.absoluteFill,children:i}):null,V&&W?_jsx(_Fragment,{children:_jsxs(View,{pointerEvents:"none",style:StyleSheet.absoluteFill,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:[_jsx(View,{style:[b.scrim,{left:0,right:0,top:0,height:H}]}),_jsx(View,{style:[b.scrim,{left:0,right:0,top:H+L,bottom:0}]}),_jsx(View,{style:[b.scrim,{left:0,width:B,top:H,height:L}]}),_jsx(View,{style:[b.scrim,{left:B+L,right:0,top:H,height:L}]}),_jsx(Animated.View,{style:{position:"absolute",left:B,top:H,width:L,height:L,transform:[{scale:R}]},children:CORNERS.map(e=>_jsx(View,{style:[b.mark,z,e.style]},e.key))})]})}):null,V?null:_jsx(View,{style:b.panel,children:_jsx(EmptyState,{fill:!0,icon:_jsx(AppIcon,{name:"noPermission"===f?"camera":"camera-slash",size:48,color:g.colors["text-subtle"]}),title:"noPermission"===f?N:P,description:"noPermission"===f?O:F,action:"noPermission"===f&&d?{label:j.permissionAction,onPress:d}:void 0})}),_jsxs(View,{pointerEvents:"box-none",onLayout:e=>{const{height:t}=e.nativeEvent.layout;A(e=>e===t?e:t)},style:[b.bar,{paddingBottom:Math.max(y.bottom,g.space.md)}],children:[V&&W?_jsx(View,{pointerEvents:"none",style:b.message,children:U}):null,_jsxs(View,{style:b.actions,children:[$?_jsx(IconButton,{icon:r?"flash":"flash-slash",variant:"glass",size:"lg",active:r,haptic:u,accessibilityLabel:r?j.torchOff:j.torchOn,onPress:()=>a?.(!r)}):null,c?_jsx(Button,{label:j.gallery,leftIcon:"gallery",variant:K,tone:"neutral",size:"lg",haptic:u,onPress:c}):null,l?_jsx(Button,{label:j.manualEntry,leftIcon:"keyboard",variant:K,tone:"neutral",size:"lg",haptic:u,onPress:l}):null]})]})]})});ScannerOverlay.displayName="ScannerOverlay";const buildStyles=e=>StyleSheet.create({root:{flex:1,overflow:"hidden"},scrim:{position:"absolute",backgroundColor:e.colors.scrim},mark:{position:"absolute"},message:{alignItems:"center",paddingHorizontal:e.space.xl},pill:{paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners},panel:{...StyleSheet.absoluteFill,justifyContent:"center"},bar:{position:"absolute",left:0,right:0,bottom:0,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:e.space.sm,paddingHorizontal:e.space.md},actions:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"center",gap:e.space.sm}});export{ScannerOverlay};export default ScannerOverlay;
@@ -1 +1 @@
1
- "use strict";export{DEFAULT_SCANNER_OVERLAY_LABELS,default,ScannerOverlay}from"./ScannerOverlay.js";
1
+ "use strict";export{default,ScannerOverlay}from"./ScannerOverlay.js";
@@ -1 +1 @@
1
- "use strict";import{cloneElement,isValidElement,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,BackHandler,FlatList,StyleSheet,View}from"react-native";import{KeyboardStickyView}from"react-native-keyboard-controller";import{useSharedValue}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useRefreshControl}from"../../hooks/useRefreshControl.js";import{resolveFloatingActionButtonSize,useTheme}from"../../theme/index.js";import{AppBar}from"../AppBar/index.js";import{AsyncBlock,DEFAULT_ASYNC_BLOCK_LABELS}from"../AsyncBlock/index.js";import{EmptyState}from"../EmptyState/index.js";import{KeyboardAwareScrollView}from"../KeyboardAwareScrollView/index.js";import{KeyboardToolbar}from"../KeyboardToolbar/index.js";import{PagedListFooter}from"../PagedListFooter/index.js";import{ScrollHostContext}from"./ScrollHost.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{},isElementFooter=e=>isValidElement(e);function renderFooter(e){if(null==e)return null;if(isElementFooter(e))return e;return _jsx(e,{})}const topPaddingOf=e=>{const t=StyleSheet.flatten(e),o=t?.paddingTop??t?.paddingVertical??t?.padding;return"number"==typeof o?o:0},buildStyles=e=>StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},headerRaised:{zIndex:1},footer:{backgroundColor:e.colors.bg,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});export function Screen(e){const{title:t,subtitle:o,largeTitle:n=!0,headerShadowOnScroll:r,onBack:s,rightActions:a,leading:l,trailing:i,children:d,onRefresh:c,refreshing:u=!1,footer:f,scroll:m=!0,list:p,edges:h=DEFAULT_EDGES,keyboardToolbar:g=!0,bottomInset:S=0,gutter:y,floatingAction:v,scrollRef:b,onScroll:x,contentContainerStyle:E,testID:C}=e,T=useTheme(),L=y??void 0===p,j=T.space[T.components.screen.gutter],_=L?j:0,A=useSafeAreaInsets(),R=useMemo(()=>buildStyles(T),[T]),[k]=useState(()=>new Animated.Value(0)),[F,B]=useState(0),[V,w]=useState(0),O=void 0!==s,M=useRef(s);M.current=s;const K=Boolean(t||o||s||l||i||a?.length),P=n&&void 0!==t,D=P&&(void 0!==p||m),z=D?F:0,H=K&&!D&&(r??T.settings.components.screen?.headerShadowOnScroll??!0),[I,N]=useState(!1),U=useRef(H);U.current=H;const headerGap=e=>e>0?e:K?T.space.lg:0,G=void 0!==f,W=p?.state,Y="data"===W?.status||"empty"===W?.status?W:void 0,{refreshControl:q}=useRefreshControl({onRefresh:Y?Y.refresh:c??noop,refreshing:Y?Y.refreshing:u}),J=c||Y?cloneElement(q,{progressViewOffset:z}):void 0,Q=useSharedValue(0),X=useSharedValue(0),Z=useSharedValue(0),$=useSharedValue(0),ee=useRef(null),te=useRef(0),oe=useRef(0),ne=useMemo(()=>({top:Q,bottom:X,offset:Z,maxOffset:$,scrollTo:e=>{const t=ee.current;t instanceof FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[Q,X,Z,$]),re=useCallback(e=>{ee.current=e,"function"==typeof b?b(e):b&&(b.current=e)},[b]),se=useCallback(()=>{$.value=Math.max(0,te.current-oe.current)},[$]),ae=useRef(x);ae.current=x;const le=useMemo(()=>Animated.event([{nativeEvent:{contentOffset:{y:k}}}],{useNativeDriver:!1,listener:e=>{if(Z.value=e.nativeEvent.contentOffset.y,U.current){const t=e.nativeEvent.contentOffset.y>0;N(e=>e===t?e:t)}ae.current?.(e)}}),[k,Z]),ie=useCallback(e=>{const{height:t}=e.nativeEvent.layout;B(e=>Math.max(e,t))},[]),de=useCallback(e=>{w(e.nativeEvent.layout.height)},[]);useEffect(()=>{if(!O)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(M.current?.(),!0));return()=>e.remove()},[O]);const ce=h.includes("left")?A.left:0,ue=h.includes("right")?A.right:0,fe=h.includes("bottom")?A.bottom:0,me=h.includes("top")&&!K?A.top:0,pe=T.space[T.components["floating-action-button"]["bottom-offset"]],he=v?.props.bottomOffset??pe,ge=v?resolveFloatingActionButtonSize(T,v.props.size??"md").diameter+he+T.space.lg:0,Se=G?Math.max(0,V-A.bottom):S,ye=v?cloneElement(v,{bottomOffset:he+Se,position:v.props.position??"bottomRight"}):null,ve=G?ge:Math.max(fe,v?ge+A.bottom:0),be=S+ve-(G?0:fe),xe=h.filter(e=>"top"!==e&&!("bottom"===e&&G)),Ee=K?_jsx(View,{style:D?R.overlay:H?R.headerRaised:void 0,onLayout:D?ie:void 0,children:_jsx(AppBar,{title:t,subtitle:o,variant:P?"large":"default",scrollY:D?k:void 0,elevated:H&&I,onBack:s,rightActions:a,leading:l,trailing:i,gutter:j})}):null,Ce=useCallback(()=>{const e=ee.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,o,n)=>{oe.current=n,Q.value=t+z,X.value=t+n,se()})},[z,Q,X,se]);useEffect(()=>{Ce()},[Ce]);const Te=useCallback((e,t)=>{te.current=t,se()},[se]);let Le;if(void 0!==p){const{state:e,paging:t,empty:o,skeleton:n,errorTitle:r,data:s,...a}=p,l=topPaddingOf([a.contentContainerStyle,E]),handleEndReached=e=>{t?.hasMore&&!t.loadingMore&&null==t.errorMore&&t.loadMore(),a.onEndReached?.(e)},renderList=(e,o)=>_jsx(FlatList,{data:e,keyboardShouldPersistTaps:"handled",onEndReachedThreshold:t?.5:void 0,...a,ref:re,refreshControl:J,onScroll:le,onLayout:e=>{Ce(),a.onLayout?.(e)},onContentSizeChange:(e,t)=>{Te(e,t),a.onContentSizeChange?.(e,t)},onEndReached:t?handleEndReached:a.onEndReached,ListEmptyComponent:o,ListFooterComponent:t||a.ListFooterComponent?_jsxs(_Fragment,{children:[renderFooter(a.ListFooterComponent),t?_jsx(PagedListFooter,{paging:t}):null]}):void 0,scrollEventThrottle:16,style:R.flex,contentContainerStyle:[{paddingTop:z,paddingLeft:ce+_,paddingRight:ue+_},{paddingBottom:S+ve},a.contentContainerStyle,E,o?{flexGrow:1}:void 0,{paddingTop:z+headerGap(l)}]});Le=_jsx(ScrollHostContext.Provider,{value:ne,children:"empty"===e?.status?renderList([],_jsx(EmptyState,{...o??{title:DEFAULT_ASYNC_BLOCK_LABELS.emptyTitle}})):e?_jsx(AsyncBlock,{state:e,skeleton:n,errorTitle:r,style:[R.flex,{paddingTop:z+headerGap(l)}],children:e=>renderList(e,void 0)}):renderList(s,o?_jsx(EmptyState,{...o}):void 0)})}else Le=m?_jsx(ScrollHostContext.Provider,{value:ne,children:_jsxs(KeyboardAwareScrollView,{ref:re,refreshControl:J,onScroll:le,scrollEventThrottle:16,onLayout:Ce,onContentSizeChange:Te,safeAreaEdges:xe,style:R.flex,contentContainerStyle:[{paddingHorizontal:_},E,{paddingTop:z+headerGap(topPaddingOf(E))}],children:[d,be>0?_jsx(View,{style:{height:be}}):null]})}):_jsx(View,{style:[R.flex,{paddingLeft:ce+_,paddingRight:ue+_,paddingBottom:S+ve},E],children:d});const je=G?_jsx(KeyboardStickyView,{onLayout:de,style:[R.footer,{paddingLeft:ce+j,paddingRight:ue+j,paddingBottom:fe+S}],children:f}):null;return _jsxs(View,{testID:C,style:[R.root,{paddingTop:me}],children:[D?null:Ee,Le,je,ye,void 0!==p?d:null,D?Ee:null,g?_jsx(KeyboardToolbar,{}):null]})}
1
+ "use strict";import{cloneElement,isValidElement,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,BackHandler,FlatList,StyleSheet,View}from"react-native";import{KeyboardStickyView}from"react-native-keyboard-controller";import{useSharedValue}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useRefreshControl}from"../../hooks/useRefreshControl.js";import{useMobileUiText}from"../../text/index.js";import{ASYNC_BLOCK_TEXT}from"../../text/phone/asyncBlock.g.js";import{resolveFloatingActionButtonSize,useTheme}from"../../theme/index.js";import{AppBar}from"../AppBar/index.js";import{AsyncBlock}from"../AsyncBlock/index.js";import{EmptyState}from"../EmptyState/index.js";import{KeyboardAwareScrollView}from"../KeyboardAwareScrollView/index.js";import{KeyboardToolbar}from"../KeyboardToolbar/index.js";import{PagedListFooter}from"../PagedListFooter/index.js";import{ScrollHostContext}from"./ScrollHost.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_EDGES=["top","bottom"],SCROLL_EVENT_THROTTLE=16,noop=()=>{},isElementFooter=e=>isValidElement(e);function renderFooter(e){if(null==e)return null;if(isElementFooter(e))return e;return _jsx(e,{})}const topPaddingOf=e=>{const t=StyleSheet.flatten(e),o=t?.paddingTop??t?.paddingVertical??t?.padding;return"number"==typeof o?o:0},buildStyles=e=>StyleSheet.create({flex:{flex:1},root:{flex:1,backgroundColor:e.colors.bg},overlay:{position:"absolute",top:0,left:0,right:0},headerRaised:{zIndex:1},footer:{backgroundColor:e.colors.bg,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:e.colors.border}});export function Screen(e){const{title:t,subtitle:o,largeTitle:n=!0,headerShadowOnScroll:r,onBack:s,rightActions:a,leading:l,trailing:i,children:d,onRefresh:c,refreshing:u=!1,footer:f,scroll:m=!0,list:p,edges:h=DEFAULT_EDGES,keyboardToolbar:g=!0,bottomInset:y=0,gutter:S,floatingAction:v,scrollRef:x,onScroll:b,contentContainerStyle:C,testID:E}=e,T=useTheme(),j=useMobileUiText("asyncBlock",ASYNC_BLOCK_TEXT),_=S??void 0===p,k=T.space[T.components.screen.gutter],L=_?k:0,R=useSafeAreaInsets(),A=useMemo(()=>buildStyles(T),[T]),[B]=useState(()=>new Animated.Value(0)),[V,w]=useState(0),[F,O]=useState(0),M=void 0!==s,K=useRef(s);K.current=s;const P=Boolean(t||o||s||l||i||a?.length),z=n&&void 0!==t,D=z&&(void 0!==p||m),H=D?V:0,I=P&&!D&&(r??T.settings.components.screen?.headerShadowOnScroll??!0),[N,U]=useState(!1),G=useRef(I);G.current=I;const headerGap=e=>e>0?e:P?T.space.lg:0,W=void 0!==f,Y=p?.state,X="data"===Y?.status||"empty"===Y?.status?Y:void 0,{refreshControl:$}=useRefreshControl({onRefresh:X?X.refresh:c??noop,refreshing:X?X.refreshing:u}),q=c||X?cloneElement($,{progressViewOffset:H}):void 0,J=useSharedValue(0),Q=useSharedValue(0),Z=useSharedValue(0),ee=useSharedValue(0),te=useRef(null),oe=useRef(0),ne=useRef(0),re=useMemo(()=>({top:J,bottom:Q,offset:Z,maxOffset:ee,scrollTo:e=>{const t=te.current;t instanceof FlatList?t.scrollToOffset({offset:e,animated:!1}):t?.scrollTo({y:e,animated:!1})}}),[J,Q,Z,ee]),se=useCallback(e=>{te.current=e,"function"==typeof x?x(e):x&&(x.current=e)},[x]),ae=useCallback(()=>{ee.value=Math.max(0,oe.current-ne.current)},[ee]),le=useRef(b);le.current=b;const ie=useMemo(()=>Animated.event([{nativeEvent:{contentOffset:{y:B}}}],{useNativeDriver:!1,listener:e=>{if(Z.value=e.nativeEvent.contentOffset.y,G.current){const t=e.nativeEvent.contentOffset.y>0;U(e=>e===t?e:t)}le.current?.(e)}}),[B,Z]),de=useCallback(e=>{const{height:t}=e.nativeEvent.layout;w(e=>Math.max(e,t))},[]),ce=useCallback(e=>{O(e.nativeEvent.layout.height)},[]);useEffect(()=>{if(!M)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(K.current?.(),!0));return()=>e.remove()},[M]);const ue=h.includes("left")?R.left:0,fe=h.includes("right")?R.right:0,me=h.includes("bottom")?R.bottom:0,pe=h.includes("top")&&!P?R.top:0,he=T.space[T.components["floating-action-button"]["bottom-offset"]],ge=v?.props.bottomOffset??he,ye=v?resolveFloatingActionButtonSize(T,v.props.size??"md").diameter+ge+T.space.lg:0,Se=W?Math.max(0,F-R.bottom):y,ve=v?cloneElement(v,{bottomOffset:ge+Se,position:v.props.position??"bottomRight"}):null,xe=W?ye:Math.max(me,v?ye+R.bottom:0),be=y+xe-(W?0:me),Ce=h.filter(e=>"top"!==e&&!("bottom"===e&&W)),Ee=P?_jsx(View,{style:D?A.overlay:I?A.headerRaised:void 0,onLayout:D?de:void 0,children:_jsx(AppBar,{title:t,subtitle:o,variant:z?"large":"default",scrollY:D?B:void 0,elevated:I&&N,onBack:s,rightActions:a,leading:l,trailing:i,gutter:k,testID:E?`${E}-app-bar`:void 0})}):null,Te=useCallback(()=>{const e=te.current?.getNativeScrollRef();e&&e.measureInWindow((e,t,o,n)=>{ne.current=n,J.value=t+H,Q.value=t+n,ae()})},[H,J,Q,ae]);useEffect(()=>{Te()},[Te]);const je=useCallback((e,t)=>{oe.current=t,ae()},[ae]);let ke;if(void 0!==p){const{state:e,paging:t,empty:o,skeleton:n,errorTitle:r,data:s,...a}=p,l=topPaddingOf([a.contentContainerStyle,C]),handleEndReached=e=>{t?.hasMore&&!t.loadingMore&&null==t.errorMore&&t.loadMore(),a.onEndReached?.(e)},renderList=(e,o)=>_jsx(FlatList,{data:e,keyboardShouldPersistTaps:"handled",onEndReachedThreshold:t?.5:void 0,...a,ref:se,refreshControl:q,onScroll:ie,onLayout:e=>{Te(),a.onLayout?.(e)},onContentSizeChange:(e,t)=>{je(e,t),a.onContentSizeChange?.(e,t)},onEndReached:t?handleEndReached:a.onEndReached,ListEmptyComponent:o,ListFooterComponent:t||a.ListFooterComponent?_jsxs(_Fragment,{children:[renderFooter(a.ListFooterComponent),t?_jsx(PagedListFooter,{paging:t}):null]}):void 0,scrollEventThrottle:16,style:A.flex,contentContainerStyle:[{paddingTop:H,paddingLeft:ue+L,paddingRight:fe+L},{paddingBottom:y+xe},a.contentContainerStyle,C,o?{flexGrow:1}:void 0,{paddingTop:H+headerGap(l)}]});ke=_jsx(ScrollHostContext.Provider,{value:re,children:"empty"===e?.status?renderList([],_jsx(EmptyState,{...o??{title:j.emptyTitle}})):e?_jsx(AsyncBlock,{state:e,skeleton:n,errorTitle:r,style:[A.flex,{paddingTop:H+headerGap(l)}],children:e=>renderList(e,void 0)}):renderList(s,o?_jsx(EmptyState,{...o}):void 0)})}else ke=m?_jsx(ScrollHostContext.Provider,{value:re,children:_jsxs(KeyboardAwareScrollView,{ref:se,refreshControl:q,onScroll:ie,scrollEventThrottle:16,onLayout:Te,onContentSizeChange:je,safeAreaEdges:Ce,style:A.flex,contentContainerStyle:[{paddingHorizontal:L},C,{paddingTop:H+headerGap(topPaddingOf(C))}],children:[d,be>0?_jsx(View,{style:{height:be}}):null]})}):_jsx(View,{style:[A.flex,{paddingLeft:ue+L,paddingRight:fe+L,paddingBottom:y+xe},C],children:d});const Le=W?_jsx(KeyboardStickyView,{onLayout:ce,style:[A.footer,{paddingLeft:ue+k,paddingRight:fe+k,paddingBottom:me+y}],children:f}):null;return _jsxs(View,{testID:E,style:[A.root,{paddingTop:pe}],children:[D?null:Ee,ke,Le,ve,void 0!==p?d:null,D?Ee:null,g?_jsx(KeyboardToolbar,{}):null]})}
@@ -1 +1 @@
1
- "use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useDebounce}from"../../hooks/useDebounce.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{FieldBase,FieldLabel,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{normalizeSuggestion,SearchRecents,SearchScopeBar,SearchSuggestions}from"./SearchPanel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SEARCH_BAR_LABELS=Object.freeze({placeholder:"Search…",recents:"Recent searches",clearAll:"Clear all",clearAllRecents:"Clear all recent searches",searchAgain:"Searches again",removeRecent:e=>`Remove ${e} from recent searches`,scope:"Search scope",clearSearch:"Clear search",searching:e=>`Searching ${e}`,suggestionCount:e=>1===e?"1 suggestion":`${e} suggestions`,removed:e=>`Removed ${e}`,recentsCleared:"Recent searches cleared"});const DEFAULT_PANEL_ROWS=8,HOLD_RELEASE_MS=50,SearchBar=forwardRef((e,s)=>{const{value:l,onChangeText:a,onSubmit:t,onFocus:o,onBlur:r,placeholder:n,autoFocus:i=!1,disabled:c=!1,onClear:u,leftIcon:d,debounceMs:p,size:h="md",variant:b,radius:m,label:f,labelMode:S="top",labelStyle:g,scopes:v,scope:C,onScopeChange:x,recents:R,maxRecents:j=DEFAULT_PANEL_ROWS,onSelectRecent:y,onRemove:F,onClearRecents:_,suggestions:L,maxSuggestions:k=DEFAULT_PANEL_ROWS,onSelect:B,haptic:E,labels:A,style:V,inputStyle:T,accessibilityLabel:z,testID:I,...H}=e;assertValidValue("SearchBar","size",e.size,["sm","md","lg"]),assertValidValue("SearchBar","variant",e.variant,["outline","filled","underline"]),assertValidValue("SearchBar","labelMode",e.labelMode,["top","float"]);const M=useTheme(),w=useMemo(()=>({...DEFAULT_SEARCH_BAR_LABELS,...A}),[A]),D=n??w.placeholder,P=b??M.settings.components["search-bar"]?.defaultVariant??M.settings.components.field?.defaultVariant??"filled",O="underline"===P,N=resolveFieldSize(M,h),U=m??M.components["search-bar"][h].radius,W=resolveFieldTextStyle(M,{disabled:c}),$=useRef(null),q=useMemo(()=>mergeRefs($,s),[s]),K=useCallback(()=>{c||$.current?.focus()},[c]),G=useMemo(()=>buildStyles(M),[M]),J="string"==typeof l?l:"",[Q,X]=useState(!1),Y=useCallback(e=>{X(!0),o?.(e)},[o]),Z=useCallback(e=>{X(!1),r?.(e)},[r]),[ee,se]=useState(J),le=useRef(ee);le.current=ee;const ae=useDebounce(ee,p??0);useEffect(()=>{void 0!==p&&J!==le.current&&se(J)},[J,p]);const te=useRef(J);useEffect(()=>{void 0!==p&&ae!==te.current&&(te.current=ae,a(ae))},[ae,p,a]);const oe=useCallback(e=>{void 0===p?a(e):se(e)},[p,a]),re=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e),void 0!==p&&(se(""),te.current=""),a(""),u?.()},[E,p,a,u]),ne=useCallback(()=>{t?.(void 0!==p?ee:J)},[t,p,ee,J]),ie=void 0!==p?ee:J,ce=ie.length>0,[ue,de]=useControllableState({value:C,defaultValue:v?.[0]?.value??"",onChange:x}),pe=useCallback(e=>{de(e);const s=v?.find(s=>s.value===e)?.label;s&&announce(w.searching(s))},[v,de,w]),[he,be]=useState(!1),me=useRef(null),fe=useCallback(()=>{me.current&&(clearTimeout(me.current),me.current=null)},[]),Se=useCallback(()=>{fe(),be(!0)},[fe]),ge=useCallback(()=>{fe(),me.current=setTimeout(()=>be(!1),50)},[fe]);useEffect(()=>fe,[fe]);const ve=!c&&(Q||he),Ce=useMemo(()=>(R??[]).slice(0,j),[R,j]),xe=useMemo(()=>(L??[]).slice(0,k).map(normalizeSuggestion),[L,k]),Re=ve&&!ce&&Ce.length>0,je=ve&&ce&&xe.length>0,ye=je?xe.length:0,Fe=ye>0?w.suggestionCount(ye):"";useEffect(()=>{Fe&&announce(Fe)},[Fe]);const Le=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e)},[E]),ke=useCallback(e=>{Le(),$.current?.blur(),be(!1),y?.(e)},[Le,y]),Be=useCallback(e=>{Le(),$.current?.blur(),be(!1),B?.(e)},[Le,B]),Ee=useCallback(e=>{Le(),F?.(e),announce(w.removed(e)),K()},[Le,F,K,w]),Ae=useCallback(()=>{Le(),_?.(),announce(w.recentsCleared),K()},[Le,_,K,w]),Ve={size:N.icon,color:c?M.colors["text-disabled"]:M.colors["text-subtle"],disabled:c},Te=d?renderSlotIcon(d,Ve):(M.settings.icons.search??defaultIcons.search)(Ve),ze=_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:Te}),Ie=Boolean(f)&&"float"===S,He=useFloatingLabel({label:f,enabled:Ie,floated:Q||ce,variant:P,sizeTokens:N,leadingOffset:N.icon+M.space.md,trailingOffset:ce?N.icon+M.space.md:0,paddingLeft:O?M.space.none:N["padding-x"],color:M.colors["field-label"],style:g}),Me=ce&&!c?_jsx(Pressable,{onPress:re,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:w.clearSearch,children:(M.settings.icons.close??defaultIcons.close)({size:N.icon,color:M.colors["text-muted"]})}):null;return _jsxs(View,{style:V,testID:I,children:[f&&!Ie?_jsx(FieldLabel,{size:h,style:g,children:f}):null,_jsx(View,{style:G.root,children:_jsxs(View,{style:G.fieldWrap,children:[_jsx(FieldBase,{size:h,variant:P,focused:Q,disabled:c,filled:ce,minHeight:N["min-height"],paddingHorizontal:O?M.space.none:N["padding-x"],radius:U,leading:ze,trailing:Me,topNotch:He.topNotch,onPress:K,pressFeedback:!1,accessibilityRole:"search",accessibilityLabel:z??D,children:_jsx(TextInput,{ref:q,style:[G.input,{fontSize:N.text,color:W.color,...W.weightStyle},T],value:ie,onChangeText:oe,onSubmitEditing:ne,onFocus:Y,onBlur:Z,placeholder:!Ie||Q||ce?D:void 0,placeholderTextColor:W.placeholderColor,autoFocus:i,editable:!c,returnKeyType:"search",selectionColor:resolveVariantColors(M,P).borderFocusedRepresentative,accessibilityLabel:z??D,accessibilityState:{disabled:c},"aria-disabled":c,...H})}),He.node]})}),v&&v.length>0?_jsx(SearchScopeBar,{scopes:v,scope:ue||(v[0]?.value??""),disabled:c,haptic:E,labels:w,onChange:pe}):null,Re?_jsx(SearchRecents,{recents:Ce,labels:w,onSelect:ke,onRemove:F?Ee:void 0,onClear:_?Ae:void 0,onHold:Se,onRelease:ge}):null,je?_jsx(SearchSuggestions,{suggestions:xe,query:ie,onSelect:Be,onHold:Se,onRelease:ge}):null]})});SearchBar.displayName="SearchBar";const buildStyles=e=>StyleSheet.create({root:{flexDirection:"row",alignItems:"center",width:"100%",position:"relative",overflow:"visible"},fieldWrap:{flex:1,position:"relative",overflow:"visible"},input:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SearchBar};export default SearchBar;
1
+ "use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useDebounce}from"../../hooks/useDebounce.js";import{fillText,pluralText,useMobileUiText}from"../../text/index.js";import{SEARCH_BAR_TEXT}from"../../text/phone/searchBar.g.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{FieldBase,FieldLabel,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{normalizeSuggestion,SearchRecents,SearchScopeBar,SearchSuggestions}from"./SearchPanel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_PANEL_ROWS=8,HOLD_RELEASE_MS=50,SearchBar=forwardRef((e,l)=>{const{value:s,onChangeText:t,onSubmit:o,onFocus:a,onBlur:i,placeholder:r,autoFocus:n=!1,disabled:c=!1,onClear:u,leftIcon:d,debounceMs:p,size:b="md",variant:f,radius:m,label:h,labelMode:S="top",labelStyle:g,scopes:x,scope:v,onScopeChange:C,recents:j,maxRecents:y=DEFAULT_PANEL_ROWS,onSelectRecent:R,onRemove:T,onClearRecents:F,suggestions:_,maxSuggestions:k=DEFAULT_PANEL_ROWS,onSelect:B,haptic:E,labels:V,style:L,inputStyle:I,accessibilityLabel:M,testID:z,...A}=e;assertValidValue("SearchBar","size",e.size,["sm","md","lg"]),assertValidValue("SearchBar","variant",e.variant,["outline","filled","underline"]),assertValidValue("SearchBar","labelMode",e.labelMode,["top","float"]);const H=useTheme(),w=useMobileUiText("searchBar",SEARCH_BAR_TEXT),D=useMemo(()=>({...w,...V}),[w,V]),P=r??D.placeholder,N=f??H.settings.components["search-bar"]?.defaultVariant??H.settings.components.field?.defaultVariant??"filled",O="underline"===N,U=resolveFieldSize(H,b),W=m??H.components["search-bar"][b].radius,X=resolveFieldTextStyle(H,{disabled:c}),q=useRef(null),K=useMemo(()=>mergeRefs(q,l),[l]),$=useCallback(()=>{c||q.current?.focus()},[c]),G=useMemo(()=>buildStyles(H),[H]),J="string"==typeof s?s:"",[Q,Y]=useState(!1),Z=useCallback(e=>{Y(!0),a?.(e)},[a]),ee=useCallback(e=>{Y(!1),i?.(e)},[i]),[le,se]=useState(J),te=useRef(le);te.current=le;const oe=useDebounce(le,p??0);useEffect(()=>{void 0!==p&&J!==te.current&&se(J)},[J,p]);const ae=useRef(J);useEffect(()=>{void 0!==p&&oe!==ae.current&&(ae.current=oe,t(oe))},[oe,p,t]);const ie=useCallback(e=>{void 0===p?t(e):se(e)},[p,t]),re=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e),void 0!==p&&(se(""),ae.current=""),t(""),u?.()},[E,p,t,u]),ne=useCallback(()=>{o?.(void 0!==p?le:J)},[o,p,le,J]),ce=void 0!==p?le:J,ue=ce.length>0,[de,pe]=useControllableState({value:v,defaultValue:x?.[0]?.value??"",onChange:C}),be=useCallback(e=>{pe(e);const l=x?.find(l=>l.value===e)?.label;l&&announce(fillText(D.searching,{label:l}))},[x,pe,D]),[fe,me]=useState(!1),he=useRef(null),Se=useCallback(()=>{he.current&&(clearTimeout(he.current),he.current=null)},[]),ge=useCallback(()=>{Se(),me(!0)},[Se]),xe=useCallback(()=>{Se(),he.current=setTimeout(()=>me(!1),50)},[Se]);useEffect(()=>Se,[Se]);const ve=!c&&(Q||fe),Ce=useMemo(()=>(j??[]).slice(0,y),[j,y]),je=useMemo(()=>(_??[]).slice(0,k).map(normalizeSuggestion),[_,k]),ye=ve&&!ue&&Ce.length>0,Re=ve&&ue&&je.length>0,Te=Re?je.length:0,Fe=Te>0?pluralText(D,"suggestionCount",Te):"";useEffect(()=>{Fe&&announce(Fe)},[Fe]);const ke=useCallback(()=>{const e=resolveHaptic(E,"selection");e&&triggerHaptic(e)},[E]),Be=useCallback(e=>{ke(),q.current?.blur(),me(!1),R?.(e)},[ke,R]),Ee=useCallback(e=>{ke(),q.current?.blur(),me(!1),B?.(e)},[ke,B]),Ve=useCallback(e=>{ke(),T?.(e),announce(fillText(D.removed,{text:e})),$()},[ke,T,$,D]),Le=useCallback(()=>{ke(),F?.(),announce(D.recentsCleared),$()},[ke,F,$,D]),Ie={size:U.icon,color:c?H.colors["text-disabled"]:H.colors["text-subtle"],disabled:c},Me=d?renderSlotIcon(d,Ie):(H.settings.icons.search??defaultIcons.search)(Ie),ze=_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:Me}),Ae=Boolean(h)&&"float"===S,He=useFloatingLabel({label:h,enabled:Ae,floated:Q||ue,variant:N,sizeTokens:U,leadingOffset:U.icon+H.space.md,trailingOffset:ue?U.icon+H.space.md:0,paddingLeft:O?H.space.none:U["padding-x"],color:H.colors["field-label"],style:g}),we=ue&&!c?_jsx(Pressable,{onPress:re,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:D.clearSearch,children:(H.settings.icons.close??defaultIcons.close)({size:U.icon,color:H.colors["text-muted"]})}):null;return _jsxs(View,{style:L,testID:z,children:[h&&!Ae?_jsx(FieldLabel,{size:b,style:g,children:h}):null,_jsx(View,{style:G.root,children:_jsxs(View,{style:G.fieldWrap,children:[_jsx(FieldBase,{testID:z?`${z}-field`:void 0,size:b,variant:N,focused:Q,disabled:c,filled:ue,minHeight:U["min-height"],paddingHorizontal:O?H.space.none:U["padding-x"],radius:W,leading:ze,trailing:we,topNotch:He.topNotch,onPress:$,pressFeedback:!1,accessibilityRole:"search",accessibilityLabel:M??P,children:_jsx(TextInput,{ref:K,style:[G.input,{fontSize:U.text,color:X.color,...X.weightStyle},I],value:ce,onChangeText:ie,onSubmitEditing:ne,onFocus:Z,onBlur:ee,placeholder:!Ae||Q||ue?P:void 0,placeholderTextColor:X.placeholderColor,autoFocus:n,editable:!c,returnKeyType:"search",selectionColor:resolveVariantColors(H,N).borderFocusedRepresentative,accessibilityLabel:M??P,accessibilityState:{disabled:c},"aria-disabled":c,...A})}),He.node]})}),x&&x.length>0?_jsx(SearchScopeBar,{scopes:x,scope:de||(x[0]?.value??""),disabled:c,haptic:E,labels:D,onChange:be}):null,ye?_jsx(SearchRecents,{recents:Ce,labels:D,onSelect:Be,onRemove:T?Ve:void 0,onClear:F?Le:void 0,onHold:ge,onRelease:xe}):null,Re?_jsx(SearchSuggestions,{suggestions:je,query:ce,onSelect:Ee,onHold:ge,onRelease:xe}):null]})});SearchBar.displayName="SearchBar";const buildStyles=e=>StyleSheet.create({root:{flexDirection:"row",alignItems:"center",width:"100%",position:"relative",overflow:"visible"},fieldWrap:{flex:1,position:"relative",overflow:"visible"},input:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SearchBar};export default SearchBar;