@televet/kibble-ui 1.4.0-release.0 → 1.4.0
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.
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
export interface IRatingDotsProps {
|
|
3
3
|
minValue: number;
|
|
4
4
|
maxValue: number;
|
|
5
|
-
minLabel?: string;
|
|
6
|
-
maxLabel?: string;
|
|
7
|
-
centeredLabel?: string;
|
|
8
5
|
isInteractive?: boolean;
|
|
9
6
|
isDisabled?: boolean;
|
|
10
7
|
onClick?: (value: number) => void;
|
|
11
8
|
selected?: number;
|
|
12
9
|
}
|
|
13
|
-
export declare const RatingDots: ({ minValue, maxValue,
|
|
10
|
+
export declare const RatingDots: ({ minValue, maxValue, isDisabled, isInteractive, onClick, selected, }: IRatingDotsProps) => JSX.Element;
|
package/build/index.js
CHANGED
|
@@ -1663,7 +1663,7 @@ var RatingDot = function (_a) {
|
|
|
1663
1663
|
};
|
|
1664
1664
|
|
|
1665
1665
|
var RatingDots = function (_a) {
|
|
1666
|
-
var minValue = _a.minValue, maxValue = _a.maxValue,
|
|
1666
|
+
var minValue = _a.minValue, maxValue = _a.maxValue, isDisabled = _a.isDisabled, isInteractive = _a.isInteractive, onClick = _a.onClick, selected = _a.selected;
|
|
1667
1667
|
var _b = React.useState(), selectedValue = _b[0], setSelectedValue = _b[1];
|
|
1668
1668
|
var roundedMin = React.useMemo(function () { return Math.round(minValue); }, [minValue]);
|
|
1669
1669
|
var roundedMax = React.useMemo(function () { return Math.round(maxValue); }, [maxValue]);
|
|
@@ -1680,10 +1680,10 @@ var RatingDots = function (_a) {
|
|
|
1680
1680
|
}, [selected]);
|
|
1681
1681
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1682
1682
|
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 })); })),
|
|
1683
|
-
React__default["default"].createElement(react.Flex, { color: colors.text.light.subtle, justifyContent: isInteractive ?
|
|
1684
|
-
|
|
1683
|
+
React__default["default"].createElement(react.Flex, { color: colors.text.light.subtle, justifyContent: isInteractive ? 'space-between' : 'flex-start' },
|
|
1684
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMin, " - Not likely")),
|
|
1685
1685
|
!isInteractive && React__default["default"].createElement(Text, { size: "sm", pr: 1 }, ","),
|
|
1686
|
-
|
|
1686
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMax, " - Very likely")))));
|
|
1687
1687
|
};
|
|
1688
1688
|
|
|
1689
1689
|
var Select = function (props) {
|