@btndprojects/loam-ui-native 0.1.0 → 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 (263) hide show
  1. package/README.md +56 -0
  2. package/dist/accordion/index.js +5 -3
  3. package/dist/adaptive/index.js +6 -2
  4. package/dist/alert/index.js +5 -2
  5. package/dist/analyzer/index.js +9 -6
  6. package/dist/announcement/index.js +8 -5
  7. package/dist/audio-player/index.js +5 -3
  8. package/dist/avatar/index.js +5 -2
  9. package/dist/avatar-group/index.js +7 -3
  10. package/dist/badge/index.js +7 -4
  11. package/dist/banner/index.js +5 -2
  12. package/dist/board/index.js +11 -6
  13. package/dist/button/index.js +6 -3
  14. package/dist/camera-permission/index.js +15 -12
  15. package/dist/capture-result/index.js +19 -16
  16. package/dist/card/index.js +6 -3
  17. package/dist/card-form/index.js +12 -8
  18. package/dist/carousel/index.js +4 -2
  19. package/dist/chart/index.js +8 -5
  20. package/dist/charts/index.js +8 -6
  21. package/dist/chat/index.js +16 -0
  22. package/dist/checkbox/index.js +6 -4
  23. package/dist/checklist/index.js +11 -8
  24. package/dist/checkout/index.js +16 -11
  25. package/dist/chip/index.js +7 -4
  26. package/dist/{chunk-XNUVB5OL.js → chunk-2OLKPG4E.js} +92 -28
  27. package/dist/{chunk-RUZHTGKB.js → chunk-2PKYGLQ6.js} +71 -40
  28. package/dist/{chunk-UC2WGUP3.js → chunk-2SWKL3AJ.js} +91 -252
  29. package/dist/{chunk-AI4DWZCD.js → chunk-2SY63FCH.js} +63 -16
  30. package/dist/{chunk-F5XNPWS7.js → chunk-2TXERVVA.js} +92 -35
  31. package/dist/chunk-36EC2T6P.js +581 -0
  32. package/dist/chunk-3DUWIYV5.js +437 -0
  33. package/dist/{chunk-RGQWWKLA.js → chunk-3QMEOFW5.js} +275 -71
  34. package/dist/chunk-3WEZCGHX.js +265 -0
  35. package/dist/chunk-46MMSDGL.js +194 -0
  36. package/dist/{chunk-7O2FMUPT.js → chunk-4IZXHVFJ.js} +297 -92
  37. package/dist/{chunk-LAECSR4H.js → chunk-5LAAAXFP.js} +14 -8
  38. package/dist/{chunk-2A5NIQAK.js → chunk-5RENVKBQ.js} +134 -46
  39. package/dist/{chunk-2ZZ7TDJ4.js → chunk-5UTRIXQ6.js} +37 -31
  40. package/dist/{chunk-LOE5YNN3.js → chunk-5VFZRGVD.js} +37 -10
  41. package/dist/{chunk-52X2VYTD.js → chunk-67IZZ2MJ.js} +115 -60
  42. package/dist/{chunk-UYG5L34B.js → chunk-6YAQBXB3.js} +10 -4
  43. package/dist/{chunk-BTTFCMKG.js → chunk-74FLKD24.js} +94 -23
  44. package/dist/{chunk-ITTYJZWX.js → chunk-7BUIKDD6.js} +73 -18
  45. package/dist/{chunk-FOKG57CR.js → chunk-7OVVSVEZ.js} +273 -109
  46. package/dist/chunk-AEB7KCHQ.js +287 -0
  47. package/dist/chunk-APCWFOZW.js +28 -0
  48. package/dist/chunk-AWKQIE5I.js +139 -0
  49. package/dist/{chunk-VCDBXW5H.js → chunk-B7N4ASYE.js} +86 -42
  50. package/dist/{chunk-IVNRBPGC.js → chunk-C4GTDLRC.js} +104 -20
  51. package/dist/{chunk-4ZAHCY44.js → chunk-C6APNDVA.js} +12 -5
  52. package/dist/{chunk-4SZYY6AN.js → chunk-CMTVNF3D.js} +18 -13
  53. package/dist/{chunk-WVKKJA6U.js → chunk-CPTOADB2.js} +151 -96
  54. package/dist/chunk-D5N5QWI7.js +1325 -0
  55. package/dist/{chunk-IIQTAY3J.js → chunk-DN7MNQIP.js} +113 -29
  56. package/dist/{chunk-47FWHGUN.js → chunk-DVGBZ3TX.js} +84 -23
  57. package/dist/chunk-DW3L54DQ.js +305 -0
  58. package/dist/{chunk-3ARE4TES.js → chunk-E2E3I5W2.js} +69 -18
  59. package/dist/{chunk-DHWADYZX.js → chunk-EDCBJV7J.js} +41 -28
  60. package/dist/{chunk-WSW6ZFAQ.js → chunk-ENP3BMZU.js} +4 -4
  61. package/dist/{chunk-OOPPQH27.js → chunk-EVOIGUBI.js} +43 -19
  62. package/dist/{chunk-VEAYTRPX.js → chunk-EY4DD67D.js} +165 -97
  63. package/dist/{chunk-223Q2T2Q.js → chunk-F3H33DQX.js} +132 -61
  64. package/dist/{chunk-CYRBHQQZ.js → chunk-F5B3UINI.js} +68 -35
  65. package/dist/{chunk-6X6PQ443.js → chunk-FAJI7BSC.js} +20 -9
  66. package/dist/{chunk-MOUJOP55.js → chunk-FUMHAAF3.js} +96 -29
  67. package/dist/{chunk-6HT2LP62.js → chunk-FV6HMP7W.js} +192 -73
  68. package/dist/{chunk-S7F6XLTK.js → chunk-FYWNRX4F.js} +76 -47
  69. package/dist/{chunk-YG3ZJHGU.js → chunk-FZGAAOKS.js} +30 -8
  70. package/dist/{chunk-YDGVJETP.js → chunk-G3AFC24V.js} +1 -1
  71. package/dist/{chunk-EJBDRVIH.js → chunk-G6UESEVN.js} +15 -8
  72. package/dist/chunk-GDKVKNR2.js +339 -0
  73. package/dist/chunk-GEIGMWNF.js +10 -0
  74. package/dist/{chunk-JUAMLEHX.js → chunk-H7DWSL4O.js} +24 -12
  75. package/dist/chunk-HJFFOOJ4.js +1 -0
  76. package/dist/{chunk-RW6ZL2FQ.js → chunk-HJLPZA4X.js} +106 -21
  77. package/dist/chunk-HYEOQWT7.js +647 -0
  78. package/dist/chunk-I2KLQ2HA.js +19 -0
  79. package/dist/{chunk-CJ5EOYZE.js → chunk-I4FHVKEC.js} +11 -5
  80. package/dist/{chunk-JNH2TYIN.js → chunk-IDM7JJMO.js} +19 -5
  81. package/dist/{chunk-O4AEHWII.js → chunk-IPUNJMAQ.js} +141 -49
  82. package/dist/{chunk-J7Q7VCVC.js → chunk-IT6FUXXG.js} +13 -6
  83. package/dist/{chunk-QJJ6MADV.js → chunk-IVKMZ7BB.js} +80 -28
  84. package/dist/{chunk-Z7H7VSFZ.js → chunk-IXKWIFWZ.js} +17 -6
  85. package/dist/chunk-J64KGCGX.js +55 -0
  86. package/dist/chunk-JBMLWFSJ.js +270 -0
  87. package/dist/{chunk-4BXMXBJO.js → chunk-JJLPBRVZ.js} +22 -11
  88. package/dist/chunk-JLC6PM5S.js +406 -0
  89. package/dist/chunk-JUYWSSKW.js +335 -0
  90. package/dist/{chunk-7CFF4HXS.js → chunk-JV5YOTOB.js} +49 -11
  91. package/dist/{chunk-LZLHELAG.js → chunk-KFJGFLMW.js} +29 -8
  92. package/dist/{chunk-O7AE6DAF.js → chunk-KQZ3GLHR.js} +18 -8
  93. package/dist/{chunk-N32RGOA5.js → chunk-LKFC4CS7.js} +80 -24
  94. package/dist/{chunk-YC6WORFL.js → chunk-LMPHCVJJ.js} +82 -50
  95. package/dist/{chunk-3WPW4KUN.js → chunk-LQP4KEXZ.js} +45 -13
  96. package/dist/{chunk-TKQYWZ5V.js → chunk-LUMVGO2K.js} +47 -31
  97. package/dist/{chunk-AWJOCGFZ.js → chunk-M656FYNH.js} +25 -13
  98. package/dist/{chunk-35OFI3JG.js → chunk-MKSNFG7H.js} +73 -20
  99. package/dist/{chunk-4GBOGOTV.js → chunk-NBEF4EPJ.js} +16 -6
  100. package/dist/chunk-NNCOFLNE.js +24 -0
  101. package/dist/{chunk-4YQOR7JM.js → chunk-NTQ2F3AU.js} +73 -20
  102. package/dist/{chunk-QCDXZBC5.js → chunk-O5V4TG3V.js} +126 -44
  103. package/dist/{chunk-U7TFM2JA.js → chunk-OJQUBQWA.js} +3 -3
  104. package/dist/{chunk-VQHPQEUH.js → chunk-OWAMM2DK.js} +13 -6
  105. package/dist/chunk-PID3NJB7.js +405 -0
  106. package/dist/{chunk-66SG2H23.js → chunk-PMMTGBBS.js} +27 -17
  107. package/dist/{chunk-RIBDXGUG.js → chunk-PNF3NKB5.js} +49 -16
  108. package/dist/{chunk-JXJB2X6M.js → chunk-Q6NKEPRE.js} +81 -32
  109. package/dist/chunk-QDZGFXQD.js +176 -0
  110. package/dist/{chunk-SYNOJOQO.js → chunk-QEYFDRHR.js} +60 -26
  111. package/dist/{chunk-VBOXAEPI.js → chunk-QHAITQIF.js} +97 -22
  112. package/dist/{chunk-VXDZFJGP.js → chunk-QHTVYA65.js} +230 -76
  113. package/dist/{chunk-TUTI5HOZ.js → chunk-QIKT7LIB.js} +14 -8
  114. package/dist/{chunk-3ENTMPQY.js → chunk-QP3KMOVF.js} +82 -42
  115. package/dist/{chunk-GNNJ4GCC.js → chunk-QPWDDJJ4.js} +62 -148
  116. package/dist/{chunk-QWCMU5B2.js → chunk-QRUMA22E.js} +205 -80
  117. package/dist/{chunk-ZVFE5QGU.js → chunk-QYPE5JX3.js} +50 -10
  118. package/dist/{chunk-PUPM2YGF.js → chunk-ROCUG24E.js} +76 -36
  119. package/dist/{chunk-NQYBUO3K.js → chunk-RU3ZPNL6.js} +333 -142
  120. package/dist/{chunk-TOXAGRDQ.js → chunk-RXSCIO6W.js} +14 -5
  121. package/dist/{chunk-FIF2M24N.js → chunk-SATMR6SG.js} +631 -203
  122. package/dist/{chunk-4YIP3CWS.js → chunk-SHHY5OMK.js} +7 -5
  123. package/dist/chunk-SKWO3SZF.js +2284 -0
  124. package/dist/{chunk-YF4NSSMT.js → chunk-SWS5JQIF.js} +41 -13
  125. package/dist/{chunk-CUMUNPXY.js → chunk-T5LTPKX6.js} +15 -7
  126. package/dist/{chunk-H6NIOQHK.js → chunk-TDMG26JI.js} +26 -6
  127. package/dist/{chunk-UWFLYMAR.js → chunk-TLCIR6RG.js} +267 -126
  128. package/dist/{chunk-SBMNWWBV.js → chunk-TN2ZNJUI.js} +47 -9
  129. package/dist/{chunk-5YNTNN5A.js → chunk-TQVAIKFD.js} +106 -41
  130. package/dist/chunk-TRGFFU6A.js +1456 -0
  131. package/dist/{chunk-2GK6PHGE.js → chunk-TY4MTKQJ.js} +100 -22
  132. package/dist/{chunk-AZRX6SAC.js → chunk-U23FYWME.js} +15 -7
  133. package/dist/{chunk-PZXZJBMP.js → chunk-U5NLHYV6.js} +26 -12
  134. package/dist/chunk-UQEN55EY.js +1 -0
  135. package/dist/chunk-UQGBTPXH.js +218 -0
  136. package/dist/chunk-UXGIW7OK.js +116 -0
  137. package/dist/{chunk-PJXUJYS6.js → chunk-UYGDJWMN.js} +55 -30
  138. package/dist/{chunk-QDYDBCFP.js → chunk-V2OEB75Z.js} +50 -51
  139. package/dist/{chunk-LSS54GLJ.js → chunk-VAOAKWUK.js} +34 -13
  140. package/dist/{chunk-DM5QUKKO.js → chunk-VDPK5CY4.js} +18 -6
  141. package/dist/chunk-W23G6JLF.js +37 -0
  142. package/dist/{chunk-CDRZHT42.js → chunk-W63AJTM7.js} +276 -12
  143. package/dist/{chunk-XXXEFXY5.js → chunk-W74TXYFB.js} +13 -5
  144. package/dist/{chunk-LRJNDEIA.js → chunk-WRDSPUE7.js} +144 -29
  145. package/dist/{chunk-C2NTXVWM.js → chunk-XBZGDDMR.js} +11 -4
  146. package/dist/{chunk-BV3B2HYZ.js → chunk-XIDTBCBA.js} +189 -131
  147. package/dist/{chunk-DSJBXLUG.js → chunk-XN4KG3P4.js} +348 -153
  148. package/dist/chunk-XQXMLMH3.js +211 -0
  149. package/dist/{chunk-HPPW424V.js → chunk-XTORZWRF.js} +19 -8
  150. package/dist/{chunk-P23EQNRQ.js → chunk-YAAHPATV.js} +181 -30
  151. package/dist/{chunk-KMI5ML5I.js → chunk-YXOAPXMU.js} +57 -18
  152. package/dist/{chunk-RJQOOHT2.js → chunk-ZECZOOSB.js} +59 -28
  153. package/dist/{chunk-QKXCPTFS.js → chunk-ZLTO5VQI.js} +121 -31
  154. package/dist/{chunk-BEDBFJND.js → chunk-ZVATDZOM.js} +16 -18
  155. package/dist/coachmark/index.js +6 -3
  156. package/dist/code-block/index.js +5 -3
  157. package/dist/color-field/index.js +6 -4
  158. package/dist/commerce/index.js +19 -16
  159. package/dist/connectivity/index.js +5 -2
  160. package/dist/context-menu/index.js +5 -3
  161. package/dist/copy-button/index.js +4 -2
  162. package/dist/data-grid/index.js +21 -16
  163. package/dist/date-range-picker/index.js +11 -8
  164. package/dist/description-list/index.js +3 -1
  165. package/dist/dialog/index.js +4 -2
  166. package/dist/empty-state/index.js +4 -2
  167. package/dist/error-summary/index.js +4 -2
  168. package/dist/fab/index.js +5 -2
  169. package/dist/file-manager/index.js +28 -0
  170. package/dist/file-upload/index.js +10 -7
  171. package/dist/filter-bar/index.js +9 -6
  172. package/dist/flow-run/index.js +15 -12
  173. package/dist/form/index.js +5 -3
  174. package/dist/gallery/index.js +5 -2
  175. package/dist/hold-to-confirm/index.js +4 -2
  176. package/dist/index.d.ts +9557 -2985
  177. package/dist/index.js +355 -122
  178. package/dist/infinite-list/index.js +4 -2
  179. package/dist/inline-edit/index.js +6 -4
  180. package/dist/input/index.js +5 -3
  181. package/dist/interactions/index.js +2 -1
  182. package/dist/invoice/index.js +13 -9
  183. package/dist/kbd/index.js +5 -1
  184. package/dist/keyboard/index.js +4 -2
  185. package/dist/list-row/index.js +6 -4
  186. package/dist/log-viewer/index.js +4 -2
  187. package/dist/map-view/index.js +5 -3
  188. package/dist/markdown/index.js +9 -6
  189. package/dist/metric/index.js +7 -4
  190. package/dist/money/index.js +9 -3
  191. package/dist/nav-drawer/index.js +4 -2
  192. package/dist/nav-header/index.js +9 -0
  193. package/dist/navigation/index.js +5 -2
  194. package/dist/notification-center/index.js +12 -10
  195. package/dist/number-roll/index.js +5 -2
  196. package/dist/one-handed/index.js +5 -3
  197. package/dist/os-surfaces/index.js +6 -3
  198. package/dist/otp/index.js +7 -4
  199. package/dist/page-header/index.js +1 -0
  200. package/dist/pagination/index.js +6 -0
  201. package/dist/payment-method/index.js +14 -10
  202. package/dist/payment-status/index.js +17 -14
  203. package/dist/permission/index.js +5 -2
  204. package/dist/picker/index.js +11 -6
  205. package/dist/progress/index.js +6 -3
  206. package/dist/pull-to-refresh/index.js +4 -2
  207. package/dist/radio-group/index.js +6 -4
  208. package/dist/rating/index.js +5 -2
  209. package/dist/receivables/index.js +21 -16
  210. package/dist/refund/index.js +18 -14
  211. package/dist/save-status/index.js +5 -3
  212. package/dist/scroll-area/index.js +3 -1
  213. package/dist/search-field/index.js +8 -0
  214. package/dist/segmented-control/index.js +4 -3
  215. package/dist/sheet/index.js +5 -3
  216. package/dist/skeleton/index.js +3 -1
  217. package/dist/slider/index.js +4 -2
  218. package/dist/sortable/index.js +7 -0
  219. package/dist/spinner/index.js +3 -1
  220. package/dist/split-button/index.js +9 -6
  221. package/dist/spotlight/index.js +3 -1
  222. package/dist/stage-timeline/index.js +5 -3
  223. package/dist/status-dot/index.js +4 -2
  224. package/dist/stepper/index.js +7 -4
  225. package/dist/streaming-text/index.js +3 -2
  226. package/dist/survey/index.js +18 -15
  227. package/dist/switch/index.js +5 -3
  228. package/dist/system-state/index.js +7 -4
  229. package/dist/tab-bar/index.js +5 -2
  230. package/dist/tabs/index.js +4 -2
  231. package/dist/tags-input/index.js +10 -0
  232. package/dist/textarea/index.js +6 -4
  233. package/dist/thinking/index.js +3 -1
  234. package/dist/time-field/index.js +12 -0
  235. package/dist/time-range-control/index.js +22 -0
  236. package/dist/timeline/index.js +4 -2
  237. package/dist/toast/index.js +4 -2
  238. package/dist/toolbar/index.js +4 -2
  239. package/dist/tour/index.js +12 -9
  240. package/dist/truncation-notice/index.js +5 -2
  241. package/dist/update-notice/index.js +12 -9
  242. package/dist/video-player/index.js +5 -2
  243. package/dist/viewfinder/index.js +6 -4
  244. package/dist/widget/index.js +7 -4
  245. package/dist/wizard/index.js +7 -4
  246. package/package.json +13 -12
  247. package/dist/chunk-6N33LFQA.js +0 -35
  248. package/dist/chunk-GDKZTW34.js +0 -395
  249. package/dist/chunk-GL7B2DOW.js +0 -134
  250. package/dist/chunk-NKB7BZYK.js +0 -167
  251. package/dist/chunk-OETCUXQP.js +0 -134
  252. package/dist/chunk-OPXFZ4Y5.js +0 -204
  253. package/dist/chunk-Q72LJOVE.js +0 -169
  254. package/dist/chunk-RNGLIHFA.js +0 -191
  255. package/dist/chunk-RQ3HASCC.js +0 -6
  256. package/dist/chunk-RSOJT5YW.js +0 -124
  257. package/dist/chunk-TKVFVF5D.js +0 -95
  258. package/dist/chunk-XOSCY2CW.js +0 -242
  259. package/dist/header/index.js +0 -5
  260. package/dist/search-bar/index.js +0 -5
  261. /package/dist/{chunk-3ECPOSKO.js → chunk-3UG6JUCV.js} +0 -0
  262. /package/dist/{chunk-JRLTGLN4.js → chunk-5WWRTEPS.js} +0 -0
  263. /package/dist/{chunk-RTIKSY6A.js → chunk-5Z5ZYMOJ.js} +0 -0
