@mailstep/design-system 0.8.16-beta.2 → 0.8.16-beta.21

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.
Files changed (122) hide show
  1. package/package.json +12 -6
  2. package/ui/Blocks/CommonGrid/components/ColumnTitle.js +4 -2
  3. package/ui/Blocks/CommonGrid/components/ControlButtons/styles.d.ts +1 -0
  4. package/ui/Blocks/CommonGrid/components/DropdownButton/DropdownButton.js +1 -1
  5. package/ui/Blocks/CommonGrid/components/ExtraControlButtons/ExtraControlButtons.js +9 -8
  6. package/ui/Blocks/CommonGrid/components/Filters/DatePickerRange/DatePickerRange.js +1 -2
  7. package/ui/Blocks/CommonGrid/components/Filters/GridSelect/GridSelect.js +5 -4
  8. package/ui/Blocks/CommonGrid/components/Filters/TextRange/TextRange.js +1 -1
  9. package/ui/Blocks/CommonGrid/components/IconList/IconList.d.ts +1 -1
  10. package/ui/Blocks/CommonGrid/components/ManageColumnForm/styles.d.ts +2 -2
  11. package/ui/Blocks/CommonGrid/components/MobileFilterModal.js +2 -2
  12. package/ui/Blocks/CommonGrid/components/MobileSortModal.js +1 -1
  13. package/ui/Blocks/CommonGrid/components/QuickFilter/QuickFilter.js +1 -4
  14. package/ui/Blocks/CommonGrid/components/Table.d.ts +28 -28
  15. package/ui/Blocks/CommonGrid/components/Table.js +1 -1
  16. package/ui/Blocks/CommonGrid/hooks/useAddFilter.d.ts +1 -1
  17. package/ui/Blocks/CommonGrid/hooks/useColumnSizes.d.ts +1 -1
  18. package/ui/Blocks/CommonGrid/hooks/useEvent.d.ts +1 -1
  19. package/ui/Blocks/CommonGrid/hooks/useGridActionTrigger.d.ts +1 -1
  20. package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +1 -1
  21. package/ui/Blocks/CommonGrid/hooks/useRowsKeyControls.d.ts +1 -1
  22. package/ui/Blocks/CommonGrid/hooks/useToggleAllCheckbox.d.ts +1 -1
  23. package/ui/Blocks/CommonGrid/hooks/useUxReset.d.ts +1 -1
  24. package/ui/Blocks/CommonGrid/store/index.d.ts +14 -14
  25. package/ui/Blocks/CommonGrid/styles.d.ts +6 -5
  26. package/ui/Blocks/CommonGrid/styles.js +6 -9
  27. package/ui/Blocks/CommonGrid/utils/index.d.ts +1 -1
  28. package/ui/Blocks/Header/components/MenuItems/styles.d.ts +1 -1
  29. package/ui/Blocks/Header/components/MenuItems/styles.js +1 -1
  30. package/ui/Blocks/Header/hooks/useChangeLanguage.js +0 -1
  31. package/ui/Blocks/Header/stories/Header.stories.d.ts +16 -16
  32. package/ui/Blocks/Header/styles.js +2 -2
  33. package/ui/Blocks/ImageList/components/AddPhoto/index.js +2 -2
  34. package/ui/Blocks/ImageList/components/AddPhoto/styles.d.ts +2 -2
  35. package/ui/Blocks/ImageList/components/CloseButton/styles.d.ts +1 -1
  36. package/ui/Blocks/ImageList/components/ImageElement/styles.d.ts +1 -1
  37. package/ui/Blocks/ImageList/styles.d.ts +2 -2
  38. package/ui/Blocks/LanguageSwitch/LanguageSwitch.js +10 -5
  39. package/ui/Blocks/LanguageSwitch/styles.d.ts +2 -7
  40. package/ui/Blocks/LanguageSwitch/styles.js +3 -11
  41. package/ui/Blocks/LoginPage/stories/LoginPage.stories.js +2 -2
  42. package/ui/Blocks/LoginPage/styles.d.ts +2 -3
  43. package/ui/Blocks/Modal/styles.d.ts +7 -7
  44. package/ui/Blocks/Modal/styles.js +8 -8
  45. package/ui/Blocks/Scheduler/components/Groups/styles.d.ts +1 -1
  46. package/ui/Blocks/Scheduler/components/TimeSlots/styles.d.ts +1 -1
  47. package/ui/Blocks/SideMenu/components/Footer.d.ts +1 -1
  48. package/ui/Blocks/SideMenu/components/HamburgerMenu.js +2 -3
  49. package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +1 -0
  50. package/ui/Blocks/SideMenu/styles.d.ts +15 -15
  51. package/ui/Blocks/Stepper/components/StepCircle/styles.d.ts +2 -2
  52. package/ui/Blocks/Stepper/components/StepItem/styles.d.ts +3 -3
  53. package/ui/Blocks/Table/stories/Table.stories.d.ts +3 -2
  54. package/ui/Blocks/Tabs/styles.d.ts +6 -5
  55. package/ui/Elements/Alert/styles.d.ts +18 -17
  56. package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +2 -1
  57. package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.js +2 -2
  58. package/ui/Elements/BarChartSymbol/styles.d.ts +2 -2
  59. package/ui/Elements/BorderedBox/types.d.ts +1 -0
  60. package/ui/Elements/Button/styles.d.ts +6 -5
  61. package/ui/Elements/Card/styles.d.ts +2 -2
  62. package/ui/Elements/Card/types.d.ts +1 -0
  63. package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +2 -2
  64. package/ui/Elements/DatePicker/Datetime/components/FooterRow.d.ts +1 -1
  65. package/ui/Elements/DatePicker/Datetime/views/DaysView.js +1 -1
  66. package/ui/Elements/DatePicker/styles.d.ts +2 -1
  67. package/ui/Elements/DropdownMenu/components/DefaultItem.js +1 -1
  68. package/ui/Elements/Icon/Icon.js +6 -6
  69. package/ui/Elements/Icon/icons/FlagHU.js +1 -1
  70. package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +1 -1
  71. package/ui/Elements/Label/Label.d.ts +1 -1
  72. package/ui/Elements/Label/stories/Label.stories.d.ts +1 -1
  73. package/ui/Elements/Link/stories/Link.stories.d.ts +12 -12
  74. package/ui/Elements/Logo/Logo.js +2 -2
  75. package/ui/Elements/Pagination/styled.d.ts +2 -1
  76. package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +5 -5
  77. package/ui/Elements/ProgressBar/styles.d.ts +1 -1
  78. package/ui/Elements/Select/Select.js +6 -6
  79. package/ui/Elements/Select/components/ConnectedMenu.js +2 -3
  80. package/ui/Elements/Select/components/CountMultiValue.d.ts +10 -1
  81. package/ui/Elements/Select/components/CountMultiValue.js +16 -7
  82. package/ui/Elements/Select/components/DropdownIndicator.d.ts +6 -1
  83. package/ui/Elements/Select/components/DropdownIndicator.js +3 -2
  84. package/ui/Elements/Select/components/IconValueContainer.js +1 -1
  85. package/ui/Elements/Select/components/SimplifiedOption.d.ts +1 -0
  86. package/ui/Elements/Select/stories/Select.stories.d.ts +10 -0
  87. package/ui/Elements/Select/stories/Select.stories.js +15 -0
  88. package/ui/Elements/Select/themes/index.d.ts +1 -1
  89. package/ui/Elements/Select/themes/index.js +4 -14
  90. package/ui/Elements/Select/themes/selectStyles.d.ts +1 -1
  91. package/ui/Elements/Select/themes/selectStyles.js +28 -30
  92. package/ui/Elements/Select/types.d.ts +10 -7
  93. package/ui/Elements/SingleSelect/SingleSelect.d.ts +2 -2
  94. package/ui/Elements/SingleSelect/SingleSelect.js +13 -22
  95. package/ui/Elements/SpaceAround/types.d.ts +1 -0
  96. package/ui/Elements/Spinner/styles.d.ts +1 -1
  97. package/ui/Elements/Tag/types.d.ts +1 -0
  98. package/ui/Elements/Toast/styles.d.ts +1 -1
  99. package/ui/Forms/Checkbox/styles.d.ts +2 -1
  100. package/ui/Forms/Checkbox/styles.js +1 -1
  101. package/ui/Forms/Input/styles.d.ts +3 -3
  102. package/ui/Forms/Input/styles.js +2 -2
  103. package/ui/Forms/TextArea/styles.d.ts +5 -5
  104. package/ui/ThemeProvider/ThemeProvider.d.ts +2 -1
  105. package/ui/ThemeProvider/ThemeProvider.js +1 -1
  106. package/ui/ThemeProvider/themes/dark.d.ts +154 -0
  107. package/ui/ThemeProvider/themes/dark.js +14 -0
  108. package/ui/ThemeProvider/themes/default.d.ts +2 -0
  109. package/ui/ThemeProvider/themes/default.js +13 -9
  110. package/ui/ThemeProvider/themes/index.d.ts +155 -1
  111. package/ui/ThemeProvider/themes/index.js +3 -3
  112. package/ui/ThemeProvider/themes/mailwise.js +1 -1
  113. package/ui/ThemeProvider/types.d.ts +13 -33
  114. package/ui/index.es.js +15390 -16026
  115. package/ui/index.umd.js +502 -516
  116. package/ui/utils/index.js +1 -1
  117. package/ui/utils/translations.d.ts +4 -1
  118. package/ui/utils/translations.js +2 -2
  119. package/ui/Elements/Select/components/ResetAll.d.ts +0 -5
  120. package/ui/Elements/Select/components/ResetAll.js +0 -15
  121. package/ui/ThemeProvider/themes/light.d.ts +0 -4
  122. package/ui/ThemeProvider/themes/light.js +0 -7
