@televet/kibble-ui 1.12.11-beta.3chctp9.0 → 1.12.11
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
|
@@ -4163,7 +4163,7 @@ var TruncatedText = function (_a) {
|
|
|
4163
4163
|
};
|
|
4164
4164
|
|
|
4165
4165
|
var RatingDots = function (_a) {
|
|
4166
|
-
var minValue = _a.minValue, maxValue = _a.maxValue,
|
|
4166
|
+
var minValue = _a.minValue, maxValue = _a.maxValue, isDisabled = _a.isDisabled, isInteractive = _a.isInteractive, onClick = _a.onClick, selected = _a.selected;
|
|
4167
4167
|
var _b = __read(React.useState(), 2), selectedValue = _b[0], setSelectedValue = _b[1];
|
|
4168
4168
|
var roundedMin = React.useMemo(function () { return Math.round(minValue); }, [minValue]);
|
|
4169
4169
|
var roundedMax = React.useMemo(function () { return Math.round(maxValue); }, [maxValue]);
|
|
@@ -4180,10 +4180,10 @@ var RatingDots = function (_a) {
|
|
|
4180
4180
|
}, [selected]);
|
|
4181
4181
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
4182
4182
|
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 })); })),
|
|
4183
|
-
React__default["default"].createElement(react.Flex, { justifyContent: isInteractive ?
|
|
4184
|
-
|
|
4185
|
-
!isInteractive && React__default["default"].createElement(Text, {
|
|
4186
|
-
|
|
4183
|
+
React__default["default"].createElement(react.Flex, { color: colors.text.light.subtle, justifyContent: isInteractive ? 'space-between' : 'flex-start' },
|
|
4184
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMin, " - Not likely")),
|
|
4185
|
+
!isInteractive && React__default["default"].createElement(Text, { size: "sm", pr: 1 }, ","),
|
|
4186
|
+
React__default["default"].createElement(Text, { size: "sm" }, "".concat(roundedMax, " - Very likely")))));
|
|
4187
4187
|
};
|
|
4188
4188
|
|
|
4189
4189
|
// TODO: Figure out how to document this functionality
|