kelt-ui-kit-react 2.0.8 → 2.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.
- package/.github/workflows/publish.yml +40 -31
- package/README.md +124 -72
- package/dist/App.d.ts +2 -3
- package/dist/App.menu.d.ts +10 -10
- package/dist/App.routes.d.ts +1 -1
- package/dist/_core/hooks/HistoryProvider.d.ts +5 -5
- package/dist/_core/hooks/ImageChecker.d.ts +5 -6
- package/dist/_core/hooks/imageExist.d.ts +5 -6
- package/dist/_core/hooks/isEAN13.d.ts +1 -1
- package/dist/_core/hooks/objectToQueryParams.d.ts +1 -1
- package/dist/_core/hooks/useCurrency.d.ts +3 -3
- package/dist/_core/hooks/useDateutils.d.ts +4 -4
- package/dist/_core/hooks/useIsMobile.d.ts +1 -1
- package/dist/_core/hooks/useToken.d.ts +3 -3
- package/dist/_core/hooks/useValidate.d.ts +5 -5
- package/dist/_core/hooks/widgetSupport.d.ts +1 -1
- package/dist/_core/type/generiqueType.d.ts +4 -0
- package/dist/action/Action.view.d.ts +1 -1
- package/dist/action/ButtonAction.d.ts +8 -9
- package/dist/addressSearch/AddressSearch.d.ts +18 -19
- package/dist/addressSearch/AddressSearch.view.d.ts +1 -1
- package/dist/badge/Badge.d.ts +10 -9
- package/dist/badge/Badge.view.d.ts +1 -1
- package/dist/button/Button.d.ts +1 -2
- package/dist/button/Button.view.d.ts +1 -1
- package/dist/button/button.interface.d.ts +19 -20
- package/dist/button/buttonActions/ButtonActions.d.ts +11 -12
- package/dist/button/buttonFile/ButtonFile.d.ts +9 -9
- package/dist/button/buttonFile/ButtonFile.view.d.ts +1 -1
- package/dist/button/buttonFilters/ButtonFilters.d.ts +16 -17
- package/dist/card/Card.d.ts +14 -15
- package/dist/card/Card.view.d.ts +1 -1
- package/dist/card/card.interface.d.ts +10 -10
- package/dist/card/cardAction/CardAction.d.ts +14 -14
- package/dist/card/cardAction.interface.d.ts +8 -9
- package/dist/card/hook/useCardInteractions.d.ts +8 -8
- package/dist/carousel/Carousel.d.ts +14 -15
- package/dist/carousel/Carousel.view.d.ts +1 -1
- package/dist/damier/Damier.d.ts +9 -10
- package/dist/damier/Damier.view.d.ts +1 -1
- package/dist/damier/damierCell/DamierCell.d.ts +6 -7
- package/dist/damier/damierCell/damierCell.interface.d.ts +6 -6
- package/dist/dataTable/DataTable.d.ts +37 -33
- package/dist/dataTable/DataTable.view.d.ts +1 -1
- package/dist/dataTable/dataTable.interface.d.ts +70 -47
- package/dist/dataTable/dataTable.utils.d.ts +17 -0
- package/dist/dataTable/dataTableActions/DataTableAction.d.ts +9 -10
- package/dist/dataTable/dataTableColumn/DataTableColumn.d.ts +14 -8
- package/dist/dataTable/dataTableColumn/dataTableColumnFilter/DataTableColumnFilter.d.ts +9 -0
- package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDate/DataTableColumnFilterDate.d.ts +9 -0
- package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDateRange/dataTableColumnFilterDateRange.d.ts +9 -0
- package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterEnum/DataTableColumnFilterEnum.d.ts +12 -0
- package/dist/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterString/DataTableColumnFilterString.d.ts +9 -0
- package/dist/dataTable/dataTableColumn/dataTableColumnSort/DataTableColumnSort.d.ts +10 -0
- package/dist/dataTable/dataTableFilters/DataTableFilters.d.ts +6 -0
- package/dist/dataTable/dataTableLoading/DataTableLoading.d.ts +8 -7
- package/dist/dataTable/dataTableRow/DataTableRow.d.ts +12 -11
- package/dist/dataTable/useDataTableState.d.ts +13 -0
- package/dist/datePicker/DatePicker.d.ts +7 -8
- package/dist/datePicker/DatePicker.view.d.ts +1 -1
- package/dist/docs/ComponentDocs.d.ts +6 -0
- package/dist/docs/catalog.d.ts +8 -0
- package/dist/docs/documentation.types.d.ts +21 -0
- package/dist/expands/Expands.d.ts +11 -12
- package/dist/expands/Expands.view.d.ts +1 -1
- package/dist/expands/expand/expand.d.ts +10 -11
- package/dist/expands/expand/expand.interface.d.ts +9 -9
- package/dist/filAriane/FilAriane.d.ts +8 -9
- package/dist/filAriane/FilAriane.view.d.ts +1 -1
- package/dist/filAriane/filAriane.interface.d.ts +6 -6
- package/dist/form/Form.d.ts +35 -36
- package/dist/form/Form.view.d.ts +1 -1
- package/dist/form/form.enum.d.ts +16 -15
- package/dist/form/form.interface.d.ts +53 -54
- package/dist/form/input/Input.d.ts +27 -25
- package/dist/form/inputNumber/InputNumber.d.ts +21 -22
- package/dist/form/inputNumber/InputNumber.view.d.ts +1 -1
- package/dist/form/inputPrice/InputPrice.d.ts +14 -15
- package/dist/form/inputPrice/InputPrice.view.d.ts +1 -1
- package/dist/form/textArea/TextArea.d.ts +14 -15
- package/dist/form/textArea/TextArea.view.d.ts +1 -1
- package/dist/geocoding/GeocodingService.d.ts +11 -12
- package/dist/geocoding/geocoding.interface.d.ts +20 -20
- package/dist/grid/Grid.d.ts +9 -10
- package/dist/grid/Grid.view.d.ts +1 -1
- package/dist/grid/col/Col.d.ts +5 -6
- package/dist/grid/col/colStyled/ColStyled.d.ts +10 -11
- package/dist/grid/container/Container.d.ts +5 -6
- package/dist/grid/grid.interface.d.ts +23 -23
- package/dist/grid/row/Row.d.ts +13 -14
- package/dist/header/Header.d.ts +1 -2
- package/dist/header/Header.view.d.ts +1 -1
- package/dist/header/header.interface.d.ts +12 -12
- package/dist/home/Home.d.ts +1 -1
- package/dist/icon/Icon.d.ts +1 -2
- package/dist/icon/Icons.view.d.ts +1 -1
- package/dist/icon/icon.interface.d.ts +5 -5
- package/dist/icon/iconSize.enum.d.ts +7 -7
- package/dist/index.d.ts +56 -54
- package/dist/index.html +18 -18
- package/dist/index.js +3966 -3460
- package/dist/loader/Loader.d.ts +7 -8
- package/dist/loader/Loader.view.d.ts +1 -1
- package/dist/main.d.ts +0 -1
- package/dist/manifest.json +25 -25
- package/dist/menus/Menus.d.ts +5 -6
- package/dist/menus/Menus.view.d.ts +1 -1
- package/dist/menus/menu/Menu.d.ts +7 -8
- package/dist/menus/menu/menu.interface.d.ts +10 -10
- package/dist/message/Message.d.ts +6 -7
- package/dist/message/Message.view.d.ts +1 -1
- package/dist/modal/Modal.d.ts +13 -14
- package/dist/modal/Modal.view.d.ts +1 -1
- package/dist/notFound/NotFound.d.ts +1 -1
- package/dist/overlayPanel/OverlayPanel.d.ts +22 -23
- package/dist/overlayPanel/OverlayPanel.view.d.ts +1 -1
- package/dist/overlayPanel/overlay.context.d.ts +9 -10
- package/dist/overlayPanel/overlayPanelStyled/OverlayPanelStyled.d.ts +9 -9
- package/dist/pdfViewer/PdfViewer.d.ts +12 -12
- package/dist/pdfViewer/PdfViewer.view.d.ts +1 -1
- package/dist/quantity/Quantity.d.ts +10 -11
- package/dist/robots.txt +3 -3
- package/dist/search/Search.d.ts +21 -22
- package/dist/search/Search.view.d.ts +1 -1
- package/dist/select/Select.d.ts +25 -24
- package/dist/select/Select.view.d.ts +1 -1
- package/dist/select/selectOption.interface.d.ts +5 -5
- package/dist/sidebar/Sidebar.d.ts +12 -13
- package/dist/sidebar/Sidebar.view.d.ts +1 -1
- package/dist/sidebarData/SidebarData.d.ts +6 -7
- package/dist/sidebarData/SidebarData.view.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tabs/Tabs.d.ts +17 -17
- package/dist/tabs/Tabs.view.d.ts +1 -1
- package/dist/toaster/Toaster.d.ts +1 -2
- package/dist/toaster/Toaster.view.d.ts +1 -1
- package/dist/toaster/store/useToasterStore.d.ts +24 -24
- package/docs.plugin.ts +223 -0
- package/index.html +20 -18
- package/package.json +63 -55
- package/public/index.html +18 -18
- package/public/manifest.json +25 -25
- package/public/robots.txt +3 -3
- package/src/App.css +178 -11
- package/src/App.menu.tsx +277 -257
- package/src/App.routes.tsx +21 -16
- package/src/App.tsx +31 -30
- package/src/_core/hooks/HistoryProvider.tsx +25 -25
- package/src/_core/hooks/ImageChecker.tsx +26 -26
- package/src/_core/hooks/imageExist.tsx +9 -9
- package/src/_core/hooks/isEAN13.tsx +16 -16
- package/src/_core/hooks/objectToQueryParams.tsx +32 -32
- package/src/_core/hooks/useCurrency.tsx +18 -18
- package/src/_core/hooks/useDateutils.ts +64 -64
- package/src/_core/hooks/useIsMobile.ts +18 -18
- package/src/_core/hooks/useToken.tsx +19 -19
- package/src/_core/hooks/useValidate.tsx +18 -18
- package/src/_core/hooks/widgetSupport.tsx +39 -39
- package/src/_core/type/generiqueType.tsx +4 -0
- package/src/action/Action.view.tsx +21 -21
- package/src/action/ButtonAction.tsx +32 -32
- package/src/action/action.css +20 -20
- package/src/addressSearch/AddressSearch.tsx +246 -246
- package/src/addressSearch/AddressSearch.view.tsx +52 -52
- package/src/addressSearch/addressSearch.css +132 -132
- package/src/badge/Badge.tsx +41 -34
- package/src/badge/Badge.view.tsx +15 -15
- package/src/badge/badge.css +63 -55
- package/src/button/Button.tsx +48 -48
- package/src/button/Button.view.tsx +85 -85
- package/src/button/button.css +53 -53
- package/src/button/button.interface.tsx +22 -22
- package/src/button/buttonActions/ButtonActions.tsx +104 -104
- package/src/button/buttonFile/ButtonFile.tsx +59 -59
- package/src/button/buttonFile/ButtonFile.view.tsx +70 -70
- package/src/button/buttonFilters/ButtonFilters.tsx +102 -102
- package/src/button/buttonFilters/buttonFilters.css +22 -22
- package/src/card/Card.tsx +151 -151
- package/src/card/Card.view.tsx +73 -73
- package/src/card/card.css +144 -144
- package/src/card/card.interface.tsx +9 -9
- package/src/card/cardAction/CardAction.tsx +129 -135
- package/src/card/cardAction/cardAction.css +10 -10
- package/src/card/cardAction.interface.tsx +10 -10
- package/src/card/hook/useCardInteractions.tsx +30 -30
- package/src/carousel/Carousel.css +44 -44
- package/src/carousel/Carousel.tsx +115 -115
- package/src/carousel/Carousel.view.tsx +13 -13
- package/src/damier/Damier.tsx +64 -64
- package/src/damier/Damier.view.tsx +31 -31
- package/src/damier/damier.css +50 -50
- package/src/damier/damierCell/DamierCell.tsx +18 -18
- package/src/damier/damierCell/damierCell.interface.tsx +5 -5
- package/src/dataTable/DataTable.tsx +845 -746
- package/src/dataTable/DataTable.view.tsx +105 -71
- package/src/dataTable/dataTable.css +333 -208
- package/src/dataTable/dataTable.interface.ts +66 -45
- package/src/dataTable/dataTable.utils.ts +45 -0
- package/src/dataTable/dataTableActions/DataTableAction.tsx +82 -65
- package/src/dataTable/dataTableColumn/DataTableColumn.tsx +48 -27
- package/src/dataTable/dataTableColumn/dataTableColumnFilter/DataTableColumnFilter.tsx +36 -0
- package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilter.css +0 -0
- package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDate/DataTableColumnFilterDate.tsx +39 -0
- package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterDateRange/dataTableColumnFilterDateRange.tsx +80 -0
- package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterEnum/DataTableColumnFilterEnum.tsx +89 -0
- package/src/dataTable/dataTableColumn/dataTableColumnFilter/dataTableColumnFilterString/DataTableColumnFilterString.tsx +37 -0
- package/src/dataTable/dataTableColumn/dataTableColumnSort/DataTableColumnSort.tsx +42 -0
- package/src/dataTable/dataTableFilters/DataTableFilters.tsx +91 -0
- package/src/dataTable/dataTableFilters/dataTableFilters.css +16 -0
- package/src/dataTable/dataTableLoading/DataTableLoading.tsx +23 -21
- package/src/dataTable/dataTableRow/DataTableRow.tsx +155 -208
- package/src/dataTable/useDataTableState.tsx +95 -0
- package/src/datePicker/DatePicker.tsx +110 -110
- package/src/datePicker/DatePicker.view.tsx +9 -9
- package/src/datePicker/datePicker.css +77 -77
- package/src/docs/ComponentDocs.tsx +156 -0
- package/src/docs/catalog.ts +40 -0
- package/src/docs/documentation.types.ts +20 -0
- package/src/docs/virtual.d.ts +7 -0
- package/src/expands/Expands.tsx +46 -46
- package/src/expands/Expands.view.tsx +90 -90
- package/src/expands/expand/expand.interface.tsx +8 -8
- package/src/expands/expand/expand.tsx +191 -191
- package/src/expands/expands.css +101 -101
- package/src/filAriane/FilAriane.tsx +57 -57
- package/src/filAriane/FilAriane.view.tsx +28 -28
- package/src/filAriane/filAriane.css +23 -23
- package/src/filAriane/filAriane.interface.tsx +6 -6
- package/src/form/Form.tsx +477 -477
- package/src/form/Form.view.tsx +67 -67
- package/src/form/form.css +135 -135
- package/src/form/form.enum.ts +16 -15
- package/src/form/form.interface.tsx +67 -67
- package/src/form/input/Input.tsx +146 -106
- package/src/form/input/input.css +39 -29
- package/src/form/inputNumber/InputNumber.tsx +132 -132
- package/src/form/inputNumber/InputNumber.view.tsx +15 -15
- package/src/form/inputPrice/InputPrice.tsx +42 -42
- package/src/form/inputPrice/InputPrice.view.tsx +15 -15
- package/src/form/textArea/TextArea.tsx +59 -59
- package/src/form/textArea/TextArea.view.tsx +34 -34
- package/src/form/textArea/textArea.css +9 -9
- package/src/geocoding/GeocodingService.ts +89 -89
- package/src/geocoding/geocoding.interface.ts +25 -25
- package/src/grid/Grid.tsx +34 -34
- package/src/grid/Grid.view.tsx +24 -24
- package/src/grid/col/Col.tsx +24 -24
- package/src/grid/col/col.css +3 -3
- package/src/grid/col/colStyled/ColStyled.tsx +59 -59
- package/src/grid/container/Container.tsx +8 -8
- package/src/grid/container/container.css +4 -4
- package/src/grid/grid.interface.tsx +27 -27
- package/src/grid/row/Row.tsx +49 -49
- package/src/grid/row/row.css +25 -25
- package/src/header/Header.tsx +64 -64
- package/src/header/Header.view.tsx +5 -5
- package/src/header/header.css +43 -43
- package/src/header/header.interface.tsx +11 -11
- package/src/home/Home.tsx +40 -3
- package/src/icon/Icon.tsx +6 -6
- package/src/icon/Icons.view.tsx +29 -29
- package/src/icon/icon.css +20 -20
- package/src/icon/icon.interface.tsx +7 -6
- package/src/icon/iconSize.enum.ts +7 -7
- package/src/index.css +547 -547
- package/src/index.ts +76 -70
- package/src/loader/Loader.tsx +37 -37
- package/src/loader/Loader.view.tsx +20 -20
- package/src/loader/loader.css +30 -30
- package/src/main.tsx +10 -10
- package/src/menus/Menus.tsx +43 -43
- package/src/menus/Menus.view.tsx +39 -39
- package/src/menus/menu/Menu.tsx +18 -18
- package/src/menus/menu/menu.interface.tsx +9 -9
- package/src/menus/menus.css +47 -47
- package/src/message/Message.tsx +30 -30
- package/src/message/Message.view.tsx +22 -22
- package/src/message/message.css +29 -29
- package/src/modal/Modal.tsx +59 -59
- package/src/modal/Modal.view.tsx +26 -26
- package/src/modal/modal.css +71 -71
- package/src/notFound/NotFound.tsx +3 -3
- package/src/overlayPanel/OverlayPanel.tsx +265 -255
- package/src/overlayPanel/OverlayPanel.view.tsx +25 -25
- package/src/overlayPanel/overlay.context.tsx +30 -30
- package/src/overlayPanel/overlayPanel.css +43 -43
- package/src/overlayPanel/overlayPanelStyled/OverlayPanelStyled.tsx +23 -23
- package/src/pdfViewer/PdfViewer.tsx +73 -73
- package/src/pdfViewer/PdfViewer.view.tsx +5 -5
- package/src/quantity/Quantity.tsx +103 -103
- package/src/quantity/quantity.css +26 -26
- package/src/search/Search.tsx +161 -161
- package/src/search/Search.view.tsx +14 -14
- package/src/search/search.css +59 -59
- package/src/select/Select.tsx +247 -245
- package/src/select/Select.view.tsx +71 -71
- package/src/select/select.css +150 -150
- package/src/select/selectOption.interface.ts +5 -5
- package/src/sidebar/Sidebar.tsx +213 -213
- package/src/sidebar/Sidebar.view.tsx +17 -17
- package/src/sidebar/sidebar.css +103 -103
- package/src/sidebarData/SidebarData.tsx +19 -19
- package/src/sidebarData/SidebarData.view.tsx +19 -19
- package/src/sidebarData/sidebarData.css +27 -27
- package/src/tabs/Tabs.tsx +101 -90
- package/src/tabs/Tabs.view.tsx +20 -20
- package/src/tabs/tabs.css +29 -29
- package/src/toaster/Toaster.tsx +61 -61
- package/src/toaster/Toaster.view.tsx +25 -25
- package/src/toaster/store/useToasterStore.tsx +54 -54
- package/src/toaster/toaster.css +105 -105
- package/tests/dataTable.test.mjs +93 -0
- package/tests/documentation.test.mjs +75 -0
- package/tsconfig.docs.json +10 -0
- package/tsconfig.json +28 -28
- package/vite.config.ts +26 -20
- package/vite.config.ts.timestamp-1733262892554-a13dfef6e8a29.mjs +24 -24
- package/vite.config.ts.timestamp-1757847121745-e5a5bf54b81b.mjs +28 -28
- package/vite.config.ts.timestamp-1759742478362-4ac5c5a7db34b.mjs +28 -28
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Sidebar, SidebarProps } from "../sidebar/Sidebar";
|
|
2
|
-
import "./sidebarData.css";
|
|
3
|
-
|
|
4
|
-
interface SidebarDataProps extends SidebarProps {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
classNameContent?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const SidebarData = (props: SidebarDataProps) => {
|
|
10
|
-
return (
|
|
11
|
-
<Sidebar {...props} className={`full sidebar-data ${props.className}`}>
|
|
12
|
-
{props.children && (
|
|
13
|
-
<div className={`sidebar-data-content ${props.classNameContent} `}>
|
|
14
|
-
{props.children}
|
|
15
|
-
</div>
|
|
16
|
-
)}
|
|
17
|
-
</Sidebar>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
1
|
+
import { Sidebar, SidebarProps } from "../sidebar/Sidebar";
|
|
2
|
+
import "./sidebarData.css";
|
|
3
|
+
|
|
4
|
+
interface SidebarDataProps extends SidebarProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
classNameContent?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const SidebarData = (props: SidebarDataProps) => {
|
|
10
|
+
return (
|
|
11
|
+
<Sidebar {...props} className={`full sidebar-data ${props.className}`}>
|
|
12
|
+
{props.children && (
|
|
13
|
+
<div className={`sidebar-data-content ${props.classNameContent} `}>
|
|
14
|
+
{props.children}
|
|
15
|
+
</div>
|
|
16
|
+
)}
|
|
17
|
+
</Sidebar>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useCallback, useState } from "react";
|
|
2
|
-
import { Button } from "../button/Button";
|
|
3
|
-
import { SidebarData } from "./SidebarData";
|
|
4
|
-
|
|
5
|
-
export const SidebarDataView = () => {
|
|
6
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
-
const onClick = useCallback(() => {
|
|
8
|
-
setIsOpen(true);
|
|
9
|
-
}, [setIsOpen]);
|
|
10
|
-
const onClose = useCallback(() => {
|
|
11
|
-
setIsOpen(false);
|
|
12
|
-
}, [setIsOpen]);
|
|
13
|
-
return (
|
|
14
|
-
<>
|
|
15
|
-
<Button title={"open me"} onClick={onClick}></Button>
|
|
16
|
-
<SidebarData onClose={onClose} width="20vw" title="Infos" open={isOpen} />
|
|
17
|
-
</>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
import { Button } from "../button/Button";
|
|
3
|
+
import { SidebarData } from "./SidebarData";
|
|
4
|
+
|
|
5
|
+
export const SidebarDataView = () => {
|
|
6
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
+
const onClick = useCallback(() => {
|
|
8
|
+
setIsOpen(true);
|
|
9
|
+
}, [setIsOpen]);
|
|
10
|
+
const onClose = useCallback(() => {
|
|
11
|
+
setIsOpen(false);
|
|
12
|
+
}, [setIsOpen]);
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<Button title={"open me"} onClick={onClick}></Button>
|
|
16
|
+
<SidebarData onClose={onClose} width="20vw" title="Infos" open={isOpen} />
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
.sidebar {
|
|
2
|
-
&.sidebar-data {
|
|
3
|
-
background-color: #fff;
|
|
4
|
-
box-shadow: -4px 0 15px rgba(0, 0, 0, 0.3);
|
|
5
|
-
color: #333;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
&.closed {
|
|
9
|
-
transform: translateX(100vw);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.toggle-btn {
|
|
13
|
-
color: #333;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.sidebar-data-content {
|
|
17
|
-
padding: 1rem;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
@media screen and (max-width: 992px) {
|
|
22
|
-
.sidebar {
|
|
23
|
-
&.sidebar-data {
|
|
24
|
-
width: 100% !important;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
.sidebar {
|
|
2
|
+
&.sidebar-data {
|
|
3
|
+
background-color: #fff;
|
|
4
|
+
box-shadow: -4px 0 15px rgba(0, 0, 0, 0.3);
|
|
5
|
+
color: #333;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
&.closed {
|
|
9
|
+
transform: translateX(100vw);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.toggle-btn {
|
|
13
|
+
color: #333;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.sidebar-data-content {
|
|
17
|
+
padding: 1rem;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
@media screen and (max-width: 992px) {
|
|
22
|
+
.sidebar {
|
|
23
|
+
&.sidebar-data {
|
|
24
|
+
width: 100% !important;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/tabs/Tabs.tsx
CHANGED
|
@@ -1,90 +1,101 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
-
import "./tabs.css";
|
|
3
|
-
export type TabItem = {
|
|
4
|
-
key: string;
|
|
5
|
-
title: React.ReactNode;
|
|
6
|
-
panel: React.ReactNode;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type TabsProps = {
|
|
11
|
-
items: TabItem[];
|
|
12
|
-
defaultIndex?: number;
|
|
13
|
-
index?: number; // if provided, component is controlled
|
|
14
|
-
onChange?: (nextIndex: number) => void;
|
|
15
|
-
className?: string;
|
|
16
|
-
tabClassName?: string;
|
|
17
|
-
panelClassName?: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setActive(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import "./tabs.css";
|
|
3
|
+
export type TabItem = {
|
|
4
|
+
key: string;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
panel: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type TabsProps = {
|
|
11
|
+
items: TabItem[];
|
|
12
|
+
defaultIndex?: number;
|
|
13
|
+
index?: number; // if provided, component is controlled
|
|
14
|
+
onChange?: (nextIndex: number) => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
tabClassName?: string;
|
|
17
|
+
panelClassName?: string;
|
|
18
|
+
keepMountedVisited?: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const Tabs = ({
|
|
22
|
+
items,
|
|
23
|
+
defaultIndex = 0,
|
|
24
|
+
index,
|
|
25
|
+
onChange,
|
|
26
|
+
className = "",
|
|
27
|
+
tabClassName = "",
|
|
28
|
+
panelClassName = "",
|
|
29
|
+
keepMountedVisited = false,
|
|
30
|
+
}: TabsProps) => {
|
|
31
|
+
const isControlled = typeof index === "number";
|
|
32
|
+
const [active, setActive] = useState<number>(defaultIndex);
|
|
33
|
+
const current = isControlled ? (index as number) : active;
|
|
34
|
+
const [visitedTabs, setVisitedTabs] = useState<Set<number>>(
|
|
35
|
+
() => new Set([current]),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (keepMountedVisited) {
|
|
40
|
+
setVisitedTabs((visited) => visited.has(current) ? visited : new Set([...Array.from(visited), current]));
|
|
41
|
+
}
|
|
42
|
+
}, [current, keepMountedVisited]);
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
// clamp
|
|
46
|
+
if (!isControlled && (defaultIndex < 0 || defaultIndex >= items.length)) {
|
|
47
|
+
setActive(0);
|
|
48
|
+
}
|
|
49
|
+
}, [defaultIndex, items.length, isControlled]);
|
|
50
|
+
|
|
51
|
+
const tabsRef = useRef<Array<HTMLButtonElement | null>>([]);
|
|
52
|
+
|
|
53
|
+
const activate = (next: number) => {
|
|
54
|
+
if (items[next]?.disabled) return;
|
|
55
|
+
if (isControlled) {
|
|
56
|
+
onChange?.(next);
|
|
57
|
+
} else {
|
|
58
|
+
setActive(next);
|
|
59
|
+
onChange?.(next);
|
|
60
|
+
}
|
|
61
|
+
tabsRef.current[next]?.focus();
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div className={`tabs-root ${className}`}>
|
|
66
|
+
<div role="tablist" className="tabs-header">
|
|
67
|
+
{items.map((t, i) => (
|
|
68
|
+
<button
|
|
69
|
+
key={`tab-${t.key}`}
|
|
70
|
+
ref={(r) => (tabsRef.current[i] = r)}
|
|
71
|
+
role="tab"
|
|
72
|
+
id={`tab-${t.key}`}
|
|
73
|
+
aria-selected={current === i}
|
|
74
|
+
aria-controls={`panel-${t.key}`}
|
|
75
|
+
tabIndex={current === i ? 0 : -1}
|
|
76
|
+
disabled={t.disabled}
|
|
77
|
+
onClick={() => activate(i)}
|
|
78
|
+
className={`${tabClassName} tab-button ${
|
|
79
|
+
current === i ? "tab-button--active" : ""
|
|
80
|
+
} ${t.disabled ? "tab-button--disabled" : ""}`}
|
|
81
|
+
>
|
|
82
|
+
{t.title}
|
|
83
|
+
</button>
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
{items.map((t, i) => (
|
|
88
|
+
<div
|
|
89
|
+
key={`panel-${t.key}`}
|
|
90
|
+
role="tabpanel"
|
|
91
|
+
id={`panel-${t.key}`}
|
|
92
|
+
aria-labelledby={`tab-${t.key}`}
|
|
93
|
+
hidden={current !== i}
|
|
94
|
+
className={`${panelClassName} mt-3`}
|
|
95
|
+
>
|
|
96
|
+
{(current === i || (keepMountedVisited && visitedTabs.has(i))) && t.panel}
|
|
97
|
+
</div>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
package/src/tabs/Tabs.view.tsx
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { TabItem, Tabs } from "./Tabs";
|
|
2
|
-
|
|
3
|
-
export const TabsView = () => {
|
|
4
|
-
const items: TabItem[] = [
|
|
5
|
-
{ key: "first", title: "Info", panel: <div>Contenu 1</div> },
|
|
6
|
-
{ key: "second", title: "Détails", panel: <div>Contenu 2</div> },
|
|
7
|
-
{
|
|
8
|
-
key: "third",
|
|
9
|
-
title: "Paramètres",
|
|
10
|
-
panel: <div>Contenu 3</div>,
|
|
11
|
-
disabled: false,
|
|
12
|
-
},
|
|
13
|
-
];
|
|
14
|
-
return (
|
|
15
|
-
<div>
|
|
16
|
-
<h2 className="text-xl mb-4">Exemple de Tabs</h2>
|
|
17
|
-
<Tabs items={items} defaultIndex={0} />
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
1
|
+
import { TabItem, Tabs } from "./Tabs";
|
|
2
|
+
|
|
3
|
+
export const TabsView = () => {
|
|
4
|
+
const items: TabItem[] = [
|
|
5
|
+
{ key: "first", title: "Info", panel: <div>Contenu 1</div> },
|
|
6
|
+
{ key: "second", title: "Détails", panel: <div>Contenu 2</div> },
|
|
7
|
+
{
|
|
8
|
+
key: "third",
|
|
9
|
+
title: "Paramètres",
|
|
10
|
+
panel: <div>Contenu 3</div>,
|
|
11
|
+
disabled: false,
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
return (
|
|
15
|
+
<div>
|
|
16
|
+
<h2 className="text-xl mb-4">Exemple de Tabs</h2>
|
|
17
|
+
<Tabs items={items} defaultIndex={0} />
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
package/src/tabs/tabs.css
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
.tabs-root {
|
|
2
|
-
height: 100%;
|
|
3
|
-
|
|
4
|
-
.tabs-header {
|
|
5
|
-
display: flex;
|
|
6
|
-
border-bottom: 1px solid #b2a1a1;
|
|
7
|
-
|
|
8
|
-
.tab-button {
|
|
9
|
-
padding: 0.5rem 0.75rem;
|
|
10
|
-
border: 0px;
|
|
11
|
-
outline: none;
|
|
12
|
-
background-color: transparent;
|
|
13
|
-
color: #1e293b;
|
|
14
|
-
/* slate-800 */
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
|
|
17
|
-
&.tab-button--active {
|
|
18
|
-
border-bottom: 2px solid var(--primary-color);
|
|
19
|
-
/* slate-800 */
|
|
20
|
-
border-radius: 0px;
|
|
21
|
-
font-weight: bold;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.tab-button--disabled {
|
|
25
|
-
opacity: 0.5;
|
|
26
|
-
cursor: not-allowed;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
.tabs-root {
|
|
2
|
+
height: 100%;
|
|
3
|
+
|
|
4
|
+
.tabs-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
border-bottom: 1px solid #b2a1a1;
|
|
7
|
+
|
|
8
|
+
.tab-button {
|
|
9
|
+
padding: 0.5rem 0.75rem;
|
|
10
|
+
border: 0px;
|
|
11
|
+
outline: none;
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
color: #1e293b;
|
|
14
|
+
/* slate-800 */
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
|
|
17
|
+
&.tab-button--active {
|
|
18
|
+
border-bottom: 2px solid var(--primary-color);
|
|
19
|
+
/* slate-800 */
|
|
20
|
+
border-radius: 0px;
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.tab-button--disabled {
|
|
25
|
+
opacity: 0.5;
|
|
26
|
+
cursor: not-allowed;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
30
|
}
|
package/src/toaster/Toaster.tsx
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { useCallback, useEffect } from "react";
|
|
2
|
-
import ReactDOM from "react-dom";
|
|
3
|
-
import { Icon } from "../icon/Icon";
|
|
4
|
-
import { useToasterStore } from "./store/useToasterStore";
|
|
5
|
-
import "./toaster.css";
|
|
6
|
-
|
|
7
|
-
export const Toaster = () => {
|
|
8
|
-
const {
|
|
9
|
-
title,
|
|
10
|
-
description,
|
|
11
|
-
severity = "info",
|
|
12
|
-
visible,
|
|
13
|
-
children,
|
|
14
|
-
duration,
|
|
15
|
-
hideToast,
|
|
16
|
-
close,
|
|
17
|
-
position,
|
|
18
|
-
} = useToasterStore();
|
|
19
|
-
const onClose = useCallback(() => {
|
|
20
|
-
hideToast();
|
|
21
|
-
}, [hideToast]);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (!visible) return;
|
|
24
|
-
const timer = setTimeout(() => {
|
|
25
|
-
hideToast();
|
|
26
|
-
}, duration);
|
|
27
|
-
return () => clearTimeout(timer);
|
|
28
|
-
}, [visible, duration, hideToast]);
|
|
29
|
-
|
|
30
|
-
if (!visible) return null;
|
|
31
|
-
|
|
32
|
-
const toasterRoot = document.getElementById("toaster-root");
|
|
33
|
-
if (!toasterRoot) return null;
|
|
34
|
-
|
|
35
|
-
return ReactDOM.createPortal(
|
|
36
|
-
<div className={`toaster toaster-${severity} toaster--${position}`}>
|
|
37
|
-
{close && (
|
|
38
|
-
<button
|
|
39
|
-
type="button"
|
|
40
|
-
className="toaster--close"
|
|
41
|
-
onClick={onClose}
|
|
42
|
-
aria-label="Fermer la notification"
|
|
43
|
-
>
|
|
44
|
-
<Icon classIcon="bi-x" />
|
|
45
|
-
</button>
|
|
46
|
-
)}
|
|
47
|
-
<div>
|
|
48
|
-
{severity === "info" && <Icon classIcon="bi-info-circle" />}
|
|
49
|
-
{severity === "success" && <Icon classIcon="bi-check-circle" />}
|
|
50
|
-
{severity === "error" && <Icon classIcon="bi-x-circle" />}
|
|
51
|
-
{severity === "warning" && <Icon classIcon="bi-exclamation-triangle" />}
|
|
52
|
-
</div>
|
|
53
|
-
<div>
|
|
54
|
-
<div className={`title title-${severity}`}>{title}</div>
|
|
55
|
-
{description && <div className="subtitle">{description}</div>}
|
|
56
|
-
{children}
|
|
57
|
-
</div>
|
|
58
|
-
</div>,
|
|
59
|
-
toasterRoot
|
|
60
|
-
);
|
|
61
|
-
};
|
|
1
|
+
import { useCallback, useEffect } from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
import { Icon } from "../icon/Icon";
|
|
4
|
+
import { useToasterStore } from "./store/useToasterStore";
|
|
5
|
+
import "./toaster.css";
|
|
6
|
+
|
|
7
|
+
export const Toaster = () => {
|
|
8
|
+
const {
|
|
9
|
+
title,
|
|
10
|
+
description,
|
|
11
|
+
severity = "info",
|
|
12
|
+
visible,
|
|
13
|
+
children,
|
|
14
|
+
duration,
|
|
15
|
+
hideToast,
|
|
16
|
+
close,
|
|
17
|
+
position,
|
|
18
|
+
} = useToasterStore();
|
|
19
|
+
const onClose = useCallback(() => {
|
|
20
|
+
hideToast();
|
|
21
|
+
}, [hideToast]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!visible) return;
|
|
24
|
+
const timer = setTimeout(() => {
|
|
25
|
+
hideToast();
|
|
26
|
+
}, duration);
|
|
27
|
+
return () => clearTimeout(timer);
|
|
28
|
+
}, [visible, duration, hideToast]);
|
|
29
|
+
|
|
30
|
+
if (!visible) return null;
|
|
31
|
+
|
|
32
|
+
const toasterRoot = document.getElementById("toaster-root");
|
|
33
|
+
if (!toasterRoot) return null;
|
|
34
|
+
|
|
35
|
+
return ReactDOM.createPortal(
|
|
36
|
+
<div className={`toaster toaster-${severity} toaster--${position}`}>
|
|
37
|
+
{close && (
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
className="toaster--close"
|
|
41
|
+
onClick={onClose}
|
|
42
|
+
aria-label="Fermer la notification"
|
|
43
|
+
>
|
|
44
|
+
<Icon classIcon="bi-x" />
|
|
45
|
+
</button>
|
|
46
|
+
)}
|
|
47
|
+
<div>
|
|
48
|
+
{severity === "info" && <Icon classIcon="bi-info-circle" />}
|
|
49
|
+
{severity === "success" && <Icon classIcon="bi-check-circle" />}
|
|
50
|
+
{severity === "error" && <Icon classIcon="bi-x-circle" />}
|
|
51
|
+
{severity === "warning" && <Icon classIcon="bi-exclamation-triangle" />}
|
|
52
|
+
</div>
|
|
53
|
+
<div>
|
|
54
|
+
<div className={`title title-${severity}`}>{title}</div>
|
|
55
|
+
{description && <div className="subtitle">{description}</div>}
|
|
56
|
+
{children}
|
|
57
|
+
</div>
|
|
58
|
+
</div>,
|
|
59
|
+
toasterRoot
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
2
|
-
import { Button } from "../button/Button";
|
|
3
|
-
import { useToasterStore } from "./store/useToasterStore";
|
|
4
|
-
|
|
5
|
-
export const ToasterView = (): JSX.Element => {
|
|
6
|
-
const { showToast } = useToasterStore();
|
|
7
|
-
const handleClickToast = useCallback(() => {
|
|
8
|
-
showToast("This is a toast message", {
|
|
9
|
-
description: "This is a description for the toast message.",
|
|
10
|
-
severity: "warning",
|
|
11
|
-
duration: 10000,
|
|
12
|
-
close: true,
|
|
13
|
-
children: <div>Additional content can go here.</div>,
|
|
14
|
-
});
|
|
15
|
-
}, [showToast]);
|
|
16
|
-
return (
|
|
17
|
-
<div>
|
|
18
|
-
<Button
|
|
19
|
-
title="Show Toast"
|
|
20
|
-
onClick={handleClickToast}
|
|
21
|
-
className="btn btn-primary"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { Button } from "../button/Button";
|
|
3
|
+
import { useToasterStore } from "./store/useToasterStore";
|
|
4
|
+
|
|
5
|
+
export const ToasterView = (): JSX.Element => {
|
|
6
|
+
const { showToast } = useToasterStore();
|
|
7
|
+
const handleClickToast = useCallback(() => {
|
|
8
|
+
showToast("This is a toast message", {
|
|
9
|
+
description: "This is a description for the toast message.",
|
|
10
|
+
severity: "warning",
|
|
11
|
+
duration: 10000,
|
|
12
|
+
close: true,
|
|
13
|
+
children: <div>Additional content can go here.</div>,
|
|
14
|
+
});
|
|
15
|
+
}, [showToast]);
|
|
16
|
+
return (
|
|
17
|
+
<div>
|
|
18
|
+
<Button
|
|
19
|
+
title="Show Toast"
|
|
20
|
+
onClick={handleClickToast}
|
|
21
|
+
className="btn btn-primary"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|