@@ -16,16 +16,16 @@ export var CustomStyles = {
16
16
  var _b;
17
17
  var selectProps = _a.selectProps, theme = _a.theme, isFocused = _a.isFocused, isDisabled = _a.isDisabled;
18
18
  var colors = theme.colors;
19
- return __assign(__assign({}, styles), { borderColor: selectProps.isInvalid ? colors.primary : isFocused ? colors.inputTextColor : colors.inputBorderColor, backgroundColor: isDisabled ? colors.menuHoverBackgroundColor : colors.whiteBackgroundColor, boxShadow: theme.focusBoxShadow, borderRadius: theme.borderRadius, '& input': {
19
+ return __assign(__assign({}, styles), { borderColor: selectProps.isInvalid ? colors.primary : isFocused ? colors.inputTextColor : colors.inputBorderColor, backgroundColor: isDisabled ? colors.backgroundColorDisabled : colors.backgroundColor, boxShadow: theme.focusBoxShadow, borderRadius: theme.borderRadius, '& input': {
20
20
  fontWeight: theme.textWeightNormal,
21
- fontFamily: theme.font,
21
+ fontFamily: theme.font
22
22
  }, '&:hover': __assign(__assign({}, ((_b = styles['&:hover']) !== null && _b !== void 0 ? _b : {})), { borderColor: colors.inputBorderHoverColor }), fontSize: '14px', minWidth: 'min-content', '.inputIcon': {
23
- color: isDisabled ? colors.defaultControlColor : !!selectProps.value ? colors.inputTextColor : colors.defaultControlColor,
23
+ color: isDisabled ? colors.defaultControlColor : selectProps.value ? colors.inputTextColor : colors.defaultControlColor
24
24
  } });
25
25
  },
26
26
  valueContainer: function (styles, _a) {
27
27
  var theme = _a.theme;
28
- return __assign(__assign({}, styles), { width: '50px', flexWrap: theme.flexWrap });
28
+ return __assign(__assign({}, styles), { width: '50px', paddingLeft: '7px', flexWrap: theme.flexWrap });
29
29
  },
30
30
  singleValue: function (styles, _a) {
31
31
  var selectProps = _a.selectProps, theme = _a.theme, isDisabled = _a.isDisabled;
@@ -37,10 +37,10 @@ export var CustomStyles = {
37
37
  },
38
38
  multiValue: function (styles, state) {
39
39
  var theme = state.theme;
40
- return __assign(__assign({}, styles), { color: theme.colors.inputTextColor, fontWeight: theme.textWeightNormal, backgroundColor: '#E7EBEF', borderRadius: '4px', '& svg': {
41
- color: theme.colors.inputTextColor,
40
+ return __assign(__assign({}, styles), { color: theme.colors.inputTextColor, fontWeight: theme.textWeightNormal, backgroundColor: theme.colors.multiValueBackgroundColor, borderRadius: '4px', '& svg': {
41
+ color: theme.colors.inputTextColor
42
42
  }, ' > div': {
43
- fontSize: '12px',
43
+ fontSize: '12px'
44
44
  } });
45
45
  },
46
46
  multiValueLabel: function (styles) { return (__assign(__assign({}, styles), { fontSize: 'unset', padding: '5px' })); },
@@ -87,13 +87,13 @@ export var CustomStyles = {
87
87
  ? theme.colors.hoverToActiveOptionBackground
88
88
  : !isDisabled
89
89
  ? theme.colors.menuHoverBackgroundColor
90
- : undefined,
91
- },
90
+ : undefined
91
+ }
92
92
  };
93
93
  },
94
94
  menu: function (styles, state) {
95
95
  var theme = state.theme;
96
- return __assign(__assign({}, styles), { boxShadow: '0 2px 20px 0 rgba(0, 0, 0, 0.10);', marginTop: '4px', paddingTop: '0', borderRadius: '10px', zIndex: 3, minWidth: 'max-content', backgroundColor: theme.colors.whiteBackgroundColor });
96
+ return __assign(__assign({}, styles), { boxShadow: '0 2px 20px 0 rgba(0, 0, 0, 0.10);', marginTop: '4px', paddingTop: '0', borderRadius: '10px', zIndex: 3, minWidth: 'max-content', color: theme.colors.optionTextColor, backgroundColor: theme.colors.menuBackgroundColor });
97
97
  },
98
98
  menuList: function (styles, _a) {
99
99
  var theme = _a.theme;
@@ -103,48 +103,46 @@ export var CustomStyles = {
103
103
  height: '47px',
104
104
  backgroundColor: theme.colors.defaultControlColor,
105
105
  '&:hover': {
106
- backgroundColor: theme.colors.dropdownIndicatorColor,
107
- },
106
+ backgroundColor: theme.colors.dropdownIndicatorColor
107
+ }
108
108
  }, '::-webkit-scrollbar': {
109
- width: '10px',
109
+ width: '10px'
110
110
  }, '::-webkit-scrollbar-track': {
111
111
  backgroundColor: theme.colors.menuHoverBackgroundColor,
112
- borderRadius: '6px',
112
+ borderRadius: '6px'
113
113
  } });
114
114
  },
115
- dropdownIndicator: function (styles, state) {
116
- var theme = state.theme, isDisabled = state.isDisabled;
117
- return __assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', '& svg': {
118
- stroke: isDisabled ? theme.colors.dropdownIndicatorColor : theme.colors.inputTextColor,
119
- }, padding: '0px 5px 0px 0px', '@media (min-width: 1024px)': {
120
- padding: '0px 10px 0px 1px',
121
- } });
115
+ dropdownIndicator: function (styles) {
116
+ return __assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', padding: '0px 7px 0px 0px' });
122
117
  },
