allaw-ui 0.0.338 → 0.0.339

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.
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import "./Checkbox.css";
3
3
  import "../../../styles/global.css";
4
4
  export interface CheckboxProps {
5
- id?: string;
6
5
  checked?: boolean;
7
6
  onChange?: (checked: boolean) => void;
8
7
  isWhite?: boolean;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import "./Checkbox.css";
3
3
  import "../../../styles/global.css";
4
4
  var Checkbox = function (_a) {
5
- var id = _a.id, _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.isWhite, isWhite = _c === void 0 ? false : _c;
5
+ var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.isWhite, isWhite = _c === void 0 ? false : _c;
6
6
  var handleClick = function (e) {
7
7
  e.preventDefault();
8
8
  e.stopPropagation();
@@ -10,6 +10,6 @@ var Checkbox = function (_a) {
10
10
  onChange(!checked);
11
11
  }
12
12
  };
13
- return (React.createElement("button", { id: id, className: "checkbox ".concat(checked ? "checkbox-pressed" : "checkbox-default", " ").concat(isWhite ? "checkbox-white" : "checkbox-black"), onClick: handleClick }, checked && (React.createElement("span", { className: "checkbox-icon allaw-icon-close ".concat(isWhite ? "checkbox-icon-white" : "checkbox-icon-black") }))));
13
+ return (React.createElement("button", { className: "checkbox ".concat(checked ? "checkbox-pressed" : "checkbox-default", " ").concat(isWhite ? "checkbox-white" : "checkbox-black"), onClick: handleClick }, checked && (React.createElement("span", { className: "checkbox-icon allaw-icon-close ".concat(isWhite ? "checkbox-icon-white" : "checkbox-icon-black") }))));
14
14
  };
15
15
  export default Checkbox;
@@ -3,7 +3,7 @@ import "./Paragraph.css";
3
3
  export interface ParagraphProps {
4
4
  variant: "bold" | "semiBold" | "medium";
5
5
  color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
6
- text: React.ReactNode;
6
+ text: string;
7
7
  maxLines?: number;
8
8
  maxChars?: number;
9
9
  }
@@ -9,9 +9,7 @@ var Paragraph = function (_a) {
9
9
  return text.slice(0, maxChars) + "...";
10
10
  };
11
11
  // Tronquer le texte si maxChars est défini
12
- var truncatedText = maxChars
13
- ? truncateText(text, maxChars)
14
- : text;
12
+ var truncatedText = maxChars ? truncateText(text, maxChars) : text;
15
13
  return (React.createElement("p", { className: "paragraph ".concat(variant, " ").concat(color ? "color-".concat(color) : ""), style: maxLines
16
14
  ? {
17
15
  WebkitLineClamp: maxLines,
@@ -19,6 +17,6 @@ var Paragraph = function (_a) {
19
17
  WebkitBoxOrient: "vertical",
20
18
  overflow: "hidden",
21
19
  }
22
- : {} }, truncatedText));
20
+ : {}, dangerouslySetInnerHTML: { __html: truncatedText } }));
23
21
  };
24
22
  export default Paragraph;
@@ -1,7 +1,7 @@
1
1
  .checkbox-form {
2
2
  display: flex;
3
3
  align-items: center;
4
- gap: 0.75rem;
4
+ gap: 8px;
5
5
  cursor: pointer;
6
6
  }
7
7
 
