allaw-ui 5.3.9 → 5.4.2
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.
- package/dist/components/atoms/buttons/ActionButton.d.ts +1 -1
- package/dist/components/atoms/buttons/ActionButton.js +2 -2
- package/dist/components/atoms/selects/SelectableListItem.d.ts +1 -0
- package/dist/components/atoms/selects/SelectableListItem.js +3 -2
- package/dist/components/atoms/selects/SelectableListItem.module.css +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes } from "react";
|
|
2
|
-
export interface ActionButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
export interface ActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
|
|
3
3
|
startIcon?: React.ReactNode;
|
|
4
4
|
endIcon?: React.ReactNode;
|
|
5
5
|
startIconName?: string;
|
|
@@ -59,7 +59,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
59
59
|
import React, { forwardRef, useEffect, useImperativeHandle, useState, } from "react";
|
|
60
60
|
import styles from "./ActionButton.module.css";
|
|
61
61
|
var ActionButton = forwardRef(function (_a, ref) {
|
|
62
|
-
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, variant = _a.variant, _f = _a.size, size = _f === void 0 ? "medium" : _f, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type", "isLoading", "variant", "size"]);
|
|
62
|
+
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, variant = _a.variant, _f = _a.size, size = _f === void 0 ? "medium" : _f, dataTestId = _a.dataTestId, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type", "isLoading", "variant", "size", "dataTestId"]);
|
|
63
63
|
var buttonRef = React.useRef(null);
|
|
64
64
|
var _g = useState(false), internalIsLoading = _g[0], setInternalIsLoading = _g[1];
|
|
65
65
|
var _h = useState(""), loadingDots = _h[0], setLoadingDots = _h[1];
|
|
@@ -106,7 +106,7 @@ var ActionButton = forwardRef(function (_a, ref) {
|
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}); };
|
|
109
|
-
return (React.createElement("button", __assign({ ref: buttonRef, "data-testid":
|
|
109
|
+
return (React.createElement("button", __assign({ ref: buttonRef, "data-testid": dataTestId, className: "".concat(styles.actionButton, " ").concat(disabled ? styles.actionButtonDisabled : styles.actionButtonEnabled, " ").concat(fullWidth ? styles.actionButtonFullWidth : "", " ").concat(isButtonLoading ? styles.actionButtonLoading : "", " ").concat(variant === "warning" ? styles.actionButtonWarning : "", " ").concat(variant === "border" ? styles.actionButtonBorder : "", " ").concat(size === "large" ? styles.actionButtonLarge : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
110
110
|
startIcon && (React.createElement("span", { className: "".concat(styles.actionButtonIcon, " ").concat(startIconName) })),
|
|
111
111
|
React.createElement("span", { className: styles.actionButtonLabel }, label),
|
|
112
112
|
isButtonLoading ? (React.createElement("span", { className: styles.actionButtonLoadingDots }, loadingDots)) : (endIcon && (React.createElement("span", { className: "".concat(styles.actionButtonIcon, " ").concat(endIconName) })))));
|
|
@@ -9,6 +9,7 @@ export interface SelectableListItemProps {
|
|
|
9
9
|
onClick: () => void;
|
|
10
10
|
icon?: string;
|
|
11
11
|
testIdKey?: string | number;
|
|
12
|
+
durationSize?: "standard" | "large";
|
|
12
13
|
}
|
|
13
14
|
declare const SelectableListItem: React.FC<SelectableListItemProps>;
|
|
14
15
|
export default SelectableListItem;
|
|
@@ -4,7 +4,7 @@ import "../../../styles/icons.css";
|
|
|
4
4
|
import { slugify } from "../../../utils/utils";
|
|
5
5
|
import styles from "./SelectableListItem.module.css";
|
|
6
6
|
var SelectableListItem = function (_a) {
|
|
7
|
-
var label = _a.label, duration = _a.duration, price = _a.price, isActive = _a.isActive, onClick = _a.onClick, icon = _a.icon, testIdKey = _a.testIdKey;
|
|
7
|
+
var label = _a.label, duration = _a.duration, price = _a.price, isActive = _a.isActive, onClick = _a.onClick, icon = _a.icon, testIdKey = _a.testIdKey, _b = _a.durationSize, durationSize = _b === void 0 ? "standard" : _b;
|
|
8
8
|
var hasIcon = icon && icon.length > 0;
|
|
9
9
|
var hasContent = (duration && duration.trim()) || (price && price.trim());
|
|
10
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)) },
|
|
@@ -14,7 +14,8 @@ var SelectableListItem = function (_a) {
|
|
|
14
14
|
React.createElement("div", { className: styles.content },
|
|
15
15
|
React.createElement("span", { className: styles.label }, label)),
|
|
16
16
|
hasContent && (React.createElement("div", { className: styles.columnsWrapper },
|
|
17
|
-
duration && React.createElement("span", { className: styles.duration }, duration),
|
|
17
|
+
duration && (React.createElement("span", { className: "".concat(styles.duration, " ").concat(durationSize === "large" ? styles.durationLarge : "") }, duration)),
|
|
18
18
|
price && React.createElement("span", { className: styles.price }, price)))));
|
|
19
19
|
};
|
|
20
|
+
// test
|
|
20
21
|
export default SelectableListItem;
|