allaw-ui 3.4.7 → 3.4.9

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.
@@ -4,11 +4,12 @@ export interface EntityAdminCardProps {
4
4
  dateSent?: string;
5
5
  role?: "admin" | "default";
6
6
  status?: "member" | "request";
7
+ displayAs?: "default" | "admin";
7
8
  avatarUrl?: string;
8
9
  onAccept?: () => void;
9
10
  onRefuse?: () => void;
10
11
  onRoleChange?: (newRole: "admin" | "default") => void;
11
12
  onRemove?: () => void;
12
13
  }
13
- declare function EntityAdminCard({ email, dateSent, role, status, avatarUrl, onAccept, onRefuse, onRoleChange, onRemove, }: EntityAdminCardProps): React.JSX.Element;
14
+ declare function EntityAdminCard({ email, dateSent, role, status, displayAs, avatarUrl, onAccept, onRefuse, onRoleChange, onRemove, }: EntityAdminCardProps): React.JSX.Element;
14
15
  export default EntityAdminCard;
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { Select } from "../../atoms/selects";
3
3
  import { IconButton } from "../../atoms/buttons";
4
+ import { Paragraph } from "../../atoms/typography";
4
5
  import styles from "./EntityAdminCard.module.css";
5
6
  function EntityAdminCard(_a) {
6
- var email = _a.email, dateSent = _a.dateSent, role = _a.role, status = _a.status, avatarUrl = _a.avatarUrl, onAccept = _a.onAccept, onRefuse = _a.onRefuse, onRoleChange = _a.onRoleChange, onRemove = _a.onRemove;
7
+ var email = _a.email, dateSent = _a.dateSent, role = _a.role, status = _a.status, _b = _a.displayAs, displayAs = _b === void 0 ? "default" : _b, avatarUrl = _a.avatarUrl, onAccept = _a.onAccept, onRefuse = _a.onRefuse, onRoleChange = _a.onRoleChange, onRemove = _a.onRemove;
7
8
  var roleItems = [
8
9
  { label: "Admin", value: "admin" },
9
10
  { label: "Membre", value: "default" },
@@ -21,17 +22,17 @@ function EntityAdminCard(_a) {
21
22
  ? "Demande r\u00E9alis\u00E9e le ".concat(dateSent)
22
23
  : "Depuis le ".concat(dateSent))))),
23
24
  React.createElement("div", { className: styles.right },
24
- status === "member" && (React.createElement(React.Fragment, null,
25
+ status === "member" && (React.createElement(React.Fragment, null, displayAs === "admin" ? (React.createElement(React.Fragment, null,
25
26
  React.createElement(Select, { items: roleItems, selectedItem: role, onChange: function (newValue) {
26
27
  return onRoleChange === null || onRoleChange === void 0 ? void 0 : onRoleChange(newValue);
27
28
  } }),
28
- React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-close", color: "#e15151", onClick: onRemove }))),
29
- status === "request" && (React.createElement("div", { className: styles.actions },
29
+ React.createElement(IconButton, { style: "smallFilled", iconName: "allaw-icon-close", color: "#e15151", onClick: onRemove }))) : (React.createElement(Paragraph, { variant: "medium", color: "mid-grey", text: "Membre", size: "small" })))),
30
+ status === "request" && (React.createElement(React.Fragment, null, displayAs === "admin" ? (React.createElement("div", { className: styles.actions },
30
31
  React.createElement("button", { className: styles.accept, onClick: onAccept },
31
32
  React.createElement("i", { className: "allaw-icon-check", style: { marginRight: "0.5rem" } }),
32
33
  "Accepter"),
33
34
  React.createElement("button", { className: styles.refuse, onClick: onRefuse },
34
35
  React.createElement("i", { className: "allaw-icon-close", style: { marginRight: "0.5rem" } }),
35
- "Refuser"))))));
36
+ "Refuser"))) : (React.createElement(Paragraph, { variant: "medium", color: "mid-grey", text: "Demande en attente", size: "small" })))))));
36
37
  }