@@ -22,39 +22,3 @@
22
22
  .checkbox-form-required {
23
23
  color: var(--dark-grey, #456073);
24
24
  }
25
-
26
- .checkbox-form-link {
27
- color: var(--allaw-blue, #25beeb);
28
- text-decoration: underline;
29
- cursor: pointer;
30
- margin-left: 0.25rem;
31
- }
32
-
33
- /* Ajout des classes pour les différentes couleurs */
34
- .checkbox-form-bleu-allaw input[type="checkbox"] {
35
- accent-color: var(--bleu-allaw);
36
- }
37
-
38
- .checkbox-form-mid-grey input[type="checkbox"] {
39
- accent-color: var(--mid-grey);
40
- }
41
-
42
- .checkbox-form-dark-grey input[type="checkbox"] {
43
- accent-color: var(--dark-grey);
44
- }
45
-
46
- .checkbox-form-noir input[type="checkbox"] {
47
- accent-color: var(--noir);
48
- }
49
-
50
- .checkbox-form-pure-white input[type="checkbox"] {
51
- accent-color: var(--pure-white);
52
- }
53
-
54
- .checkbox-form-grey-venom input[type="checkbox"] {
55
- accent-color: var(--grey-venom);
56
- }
57
-
58
- .checkbox-form-venom-grey-dark input[type="checkbox"] {
59
- accent-color: var(--venom-grey-dark);
60
- }
@@ -1,15 +1,11 @@
1
1
  import React from "react";
2
- import { ParagraphProps } from "../../atoms/typography/Paragraph";
3
2
  import "./CheckboxForm.css";
4
3
  export interface CheckboxFormProps {
5
4
  checked?: boolean;
6
5
  onChange?: (checked: boolean) => void;
7
- labelColor?: ParagraphProps["color"] | "grey-venom" | "venom-grey-dark";
8
6
  isWhite?: boolean;
9
- label?: React.ReactNode;
7
+ label?: string;
10
8
  isRequired?: boolean;
11
- linkText?: string;
12
- linkUrl?: string;
13
9
  }
14
10
  declare const CheckboxForm: React.FC<CheckboxFormProps>;
15
11
  export default CheckboxForm;
@@ -3,24 +3,18 @@ import Checkbox from "../../atoms/checkboxes/Checkbox";
3
3
  import Paragraph from "../../atoms/typography/Paragraph";
4
4
  import "./CheckboxForm.css";
5
5
  var CheckboxForm = function (_a) {
6
- var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.labelColor, labelColor = _c === void 0 ? "noir" : _c, _d = _a.isWhite, isWhite = _d === void 0 ? false : _d, label = _a.label, _e = _a.isRequired, isRequired = _e === void 0 ? false : _e, linkText = _a.linkText, linkUrl = _a.linkUrl;
7
- var checkboxId = "checkbox-".concat(Math.random().toString(36).substr(2, 9));
8
- var handleLabelClick = function (e) {
6
+ var _b = _a.checked, checked = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.isWhite, isWhite = _c === void 0 ? false : _c, label = _a.label, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d;
7
+ var handleClick = function (e) {
8
+ e.preventDefault();
9
9
  e.stopPropagation();
10
10
  if (onChange) {
11
11
  onChange(!checked);
12
12
  }
13
13
  };
14
- // Convertir les couleurs supplémentaires en couleurs acceptées par Paragraph
15
- var paragraphColor = labelColor === "grey-venom" || labelColor === "venom-grey-dark"
16
- ? "noir"
17
- : labelColor;
18
- return (React.createElement("div", { className: "checkbox-form ".concat(isWhite ? "checkbox-form-white" : "checkbox-form-black", " checkbox-form-").concat(labelColor) },
19
- React.createElement(Checkbox, { id: checkboxId, checked: checked, onChange: onChange, isWhite: isWhite }),
20
- label && (React.createElement("div", { className: "checkbox-form-label-container", onClick: handleLabelClick },
21
- React.createElement(Paragraph, { variant: "semiBold", color: paragraphColor, text: React.createElement(React.Fragment, null,
22
- React.createElement("span", null, label),
23
- linkText && linkUrl && (React.createElement("a", { href: linkUrl, target: "_blank", rel: "noopener noreferrer", className: "checkbox-form-link", onClick: function (e) { return e.stopPropagation(); } }, linkText))) }),
14
+ return (React.createElement("div", { className: "checkbox-form ".concat(isWhite ? "checkbox-form-white" : "checkbox-form-black") },
15
+ React.createElement(Checkbox, { checked: checked, onChange: onChange, isWhite: isWhite }),
16
+ label && (React.createElement("div", { className: "checkbox-form-label-container", onClick: handleClick },
17
+ React.createElement(Paragraph, { variant: "semiBold", color: isWhite ? "pure-white" : "noir", text: label }),
24
18
  isRequired && (React.createElement("span", { className: "checkbox-form-required" },
25
19
  "\u00A0",
26
20
  "*"))))));
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export { default as TabNavigation } from "./components/atoms/buttons/TabNavigati
10
10
  export { default as TertiaryButton } from "./components/atoms/buttons/TertiaryButton";
11
11
  export { default as OAuthProviderButton } from "./components/atoms/buttons/OAuthProviderButton";
12
12
  export { default as Checkbox } from "./components/atoms/checkboxes/Checkbox";
13
+ export { default as Filter } from "./components/atoms/filter/Filter";
13
14
  export { default as Input } from "./components/atoms/inputs/Input";
14
15
  export type { InputProps, InputRef } from "./components/atoms/inputs/Input";
15
16
  export { default as SearchBar } from "./components/atoms/inputs/SearchBar";
package/dist/index.js CHANGED
@@ -13,6 +13,8 @@ export { default as TertiaryButton } from "./components/atoms/buttons/TertiaryBu
13
13
  export { default as OAuthProviderButton } from "./components/atoms/buttons/OAuthProviderButton";
14
14
  // Checkboxes
15
15
  export { default as Checkbox } from "./components/atoms/checkboxes/Checkbox";
16
+ // Checkboxes
17
+ export { default as Filter } from "./components/atoms/filter/Filter";
16
18
  // Inputs
17
19
  export { default as Input } from "./components/atoms/inputs/Input";
18
20
  export { default as SearchBar } from "./components/atoms/inputs/SearchBar";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "0.0.338",
3
+ "version": "0.0.339",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",