1 | "use strict";
|
2 |
|
3 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports.StyledProfileBody = exports.StyledProfileSubtitle = exports.StyledProfileTitle = exports.StyledProfileLabelsContainer = exports.StyledProfileImg = exports.StyledProfileImgContainer = exports.StyledListItemProfile = exports.StyledListItem = exports.StyledListItemElement = exports.StyledListItemAnchor = exports.StyledOptgroupHeader = exports.StyledEmptyState = exports.StyledList = void 0;
|
9 |
|
10 | var React = _interopRequireWildcard(require("react"));
|
11 |
|
12 | var _index = require("../styles/index.js");
|
13 |
|
14 | var _constants = require("./constants.js");
|
15 |
|
16 | function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
17 |
|
18 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19 |
|
20 | function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
21 |
|
22 | function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
23 |
|
24 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
25 |
|
26 | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
27 |
|
28 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
29 |
|
30 | var StyledList = (0, _index.styled)('ul', function (_ref) {
|
31 | var $theme = _ref.$theme,
|
32 | $isFocusVisible = _ref.$isFocusVisible;
|
33 | return {
|
34 | backgroundColor: $theme.colors.menuFill,
|
35 | position: 'relative',
|
36 | marginTop: 0,
|
37 | marginBottom: 0,
|
38 | marginLeft: 0,
|
39 | marginRight: 0,
|
40 | paddingTop: $theme.sizing.scale300,
|
41 | paddingBottom: $theme.sizing.scale300,
|
42 | paddingLeft: 0,
|
43 | paddingRight: 0,
|
44 | borderTopLeftRadius: $theme.borders.popoverBorderRadius,
|
45 | borderTopRightRadius: $theme.borders.popoverBorderRadius,
|
46 | borderBottomRightRadius: $theme.borders.popoverBorderRadius,
|
47 | borderBottomLeftRadius: $theme.borders.popoverBorderRadius,
|
48 | boxShadow: $theme.lighting.shadow600,
|
49 | overflow: 'auto',
|
50 | ':focus': {
|
51 | outline: $isFocusVisible ? "3px solid ".concat($theme.colors.accent) : 'none'
|
52 | }
|
53 | };
|
54 | });
|
55 | exports.StyledList = StyledList;
|
56 | StyledList.displayName = "StyledList";
|
57 |
|
58 | function getFontColor(props) {
|
59 | if (props.$disabled) {
|
60 | return props.$theme.colors.menuFontDisabled;
|
61 | }
|
62 |
|
63 | if (props.$isHighlighted && props.$isFocused) {
|
64 | return props.$theme.colors.menuFontHighlighted;
|
65 | }
|
66 |
|
67 | if (props.$isHighlighted && !props.$isFocused) {
|
68 | return props.$theme.colors.menuFontSelected;
|
69 | }
|
70 |
|
71 | return props.$theme.colors.menuFontDefault;
|
72 | }
|
73 |
|
74 | function getBackgroundColor(props) {
|
75 | if (props.$disabled) {
|
76 | return 'transparent';
|
77 | }
|
78 |
|
79 | if (props.$isHighlighted) {
|
80 | return props.$theme.colors.menuFillHover;
|
81 | }
|
82 |
|
83 | return 'transparent';
|
84 | }
|
85 |
|
86 | var StyledEmptyState = (0, _index.styled)('li', function (props) {
|
87 | var $theme = props.$theme,
|
88 | $size = props.$size;
|
89 | return _objectSpread({}, $size === _constants.OPTION_LIST_SIZE.compact ? $theme.typography.font100 : $theme.typography.font200, {
|
90 | position: 'relative',
|
91 | display: 'block',
|
92 | color: $theme.colors.menuFontDisabled,
|
93 | textAlign: 'center',
|
94 | cursor: 'not-allowed',
|
95 | backgroundColor: 'transparent',
|
96 | marginBottom: 0,
|
97 | paddingTop: $theme.sizing.scale800,
|
98 | paddingBottom: $theme.sizing.scale800,
|
99 | paddingRight: $theme.sizing.scale800,
|
100 | paddingLeft: $theme.sizing.scale800
|
101 | });
|
102 | });
|
103 | exports.StyledEmptyState = StyledEmptyState;
|
104 | StyledEmptyState.displayName = "StyledEmptyState";
|
105 | var StyledOptgroupHeader = (0, _index.styled)('li', function (props) {
|
106 | var paddingX = props.$theme.sizing.scale300;
|
107 | var paddingY = props.$theme.sizing.scale200;
|
108 | return _objectSpread({}, props.$theme.typography.font250, {
|
109 | color: props.$theme.colors.colorPrimary,
|
110 | paddingTop: paddingY,
|
111 | paddingBottom: paddingY,
|
112 | paddingRight: paddingX,
|
113 | paddingLeft: paddingX
|
114 | });
|
115 | });
|
116 | exports.StyledOptgroupHeader = StyledOptgroupHeader;
|
117 | StyledOptgroupHeader.displayName = "StyledOptgroupHeader";
|
118 | var StyledListItemAnchor = (0, _index.styled)('a', function (props) {
|
119 | return {
|
120 | display: 'block',
|
121 | color: getFontColor(props)
|
122 | };
|
123 | });
|
124 | exports.StyledListItemAnchor = StyledListItemAnchor;
|
125 | StyledListItemAnchor.displayName = "StyledListItemAnchor";
|
126 | var StyledListItemElement = (0, _index.styled)('li', function (props) {
|
127 | var $disabled = props.$disabled,
|
128 | $theme = props.$theme,
|
129 | $size = props.$size;
|
130 | return _objectSpread({}, $size === _constants.OPTION_LIST_SIZE.compact ? $theme.typography.font100 : $theme.typography.font200, {
|
131 | position: 'relative',
|
132 | display: 'block',
|
133 | color: getFontColor(props),
|
134 | cursor: $disabled ? 'not-allowed' : 'pointer',
|
135 | backgroundColor: getBackgroundColor(props),
|
136 | transitionProperty: 'color, background-color',
|
137 | transitionDuration: $theme.animation.timing200,
|
138 | transitionTimingFunction: $theme.animation.easeOutCurve,
|
139 | marginBottom: 0,
|
140 | paddingTop: $size === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale100 : $theme.sizing.scale300,
|
141 | paddingBottom: $size === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale100 : $theme.sizing.scale300,
|
142 | paddingRight: $size === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale900 : $theme.sizing.scale600,
|
143 | paddingLeft: $size === _constants.OPTION_LIST_SIZE.compact ? $theme.sizing.scale900 : $theme.sizing.scale600,
|
144 | ':focus': {
|
145 | outline: 'none'
|
146 | }
|
147 | });
|
148 | });
|
149 | exports.StyledListItemElement = StyledListItemElement;
|
150 | StyledListItemElement.displayName = "StyledListItemElement";
|
151 | var StyledListItem = (0, _index.withWrapper)(StyledListItemElement, function (Styled) {
|
152 | return function StyledListItem(_ref2) {
|
153 | var item = _ref2.item,
|
154 | restProps = _objectWithoutProperties(_ref2, ["item"]);
|
155 |
|
156 | return React.createElement(Styled, restProps);
|
157 | };
|
158 | });
|
159 | exports.StyledListItem = StyledListItem;
|
160 | var StyledListItemProfile = (0, _index.styled)('li', function (_ref3) {
|
161 | var $theme = _ref3.$theme;
|
162 | return {
|
163 | position: 'relative',
|
164 | display: 'flex',
|
165 | alignItems: 'center',
|
166 | cursor: 'pointer',
|
167 | paddingTop: $theme.sizing.scale300,
|
168 | paddingBottom: $theme.sizing.scale300,
|
169 | paddingRight: $theme.sizing.scale800,
|
170 | paddingLeft: $theme.sizing.scale800,
|
171 | transitionProperty: 'color, background-color',
|
172 | transitionDuration: $theme.animation.timing200,
|
173 | transitionTimingFunction: $theme.animation.easeOutCurve,
|
174 | ':hover': {
|
175 | backgroundColor: $theme.colors.menuFillHover
|
176 | }
|
177 | };
|
178 | });
|
179 | exports.StyledListItemProfile = StyledListItemProfile;
|
180 | StyledListItemProfile.displayName = "StyledListItemProfile";
|
181 | var StyledProfileImgContainer = (0, _index.styled)('div', {
|
182 | width: '60px',
|
183 | height: '60px',
|
184 | display: 'flex',
|
185 | justifyContent: 'center',
|
186 | alignItems: 'center'
|
187 | });
|
188 | exports.StyledProfileImgContainer = StyledProfileImgContainer;
|
189 | StyledProfileImgContainer.displayName = "StyledProfileImgContainer";
|
190 | var StyledProfileImg = (0, _index.styled)('img', {
|
191 | width: '100%',
|
192 | height: '100%',
|
193 | borderTopLeftRadius: '50%',
|
194 | borderTopRightRadius: '50%',
|
195 | borderBottomRightRadius: '50%',
|
196 | borderBottomLeftRadius: '50%'
|
197 | });
|
198 | exports.StyledProfileImg = StyledProfileImg;
|
199 | StyledProfileImg.displayName = "StyledProfileImg";
|
200 | var StyledProfileLabelsContainer = (0, _index.styled)('div', function (_ref4) {
|
201 | var $theme = _ref4.$theme;
|
202 | return {
|
203 | marginLeft: $theme.sizing.scale600,
|
204 | alignSelf: $theme.direction === 'rtl' ? 'flex-end' : 'flex-start',
|
205 | display: 'flex',
|
206 | flexDirection: 'column'
|
207 | };
|
208 | });
|
209 | exports.StyledProfileLabelsContainer = StyledProfileLabelsContainer;
|
210 | StyledProfileLabelsContainer.displayName = "StyledProfileLabelsContainer";
|
211 | var StyledProfileTitle = (0, _index.styled)('h6', function (_ref5) {
|
212 | var $theme = _ref5.$theme;
|
213 | return _objectSpread({}, $theme.typography.font350, {
|
214 | color: $theme.colors.contentPrimary,
|
215 | marginTop: 0,
|
216 | marginBottom: 0,
|
217 | marginLeft: 0,
|
218 | marginRight: 0
|
219 | });
|
220 | });
|
221 | exports.StyledProfileTitle = StyledProfileTitle;
|
222 | StyledProfileTitle.displayName = "StyledProfileTitle";
|
223 | var StyledProfileSubtitle = (0, _index.styled)('p', function (_ref6) {
|
224 | var $theme = _ref6.$theme;
|
225 | return _objectSpread({}, $theme.typography.font200, {
|
226 | color: $theme.colors.contentPrimary,
|
227 | marginTop: 0,
|
228 | marginBottom: 0,
|
229 | marginLeft: 0,
|
230 | marginRight: 0
|
231 | });
|
232 | });
|
233 | exports.StyledProfileSubtitle = StyledProfileSubtitle;
|
234 | StyledProfileSubtitle.displayName = "StyledProfileSubtitle";
|
235 | var StyledProfileBody = (0, _index.styled)('p', function (_ref7) {
|
236 | var $theme = _ref7.$theme;
|
237 | return _objectSpread({}, $theme.typography.font100, {
|
238 | color: $theme.colors.contentPrimary,
|
239 | marginTop: 0,
|
240 | marginBottom: 0,
|
241 | marginLeft: 0,
|
242 | marginRight: 0
|
243 | });
|
244 | });
|
245 | exports.StyledProfileBody = StyledProfileBody;
|
246 | StyledProfileBody.displayName = "StyledProfileBody"; |
\ | No newline at end of file |