@televet/kibble-ui 1.11.0-beta.3chctp9.0 → 1.11.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.
|
@@ -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
|
@@ -4128,7 +4128,7 @@ var TextConfig = {
|
|
|
4128
4128
|
};
|
|
4129
4129
|
|
|
4130
4130
|
var RatingDots = function (_a) {
|
|
4131
|
-
var minValue = _a.minValue, maxValue = _a.maxValue,
|
|
4131
|
+
var minValue = _a.minValue, maxValue = _a.maxValue, isDisabled = _a.isDisabled, isInteractive = _a.isInteractive, onClick = _a.onClick, selected = _a.selected;
|
|
4132
4132
|
var _b = __read(React.useState(), 2), selectedValue = _b[0], setSelectedValue = _b[1];
|
|
4133
4133
|
var roundedMin = React.useMemo(function () { return Math.round(minValue); }, [minValue]);
|
|
4134
4134
|
var roundedMax = React.useMemo(function () { return Math.round(maxValue); }, [maxValue]);
|
|
@@ -4145,10 +4145,10 @@ var RatingDots = function (_a) {
|
|
|
4145
4145
|
}, [selected]);
|
|
4146
4146
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4147
4147
|
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 })); })),
|
|
4148
|
-
React__default["default"].createElement(react.Flex, { justifyContent: isInteractive ?
|
|
4149
|
-
|
|
4150
|
-
!isInteractive && React__default["default"].createElement(Text, {
|
|
4151
|
-
|
|
4148
|
+
React__default["default"].createElement(react.Flex, { color: colors.text.light.subtle, justifyContent: isInteractive ? 'space-between' : 'flex-start' },
|
|
4149
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMin, " - Not likely")),
|
|
4150
|
+
!isInteractive && React__default["default"].createElement(Text, { size: "sm", pr: 1 }, ","),
|
|
4151
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMax, " - Very likely")))));
|
|
4152
4152
|
};
|
|
4153
4153
|
|
|
4154
4154
|
var Select = function (props) {
|