allaw-ui 4.5.5 → 4.5.6

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.
@@ -6,14 +6,15 @@ import styles from "./SelectableListItem.module.css";
6
6
  var SelectableListItem = function (_a) {
7
7
  var label = _a.label, duration = _a.duration, price = _a.price, isActive = _a.isActive, onClick = _a.onClick, icon = _a.icon, testIdKey = _a.testIdKey;
8
8
  var hasIcon = icon && icon.length > 0;
9
- return (React.createElement("button", { className: "".concat(styles.container, " ").concat(isActive ? styles.active : "", " ").concat(hasIcon ? styles.withIcon : ""), onClick: onClick, "data-testid": "item-".concat(testIdKey !== undefined ? testIdKey : slugify(label)) },
9
+ var hasContent = (duration && duration.trim()) || (price && price.trim());
10
+ return (React.createElement("button", { className: "".concat(styles.container, " ").concat(isActive ? styles.active : "", " ").concat(hasIcon ? styles.withIcon : "", " ").concat(!hasContent ? styles.noContent : ""), onClick: onClick, "data-testid": "item-".concat(testIdKey !== undefined ? testIdKey : slugify(label)) },
10
11
  React.createElement("div", { className: styles.iconContainer }, isActive && React.createElement("span", { className: styles.activeIcon })),
11
12
  hasIcon && (React.createElement("div", { className: styles.iconWrapper },
12
13
  React.createElement("i", { className: "".concat(icon, " ").concat(styles.icon) }))),
13
14
  React.createElement("div", { className: styles.content },
14
15
  React.createElement("span", { className: styles.label }, label)),
15
- React.createElement("div", { className: styles.columnsWrapper },
16
+ hasContent && (React.createElement("div", { className: styles.columnsWrapper },
16
17
  duration && React.createElement("span", { className: styles.duration }, duration),
17
- price && React.createElement("span", { className: styles.price }, price))));
18
+ price && React.createElement("span", { className: styles.price }, price)))));
18
19
  };
19
20
  export default SelectableListItem;
@@ -131,6 +131,14 @@
131
131
  margin-bottom: 8px;
132
132
  }
133
133
 
134
+ .container:not(.withIcon).noContent {
135
+ align-items: center;
136
+ }
137
+
138
+ .container:not(.withIcon).noContent .label {
139
+ margin-bottom: 0;
140
+ }
141
+
134
142
  .container:not(.withIcon) .columnsWrapper {
135
143
  flex-direction: row;
136
144
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "4.5.5",
3
+ "version": "4.5.6",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",