@@ -1,25 +1,99 @@
1
- import { Amount, PriceRow } from './chunk-VBOXAEPI.js';
2
- import { DescriptionList } from './chunk-TUTI5HOZ.js';
3
- import { Badge } from './chunk-SBMNWWBV.js';
4
- import { Button } from './chunk-3ARE4TES.js';
5
- import { Icon } from './chunk-TKVFVF5D.js';
6
- import 'react';
7
- import { View, Text } from 'react-native';
1
+ import { Amount, PriceRow } from './chunk-QHAITQIF.js';
2
+ import { DescriptionList } from './chunk-QIKT7LIB.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';
7
+ import { Icon } from './chunk-UXGIW7OK.js';
8
+ import { useResolvedMotion, springConfig } from './chunk-J64KGCGX.js';
9
+ import * as React from 'react';
10
+ import { Animated, Text, View } from 'react-native';
8
11
  import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
9
12
  import { dateZone, dayLabel } from '@btndprojects/loam-date';
10
- import { INVOICE_STATUS, TAX_MODES, REVERSE_CHARGE_NOTE } from '@btndprojects/loam-pay';
13
+ import { INVOICE_STATUS, invoiceStatusLabel, taxModeText, currencyName } from '@btndprojects/loam-pay';
11
14
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
15
 
