@spaceinvoices/react-ui 0.4.8 → 0.4.11

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 (276) hide show
  1. package/README.md +24 -8
  2. package/cli/dist/index.js +89 -26
  3. package/package.json +4 -1
  4. package/spaceinvoices.schema.json +6 -1
  5. package/src/common/autocomplete.tsx +69 -6
  6. package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +124 -285
  7. package/src/components/advance-invoices/list/list-table.tsx +10 -3
  8. package/src/components/advance-invoices/list/locales/de.ts +2 -0
  9. package/src/components/advance-invoices/list/locales/en.ts +1 -0
  10. package/src/components/advance-invoices/list/locales/es.ts +1 -0
  11. package/src/components/advance-invoices/list/locales/fr.ts +1 -0
  12. package/src/components/advance-invoices/list/locales/hr.ts +1 -0
  13. package/src/components/advance-invoices/list/locales/it.ts +1 -0
  14. package/src/components/advance-invoices/list/locales/nl.ts +1 -0
  15. package/src/components/advance-invoices/list/locales/pl.ts +1 -0
  16. package/src/components/advance-invoices/list/locales/pt.ts +1 -0
  17. package/src/components/advance-invoices/list/locales/sl.ts +1 -0
  18. package/src/components/advance-invoices/list/use-advance-invoice-download.ts +1 -12
  19. package/src/components/credit-notes/create/create-credit-note-form.tsx +116 -238
  20. package/src/components/credit-notes/list/list-table.tsx +6 -3
  21. package/src/components/credit-notes/list/use-credit-note-download.ts +1 -12
  22. package/src/components/customers/customer-autocomplete.tsx +64 -11
  23. package/src/components/customers/customer-list-table/customer-list-table.tsx +3 -2
  24. package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +9 -1
  25. package/src/components/dashboard/collection-rate-card/locales/bg.ts +3 -0
  26. package/src/components/dashboard/collection-rate-card/locales/cs.ts +3 -0
  27. package/src/components/dashboard/collection-rate-card/locales/et.ts +3 -0
  28. package/src/components/dashboard/collection-rate-card/locales/fi.ts +3 -0
  29. package/src/components/dashboard/collection-rate-card/locales/is.ts +3 -0
  30. package/src/components/dashboard/collection-rate-card/locales/nb.ts +3 -0
  31. package/src/components/dashboard/collection-rate-card/locales/sk.ts +3 -0
  32. package/src/components/dashboard/collection-rate-card/locales/sv.ts +3 -0
  33. package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +10 -2
  34. package/src/components/dashboard/invoice-status-chart/locales/bg.ts +10 -0
  35. package/src/components/dashboard/invoice-status-chart/locales/cs.ts +10 -0
  36. package/src/components/dashboard/invoice-status-chart/locales/de.ts +1 -0
  37. package/src/components/dashboard/invoice-status-chart/locales/es.ts +1 -0
  38. package/src/components/dashboard/invoice-status-chart/locales/et.ts +10 -0
  39. package/src/components/dashboard/invoice-status-chart/locales/fi.ts +10 -0
  40. package/src/components/dashboard/invoice-status-chart/locales/fr.ts +1 -0
  41. package/src/components/dashboard/invoice-status-chart/locales/hr.ts +1 -0
  42. package/src/components/dashboard/invoice-status-chart/locales/is.ts +10 -0
  43. package/src/components/dashboard/invoice-status-chart/locales/it.ts +1 -0
  44. package/src/components/dashboard/invoice-status-chart/locales/nb.ts +10 -0
  45. package/src/components/dashboard/invoice-status-chart/locales/nl.ts +1 -0
  46. package/src/components/dashboard/invoice-status-chart/locales/pl.ts +1 -0
  47. package/src/components/dashboard/invoice-status-chart/locales/pt.ts +1 -0
  48. package/src/components/dashboard/invoice-status-chart/locales/sk.ts +10 -0
  49. package/src/components/dashboard/invoice-status-chart/locales/sl.ts +1 -0
  50. package/src/components/dashboard/invoice-status-chart/locales/sv.ts +10 -0
  51. package/src/components/dashboard/payment-methods-chart/locales/bg.ts +12 -0
  52. package/src/components/dashboard/payment-methods-chart/locales/cs.ts +12 -0
  53. package/src/components/dashboard/payment-methods-chart/locales/et.ts +12 -0
  54. package/src/components/dashboard/payment-methods-chart/locales/fi.ts +12 -0
  55. package/src/components/dashboard/payment-methods-chart/locales/is.ts +12 -0
  56. package/src/components/dashboard/payment-methods-chart/locales/nb.ts +12 -0
  57. package/src/components/dashboard/payment-methods-chart/locales/sk.ts +12 -0
  58. package/src/components/dashboard/payment-methods-chart/locales/sv.ts +12 -0
  59. package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +9 -1
  60. package/src/components/dashboard/payment-trend-chart/locales/bg.ts +6 -0
  61. package/src/components/dashboard/payment-trend-chart/locales/cs.ts +6 -0
  62. package/src/components/dashboard/payment-trend-chart/locales/de.ts +1 -0
  63. package/src/components/dashboard/payment-trend-chart/locales/es.ts +1 -0
  64. package/src/components/dashboard/payment-trend-chart/locales/et.ts +6 -0
  65. package/src/components/dashboard/payment-trend-chart/locales/fi.ts +6 -0
  66. package/src/components/dashboard/payment-trend-chart/locales/fr.ts +1 -0
  67. package/src/components/dashboard/payment-trend-chart/locales/hr.ts +1 -0
  68. package/src/components/dashboard/payment-trend-chart/locales/is.ts +6 -0
  69. package/src/components/dashboard/payment-trend-chart/locales/it.ts +1 -0
  70. package/src/components/dashboard/payment-trend-chart/locales/nb.ts +6 -0
  71. package/src/components/dashboard/payment-trend-chart/locales/nl.ts +1 -0
  72. package/src/components/dashboard/payment-trend-chart/locales/pl.ts +1 -0
  73. package/src/components/dashboard/payment-trend-chart/locales/pt.ts +1 -0
  74. package/src/components/dashboard/payment-trend-chart/locales/sk.ts +6 -0
  75. package/src/components/dashboard/payment-trend-chart/locales/sl.ts +1 -0
  76. package/src/components/dashboard/payment-trend-chart/locales/sv.ts +6 -0
  77. package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +15 -8
  78. package/src/components/dashboard/revenue-trend-chart/locales/bg.ts +6 -0
  79. package/src/components/dashboard/revenue-trend-chart/locales/cs.ts +6 -0
  80. package/src/components/dashboard/revenue-trend-chart/locales/de.ts +1 -0
  81. package/src/components/dashboard/revenue-trend-chart/locales/es.ts +1 -0
  82. package/src/components/dashboard/revenue-trend-chart/locales/et.ts +6 -0
  83. package/src/components/dashboard/revenue-trend-chart/locales/fi.ts +6 -0
  84. package/src/components/dashboard/revenue-trend-chart/locales/fr.ts +1 -0
  85. package/src/components/dashboard/revenue-trend-chart/locales/hr.ts +1 -0
  86. package/src/components/dashboard/revenue-trend-chart/locales/is.ts +6 -0
  87. package/src/components/dashboard/revenue-trend-chart/locales/it.ts +1 -0
  88. package/src/components/dashboard/revenue-trend-chart/locales/nb.ts +6 -0
  89. package/src/components/dashboard/revenue-trend-chart/locales/nl.ts +1 -0
  90. package/src/components/dashboard/revenue-trend-chart/locales/pl.ts +1 -0
  91. package/src/components/dashboard/revenue-trend-chart/locales/pt.ts +1 -0
  92. package/src/components/dashboard/revenue-trend-chart/locales/sk.ts +6 -0
  93. package/src/components/dashboard/revenue-trend-chart/locales/sl.ts +1 -0
  94. package/src/components/dashboard/revenue-trend-chart/locales/sv.ts +6 -0
  95. package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +15 -8
  96. package/src/components/dashboard/tax-collected-card/locales.ts +110 -0
  97. package/src/components/dashboard/tax-collected-card/tax-collected-card.tsx +8 -2
  98. package/src/components/dashboard/tax-collected-card/use-tax-collected.ts +4 -4
  99. package/src/components/dashboard/top-customers-chart/locales/bg.ts +7 -0
  100. package/src/components/dashboard/top-customers-chart/locales/cs.ts +7 -0
  101. package/src/components/dashboard/top-customers-chart/locales/de.ts +2 -0
  102. package/src/components/dashboard/top-customers-chart/locales/es.ts +2 -0
  103. package/src/components/dashboard/top-customers-chart/locales/et.ts +7 -0
  104. package/src/components/dashboard/top-customers-chart/locales/fi.ts +7 -0
  105. package/src/components/dashboard/top-customers-chart/locales/fr.ts +2 -0
  106. package/src/components/dashboard/top-customers-chart/locales/hr.ts +2 -0
  107. package/src/components/dashboard/top-customers-chart/locales/is.ts +7 -0
  108. package/src/components/dashboard/top-customers-chart/locales/it.ts +2 -0
  109. package/src/components/dashboard/top-customers-chart/locales/nb.ts +7 -0
  110. package/src/components/dashboard/top-customers-chart/locales/nl.ts +2 -0
  111. package/src/components/dashboard/top-customers-chart/locales/pl.ts +2 -0
  112. package/src/components/dashboard/top-customers-chart/locales/pt.ts +2 -0
  113. package/src/components/dashboard/top-customers-chart/locales/sk.ts +7 -0
  114. package/src/components/dashboard/top-customers-chart/locales/sl.ts +2 -0
  115. package/src/components/dashboard/top-customers-chart/locales/sv.ts +7 -0
  116. package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +23 -12
  117. package/src/components/delivery-notes/create/create-delivery-note-form.tsx +33 -20
  118. package/src/components/delivery-notes/list/list-table.tsx +22 -13
  119. package/src/components/delivery-notes/list/locales/de.ts +2 -0
  120. package/src/components/delivery-notes/list/locales/en.ts +1 -0
  121. package/src/components/delivery-notes/list/locales/es.ts +1 -0
  122. package/src/components/delivery-notes/list/locales/fr.ts +1 -0
  123. package/src/components/delivery-notes/list/locales/hr.ts +1 -0
  124. package/src/components/delivery-notes/list/locales/it.ts +1 -0
  125. package/src/components/delivery-notes/list/locales/nl.ts +1 -0
  126. package/src/components/delivery-notes/list/locales/pl.ts +1 -0
  127. package/src/components/delivery-notes/list/locales/pt.ts +1 -0
  128. package/src/components/delivery-notes/list/locales/sl.ts +1 -0
  129. package/src/components/delivery-notes/list/use-delivery-note-download.ts +1 -12
  130. package/src/components/documents/create/document-add-item-form.tsx +28 -16
  131. package/src/components/documents/create/document-add-item-tax-rate-field.tsx +12 -2
  132. package/src/components/documents/create/document-items-section.tsx +70 -39
  133. package/src/components/documents/create/document-recipient-section.tsx +10 -1
  134. package/src/components/documents/create/live-preview.tsx +113 -15
  135. package/src/components/documents/create/prepare-document-submission.ts +35 -16
  136. package/src/components/documents/create/use-document-customer-form.ts +14 -3
  137. package/src/components/documents/documents.hooks.ts +7 -2
  138. package/src/components/documents/shared/document-preview-display.tsx +136 -67
  139. package/src/components/documents/shared/scaled-document-preview.tsx +45 -5
  140. package/src/components/documents/view/document-actions-bar.tsx +284 -182
  141. package/src/components/documents/view/document-activities-list.tsx +3 -0
  142. package/src/components/documents/view/document-payments-list.tsx +3 -0
  143. package/src/components/documents/view/locales/de.ts +8 -0
  144. package/src/components/documents/view/locales/es.ts +8 -0
  145. package/src/components/documents/view/locales/fr.ts +8 -0
  146. package/src/components/documents/view/locales/hr.ts +8 -0
  147. package/src/components/documents/view/locales/it.ts +8 -0
  148. package/src/components/documents/view/locales/nl.ts +8 -0
  149. package/src/components/documents/view/locales/pl.ts +8 -0
  150. package/src/components/documents/view/locales/pt.ts +8 -0
  151. package/src/components/documents/view/locales/sl.ts +8 -0
  152. package/src/components/documents/view/use-document-download.ts +14 -25
  153. package/src/components/entities/create-entity-form.tsx +101 -16
  154. package/src/components/entities/entity-settings-form/entity-settings-form.tsx +10 -10
  155. package/src/components/entities/entity-settings-form/locales/de.ts +10 -0
  156. package/src/components/entities/entity-settings-form/locales/es.ts +10 -0
  157. package/src/components/entities/entity-settings-form/locales/fr.ts +10 -0
  158. package/src/components/entities/entity-settings-form/locales/hr.ts +10 -0
  159. package/src/components/entities/entity-settings-form/locales/it.ts +10 -0
  160. package/src/components/entities/entity-settings-form/locales/nl.ts +10 -0
  161. package/src/components/entities/entity-settings-form/locales/pl.ts +10 -0
  162. package/src/components/entities/entity-settings-form/locales/pt.ts +10 -0
  163. package/src/components/entities/entity-settings-form/locales/sl.ts +10 -0
  164. package/src/components/entities/fina-settings-form/fina-operator-required-dialog.tsx +3 -3
  165. package/src/components/entities/fina-settings-form/fina-settings-form.tsx +78 -124
  166. package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +8 -1
  167. package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +14 -2
  168. package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +7 -2
  169. package/src/components/entities/furs-settings-form/furs-settings-form.tsx +56 -130
  170. package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +8 -1
  171. package/src/components/entities/furs-settings-form/sections/enable-fiscalization-section.tsx +1 -0
  172. package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +15 -2
  173. package/src/components/entities/furs-settings-form/sections/premises-management-section.tsx +20 -3
  174. package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +38 -12
  175. package/src/components/entities/settings/defaults-settings-form.tsx +6 -6
  176. package/src/components/entities/settings/eslog-settings-form.tsx +13 -1
  177. package/src/components/entities/settings/pdf-template-selector/demo-invoice-data.ts +3 -22
  178. package/src/components/entities/shared/fiscalization-step-flow.ts +77 -0
  179. package/src/components/entities/shared/fiscalization-step-tabs.tsx +71 -0
  180. package/src/components/estimates/create/create-estimate-form.tsx +34 -21
  181. package/src/components/estimates/list/list-table.tsx +23 -14
  182. package/src/components/estimates/list/locales/de.ts +2 -0
  183. package/src/components/estimates/list/locales/en.ts +1 -0
  184. package/src/components/estimates/list/locales/es.ts +1 -0
  185. package/src/components/estimates/list/locales/fr.ts +1 -0
  186. package/src/components/estimates/list/locales/hr.ts +1 -0
  187. package/src/components/estimates/list/locales/it.ts +1 -0
  188. package/src/components/estimates/list/locales/nl.ts +1 -0
  189. package/src/components/estimates/list/locales/pl.ts +1 -0
  190. package/src/components/estimates/list/locales/pt.ts +1 -0
  191. package/src/components/estimates/list/locales/sl.ts +1 -0
  192. package/src/components/estimates/list/use-estimate-download.ts +1 -12
  193. package/src/components/export/document-export-form.tsx +33 -7
  194. package/src/components/export/sales-per-item-export-form.tsx +23 -7
  195. package/src/components/invoices/create/create-invoice-form.tsx +295 -329
  196. package/src/components/invoices/create/prepare-invoice-submission.ts +0 -8
  197. package/src/components/invoices/list/list-table.tsx +7 -4
  198. package/src/components/invoices/list/use-invoice-download.ts +1 -11
  199. package/src/components/invoices/send-email-dialog/locales/de.ts +20 -0
  200. package/src/components/invoices/send-email-dialog/locales/es.ts +20 -0
  201. package/src/components/invoices/send-email-dialog/locales/fr.ts +20 -0
  202. package/src/components/invoices/send-email-dialog/locales/hr.ts +20 -0
  203. package/src/components/invoices/send-email-dialog/locales/it.ts +20 -0
  204. package/src/components/invoices/send-email-dialog/locales/nl.ts +20 -0
  205. package/src/components/invoices/send-email-dialog/locales/pl.ts +20 -0
  206. package/src/components/invoices/send-email-dialog/locales/pt.ts +20 -0
  207. package/src/components/invoices/send-email-dialog/locales/sl.ts +20 -0
  208. package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +77 -8
  209. package/src/components/invoices/view/eslog-info-display.tsx +17 -1
  210. package/src/components/invoices/view/fiscalization-status-card.tsx +7 -3
  211. package/src/components/items/item-combobox.tsx +26 -6
  212. package/src/components/items/item-list-table/item-list-table.tsx +5 -2
  213. package/src/components/payments/create-payment-form/index.ts +1 -0
  214. package/src/components/payments/list/list-table.tsx +14 -4
  215. package/src/components/recurring-invoices/list/list-table.tsx +7 -4
  216. package/src/components/request-logs/locales.ts +412 -0
  217. package/src/components/request-logs/request-log-detail.tsx +37 -21
  218. package/src/components/request-logs/request-log-list-table.tsx +57 -11
  219. package/src/components/table/data-table.tsx +5 -2
  220. package/src/components/table/date-cell.tsx +3 -1
  221. package/src/components/table/filter-bar.tsx +14 -2
  222. package/src/components/table/hooks/use-table-query.ts +1 -1
  223. package/src/components/table/locales.ts +1116 -0
  224. package/src/components/table/search-input.tsx +12 -3
  225. package/src/components/table/selection-toolbar.tsx +23 -6
  226. package/src/components/table/table-empty-state.tsx +43 -3
  227. package/src/components/table/table-no-results.tsx +3 -3
  228. package/src/components/table/table-pagination.tsx +4 -3
  229. package/src/components/table/types.ts +1 -0
  230. package/src/components/tax-reports/index.ts +1 -0
  231. package/src/components/tax-reports/kir-export-form.tsx +46 -8
  232. package/src/components/tax-reports/slovenia-tax-profile-step.tsx +191 -0
  233. package/src/components/tax-reports/slovenia-yearly-export-form.tsx +509 -0
  234. package/src/components/tax-reports/slovenia-yearly-review-step.tsx +253 -0
  235. package/src/components/tax-reports/slovenia-yearly-summary.tsx +19 -0
  236. package/src/components/taxes/tax-list-table/tax-list-table.tsx +3 -2
  237. package/src/components/ui/sidebar.tsx +3 -2
  238. package/src/components/ui/sticky-form-footer.tsx +7 -1
  239. package/src/components/webhook-logs/index.ts +6 -0
  240. package/src/components/webhook-logs/locales.ts +392 -0
  241. package/src/components/webhook-logs/webhook-delivery-detail.tsx +255 -0
  242. package/src/components/webhook-logs/webhook-delivery-list-table.tsx +278 -0
  243. package/src/components/wl-subscription/index.ts +1 -0
  244. package/src/components/wl-subscription/locked-feature.tsx +1 -0
  245. package/src/components/wl-subscription/paywall.tsx +193 -0
  246. package/src/components/wl-subscription/upgrade-modal.tsx +93 -29
  247. package/src/generate-schemas.ts +12 -7
  248. package/src/generated/schemas/customer.ts +2 -0
  249. package/src/generated/schemas/entity.ts +134 -0
  250. package/src/generated/schemas/exportsloveniayearlynormiranireport_body.ts +27 -0
  251. package/src/generated/schemas/index.ts +2 -0
  252. package/src/generated/schemas/me.ts +20 -1
  253. package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +40 -34
  254. package/src/generated/schemas/rendercreditnotepreview_body.ts +42 -36
  255. package/src/generated/schemas/renderdeliverynotepreview_body.ts +23 -13
  256. package/src/generated/schemas/renderestimatepreview_body.ts +23 -13
  257. package/src/generated/schemas/renderinvoicepreview_body.ts +40 -34
  258. package/src/generated/schemas/sendemail_body.ts +44 -0
  259. package/src/generated/schemas/sloveniataxprofile.ts +42 -0
  260. package/src/generated/schemas/startpdfexport_body.ts +91 -1
  261. package/src/generated/schemas/webhook.ts +10 -0
  262. package/src/hooks/use-duplicate-document.ts +51 -13
  263. package/src/hooks/use-eslog-validation.ts +59 -0
  264. package/src/hooks/use-premise-selection.ts +186 -0
  265. package/src/lib/browser-cookies.ts +4 -4
  266. package/src/lib/date-fns-locale.ts +48 -0
  267. package/src/lib/fiscalization-options.ts +81 -0
  268. package/src/lib/locale.ts +38 -0
  269. package/src/lib/template-variables.tsx +1 -1
  270. package/src/lib/translation.ts +14 -3
  271. package/src/providers/entities-context.tsx +1 -0
  272. package/src/providers/entities-provider.tsx +102 -3
  273. package/src/providers/form-footer-context.tsx +37 -4
  274. package/src/providers/sdk-provider.tsx +7 -2
  275. package/src/providers/white-label-provider.tsx +4 -1
  276. package/src/providers/wl-subscription-provider.tsx +90 -3
