allaw-ui 1.0.124 → 1.0.126

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.
Files changed (35) hide show
  1. package/dist/components/atoms/selects/SelectableListItem.d.ts +15 -0
  2. package/dist/components/atoms/selects/SelectableListItem.js +23 -0
  3. package/dist/components/atoms/selects/SelectableListItem.module.css +73 -0
  4. package/dist/components/atoms/selects/SelectableListItem.stories.d.ts +36 -0
  5. package/dist/components/atoms/selects/SelectableListItem.stories.js +94 -0
  6. package/dist/components/atoms/selects/index.d.ts +2 -0
  7. package/dist/components/atoms/selects/index.js +1 -0
  8. package/dist/components/atoms/typography/Heading.d.ts +6 -1
  9. package/dist/components/atoms/typography/Heading.js +22 -4
  10. package/dist/components/atoms/typography/Heading.module.css +43 -0
  11. package/dist/components/atoms/typography/Heading.stories.d.ts +19 -0
  12. package/dist/components/atoms/typography/Heading.stories.js +38 -1
  13. package/dist/components/molecules/{blogArticle/BlogArticle.stories.d.ts → blogCard/BlodCard.stories.d.ts} +2 -2
  14. package/dist/components/molecules/{blogArticle/BlogArticle.stories.js → blogCard/BlodCard.stories.js} +7 -7
  15. package/dist/components/molecules/{blogArticle/BlogArticle.d.ts → blogCard/BlogCard.d.ts} +3 -3
  16. package/dist/components/molecules/{blogArticle/BlogArticle.js → blogCard/BlogCard.js} +3 -3
  17. package/dist/components/molecules/{blogArticle/BlogArticle.module.css → blogCard/BlogCard.module.css} +6 -0
  18. package/dist/components/molecules/blogCard/index.d.ts +2 -0
  19. package/dist/components/molecules/blogCard/index.js +1 -0
  20. package/dist/components/molecules/blogHeader/BlogHeader.d.ts +11 -0
  21. package/dist/components/molecules/blogHeader/BlogHeader.js +38 -0
  22. package/dist/components/molecules/blogHeader/BlogHeader.module.css +132 -0
  23. package/dist/components/molecules/{BlogTextBlock/BlogTextBlock.stories.d.ts → blogHeader/BlogHeader.stories.d.ts} +2 -2
  24. package/dist/components/molecules/{BlogTextBlock/BlogTextBlock.stories.js → blogHeader/BlogHeader.stories.js} +13 -13
  25. package/dist/components/molecules/blogHeader/index.d.ts +2 -0
  26. package/dist/components/molecules/blogHeader/index.js +1 -0
  27. package/dist/index.d.ts +5 -4
  28. package/dist/index.js +3 -2
  29. package/dist/stories/Header.stories.d.ts +3 -3
  30. package/dist/styles/colors.module.css +44 -0
  31. package/package.json +1 -1
  32. package/dist/components/atoms/typography/Heading.css +0 -77
  33. package/dist/components/molecules/BlogTextBlock/BlogTextBlock.css +0 -43
  34. package/dist/components/molecules/BlogTextBlock/BlogTextBlock.d.ts +0 -12
  35. package/dist/components/molecules/BlogTextBlock/BlogTextBlock.js +0 -30
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import "../../../styles/global.css";
3
+ export interface SelectableListItemProps {
4
+ labels: {
5
+ label: string;
6
+ width?: string;
7
+ align?: "start" | "end" | "center";
8
+ fontWeight?: "normal" | "bold";
9
+ color?: "mid-grey" | "dark-grey" | "noir" | "venom-grey-dark" | "actions-valid" | "actions-error";
10
+ }[];
11
+ isActive: boolean;
12
+ onClick: () => void;
13
+ }
14
+ declare const SelectableListItem: React.FC<SelectableListItemProps>;
15
+ export default SelectableListItem;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import styles from "./SelectableListItem.module.css";
3
+ import "../../../styles/global.css";
4
+ var SelectableListItem = function (_a) {
5
+ var labels = _a.labels, isActive = _a.isActive, onClick = _a.onClick;
6
+ return (React.createElement("button", { className: "".concat(styles.selectableListItem, " ").concat(isActive ? styles.selectableListItemActive : ""), onClick: onClick },
7
+ React.createElement("span", { className: styles.selectableListItemIcon }, isActive && React.createElement("span", { className: styles.selectableListItemIconInner })),
8
+ React.createElement("div", { className: styles.selectableListItemLabels }, labels.map(function (label, index) {
9
+ var _a, _b;
10
+ return (React.createElement("span", { key: index, className: styles.selectableListItemLabel, style: {
11
+ width: ((_a = label.width) === null || _a === void 0 ? void 0 : _a.includes("%")) ? label.width : undefined,
12
+ minWidth: ((_b = label.width) === null || _b === void 0 ? void 0 : _b.includes("px")) ? label.width : undefined,
13
+ justifyContent: label.align === "start"
14
+ ? "flex-start"
15
+ : label.align === "end"
16
+ ? "flex-end"
17
+ : "center",
18
+ fontWeight: label.fontWeight === "bold" ? "bold" : "normal",
19
+ color: "var(--".concat(label.color, ", inherit)"),
20
+ } }, label.label));
21
+ }))));
22
+ };
23
+ export default SelectableListItem;
@@ -0,0 +1,73 @@
1
+ .selectableListItem {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 8px;
5
+ border: none;
6
+ background: none;
7
+ cursor: pointer;
8
+ transition: color 0.15s, border-bottom 0.15s;
9
+ padding: 12px 24px;
10
+ border-radius: 16px;
11
+ background: var(--secondary-light-grey, #f4f7fb);
12
+ width: 100%;
13
+ }
14
+
15
+ .selectableListItem:hover {
16
+ background-color: var(--venom-grey, #e6edf5);
17
+ }
18
+
19
+ .selectableListItemActive {
20
+ background: var(--venom-grey, #e6edf5);
21
+ outline: 1px solid var(--mid-grey, #728ea7);
22
+ }
23
+
24
+ .selectableListItemIcon {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ border-radius: 50%;
29
+ background: var(--Primary-Blanc, #fff);
30
+ width: 24px;
31
+ min-width: 25px;
32
+ height: 24px;
33
+ border: 1px solid #d1dce7;
34
+ }
35
+
36
+ .selectableListItemActive .selectableListItemIcon {
37
+ padding: 3px;
38
+ border: 1px solid #d1dce7;
39
+ }
40
+
41
+ .selectableListItemActive .selectableListItemIconInner {
42
+ width: 16px;
43
+ height: 16px;
44
+ border-radius: 50%;
45
+ background: var(--primary-blue, #25beeb);
46
+ }
47
+
48
+ .selectableListItemLabels {
49
+ display: flex;
50
+ flex-wrap: nowrap;
51
+ width: 100%;
52
+ }
53
+
54
+ .selectableListItemLabel {
55
+ font-family: "Open Sans", sans-serif;
56
+ font-size: 16px;
57
+ font-style: normal;
58
+ line-height: normal;
59
+ white-space: nowrap;
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ display: flex;
63
+ align-items: center;
64
+ }
65
+
66
+ :root {
67
+ --mid-grey: #728ea7;
68
+ --dark-grey: #456073;
69
+ --noir: #171e25;
70
+ --venom-grey-dark: #d1dce8;
71
+ --actions-valid: #29a36a;
72
+ --actions-error: #e15151;
73
+ }
@@ -0,0 +1,36 @@
1
+ export namespace ActionsData {
2
+ namespace onClick {
3
+ let action: string;
4
+ }
5
+ }
6
+ declare namespace _default {
7
+ export let title: string;
8
+ export { SelectableListItem as component };
9
+ export let tags: string[];
10
+ export let excludeStories: RegExp;
11
+ export namespace args {
12
+ let labels: {
13
+ label: string;
14
+ width: string;
15
+ align: string;
16
+ fontWeight: string;
17
+ color: string;
18
+ }[];
19
+ let isActive: boolean;
20
+ }
21
+ export namespace parameters {
22
+ namespace backgrounds {
23
+ let _default: string;
24
+ export { _default as default };
25
+ export let values: {
26
+ name: string;
27
+ value: string;
28
+ }[];
29
+ }
30
+ let layout: string;
31
+ }
32
+ }
33
+ export default _default;
34
+ export const Default: any;
35
+ export const Active: any;
36
+ import SelectableListItem from "./SelectableListItem";
@@ -0,0 +1,94 @@
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, { useState } from "react";
13
+ import SelectableListItem from "./SelectableListItem";
14
+ import "../../../styles/global.css";
15
+ export var ActionsData = {
16
+ onClick: { action: "clicked" },
17
+ };
18
+ export default {
19
+ title: "Components/Atoms/selects/SelectableListItem",
20
+ component: SelectableListItem,
21
+ tags: ["autodocs"],
22
+ excludeStories: /.*Data$/,
23
+ args: __assign(__assign({}, ActionsData), { labels: [
24
+ {
25
+ label: "Adoption",
26
+ width: "100%",
27
+ align: "start",
28
+ fontWeight: "normal",
29
+ color: "noir",
30
+ },
31
+ {
32
+ label: "(35 min)",
33
+ width: "100px",
34
+ align: "end",
35
+ fontWeight: "normal",
36
+ color: "mid-grey",
37
+ },
38
+ {
39
+ label: "100 €",
40
+ width: "80px",
41
+ align: "end",
42
+ fontWeight: "bold",
43
+ color: "noir",
44
+ },
45
+ ], isActive: false }),
46
+ parameters: {
47
+ backgrounds: {
48
+ default: "light",
49
+ values: [
50
+ { name: "light", value: "#ffffff" },
51
+ { name: "grey", value: "#728ea7" },
52
+ { name: "figma", value: "#404040" },
53
+ { name: "dark", value: "#171e25" },
54
+ ],
55
+ },
56
+ layout: "padded",
57
+ },
58
+ };
59
+ var Template = function (args) {
60
+ var _a = useState(false), isActive = _a[0], setIsActive = _a[1];
61
+ var handleClick = function () {
62
+ setIsActive(!isActive);
63
+ args.onClick();
64
+ };
65
+ return (React.createElement(SelectableListItem, __assign({}, args, { isActive: isActive, onClick: handleClick })));
66
+ };
67
+ export var Default = Template.bind({});
68
+ export var Active = Template.bind({});
69
+ Active.args = {
70
+ labels: [
71
+ {
72
+ label: "Adoption",
73
+ width: "100%",
74
+ align: "start",
75
+ fontWeight: "normal",
76
+ color: "noir",
77
+ },
78
+ {
79
+ label: "(35 min)",
80
+ width: "100px",
81
+ align: "end",
82
+ fontWeight: "normal",
83
+ color: "mid-grey",
84
+ },
85
+ {
86
+ label: "100 €",
87
+ width: "80px",
88
+ align: "end",
89
+ fontWeight: "bold",
90
+ color: "noir",
91
+ },
92
+ ],
93
+ isActive: true,
94
+ };
@@ -2,3 +2,5 @@ export { default as Select } from "./Select";
2
2
  export type { SelectItem, SelectProps, SelectRef } from "./Select";
3
3
  export { default as ComboBox } from "./ComboBox";
4
4
  export type { ComboBoxProps, ComboBoxRef } from "./ComboBox";
5
+ export { default as SelectableListItem } from "./SelectableListItem";
6
+ export type { SelectableListItemProps } from "./SelectableListItem";
@@ -1,2 +1,3 @@
1
1
  export { default as Select } from "./Select";
2
2
  export { default as ComboBox } from "./ComboBox";
3
+ export { default as SelectableListItem } from "./SelectableListItem";
@@ -1,10 +1,15 @@
1
1
  import React from "react";
2
- import "./Heading.css";
2
+ export interface ResponsiveSetting {
3
+ maxWidth: number;
4
+ minWidth: number;
5
+ styles: React.CSSProperties;
6
+ }
3
7
  export interface HeadingProps {
4
8
  variant: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h7";
5
9
  color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
6
10
  text: React.ReactNode;
7
11
  align?: "left" | "justify" | "center";
12
+ responsiveSettings?: ResponsiveSetting[];
8
13
  }
9
14
  declare const Heading: React.FC<HeadingProps>;
10
15
  export default Heading;
@@ -1,7 +1,25 @@
1
- import React from "react";
2
- import "./Heading.css";
1
+ import React, { useState, useEffect } from "react";
2
+ import styles from "./Heading.module.css";
3
3
  var Heading = function (_a) {
4
- var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "center" : _c;
5
- return React.createElement("span", { className: "heading ".concat(variant, " color-").concat(color, " align-").concat(align) }, text);
4
+ var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "center" : _c, responsiveSettings = _a.responsiveSettings;
5
+ var _d = useState({}), dynamicStyles = _d[0], setDynamicStyles = _d[1];
6
+ var calculateStyles = function () {
7
+ if (!responsiveSettings || responsiveSettings.length === 0)
8
+ return;
9
+ var currentWidth = window.innerWidth;
10
+ var matchedSetting = responsiveSettings.find(function (setting) {
11
+ return currentWidth <= setting.maxWidth && currentWidth >= setting.minWidth;
12
+ });
13
+ if (matchedSetting) {
14
+ setDynamicStyles(matchedSetting.styles);
15
+ }
16
+ };
17
+ useEffect(function () {
18
+ calculateStyles();
19
+ var handleResize = function () { return calculateStyles(); };
20
+ window.addEventListener("resize", handleResize);
21
+ return function () { return window.removeEventListener("resize", handleResize); };
22
+ }, [responsiveSettings]);
23
+ return (React.createElement("span", { className: "".concat(styles.heading, " ").concat(styles[variant], " ").concat(styles["color-".concat(color)], " ").concat(styles["align-".concat(align)]), style: dynamicStyles }, text));
6
24
  };
7
25
  export default Heading;
@@ -0,0 +1,43 @@
1
+ .heading {
2
+ font-weight: bold;
3
+ }
4
+
5
+ .h1 {
6
+ font-size: 32px;
7
+ }
8
+
9
+ .h2 {
10
+ font-size: 28px;
11
+ }
12
+
13
+ .color-bleu-allaw {
14
+ color: #25beeb;
15
+ }
16
+
17
+ .color-mid-grey {
18
+ color: #728ea7;
19
+ }
20
+
21
+ .color-dark-grey {
22
+ color: #495867;
23
+ }
24
+
25
+ .color-noir {
26
+ color: #000000;
27
+ }
28
+
29
+ .color-pure-white {
30
+ color: #ffffff;
31
+ }
32
+
33
+ .align-left {
34
+ text-align: left;
35
+ }
36
+
37
+ .align-center {
38
+ text-align: center;
39
+ }
40
+
41
+ .align-justify {
42
+ text-align: justify;
43
+ }
@@ -22,6 +22,24 @@ declare namespace _default {
22
22
  let control_2: string;
23
23
  export { control_2 as control };
24
24
  }
25
+ namespace responsiveSettings {
26
+ export namespace control_3 {
27
+ let type_2: null;
28
+ export { type_2 as type };
29
+ }
30
+ export { control_3 as control };
31
+ export let description: string;
32
+ export namespace table {
33
+ export namespace type_3 {
34
+ let summary: string;
35
+ }
36
+ export { type_3 as type };
37
+ export namespace defaultValue {
38
+ let summary_1: string;
39
+ export { summary_1 as summary };
40
+ }
41
+ }
42
+ }
25
43
  }
26
44
  export namespace parameters {
27
45
  namespace backgrounds {
@@ -42,4 +60,5 @@ export const H4: any;
42
60
  export const H5: any;
43
61
  export const H6: any;
44
62
  export const H7: any;
63
+ export const ResponsiveExample: any;
45
64
  import Heading from "./Heading";
@@ -26,12 +26,26 @@ export default {
26
26
  color: {
27
27
  control: {
28
28
  type: "select",
29
- options: ["bleu-allaw", "mid-grey", "dark-grey", "noir", "pure-white"], // Ajoutez d'autres couleurs si nécessaire
29
+ options: ["bleu-allaw", "mid-grey", "dark-grey", "noir", "pure-white"],
30
30
  },
31
31
  },
32
32
  text: {
33
33
  control: "text",
34
34
  },
35
+ responsiveSettings: {
36
+ control: {
37
+ type: null,
38
+ },
39
+ description: "An array of responsive settings. Each object defines the styles for specific min and max widths.",
40
+ table: {
41
+ type: {
42
+ summary: "Array<{ maxWidth: number, minWidth: number, styles: React.CSSProperties }>",
43
+ },
44
+ defaultValue: {
45
+ summary: "[]",
46
+ },
47
+ },
48
+ },
35
49
  },
36
50
  parameters: {
37
51
  backgrounds: {
@@ -88,3 +102,26 @@ H7.args = {
88
102
  color: "pure-white",
89
103
  text: "Poppins – SemiBold – 14px",
90
104
  };
105
+ export var ResponsiveExample = Template.bind({});
106
+ ResponsiveExample.args = {
107
+ variant: "h2",
108
+ color: "pure-white",
109
+ text: "Responsive Heading Example",
110
+ responsiveSettings: [
111
+ {
112
+ maxWidth: 1000,
113
+ minWidth: 768,
114
+ styles: { fontSize: "36px", lineHeight: "42px", letterSpacing: "0.38px" },
115
+ },
116
+ {
117
+ maxWidth: 767,
118
+ minWidth: 480,
119
+ styles: { fontSize: "28px", lineHeight: "34px", letterSpacing: "0.28px" },
120
+ },
121
+ {
122
+ maxWidth: 479,
123
+ minWidth: 0,
124
+ styles: { fontSize: "16px", lineHeight: "26px", letterSpacing: "0.2px" },
125
+ },
126
+ ],
127
+ };
@@ -1,10 +1,10 @@
1
1
  declare namespace _default {
2
2
  export let title: string;
3
- export { BlogArticle as component };
3
+ export { BlogCard as component };
4
4
  }
5
5
  export default _default;
6
6
  export const Default: any;
7
7
  export const NoImage: any;
8
8
  export const LongDescriptionTitle: any;
9
9
  export const MultipleTags: any;
10
- import BlogArticle from './BlogArticle';
10
+ import BlogCard from './BlogCard';
@@ -10,17 +10,17 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import React from 'react';
13
- import BlogArticle from './BlogArticle';
13
+ import BlogCard from './BlogCard';
14
14
  export default {
15
- title: 'Components/Molecules/BlogArticle',
16
- component: BlogArticle,
15
+ title: 'Components/Molecules/Blog/BlogCard',
16
+ component: BlogCard,
17
17
  };
18
- var Template = function (args) { return React.createElement(BlogArticle, __assign({}, args)); };
18
+ var Template = function (args) { return React.createElement(BlogCard, __assign({}, args)); };
19
19
  export var Default = Template.bind({});
20
20
  Default.args = {
21
- Article_URL: 'https://example.com/article',
21
+ Article_URL: 'https://example.com/card',
22
22
  Image_URL: 'https://plus.unsplash.com/premium_photo-1661329930662-19a43503782f?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8YXZvY2F0fGVufDB8fDB8fHww',
23
- Tags: ['Blablablablabla', "Blablablabla", "Blablablabla"],
23
+ Tags: ['Conseil', "Droit", "Donation"],
24
24
  Date: new Date('2023-04-23'),
25
25
  Title: 'Le Droit en France',
26
26
  Description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas aliquam...',
@@ -28,6 +28,6 @@ Default.args = {
28
28
  export var NoImage = Template.bind({});
29
29
  NoImage.args = __assign(__assign({}, Default.args), { Image_URL: '' });
30
30
  export var LongDescriptionTitle = Template.bind({});
31
- LongDescriptionTitle.args = __assign(__assign({}, Default.args), { Description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce interdum lacus vitae turpis malesuada, id varius magna faucibus. Nulla facilisi. Suspendisse potenti. Vivamus in purus sit amet sapien sodales convallis. Integer venenatis velit id lorem aliquam, sit amet pulvinar neque volutpat.', Title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce interdum lacus vitae turpis malesuada, id varius magna faucibus. Nulla facilisi. Suspendisse potenti. Vivamus in purus sit amet sapien sodales convallis. Integer venenatis velit id lorem aliquam, sit amet pulvinar neque volutpat.' });
31
+ LongDescriptionTitle.args = __assign(__assign({}, Default.args), { Description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce interdum lacus vitae turpis malesuada, id varius magna faucibus. Nulla facilisi. Suspendisse potenti. Vivamus in purus sit amet sapien sodales convallis. Integer venenatis velit id lorem aliquam, sit amet pulvinar neque volutpat. dgfdfdfgdfgdfgdfgdfgfdgdfgdfgfgfdgd dfgffsd', Title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce interdum lacus vitae turpis malesuada, id varius magna faucibus. Nulla facilisi. Suspendisse potenti. Vivamus in purus sit amet sapien sodales convallis. Integer venenatis velit id lorem aliquam, sit amet pulvinar neque volutpat.' });
32
32
  export var MultipleTags = Template.bind({});
33
33
  MultipleTags.args = __assign(__assign({}, Default.args), { Tags: ['Conseil', 'Droit', 'Avocat', 'Justice', 'Légal', 'Justice', 'Légal'] });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type BlogArticleProps = {
2
+ export type BlogCardProps = {
3
3
  Article_URL: string;
4
4
  Image_URL: string;
5
5
  Tags: string[];
@@ -9,5 +9,5 @@ export type BlogArticleProps = {
9
9
  Preview?: boolean;
10
10
  onClick?: () => void;
11
11
  };
12
- declare const BlogArticle: React.FC<BlogArticleProps>;
13
- export default BlogArticle;
12
+ declare const BlogCard: React.FC<BlogCardProps>;
13
+ export default BlogCard;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import styles from './BlogArticle.module.css';
2
+ import styles from './BlogCard.module.css';
3
3
  import Link from 'next/link';
4
4
  import { OtherStatusTag } from '../../atoms/tags';
5
5
  import { Heading, TinyInfo } from '../../atoms/typography';
@@ -24,7 +24,7 @@ var BlogBottomSection = function (_a) {
24
24
  React.createElement("div", { className: styles.blogDescription },
25
25
  React.createElement(TinyInfo, { variant: "medium14", text: Description, color: "noir", align: "left" })))));
26
26
  };
27
- var BlogArticle = function (_a) {
27
+ var BlogCard = function (_a) {
28
28
  var Article_URL = _a.Article_URL, Image_URL = _a.Image_URL, Tags = _a.Tags, Date = _a.Date, Title = _a.Title, Description = _a.Description, _b = _a.Preview, Preview = _b === void 0 ? false : _b, onClick = _a.onClick;
29
29
  return (React.createElement(React.Fragment, null, onClick ? React.createElement("button", { className: styles.blogContainer, onClick: function () { return onClick && onClick(); } },
30
30
  !Preview && React.createElement(BlogTopSection, { Image_URL: Image_URL, Title: Title }),
@@ -33,4 +33,4 @@ var BlogArticle = function (_a) {
33
33
  !Preview && React.createElement(BlogTopSection, { Image_URL: Image_URL, Title: Title }),
34
34
  React.createElement(BlogBottomSection, { Tags: Tags, Date: Date, Title: Title, Description: Description }))));
35
35
  };
36
- export default BlogArticle;
36
+ export default BlogCard;
@@ -61,6 +61,12 @@
61
61
  -webkit-line-clamp: 3;
62
62
  -webkit-box-orient: vertical;
63
63
  overflow: hidden;
64
+ text-overflow: ellipsis;
65
+ white-space: normal;
66
+ word-wrap: break-word;
67
+ overflow-wrap: break-word;
68
+ word-break: break-word;
69
+ hyphens: auto;
64
70
  }
65
71
 
66
72
  .blogTopSectionPlaceholder {
@@ -0,0 +1,2 @@
1
+ export { default as BlogCard } from "./BlogCard";
2
+ export type { BlogCardProps } from "./BlogCard";
@@ -0,0 +1 @@
1
+ export { default as BlogCard } from "./BlogCard";
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export type BlogHeaderProps = {
3
+ Title: string;
4
+ Author: string;
5
+ Date: Date;
6
+ TimeToRead: number;
7
+ Profession: "Avocat" | "Notaire" | "Commissaire de justice";
8
+ ImageBlog: string;
9
+ };
10
+ declare function BlogHeader({ Title, Author, Date, TimeToRead, Profession, ImageBlog }: BlogHeaderProps): React.JSX.Element;
11
+ export default BlogHeader;
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ import { Heading, TinyInfo } from "../../atoms/typography";
3
+ import Image from "next/image";
4
+ import styles from "./BlogHeader.module.css";
5
+ function BlogHeader(_a) {
6
+ var Title = _a.Title, Author = _a.Author, Date = _a.Date, TimeToRead = _a.TimeToRead, Profession = _a.Profession, ImageBlog = _a.ImageBlog;
7
+ var responsiveSettings = [
8
+ {
9
+ maxWidth: 1000,
10
+ minWidth: 768,
11
+ styles: { fontSize: "32px", lineHeight: "40px" },
12
+ },
13
+ {
14
+ maxWidth: 767,
15
+ minWidth: 480,
16
+ styles: { fontSize: "28px", lineHeight: "36px" },
17
+ },
18
+ {
19
+ maxWidth: 479,
20
+ minWidth: 0,
21
+ styles: { fontSize: "24px", lineHeight: "32px" },
22
+ },
23
+ ];
24
+ return (React.createElement("div", { className: styles.blogContainerWrapper },
25
+ React.createElement("div", { className: styles.blogContainer },
26
+ React.createElement("div", { className: styles.blogTitle },
27
+ React.createElement(Heading, { text: Title, variant: "h2", color: "noir", align: "left", responsiveSettings: responsiveSettings })),
28
+ React.createElement("div", { className: styles.blogInfoContainer },
29
+ React.createElement(TinyInfo, { variant: "medium12", text: Date.toLocaleDateString(), color: "dark-grey" }),
30
+ React.createElement("div", { className: styles.timeToReadContainer },
31
+ React.createElement("i", { className: "allaw-icon-clock" }),
32
+ React.createElement(TinyInfo, { variant: "medium12", text: "".concat(TimeToRead, " min"), color: "dark-grey" })),
33
+ React.createElement(TinyInfo, { variant: "medium12", text: Profession, color: "dark-grey" }),
34
+ React.createElement(TinyInfo, { variant: "medium12", text: Author, color: "dark-grey" })),
35
+ React.createElement("div", { className: styles.blogImageContainer },
36
+ React.createElement(Image, { src: ImageBlog, alt: "Illustration pour l'article intitul\u00E9 \"".concat(Title, "\""), width: 1000, height: 449, className: styles.blogImage })))));
37
+ }
38
+ export default BlogHeader;
@@ -0,0 +1,132 @@
1
+ .blogContainerWrapper {
2
+ display: flex;
3
+ justify-content: center;
4
+ background-color: white;
5
+ padding: 16px;
6
+ }
7
+
8
+ .blogContainer {
9
+ display: flex;
10
+ width: 100%;
11
+ max-width: 1000px;
12
+ flex-direction: column;
13
+ align-items: flex-start;
14
+ background-color: white;
15
+ gap: 16px;
16
+ }
17
+
18
+ .blogInfoContainer {
19
+ display: flex;
20
+ align-items: flex-end;
21
+ gap: 14px;
22
+ width: auto;
23
+ height: auto;
24
+ flex-wrap: wrap;
25
+ }
26
+
27
+ .blogTitle {
28
+ display: -webkit-box;
29
+ -webkit-line-clamp: 2;
30
+ line-clamp: 2;
31
+ overflow: hidden;
32
+ -webkit-box-orient: vertical;
33
+ text-overflow: ellipsis;
34
+ word-wrap: break-word;
35
+ white-space: normal;
36
+ word-wrap: break-word;
37
+ overflow-wrap: break-word;
38
+ }
39
+
40
+ .blogImage {
41
+ width: 100%;
42
+ height: 100%;
43
+ object-fit: cover;
44
+ object-position: center;
45
+ }
46
+
47
+ .blogImageContainer {
48
+ width: 100%;
49
+ height: auto;
50
+ overflow: hidden;
51
+ display: flex;
52
+ justify-content: center;
53
+ align-items: center;
54
+ position: relative;
55
+ }
56
+
57
+ .timeToReadContainer {
58
+ display: flex;
59
+ align-items: center;
60
+ gap: 5px;
61
+ }
62
+
63
+ .timeToReadContainer > i {
64
+ color: #25BEEB;
65
+ font-size: 12px;
66
+ }
67
+
68
+ @media (max-width: 700px) and (min-width: 400px) {
69
+ .blogInfoContainer {
70
+ display: grid;
71
+ grid-template-columns: 1fr 1fr;
72
+ grid-template-rows: 1fr 1fr;
73
+ gap: 6px;
74
+ width: 100%;
75
+ justify-content: space-between;
76
+ align-items: stretch;
77
+ }
78
+
79
+ .blogInfoContainer > *:nth-child(1) {
80
+ grid-column: 1;
81
+ grid-row: 1;
82
+ justify-self: start;
83
+ align-self: start;
84
+ }
85
+
86
+ .blogInfoContainer > *:nth-child(2) {
87
+ grid-column: 2;
88
+ grid-row: 1;
89
+ justify-self: end;
90
+ align-self: start;
91
+ }
92
+
93
+ .blogInfoContainer > *:nth-child(3) {
94
+ grid-column: 1;
95
+ grid-row: 2;
96
+ justify-self: start;
97
+ align-self: end;
98
+ }
99
+
100
+ .blogInfoContainer > *:nth-child(4) {
101
+ grid-column: 2;
102
+ grid-row: 2;
103
+ justify-self: end;
104
+ align-self: end;
105
+ }
106
+ }
107
+
108
+ @media (max-width: 400px) {
109
+ .blogContainerWrapper {
110
+ padding: 0;
111
+ }
112
+
113
+ .blogTitle {
114
+ -webkit-line-clamp: 3;
115
+ line-clamp: 3;
116
+ }
117
+
118
+ .blogContainer {
119
+ gap: 12px;
120
+ flex-direction: column;
121
+ align-items: flex-start;
122
+ padding: 0 8px;
123
+ margin-top: 4px;
124
+ }
125
+
126
+ .blogInfoContainer {
127
+ display: flex;
128
+ flex-direction: column;
129
+ gap: 4px;
130
+ align-items: flex-start;
131
+ }
132
+ }
@@ -1,6 +1,6 @@
1
1
  declare namespace _default {
2
2
  export let title: string;
3
- export { BlogTextBlock as component };
3
+ export { BlogHeader as component };
4
4
  export namespace argTypes {
5
5
  namespace Title {
6
6
  let control: string;
@@ -45,4 +45,4 @@ export default _default;
45
45
  export const Default: any;
46
46
  export const NotaryExample: any;
47
47
  export const JudicialOfficerExample: any;
48
- import BlogTextBlock from "./BlogTextBlock";
48
+ import BlogHeader from "./BlogHeader";
@@ -10,31 +10,31 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import React from "react";
13
- import BlogTextBlock, { BlogTextBlockProps } from "./BlogTextBlock";
13
+ import BlogHeader, { BlogHeaderProps } from "./BlogHeader";
14
14
  export default {
15
- title: "Components/molecules/BlogTextBlock",
16
- component: BlogTextBlock,
15
+ title: "Components/molecules/Blog/BlogHeader",
16
+ component: BlogHeader,
17
17
  argTypes: {
18
18
  Title: { control: "text", description: "The title of the blog post" },
19
19
  Author: { control: "text", description: "The author of the blog post" },
20
20
  Date: { control: "date", description: "The publication date of the blog post" },
21
- TimeToRead: { control: "text", description: "The estimated time to read the blog post" },
21
+ TimeToRead: { control: "number", description: "The estimated time to read the blog post" },
22
22
  Profession: {
23
23
  control: { type: "select" },
24
- options: ["avocat", "notaire", "commissaire de justice"],
24
+ options: ["Avocat", "Notaire", "Commissaire de justice"],
25
25
  description: "The profession associated with the author",
26
26
  },
27
27
  ImageBlog: { control: "text", description: "The image for the blog post" },
28
28
  },
29
29
  };
30
- var Template = function (args) { return React.createElement(BlogTextBlock, __assign({}, args)); };
30
+ var Template = function (args) { return React.createElement(BlogHeader, __assign({}, args)); };
31
31
  export var Default = Template.bind({});
32
32
  Default.args = {
33
33
  Title: "Understanding Legal Procedures",
34
34
  Author: "John Doe",
35
35
  Date: new Date("2023-10-21"),
36
- TimeToRead: "5 min",
37
- Profession: "avocat",
36
+ TimeToRead: 5,
37
+ Profession: "Avocat",
38
38
  ImageBlog: "https://plus.unsplash.com/premium_photo-1661329930662-19a43503782f?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8YXZvY2F0fGVufDB8fDB8fHww",
39
39
  };
40
40
  export var NotaryExample = Template.bind({});
@@ -42,16 +42,16 @@ NotaryExample.args = {
42
42
  Title: "The Role of a Notary in Legal Contracts",
43
43
  Author: "Jane Smith",
44
44
  Date: new Date("2023-08-15"),
45
- TimeToRead: "7 min",
46
- Profession: "notaire",
45
+ TimeToRead: 7,
46
+ Profession: "Notaire",
47
47
  ImageBlog: "https://via.placeholder.com/1000x449",
48
48
  };
49
49
  export var JudicialOfficerExample = Template.bind({});
50
50
  JudicialOfficerExample.args = {
51
- Title: "How Judicial Officers Ensure Justice",
51
+ Title: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui quod consequuntur perferendis accusamus distinctio error rem nostrum odio dolorem laudantium libero dicta saepe magnam ipsum impedit eos, numquam ducimus? Nisi",
52
52
  Author: "Alice Cooper",
53
53
  Date: new Date("2023-09-10"),
54
- TimeToRead: "6 min",
55
- Profession: "commissaire de justice",
54
+ TimeToRead: 9,
55
+ Profession: "Commissaire de justice",
56
56
  ImageBlog: "https://via.placeholder.com/1000x449",
57
57
  };
@@ -0,0 +1,2 @@
1
+ export { default as BlogHeader } from './BlogHeader';
2
+ export type { BlogHeaderProps } from './BlogHeader';
@@ -0,0 +1 @@
1
+ export { default as BlogHeader } from './BlogHeader';
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export { default as Select } from "./components/atoms/selects/Select";
23
23
  export type { SelectItem, SelectProps, SelectRef, } from "./components/atoms/selects/Select";
24
24
  export { default as ComboBox } from "./components/atoms/selects/ComboBox";
25
25
  export type { ComboBoxProps, ComboBoxRef, } from "./components/atoms/selects/ComboBox";
26
+ export { default as SelectableListItem } from "./components/atoms/selects/SelectableListItem";
26
27
  export { default as Datepicker } from "./components/atoms/datepickers/Datepicker";
27
28
  export type { DatepickerProps } from "./components/atoms/datepickers/Datepicker";
28
29
  export { default as DatepickerForm } from "./components/molecules/datepickerForm/DatepickerForm";
@@ -61,7 +62,7 @@ export { default as Breadcrumb } from "./components/molecules/breadcrumb/Breadcr
61
62
  export { default as ProCard } from "./components/molecules/proCard/ProCard";
62
63
  export { default as Pagination } from "./components/molecules/pagination/Pagination";
63
64
  export type { PaginationProps } from "./components/molecules/pagination/Pagination";
64
- export { default as BlogTextBlock } from './components/molecules/BlogTextBlock/BlogTextBlock';
65
- export type { BlogTextBlockProps } from './components/molecules/BlogTextBlock/BlogTextBlock';
66
- export { default as BlogArticle } from './components/molecules/blogArticle/BlogArticle';
67
- export type { BlogArticleProps } from './components/molecules/blogArticle/BlogArticle';
65
+ export { default as BlogHeader } from "./components/molecules/blogHeader/BlogHeader";
66
+ export type { BlogHeaderProps } from "./components/molecules/blogHeader/BlogHeader";
67
+ export { default as BlogCard } from "./components/molecules/blogCard/BlogCard";
68
+ export type { BlogCardProps } from "./components/molecules/blogCard/BlogCard";
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ export { default as SingleFilter } from "./components/atoms/filters/SingleFilter
27
27
  // Selects
28
28
  export { default as Select } from "./components/atoms/selects/Select";
29
29
  export { default as ComboBox } from "./components/atoms/selects/ComboBox";
30
+ export { default as SelectableListItem } from "./components/atoms/selects/SelectableListItem";
30
31
  // Datepickers
31
32
  export { default as Datepicker } from "./components/atoms/datepickers/Datepicker";
32
33
  // DatepickerForm
@@ -79,5 +80,5 @@ export { default as Breadcrumb } from "./components/molecules/breadcrumb/Breadcr
79
80
  export { default as ProCard } from "./components/molecules/proCard/ProCard";
80
81
  // Pagination
81
82
  export { default as Pagination } from "./components/molecules/pagination/Pagination";
82
- export { default as BlogTextBlock } from './components/molecules/BlogTextBlock/BlogTextBlock';
83
- export { default as BlogArticle } from './components/molecules/blogArticle/BlogArticle';
83
+ export { default as BlogHeader } from "./components/molecules/blogHeader/BlogHeader";
84
+ export { default as BlogCard } from "./components/molecules/blogCard/BlogCard";
@@ -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;
@@ -0,0 +1,44 @@
1
+ :root {
2
+ /* Primary colors */
3
+ --bleu-allaw: #25beeb;
4
+ --mid-grey: #728ea7;
5
+ --dark-grey: #456073;
6
+ --noir: #171e25;
7
+ --pure-white: #ffffff;
8
+
9
+ /* Greyscale */
10
+ --grey-venom: #e6edf5;
11
+ --venom-grey-dark: #d1dce8;
12
+ --grey-light: #f6fcfe;
13
+ --grey-light-2: #f2f8fc;
14
+ --active-grey: #e9eef5;
15
+ --blue-lightning: #f6fcfe;
16
+ --fond-de-selection: #f6fcfe;
17
+ --lightSteelBlue: #a2b5c8;
18
+
19
+ /* Tag colors */
20
+ --tag-white: #eef5fc;
21
+ --green-tag-dark: #29a36a;
22
+ --green-tag-light: #daf6e9;
23
+ --red-tag-dark: #e15151;
24
+ --red-tag-light: #fdf2f2;
25
+ --blue-tag-dark: #1985e8;
26
+ --blue-tag-light: #daebfb;
27
+ --gris-clair: #dee8f2;
28
+
29
+ /* Actions */
30
+ --actions-valid: #29a36a;
31
+ --actions-error: #e15151;
32
+
33
+ /* Background */
34
+ --background-pro: #fcfdfd;
35
+ --background-usager: #ffffff;
36
+ }
37
+
38
+ .bgBleuAllaw {
39
+ background-color: var(--bleu-allaw);
40
+ }
41
+
42
+ .textMidGrey {
43
+ color: var(--mid-grey);
44
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "1.0.124",
3
+ "version": "1.0.126",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,77 +0,0 @@
1
- @import "../../../styles/colors.css";
2
-
3
- .heading {
4
- font-family: Poppins;
5
- font-style: normal;
6
- line-height: normal;
7
- }
8
-
9
- .heading.h1 {
10
- font-size: 60px;
11
- font-weight: 600;
12
- letter-spacing: 0.5px;
13
- }
14
-
15
- .heading.h2 {
16
- font-size: 36px;
17
- font-weight: 600;
18
- letter-spacing: 0.38px;
19
- }
20
-
21
- .heading.h3 {
22
- font-size: 28px;
23
- font-weight: 600;
24
- letter-spacing: 0.28px;
25
- }
26
-
27
- .heading.h4 {
28
- font-size: 24px;
29
- font-weight: 600;
30
- }
31
-
32
- .heading.h5 {
33
- font-size: 24px;
34
- font-weight: 500;
35
- }
36
-
37
- .heading.h6 {
38
- font-size: 18px;
39
- font-weight: 600;
40
- }
41
-
42
- .heading.h7 {
43
- font-size: 14px;
44
- font-weight: 600;
45
- }
46
-
47
- .heading.color-bleu-allaw {
48
- color: var(--bleu-allaw);
49
- }
50
-
51
- .heading.color-mid-grey {
52
- color: var(--mid-grey);
53
- }
54
-
55
- .heading.color-dark-grey {
56
- color: var(--dark-grey);
57
- }
58
-
59
- .heading.color-noir {
60
- color: var(--noir);
61
- }
62
-
63
- .heading.color-pure-white {
64
- color: var(--pure-white);
65
- }
66
-
67
- .heading.align-left {
68
- text-align: left;
69
- }
70
-
71
- .heading.align-justify {
72
- text-align: justify;
73
- }
74
-
75
- .heading.align-center {
76
- text-align: center;
77
- }
@@ -1,43 +0,0 @@
1
- .blogContainerTop {
2
- display: flex;
3
- width: 1000px;
4
- max-width: 1000px;
5
- flex-direction: column;
6
- align-items: flex-start;
7
- gap: 23px;
8
- }
9
-
10
- .blogInfoContainer {
11
- display: flex;
12
- flex-direction: row;
13
- align-items: center;
14
- justify-content: flex-start;
15
- gap: 23px;
16
- width: auto;
17
- height: auto;
18
- flex-wrap: nowrap;
19
- }
20
-
21
- .blogContainerBottom {
22
- display: flex;
23
- max-width: 1000px;
24
- flex-direction: column;
25
- align-items: flex-start;
26
- gap: 20px;
27
- }
28
-
29
- .blogImageContainer {
30
- align-self: stretch;
31
- background: #D9D9D9;
32
- object-fit: cover;
33
- }
34
-
35
- .timeToReadContainer {
36
- display: flex;
37
- align-items: center;
38
- gap: 8px;
39
- }
40
-
41
- .timeToReadContainer svg {
42
- flex-shrink: 0;
43
- }
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import "./BlogTextBlock.css";
3
- export type BlogTextBlockProps = {
4
- Title: string;
5
- Author: string;
6
- Date: Date;
7
- TimeToRead: string;
8
- Profession: "Avocat" | "Notaire" | "Commissaire de justice";
9
- ImageBlog: string;
10
- };
11
- declare function BlogTextBlock({ Title, Date, TimeToRead, Profession, ImageBlog }: BlogTextBlockProps): React.JSX.Element;
12
- export default BlogTextBlock;
@@ -1,30 +0,0 @@
1
- import React from "react";
2
- import { Heading, TinyInfo } from "../../atoms/typography";
3
- import Image from "next/image";
4
- import "./BlogTextBlock.css";
5
- function BlogTextBlock(_a) {
6
- var Title = _a.Title, Date = _a.Date, TimeToRead = _a.TimeToRead, Profession = _a.Profession, ImageBlog = _a.ImageBlog;
7
- return (React.createElement(React.Fragment, null,
8
- React.createElement("div", { className: "blogContainer" },
9
- React.createElement("div", { className: "blogContainerTop" },
10
- React.createElement(Heading, { text: Title, variant: "h2", color: "noir", align: "left" }),
11
- React.createElement("div", { className: "blogInfoContainer" },
12
- React.createElement(TinyInfo, { variant: "medium12", text: Date.toLocaleDateString(), color: "dark-grey" }),
13
- React.createElement("div", { className: "timeToReadContainer" },
14
- React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" },
15
- React.createElement("g", { clipPath: "url(#clip0_9957_3676)" },
16
- React.createElement("path", { d: "M7.00033 12.8332C10.222 12.8332 12.8337 10.2215 12.8337 6.99984C12.8337 3.77818 10.222 1.1665 7.00033 1.1665C3.77866 1.1665 1.16699 3.77818 1.16699 6.99984C1.16699 10.2215 3.77866 12.8332 7.00033 12.8332Z", stroke: "#25BEEB", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
17
- React.createElement("path", { d: "M7 3.5V7L9.33333 8.16667", stroke: "#25BEEB", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
18
- React.createElement("defs", null,
19
- React.createElement("clipPath", { id: "clip0_9957_3676" },
20
- React.createElement("rect", { width: "14", height: "14", fill: "white" })))),
21
- React.createElement(TinyInfo, { variant: "medium12", text: TimeToRead, color: "dark-grey" })),
22
- React.createElement(TinyInfo, { variant: "medium12", text: Profession, color: "dark-grey" })),
23
- React.createElement("div", { className: "blogImageContainer" },
24
- React.createElement(Image, { src: ImageBlog, alt: "Image de fond d'un article de blog", width: 1000, height: 449 }))),
25
- React.createElement("div", { className: "blogContainerBottom" })),
26
- React.createElement("div", { className: "blogImageContainer" },
27
- React.createElement(Image, { src: ImageBlog, alt: "Image de fond d'un article de blog", width: 1000, height: 449 })),
28
- React.createElement("div", { className: "blogContainerBottom" })));
29
- }
30
- export default BlogTextBlock;