@ifto/mantine-kit 0.0.0-stage → 0.1.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 (298) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +471 -2
  3. package/dist/component/atom/AppMain/App.module.js +7 -0
  4. package/dist/component/atom/AppMain/App.module.js.map +1 -0
  5. package/dist/component/atom/AppMain/AppMain.d.ts +7 -0
  6. package/dist/component/atom/AppMain/AppMain.js +14 -0
  7. package/dist/component/atom/AppMain/AppMain.js.map +1 -0
  8. package/dist/component/atom/CancelEditButton/CancelEditButton.d.ts +6 -0
  9. package/dist/component/atom/CancelEditButton/CancelEditButton.js +24 -0
  10. package/dist/component/atom/CancelEditButton/CancelEditButton.js.map +1 -0
  11. package/dist/component/atom/ConfirmEditButton/ConfirmEditButton.d.ts +13 -0
  12. package/dist/component/atom/ConfirmEditButton/ConfirmEditButton.js +30 -0
  13. package/dist/component/atom/ConfirmEditButton/ConfirmEditButton.js.map +1 -0
  14. package/dist/component/atom/DateField/DateField.d.ts +7 -0
  15. package/dist/component/atom/DateField/DateField.js +21 -0
  16. package/dist/component/atom/DateField/DateField.js.map +1 -0
  17. package/dist/component/atom/EditValueButton/EditValueButton.d.ts +6 -0
  18. package/dist/component/atom/EditValueButton/EditValueButton.js +24 -0
  19. package/dist/component/atom/EditValueButton/EditValueButton.js.map +1 -0
  20. package/dist/component/atom/ErrorAlert/ErrorAlert.d.ts +8 -0
  21. package/dist/component/atom/ErrorAlert/ErrorAlert.js +21 -0
  22. package/dist/component/atom/ErrorAlert/ErrorAlert.js.map +1 -0
  23. package/dist/component/atom/Surface/Surface.d.ts +20 -0
  24. package/dist/component/atom/Surface/Surface.js +15 -0
  25. package/dist/component/atom/Surface/Surface.js.map +1 -0
  26. package/dist/component/molecule/Breadcrumb/Breadcrumb.d.ts +12 -0
  27. package/dist/component/molecule/Breadcrumb/Breadcrumb.js +38 -0
  28. package/dist/component/molecule/Breadcrumb/Breadcrumb.js.map +1 -0
  29. package/dist/component/molecule/ExportMenuButton/ExportMenuButton.d.ts +25 -0
  30. package/dist/component/molecule/ExportMenuButton/ExportMenuButton.js +49 -0
  31. package/dist/component/molecule/ExportMenuButton/ExportMenuButton.js.map +1 -0
  32. package/dist/component/molecule/PaperCard/PaperCard.d.ts +7 -0
  33. package/dist/component/molecule/PaperCard/PaperCard.js +17 -0
  34. package/dist/component/molecule/PaperCard/PaperCard.js.map +1 -0
  35. package/dist/component/molecule/PrintSection/PrintSection.d.ts +14 -0
  36. package/dist/component/molecule/PrintSection/PrintSection.js +29 -0
  37. package/dist/component/molecule/PrintSection/PrintSection.js.map +1 -0
  38. package/dist/component/molecule/SelectField/SelectField.d.ts +32 -0
  39. package/dist/component/molecule/SelectField/SelectField.js +38 -0
  40. package/dist/component/molecule/SelectField/SelectField.js.map +1 -0
  41. package/dist/component/molecule/StatsCard/Stats.module.js +15 -0
  42. package/dist/component/molecule/StatsCard/Stats.module.js.map +1 -0
  43. package/dist/component/molecule/StatsCard/StatsCard.d.ts +18 -0
  44. package/dist/component/molecule/StatsCard/StatsCard.js +60 -0
  45. package/dist/component/molecule/StatsCard/StatsCard.js.map +1 -0
  46. package/dist/component/organism/DataForm/DataForm.d.ts +26 -0
  47. package/dist/component/organism/DataForm/DataForm.js +83 -0
  48. package/dist/component/organism/DataForm/DataForm.js.map +1 -0
  49. package/dist/component/organism/DataTabList/DataTabList.d.ts +24 -0
  50. package/dist/component/organism/DataTabList/DataTabList.js +37 -0
  51. package/dist/component/organism/DataTabList/DataTabList.js.map +1 -0
  52. package/dist/component/organism/DataTabList/DataTabList.module.js +13 -0
  53. package/dist/component/organism/DataTabList/DataTabList.module.js.map +1 -0
  54. package/dist/component/organism/EChart/EChart.d.ts +47 -0
  55. package/dist/component/organism/EChart/EChart.js +37 -0
  56. package/dist/component/organism/EChart/EChart.js.map +1 -0
  57. package/dist/component/organism/EChart/buildEChartOption.d.ts +40 -0
  58. package/dist/component/organism/EChart/buildEChartOption.js +57 -0
  59. package/dist/component/organism/EChart/buildEChartOption.js.map +1 -0
  60. package/dist/component/organism/EChart/chart/BarChart.d.ts +22 -0
  61. package/dist/component/organism/EChart/chart/BarChart.js +34 -0
  62. package/dist/component/organism/EChart/chart/BarChart.js.map +1 -0
  63. package/dist/component/organism/EChart/chart/CartesianChart.d.ts +48 -0
  64. package/dist/component/organism/EChart/chart/CartesianChart.js +63 -0
  65. package/dist/component/organism/EChart/chart/CartesianChart.js.map +1 -0
  66. package/dist/component/organism/EChart/chart/ChartHeader.d.ts +36 -0
  67. package/dist/component/organism/EChart/chart/ChartHeader.js +105 -0
  68. package/dist/component/organism/EChart/chart/ChartHeader.js.map +1 -0
  69. package/dist/component/organism/EChart/chart/ChartSeries.d.ts +50 -0
  70. package/dist/component/organism/EChart/chart/ChartSeries.js +23 -0
  71. package/dist/component/organism/EChart/chart/ChartSeries.js.map +1 -0
  72. package/dist/component/organism/EChart/chart/ChartTexts.d.ts +12 -0
  73. package/dist/component/organism/EChart/chart/ChartTexts.js +21 -0
  74. package/dist/component/organism/EChart/chart/ChartTexts.js.map +1 -0
  75. package/dist/component/organism/EChart/chart/ChartType.d.ts +50 -0
  76. package/dist/component/organism/EChart/chart/ChartType.js +1 -0
  77. package/dist/component/organism/EChart/chart/ChartTypeId.d.ts +2 -0
  78. package/dist/component/organism/EChart/chart/ChartTypeId.js +1 -0
  79. package/dist/component/organism/EChart/chart/ChartTypes.d.ts +15 -0
  80. package/dist/component/organism/EChart/chart/ChartTypes.js +24 -0
  81. package/dist/component/organism/EChart/chart/ChartTypes.js.map +1 -0
  82. package/dist/component/organism/EChart/chart/DonutChart.d.ts +32 -0
  83. package/dist/component/organism/EChart/chart/DonutChart.js +111 -0
  84. package/dist/component/organism/EChart/chart/DonutChart.js.map +1 -0
  85. package/dist/component/organism/EChart/chart/LineChart.d.ts +11 -0
  86. package/dist/component/organism/EChart/chart/LineChart.js +20 -0
  87. package/dist/component/organism/EChart/chart/LineChart.js.map +1 -0
  88. package/dist/component/organism/EChart/chart/StackedBarChart.d.ts +15 -0
  89. package/dist/component/organism/EChart/chart/StackedBarChart.js +30 -0
  90. package/dist/component/organism/EChart/chart/StackedBarChart.js.map +1 -0
  91. package/dist/component/organism/EChart/chart/UnitPanels.d.ts +63 -0
  92. package/dist/component/organism/EChart/chart/UnitPanels.js +127 -0
  93. package/dist/component/organism/EChart/chart/UnitPanels.js.map +1 -0
  94. package/dist/component/organism/EChart/echartDefaults.d.ts +32 -0
  95. package/dist/component/organism/EChart/echartDefaults.js +47 -0
  96. package/dist/component/organism/EChart/echartDefaults.js.map +1 -0
  97. package/dist/component/organism/EChart/useEChart.d.ts +35 -0
  98. package/dist/component/organism/EChart/useEChart.js +112 -0
  99. package/dist/component/organism/EChart/useEChart.js.map +1 -0
  100. package/dist/component/organism/Navbar/NavItem.d.ts +16 -0
  101. package/dist/component/organism/Navbar/NavItem.js +1 -0
  102. package/dist/component/organism/Navbar/Navbar.d.ts +20 -0
  103. package/dist/component/organism/Navbar/Navbar.js +64 -0
  104. package/dist/component/organism/Navbar/Navbar.js.map +1 -0
  105. package/dist/component/organism/Navbar/Navbar.module.js +19 -0
  106. package/dist/component/organism/Navbar/Navbar.module.js.map +1 -0
  107. package/dist/component/organism/PageHeader/PageHeader.d.ts +14 -0
  108. package/dist/component/organism/PageHeader/PageHeader.js +55 -0
  109. package/dist/component/organism/PageHeader/PageHeader.js.map +1 -0
  110. package/dist/component/organism/StatsGrid/StatsGrid.d.ts +12 -0
  111. package/dist/component/organism/StatsGrid/StatsGrid.js +46 -0
  112. package/dist/component/organism/StatsGrid/StatsGrid.js.map +1 -0
  113. package/dist/component/organism/StatsGrid/StatsGrid.module.js +17 -0
  114. package/dist/component/organism/StatsGrid/StatsGrid.module.js.map +1 -0
  115. package/dist/component/organism/Table/RowActions.d.ts +23 -0
  116. package/dist/component/organism/Table/RowActions.js +121 -0
  117. package/dist/component/organism/Table/RowActions.js.map +1 -0
  118. package/dist/component/organism/Table/Table.d.ts +51 -0
  119. package/dist/component/organism/Table/Table.js +108 -0
  120. package/dist/component/organism/Table/Table.js.map +1 -0
  121. package/dist/component/organism/ViewTable/ColumnComparator.d.ts +11 -0
  122. package/dist/component/organism/ViewTable/ColumnComparator.js +25 -0
  123. package/dist/component/organism/ViewTable/ColumnComparator.js.map +1 -0
  124. package/dist/component/organism/ViewTable/ViewTable.d.ts +53 -0
  125. package/dist/component/organism/ViewTable/ViewTable.js +123 -0
  126. package/dist/component/organism/ViewTable/ViewTable.js.map +1 -0
  127. package/dist/component/template/CreateFormPage/CreateFormPage.d.ts +19 -0
  128. package/dist/component/template/CreateFormPage/CreateFormPage.js +41 -0
  129. package/dist/component/template/CreateFormPage/CreateFormPage.js.map +1 -0
  130. package/dist/component/template/EditFormPage/EditFormPage.d.ts +19 -0
  131. package/dist/component/template/EditFormPage/EditFormPage.js +42 -0
  132. package/dist/component/template/EditFormPage/EditFormPage.js.map +1 -0
  133. package/dist/component/template/FormPage/FormPage.d.ts +25 -0
  134. package/dist/component/template/FormPage/FormPage.js +130 -0
  135. package/dist/component/template/FormPage/FormPage.js.map +1 -0
  136. package/dist/component/template/FormPage/FormType.d.ts +6 -0
  137. package/dist/component/template/FormPage/FormType.js +12 -0
  138. package/dist/component/template/FormPage/FormType.js.map +1 -0
  139. package/dist/component/template/Layout/Layout.d.ts +21 -0
  140. package/dist/component/template/Layout/Layout.js +121 -0
  141. package/dist/component/template/Layout/Layout.js.map +1 -0
  142. package/dist/component/template/Layout/Layout.module.js +19 -0
  143. package/dist/component/template/Layout/Layout.module.js.map +1 -0
  144. package/dist/component/template/ListPage/ListPage.d.ts +32 -0
  145. package/dist/component/template/ListPage/ListPage.js +47 -0
  146. package/dist/component/template/ListPage/ListPage.js.map +1 -0
  147. package/dist/component/template/PrintPage/PrintPage.d.ts +25 -0
  148. package/dist/component/template/PrintPage/PrintPage.js +115 -0
  149. package/dist/component/template/PrintPage/PrintPage.js.map +1 -0
  150. package/dist/component/template/ViewPage/ViewPage.d.ts +11 -0
  151. package/dist/component/template/ViewPage/ViewPage.js +49 -0
  152. package/dist/component/template/ViewPage/ViewPage.js.map +1 -0
  153. package/dist/data/ListDataSource.d.ts +12 -0
  154. package/dist/data/ListDataSource.js +1 -0
  155. package/dist/data/SaveDataSource.d.ts +16 -0
  156. package/dist/data/SaveDataSource.js +1 -0
  157. package/dist/export/ExportCellText.d.ts +18 -0
  158. package/dist/export/ExportCellText.js +60 -0
  159. package/dist/export/ExportCellText.js.map +1 -0
  160. package/dist/export/ExportDocument.d.ts +127 -0
  161. package/dist/export/ExportDocument.js +59 -0
  162. package/dist/export/ExportDocument.js.map +1 -0
  163. package/dist/export/ExportDownload.d.ts +9 -0
  164. package/dist/export/ExportDownload.js +19 -0
  165. package/dist/export/ExportDownload.js.map +1 -0
  166. package/dist/export/ExportFileName.d.ts +11 -0
  167. package/dist/export/ExportFileName.js +24 -0
  168. package/dist/export/ExportFileName.js.map +1 -0
  169. package/dist/export/ExportFormat.d.ts +30 -0
  170. package/dist/export/ExportFormat.js +1 -0
  171. package/dist/export/ExportFormats.d.ts +12 -0
  172. package/dist/export/ExportFormats.js +16 -0
  173. package/dist/export/ExportFormats.js.map +1 -0
  174. package/dist/export/ExportTexts.d.ts +14 -0
  175. package/dist/export/ExportTexts.js +23 -0
  176. package/dist/export/ExportTexts.js.map +1 -0
  177. package/dist/export/csv/CsvFormat.d.ts +41 -0
  178. package/dist/export/csv/CsvFormat.js +91 -0
  179. package/dist/export/csv/CsvFormat.js.map +1 -0
  180. package/dist/export/xlsx/XlsxFormat.d.ts +35 -0
  181. package/dist/export/xlsx/XlsxFormat.js +66 -0
  182. package/dist/export/xlsx/XlsxFormat.js.map +1 -0
  183. package/dist/export/xlsx/XlsxNumberFormat.d.ts +8 -0
  184. package/dist/export/xlsx/XlsxNumberFormat.js +15 -0
  185. package/dist/export/xlsx/XlsxNumberFormat.js.map +1 -0
  186. package/dist/export/xlsx/XlsxSheetName.d.ts +12 -0
  187. package/dist/export/xlsx/XlsxSheetName.js +62 -0
  188. package/dist/export/xlsx/XlsxSheetName.js.map +1 -0
  189. package/dist/export/xlsx/XlsxSheetWriter.d.ts +67 -0
  190. package/dist/export/xlsx/XlsxSheetWriter.js +215 -0
  191. package/dist/export/xlsx/XlsxSheetWriter.js.map +1 -0
  192. package/dist/export/xlsx/XlsxStyle.d.ts +51 -0
  193. package/dist/export/xlsx/XlsxStyle.js +87 -0
  194. package/dist/export/xlsx/XlsxStyle.js.map +1 -0
  195. package/dist/hook/useIsMobile.d.ts +5 -0
  196. package/dist/hook/useIsMobile.js +16 -0
  197. package/dist/hook/useIsMobile.js.map +1 -0
  198. package/dist/hook/useKeyedService.d.ts +22 -0
  199. package/dist/hook/useKeyedService.js +38 -0
  200. package/dist/hook/useKeyedService.js.map +1 -0
  201. package/dist/hook/useLightColorSchemeOnPrint.d.ts +9 -0
  202. package/dist/hook/useLightColorSchemeOnPrint.js +36 -0
  203. package/dist/hook/useLightColorSchemeOnPrint.js.map +1 -0
  204. package/dist/hook/useService.d.ts +12 -0
  205. package/dist/hook/useService.js +29 -0
  206. package/dist/hook/useService.js.map +1 -0
  207. package/dist/http/ApiError.d.ts +13 -0
  208. package/dist/http/ApiError.js +22 -0
  209. package/dist/http/ApiError.js.map +1 -0
  210. package/dist/http/AxiosHttpClient.d.ts +21 -0
  211. package/dist/http/AxiosHttpClient.js +67 -0
  212. package/dist/http/AxiosHttpClient.js.map +1 -0
  213. package/dist/http/AxiosHttpClientConfig.d.ts +37 -0
  214. package/dist/http/AxiosHttpClientConfig.js +19 -0
  215. package/dist/http/AxiosHttpClientConfig.js.map +1 -0
  216. package/dist/i18n/KitLocale.d.ts +4 -0
  217. package/dist/i18n/KitLocale.js +7 -0
  218. package/dist/i18n/KitLocale.js.map +1 -0
  219. package/dist/i18n/KitMessages.d.ts +146 -0
  220. package/dist/i18n/KitMessages.js +1 -0
  221. package/dist/i18n/messages/enUS.d.ts +3 -0
  222. package/dist/i18n/messages/enUS.js +112 -0
  223. package/dist/i18n/messages/enUS.js.map +1 -0
  224. package/dist/i18n/messages/ptBR.d.ts +3 -0
  225. package/dist/i18n/messages/ptBR.js +97 -0
  226. package/dist/i18n/messages/ptBR.js.map +1 -0
  227. package/dist/i18n/resolveMessages.d.ts +13 -0
  228. package/dist/i18n/resolveMessages.js +29 -0
  229. package/dist/i18n/resolveMessages.js.map +1 -0
  230. package/dist/model/Identifiable.d.ts +7 -0
  231. package/dist/model/Identifiable.js +1 -0
  232. package/dist/provider/KitConfig.d.ts +26 -0
  233. package/dist/provider/KitConfig.js +1 -0
  234. package/dist/provider/KitContext.d.ts +9 -0
  235. package/dist/provider/KitContext.js +27 -0
  236. package/dist/provider/KitContext.js.map +1 -0
  237. package/dist/provider/KitProvider.d.ts +7 -0
  238. package/dist/provider/KitProvider.js +31 -0
  239. package/dist/provider/KitProvider.js.map +1 -0
  240. package/dist/provider/useKit.d.ts +15 -0
  241. package/dist/provider/useKit.js +28 -0
  242. package/dist/provider/useKit.js.map +1 -0
  243. package/dist/router/FormRouteSegments.d.ts +16 -0
  244. package/dist/router/FormRouteSegments.js +19 -0
  245. package/dist/router/FormRouteSegments.js.map +1 -0
  246. package/dist/router/RouterAdapter.d.ts +24 -0
  247. package/dist/router/RouterAdapter.js +1 -0
  248. package/dist/router/anchorRouter.d.ts +7 -0
  249. package/dist/router/anchorRouter.js +23 -0
  250. package/dist/router/anchorRouter.js.map +1 -0
  251. package/dist/styles/print.css +93 -0
  252. package/dist/styles.css +188 -0
  253. package/dist/util/ArrayUtil.d.ts +39 -0
  254. package/dist/util/ArrayUtil.js +48 -0
  255. package/dist/util/ArrayUtil.js.map +1 -0
  256. package/dist/util/ColorUtil.d.ts +7 -0
  257. package/dist/util/ColorUtil.js +16 -0
  258. package/dist/util/ColorUtil.js.map +1 -0
  259. package/dist/util/CompareUtil.d.ts +19 -0
  260. package/dist/util/CompareUtil.js +51 -0
  261. package/dist/util/CompareUtil.js.map +1 -0
  262. package/dist/util/DateUtil.d.ts +37 -0
  263. package/dist/util/DateUtil.js +53 -0
  264. package/dist/util/DateUtil.js.map +1 -0
  265. package/dist/util/DownloadUtil.d.ts +6 -0
  266. package/dist/util/DownloadUtil.js +25 -0
  267. package/dist/util/DownloadUtil.js.map +1 -0
  268. package/dist/util/EnumUtil.d.ts +19 -0
  269. package/dist/util/EnumUtil.js +32 -0
  270. package/dist/util/EnumUtil.js.map +1 -0
  271. package/dist/util/FormUtil.d.ts +8 -0
  272. package/dist/util/FormUtil.js +14 -0
  273. package/dist/util/FormUtil.js.map +1 -0
  274. package/dist/util/HtmlUtil.d.ts +8 -0
  275. package/dist/util/HtmlUtil.js +23 -0
  276. package/dist/util/HtmlUtil.js.map +1 -0
  277. package/dist/util/Notifications.d.ts +30 -0
  278. package/dist/util/Notifications.js +59 -0
  279. package/dist/util/Notifications.js.map +1 -0
  280. package/dist/util/NumberUtil.d.ts +19 -0
  281. package/dist/util/NumberUtil.js +33 -0
  282. package/dist/util/NumberUtil.js.map +1 -0
  283. package/dist/util/ObjectUtil.d.ts +22 -0
  284. package/dist/util/ObjectUtil.js +34 -0
  285. package/dist/util/ObjectUtil.js.map +1 -0
  286. package/dist/util/SearchParamsUtil.d.ts +23 -0
  287. package/dist/util/SearchParamsUtil.js +29 -0
  288. package/dist/util/SearchParamsUtil.js.map +1 -0
  289. package/dist/util/TransformData.d.ts +14 -0
  290. package/dist/util/TransformData.js +31 -0
  291. package/dist/util/TransformData.js.map +1 -0
  292. package/dist/util/ValidationUtil.d.ts +9 -0
  293. package/dist/util/ValidationUtil.js +16 -0
  294. package/dist/util/ValidationUtil.js.map +1 -0
  295. package/dist/util/parseActionsPageParams.d.ts +14 -0
  296. package/dist/util/parseActionsPageParams.js +29 -0
  297. package/dist/util/parseActionsPageParams.js.map +1 -0
  298. package/package.json +149 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Instituto Federal do Tocantins (IFTO) - Campus Palmas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,472 @@
