@btndprojects/loam-ui-native 0.1.1 → 0.2.1

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 (262) hide show
  1. package/dist/accordion/index.js +5 -3
  2. package/dist/adaptive/index.js +6 -2
  3. package/dist/alert/index.js +5 -2
  4. package/dist/analyzer/index.js +9 -6
  5. package/dist/announcement/index.js +8 -5
  6. package/dist/audio-player/index.js +5 -3
  7. package/dist/avatar/index.js +5 -2
  8. package/dist/avatar-group/index.js +7 -3
  9. package/dist/badge/index.js +7 -4
  10. package/dist/banner/index.js +5 -2
  11. package/dist/board/index.js +11 -6
  12. package/dist/button/index.js +6 -3
  13. package/dist/camera-permission/index.js +15 -12
  14. package/dist/capture-result/index.js +19 -16
  15. package/dist/card/index.js +6 -3
  16. package/dist/card-form/index.js +12 -8
  17. package/dist/carousel/index.js +4 -2
  18. package/dist/chart/index.js +8 -5
  19. package/dist/charts/index.js +8 -6
  20. package/dist/chat/index.js +16 -0
  21. package/dist/checkbox/index.js +6 -4
  22. package/dist/checklist/index.js +11 -8
  23. package/dist/checkout/index.js +16 -11
  24. package/dist/chip/index.js +7 -4
  25. package/dist/{chunk-XNUVB5OL.js → chunk-2OLKPG4E.js} +92 -28
  26. package/dist/{chunk-RUZHTGKB.js → chunk-2PKYGLQ6.js} +71 -40
  27. package/dist/{chunk-UC2WGUP3.js → chunk-2SWKL3AJ.js} +91 -252
  28. package/dist/{chunk-AI4DWZCD.js → chunk-2SY63FCH.js} +63 -16
  29. package/dist/{chunk-F5XNPWS7.js → chunk-2TXERVVA.js} +92 -35
  30. package/dist/chunk-36EC2T6P.js +581 -0
  31. package/dist/chunk-3DUWIYV5.js +437 -0
  32. package/dist/{chunk-JNY4ZHAR.js → chunk-3QMEOFW5.js} +275 -71
  33. package/dist/chunk-3WEZCGHX.js +265 -0
  34. package/dist/chunk-46MMSDGL.js +194 -0
  35. package/dist/{chunk-7O2FMUPT.js → chunk-4IZXHVFJ.js} +297 -92
  36. package/dist/{chunk-LAECSR4H.js → chunk-5LAAAXFP.js} +14 -8
  37. package/dist/{chunk-2A5NIQAK.js → chunk-5RENVKBQ.js} +134 -46
  38. package/dist/{chunk-2ZZ7TDJ4.js → chunk-5UTRIXQ6.js} +37 -31
  39. package/dist/{chunk-LOE5YNN3.js → chunk-5VFZRGVD.js} +37 -10
  40. package/dist/{chunk-52X2VYTD.js → chunk-67IZZ2MJ.js} +115 -60
  41. package/dist/{chunk-UYG5L34B.js → chunk-6YAQBXB3.js} +10 -4
  42. package/dist/{chunk-BTTFCMKG.js → chunk-74FLKD24.js} +94 -23
  43. package/dist/{chunk-ITTYJZWX.js → chunk-7BUIKDD6.js} +73 -18
  44. package/dist/{chunk-423B7SPN.js → chunk-7OVVSVEZ.js} +273 -109
  45. package/dist/chunk-AEB7KCHQ.js +287 -0
  46. package/dist/chunk-APCWFOZW.js +28 -0
  47. package/dist/chunk-AWKQIE5I.js +139 -0
  48. package/dist/{chunk-VCDBXW5H.js → chunk-B7N4ASYE.js} +86 -42
  49. package/dist/{chunk-IVNRBPGC.js → chunk-C4GTDLRC.js} +104 -20
  50. package/dist/{chunk-4ZAHCY44.js → chunk-C6APNDVA.js} +12 -5
  51. package/dist/{chunk-4SZYY6AN.js → chunk-CMTVNF3D.js} +18 -13
  52. package/dist/{chunk-HZ6CNMAF.js → chunk-CPTOADB2.js} +151 -96
  53. package/dist/chunk-D5N5QWI7.js +1325 -0
  54. package/dist/{chunk-IIQTAY3J.js → chunk-DN7MNQIP.js} +113 -29
  55. package/dist/{chunk-47FWHGUN.js → chunk-DVGBZ3TX.js} +84 -23
  56. package/dist/chunk-DW3L54DQ.js +305 -0
  57. package/dist/{chunk-3ARE4TES.js → chunk-E2E3I5W2.js} +69 -18
  58. package/dist/{chunk-DHWADYZX.js → chunk-EDCBJV7J.js} +41 -28
  59. package/dist/{chunk-WSW6ZFAQ.js → chunk-ENP3BMZU.js} +4 -4
  60. package/dist/{chunk-OOPPQH27.js → chunk-EVOIGUBI.js} +43 -19
  61. package/dist/{chunk-VEAYTRPX.js → chunk-EY4DD67D.js} +165 -97
  62. package/dist/{chunk-223Q2T2Q.js → chunk-F3H33DQX.js} +132 -61
  63. package/dist/{chunk-CYRBHQQZ.js → chunk-F5B3UINI.js} +68 -35
  64. package/dist/{chunk-6X6PQ443.js → chunk-FAJI7BSC.js} +20 -9
  65. package/dist/{chunk-MOUJOP55.js → chunk-FUMHAAF3.js} +96 -29
  66. package/dist/{chunk-6HT2LP62.js → chunk-FV6HMP7W.js} +192 -73
  67. package/dist/{chunk-S7F6XLTK.js → chunk-FYWNRX4F.js} +76 -47
  68. package/dist/{chunk-YG3ZJHGU.js → chunk-FZGAAOKS.js} +30 -8
  69. package/dist/{chunk-YDGVJETP.js → chunk-G3AFC24V.js} +1 -1
  70. package/dist/{chunk-EJBDRVIH.js → chunk-G6UESEVN.js} +15 -8
  71. package/dist/chunk-GDKVKNR2.js +339 -0
  72. package/dist/chunk-GEIGMWNF.js +10 -0
  73. package/dist/{chunk-JUAMLEHX.js → chunk-H7DWSL4O.js} +24 -12
  74. package/dist/chunk-HJFFOOJ4.js +1 -0
  75. package/dist/{chunk-RW6ZL2FQ.js → chunk-HJLPZA4X.js} +106 -21
  76. package/dist/chunk-HYEOQWT7.js +647 -0
  77. package/dist/chunk-I2KLQ2HA.js +19 -0
  78. package/dist/{chunk-CJ5EOYZE.js → chunk-I4FHVKEC.js} +11 -5
  79. package/dist/{chunk-JNH2TYIN.js → chunk-IDM7JJMO.js} +19 -5
  80. package/dist/{chunk-O4AEHWII.js → chunk-IPUNJMAQ.js} +141 -49
  81. package/dist/{chunk-J7Q7VCVC.js → chunk-IT6FUXXG.js} +13 -6
  82. package/dist/{chunk-QJJ6MADV.js → chunk-IVKMZ7BB.js} +80 -28
  83. package/dist/{chunk-Z7H7VSFZ.js → chunk-IXKWIFWZ.js} +17 -6
  84. package/dist/chunk-J64KGCGX.js +55 -0
  85. package/dist/chunk-JBMLWFSJ.js +270 -0
  86. package/dist/{chunk-4BXMXBJO.js → chunk-JJLPBRVZ.js} +22 -11
  87. package/dist/chunk-JLC6PM5S.js +406 -0
  88. package/dist/chunk-JUYWSSKW.js +335 -0
  89. package/dist/{chunk-7CFF4HXS.js → chunk-JV5YOTOB.js} +49 -11
  90. package/dist/{chunk-LZLHELAG.js → chunk-KFJGFLMW.js} +29 -8
  91. package/dist/{chunk-O7AE6DAF.js → chunk-KQZ3GLHR.js} +18 -8
  92. package/dist/{chunk-N32RGOA5.js → chunk-LKFC4CS7.js} +80 -24
  93. package/dist/{chunk-YC6WORFL.js → chunk-LMPHCVJJ.js} +82 -50
  94. package/dist/{chunk-3WPW4KUN.js → chunk-LQP4KEXZ.js} +45 -13
  95. package/dist/{chunk-TKQYWZ5V.js → chunk-LUMVGO2K.js} +47 -31
  96. package/dist/{chunk-AWJOCGFZ.js → chunk-M656FYNH.js} +25 -13
  97. package/dist/{chunk-35OFI3JG.js → chunk-MKSNFG7H.js} +73 -20
  98. package/dist/{chunk-4GBOGOTV.js → chunk-NBEF4EPJ.js} +16 -6
  99. package/dist/chunk-NNCOFLNE.js +24 -0
  100. package/dist/{chunk-4YQOR7JM.js → chunk-NTQ2F3AU.js} +73 -20
  101. package/dist/{chunk-QCDXZBC5.js → chunk-O5V4TG3V.js} +126 -44
  102. package/dist/{chunk-U7TFM2JA.js → chunk-OJQUBQWA.js} +3 -3
  103. package/dist/{chunk-VQHPQEUH.js → chunk-OWAMM2DK.js} +13 -6
  104. package/dist/chunk-PID3NJB7.js +405 -0
  105. package/dist/{chunk-HET4LLMX.js → chunk-PMMTGBBS.js} +27 -17
  106. package/dist/{chunk-RIBDXGUG.js → chunk-PNF3NKB5.js} +49 -16
  107. package/dist/{chunk-JXJB2X6M.js → chunk-Q6NKEPRE.js} +81 -32
  108. package/dist/chunk-QDZGFXQD.js +176 -0
  109. package/dist/{chunk-SYNOJOQO.js → chunk-QEYFDRHR.js} +60 -26
  110. package/dist/{chunk-VBOXAEPI.js → chunk-QHAITQIF.js} +97 -22
  111. package/dist/{chunk-VXDZFJGP.js → chunk-QHTVYA65.js} +230 -76
  112. package/dist/{chunk-TUTI5HOZ.js → chunk-QIKT7LIB.js} +14 -8
  113. package/dist/{chunk-3ENTMPQY.js → chunk-QP3KMOVF.js} +82 -42
  114. package/dist/{chunk-GNNJ4GCC.js → chunk-QPWDDJJ4.js} +62 -148
  115. package/dist/{chunk-QWCMU5B2.js → chunk-QRUMA22E.js} +205 -80
  116. package/dist/{chunk-ZVFE5QGU.js → chunk-QYPE5JX3.js} +50 -10
  117. package/dist/{chunk-PUPM2YGF.js → chunk-ROCUG24E.js} +76 -36
  118. package/dist/{chunk-NQYBUO3K.js → chunk-RU3ZPNL6.js} +333 -142
  119. package/dist/{chunk-TOXAGRDQ.js → chunk-RXSCIO6W.js} +14 -5
  120. package/dist/{chunk-FMYDDECK.js → chunk-SATMR6SG.js} +631 -203
  121. package/dist/{chunk-4YIP3CWS.js → chunk-SHHY5OMK.js} +7 -5
  122. package/dist/chunk-SKWO3SZF.js +2284 -0
  123. package/dist/{chunk-YF4NSSMT.js → chunk-SWS5JQIF.js} +41 -13
  124. package/dist/{chunk-CUMUNPXY.js → chunk-T5LTPKX6.js} +15 -7
  125. package/dist/{chunk-H6NIOQHK.js → chunk-TDMG26JI.js} +26 -6
  126. package/dist/{chunk-UWFLYMAR.js → chunk-TLCIR6RG.js} +267 -126
  127. package/dist/{chunk-SBMNWWBV.js → chunk-TN2ZNJUI.js} +47 -9
  128. package/dist/{chunk-5YNTNN5A.js → chunk-TQVAIKFD.js} +106 -41
  129. package/dist/chunk-TRGFFU6A.js +1456 -0
  130. package/dist/{chunk-2GK6PHGE.js → chunk-TY4MTKQJ.js} +100 -22
  131. package/dist/{chunk-AZRX6SAC.js → chunk-U23FYWME.js} +15 -7
  132. package/dist/{chunk-PZXZJBMP.js → chunk-U5NLHYV6.js} +26 -12
  133. package/dist/chunk-UQEN55EY.js +1 -0
  134. package/dist/chunk-UQGBTPXH.js +218 -0
  135. package/dist/chunk-UXGIW7OK.js +116 -0
  136. package/dist/{chunk-PJXUJYS6.js → chunk-UYGDJWMN.js} +55 -30
  137. package/dist/{chunk-QDYDBCFP.js → chunk-V2OEB75Z.js} +50 -51
  138. package/dist/{chunk-LSS54GLJ.js → chunk-VAOAKWUK.js} +34 -13
  139. package/dist/{chunk-DM5QUKKO.js → chunk-VDPK5CY4.js} +18 -6
  140. package/dist/chunk-W23G6JLF.js +37 -0
  141. package/dist/{chunk-CDRZHT42.js → chunk-W63AJTM7.js} +276 -12
  142. package/dist/{chunk-XXXEFXY5.js → chunk-W74TXYFB.js} +13 -5
  143. package/dist/{chunk-LRJNDEIA.js → chunk-WRDSPUE7.js} +144 -29
  144. package/dist/{chunk-C2NTXVWM.js → chunk-XBZGDDMR.js} +11 -4
  145. package/dist/{chunk-BV3B2HYZ.js → chunk-XIDTBCBA.js} +189 -131
  146. package/dist/{chunk-YTFKPRUK.js → chunk-XN4KG3P4.js} +348 -153
  147. package/dist/chunk-XQXMLMH3.js +211 -0
  148. package/dist/{chunk-HPPW424V.js → chunk-XTORZWRF.js} +19 -8
  149. package/dist/{chunk-P23EQNRQ.js → chunk-YAAHPATV.js} +181 -30
  150. package/dist/{chunk-KMI5ML5I.js → chunk-YXOAPXMU.js} +57 -18
  151. package/dist/{chunk-RJQOOHT2.js → chunk-ZECZOOSB.js} +59 -28
  152. package/dist/{chunk-QKXCPTFS.js → chunk-ZLTO5VQI.js} +121 -31
  153. package/dist/{chunk-BEDBFJND.js → chunk-ZVATDZOM.js} +16 -18
  154. package/dist/coachmark/index.js +6 -3
  155. package/dist/code-block/index.js +5 -3
  156. package/dist/color-field/index.js +6 -4
  157. package/dist/commerce/index.js +19 -16
  158. package/dist/connectivity/index.js +5 -2
  159. package/dist/context-menu/index.js +5 -3
  160. package/dist/copy-button/index.js +4 -2
  161. package/dist/data-grid/index.js +21 -16
  162. package/dist/date-range-picker/index.js +11 -8
  163. package/dist/description-list/index.js +3 -1
  164. package/dist/dialog/index.js +4 -2
  165. package/dist/empty-state/index.js +4 -2
  166. package/dist/error-summary/index.js +4 -2
  167. package/dist/fab/index.js +5 -2
  168. package/dist/file-manager/index.js +28 -0
  169. package/dist/file-upload/index.js +10 -7
  170. package/dist/filter-bar/index.js +9 -6
  171. package/dist/flow-run/index.js +15 -12
  172. package/dist/form/index.js +5 -3
  173. package/dist/gallery/index.js +5 -2
  174. package/dist/hold-to-confirm/index.js +4 -2
  175. package/dist/index.d.ts +9557 -2985
  176. package/dist/index.js +355 -122
  177. package/dist/infinite-list/index.js +4 -2
  178. package/dist/inline-edit/index.js +6 -4
  179. package/dist/input/index.js +5 -3
  180. package/dist/interactions/index.js +2 -1
  181. package/dist/invoice/index.js +13 -9
  182. package/dist/kbd/index.js +5 -1
  183. package/dist/keyboard/index.js +4 -2
  184. package/dist/list-row/index.js +6 -4
  185. package/dist/log-viewer/index.js +4 -2
  186. package/dist/map-view/index.js +5 -3
  187. package/dist/markdown/index.js +9 -6
  188. package/dist/metric/index.js +7 -4
  189. package/dist/money/index.js +9 -3
  190. package/dist/nav-drawer/index.js +4 -2
  191. package/dist/nav-header/index.js +9 -0
  192. package/dist/navigation/index.js +5 -2
  193. package/dist/notification-center/index.js +12 -10
  194. package/dist/number-roll/index.js +5 -2
  195. package/dist/one-handed/index.js +5 -3
  196. package/dist/os-surfaces/index.js +6 -3
  197. package/dist/otp/index.js +7 -4
  198. package/dist/page-header/index.js +1 -0
  199. package/dist/pagination/index.js +6 -0
  200. package/dist/payment-method/index.js +14 -10
  201. package/dist/payment-status/index.js +17 -14
  202. package/dist/permission/index.js +5 -2
  203. package/dist/picker/index.js +11 -6
  204. package/dist/progress/index.js +6 -3
  205. package/dist/pull-to-refresh/index.js +4 -2
  206. package/dist/radio-group/index.js +6 -4
  207. package/dist/rating/index.js +5 -2
  208. package/dist/receivables/index.js +21 -16
  209. package/dist/refund/index.js +18 -14
  210. package/dist/save-status/index.js +5 -3
  211. package/dist/scroll-area/index.js +3 -1
  212. package/dist/search-field/index.js +8 -0
  213. package/dist/segmented-control/index.js +4 -3
  214. package/dist/sheet/index.js +5 -3
  215. package/dist/skeleton/index.js +3 -1
  216. package/dist/slider/index.js +4 -2
  217. package/dist/sortable/index.js +7 -0
  218. package/dist/spinner/index.js +3 -1
  219. package/dist/split-button/index.js +9 -6
  220. package/dist/spotlight/index.js +3 -1
  221. package/dist/stage-timeline/index.js +5 -3
  222. package/dist/status-dot/index.js +4 -2
  223. package/dist/stepper/index.js +7 -4
  224. package/dist/streaming-text/index.js +3 -2
  225. package/dist/survey/index.js +18 -15
  226. package/dist/switch/index.js +5 -3
  227. package/dist/system-state/index.js +7 -4
  228. package/dist/tab-bar/index.js +5 -2
  229. package/dist/tabs/index.js +4 -2
  230. package/dist/tags-input/index.js +10 -0
  231. package/dist/textarea/index.js +6 -4
  232. package/dist/thinking/index.js +3 -1
  233. package/dist/time-field/index.js +12 -0
  234. package/dist/time-range-control/index.js +22 -0
  235. package/dist/timeline/index.js +4 -2
  236. package/dist/toast/index.js +4 -2
  237. package/dist/toolbar/index.js +4 -2
  238. package/dist/tour/index.js +12 -9
  239. package/dist/truncation-notice/index.js +5 -2
  240. package/dist/update-notice/index.js +12 -9
  241. package/dist/video-player/index.js +5 -2
  242. package/dist/viewfinder/index.js +6 -4
  243. package/dist/widget/index.js +7 -4
  244. package/dist/wizard/index.js +7 -4
  245. package/package.json +13 -12
  246. package/dist/chunk-6N33LFQA.js +0 -35
  247. package/dist/chunk-GDKZTW34.js +0 -395
  248. package/dist/chunk-GL7B2DOW.js +0 -134
  249. package/dist/chunk-NKB7BZYK.js +0 -167
  250. package/dist/chunk-OETCUXQP.js +0 -134
  251. package/dist/chunk-OPXFZ4Y5.js +0 -204
  252. package/dist/chunk-Q72LJOVE.js +0 -169
  253. package/dist/chunk-RNGLIHFA.js +0 -191
  254. package/dist/chunk-RQ3HASCC.js +0 -6
  255. package/dist/chunk-RSOJT5YW.js +0 -124
  256. package/dist/chunk-TKVFVF5D.js +0 -95
  257. package/dist/chunk-XOSCY2CW.js +0 -242
  258. package/dist/header/index.js +0 -5
  259. package/dist/search-bar/index.js +0 -5
  260. /package/dist/{chunk-3ECPOSKO.js → chunk-3UG6JUCV.js} +0 -0
  261. /package/dist/{chunk-JRLTGLN4.js → chunk-5WWRTEPS.js} +0 -0
  262. /package/dist/{chunk-RTIKSY6A.js → chunk-5Z5ZYMOJ.js} +0 -0
