@braineet/ui
Version:
Braineet design system
41 lines • 2.06 kB
JavaScript
import styled, { css } from 'styled-components';
import Box from '../box';
export var StyledRate = styled.ul.withConfig({
displayName: "styles__StyledRate",
componentId: "sc-16jge7i-0"
})(["margin:0;padding:0;list-style:none;display:inline-block;vertical-align:middle;font-weight:normal;font-style:normal;outline:none;box-shadow:none !important;white-space:nowrap;", ""], function (p) {
return p.disabled && css(["cursor:not-allowed;opacity:0.24;"]);
});
var getStyle = function getStyle(p) {
var characterValue = p.index + 1;
if (p.allowHalf && p.isFirst && p.value + 0.5 >= characterValue && p.value < characterValue) {
return css(["opacity:1 !important;color:", ";"], p.theme.colors.brand);
}
if (characterValue <= p.value) {
return css(["color:", ";"], p.theme.colors.brand);
}
};
export var StyledCharacter = styled.div.withConfig({
displayName: "styles__StyledCharacter",
componentId: "sc-16jge7i-1"
})(["margin:0;padding:0;display:inline-block;margin-right:8px;position:relative;box-shadow:none !important;border-radius:4px;color:", ";cursor:", ";"], function (p) {
return p.theme.colors.black;
}, function (p) {
return p.disabled || p.readOnly ? 'default' : 'pointer';
});
export var RadioCharacter = styled.div.withConfig({
displayName: "styles__RadioCharacter",
componentId: "sc-16jge7i-2"
})(["transition:all 0.3s;box-shadow:none !important;"]);
export var StyledCharacterNode = styled.div.withConfig({
displayName: "styles__StyledCharacterNode",
componentId: "sc-16jge7i-3"
})(["box-shadow:none !important;&:first-child,&:nth-of-type(2){transition:all 0.3s;}&:first-child{position:absolute;left:0;top:0;width:50%;height:100%;overflow:hidden;opacity:0;}", ""], function (p) {
return getStyle(p);
});
export var StyledCharacterPlaceholder = styled(Box).withConfig({
displayName: "styles__StyledCharacterPlaceholder",
componentId: "sc-16jge7i-4"
})(["box-shadow:none !important;position:absolute;top:0;bottom:0;left:0;right:0;z-index:", ";"], function (props) {
return props.theme.zIndex.front;
});