allaw-ui 4.5.5 → 4.5.7
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
|
-
|
|
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;
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
.content {
|
|
63
63
|
flex-grow: 1;
|
|
64
|
+
width: 100%;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
.label {
|
|
@@ -131,6 +132,14 @@
|
|
|
131
132
|
margin-bottom: 8px;
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
.container:not(.withIcon).noContent {
|
|
136
|
+
align-items: center;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.container:not(.withIcon).noContent .label {
|
|
140
|
+
margin-bottom: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
134
143
|
.container:not(.withIcon) .columnsWrapper {
|
|
135
144
|
flex-direction: row;
|
|
136
145
|
align-items: center;
|