import { darkTheme, lightTheme } from '@nordnet/design-tokens';
import styled from 'styled-components';
import { Button, Flexbox } from '../..';
import { TRANSITION_DURATION } from './constants';
var getNeutralColor = function getNeutralColor(colorToken, theme, invertedColors) {
  if (invertedColors) {
    return theme.isDarkMode ? lightTheme.color.neutral[colorToken] : darkTheme.color.neutral[colorToken];
  }
  return theme.colorTokens.neutral[colorToken];
};
var getActionColor = function getActionColor(colorToken, theme, invertedColors) {
  if (invertedColors) {
    return theme.isDarkMode ? lightTheme.color.action[colorToken] : darkTheme.color.action[colorToken];
  }
  return theme.colorTokens.action[colorToken];
};
export var StyledIconButton = styled(Button.Icon).withConfig({
  displayName: "BottomSheetstyles__StyledIconButton",
  componentId: "sc-ka5sdk-0"
})(["background-color:", ";color:", ";svg{color:", ";}&:hover{background-color:", ";svg{color:", ";}}&:active{background-color:", ";svg{color:", ";}}"], function (p) {
  return getNeutralColor('background_strong', p.theme, p.$invertedColors);
}, function (p) {
  return getNeutralColor('icon_default', p.theme, p.$invertedColors);
}, function (p) {
  return getNeutralColor('icon_default', p.theme, p.$invertedColors);
}, function (p) {
  return getNeutralColor('background_strong', p.theme, p.$invertedColors);
}, function (p) {
  return getActionColor('icon_hover', p.theme, p.$invertedColors);
}, function (p) {
  return getNeutralColor('background_weak', p.theme, p.$invertedColors);
}, function (p) {
  return getActionColor('icon_pressed', p.theme, p.$invertedColors);
});
export var Backdrop = styled(Flexbox).withConfig({
  displayName: "BottomSheetstyles__Backdrop",
  componentId: "sc-ka5sdk-1"
})(["background-color:", ";height:100%;left:0;position:fixed;top:0;width:100%;z-index:", ";"], function (_ref) {
  var theme = _ref.theme;
  return theme.colorTokens.neutral.background_overlay;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.zIndex.overlay;
});
var getHeight = function getHeight(height, fullScreenMobile) {
  if (fullScreenMobile) {
    return 'height: 100%';
  }
  if (height && typeof height === 'number') {
    return "height: ".concat(height, "px");
  }
  if (height && typeof height === 'string') {
    return "height: ".concat(height);
  }
  return '';
};
export var StyledBottomSheet = styled(Flexbox).withConfig({
  displayName: "BottomSheetstyles__StyledBottomSheet",
  componentId: "sc-ka5sdk-2"
})(["background-color:", ";border-color:", ";border-radius:", ";bottom:0;box-sizing:border-box;color:", ";display:block;", ";transition:height ", "s ease-out;left:0;padding:", "px ", "px;position:absolute;width:100%;z-index:", ";"], function (p) {
  return getNeutralColor('background_default', p.theme, p.$invertedColors);
}, function (p) {
  return getNeutralColor('background_default', p.theme, p.$invertedColors);
}, function (_ref3) {
  var theme = _ref3.theme;
  return "".concat(theme.borderRadius20, " ").concat(theme.borderRadius20, " 0 0");
}, function (p) {
  return getNeutralColor('text_default', p.theme, p.$invertedColors);
}, function (p) {
  return getHeight(p.height, p.$fullScreenMobile);
}, TRANSITION_DURATION, function (p) {
  return p.theme.spacing.unit(4);
}, function (p) {
  return p.theme.spacing.unit(3);
}, function (p) {
  return p.theme.zIndex.overlayInModal;
});