allaw-ui 4.4.8 → 4.5.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.
@@ -10,7 +10,7 @@ export interface ActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElemen
10
10
  fullWidth?: boolean;
11
11
  type?: "button" | "submit" | "reset";
12
12
  isLoading?: boolean;
13
- variant?: "default" | "warning";
13
+ variant?: "default" | "warning" | "yellow";
14
14
  size?: "medium" | "large";
15
15
  dataTestId?: string;
16
16
  }
@@ -107,7 +107,7 @@ var ActionButton = forwardRef(function (_a, ref) {
107
107
  }
108
108
  });
109
109
  }); };
110
- return (React.createElement("button", __assign({ ref: buttonRef, "data-testid": props.dataTestId, className: "".concat(styles.actionButton, " ").concat(disabled ? styles.actionButtonDisabled : styles.actionButtonEnabled, " ").concat(fullWidth ? styles.actionButtonFullWidth : "", " ").concat(isButtonLoading ? styles.actionButtonLoading : "", " ").concat(variant === "warning" ? styles.actionButtonWarning : "", " ").concat(size === "large" ? styles.actionButtonLarge : ""), disabled: disabled, onClick: handleClick, type: type }, props),
110
+ return (React.createElement("button", __assign({ ref: buttonRef, "data-testid": props.dataTestId, className: "".concat(styles.actionButton, " ").concat(disabled ? styles.actionButtonDisabled : styles.actionButtonEnabled, " ").concat(fullWidth ? styles.actionButtonFullWidth : "", " ").concat(isButtonLoading ? styles.actionButtonLoading : "", " ").concat(variant === "warning" ? styles.actionButtonWarning : "", " ").concat(variant === "yellow" ? styles.actionButtonYellow : "", " ").concat(size === "large" ? styles.actionButtonLarge : ""), disabled: disabled, onClick: handleClick, type: type }, props),
111
111
  startIcon && (React.createElement("span", { className: "".concat(styles.actionButtonIcon, " ").concat(startIconName) })),
112
112
  React.createElement("span", { className: styles.actionButtonLabel }, label),
113
113
  isButtonLoading ? (React.createElement("span", { className: styles.actionButtonLoadingDots }, loadingDots)) : (endIcon && (React.createElement("span", { className: "".concat(styles.actionButtonIcon, " ").concat(endIconName) })))));
@@ -90,6 +90,19 @@
90
90
  background: rgba(225, 81, 81, 0.1);
91
91
  }
92
92
 
93
+ .actionButtonYellow {
94
+ background: #ffc107;
95
+ color: #000000;
96
+ }
97
+
98
+ .actionButtonYellow:hover {
99
+ background: #e0a005;
100
+ }
101
+
102
+ .actionButtonYellow:active {
103
+ background: #c79504;
104
+ }
105
+
93
106
  @keyframes pulseBackground {
94
107
  0% {
95
108
  background-color: var(--Primary-Mid-black, #171e25);
@@ -105,4 +105,6 @@ export const WarningButton: any;
105
105
  export const LargeButton: any;
106
106
  export const LargeButtonWithIcons: any;
107
107
  export const LargeWarningButton: any;
108
+ export const YellowButton: any;
109
+ export const LargeYellowButton: any;
108
110
  import ActionButton from "./ActionButton";
@@ -97,7 +97,7 @@ export default {
97
97
  variant: {
98
98
  control: {
99
99
  type: "select",
100
- options: ["default", "warning"],
100
+ options: ["default", "warning", "yellow"],
101
101
  },
102
102
  },
103
103
  size: {
@@ -165,3 +165,7 @@ export var LargeButtonWithIcons = Template.bind({});
165
165
  LargeButtonWithIcons.args = __assign(__assign({}, Default.args), { label: "Grand Bouton avec Icônes", startIcon: true, endIcon: true, size: "large" });
166
166
  export var LargeWarningButton = Template.bind({});
167
167
  LargeWarningButton.args = __assign(__assign({}, Default.args), { label: "Grand Bouton d'Alerte", variant: "warning", size: "large" });
168
+ export var YellowButton = Template.bind({});
169
+ YellowButton.args = __assign(__assign({}, Default.args), { label: "Bouton Jaune", variant: "yellow" });
170
+ export var LargeYellowButton = Template.bind({});
171
+ LargeYellowButton.args = __assign(__assign({}, Default.args), { label: "Grand Bouton Jaune", variant: "yellow", size: "large" });
@@ -30,12 +30,13 @@ var CountrySelect = function (_a) {
30
30
  setSearch("");
31
31
  }, [isOpen]);
32
32
  useEffect(function () {
33
+ if (disablePortal)
34
+ return;
33
35
  if (isOpen && buttonRef.current) {
34
36
  var rect = buttonRef.current.getBoundingClientRect();
35
37
  var btnW = typeof buttonWidth === "number" ? buttonWidth : rect.width;
36
38
  var lstW = typeof listWidth === "number" ? listWidth : rect.width;
37
39
  var left = rect.left + window.scrollX + (btnW - lstW) / 2;
38
- // Décalage intelligent si la liste sort de l'écran
39
40
  var minMargin = 8;
40
41
  if (left < minMargin)
41
42
  left = minMargin;
@@ -47,7 +48,7 @@ var CountrySelect = function (_a) {
47
48
  width: lstW,
48
49
  });
49
50
  }
50
- }, [isOpen, listWidth, buttonWidth]);
51
+ }, [isOpen, listWidth, buttonWidth, disablePortal]);
51
52
  useEffect(function () {
52
53
  if (!isOpen)
53
54
  return;
@@ -99,14 +100,19 @@ var CountrySelect = function (_a) {
99
100
  }
100
101
  };
101
102
  var selectedItem = items.find(function (i) { return i.value === selected; });
102
- // Liste en portal, position fixed, centrée sous le bouton, décalée si besoin
103
- var dropdown = (React.createElement("div", { className: selectStyles.selectList + " " + styles.listOpen, style: {
104
- position: disablePortal ? "absolute" : "fixed",
105
- top: listPos.top,
106
- left: listPos.left,
107
- width: listPos.width,
108
- zIndex: 9999,
109
- }, role: "listbox", tabIndex: -1, onKeyDown: handleKeyDown },
103
+ var dropdown = (React.createElement("div", { className: selectStyles.selectList + " " + styles.listOpen, style: disablePortal
104
+ ? {
105
+ position: "absolute",
106
+ width: listPos.width,
107
+ zIndex: 9999,
108
+ }
109
+ : {
110
+ position: "fixed",
111
+ top: listPos.top,
112
+ left: listPos.left,
113
+ width: listPos.width,
114
+ zIndex: 9999,
115
+ }, onKeyDown: handleKeyDown },
110
116
  React.createElement("div", { className: styles.searchWrapper },
111
117
  React.createElement("i", { className: "allaw-icon-search" }),
112
118
  React.createElement("input", __assign({ className: styles.search, placeholder: "Rechercher...", value: search, onChange: function (e) { return setSearch(e.target.value); }, autoFocus: true, "aria-label": "Rechercher un pays", onBlur: handleBlur }, (disableAutofill && {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "4.4.8",
3
+ "version": "4.5.0",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",