allaw-ui 3.3.7 → 3.3.8

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.
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ export type EntityCardProps = {
3
+ entityName: string;
4
+ numberOfMembers: number;
5
+ formatedAddress?: string;
6
+ immat?: string;
7
+ actionType: "QUIT" | "REQUEST" | "REMOVE_REQUEST" | "NONE";
8
+ onActionButtonClick?: () => void;
9
+ onCardClick?: () => void;
10
+ };
11
+ declare function EntityCard({ entityName, numberOfMembers, formatedAddress, immat, actionType, onActionButtonClick, onCardClick }: EntityCardProps): React.JSX.Element;
12
+ export default EntityCard;
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import styles from "./entityCard.module.css";
3
+ var ActionButton = function (_a) {
4
+ var type = _a.type, action = _a.action;
5
+ var elements = {
6
+ "QUIT": {
7
+ text: "Quitter l'organisation",
8
+ icon: "allaw-icon-close",
9
+ color: "#E15151",
10
+ },
11
+ "REQUEST": {
12
+ text: "Demander à rejoindre",
13
+ icon: "allaw-icon-arrow-right",
14
+ color: "#25BEEB",
15
+ },
16
+ "REMOVE_REQUEST": {
17
+ text: "Annuler la demande",
18
+ icon: "allaw-icon-close",
19
+ color: "#E15151",
20
+ },
21
+ "NONE": {
22
+ text: "",
23
+ icon: "",
24
+ color: "",
25
+ }
26
+ };
27
+ return React.createElement("button", { style: { color: elements[type].color }, className: styles.actionButton, onClick: function () { action && action(); } },
28
+ elements[type].text,
29
+ React.createElement("i", { className: elements[type].icon }));
30
+ };
31
+ function EntityCard(_a) {
32
+ var entityName = _a.entityName, numberOfMembers = _a.numberOfMembers, formatedAddress = _a.formatedAddress, immat = _a.immat, actionType = _a.actionType, onActionButtonClick = _a.onActionButtonClick, onCardClick = _a.onCardClick;
33
+ return React.createElement("div", { className: styles.card, style: { cursor: onCardClick ? "pointer" : "default" }, onClick: function () { return onCardClick && onCardClick(); } },
34
+ React.createElement("div", { className: styles.picturePlaceHolder },
35
+ React.createElement("i", { className: "allaw-icon-home" })),
36
+ React.createElement("div", { className: styles.dataInfo },
37
+ React.createElement("div", { className: styles.basicsInfo },
38
+ React.createElement("span", { className: styles.entityName }, entityName),
39
+ React.createElement("span", { className: styles.numberOfMembers }, formatedAddress)),
40
+ React.createElement("div", { className: styles.detailsInfo },
41
+ React.createElement("span", { className: styles.detail },
42
+ React.createElement("i", { className: "allaw-icon-users" }),
43
+ numberOfMembers,
44
+ " membre",
45
+ numberOfMembers > 1 ? "s" : ""),
46
+ React.createElement("span", { className: styles.detail },
47
+ React.createElement("i", { className: "allaw-icon-prestation" }),
48
+ immat))),
49
+ actionType != "NONE" && React.createElement(ActionButton, { type: actionType, action: onActionButtonClick && onActionButtonClick() }));
50
+ }
51
+ export default EntityCard;
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { EntityCard as component };
4
+ }
5
+ export default _default;
6
+ export const Default: any;
7
+ import EntityCard from "./EntityCard";
@@ -0,0 +1,30 @@
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 React from "react";
13
+ import EntityCard from "./EntityCard";
14
+ import { action } from "@storybook/addon-actions";
15
+ export default {
16
+ title: "Components/Molecules/EntityCard",
17
+ component: EntityCard,
18
+ };
19
+ var Template = function (args) { return React.createElement(EntityCard, __assign({}, args)); };
20
+ export var Default = Template.bind({});
21
+ Default.args = {
22
+ pictureLink: "https://via.placeholder.com/100",
23
+ entityName: "Cabinet Martin & Associés",
24
+ numberOfMembers: 3,
25
+ formatedAddress: "12 rue du Droit, 75001 Paris",
26
+ immat: "RCS Paris 123 456 789",
27
+ actionType: "REQUEST",
28
+ onActionButtonClick: action("Action button clicked"),
29
+ onCardClick: action("Card clicked"),
30
+ };
@@ -0,0 +1,115 @@
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);
12
+ }
13
+
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;
24
+ }
25
+
26
+ .dataInfo {
27
+ display: flex;
28
+ flex-direction: row;
29
+ gap: 2rem;
30
+ flex-wrap: wrap;
31
+ }
32
+
33
+ .basicsInfo {
34
+ display: flex;
35
+ flex-direction: column;
36
+ gap: 0.25rem;
37
+ align-items: start;
38
+ }
39
+
40
+ .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
+ }
54
+
55
+ .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;
68
+ }
69
+
70
+ .detailsInfo {
71
+ display: flex;
72
+ flex-direction: row;
73
+ gap: 1rem;
74
+ align-items: center;
75
+ flex-wrap: wrap;
76
+ }
77
+
78
+ .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;
94
+ }
95
+
96
+ .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;
111
+ }
112
+
113
+ .actionButton > i {
114
+ font-size: 12px;
115
+ }
@@ -0,0 +1,2 @@
1
+ export { default as EntityCard } from "./EntityCard";
2
+ export type { EntityCardProps } from "./EntityCard";
@@ -0,0 +1 @@
1
+ export { default as EntityCard } from "./EntityCard";
package/dist/index.d.ts CHANGED
@@ -81,6 +81,8 @@ export { default as FeatureCard } from "./components/atoms/featureCard/featureCa
81
81
  export type { FeatureType } from "./components/atoms/featureCard/featureCard";
82
82
  export { default as FeatureGrid } from "./components/molecules/featureGrid/FeatureGrid";
83
83
  export type { FeatureGridProps } from "./components/molecules/featureGrid/FeatureGrid";
84
+ export { default as EntityCard } from "./components/molecules/entityCard/EntityCard";
85
+ export type { EntityCardProps } from "./components/molecules/entityCard/EntityCard";
84
86
  export { default as HeroSection } from "./components/molecules/heroSection/HeroSection";
85
87
  export type { HeroSectionProps } from "./components/molecules/heroSection/HeroSection";
86
88
  export { default as FrameCTA } from "./components/molecules/frameCTA/FrameCTA";
package/dist/index.js CHANGED
@@ -91,6 +91,7 @@ export { default as VerificationCodeInput } from "./components/atoms/inputs/Veri
91
91
  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
+ export { default as EntityCard } from "./components/molecules/entityCard/EntityCard";
94
95
  export { default as HeroSection } from "./components/molecules/heroSection/HeroSection";
95
96
  export { default as FrameCTA } from "./components/molecules/frameCTA/FrameCTA";
96
97
  export { default as QuestionAnswer } from "./components/molecules/questionAnswer/QuestionAnswer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.3.7",
3
+ "version": "3.3.8",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",