@@ -9,12 +9,21 @@ type SearchInputProps = {
9
9
  onSearch: (value: string | null) => void;
10
10
  placeholder?: string;
11
11
  debounceMs?: number;
12
+ ariaLabel?: string;
13
+ clearAriaLabel?: string;
12
14
  };
13
15
 
14
16
  /**
15
17
  * Search input with optional clear button and form submission
16
18
  */
17
- export function SearchInput({ initialValue = "", onSearch, placeholder = "Search...", debounceMs }: SearchInputProps) {
19
+ export function SearchInput({
20
+ initialValue = "",
21
+ onSearch,
22
+ placeholder = "Search...",
23
+ debounceMs,
24
+ ariaLabel = "Search",
25
+ clearAriaLabel = "Clear search",
26
+ }: SearchInputProps) {
18
27
  const [value, setValue] = useState(initialValue);
19
28
  const [isFocused, setIsFocused] = useState(false);
20
29
 
@@ -66,7 +75,7 @@ export function SearchInput({ initialValue = "", onSearch, placeholder = "Search
66
75
  <Input
67
76
  type="search"
68
77
  role="searchbox"
69
- aria-label="Search"
78
+ aria-label={ariaLabel}
70
79
  placeholder={placeholder}
71
80
  value={value}
72
81
  onChange={handleChange}
@@ -92,7 +101,7 @@ export function SearchInput({ initialValue = "", onSearch, placeholder = "Search
92
101
  size="sm"
93
102
  onClick={handleClear}
94
103
  className="absolute top-1/2 right-1 z-10 h-6 w-6 -translate-y-1/2 p-0 hover:bg-transparent"
95
- aria-label="Clear search"
104
+ aria-label={clearAriaLabel}
96
105
  >
97
106
  <X className="h-3 w-3 text-muted-foreground" />
98
107
  </Button>
@@ -6,6 +6,8 @@ type SelectionToolbarProps = {
6
6
  selectedCount: number;
7
7
  onExportPdfs?: () => void;
8
8
  onCopyToInvoice?: () => void;
9
+ copyToInvoiceDisabled?: boolean;
10
+ copyToInvoiceTooltip?: string;
9
11
  onRetryFiscalization?: () => void;
10
12
  retryFiscalizationDisabled?: boolean;
11
13
  retryFiscalizationTooltip?: string;
@@ -17,6 +19,8 @@ export function SelectionToolbar({
17
19
  selectedCount,
18
20
  onExportPdfs,
19
21
  onCopyToInvoice,
22
+ copyToInvoiceDisabled,
23
+ copyToInvoiceTooltip,
20
24
  onRetryFiscalization,
21
25
  retryFiscalizationDisabled,
22
26
  retryFiscalizationTooltip,
@@ -34,12 +38,25 @@ export function SelectionToolbar({
34
38
  {t("Export PDFs")}
35
39
  </Button>
36
40
  )}
37
- {onCopyToInvoice && (
38
- <Button variant="outline" size="sm" onClick={onCopyToInvoice}>
39
- <FileText className="mr-1.5 size-4" />
40
- {t("Copy to Invoice")}
41
- </Button>
42
- )}
41
+ {onCopyToInvoice &&
42
+ (copyToInvoiceDisabled && copyToInvoiceTooltip ? (
43
+ <Tooltip>
44
+ <TooltipTrigger>
45
+ <span>
46
+ <Button variant="outline" size="sm" disabled>
47
+ <FileText className="mr-1.5 size-4" />
48
+ {t("Copy to Invoice")}
49
+ </Button>
50
+ </span>
51
+ </TooltipTrigger>
52
+ <TooltipContent>{copyToInvoiceTooltip}</TooltipContent>
53
+ </Tooltip>
54
+ ) : (
55
+ <Button variant="outline" size="sm" onClick={onCopyToInvoice}>
56
+ <FileText className="mr-1.5 size-4" />
57
+ {t("Copy to Invoice")}
58
+ </Button>
59
+ ))}
43
60
  {onRetryFiscalization &&
44
61
  (retryFiscalizationDisabled && retryFiscalizationTooltip ? (
45
62
  <Tooltip>
@@ -1,7 +1,44 @@
1
- import { Sprout } from "lucide-react";
1
+ import type { LucideIcon } from "lucide-react";
2
+ import {
3
+ Building2,
4
+ CreditCard,
5
+ FileCheck,
6
+ FileMinus,
7
+ FileOutput,
8
+ FilePlus,
9
+ FileText,
10
+ Landmark,
11
+ Link2,
12
+ Package,
13
+ RefreshCw,
14
+ ShoppingCart,
15
+ Sprout,
16
+ Users,
17
+ } from "lucide-react";
2
18
 
3
19
  import { Button } from "@/ui/components/ui/button";
4
20
 
21
+ // Generic subtitle key — each list component's locale files override this
22
+ // with a resource-specific translation (e.g. "Get started by creating your first invoice")
23
+ const GENERIC_SUBTITLE = "Get started by creating your first entry";
24
+
25
+ const RESOURCE_ICONS: Record<string, LucideIcon> = {
26
+ invoice: FileText,
27
+ estimate: FileCheck,
28
+ credit_note: FileMinus,
29
+ advance_invoice: FilePlus,
30
+ "delivery note": FileOutput,
31
+ delivery_note: FileOutput,
32
+ customer: Users,
33
+ item: Package,
34
+ tax: Landmark,
35
+ payment: CreditCard,
36
+ "recurring-invoice": RefreshCw,
37
+ order: ShoppingCart,
38
+ "order-integration": Link2,
39
+ entity: Building2,
40
+ };
41
+
5
42
  type TableEmptyStateProps = {
6
43
  resource: string;
7
44
  createNewLink?: string;
@@ -21,6 +58,7 @@ const ROW_HEIGHT = 53;
21
58
  * Empty state shown when table has no data
22
59
  */
23
60
  export function TableEmptyState({
61
+ resource,
24
62
  createNewLink,
25
63
  createNewTrigger,
26
64
  onCreateNew,
@@ -30,13 +68,15 @@ export function TableEmptyState({
30
68
  // Calculate height based on row count (min 200px)
31
69
  const height = Math.max(rows * ROW_HEIGHT, 200);
32
70
 
71
+ const Icon = RESOURCE_ICONS[resource] ?? Sprout;
72
+
33
73
  return (
34
74
  <div className="flex flex-col items-center justify-center gap-3" style={{ height }}>
35
- <Sprout size={70} strokeWidth={0.35} className="text-muted-foreground" />
75
+ <Icon size={70} strokeWidth={0.35} className="text-muted-foreground" />
36
76
  <div className="space-y-1 text-center">
37
77
  <p className="font-light text-lg text-muted-foreground">{t("Your list is empty")}</p>
38
78
  {(createNewLink || createNewTrigger || onCreateNew) && (
39
- <p className="text-muted-foreground text-sm">{t("Get started by creating your first entry")}</p>
79
+ <p className="text-muted-foreground text-sm">{t(GENERIC_SUBTITLE)}</p>
40
80
  )}
41
81
  </div>
42
82
  {createNewLink && (
@@ -1,4 +1,4 @@
1
- import { FileX } from "lucide-react";
1
+ import { SearchX } from "lucide-react";
2
2
 
3
3
  import { Button } from "@/ui/components/ui/button";
4
4
  import { TableCell, TableRow } from "@/ui/components/ui/table";
@@ -31,9 +31,9 @@ export function TableNoResults({ search, onClear, rows = 10, t = (key) => key }:
31
31
  <TableRow className="hover:bg-transparent">
32
32
  <TableCell colSpan={100} className="text-center align-middle" style={{ height }}>
33
33
  <div className="flex flex-col items-center gap-3">
34
- <FileX size={32} strokeWidth={1.5} className="text-muted-foreground" />
34
+ <SearchX size={70} strokeWidth={0.35} className="text-muted-foreground" />
35
35
  <div className="space-y-1">
36
- <p className="font-medium text-muted-foreground">{t("No results found")}</p>
36
+ <p className="font-light text-lg text-muted-foreground">{t("No results found")}</p>
37
37
  {handleClear && <p className="text-muted-foreground text-sm">{t("Try adjusting your search criteria")}</p>}
38
38
  </div>
39
39
  {handleClear && (
@@ -6,12 +6,13 @@ type PaginationProps = {
6
6
  prevCursor?: string | null;
7
7
  nextCursor?: string | null;
8
8
  onPageChange: (cursor: { prev?: string; next?: string }) => void;
9
+ t?: (key: string) => string;
9
10
  };
10
11
 
11
12
  /**
12
13
  * Cursor-based pagination controls
13
14
  */
14
- export function Pagination({ prevCursor, nextCursor, onPageChange }: PaginationProps) {
15
+ export function Pagination({ prevCursor, nextCursor, onPageChange, t = (key) => key }: PaginationProps) {
15
16
  const hasPrevious = Boolean(prevCursor);
16
17
  const hasNext = Boolean(nextCursor);
17
18
 
@@ -23,7 +24,7 @@ export function Pagination({ prevCursor, nextCursor, onPageChange }: PaginationP
23
24
  className="h-8 w-8 cursor-pointer p-0"
24
25
  onClick={() => onPageChange({ prev: prevCursor ?? undefined })}
25
26
  disabled={!hasPrevious}
26
- aria-label="Previous page"
27
+ aria-label={t("Previous page")}
27
28
  >
28
29
  <ChevronLeft className="h-4 w-4" />
29
30
  </Button>
@@ -33,7 +34,7 @@ export function Pagination({ prevCursor, nextCursor, onPageChange }: PaginationP
33
34
  className="h-8 w-8 cursor-pointer p-0"
34
35
  onClick={() => onPageChange({ next: nextCursor ?? undefined })}
35
36
  disabled={!hasNext}
36
- aria-label="Next page"
37
+ aria-label={t("Next page")}
37
38
  >
38
39
  <ChevronRight className="h-4 w-4" />
39
40
  </Button>
@@ -34,6 +34,7 @@ export type TableQueryParams = {
34
34
  // HTTP-specific filter params (for request logs)
35
35
  filter_method?: string; // GET, POST, PATCH, PUT, DELETE
36
36
  filter_http_status?: string; // 2xx, 4xx, 5xx
37
+ filter_client_name?: string;
37
38
  };
38
39
 
39
40
  /**
@@ -1 +1,2 @@
1
1
  export { KirExportForm } from "./kir-export-form";
2
+ export { SloveniaYearlyExportForm } from "./slovenia-yearly-export-form";
@@ -1,9 +1,8 @@
1
- import type SDK from "@spaceinvoices/js-sdk";
2
-
3
- type TFunction = (key: string, options?: Record<string, unknown>) => string;
4
-
5
1
  import { Download, Loader2 } from "lucide-react";
6
2
  import { useRef, useState } from "react";
3
+ import type SDK from "@spaceinvoices/js-sdk";
4
+ import type { ComponentTranslationProps } from "@/ui/lib/translation";
5
+ import { createTranslation } from "@/ui/lib/translation";
7
6
  import { Button } from "../ui/button";
8
7
  import { Label } from "../ui/label";
9
8
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
@@ -25,13 +24,52 @@ function getPreviousMonth(): { year: number; month: number } {
25
24
  type KirExportFormProps = {
26
25
  sdk: SDK;
27
26
  entityId: string;
28
- t: TFunction;
29
27
  onSuccess?: (fileName: string) => void;
30
28
  onError?: (error: Error) => void;
31
29
  onLoadingChange?: (isLoading: boolean, toastId: string | number | null) => void;
32
- };
33
-
34
- export function KirExportForm({ sdk, entityId, t, onSuccess, onError, onLoadingChange }: KirExportFormProps) {
30
+ } & ComponentTranslationProps;
31
+
32
+ const translations = {
33
+ en: {
34
+ "kir-export.year": "Year",
35
+ "kir-export.period-type": "Period type",
36
+ "kir-export.period-types.month": "Month",
37
+ "kir-export.period-types.quarter": "Quarter",
38
+ "kir-export.month": "Month",
39
+ "kir-export.quarter": "Quarter",
40
+ "kir-export.months.1": "January",
41
+ "kir-export.months.2": "February",
42
+ "kir-export.months.3": "March",
43
+ "kir-export.months.4": "April",
44
+ "kir-export.months.5": "May",
45
+ "kir-export.months.6": "June",
46
+ "kir-export.months.7": "July",
47
+ "kir-export.months.8": "August",
48
+ "kir-export.months.9": "September",
49
+ "kir-export.months.10": "October",
50
+ "kir-export.months.11": "November",
51
+ "kir-export.months.12": "December",
52
+ "kir-export.quarters.1": "Q1",
53
+ "kir-export.quarters.2": "Q2",
54
+ "kir-export.quarters.3": "Q3",
55
+ "kir-export.quarters.4": "Q4",
56
+ "kir-export.file-preview": "File preview",
57
+ "kir-export.exporting": "Exporting...",
58
+ "kir-export.export-button": "Export KIR ZIP",
59
+ },
60
+ } as const;
61
+
62
+ export function KirExportForm({
63
+ sdk,
64
+ entityId,
65
+ t: translateFn,
66
+ namespace,
67
+ locale,
68
+ onSuccess,
69
+ onError,
70
+ onLoadingChange,
71
+ }: KirExportFormProps) {
72
+ const t = createTranslation({ t: translateFn, namespace, locale, translations });
35
73
  const defaultPeriod = getPreviousMonth();
36
74
  const [year, setYear] = useState(defaultPeriod.year);
37
75
  const [periodType, setPeriodType] = useState<PeriodType>("month");
@@ -0,0 +1,191 @@
1
+ import { AlertCircle } from "lucide-react";
2
+ import type { ChangeEvent } from "react";
3
+ import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
4
+ import { Input } from "../ui/input";
5
+ import { Label } from "../ui/label";
6
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select";
7
+
8
+ export type SloveniaTaxProfileFormState = {
9
+ business_form: "sp" | "doo" | "dno" | "club" | "";
10
+ income_tax_regime: "normirani" | "dejanski" | "";
11
+ vat_profile: "standard" | "special_vat_identified" | "";
12
+ tax_residency: "resident" | "non_resident" | "";
13
+ activity_code: string;
14
+ registration_number: string;
15
+ normiranec_insurance_basis: "full_time_self_employed" | "other" | "";
16
+ };
17
+
18
+ type SloveniaTaxProfileStepProps = {
19
+ form: SloveniaTaxProfileFormState;
20
+ t: (key: string) => string;
21
+ onFieldChange: (field: keyof SloveniaTaxProfileFormState, value: string) => void;
22
+ unsupportedReason: string | null;
23
+ year: number;
24
+ onYearChange: (year: number) => void;
25
+ yearOptions: number[];
26
+ };
27
+
28
+ export function SloveniaTaxProfileStep({
29
+ form,
30
+ t,
31
+ onFieldChange,
32
+ unsupportedReason,
33
+ year,
34
+ onYearChange,
35
+ yearOptions,
36
+ }: SloveniaTaxProfileStepProps) {
37
+ const businessFormLabel =
38
+ form.business_form ? t(`slovenia-yearly.profile.business-form.options.${form.business_form}`) : undefined;
39
+ const regimeLabel =
40
+ form.income_tax_regime ? t(`slovenia-yearly.profile.regime.options.${form.income_tax_regime}`) : undefined;
41
+ const residencyLabel =
42
+ form.tax_residency ? t(`slovenia-yearly.profile.residency.options.${form.tax_residency}`) : undefined;
43
+ const vatProfileLabel = form.vat_profile
44
+ ? t(`slovenia-yearly.profile.vat-profile.options.${form.vat_profile}`)
45
+ : undefined;
46
+ const insuranceBasisLabel = form.normiranec_insurance_basis
47
+ ? t(`slovenia-yearly.profile.insurance-basis.options.${form.normiranec_insurance_basis}`)
48
+ : undefined;
49
+
50
+ return (
51
+ <div className="space-y-4">
52
+ <div className="grid gap-4 md:grid-cols-2">
53
+ <div className="space-y-2">
54
+ <Label htmlFor="si-yearly-year">{t("slovenia-yearly.profile.year.label")}</Label>
55
+ <Select value={String(year)} onValueChange={(value) => onYearChange(Number(value))}>
56
+ <SelectTrigger id="si-yearly-year">
57
+ <SelectValue>{year}</SelectValue>
58
+ </SelectTrigger>
59
+ <SelectContent>
60
+ {yearOptions.map((option) => (
61
+ <SelectItem key={option} value={String(option)}>
62
+ {option}
63
+ </SelectItem>
64
+ ))}
65
+ </SelectContent>
66
+ </Select>
67
+ </div>
68
+
69
+ <div className="space-y-2">
70
+ <Label htmlFor="si-yearly-business-form">{t("slovenia-yearly.profile.business-form.label")}</Label>
71
+ <Select
72
+ value={form.business_form || undefined}
73
+ onValueChange={(value) => onFieldChange("business_form", value ?? "")}
74
+ >
75
+ <SelectTrigger id="si-yearly-business-form">
76
+ <SelectValue placeholder={t("slovenia-yearly.profile.business-form.placeholder")}>
77
+ {businessFormLabel}
78
+ </SelectValue>
79
+ </SelectTrigger>
80
+ <SelectContent>
81
+ <SelectItem value="sp">{t("slovenia-yearly.profile.business-form.options.sp")}</SelectItem>
82
+ <SelectItem value="doo">{t("slovenia-yearly.profile.business-form.options.doo")}</SelectItem>
83
+ <SelectItem value="dno">{t("slovenia-yearly.profile.business-form.options.dno")}</SelectItem>
84
+ <SelectItem value="club">{t("slovenia-yearly.profile.business-form.options.club")}</SelectItem>
85
+ </SelectContent>
86
+ </Select>
87
+ </div>
88
+
89
+ <div className="space-y-2">
90
+ <Label htmlFor="si-yearly-regime">{t("slovenia-yearly.profile.regime.label")}</Label>
91
+ <Select
92
+ value={form.income_tax_regime || undefined}
93
+ onValueChange={(value) => onFieldChange("income_tax_regime", value ?? "")}
94
+ >
95
+ <SelectTrigger id="si-yearly-regime">
96
+ <SelectValue placeholder={t("slovenia-yearly.profile.regime.placeholder")}>{regimeLabel}</SelectValue>
97
+ </SelectTrigger>
98
+ <SelectContent>
99
+ <SelectItem value="normirani">{t("slovenia-yearly.profile.regime.options.normirani")}</SelectItem>
100
+ <SelectItem value="dejanski">{t("slovenia-yearly.profile.regime.options.dejanski")}</SelectItem>
101
+ </SelectContent>
102
+ </Select>
103
+ </div>
104
+
105
+ <div className="space-y-2">
106
+ <Label htmlFor="si-yearly-residency">{t("slovenia-yearly.profile.residency.label")}</Label>
107
+ <Select
108
+ value={form.tax_residency || undefined}
109
+ onValueChange={(value) => onFieldChange("tax_residency", value ?? "")}
110
+ >
111
+ <SelectTrigger id="si-yearly-residency">
112
+ <SelectValue placeholder={t("slovenia-yearly.profile.residency.placeholder")}>{residencyLabel}</SelectValue>
113
+ </SelectTrigger>
114
+ <SelectContent>
115
+ <SelectItem value="resident">{t("slovenia-yearly.profile.residency.options.resident")}</SelectItem>
116
+ <SelectItem value="non_resident">{t("slovenia-yearly.profile.residency.options.non_resident")}</SelectItem>
117
+ </SelectContent>
118
+ </Select>
119
+ </div>
120
+
121
+ <div className="space-y-2">
122
+ <Label htmlFor="si-yearly-vat-profile">{t("slovenia-yearly.profile.vat-profile.label")}</Label>
123
+ <Select
124
+ value={form.vat_profile || undefined}
125
+ onValueChange={(value) => onFieldChange("vat_profile", value ?? "")}
126
+ >
127
+ <SelectTrigger id="si-yearly-vat-profile">
128
+ <SelectValue placeholder={t("slovenia-yearly.profile.vat-profile.placeholder")}>
129
+ {vatProfileLabel}
130
+ </SelectValue>
131
+ </SelectTrigger>
132
+ <SelectContent>
133
+ <SelectItem value="standard">{t("slovenia-yearly.profile.vat-profile.options.standard")}</SelectItem>
134
+ <SelectItem value="special_vat_identified">
135
+ {t("slovenia-yearly.profile.vat-profile.options.special_vat_identified")}
136
+ </SelectItem>
137
+ </SelectContent>
138
+ </Select>
139
+ </div>
140
+
141
+ <div className="space-y-2">
142
+ <Label htmlFor="si-yearly-insurance-basis">{t("slovenia-yearly.profile.insurance-basis.label")}</Label>
143
+ <Select
144
+ value={form.normiranec_insurance_basis || undefined}
145
+ onValueChange={(value) => onFieldChange("normiranec_insurance_basis", value ?? "")}
146
+ >
147
+ <SelectTrigger id="si-yearly-insurance-basis">
148
+ <SelectValue placeholder={t("slovenia-yearly.profile.insurance-basis.placeholder")}>
149
+ {insuranceBasisLabel}
150
+ </SelectValue>
151
+ </SelectTrigger>
152
+ <SelectContent>
153
+ <SelectItem value="full_time_self_employed">
154
+ {t("slovenia-yearly.profile.insurance-basis.options.full_time_self_employed")}
155
+ </SelectItem>
156
+ <SelectItem value="other">{t("slovenia-yearly.profile.insurance-basis.options.other")}</SelectItem>
157
+ </SelectContent>
158
+ </Select>
159
+ </div>
160
+
161
+ <div className="space-y-2">
162
+ <Label htmlFor="si-yearly-activity-code">{t("slovenia-yearly.profile.activity-code.label")}</Label>
163
+ <Input
164
+ id="si-yearly-activity-code"
165
+ value={form.activity_code}
166
+ onChange={(event: ChangeEvent<HTMLInputElement>) => onFieldChange("activity_code", event.target.value)}
167
+ placeholder={t("slovenia-yearly.profile.activity-code.placeholder")}
168
+ />
169
+ </div>
170
+
171
+ <div className="space-y-2">
172
+ <Label htmlFor="si-yearly-registration-number">{t("slovenia-yearly.profile.registration-number.label")}</Label>
173
+ <Input
174
+ id="si-yearly-registration-number"
175
+ value={form.registration_number}
176
+ onChange={(event: ChangeEvent<HTMLInputElement>) => onFieldChange("registration_number", event.target.value)}
177
+ placeholder={t("slovenia-yearly.profile.registration-number.placeholder")}
178
+ />
179
+ </div>
180
+ </div>
181
+
182
+ {unsupportedReason && (
183
+ <Alert>
184
+ <AlertCircle className="h-4 w-4" />
185
+ <AlertTitle>{t("slovenia-yearly.profile.unsupported.title")}</AlertTitle>
186
+ <AlertDescription>{unsupportedReason}</AlertDescription>
187
+ </Alert>
188
+ )}
189
+ </div>
190
+ );
191
+ }