allaw-ui 1.0.166 → 1.0.169
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/atoms/selects/SelectableListItem.module.css +1 -1
- package/dist/components/atoms/typography/Link.d.ts +13 -0
- package/dist/components/atoms/typography/Link.js +35 -0
- package/dist/components/atoms/typography/Link.module.css +60 -0
- package/dist/components/atoms/typography/Link.stories.d.ts +57 -0
- package/dist/components/atoms/typography/Link.stories.js +105 -0
- package/dist/components/atoms/typography/Paragraph.d.ts +1 -0
- package/dist/components/atoms/typography/Paragraph.js +2 -2
- package/dist/components/atoms/typography/Paragraph.stories.d.ts +3 -0
- package/dist/components/atoms/typography/Paragraph.stories.js +1 -0
- package/dist/components/atoms/typography/index.d.ts +2 -0
- package/dist/components/atoms/typography/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styles/colors.module.css +107 -44
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface LinkProps {
|
|
3
|
+
variant: "bold" | "semiBold" | "medium";
|
|
4
|
+
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "grey-venom" | "venom-grey-dark";
|
|
5
|
+
text: React.ReactNode;
|
|
6
|
+
maxLines?: number;
|
|
7
|
+
maxChars?: number;
|
|
8
|
+
size?: "default" | "small";
|
|
9
|
+
className?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Link: React.FC<LinkProps>;
|
|
13
|
+
export default Link;
|
|
@@ -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 React from "react";
|
|
13
|
+
import styles from "./Link.module.css";
|
|
14
|
+
import { convertToHtml } from "../../../utils/utils";
|
|
15
|
+
var Link = function (_a) {
|
|
16
|
+
var variant = _a.variant, color = _a.color, text = _a.text, maxLines = _a.maxLines, maxChars = _a.maxChars, _b = _a.size, size = _b === void 0 ? "default" : _b, className = _a.className, onClick = _a.onClick;
|
|
17
|
+
var truncateText = function (text, maxChars) {
|
|
18
|
+
if (text.length <= maxChars)
|
|
19
|
+
return text;
|
|
20
|
+
return text.slice(0, maxChars) + "...";
|
|
21
|
+
};
|
|
22
|
+
var htmlText = convertToHtml(text);
|
|
23
|
+
var truncatedText = maxChars ? truncateText(htmlText, maxChars) : htmlText;
|
|
24
|
+
var isClickable = typeof onClick === "function";
|
|
25
|
+
var colorClassName = color ? "color-".concat(color) : "";
|
|
26
|
+
return (React.createElement("div", { className: "".concat(styles.link, " ").concat(styles[variant], " ").concat(size === "small" ? styles["link-small"] : "", " ").concat(className || "", " ").concat(isClickable ? styles.pointer : "", " ").concat(styles[colorClassName]), style: __assign({ whiteSpace: "pre-line" }, (maxLines
|
|
27
|
+
? {
|
|
28
|
+
WebkitLineClamp: maxLines,
|
|
29
|
+
display: "-webkit-box",
|
|
30
|
+
WebkitBoxOrient: "vertical",
|
|
31
|
+
overflow: "hidden",
|
|
32
|
+
}
|
|
33
|
+
: {})), onClick: onClick, dangerouslySetInnerHTML: { __html: truncatedText } }));
|
|
34
|
+
};
|
|
35
|
+
export default Link;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@import "../../../styles/colors.module.css";
|
|
2
|
+
|
|
3
|
+
.link {
|
|
4
|
+
font-family: "Open Sans", sans-serif;
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-size: 1rem;
|
|
7
|
+
line-height: normal;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.link-small {
|
|
11
|
+
font-size: 0.875rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.link.bold {
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.link.semiBold {
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.link.medium {
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.link.color-bleu-allaw {
|
|
27
|
+
color: var(--bleu-allaw);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.link.color-mid-grey {
|
|
31
|
+
color: var(--mid-grey);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.link.color-dark-grey {
|
|
35
|
+
color: var(--dark-grey);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.link.color-noir {
|
|
39
|
+
color: var(--noir);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.link.color-pure-white {
|
|
43
|
+
color: var(--pure-white);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.link.color-grey-venom {
|
|
47
|
+
color: var(--grey-venom);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.link.color-venom-grey-dark {
|
|
51
|
+
color: var(--venom-grey-dark);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.pointer {
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.pointer:hover {
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { Link as component };
|
|
4
|
+
export let tags: string[];
|
|
5
|
+
export namespace argTypes {
|
|
6
|
+
namespace variant {
|
|
7
|
+
namespace control {
|
|
8
|
+
let type: string;
|
|
9
|
+
let options: string[];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
namespace color {
|
|
13
|
+
export namespace control_1 {
|
|
14
|
+
let type_1: string;
|
|
15
|
+
export { type_1 as type };
|
|
16
|
+
let options_1: string[];
|
|
17
|
+
export { options_1 as options };
|
|
18
|
+
}
|
|
19
|
+
export { control_1 as control };
|
|
20
|
+
}
|
|
21
|
+
namespace text {
|
|
22
|
+
let control_2: string;
|
|
23
|
+
export { control_2 as control };
|
|
24
|
+
}
|
|
25
|
+
namespace size {
|
|
26
|
+
export namespace control_3 {
|
|
27
|
+
let type_2: string;
|
|
28
|
+
export { type_2 as type };
|
|
29
|
+
let options_2: string[];
|
|
30
|
+
export { options_2 as options };
|
|
31
|
+
}
|
|
32
|
+
export { control_3 as control };
|
|
33
|
+
}
|
|
34
|
+
namespace onClick {
|
|
35
|
+
let action: string;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export namespace parameters {
|
|
39
|
+
namespace backgrounds {
|
|
40
|
+
let _default: string;
|
|
41
|
+
export { _default as default };
|
|
42
|
+
export let values: {
|
|
43
|
+
name: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}[];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default _default;
|
|
50
|
+
export const Bold: any;
|
|
51
|
+
export const SemiBold: any;
|
|
52
|
+
export const Medium: any;
|
|
53
|
+
export const BoldSmall: any;
|
|
54
|
+
export const SemiBoldSmall: any;
|
|
55
|
+
export const MediumSmall: any;
|
|
56
|
+
export const ClickableLink: any;
|
|
57
|
+
import Link from "./Link";
|
|
@@ -0,0 +1,105 @@
|
|
|
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 Link from "./Link";
|
|
14
|
+
import "../../../styles/global.css";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/UI-Variables/Typography/Link",
|
|
17
|
+
component: Link,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
argTypes: {
|
|
20
|
+
variant: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "select",
|
|
23
|
+
options: ["bold", "semiBold", "medium"],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
color: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "select",
|
|
29
|
+
options: ["bleu-allaw", "mid-grey", "dark-grey", "noir", "pure-white"],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
text: {
|
|
33
|
+
control: "text",
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
control: {
|
|
37
|
+
type: "select",
|
|
38
|
+
options: ["default", "small"],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
onClick: { action: "clicked" },
|
|
42
|
+
},
|
|
43
|
+
parameters: {
|
|
44
|
+
backgrounds: {
|
|
45
|
+
default: "light",
|
|
46
|
+
values: [
|
|
47
|
+
{ name: "light", value: "#ffffff" },
|
|
48
|
+
{ name: "grey", value: "#728ea7" },
|
|
49
|
+
{ name: "figma", value: "#404040" },
|
|
50
|
+
{ name: "dark", value: "#171e25" },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
var Template = function (args) { return React.createElement(Link, __assign({}, args)); };
|
|
56
|
+
export var Bold = Template.bind({});
|
|
57
|
+
Bold.args = {
|
|
58
|
+
variant: "bold",
|
|
59
|
+
color: "noir",
|
|
60
|
+
text: "Open Sans - Bold - 16px",
|
|
61
|
+
size: "default",
|
|
62
|
+
};
|
|
63
|
+
export var SemiBold = Template.bind({});
|
|
64
|
+
SemiBold.args = {
|
|
65
|
+
variant: "semiBold",
|
|
66
|
+
color: "noir",
|
|
67
|
+
text: "Open Sans - SemiBold - 16px",
|
|
68
|
+
size: "default",
|
|
69
|
+
};
|
|
70
|
+
export var Medium = Template.bind({});
|
|
71
|
+
Medium.args = {
|
|
72
|
+
variant: "medium",
|
|
73
|
+
color: "noir",
|
|
74
|
+
text: "Open Sans - Medium - 16px",
|
|
75
|
+
size: "default",
|
|
76
|
+
};
|
|
77
|
+
export var BoldSmall = Template.bind({});
|
|
78
|
+
BoldSmall.args = {
|
|
79
|
+
variant: "bold",
|
|
80
|
+
color: "noir",
|
|
81
|
+
text: "Open Sans - Bold - 12px",
|
|
82
|
+
size: "small",
|
|
83
|
+
};
|
|
84
|
+
export var SemiBoldSmall = Template.bind({});
|
|
85
|
+
SemiBoldSmall.args = {
|
|
86
|
+
variant: "semiBold",
|
|
87
|
+
color: "noir",
|
|
88
|
+
text: "Open Sans - SemiBold - 12px",
|
|
89
|
+
size: "small",
|
|
90
|
+
};
|
|
91
|
+
export var MediumSmall = Template.bind({});
|
|
92
|
+
MediumSmall.args = {
|
|
93
|
+
variant: "medium",
|
|
94
|
+
color: "noir",
|
|
95
|
+
text: "Open Sans - Medium - 12px",
|
|
96
|
+
size: "small",
|
|
97
|
+
};
|
|
98
|
+
export var ClickableLink = Template.bind({});
|
|
99
|
+
ClickableLink.args = {
|
|
100
|
+
variant: "semiBold",
|
|
101
|
+
color: "bleu-allaw",
|
|
102
|
+
text: "Cliquez sur moi",
|
|
103
|
+
size: "small",
|
|
104
|
+
onClick: function () { return console.log("Linke cliqué"); },
|
|
105
|
+
};
|
|
@@ -13,7 +13,7 @@ import React from "react";
|
|
|
13
13
|
import "./Paragraph.css";
|
|
14
14
|
import { convertToHtml } from "../../../utils/utils";
|
|
15
15
|
var Paragraph = function (_a) {
|
|
16
|
-
var variant = _a.variant, color = _a.color, text = _a.text, maxLines = _a.maxLines, maxChars = _a.maxChars, _b = _a.size, size = _b === void 0 ? "default" : _b, className = _a.className;
|
|
16
|
+
var variant = _a.variant, color = _a.color, text = _a.text, maxLines = _a.maxLines, maxChars = _a.maxChars, _b = _a.size, size = _b === void 0 ? "default" : _b, className = _a.className, onClick = _a.onClick;
|
|
17
17
|
var truncateText = function (text, maxChars) {
|
|
18
18
|
if (text.length <= maxChars)
|
|
19
19
|
return text;
|
|
@@ -28,6 +28,6 @@ var Paragraph = function (_a) {
|
|
|
28
28
|
WebkitBoxOrient: "vertical",
|
|
29
29
|
overflow: "hidden",
|
|
30
30
|
}
|
|
31
|
-
: {})), dangerouslySetInnerHTML: { __html: truncatedText } }));
|
|
31
|
+
: {})), onClick: onClick, dangerouslySetInnerHTML: { __html: truncatedText } }));
|
|
32
32
|
};
|
|
33
33
|
export default Paragraph;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { default as Heading } from "./Heading";
|
|
2
2
|
export { default as Paragraph } from "./Paragraph";
|
|
3
|
+
export { default as Link } from "./Link";
|
|
3
4
|
export { default as SmallTitle } from "./SmallTitle";
|
|
4
5
|
export { default as Subtitle } from "./Subtitle";
|
|
5
6
|
export { default as TinyInfo } from "./TinyInfo";
|
|
6
7
|
export type { HeadingProps } from "./Heading";
|
|
7
8
|
export type { ParagraphProps } from "./Paragraph";
|
|
9
|
+
export type { LinkProps } from "./Link";
|
|
8
10
|
export type { SmallTitleProps } from "./SmallTitle";
|
|
9
11
|
export type { SubtitleProps } from "./Subtitle";
|
|
10
12
|
export type { TinyInfoProps } from "./TinyInfo";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Heading } from "./Heading";
|
|
2
2
|
export { default as Paragraph } from "./Paragraph";
|
|
3
|
+
export { default as Link } from "./Link";
|
|
3
4
|
export { default as SmallTitle } from "./SmallTitle";
|
|
4
5
|
export { default as Subtitle } from "./Subtitle";
|
|
5
6
|
export { default as TinyInfo } from "./TinyInfo";
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export { default as FolderStatusTag } from "./components/atoms/tags/FolderStatus
|
|
|
33
33
|
export { default as OtherStatusTag } from "./components/atoms/tags/OtherStatusTag";
|
|
34
34
|
export { default as Heading } from "./components/atoms/typography/Heading";
|
|
35
35
|
export { default as Paragraph } from "./components/atoms/typography/Paragraph";
|
|
36
|
+
export { default as Link } from "./components/atoms/typography/Link";
|
|
36
37
|
export { default as SmallTitle } from "./components/atoms/typography/SmallTitle";
|
|
37
38
|
export { default as Subtitle } from "./components/atoms/typography/Subtitle";
|
|
38
39
|
export { default as TinyInfo } from "./components/atoms/typography/TinyInfo";
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ export { default as OtherStatusTag } from "./components/atoms/tags/OtherStatusTa
|
|
|
39
39
|
// Typography
|
|
40
40
|
export { default as Heading } from "./components/atoms/typography/Heading";
|
|
41
41
|
export { default as Paragraph } from "./components/atoms/typography/Paragraph";
|
|
42
|
+
export { default as Link } from "./components/atoms/typography/Link";
|
|
42
43
|
export { default as SmallTitle } from "./components/atoms/typography/SmallTitle";
|
|
43
44
|
export { default as Subtitle } from "./components/atoms/typography/Subtitle";
|
|
44
45
|
export { default as TinyInfo } from "./components/atoms/typography/TinyInfo";
|
|
@@ -1,44 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
.bgBleuAllaw {
|
|
2
|
+
background-color: var(--bleu-allaw);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.textMidGrey {
|
|
6
|
+
color: var(--mid-grey);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.bleuAllaw {
|
|
10
|
+
--bleu-allaw: #25beeb;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.midGrey {
|
|
14
|
+
--mid-grey: #728ea7;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.darkGrey {
|
|
18
|
+
--dark-grey: #456073;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.noir {
|
|
22
|
+
--noir: #171e25;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pureWhite {
|
|
26
|
+
--pure-white: #ffffff;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.greyVenom {
|
|
30
|
+
--grey-venom: #e6edf5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.venomGreyDark {
|
|
34
|
+
--venom-grey-dark: #d1dce8;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.greyLight {
|
|
38
|
+
--grey-light: #f6fcfe;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.greyLight2 {
|
|
42
|
+
--grey-light-2: #f2f8fc;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.activeGrey {
|
|
46
|
+
--active-grey: #e9eef5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.blueLightning {
|
|
50
|
+
--blue-lightning: #f6fcfe;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.fondDeSelection {
|
|
54
|
+
--fond-de-selection: #f6fcfe;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.lightSteelBlue {
|
|
58
|
+
--lightSteelBlue: #a2b5c8;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.tagWhite {
|
|
62
|
+
--tag-white: #eef5fc;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.greenTagDark {
|
|
66
|
+
--green-tag-dark: #29a36a;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.greenTagLight {
|
|
70
|
+
--green-tag-light: #daf6e9;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.redTagDark {
|
|
74
|
+
--red-tag-dark: #e15151;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.redTagLight {
|
|
78
|
+
--red-tag-light: #fdf2f2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.blueTagDark {
|
|
82
|
+
--blue-tag-dark: #1985e8;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.blueTagLight {
|
|
86
|
+
--blue-tag-light: #daebfb;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.grisClair {
|
|
90
|
+
--gris-clair: #dee8f2;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.actionsValid {
|
|
94
|
+
--actions-valid: #29a36a;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.actionsError {
|
|
98
|
+
--actions-error: #e15151;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.backgroundPro {
|
|
102
|
+
--background-pro: #fcfdfd;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.backgroundUsager {
|
|
106
|
+
--background-usager: #ffffff;
|
|
107
|
+
}
|