@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,335 @@
1
+ import { Chip } from './chunk-2SY63FCH.js';
2
+ import { NO_UA_FOCUS_RING } from './chunk-3NMD74ZU.js';
3
+ import { useLabels } from './chunk-APCWFOZW.js';
4
+ import { useResolvedMotion, springConfig } from './chunk-J64KGCGX.js';
5
+ import * as React from 'react';
6
+ import { View, Text, Pressable, TextInput, Animated, LayoutAnimation, AccessibilityInfo } from 'react-native';
7
+ import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
8
+ import { MOTION_MOVE } from '@btndprojects/loam-tokens';
9
+ import { jsxs, jsx } from 'react/jsx-runtime';
10
+
11
+ var DEFAULT_LABELS = {
12
+ remove: (tag) => `Remove ${tag}`,
13
+ added: (tag) => `${tag} added`,
14
+ removed: (tag) => `${tag} removed`,
15
+ duplicate: (tag) => `${tag} is already added`,
16
+ maxReached: (max) => `No more than ${max} tags`,
17
+ invalid: (tag) => `${tag} is not valid`
18
+ };
19
+ var CHIP_SIZE = { xs: "xs", sm: "xs", md: "sm", lg: "md" };
20
+ function TagSlot({
21
+ animate,
22
+ style,
23
+ children
24
+ }) {
25
+ const theme = useLoamTheme("tags-input");
26
+ const t = React.useRef(new Animated.Value(animate ? 0 : 1)).current;
27
+ React.useEffect(() => {
28
+ if (!animate) return;
29
+ const run = Animated.spring(t, {
30
+ ...springConfig(theme, "fs"),
31
+ toValue: 1,
32
+ useNativeDriver: true
33
+ });
34
+ run.start();
35
+ return () => run.stop();
36
+ }, []);
37
+ return /* @__PURE__ */ jsx(
38
+ Animated.View,
39
+ {
40
+ testID: "tag",
41
+ style: [
42
+ style,
43
+ {
44
+ opacity: t,
45
+ transform: [{ scale: t.interpolate({ inputRange: [0, 1], outputRange: [SCALE_IN, 1] }) }]
46
+ }
47
+ ],
48
+ children
49
+ }
50
+ );
51
+ }
52
+ var SCALE_IN = 1 - MOTION_MOVE.scaleIn;
53
+ function splitText(text, chars) {
54
+ let parts = text.split(/\r?\n/);
55
+ for (const c of chars) parts = parts.flatMap((p) => p.split(c));
56
+ return parts;
57
+ }
58
+ function TagsInput({
59
+ value: valueProp,
60
+ defaultValue,
61
+ onValueChange,
62
+ size = "md",
63
+ delimiters = [","],
64
+ addOnBlur = false,
65
+ validate,
66
+ max,
67
+ allowDuplicates = false,
68
+ transform,
69
+ normalize,
70
+ labels: labelsProp,
71
+ renderTag,
72
+ label,
73
+ description,
74
+ error,
75
+ invalid = false,
76
+ readOnly = false,
77
+ disabled = false,
78
+ containerStyle,
79
+ onBlur,
80
+ onFocus,
81
+ onKeyPress,
82
+ motion = "full",
83
+ ...rest
84
+ }) {
85
+ const level = useResolvedMotion(motion, "tags-input");
86
+ const mounted = React.useRef(false);
87
+ React.useEffect(() => {
88
+ mounted.current = true;
89
+ }, []);
90
+ const flowNext = () => {
91
+ if (level !== "full") return;
92
+ const fs = theme.spring.fs;
93
+ LayoutAnimation.configureNext({
94
+ duration: fs.duration,
95
+ update: { type: "spring", springDamping: fs.dampingRatio },
96
+ delete: { type: "easeInEaseOut", property: "opacity" }
97
+ });
98
+ };
99
+ const labels = useLabels("tagsInput", DEFAULT_LABELS, labelsProp);
100
+ const { styles } = useStyles(sheet, { size });
101
+ const theme = useLoamTheme("tags-input");
102
+ const [inner, setInner] = React.useState(defaultValue ?? []);
103
+ const controlled = valueProp !== void 0;
104
+ const tags = controlled ? valueProp : inner;
105
+ const [text, setText] = React.useState("");
106
+ const [rejection, setRejection] = React.useState(null);
107
+ const [highlight, setHighlight] = React.useState(null);
108
+ const [focused, setFocused] = React.useState(false);
109
+ const inputRef = React.useRef(null);
110
+ const inert = disabled || readOnly;
111
+ const labelId = React.useId();
112
+ const emit = (next) => {
113
+ if (!controlled) setInner(next);
114
+ onValueChange?.(next);
115
+ };
116
+ const announce = (message2) => {
117
+ AccessibilityInfo.announceForAccessibility?.(message2);
118
+ };
119
+ const keyOf = normalize ?? ((t) => t);
120
+ const commit = (candidates) => {
121
+ let next = tags;
122
+ let problem = null;
123
+ const added = [];
124
+ for (const raw of candidates) {
125
+ let tag = raw.trim();
126
+ if (transform) tag = transform(tag).trim();
127
+ if (!tag) continue;
128
+ if (max !== void 0 && next.length >= max) {
129
+ problem ??= labels.maxReached(max);
130
+ break;
131
+ }
132
+ if (!allowDuplicates && next.some((t) => keyOf(t) === keyOf(tag))) {
133
+ problem ??= labels.duplicate(tag);
134
+ continue;
135
+ }
136
+ if (validate) {
137
+ const verdict = validate(tag, next);
138
+ if (verdict !== true) {
139
+ problem ??= typeof verdict === "string" && verdict ? verdict : labels.invalid(tag);
140
+ continue;
141
+ }
142
+ }
143
+ next = [...next, tag];
144
+ added.push(tag);
145
+ }
146
+ setRejection(problem);
147
+ if (added.length > 0) {
148
+ flowNext();
149
+ emit(next);
150
+ announce(added.map((t) => labels.added(t)).join(". "));
151
+ }
152
+ return problem;
153
+ };
154
+ const removeAt = (index) => {
155
+ if (inert) return;
156
+ const tag = tags[index];
157
+ if (tag === void 0) return;
158
+ flowNext();
159
+ emit(tags.filter((_, i) => i !== index));
160
+ setRejection(null);
161
+ setHighlight(null);
162
+ announce(labels.removed(tag));
163
+ inputRef.current?.focus();
164
+ };
165
+ const commitText = () => {
166
+ if (text.trim() === "") {
167
+ setText("");
168
+ return;
169
+ }
170
+ if (commit([text]) === null) setText("");
171
+ };
172
+ const handleChangeText = (next) => {
173
+ setRejection(null);
174
+ setHighlight(null);
175
+ if (delimiters.some((d) => next.includes(d))) {
176
+ const parts = splitText(next, delimiters);
177
+ const tail = parts.pop() ?? "";
178
+ commit(parts);
179
+ setText(tail);
180
+ return;
181
+ }
182
+ setText(next);
183
+ };
184
+ const handleKeyPress = (e) => {
185
+ onKeyPress?.(e);
186
+ if (inert || e.nativeEvent.key !== "Backspace" || text !== "" || tags.length === 0) return;
187
+ if (highlight === tags.length - 1) removeAt(highlight);
188
+ else setHighlight(tags.length - 1);
189
+ };
190
+ const tone = disabled ? { border: theme.color.border, fill: theme.color.surface3 } : invalid || error || rejection ? { border: theme.color.danger, fill: theme.color.dangerSoft } : focused ? { border: theme.focus.ringColor, fill: theme.color.surface } : { border: theme.color.borderStrong, fill: theme.color.surface2 };
191
+ const message = error ?? rejection ?? void 0;
192
+ const hasError = invalid || Boolean(message);
193
+ const shown = message ?? description;
194
+ return /* @__PURE__ */ jsxs(View, { style: [styles.field, containerStyle], children: [
195
+ label ? /* @__PURE__ */ jsx(Text, { nativeID: labelId, style: [styles.label, hasError && { color: theme.color.danger }], children: label }) : null,
196
+ /* @__PURE__ */ jsxs(
197
+ Pressable,
198
+ {
199
+ testID: "tags-input-container",
200
+ accessible: false,
201
+ disabled: inert,
202
+ onPress: () => inputRef.current?.focus(),
203
+ style: [styles.container, { borderColor: tone.border, backgroundColor: tone.fill }],
204
+ children: [
205
+ tags.map((tag, index) => /* @__PURE__ */ jsx(
206
+ TagSlot,
207
+ {
208
+ animate: mounted.current && level === "full",
209
+ style: [styles.tag, highlight === index && { borderColor: theme.focus.ringColor }],
210
+ children: renderTag ? renderTag(tag, { remove: () => removeAt(index), disabled: inert }) : /* @__PURE__ */ jsx(
211
+ Chip,
212
+ {
213
+ variant: "input",
214
+ size: CHIP_SIZE[size],
215
+ removable: !inert,
216
+ disabled,
217
+ removeLabel: labels.remove(tag),
218
+ onRemove: () => removeAt(index),
219
+ children: tag
220
+ }
221
+ )
222
+ },
223
+ `${tag}#${tags.slice(0, index).filter((t) => t === tag).length}`
224
+ )),
225
+ /* @__PURE__ */ jsx(
226
+ TextInput,
227
+ {
228
+ ...rest,
229
+ ref: inputRef,
230
+ value: text,
231
+ editable: !inert,
232
+ placeholder: tags.length === 0 ? rest.placeholder : void 0,
233
+ placeholderTextColor: theme.color.text3,
234
+ "aria-labelledby": label ? labelId : rest["aria-labelledby"],
235
+ "aria-invalid": hasError || void 0,
236
+ blurOnSubmit: false,
237
+ onChangeText: handleChangeText,
238
+ onSubmitEditing: commitText,
239
+ onKeyPress: handleKeyPress,
240
+ onFocus: (e) => {
241
+ setFocused(true);
242
+ onFocus?.(e);
243
+ },
244
+ onBlur: (e) => {
245
+ setFocused(false);
246
+ setHighlight(null);
247
+ onBlur?.(e);
248
+ if (addOnBlur && !inert) commitText();
249
+ },
250
+ style: [styles.input, NO_UA_FOCUS_RING]
251
+ }
252
+ )
253
+ ]
254
+ }
255
+ ),
256
+ shown ? /* @__PURE__ */ jsx(
257
+ Text,
258
+ {
259
+ accessibilityLiveRegion: "polite",
260
+ style: [styles.message, { color: hasError ? theme.color.danger : theme.color.text3 }],
261
+ children: shown
262
+ }
263
+ ) : null
264
+ ] });
265
+ }
266
+ var sheet = createStyleSheet((theme) => ({
267
+ field: { gap: theme.space.s2 },
268
+ label: {
269
+ fontFamily: theme.font.sans,
270
+ fontWeight: theme.fontWeight.semibold,
271
+ fontSize: theme.fontSize[14],
272
+ color: theme.color.text2
273
+ },
274
+ container: {
275
+ flexDirection: "row",
276
+ flexWrap: "wrap",
277
+ alignItems: "center",
278
+ borderWidth: theme.borderWidth.thick,
279
+ variants: {
280
+ size: {
281
+ xs: {
282
+ minHeight: theme.ctl.xs,
283
+ paddingHorizontal: theme.ctl.px.xs,
284
+ gap: theme.ctl.gap.xs,
285
+ borderRadius: theme.ctl.r.xs
286
+ },
287
+ sm: {
288
+ minHeight: theme.ctl.sm,
289
+ paddingHorizontal: theme.ctl.px.sm,
290
+ gap: theme.ctl.gap.sm,
291
+ borderRadius: theme.ctl.r.sm
292
+ },
293
+ md: {
294
+ minHeight: theme.ctl.md,
295
+ paddingHorizontal: theme.ctl.px.md,
296
+ gap: theme.ctl.gap.md,
297
+ borderRadius: theme.ctl.r.md
298
+ },
299
+ lg: {
300
+ minHeight: theme.ctl.lg,
301
+ paddingHorizontal: theme.ctl.px.lg,
302
+ gap: theme.ctl.gap.lg,
303
+ borderRadius: theme.ctl.r.lg
304
+ }
305
+ }
306
+ }
307
+ },
308
+ // A transparent edge that the highlight fills in, so the row never shifts.
309
+ tag: {
310
+ borderWidth: theme.borderWidth.thick,
311
+ borderColor: "transparent",
312
+ borderRadius: theme.radius.full
313
+ },
314
+ input: {
315
+ flexGrow: 1,
316
+ minWidth: theme.tapMin * 2,
317
+ padding: 0,
318
+ color: theme.color.text,
319
+ fontFamily: theme.font.sans,
320
+ variants: {
321
+ size: {
322
+ xs: { fontSize: theme.fontSize[14] },
323
+ sm: { fontSize: theme.fontSize[14] },
324
+ md: { fontSize: theme.fontSize[16] },
325
+ lg: { fontSize: theme.fontSize[16] }
326
+ }
327
+ }
328
+ },
329
+ message: {
330
+ fontFamily: theme.font.sans,
331
+ fontSize: theme.fontSize[12]
332
+ }
333
+ }));
334
+
335
+ export { TagsInput };
@@ -1,16 +1,38 @@
1
- import { Icon } from './chunk-TKVFVF5D.js';
1
+ import { useLabels } from './chunk-APCWFOZW.js';
2
+ import { Icon } from './chunk-UXGIW7OK.js';
2
3
  import 'react';
