@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
@@ -1,8 +1,9 @@
1
- import { ContextMenuOverlay, LONG_PRESS_DELAY_MS } from './chunk-PZXZJBMP.js';
1
+ import { ContextMenuOverlay, LONG_PRESS_DELAY_MS } from './chunk-U5NLHYV6.js';
2
2
  import { haptics } from './chunk-NY2U3PBI.js';
3
- import { Icon } from './chunk-TKVFVF5D.js';
3
+ import { useLabels } from './chunk-APCWFOZW.js';
4
+ import { Icon } from './chunk-UXGIW7OK.js';
4
5
  import * as React from 'react';
5
- import { Animated, Easing, PanResponder, View, Pressable, StyleSheet, Text } from 'react-native';
6
+ import { View, Animated, Easing, PanResponder, Pressable, StyleSheet, Text } from 'react-native';
6
7
  import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
7
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
9
 
@@ -39,6 +40,8 @@ function activeSwipeSide(offset) {
39
40
  if (offset < 0) return "trailing";
40
41
  return null;
41
42
  }
43
+ var SWIPE_PEEK_FRACTION = 0.4;
44
+ var swipePeekShown = false;
42
45
  function swipeActionCollapses(action) {
43
46
  return action.collapses ?? action.destructive === true;
44
47
  }
@@ -115,6 +118,15 @@ function resolveSwipeAccessibilityAction(actions, name) {
115
118
  if (name === "longpress") return "menu";
116
119
  return actions.find((a) => a.key === name) ?? null;
117
120
  }