@@ -0,0 +1,405 @@
1
+ import { Sheet } from './chunk-QYPE5JX3.js';
2
+ import { expandedProps } from './chunk-W23G6JLF.js';
3
+ import { Button } from './chunk-E2E3I5W2.js';
4
+ import { haptics } from './chunk-NY2U3PBI.js';
5
+ import { useLabels } from './chunk-APCWFOZW.js';
6
+ import { Icon } from './chunk-UXGIW7OK.js';
7
+ import { useResolvedMotion } from './chunk-J64KGCGX.js';
8
+ import * as React from 'react';
9
+ import { Animated, Platform, View, Text, Pressable } from 'react-native';
10
+ import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
11
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
12
+
13
+ var MIN_SCALE = 0.85;
14
+ var TILT = 50;
15
+ function WheelPicker({
16
+ items,
17
+ value,
18
+ onValueChange,
19
+ visibleRows = 5,
20
+ accessibilityLabel,
21
+ motion = "full",
22
+ style,
23
+ testID
24
+ }) {
25
+ const theme = useLoamTheme("picker");
26
+ const { styles } = useStyles(sheet);
27
+ const level = useResolvedMotion(motion, "picker");
28
+ const row = theme.tapMin;
29
+ const pad = row * (visibleRows - 1) / 2;
30
+ const selectedIndex = Math.max(
31
+ 0,
32
+ items.findIndex((item) => item.value === value)
33
+ );
34
+ const scrollY = React.useRef(new Animated.Value(selectedIndex * row)).current;
35
+ const scroller = React.useRef(null);
36
+ const live = React.useRef(selectedIndex);
37
+ const settled = React.useRef(selectedIndex);
38
+ const indexAt = (y) => Math.min(items.length - 1, Math.max(0, Math.round(y / row)));
39
+ React.useLayoutEffect(() => {
40
+ if (Platform.OS === "web")
41
+ scroller.current?.scrollTo({ y: selectedIndex * row, animated: false });
42
+ }, []);
43
+ React.useEffect(() => {
44
+ if (selectedIndex === settled.current) return;
45
+ settled.current = selectedIndex;
46
+ live.current = selectedIndex;
47
+ scroller.current?.scrollTo({ y: selectedIndex * row, animated: level === "full" });
48
+ }, [selectedIndex, row, level]);
49
+ const commit = (index) => {
50
+ settled.current = index;
51
+ const item = items[index];
52
+ if (item && item.value !== value) onValueChange?.(item.value);
53
+ };
54
+ const onScroll = Animated.event([{ nativeEvent: { contentOffset: { y: scrollY } } }], {
55
+ useNativeDriver: true,
56
+ listener: (e) => {
57
+ const i = indexAt(e.nativeEvent.contentOffset.y);
58
+ if (i !== live.current) {
59
+ live.current = i;
60
+ haptics.selection();
61
+ }
62
+ if (idle.current) clearTimeout(idle.current);
63
+ idle.current = setTimeout(() => commit(i), 150);
64
+ }
65
+ });
66
+ const idle = React.useRef(null);
67
+ React.useEffect(
68
+ () => () => {
69
+ if (idle.current) clearTimeout(idle.current);
70
+ },
71
+ []
72
+ );
73
+ const onEnd = (e) => {
74
+ if (idle.current) clearTimeout(idle.current);
75
+ commit(indexAt(e.nativeEvent.contentOffset.y));
76
+ };
77
+ const step = (delta) => {
78
+ const next = Math.min(items.length - 1, Math.max(0, settled.current + delta));
79
+ if (next === settled.current) return;
80
+ haptics.selection();
81
+ live.current = next;
82
+ scroller.current?.scrollTo({ y: next * row, animated: level === "full" });
83
+ commit(next);
84
+ };
85
+ const current = items[selectedIndex];
86
+ return /* @__PURE__ */ jsxs(
87
+ View,
88
+ {
89
+ testID,
90
+ accessible: true,
91
+ accessibilityRole: "adjustable",
92
+ accessibilityLabel,
93
+ accessibilityValue: { text: current?.label },
94
+ ...{ role: "slider", "aria-valuetext": current?.label },
95
+ accessibilityActions: [{ name: "increment" }, { name: "decrement" }],
96
+ onAccessibilityAction: (e) => step(e.nativeEvent.actionName === "increment" ? 1 : -1),
97
+ style: [styles.wheel, { height: row * visibleRows }, style],
98
+ children: [
99
+ /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: [styles.band, { top: pad, height: row }] }),
100
+ /* @__PURE__ */ jsx(
101
+ Animated.ScrollView,
102
+ {
103
+ ref: scroller,
104
+ showsVerticalScrollIndicator: false,
105
+ snapToInterval: row,
106
+ decelerationRate: "fast",
107
+ contentOffset: { x: 0, y: selectedIndex * row },
108
+ contentContainerStyle: { paddingVertical: pad },
109
+ scrollEventThrottle: 16,
110
+ onScroll,
111
+ onMomentumScrollEnd: onEnd,
112
+ style: Platform.OS === "web" ? { scrollSnapType: "y mandatory" } : void 0,
113
+ ...{ "aria-hidden": true },
114
+ children: items.map((item, i) => {
115
+ const at = i * row;
116
+ const range = [at - 2 * row, at - row, at, at + row, at + 2 * row];
117
+ const opacity = scrollY.interpolate({
118
+ inputRange: range,
119
+ outputRange: [0.3, 0.6, 1, 0.6, 0.3],
120
+ extrapolate: "clamp"
121
+ });
122
+ const turn = level === "full" ? [
123
+ { perspective: row * 8 },
124
+ {
125
+ rotateX: scrollY.interpolate({
126
+ inputRange: range,
127
+ outputRange: [
128
+ `${-TILT}deg`,
129
+ `${-TILT / 2}deg`,
130
+ "0deg",
131
+ `${TILT / 2}deg`,
132
+ `${TILT}deg`
133
+ ],
134
+ extrapolate: "clamp"
135
+ })
136
+ },
137
+ {
138
+ scale: scrollY.interpolate({
139
+ inputRange: range,
140
+ outputRange: [
141
+ MIN_SCALE,
142
+ (1 + MIN_SCALE) / 2,
143
+ 1,
144
+ (1 + MIN_SCALE) / 2,
145
+ MIN_SCALE
146
+ ],
147
+ extrapolate: "clamp"
148
+ })
149
+ }
150
+ ] : [];
151
+ return /* @__PURE__ */ jsx(
152
+ Animated.View,
153
+ {
154
+ style: [
155
+ styles.row,
156
+ { height: row, opacity, transform: turn },
157
+ Platform.OS === "web" ? { scrollSnapAlign: "center" } : null
158
+ ],
159
+ children: /* @__PURE__ */ jsx(
160
+ Text,
161
+ {
162
+ style: [styles.label, i === selectedIndex && styles.labelSelected],
163
+ numberOfLines: 1,
164
+ children: item.label
165
+ }
166
+ )
167
+ },
168
+ item.value
169
+ );
170
+ })
171
+ }
172
+ )
173
+ ]
174
+ }
175
+ );
176
+ }
177
+ var sheet = createStyleSheet((theme) => ({
178
+ wheel: { alignSelf: "stretch", overflow: "hidden" },
179
+ band: {
180
+ position: "absolute",
181
+ left: 0,
182
+ right: 0,
183
+ borderRadius: theme.radius.md,
184
+ backgroundColor: theme.color.accentSoft,
185
+ // The tint collapses to the surface under `contrast: 'more'`, where
186
+ // `edge.accent` turns opaque and keeps the selection band drawn.
187
+ borderWidth: theme.borderWidth.base,
188
+ borderColor: theme.edge.accent
189
+ },
190
+ row: { alignItems: "center", justifyContent: "center" },
191
+ label: {
192
+ fontFamily: theme.font.sans,
193
+ fontSize: theme.fontSize[20],
194
+ color: theme.color.text
195
+ },
196
+ labelSelected: { fontWeight: theme.fontWeight.semibold, color: theme.color.accentOnSoft }
197
+ }));
198
+ var DEFAULT_LABELS = {
199
+ select: "Select\u2026",
200
+ done: "Done"
201
+ };
202
+ function Picker({
203
+ items,
204
+ value,
205
+ onValueChange,
206
+ placeholder: placeholderProp,
207
+ title,
208
+ disabled = false,
209
+ size = "md",
210
+ accessibilityLabel,
211
+ variant = "list",
212
+ motion = "full",
213
+ labels: labelsProp
214
+ }) {
215
+ const labels = useLabels("picker", DEFAULT_LABELS, labelsProp);
216
+ const placeholder = placeholderProp ?? labels.select;
217
+ const [open, setOpen] = React.useState(false);
218
+ const [draft, setDraft] = React.useState(value);
219
+ React.useEffect(() => {
220
+ if (open) setDraft(value ?? items[0]?.value);
221
+ }, [open]);
222
+ const theme = useLoamTheme("picker");
223
+ const selected = items.find((item) => item.value === value);
224
+ const isPlaceholder = selected == null;
225
+ const displayText = selected?.label ?? placeholder;
226
+ const { styles } = useStyles(sheet2, { size, disabled, placeholder: isPlaceholder });
227
+ const iconSize = theme.ctl.icon[size];
228
+ const slopY = Math.max(0, (theme.hit[size] - theme.ctl[size]) / 2);
229
+ const handleSelect = (next) => {
230
+ haptics.selection();
231
+ onValueChange?.(next);
232
+ setOpen(false);
233
+ };
234
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
235
+ /* @__PURE__ */ jsxs(
236
+ Pressable,
237
+ {
238
+ accessibilityRole: "button",
239
+ accessibilityLabel: accessibilityLabel ? `${accessibilityLabel}, ${displayText}` : displayText,
240
+ accessibilityState: { disabled, expanded: open },
241
+ ...expandedProps(open),
242
+ disabled,
243
+ onPress: disabled ? void 0 : () => setOpen(true),
244
+ hitSlop: { top: slopY, bottom: slopY },
245
+ style: styles.trigger,
246
+ children: [
247
+ /* @__PURE__ */ jsx(Text, { style: styles.value, numberOfLines: 1, children: displayText }),
248
+ /* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: iconSize, color: theme.color.text3 })
249
+ ]
250
+ }
251
+ ),
252
+ /* @__PURE__ */ jsxs(
253
+ Sheet,
254
+ {
255
+ open,
256
+ onClose: () => setOpen(false),
257
+ title,
258
+ footer: variant === "wheel" ? /* @__PURE__ */ jsx(
259
+ Button,
260
+ {
261
+ fullWidth: true,
262
+ onPress: () => {
263
+ if (draft != null && draft !== value) onValueChange?.(draft);
264
+ setOpen(false);
265
+ },
266
+ children: labels.done
267
+ }
268
+ ) : void 0,
269
+ children: [
270
+ variant === "wheel" ? /* @__PURE__ */ jsx(
271
+ WheelPicker,
272
+ {
273
+ items,
274
+ value: draft,
275
+ onValueChange: setDraft,
276
+ accessibilityLabel: title ?? accessibilityLabel ?? placeholder,
277
+ motion
278
+ }
279
+ ) : null,
280
+ variant === "wheel" ? null : items.map((item) => {
281
+ const isSelected = item.value === value;
282
+ return /* @__PURE__ */ jsxs(
283
+ Pressable,
284
+ {
285
+ accessibilityRole: "button",
286
+ accessibilityLabel: item.label,
287
+ accessibilityState: { selected: isSelected },
288
+ onPress: () => handleSelect(item.value),
289
+ style: ({ pressed }) => [
290
+ styles.option,
291
+ isSelected ? styles.optionSelected : null,
292
+ pressed ? styles.optionPressed : null
293
+ ],
294
+ children: [
295
+ /* @__PURE__ */ jsx(
296
+ Text,
297
+ {
298
+ style: [styles.optionLabel, isSelected ? styles.optionLabelSelected : null],
299
+ children: item.label
300
+ }
301
+ ),
302
+ isSelected ? /* @__PURE__ */ jsx(Icon, { name: "check", size: theme.icon.md, color: theme.color.accentOnSoft }) : null
303
+ ]
304
+ },
305
+ item.value
306
+ );
307
+ })
308
+ ]
309
+ }
310
+ )
311
+ ] });
312
+ }
313
+ var sheet2 = createStyleSheet((theme) => ({
314
+ trigger: {
315
+ flexDirection: "row",
316
+ alignItems: "center",
317
+ backgroundColor: theme.color.surface2,
318
+ // The reference draws a `1.5px` field edge — the static `w2` weight.
319
+ borderWidth: theme.borderWidth.thick,
320
+ borderColor: theme.color.borderStrong,
321
+ variants: {
322
+ // Height, padding, gap and corner radius all resolve from one control-size
323
+ // tier (26 / 30 / 36 / 44), matching {@link Input}.
324
+ size: {
325
+ xs: {
326
+ height: theme.ctl.xs,
327
+ paddingHorizontal: theme.ctl.px.xs,
328
+ gap: theme.ctl.gap.xs,
329
+ borderRadius: theme.ctl.r.xs
330
+ },
331
+ sm: {
332
+ height: theme.ctl.sm,
333
+ paddingHorizontal: theme.ctl.px.sm,
334
+ gap: theme.ctl.gap.sm,
335
+ borderRadius: theme.ctl.r.sm
336
+ },
337
+ md: {
338
+ height: theme.ctl.md,
339
+ paddingHorizontal: theme.ctl.px.md,
340
+ gap: theme.ctl.gap.md,
341
+ borderRadius: theme.ctl.r.md
342
+ },
343
+ lg: {
344
+ height: theme.ctl.lg,
345
+ paddingHorizontal: theme.ctl.px.lg,
346
+ gap: theme.ctl.gap.lg,
347
+ borderRadius: theme.ctl.r.lg
348
+ }
349
+ },
350
+ disabled: {
351
+ true: { opacity: theme.state.disabledOpacity },
352
+ false: {}
353
+ }
354
+ }
355
+ },
356
+ value: {
357
+ flex: 1,
358
+ fontFamily: theme.font.sans,
359
+ variants: {
360
+ size: {
361
+ xs: { fontSize: theme.fontSize[14] },
362
+ sm: { fontSize: theme.fontSize[14] },
363
+ md: { fontSize: theme.fontSize[16] },
364
+ lg: { fontSize: theme.fontSize[16] }
365
+ },
366
+ placeholder: {
367
+ true: { color: theme.color.text3 },
368
+ false: { color: theme.color.text }
369
+ }
370
+ }
371
+ },
372
+ option: {
373
+ flexDirection: "row",
374
+ alignItems: "center",
375
+ gap: theme.space.s3,
376
+ minHeight: theme.space[48],
377
+ paddingHorizontal: theme.space.s3,
378
+ paddingVertical: theme.space.s2,
379
+ borderRadius: theme.radius.md,
380
+ // Every row carries the edge weight so selecting one does not shift the text.
381
+ borderWidth: theme.borderWidth.base,
382
+ borderColor: "transparent"
383
+ },
384
+ // The reference's selection band: an `accentSoft` `radius.md` plate behind the
385
+ // centred option. `-soft` tints collapse at high contrast, so it carries the
386
+ // matching tone edge.
387
+ optionSelected: {
388
+ backgroundColor: theme.color.accentSoft,
389
+ borderWidth: theme.borderWidth.base,
390
+ borderColor: theme.edge.accent
391
+ },
392
+ optionPressed: { backgroundColor: theme.color.surface2 },
393
+ optionLabel: {
394
+ flex: 1,
395
+ fontFamily: theme.font.sans,
396
+ fontSize: theme.fontSize[16],
397
+ color: theme.color.text2
398
+ },
399
+ optionLabelSelected: {
400
+ fontWeight: theme.fontWeight.semibold,
401
+ color: theme.color.accentOnSoft
402
+ }
403
+ }));
404
+
405
+ export { Picker, WheelPicker };
@@ -1,11 +1,13 @@
1
- import { CardBrandMark, OrDivider } from './chunk-PUPM2YGF.js';
2
- import { Badge } from './chunk-SBMNWWBV.js';
3
- import { Skeleton } from './chunk-RIBDXGUG.js';
4
- import { Button } from './chunk-3ARE4TES.js';
1
+ import { Skeleton } from './chunk-PNF3NKB5.js';
2
+ import { DEFAULT_LABELS, CardBrandMark, OrDivider } from './chunk-ROCUG24E.js';
3
+ import { usePayLabels } from './chunk-GEIGMWNF.js';
4
+ import { Badge } from './chunk-TN2ZNJUI.js';
5
+ import { Button } from './chunk-E2E3I5W2.js';
6
+ import { useLabels, useLoamLocale } from './chunk-APCWFOZW.js';
5
7
  import 'react';