1
- # Temporary Holding Version
1
+ # @ifto/mantine-kit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Build](https://github.com/iftopalmas/mantine-kit/actions/workflows/build.yml/badge.svg)](https://github.com/iftopalmas/mantine-kit/actions/workflows/build.yml)
4
+ [![npm](https://img.shields.io/npm/v/@ifto/mantine-kit)](https://www.npmjs.com/package/@ifto/mantine-kit)
5
+ [![Storybook](https://img.shields.io/badge/docs-Storybook-ff4785)](https://iftopalmas.github.io/mantine-kit/)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+
8
+ General purpose [Mantine](https://mantine.dev) components for business React apps: CRUD tables and forms, an app
9
+ layout with a side menu, [Apache ECharts](https://echarts.apache.org) charts, Excel/CSV export, print-ready reports and
10
+ a REST HTTP client.
11
+
12
+ - **Works with any router.** Components never import a router: they navigate through a small adapter you give to the
13
+ `KitProvider` (examples for Next.js and React Router below). Without one, plain links are used.
14
+ - **Internationalized.** Every text comes from a typed message catalog, with American English (`en-US`, the default)
15
+ and Brazilian Portuguese (`pt-BR`). Numbers, dates and sorting follow the locale. You can override any text.
16
+ - **Bound to data by contracts, not classes.** Tables and forms accept any object with `findAll`/`delete` or `save`
17
+ methods, so they work with REST services, GraphQL clients or in-memory data alike.
18
+ - **Pay only for what you use.** Each component is imported from its own file, so optional dependencies (ECharts,
19
+ ExcelJS, Axios, mantine-datatable) only enter your bundle if you use the components that need them. ECharts and
20
+ ExcelJS are loaded on demand.
21
+ - **Ready for the Next.js App Router.** Every module is marked as a Client Component.
22
+
23
+ **Documentation of every component, with live examples: [Storybook](https://iftopalmas.github.io/mantine-kit/).**
24
+
25
+ ## Contents
26
+
27
+ - [How to use](#how-to-use)
28
+ - [Examples](#examples)
29
+ - [Configuration](#configuration)
30
+ - [Components](#components)
31
+ - [Internationalization](#internationalization)
32
+ - [Storybook](#storybook)
33
+ - [Development](#development)
34
+ - [Publishing](#publishing)
35
+
36
+ ## How to use
37
+
38
+ **1. Install** the library and its required peer dependencies:
39
+
40
+ ```bash
41
+ yarn add @ifto/mantine-kit @mantine/core @mantine/hooks @mantine/dates @mantine/form @mantine/modals \
42
+ @mantine/notifications @tabler/icons-react clsx dayjs react react-dom
43
+ ```
44
+
45
+ Install the optional ones only if you use the components that need them:
46
+
47
+ | Package | Needed by |
48
+ |---|---|
49
+ | `mantine-datatable` | `Table`, `ViewTable`, `ListPage` |
50
+ | `echarts` | `EChart` and the chart types |
51
+ | `exceljs` | Excel export |
52
+ | `axios` | `AxiosHttpClient` |
53
+ | `zod` | `selectedId` validation helper |
54
+
55
+ **2. Import the CSS** once, after the Mantine CSS (e.g. in the root layout of the app):
56
+
57
+ ```ts
58
+ import '@mantine/core/styles.css';
59
+ import '@mantine/notifications/styles.css';
60
+ import 'mantine-datatable/styles.css';
61
+ import '@ifto/mantine-kit/styles.css';
62
+ import '@ifto/mantine-kit/print.css'; // only if you use PrintPage
63
+ ```
64
+
65
+ **3. Wrap the app** with the Mantine providers and the `KitProvider`:
66
+
67
+ ```tsx
68
+ import { MantineProvider } from '@mantine/core';
69
+ import { ModalsProvider } from '@mantine/modals';
70
+ import { Notifications } from '@mantine/notifications';
71
+ import { KitProvider } from '@ifto/mantine-kit/provider/KitProvider';
72
+
73
+ export function Providers({ children }: { children: React.ReactNode }) {
74
+ return (
75
+ <MantineProvider>
76
+ <ModalsProvider>
77
+ <Notifications />
78
+ <KitProvider appName="My System" locale="en-US">
79
+ {children}
80
+ </KitProvider>
81
+ </ModalsProvider>
82
+ </MantineProvider>
83
+ );
84
+ }
85
+ ```
86
+
87
+ Give your router to the `KitProvider` (`router={nextRouter}`) so links do not reload the page; see
88
+ [Router adapter](#router-adapter).
89
+
90
+ **4. Import each component from its own file** and use it:
91
+
92
+ ```tsx
93
+ import { SelectField } from '@ifto/mantine-kit/component/molecule/SelectField/SelectField';
94
+
95
+ <SelectField label="City" data={cities} getId={city => city.id} getDescription={city => city.name} />;
96
+ ```
97
+
98
+ The path is the one of the file inside `src`, without the extension (see [Components](#components)). There is no
99
+ `index` with everything, so you only bundle what you import.
100
+
101
+ ## Examples
102
+
103
+ ### CRUD list page
104
+
105
+ `ListPage` shows the records in a sortable, paginated table with view, edit and delete actions. Its `service` is any
106
+ object with `findAll` and `delete`:
107
+
108
+ ```tsx
109
+ import ListPage from '@ifto/mantine-kit/component/template/ListPage/ListPage';
110
+ import type { ListDataSource } from '@ifto/mantine-kit/data/ListDataSource';
111
+
112
+ type Region = { id?: number; name: string };
113
+
114
+ const regions: ListDataSource<Region> = {
115
+ findAll: () => fetch('/api/region').then(response => response.json()),
116
+ delete: id => fetch(`/api/region/${id}`, { method: 'DELETE' }).then(() => undefined)
117
+ };
118
+
119
+ export function RegionsPage() {
120
+ return (
121
+ <ListPage
122
+ title="Regions"
123
+ titlePlural="Regions"
124
+ breadcrumbItems={[{ title: 'Regions', href: '/region' }]}
125
+ addActionRoute="/region/create"
126
+ service={regions}
127
+ resourceBasePath="/region"
128
+ tableColumns={[{ accessor: 'name', title: 'Name', sortable: true }]}
129
+ />
130
+ );
131
+ }
132
+ ```
133
+
134
+ ### CRUD form page
135
+
136
+ `FormPage` creates, edits or views a record and saves it with any object that has a `save(id, data)` method:
137
+
138
+ ```tsx
139
+ import { TextInput } from '@mantine/core';
140
+ import { useForm } from '@mantine/form';
141
+ import FormPage from '@ifto/mantine-kit/component/template/FormPage/FormPage';
142
+ import { FormType } from '@ifto/mantine-kit/component/template/FormPage/FormType';
143
+ import type { SaveDataSource } from '@ifto/mantine-kit/data/SaveDataSource';
144
+
145
+ const regionService: SaveDataSource<Region, Region> = {
146
+ save: (id, data) =>
147
+ fetch(id ? `/api/region/${id}` : '/api/region', {
148
+ method: id ? 'PUT' : 'POST',
149
+ headers: { 'Content-Type': 'application/json' },
150
+ body: JSON.stringify(data)
151
+ }).then(response => response.json())
152
+ };
153
+
154
+ export function NewRegionPage() {
155
+ const form = useForm<Region>({ initialValues: { name: '' } });
156
+
157
+ return (
158
+ <FormPage service={regionService} title="Region" form={form} formType={FormType.Create} backRoute="/region">
159
+ <TextInput label="Name" {...form.getInputProps('name')} />
160
+ </FormPage>
161
+ );
162
+ }
163
+ ```
164
+
165
+ To read the action from a catch-all route (`/region/create`, `/region/edit/5`), use
166
+ `parseActionsPageParams(segments)` (`util/parseActionsPageParams`).
167
+
168
+ ### App layout with a side menu
169
+
170
+ ```tsx
171
+ import { Menu, Title } from '@mantine/core';
172
+ import { IconHome, IconMap } from '@tabler/icons-react';
173
+ import { Layout } from '@ifto/mantine-kit/component/template/Layout/Layout';
174
+
175
+ const menu = [
176
+ { link: '/', label: 'Home', icon: IconHome },
177
+ { link: '/region', label: 'Regions', icon: IconMap }
178
+ ];
179
+
180
+ export function AppLayout({ children }: { children: React.ReactNode }) {
181
+ return (
182
+ <Layout logo={<Title order={4}>My System</Title>} navItems={menu} userMenu={<Menu.Item>Log out</Menu.Item>}>
183
+ {children}
184
+ </Layout>
185
+ );
186
+ }
187
+ ```
188
+
189
+ ### Chart
190
+
191
+ `EChart` builds the series from your data with `getName`/`getValue`. ECharts is loaded only when a chart is shown:
192
+
193
+ ```tsx
194
+ import { EChart } from '@ifto/mantine-kit/component/organism/EChart/EChart';
195
+
196
+ const coverage = [
197
+ { region: 'North', rate: 0.82 },
198
+ { region: 'South', rate: 0.64 }
199
+ ];
200
+
201
+ <EChart
202
+ data={coverage}
203
+ getName={item => item.region}
204
+ getValue={item => item.rate}
205
+ option={{ xAxis: { type: 'category', data: coverage.map(item => item.region) }, yAxis: {}, series: [{ type: 'bar' }] }}
206
+ style={{ height: 360 }}
207
+ />;
208
+ ```
209
+
210
+ The chart types in `component/organism/EChart/chart` (`LINE_CHART`, `BAR_CHART`, `STACKED_BAR_CHART`, `DONUT_CHART`)
211
+ build a complete option, with one panel per unit, from generic series:
212
+ `option={LINE_CHART.buildOption(data, { title: 'Revenue', locale: 'en-US' })}`.
213
+
214
+ ### Export to Excel or CSV
215
+
216
+ ```tsx
217
+ import ExportMenuButton from '@ifto/mantine-kit/component/molecule/ExportMenuButton/ExportMenuButton';
218
+ import { downloadExport } from '@ifto/mantine-kit/export/ExportDownload';
219
+ import { EXPORT_FORMATS } from '@ifto/mantine-kit/export/ExportFormats';
220
+
221
+ <ExportMenuButton
222
+ formats={EXPORT_FORMATS}
223
+ onExport={format =>
224
+ downloadExport(
225
+ {
226
+ title: 'Sales report',
227
+ fileName: 'sales',
228
+ info: [{ label: 'Period', value: '2026' }],
229
+ generatedAt: new Date(),
230
+ branding: { systemName: 'My System', siteUrl: window.location.origin },
231
+ sheets: [{ name: 'Sales', columns: [{ header: 'Product' }, { header: 'Total' }], rows: [['Water', 10]] }],
232
+ locale: 'en-US'
233
+ },
234
+ format
235
+ )
236
+ }
237
+ />;
238
+ ```
239
+
240
+ The CSV uses the decimal separator of the locale and a column separator that does not clash with it (`;` in `pt-BR`,
241
+ `,` in `en-US`), as Excel in that language expects.
242
+
243
+ The menu offers the formats you give: the built-in ones (`EXPORT_FORMATS`, `XLSX_FORMAT`, `CSV_FORMAT`), an Excel
244
+ format with your brand colors (`new XlsxFormat({ colors: { primary: 'FF2B8A3E' } })`) or any format of your own, by
245
+ implementing the `ExportFormat` interface (e.g. PDF or JSON).
246
+
247
+ ### Printable report
248
+
249
+ ```tsx
250
+ import PrintSection from '@ifto/mantine-kit/component/molecule/PrintSection/PrintSection';
251
+ import PrintPage from '@ifto/mantine-kit/component/template/PrintPage/PrintPage';
252
+
253
+ <PrintPage title="Regions report" systemName="My System" info={[{ label: 'Period', value: '2026' }]}>
254
+ <PrintSection title="Regions">{regionsTable}</PrintSection>
255
+ <PrintSection title="Summary" newPage>
256
+ {summary}
257
+ </PrintSection>
258
+ </PrintPage>;
259
+ ```
260
+
261
+ ### HTTP client
262
+
263
+ ```ts
264
+ import { AxiosHttpClient } from '@ifto/mantine-kit/http/AxiosHttpClient';
265
+ import { ApiError } from '@ifto/mantine-kit/http/ApiError';
266
+
267
+ const httpClient = new AxiosHttpClient({ baseURL: 'https://api.example.com', timeout: 10_000, locale: 'en-US' });
268
+ // Interceptors, e.g. for the authentication token
269
+ httpClient.axiosInstance.interceptors.request.use(config => config);
270
+
271
+ try {
272
+ await httpClient.put('/region/1', data);
273
+ } catch (e) {
274
+ if (e instanceof ApiError && e.code === 'CONCURRENT_UPDATE') {
275
+ // another user changed the record
276
+ }
277
+ }
278
+ ```
279
+
280
+ By default, the message and the code of an error are read from the `message` and `code` fields of the response body
281
+ (the error format of a Spring API). For another format, give an `errorParser` in the configuration.
282
+
283
+ More examples, with every state of each component, are in the [Storybook](https://iftopalmas.github.io/mantine-kit/).
284
+
285
+ ## Configuration
286
+
287
+ Options of the `KitProvider`:
288
+
289
+ | Option | Default | Description |
290
+ |---|---|---|
291
+ | `router` | plain `<a>` links | Adapter to the router of the app (see below). |
292
+ | `appName` | none | Shown in the browser tab title by the page templates (e.g. "Regions - My System"). |
293
+ | `locale` | `en-US` | Language of the texts and format of numbers and dates: `en-US` or `pt-BR`. |
294
+ | `messages` | none | Texts that replace the ones of the locale, by section (see [Internationalization](#internationalization)). |
295
+ | `formRouteSegments` | `create`, `edit`, `view` | URL segments of the create, edit and view pages of a record (e.g. `/region/edit/5`), independent of the locale: `ENGLISH_FORM_ROUTE_SEGMENTS` (default), `PORTUGUESE_FORM_ROUTE_SEGMENTS` (`criar`, `editar`, `visualizar`) or your own, from `router/FormRouteSegments`. |
296
+
297
+ ### Router adapter
298
+
299
+ A `RouterAdapter` has a `Link` component (receiving `href`), a `usePathname` hook and a `useNavigate` hook.
300
+
301
+ **Next.js (App Router):**
302
+
303
+ ```tsx
304
+ 'use client';
305
+
306
+ import NextLink from 'next/link';
307
+ import { usePathname, useRouter } from 'next/navigation';
308
+
309
+ import type { RouterAdapter } from '@ifto/mantine-kit/router/RouterAdapter';
310
+
311
+ export const nextRouter: RouterAdapter = {
312
+ Link: NextLink,
313
+ usePathname,
314
+ useNavigate: () => useRouter().push
315
+ };
316
+ ```
317
+
318
+ **React Router:**
319
+
320
+ ```tsx
321
+ import { forwardRef } from 'react';
322
+ import { Link, useLocation, useNavigate } from 'react-router';
323
+
324
+ import type { RouterAdapter, RouterLinkProps } from '@ifto/mantine-kit/router/RouterAdapter';
325
+
326
+ const RouterLink = forwardRef<HTMLAnchorElement, RouterLinkProps>(({ href, ...props }, ref) => (
327
+ <Link ref={ref} to={href} {...props} />
328
+ ));
329
+
330
+ export const reactRouter: RouterAdapter = {
331
+ Link: RouterLink,
332
+ usePathname: () => useLocation().pathname,
333
+ useNavigate: () => {
334
+ const navigate = useNavigate();
335
+ return (url: string) => navigate(url);
336
+ }
337
+ };
338
+ ```
339
+
340
+ ## Components
341
+
342
+ Every file is imported by its path inside `src`, without the extension, e.g.
343
+ `@ifto/mantine-kit/component/organism/Table/Table`. The components follow the
344
+ [atomic design](https://atomicdesign.bradfrost.com) layers.
345
+
346
+ ### Atoms (`component/atom`)
347
+
348
+ | Component | What it does |
349
+ |---|---|
350
+ | `AppMain` | Main content area of the `Layout`, with the page background in light and dark color schemes. |
351
+ | `CancelEditButton` | Icon button that cancels the in-place editing of a table row. |
352
+ | `ConfirmEditButton` | Icon button that confirms the in-place editing of a table row (keeps its tooltip when disabled). |
353
+ | `EditValueButton` | Icon button that starts the in-place editing of a table row. |
354
+ | `DateField` | Clearable date input in the date format of the locale. |
355
+ | `ErrorAlert` | Red alert that shows an error message. |
356
+ | `Surface` | Polymorphic container, the base of cards and page headers. |
357
+
358
+ ### Molecules (`component/molecule`)
359
+
360
+ | Component | What it does |
361
+ |---|---|
362
+ | `Breadcrumb` | Navigation path to the current page, with links to the previous ones. |
363
+ | `ExportMenuButton` | "Export" button with a menu of file formats (Excel, CSV); shows a notification if the export fails. |
364
+ | `PaperCard` | Bordered card that groups the content of a page. |
365
+ | `PrintSection` | Titled section of a report that can start on a new printed page and never leaves its title alone. |
366
+ | `SelectField` | Select built from any array of objects, with placeholder and "not found" texts built from the label. |
367
+ | `StatsCard` | Card with a key value, its change from the previous period and the period. |
368
+
369
+ ### Organisms (`component/organism`)
370
+
371
+ | Component | What it does |
372
+ |---|---|
373
+ | `DataForm` | Form in a card with back and submit buttons, optional confirmation, notifications and navigation. |
374
+ | `DataTabList` | Tabs built from an array of objects, one tab per object, wrapping in rows. |
375
+ | `EChart` | React wrapper of Apache ECharts: builds the series from raw data, loads ECharts on demand, resizes and prints. |
376
+ | `Navbar` | Side menu with links and collapsible groups, highlighting the current page. |
377
+ | `PageHeader` | Page title with the breadcrumb and, in list pages, the "Add" button. |
378
+ | `StatsGrid` | Responsive grid of `StatsCard`s, with placeholders while loading. |
379
+ | `Table` | Table of the records of a data source, with view, edit and delete (with confirmation) actions. |
380
+ | `RowActions` | View, edit and delete buttons of a `Table` row. |
381
+ | `ViewTable` | Sortable and paginated table (on top of mantine-datatable), with locale-aware sorting. |
382
+
383
+ The `EChart/chart` folder has chart types that build the ECharts option from generic series: `LineChart`, `BarChart`
384
+ (negative values highlighted), `StackedBarChart` and `DonutChart`, with one panel per unit of measure.
385
+
386
+ ### Templates (`component/template`)
387
+
388
+ | Component | What it does |
389
+ |---|---|
390
+ | `Layout` | App shell: header with the brand, color scheme toggle and user menu, collapsible side menu and content area. |
391
+ | `ListPage` | List page of records: header with the "Add" button, optional filters and the `Table`. |
392
+ | `FormPage` | Create, edit or view form page that saves the record in a `SaveDataSource`. |
393
+ | `CreateFormPage` | Form page to create a record with a given function. |
394
+ | `EditFormPage` | Form page to update a record with a given function. |
395
+ | `ViewPage` | Page that shows a record, with a back button. |
396
+ | `PrintPage` | Report page formatted to be printed or saved as PDF by the browser. |
397
+
398
+ ### Other modules
399
+
400
+ | Module | What it does |
401
+ |---|---|
402
+ | `provider/KitProvider`, `provider/useKit` | Configuration of the library (router, app name, locale, texts) and the hooks to read it. |
403
+ | `router/RouterAdapter`, `router/anchorRouter` | Contract of the router adapter and the default one, with plain links. |
404
+ | `data/ListDataSource`, `data/SaveDataSource` | Contracts of the data sources of the tables and forms. |
405
+ | `i18n/*` | Message catalog type, the `en-US` and `pt-BR` catalogs and `resolveMessages`. |
406
+ | `export/*` | Export model (`ExportDocument`), the Excel and CSV formats and `downloadExport`. |
407
+ | `http/AxiosHttpClient`, `http/ApiError` | REST client that turns backend errors into `ApiError`s with message and code. |
408
+ | `hook/*` | `useService` and `useKeyedService` (fetch data, ignoring stale responses), `useIsMobile`, `useLightColorSchemeOnPrint`. |
409
+ | `util/*` | Notifications, sorting, number and date formatting, URL building, form helpers and more. |
410
+
411
+ ## Internationalization
412
+
413
+ All texts the components show are in a typed catalog (`i18n/KitMessages.ts`), grouped by component: `common`, `form`,
414
+ `table`, `rowEdit`, `select`, `layout`, `print`, `stats`, `export`, `chart` and `http`. Each locale is an object of
415
+ this type (`i18n/messages/ptBR.ts`, `i18n/messages/enUS.ts`), so a missing translation is a compile error. Texts with
416
+ variables are functions, such as `table.pagination({ from, to, totalRecords })`.
417
+
418
+ Choose the locale and override any text in the `KitProvider`. An app that already uses an i18n library (e.g.
419
+ `react-i18next`, `next-intl`) passes its translations the same way:
420
+
421
+ ```tsx
422
+ <KitProvider locale="en-US" messages={{ common: { back: t('back') }, table: { noRecords: t('empty') } }}>
423
+ ```
424
+
425
+ Code outside React receives the locale (and, optionally, texts) directly: `ExportDocument.locale`,
426
+ `ChartContext.locale` and `AxiosHttpClientConfig.locale`. URLs are not translated: the CRUD route segments are a
427
+ separate option (`formRouteSegments`).
428
+
429
+ ## Storybook
430
+
431
+ The [Storybook](https://iftopalmas.github.io/mantine-kit/) documents every component: a **Docs** page per component,
432
+ generated from its props types and JSDoc, and stories with examples of its states, whose props can be changed in the
433
+ **Controls** panel. The toolbar switches the locale (`en-US`/`pt-BR`) and the theme (light/dark) of all stories.
434
+
435
+ ```bash
436
+ yarn storybook # development server at http://localhost:6006
437
+ yarn storybook:build # static site in storybook-static/
438
+ ```
439
+
440
+ The stories live in `stories/`, mirroring `src/`. The [`storybook.yml`](.github/workflows/storybook.yml) workflow
441
+ publishes the site to GitHub Pages on every push to `main`.
442
+
443
+ ## Development
444
+
445
+ See [AGENTS.md](AGENTS.md) for the architecture and the conventions of the code.
446
+
447
+ ```bash
448
+ nvm use # Node version of .nvmrc
449
+ corepack enable
450
+ yarn install
451
+ yarn test # Prettier, lint, typecheck and tests with coverage
452
+ yarn build # generates dist/
453
+ ```
454
+
455
+ ## Publishing
456
+
457
+ The [`publish.yml`](.github/workflows/publish.yml) workflow publishes to npm when a tag equal to the version in
458
+ `package.json` is pushed:
459
+
460
+ ```bash
461
+ # After updating "version" in package.json and merging it into main
462
+ git tag v0.1.0
463
+ git push origin v0.1.0
464
+ ```
465
+
466
+ Versions with a suffix (e.g. `v0.2.0-beta.1`) are published with the `next` dist-tag. The workflow needs the
467
+ `NPM_TOKEN` secret (an npm granular access token allowed to publish in the `@ifto` scope) in the `npm` environment of
468
+ the repository.
469
+
470
+ ## License
471
+
472
+ [MIT](LICENSE)
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ // src/component/atom/AppMain/App.module.css
3
+ var main = "mk-App-module-main-8515C";
4
+ var App_module_default = { main };
5
+ export { App_module_default as default, main };
6
+
7
+ //# sourceMappingURL=App.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.module.js","names":[],"sources":["../../../../src/component/atom/AppMain/App.module.css"],"sourcesContent":[".main {\n min-height: 95vh;\n\n @mixin light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin dark {\n background-color: var(--mantine-color-dark-6);\n }\n\n /* On paper, the page is white and only as tall as its content (see styles/print.css). */\n @media print {\n min-height: 0;\n background-color: #fff !important;\n }\n}\n"],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ type AppMainProps = {
3
+ children: ReactNode;
4
+ };
5
+ /** Main content area of the {@link Layout}, with the page background in the light and dark color schemes. */
6
+ declare const AppMain: ({ children }: AppMainProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default AppMain;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import App_module_default from "./App.module.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { Box } from "@mantine/core";
5
+ // src/component/atom/AppMain/AppMain.tsx
6
+ /** Main content area of the {@link Layout}, with the page background in the light and dark color schemes. */
7
+ var AppMain = ({ children }) => /* @__PURE__ */ jsx(Box, {
8
+ p: 0,
9
+ className: App_module_default.main,
10
+ children
11
+ });
12
+ export { AppMain as default };
13
+
14
+ //# sourceMappingURL=AppMain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppMain.js","names":["classes"],"sources":["../../../../src/component/atom/AppMain/AppMain.tsx"],"sourcesContent":["import { ReactNode } from 'react';\n\nimport { Box } from '@mantine/core';\n\nimport classes from './App.module.css';\n\ntype AppMainProps = {\n children: ReactNode;\n};\n\n/** Main content area of the {@link Layout}, with the page background in the light and dark color schemes. */\nconst AppMain = ({ children }: AppMainProps) => (\n <Box p={0} className={classes.main}>\n {children}\n </Box>\n);\n\nexport default AppMain;\n"],"mappings":";;;;;;AAWA,IAAM,WAAW,EAAE,eACf,oBAAC,KAAD;CAAK,GAAG;CAAG,WAAWA,mBAAQ;CACzB;AACA,CAAA"}
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ onClick: () => void;
3
+ };
4
+ /** Button that cancels the editing of a table row edited in place. */
5
+ declare const CancelEditButton: ({ onClick }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default CancelEditButton;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { useKitMessages } from "../../../provider/useKit.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { ActionIcon, Tooltip } from "@mantine/core";
5
+ import { IconX } from "@tabler/icons-react";
6
+ // src/component/atom/CancelEditButton/CancelEditButton.tsx
7
+ /** Button that cancels the editing of a table row edited in place. */
8
+ var CancelEditButton = ({ onClick }) => {
9
+ const label = useKitMessages().rowEdit.cancel;
10
+ return /* @__PURE__ */ jsx(Tooltip, {
11
+ label,
12
+ children: /* @__PURE__ */ jsx(ActionIcon, {
13
+ size: "sm",
14
+ variant: "subtle",
15
+ color: "red",
16
+ onClick,
17
+ "aria-label": label,
18
+ children: /* @__PURE__ */ jsx(IconX, { size: 16 })
19
+ })
20
+ });
21
+ };
22
+ export { CancelEditButton as default };
23
+
24
+ //# sourceMappingURL=CancelEditButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CancelEditButton.js","names":[],"sources":["../../../../src/component/atom/CancelEditButton/CancelEditButton.tsx"],"sourcesContent":["import { ActionIcon, Tooltip } from '@mantine/core';\nimport { IconX } from '@tabler/icons-react';\n\nimport { useKitMessages } from '../../../provider/useKit';\n\ntype Props = {\n onClick: () => void;\n};\n\n/** Button that cancels the editing of a table row edited in place. */\nconst CancelEditButton = ({ onClick }: Props) => {\n const label = useKitMessages().rowEdit.cancel;\n\n return (\n <Tooltip label={label}>\n <ActionIcon size=\"sm\" variant=\"subtle\" color=\"red\" onClick={onClick} aria-label={label}>\n <IconX size={16} />\n </ActionIcon>\n </Tooltip>\n );\n};\n\nexport default CancelEditButton;\n"],"mappings":";;;;;;;AAUA,IAAM,oBAAoB,EAAE,cAAqB;CAC7C,MAAM,QAAQ,eAAe,CAAC,CAAC,QAAQ;CAEvC,OACI,oBAAC,SAAD;EAAgB;EACZ,UAAA,oBAAC,YAAD;GAAY,MAAK;GAAK,SAAQ;GAAS,OAAM;GAAe;GAAS,cAAY;GAC7E,UAAA,oBAAC,OAAD,EAAO,MAAM,GAAK,CAAA;EACV,CAAA;CACP,CAAA;AAEjB"}
@@ -0,0 +1,13 @@
1
+ type Props = {
2
+ onClick: () => void;
3
+ /** Disabled while no value of the row was changed (nothing to confirm). */
4
+ disabled?: boolean;
5
+ };
6
+ /**
7
+ * Button that confirms the editing of a table row edited in place.
8
+ *
9
+ * The `<span>` around the `ActionIcon` keeps the `Tooltip` working while the button is `disabled`: a disabled native
10
+ * HTML element fires no pointer events, so the `Tooltip` could not detect the hover on the button itself.
11
+ */
12
+ declare const ConfirmEditButton: ({ onClick, disabled }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ export default ConfirmEditButton;
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { useKitMessages } from "../../../provider/useKit.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { ActionIcon, Tooltip } from "@mantine/core";
5
+ import { IconCheck } from "@tabler/icons-react";
6
+ // src/component/atom/ConfirmEditButton/ConfirmEditButton.tsx
7
+ /**
8
+ * Button that confirms the editing of a table row edited in place.
9
+ *
10
+ * The `<span>` around the `ActionIcon` keeps the `Tooltip` working while the button is `disabled`: a disabled native
11
+ * HTML element fires no pointer events, so the `Tooltip` could not detect the hover on the button itself.
12
+ */
13
+ var ConfirmEditButton = ({ onClick, disabled }) => {
14
+ const label = useKitMessages().rowEdit.confirm;
15
+ return /* @__PURE__ */ jsx(Tooltip, {
16
+ label,
17
+ children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(ActionIcon, {
18
+ size: "sm",
19
+ variant: "subtle",
20
+ color: "green",
21
+ onClick,
22
+ disabled,
23
+ "aria-label": label,
24
+ children: /* @__PURE__ */ jsx(IconCheck, { size: 16 })
25
+ }) })
26
+ });
27
+ };
28
+ export { ConfirmEditButton as default };
29
+
30
+ //# sourceMappingURL=ConfirmEditButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmEditButton.js","names":[],"sources":["../../../../src/component/atom/ConfirmEditButton/ConfirmEditButton.tsx"],"sourcesContent":["import { ActionIcon, Tooltip } from '@mantine/core';\nimport { IconCheck } from '@tabler/icons-react';\n\nimport { useKitMessages } from '../../../provider/useKit';\n\ntype Props = {\n onClick: () => void;\n\n /** Disabled while no value of the row was changed (nothing to confirm). */\n disabled?: boolean;\n};\n\n/**\n * Button that confirms the editing of a table row edited in place.\n *\n * The `<span>` around the `ActionIcon` keeps the `Tooltip` working while the button is `disabled`: a disabled native\n * HTML element fires no pointer events, so the `Tooltip` could not detect the hover on the button itself.\n */\nconst ConfirmEditButton = ({ onClick, disabled }: Props) => {\n const label = useKitMessages().rowEdit.confirm;\n\n return (\n <Tooltip label={label}>\n <span>\n <ActionIcon\n size=\"sm\"\n variant=\"subtle\"\n color=\"green\"\n onClick={onClick}\n disabled={disabled}\n aria-label={label}\n >\n <IconCheck size={16} />\n </ActionIcon>\n </span>\n </Tooltip>\n );\n};\n\nexport default ConfirmEditButton;\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAM,qBAAqB,EAAE,SAAS,eAAsB;CACxD,MAAM,QAAQ,eAAe,CAAC,CAAC,QAAQ;CAEvC,OACI,oBAAC,SAAD;EAAgB;EACZ,UAAA,oBAAC,QAAD,EAAA,UACI,oBAAC,YAAD;GACI,MAAK;GACL,SAAQ;GACR,OAAM;GACG;GACC;GACV,cAAY;GAEZ,UAAA,oBAAC,WAAD,EAAW,MAAM,GAAK,CAAA;EACd,CAAA,EACV,CAAA;CACD,CAAA;AAEjB"}
@@ -0,0 +1,7 @@
1
+ import { ReactElement } from 'react';
2
+ import { DateInputProps } from '@mantine/dates';
3
+ export interface DateProps extends DateInputProps {
4
+ label: string;
5
+ }
6
+ /** Clearable date input in the date format of the locale (e.g. `DD/MM/YYYY` in `pt-BR`). */
7
+ export declare function DateField({ label, value, ...rest }: DateProps): ReactElement;
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { useKitMessages } from "../../../provider/useKit.js";
3
+ import { parseDate } from "../../../util/DateUtil.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { DateInput } from "@mantine/dates";
6
+ // src/component/atom/DateField/DateField.tsx
7
+ /** Clearable date input in the date format of the locale (e.g. `DD/MM/YYYY` in `pt-BR`). */
8
+ function DateField({ label, value, ...rest }) {
9
+ const { dateFormat } = useKitMessages().common;
10
+ return /* @__PURE__ */ jsx(DateInput, {
11
+ label,
12
+ placeholder: dateFormat,
13
+ valueFormat: dateFormat,
14
+ value: parseDate(value, dateFormat),
15
+ clearable: true,
16
+ ...rest
17
+ });
18
+ }
19
+ export { DateField };
20
+
21
+ //# sourceMappingURL=DateField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateField.js","names":[],"sources":["../../../../src/component/atom/DateField/DateField.tsx"],"sourcesContent":["import { ReactElement } from 'react';\nimport { DateInput, DateInputProps } from '@mantine/dates';\n\nimport { useKitMessages } from '../../../provider/useKit';\nimport { parseDate } from '../../../util/DateUtil';\n\nexport interface DateProps extends DateInputProps {\n label: string;\n}\n\n/** Clearable date input in the date format of the locale (e.g. `DD/MM/YYYY` in `pt-BR`). */\nexport function DateField({ label, value, ...rest }: DateProps): ReactElement {\n const { dateFormat } = useKitMessages().common;\n\n return (\n <DateInput\n label={label}\n placeholder={dateFormat}\n valueFormat={dateFormat}\n value={parseDate(value, dateFormat)}\n clearable\n {...rest}\n />\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,UAAU,EAAE,OAAO,OAAO,GAAG,QAAiC;CAC1E,MAAM,EAAE,eAAe,eAAe,CAAC,CAAC;CAExC,OACI,oBAAC,WAAD;EACW;EACP,aAAa;EACb,aAAa;EACb,OAAO,UAAU,OAAO,UAAU;EAClC,WAAA;EACA,GAAI;CACP,CAAA;AAET"}