allaw-ui 2.0.0 → 2.0.3

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.
@@ -1,10 +1,9 @@
1
1
  import React from "react";
2
2
  import styles from "./contactCard.module.css";
3
3
  import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
4
- import IconButton from "../../atoms/buttons/IconButton";
5
4
  import Link from "next/link";
6
5
  var ContactCard = function (_a) {
7
- var name = _a.name, status = _a.status, phone = _a.phone, email = _a.email, isEditable = _a.isEditable, onEdit = _a.onEdit, onClick = _a.onClick, actionsButton = _a.actionsButton, _b = _a.actionIconName, actionIconName = _b === void 0 ? "allaw-icon-edit-2" : _b, clientLabel = _a.clientLabel;
6
+ var name = _a.name, status = _a.status, phone = _a.phone, email = _a.email, onClick = _a.onClick, actionsButton = _a.actionsButton, clientLabel = _a.clientLabel;
8
7
  var isPhoneEmpty = !phone || phone.trim() === "";
9
8
  var isEmailEmpty = !email || email.trim() === "";
10
9
  var displayClientLabel = clientLabel || "Client de l'\u00E9tude";
@@ -26,9 +25,7 @@ var ContactCard = function (_a) {
26
25
  React.createElement("span", { className: "".concat(styles.infoText, " ").concat(styles.contact, " ").concat(isEmailEmpty ? styles.emptyField : "") }, isEmailEmpty ? ("Non renseigné") : (React.createElement(Link, { style: { color: "#171E25", textDecoration: "underline" }, href: "mailTo:".concat(email) }, email))))))),
27
26
  React.createElement("div", { className: styles.actionsContainer },
28
27
  actionsButton ? actionsButton : null,
29
- isEditable && (React.createElement("div", { className: styles.actionButtonContainer },
30
- React.createElement(IconButton, { style: "largeFilled", iconName: actionIconName, onClick: onEdit }))),
31
28
  onClick && (React.createElement("div", { className: styles.actionButtonContainer },
32
- React.createElement("i", { className: "allaw-icon-right ".concat(styles.infoIcon) }))))));
29
+ React.createElement("i", { className: "allaw-icon-arrow-right" }))))));
33
30
  };
34
31
  export default ContactCard;
@@ -18,30 +18,17 @@ declare namespace _default {
18
18
  let control_3: string;
19
19
  export { control_3 as control };
20
20
  }
21
- namespace isEditable {
22
- let control_4: string;
23
- export { control_4 as control };
24
- }
25
- namespace onEdit {
26
- let action: string;
27
- }
28
21
  namespace gender {
29
- export namespace control_5 {
22
+ export namespace control_4 {
30
23
  let type: string;
31
24
  let options: string[];
32
25
  }
33
- export { control_5 as control };
34
- }
35
- namespace actionIconName {
36
- let control_6: string;
37
- export { control_6 as control };
38
- export let description: string;
26
+ export { control_4 as control };
39
27
  }
40
28
  namespace clientLabel {
41
- let control_7: string;
42
- export { control_7 as control };
43
- let description_1: string;
44
- export { description_1 as description };
29
+ let control_5: string;
30
+ export { control_5 as control };
31
+ export let description: string;
45
32
  }
46
33
  }
