@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
31 lines (23 loc) • 1.2 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
var _opacity;
import { convertHexToRgba } from "@kiwicom/orbit-design-tokens";
import { TOKENS, TYPE_OPTIONS } from "../consts";
import { BUTTON_STATES } from "../../primitives/ButtonPrimitive/common/consts";
import getSocialButtonTypeToken from "./getSocialButtonTypeToken";
var opacity = (_opacity = {}, _defineProperty(_opacity, TYPE_OPTIONS.APPLE, 15), _defineProperty(_opacity, TYPE_OPTIONS.FACEBOOK, 8), _defineProperty(_opacity, TYPE_OPTIONS.GOOGLE, 8), _defineProperty(_opacity, TYPE_OPTIONS.TWITTER, 8), _opacity);
var getButtonBoxShadow = function getButtonBoxShadow(state, disabled, theme, type) {
var wrappedButtonTypeToken = function wrappedButtonTypeToken(name) {
return getSocialButtonTypeToken(name, type, theme);
};
if (disabled) {
return null;
}
if (state === BUTTON_STATES.ACTIVE) {
return "inset 0 0 6px 3px ".concat(convertHexToRgba(theme.orbit.paletteInkNormal, opacity[type]), ";");
}
if (state === BUTTON_STATES.FOCUS) {
return "0 0 0 3px ".concat(wrappedButtonTypeToken(TOKENS.borderColorButtonFocus));
}
return null;
};
export default getButtonBoxShadow;