@mailstep/design-system 0.6.37-beta.0 → 0.6.38
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/storybook/utils/columnDefinition.js +10 -2
- package/ui/Blocks/CommonGrid/types.d.ts +0 -1
- package/ui/Blocks/CornerDialog/styles.js +1 -1
- package/ui/Elements/Icon/icons/ArrowForward.d.ts +3 -0
- package/ui/Elements/{Select/components/CustomInput.js → Icon/icons/ArrowForward.js} +1 -7
- package/ui/Elements/Icon/icons/index.d.ts +1 -0
- package/ui/Elements/Icon/icons/index.js +1 -0
- package/ui/Elements/Select/themes/CustomComponents.d.ts +8 -0
- package/ui/Elements/Select/themes/CustomComponents.js +137 -0
- package/ui/Elements/Select/themes/index.js +2 -8
- package/ui/Elements/Select/themes/selectStyles.d.ts +39 -1
- package/ui/Elements/Select/types.d.ts +1 -38
- package/ui/index.es.js +9824 -9742
- package/ui/index.umd.js +377 -374
- package/ui/Elements/Select/components/ChevronOption.d.ts +0 -2
- package/ui/Elements/Select/components/ChevronOption.js +0 -23
- package/ui/Elements/Select/components/ConnectedMenu.d.ts +0 -2
- package/ui/Elements/Select/components/ConnectedMenu.js +0 -21
- package/ui/Elements/Select/components/CountMultiValue.d.ts +0 -2
- package/ui/Elements/Select/components/CountMultiValue.js +0 -33
- package/ui/Elements/Select/components/CustomInput.d.ts +0 -2
- package/ui/Elements/Select/components/DropdownIndicator.d.ts +0 -2
- package/ui/Elements/Select/components/DropdownIndicator.js +0 -28
- package/ui/Elements/Select/components/IconValueContainer.d.ts +0 -2
- package/ui/Elements/Select/components/IconValueContainer.js +0 -45
- package/ui/Elements/Select/components/ResetAll.d.ts +0 -5
- package/ui/Elements/Select/components/ResetAll.js +0 -15
- package/ui/Elements/Select/components/SelectAll.d.ts +0 -11
- package/ui/Elements/Select/components/SelectAll.js +0 -56
- package/ui/Elements/Select/components/SelectedIndicator.d.ts +0 -2
- package/ui/Elements/Select/components/SelectedIndicator.js +0 -8
- package/ui/Elements/Select/components/SimplifiedOption.d.ts +0 -3
- package/ui/Elements/Select/components/SimplifiedOption.js +0 -11
package/package.json
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
1
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
11
|
import React from 'react';
|
|
3
12
|
export var oversizedArrayColumns = 25;
|
|
@@ -19,8 +28,7 @@ export var enumColumn = {
|
|
|
19
28
|
name: 'enumColumn',
|
|
20
29
|
title: 'Enum Column',
|
|
21
30
|
flexBasis: 160,
|
|
22
|
-
filterOptions: enumValues.map(function (v) { return ({ value: v, label: v }); }),
|
|
23
|
-
filterExtraProps: { isMulti: true, checkAllButton: true },
|
|
31
|
+
filterOptions: __spreadArray([{ value: '', label: 'all' }], enumValues.map(function (v) { return ({ value: v, label: v }); }), true),
|
|
24
32
|
filtering: true,
|
|
25
33
|
sorting: false,
|
|
26
34
|
};
|
|
@@ -113,7 +113,6 @@ export type ColumnDefinition<ColumnName extends string = string> = ColumnBasePro
|
|
|
113
113
|
isBigInt?: boolean;
|
|
114
114
|
isUuid?: boolean;
|
|
115
115
|
defaultComparator?: string;
|
|
116
|
-
checkAllButton?: boolean;
|
|
117
116
|
};
|
|
118
117
|
getFilterCriteria?: (value: string) => {
|
|
119
118
|
[column: string]: any;
|
|
@@ -3,7 +3,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled, { th } from '@xstyled/styled-components';
|
|
6
|
-
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right:
|
|
6
|
+
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 0.6rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 95vw;\n max-width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n @media (min-width: 768px) {\n right: 3rem;\n width: 400px;\n }\n"], ["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 0.6rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 95vw;\n max-width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n @media (min-width: 768px) {\n right: 3rem;\n width: 400px;\n }\n"])), function (_a) {
|
|
7
7
|
var $mounted = _a.$mounted;
|
|
8
8
|
return ($mounted ? 1 : 0);
|
|
9
9
|
});
|
|
@@ -10,10 +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
|
-
|
|
14
|
-
export var CustomInput = function (props) {
|
|
15
|
-
var name = props.selectProps.name;
|
|
16
|
-
var value = !!name ? "".concat(name, "Inp") : props.id;
|
|
17
|
-
return _jsx(selectComponents.Input, __assign({}, props, { "data-cy": value }));
|
|
18
|
-
};
|
|
19
|
-
export default CustomInput;
|
|
13
|
+
export var ArrowForward = function (props) { return (_jsx("svg", __assign({ width: "7", height: "11", viewBox: "0 0 7 11", fill: "#A3B3C1" }, props, { children: _jsx("path", { d: "M0.244995 9.565L1.13 10.45L6.08 5.5L1.13 0.550003L0.244995 1.435L4.31 5.5L0.244995 9.565Z" }) }))); };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const SimplifiedOption: React.MemoExoticComponent<(props: any) => any>;
|
|
3
|
+
export declare const IconValueContainer: (props: any) => any;
|
|
4
|
+
export declare const CountMultiValue: (props: any) => any;
|
|
5
|
+
export declare const ChevronOption: (props: any) => any;
|
|
6
|
+
export declare const ConnectedMenu: (props: any) => any;
|
|
7
|
+
export declare const CustomInput: (props: any) => any;
|
|
8
|
+
export declare const DropdownIndicator: (props: any) => any;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { useCallback, memo, useState, useEffect, useRef } from 'react';
|
|
29
|
+
import { components } from 'react-select';
|
|
30
|
+
import styled, { th } from '@xstyled/styled-components';
|
|
31
|
+
import { components as selectComponents } from 'react-select';
|
|
32
|
+
import { Trans } from '@lingui/react';
|
|
33
|
+
import Icon from '../../Icon/Icon';
|
|
34
|
+
import { Paragraph3 } from '../../Typography/Typography';
|
|
35
|
+
import Checkbox from '../../../Forms/Checkbox/Checkbox';
|
|
36
|
+
import Toggle from '../../Toggle/Toggle';
|
|
37
|
+
import { ArrowDown } from '../../Icon/icons/ArrowDown';
|
|
38
|
+
import { ArrowUp } from '../../Icon/icons/ArrowUp';
|
|
39
|
+
// Option for big lists
|
|
40
|
+
var SimplifiedOptionInner = function (props) {
|
|
41
|
+
var styles = props.getStyles('option', props);
|
|
42
|
+
var data = props.data, selectOption = props.selectOption, innerProps = props.innerProps;
|
|
43
|
+
var handleClick = useCallback(function () { return selectOption(data); }, [data, selectOption]);
|
|
44
|
+
return (_jsx("div", { style: styles, onClick: handleClick, onMouseOver: innerProps.onMouseOver, onMouseMove: innerProps.onMouseMove, children: props.label }));
|
|
45
|
+
};
|
|
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); });
|
|
47
|
+
// Value container with icon
|
|
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
|
+
});
|
|
52
|
+
export var IconValueContainer = function (props) {
|
|
53
|
+
var _a;
|
|
54
|
+
// eslint-disable-next-line react/prop-types
|
|
55
|
+
var children = props.children, rest = __rest(props, ["children"]);
|
|
56
|
+
var icon = (_a = rest.selectProps) === null || _a === void 0 ? void 0 : _a.icon;
|
|
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 }))] }));
|
|
59
|
+
};
|
|
60
|
+
// MultiValue container with count of selected options
|
|
61
|
+
var StyledNumber = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n height: 25px;\n justify-content: center;\n align-items: center;\n display: flex;\n border-radius: md;\n padding: 2px 6px;\n"], ["\n background: ", ";\n height: 25px;\n justify-content: center;\n align-items: center;\n display: flex;\n border-radius: md;\n padding: 2px 6px;\n"])), th.color('lightGray7'));
|
|
62
|
+
export var CountMultiValue = function (props) {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
var selectVal = props.selectProps.value;
|
|
65
|
+
var inputVal = props.selectProps.inputValue;
|
|
66
|
+
if (!inputVal && ((_a = props.data) === null || _a === void 0 ? void 0 : _a.value) == ((_b = selectVal[0]) === null || _b === void 0 ? void 0 : _b.value)) {
|
|
67
|
+
return (_jsxs(_Fragment, { children: [_jsx(selectComponents.MultiValue, __assign({}, props, { children: props.children })), selectVal.length > 1 ? _jsxs(StyledNumber, { children: ["+", selectVal.length - 1] }) : null] }));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
// Option with chevron form new design
|
|
74
|
+
var ChevronDiv = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-self: center;\n display: flex;\n"], ["\n align-self: center;\n display: flex;\n"])));
|
|
75
|
+
var SelectedIndicator = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding-right: 12px;\n"], ["\n padding-right: 12px;\n"])));
|
|
76
|
+
export var ChevronOption = function (props) {
|
|
77
|
+
var theme = props.theme, isSelected = props.isSelected, selectOption = props.selectOption, children = props.children, data = props.data;
|
|
78
|
+
var showCheckbox = !!(theme.optionVariant == 'checkbox');
|
|
79
|
+
var showToggle = !!(theme.optionVariant == 'toggle');
|
|
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 })] })));
|
|
81
|
+
};
|
|
82
|
+
// menu with check all and reset config button
|
|
83
|
+
var SelectAll = styled.div(templateObject_5 || (templateObject_5 = __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) {
|
|
84
|
+
var additionalPadding = _a.additionalPadding;
|
|
85
|
+
return (additionalPadding ? '8px 27px 8px 10px' : '8px 10px');
|
|
86
|
+
}, function (_a) {
|
|
87
|
+
var isSelected = _a.isSelected;
|
|
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'));
|
|
95
|
+
});
|
|
96
|
+
var ConfigWrap = styled.div(templateObject_6 || (templateObject_6 = __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"])));
|
|
97
|
+
export var ConnectedMenu = function (props) {
|
|
98
|
+
var theme = props.theme;
|
|
99
|
+
var _a = props.selectProps, resetGrid = _a.resetGrid, onCustomSelectAll = _a.onCustomSelectAll, onCustomDeselectAll = _a.onCustomDeselectAll, value = _a.value, options = _a.options, resetGridButton = _a.resetGridButton, selectAllButton = _a.selectAllButton, maxMenuHeight = _a.maxMenuHeight;
|
|
100
|
+
var showCheckbox = !!(theme.optionVariant === 'checkbox');
|
|
101
|
+
var showToggle = !!(theme.optionVariant === 'toggle');
|
|
102
|
+
var _b = useState(false), isSelected = _b[0], setIsSelected = _b[1];
|
|
103
|
+
var _c = useState(false), additionalPadding = _c[0], setAdditionalPadding = _c[1];
|
|
104
|
+
var ref = useRef(null);
|
|
105
|
+
useEffect(function () {
|
|
106
|
+
var _a;
|
|
107
|
+
// if the height of all options is higher than maxMenuHeight and the slider is displayed => the indentation needs to be increased
|
|
108
|
+
((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) && setAdditionalPadding(ref.current.offsetHeight * options.length > maxMenuHeight);
|
|
109
|
+
if (value) {
|
|
110
|
+
options.length === value.length && setIsSelected(true);
|
|
111
|
+
options.length !== value.length && setIsSelected(false);
|
|
112
|
+
}
|
|
113
|
+
else
|
|
114
|
+
return;
|
|
115
|
+
}, [additionalPadding, maxMenuHeight, options.length, value]);
|
|
116
|
+
var selectAll = useCallback(function () {
|
|
117
|
+
if (!isSelected) {
|
|
118
|
+
setIsSelected(true);
|
|
119
|
+
onCustomSelectAll();
|
|
120
|
+
}
|
|
121
|
+
else if (isSelected) {
|
|
122
|
+
setIsSelected(false);
|
|
123
|
+
onCustomDeselectAll();
|
|
124
|
+
}
|
|
125
|
+
}, [isSelected, onCustomDeselectAll, onCustomSelectAll]);
|
|
126
|
+
return (_jsxs(selectComponents.Menu, __assign({}, props, { children: [selectAllButton && (_jsxs(SelectAll, { isSelected: isSelected, onClick: selectAll, ref: ref, additionalPadding: additionalPadding, children: [(showCheckbox || showToggle) && (_jsxs(SelectedIndicator, { children: [showCheckbox && _jsx(Checkbox, { checked: isSelected, size: 2, readOnly: true }), showToggle && _jsx(Toggle, { name: "", checked: isSelected, spaceAround: false, variant: 'grid' })] })), _jsx(Trans, { id: "datagrid.filterCell.selectAllLabel", message: 'select all' })] })), props.children, resetGridButton && (_jsx(ConfigWrap, { onClick: resetGrid, children: _jsx(Paragraph3, { variant: "semiBold", children: _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }) }) }))] })));
|
|
127
|
+
};
|
|
128
|
+
export var CustomInput = function (props) {
|
|
129
|
+
var name = props.selectProps.name;
|
|
130
|
+
var value = !!name ? "".concat(name, "Inp") : props.id;
|
|
131
|
+
return _jsx(selectComponents.Input, __assign({}, props, { "data-cy": value }));
|
|
132
|
+
};
|
|
133
|
+
export var DropdownIndicator = function (props) {
|
|
134
|
+
var _a = props.selectProps, menuIsOpen = _a.menuIsOpen, name = _a.name;
|
|
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" }) }) })));
|
|
136
|
+
};
|
|
137
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import ConnectedMenu from '
|
|
2
|
-
import IconValueContainer from '../components/IconValueContainer';
|
|
3
|
-
import SimplifiedOption from '../components/SimplifiedOption';
|
|
4
|
-
import CountMultiValue from '../components/CountMultiValue';
|
|
5
|
-
import ChevronOption from '../components/ChevronOption';
|
|
6
|
-
import DropdownIndicator from '../components/DropdownIndicator';
|
|
7
|
-
import CustomInput from '../components/CustomInput';
|
|
1
|
+
import { SimplifiedOption, IconValueContainer, CountMultiValue, ChevronOption, DropdownIndicator, CustomInput, ConnectedMenu, } from './CustomComponents';
|
|
8
2
|
import { getCustomTheme as getFormCustomTheme, CustomStyles as SelectCustomStyles } from './selectStyles';
|
|
9
3
|
import { useTheme } from '@xstyled/styled-components';
|
|
10
4
|
import { useMemo } from 'react';
|
|
@@ -25,7 +19,7 @@ export var useStylesAndComponents = function (style, optionVariant, multiLabelVa
|
|
|
25
19
|
components.DropdownIndicator = null;
|
|
26
20
|
}
|
|
27
21
|
if (showResetGridButton || showSelectAllButton) {
|
|
28
|
-
components.
|
|
22
|
+
components.Menu = ConnectedMenu;
|
|
29
23
|
}
|
|
30
24
|
components.Input = CustomInput;
|
|
31
25
|
var themes = getFormCustomTheme(systemTheme, optionVariant, style == 'gridFilter');
|
|
@@ -1,4 +1,42 @@
|
|
|
1
|
-
import { SelectProps
|
|
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
|
+
flexWrap: 'wrap' | 'nowrap';
|
|
38
|
+
};
|
|
39
|
+
type State = BaseState<CustomTheme>;
|
|
2
40
|
export declare const CustomStyles: StylesConfig<State>;
|
|
3
41
|
type ThemeGetter = (theme: any) => CustomTheme;
|
|
4
42
|
export declare const getCustomTheme: (theme: any, optionVariant: Required<SelectProps>['optionVariant'], useFilterSubvariant: boolean) => ThemeGetter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { SpaceAround } from '../SpaceAround/types';
|
|
3
|
-
import { Theme
|
|
3
|
+
import { Theme } from 'react-select';
|
|
4
4
|
export type Option<Value = string | number> = {
|
|
5
5
|
value: Value;
|
|
6
6
|
label: string | number;
|
|
@@ -53,40 +53,3 @@ export type SelectProps = {
|
|
|
53
53
|
systemTheme?: Theme;
|
|
54
54
|
menuPlacement?: string;
|
|
55
55
|
};
|
|
56
|
-
export type BaseColors = {
|
|
57
|
-
primary: string;
|
|
58
|
-
optionTextColor: string;
|
|
59
|
-
inputDisabledColor: string;
|
|
60
|
-
inputBorderColor: string;
|
|
61
|
-
whiteBackgroundColor: string;
|
|
62
|
-
inputTextColor: string;
|
|
63
|
-
placeholderTextColor: string;
|
|
64
|
-
activeOptionBackground: string;
|
|
65
|
-
disabledTextColor: string;
|
|
66
|
-
inputBorderHoverColor: string;
|
|
67
|
-
menuHoverBackgroundColor: string;
|
|
68
|
-
dropdownIndicatorColor: string;
|
|
69
|
-
hoverToActiveOptionBackground: string;
|
|
70
|
-
defaultControlColor: string;
|
|
71
|
-
};
|
|
72
|
-
type BaseState<ThemeType = BaseColors> = {
|
|
73
|
-
theme: ThemeType;
|
|
74
|
-
isSelected: boolean;
|
|
75
|
-
isFocused: boolean;
|
|
76
|
-
isDisabled: boolean;
|
|
77
|
-
isMulti: boolean;
|
|
78
|
-
selectProps: SelectProps;
|
|
79
|
-
} & ControlProps;
|
|
80
|
-
export type StylesConfig<T = BaseState> = Record<string, (styles: CSSObjectWithLabel, state: T) => CSSObjectWithLabel>;
|
|
81
|
-
export type CustomTheme = {
|
|
82
|
-
colors: BaseColors;
|
|
83
|
-
height: string | number;
|
|
84
|
-
focusBoxShadow?: string;
|
|
85
|
-
textWeightNormal: string;
|
|
86
|
-
optionVariant: Required<SelectProps>['optionVariant'];
|
|
87
|
-
borderRadius: string;
|
|
88
|
-
font: string;
|
|
89
|
-
narrowIndicators: boolean;
|
|
90
|
-
flexWrap: 'wrap' | 'nowrap';
|
|
91
|
-
};
|
|
92
|
-
export {};
|