kelt-ui-kit-react 1.2.3 → 1.2.5

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 (215) hide show
  1. package/README.md +46 -46
  2. package/dist/App.d.ts +3 -2
  3. package/dist/App.menu.d.ts +10 -10
  4. package/dist/App.routes.d.ts +1 -1
  5. package/dist/_core/hooks/ImageChecker.d.ts +6 -5
  6. package/dist/_core/hooks/useIsMobile.d.ts +1 -1
  7. package/dist/action/Action.view.d.ts +1 -1
  8. package/dist/action/ButtonAction.d.ts +9 -8
  9. package/dist/badge/Badge.d.ts +9 -8
  10. package/dist/badge/Badge.view.d.ts +1 -1
  11. package/dist/button/Button.d.ts +2 -1
  12. package/dist/button/Button.view.d.ts +1 -1
  13. package/dist/button/button.interface.d.ts +18 -17
  14. package/dist/button/buttonActions/ButtonActions.d.ts +11 -10
  15. package/dist/card/Card.d.ts +13 -12
  16. package/dist/card/Card.view.d.ts +1 -1
  17. package/dist/card/card.interface.d.ts +10 -10
  18. package/dist/card/cardAction/CardAction.d.ts +14 -13
  19. package/dist/card/cardAction.interface.d.ts +9 -8
  20. package/dist/card/hook/useCardInteractions.d.ts +8 -8
  21. package/dist/carousel/Carousel.d.ts +15 -14
  22. package/dist/carousel/Carousel.view.d.ts +1 -1
  23. package/dist/damier/Damier.d.ts +10 -9
  24. package/dist/damier/Damier.view.d.ts +1 -1
  25. package/dist/damier/damierCell/DamierCell.d.ts +7 -6
  26. package/dist/damier/damierCell/damierCell.interface.d.ts +6 -6
  27. package/dist/dataTable/DataTable.d.ts +18 -17
  28. package/dist/dataTable/DataTable.view.d.ts +1 -1
  29. package/dist/dataTable/dataTable.interface.d.ts +31 -30
  30. package/dist/datePicker/DatePicker.d.ts +8 -7
  31. package/dist/datePicker/DatePicker.view.d.ts +1 -1
  32. package/dist/expands/Expands.d.ts +10 -9
  33. package/dist/expands/Expands.view.d.ts +1 -1
  34. package/dist/expands/expand/expand.d.ts +9 -8
  35. package/dist/expands/expand/expand.interface.d.ts +9 -9
  36. package/dist/filAriane/FilAriane.d.ts +9 -8
  37. package/dist/filAriane/FilAriane.view.d.ts +1 -1
  38. package/dist/filAriane/filAriane.interface.d.ts +6 -6
  39. package/dist/form/Form.d.ts +24 -23
  40. package/dist/form/Form.view.d.ts +1 -1
  41. package/dist/form/form.enum.d.ts +11 -11
  42. package/dist/form/form.interface.d.ts +30 -29
  43. package/dist/form/textArea/TextArea.d.ts +13 -12
  44. package/dist/form/textArea/TextArea.view.d.ts +1 -1
  45. package/dist/grid/Grid.d.ts +8 -7
  46. package/dist/grid/Grid.view.d.ts +1 -1
  47. package/dist/grid/col/Col.d.ts +10 -10
  48. package/dist/grid/col/colStyled/ColStyled.d.ts +9 -9
  49. package/dist/grid/container/Container.d.ts +6 -5
  50. package/dist/grid/grid.interface.d.ts +8 -8
  51. package/dist/grid/row/Row.d.ts +8 -7
  52. package/dist/header/Header.d.ts +2 -1
  53. package/dist/header/Header.view.d.ts +1 -1
  54. package/dist/header/header.interface.d.ts +9 -9
  55. package/dist/home/Home.d.ts +1 -1
  56. package/dist/icon/Icon.d.ts +2 -1
  57. package/dist/icon/Icons.view.d.ts +1 -1
  58. package/dist/icon/icon.interface.d.ts +5 -4
  59. package/dist/icon/iconSize.enum.d.ts +7 -7
  60. package/dist/index.d.ts +32 -31
  61. package/dist/index.html +18 -18
  62. package/dist/index.js +1 -1
  63. package/dist/loader/Loader.d.ts +8 -7
  64. package/dist/loader/Loader.view.d.ts +1 -1
  65. package/dist/main.d.ts +1 -0
  66. package/dist/manifest.json +25 -25
  67. package/dist/menus/Menus.d.ts +6 -5
  68. package/dist/menus/Menus.view.d.ts +1 -1
  69. package/dist/menus/menu/Menu.d.ts +7 -6
  70. package/dist/menus/menu/menu.interface.d.ts +10 -10
  71. package/dist/modal/Modal.d.ts +13 -12
  72. package/dist/modal/Modal.view.d.ts +1 -1
  73. package/dist/notFound/NotFound.d.ts +1 -1
  74. package/dist/overlayPanel/OverlayPanel.d.ts +19 -18
  75. package/dist/overlayPanel/OverlayPanel.view.d.ts +1 -1
  76. package/dist/overlayPanel/overlay.context.d.ts +10 -9
  77. package/dist/overlayPanel/overlayPanelStyled/OverlayPanelStyled.d.ts +7 -7
  78. package/dist/quantity/Quantity.d.ts +11 -10
  79. package/dist/robots.txt +3 -3
  80. package/dist/search/Search.d.ts +22 -21
  81. package/dist/search/Search.view.d.ts +1 -1
  82. package/dist/select/Select.d.ts +14 -13
  83. package/dist/select/Select.view.d.ts +1 -1
  84. package/dist/select/selectOption.interface.d.ts +4 -4
  85. package/dist/sidebar/Sidebar.d.ts +13 -12
  86. package/dist/sidebar/Sidebar.view.d.ts +1 -1
  87. package/dist/sidebarData/SidebarData.d.ts +7 -6
  88. package/dist/sidebarData/SidebarData.view.d.ts +1 -1
  89. package/dist/style.css +1 -1
  90. package/dist/toaster/Toaster.d.ts +2 -1
  91. package/dist/toaster/Toaster.view.d.ts +1 -1
  92. package/dist/toaster/store/useToasterStore.d.ts +18 -18
  93. package/index.html +19 -19
  94. package/package.json +55 -55
  95. package/public/index.html +18 -18
  96. package/public/manifest.json +25 -25
  97. package/public/robots.txt +3 -3
  98. package/src/App.css +11 -11
  99. package/src/App.menu.tsx +209 -209
  100. package/src/App.routes.tsx +16 -16
  101. package/src/App.tsx +28 -28
  102. package/src/_core/hooks/ImageChecker.tsx +26 -26
  103. package/src/_core/hooks/useIsMobile.ts +18 -18
  104. package/src/action/Action.view.tsx +21 -21
  105. package/src/action/ButtonAction.tsx +32 -32
  106. package/src/action/action.css +20 -20
  107. package/src/badge/Badge.tsx +34 -34
  108. package/src/badge/Badge.view.tsx +15 -15
  109. package/src/badge/badge.css +55 -55
  110. package/src/button/Button.tsx +44 -44
  111. package/src/button/Button.view.tsx +61 -61
  112. package/src/button/button.css +53 -53
  113. package/src/button/button.interface.tsx +20 -20
  114. package/src/button/buttonActions/ButtonActions.tsx +101 -101
  115. package/src/card/Card.tsx +125 -125
  116. package/src/card/Card.view.tsx +73 -73
  117. package/src/card/card.css +145 -145
  118. package/src/card/card.interface.tsx +9 -9
  119. package/src/card/cardAction/CardAction.tsx +135 -135
  120. package/src/card/cardAction/cardAction.css +10 -10
  121. package/src/card/cardAction.interface.tsx +10 -10
  122. package/src/card/hook/useCardInteractions.tsx +30 -30
  123. package/src/carousel/Carousel.css +44 -44
  124. package/src/carousel/Carousel.tsx +115 -115
  125. package/src/carousel/Carousel.view.tsx +13 -13
  126. package/src/damier/Damier.tsx +55 -55
  127. package/src/damier/Damier.view.tsx +31 -31
  128. package/src/damier/damier.css +44 -44
  129. package/src/damier/damierCell/DamierCell.tsx +18 -18
  130. package/src/damier/damierCell/damierCell.interface.tsx +5 -5
  131. package/src/dataTable/DataTable.tsx +241 -241
  132. package/src/dataTable/DataTable.view.tsx +59 -59
  133. package/src/dataTable/dataTable.css +17 -17
  134. package/src/dataTable/dataTable.interface.ts +29 -29
  135. package/src/datePicker/DatePicker.tsx +110 -110
  136. package/src/datePicker/DatePicker.view.tsx +9 -9
  137. package/src/datePicker/datePicker.css +77 -77
  138. package/src/expands/Expands.tsx +42 -42
  139. package/src/expands/Expands.view.tsx +90 -90
  140. package/src/expands/expand/expand.interface.tsx +8 -8
  141. package/src/expands/expand/expand.tsx +75 -75
  142. package/src/expands/expands.css +97 -97
  143. package/src/filAriane/FilAriane.tsx +57 -57
  144. package/src/filAriane/FilAriane.view.tsx +28 -28
  145. package/src/filAriane/filAriane.css +22 -22
  146. package/src/filAriane/filAriane.interface.tsx +6 -6
  147. package/src/form/Form.tsx +175 -175
  148. package/src/form/Form.view.tsx +47 -47
  149. package/src/form/form.css +37 -37
  150. package/src/form/form.enum.ts +11 -11
  151. package/src/form/form.interface.tsx +31 -31
  152. package/src/form/textArea/TextArea.tsx +53 -53
  153. package/src/form/textArea/TextArea.view.tsx +34 -34
  154. package/src/form/textArea/textArea.css +9 -9
  155. package/src/grid/Grid.tsx +21 -21
  156. package/src/grid/Grid.view.tsx +24 -24
  157. package/src/grid/col/Col.tsx +15 -15
  158. package/src/grid/col/colStyled/ColStyled.tsx +41 -41
  159. package/src/grid/container/Container.tsx +8 -8
  160. package/src/grid/container/container.css +5 -5
  161. package/src/grid/grid.interface.tsx +7 -7
  162. package/src/grid/row/Row.tsx +12 -12
  163. package/src/grid/row/row.css +18 -18
  164. package/src/header/Header.tsx +51 -51
  165. package/src/header/Header.view.tsx +5 -5
  166. package/src/header/header.css +26 -26
  167. package/src/header/header.interface.tsx +8 -8
  168. package/src/home/Home.tsx +3 -3
  169. package/src/icon/Icon.tsx +6 -6
  170. package/src/icon/Icons.view.tsx +29 -29
  171. package/src/icon/icon.css +20 -20
  172. package/src/icon/icon.interface.tsx +6 -6
  173. package/src/icon/iconSize.enum.ts +7 -7
  174. package/src/index.css +502 -502
  175. package/src/index.ts +33 -33
  176. package/src/loader/Loader.tsx +37 -37
  177. package/src/loader/Loader.view.tsx +20 -20
  178. package/src/loader/loader.css +30 -30
  179. package/src/main.tsx +10 -10
  180. package/src/menus/Menus.tsx +42 -42
  181. package/src/menus/Menus.view.tsx +39 -39
  182. package/src/menus/menu/Menu.tsx +17 -17
  183. package/src/menus/menu/menu.interface.tsx +9 -9
  184. package/src/menus/menus.css +47 -47
  185. package/src/modal/Modal.tsx +53 -53
  186. package/src/modal/Modal.view.tsx +25 -25
  187. package/src/modal/modal.css +71 -69
  188. package/src/notFound/NotFound.tsx +3 -3
  189. package/src/overlayPanel/OverlayPanel.tsx +189 -189
  190. package/src/overlayPanel/OverlayPanel.view.tsx +25 -25
  191. package/src/overlayPanel/overlay.context.tsx +28 -28
  192. package/src/overlayPanel/overlayPanel.css +35 -35
  193. package/src/overlayPanel/overlayPanelStyled/OverlayPanelStyled.tsx +18 -18
  194. package/src/quantity/Quantity.tsx +103 -103
  195. package/src/quantity/quantity.css +26 -26
  196. package/src/search/Search.tsx +161 -161
  197. package/src/search/Search.view.tsx +14 -14
  198. package/src/search/search.css +59 -59
  199. package/src/select/Select.tsx +53 -53
  200. package/src/select/Select.view.tsx +71 -71
  201. package/src/select/select.css +51 -51
  202. package/src/select/selectOption.interface.ts +4 -4
  203. package/src/sidebar/Sidebar.tsx +111 -111
  204. package/src/sidebar/Sidebar.view.tsx +17 -17
  205. package/src/sidebar/sidebar.css +87 -87
  206. package/src/sidebarData/SidebarData.tsx +19 -19
  207. package/src/sidebarData/SidebarData.view.tsx +19 -19
  208. package/src/sidebarData/sidebarData.css +27 -27
  209. package/src/toaster/Toaster.tsx +47 -47
  210. package/src/toaster/Toaster.view.tsx +3 -3
  211. package/src/toaster/store/useToasterStore.tsx +39 -39
  212. package/src/toaster/toaster.css +57 -57
  213. package/tsconfig.json +28 -28
  214. package/vite.config.ts +20 -20
  215. package/vite.config.ts.timestamp-1733262892554-a13dfef6e8a29.mjs +24 -24
