allaw-ui 1.0.33 → 1.0.35

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.
@@ -24,7 +24,7 @@
24
24
 
25
25
  .secondary-button-enabled:hover {
26
26
  color: #25beeb;
27
- border: 0px;
27
+ /* border: 0px; */
28
28
  }
29
29
 
30
30
  .secondary-button-enabled:active {
@@ -63,8 +63,11 @@ function BillingCount(_a) {
63
63
  return React.createElement("button", { onClick: handleButtonClick, className: "billing-button-wrapper" },
64
64
  React.createElement("i", { className: "allaw-icon-clock" }),
65
65
  formatTime(time),
66
- React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 43 48" },
67
- React.createElement("path", { fill: "#25BEEB", d: "M12 39c-.549 0-1.095-.15-1.578-.447A3.008 3.008 0 0 1 9 36V12c0-1.041.54-2.007 1.422-2.553a3.014 3.014 0 0 1 2.919-.132l24 12a3.003 3.003 0 0 1 0 5.37l-24 12c-.42.21-.885.315-1.341.315z" })));
66
+ React.createElement("svg", { width: "12px", height: "12px", viewBox: "-0.5 0 7 7", version: "1.1", xmlns: "http://www.w3.org/2000/svg" },
67
+ React.createElement("g", { id: "Page-1", stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
68
+ React.createElement("g", { id: "Dribbble-Light-Preview", transform: "translate(-347.000000, -3766.000000)", fill: "#25BEEB" },
69
+ React.createElement("g", { id: "icons", transform: "translate(56.000000, 160.000000)" },
70
+ React.createElement("path", { d: "M296.494737,3608.57322 L292.500752,3606.14219 C291.83208,3605.73542 291,3606.25002 291,3607.06891 L291,3611.93095 C291,3612.7509 291.83208,3613.26444 292.500752,3612.85767 L296.494737,3610.42771 C297.168421,3610.01774 297.168421,3608.98319 296.494737,3608.57322", id: "play-[#1003]" }))))));
68
71
  }
69
72
  export default BillingCount;
70
73
  /*
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./pagination.css";
3
+ import "../../../styles/global.css";
4
+ export interface PaginationProps {
5
+ currentPage: number;
6
+ totalPages: number;
7
+ onPageChange: (page: number) => void;
8
+ }
9
+ declare const Pagination: React.FC<PaginationProps>;
10
+ export default Pagination;
@@ -0,0 +1,64 @@
1
+ import React, { useState, useEffect } from "react";
2
+ import "./pagination.css";
3
+ import "../../../styles/global.css";
4
+ var Pagination = function (_a) {
5
+ var currentPage = _a.currentPage, totalPages = _a.totalPages, onPageChange = _a.onPageChange;
6
+ var _b = useState(window.innerWidth), setWindowWidth = _b[1];
7
+ var _c = useState(2), range = _c[0], setRange = _c[1];
8
+ useEffect(function () {
9
+ var handleResize = function () {
10
+ setWindowWidth(window.innerWidth);
11
+ // Ajuster le range en fonction de la largeur
12
+ setRange(window.innerWidth < 480 ? 1 : 2);
13
+ };
14
+ window.addEventListener("resize", handleResize);
15
+ handleResize(); // Initialisation
16
+ return function () { return window.removeEventListener("resize", handleResize); };
17
+ }, []);
18
+ // Validation des props
19
+ if (currentPage < 1 || currentPage > totalPages) {
20
+ console.error("Current page must be between 1 and total pages");
21
+ return null;
22
+ }
23
+ var handlePageChange = function (newPage) {
24
+ if (newPage >= 1 && newPage <= totalPages) {
25
+ onPageChange(newPage);
26
+ }
27
+ };
28
+ var renderPageNumbers = function () {
29
+ var items = [];
30
+ // Bouton Previous
31
+ items.push(React.createElement("button", { key: "prev", className: "pagination-nav-button pagination-prev-button", onClick: function () { return handlePageChange(currentPage - 1); }, disabled: currentPage === 1, "aria-label": "Page pr\u00E9c\u00E9dente", type: "button" },
32
+ React.createElement("span", { className: "allaw-icon-chevron-left pagination-icon", "aria-hidden": "true" }),
33
+ React.createElement("span", { className: "pagination-nav-text" }, "Pr\u00E9c\u00E9dent")));
34
+ // Première page
35
+ items.push(React.createElement("button", { key: 1, className: "pagination-number ".concat(currentPage === 1 ? "active" : ""), onClick: function () { return handlePageChange(1); }, "aria-label": "Page 1", "aria-current": currentPage === 1 ? "page" : undefined, type: "button" }, "1"));
36
+ // Points de suspension gauche
37
+ if (currentPage - range > 2) {
38
+ items.push(React.createElement("span", { key: "ellipsis-left", className: "pagination-ellipsis", "aria-hidden": "true" }, "..."));
39
+ }
40
+ var _loop_1 = function (i) {
41
+ items.push(React.createElement("button", { key: i, className: "pagination-number ".concat(currentPage === i ? "active" : ""), onClick: function () { return handlePageChange(i); }, "aria-label": "Page ".concat(i), "aria-current": currentPage === i ? "page" : undefined, type: "button" }, i));
42
+ };
43
+ // Pages autour de la page courante
44
+ for (var i = Math.max(2, currentPage - range); i <= Math.min(totalPages - 1, currentPage + range); i++) {
45
+ _loop_1(i);
46
+ }
47
+ // Points de suspension droite
48
+ if (currentPage + range < totalPages - 1) {
49
+ items.push(React.createElement("span", { key: "ellipsis-right", className: "pagination-ellipsis", "aria-hidden": "true" }, "..."));
50
+ }
51
+ // Dernière page
52
+ if (totalPages > 1) {
53
+ items.push(React.createElement("button", { key: totalPages, className: "pagination-number ".concat(currentPage === totalPages ? "active" : ""), onClick: function () { return handlePageChange(totalPages); }, "aria-label": "Page ".concat(totalPages), "aria-current": currentPage === totalPages ? "page" : undefined, type: "button" }, totalPages));
54
+ }
55
+ // Bouton Next
56
+ items.push(React.createElement("button", { key: "next", className: "pagination-nav-button pagination-next-button", onClick: function () { return handlePageChange(currentPage + 1); }, disabled: currentPage === totalPages, "aria-label": "Page suivante", type: "button" },
57
+ React.createElement("span", { className: "pagination-nav-text" }, "Suivant"),
58
+ React.createElement("span", { className: "allaw-icon-chevron-right pagination-icon", "aria-hidden": "true" })));
59
+ return items;
60
+ };
61
+ return (React.createElement("nav", { "aria-label": "Navigation des pages" },
62
+ React.createElement("div", { className: "pagination-container", role: "navigation" }, renderPageNumbers())));
63
+ };
64
+ export default Pagination;
@@ -0,0 +1,2 @@
1
+ export { default as Pagination } from "./Pagination";
2
+ export type { PaginationProps } from "./Pagination";
@@ -0,0 +1 @@
1
+ export { default as Pagination } from "./Pagination";
@@ -0,0 +1,120 @@
1
+ .pagination-container {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 4px;
5
+ font-family: "Open Sans", sans-serif;
6
+ flex-wrap: wrap;
7
+ justify-content: center;
8
+ }
9
+
10
+ .pagination-number {
11
+ min-width: 40px;
12
+ height: 40px;
13
+ padding: 4px 8px;
14
+ border: none;
15
+ background: none;
16
+ border-radius: 8px;
17
+ font-size: 14px;
18
+ color: var(--dark-grey);
19
+ cursor: pointer;
20
+ transition: background-color 0.2s;
21
+ }
22
+
23
+ .pagination-number:hover {
24
+ background-color: var(--grey-venom, #e6edf5);
25
+ }
26
+
27
+ .pagination-number.active {
28
+ background-color: var(--primary-blue);
29
+ border: 1px solid var(--bleu-allaw, #25beeb);
30
+ }
31
+
32
+ .pagination-number.active:hover {
33
+ background-color: var(--grey-venom, #e6edf5);
34
+ }
35
+
36
+ .pagination-nav-button {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 8px;
40
+ padding: 4px 12px;
41
+ border: none;
42
+ background: none;
43
+ color: var(--dark-grey);
44
+ font-size: 14px;
45
+ cursor: pointer;
46
+ transition: color 0.2s;
47
+ height: 40px;
48
+ border-radius: 8px;
49
+ }
50
+
51
+ .pagination-prev-button {
52
+ padding-right: 16px;
53
+ }
54
+
55
+ .pagination-next-button {
56
+ padding-left: 16px;
57
+ }
58
+
59
+ .pagination-nav-button:hover {
60
+ background-color: var(--grey-venom, #e6edf5);
61
+ }
62
+
63
+ .pagination-nav-button:hover:not(:disabled) {
64
+ color: var(--primary-blue);
65
+ }
66
+
67
+ .pagination-nav-button:disabled {
68
+ opacity: 0.5;
69
+ cursor: not-allowed;
70
+ }
71
+
72
+ .pagination-ellipsis {
73
+ padding: 4px 8px;
74
+ color: var(--dark-grey);
75
+ }
76
+
77
+ .pagination-icon {
78
+ font-size: 10px;
79
+ }
80
+
81
+ /* Media Queries pour la responsivité */
82
+ @media screen and (max-width: 768px) {
83
+ .pagination-container {
84
+ gap: 2px;
85
+ }
86
+
87
+ .pagination-number {
88
+ min-width: 32px;
89
+ height: 32px;
90
+ font-size: 12px;
91
+ }
92
+ }
93
+
94
+ @media screen and (max-width: 640px) {
95
+ .pagination-nav-text {
96
+ display: none;
97
+ }
98
+
99
+ .pagination-nav-button {
100
+ padding: 4px 8px;
101
+ }
102
+
103
+ .pagination-prev-button,
104
+ .pagination-next-button {
105
+ padding: 4px 8px;
106
+ }
107
+ }
108
+
109
+ @media screen and (max-width: 480px) {
110
+ .pagination-container {
111
+ gap: 1px;
112
+ }
113
+
114
+ .pagination-number {
115
+ min-width: 28px;
116
+ height: 28px;
117
+ padding: 2px 4px;
118
+ font-size: 12px;
119
+ }
120
+ }
package/dist/index.d.ts CHANGED
@@ -54,3 +54,5 @@ export { default as RadioForm } from "./components/molecules/radioForm/RadioForm
54
54
  export { default as SelectForm } from "./components/molecules/selectForm/SelectForm";
55
55
  export { default as Breadcrumb } from "./components/molecules/breadcrumb/Breadcrumb";
56
56
  export { default as ProCard } from "./components/molecules/proCard/ProCard";
57
+ export { default as Pagination } from "./components/molecules/pagination/Pagination";
58
+ export type { PaginationProps } from "./components/molecules/pagination/Pagination";
package/dist/index.js CHANGED
@@ -74,3 +74,5 @@ export { default as SelectForm } from "./components/molecules/selectForm/SelectF
74
74
  export { default as Breadcrumb } from "./components/molecules/breadcrumb/Breadcrumb";
75
75
  // ProCard
76
76
  export { default as ProCard } from "./components/molecules/proCard/ProCard";
77
+ // Pagination
78
+ export { default as Pagination } from "./components/molecules/pagination/Pagination";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",