allaw-ui 1.0.11 → 1.0.12

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.
@@ -68,10 +68,25 @@
68
68
  .progress-bar-fill {
69
69
  height: 8px;
70
70
  border-radius: 8px;
71
- background: var(--primary-blue, #25beeb);
72
71
  transition: width 0.35s ease;
73
72
  }
74
73
 
74
+ .progress-bar-fill-blue {
75
+ background: var(--primary-blue, #25beeb);
76
+ }
77
+
78
+ .progress-bar-fill-red {
79
+ background: var(--actions-error, #e15151);
80
+ }
81
+
82
+ .progress-bar-fill-green {
83
+ background: var(--actions-valid, #29a36a);
84
+ }
85
+
86
+ .progress-bar-fill-grey {
87
+ background: var(--mid-grey, #728ea7);
88
+ }
89
+
75
90
  .progress-bar-close {
76
91
  display: flex;
77
92
  flex-direction: row;
@@ -79,7 +94,6 @@
79
94
  align-items: center;
80
95
  width: 32px;
81
96
  height: 32px;
82
- /* padding: 5px; */
83
97
  padding-right: 2px;
84
98
  flex-shrink: 0;
85
99
  cursor: pointer;
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import "./ProgressBar.css";
3
3
  import "../../../styles/global.css";
4
4
  import "../../../styles/icons.css";
5
+ export type BarColor = "blue" | "red" | "green" | "grey";
5
6
  export interface ProgressBarProps {
6
7
  steps: number;
7
8
  currentStep: number;
@@ -10,6 +11,7 @@ export interface ProgressBarProps {
10
11
  onStartIconClick?: () => void;
11
12
  onEndIconClick?: () => void;
12
13
  showProgressBar?: boolean;
14
+ barColor?: BarColor;
13
15
  }
14
16
  declare const ProgressBar: React.FC<ProgressBarProps>;
15
17
  export default ProgressBar;
@@ -3,7 +3,7 @@ import "./ProgressBar.css";
3
3
  import "../../../styles/global.css";
4
4
  import "../../../styles/icons.css";
5
5
  var ProgressBar = function (_a) {
6
- var steps = _a.steps, currentStep = _a.currentStep, _b = _a.startIcon, startIcon = _b === void 0 ? true : _b, _c = _a.endIcon, endIcon = _c === void 0 ? true : _c, onStartIconClick = _a.onStartIconClick, onEndIconClick = _a.onEndIconClick, _d = _a.showProgressBar, showProgressBar = _d === void 0 ? true : _d;
6
+ var steps = _a.steps, currentStep = _a.currentStep, _b = _a.startIcon, startIcon = _b === void 0 ? true : _b, _c = _a.endIcon, endIcon = _c === void 0 ? true : _c, onStartIconClick = _a.onStartIconClick, onEndIconClick = _a.onEndIconClick, _d = _a.showProgressBar, showProgressBar = _d === void 0 ? true : _d, _e = _a.barColor, barColor = _e === void 0 ? "blue" : _e;
7
7
  var constrainedCurrentStep = Math.max(0, Math.min(currentStep, steps));
8
8
  var progressWidth = constrainedCurrentStep === 0 ? 0 : (constrainedCurrentStep / steps) * 100;
9
9
  return (React.createElement("div", { className: "progress-bar-container" },
@@ -11,7 +11,7 @@ var ProgressBar = function (_a) {
11
11
  React.createElement("button", { className: "progress-bar-chevron", onClick: onStartIconClick },
12
12
  React.createElement("i", { className: "allaw-icon-chevron-left" })))) : null,
13
13
  React.createElement("div", { className: "progress-bar-background ".concat(showProgressBar ? "" : "hidden-content") },
14
- React.createElement("div", { className: "progress-bar-fill", style: { width: "".concat(progressWidth, "%") } })),
14
+ React.createElement("div", { className: "progress-bar-fill progress-bar-fill-".concat(barColor), style: { width: "".concat(progressWidth, "%") } })),
15
15
  endIcon && (React.createElement("button", { className: "progress-bar-close", onClick: onEndIconClick },
16
16
  React.createElement("i", { className: "allaw-icon-close" })))));
17
17
  };
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import "./CaseCard.css";
3
+ import { BarColor } from "../../atoms/progressBars/ProgressBar";
3
4
  export interface CaseCardProps {
4
5
  clientName: string;
5
6
  title: string;
@@ -10,10 +11,10 @@ export interface CaseCardProps {
10
11
  categories: string[];
11
12
  variant: "desktop" | "mobile" | "archived";
12
13
  categoryLabelLimit?: number;
13
- isClosed?: boolean;
14
14
  isDisabled?: boolean;
15
15
  dateStyle?: "horizontal" | "hybride" | "vertical";
16
16
  dateLabel?: string;
17
+ barColor?: BarColor;
17
18
  }
18
19
  declare const CaseCard: React.FC<CaseCardProps>;
19
20
  export default CaseCard;
@@ -4,14 +4,14 @@ import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
4
4
  import CardDate from "../../atoms/typography/CardDate";
5
5
  import ProgressBar from "../../atoms/progressBars/ProgressBar";
6
6
  var CaseCard = function (_a) {
7
- var clientName = _a.clientName, title = _a.title, nextAppointment = _a.nextAppointment, categories = _a.categories, variant = _a.variant, _b = _a.categoryLabelLimit, categoryLabelLimit = _b === void 0 ? 20 : _b, _c = _a.isClosed, isClosed = _c === void 0 ? false : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.dateStyle, dateStyle = _e === void 0 ? "hybride" : _e, dateLabel = _a.dateLabel;
7
+ var clientName = _a.clientName, title = _a.title, nextAppointment = _a.nextAppointment, categories = _a.categories, variant = _a.variant, _b = _a.categoryLabelLimit, categoryLabelLimit = _b === void 0 ? 20 : _b, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.dateStyle, dateStyle = _d === void 0 ? "hybride" : _d, dateLabel = _a.dateLabel, _e = _a.barColor, barColor = _e === void 0 ? "blue" : _e;
8
8
  return (React.createElement("div", { className: "case-card-wrapper case-card-".concat(variant) },
9
9
  React.createElement("div", { className: "case-card-content" },
10
10
  React.createElement("div", { className: "case-card-header" },
11
- React.createElement("h2", { className: "case-card-title ".concat(isClosed ? "closed" : ""), title: title }, title),
11
+ React.createElement("h2", { className: "case-card-title ".concat(isDisabled ? "closed" : ""), title: title }, title),
12
12
  React.createElement("span", { className: "case-card-client-name" }, clientName)),
13
13
  React.createElement("div", { className: "case-card-progress-bar" },
14
- React.createElement(ProgressBar, { startIcon: false, endIcon: false, steps: 100, currentStep: 50 })),
14
+ React.createElement(ProgressBar, { startIcon: false, endIcon: false, steps: 100, currentStep: 50, barColor: barColor })),
15
15
  React.createElement("div", { className: "case-card-categories" }, categories.map(function (category, index) { return (React.createElement(OtherStatusTag, { key: index, label: category, type: "readonly", labelLimit: categoryLabelLimit })); }))),
16
16
  nextAppointment && variant !== "archived" && (React.createElement("div", { className: "case-card-next-appointment" },
17
17
  React.createElement(CardDate, { date: nextAppointment.date, showYear: variant === "desktop", variant: dateStyle, label: dateLabel, isDisabled: isDisabled })))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",