121
+ var DEFAULT_LABELS = {
122
+ dragHandle: "Drag to reorder",
123
+ rowActions: "Row actions",
124
+ release: "Release",
125
+ swipeHint: "Long press for actions",
126
+ moveUp: "Move up",
127
+ moveDown: "Move down",
128
+ reorderHint: (handle) => `${handle}. Use the move up and move down actions to reorder.`
129
+ };
118
130
  function resolveRowMotion(motion, osReduced) {
119
131
  if (motion === "none") return "none";
120
132
  if (motion === "reduced") return "reduced";
@@ -125,7 +137,7 @@ function line(value, style) {
125
137
  return typeof value === "string" || typeof value === "number" ? /* @__PURE__ */ jsx(Text, { style, numberOfLines: 1, children: value }) : value;
126
138
  }
127
139
  function SelectionIndicator({ selected }) {
128
- const theme = useLoamTheme();
140
+ const theme = useLoamTheme("list-row");
129
141
  const { styles } = useStyles(sheet, { selectedBox: selected });
130
142
  return /* @__PURE__ */ jsx(
131
143
  View,
@@ -207,7 +219,10 @@ function ListRow(props) {
207
219
  swipeActions,
208
220
  swipeReleaseLabel,
209
221
  swipeMenuLabel,
222
+ menuItems,
210
223
  swipeHint,
224
+ swipePeek = true,
225
+ onSwipePeek,
211
226
  selectable = false,
212
227
  selected,
213
228
  defaultSelected = false,
@@ -220,8 +235,10 @@ function ListRow(props) {
220
235
  onMoveDown,
221
236
  dragHandleLabel,
222
237
  motion = "full",
238
+ labels: labelsProp,
223
239
  ...rest
224
240
  } = props;
241
+ const labels = useLabels("listRow", DEFAULT_LABELS, labelsProp);
225
242
  const isControlled = selected !== void 0;
226
243
  const [internalSelected, setInternalSelected] = React.useState(defaultSelected);
227
244
  const isSelected = isControlled ? selected : internalSelected;
@@ -248,33 +265,74 @@ function ListRow(props) {
248
265
  onDragEnd,
249
266
  onMoveUp,
250
267
  onMoveDown,
251
- handleLabel: dragHandleLabel ?? "Drag to reorder",
268
+ handleLabel: dragHandleLabel ?? labels.dragHandle,
269
+ labels,
252
270
  motion
253
271
  }
254
272
  );
255
273
  }
256
- if (sides.leading.length === 0 && sides.trailing.length === 0) return /* @__PURE__ */ jsx(RowBody, { ...row });
274
+ if (sides.leading.length === 0 && sides.trailing.length === 0) {
275
+ return menuItems && menuItems.length > 0 ? /* @__PURE__ */ jsx(MenuRow, { row, items: menuItems, menuLabel: swipeMenuLabel ?? labels.rowActions }) : /* @__PURE__ */ jsx(RowBody, { ...row });
276
+ }
257
277
  return /* @__PURE__ */ jsx(
258
278
  SwipeRow,
259
279
  {
260
280
  row,
261
281
  sides,
262
- releaseLabel: swipeReleaseLabel ?? "Release",
263
- menuLabel: swipeMenuLabel ?? "Row actions",
264
- hint: swipeHint ?? "Long press for actions",
265
- motion
282
+ menuItems,
283
+ releaseLabel: swipeReleaseLabel ?? labels.release,
284
+ menuLabel: swipeMenuLabel ?? labels.rowActions,
285
+ hint: swipeHint ?? labels.swipeHint,
286
+ motion,
287
+ peek: swipePeek,
288
+ onPeek: onSwipePeek
266
289
  }
267
290
  );
268
291
  }
292
+ function MenuRow({
293
+ row,
294
+ items,
295
+ menuLabel
296
+ }) {
297
+ const [open, setOpen] = React.useState(false);
298
+ const [anchor, setAnchor] = React.useState(null);
299
+ const rootRef = React.useRef(null);
300
+ const openMenu = () => {
301
+ const node = rootRef.current;
302
+ if (node && typeof node.measureInWindow === "function") {
303
+ node.measureInWindow((mx, my, width, height) => setAnchor({ x: mx, y: my, width, height }));
304
+ }
305
+ haptics.impact("heavy");
306
+ setOpen(true);
307
+ };
308
+ return /* @__PURE__ */ jsxs(View, { ref: rootRef, collapsable: false, children: [
309
+ /* @__PURE__ */ jsx(
310
+ RowBody,
311
+ {
312
+ ...row,
313
+ interactive: true,
314
+ onLongPress: openMenu,
315
+ accessibilityActions: [{ name: "longpress", label: menuLabel }],
316
+ onAccessibilityAction: (e) => {
317
+ if (e.nativeEvent.actionName === "longpress") openMenu();
318
+ }
319
+ }
320
+ ),
321
+ /* @__PURE__ */ jsx(ContextMenuOverlay, { open, onClose: () => setOpen(false), items, anchor, accessibilityLabel: menuLabel })
322
+ ] });
323
+ }
269
324
  function SwipeRow({
270
325
  row,
271
326
  sides,
327
+ menuItems: menuOverride,
272
328
  releaseLabel,
273
329
  menuLabel,
274
330
  hint,
275
- motion
331
+ motion,
332
+ peek,
333
+ onPeek
276
334
  }) {
277
- const theme = useLoamTheme();
335
+ const theme = useLoamTheme("list-row");
278
336
  const { styles } = useStyles(sheet, { divider: false, disabled: false });
279
337
  const reducedMotion = resolveRowMotion(motion, theme.reduceMotion) !== "full";
280
338
  const hasLeading = sides.leading.length > 0;
@@ -506,6 +564,31 @@ function SwipeRow({
506
564
  rowWidth.current = e.nativeEvent.layout.width || FALLBACK_ROW_WIDTH;
507
565
  rowHeight.current = e.nativeEvent.layout.height || rowHeight.current;
508
566
  };
567
+ const peekRef = React.useRef({ peek, onPeek, rails, springTo, hasTrailing });
568
+ peekRef.current = { peek, onPeek, rails, springTo, hasTrailing };
569
+ React.useEffect(() => {
570
+ const cfg = peekRef.current;
571
+ if (!cfg.peek || swipePeekShown) return;
572
+ const side = cfg.hasTrailing ? "trailing" : "leading";
573
+ const open = cfg.rails[side].openOffset;
574
+ if (open === 0) return;
575
+ swipePeekShown = true;
576
+ let back = null;
577
+ const start = setTimeout(() => {
578
+ if (axis.current !== null || cur.current !== 0) return;
579
+ peekRef.current.onPeek?.();
580
+ peekRef.current.springTo(open * SWIPE_PEEK_FRACTION, 0, SWIPE_SPRING_SNAP);
581
+ back = setTimeout(() => {
582
+ if (axis.current === null && Math.abs(cur.current) < Math.abs(open)) {
583
+ peekRef.current.springTo(0, 0, SWIPE_SPRING_SNAP);
584
+ }
585
+ }, theme.duration.slow);
586
+ }, theme.duration.slow);
587
+ return () => {
588
+ clearTimeout(start);
589
+ if (back) clearTimeout(back);
590
+ };
591
+ }, []);
509
592
  const openMenu = () => {
510
593
  const node = rootRef.current;
511
594
  if (node && typeof node.measureInWindow === "function") {
@@ -520,7 +603,7 @@ function SwipeRow({
520
603
  if (target === "menu") openMenu();
521
604
  else if (target) fire(target);
522
605
  };
523
- const menuItems = allActions.map((a) => ({
606
+ const menuItems = menuOverride ?? allActions.map((a) => ({
524
607
  key: a.key,
525
608
  label: a.label,
526
609
  icon: a.icon ?? (a.destructive === true ? "trash" : "folder"),
@@ -627,7 +710,7 @@ function SwipeActionButton({
627
710
  reduced,
628
711
  onPress
629
712
  }) {
630
- const theme = useLoamTheme();
713
+ const theme = useLoamTheme("list-row");
631
714
  const destructive = action.destructive === true;
632
715
  const { styles } = useStyles(sheet, { destructive });
633
716
  const p = side === "leading" ? x.interpolate({
@@ -671,10 +754,10 @@ function SwipeActionButton({
671
754
  ) }) })
672
755
  );
673
756
  }
674
- function dragAccessibilityActions(canMoveUp, canMoveDown) {
757
+ function dragAccessibilityActions(canMoveUp, canMoveDown, labels = DEFAULT_LABELS) {
675
758
  const actions = [];
676
- if (canMoveUp) actions.push({ name: "moveUp", label: "Move up" });
677
- if (canMoveDown) actions.push({ name: "moveDown", label: "Move down" });
759
+ if (canMoveUp) actions.push({ name: "moveUp", label: labels.moveUp });
760
+ if (canMoveDown) actions.push({ name: "moveDown", label: labels.moveDown });
678
761
  return actions;
679
762
  }
680
763
  function DraggableRow({
@@ -685,9 +768,10 @@ function DraggableRow({
685
768
  onMoveUp,
686
769
  onMoveDown,
687
770
  handleLabel,
771
+ labels,
688
772
  motion
689
773
  }) {
690
- const theme = useLoamTheme();
774
+ const theme = useLoamTheme("list-row");
691
775
  const { styles } = useStyles(sheet, { divider: false, disabled: false });
692
776
  const reducedMotion = resolveRowMotion(motion, theme.reduceMotion) !== "full";
693
777
  const noMotion = motion === "none";
@@ -750,7 +834,7 @@ function DraggableRow({
750
834
  onPanResponderTerminate: () => settleRef.current()
751
835
  })
752
836
  ).current;
753
- const dragActions = dragAccessibilityActions(onMoveUp != null, onMoveDown != null);
837
+ const dragActions = dragAccessibilityActions(onMoveUp != null, onMoveDown != null, labels);
754
838
  const onRowAction = (e) => {
755
839
  if (e.nativeEvent.actionName === "moveUp") onMoveUp?.();
756
840
  else if (e.nativeEvent.actionName === "moveDown") onMoveDown?.();
@@ -790,7 +874,7 @@ function DraggableRow({
790
874
  dragHandle: handle,
791
875
  accessibilityActions: dragActions.length > 0 ? dragActions : void 0,
792
876
  onAccessibilityAction: dragActions.length > 0 ? onRowAction : void 0,
793
- accessibilityHint: `${handleLabel}. Use the move up and move down actions to reorder.`
877
+ accessibilityHint: labels.reorderHint(handleLabel)
794
878
  }
795
879
  )
796
880
  }
@@ -1,9 +1,14 @@
1
- import { Icon } from './chunk-TKVFVF5D.js';
1
+ import { useLabels } from './chunk-APCWFOZW.js';
2
+ import { Icon } from './chunk-UXGIW7OK.js';
2
3
  import * as React from 'react';
3
4
  import { Animated, Easing, Pressable, View, Text, AccessibilityInfo } from 'react-native';
4
5
  import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
5
6
  import { jsx, jsxs } from 'react/jsx-runtime';
6
7
 
8
+ var DEFAULT_LABELS = {
9
+ copy: "Copy",
10
+ copied: "Copied"
11
+ };
7
12
  function CopyButton({
8
13
  onCopy,
9
14
  label,
@@ -11,10 +16,12 @@ function CopyButton({
11
16
  size = "sm",
12
17
  timeout = 2e3,
13
18
  motion = "full",
14
- accessibilityLabel
19
+ accessibilityLabel,
20
+ labels: labelsProp
15
21
  }) {
22
+ const labels = useLabels("copyButton", DEFAULT_LABELS, labelsProp);
16
23
  const { styles } = useStyles(sheet, { variant, size });
17
- const theme = useLoamTheme();
24
+ const theme = useLoamTheme("copy-button");
18
25
  const fg = theme.color.text;
19
26
  const iconSize = theme.ctl.icon[size];
20
27
  const slop = Math.max(0, (theme.hit[size] - theme.ctl[size]) / 2);
@@ -45,7 +52,7 @@ function CopyButton({
45
52
  const handlePress = () => {
46
53
  onCopy?.();
47
54
  setCopied(true);
48
- AccessibilityInfo.announceForAccessibility("Copied");
55
+ AccessibilityInfo.announceForAccessibility(labels.copied);
49
56
  clearTimeout(timer.current);
50
57
  timer.current = setTimeout(() => setCopied(false), timeout);
51
58
  };
@@ -58,7 +65,7 @@ function CopyButton({
58
65
  Pressable,
59
66
  {
60
67
  accessibilityRole: "button",
61
- accessibilityLabel: accessibilityLabel ?? label ?? "Copy",
68
+ accessibilityLabel: accessibilityLabel ?? label ?? labels.copy,
62
69
  onPress: handlePress,
63
70
  onPressIn: () => press(0.97),
64
71
  onPressOut: () => press(1),
@@ -14,7 +14,7 @@ function Touchable({
14
14
  style,
15
15
  accessibilityLabel
16
16
  }) {
17
- const theme = useLoamTheme();
17
+ const theme = useLoamTheme("interactions");
18
18
  const scale = React.useRef(new Animated.Value(1)).current;
19
19
  const highlight = React.useRef(new Animated.Value(0)).current;
20
20
  const overlayOpacity = highlight.interpolate({
@@ -23,13 +23,16 @@ function Touchable({
23
23
  });
24
24
  const layerIn = theme.motion.hover;
25
25
  const layerOut = theme.motion.exit;
26
+ const animateScale = !theme.reduceMotion;
26
27
  const pressIn = () => {
27
- Animated.spring(scale, {
28
- toValue: scaleTo,
29
- useNativeDriver: true,
30
- speed: 40,
31
- bounciness: 6
32
- }).start();
28
+ if (animateScale) {
29
+ Animated.spring(scale, {
30
+ toValue: scaleTo,
31
+ useNativeDriver: true,
32
+ speed: 40,
33
+ bounciness: 6
34
+ }).start();
35
+ }
33
36
  if (ripple) {
34
37
  Animated.timing(highlight, {
35
38
  toValue: 1,
@@ -40,12 +43,14 @@ function Touchable({
40
43
  }
41
44
  };
42
45
  const pressOut = () => {
43
- Animated.spring(scale, {
44
- toValue: 1,
45
- useNativeDriver: true,
46
- speed: 40,
47
- bounciness: 6
48
- }).start();
46
+ if (animateScale) {
47
+ Animated.spring(scale, {
48
+ toValue: 1,
49
+ useNativeDriver: true,
50
+ speed: 40,
51
+ bounciness: 6
52
+ }).start();
53
+ }
49
54
  if (ripple) {
50
55
  Animated.timing(highlight, {
51
56
  toValue: 0,