UNPKG

2.62 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _colors = require('../../styles/common/colors.css');
8
9var _colors2 = _interopRequireDefault(_colors);
10
11var _functions = require('../../styles/common/functions.css');
12
13function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15// TODO: Write test(s) for any logic contained herein
16var styles = function styles(_ref) {
17 var listItems = _ref.listItems,
18 alignment = _ref.alignment,
19 optClass = _ref.optClass,
20 isOpened = _ref.isOpened,
21 _ref$triggerRect = _ref.triggerRect,
22 triggerRect = _ref$triggerRect === undefined ? { width: 0 } : _ref$triggerRect;
23
24 return {
25 position: 'relative',
26
27 '> *': {
28 margin: 0
29 },
30 '.trigger': {
31 cursor: 'pointer'
32 },
33 '> .dropdown-wrapper': {
34 backfaceVisibility: 'hidden',
35 backgroundColor: _colors2.default.white,
36 borderRadius: '3px',
37 boxShadow: '0 1px 2px 1px rgba(0, 0, 0, 0.2)',
38 boxSizing: 'border-box',
39 height: 'auto',
40 marginTop: '7px',
41 opacity: isOpened ? 1 : 0,
42 overflow: listItems ? 'hidden' : 'unset',
43 padding: listItems ? 0 : '10px',
44 position: 'absolute',
45 transform: isOpened && alignment === 'right' ? 'translateX(calc(-100% + ' + triggerRect.width + 'px))' : 'inherit',
46 display: isOpened ? 'block' : 'none',
47 zIndex: _functions.zLayers.dropdown
48 },
49 '.list-wrapper': {
50 margin: 0,
51 minWidth: '110px',
52 padding: 0,
53 lineHeight: 'initial',
54 li: {
55 boxSizing: 'border-box',
56 color: _colors2.default.primary_4,
57 cursor: 'pointer',
58 display: 'block',
59 minHeight: '18px',
60 padding: '10px',
61 textDecoration: 'none',
62 width: '100%',
63 '&:hover': {
64 backgroundColor: _colors2.default.primary_1,
65 color: _colors2.default.white
66 }
67 }
68 },
69 '.overlay': {
70 backgroundColor: _colors2.default.white,
71 minWidth: '128px',
72 width: '100%',
73 '> span': {
74 fontSize: '16px',
75 fontWeight: 200,
76 color: _colors2.default.navy_text,
77 margin: '10px 10px 0',
78 textAlign: 'left',
79 display: 'block'
80 },
81 '.button-wrapper': {
82 boxSizing: 'border-box',
83 display: 'flex',
84 justifyContent: 'flex-end',
85 padding: '10px',
86 width: '100%',
87 button: {
88 margin: 0,
89 '&:first-child': {
90 marginRight: '12px !important'
91 }
92 }
93 }
94 }
95 };
96};
97
98exports.default = styles;
\No newline at end of file