123
118
  clearIndicator: function (styles, state) {
124
- var theme = state.theme;
125
- return __assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', padding: theme.narrowIndicators ? '0px 4px 0px 0px' : '0px 4px', color: theme.colors.dropdownIndicatorColor });
119
+ var theme = state.theme, selectProps = state.selectProps;
120
+ return __assign(__assign({}, styles), { justifyContent: 'center', alignItems: 'center', padding: theme.narrowIndicators && selectProps.containerVariant !== 'search' ? '0px' : '0px 4px', color: theme.colors.clearIndicatorColor, cursor: 'pointer' });
126
121
  },
127
122
  indicatorSeparator: function () { return ({
128
- display: 'none',
123
+ display: 'none'
129
124
  }); }
130
125
  };
131
126
  export var getCustomTheme = function (theme, optionVariant, useFilterSubvariant) {
132
- var inputTextColor = th.color('blue2')({ theme: theme });
133
127
  var customColors = {
134
128
  primary: th.color('red1')({ theme: theme }),
135
- inputTextColor: inputTextColor,
136
- whiteBackgroundColor: th.color('white')({ theme: theme }),
137
- optionTextColor: th.color('blue2')({ theme: theme }),
138
- menuHoverBackgroundColor: th.color('bgLightGray1')({ theme: theme }),
129
+ inputTextColor: th.color('blue1')({ theme: theme }),
130
+ backgroundColor: th.color('white')({ theme: theme }),
131
+ backgroundColorDisabled: th.color('neutral20')({ theme: theme }),
132
+ multiValueBackgroundColor: th.color('lightGray7')({ theme: theme }),
133
+ menuBackgroundColor: th.color('white')({ theme: theme }),
134
+ optionTextColor: th.color('textPrimary')({ theme: theme }),
135
+ menuHoverBackgroundColor: th.color('neutral20')({ theme: theme }),
139
136
  inputDisabledColor: th.color('lightGray1')({ theme: theme }),
140
137
  inputBorderColor: th.color('lightGray3')({ theme: theme }),
141
138
  placeholderTextColor: th.color('lightGray3')({ theme: theme }),
139
+ clearIndicatorColor: th.color('lightGray4')({ theme: theme }),
142
140
  defaultControlColor: th.color('lightGray5')({ theme: theme }),
143
141
  disabledTextColor: th.color('lightGray6')({ theme: theme }),
144
142
  dropdownIndicatorColor: th.color('gray1')({ theme: theme }),
145
143
  inputBorderHoverColor: th.color('gray5')({ theme: theme }),
146
144
  activeOptionBackground: th.color('red20')({ theme: theme }),
147
- hoverToActiveOptionBackground: th.color('red30')({ theme: theme }),
145
+ hoverToActiveOptionBackground: th.color('red30')({ theme: theme })
148
146
  };
149
147
  return function (reactSelectTheme) {
150
148
  return __assign(__assign({}, reactSelectTheme), { colors: customColors, focusBoxShadow: null, height: '38px', flexWrap: useFilterSubvariant ? 'nowrap' : 'wrap', textWeightNormal: th.fontWeight('normal')({ theme: theme }), optionVariant: optionVariant, borderRadius: th.radius('lg')({ theme: theme }), font: th.font('primary')({ theme: theme }), narrowIndicators: !!useFilterSubvariant });
@@ -25,21 +25,21 @@ export type SelectProps = {
25
25
  loadOptions?: (text: string) => Promise<Option[]>;
26
26
  defaultOptions?: Option[];
27
27
  onChange: (value: ValueType) => void;
28
- onBlur?: Function;
28
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
29
29
  error?: string;
30
30
  index?: [];
31
31
  isInvalid?: boolean;
32
32
  isLoading?: boolean;
33
33
  spaceAround?: SpaceAround;
34
34
  disabled?: boolean;
35
- onInputChange?: Function;
35
+ onInputChange?: (value: string) => void;
36
36
  useSimplifiedOptions?: boolean;
37
37
  showSelectAllButton?: boolean;
38
- showResetGridButton?: boolean;
39
38
  isClearable?: boolean;
40
39
  isSearchable?: boolean;
41
40
  isMulti?: boolean;
42
41
  shortValues?: boolean;
42
+ shortVariant?: 'block' | 'join';
43
43
  menuIsOpen?: boolean;
44
44
  defaultMenuIsOpen?: boolean;
45
45
  isDarkPlaceholderText?: boolean;
@@ -51,18 +51,20 @@ export type SelectProps = {
51
51
  innerRef?: RefObject<HTMLElement>;
52
52
  className?: string;
53
53
  maxMenuHeight?: number;
54
- resetGrid?: Function;
55
- getOptionValue?: Function;
54
+ getOptionValue?: (selectedOption: ValueType) => any;
56
55
  systemTheme?: Theme;
57
56
  menuPlacement?: string;
58
- onIconClick?: Function;
57
+ onIconClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
59
58
  };
60
59
  export type BaseColors = {
61
60
  primary: string;
62
61
  optionTextColor: string;
63
62
  inputDisabledColor: string;
64
63
  inputBorderColor: string;
65
- whiteBackgroundColor: string;
64
+ backgroundColor: string;
65
+ backgroundColorDisabled: string;
66
+ multiValueBackgroundColor: string;
67
+ menuBackgroundColor: string;
66
68
  inputTextColor: string;
67
69
  placeholderTextColor: string;
68
70
  activeOptionBackground: string;
@@ -72,6 +74,7 @@ export type BaseColors = {
72
74
  dropdownIndicatorColor: string;
73
75
  hoverToActiveOptionBackground: string;
74
76
  defaultControlColor: string;
77
+ clearIndicatorColor: string;
75
78
  };
76
79
  type BaseState<ThemeType = BaseColors> = {
77
80
  theme: ThemeType;
@@ -1,12 +1,12 @@
1
1
  import { default as React } from 'react';
2
2
  import { SelectProps, Option } from '../Select/types';
3
3
 
4
- type FieldValueType = string | number | Array<string | number> | null;
4
+ export type FieldValueType = string | number | Array<string | number> | null;
5
5
  export type Props = Omit<SelectProps, 'onChange' | 'loadOptions'> & {
6
6
  onChange?: (event: {
7
7
  target: Record<string, FieldValueType>;
8
8
  }) => void;
9
- onValueChange?: Function;
9
+ onValueChange?: (value: FieldValueType) => void;
10
10
  asyncLoadMinChars?: number;
11
11
  preload?: boolean;
12
12
  isLocked?: boolean;
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
19
  });
20
20
  };
21
21
  var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
24
  function verb(n) { return function (v) { return step([n, v]); }; }
25
25
  function step(op) {
26
26
  if (f) throw new TypeError("Generator is already executing.");
@@ -64,7 +64,7 @@ import omit from 'lodash/fp/omit';
64
64
  var CREATE = "_create_".concat(nanoid(), "_");
65
65
  var defaultFilterOption = createFilter();
66
66
  var creatableFilterOption = function (option, rawInput) {
67
- if ((option === null || option === void 0 ? void 0 : option.value) == CREATE)
67
+ if ((option === null || option === void 0 ? void 0 : option.value) === CREATE)
68
68
  return true;
69
69
  return defaultFilterOption(option, rawInput);
70
70
  };
@@ -88,7 +88,7 @@ var SingleSelect = function (props) {
88
88
  if (!loadOptions)
89
89
  return i18n._({ id: 'components.dropdown.noOptions', message: 'No options' });
90
90
  if (inputValue.length < asyncLoadMinChars)
91
- return i18n._({ id: 'components.dropdown.writeMoreChars', message: 'Write at least ${asyncLoadMinChars} characters.' });
91
+ return i18n._({ id: 'components.dropdown.writeMoreChars', message: "Write at least ".concat(asyncLoadMinChars, " characters.") });
92
92
  return i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' });
93
93
  }, [loadOptions, asyncLoadMinChars]);
94
94
  var handleLoadOptions = useCallback(function (inputValue) { return __awaiter(void 0, void 0, void 0, function () {
@@ -119,19 +119,21 @@ var SingleSelect = function (props) {
119
119
  var _f = useState(options || []), loadedDefaultOptions = _f[0], setLoadedDefaultOptions = _f[1];
120
120
  useEffect(function () {
121
121
  if (loadOptions && preload && !props.value)
122
- loadOptions('', false).then(setLoadedDefaultOptions);
122
+ loadOptions('', false).then(setLoadedDefaultOptions).catch(console.error);
123
123
  // eslint-disable-next-line react-hooks/exhaustive-deps
124
124
  }, [loadOptions]); // this is intentional
125
125
  var _g = useState(null), storedSelectedOption = _g[0], setStoredSelectedOption = _g[1];
126
126
  useEffect(function () {
127
- if (initialOptions && initialOptions.length) {
128
- var selectedOption = initialOptions.find(function (option) { return option.value == props.value; }) || null;
127
+ if (initialOptions === null || initialOptions === void 0 ? void 0 : initialOptions.length) {
128
+ var selectedOption = initialOptions.find(function (option) { return option.value === props.value; }) || null;
129
129
  setStoredSelectedOption(selectedOption);
130
130
  }
131
131
  if (loadOptions && !initialOptions && props.value) {
132
- loadOptions(String(props.value), true).then(function (selectedOptions) {
132
+ loadOptions(String(props.value), true)
133
+ .then(function (selectedOptions) {
133
134
  setStoredSelectedOption((selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions[0]) || null);
134
- });
135
+ })
136
+ .catch(console.error);
135
137
  }
136
138
  // ignored because of props.value, this only finds option for initial value
137
139
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -147,7 +149,7 @@ var SingleSelect = function (props) {
147
149
  return __generator(this, function (_e) {
148
150
  switch (_e.label) {
149
151
  case 0:
150
- if (!(onCreateOption && (option === null || option === void 0 ? void 0 : option.value) == CREATE)) return [3 /*break*/, 4];
152
+ if (!(onCreateOption && (option === null || option === void 0 ? void 0 : option.value) === CREATE)) return [3 /*break*/, 4];
151
153
  if (!((option === null || option === void 0 ? void 0 : option.inputValue) && ((_b = (_a = option === null || option === void 0 ? void 0 : option.inputValue) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.length) < 2)) return [3 /*break*/, 1];
152
154
  props === null || props === void 0 ? void 0 : props.form.setFieldTouched(name, true, true);
153
155
  props === null || props === void 0 ? void 0 : props.form.setFieldError(name, i18n._({ id: 'form.general.min2Chars', message: 'Minimal length is 2 characters.' }));
@@ -182,17 +184,6 @@ var SingleSelect = function (props) {
182
184
  }
183
185
  });
184
186
  }); }, [onCreateOption, loadOptions, onChange, onValueChange, props === null || props === void 0 ? void 0 : props.form, name]);
185
- var handleBlur = useCallback(function (option) {
186
- if (onBlur) {
187
- onBlur({
188
- target: {
189
- name: name,
190
- type: 'blur',
191
- value: getOptionValue(option)
192
- }
193
- });
194
- }
195
- }, [name, onBlur]);
196
187
  var omitted = ['onValueChange', 'placeholder', 'options', 'loadOptions', 'asyncLoadMinChars'];
197
188
  var displayLockedText = isLocked && !disabled;
198
189
  var placeholderValue = displayLockedText ? lockedText : placeholder;
@@ -204,6 +195,6 @@ var SingleSelect = function (props) {
204
195
  return staticOptions || undefined;
205
196
  return staticOptions ? __spreadArray(__spreadArray([], staticOptions, true), [storedSelectedOption], false) : [storedSelectedOption];
206
197
  }, [asAsync, loadedDefaultOptions, onCreateOption, options, storedSelectedOption]);
207
- return (_jsx(Select, __assign({}, omit(omitted, props), { filterOption: (filterOption || creatableFilterOption), disabled: disabled || isLocked, onChange: handleChange, onBlur: handleBlur, placeholder: placeholderValue, loadingMessage: loadingMessage, noOptionsMessage: noOptionsMessage, loadOptions: asAsync ? handleLoadOptions : undefined, containerVariant: asAsync ? 'search' : undefined, defaultOptions: defaultOptions, options: !asAsync ? options : undefined, isLoading: isCreating || props.isLoading })));
198
+ return (_jsx(Select, __assign({}, omit(omitted, props), { filterOption: (filterOption || creatableFilterOption), disabled: disabled || isLocked, onChange: handleChange, onBlur: onBlur, placeholder: placeholderValue, loadingMessage: loadingMessage, noOptionsMessage: noOptionsMessage, loadOptions: asAsync ? handleLoadOptions : undefined, containerVariant: asAsync ? 'search' : undefined, defaultOptions: defaultOptions, options: !asAsync ? options : undefined, isLoading: isCreating || props.isLoading })));
208
199
  };
209
200
  export default SingleSelect;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type SpaceAroundProps = {
2
3
  marginTop?: number;
3
4
  marginRight?: number;
@@ -1,4 +1,4 @@
1
1
  export declare const Svg: import('styled-components').StyledComponent<"svg", import('@xstyled/system').Theme, {
2
- $variant: "default" | "sm";
2
+ $variant: 'default' | 'sm';
3
3
  }, never>;
4
4
  export declare const Circle: import('styled-components').StyledComponent<"circle", import('@xstyled/system').Theme, {}, never>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type Props = {
2
3
  color?: string;
3
4
  textColor?: string;
@@ -3,6 +3,6 @@ export declare const Text: import('styled-components').StyledComponent<"span", i
3
3
  export declare const ContentWrapper: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
4
4
  export declare const CloseWrapper: import('styled-components').StyledComponent<"span", import('@xstyled/system').Theme, {}, never>;
5
5
  export declare const Container: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
6
- autoClose?: number;
6
+ autoClose?: number | undefined;
7
7
  fill: string;
8
8
  }, never>;
@@ -1,7 +1,8 @@
1
+ /// <reference types="react" />
1
2
  export declare const FakeInput: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
2
3
  size: string | number;
3
4
  }, never>;
4
- export declare const CheckIcon: import('styled-components').StyledComponent<import('react').FC<import('../..').IconProps>, import('@xstyled/system').Theme, {
5
+ export declare const CheckIcon: import('styled-components').StyledComponent<import('react').FC<import('../../Elements/Icon').IconProps>, import('@xstyled/system').Theme, {
5
6
  size: string | number;
6
7
  }, never>;
7
8
  export declare const CheckboxWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
@@ -2,8 +2,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
2
2
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
3
  return cooked;
4
4
  };
5
- import styled, { th } from '@xstyled/styled-components';
6
5
  import { Icon } from '../../Elements/Icon';
6
+ import styled, { th } from '@xstyled/styled-components';
7
7
  export var FakeInput = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n min-width: ", ";\n height: ", ";\n border-radius: md;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n transform: rotate(0);\n overflow: hidden;\n border: slim;\n border-color: lightGray5;\n\n input[type='checkbox']:not(:disabled):hover + & {\n border-color: gray1;\n }\n\n input[type='checkbox']:disabled + & {\n background-color: white;\n border-color: lightGray7;\n }\n\n input[type='checkbox']:checked:disabled + & {\n background-color: bgLightGray1;\n border-color: bgLightGray1;\n }\n\n input[type='checkbox']:checked:not(:disabled) + & {\n transform: rotate(0deg);\n background-color: red1;\n border-color: red1;\n }\n\n input[type='checkbox']:not(:checked):not(:disabled) + & {\n transform: rotate(90deg);\n background-color: white;\n border-color: lightGray5;\n }\n"], ["\n width: ", ";\n min-width: ", ";\n height: ", ";\n border-radius: md;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n transform: rotate(0);\n overflow: hidden;\n border: slim;\n border-color: lightGray5;\n\n input[type='checkbox']:not(:disabled):hover + & {\n border-color: gray1;\n }\n\n input[type='checkbox']:disabled + & {\n background-color: white;\n border-color: lightGray7;\n }\n\n input[type='checkbox']:checked:disabled + & {\n background-color: bgLightGray1;\n border-color: bgLightGray1;\n }\n\n input[type='checkbox']:checked:not(:disabled) + & {\n transform: rotate(0deg);\n background-color: red1;\n border-color: red1;\n }\n\n input[type='checkbox']:not(:checked):not(:disabled) + & {\n transform: rotate(90deg);\n background-color: white;\n border-color: lightGray5;\n }\n"])), function (_a) {
8
8
  var size = _a.size;
9
9
  return size;
@@ -32,9 +32,9 @@ export declare const Suffix: import('styled-components').StyledComponent<"div",
32
32
  export declare const InputRow: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
33
33
  hasValue: boolean;
34
34
  disabled: boolean;
35
- $icon?: string;
36
- $isInvalid?: boolean;
37
- variant?: string;
35
+ $icon?: string | undefined;
36
+ $isInvalid?: boolean | undefined;
37
+ variant?: string | undefined;
38
38
  }, never>;
39
39
  export declare const Tooltip: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
40
40
  export {};
@@ -29,10 +29,10 @@ export var IconsController = styled.div(templateObject_3 || (templateObject_3 =
29
29
  export var IconWrapper = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n svg {\n :hover {\n cursor: pointer;\n color: blue2;\n }\n }\n"], ["\n display: flex;\n svg {\n :hover {\n cursor: pointer;\n color: blue2;\n }\n }\n"])));
30
30
  export var StyledInput = styled.input.attrs(function (props) { return ({
31
31
  as: props.$asTextArea ? 'textarea' : 'input'
32
- }); })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n border: slim;\n border-color: ", ";\n box-sizing: border-box;\n background-clip: padding-box;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n padding-right: ", "em;\n display: block;\n width: ", ";\n font-family: ", ";\n font-size: 14px;\n font-weight: normal;\n transition: inputTransition;\n resize: none;\n overflow: hidden;\n\n ~ ", " {\n svg {\n stroke: lightGray3;\n }\n }\n\n ::placeholder {\n color: gray1;\n opacity: 1;\n }\n\n :focus {\n background-color: white;\n border-color: blue2;\n color: typoPrimary;\n outline: 0;\n\n ~ ", " {\n svg {\n stroke: blue2;\n color: blue2;\n }\n }\n }\n ", ";\n ", ";\n :disabled,\n :disabled:hover {\n background-color: bgLightGray1;\n border-color: lightGray6;\n color: neutral300;\n }\n\n text-overflow: ellipsis;\n\n -moz-appearance: textfield;\n appearance: textfield;\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n"], ["\n ", ";\n border: slim;\n border-color: ", ";\n box-sizing: border-box;\n background-clip: padding-box;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n padding-right: ", "em;\n display: block;\n width: ", ";\n font-family: ", ";\n font-size: 14px;\n font-weight: normal;\n transition: inputTransition;\n resize: none;\n overflow: hidden;\n\n ~ ", " {\n svg {\n stroke: lightGray3;\n }\n }\n\n ::placeholder {\n color: gray1;\n opacity: 1;\n }\n\n :focus {\n background-color: white;\n border-color: blue2;\n color: typoPrimary;\n outline: 0;\n\n ~ ", " {\n svg {\n stroke: blue2;\n color: blue2;\n }\n }\n }\n ", ";\n ", ";\n :disabled,\n :disabled:hover {\n background-color: bgLightGray1;\n border-color: lightGray6;\n color: neutral300;\n }\n\n text-overflow: ellipsis;\n\n -moz-appearance: textfield;\n appearance: textfield;\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n"])), system, function (_a) {
32
+ }); })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n border: slim;\n border-color: ", ";\n background-color: white;\n box-sizing: border-box;\n background-clip: padding-box;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n padding-right: ", "em;\n display: block;\n width: ", ";\n font-family: ", ";\n font-size: 14px;\n font-weight: normal;\n transition: inputTransition;\n resize: none;\n overflow: hidden;\n\n ~ ", " {\n svg {\n stroke: lightGray3;\n }\n }\n\n ::placeholder {\n color: gray1;\n opacity: 1;\n }\n\n :focus {\n background-color: white;\n border-color: blue2;\n color: typoPrimary;\n outline: 0;\n\n ~ ", " {\n svg {\n stroke: blue2;\n color: blue2;\n }\n }\n }\n ", ";\n ", ";\n :disabled,\n :disabled:hover {\n background-color: neutral30;\n border-color: lightGray6;\n color: neutral300;\n }\n\n text-overflow: ellipsis;\n\n -moz-appearance: textfield;\n appearance: textfield;\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n"], ["\n ", ";\n border: slim;\n border-color: ", ";\n background-color: white;\n box-sizing: border-box;\n background-clip: padding-box;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n padding-right: ", "em;\n display: block;\n width: ", ";\n font-family: ", ";\n font-size: 14px;\n font-weight: normal;\n transition: inputTransition;\n resize: none;\n overflow: hidden;\n\n ~ ", " {\n svg {\n stroke: lightGray3;\n }\n }\n\n ::placeholder {\n color: gray1;\n opacity: 1;\n }\n\n :focus {\n background-color: white;\n border-color: blue2;\n color: typoPrimary;\n outline: 0;\n\n ~ ", " {\n svg {\n stroke: blue2;\n color: blue2;\n }\n }\n }\n ", ";\n ", ";\n :disabled,\n :disabled:hover {\n background-color: neutral30;\n border-color: lightGray6;\n color: neutral300;\n }\n\n text-overflow: ellipsis;\n\n -moz-appearance: textfield;\n appearance: textfield;\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n }\n"])), system, function (_a) {
33
33
  var $isInvalid = _a.$isInvalid;
34
34
  return ($isInvalid ? th.color('red1') : th.color('lightGray6'));
35
- }, function (props) { return resolvePaddingRight(props); }, function (props) { return props.type !== 'checkbox' ? '100%' : 'auto'; }, th('fonts.primary'), InputIcon, InputIcon, function (_a) {
35
+ }, function (props) { return resolvePaddingRight(props); }, function (props) { return (props.type !== 'checkbox' ? '100%' : 'auto'); }, th('fonts.primary'), InputIcon, InputIcon, function (_a) {
36
36
  var big = _a.big;
37
37
  return big
38
38
  ? css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-size: 30px;\n color: gray;\n font-weight: semiBold;\n padding: 0 0.5rem 0 1.25rem;\n "], ["\n font-size: 30px;\n color: gray;\n font-weight: semiBold;\n padding: 0 0.5rem 0 1.25rem;\n "]))) : '';
@@ -1,12 +1,12 @@
1
1
  export declare const IconWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
2
2
  export declare const StyledTextArea: import('styled-components').StyledComponent<"textarea", import('@xstyled/system').Theme, {
3
- $resize?: string;
4
- $isInvalid?: boolean;
5
- disabled?: boolean;
3
+ $resize?: string | undefined;
4
+ $isInvalid?: boolean | undefined;
5
+ disabled?: boolean | undefined;
6
6
  }, never>;
7
7
  export declare const TextAreaWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
8
8
  export declare const BorderWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
9
- $isInvalid?: boolean;
10
- disabled?: boolean;
9
+ $isInvalid?: boolean | undefined;
10
+ disabled?: boolean | undefined;
11
11
  }, never>;
12
12
  export declare const InnerWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
@@ -1,5 +1,6 @@
1
+ import { FC } from 'react';
1
2
  import { Props } from './types';
2
3
 
3
4
  export declare const LanguageContext: import('react').Context<string>;
4
- declare const MailstepThemeProvider: ({ children, theme, preflight, language }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ declare const MailstepThemeProvider: FC<Props>;
5
6
  export default MailstepThemeProvider;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext } from 'react';
2
3
  import { ThemeProvider, Preflight } from '@xstyled/styled-components';
3
4
  import themes from './themes';
4
- import { createContext } from 'react';
5
5
  export var LanguageContext = createContext('en');
6
6
  var MailstepThemeProvider = function (_a) {
7
7
  var children = _a.children, _b = _a.theme, theme = _b === void 0 ? 'default' : _b, _c = _a.preflight, preflight = _c === void 0 ? true : _c, _d = _a.language, language = _d === void 0 ? 'en' : _d;
@@ -0,0 +1,154 @@
1
+ declare const darkTheme: {
2
+ colors: {
3
+ bgLightGray: string;
4
+ bgLightGray1: string;
5
+ typoPrimary: string;
6
+ textPrimary: string;
7
+ white: string;
8
+ lightGray7: string;
9
+ neutral20: string;
10
+ red1: string;
11
+ red20: string;
12
+ red30: string;
13
+ blue2: string;
14
+ lightGray1: string;
15
+ blue3: string;
16
+ lightGray2: string;
17
+ lightGray3: string;
18
+ lightGray4: string;
19
+ lightGray5: string;
20
+ lightGray6: string;
21
+ neutral10: string;
22
+ neutral30: string;
23
+ neutral300: string;
24
+ neutral500: string;
25
+ gray: string;
26
+ gray1: string;
27
+ gray2: string;
28
+ gray3: string;
29
+ gray4: string;
30
+ gray5: string;
31
+ blue1: string;
32
+ blue4: string;
33
+ textTertiary: string;
34
+ blue10: string;
35
+ blue20: string;
36
+ blue30: string;
37
+ blue40: string;
38
+ blue50: string;
39
+ blue60: string;
40
+ blue70: string;
41
+ blue80: string;
42
+ blue90: string;
43
+ teal20: string;
44
+ teal40: string;
45
+ teal50: string;
46
+ teal60: string;
47
+ teal70: string;
48
+ teal80: string;
49
+ teal90: string;
50
+ green10: string;
51
+ green20: string;
52
+ green30: string;
53
+ green50: string;
54
+ green60: string;
55
+ green70: string;
56
+ green80: string;
57
+ green90: string;
58
+ green: string;
59
+ successColor: string;
60
+ darkGreen: string;
61
+ orange20: string;
62
+ orange30: string;
63
+ orange50: string;
64
+ orange60: string;
65
+ orange80: string;
66
+ yellow10: string;
67
+ yellow20: string;
68
+ yellow60: string;
69
+ yellow70: string;
70
+ yellow1: string;
71
+ yellow2: string;
72
+ red10: string;
73
+ red50: string;
74
+ red70: string;
75
+ red2: string;
76
+ red3: string;
77
+ red60: string;
78
+ red80: string;
79
+ dangerColor: string;
80
+ purple20: string;
81
+ purple40: string;
82
+ purple50: string;
83
+ purple60: string;
84
+ purple80: string;
85
+ purple90: string;
86
+ magenta10: string;
87
+ magenta20: string;
88
+ magenta30: string;
89
+ magenta40: string;
90
+ magenta50: string;
91
+ magenta60: string;
92
+ magenta70: string;
93
+ magenta80: string;
94
+ magenta90: string;
95
+ };
96
+ shadows: {
97
+ dialogShadow: string;
98
+ boxShadow: string;
99
+ dropShadow: string;
100
+ inputFocusBoxShadow: string;
101
+ dropdownMenuShadow: string;
102
+ tooltipBoxShadow: string;
103
+ cardShadow: string;
104
+ smooth: string;
105
+ headerShadow: string;
106
+ headerShadowB: string;
107
+ headerShadowNotifications: string;
108
+ cornerDialogShadow: string;
109
+ gridShadow: string;
110
+ tooltipShadow: string;
111
+ };
112
+ breakpoints: string[];
113
+ fonts: {
114
+ primary: string;
115
+ heading: string;
116
+ };
117
+ fontLinks: string[];
118
+ fontSizes: string[];
119
+ lineHeights: number[];
120
+ fontWeights: {
121
+ light: number;
122
+ normal: number;
123
+ medium: number;
124
+ semiBold: number;
125
+ bold: number;
126
+ };
127
+ letterSpacings: {
128
+ default: null;
129
+ sm: string;
130
+ md: string;
131
+ lg: string;
132
+ };
133
+ borders: {
134
+ slim: string;
135
+ mediumSlim: string;
136
+ medium: string;
137
+ mediumThick: string;
138
+ thick: string;
139
+ };
140
+ radii: {
141
+ sm: string;
142
+ md: string;
143
+ ml: string;
144
+ lg: string;
145
+ xl: string;
146
+ };
147
+ space: number[];
148
+ transitions: {
149
+ simpleLong: string;
150
+ inputTransition: string;
151
+ };
152
+ zIndices: number[];
153
+ };
154
+ export default darkTheme;
@@ -0,0 +1,14 @@
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 defaultTheme from './default';
13
+ var darkTheme = __assign(__assign({}, defaultTheme), { colors: __assign(__assign({}, defaultTheme.colors), { bgLightGray: '#131A27', bgLightGray1: '#2a4054', typoPrimary: '#ffffff', textPrimary: '#ffffff', white: '#2a4054', lightGray7: '#5f5f5f', neutral20: '#2a4054', red1: '#d0d0d0', red20: '#5f5f5f', red30: '#8594A5', blue2: '#ffffff', lightGray1: '#162C3F', blue3: '#2a4054' }), shadows: __assign(__assign({}, defaultTheme.shadows), { dialogShadow: '0px 4px 23px 0px rgba(255, 255, 255, 0.08)' }) });
14
+ export default darkTheme;
@@ -11,7 +11,9 @@ declare const defaultTheme: {
11
11
  lightGray5: string;
12
12
  lightGray6: string;
13
13
  lightGray7: string;
14
+ neutral10: string;
14
15
  neutral20: string;
16
+ neutral30: string;
15
17
  neutral300: string;
16
18
  neutral500: string;
17
19
  gray: string;