6
8
  import { View, Text } from 'react-native';
7
9
  import { createStyleSheet, useStyles } from '@btndprojects/loam-theme-native';
8
- import { mask, methodsFor } from '@btndprojects/loam-pay';
10
+ import { mask, methodsFor, methodText } from '@btndprojects/loam-pay';
9
11
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
12
 
11
13
  function SavedCardChip({
@@ -15,22 +17,24 @@ function SavedCardChip({
15
17
  isDefault = false,
16
18
  onUseAnother,
17
19
  onManage,
18
- useAnotherLabel = "Use a different card",
19
- manageLabel = "Manage cards",
20
+ useAnotherLabel,
21
+ manageLabel,
22
+ labels: labelsProp,
20
23
  style,
21
24
  testID
22
25
  }) {
26
+ const labels = useLabels("paymentMethod", DEFAULT_LABELS, labelsProp);
23
27
  const { styles } = useStyles(sheet);
24
28
  return /* @__PURE__ */ jsxs(View, { testID, style: [styles.chip, style], children: [
25
29
  /* @__PURE__ */ jsxs(View, { style: styles.chipFacts, children: [
26
- /* @__PURE__ */ jsx(CardBrandMark, { brand, size: "md" }),
30
+ /* @__PURE__ */ jsx(CardBrandMark, { brand, size: "md", labels: labelsProp }),
27
31
  /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles.chipMask, children: mask(brand, last4) }),
28
- expiry ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles.chipExpiry, children: `Expires ${expiry}` }) : null,
29
- isDefault ? /* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: "neutral", size: "sm", children: "default" }) : null
32
+ expiry ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles.chipExpiry, children: labels.expires(expiry) }) : null,
33
+ isDefault ? /* @__PURE__ */ jsx(Badge, { style: styles.rowBadge, variant: "neutral", size: "sm", children: labels.defaultBadge }) : null
30
34
  ] }),
31
35
  /* @__PURE__ */ jsxs(View, { style: styles.chipActions, children: [
32
- onManage ? /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onPress: onManage, children: manageLabel }) : null,
33
- /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onPress: onUseAnother, children: useAnotherLabel })
36
+ onManage ? /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onPress: onManage, children: manageLabel ?? labels.manageCards }) : null,
37
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onPress: onUseAnother, children: useAnotherLabel ?? labels.useDifferentCard })
34
38
  ] })