37
38
  export default EntityAdminCard;
@@ -5,4 +5,6 @@ declare namespace _default {
5
5
  export default _default;
6
6
  export const Member: any;
7
7
  export const Request: any;
8
+ export const AdminViewMember: any;
9
+ export const AdminViewRequest: any;
8
10
  import EntityAdminCard from "./EntityAdminCard";
@@ -33,3 +33,18 @@ Request.args = {
33
33
  onAccept: action("Accept clicked"),
34
34
  onRefuse: action("Refuse clicked"),
35
35
  };
36
+ export var AdminViewMember = Template.bind({});
37
+ AdminViewMember.args = {
38
+ email: "valerie_damido@avocate.com",
39
+ dateSent: "19/07/2025 à 11h35",
40
+ role: "default",
41
+ status: "member",
42
+ displayAs: "admin",
43
+ };
44
+ export var AdminViewRequest = Template.bind({});
45
+ AdminViewRequest.args = {
46
+ email: "valerie_damido@avocate.com",
47
+ dateSent: "19/07/2025 à 11h35",
48
+ status: "request",
49
+ displayAs: "admin",
50
+ };
@@ -1,7 +1,14 @@
1
1
  declare namespace _default {
2
2
  export let title: string;
3
3
  export { EntityCard as component };
4
+ export namespace parameters {
5
+ let layout: string;
6
+ }
4
7
  }
5
8
  export default _default;
6
9
  export const Default: any;
10
+ export const LongContent: any;
11
+ export const Mobile: any;
12
+ export const Tablet: any;
13
+ export const NoAction: any;
7
14
  import EntityCard from "./EntityCard";
@@ -15,6 +15,9 @@ import { action } from "@storybook/addon-actions";
15
15
  export default {
16
16
  title: "Components/Molecules/EntityCard",
17
17
  component: EntityCard,
18
+ parameters: {
19
+ layout: "padded",
20
+ },
18
21
  };
19
22
  var Template = function (args) { return React.createElement(EntityCard, __assign({}, args)); };
20
23
  export var Default = Template.bind({});
@@ -28,3 +31,21 @@ Default.args = {
28
31
  onActionButtonClick: action("Action button clicked"),
29
32
  onCardClick: action("Card clicked"),
30
33
  };
34
+ export var LongContent = Template.bind({});
35
+ LongContent.args = __assign(__assign({}, Default.args), { entityName: "Cabinet d'Avocats Martin & Associés Spécialisés en Droit des Affaires", formatedAddress: "12 rue du Droit, Quartier des Affaires, 75001 Paris, France", immat: "RCS Paris 123 456 789 SIRET 12345678901234" });
36
+ export var Mobile = Template.bind({});
37
+ Mobile.args = __assign({}, Default.args);
38
+ Mobile.parameters = {
39
+ viewport: {
40
+ defaultViewport: "mobile1",
41
+ },
42
+ };
43
+ export var Tablet = Template.bind({});
44
+ Tablet.args = __assign({}, Default.args);
45
+ Tablet.parameters = {
46
+ viewport: {
47
+ defaultViewport: "tablet",
48
+ },
49
+ };
50
+ export var NoAction = Template.bind({});
51
+ NoAction.args = __assign(__assign({}, Default.args), { actionType: "NONE" });
@@ -1,115 +1,203 @@
1
1
  .card {
2
- display: flex;
3
- min-height: 92px;
4
- padding: 16px;
5
- justify-content: start;
6
- align-items: center;
7
- gap: 1rem;
8
- flex-wrap: wrap;
9
- align-self: stretch;
10
- border-radius: 16px;
11
- border: 1.5px solid var(--Primary-Venom-grey, #E6EDF5);
2
+ display: flex;
3
+ min-height: 92px;
4
+ padding: 16px;
5
+ justify-content: start;
6
+ align-items: center;
7
+ gap: 1rem;
8
+ flex-wrap: wrap;
9
+ align-self: stretch;
10
+ border-radius: 16px;
11
+ border: 1.5px solid var(--Primary-Venom-grey, #e6edf5);
12
12
  }
13
13
 
14
14
  .picturePlaceHolder {
15
- display: flex;
16
- width: 60px;
17
- height: 60px;
18
- padding: 8px;
19
- justify-content: center;
20
- align-items: center;
21
- gap: 10px;
22
- border-radius: 8px;
23
- background: #F5F7FA;
15
+ display: flex;
16
+ width: 60px;
17
+ height: 60px;
18
+ padding: 8px;
19
+ justify-content: center;
20
+ align-items: center;
21
+ gap: 10px;
22
+ border-radius: 8px;
23
+ background: #f5f7fa;
24
+ flex-shrink: 0;
24
25
  }
25
26
 
26
27
  .dataInfo {
27
- display: flex;
28
- flex-direction: row;
29
- gap: 2rem;
30
- flex-wrap: wrap;
28
+ display: flex;
29
+ flex-direction: row;
30
+ gap: 2rem;
31
+ flex-wrap: wrap;
32
+ flex: 1;
33
+ min-width: 0;
31
34
  }
32
35
 
33
36
  .basicsInfo {
34
- display: flex;
35
- flex-direction: column;
36
- gap: 0.25rem;
37
- align-items: start;
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: 0.25rem;
40
+ align-items: start;
41
+ flex: 1;
42
+ min-width: 200px;
38
43
  }
39
44
 
40
45
  .entityName {
41
- color: #000;
42
- leading-trim: both;
43
- text-edge: cap;
44
- font-family: Poppins;
45
- font-size: 16px;
46
- font-style: normal;
47
- font-weight: 600;
48
- line-height: 22px; /* 137.5% */
49
- max-width: 300px;
50
- overflow: hidden;
51
- text-overflow: ellipsis;
52
- white-space: nowrap;
53
- }
46
+ color: #000;
47
+ leading-trim: both;
48
+ text-edge: cap;
49
+ font-family: Poppins;
50
+ font-size: 16px;
51
+ font-style: normal;
52
+ font-weight: 600;
53
+ line-height: 22px; /* 137.5% */
54
+ max-width: 100%;
55
+ overflow: hidden;
56
+ text-overflow: ellipsis;
57
+ white-space: nowrap;
58
+ }
54
59
 
55
60
  .numberOfMembers {
56
- color: #456073;
57
- leading-trim: both;
58
- text-edge: cap;
59
- font-family: var(--font-open-sans);
60
- font-size: 16px;
61
- font-style: normal;
62
- font-weight: 500;
63
- line-height: normal;
64
- max-width: 300px;
65
- overflow: hidden;
66
- text-overflow: ellipsis;
67
- white-space: nowrap;
61
+ color: #456073;
62
+ leading-trim: both;
63
+ text-edge: cap;
64
+ font-family: var(--font-open-sans);
65
+ font-size: 16px;
66
+ font-style: normal;
67
+ font-weight: 500;
68
+ line-height: normal;
69
+ max-width: 100%;
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ white-space: nowrap;
68
73
  }
69
74
 
70
75
  .detailsInfo {
71
- display: flex;
72
- flex-direction: row;
73
- gap: 1rem;
74
- align-items: center;
75
- flex-wrap: wrap;
76
+ display: flex;
77
+ flex-direction: row;
78
+ gap: 1rem;
79
+ align-items: center;
80
+ flex-wrap: wrap;
81
+ flex-shrink: 0;
76
82
  }
77
83
 
78
84
  .detail {
79
- display: flex;
80
- padding: 2px 0px;
81
- justify-content: center;
82
- align-items: center;
83
- gap: 8px;
84
- color: var(--Primary-Dark-grey, #456073);
85
- leading-trim: both;
86
- text-edge: cap;
87
- text-wrap: nowrap;
88
- /* OS - 16px - Paragraphe/OS - SemiBold */
89
- font-family: var(--font-open-sans);
90
- font-size: 16px;
91
- font-style: normal;
92
- font-weight: 500;
93
- line-height: normal;
85
+ display: flex;
86
+ padding: 2px 0px;
87
+ justify-content: center;
88
+ align-items: center;
89
+ gap: 8px;
90
+ color: var(--Primary-Dark-grey, #456073);
91
+ leading-trim: both;
92
+ text-edge: cap;
93
+ text-wrap: nowrap;
94
+ /* OS - 16px - Paragraphe/OS - SemiBold */
95
+ font-family: var(--font-open-sans);
96
+ font-size: 16px;
97
+ font-style: normal;
98
+ font-weight: 500;
99
+ line-height: normal;
94
100
  }
95
101
 
96
102
  .actionButton {
97
- margin-left: auto;
98
- display: flex;
99
- padding: 12px 0px;
100
- align-items: baseline;
101
- gap: 8px;
102
- cursor: pointer;
103
-
104
- font-family: var(--font-open-sans);
105
- font-size: 16px;
106
- font-style: normal;
107
- font-weight: 500;
108
- line-height: normal;
109
- background: transparent;
110
- border: none;
103
+ margin-left: auto;
104
+ display: flex;
105
+ padding: 12px 0px;
106
+ align-items: baseline;
107
+ gap: 8px;
108
+ cursor: pointer;
109
+ flex-shrink: 0;
110
+
111
+ font-family: var(--font-open-sans);
112
+ font-size: 16px;
113
+ font-style: normal;
114
+ font-weight: 500;
115
+ line-height: normal;
116
+ background: transparent;
117
+ border: none;
111
118
  }
112
119
 
113
120
  .actionButton > i {
114
- font-size: 12px;
115
- }
121
+ font-size: 12px;
122
+ }
123
+
124
+ /* Media queries pour la responsivité */
125
+ @media (max-width: 820px) {
126
+ .card {
127
+ gap: 0.75rem;
128
+ }
129
+
130
+ .dataInfo {
131
+ gap: 1.5rem;
132
+ }
133
+
134
+ .detailsInfo {
135
+ gap: 0.75rem;
136
+ }
137
+ }
138
+
139
+ @media (max-width: 640px) {
140
+ .card {
141
+ flex-direction: column;
142
+ align-items: flex-start;
143
+ gap: 1rem;
144
+ padding: 12px;
145
+ }
146
+
147
+ .dataInfo {
148
+ width: 100%;
149
+ flex-direction: column;
150
+ gap: 1rem;
151
+ }
152
+
153
+ .basicsInfo {
154
+ min-width: unset;
155
+ width: 100%;
156
+ }
157
+
158
+ .detailsInfo {
159
+ width: 100%;
160
+ justify-content: flex-start;
161
+ }
162
+
163
+ .actionButton {
164
+ margin-left: 0;
165
+ align-self: flex-end;
166
+ width: 100%;
167
+ justify-content: center;
168
+ padding: 8px 12px;
169
+ border: 1px solid currentColor;
170
+ border-radius: 8px;
171
+ text-align: center;
172
+ }
173
+ }
174
+
175
+ @media (max-width: 480px) {
176
+ .card {
177
+ padding: 8px;
178
+ }
179
+
180
+ .picturePlaceHolder {
181
+ width: 48px;
182
+ height: 48px;
183
+ padding: 6px;
184
+ }
185
+
186
+ .entityName {
187
+ font-size: 14px;
188
+ line-height: 20px;
189
+ }
190
+
191
+ .numberOfMembers {
192
+ font-size: 14px;
193
+ }
194
+
195
+ .detail {
196
+ font-size: 14px;
197
+ }
198
+
199
+ .actionButton {
200
+ font-size: 14px;
201
+ padding: 6px 10px;
202
+ }
203
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.4.7",
3
+ "version": "3.4.9",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",