@televet/kibble-ui 1.10.2-beta.3chctp9.2 → 1.10.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.
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export interface IRatingDotsProps {
|
|
2
2
|
minValue: number;
|
|
3
3
|
maxValue: number;
|
|
4
|
-
minLabel?: string;
|
|
5
|
-
maxLabel?: string;
|
|
6
|
-
centeredLabel?: string;
|
|
7
4
|
isInteractive?: boolean;
|
|
8
5
|
isDisabled?: boolean;
|
|
9
6
|
onClick?: (value: number) => void;
|
|
10
7
|
selected?: number;
|
|
11
8
|
}
|
|
12
|
-
export declare const RatingDots: ({ minValue, maxValue,
|
|
9
|
+
export declare const RatingDots: ({ minValue, maxValue, isDisabled, isInteractive, onClick, selected, }: IRatingDotsProps) => JSX.Element;
|
package/build/index.js
CHANGED
|
@@ -3965,7 +3965,7 @@ var TextConfig = {
|
|
|
3965
3965
|
};
|
|
3966
3966
|
|
|
3967
3967
|
var RatingDots = function (_a) {
|
|
3968
|
-
var minValue = _a.minValue, maxValue = _a.maxValue,
|
|
3968
|
+
var minValue = _a.minValue, maxValue = _a.maxValue, isDisabled = _a.isDisabled, isInteractive = _a.isInteractive, onClick = _a.onClick, selected = _a.selected;
|
|
3969
3969
|
var _b = __read(React.useState(), 2), selectedValue = _b[0], setSelectedValue = _b[1];
|
|
3970
3970
|
var roundedMin = React.useMemo(function () { return Math.round(minValue); }, [minValue]);
|
|
3971
3971
|
var roundedMax = React.useMemo(function () { return Math.round(maxValue); }, [maxValue]);
|
|
@@ -3982,10 +3982,10 @@ var RatingDots = function (_a) {
|
|
|
3982
3982
|
}, [selected]);
|
|
3983
3983
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
3984
3984
|
React__default["default"].createElement(react.Flex, { my: 4, flexWrap: "wrap", justifyContent: isInteractive ? 'center' : 'flex-start' }, values.map(function (value) { return (React__default["default"].createElement(RatingDot, { key: "composer-rating-dot-".concat(value), number: value, isInteractive: isInteractive, onClick: onClick, isDisabled: isDisabled, selected: selectedValue === value })); })),
|
|
3985
|
-
React__default["default"].createElement(react.Flex, { justifyContent: isInteractive ?
|
|
3986
|
-
|
|
3987
|
-
!isInteractive && React__default["default"].createElement(Text, {
|
|
3988
|
-
|
|
3985
|
+
React__default["default"].createElement(react.Flex, { color: colors.text.light.subtle, justifyContent: isInteractive ? 'space-between' : 'flex-start' },
|
|
3986
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMin, " - Not likely")),
|
|
3987
|
+
!isInteractive && React__default["default"].createElement(Text, { size: "sm", pr: 1 }, ","),
|
|
3988
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMax, " - Very likely")))));
|
|
3989
3989
|
};
|
|
3990
3990
|
|
|
3991
3991
|
var Select = function (props) {
|