35
39
  ] });
36
40
  }
@@ -39,16 +43,22 @@ function ExpressPayRow({
39
43
  platform,
40
44
  label,
41
45
  secondary,
42
- dividerLabel = "or pay with card",
43
- resolvingLabel = "Checking for a wallet on this device",
46
+ dividerLabel,
47
+ resolvingLabel: resolvingLabelProp,
44
48
  onExpressPay,
49
+ loading = false,
45
50
  onInstalments,
51
+ labels: labelsProp,
46
52
  style,
47
53
  testID
48
54
  }) {
55
+ const labels = useLabels("paymentMethod", DEFAULT_LABELS, labelsProp);
56
+ const pay = usePayLabels(labelsProp);
57
+ const locale = useLoamLocale();
58
+ const resolvingLabel = resolvingLabelProp ?? labels.checkingWallet;
49
59
  const { styles, theme } = useStyles(sheet);
50
60
  const express = methodsFor({ platform }).find((m) => m.kind === "express");
51
- const buttonLabel = label ?? (express ? `Pay with ${express.label.toLowerCase()}` : "Express pay");
61
+ const buttonLabel = label ?? (express ? labels.payWith((methodText(express.id, pay)?.label ?? express.label).toLocaleLowerCase(locale)) : labels.expressPay);
52
62
  if (state === "unavailable") return null;
53
63
  return /* @__PURE__ */ jsxs(View, { testID, style: [styles.express, style], children: [
54
64
  state === "resolving" ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -73,10 +83,10 @@ function ExpressPayRow({
73
83
  }
74
84
  )
75
85
  ] }) : /* @__PURE__ */ jsxs(View, { style: styles.expressButtons, children: [
76
- /* @__PURE__ */ jsx(Button, { size: "lg", fullWidth: true, leadingIcon: "lock", onPress: onExpressPay, children: buttonLabel }),
86
+ /* @__PURE__ */ jsx(Button, { size: "lg", fullWidth: true, leadingIcon: "lock", loading, onPress: onExpressPay, children: buttonLabel }),
77
87
  onInstalments && secondary ? /* @__PURE__ */ jsx(Button, { variant: "outline", size: "lg", fullWidth: true, onPress: onInstalments, children: secondary }) : null
78
88
  ] }),
79
- /* @__PURE__ */ jsx(OrDivider, { label: dividerLabel })
89
+ /* @__PURE__ */ jsx(OrDivider, { label: dividerLabel ?? labels.orPayWithCard, labels: labelsProp })
80
90
  ] });
