kelt-ui-kit-react 2.0.6 → 2.0.9

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 (313) hide show
  1. package/.github/workflows/publish.yml +40 -31
  2. package/README.md +124 -72
  3. package/dist/App.d.ts +2 -3
  4. package/dist/App.menu.d.ts +10 -10
  5. package/dist/App.routes.d.ts +1 -1
  6. package/dist/_core/hooks/HistoryProvider.d.ts +5 -5
  7. package/dist/_core/hooks/ImageChecker.d.ts +5 -6
  8. package/dist/_core/hooks/imageExist.d.ts +5 -6
  9. package/dist/_core/hooks/isEAN13.d.ts +1 -1
  10. package/dist/_core/hooks/objectToQueryParams.d.ts +1 -1
  11. package/dist/_core/hooks/useCurrency.d.ts +3 -3
  12. package/dist/_core/hooks/useDateutils.d.ts +4 -4
  13. package/dist/_core/hooks/useIsMobile.d.ts +1 -1
  14. package/dist/_core/hooks/useToken.d.ts +3 -3
  15. package/dist/_core/hooks/useValidate.d.ts +5 -5
  16. package/dist/_core/hooks/widgetSupport.d.ts +1 -1
  17. package/dist/_core/type/generiqueType.d.ts +4 -0
  18. package/dist/action/Action.view.d.ts +1 -1
  19. package/dist/action/ButtonAction.d.ts +8 -9
  20. package/dist/addressSearch/AddressSearch.d.ts +18 -19
  21. package/dist/addressSearch/AddressSearch.view.d.ts +1 -1
  22. package/dist/badge/Badge.d.ts +10 -9
  23. package/dist/badge/Badge.view.d.ts +1 -1
  24. package/dist/button/Button.d.ts +1 -2
  25. package/dist/button/Button.view.d.ts +1 -1
  26. package/dist/button/button.interface.d.ts +19 -20
  27. package/dist/button/buttonActions/ButtonActions.d.ts +11 -12
  28. package/dist/button/buttonFile/ButtonFile.d.ts +9 -9
  29. package/dist/button/buttonFile/ButtonFile.view.d.ts +1 -1
  30. package/dist/button/buttonFilters/ButtonFilters.d.ts +16 -17
  31. package/dist/card/Card.d.ts +14 -15
  32. package/dist/card/Card.view.d.ts +1 -1
  33. package/dist/card/card.interface.d.ts +10 -10
  34. package/dist/card/cardAction/CardAction.d.ts +13 -14
  35. package/dist/card/cardAction.interface.d.ts +8 -9
  36. package/dist/card/hook/useCardInteractions.d.ts +8 -8
  37. package/dist/carousel/Carousel.d.ts +14 -15
  38. package/dist/carousel/Carousel.view.d.ts +1 -1
  39. package/dist/damier/Damier.d.ts +9 -10
  40. package/dist/damier/Damier.view.d.ts +1 -1
  41. package/dist/damier/damierCell/DamierCell.d.ts +6 -7
  42. package/dist/damier/damierCell/damierCell.interface.d.ts +6 -6
  43. package/dist/dataTable/DataTable.d.ts +37 -33
  44. package/dist/dataTable/DataTable.view.d.ts +1 -1
  45. package/dist/dataTable/dataTable.interface.d.ts +70 -47
  46. package/dist/dataTable/dataTable.utils.d.ts +17 -0
  47. package/dist/dataTable/dataTableActions/DataTableAction.d.ts +9 -10
  48. package/dist/dataTable/dataTableColumn/DataTableColumn.d.ts +14 -8
  49. package/dist/dataTable/dataTableColumn/dataTableColumnFilter/DataTableColumnFilter.d.ts +9 -0
  50. package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDate/DataTableColumnFilterDate.d.ts +9 -0
  51. package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDateRange/dataTableColumnFilterDateRange.d.ts +9 -0
  52. package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterEnum/DataTableColumnFilterEnum.d.ts +12 -0
  53. package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterString/DataTableColumnFilterString.d.ts +9 -0
  54. package/dist/dataTable/dataTableColumn/dataTableColumnSort/DataTableColumnSort.d.ts +10 -0
  55. package/dist/dataTable/dataTableFilters/DataTableFilters.d.ts +6 -0
  56. package/dist/dataTable/dataTableLoading/DataTableLoading.d.ts +8 -7
  57. package/dist/dataTable/dataTableRow/DataTableRow.d.ts +12 -11
  58. package/dist/dataTable/useDataTableState.d.ts +13 -0
  59. package/dist/datePicker/DatePicker.d.ts +7 -8
  60. package/dist/datePicker/DatePicker.view.d.ts +1 -1
  61. package/dist/docs/ComponentDocs.d.ts +6 -0
  62. package/dist/docs/catalog.d.ts +8 -0
  63. package/dist/docs/documentation.types.d.ts +21 -0
  64. package/dist/expands/Expands.d.ts +11 -12
  65. package/dist/expands/Expands.view.d.ts +1 -1
  66. package/dist/expands/expand/expand.d.ts +10 -11
  67. package/dist/expands/expand/expand.interface.d.ts +9 -9
  68. package/dist/filAriane/FilAriane.d.ts +8 -9
  69. package/dist/filAriane/FilAriane.view.d.ts +1 -1
  70. package/dist/filAriane/filAriane.interface.d.ts +6 -6
  71. package/dist/form/Form.d.ts +35 -36
  72. package/dist/form/Form.view.d.ts +1 -1
  73. package/dist/form/form.enum.d.ts +16 -15
  74. package/dist/form/form.interface.d.ts +53 -54
  75. package/dist/form/input/Input.d.ts +27 -25
  76. package/dist/form/inputNumber/InputNumber.d.ts +21 -22
  77. package/dist/form/inputNumber/InputNumber.view.d.ts +1 -1
  78. package/dist/form/inputPrice/InputPrice.d.ts +14 -15
  79. package/dist/form/inputPrice/InputPrice.view.d.ts +1 -1
  80. package/dist/form/textArea/TextArea.d.ts +14 -15
  81. package/dist/form/textArea/TextArea.view.d.ts +1 -1
  82. package/dist/geocoding/GeocodingService.d.ts +11 -12
  83. package/dist/geocoding/geocoding.interface.d.ts +20 -20
  84. package/dist/grid/Grid.d.ts +9 -10
  85. package/dist/grid/Grid.view.d.ts +1 -1
  86. package/dist/grid/col/Col.d.ts +5 -6
  87. package/dist/grid/col/colStyled/ColStyled.d.ts +10 -11
  88. package/dist/grid/container/Container.d.ts +5 -6
  89. package/dist/grid/grid.interface.d.ts +23 -23
  90. package/dist/grid/row/Row.d.ts +13 -14
  91. package/dist/header/Header.d.ts +1 -2
  92. package/dist/header/Header.view.d.ts +1 -1
  93. package/dist/header/header.interface.d.ts +12 -12
  94. package/dist/home/Home.d.ts +1 -1
  95. package/dist/icon/Icon.d.ts +1 -2
  96. package/dist/icon/Icons.view.d.ts +1 -1
  97. package/dist/icon/icon.interface.d.ts +5 -5
  98. package/dist/icon/iconSize.enum.d.ts +7 -7
  99. package/dist/index.d.ts +56 -54
  100. package/dist/index.html +18 -18
  101. package/dist/index.js +3964 -3470
  102. package/dist/loader/Loader.d.ts +7 -8
  103. package/dist/loader/Loader.view.d.ts +1 -1
  104. package/dist/main.d.ts +0 -1
  105. package/dist/manifest.json +25 -25
  106. package/dist/menus/Menus.d.ts +5 -6
  107. package/dist/menus/Menus.view.d.ts +1 -1
  108. package/dist/menus/menu/Menu.d.ts +7 -8
  109. package/dist/menus/menu/menu.interface.d.ts +10 -10
  110. package/dist/message/Message.d.ts +6 -7
  111. package/dist/message/Message.view.d.ts +1 -1
  112. package/dist/modal/Modal.d.ts +13 -14
  113. package/dist/modal/Modal.view.d.ts +1 -1
  114. package/dist/notFound/NotFound.d.ts +1 -1
  115. package/dist/overlayPanel/OverlayPanel.d.ts +22 -23
  116. package/dist/overlayPanel/OverlayPanel.view.d.ts +1 -1
  117. package/dist/overlayPanel/overlay.context.d.ts +9 -10
  118. package/dist/overlayPanel/overlayPanelStyled/OverlayPanelStyled.d.ts +9 -9
  119. package/dist/pdfViewer/PdfViewer.d.ts +12 -12
  120. package/dist/pdfViewer/PdfViewer.view.d.ts +1 -1
  121. package/dist/quantity/Quantity.d.ts +10 -11
  122. package/dist/robots.txt +3 -3
  123. package/dist/search/Search.d.ts +21 -22
  124. package/dist/search/Search.view.d.ts +1 -1
  125. package/dist/select/Select.d.ts +23 -24
  126. package/dist/select/Select.view.d.ts +1 -1
  127. package/dist/select/selectOption.interface.d.ts +5 -5
  128. package/dist/sidebar/Sidebar.d.ts +12 -13
  129. package/dist/sidebar/Sidebar.view.d.ts +1 -1
  130. package/dist/sidebarData/SidebarData.d.ts +6 -7
  131. package/dist/sidebarData/SidebarData.view.d.ts +1 -1
  132. package/dist/style.css +1 -1
  133. package/dist/tabs/Tabs.d.ts +17 -17
  134. package/dist/tabs/Tabs.view.d.ts +1 -1
  135. package/dist/toaster/Toaster.d.ts +1 -2
  136. package/dist/toaster/Toaster.view.d.ts +1 -1
  137. package/dist/toaster/store/useToasterStore.d.ts +24 -20
  138. package/docs.plugin.ts +223 -0
  139. package/index.html +20 -18
  140. package/package.json +64 -56
  141. package/public/index.html +18 -18
  142. package/public/manifest.json +25 -25
  143. package/public/robots.txt +3 -3
  144. package/src/App.css +178 -11
  145. package/src/App.menu.tsx +277 -257
  146. package/src/App.routes.tsx +21 -16
  147. package/src/App.tsx +31 -30
  148. package/src/_core/hooks/HistoryProvider.tsx +25 -25
  149. package/src/_core/hooks/ImageChecker.tsx +26 -26
  150. package/src/_core/hooks/imageExist.tsx +9 -9
  151. package/src/_core/hooks/isEAN13.tsx +16 -16
  152. package/src/_core/hooks/objectToQueryParams.tsx +32 -32
  153. package/src/_core/hooks/useCurrency.tsx +18 -18
  154. package/src/_core/hooks/useDateutils.ts +64 -64
  155. package/src/_core/hooks/useIsMobile.ts +18 -18
  156. package/src/_core/hooks/useToken.tsx +19 -19
  157. package/src/_core/hooks/useValidate.tsx +18 -18
  158. package/src/_core/hooks/widgetSupport.tsx +39 -39
  159. package/src/_core/type/generiqueType.tsx +4 -0
  160. package/src/action/Action.view.tsx +21 -21
  161. package/src/action/ButtonAction.tsx +32 -32
  162. package/src/action/action.css +20 -20
  163. package/src/addressSearch/AddressSearch.tsx +246 -246
  164. package/src/addressSearch/AddressSearch.view.tsx +52 -52
  165. package/src/addressSearch/addressSearch.css +132 -132
  166. package/src/badge/Badge.tsx +41 -34
  167. package/src/badge/Badge.view.tsx +15 -15
  168. package/src/badge/badge.css +63 -55
  169. package/src/button/Button.tsx +48 -48
  170. package/src/button/Button.view.tsx +85 -85
  171. package/src/button/button.css +53 -53
  172. package/src/button/button.interface.tsx +22 -22
  173. package/src/button/buttonActions/ButtonActions.tsx +104 -104
  174. package/src/button/buttonFile/ButtonFile.tsx +59 -59
  175. package/src/button/buttonFile/ButtonFile.view.tsx +70 -70
  176. package/src/button/buttonFilters/ButtonFilters.tsx +102 -102
  177. package/src/button/buttonFilters/buttonFilters.css +22 -22
  178. package/src/card/Card.tsx +151 -151
  179. package/src/card/Card.view.tsx +73 -73
  180. package/src/card/card.css +144 -144
  181. package/src/card/card.interface.tsx +9 -9
  182. package/src/card/cardAction/CardAction.tsx +135 -135
  183. package/src/card/cardAction/cardAction.css +10 -10
  184. package/src/card/cardAction.interface.tsx +10 -10
  185. package/src/card/hook/useCardInteractions.tsx +30 -30
  186. package/src/carousel/Carousel.css +44 -44
  187. package/src/carousel/Carousel.tsx +115 -115
  188. package/src/carousel/Carousel.view.tsx +13 -13
  189. package/src/damier/Damier.tsx +64 -64
  190. package/src/damier/Damier.view.tsx +31 -31
  191. package/src/damier/damier.css +50 -50
  192. package/src/damier/damierCell/DamierCell.tsx +18 -18
  193. package/src/damier/damierCell/damierCell.interface.tsx +5 -5
  194. package/src/dataTable/DataTable.tsx +840 -746
  195. package/src/dataTable/DataTable.view.tsx +105 -71
  196. package/src/dataTable/dataTable.css +233 -208
  197. package/src/dataTable/dataTable.interface.ts +66 -45
  198. package/src/dataTable/dataTable.utils.ts +45 -0
  199. package/src/dataTable/dataTableActions/DataTableAction.tsx +82 -65
  200. package/src/dataTable/dataTableColumn/DataTableColumn.tsx +48 -27
  201. package/src/dataTable/dataTableColumn/dataTableColumnFilter/DataTableColumnFilter.tsx +36 -0
  202. package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilter.css +0 -0
  203. package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDate/DataTableColumnFilterDate.tsx +39 -0
  204. package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDateRange/dataTableColumnFilterDateRange.tsx +80 -0
  205. package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterEnum/DataTableColumnFilterEnum.tsx +89 -0
  206. package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterString/DataTableColumnFilterString.tsx +37 -0
  207. package/src/dataTable/dataTableColumn/dataTableColumnSort/DataTableColumnSort.tsx +42 -0
  208. package/src/dataTable/dataTableFilters/DataTableFilters.tsx +91 -0
  209. package/src/dataTable/dataTableFilters/dataTableFilters.css +16 -0
  210. package/src/dataTable/dataTableLoading/DataTableLoading.tsx +23 -21
  211. package/src/dataTable/dataTableRow/DataTableRow.tsx +155 -208
  212. package/src/dataTable/useDataTableState.tsx +89 -0
  213. package/src/datePicker/DatePicker.tsx +110 -110
  214. package/src/datePicker/DatePicker.view.tsx +9 -9
  215. package/src/datePicker/datePicker.css +77 -77
  216. package/src/docs/ComponentDocs.tsx +156 -0
  217. package/src/docs/catalog.ts +40 -0
  218. package/src/docs/documentation.types.ts +20 -0
  219. package/src/docs/virtual.d.ts +7 -0
  220. package/src/expands/Expands.tsx +46 -46
  221. package/src/expands/Expands.view.tsx +90 -90
  222. package/src/expands/expand/expand.interface.tsx +8 -8
  223. package/src/expands/expands.css +101 -101
  224. package/src/filAriane/FilAriane.tsx +57 -57
  225. package/src/filAriane/FilAriane.view.tsx +28 -28
  226. package/src/filAriane/filAriane.css +23 -23
  227. package/src/filAriane/filAriane.interface.tsx +6 -6
  228. package/src/form/Form.tsx +477 -477
  229. package/src/form/Form.view.tsx +67 -67
  230. package/src/form/form.css +135 -135
  231. package/src/form/form.enum.ts +16 -15
  232. package/src/form/form.interface.tsx +67 -67
  233. package/src/form/input/Input.tsx +146 -106
  234. package/src/form/input/input.css +39 -29
  235. package/src/form/inputNumber/InputNumber.tsx +132 -132
  236. package/src/form/inputNumber/InputNumber.view.tsx +15 -15
  237. package/src/form/inputPrice/InputPrice.tsx +42 -42
  238. package/src/form/inputPrice/InputPrice.view.tsx +15 -15
  239. package/src/form/textArea/TextArea.tsx +59 -59
  240. package/src/form/textArea/TextArea.view.tsx +34 -34
  241. package/src/form/textArea/textArea.css +9 -9
  242. package/src/geocoding/GeocodingService.ts +89 -89
  243. package/src/geocoding/geocoding.interface.ts +25 -25
  244. package/src/grid/Grid.view.tsx +24 -24
  245. package/src/grid/container/Container.tsx +8 -8
  246. package/src/grid/container/container.css +4 -4
  247. package/src/grid/grid.interface.tsx +27 -27
  248. package/src/grid/row/row.css +25 -25
  249. package/src/header/Header.tsx +64 -64
  250. package/src/header/Header.view.tsx +5 -5
  251. package/src/header/header.css +43 -43
  252. package/src/header/header.interface.tsx +11 -11
  253. package/src/home/Home.tsx +40 -3
  254. package/src/icon/Icon.tsx +6 -6
  255. package/src/icon/Icons.view.tsx +29 -29
  256. package/src/icon/icon.css +20 -20
  257. package/src/icon/icon.interface.tsx +7 -6
  258. package/src/icon/iconSize.enum.ts +7 -7
  259. package/src/index.css +547 -547
  260. package/src/index.ts +76 -70
  261. package/src/loader/Loader.tsx +37 -37
  262. package/src/loader/Loader.view.tsx +20 -20
  263. package/src/loader/loader.css +30 -30
  264. package/src/main.tsx +10 -10
  265. package/src/menus/Menus.tsx +43 -43
  266. package/src/menus/Menus.view.tsx +39 -39
  267. package/src/menus/menu/Menu.tsx +18 -18
  268. package/src/menus/menu/menu.interface.tsx +9 -9
  269. package/src/menus/menus.css +47 -47
  270. package/src/message/Message.tsx +30 -30
  271. package/src/message/Message.view.tsx +22 -22
  272. package/src/message/message.css +29 -29
  273. package/src/modal/Modal.tsx +59 -59
  274. package/src/modal/Modal.view.tsx +26 -26
  275. package/src/modal/modal.css +71 -71
  276. package/src/notFound/NotFound.tsx +3 -3
  277. package/src/overlayPanel/OverlayPanel.tsx +260 -255
  278. package/src/overlayPanel/OverlayPanel.view.tsx +25 -25
  279. package/src/overlayPanel/overlay.context.tsx +30 -30
  280. package/src/overlayPanel/overlayPanel.css +43 -43
  281. package/src/overlayPanel/overlayPanelStyled/OverlayPanelStyled.tsx +23 -23
  282. package/src/pdfViewer/PdfViewer.tsx +73 -73
  283. package/src/pdfViewer/PdfViewer.view.tsx +5 -5
  284. package/src/quantity/Quantity.tsx +103 -103
  285. package/src/quantity/quantity.css +26 -26
  286. package/src/search/Search.tsx +161 -161
  287. package/src/search/Search.view.tsx +14 -14
  288. package/src/search/search.css +59 -59
  289. package/src/select/Select.tsx +245 -245
  290. package/src/select/Select.view.tsx +71 -71
  291. package/src/select/select.css +150 -150
  292. package/src/select/selectOption.interface.ts +5 -5
  293. package/src/sidebar/Sidebar.tsx +213 -213
  294. package/src/sidebar/Sidebar.view.tsx +17 -17
  295. package/src/sidebar/sidebar.css +103 -103
  296. package/src/sidebarData/SidebarData.tsx +19 -19
  297. package/src/sidebarData/SidebarData.view.tsx +19 -19
  298. package/src/sidebarData/sidebarData.css +27 -27
  299. package/src/tabs/Tabs.tsx +101 -90
  300. package/src/tabs/Tabs.view.tsx +20 -20
  301. package/src/tabs/tabs.css +29 -29
  302. package/src/toaster/Toaster.tsx +61 -60
  303. package/src/toaster/Toaster.view.tsx +25 -25
  304. package/src/toaster/store/useToasterStore.tsx +54 -43
  305. package/src/toaster/toaster.css +105 -92
  306. package/tests/dataTable.test.mjs +93 -0
  307. package/tests/documentation.test.mjs +75 -0
  308. package/tsconfig.docs.json +10 -0
  309. package/tsconfig.json +28 -28
  310. package/vite.config.ts +26 -20
  311. package/vite.config.ts.timestamp-1733262892554-a13dfef6e8a29.mjs +24 -24
  312. package/vite.config.ts.timestamp-1757847121745-e5a5bf54b81b.mjs +28 -28
  313. package/vite.config.ts.timestamp-1759742478362-4ac5c5a7db34b.mjs +28 -28
