allaw-ui 2.7.4 → 2.7.6

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.
@@ -33,6 +33,7 @@
33
33
  white-space: nowrap;
34
34
  overflow: hidden;
35
35
  text-overflow: ellipsis;
36
+ text-transform: none !important;
36
37
  }
37
38
 
38
39
  .oauth-provider-button.apple {
@@ -56,6 +57,7 @@
56
57
  white-space: nowrap;
57
58
  overflow: hidden;
58
59
  text-overflow: ellipsis;
60
+ text-transform: none !important;
59
61
  }
60
62
 
61
63
  .oauth-provider-button.linkedin .label {
@@ -66,6 +68,7 @@
66
68
  white-space: nowrap;
67
69
  overflow: hidden;
68
70
  text-overflow: ellipsis;
71
+ text-transform: none !important;
69
72
  }
70
73
 
71
74
  .allaw-icon-google {
@@ -116,4 +119,18 @@
116
119
  white-space: nowrap;
117
120
  overflow: hidden;
118
121
  text-overflow: ellipsis;
122
+ text-transform: none !important;
123
+ }
124
+
125
+ /* Ajoutez cette règle spécifique pour forcer le texte à ne pas être en majuscules */
126
+ .oauth-provider-button .label {
127
+ text-transform: none !important;
128
+ }
129
+
130
+ /* Assurez-vous que cette règle est appliquée à tous les fournisseurs */
131
+ .oauth-provider-button.google .label,
132
+ .oauth-provider-button.apple .label,
133
+ .oauth-provider-button.linkedin .label,
134
+ .oauth-provider-button.microsoft .label {
135
+ text-transform: none !important;
119
136
  }
@@ -7,25 +7,23 @@ var OAuthProviderButton = function (_a) {
7
7
  var buttonRef = useRef(null);
8
8
  var getLabels = function () {
9
9
  var labels = {
10
- google: {
11
- login: "Continuer avec Google",
12
- signup: "S'inscrire avec Google",
13
- calendar: "Google Calendar",
10
+ login: {
11
+ google: "Se connecter avec Google",
12
+ apple: "Se connecter avec Apple",
13
+ linkedin: "Se connecter avec LinkedIn",
14
+ microsoft: "Se connecter avec Microsoft",
14
15
  },
15
- apple: {
16
- login: "Continuer avec Apple",
17
- signup: "S'inscrire avec Apple",
18
- calendar: "Apple Calendar",
16
+ signup: {
17
+ google: "S'inscrire avec Google",
18
+ apple: "S'inscrire avec Apple",
19
+ linkedin: "S'inscrire avec LinkedIn",
20
+ microsoft: "S'inscrire avec Microsoft",
19
21
  },
20
- linkedin: {
21
- login: "Continuer avec LinkedIn",
22
- signup: "S'inscrire avec LinkedIn",
23
- calendar: "Ajouter à l'Agenda",
24
- },
25
- microsoft: {
26
- login: "Continuer avec Microsoft",
27
- signup: "S'inscrire avec Microsoft",
28
- calendar: "Microsoft Outlook",
22
+ calendar: {
23
+ google: "Connecter Google Calendar",
24
+ apple: "Connecter Apple Calendar",
25
+ linkedin: "Connecter LinkedIn",
26
+ microsoft: "Connecter Microsoft Calendar",
29
27
  },
30
28
  };
31
29
  var shortLabels = {
@@ -54,39 +52,30 @@ var OAuthProviderButton = function (_a) {
54
52
  return 250;
55
53
  }
56
54
  };
57
- var updateLabel = function () {
58
- var _a, _b;
59
- var _c = getLabels(), labels = _c.labels, shortLabels = _c.shortLabels;
60
- if (!labels[provider][type]) {
61
- console.warn("Type \"".concat(type, "\" non pris en charge pour le provider \"").concat(provider, "\"."));
62
- setLabel("Type inconnu");
63
- return;
64
- }
65
- var maxWidth = (_b = (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0;
66
- var thresholdWidth = getThresholdWidth(size);
67
- var newLabel = maxWidth < thresholdWidth
68
- ? shortLabels[provider]
69
- : labels[provider][type];
70
- setLabel(newLabel);
71
- };
72
55
  useEffect(function () {
73
- var resizeObserver = new ResizeObserver(function () {
56
+ updateLabel();
57
+ var timer = setTimeout(function () {
74
58
  updateLabel();
75
- });
59
+ }, 50);
60
+ return function () { return clearTimeout(timer); };
61
+ }, []);
62
+ var updateLabel = function () {
63
+ var _a = getLabels(), labels = _a.labels, shortLabels = _a.shortLabels;
64
+ var thresholdWidth = getThresholdWidth(size);
76
65
  if (buttonRef.current) {
77
- resizeObserver.observe(buttonRef.current);
78
- }
79
- return function () {
80
- if (buttonRef.current) {
81
- resizeObserver.unobserve(buttonRef.current);
66
+ var buttonWidth = buttonRef.current.offsetWidth;
67
+ if (!label) {
68
+ setLabel(labels[type][provider]);
69
+ return;
70
+ }
71
+ if (buttonWidth < thresholdWidth) {
72
+ setLabel(shortLabels[provider]);
73
+ }
74
+ else {
75
+ setLabel(labels[type][provider]);
82
76
  }
83
- };
84
- }, [provider, type, size]);
85
- useEffect(function () {
86
- if (buttonRef.current) {
87
- updateLabel();
88
77
  }
89
- }, []);
78
+ };
90
79
  var renderIcon = function () {
91
80
  var iconSizes = {
92
81
  google: type === "calendar" ? size * 1.1 : size * 0.8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "2.7.4",
3
+ "version": "2.7.6",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",