16
+ // src/invoice/invoice-labels.ts
17
+ var DEFAULT_LABELS = {
18
+ name: "Name",
19
+ address: "Address",
20
+ vat: "VAT",
21
+ registration: "Registration",
22
+ contact: "Contact",
23
+ sellerVat: (v) => `VAT ${v}`,
24
+ sellerReg: (r) => `Reg. ${r}`,
25
+ title: "Invoice",
26
+ billedTo: "Billed to",
27
+ dates: "Dates",
28
+ references: "References",
29
+ issued: "Issued",
30
+ due: "Due",
31
+ terms: "Terms",
32
+ invoice: "Invoice",
33
+ po: "PO",
34
+ taxMode: "Tax mode",
35
+ currency: "Currency",
36
+ currencyLine: (code, name) => `${code} \xB7 ${name}`,
37
+ linesTitle: (code) => `Lines \xB7 all amounts in ${code}`,
38
+ colDescription: "Description",
39
+ colQty: "Qty",
40
+ colUnit: "Unit",
41
+ colTax: "Tax",
42
+ colAmount: "Amount",
43
+ noLines: "This invoice has no lines.",
44
+ linesCaption: (n) => `Lines on invoice ${n}`,
45
+ howToPay: "How to pay",
46
+ iban: "IBAN",
47
+ bic: "BIC / SWIFT",
48
+ reference: "Reference",
49
+ payableBy: "Payable by",
50
+ payByCard: "Pay by card instead",
51
+ totals: "Totals",
52
+ subtotal: "Subtotal",
53
+ discount: "Discount",
54
+ discountPercent: (label, pct) => `${label} \xB7 ${pct}%`,
55
+ net: "Net",
56
+ taxable: "Taxable amount",
57
+ taxIncluded: (l) => `${l} \xB7 included above`,
58
+ taxZeroRated: (l, mode) => `${l} \xB7 ${mode.toLowerCase()}`,
59
+ payment: (label, date) => `${label} \xB7 ${date}`,
60
+ total: "Total",
61
+ amountDue: "Amount due",
62
+ taxModeFooter: (name, note) => `${name} \u2014 ${note}`,
63
+ downloadPdf: "Download PDF",
64
+ lineQty: (qty) => `${qty} \xD7`,
65
+ lineTax: (rate) => `\xB7 ${rate}% tax`,
66
+ print: "Print"
67
+ };
13
68
  function InvoiceStatusStamp({
14
69
  stamp: value,
15
70
  size = "md",
16
- style
71
+ style,
72
+ motion = "full"
17
73
  }) {
18
- const theme = useLoamTheme();
74
+ const theme = useLoamTheme("invoice");
75
+ const level = useResolvedMotion(motion, "invoice");
76
+ const land = React.useRef(new Animated.Value(1)).current;
77
+ const first = React.useRef(true);
78
+ React.useEffect(() => {
79
+ if (first.current) {
80
+ first.current = false;
81
+ return;
82
+ }
83
+ if (level !== "full") return;
84
+ land.setValue(0);
85
+ const run = Animated.spring(land, {
86
+ ...springConfig(theme, "fs"),
87
+ toValue: 1,
88
+ useNativeDriver: true
89
+ });
90
+ run.start();
91
+ return () => run.stop();
92
+ }, [value.tone, value.label]);
19
93
  const { styles } = useStyles(sheet);
20
94
  const plate = stampPlate(theme, value.tone);
21
95
  return /* @__PURE__ */ jsx(
22
- View,
96
+ Animated.View,
23
97
  {
24
98
  testID: `invoice-stamp-${value.tone}`,
25
99
  accessibilityRole: "text",
@@ -28,6 +102,12 @@ function InvoiceStatusStamp({
28
102
  styles.stamp,
29
103
  size === "lg" ? styles.stampLg : styles.stampMd,
30
104
  { borderColor: plate.edge, backgroundColor: plate.fill },
105
+ {
106
+ opacity: land.interpolate({ inputRange: [0, 1], outputRange: [0.4, 1] }),
107
+ transform: [
108
+ { scale: land.interpolate({ inputRange: [0, 1], outputRange: [STAMP_FROM, 1] }) }
109
+ ]
110
+ },
31
111
  style
32
112
  ],
33
113
  children: /* @__PURE__ */ jsx(
@@ -44,6 +124,7 @@ function InvoiceStatusStamp({
44
124
  }
45
125
  );
46
126
  }
127
+ var STAMP_FROM = 0.9;
47
128
  function stampPlate(theme, tone) {
48
129
  switch (tone) {
49
130
  case "good":
@@ -64,10 +145,12 @@ function stampPlate(theme, tone) {
64
145
  function InvoiceStatusBadge({
65
146
  status,
66
147
  label,
67
- size = "sm"
148
+ size = "sm",
149
+ labels
68
150
  }) {
151
+ const pay = usePayLabels(labels);
69
152
  const meta = INVOICE_STATUS[status];
70
- return /* @__PURE__ */ jsx(Badge, { variant: meta.tone, size, children: label ?? meta.label });
153
+ return /* @__PURE__ */ jsx(Badge, { variant: meta.tone, size, children: label ?? invoiceStatusLabel(status, pay) });
71
154
  }
72
155
  var sheet = createStyleSheet((theme) => ({
73
156
  stamp: {
@@ -96,10 +179,10 @@ var sheet = createStyleSheet((theme) => ({
96
179
  letterSpacing: theme.tracking.wider
97
180
  }
98
181
  }));
99
- function discountLabel(discounts) {
182
+ function discountLabel(discounts, labels = DEFAULT_LABELS) {
100
183
  const list = discounts ?? [];
101
- if (list.length === 0) return "Discount";
102
- return list.map((d) => d.kind === "pct" ? `${d.label} \xB7 ${d.value}%` : d.label).join(" \xB7 ");
184
+ if (list.length === 0) return labels.discount;
185
+ return list.map((d) => d.kind === "pct" ? labels.discountPercent(d.label, d.value) : d.label).join(" \xB7 ");
103
186
  }
104
187
  function InvoiceDocument({
105
188
  invoice,
@@ -107,20 +190,29 @@ function InvoiceDocument({
107
190
  stamp,
108
191
  dense = false,
109
192
  showPayAction = false,
110
- locale,
193
+ locale: localeProp,
111
194
  zone,
112
195
  onPay,
113
196
  onDownloadPdf,
114
- title = "Invoice",
115
- payLabel = "Pay by card instead",
116
- style
197
+ title: titleProp,
198
+ payLabel: payLabelProp,
199
+ payBusy = false,
200
+ labels: labelsProp,
201
+ style,
202
+ motion = "full"
117
203
  }) {
118
- const theme = useLoamTheme();
204
+ const labels = useLabels("invoice", DEFAULT_LABELS, labelsProp);
205
+ const pay = usePayLabels(labelsProp);
206
+ const contextLocale = useLoamLocale();
207
+ const locale = localeProp ?? contextLocale;
208
+ const title = titleProp ?? labels.title;
209
+ const payLabel = payLabelProp ?? labels.payByCard;
210
+ const theme = useLoamTheme("invoice");
119
211
  const { styles } = useStyles(sheet2);
120
212
  const Z = zone ?? dateZone();
121
213
  const day = (ms) => dayLabel(Z, ms, { longMonth: true, locale });
122
214
  const cy = invoice.currency;
123
- const mode = TAX_MODES[invoice.taxMode];
215
+ const mode = taxModeText(invoice.taxMode, pay);
124
216
  const zeroRated = invoice.taxMode === "reverse" || invoice.taxMode === "exempt";
125
217
  return /* @__PURE__ */ jsxs(
126
218
  View,
@@ -133,45 +225,52 @@ function InvoiceDocument({
133
225
  /* @__PURE__ */ jsxs(View, { style: styles.sellerBlock, children: [
134
226
  /* @__PURE__ */ jsx(Text, { style: styles.sellerName, children: invoice.seller.name }),
135
227
  /* @__PURE__ */ jsx(Text, { style: styles.sellerAddr, children: invoice.seller.addr }),
136
- invoice.seller.vat ? /* @__PURE__ */ jsx(Text, { style: styles.sellerMeta, children: `VAT ${invoice.seller.vat}` }) : null,
137
- invoice.seller.reg ? /* @__PURE__ */ jsx(Text, { style: styles.sellerMeta, children: `Reg. ${invoice.seller.reg}` }) : null
228
+ invoice.seller.vat ? /* @__PURE__ */ jsx(Text, { style: styles.sellerMeta, children: labels.sellerVat(invoice.seller.vat) }) : null,
229
+ invoice.seller.reg ? /* @__PURE__ */ jsx(Text, { style: styles.sellerMeta, children: labels.sellerReg(invoice.seller.reg) }) : null
138
230
  ] }),
139
231
  /* @__PURE__ */ jsxs(View, { style: styles.titleBlock, children: [
140
232
  /* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: styles.docTitle, children: title }),
141
233
  /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.number }),
142
- /* @__PURE__ */ jsx(InvoiceStatusStamp, { stamp, size: "lg" })
234
+ /* @__PURE__ */ jsx(InvoiceStatusStamp, { stamp, size: "lg", motion })
143
235
  ] })
144
236
  ] }),
145
- /* @__PURE__ */ jsx(Block, { title: "Billed to", children: /* @__PURE__ */ jsx(DescriptionList, { layout: "inline", density: "compact", items: partyEntries(invoice.buyer, styles.mono) }) }),
146
- /* @__PURE__ */ jsx(Block, { title: "Dates", children: /* @__PURE__ */ jsx(
237
+ /* @__PURE__ */ jsx(Block, { title: labels.billedTo, children: /* @__PURE__ */ jsx(
238
+ DescriptionList,
239
+ {
240
+ layout: "inline",
241
+ density: "compact",
242
+ items: partyEntries(invoice.buyer, styles.mono, labels)
243
+ }
244
+ ) }),
245
+ /* @__PURE__ */ jsx(Block, { title: labels.dates, children: /* @__PURE__ */ jsx(
147
246
  DescriptionList,
148
247
  {
149
248
  layout: "inline",
150
249
  density: "compact",
151
250
  items: [
152
- { term: "Issued", description: day(invoice.issued) },
251
+ { term: labels.issued, description: day(invoice.issued) },
153
252
  {
154
- term: "Due",
253
+ term: labels.due,
155
254
  description: /* @__PURE__ */ jsx(Text, { style: styles.strongValue, children: day(invoice.due) })
156
255
  },
157
- { term: "Terms", description: invoice.terms }
256
+ { term: labels.terms, description: invoice.terms }
158
257
  ]
159
258
  }
160
259
  ) }),
161
- /* @__PURE__ */ jsx(Block, { title: "References", children: /* @__PURE__ */ jsx(
260
+ /* @__PURE__ */ jsx(Block, { title: labels.references, children: /* @__PURE__ */ jsx(
162
261
  DescriptionList,
163
262
  {
164
263
  layout: "inline",
165
264
  density: "compact",
166
265
  items: [
167
- { term: "Invoice", description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.number }) },
168
- ...invoice.po ? [{ term: "PO", description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.po }) }] : [],
169
- { term: "Tax mode", description: mode.label },
170
- { term: "Currency", description: `${t.c.code} \xB7 ${t.c.label}` }
266
+ { term: labels.invoice, description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.number }) },
267
+ ...invoice.po ? [{ term: labels.po, description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.po }) }] : [],
268
+ { term: labels.taxMode, description: mode.label },
269
+ { term: labels.currency, description: labels.currencyLine(t.c.code, currencyName(t.c.code, pay)) }
171
270
  ]
172
271
  }
173
272
  ) }),
174
- /* @__PURE__ */ jsx(Block, { title: `Lines \xB7 all amounts in ${t.c.code}`, children: t.lines.length === 0 ? /* @__PURE__ */ jsx(Text, { style: styles.empty, children: "This invoice has no lines." }) : /* @__PURE__ */ jsx(View, { role: "list", accessibilityRole: "list", style: styles.lines, children: t.lines.map((line, index) => /* @__PURE__ */ jsxs(
273
+ /* @__PURE__ */ jsx(Block, { title: labels.linesTitle(t.c.code), children: t.lines.length === 0 ? /* @__PURE__ */ jsx(Text, { style: styles.empty, children: labels.noLines }) : /* @__PURE__ */ jsx(View, { role: "list", accessibilityRole: "list", style: styles.lines, children: t.lines.map((line, index) => /* @__PURE__ */ jsxs(
175
274
  View,
176
275
  {
177
276
  role: "listitem",
@@ -180,18 +279,9 @@ function InvoiceDocument({
180
279
  /* @__PURE__ */ jsx(Text, { style: styles.lineDesc, children: line.desc }),
181
280
  line.detail ? /* @__PURE__ */ jsx(Text, { style: styles.lineDetail, children: line.detail }) : null,
182
281
  /* @__PURE__ */ jsxs(View, { style: styles.lineFoot, children: [
183
- /* @__PURE__ */ jsx(Text, { style: styles.lineMeta, children: `${line.qty} \xD7` }),
184
- /* @__PURE__ */ jsx(
185
- Amount,
186
- {
187
- minor: line.unit,
188
- currency: cy,
189
- size: "sm",
190
- noSymbol: true,
191
- locale
192
- }
193
- ),
194
- /* @__PURE__ */ jsx(Text, { style: styles.lineMeta, children: `\xB7 ${zeroRated ? 0 : line.tax}% tax` }),
282
+ /* @__PURE__ */ jsx(Text, { style: styles.lineMeta, children: labels.lineQty(line.qty) }),
283
+ /* @__PURE__ */ jsx(Amount, { minor: line.unit, currency: cy, size: "sm", noSymbol: true, locale }),
284
+ /* @__PURE__ */ jsx(Text, { style: styles.lineMeta, children: labels.lineTax(zeroRated ? 0 : line.tax) }),
195
285
  /* @__PURE__ */ jsx(View, { style: styles.pushEnd, children: /* @__PURE__ */ jsx(
196
286
  Amount,
197
287
  {
@@ -209,33 +299,38 @@ function InvoiceDocument({
209
299
  },
210
300
  `${invoice.id}-line-${index}`
211
301
  )) }) }),
212
- /* @__PURE__ */ jsxs(Block, { title: "How to pay", children: [
302
+ /* @__PURE__ */ jsxs(Block, { title: labels.howToPay, children: [
213
303
  /* @__PURE__ */ jsx(
214
304
  DescriptionList,
215
305
  {
216
306
  layout: "inline",
217
307
  density: "compact",
218
308
  items: [
219
- ...invoice.seller.iban ? [{ term: "IBAN", description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.seller.iban }) }] : [],
309
+ ...invoice.seller.iban ? [
310
+ {
311
+ term: labels.iban,
312
+ description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.seller.iban })
313
+ }
314
+ ] : [],
220
315
  ...invoice.seller.bic ? [
221
316
  {
222
- term: "BIC / SWIFT",
317
+ term: labels.bic,
223
318
  description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.seller.bic })
224
319
  }
225
320
  ] : [],
226
- { term: "Reference", description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.number }) },
227
- { term: "Payable by", description: day(invoice.due) }
321
+ { term: labels.reference, description: /* @__PURE__ */ jsx(Text, { style: styles.mono, children: invoice.number }) },
322
+ { term: labels.payableBy, description: day(invoice.due) }
228
323
  ]
229
324
  }
230
325
  ),
231
- showPayAction ? /* @__PURE__ */ jsx(View, { style: styles.payAction, children: /* @__PURE__ */ jsx(Button, { variant: "tonal", size: "sm", leadingIcon: "card", onPress: onPay, children: payLabel }) }) : null
326
+ showPayAction ? /* @__PURE__ */ jsx(View, { style: styles.payAction, children: /* @__PURE__ */ jsx(Button, { variant: "tonal", size: "sm", leadingIcon: "card", loading: payBusy, onPress: onPay, children: payLabel }) }) : null
232
327
  ] }),
233
- /* @__PURE__ */ jsx(Block, { title: "Totals", children: /* @__PURE__ */ jsxs(View, { style: dense ? styles.totalsDense : styles.totals, children: [
234
- /* @__PURE__ */ jsx(PriceRow, { label: "Subtotal", minor: t.gross, currency: cy, noSymbol: true, locale }),
328
+ /* @__PURE__ */ jsx(Block, { title: labels.totals, children: /* @__PURE__ */ jsxs(View, { style: dense ? styles.totalsDense : styles.totals, children: [
329
+ /* @__PURE__ */ jsx(PriceRow, { label: labels.subtotal, minor: t.gross, currency: cy, noSymbol: true, locale }),
235
330
  t.discount !== 0 ? /* @__PURE__ */ jsx(
236
331
  PriceRow,
237
332
  {
238
- label: discountLabel(invoice.discounts),
333
+ label: discountLabel(invoice.discounts, labels),
239
334
  minor: -t.discount,
240
335
  currency: cy,
241
336
  tone: "good",
@@ -243,12 +338,12 @@ function InvoiceDocument({
243
338
  locale
244
339
  }
245
340
  ) : null,
246
- t.discount !== 0 ? /* @__PURE__ */ jsx(PriceRow, { label: "Net", minor: t.net, currency: cy, noSymbol: true, locale, rule: true }) : null,
341
+ t.discount !== 0 ? /* @__PURE__ */ jsx(PriceRow, { label: labels.net, minor: t.net, currency: cy, noSymbol: true, locale, rule: true }) : null,
247
342
  invoice.taxMode === "inclusive" ? /* @__PURE__ */ jsxs(Fragment, { children: [
248
343
  /* @__PURE__ */ jsx(
249
344
  PriceRow,
250
345
  {
251
- label: "Taxable amount",
346
+ label: labels.taxable,
252
347
  minor: t.taxable,
253
348
  currency: cy,
254
349
  noSymbol: true,
@@ -258,7 +353,7 @@ function InvoiceDocument({
258
353
  /* @__PURE__ */ jsx(
259
354
  PriceRow,
260
355
  {
261
- label: `${invoice.taxLabel} \xB7 included above`,
356
+ label: labels.taxIncluded(invoice.taxLabel),
262
357
  minor: t.tax,
263
358
  currency: cy,
264
359
  noSymbol: true,
@@ -268,7 +363,7 @@ function InvoiceDocument({
268
363
  ] }) : /* @__PURE__ */ jsx(
269
364
  PriceRow,
270
365
  {
271
- label: zeroRated ? `${invoice.taxLabel} \xB7 ${mode.label.toLowerCase()}` : invoice.taxLabel,
366
+ label: zeroRated ? labels.taxZeroRated(invoice.taxLabel, mode.label) : invoice.taxLabel,
272
367
  minor: t.tax,
273
368
  currency: cy,
274
369
  noSymbol: true,
@@ -287,11 +382,23 @@ function InvoiceDocument({
287
382
  },
288
383
  c.label
289
384
  )),
290
- /* @__PURE__ */ jsx(PriceRow, { label: "Total", minor: t.total, currency: cy, strong: true, rule: true, locale }),
385
+ /* @__PURE__ */ jsx(
386
+ PriceRow,
387
+ {
388
+ label: labels.total,
389
+ minor: t.total,
390
+ currency: cy,
391
+ strong: true,
392
+ rule: true,
393
+ locale,
394
+ roll: true,
395
+ motion
396
+ }
397
+ ),
291
398
  (invoice.payments ?? []).map((p) => /* @__PURE__ */ jsx(
292
399
  PriceRow,
293
400
  {
294
- label: `${p.label} \xB7 ${day(p.at)}`,
401
+ label: labels.payment(p.label, day(p.at)),
295
402
  minor: -p.amount,
296
403
  currency: cy,
297
404
  tone: "good",
@@ -300,33 +407,45 @@ function InvoiceDocument({
300
407
  },
301
408
  `${p.label}-${p.at}`
302
409
  )),
303
- /* @__PURE__ */ jsx(PriceRow, { label: "Amount due", minor: t.due, currency: cy, strong: true, rule: true, locale })
410
+ /* @__PURE__ */ jsx(
411
+ PriceRow,
412
+ {
413
+ label: labels.amountDue,
414
+ minor: t.due,
415
+ currency: cy,
416
+ strong: true,
417
+ rule: true,
418
+ locale,
419
+ roll: true,
420
+ motion
421
+ }
422
+ )
304
423
  ] }) }),
305
424
  invoice.taxMode === "reverse" ? /* @__PURE__ */ jsxs(View, { style: styles.legalBox, children: [
306
425
  /* @__PURE__ */ jsx(Icon, { name: "info", size: theme.icon.sm, color: theme.color.text2 }),
307
426
  /* @__PURE__ */ jsxs(View, { style: styles.legalBody, children: [
308
427
  /* @__PURE__ */ jsx(Text, { style: styles.legalTitle, children: mode.label }),
309
- /* @__PURE__ */ jsx(Text, { style: styles.legalNote, children: REVERSE_CHARGE_NOTE })
428
+ /* @__PURE__ */ jsx(Text, { style: styles.legalNote, children: pay.reverseChargeNote })
310
429
  ] })
311
430
  ] }) : null,
312
431
  /* @__PURE__ */ jsxs(View, { style: styles.footer, children: [
313
432
  invoice.notes ? /* @__PURE__ */ jsx(Text, { style: styles.notes, children: invoice.notes }) : null,
314
- /* @__PURE__ */ jsx(Text, { style: styles.taxFooter, children: `${mode.label} \u2014 ${mode.note}` })
433
+ /* @__PURE__ */ jsx(Text, { style: styles.taxFooter, children: labels.taxModeFooter(mode.label, mode.note) })
315
434
  ] }),
316
- onDownloadPdf ? /* @__PURE__ */ jsx(View, { style: styles.docActions, children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", leadingIcon: "download", onPress: onDownloadPdf, children: "Download PDF" }) }) : null
435
+ onDownloadPdf ? /* @__PURE__ */ jsx(View, { style: styles.docActions, children: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", leadingIcon: "download", onPress: onDownloadPdf, children: labels.downloadPdf }) }) : null
317
436
  ]
318
437
  }
319
438
  );
320
439
  }
321
- function partyEntries(party, mono) {
440
+ function partyEntries(party, mono, labels = DEFAULT_LABELS) {
322
441
  const out = [
323
- { term: "Name", description: party.name },
324
- { term: "Address", description: party.addr }
442
+ { term: labels.name, description: party.name },
443
+ { term: labels.address, description: party.addr }
325
444
  ];
326
- if (party.vat) out.push({ term: "VAT", description: /* @__PURE__ */ jsx(Text, { style: mono, children: party.vat }) });
445
+ if (party.vat) out.push({ term: labels.vat, description: /* @__PURE__ */ jsx(Text, { style: mono, children: party.vat }) });
327
446
  if (party.reg)
328
- out.push({ term: "Registration", description: /* @__PURE__ */ jsx(Text, { style: mono, children: party.reg }) });
329
- if (party.contact) out.push({ term: "Contact", description: party.contact });
447
+ out.push({ term: labels.registration, description: /* @__PURE__ */ jsx(Text, { style: mono, children: party.reg }) });
448
+ if (party.contact) out.push({ term: labels.contact, description: party.contact });
330
449
  return out;
331
450
  }
332
451
  function Block({