@@ -1,18 +1,18 @@
1
1
  import { default as React } from 'react';
2
-
3
- export type TabItem = {
4
- key: string;
5
- title: React.ReactNode;
6
- panel: React.ReactNode;
7
- disabled?: boolean;
8
- };
9
- export type TabsProps = {
10
- items: TabItem[];
11
- defaultIndex?: number;
12
- index?: number;
13
- onChange?: (nextIndex: number) => void;
14
- className?: string;
15
- tabClassName?: string;
16
- panelClassName?: string;
17
- };
18
- export declare const Tabs: ({ items, defaultIndex, index, onChange, className, tabClassName, panelClassName, }: TabsProps) => import("react/jsx-runtime").JSX.Element;
2
+ export type TabItem = {
3
+ key: string;
4
+ title: React.ReactNode;
5
+ panel: React.ReactNode;
6
+ disabled?: boolean;
7
+ };
8
+ export type TabsProps = {
9
+ items: TabItem[];
10
+ defaultIndex?: number;
11
+ index?: number;
12
+ onChange?: (nextIndex: number) => void;
13
+ className?: string;
14
+ tabClassName?: string;
15
+ panelClassName?: string;
16
+ keepMountedVisited?: boolean;
17
+ };
18
+ export declare const Tabs: ({ items, defaultIndex, index, onChange, className, tabClassName, panelClassName, keepMountedVisited, }: TabsProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare const TabsView: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const TabsView: () => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1 @@
1
-
2
- export declare const Toaster: () => import('react').ReactPortal | null;
1
+ export declare const Toaster: () => import('react').ReactPortal | null;
@@ -1 +1 @@
1
- export declare const ToasterView: () => JSX.Element;
1
+ export declare const ToasterView: () => JSX.Element;
@@ -1,20 +1,24 @@
1
- /// <reference types="react" />
2
- type ToasterState = {
3
- title: string;
4
- description?: string;
5
- severity?: "info" | "success" | "error" | "warning";
6
- children?: React.ReactNode;
7
- visible: boolean;
8
- duration: number;
9
- close?: boolean;
10
- showToast: (title: string, options?: {
11
- description?: string;
12
- severity?: "info" | "success" | "error" | "warning";
13
- duration?: number;
14
- children?: React.ReactNode;
15
- close?: boolean;
16
- }) => void;
17
- hideToast: () => void;
18
- };
19
- export declare const useToasterStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ToasterState>>;
20
- export {};
1
+ /// <reference types="react" />
2
+ export type ToasterPosition = "top-right" | "top-center" | "bottom-right" | "bottom-center";
3
+ type ToasterState = {
4
+ title: string;
5
+ description?: string;
6
+ severity?: "info" | "success" | "error" | "warning";
7
+ children?: React.ReactNode;
8
+ visible: boolean;
9
+ duration: number;
10
+ close?: boolean;
11
+ position: ToasterPosition;
12
+ showToast: (title: string, options?: {
13
+ description?: string;
14
+ severity?: "info" | "success" | "error" | "warning";
15
+ duration?: number;
16
+ children?: React.ReactNode;
17
+ close?: boolean;
18
+ /** Position à l'écran (défaut : "top-right") */
19
+ position?: ToasterPosition;
20
+ }) => void;
21
+ hideToast: () => void;
22
+ };
23
+ export declare const useToasterStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ToasterState>>;
24
+ export {};
package/docs.plugin.ts ADDED
@@ -0,0 +1,223 @@
1
+ import { readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import ts from "typescript";
4
+ import type { Plugin } from "vite";
5
+ import type {
6
+ ComponentDocumentation,
7
+ DocumentedComponent,
8
+ } from "./src/docs/documentation.types";
9
+
10
+ const moduleId = "virtual:ui-docs";
11
+ const resolvedId = `\0${moduleId}`;
12
+
13
+ export function uiDocsPlugin(): Plugin {
14
+ let root: string;
15
+
16
+ function generate() {
17
+ const configPath = path.join(root, "tsconfig.json");
18
+ const config = ts.readConfigFile(configPath, ts.sys.readFile);
19
+ if (config.error) throw new Error(ts.flattenDiagnosticMessageText(config.error.messageText, "\n"));
20
+ const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, root);
21
+ if (parsed.errors.length) throw new Error(ts.formatDiagnosticsWithColorAndContext(parsed.errors, {
22
+ getCanonicalFileName: (name) => name,
23
+ getCurrentDirectory: () => root,
24
+ getNewLine: () => "\n",
25
+ }));
26
+ const program = ts.createProgram(parsed.fileNames, parsed.options);
27
+ const checker = program.getTypeChecker();
28
+ const srcRoot = path.join(root, "src") + path.sep;
29
+
30
+ function sourceAt(filename: string) {
31
+ const source = program.getSourceFile(filename);
32
+ if (!source) throw new Error(`Documentation source not found: ${filename}`);
33
+ return source;
34
+ }
35
+
36
+ function importedFiles(source: ts.SourceFile) {
37
+ return source.statements.filter(ts.isImportDeclaration).flatMap((statement) => {
38
+ if (!ts.isStringLiteral(statement.moduleSpecifier)) return [];
39
+ const specifier = statement.moduleSpecifier.text;
40
+ if (!specifier.startsWith(".")) return [];
41
+ const filename = ts.resolveModuleName(specifier, source.fileName, parsed.options, ts.sys)
42
+ .resolvedModule?.resolvedFileName;
43
+ const bindings = statement.importClause?.namedBindings;
44
+ if (!filename || !bindings || !ts.isNamedImports(bindings)) return [];
45
+ return bindings.elements.map((binding) => ({
46
+ local: binding.name.text,
47
+ exported: (binding.propertyName ?? binding.name).text,
48
+ filename,
49
+ }));
50
+ });
51
+ }
52
+
53
+ function describe(filename: string, name: string): DocumentedComponent | undefined {
54
+ const source = sourceAt(filename);
55
+ const module = checker.getSymbolAtLocation(source);
56
+ const symbol = module && checker.getExportsOfModule(module).find((item) => item.name === name);
57
+ if (!symbol) return;
58
+ const componentType = checker.getTypeOfSymbolAtLocation(symbol, source);
59
+ const signature = componentType.getCallSignatures()[0];
60
+ if (!signature) return;
61
+ const parameter = signature.getParameters()[0];
62
+ const propsType = parameter && checker.getTypeOfSymbolAtLocation(parameter, source);
63
+ const defaults = new Map<string, string>();
64
+
65
+ function findDefaults(node: ts.Node) {
66
+ if (ts.isArrowFunction(node) || ts.isFunctionExpression(node) || ts.isFunctionDeclaration(node)) {
67
+ node.parameters.forEach(findDefaults);
68
+ return;
69
+ }
70
+ if (ts.isParameter(node) && ts.isObjectBindingPattern(node.name)) {
71
+ node.name.elements.forEach((element) => {
72
+ if (element.initializer) {
73
+ defaults.set((element.propertyName ?? element.name).getText(source), element.initializer.getText(source));
74
+ }
75
+ });
76
+ }
77
+ ts.forEachChild(node, findDefaults);
78
+ }
79
+ symbol.declarations?.forEach(findDefaults);
80
+
81
+ const types = new Map<string, { name: string; declaration: string }>();
82
+ const visited = new Set<ts.Type>();
83
+ function collectTypes(type: ts.Type) {
84
+ if (visited.has(type)) return;
85
+ visited.add(type);
86
+ if (type.isUnionOrIntersection()) type.types.forEach(collectTypes);
87
+ type.aliasTypeArguments?.forEach(collectTypes);
88
+ if (type.flags & ts.TypeFlags.Object) {
89
+ const reference = type as ts.TypeReference;
90
+ if (reference.objectFlags & ts.ObjectFlags.Reference) {
91
+ checker.getTypeArguments(reference).forEach(collectTypes);
92
+ }
93
+ }
94
+ const typeSymbol = type.aliasSymbol ?? type.getSymbol();
95
+ const declarations = typeSymbol?.declarations?.filter((declaration) =>
96
+ path.resolve(declaration.getSourceFile().fileName).startsWith(srcRoot) &&
97
+ (ts.isTypeAliasDeclaration(declaration) || ts.isInterfaceDeclaration(declaration) || ts.isEnumDeclaration(declaration))
98
+ );
99
+ if (!declarations?.length) return;
100
+ declarations.forEach((declaration) => {
101
+ types.set(`${declaration.getSourceFile().fileName}:${declaration.pos}`, {
102
+ name: typeSymbol!.name,
103
+ declaration: declaration.getText(),
104
+ });
105
+ });
106
+ type.getProperties().forEach((property) => {
107
+ const declaration = property.valueDeclaration ?? property.declarations?.[0];
108
+ if (declaration) collectTypes(checker.getTypeOfSymbolAtLocation(property, declaration));
109
+ });
110
+ type.getCallSignatures().forEach((call) => {
111
+ call.parameters.forEach((argument) => {
112
+ const declaration = argument.valueDeclaration ?? argument.declarations?.[0];
113
+ if (declaration) collectTypes(checker.getTypeOfSymbolAtLocation(argument, declaration));
114
+ });
115
+ collectTypes(call.getReturnType());
116
+ });
117
+ }
118
+
119
+ const flags = ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope;
120
+ const props = propsType?.getProperties().map((property) => {
121
+ const declaration = property.valueDeclaration ?? property.declarations?.[0] ?? source;
122
+ const type = checker.getTypeOfSymbolAtLocation(property, declaration);
123
+ collectTypes(type);
124
+ return {
125
+ name: property.name,
126
+ type: checker.typeToString(type, declaration, flags),
127
+ required: !(property.flags & ts.SymbolFlags.Optional),
128
+ defaultValue: defaults.get(property.name),
129
+ description: ts.displayPartsToString(property.getDocumentationComment(checker)),
130
+ };
131
+ }) ?? [];
132
+ if (propsType) collectTypes(propsType);
133
+ return {
134
+ name,
135
+ source: path.relative(root, filename).split(path.sep).join("/"),
136
+ signature: checker.signatureToString(signature, source, flags),
137
+ props,
138
+ types: Array.from(types.values()),
139
+ };
140
+ }
141
+
142
+ const menu = sourceAt(path.join(root, "src", "App.menu.tsx"));
143
+ const views = importedFiles(menu);
144
+ const documentation: Record<string, ComponentDocumentation> = {};
145
+ function visit(node: ts.Node) {
146
+ if (ts.isObjectLiteralExpression(node)) {
147
+ const link = node.properties.find((property) =>
148
+ ts.isPropertyAssignment(property) && property.name.getText(menu) === "link"
149
+ );
150
+ const element = node.properties.find((property) =>
151
+ ts.isPropertyAssignment(property) && property.name.getText(menu) === "element"
152
+ );
153
+ if (link && element && ts.isPropertyAssignment(link) && ts.isStringLiteral(link.initializer) &&
154
+ ts.isPropertyAssignment(element) && ts.isJsxSelfClosingElement(element.initializer)) {
155
+ const viewName = element.initializer.tagName.getText(menu);
156
+ const view = views.find((item) => item.local === viewName);
157
+ if (!view) throw new Error(`Missing documentation view for ${link.initializer.text}`);
158
+ const viewSource = sourceAt(view.filename);
159
+ const components = importedFiles(viewSource)
160
+ .filter((item) => /^[A-Z]/.test(item.exported))
161
+ .map((item) => describe(item.filename, item.exported))
162
+ .filter((item): item is DocumentedComponent => !!item);
163
+
164
+ if (link.initializer.text === "/toasters") {
165
+ const toaster = describe(path.join(root, "src", "toaster", "Toaster.tsx"), "Toaster");
166
+ if (!toaster) throw new Error("Missing Toaster export");
167
+ components.unshift(toaster);
168
+ const storeSource = sourceAt(path.join(root, "src", "toaster", "store", "useToasterStore.tsx"));
169
+ const stateDeclaration = storeSource.statements.find((statement) =>
170
+ ts.isTypeAliasDeclaration(statement) && statement.name.text === "ToasterState"
171
+ );
172
+ if (!stateDeclaration) throw new Error("Missing ToasterState");
173
+ const state = checker.getTypeAtLocation(stateDeclaration);
174
+ const showToast = state.getProperty("showToast");
175
+ if (!showToast) throw new Error("Missing showToast");
176
+ const call = checker.getTypeOfSymbolAtLocation(showToast, storeSource).getCallSignatures()[0];
177
+ const options = call.getParameters()[1];
178
+ const optionsType = checker.getNonNullableType(checker.getTypeOfSymbolAtLocation(options, storeSource));
179
+ components.push({
180
+ name: "showToast",
181
+ source: "src/toaster/store/useToasterStore.tsx",
182
+ signature: checker.signatureToString(call, storeSource, ts.TypeFormatFlags.NoTruncation),
183
+ props: optionsType.getProperties().map((property) => ({
184
+ name: property.name,
185
+ type: checker.typeToString(checker.getTypeOfSymbolAtLocation(property, storeSource), storeSource, ts.TypeFormatFlags.NoTruncation),
186
+ required: !(property.flags & ts.SymbolFlags.Optional),
187
+ description: ts.displayPartsToString(property.getDocumentationComment(checker)),
188
+ })),
189
+ types: storeSource.statements.filter(ts.isTypeAliasDeclaration).map((declaration) => ({
190
+ name: declaration.name.text,
191
+ declaration: declaration.getText(),
192
+ })),
193
+ });
194
+ }
195
+ if (!components.length) throw new Error(`No documented components for ${link.initializer.text}`);
196
+ documentation[link.initializer.text] = {
197
+ components,
198
+ example: readFileSync(view.filename, "utf8"),
199
+ };
200
+ }
201
+ }
202
+ ts.forEachChild(node, visit);
203
+ }
204
+ visit(menu);
205
+ return documentation;
206
+ }
207
+
208
+ return {
209
+ name: "ui-kit-documentation",
210
+ configResolved(config) { root = config.root; },
211
+ resolveId(id) { if (id === moduleId) return resolvedId; },
212
+ load(id) {
213
+ if (id === resolvedId) return `export default ${JSON.stringify(generate())};`;
214
+ },
215
+ handleHotUpdate(context) {
216
+ if (context.file.startsWith(path.join(root, "src")) && /\.tsx?$/.test(context.file)) {
217
+ const module = context.server.moduleGraph.getModuleById(resolvedId);
218
+ if (module) context.server.moduleGraph.invalidateModule(module);
219
+ context.server.ws.send({ type: "full-reload" });
220
+ }
221
+ },
222
+ };
223
+ }
package/index.html CHANGED
@@ -1,19 +1,21 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <link rel="preconnect" href="https://fonts.googleapis.com">
7
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
- <link href="https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap" rel="stylesheet">
9
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
10
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
- <title>Vite + React + TS</title>
12
- </head>
13
-
14
- <body>
15
- <div id="root"></div>
16
- <script type="module" src="/src/main.tsx"></script>
17
- </body>
18
-
1
+ <!doctype html>
2
+ <html lang="fr">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <link rel="preconnect" href="https://fonts.googleapis.com">
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
+ <link href="https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap" rel="stylesheet">
9
+ <meta name="theme-color" content="#16776c" />
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
+ <meta name="description" content="Explorez les composants React Kelt : demos interactives, parametres, types TypeScript et exemples de code." />
12
+ <title>Kelt UI — Component explorer</title>
13
+ </head>
14
+
15
+ <body>
16
+ <div id="root"></div>
17
+ <div id="toaster-root"></div>
18
+ <script type="module" src="/src/main.tsx"></script>
19
+ </body>
20
+
19
21
  </html>
package/package.json CHANGED
@@ -1,56 +1,64 @@
1
- {
2
- "name": "kelt-ui-kit-react",
3
- "type": "module",
4
- "version": "2.0.6",
5
- "private": false,
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "dependencies": {
9
- "@types/node": "^22.5.5",
10
- "@vitejs/plugin-react": "^4.3.1",
11
- "bootstrap-icons": "^1.11.3",
12
- "jwt-decode": "^4.0.0",
13
- "react-date-picker": "^11.0.0",
14
- "styled-components": "^6.1.13",
15
- "vite": "^5.4.6",
16
- "vite-plugin-dts": "^4.2.2",
17
- "vite-plugin-eslint": "^1.8.1",
18
- "web-vitals": "^2.1.4",
19
- "zustand": "^5.0.5"
20
- },
21
- "peerDependencies": {
22
- "react": "^18.3.1",
23
- "react-dom": "^18.3.1",
24
- "react-router-dom": "^6.26.2"
25
- },
26
- "scripts": {
27
- "dev": "vite",
28
- "build": "tsc -b && vite build",
29
- "lint": "eslint .",
30
- "preview": "vite preview"
31
- },
32
- "eslintConfig": {
33
- "extends": [
34
- "react-app",
35
- "react-app/jest"
36
- ]
37
- },
38
- "browserslist": {
39
- "production": [
40
- ">0.2%",
41
- "not dead",
42
- "not op_mini all"
43
- ],
44
- "development": [
45
- "last 1 chrome version",
46
- "last 1 firefox version",
47
- "last 1 safari version"
48
- ]
49
- },
50
- "devDependencies": {
51
- "@types/react-dom": "^18.3.0",
52
- "@types/react-router-dom": "^5.3.3",
53
- "typescript": "^4.9.5",
54
- "vite-plugin-checker": "^0.8.0"
55
- }
56
- }
1
+ {
2
+ "name": "kelt-ui-kit-react",
3
+ "type": "module",
4
+ "version": "2.0.9",
5
+ "private": false,
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/funeste29200/ui-kit-react.git"
9
+ },
10
+ "main": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "dependencies": {
13
+ "@types/node": "^22.5.5",
14
+ "@vitejs/plugin-react": "^4.3.1",
15
+ "bootstrap-icons": "^1.11.3",
16
+ "jwt-decode": "^4.0.0",
17
+ "react-date-picker": "^11.0.0",
18
+ "styled-components": "^6.1.13",
19
+ "vite": "^5.4.6",
20
+ "vite-plugin-dts": "^4.2.2",
21
+ "vite-plugin-eslint": "^1.8.1",
22
+ "web-vitals": "^2.1.4",
23
+ "zustand": "^5.0.5"
24
+ },
25
+ "peerDependencies": {
26
+ "react": "^18.3.1",
27
+ "react-dom": "^18.3.1",
28
+ "react-router-dom": "^6.26.2"
29
+ },
30
+ "scripts": {
31
+ "dev": "vite",
32
+ "build": "tsc -b && vite build",
33
+ "docs:build": "tsc -b && vite build --mode docs",
34
+ "docs:preview": "vite preview --outDir dist-docs",
35
+ "docs:test": "tsc -p tsconfig.docs.json && node --test tests/documentation.test.mjs",
36
+ "test": "node --test tests/dataTable.test.mjs",
37
+ "lint": "eslint .",
38
+ "preview": "vite preview"
39
+ },
40
+ "eslintConfig": {
41
+ "extends": [
42
+ "react-app",
43
+ "react-app/jest"
44
+ ]
45
+ },
46
+ "browserslist": {
47
+ "production": [
48
+ ">0.2%",
49
+ "not dead",
50
+ "not op_mini all"
51
+ ],
52
+ "development": [
53
+ "last 1 chrome version",
54
+ "last 1 firefox version",
55
+ "last 1 safari version"
56
+ ]
57
+ },
58
+ "devDependencies": {
59
+ "@types/react-dom": "^18.3.0",
60
+ "@types/react-router-dom": "^5.3.3",
61
+ "typescript": "^4.9.5",
62
+ "vite-plugin-checker": "^0.8.0"
63
+ }
64
+ }
package/public/index.html CHANGED
@@ -1,18 +1,18 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta name="description" content="Web site created using Vite" />
9
- <link rel="apple-touch-icon" href="/logo192.png" />
10
- <link rel="manifest" href="/manifest.json" />
11
- <title>Vite App</title>
12
- </head>
13
- <body>
14
- <noscript>You need to enable JavaScript to run this app.</noscript>
15
- <div id="root"></div>
16
- <script type="module" src="/src/main.tsx"></script>
17
- </body>
18
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <meta name="theme-color" content="#000000" />
8
+ <meta name="description" content="Web site created using Vite" />
9
+ <link rel="apple-touch-icon" href="/logo192.png" />
10
+ <link rel="manifest" href="/manifest.json" />
11
+ <title>Vite App</title>
12
+ </head>
13
+ <body>
14
+ <noscript>You need to enable JavaScript to run this app.</noscript>
15
+ <div id="root"></div>
16
+ <script type="module" src="/src/main.tsx"></script>
17
+ </body>
18
+ </html>
@@ -1,25 +1,25 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
package/public/robots.txt CHANGED
@@ -1,3 +1,3 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow: