allaw-ui 4.5.0 → 4.5.2

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.
@@ -91,16 +91,16 @@
91
91
  }
92
92
 
93
93
  .actionButtonYellow {
94
- background: #ffc107;
95
- color: #000000;
94
+ background: #f9e000;
95
+ color: var(--primary-black, #171e25);
96
96
  }
97
97
 
98
98
  .actionButtonYellow:hover {
99
- background: #e0a005;
99
+ background: #e6d000;
100
100
  }
101
101
 
102
102
  .actionButtonYellow:active {
103
- background: #c79504;
103
+ background: #c7b200;
104
104
  }
105
105
 
106
106
  @keyframes pulseBackground {
@@ -7,8 +7,10 @@
7
7
  gap: 15px;
8
8
  cursor: pointer;
9
9
  min-width: 210px;
10
+ max-width: 100%;
10
11
  border-radius: 10px;
11
12
  padding: 6px;
13
+ box-sizing: border-box;
12
14
  }
13
15
 
14
16
  .oauth-provider-button:hover {
@@ -21,6 +23,7 @@
21
23
 
22
24
  .oauth-provider-button.google {
23
25
  width: 100%;
26
+ max-width: 100%;
24
27
  background: #ffffff;
25
28
  box-shadow: 0px 2px 3px 0px #0000002b, 0px 0px 3px 0px #00000015;
26
29
  }
@@ -39,11 +42,13 @@
39
42
  .oauth-provider-button.apple {
40
43
  background: #000000;
41
44
  width: 100%;
45
+ max-width: 100%;
42
46
  }
43
47
 
44
48
  .oauth-provider-button.linkedin {
45
49
  background: #0a66c2;
46
50
  width: 100%;
51
+ max-width: 100%;
47
52
  padding-left: 10px;
48
53
  padding-right: 10px;
49
54
  }
@@ -99,6 +104,7 @@
99
104
 
100
105
  .oauth-provider-button.microsoft {
101
106
  width: 100%;
107
+ max-width: 100%;
102
108
  background: #ffffff;
103
109
  box-shadow: 0px 2px 3px 0px #0000002b, 0px 0px 3px 0px #00000015;
104
110
  font-family: Roboto;
@@ -59,19 +59,33 @@ var OAuthProviderButton = function (_a) {
59
59
  }, 50);
60
60
  return function () { return clearTimeout(timer); };
61
61
  }, []);
62
+ // Ajouter un useEffect pour surveiller les changements de taille
63
+ useEffect(function () {
64
+ var handleResize = function () {
65
+ updateLabel();
66
+ };
67
+ window.addEventListener("resize", handleResize);
68
+ return function () { return window.removeEventListener("resize", handleResize); };
69
+ }, [size, type, provider]);
62
70
  var updateLabel = function () {
63
71
  var _a = getLabels(), labels = _a.labels, shortLabels = _a.shortLabels;
64
72
  var thresholdWidth = getThresholdWidth(size);
65
73
  if (buttonRef.current) {
66
74
  var buttonWidth = buttonRef.current.offsetWidth;
75
+ // Debug: afficher les valeurs pour diagnostiquer
76
+ console.log("Button width:", buttonWidth, "Threshold:", thresholdWidth, "Size:", size);
77
+ // Toujours utiliser le label complet au début
67
78
  if (!label) {
68
79
  setLabel(labels[type][provider]);
69
80
  return;
70
81
  }
82
+ // Vérifier si on doit passer aux shortLabels
71
83
  if (buttonWidth < thresholdWidth) {
84
+ console.log("Using short label for", provider);
72
85
  setLabel(shortLabels[provider]);
73
86
  }
74
87
  else {
88
+ console.log("Using full label for", provider);
75
89
  setLabel(labels[type][provider]);
76
90
  }
77
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",