3
4
  import { View, Text } from 'react-native';
4
5
  import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
5
6
  import { jsxs, jsx } from 'react/jsx-runtime';
6
7
 
8
+ // src/checkout/checkout-labels.ts
9
+ var DEFAULT_LABELS = {
10
+ paying: "Paying\u2026",
11
+ checking: "Checking\u2026",
12
+ paid: "Paid",
13
+ orderSummary: "Order summary",
14
+ summaryHeading: (title, currency) => `${title} \xB7 ${currency}`,
15
+ total: "Total",
16
+ discountCode: "Discount code",
17
+ remove: "Remove",
18
+ apply: "Apply",
19
+ encrypted: "Encrypted",
20
+ cardDetailsNeverTouch: "Card details never touch our servers",
21
+ pciDss: "PCI DSS SAQ-A",
22
+ refundWindow: "30-day refund",
23
+ cart: "Cart",
24
+ cartCount: (name, count) => `${name}, ${count} ${count === 1 ? "item" : "items"}`,
25
+ mandateTitle: "Direct debit mandate",
26
+ mandateAuthorise: (merchant) => `By giving your IBAN and confirming this payment you authorise ${merchant} to send instructions to your bank to debit your account, and your bank to debit your account in accordance with those instructions.`,
27
+ mandateRefund: (weeks) => `You are entitled to a refund from your bank under the terms of your agreement with it. A refund must be claimed within ${weeks} weeks of the date your account was debited.`
28
+ };
7
29
  function SecurePayLabel({
8
30
  label,
9
31
  showLock = true,
10
32
  size = "sm",
11
33
  style
12
34
  }) {
13
- const theme = useLoamTheme();
35
+ const theme = useLoamTheme("checkout");
14
36
  const { styles } = useStyles(sheet);
15
37
  return /* @__PURE__ */ jsxs(View, { style: [styles.secureRow, style], children: [
16
38
  showLock ? /* @__PURE__ */ jsx(
@@ -31,13 +53,27 @@ var TRUST_ROW = [
31
53
  { icon: "shield", label: "PCI DSS SAQ-A" },
32
54
  { icon: "refresh", label: "30-day refund" }
33
55
  ];
34
- function TrustRow({ level, items, style }) {
35
- const theme = useLoamTheme();
56
+ var trustInline = (labels) => [{ icon: "lock", label: labels.encrypted }];
57
+ var trustRow = (labels) => [
58
+ { icon: "lock", label: labels.cardDetailsNeverTouch },
59
+ { icon: "shield", label: labels.pciDss },
60
+ { icon: "refresh", label: labels.refundWindow }
61
+ ];
62
+ function TrustRow({ level, items, labels: labelsProp, style }) {
63
+ const labels = useLabels("checkout", DEFAULT_LABELS, labelsProp);
64
+ const theme = useLoamTheme("checkout");
36
65
  const { styles } = useStyles(sheet);
37
- const resolved = items ?? (level === "inline" ? TRUST_INLINE : TRUST_ROW);
66
+ const resolved = items === void 0 || items === TRUST_INLINE || items === TRUST_ROW ? level === "inline" ? trustInline(labels) : trustRow(labels) : items;
38
67
  if (level === "inline") {
39
68
  const first = resolved[0];
40
- return /* @__PURE__ */ jsx(SecurePayLabel, { label: first?.label ?? "", showLock: first?.icon !== void 0, style });
69
+ return /* @__PURE__ */ jsx(
70
+ SecurePayLabel,
71
+ {
72
+ label: first?.label ?? "",
73
+ showLock: first?.icon !== void 0,
74
+ style
75
+ }
76
+ );
41
77
  }
42
78
  return (
43
79
  // A real list, so three facts are announced as three.
@@ -58,14 +94,16 @@ function TrustRow({ level, items, style }) {
58
94
  function MandateNotice({
59
95
  merchantLegalName,
60
96
  weeks = 8,
61
- title = "Direct debit mandate",
97
+ title,
98
+ labels: labelsProp,
62
99
  style
63
100
  }) {
101
+ const labels = useLabels("checkout", DEFAULT_LABELS, labelsProp);
64
102
  const { styles } = useStyles(sheet);
65
103
  return /* @__PURE__ */ jsxs(View, { style: [styles.mandate, style], children: [
66
- /* @__PURE__ */ jsx(Text, { style: styles.overline, children: title }),
67
- /* @__PURE__ */ jsx(Text, { style: styles.mandateBody, children: `By giving your IBAN and confirming this payment you authorise ${merchantLegalName} to send instructions to your bank to debit your account, and your bank to debit your account in accordance with those instructions.` }),
68
- /* @__PURE__ */ jsx(Text, { style: styles.mandateBody, children: `You are entitled to a refund from your bank under the terms of your agreement with it. A refund must be claimed within ${weeks} weeks of the date your account was debited.` })
104
+ /* @__PURE__ */ jsx(Text, { style: styles.overline, children: title ?? labels.mandateTitle }),
105
+ /* @__PURE__ */ jsx(Text, { style: styles.mandateBody, children: labels.mandateAuthorise(merchantLegalName) }),
106
+ /* @__PURE__ */ jsx(Text, { style: styles.mandateBody, children: labels.mandateRefund(weeks) })
69
107
  ] });
70
108
  }
71
109
  var sheet = createStyleSheet((theme) => ({
@@ -123,4 +161,4 @@ var sheet = createStyleSheet((theme) => ({
123
161
  }
124
162
  }));
125
163
 
126
- export { MandateNotice, SecurePayLabel, TRUST_INLINE, TRUST_ROW, TrustRow };
164
+ export { DEFAULT_LABELS, MandateNotice, SecurePayLabel, TRUST_INLINE, TRUST_ROW, TrustRow };
@@ -1,6 +1,7 @@
1
- import { Icon } from './chunk-TKVFVF5D.js';
2
- import 'react';
3
- import { View, Text, Pressable } from 'react-native';
1
+ import { Icon } from './chunk-UXGIW7OK.js';
2
+ import { useResolvedMotion, springConfig } from './chunk-J64KGCGX.js';
3
+ import * as React from 'react';
4
+ import { Animated, View, Text, Pressable } from 'react-native';
4
5
  import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
5
6
  import { jsxs, jsx } from 'react/jsx-runtime';
6
7
 
@@ -21,7 +22,7 @@ var VARIANT_ICON = {
21
22
  stale: "clock"
22
23
  };
23
24
  function useForeground(kind) {
24
- const theme = useLoamTheme();
25
+ const theme = useLoamTheme("empty-state");
25
26
  switch (kind) {
26
27
  case "muted":
27
28
  return theme.color.text2;
@@ -42,16 +43,36 @@ function EmptyState({
42
43
  description,
43
44
  actionLabel,
44
45
  onAction,
45
- // Inert (see prop docs); destructured so it never reaches a native element.
46
- motion: _motion = "full"
46
+ motion = "full"
47
47
  }) {
48
48
  const kind = VARIANT_KIND[variant];
49
49
  const { styles } = useStyles(sheet, { kind });
50
- const theme = useLoamTheme();
50
+ const theme = useLoamTheme("empty-state");
51
51
  const fg = useForeground(kind);
52
52
  const iconName = icon ?? VARIANT_ICON[variant];
53
53
  const pillInk = kind === "muted" ? theme.color.text : theme.color.accentInk;
54
- return /* @__PURE__ */ jsxs(View, { style: styles.base, children: [
54
+ const level = useResolvedMotion(motion, "empty-state");
55
+ const rise = React.useRef(new Animated.Value(level === "none" ? 1 : 0)).current;
56
+ React.useEffect(() => {
57
+ if (level === "none") return;
58
+ Animated.spring(rise, {
59
+ ...springConfig(theme, "ds"),
60
+ toValue: 1,
61
+ useNativeDriver: true
62
+ }).start();
63
+ }, []);
64
+ const riseStyle = {
65
+ opacity: rise,
66
+ transform: level === "full" ? [
67
+ {
68
+ translateY: rise.interpolate({
69
+ inputRange: [0, 1],
70
+ outputRange: [theme.space.s3, 0]
71
+ })
72
+ }
73
+ ] : []
74
+ };
75
+ return /* @__PURE__ */ jsxs(Animated.View, { style: [styles.base, riseStyle], children: [
55
76
  /* @__PURE__ */ jsx(View, { style: styles.tile, children: /* @__PURE__ */ jsx(Icon, { name: iconName, size: 30, color: fg }) }),
56
77
  /* @__PURE__ */ jsx(Text, { style: styles.title, children: title }),
57
78
  description ? /* @__PURE__ */ jsx(Text, { style: styles.description, children: description }) : null,
@@ -1,10 +1,10 @@
1
+ import { useLabels } from './chunk-APCWFOZW.js';
1
2
  import * as React from 'react';
2
3
  import { StyleSheet, Animated, Easing, View, Text } from 'react-native';
3
4
  import { Svg, Circle } from 'react-native-svg';
4
5
  import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
5
6
  import { jsx, jsxs } from 'react/jsx-runtime';
6
7
 
7
- // src/spinner/spinner.tsx
8
8
  var RING = {
9
9
  sm: { diameter: 16, stroke: 2 },
10
10
  md: { diameter: 20, stroke: 2.5 },
@@ -12,13 +12,20 @@ var RING = {
12
12
  xl: { diameter: 40, stroke: 4 }
13
13
  };
14
14
  var ARC_FRACTION = 0.7;
15
+ var DEFAULT_LABELS = {
16
+ loading: "Loading",
17
+ stillWorking: "Still working\u2026"
18
+ };
15
19
  function Spinner({
16
20
  size = "md",
17
21
  color,
18
- accessibilityLabel = "Loading",
19
- motion = "full"
22
+ accessibilityLabel: accessibilityLabelProp,
23
+ motion = "full",
24
+ labels: labelsProp
20
25
  }) {
21
- const theme = useLoamTheme();
26
+ const theme = useLoamTheme("spinner");
27
+ const labels = useLabels("spinner", DEFAULT_LABELS, labelsProp);
28
+ const accessibilityLabel = accessibilityLabelProp ?? labels.loading;
22
29
  const stroke = color ?? theme.color.accent;
23
30
  const { diameter, stroke: strokeWidth } = RING[size];
24
31
  const spinning = motion === "full" && !theme.reduceMotion;
@@ -69,17 +76,20 @@ function Spinner({
69
76
  }
70
77
  );
71
78
  }
72
- var DEFAULT_LATE_LABEL = "Still working\u2026";
73
79
  function LoadingOverlay({
74
80
  active = true,
75
81
  size = "lg",
76
82
  color,
77
- accessibilityLabel = "Loading",
83
+ accessibilityLabel: accessibilityLabelProp,
78
84
  late = false,
79
- lateLabel = DEFAULT_LATE_LABEL,
85
+ lateLabel: lateLabelProp,
80
86
  scrim = "default",
81
- motion = "full"
87
+ motion = "full",
88
+ labels: labelsProp
82
89
  }) {
90
+ const labels = useLabels("spinner", DEFAULT_LABELS, labelsProp);
91
+ const accessibilityLabel = accessibilityLabelProp ?? labels.loading;
92
+ const lateLabel = lateLabelProp ?? labels.stillWorking;
83
93
  const { styles } = useStyles(sheet, { scrim: scrim === "light" ? "light" : void 0 });
84
94
  if (!active) return null;
85
95
  return /* @__PURE__ */ jsx(