allaw-ui 3.3.9 → 3.4.1
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.
- package/dist/components/molecules/entityAdminCard/EntityAdminCard.d.ts +13 -0
- package/dist/components/molecules/entityAdminCard/EntityAdminCard.js +29 -0
- package/dist/components/molecules/entityAdminCard/entityAdminCard.module.css +98 -0
- package/dist/components/molecules/entityAdminCard/entityAdminCard.stories.d.ts +8 -0
- package/dist/components/molecules/entityAdminCard/entityAdminCard.stories.js +35 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface EntityAdminCardProps {
|
|
3
|
+
email: string;
|
|
4
|
+
dateSent?: string;
|
|
5
|
+
role?: "Admin" | "Défaut";
|
|
6
|
+
status?: "MEMBER" | "REQUEST";
|
|
7
|
+
avatarUrl?: string;
|
|
8
|
+
onAccept?: () => void;
|
|
9
|
+
onRefuse?: () => void;
|
|
10
|
+
onRoleChange?: (newRole: "Admin" | "Défaut") => void;
|
|
11
|
+
}
|
|
12
|
+
declare function EntityAdminCard({ email, dateSent, role, status, avatarUrl, onAccept, onRefuse, onRoleChange, }: EntityAdminCardProps): React.JSX.Element;
|
|
13
|
+
export default EntityAdminCard;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styles from "./EntityAdminCard.module.css";
|
|
3
|
+
function EntityAdminCard(_a) {
|
|
4
|
+
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;
|
|
5
|
+
return (React.createElement("div", { className: styles.card },
|
|
6
|
+
React.createElement("div", { className: styles.left },
|
|
7
|
+
React.createElement("div", { className: styles.avatar }, avatarUrl ? (React.createElement("div", { className: styles.avatarImage, style: {
|
|
8
|
+
backgroundImage: "url(".concat(avatarUrl, ")"),
|
|
9
|
+
} })) : (React.createElement("i", { className: "allaw-icon-user" }))),
|
|
10
|
+
React.createElement("div", { className: styles.info },
|
|
11
|
+
React.createElement("span", { className: styles.email }, email),
|
|
12
|
+
dateSent && (React.createElement("span", { className: styles.date },
|
|
13
|
+
"A rejoint le ",
|
|
14
|
+
dateSent)))),
|
|
15
|
+
React.createElement("div", { className: styles.right },
|
|
16
|
+
status === "MEMBER" && (React.createElement("select", { className: styles.roleSelect, value: role, onChange: function (e) {
|
|
17
|
+
return onRoleChange === null || onRoleChange === void 0 ? void 0 : onRoleChange(e.target.value);
|
|
18
|
+
} },
|
|
19
|
+
React.createElement("option", { value: "Admin" }, "Admin"),
|
|
20
|
+
React.createElement("option", { value: "D\u00E9faut" }, "D\u00E9faut"))),
|
|
21
|
+
status === "REQUEST" && (React.createElement("div", { className: styles.actions },
|
|
22
|
+
React.createElement("button", { className: styles.accept, onClick: onAccept },
|
|
23
|
+
React.createElement("i", { className: "allaw-icon-check", style: { marginRight: "0.5rem" } }),
|
|
24
|
+
"Accepter"),
|
|
25
|
+
React.createElement("button", { className: styles.refuse, onClick: onRefuse },
|
|
26
|
+
React.createElement("i", { className: "allaw-icon-close", style: { marginRight: "0.5rem" } }),
|
|
27
|
+
"Refuser"))))));
|
|
28
|
+
}
|
|
29
|
+
export default EntityAdminCard;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
border: 1px solid #e6edf5;
|
|
6
|
+
border-radius: 16px;
|
|
7
|
+
padding: 1rem;
|
|
8
|
+
margin-bottom: 1rem;
|
|
9
|
+
background-color: white;
|
|
10
|
+
gap: 10px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.left {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 1rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.avatar {
|
|
20
|
+
width: 48px;
|
|
21
|
+
height: 48px;
|
|
22
|
+
background-color: #f2f4f7;
|
|
23
|
+
border-radius: 50%;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
font-size: 24px;
|
|
28
|
+
color: #9ca3af;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.info {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 10px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.email {
|
|
38
|
+
color: var(--Primary-Dark-grey, #456073);
|
|
39
|
+
font-family: "Open Sans";
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
font-style: normal;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
text-decoration-line: underline;
|
|
44
|
+
text-decoration-style: solid;
|
|
45
|
+
text-decoration-skip-ink: auto;
|
|
46
|
+
text-decoration-thickness: auto;
|
|
47
|
+
text-underline-offset: auto;
|
|
48
|
+
text-underline-position: from-font;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.date {
|
|
52
|
+
color: #728ea7;
|
|
53
|
+
font-family: "Open Sans";
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
line-height: normal;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.right {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 1rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.roleSelect {
|
|
67
|
+
background-color: #f8fafc;
|
|
68
|
+
border: none;
|
|
69
|
+
border-radius: 8px;
|
|
70
|
+
padding: 0.5rem 0.75rem;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
color: #1e293b;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.actions {
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: 1rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.accept {
|
|
83
|
+
background: none;
|
|
84
|
+
border: none;
|
|
85
|
+
color: #12b76a;
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.refuse {
|
|
92
|
+
background: none;
|
|
93
|
+
border: none;
|
|
94
|
+
color: #e54848;
|
|
95
|
+
font-weight: 500;
|
|
96
|
+
font-size: 14px;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { action } from "@storybook/addon-actions";
|
|
13
|
+
import React from "react";
|
|
14
|
+
import EntityAdminCard from "./EntityAdminCard";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/Molecules/EntityAdminCard",
|
|
17
|
+
component: EntityAdminCard,
|
|
18
|
+
};
|
|
19
|
+
var Template = function (args) { return React.createElement(EntityAdminCard, __assign({}, args)); };
|
|
20
|
+
export var Member = Template.bind({});
|
|
21
|
+
Member.args = {
|
|
22
|
+
email: "valerie_damido@avocate.com",
|
|
23
|
+
dateSent: "19/07/2025 à 11h35",
|
|
24
|
+
role: "Défaut",
|
|
25
|
+
status: "MEMBER",
|
|
26
|
+
onRoleChange: action("Role changed"),
|
|
27
|
+
};
|
|
28
|
+
export var Request = Template.bind({});
|
|
29
|
+
Request.args = {
|
|
30
|
+
email: "valerie_damido@avocate.com",
|
|
31
|
+
dateSent: "19/07/2025 à 11h35",
|
|
32
|
+
status: "REQUEST",
|
|
33
|
+
onAccept: action("Accept clicked"),
|
|
34
|
+
onRefuse: action("Refuse clicked"),
|
|
35
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,8 @@ export { default as FeatureGrid } from "./components/molecules/featureGrid/Featu
|
|
|
83
83
|
export type { FeatureGridProps } from "./components/molecules/featureGrid/FeatureGrid";
|
|
84
84
|
export { default as EntityCard } from "./components/molecules/entityCard/EntityCard";
|
|
85
85
|
export type { EntityCardProps } from "./components/molecules/entityCard/EntityCard";
|
|
86
|
+
export { default as EntityAdminCard } from "./components/molecules/entityAdminCard/EntityAdminCard";
|
|
87
|
+
export type { EntityAdminCardProps } from "./components/molecules/entityAdminCard/EntityAdminCard";
|
|
86
88
|
export { default as HeroSection } from "./components/molecules/heroSection/HeroSection";
|
|
87
89
|
export type { HeroSectionProps } from "./components/molecules/heroSection/HeroSection";
|
|
88
90
|
export { default as FrameCTA } from "./components/molecules/frameCTA/FrameCTA";
|
package/dist/index.js
CHANGED
|
@@ -92,6 +92,7 @@ export { default as Banner } from "./components/molecules/banner/Banner";
|
|
|
92
92
|
export { default as FeatureCard } from "./components/atoms/featureCard/featureCard";
|
|
93
93
|
export { default as FeatureGrid } from "./components/molecules/featureGrid/FeatureGrid";
|
|
94
94
|
export { default as EntityCard } from "./components/molecules/entityCard/EntityCard";
|
|
95
|
+
export { default as EntityAdminCard } from "./components/molecules/entityAdminCard/EntityAdminCard";
|
|
95
96
|
export { default as HeroSection } from "./components/molecules/heroSection/HeroSection";
|
|
96
97
|
export { default as FrameCTA } from "./components/molecules/frameCTA/FrameCTA";
|
|
97
98
|
export { default as QuestionAnswer } from "./components/molecules/questionAnswer/QuestionAnswer";
|