@mailstep/design-system 0.6.5-beta.2 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ui/Blocks/CommonGrid/CommonGrid.d.ts +5 -2
- package/ui/Blocks/CommonGrid/CommonGrid.js +4 -35
- package/ui/Blocks/CommonGrid/CommonGridContainer.js +2 -2
- package/ui/Blocks/CommonGrid/components/HeadRow.d.ts +3 -3
- package/ui/Blocks/CommonGrid/components/HeadRow.js +1 -26
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +5 -5
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.d.ts +3 -1
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/ManageColumnForm.js +16 -4
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +5 -1
- package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +5 -4
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +5 -0
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +76 -10
- package/ui/Blocks/CommonGrid/storybook/stories/loading.stories.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNoScrollLayout.stories.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/stories/manyColumnsNormalLayout.stories.js +1 -1
- package/ui/Blocks/CommonGrid/storybook/stories/withCustomGridActions.stories.js +1 -1
- package/ui/Blocks/CommonGrid/styles.d.ts +3 -1
- package/ui/Blocks/CommonGrid/types.d.ts +1 -2
- package/ui/Blocks/CommonGrid/utils/index.d.ts +1 -0
- package/ui/Blocks/CommonGrid/utils/index.js +13 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.js +4 -5
- package/ui/Elements/Icon/icons/ArrowDown.d.ts +3 -0
- package/ui/Elements/Icon/icons/ArrowDown.js +13 -0
- package/ui/Elements/Icon/icons/ArrowUp.d.ts +3 -0
- package/ui/Elements/Icon/icons/ArrowUp.js +13 -0
- package/ui/Elements/Icon/icons/Cancel.js +1 -1
- package/ui/Elements/Icon/icons/index.d.ts +2 -0
- package/ui/Elements/Icon/icons/index.js +2 -0
- package/ui/Elements/Select/themes/CustomComponents.js +16 -4
- package/ui/Elements/Select/themes/index.js +2 -2
- package/ui/Elements/Select/themes/selectStyles.d.ts +42 -0
- package/ui/Elements/Select/themes/selectStyles.js +145 -0
- package/ui/ThemeProvider/themes/default.js +1 -1
- package/ui/index.es.js +15795 -15863
- package/ui/index.umd.js +468 -468
- package/ui/Elements/Select/themes/baseStyles.d.ts +0 -28
- package/ui/Elements/Select/themes/baseStyles.js +0 -87
- package/ui/Elements/Select/themes/formStyles.d.ts +0 -24
- package/ui/Elements/Select/themes/formStyles.js +0 -102
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var ArrowUp = function (props) { return (_jsx("svg", __assign({ width: "12", height: "7", viewBox: "0 0 12 7", fill: "none", stroke: "#22394E", xmlns: "http://www.w3.org/2000/svg" }, props, { children: _jsx("path", { d: "M1 6L5.64645 1.35355C5.84171 1.15829 6.15829 1.15829 6.35355 1.35355L11 6", strokeWidth: "2", strokeLinecap: "round" }) }))); };
|
|
@@ -10,4 +10,4 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export var Cancel = function (props) { return (_jsx("svg", __assign({ width: "11", height: "11", viewBox: "0 0 11 11", fill: "
|
|
13
|
+
export var Cancel = function (props) { return (_jsx("svg", __assign({ width: "11", height: "11", viewBox: "0 0 11 11", fill: "#22394E", xmlns: "http://www.w3.org/2000/svg" }, props, { children: _jsx("path", { id: "cancel", fillRule: "evenodd", clipRule: "evenodd", d: "M1.61873 0.375917C1.26726 0.0244455 0.697412 0.0244455 0.34594 0.375917C-0.00553197 0.727389 -0.00553197 1.29724 0.34594 1.64871L4.21225 5.51502L0.34594 9.38133C-0.00553159 9.7328 -0.00553156 10.3026 0.34594 10.6541C0.697412 11.0056 1.26726 11.0056 1.61873 10.6541L5.48504 6.78781L9.35135 10.6541C9.70282 11.0056 10.2727 11.0056 10.6241 10.6541C10.9756 10.3026 10.9756 9.7328 10.6241 9.38133L6.75783 5.51502L10.6241 1.64871C10.9756 1.29724 10.9756 0.727391 10.6241 0.375919C10.2727 0.024447 9.70282 0.024447 9.35135 0.375919L5.48504 4.24223L1.61873 0.375917Z" }) }))); };
|
|
@@ -34,6 +34,8 @@ import Icon from '../../Icon/Icon';
|
|
|
34
34
|
import { Paragraph3 } from '../../Typography/Typography';
|
|
35
35
|
import Checkbox from '../../../Forms/Checkbox/Checkbox';
|
|
36
36
|
import Toggle from '../../Toggle/Toggle';
|
|
37
|
+
import { ArrowDown } from '../../Icon/icons/ArrowDown';
|
|
38
|
+
import { ArrowUp } from '../../Icon/icons/ArrowUp';
|
|
37
39
|
// Option for big lists
|
|
38
40
|
var SimplifiedOptionInner = function (props) {
|
|
39
41
|
var styles = props.getStyles('option', props);
|
|
@@ -43,13 +45,17 @@ var SimplifiedOptionInner = function (props) {
|
|
|
43
45
|
};
|
|
44
46
|
export var SimplifiedOption = memo(SimplifiedOptionInner, function (prevProps, nextProps) { var _a, _b; return prevProps.isFocused === nextProps.isFocused && ((_a = prevProps.data) === null || _a === void 0 ? void 0 : _a.label) === ((_b = nextProps.data) === null || _b === void 0 ? void 0 : _b.label); });
|
|
45
47
|
// Value container with icon
|
|
46
|
-
var IconDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: 12px;\n align-self: center;\n"], ["\n padding-left: 12px;\n align-self: center;\n"])))
|
|
48
|
+
var IconDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: 12px;\n align-self: center;\n & > * {\n color: ", ";\n }\n"], ["\n padding-left: 12px;\n align-self: center;\n & > * {\n color: ", ";\n }\n"])), function (_a) {
|
|
49
|
+
var hasValue = _a.hasValue;
|
|
50
|
+
return (hasValue ? 'black' : '#a3b3c1');
|
|
51
|
+
});
|
|
47
52
|
export var IconValueContainer = function (props) {
|
|
48
53
|
var _a;
|
|
49
54
|
// eslint-disable-next-line react/prop-types
|
|
50
55
|
var children = props.children, rest = __rest(props, ["children"]);
|
|
51
56
|
var icon = (_a = rest.selectProps) === null || _a === void 0 ? void 0 : _a.icon;
|
|
52
|
-
|
|
57
|
+
var hasValue = rest.hasValue;
|
|
58
|
+
return (_jsxs(_Fragment, { children: [icon && (_jsx(IconDiv, { className: "inputIcon", hasValue: hasValue, children: _jsx(Icon, { icon: icon }) })), _jsx(components.ValueContainer, __assign({}, rest, { children: children }))] }));
|
|
53
59
|
};
|
|
54
60
|
// MultiValue container replacement with count of selected options
|
|
55
61
|
export var CountMultiValue = function (props) {
|
|
@@ -74,12 +80,18 @@ export var ChevronOption = function (props) {
|
|
|
74
80
|
return (_jsxs(selectComponents.Option, __assign({}, props, { children: [(showCheckbox || showToggle) && (_jsxs(SelectedIndicator, { children: [showCheckbox && _jsx(Checkbox, { checked: isSelected, size: 2, readOnly: true }), showToggle && _jsx(Toggle, { name: "", onChange: selectOption, checked: isSelected, spaceAround: false, variant: 'grid' })] })), _jsx("span", { className: "label", "data-cy": "dropdownModalOption".concat(data.index), children: children })] })));
|
|
75
81
|
};
|
|
76
82
|
// menu with check all and reset config button
|
|
77
|
-
var SelectAll = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n margin: 4px 18px -10px 8px;\n padding: ", ";\n font-weight: 400;\n background-color: ", ";\n color:
|
|
83
|
+
var SelectAll = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n margin: 4px 18px -10px 8px;\n padding: ", ";\n font-weight: 400;\n background-color: ", ";\n color: ", ";\n border-radius: 6px;\n height: 36px;\n :hover {\n cursor: pointer;\n background-color: ", ";\n }\n"], ["\n display: flex;\n margin: 4px 18px -10px 8px;\n padding: ", ";\n font-weight: 400;\n background-color: ", ";\n color: ", ";\n border-radius: 6px;\n height: 36px;\n :hover {\n cursor: pointer;\n background-color: ", ";\n }\n"])), function (_a) {
|
|
78
84
|
var additionalPadding = _a.additionalPadding;
|
|
79
85
|
return (additionalPadding ? '8px 27px 8px 10px' : '8px 10px');
|
|
80
86
|
}, function (_a) {
|
|
81
87
|
var isSelected = _a.isSelected;
|
|
82
88
|
return (isSelected ? th.color('red20') : 'transparent');
|
|
89
|
+
}, function (_a) {
|
|
90
|
+
var isSelected = _a.isSelected;
|
|
91
|
+
return (isSelected ? th.color('red1') : th.color('textPrimary'));
|
|
92
|
+
}, function (_a) {
|
|
93
|
+
var isSelected = _a.isSelected;
|
|
94
|
+
return (isSelected ? th.color('red30') : th.color('bgLightGray1'));
|
|
83
95
|
});
|
|
84
96
|
var ConfigWrap = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-align: center;\n cursor: pointer;\n color: red1;\n text-decoration: underline;\n margin: 0 30px 0 20px;\n padding-bottom: 7px;\n :first-letter {\n text-transform: capitalize;\n }\n :hover {\n color: red3;\n }\n"], ["\n text-align: center;\n cursor: pointer;\n color: red1;\n text-decoration: underline;\n margin: 0 30px 0 20px;\n padding-bottom: 7px;\n :first-letter {\n text-transform: capitalize;\n }\n :hover {\n color: red3;\n }\n"])));
|
|
85
97
|
export var ConnectedMenu = function (props) {
|
|
@@ -120,6 +132,6 @@ export var CustomInput = function (props) {
|
|
|
120
132
|
};
|
|
121
133
|
export var DropdownIndicator = function (props) {
|
|
122
134
|
var _a = props.selectProps, menuIsOpen = _a.menuIsOpen, name = _a.name;
|
|
123
|
-
return (_jsx(selectComponents.DropdownIndicator, __assign({}, props, { children: _jsx(ChevronDiv, { className: "chevron", "data-cy": "".concat(name, "ChevronBtn"), children: _jsx(
|
|
135
|
+
return (_jsx(selectComponents.DropdownIndicator, __assign({}, props, { children: _jsx(ChevronDiv, { className: "chevron", "data-cy": "".concat(name, "ChevronBtn"), children: menuIsOpen ? _jsx(ArrowUp, { width: "16px" }) : _jsx(ArrowDown, { width: "16px" }) }) })));
|
|
124
136
|
};
|
|
125
137
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SimplifiedOption, IconValueContainer, CountMultiValue, ChevronOption, DropdownIndicator, CustomInput, ConnectedMenu, } from './CustomComponents';
|
|
2
|
-
import { getCustomTheme as getFormCustomTheme, CustomStyles as
|
|
2
|
+
import { getCustomTheme as getFormCustomTheme, CustomStyles as SelectCustomStyles } from './selectStyles';
|
|
3
3
|
import { useTheme } from '@xstyled/styled-components';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
export var useStylesAndComponents = function (style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton, showResetGridButton) {
|
|
@@ -23,7 +23,7 @@ export var useStylesAndComponents = function (style, optionVariant, multiLabelVa
|
|
|
23
23
|
}
|
|
24
24
|
components.Input = CustomInput;
|
|
25
25
|
var themes = getFormCustomTheme(systemTheme, optionVariant, style == 'gridFilter');
|
|
26
|
-
var styles =
|
|
26
|
+
var styles = SelectCustomStyles;
|
|
27
27
|
components.Option = ChevronOption;
|
|
28
28
|
components.DropdownIndicator = DropdownIndicator;
|
|
29
29
|
// performance reasons
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SelectProps } from '../types';
|
|
2
|
+
import { ControlProps, CSSObjectWithLabel } from 'react-select';
|
|
3
|
+
type BaseColors = {
|
|
4
|
+
primary: string;
|
|
5
|
+
optionTextColor: string;
|
|
6
|
+
inputDisabledColor: string;
|
|
7
|
+
inputBorderColor: string;
|
|
8
|
+
whiteBackgroundColor: string;
|
|
9
|
+
inputTextColor: string;
|
|
10
|
+
placeholderTextColor: string;
|
|
11
|
+
activeOptionBackground: string;
|
|
12
|
+
disabledTextColor: string;
|
|
13
|
+
inputBorderHoverColor: string;
|
|
14
|
+
menuHoverBackgroundColor: string;
|
|
15
|
+
dropdownIndicatorColor: string;
|
|
16
|
+
hoverToActiveOptionBackground: string;
|
|
17
|
+
defaultControlColor: string;
|
|
18
|
+
};
|
|
19
|
+
type BaseState<ThemeType = BaseColors> = {
|
|
20
|
+
theme: ThemeType;
|
|
21
|
+
isSelected: boolean;
|
|
22
|
+
isFocused: boolean;
|
|
23
|
+
isDisabled: boolean;
|
|
24
|
+
isMulti: boolean;
|
|
25
|
+
selectProps: SelectProps;
|
|
26
|
+
} & ControlProps;
|
|
27
|
+
type StylesConfig<T = BaseState> = Record<string, (styles: CSSObjectWithLabel, state: T) => CSSObjectWithLabel>;
|
|
28
|
+
type CustomTheme = {
|
|
29
|
+
colors: BaseColors;
|
|
30
|
+
height: string | number;
|
|
31
|
+
focusBoxShadow?: string;
|
|
32
|
+
textWeightNormal: string;
|
|
33
|
+
optionVariant: Required<SelectProps>['optionVariant'];
|
|
34
|
+
borderRadius: string;
|
|
35
|
+
font: string;
|
|
36
|
+
narrowIndicators: boolean;
|
|
37
|
+
};
|
|
38
|
+
type State = BaseState<CustomTheme>;
|
|
39
|
+
export declare const CustomStyles: StylesConfig<State>;
|
|
40
|
+
type ThemeGetter = (theme: any) => CustomTheme;
|
|
41
|
+
export declare const getCustomTheme: (theme: any, optionVariant: Required<SelectProps>['optionVariant'], useFilterSubvariant: boolean) => ThemeGetter;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { th } from '@xstyled/system';
|
|
13
|
+
// style object https://react-select.com/styles
|
|
14
|
+
export var CustomStyles = {
|
|
15
|
+
control: function (styles, _a) {
|
|
16
|
+
var _b;
|
|
17
|
+
var selectProps = _a.selectProps, theme = _a.theme, isFocused = _a.isFocused, isDisabled = _a.isDisabled;
|
|
18
|
+
var colors = theme.colors;
|
|
19
|
+
return __assign(__assign({}, styles), { borderColor: selectProps.isInvalid ? colors.primary : isFocused ? colors.inputTextColor : colors.inputBorderColor, backgroundColor: colors.whiteBackgroundColor, boxShadow: theme.focusBoxShadow, borderRadius: theme.borderRadius, '& input': {
|
|
20
|
+
fontWeight: theme.textWeightNormal,
|
|
21
|
+
fontFamily: theme.font,
|
|
22
|
+
}, '&:hover': __assign(__assign({}, ((_b = styles['&:hover']) !== null && _b !== void 0 ? _b : {})), { borderColor: colors.inputBorderHoverColor }), fontSize: '14px', minHeight: theme.height, minWidth: selectProps.isMulti ? 'min-content' : 'max-content', '.inputIcon': {
|
|
23
|
+
color: isDisabled ? colors.defaultControlColor : !!selectProps.value ? colors.inputTextColor : colors.defaultControlColor,
|
|
24
|
+
} });
|
|
25
|
+
},
|
|
26
|
+
singleValue: function (styles, _a) {
|
|
27
|
+
var selectProps = _a.selectProps, theme = _a.theme, isDisabled = _a.isDisabled;
|
|
28
|
+
return __assign(__assign({}, styles), { position: 'absolute', top: '50%', transform: 'translateY(-50%)', color: selectProps.isInvalid
|
|
29
|
+
? theme.colors.primary
|
|
30
|
+
: isDisabled
|
|
31
|
+
? theme.colors.disabledTextColor
|
|
32
|
+
: theme.colors.inputTextColor, fontSize: '14px', fontWeight: theme.textWeightNormal });
|
|
33
|
+
},
|
|
34
|
+
multiValue: function (styles, state) {
|
|
35
|
+
var theme = state.theme;
|
|
36
|
+
return __assign(__assign({}, styles), { color: theme.colors.inputTextColor, fontWeight: theme.textWeightNormal, backgroundColor: '#E7EBEF', borderRadius: '4px', '& svg': {
|
|
37
|
+
color: theme.colors.inputTextColor,
|
|
38
|
+
}, ' > div': {
|
|
39
|
+
fontSize: '12px',
|
|
40
|
+
} });
|
|
41
|
+
},
|
|
42
|
+
multiValueLabel: function (styles) { return (__assign(__assign({}, styles), { fontSize: 'unset', padding: '5px' })); },
|
|
43
|
+
multiValueRemove: function (styles, _a) {
|
|
44
|
+
var theme = _a.theme;
|
|
45
|
+
return (__assign(__assign({}, styles), { color: theme.colors.inputBorderColor }));
|
|
46
|
+
},
|
|
47
|
+
placeholder: function (styles, state) {
|
|
48
|
+
var theme = state.theme, selectProps = state.selectProps;
|
|
49
|
+
return __assign(__assign({}, styles), { fontSize: '14px', fontWeight: theme.textWeightNormal, textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden', maxWidth: 'calc(100% - 8px)', color: selectProps.isDarkPlaceholderText ? theme.colors.inputTextColor : theme.colors.placeholderTextColor });
|
|
50
|
+
},
|
|
51
|
+
loadingMessage: function (styles, _a) {
|
|
52
|
+
var theme = _a.theme;
|
|
53
|
+
return (__assign(__assign({}, styles), { color: theme.colors.optionTextColor }));
|
|
54
|
+
},
|
|
55
|
+
noOptionsMessage: function (styles, _a) {
|
|
56
|
+
var theme = _a.theme;
|
|
57
|
+
return (__assign(__assign({}, styles), { color: theme.colors.optionTextColor }));
|
|
58
|
+
},
|
|
59
|
+
input: function (styles, _a) {
|
|
60
|
+
var theme = _a.theme;
|
|
61
|
+
return (__assign(__assign({}, styles), { color: theme.colors.inputTextColor }));
|
|
62
|
+
},
|
|
63
|
+
option: function (styles, _a) {
|
|
64
|
+
var isSelected = _a.isSelected, theme = _a.theme, isDisabled = _a.isDisabled, selectProps = _a.selectProps;
|
|
65
|
+
var defaultColor = theme.colors.optionTextColor;
|
|
66
|
+
return {
|
|
67
|
+
color: isSelected ? theme.colors.primary : defaultColor,
|
|
68
|
+
backgroundColor: isSelected ? theme.colors.activeOptionBackground : undefined,
|
|
69
|
+
fontWeight: theme.textWeightNormal,
|
|
70
|
+
fontSize: '14px',
|
|
71
|
+
cursor: !isDisabled ? 'pointer' : 'default',
|
|
72
|
+
display: 'flex',
|
|
73
|
+
flexDirection: 'row',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
padding: '7px 10px',
|
|
76
|
+
height: '36px',
|
|
77
|
+
marginRight: '4px',
|
|
78
|
+
marginBottom: '2px',
|
|
79
|
+
lineHeight: '22px',
|
|
80
|
+
borderRadius: th.radius('ml')({ theme: selectProps === null || selectProps === void 0 ? void 0 : selectProps.systemTheme }),
|
|
81
|
+
'&:hover': {
|
|
82
|
+
backgroundColor: isSelected
|
|
83
|
+
? theme.colors.hoverToActiveOptionBackground
|
|
84
|
+
: !isDisabled
|
|
85
|
+
? theme.colors.menuHoverBackgroundColor
|
|
86
|
+
: undefined,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
menu: function (styles, state) {
|
|
91
|
+
var theme = state.theme;
|
|
92
|
+
return __assign(__assign({}, styles), { boxShadow: '0 2px 20px 0 rgba(0, 0, 0, 0.10);', marginTop: '-0', paddingTop: '0', borderRadius: '10px', zIndex: 3, minWidth: 'max-content', backgroundColor: theme.colors.whiteBackgroundColor });
|
|
93
|
+
},
|
|
94
|
+
menuList: function (styles, _a) {
|
|
95
|
+
var theme = _a.theme;
|
|
96
|
+
return __assign(__assign({}, styles), { margin: '8px 4px 8px 8px', '::-webkit-scrollbar-thumb': {
|
|
97
|
+
border: 'none',
|
|
98
|
+
borderRadius: '4px',
|
|
99
|
+
height: '47px',
|
|
100
|
+
backgroundColor: theme.colors.defaultControlColor,
|
|
101
|
+
'&:hover': {
|
|
102
|
+
backgroundColor: theme.colors.dropdownIndicatorColor,
|
|
103
|
+
},
|
|
104
|
+
}, '::-webkit-scrollbar': {
|
|
105
|
+
width: '10px',
|
|
106
|
+
}, '::-webkit-scrollbar-track': {
|
|
107
|
+
backgroundColor: theme.colors.menuHoverBackgroundColor,
|
|
108
|
+
borderRadius: '6px',
|
|
109
|
+
} });
|
|
110
|
+
},
|
|
111
|
+
dropdownIndicator: function (styles, state) {
|
|
112
|
+
var theme = state.theme, isDisabled = state.isDisabled;
|
|
113
|
+
return __assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', '& svg': {
|
|
114
|
+
stroke: isDisabled ? theme.colors.dropdownIndicatorColor : theme.colors.inputTextColor,
|
|
115
|
+
}, padding: '0px 5px 0px 0px', '@media (min-width: 1024px)': {
|
|
116
|
+
padding: '0px 10px 0px 1px',
|
|
117
|
+
} });
|
|
118
|
+
},
|
|
119
|
+
clearIndicator: function (styles, state) {
|
|
120
|
+
var theme = state.theme;
|
|
121
|
+
return __assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', padding: theme.narrowIndicators ? '0px 0px 0px 2px' : '0px 4px', color: theme.colors.dropdownIndicatorColor });
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
export var getCustomTheme = function (theme, optionVariant, useFilterSubvariant) {
|
|
125
|
+
var inputTextColor = th.color('blue2')({ theme: theme });
|
|
126
|
+
var customColors = {
|
|
127
|
+
primary: th.color('red1')({ theme: theme }),
|
|
128
|
+
inputTextColor: inputTextColor,
|
|
129
|
+
whiteBackgroundColor: th.color('white')({ theme: theme }),
|
|
130
|
+
optionTextColor: th.color('blue2')({ theme: theme }),
|
|
131
|
+
menuHoverBackgroundColor: th.color('bgLightGray1')({ theme: theme }),
|
|
132
|
+
inputDisabledColor: th.color('lightGray1')({ theme: theme }),
|
|
133
|
+
inputBorderColor: th.color('lightGray3')({ theme: theme }),
|
|
134
|
+
placeholderTextColor: th.color('lightGray3')({ theme: theme }),
|
|
135
|
+
defaultControlColor: th.color('lightGray5')({ theme: theme }),
|
|
136
|
+
disabledTextColor: th.color('lightGray6')({ theme: theme }),
|
|
137
|
+
dropdownIndicatorColor: th.color('gray1')({ theme: theme }),
|
|
138
|
+
inputBorderHoverColor: th.color('gray5')({ theme: theme }),
|
|
139
|
+
activeOptionBackground: th.color('red20')({ theme: theme }),
|
|
140
|
+
hoverToActiveOptionBackground: th.color('red30')({ theme: theme }),
|
|
141
|
+
};
|
|
142
|
+
return function (reactSelectTheme) {
|
|
143
|
+
return __assign(__assign({}, reactSelectTheme), { colors: customColors, focusBoxShadow: null, height: useFilterSubvariant ? '32px' : '38px', textWeightNormal: th.fontWeight('normal')({ theme: theme }), optionVariant: optionVariant, borderRadius: th.radius('lg')({ theme: theme }), font: th.font('primary')({ theme: theme }), narrowIndicators: !!useFilterSubvariant });
|
|
144
|
+
};
|
|
145
|
+
};
|