81
91
  }
82
92
  var sheet = createStyleSheet((theme) => ({
@@ -1,9 +1,12 @@
1
+ import { useLabels } from './chunk-APCWFOZW.js';
1
2
  import * as React from 'react';
2
3
  import { Animated, Easing, AccessibilityInfo, View } from 'react-native';
3
4
  import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
4
5
  import { jsx } from 'react/jsx-runtime';
5
6
 
6
- // src/skeleton/skeleton.tsx
7
+ var DEFAULT_LABELS = {
8
+ loading: "Loading"
9
+ };
7
10
  var CIRCLE_DEFAULT = 40;
8
11
  var TEXT_HEIGHT = 14;
9
12
  var RECT_HEIGHT = 120;
@@ -13,10 +16,14 @@ function Skeleton({
13
16
  height,
14
17
  radius,
15
18
  style,
16
- accessibilityLabel = "Loading",
19
+ accessibilityLabel: accessibilityLabelProp,
20
+ decorative = false,
21
+ labels: labelsProp,
17
22
  testID
18
23
  }) {
19
- const theme = useLoamTheme();
24
+ const theme = useLoamTheme("skeleton");
25
+ const labels = useLabels("skeleton", DEFAULT_LABELS, labelsProp);
26
+ const accessibilityLabel = accessibilityLabelProp ?? labels.loading;
20
27
  const { styles } = useStyles(sheet, { variant });
21
28
  let resolvedWidth;
22
29
  let resolvedHeight;
@@ -61,9 +68,16 @@ function Skeleton({
61
68
  return /* @__PURE__ */ jsx(
62
69
  Animated.View,
63
70
  {
64
- accessibilityRole: "image",
65
- accessibilityLabel,
66
- accessibilityState: { busy: true },
71
+ ...decorative ? {
72
+ accessible: false,
73
+ accessibilityElementsHidden: true,
74
+ importantForAccessibility: "no-hide-descendants",
75
+ "aria-hidden": true
76
+ } : {
77
+ accessibilityRole: "image",
78
+ accessibilityLabel,
79
+ accessibilityState: { busy: true }
80
+ },
67
81
  testID,
68
82
  style: [
69
83
  styles.base,
@@ -79,18 +93,37 @@ function SkeletonText({
79
93
  lastLineWidth = "60%",
80
94
  lineHeight = TEXT_HEIGHT,
81
95
  style,
96
+ accessibilityLabel: accessibilityLabelProp,
97
+ labels: labelsProp,
82
98
  testID
83
99
  }) {
84
- const theme = useLoamTheme();
85
- return /* @__PURE__ */ jsx(View, { style: [{ gap: theme.space.s2 }, style], testID, children: Array.from({ length: Math.max(0, lines) }).map((_, i) => /* @__PURE__ */ jsx(
86
- Skeleton,
87
- {
88
- variant: "text",
89
- height: lineHeight,
90
- style: i === lines - 1 ? { width: lastLineWidth } : void 0
91
- },
92
- i
93
- )) });
100
+ const theme = useLoamTheme("skeleton");
101
+ const labels = useLabels("skeleton", DEFAULT_LABELS, labelsProp);
102
+ const accessibilityLabel = accessibilityLabelProp ?? labels.loading;
103
+ return (
104
+ // One labelled "Loading" image for the group; the bones are hidden.
105
+ /* @__PURE__ */ jsx(
106
+ View,
107
+ {
108
+ accessible: true,
109
+ accessibilityRole: "image",
110
+ accessibilityLabel,
111
+ accessibilityState: { busy: true },
112
+ style: [{ gap: theme.space.s2 }, style],
113
+ testID,
114
+ children: Array.from({ length: Math.max(0, lines) }).map((_, i) => /* @__PURE__ */ jsx(
115
+ Skeleton,
116
+ {
117
+ variant: "text",
118
+ decorative: true,
119
+ height: lineHeight,
120
+ style: i === lines - 1 ? { width: lastLineWidth } : void 0
121
+ },
122
+ i
123
+ ))
124
+ }
125
+ )
126
+ );
94
127
  }
95
128
  var sheet = createStyleSheet((theme) => ({
96
129
  base: {