47
34
  export namespace args {
@@ -53,12 +40,10 @@ declare namespace _default {
53
40
  export { phone_1 as phone };
54
41
  let email_1: string;
55
42
  export { email_1 as email };
56
- let isEditable_1: boolean;
57
- export { isEditable_1 as isEditable };
43
+ export let isEditable: boolean;
58
44
  let gender_1: string;
59
45
  export { gender_1 as gender };
60
- let actionIconName_1: string;
61
- export { actionIconName_1 as actionIconName };
46
+ export let actionIconName: string;
62
47
  let clientLabel_1: string;
63
48
  export { clientLabel_1 as clientLabel };
64
49
  }
@@ -21,18 +21,12 @@ export default {
21
21
  status: { control: "text" },
22
22
  phone: { control: "text" },
23
23
  email: { control: "text" },
24
- isEditable: { control: "boolean" },
25
- onEdit: { action: "edited" },
26
24
  gender: {
27
25
  control: {
28
26
  type: "select",
29
27
  options: ["male", "female"],
30
28
  },
31
29
  },
32
- actionIconName: {
33
- control: "text",
34
- description: "Nom de l'icône pour le bouton d'action",
35
- },
36
30
  clientLabel: {
37
31
  control: "text",
38
32
  description: "Texte personnalisé pour 'Client/Cliente de l'étude'",
@@ -47,6 +47,7 @@ var Stepper = function (_a) {
47
47
  var steps = _a.steps, currentStep = _a.currentStep, _b = _a.startIcon, startIcon = _b === void 0 ? [] : _b, _c = _a.endIcon, endIcon = _c === void 0 ? true : _c, children = _a.children, _d = _a.secondaryButton, secondaryButton = _d === void 0 ? [] : _d, _e = _a.primaryButton, primaryButton = _e === void 0 ? [] : _e, _f = _a.showProgressBar, showProgressBar = _f === void 0 ? [] : _f, onClose = _a.onClose, validateStep = _a.validateStep;
48
48
  var _g = useState(false), isVisible = _g[0], setIsVisible = _g[1];
49
49
  var portalContainerRef = useRef(null);
50
+ var stepperContainerRef = useRef(null);
50
51
  useEffect(function () {
51
52
  var container = document.createElement("div");
52
53
  document.body.appendChild(container);
@@ -97,11 +98,19 @@ var Stepper = function (_a) {
97
98
  onClose();
98
99
  }
99
100
  }, [onClose]);
100
- var stepperContent = (React.createElement("div", { className: "stepper-overlay ".concat(isVisible ? "visible" : ""), onClick: handleClose },
101
- React.createElement("div", { className: "stepper-container", onClick: function (e) { return e.stopPropagation(); } },
101
+ var handleMouseDown = useCallback(function (e) {
102
+ if (stepperContainerRef.current &&
103
+ !stepperContainerRef.current.contains(e.target)) {
104
+ handleClose();
105
+ }
106
+ }, [handleClose]);
107
+ var stepperContent = (React.createElement("div", { className: "stepper-overlay ".concat(isVisible ? "visible" : ""), onMouseDown: handleMouseDown },
108
+ React.createElement("div", { className: "stepper-container", onClick: function (e) { return e.stopPropagation(); }, ref: stepperContainerRef },
102
109
  React.createElement(ProgressBar, { steps: steps, currentStep: currentStep, startIcon: currentShowStartIcon, endIcon: endIcon, onStartIconClick: handlePrevious, onEndIconClick: handleClose, showProgressBar: currentShowProgressBar }),
103
110
  React.createElement("div", { className: "stepper-content" }, children[currentStep - 1]),
104
- React.createElement("div", { className: "stepper-buttons ".concat(!(currentSecondaryButton === null || currentSecondaryButton === void 0 ? void 0 : currentSecondaryButton.show) && !(currentPrimaryButton === null || currentPrimaryButton === void 0 ? void 0 : currentPrimaryButton.show) ? "no-buttons" : "") },
111
+ React.createElement("div", { className: "stepper-buttons ".concat(!(currentSecondaryButton === null || currentSecondaryButton === void 0 ? void 0 : currentSecondaryButton.show) && !(currentPrimaryButton === null || currentPrimaryButton === void 0 ? void 0 : currentPrimaryButton.show)
112
+ ? "no-buttons"
113
+ : "") },
105
114
  (currentSecondaryButton === null || currentSecondaryButton === void 0 ? void 0 : currentSecondaryButton.show) && (React.createElement("div", { className: "stepper-button-container secondary-button-container" },
106
115
  React.createElement(SecondaryButton, { fullWidth: true, label: currentSecondaryButton.label, startIcon: currentSecondaryButton.startIconName ? true : undefined, endIcon: currentSecondaryButton.endIconName ? true : undefined, startIconName: currentSecondaryButton.startIconName, endIconName: currentSecondaryButton.endIconName, onClick: function () { var _a; return (_a = currentSecondaryButton.onSecondaryButtonClick) === null || _a === void 0 ? void 0 : _a.call(currentSecondaryButton, currentStep); } }))),
107
116
  (currentPrimaryButton === null || currentPrimaryButton === void 0 ? void 0 : currentPrimaryButton.show) && (React.createElement("div", { className: "stepper-button-container primary-button-container" },
@@ -7,9 +7,9 @@ declare const meta: {
7
7
  layout: string;
8
8
  };
9
9
  args: {
10
- onLogin: import("@vitest/spy").Mock<[], void>;
11
- onLogout: import("@vitest/spy").Mock<[], void>;
12
- onCreateAccount: import("@vitest/spy").Mock<[], void>;
10
+ onLogin: import("@vitest/spy").Mock<(...args: any[]) => any>;
11
+ onLogout: import("@vitest/spy").Mock<(...args: any[]) => any>;
12
+ onCreateAccount: import("@vitest/spy").Mock<(...args: any[]) => any>;
13
13
  };
14
14
  };
15
15
  export default meta;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",