@booki-aui/react 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/LICENSE +21 -0
  3. package/README.md +16 -2
  4. package/dist/access.d.ts +43 -0
  5. package/dist/access.js +15 -0
  6. package/dist/access.js.map +1 -0
  7. package/dist/account-picker.d.ts +40 -0
  8. package/dist/account-picker.js +25 -0
  9. package/dist/account-picker.js.map +1 -0
  10. package/dist/accounting-period-select.d.ts +34 -0
  11. package/dist/accounting-period-select.js +23 -0
  12. package/dist/accounting-period-select.js.map +1 -0
  13. package/dist/activity-timeline.d.ts +37 -0
  14. package/dist/activity-timeline.js +19 -0
  15. package/dist/activity-timeline.js.map +1 -0
  16. package/dist/aged-balances.d.ts +62 -0
  17. package/dist/aged-balances.js +31 -0
  18. package/dist/aged-balances.js.map +1 -0
  19. package/dist/agent-cursor.d.ts +34 -0
  20. package/dist/agent-cursor.js +14 -0
  21. package/dist/agent-cursor.js.map +1 -0
  22. package/dist/agent-presence.d.ts +110 -0
  23. package/dist/agent-presence.js +15 -0
  24. package/dist/agent-presence.js.map +1 -0
  25. package/dist/aging-chart.d.ts +41 -0
  26. package/dist/aging-chart.js +19 -0
  27. package/dist/aging-chart.js.map +1 -0
  28. package/dist/amount-field.d.ts +46 -0
  29. package/dist/amount-field.js +19 -0
  30. package/dist/amount-field.js.map +1 -0
  31. package/dist/amount-input.d.ts +18 -0
  32. package/dist/amount-input.js +12 -0
  33. package/dist/amount-input.js.map +1 -0
  34. package/dist/approval-chain.d.ts +36 -0
  35. package/dist/approval-chain.js +22 -0
  36. package/dist/approval-chain.js.map +1 -0
  37. package/dist/approval-gate.d.ts +19 -0
  38. package/dist/approval-gate.js +10 -0
  39. package/dist/approval-gate.js.map +1 -0
  40. package/dist/attestation-status.d.ts +31 -0
  41. package/dist/attestation-status.js +22 -0
  42. package/dist/attestation-status.js.map +1 -0
  43. package/dist/audit-findings.d.ts +40 -0
  44. package/dist/audit-findings.js +28 -0
  45. package/dist/audit-findings.js.map +1 -0
  46. package/dist/audit-trail.d.ts +22 -0
  47. package/dist/audit-trail.js +10 -0
  48. package/dist/audit-trail.js.map +1 -0
  49. package/dist/audit-workpaper.d.ts +56 -0
  50. package/dist/audit-workpaper.js +35 -0
  51. package/dist/audit-workpaper.js.map +1 -0
  52. package/dist/bank-account-input.d.ts +36 -0
  53. package/dist/bank-account-input.js +22 -0
  54. package/dist/bank-account-input.js.map +1 -0
  55. package/dist/bank-reconciliation.d.ts +38 -0
  56. package/dist/bank-reconciliation.js +20 -0
  57. package/dist/bank-reconciliation.js.map +1 -0
  58. package/dist/bar-chart.d.ts +38 -0
  59. package/dist/bar-chart.js +19 -0
  60. package/dist/bar-chart.js.map +1 -0
  61. package/dist/booki-agent.d.ts +153 -0
  62. package/dist/booki-agent.js +27 -0
  63. package/dist/booki-agent.js.map +1 -0
  64. package/dist/cashflow-waterfall.d.ts +36 -0
  65. package/dist/cashflow-waterfall.js +17 -0
  66. package/dist/cashflow-waterfall.js.map +1 -0
  67. package/dist/change-details-CWpEgc80.d.ts +14 -0
  68. package/dist/chunk-2HM7YSBC.js +92 -0
  69. package/dist/chunk-2HM7YSBC.js.map +1 -0
  70. package/dist/chunk-35QKOOAI.js +27 -0
  71. package/dist/chunk-35QKOOAI.js.map +1 -0
  72. package/dist/chunk-37GDU76M.js +86 -0
  73. package/dist/chunk-37GDU76M.js.map +1 -0
  74. package/dist/chunk-4EVVT6ME.js +136 -0
  75. package/dist/chunk-4EVVT6ME.js.map +1 -0
  76. package/dist/chunk-4GQUOBOG.js +132 -0
  77. package/dist/chunk-4GQUOBOG.js.map +1 -0
  78. package/dist/chunk-4KWEZTO5.js +86 -0
  79. package/dist/chunk-4KWEZTO5.js.map +1 -0
  80. package/dist/chunk-4WC76FUE.js +242 -0
  81. package/dist/chunk-4WC76FUE.js.map +1 -0
  82. package/dist/chunk-62G3T2AA.js +230 -0
  83. package/dist/chunk-62G3T2AA.js.map +1 -0
  84. package/dist/chunk-663UXACN.js +334 -0
  85. package/dist/chunk-663UXACN.js.map +1 -0
  86. package/dist/chunk-6CVPNV7N.js +106 -0
  87. package/dist/chunk-6CVPNV7N.js.map +1 -0
  88. package/dist/chunk-6HWFMC7V.js +140 -0
  89. package/dist/chunk-6HWFMC7V.js.map +1 -0
  90. package/dist/chunk-7MYFKLPB.js +301 -0
  91. package/dist/chunk-7MYFKLPB.js.map +1 -0
  92. package/dist/chunk-7YTOVA5F.js +312 -0
  93. package/dist/chunk-7YTOVA5F.js.map +1 -0
  94. package/dist/chunk-AIGQPM4Y.js +311 -0
  95. package/dist/chunk-AIGQPM4Y.js.map +1 -0
  96. package/dist/chunk-AKC6N4QO.js +414 -0
  97. package/dist/chunk-AKC6N4QO.js.map +1 -0
  98. package/dist/chunk-BZIOOU4I.js +421 -0
  99. package/dist/chunk-BZIOOU4I.js.map +1 -0
  100. package/dist/chunk-CDTDN4LY.js +212 -0
  101. package/dist/chunk-CDTDN4LY.js.map +1 -0
  102. package/dist/chunk-EDWQSKY7.js +161 -0
  103. package/dist/chunk-EDWQSKY7.js.map +1 -0
  104. package/dist/chunk-EKIWL37F.js +488 -0
  105. package/dist/chunk-EKIWL37F.js.map +1 -0
  106. package/dist/chunk-F3C77WLR.js +116 -0
  107. package/dist/chunk-F3C77WLR.js.map +1 -0
  108. package/dist/chunk-FBV7BFEQ.js +84 -0
  109. package/dist/chunk-FBV7BFEQ.js.map +1 -0
  110. package/dist/chunk-GVP2N3K6.js +89 -0
  111. package/dist/chunk-GVP2N3K6.js.map +1 -0
  112. package/dist/chunk-HKYEHBQT.js +19 -0
  113. package/dist/chunk-HKYEHBQT.js.map +1 -0
  114. package/dist/chunk-HQYIFZZT.js +169 -0
  115. package/dist/chunk-HQYIFZZT.js.map +1 -0
  116. package/dist/chunk-HT6HGOLM.js +151 -0
  117. package/dist/chunk-HT6HGOLM.js.map +1 -0
  118. package/dist/chunk-ISPUO3AQ.js +244 -0
  119. package/dist/chunk-ISPUO3AQ.js.map +1 -0
  120. package/dist/chunk-JPUVGWLO.js +207 -0
  121. package/dist/chunk-JPUVGWLO.js.map +1 -0
  122. package/dist/chunk-JWFGUI7A.js +73 -0
  123. package/dist/chunk-JWFGUI7A.js.map +1 -0
  124. package/dist/chunk-K72VT6RJ.js +57 -0
  125. package/dist/chunk-K72VT6RJ.js.map +1 -0
  126. package/dist/chunk-KLDUGI7L.js +150 -0
  127. package/dist/chunk-KLDUGI7L.js.map +1 -0
  128. package/dist/chunk-M2WLQIFE.js +40 -0
  129. package/dist/chunk-M2WLQIFE.js.map +1 -0
  130. package/dist/chunk-M3MCIKF2.js +143 -0
  131. package/dist/chunk-M3MCIKF2.js.map +1 -0
  132. package/dist/chunk-MBLQSZHE.js +77 -0
  133. package/dist/chunk-MBLQSZHE.js.map +1 -0
  134. package/dist/chunk-N7GIVDUU.js +191 -0
  135. package/dist/chunk-N7GIVDUU.js.map +1 -0
  136. package/dist/chunk-NMHTPP6I.js +62 -0
  137. package/dist/chunk-NMHTPP6I.js.map +1 -0
  138. package/dist/chunk-NNP6GNEW.js +65 -0
  139. package/dist/chunk-NNP6GNEW.js.map +1 -0
  140. package/dist/chunk-OTD7VUEC.js +35 -0
  141. package/dist/chunk-OTD7VUEC.js.map +1 -0
  142. package/dist/chunk-OXHKA3UZ.js +30 -0
  143. package/dist/chunk-OXHKA3UZ.js.map +1 -0
  144. package/dist/chunk-OYERLEER.js +21 -0
  145. package/dist/chunk-OYERLEER.js.map +1 -0
  146. package/dist/chunk-PFY3VJ2T.js +231 -0
  147. package/dist/chunk-PFY3VJ2T.js.map +1 -0
  148. package/dist/chunk-PUMSFFEU.js +228 -0
  149. package/dist/chunk-PUMSFFEU.js.map +1 -0
  150. package/dist/chunk-QE7KUQOI.js +84 -0
  151. package/dist/chunk-QE7KUQOI.js.map +1 -0
  152. package/dist/chunk-QGT7VI6I.js +35 -0
  153. package/dist/chunk-QGT7VI6I.js.map +1 -0
  154. package/dist/chunk-QGYS5HS3.js +214 -0
  155. package/dist/chunk-QGYS5HS3.js.map +1 -0
  156. package/dist/chunk-QPSBRSBH.js +167 -0
  157. package/dist/chunk-QPSBRSBH.js.map +1 -0
  158. package/dist/chunk-ROXGVKR2.js +59 -0
  159. package/dist/chunk-ROXGVKR2.js.map +1 -0
  160. package/dist/chunk-RPONJDFZ.js +310 -0
  161. package/dist/chunk-RPONJDFZ.js.map +1 -0
  162. package/dist/chunk-RTCKV4H2.js +65 -0
  163. package/dist/chunk-RTCKV4H2.js.map +1 -0
  164. package/dist/chunk-SHZFZRHV.js +259 -0
  165. package/dist/chunk-SHZFZRHV.js.map +1 -0
  166. package/dist/chunk-SOXPKIQK.js +91 -0
  167. package/dist/chunk-SOXPKIQK.js.map +1 -0
  168. package/dist/chunk-SR2HEE4U.js +76 -0
  169. package/dist/chunk-SR2HEE4U.js.map +1 -0
  170. package/dist/chunk-SX3U6DRW.js +462 -0
  171. package/dist/chunk-SX3U6DRW.js.map +1 -0
  172. package/dist/chunk-T4U2CT35.js +175 -0
  173. package/dist/chunk-T4U2CT35.js.map +1 -0
  174. package/dist/chunk-TSX6BD72.js +251 -0
  175. package/dist/chunk-TSX6BD72.js.map +1 -0
  176. package/dist/chunk-U6PR3V2Q.js +123 -0
  177. package/dist/chunk-U6PR3V2Q.js.map +1 -0
  178. package/dist/chunk-U7NPK4WO.js +135 -0
  179. package/dist/chunk-U7NPK4WO.js.map +1 -0
  180. package/dist/chunk-W6TKXS75.js +55 -0
  181. package/dist/chunk-W6TKXS75.js.map +1 -0
  182. package/dist/chunk-WDME4U42.js +14 -0
  183. package/dist/chunk-WDME4U42.js.map +1 -0
  184. package/dist/chunk-WS2YJSNS.js +62 -0
  185. package/dist/chunk-WS2YJSNS.js.map +1 -0
  186. package/dist/chunk-Y5EYY6WJ.js +174 -0
  187. package/dist/chunk-Y5EYY6WJ.js.map +1 -0
  188. package/dist/chunk-YBMO3W5O.js +191 -0
  189. package/dist/chunk-YBMO3W5O.js.map +1 -0
  190. package/dist/chunk-YOOWFGCU.js +90 -0
  191. package/dist/chunk-YOOWFGCU.js.map +1 -0
  192. package/dist/chunk-ZKNVWQDU.js +230 -0
  193. package/dist/chunk-ZKNVWQDU.js.map +1 -0
  194. package/dist/chunk-ZYLWSGWQ.js +29 -0
  195. package/dist/chunk-ZYLWSGWQ.js.map +1 -0
  196. package/dist/chunk-ZYPW7GCI.js +82 -0
  197. package/dist/chunk-ZYPW7GCI.js.map +1 -0
  198. package/dist/client-requests.d.ts +40 -0
  199. package/dist/client-requests.js +25 -0
  200. package/dist/client-requests.js.map +1 -0
  201. package/dist/close-checklist.d.ts +34 -0
  202. package/dist/close-checklist.js +22 -0
  203. package/dist/close-checklist.js.map +1 -0
  204. package/dist/confirm-dialog.d.ts +43 -0
  205. package/dist/confirm-dialog.js +10 -0
  206. package/dist/confirm-dialog.js.map +1 -0
  207. package/dist/country-toggle.d.ts +16 -0
  208. package/dist/country-toggle.js +10 -0
  209. package/dist/country-toggle.js.map +1 -0
  210. package/dist/currency-select.d.ts +32 -0
  211. package/dist/currency-select.js +23 -0
  212. package/dist/currency-select.js.map +1 -0
  213. package/dist/data-table.d.ts +77 -0
  214. package/dist/data-table.js +30 -0
  215. package/dist/data-table.js.map +1 -0
  216. package/dist/deal-pipeline.d.ts +46 -0
  217. package/dist/deal-pipeline.js +25 -0
  218. package/dist/deal-pipeline.js.map +1 -0
  219. package/dist/document-signoff.d.ts +45 -0
  220. package/dist/document-signoff.js +21 -0
  221. package/dist/document-signoff.js.map +1 -0
  222. package/dist/evidence-list.d.ts +35 -0
  223. package/dist/evidence-list.js +21 -0
  224. package/dist/evidence-list.js.map +1 -0
  225. package/dist/exception-banner.d.ts +15 -0
  226. package/dist/exception-banner.js +10 -0
  227. package/dist/exception-banner.js.map +1 -0
  228. package/dist/expense-claim.d.ts +43 -0
  229. package/dist/expense-claim.js +31 -0
  230. package/dist/expense-claim.js.map +1 -0
  231. package/dist/financial-date-field.d.ts +27 -0
  232. package/dist/financial-date-field.js +17 -0
  233. package/dist/financial-date-field.js.map +1 -0
  234. package/dist/fixed-asset-register.d.ts +59 -0
  235. package/dist/fixed-asset-register.js +31 -0
  236. package/dist/fixed-asset-register.js.map +1 -0
  237. package/dist/forecast-chart.d.ts +38 -0
  238. package/dist/forecast-chart.js +19 -0
  239. package/dist/forecast-chart.js.map +1 -0
  240. package/dist/form-props-Ct7zeZBH.d.ts +25 -0
  241. package/dist/funnel-chart.d.ts +27 -0
  242. package/dist/funnel-chart.js +17 -0
  243. package/dist/funnel-chart.js.map +1 -0
  244. package/dist/iban-input.d.ts +27 -0
  245. package/dist/iban-input.js +16 -0
  246. package/dist/iban-input.js.map +1 -0
  247. package/dist/index.d.ts +644 -0
  248. package/dist/index.js +1082 -0
  249. package/dist/index.js.map +1 -0
  250. package/dist/invoice-editor.d.ts +38 -0
  251. package/dist/invoice-editor.js +26 -0
  252. package/dist/invoice-editor.js.map +1 -0
  253. package/dist/invoice-number-input.d.ts +25 -0
  254. package/dist/invoice-number-input.js +17 -0
  255. package/dist/invoice-number-input.js.map +1 -0
  256. package/dist/kpi-stat.d.ts +34 -0
  257. package/dist/kpi-stat.js +15 -0
  258. package/dist/kpi-stat.js.map +1 -0
  259. package/dist/ledger-table.d.ts +85 -0
  260. package/dist/ledger-table.js +41 -0
  261. package/dist/ledger-table.js.map +1 -0
  262. package/dist/locale.d.ts +22 -0
  263. package/dist/locale.js +13 -0
  264. package/dist/locale.js.map +1 -0
  265. package/dist/money-amount.d.ts +15 -0
  266. package/dist/money-amount.js +10 -0
  267. package/dist/money-amount.js.map +1 -0
  268. package/dist/organization-number-input.d.ts +25 -0
  269. package/dist/organization-number-input.js +17 -0
  270. package/dist/organization-number-input.js.map +1 -0
  271. package/dist/payment-batch.d.ts +58 -0
  272. package/dist/payment-batch.js +31 -0
  273. package/dist/payment-batch.js.map +1 -0
  274. package/dist/payment-confirm.d.ts +19 -0
  275. package/dist/payment-confirm.js +11 -0
  276. package/dist/payment-confirm.js.map +1 -0
  277. package/dist/payment-reference-input.d.ts +27 -0
  278. package/dist/payment-reference-input.js +17 -0
  279. package/dist/payment-reference-input.js.map +1 -0
  280. package/dist/period-lock.d.ts +28 -0
  281. package/dist/period-lock.js +18 -0
  282. package/dist/period-lock.js.map +1 -0
  283. package/dist/recurring-revenue.d.ts +37 -0
  284. package/dist/recurring-revenue.js +18 -0
  285. package/dist/recurring-revenue.js.map +1 -0
  286. package/dist/sca-prompt.d.ts +16 -0
  287. package/dist/sca-prompt.js +10 -0
  288. package/dist/sca-prompt.js.map +1 -0
  289. package/dist/sheet-stack.d.ts +34 -0
  290. package/dist/sheet-stack.js +20 -0
  291. package/dist/sheet-stack.js.map +1 -0
  292. package/dist/stage-duration.d.ts +33 -0
  293. package/dist/stage-duration.js +16 -0
  294. package/dist/stage-duration.js.map +1 -0
  295. package/dist/supplier-invoice-inbox.d.ts +66 -0
  296. package/dist/supplier-invoice-inbox.js +38 -0
  297. package/dist/supplier-invoice-inbox.js.map +1 -0
  298. package/dist/tax-code-select.d.ts +33 -0
  299. package/dist/tax-code-select.js +23 -0
  300. package/dist/tax-code-select.js.map +1 -0
  301. package/dist/text-link.d.ts +33 -0
  302. package/dist/text-link.js +13 -0
  303. package/dist/text-link.js.map +1 -0
  304. package/dist/toasts.d.ts +53 -0
  305. package/dist/toasts.js +17 -0
  306. package/dist/toasts.js.map +1 -0
  307. package/dist/trend-chart.d.ts +43 -0
  308. package/dist/trend-chart.js +19 -0
  309. package/dist/trend-chart.js.map +1 -0
  310. package/dist/vat-return.d.ts +54 -0
  311. package/dist/vat-return.js +23 -0
  312. package/dist/vat-return.js.map +1 -0
  313. package/dist/voucher-composer.d.ts +69 -0
  314. package/dist/voucher-composer.js +15 -0
  315. package/dist/voucher-composer.js.map +1 -0
  316. package/dist/voucher-lines.d.ts +11 -0
  317. package/dist/voucher-lines.js +10 -0
  318. package/dist/voucher-lines.js.map +1 -0
  319. package/docs/llms.txt +214 -0
  320. package/package.json +308 -3
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-booki-field.tsx","../src/use-booki-field-amount.ts","../src/use-booki-field-code.ts","../src/use-booki-field-date.ts","../src/index.ts"],"sourcesContent":["\"use client\";\n\nimport { BookiError } from \"@booki-aui/core/msg\";\nimport { type PrimitiveHandle, usePart, usePrimitive } from \"@ui-sdk/react/primitive\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport { bookiFieldAmount } from \"./use-booki-field-amount.js\";\nimport { bookiFieldCode, type BookiFieldCodeItem } from \"./use-booki-field-code.js\";\nimport { bookiFieldDate } from \"./use-booki-field-date.js\";\n\nexport { bookiFieldAmount, bookiFieldCode, bookiFieldDate };\n\n/**\n * Gives a field the product already has Booki's typed agent actions and rules,\n * without replacing it. The product's own input or select is what `render`\n * returns; the hook keeps the value, refuses what is not allowed, and tells the\n * agent what it may set.\n *\n * const field = useBookiField({ kind: \"code\", value, options, label: \"Kostnadssted\", onValueChange }, ({ value, change, refusal }) => (\n * <>\n * <select value={value} onChange={(e) => change(e.target.value, e.nativeEvent)}>…</select>\n * {refusal ? <p>{refusal}</p> : null}\n * </>\n * ))\n *\n * For an amount, keep what the person types as text and parse it with\n * `parseToMinor` from `@booki-aui/core/money`: the install guide has the example.\n *\n * A person's change calls `change(next, event)`, which is the same function the\n * agent's action calls: a refusal comes back as `false` and is shown as\n * `refusal`. `onValueChange` hears every change and its `details.source` is\n * `\"agent\"` for the agent's.\n */\n\ntype FieldDetails = { reason: string; source?: string };\n\ntype BookiFieldAmountBase = {\n kind: \"amount\";\n currency?: string;\n minMinor?: number;\n maxMinor?: number;\n label: string;\n disabled?: boolean;\n readOnly?: boolean;\n};\n\n/** An amount field that always holds an amount. */\nexport type BookiFieldAmountFilledArgs = BookiFieldAmountBase & {\n /** Integer minor units, like 12500 for 125.00 NOK. */\n value: number;\n allowEmpty?: false;\n onValueChange?: (minor: number, details: FieldDetails) => void;\n};\n\n/** An amount field that may be empty: the snapshot reads `minor: null`, and `setMinor(null)` empties it. */\nexport type BookiFieldAmountEmptyArgs = BookiFieldAmountBase & {\n /** Integer minor units, or `null` for empty. */\n value: number | null;\n allowEmpty: true;\n onValueChange?: (minor: number | null, details: FieldDetails) => void;\n};\n\nexport type BookiFieldAmountArgs = BookiFieldAmountFilledArgs | BookiFieldAmountEmptyArgs;\n\nexport type BookiFieldCodeArgs = {\n kind: \"code\";\n value: string;\n options: BookiFieldCodeItem[];\n /** The field may hold no code: `setCode(\"\")` or `setCode(null)` clears it to `\"\"`. */\n allowEmpty?: boolean;\n /** Values only a person may choose (a deal's won and lost stages): an agent's `setCode` to one is refused. */\n personOnly?: string[];\n onValueChange?: (code: string, details: FieldDetails) => void;\n label: string;\n disabled?: boolean;\n readOnly?: boolean;\n};\n\nexport type BookiFieldDateArgs = {\n kind: \"date\";\n /** ISO `YYYY-MM-DD`, or `\"\"` for none. */\n value: string;\n onValueChange?: (date: string, details: FieldDetails) => void;\n label: string;\n disabled?: boolean;\n readOnly?: boolean;\n};\n\nexport type BookiFieldArgs = BookiFieldAmountArgs | BookiFieldCodeArgs | BookiFieldDateArgs;\n\nexport type BookiFieldRender<T> = {\n /** The value the field holds. */\n value: T;\n /** A person's change: returns false, and sets `refusal`, when it is not allowed. */\n change: (next: T, event?: Event) => boolean;\n /** The sentence for why the last change was refused, or null. Show it next to the field. */\n refusal: string | null;\n};\n\ntype RootState = { minor: number | null; code: string; date: string; refusal: string | null };\n\ntype Api = {\n setMinor: (minor: unknown, event?: Event) => boolean;\n setCode: (code: unknown, event?: Event) => boolean;\n setDate: (date: unknown, event?: Event) => boolean;\n showRefusal: (message: string | null) => void;\n};\n\n/**\n * A field the product already has, with Booki's agent actions and rules. `render`\n * returns the product's own field; `change` and `refusal` are what it needs.\n */\nexport function useBookiField(\n options: BookiFieldAmountEmptyArgs,\n render: (field: BookiFieldRender<number | null>) => ReactNode,\n): ReactElement;\nexport function useBookiField(\n options: BookiFieldAmountFilledArgs,\n render: (field: BookiFieldRender<number>) => ReactNode,\n): ReactElement;\nexport function useBookiField(\n options: BookiFieldCodeArgs,\n render: (field: BookiFieldRender<string>) => ReactNode,\n): ReactElement;\nexport function useBookiField(\n options: BookiFieldDateArgs,\n render: (field: BookiFieldRender<string>) => ReactNode,\n): ReactElement;\nexport function useBookiField(options: BookiFieldArgs, render: (field: never) => ReactNode): ReactElement {\n // One usePrimitive call: the definition is chosen by kind, not the hooks.\n const definition =\n options.kind === \"amount\" ? bookiFieldAmount : options.kind === \"code\" ? bookiFieldCode : bookiFieldDate;\n const handle = usePrimitive(definition as never, primitiveOptions(options) as never) as unknown as PrimitiveHandle<\n typeof bookiFieldAmount\n > & { api: Api };\n const api = handle.api;\n\n const change = (next: unknown, event?: Event): boolean => {\n const write = options.kind === \"amount\" ? api.setMinor : options.kind === \"code\" ? api.setCode : api.setDate;\n try {\n write(next, event);\n } catch (error) {\n if (!(error instanceof BookiError)) throw error;\n api.showRefusal(error.message);\n return false;\n }\n api.showRefusal(null);\n return true;\n };\n\n // The root's state is the amount's, the code's or the date's, by kind: each\n // reads only its own key.\n const part = {\n \"aria-label\": options.label,\n children: (state: object) => {\n const shown = state as RootState;\n return render({\n value: options.kind === \"amount\" ? shown.minor : options.kind === \"code\" ? shown.code : shown.date,\n change,\n refusal: shown.refusal,\n } as never);\n },\n };\n return usePart(handle, \"root\", {}, part, \"div\") as ReactElement;\n}\n\n/** The options the definition takes: the arguments without `kind` and `label`. */\nfunction primitiveOptions(options: BookiFieldArgs): Record<string, unknown> {\n const { kind: _kind, label: _label, ...rest } = options;\n return rest;\n}\n","import { BookiError } from \"@booki-aui/core/msg\";\nimport { rangeError } from \"@booki-aui/primitives/amount-field\";\nimport { lockOptions, lockState } from \"@booki-aui/primitives/lock\";\nimport { createChange, definePrimitive, dispatch } from \"@ui-sdk/core\";\n\n/**\n * The amount kind of `useBookiField`: a field the product already has, held\n * as integer minor units. Its snapshot key is `minor`, so no number can be\n * read as major units. One definition per file: the contract and ergonomics\n * tests read each file's first `actions` and `controlled` lists.\n *\n * Renders as `<div role=\"group\" data-slot=\"field-amount\">`.\n */\n\nexport type BookiFieldAmountOptions = {\n /** Integer minor units; `null` is empty, with `allowEmpty`. */\n value?: number | null;\n /** The field may hold no amount: the snapshot reads `minor: null`, and `setMinor(null)` empties it. */\n allowEmpty?: boolean;\n currency?: string;\n minMinor?: number;\n maxMinor?: number;\n disabled?: boolean;\n readOnly?: boolean;\n onValueChange?: (minor: number | null, details: { reason: string; source?: string }) => void;\n};\n\nexport type BookiFieldAmountState = {\n /** Minor units, or null while the field is empty (with `allowEmpty`). */\n minor: number | null;\n allowEmpty: boolean;\n currency: string;\n minMinor: number;\n maxMinor: number | undefined;\n refusal: string | null;\n disabled: boolean;\n readOnly: boolean;\n};\n\nexport const bookiFieldAmount = definePrimitive({\n name: \"field-amount\",\n options: {\n value: \"number\",\n currency: \"string\",\n minMinor: \"number\",\n maxMinor: \"number\",\n allowEmpty: \"boolean\",\n ...lockOptions,\n onValueChange: \"callback\",\n },\n // The product owns the value: the snapshot shows these, the product sets them.\n controlled: [\"minor\", \"currency\", \"refusal\"],\n state: (options: BookiFieldAmountOptions): BookiFieldAmountState => ({\n minor: options.value ?? (options.allowEmpty ? null : 0),\n allowEmpty: options.allowEmpty ?? false,\n currency: options.currency ?? \"NOK\",\n minMinor: options.minMinor ?? 0,\n maxMinor: options.maxMinor,\n refusal: null,\n ...lockState(options),\n }),\n sync: (options: BookiFieldAmountOptions): Partial<BookiFieldAmountState> => {\n const next: Partial<BookiFieldAmountState> = { ...lockState(options) };\n if (options.allowEmpty !== undefined) next.allowEmpty = options.allowEmpty;\n if (options.value !== undefined) next.minor = options.value === null && !options.allowEmpty ? 0 : options.value;\n if (options.currency !== undefined) next.currency = options.currency;\n if (options.minMinor !== undefined) next.minMinor = options.minMinor;\n if (options.maxMinor !== undefined) next.maxMinor = options.maxMinor;\n return next;\n },\n api: (context) => {\n const change = createChange(context);\n\n function commit(next: number | null, reason: string, event?: Event): boolean {\n const { minor } = context.store.get();\n if (next === minor) return false;\n // The product hears the change first and may cancel it.\n if (dispatch(context, \"onValueChange\", next, { reason, event })) return false;\n const ok = change(\"minor\", next, { reason, event });\n if (ok) {\n // Controlled: the product passes the value back through sync; until it\n // does, the field keeps the value it holds.\n if (context.options().value !== undefined) context.store.set({ minor });\n }\n return ok;\n }\n\n return {\n /** Agent and product path: integer minor units. Throws a sentence that says what is allowed. */\n setMinor: (minor: unknown, event?: Event): boolean => {\n const { currency, minMinor, maxMinor, allowEmpty } = context.store.get();\n // No amount: only where the field may be empty.\n if (allowEmpty && (minor === null || (typeof minor === \"string\" && minor.trim() === \"\"))) {\n return commit(null, \"clear\", event);\n }\n const n = typeof minor === \"string\" && /^\\s*-?\\d+\\s*$/.test(minor) ? Number(minor) : minor;\n if (typeof n !== \"number\" || !Number.isSafeInteger(n)) {\n throw new BookiError(\"amount.not-minor\", {\n currency,\n value: typeof minor === \"string\" ? JSON.stringify(minor) : String(minor),\n });\n }\n if (rangeError(n, minMinor, maxMinor)) {\n if (n < minMinor) throw new BookiError(\"amount.below-min\", { minor: n, min: minMinor });\n throw new BookiError(\"amount.above-max\", { minor: n, max: maxMinor ?? \"\" });\n }\n return commit(n, \"set-minor\", event);\n },\n showRefusal: (message: string | null) => context.store.set({ refusal: message }),\n };\n },\n slots: (slot) => ({\n root: slot({\n role: \"group\",\n attrs: (state) => ({\n \"data-slot\": \"field-amount\",\n \"data-disabled\": state.disabled ? \"\" : undefined,\n \"data-readonly\": state.readOnly ? \"\" : undefined,\n }),\n state: (state) => ({ minor: state.minor, refusal: state.refusal }),\n }),\n }),\n agent: { actions: [\"setMinor\"] },\n});\n","import { closest, LISTED_WHOLE } from \"@booki-aui/core/closest\";\nimport { BookiError } from \"@booki-aui/core/msg\";\nimport { lockOptions, lockState } from \"@booki-aui/primitives/lock\";\nimport { createChange, definePrimitive, dispatch } from \"@ui-sdk/core\";\n\n/**\n * The code kind of `useBookiField`: a select the product already has, whose\n * value is one of a closed list. The snapshot lists the items of a short list\n * and none of a long one; `query({ within })` searches all of them.\n *\n * The list helpers are those of `@booki-aui/primitives/offered` (`shownItems`,\n * `itemsHint`, `refuseUnknown`). That module has no subpath export, so they\n * are written out here from the same `@booki-aui/core/closest` helpers.\n *\n * Renders as `<div role=\"group\" data-slot=\"field-code\">`.\n */\n\nexport type BookiFieldCodeItem = { value: string; label: string };\n\nexport type BookiFieldCodeOptions = {\n value?: string;\n options?: BookiFieldCodeItem[];\n /** The field may hold no code: `setCode(\"\")` or `setCode(null)` clears it. */\n allowEmpty?: boolean;\n /**\n * Values only a person may choose, such as a deal's won and lost stages. An\n * agent's `setCode` to one of them is refused; a person's change (with its\n * DOM event) goes through.\n */\n personOnly?: string[];\n disabled?: boolean;\n readOnly?: boolean;\n onValueChange?: (code: string, details: { reason: string; source?: string }) => void;\n};\n\nexport type BookiFieldCodeState = {\n code: string;\n /** Every item, which the agent's `query` searches. */\n options: BookiFieldCodeItem[];\n /** The items the snapshot shows: all of a short list, none of a long one. */\n items: BookiFieldCodeItem[];\n itemsHint: string;\n allowEmpty: boolean;\n /** The values only a person may choose. */\n personOnly: string[];\n refusal: string | null;\n disabled: boolean;\n readOnly: boolean;\n};\n\nconst shownItems = (items: BookiFieldCodeItem[]): BookiFieldCodeItem[] => (items.length <= LISTED_WHOLE ? items : []);\n\nconst itemsHint = (items: BookiFieldCodeItem[]): string =>\n items.length <= LISTED_WHOLE\n ? \"\"\n : `${items.length} items, not listed here: query({ within: <this ref>, text: \"a code or a whole word\" }) finds one; without text it lists 50 at a time, and from: 50 reads the next 50.`;\n\n/** How an option is named in a refusal: the value `setCode` takes, then its label when that differs. */\nconst named = (item: BookiFieldCodeItem): string =>\n item.label === item.value ? item.value : `${item.value} (${item.label})`;\n\n/** The option a value names: its `value` exactly, else its label in any case. */\nfunction optionFor(items: BookiFieldCodeItem[], raw: unknown): BookiFieldCodeItem | undefined {\n if (typeof raw !== \"string\") return undefined;\n const byValue = items.find((item) => item.value === raw);\n if (byValue) return byValue;\n const wanted = raw.trim().toLowerCase();\n const byLabel = items.filter((item) => item.label.trim().toLowerCase() === wanted);\n // Two options with the same label: the label names neither.\n return byLabel.length === 1 ? byLabel[0] : undefined;\n}\n\n/** Throws the refusal for a value the list lacks: every option of a short list, the nearest of a long one. */\nfunction refuseUnknown(items: BookiFieldCodeItem[], raw: unknown): never {\n const value = String(raw).slice(0, 80);\n if (items.length <= LISTED_WHOLE) {\n throw new BookiError(\"field.unknown-code\", {\n value,\n items: items.map(named).join(\", \") || \"(none)\",\n });\n }\n const near = closest(items, raw, (item) => item.label, 8);\n throw new BookiError(\"field.unknown-code-more\", {\n value,\n items: near.map(named).join(\", \"),\n count: items.length,\n });\n}\n\nexport const bookiFieldCode = definePrimitive({\n name: \"field-code\",\n options: {\n value: \"string\",\n options: \"value\",\n allowEmpty: \"boolean\",\n personOnly: \"value\",\n ...lockOptions,\n onValueChange: \"callback\",\n },\n controlled: [\"code\", \"items\", \"itemsHint\", \"personOnly\", \"refusal\"],\n state: (options: BookiFieldCodeOptions): BookiFieldCodeState => {\n const all = options.options ?? [];\n return {\n code: options.value ?? \"\",\n options: all,\n items: shownItems(all),\n itemsHint: itemsHint(all),\n allowEmpty: options.allowEmpty ?? false,\n personOnly: options.personOnly ?? [],\n refusal: null,\n ...lockState(options),\n };\n },\n sync: (options: BookiFieldCodeOptions): Partial<BookiFieldCodeState> => {\n const next: Partial<BookiFieldCodeState> = { ...lockState(options) };\n if (options.allowEmpty !== undefined) next.allowEmpty = options.allowEmpty;\n if (options.personOnly !== undefined) next.personOnly = options.personOnly;\n if (options.value !== undefined) next.code = options.value;\n if (options.options !== undefined) {\n next.options = options.options;\n next.items = shownItems(options.options);\n next.itemsHint = itemsHint(options.options);\n }\n return next;\n },\n api: (context) => {\n const change = createChange(context);\n\n function commit(next: string, reason: string, event?: Event): boolean {\n const { code } = context.store.get();\n if (next === code) return false;\n // The product hears the change first and may cancel it.\n if (dispatch(context, \"onValueChange\", next, { reason, event })) return false;\n const ok = change(\"code\", next, { reason, event });\n // Controlled: the product passes the value back through sync; until it\n // does, the field keeps the value it holds.\n if (ok && context.options().value !== undefined) context.store.set({ code });\n return ok;\n }\n\n return {\n /**\n * Agent and product path: one of the options, by its `value` or its label (any case).\n * With `allowEmpty`, \"\" or null clears it. Throws a sentence that lists each option as `value (label)`.\n * A value in `personOnly` is refused unless the call carries a person's DOM event.\n */\n setCode: (code: string | null, event?: Event): boolean => {\n const { options, allowEmpty } = context.store.get();\n if (allowEmpty && (code === null || code === \"\")) return commit(\"\", \"clear\", event);\n const option = optionFor(options, code);\n if (!option) refuseUnknown(options, code);\n // An agent's call carries no DOM event; a person's change does.\n const fromPerson = typeof Event !== \"undefined\" && event instanceof Event;\n if (!fromPerson && context.store.get().personOnly.includes(option.value)) {\n throw new BookiError(\"field.person-only-code\", { item: named(option) });\n }\n return commit(option.value, \"set-code\", event);\n },\n items: (): BookiFieldCodeItem[] => context.store.get().options,\n showRefusal: (message: string | null) => context.store.set({ refusal: message }),\n };\n },\n slots: (slot) => ({\n root: slot({\n role: \"group\",\n attrs: (state) => ({\n \"data-slot\": \"field-code\",\n \"data-disabled\": state.disabled ? \"\" : undefined,\n \"data-readonly\": state.readOnly ? \"\" : undefined,\n }),\n state: (state) => ({ code: state.code, refusal: state.refusal }),\n }),\n }),\n agent: { actions: [\"setCode\"], items: (api) => api.items() },\n});\n","import { BookiError } from \"@booki-aui/core/msg\";\nimport { lockOptions, lockState } from \"@booki-aui/primitives/lock\";\nimport { createChange, definePrimitive, dispatch } from \"@ui-sdk/core\";\n\n/**\n * The date kind of `useBookiField`: a date field the product already has,\n * held as an ISO `YYYY-MM-DD` string.\n *\n * `isIsoDate` is that of `@booki-aui/core/iso-date`, which has no subpath export,\n * so it is written out here: a date must match the pattern and read back the\n * same, so \"2026-02-30\" is refused.\n *\n * Renders as `<div role=\"group\" data-slot=\"field-date\">`.\n */\n\nexport type BookiFieldDateOptions = {\n value?: string;\n disabled?: boolean;\n readOnly?: boolean;\n onValueChange?: (date: string, details: { reason: string; source?: string }) => void;\n};\n\nexport type BookiFieldDateState = {\n date: string;\n refusal: string | null;\n disabled: boolean;\n readOnly: boolean;\n};\n\nfunction isIsoDate(value: unknown): value is string {\n if (typeof value !== \"string\" || !/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return false;\n const time = Date.parse(`${value}T00:00:00Z`);\n return !Number.isNaN(time) && new Date(time).toISOString().slice(0, 10) === value;\n}\n\nexport const bookiFieldDate = definePrimitive({\n name: \"field-date\",\n options: {\n value: \"string\",\n ...lockOptions,\n onValueChange: \"callback\",\n },\n controlled: [\"date\", \"refusal\"],\n state: (options: BookiFieldDateOptions): BookiFieldDateState => ({\n date: options.value ?? \"\",\n refusal: null,\n ...lockState(options),\n }),\n sync: (options: BookiFieldDateOptions): Partial<BookiFieldDateState> => {\n const next: Partial<BookiFieldDateState> = { ...lockState(options) };\n if (options.value !== undefined) next.date = options.value;\n return next;\n },\n api: (context) => {\n const change = createChange(context);\n\n function commit(next: string, reason: string, event?: Event): boolean {\n const { date } = context.store.get();\n if (next === date) return false;\n // The product hears the change first and may cancel it.\n if (dispatch(context, \"onValueChange\", next, { reason, event })) return false;\n const ok = change(\"date\", next, { reason, event });\n // Controlled: the product passes the value back through sync; until it\n // does, the field keeps the value it holds.\n if (ok && context.options().value !== undefined) context.store.set({ date });\n return ok;\n }\n\n return {\n /** Agent and product path: an ISO date that exists. Throws a sentence that says the format. */\n setDate: (value: string, event?: Event): boolean => {\n if (!isIsoDate(value)) throw new BookiError(\"date.invalid\", { value: String(value).slice(0, 80) });\n return commit(value, \"set-date\", event);\n },\n showRefusal: (message: string | null) => context.store.set({ refusal: message }),\n };\n },\n slots: (slot) => ({\n root: slot({\n role: \"group\",\n attrs: (state) => ({\n \"data-slot\": \"field-date\",\n \"data-disabled\": state.disabled ? \"\" : undefined,\n \"data-readonly\": state.readOnly ? \"\" : undefined,\n }),\n state: (state) => ({ date: state.date, refusal: state.refusal }),\n }),\n }),\n agent: { actions: [\"setDate\"] },\n});\n","export {\n BookiLocaleProvider,\n useBookiLocale,\n useBookiLocaleOptional,\n type BookiLocaleContextValue,\n type BookiLocaleProviderProps,\n} from \"./locale.js\";\nexport { MoneyAmount, type MoneyAmountProps } from \"./money-amount.js\";\nexport { DocsIcon, GitHubIcon, TextLink, type TextLinkProps } from \"./text-link.js\";\nexport {\n AmountField,\n AmountFieldCurrency,\n AmountFieldInput,\n AmountFieldRoot,\n amountField,\n type AmountFieldProps,\n} from \"./amount-field.js\";\nexport { AmountInput, type AmountInputProps } from \"./amount-input.js\";\nexport {\n CurrencySelect,\n CurrencySelectRoot,\n CurrencySelectTrigger,\n CurrencySelectList,\n CurrencySelectOption,\n CurrencySelectControl,\n currencySelect,\n type CurrencySelectProps,\n} from \"./currency-select.js\";\nexport {\n BankAccountInput,\n BankAccountRoot,\n bankAccount,\n type BankAccountInputProps,\n type BankAccountValue,\n} from \"./bank-account-input.js\";\nexport {\n PaymentReferenceInput,\n PaymentReferenceRoot,\n paymentReference,\n type PaymentReferenceInputProps,\n} from \"./payment-reference-input.js\";\nexport {\n OrganizationNumberInput,\n OrganizationNumberRoot,\n organizationNumber,\n type OrganizationNumberInputProps,\n} from \"./organization-number-input.js\";\nexport {\n IbanInput,\n IbanRoot,\n ibanInput,\n type IbanInputProps,\n} from \"./iban-input.js\";\nexport {\n FinancialDateField,\n FinancialDateRoot,\n financialDate,\n type FinancialDateFieldProps,\n} from \"./financial-date-field.js\";\nexport {\n AccountingPeriodSelect,\n AccountingPeriodRoot,\n AccountingPeriodTrigger,\n AccountingPeriodList,\n AccountingPeriodOption,\n AccountingPeriodControl,\n accountingPeriod,\n type AccountingPeriodSelectProps,\n} from \"./accounting-period-select.js\";\nexport {\n InvoiceNumberInput,\n InvoiceNumberRoot,\n invoiceNumber,\n type InvoiceNumberInputProps,\n} from \"./invoice-number-input.js\";\nexport {\n AttestationStatus,\n AttestationStatusRoot,\n attestationStatus,\n type AttestationStatusProps,\n type AttestationStatusValue,\n} from \"./attestation-status.js\";\nexport type { BookiFormProps } from \"./form-props.js\";\nexport {\n VoucherLines,\n type VoucherLinesProps,\n type VoucherLine,\n} from \"./voucher-lines.js\";\nexport {\n VoucherComposer,\n VoucherComposerRoot,\n voucherComposer,\n type VoucherComposerProps,\n type VoucherRowError,\n type AccountOption,\n type DimensionOption,\n} from \"./voucher-composer.js\";\nexport {\n BankReconciliation,\n BankReconciliationApprove,\n BankReconciliationMatch,\n BankReconciliationReject,\n BankReconciliationRoot,\n bankReconciliation,\n type BankLine,\n type BankReconciliationProps,\n type OpenPost,\n type ReconciliationMatch,\n} from \"./bank-reconciliation.js\";\nexport {\n AccountPicker,\n AccountPickerRoot,\n AccountPickerInput,\n AccountPickerList,\n AccountPickerOption,\n AccountPickerEmpty,\n AccountPickerControl,\n accountPicker,\n type AccountPickerProps,\n} from \"./account-picker.js\";\nexport {\n TaxCodeSelect,\n TaxCodeSelectRoot,\n TaxCodeSelectTrigger,\n TaxCodeSelectList,\n TaxCodeSelectOption,\n TaxCodeSelectControl,\n taxCodeSelect,\n type TaxCodeSelectProps,\n} from \"./tax-code-select.js\";\nexport {\n PaymentConfirm,\n type PaymentConfirmProps,\n} from \"./payment-confirm.js\";\nexport { ScaPrompt, type ScaPromptProps } from \"./sca-prompt.js\";\nexport { ApprovalGate, type ApprovalGateProps } from \"./approval-gate.js\";\nexport {\n ExceptionBanner,\n type ExceptionBannerProps,\n} from \"./exception-banner.js\";\nexport {\n AuditTrail,\n type AuditEvent,\n type AuditTrailProps,\n} from \"./audit-trail.js\";\nexport { CountryToggle, type CountryToggleProps } from \"./country-toggle.js\";\nexport {\n attachAudit,\n createBookiAgent,\n createBookiHistory,\n BOOKI_HISTORY_KEYS,\n createHistory,\n describeEntry,\n isHistoryRestoring,\n proposeChanges,\n registerTools,\n stageChanges,\n type AgentBridge,\n type AttachAuditOptions,\n type BookiHistoryOptions,\n type AttachAuditPush,\n type AgentDecision,\n type CreateBookiAgentOptions,\n type RegisterToolsOptions,\n} from \"./booki-agent.js\";\nexport {\n AgentPresence,\n AgentProposal,\n attachAgentPresence,\n useAgentProposal,\n type AgentActivity,\n type AgentPresenceController,\n type AgentPresenceProps,\n type AgentProposalProps,\n type ProposedChange,\n} from \"./agent-presence.js\";\nexport {\n AgentCursor,\n narrateNorwegian,\n createAgentCursor,\n type AgentCursorController,\n type AgentCursorOptions,\n type AgentCursorPhase,\n type AgentCursorProps,\n type AgentCursorState,\n type AgentCursorStep,\n} from \"./agent-cursor.js\";\nexport {\n ApprovalChain,\n ApprovalChainApprove,\n ApprovalChainEscalate,\n ApprovalChainReject,\n ApprovalChainRoot,\n approvalChain,\n type ApprovalChainProps,\n type ApprovalDecision,\n type ApprovalLevel,\n type ApprovalRequest,\n} from \"./approval-chain.js\";\nexport {\n PeriodLock,\n PeriodLockRoot,\n PeriodLockSet,\n periodLock,\n type PeriodLockProps,\n type PeriodState,\n type PeriodStatus,\n} from \"./period-lock.js\";\nexport {\n CloseChecklist,\n CloseChecklistComplete,\n CloseChecklistReopen,\n CloseChecklistRoot,\n CloseChecklistSignOff,\n closeChecklist,\n type CloseChecklistProps,\n type CloseTask,\n} from \"./close-checklist.js\";\nexport {\n InvoiceEditor,\n InvoiceEditorAdd,\n InvoiceEditorCell,\n InvoiceEditorFinalize,\n InvoiceEditorRemove,\n InvoiceEditorRoot,\n InvoiceEditorTax,\n invoiceEditor,\n type Invoice,\n type InvoiceEditorProps,\n type InvoiceLine,\n type InvoiceLinePatch,\n type TaxCategory,\n} from \"./invoice-editor.js\";\nexport {\n PaymentBatch,\n PaymentBatchApprove,\n PaymentBatchRelease,\n PaymentBatchRemove,\n PaymentBatchRoot,\n paymentBatch,\n type PaymentBatchData,\n type PaymentBatchProps,\n type PaymentItem,\n type PaymentSummary,\n} from \"./payment-batch.js\";\nexport {\n BookiAccessProvider,\n useBookiAccess,\n type BookiAccess,\n type BookiAccessProviderProps,\n type Actor,\n type Deed,\n type DutyRule,\n type Entity,\n type Permission,\n type Role,\n} from \"./access.js\";\nexport * from \"./supplier-invoice-inbox.js\";\nexport * from \"./evidence-list.js\";\nexport * from \"./expense-claim.js\";\nexport * from \"./ledger-table.js\";\nexport * from \"./aged-balances.js\";\nexport * from \"./vat-return.js\";\nexport * from \"./audit-workpaper.js\";\nexport * from \"./audit-findings.js\";\nexport * from \"./document-signoff.js\";\nexport * from \"./sheet-stack.js\";\nexport * from \"./confirm-dialog.js\";\nexport * from \"./toasts.js\";\nexport * from \"./client-requests.js\";\nexport * from \"./deal-pipeline.js\";\nexport * from \"./activity-timeline.js\";\nexport * from \"./funnel-chart.js\";\nexport * from \"./forecast-chart.js\";\nexport * from \"./recurring-revenue.js\";\nexport * from \"./stage-duration.js\";\nexport * from \"./fixed-asset-register.js\";\nexport * from \"./data-table.js\";\nexport * from \"./trend-chart.js\";\nexport * from \"./bar-chart.js\";\nexport * from \"./kpi-stat.js\";\nexport * from \"./aging-chart.js\";\nexport * from \"./cashflow-waterfall.js\";\nexport * from \"./use-booki-field.js\";\n\n/**\n * Wrap a component of your own so the agent operates it like Booki's controls:\n * named actions, declared state, and a person's click reported as theirs.\n */\nexport { createChange, definePrimitive } from \"@ui-sdk/core\";\nexport {\n createParts,\n usePart,\n usePrimitive,\n type PartProps,\n type Parts,\n type PrimitiveHandle,\n} from \"@ui-sdk/react/primitive\";\nexport {\n type AgentDecisionRow,\n type AgentPolicyOptions,\n actAndRecord,\n withRecordedAct,\n isAllowed,\n} from \"@booki-aui/primitives/agent-policy\";\nexport type { BookiChangeDetails } from \"./change-details.js\";\nexport { personOnly } from \"@booki-aui/primitives/person-only\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAAA,EACA;AAAA,OACK;AAEP,SAAS,kBAAkB;","names":["BookiError","BookiError","lockOptions","lockState","createChange","definePrimitive","dispatch","BookiError","lockOptions","lockState","createChange","definePrimitive","dispatch","BookiError","createChange","definePrimitive","usePart","usePrimitive"]}
@@ -0,0 +1,38 @@
1
+ import * as react from 'react';
2
+ import { Invoice } from '@booki-aui/core/invoice';
3
+ export { Invoice, InvoiceLine, TaxCategory } from '@booki-aui/core/invoice';
4
+ import { B as BookiChangeDetails } from './change-details-CWpEgc80.js';
5
+ import { Parts } from '@ui-sdk/react/primitive';
6
+ import { invoiceEditor } from '@booki-aui/primitives/invoice-editor';
7
+ export { InvoiceLinePatch, invoiceEditor } from '@booki-aui/primitives/invoice-editor';
8
+
9
+ declare const TAGS: {
10
+ readonly root: "div";
11
+ readonly cell: "input";
12
+ readonly tax: "select";
13
+ readonly add: "button";
14
+ readonly remove: "button";
15
+ readonly finalize: "button";
16
+ };
17
+ declare const parts: Parts<typeof invoiceEditor, typeof TAGS>;
18
+ declare const InvoiceEditorRoot: (typeof parts)["Root"];
19
+ declare const InvoiceEditorCell: (typeof parts)["Cell"];
20
+ declare const InvoiceEditorTax: (typeof parts)["Tax"];
21
+ declare const InvoiceEditorAdd: (typeof parts)["Add"];
22
+ declare const InvoiceEditorRemove: (typeof parts)["Remove"];
23
+ declare const InvoiceEditorFinalize: (typeof parts)["Finalize"];
24
+ type InvoiceEditorProps = {
25
+ invoice?: Invoice;
26
+ defaultInvoice?: Invoice;
27
+ others?: Invoice[];
28
+ nextNumber?: string;
29
+ onInvoiceChange?: (invoice: Invoice, details: BookiChangeDetails) => void;
30
+ /** Tax rates offered for category S, in basis points. Defaults to the profile's codes. */
31
+ taxRatesBp?: number[];
32
+ className?: string;
33
+ "aria-label"?: string;
34
+ };
35
+ /** Composed invoice: editable lines while it is a draft, totals per tax group, and Finalize. */
36
+ declare function InvoiceEditor({ invoice, defaultInvoice, others, nextNumber, onInvoiceChange, taxRatesBp, className, "aria-label": ariaLabel, }: InvoiceEditorProps): react.JSX.Element;
37
+
38
+ export { InvoiceEditor, InvoiceEditorAdd, InvoiceEditorCell, InvoiceEditorFinalize, type InvoiceEditorProps, InvoiceEditorRemove, InvoiceEditorRoot, InvoiceEditorTax };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import {
3
+ InvoiceEditor,
4
+ InvoiceEditorAdd,
5
+ InvoiceEditorCell,
6
+ InvoiceEditorFinalize,
7
+ InvoiceEditorRemove,
8
+ InvoiceEditorRoot,
9
+ InvoiceEditorTax,
10
+ invoiceEditor
11
+ } from "./chunk-YBMO3W5O.js";
12
+ import "./chunk-U7NPK4WO.js";
13
+ import "./chunk-K72VT6RJ.js";
14
+ import "./chunk-GVP2N3K6.js";
15
+ import "./chunk-HKYEHBQT.js";
16
+ export {
17
+ InvoiceEditor,
18
+ InvoiceEditorAdd,
19
+ InvoiceEditorCell,
20
+ InvoiceEditorFinalize,
21
+ InvoiceEditorRemove,
22
+ InvoiceEditorRoot,
23
+ InvoiceEditorTax,
24
+ invoiceEditor
25
+ };
26
+ //# sourceMappingURL=invoice-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,25 @@
1
+ import * as react from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import { Parts } from '@ui-sdk/react/primitive';
4
+ import { B as BookiFormProps } from './form-props-Ct7zeZBH.js';
5
+ import { invoiceNumber } from '@booki-aui/primitives/invoice-number-input';
6
+ export { invoiceNumber } from '@booki-aui/primitives/invoice-number-input';
7
+
8
+ declare const TAGS: {
9
+ readonly root: "div";
10
+ readonly input: "input";
11
+ };
12
+ declare const parts: Parts<typeof invoiceNumber, typeof TAGS>;
13
+ declare const InvoiceNumberRoot: (typeof parts)["Root"];
14
+ declare const InvoiceNumberField: (typeof parts)["Input"];
15
+ type InvoiceNumberInputProps = {
16
+ /** Controlled value. Omit it (and use `defaultValue`) to let the field hold its own state. */
17
+ value?: string;
18
+ defaultValue?: string;
19
+ onValueChange?: (value: string) => void;
20
+ required?: boolean;
21
+ className?: string;
22
+ } & Omit<BookiFormProps, "required"> & Omit<ComponentProps<"div">, "onChange" | "defaultValue" | "children" | "id">;
23
+ declare function InvoiceNumberInput({ value, defaultValue, onValueChange, required, name, id, disabled, readOnly, className, ...props }: InvoiceNumberInputProps): react.JSX.Element;
24
+
25
+ export { InvoiceNumberField, InvoiceNumberInput, type InvoiceNumberInputProps, InvoiceNumberRoot };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import {
3
+ InvoiceNumberField,
4
+ InvoiceNumberInput,
5
+ InvoiceNumberRoot,
6
+ invoiceNumber
7
+ } from "./chunk-WS2YJSNS.js";
8
+ import "./chunk-OYERLEER.js";
9
+ import "./chunk-GVP2N3K6.js";
10
+ import "./chunk-HKYEHBQT.js";
11
+ export {
12
+ InvoiceNumberField,
13
+ InvoiceNumberInput,
14
+ InvoiceNumberRoot,
15
+ invoiceNumber
16
+ };
17
+ //# sourceMappingURL=invoice-number-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,34 @@
1
+ import * as react from 'react';
2
+ import { Parts } from '@ui-sdk/react/primitive';
3
+ import { PeriodValue } from '@booki-aui/primitives/chart-math';
4
+ import { KpiGood, kpiStat } from '@booki-aui/primitives/kpi-stat';
5
+ export { KpiGood, kpiStat } from '@booki-aui/primitives/kpi-stat';
6
+
7
+ declare const TAGS: {
8
+ readonly root: "div";
9
+ };
10
+ declare const parts: Parts<typeof kpiStat, typeof TAGS>;
11
+ declare const KpiStatRoot: (typeof parts)["Root"];
12
+ type KpiStatProps = {
13
+ label: string;
14
+ /** Undefined or null shows "Not set". */
15
+ valueMinor?: number | null;
16
+ previousMinor?: number | null;
17
+ /** Defaults to the locale profile's currency. */
18
+ currency?: string;
19
+ /** What the comparison is against: "Feb 2026", "last year". */
20
+ previousLabel?: string;
21
+ /** Which way is good news. Defaults to "up"; use "down" for costs. */
22
+ good?: KpiGood;
23
+ /** A short series for the sparkline, oldest first. */
24
+ series?: PeriodValue[];
25
+ /** Show "No comparison" when there is no previous value. Default false: the line is left out. */
26
+ showNoComparison?: boolean;
27
+ /** Show whole amounts without ",00". Default true: a figure, not a ledger line. */
28
+ trimZeroFraction?: boolean;
29
+ className?: string;
30
+ };
31
+ /** Composed figure: the label, the value, the change against before and a sparkline. */
32
+ declare function KpiStat({ label, valueMinor, previousMinor, currency, previousLabel, good, series, showNoComparison, trimZeroFraction, className, }: KpiStatProps): react.JSX.Element;
33
+
34
+ export { KpiStat, type KpiStatProps, KpiStatRoot };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import {
3
+ KpiStat,
4
+ KpiStatRoot,
5
+ kpiStat
6
+ } from "./chunk-6HWFMC7V.js";
7
+ import "./chunk-WDME4U42.js";
8
+ import "./chunk-GVP2N3K6.js";
9
+ import "./chunk-HKYEHBQT.js";
10
+ export {
11
+ KpiStat,
12
+ KpiStatRoot,
13
+ kpiStat
14
+ };
15
+ //# sourceMappingURL=kpi-stat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,85 @@
1
+ import * as react from 'react';
2
+ import { LedgerEntry } from '@booki-aui/core/ledger';
3
+ export { LedgerEntry } from '@booki-aui/core/ledger';
4
+ import { TableQuery } from '@booki-aui/core/table';
5
+ import { Parts } from '@ui-sdk/react/primitive';
6
+ import { LedgerVoucherRef, Details, LedgerDocument, ledgerTable } from '@booki-aui/primitives/ledger-table';
7
+ export { LedgerDocument, LedgerView, LedgerVoucherRef, LedgerVoucherSummary, ledgerTable } from '@booki-aui/primitives/ledger-table';
8
+
9
+ declare const TAGS: {
10
+ readonly root: "div";
11
+ readonly from: "input";
12
+ readonly to: "input";
13
+ readonly list: "div";
14
+ readonly row: "div";
15
+ readonly back: "button";
16
+ readonly voucher: "button";
17
+ readonly lineaccount: "button";
18
+ readonly document: "button";
19
+ readonly crumb: "button";
20
+ readonly previous: "button";
21
+ readonly next: "button";
22
+ readonly search: "input";
23
+ readonly sort: "button";
24
+ };
25
+ declare const parts: Parts<typeof ledgerTable, typeof TAGS>;
26
+ declare const LedgerTableRoot: (typeof parts)["Root"];
27
+ declare const LedgerTableFrom: (typeof parts)["From"];
28
+ declare const LedgerTableTo: (typeof parts)["To"];
29
+ declare const LedgerTableList: (typeof parts)["List"];
30
+ declare const LedgerTableRow: (typeof parts)["Row"];
31
+ declare const LedgerTableBack: (typeof parts)["Back"];
32
+ declare const LedgerTableVoucher: (typeof parts)["Voucher"];
33
+ declare const LedgerTableLineAccount: (typeof parts)["Lineaccount"];
34
+ declare const LedgerTableDocument: (typeof parts)["Document"];
35
+ declare const LedgerTableCrumb: (typeof parts)["Crumb"];
36
+ declare const LedgerTablePrevious: (typeof parts)["Previous"];
37
+ declare const LedgerTableNext: (typeof parts)["Next"];
38
+ declare const LedgerTableSearch: (typeof parts)["Search"];
39
+ declare const LedgerTableSort: (typeof parts)["Sort"];
40
+ type LedgerTableProps = {
41
+ entries: LedgerEntry[];
42
+ account?: string | null;
43
+ defaultAccount?: string | null;
44
+ onAccountChange?: (account: string | null) => void;
45
+ from?: string | null;
46
+ defaultFrom?: string | null;
47
+ onFromChange?: (from: string | null) => void;
48
+ to?: string | null;
49
+ defaultTo?: string | null;
50
+ onToChange?: (to: string | null) => void;
51
+ /** Rows shown per page. Defaults to 100. */
52
+ pageSize?: number;
53
+ /** Most rows an agent's snapshot carries. Defaults to 50. */
54
+ snapshotRows?: number;
55
+ /** The sort, search, filters and page of the view on screen, when the app owns it. */
56
+ query?: TableQuery;
57
+ defaultQuery?: Partial<TableQuery>;
58
+ onQueryChange?: (query: TableQuery) => void;
59
+ /**
60
+ * A person picked an entry. The ledger then shows the whole voucher; call
61
+ * `details.cancel()` to show it in your own screen instead.
62
+ */
63
+ onOpenVoucher?: (voucher: LedgerVoucherRef, details?: Details) => void;
64
+ /** The voucher shown (its id), or null. */
65
+ voucher?: string | null;
66
+ defaultVoucher?: string | null;
67
+ onVoucherChange?: (voucher: string | null) => void;
68
+ /** The document behind each voucher, by voucher id. */
69
+ documents?: Record<string, LedgerDocument>;
70
+ /** A person asked to see a voucher's document. */
71
+ onOpenDocument?: (document: LedgerDocument & {
72
+ voucherId: string;
73
+ }) => void;
74
+ className?: string;
75
+ "aria-label"?: string;
76
+ };
77
+ /**
78
+ * Composed ledger: a date range, a search, the trial balance as a list (arrow
79
+ * keys move, Enter opens an account), and the account's entries with a running
80
+ * balance. Headers sort, totals cover every matching row, the CSV holds every
81
+ * matching row of the view. Only one page of rows is in the page at a time.
82
+ */
83
+ declare function LedgerTable({ entries, account, defaultAccount, onAccountChange, from, defaultFrom, onFromChange, to, defaultTo, onToChange, pageSize, snapshotRows, query, defaultQuery, onQueryChange, onOpenVoucher, voucher, defaultVoucher, onVoucherChange, documents, onOpenDocument, className, "aria-label": ariaLabel, }: LedgerTableProps): react.JSX.Element;
84
+
85
+ export { LedgerTable, LedgerTableBack, LedgerTableCrumb, LedgerTableDocument, LedgerTableFrom, LedgerTableLineAccount, LedgerTableList, LedgerTableNext, LedgerTablePrevious, type LedgerTableProps, LedgerTableRoot, LedgerTableRow, LedgerTableSearch, LedgerTableSort, LedgerTableTo, LedgerTableVoucher };
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import {
3
+ LedgerTable,
4
+ LedgerTableBack,
5
+ LedgerTableCrumb,
6
+ LedgerTableDocument,
7
+ LedgerTableFrom,
8
+ LedgerTableLineAccount,
9
+ LedgerTableList,
10
+ LedgerTableNext,
11
+ LedgerTablePrevious,
12
+ LedgerTableRoot,
13
+ LedgerTableRow,
14
+ LedgerTableSearch,
15
+ LedgerTableSort,
16
+ LedgerTableTo,
17
+ LedgerTableVoucher,
18
+ ledgerTable
19
+ } from "./chunk-EKIWL37F.js";
20
+ import "./chunk-ZYLWSGWQ.js";
21
+ import "./chunk-GVP2N3K6.js";
22
+ import "./chunk-HKYEHBQT.js";
23
+ export {
24
+ LedgerTable,
25
+ LedgerTableBack,
26
+ LedgerTableCrumb,
27
+ LedgerTableDocument,
28
+ LedgerTableFrom,
29
+ LedgerTableLineAccount,
30
+ LedgerTableList,
31
+ LedgerTableNext,
32
+ LedgerTablePrevious,
33
+ LedgerTableRoot,
34
+ LedgerTableRow,
35
+ LedgerTableSearch,
36
+ LedgerTableSort,
37
+ LedgerTableTo,
38
+ LedgerTableVoucher,
39
+ ledgerTable
40
+ };
41
+ //# sourceMappingURL=ledger-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,22 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { CountryCode, BookiLocaleProfile } from '@booki-aui/core/locale';
4
+
5
+ type BookiLocaleContextValue = {
6
+ country: CountryCode;
7
+ profile: BookiLocaleProfile;
8
+ setCountry: (country: CountryCode) => void;
9
+ };
10
+ type BookiLocaleProviderProps = {
11
+ children: ReactNode;
12
+ defaultCountry?: CountryCode;
13
+ country?: CountryCode;
14
+ onCountryChange?: (country: CountryCode) => void;
15
+ /** Profiles for countries Booki does not ship, by code. See `defineProfile`. */
16
+ profiles?: Record<string, BookiLocaleProfile>;
17
+ };
18
+ declare function BookiLocaleProvider({ children, defaultCountry, country: controlled, onCountryChange, profiles, }: BookiLocaleProviderProps): react.JSX.Element;
19
+ declare function useBookiLocale(): BookiLocaleContextValue;
20
+ declare function useBookiLocaleOptional(): BookiLocaleContextValue;
21
+
22
+ export { type BookiLocaleContextValue, BookiLocaleProvider, type BookiLocaleProviderProps, useBookiLocale, useBookiLocaleOptional };
package/dist/locale.js ADDED
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import {
3
+ BookiLocaleProvider,
4
+ useBookiLocale,
5
+ useBookiLocaleOptional
6
+ } from "./chunk-GVP2N3K6.js";
7
+ import "./chunk-HKYEHBQT.js";
8
+ export {
9
+ BookiLocaleProvider,
10
+ useBookiLocale,
11
+ useBookiLocaleOptional
12
+ };
13
+ //# sourceMappingURL=locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,15 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes } from 'react';
3
+ import { Money } from '@booki-aui/core/money';
4
+
5
+ type MoneyAmountProps = {
6
+ value: Money | number;
7
+ currency?: string;
8
+ withCurrency?: boolean;
9
+ accounting?: boolean;
10
+ size?: "md" | "lg";
11
+ className?: string;
12
+ } & Omit<HTMLAttributes<HTMLSpanElement>, "children">;
13
+ declare function MoneyAmount({ value, currency, withCurrency, accounting, size, className, ...props }: MoneyAmountProps): react.JSX.Element;
14
+
15
+ export { MoneyAmount, type MoneyAmountProps };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import {
3
+ MoneyAmount
4
+ } from "./chunk-OXHKA3UZ.js";
5
+ import "./chunk-GVP2N3K6.js";
6
+ import "./chunk-HKYEHBQT.js";
7
+ export {
8
+ MoneyAmount
9
+ };
10
+ //# sourceMappingURL=money-amount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,25 @@
1
+ import * as react from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import { Parts } from '@ui-sdk/react/primitive';
4
+ import { B as BookiFormProps } from './form-props-Ct7zeZBH.js';
5
+ import { organizationNumber } from '@booki-aui/primitives/organization-number-input';
6
+ export { organizationNumber } from '@booki-aui/primitives/organization-number-input';
7
+
8
+ declare const TAGS: {
9
+ readonly root: "div";
10
+ readonly input: "input";
11
+ };
12
+ declare const parts: Parts<typeof organizationNumber, typeof TAGS>;
13
+ declare const OrganizationNumberRoot: (typeof parts)["Root"];
14
+ declare const OrganizationNumberField: (typeof parts)["Input"];
15
+ type OrganizationNumberInputProps = {
16
+ /** Controlled value. Omit it (and use `defaultValue`) to let the field hold its own state. */
17
+ value?: string;
18
+ defaultValue?: string;
19
+ onValueChange?: (value: string) => void;
20
+ required?: boolean;
21
+ className?: string;
22
+ } & Omit<BookiFormProps, "required"> & Omit<ComponentProps<"div">, "onChange" | "defaultValue" | "children" | "id">;
23
+ declare function OrganizationNumberInput({ value, defaultValue, onValueChange, required, name, id, disabled, readOnly, className, ...props }: OrganizationNumberInputProps): react.JSX.Element;
24
+
25
+ export { OrganizationNumberField, OrganizationNumberInput, type OrganizationNumberInputProps, OrganizationNumberRoot };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import {
3
+ OrganizationNumberField,
4
+ OrganizationNumberInput,
5
+ OrganizationNumberRoot,
6
+ organizationNumber
7
+ } from "./chunk-SR2HEE4U.js";
8
+ import "./chunk-OYERLEER.js";
9
+ import "./chunk-GVP2N3K6.js";
10
+ import "./chunk-HKYEHBQT.js";
11
+ export {
12
+ OrganizationNumberField,
13
+ OrganizationNumberInput,
14
+ OrganizationNumberRoot,
15
+ organizationNumber
16
+ };
17
+ //# sourceMappingURL=organization-number-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,58 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { B as BookiChangeDetails } from './change-details-CWpEgc80.js';
4
+ import { PaymentBatch as PaymentBatch$1 } from '@booki-aui/core/payment-batch';
5
+ export { PaymentBatch as PaymentBatchData, PaymentItem } from '@booki-aui/core/payment-batch';
6
+ import { TableQuery } from '@booki-aui/core/table';
7
+ import { Parts } from '@ui-sdk/react/primitive';
8
+ import { paymentBatch } from '@booki-aui/primitives/payment-batch';
9
+ export { PaymentSummary, paymentBatch } from '@booki-aui/primitives/payment-batch';
10
+
11
+ declare const TAGS: {
12
+ readonly root: "div";
13
+ readonly remove: "button";
14
+ readonly approve: "button";
15
+ readonly release: "button";
16
+ readonly search: "input";
17
+ readonly sort: "button";
18
+ readonly prev: "button";
19
+ readonly next: "button";
20
+ };
21
+ declare const parts: Parts<typeof paymentBatch, typeof TAGS>;
22
+ declare const PaymentBatchRoot: (typeof parts)["Root"];
23
+ declare const PaymentBatchRemove: (typeof parts)["Remove"];
24
+ declare const PaymentBatchApprove: (typeof parts)["Approve"];
25
+ declare const PaymentBatchRelease: (typeof parts)["Release"];
26
+ declare const PaymentBatchSearch: (typeof parts)["Search"];
27
+ declare const PaymentBatchSort: (typeof parts)["Sort"];
28
+ declare const PaymentBatchPrev: (typeof parts)["Prev"];
29
+ declare const PaymentBatchNext: (typeof parts)["Next"];
30
+ type PaymentBatchProps = {
31
+ batch?: PaymentBatch$1;
32
+ defaultBatch?: PaymentBatch$1;
33
+ actor?: string;
34
+ requiredApprovals?: number;
35
+ onBatchChange?: (batch: PaymentBatch$1, details: BookiChangeDetails) => void;
36
+ /** Payments a person sees per page. Defaults to 100. */
37
+ pageSize?: number;
38
+ /** The sort, search, filters and page of the list, when the app owns it. */
39
+ query?: TableQuery;
40
+ defaultQuery?: Partial<TableQuery>;
41
+ onQueryChange?: (query: TableQuery) => void;
42
+ /**
43
+ * A memo or invoice reference reads "[redacted]" to an agent too. A KID always does. Which
44
+ * one the references are follows the country profile (a KID in Norway, a memo in the US).
45
+ */
46
+ secretReference?: boolean;
47
+ nameOf?: (id: string) => ReactNode;
48
+ className?: string;
49
+ "aria-label"?: string;
50
+ };
51
+ /**
52
+ * Composed batch: the payments (search, sortable headers, pages, CSV with the
53
+ * accounts masked), the batch total and the total of what is shown, what must
54
+ * be fixed, and approve / release.
55
+ */
56
+ declare function PaymentBatch({ batch, defaultBatch, actor, requiredApprovals, onBatchChange, pageSize, query, defaultQuery, onQueryChange, secretReference, nameOf, className, "aria-label": ariaLabel, }: PaymentBatchProps): react.JSX.Element;
57
+
58
+ export { PaymentBatch, PaymentBatchApprove, PaymentBatchNext, PaymentBatchPrev, type PaymentBatchProps, PaymentBatchRelease, PaymentBatchRemove, PaymentBatchRoot, PaymentBatchSearch, PaymentBatchSort };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import {
3
+ PaymentBatch,
4
+ PaymentBatchApprove,
5
+ PaymentBatchNext,
6
+ PaymentBatchPrev,
7
+ PaymentBatchRelease,
8
+ PaymentBatchRemove,
9
+ PaymentBatchRoot,
10
+ PaymentBatchSearch,
11
+ PaymentBatchSort,
12
+ paymentBatch
13
+ } from "./chunk-62G3T2AA.js";
14
+ import "./chunk-U7NPK4WO.js";
15
+ import "./chunk-K72VT6RJ.js";
16
+ import "./chunk-ZYLWSGWQ.js";
17
+ import "./chunk-GVP2N3K6.js";
18
+ import "./chunk-HKYEHBQT.js";
19
+ export {
20
+ PaymentBatch,
21
+ PaymentBatchApprove,
22
+ PaymentBatchNext,
23
+ PaymentBatchPrev,
24
+ PaymentBatchRelease,
25
+ PaymentBatchRemove,
26
+ PaymentBatchRoot,
27
+ PaymentBatchSearch,
28
+ PaymentBatchSort,
29
+ paymentBatch
30
+ };
31
+ //# sourceMappingURL=payment-batch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,19 @@
1
+ import * as react from 'react';
2
+ import { Money } from '@booki-aui/core/money';
3
+
4
+ type PaymentConfirmProps = {
5
+ payee: string;
6
+ /** Major units or Money */
7
+ amount: number | Money;
8
+ bankAccount?: string;
9
+ paymentReference?: string;
10
+ message?: string;
11
+ feeMajor?: number;
12
+ confirmWord?: string;
13
+ onConfirm?: () => void | Promise<void>;
14
+ onCancel?: () => void;
15
+ className?: string;
16
+ };
17
+ declare function PaymentConfirm({ payee, amount, bankAccount, paymentReference, message, feeMajor, confirmWord, onConfirm, onCancel, className, }: PaymentConfirmProps): react.JSX.Element;
18
+
19
+ export { PaymentConfirm, type PaymentConfirmProps };