allaw-ui 2.9.6 → 2.9.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.
@@ -8,6 +8,8 @@ export interface LinkProps {
8
8
  size?: "default" | "small";
9
9
  className?: string;
10
10
  onClick?: () => void;
11
+ isUnderline?: boolean;
12
+ hasHoverColor?: boolean;
11
13
  }
12
14
  declare const Link: React.FC<LinkProps>;
13
15
  export default Link;
@@ -13,7 +13,7 @@ import React from "react";
13
13
  import styles from "./Link.module.css";
14
14
  import { convertToHtml } from "../../../utils/utils";
15
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;
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, _c = _a.isUnderline, isUnderline = _c === void 0 ? false : _c, _d = _a.hasHoverColor, hasHoverColor = _d === void 0 ? false : _d;
17
17
  var truncateText = function (text, maxChars) {
18
18
  if (text.length <= maxChars)
19
19
  return text;
@@ -23,7 +23,7 @@ var Link = function (_a) {
23
23
  var truncatedText = maxChars ? truncateText(htmlText, maxChars) : htmlText;
24
24
  var isClickable = typeof onClick === "function";
25
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
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], " ").concat(isUnderline ? styles.underline : "", " ").concat(hasHoverColor ? styles.hoverColor : ""), style: __assign({ whiteSpace: "pre-line" }, (maxLines
27
27
  ? {
28
28
  WebkitLineClamp: maxLines,
29
29
  display: "-webkit-box",
@@ -58,3 +58,20 @@
58
58
  .pointer:hover {
59
59
  cursor: pointer;
60
60
  }
61
+
62
+ .underline:hover {
63
+ text-decoration: underline;
64
+ text-underline-offset: 5px;
65
+ text-decoration-thickness: 1px;
66
+ }
67
+
68
+ .hoverColor:hover {
69
+ color: var(--bleu-allaw, #25beeb) !important;
70
+ }
71
+
72
+ .hoverColor.underline:hover {
73
+ text-decoration: underline;
74
+ text-decoration-color: var(--bleu-allaw, #25beeb);
75
+ text-underline-offset: 7px;
76
+ text-decoration-thickness: 1px;
77
+ }
@@ -31,6 +31,17 @@ declare namespace _default {
31
31
  }
32
32
  export { control_3 as control };
33
33
  }
34
+ namespace isUnderline {
35
+ let control_4: string;
36
+ export { control_4 as control };
37
+ export let description: string;
38
+ }
39
+ namespace hasHoverColor {
40
+ let control_5: string;
41
+ export { control_5 as control };
42
+ let description_1: string;
43
+ export { description_1 as description };
44
+ }
34
45
  namespace onClick {
35
46
  let action: string;
36
47
  }
@@ -54,4 +65,8 @@ export const BoldSmall: any;
54
65
  export const SemiBoldSmall: any;
55
66
  export const MediumSmall: any;
56
67
  export const ClickableLink: any;
68
+ export const UnderlinedLink: any;
69
+ export const ClickableUnderlinedLink: any;
70
+ export const HoverColorLink: any;
71
+ export const HoverColorUnderlinedLink: any;
57
72
  import Link from "./Link";
@@ -38,6 +38,14 @@ export default {
38
38
  options: ["default", "small"],
39
39
  },
40
40
  },
41
+ isUnderline: {
42
+ control: "boolean",
43
+ description: "Ajoute un soulignement au survol",
44
+ },
45
+ hasHoverColor: {
46
+ control: "boolean",
47
+ description: "Change la couleur du texte en bleu au survol",
48
+ },
41
49
  onClick: { action: "clicked" },
42
50
  },
43
51
  parameters: {
@@ -59,6 +67,8 @@ Bold.args = {
59
67
  color: "noir",
60
68
  text: "Open Sans - Bold - 16px",
61
69
  size: "default",
70
+ isUnderline: false,
71
+ hasHoverColor: false,
62
72
  };
63
73
  export var SemiBold = Template.bind({});
64
74
  SemiBold.args = {
@@ -66,6 +76,8 @@ SemiBold.args = {
66
76
  color: "noir",
67
77
  text: "Open Sans - SemiBold - 16px",
68
78
  size: "default",
79
+ isUnderline: false,
80
+ hasHoverColor: false,
69
81
  };
70
82
  export var Medium = Template.bind({});
71
83
  Medium.args = {
@@ -73,6 +85,8 @@ Medium.args = {
73
85
  color: "noir",
74
86
  text: "Open Sans - Medium - 16px",
75
87
  size: "default",
88
+ isUnderline: false,
89
+ hasHoverColor: false,
76
90
  };
77
91
  export var BoldSmall = Template.bind({});
78
92
  BoldSmall.args = {
@@ -80,6 +94,8 @@ BoldSmall.args = {
80
94
  color: "noir",
81
95
  text: "Open Sans - Bold - 12px",
82
96
  size: "small",
97
+ isUnderline: false,
98
+ hasHoverColor: false,
83
99
  };
84
100
  export var SemiBoldSmall = Template.bind({});
85
101
  SemiBoldSmall.args = {
@@ -87,6 +103,8 @@ SemiBoldSmall.args = {
87
103
  color: "noir",
88
104
  text: "Open Sans - SemiBold - 12px",
89
105
  size: "small",
106
+ isUnderline: false,
107
+ hasHoverColor: false,
90
108
  };
91
109
  export var MediumSmall = Template.bind({});
92
110
  MediumSmall.args = {
@@ -94,6 +112,8 @@ MediumSmall.args = {
94
112
  color: "noir",
95
113
  text: "Open Sans - Medium - 12px",
96
114
  size: "small",
115
+ isUnderline: false,
116
+ hasHoverColor: false,
97
117
  };
98
118
  export var ClickableLink = Template.bind({});
99
119
  ClickableLink.args = {
@@ -102,4 +122,43 @@ ClickableLink.args = {
102
122
  text: "Cliquez sur moi",
103
123
  size: "small",
104
124
  onClick: function () { return console.log("Linke cliqué"); },
125
+ isUnderline: false,
126
+ hasHoverColor: false,
127
+ };
128
+ export var UnderlinedLink = Template.bind({});
129
+ UnderlinedLink.args = {
130
+ variant: "semiBold",
131
+ color: "bleu-allaw",
132
+ text: "Survolez-moi pour voir le soulignement",
133
+ size: "default",
134
+ isUnderline: true,
135
+ hasHoverColor: false,
136
+ };
137
+ export var ClickableUnderlinedLink = Template.bind({});
138
+ ClickableUnderlinedLink.args = {
139
+ variant: "semiBold",
140
+ color: "bleu-allaw",
141
+ text: "Cliquez et survolez-moi",
142
+ size: "small",
143
+ onClick: function () { return console.log("Lien cliqué"); },
144
+ isUnderline: true,
145
+ hasHoverColor: false,
146
+ };
147
+ export var HoverColorLink = Template.bind({});
148
+ HoverColorLink.args = {
149
+ variant: "semiBold",
150
+ color: "mid-grey",
151
+ text: "Survolez-moi pour changer la couleur",
152
+ size: "default",
153
+ isUnderline: false,
154
+ hasHoverColor: true,
155
+ };
156
+ export var HoverColorUnderlinedLink = Template.bind({});
157
+ HoverColorUnderlinedLink.args = {
158
+ variant: "semiBold",
159
+ color: "dark-grey",
160
+ text: "Survolez-moi pour changer la couleur et voir le soulignement",
161
+ size: "default",
162
+ isUnderline: true,
163
+ hasHoverColor: true,
105
164
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "2.9.6",
3
+ "version": "2.9.8",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",