@@ -1,32 +1,32 @@
1
- import { Badge, BadgeInterface } from "../badge/Badge";
2
- import { Icon } from "../icon/Icon";
3
- import { IconSizeEnum } from "../icon/iconSize.enum";
4
- import "./action.css";
5
-
6
- export type ButtonActionProps = {
7
- className?: string;
8
- onClick?: (e: React.MouseEvent) => void;
9
- title?: string;
10
- classIcon?: string;
11
- badge?: BadgeInterface;
12
- };
13
- export const ButtonAction = ({
14
- className,
15
- onClick,
16
- title,
17
- classIcon,
18
- badge,
19
- }: ButtonActionProps) => {
20
- const handleClick = (e: React.MouseEvent) => {
21
- if (onClick) {
22
- onClick(e);
23
- }
24
- };
25
- return (
26
- <div className={`action ${className}`} onClick={handleClick}>
27
- {badge && <Badge {...badge} />}
28
- {classIcon && <Icon classIcon={classIcon} size={IconSizeEnum.LARGE} />}
29
- <small>{title}</small>
30
- </div>
31
- );
32
- };
1
+ import { Badge, BadgeInterface } from "../badge/Badge";
2
+ import { Icon } from "../icon/Icon";
3
+ import { IconSizeEnum } from "../icon/iconSize.enum";
4
+ import "./action.css";
5
+
6
+ export type ButtonActionProps = {
7
+ className?: string;
8
+ onClick?: (e: React.MouseEvent) => void;
9
+ title?: string;
10
+ classIcon?: string;
11
+ badge?: BadgeInterface;
12
+ };
13
+ export const ButtonAction = ({
14
+ className,
15
+ onClick,
16
+ title,
17
+ classIcon,
18
+ badge,
19
+ }: ButtonActionProps) => {
20
+ const handleClick = (e: React.MouseEvent) => {
21
+ if (onClick) {
22
+ onClick(e);
23
+ }
24
+ };
25
+ return (
26
+ <div className={`action ${className}`} onClick={handleClick}>
27
+ {badge && <Badge {...badge} />}
28
+ {classIcon && <Icon classIcon={classIcon} size={IconSizeEnum.LARGE} />}
29
+ <small>{title}</small>
30
+ </div>
31
+ );
32
+ };
@@ -1,20 +1,20 @@
1
- .action {
2
- background-color: var(--tertiary-color);
3
- color: #fff;
4
- position: relative;
5
- display: flex;
6
- align-items: center;
7
- flex-direction: column;
8
- justify-content: center;
9
- padding: 0.5rem 0.5rem;
10
- min-width: 120px;
11
- text-align: center;
12
- cursor: pointer;
13
- border-radius: 4px;
14
- height: 100%;
15
- .badge {
16
- position: absolute;
17
- right: 10px;
18
- top: -10px;
19
- }
20
- }
1
+ .action {
2
+ background-color: var(--tertiary-color);
3
+ color: #fff;
4
+ position: relative;
5
+ display: flex;
6
+ align-items: center;
7
+ flex-direction: column;
8
+ justify-content: center;
9
+ padding: 0.5rem 0.5rem;
10
+ min-width: 120px;
11
+ text-align: center;
12
+ cursor: pointer;
13
+ border-radius: 4px;
14
+ height: 100%;
15
+ .badge {
16
+ position: absolute;
17
+ right: 10px;
18
+ top: -10px;
19
+ }
20
+ }
@@ -1,34 +1,34 @@
1
- import { useCallback } from "react";
2
- import { Icon } from "../icon/Icon";
3
- import { IconSizeEnum } from "../icon/iconSize.enum";
4
- import "./badge.css";
5
- export type BadgeInterface = {
6
- className?: string;
7
- onClick?: (e: React.MouseEvent) => void;
8
- title?: string;
9
- sizeIcon?: IconSizeEnum;
10
- classIcon?: string;
11
- };
12
- export const Badge = ({
13
- className,
14
- onClick,
15
- title,
16
- sizeIcon,
17
- classIcon,
18
- }: BadgeInterface) => {
19
- const handleClick = useCallback((e: React.MouseEvent) => {
20
- e.stopPropagation();
21
- if (onClick) {
22
- onClick(e);
23
- }
24
- }, []);
25
- return (
26
- <div
27
- onClick={handleClick}
28
- className={`badge ${className ? className : ""}`}
29
- >
30
- {classIcon && <Icon size={sizeIcon} classIcon={classIcon}></Icon>}
31
- <span>{title}</span>
32
- </div>
33
- );
34
- };
1
+ import { useCallback } from "react";
2
+ import { Icon } from "../icon/Icon";
3
+ import { IconSizeEnum } from "../icon/iconSize.enum";
4
+ import "./badge.css";
5
+ export type BadgeInterface = {
6
+ className?: string;
7
+ onClick?: (e: React.MouseEvent) => void;
8
+ title?: string;
9
+ sizeIcon?: IconSizeEnum;
10
+ classIcon?: string;
11
+ };
12
+ export const Badge = ({
13
+ className,
14
+ onClick,
15
+ title,
16
+ sizeIcon,
17
+ classIcon,
18
+ }: BadgeInterface) => {
19
+ const handleClick = useCallback((e: React.MouseEvent) => {
20
+ e.stopPropagation();
21
+ if (onClick) {
22
+ onClick(e);
23
+ }
24
+ }, []);
25
+ return (
26
+ <div
27
+ onClick={handleClick}
28
+ className={`badge ${className ? className : ""}`}
29
+ >
30
+ {classIcon && <Icon size={sizeIcon} classIcon={classIcon}></Icon>}
31
+ <span>{title}</span>
32
+ </div>
33
+ );
34
+ };
@@ -1,15 +1,15 @@
1
- import { Badge } from "./Badge";
2
-
3
- export const BadgeView = (): JSX.Element => {
4
- return (
5
- <>
6
- <Badge
7
- className="badge--primary"
8
- title="Badge"
9
- sizeIcon={undefined}
10
- classIcon="bi-check-circle"
11
- onClick={() => console.log("Badge clicked")}
12
- />
13
- </>
14
- );
15
- };
1
+ import { Badge } from "./Badge";
2
+
3
+ export const BadgeView = (): JSX.Element => {
4
+ return (
5
+ <>
6
+ <Badge
7
+ className="badge--primary"
8
+ title="Badge"
9
+ sizeIcon={undefined}
10
+ classIcon="bi-check-circle"
11
+ onClick={() => console.log("Badge clicked")}
12
+ />
13
+ </>
14
+ );
15
+ };
@@ -1,55 +1,55 @@
1
- .badge {
2
- display: flex;
3
- align-items: center;
4
- padding: 0.25em 0.4em;
5
- font-size: 0.5rem;
6
- font-weight: 700;
7
- line-height: 1;
8
- color: #fff;
9
- width: fit-content;
10
- text-transform: uppercase;
11
- border-radius: 0.2rem;
12
- background-color: #007bff;
13
- border: 1px solid transparent;
14
- .bi {
15
- font-size: 0.8rem;
16
- margin-right: 0.25rem;
17
- }
18
- &.badge-primary {
19
- background-color: var(--primary-color);
20
- border-color: var(--primary-color);
21
- }
22
- &.badge-secondary {
23
- background-color: var(--secondary-color);
24
- border-color: var(--secondary-color);
25
- }
26
- &.badge-success {
27
- background-color: #28a745;
28
- border-color: #28a745;
29
- }
30
- &.badge-danger {
31
- background-color: #dc3545;
32
- border-color: #dc3545;
33
- }
34
- &.badge-warning {
35
- background-color: #ffc107;
36
- border-color: #ffc107;
37
- }
38
- &.badge-info {
39
- background-color: #17a2b8;
40
- border-color: #17a2b8;
41
- }
42
- &.badge-light {
43
- background-color: #f8f9fa;
44
- border-color: #f8f9fa;
45
- color: #212529;
46
- }
47
- &.badge-dark {
48
- background-color: #343a40;
49
- border-color: #343a40;
50
- }
51
- &.badge-link {
52
- color: #007bff;
53
- text-decoration: none;
54
- }
55
- }
1
+ .badge {
2
+ display: flex;
3
+ align-items: center;
4
+ padding: 0.25em 0.4em;
5
+ font-size: 0.5rem;
6
+ font-weight: 700;
7
+ line-height: 1;
8
+ color: #fff;
9
+ width: fit-content;
10
+ text-transform: uppercase;
11
+ border-radius: 0.2rem;
12
+ background-color: #007bff;
13
+ border: 1px solid transparent;
14
+ .bi {
15
+ font-size: 0.8rem;
16
+ margin-right: 0.25rem;
17
+ }
18
+ &.badge-primary {
19
+ background-color: var(--primary-color);
20
+ border-color: var(--primary-color);
21
+ }
22
+ &.badge-secondary {
23
+ background-color: var(--secondary-color);
24
+ border-color: var(--secondary-color);
25
+ }
26
+ &.badge-success {
27
+ background-color: #28a745;
28
+ border-color: #28a745;
29
+ }
30
+ &.badge-danger {
31
+ background-color: #dc3545;
32
+ border-color: #dc3545;
33
+ }
34
+ &.badge-warning {
35
+ background-color: #ffc107;
36
+ border-color: #ffc107;
37
+ }
38
+ &.badge-info {
39
+ background-color: #17a2b8;
40
+ border-color: #17a2b8;
41
+ }
42
+ &.badge-light {
43
+ background-color: #f8f9fa;
44
+ border-color: #f8f9fa;
45
+ color: #212529;
46
+ }
47
+ &.badge-dark {
48
+ background-color: #343a40;
49
+ border-color: #343a40;
50
+ }
51
+ &.badge-link {
52
+ color: #007bff;
53
+ text-decoration: none;
54
+ }
55
+ }
@@ -1,44 +1,44 @@
1
- import { Badge } from "../badge/Badge";
2
- import { Icon } from "../icon/Icon";
3
- import "./button.css";
4
- import { ButtonInterface } from "./button.interface";
5
-
6
- export const Button = ({
7
- className,
8
- onClick,
9
- badge,
10
- title,
11
- sizeIcon,
12
- classIcon,
13
- positionicon = 1,
14
- disabled = false,
15
- }: ButtonInterface) => {
16
- const handleClick = (e: React.MouseEvent) => {
17
- e.stopPropagation();
18
- if (onClick) {
19
- onClick(e);
20
- }
21
- };
22
-
23
- return (
24
- <button
25
- disabled={disabled}
26
- type="submit"
27
- onClick={(e) => handleClick(e)}
28
- className={className}
29
- >
30
- {badge && <Badge {...badge} />}
31
- {classIcon && positionicon == 1 && (
32
- <span className={`${title ? "mr-2" : ""}`}>
33
- <Icon size={sizeIcon} classIcon={classIcon}></Icon>
34
- </span>
35
- )}
36
- <span>{title}</span>
37
- {classIcon && positionicon == 2 && (
38
- <span className="ml-2">
39
- <Icon classIcon={classIcon}></Icon>
40
- </span>
41
- )}
42
- </button>
43
- );
44
- };
1
+ import { Badge } from "../badge/Badge";
2
+ import { Icon } from "../icon/Icon";
3
+ import "./button.css";
4
+ import { ButtonInterface } from "./button.interface";
5
+
6
+ export const Button = ({
7
+ className,
8
+ onClick,
9
+ badge,
10
+ title,
11
+ sizeIcon,
12
+ classIcon,
13
+ positionicon = 1,
14
+ disabled = false,
15
+ }: ButtonInterface) => {
16
+ const handleClick = (e: React.MouseEvent) => {
17
+ e.stopPropagation();
18
+ if (onClick) {
19
+ onClick(e);
20
+ }
21
+ };
22
+
23
+ return (
24
+ <button
25
+ disabled={disabled}
26
+ type="submit"
27
+ onClick={(e) => handleClick(e)}
28
+ className={className}
29
+ >
30
+ {badge && <Badge {...badge} />}
31
+ {classIcon && positionicon == 1 && (
32
+ <span className={`${title ? "mr-2" : ""}`}>
33
+ <Icon size={sizeIcon} classIcon={classIcon}></Icon>
34
+ </span>
35
+ )}
36
+ <span>{title}</span>
37
+ {classIcon && positionicon == 2 && (
38
+ <span className="ml-2">
39
+ <Icon classIcon={classIcon}></Icon>
40
+ </span>
41
+ )}
42
+ </button>
43
+ );
44
+ };
@@ -1,61 +1,61 @@
1
- import { useMemo } from "react";
2
- import { Button } from "./Button";
3
- import { ButtonInterface } from "./button.interface";
4
- import {
5
- ButtonActions,
6
- ButtonActionsProps,
7
- } from "./buttonActions/ButtonActions";
8
-
9
- export const ButtonView = (): JSX.Element => {
10
- const mockButtonItems: ButtonInterface[] = [
11
- {
12
- title: "Envoyer",
13
- onClick: () => console.log("Envoyer"),
14
- classIcon: "bi-send",
15
- disabled: true,
16
- positionicon: 1,
17
- badge: {
18
- className: "badge--primary",
19
- title: "Badge",
20
- sizeIcon: undefined,
21
- classIcon: "bi-check-circle",
22
- onClick: () => console.log("Badge clicked"),
23
- },
24
- },
25
- {
26
- title: "Annuler",
27
- onClick: () => console.log("Envoyer"),
28
- className: "button--secondary",
29
- },
30
- ];
31
- const mockButtonAction: ButtonActionsProps = useMemo(() => {
32
- return {
33
- title: "Supprimer",
34
- onClick: () => console.log("Supprimer"),
35
- className: "button--secondary",
36
-
37
- actions: [
38
- {
39
- id: "1",
40
- label: "Supprimer",
41
- onClick: () => console.log("Supprimer action"),
42
- },
43
- {
44
- id: "2",
45
- label: "Supprimer définitivement",
46
- onClick: () => console.log("Supprimer définitivement"),
47
- },
48
- ],
49
- };
50
- }, []);
51
- return (
52
- <div className="d-flex">
53
- {mockButtonItems.map((item, index) => (
54
- <div className="mr-2" key={index}>
55
- <Button {...item} />
56
- </div>
57
- ))}
58
- <ButtonActions {...mockButtonAction} />
59
- </div>
60
- );
61
- };
1
+ import { useMemo } from "react";
2
+ import { Button } from "./Button";
3
+ import { ButtonInterface } from "./button.interface";
4
+ import {
5
+ ButtonActions,
6
+ ButtonActionsProps,
7
+ } from "./buttonActions/ButtonActions";
8
+
9
+ export const ButtonView = (): JSX.Element => {
10
+ const mockButtonItems: ButtonInterface[] = [
11
+ {
12
+ title: "Envoyer",
13
+ onClick: () => console.log("Envoyer"),
14
+ classIcon: "bi-send",
15
+ disabled: true,
16
+ positionicon: 1,
17
+ badge: {
18
+ className: "badge--primary",
19
+ title: "Badge",
20
+ sizeIcon: undefined,
21
+ classIcon: "bi-check-circle",
22
+ onClick: () => console.log("Badge clicked"),
23
+ },
24
+ },
25
+ {
26
+ title: "Annuler",
27
+ onClick: () => console.log("Envoyer"),
28
+ className: "button--secondary",
29
+ },
30
+ ];
31
+ const mockButtonAction: ButtonActionsProps = useMemo(() => {
32
+ return {
33
+ title: "Supprimer",
34
+ onClick: () => console.log("Supprimer"),
35
+ className: "button--secondary",
36
+
37
+ actions: [
38
+ {
39
+ id: "1",
40
+ label: "Supprimer",
41
+ onClick: () => console.log("Supprimer action"),
42
+ },
43
+ {
44
+ id: "2",
45
+ label: "Supprimer définitivement",
46
+ onClick: () => console.log("Supprimer définitivement"),
47
+ },
48
+ ],
49
+ };
50
+ }, []);
51
+ return (
52
+ <div className="d-flex">
53
+ {mockButtonItems.map((item, index) => (
54
+ <div className="mr-2" key={index}>
55
+ <Button {...item} />
56
+ </div>
57
+ ))}
58
+ <ButtonActions {...mockButtonAction} />
59
+ </div>
60
+ );
61
+ };
@@ -1,53 +1,53 @@
1
- button {
2
- background-color: var(--primary-color);
3
- color: white;
4
- border: none;
5
- padding: 10px;
6
- border-radius: 5px;
7
- cursor: pointer;
8
- font-size: 16px;
9
- font-weight: 500;
10
- transition: background-color 0.3s;
11
- display: flex;
12
- max-height: 40px;
13
- min-width: 150px;
14
- position: relative;
15
- align-items: center;
16
- justify-content: center;
17
- font-family: "Raleway", sans-serif !important;
18
- .badge {
19
- position: absolute;
20
- right: 10px;
21
- top: -10px;
22
- }
23
- &:disabled {
24
- opacity: 0.5;
25
- cursor: not-allowed;
26
- }
27
- &.button--primary {
28
- background-color: var(--primary-color);
29
- }
30
-
31
- &.button--secondary {
32
- background-color: var(--secondary-color);
33
- }
34
- &.button--tertiary {
35
- background-color: var(--tertiary-color);
36
- }
37
- &.button--transparent {
38
- background-color: transparent;
39
- color: var(--primary-color);
40
- border: 1px solid;
41
- }
42
- &.button--success {
43
- background-color: var(--success-color);
44
- }
45
-
46
- &.button--info {
47
- background-color: var(--info-color);
48
- }
49
-
50
- &.button--warning {
51
- background-color: var(--warning-color);
52
- }
53
- }
1
+ button {
2
+ background-color: var(--primary-color);
3
+ color: white;
4
+ border: none;
5
+ padding: 10px;
6
+ border-radius: 5px;
7
+ cursor: pointer;
8
+ font-size: 16px;
9
+ font-weight: 500;
10
+ transition: background-color 0.3s;
11
+ display: flex;
12
+ max-height: 40px;
13
+ min-width: 150px;
14
+ position: relative;
15
+ align-items: center;
16
+ justify-content: center;
17
+ font-family: "Raleway", sans-serif !important;
18
+ .badge {
19
+ position: absolute;
20
+ right: 10px;
21
+ top: -10px;
22
+ }
23
+ &:disabled {
24
+ opacity: 0.5;
25
+ cursor: not-allowed;
26
+ }
27
+ &.button--primary {
28
+ background-color: var(--primary-color);
29
+ }
30
+
31
+ &.button--secondary {
32
+ background-color: var(--secondary-color);
33
+ }
34
+ &.button--tertiary {
35
+ background-color: var(--tertiary-color);
36
+ }
37
+ &.button--transparent {
38
+ background-color: transparent;
39
+ color: var(--primary-color);
40
+ border: 1px solid;
41
+ }
42
+ &.button--success {
43
+ background-color: var(--success-color);
44
+ }
45
+
46
+ &.button--info {
47
+ background-color: var(--info-color);
48
+ }
49
+
50
+ &.button--warning {
51
+ background-color: var(--warning-color);
52
+ }
53
+ }
@@ -1,20 +1,20 @@
1
- import { BadgeInterface } from "../badge/Badge";
2
- import { IconSizeEnum } from "../icon/iconSize.enum";
3
-
4
- export interface ButtonInterface {
5
- className?: string;
6
- badge?: BadgeInterface;
7
- onClick?: (e: React.MouseEvent) => void;
8
- title: string;
9
- classIcon?: string;
10
- positionicon?: number;
11
- disabled?: boolean;
12
- sizeIcon?: IconSizeEnum;
13
- }
14
- export interface buttonActionInterface {
15
- icon?: string;
16
- id?: number | string;
17
- label: string;
18
- disabled?: boolean;
19
- onClick: (a: buttonActionInterface) => void;
20
- }
1
+ import { BadgeInterface } from "../badge/Badge";
2
+ import { IconSizeEnum } from "../icon/iconSize.enum";
3
+
4
+ export interface ButtonInterface {
5
+ className?: string;
6
+ badge?: BadgeInterface;
7
+ onClick?: (e: React.MouseEvent) => void;
8
+ title: string;
9
+ classIcon?: string;
10
+ positionicon?: number;
11
+ disabled?: boolean;
12
+ sizeIcon?: IconSizeEnum;
13
+ }
14
+ export interface buttonActionInterface {
15
+ icon?: string;
16
+ id?: number | string;
17
+ label: string;
18
+ disabled?: boolean;
19
+ onClick: (a: buttonActionInterface) => void;
20
+ }