allaw-ui 1.0.17 → 1.0.19

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.
@@ -109,3 +109,20 @@
109
109
  font-size: 18px;
110
110
  background: transparent;
111
111
  }
112
+
113
+ .icon-button.custom-color {
114
+ background-color: var(--custom-background-color);
115
+ }
116
+
117
+ .icon-button.custom-color:hover {
118
+ opacity: 0.8;
119
+ }
120
+
121
+ /* Modifier les sélecteurs hover existants */
122
+ .icon-button.smallFilled:not(.custom-color):hover {
123
+ background: var(--grey-venom, #e6edf5);
124
+ }
125
+
126
+ .icon-button.largeFilled:not(.custom-color):hover {
127
+ background: var(--grey-venom, #e6edf5);
128
+ }
@@ -2,8 +2,13 @@ import React from "react";
2
2
  import "./IconButton.css";
3
3
  import "../../../styles/global.css";
4
4
  var IconButton = function (_a) {
5
- var style = _a.style, iconName = _a.iconName, _b = _a.color, color = _b === void 0 ? "var(--secondary-light-grey, #f4f7fb)" : _b, onClick = _a.onClick;
6
- return (React.createElement("button", { className: "icon-button ".concat(style), onClick: onClick, style: { backgroundColor: color } },
5
+ var style = _a.style, iconName = _a.iconName, color = _a.color, onClick = _a.onClick;
6
+ var customStyle = color
7
+ ? {
8
+ "--custom-background-color": color,
9
+ }
10
+ : {};
11
+ return (React.createElement("button", { className: "icon-button ".concat(style, " ").concat(color ? "custom-color" : ""), onClick: onClick, style: customStyle },
7
12
  React.createElement("i", { className: "icon ".concat(iconName) })));
8
13
  };
9
14
  IconButton.defaultProps = {
@@ -14,6 +14,7 @@ export interface InputProps {
14
14
  onChange?: (value: string) => void;
15
15
  value?: string;
16
16
  error?: string;
17
+ color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "grey-venom" | "venom-grey-dark";
17
18
  }
18
19
  export interface InputRef {
19
20
  validate: () => boolean;
@@ -6,11 +6,11 @@ import { commonRegex } from "../../../utils/regex";
6
6
  import TinyInfo from "../typography/TinyInfo";
7
7
  import Paragraph from "../typography/Paragraph";
8
8
  var Input = forwardRef(function (_a, ref) {
9
- var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, endIcon = _a.endIcon, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error;
10
- var _d = useState(false), isPasswordVisible = _d[0], setIsPasswordVisible = _d[1];
11
- var _e = useState(propValue || ""), value = _e[0], setValue = _e[1];
12
- var _f = useState(propError || ""), error = _f[0], setError = _f[1];
13
- var _g = useState(false), isTouched = _g[0], setIsTouched = _g[1];
9
+ var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, endIcon = _a.endIcon, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error, _d = _a.color, color = _d === void 0 ? "noir" : _d;
10
+ var _e = useState(false), isPasswordVisible = _e[0], setIsPasswordVisible = _e[1];
11
+ var _f = useState(propValue || ""), value = _f[0], setValue = _f[1];
12
+ var _g = useState(propError || ""), error = _g[0], setError = _g[1];
13
+ var _h = useState(false), isTouched = _h[0], setIsTouched = _h[1];
14
14
  var inputRef = useRef(null);
15
15
  useEffect(function () {
16
16
  setValue(propValue || "");
@@ -71,7 +71,7 @@ var Input = forwardRef(function (_a, ref) {
71
71
  };
72
72
  return (React.createElement("div", { className: "Input Input-".concat(style) },
73
73
  React.createElement("div", { className: "Input-title-container" },
74
- React.createElement(Paragraph, { variant: "semiBold", color: "noir", text: title }),
74
+ React.createElement(Paragraph, { variant: "semiBold", color: color, text: title }),
75
75
  isRequired && title && (React.createElement("span", { className: "Input-required" },
76
76
  "\u00A0",
77
77
  "*"))),
@@ -304,12 +304,19 @@
304
304
  font-weight: 500;
305
305
  }
306
306
 
307
+ .editable-contact-card {
308
+ display: flex;
309
+ flex-direction: row;
310
+ justify-content: space-between;
311
+ width: 100%;
312
+ }
313
+
307
314
  .contact-card.editable {
308
315
  display: flex;
309
316
  padding: 24px;
310
- width: 1214px;
317
+ width: 100%;
311
318
  justify-content: space-between;
312
- align-items: flex-start;
319
+ align-items: stretch;
313
320
  align-self: stretch;
314
321
  border-radius: 16px;
315
322
  border: 1px solid var(--Primary-Venom-grey, #e6edf5);
@@ -318,6 +325,7 @@
318
325
 
319
326
  .contact-card.editable .content-container {
320
327
  display: flex;
328
+ flex-direction: row;
321
329
  align-items: center;
322
330
  gap: 24px;
323
331
  }
@@ -384,3 +392,39 @@
384
392
  align-items: center;
385
393
  gap: 16px;
386
394
  }
395
+
396
+ @media (max-width: 800px) {
397
+ .contact-card.editable .telephone-email-items {
398
+ flex-direction: column;
399
+ align-items: flex-start;
400
+ gap: 10px;
401
+ }
402
+ }
403
+
404
+ @media (max-width: 600px) {
405
+ .contact-card.editable .content-container {
406
+ flex-direction: column;
407
+ }
408
+ .contact-card.editable .name-tag-container {
409
+ align-items: flex-start;
410
+ width: 100%;
411
+ }
412
+ }
413
+
414
+ @media (max-width: 450px) {
415
+ .contact-card.editable .action-button-container {
416
+ display: block;
417
+ position: absolute;
418
+ top: 24px;
419
+ right: 24px;
420
+ }
421
+ }
422
+
423
+ .action-button-container {
424
+ display: flex;
425
+ flex-direction: column;
426
+ justify-content: center;
427
+ align-items: flex-end;
428
+ height: 100%;
429
+ align-self: stretch;
430
+ }
@@ -54,7 +54,7 @@ var ContactCard = function (_a) {
54
54
  React.createElement("div", { className: "status-container" },
55
55
  React.createElement(OtherStatusTag, { label: status, type: "readonly" }))));
56
56
  case "editable":
57
- return (React.createElement(React.Fragment, null,
57
+ return (React.createElement("div", { className: "editable-contact-card" },
58
58
  React.createElement("div", { className: "content-container" },
59
59
  React.createElement("div", { className: "name-tag-container" },
60
60
  React.createElement("h3", { className: "contact-name" }, name),
@@ -72,7 +72,8 @@ var ContactCard = function (_a) {
72
72
  React.createElement("div", { className: "info-item" },
73
73
  React.createElement("i", { className: "allaw-icon-mail info-icon" }),
74
74
  React.createElement("span", { className: "info-text contact" }, email))))),
75
- React.createElement(IconButton, { style: "largeFilled", iconName: "allaw-icon-edit-2", onClick: onEdit })));
75
+ React.createElement("div", { className: "action-button-container" },
76
+ React.createElement(IconButton, { style: "largeFilled", iconName: "allaw-icon-edit-2", onClick: onEdit }))));
76
77
  }
77
78
  };
78
79
  return React.createElement("div", { className: "contact-card ".concat(size) }, renderContent());
@@ -5,6 +5,10 @@ import Image from "next/image";
5
5
  var NoPhoto = "/assets/NoPhoto.png";
6
6
  var ProCard = function (_a) {
7
7
  var imageUrl = _a.imageUrl, job = _a.job, firstName = _a.firstName, lastName = _a.lastName, address = _a.address, profileUrl = _a.profileUrl, _b = _a.isPro, isPro = _b === void 0 ? false : _b;
8
+ console.log("Données reçues dans ProCard:", {
9
+ address: address,
10
+ hasAddress: Boolean(address && /[a-zA-Z0-9]/.test(address)),
11
+ });
8
12
  var uppercaseJob = job.toUpperCase();
9
13
  return (React.createElement("div", { className: "pro-card" },
10
14
  React.createElement("div", { className: "pro-card-content" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",