@mailstep/design-system 0.8.21 → 0.8.22-beta.1
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/components/Filters/GridSelect/GridSelect.js +1 -1
- package/ui/Blocks/CommonGrid/components/QuickFilter/QuickFilter.js +4 -1
- package/ui/Blocks/CommonGrid/styles.js +1 -1
- package/ui/Blocks/Header/components/MenuItems/styles.js +1 -1
- package/ui/Blocks/Header/styles.js +2 -2
- package/ui/Blocks/LanguageSwitch/LanguageSwitch.js +5 -10
- package/ui/Blocks/LanguageSwitch/styles.d.ts +5 -0
- package/ui/Blocks/LanguageSwitch/styles.js +11 -3
- package/ui/Blocks/SideMenu/components/HamburgerMenu.js +3 -2
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +1 -1
- package/ui/index.es.js +2274 -2241
- package/ui/index.umd.js +330 -302
package/package.json
CHANGED
|
@@ -104,7 +104,7 @@ var SelectFilter = function (_a) {
|
|
|
104
104
|
var isSelectClearable = isWide ? isClearable : false;
|
|
105
105
|
var placeholderValue = placeholder || (isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined);
|
|
106
106
|
if (isMulti) {
|
|
107
|
-
var placeholderIcon = isWide &&
|
|
107
|
+
var placeholderIcon = isWide && withNotEqComparator ? (isNotEq ? 'notEqual' : 'equals') : null;
|
|
108
108
|
var selectValue = showValue ? (isOptionArray(value) ? value.map(function (option) { return String(option.value); }) : value) : undefined;
|
|
109
109
|
return (_jsx(Select, { maxMenuHeight: 250, onChange: handleOnMultiChange, value: selectValue, options: defaultOptions || options, showSelectAllButton: checkAllButton, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, defaultOptions: defaultOptions, placeholder: placeholderValue, noOptionsMessage: function () { return null; }, containerVariant: isAsync ? 'search' : undefined, placeholderIcon: placeholderIcon, onIconClick: withNotEqComparator ? handleIconClick : undefined, optionVariant: "checkbox", multiLabelVariant: "count", isMulti: true, disabled: disabled, isClearable: isSelectClearable }));
|
|
110
110
|
}
|
|
@@ -6,12 +6,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
import Button from '../../../../Elements/Button';
|
|
7
7
|
import Input from '../../../../Forms/Input';
|
|
8
8
|
import styled, { x } from '@xstyled/styled-components';
|
|
9
|
-
var StyledInput = styled(Input)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: ", ";\n z-index: ", ";\n width:
|
|
9
|
+
var StyledInput = styled(Input)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: ", ";\n z-index: ", ";\n width: ", ";\n"], ["\n position: ", ";\n z-index: ", ";\n width: ", ";\n"])), function (_a) {
|
|
10
10
|
var isMobileInputView = _a.isMobileInputView;
|
|
11
11
|
return (isMobileInputView ? 'absolute' : 'relative');
|
|
12
12
|
}, function (_a) {
|
|
13
13
|
var isMobileInputView = _a.isMobileInputView;
|
|
14
14
|
return (isMobileInputView ? '3' : '1');
|
|
15
|
+
}, function (_a) {
|
|
16
|
+
var isMobileInputView = _a.isMobileInputView;
|
|
17
|
+
return (isMobileInputView ? 'auto' : 'auto');
|
|
15
18
|
});
|
|
16
19
|
var QuickFilter = function (_a) {
|
|
17
20
|
var searchedValue = _a.searchedValue, placeholderText = _a.placeholderText, onChange = _a.onChange, onClick = _a.onClick, displayInput = _a.displayInput, onClear = _a.onClear, isMobileInputView = _a.isMobileInputView, alwaysShowClear = _a.alwaysShowClear;
|
|
@@ -22,7 +22,7 @@ export var CommonGridWrap = styled(x.div)(templateObject_3 || (templateObject_3
|
|
|
22
22
|
return (withPagination ? gridFooterHeight : 0);
|
|
23
23
|
});
|
|
24
24
|
export var StyledButtonStrip = styled(x.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: auto;\n padding: 10px;\n flex-wrap: wrap;\n z-index: 3;\n\n @media (min-width: 768px) {\n min-height: ", "px;\n padding: 18px 20px;\n }\n"], ["\n position: relative;\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: auto;\n padding: 10px;\n flex-wrap: wrap;\n z-index: 3;\n\n @media (min-width: 768px) {\n min-height: ", "px;\n padding: 18px 20px;\n }\n"])), gridButtonStripHeight);
|
|
25
|
-
export var CommonGridWithStyles = styled(CommonGrid)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n & .filterRow {\n display: none;\n }\n\n @media (min-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: flex;\n }\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n & .filterRow {\n display: none;\n }\n\n @media (min-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: flex;\n }\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), function (_a) {
|
|
25
|
+
export var CommonGridWithStyles = styled(CommonGrid)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n & .filterRow {\n display: none;\n }\n\n @media (min-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: flex;\n }\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"], ["\n height: calc(100% - ", "px);\n\n & .cell {\n padding: 0 4px;\n }\n & .dataRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: normal;\n border-bottom: 1px solid;\n border-color: lightGray3;\n height: ", "px;\n }\n & .gridHead {\n height: ", "px;\n background-color: neutral20;\n padding-bottom: 8px;\n position: sticky;\n top: -1px;\n z-index: 2;\n border-top: 1px solid ", ";\n }\n\n & .filterRow {\n display: none;\n }\n\n @media (min-width: 1023px) {\n & .gridHead {\n height: ", "px;\n }\n & .filterRow {\n display: flex;\n }\n }\n & .headRow {\n font-size: 12px;\n font-family: ", ";\n color: typoPrimary;\n font-weight: bold;\n border-bottom: none; // TODO fix in common-grid\n\n & .cell {\n overflow: hidden;\n max-height: 32px;\n position: relative;\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n }\n\n & .filterRow {\n & .cell {\n overflow: visible;\n }\n\n & .cell > div {\n width: 100%; // TODO fix in common-grid\n }\n\n & .sticky {\n background-color: bgLightGray1;\n }\n border-bottom: none; // TODO fix in common-grid\n }\n\n & .body {\n flex-grow: 1;\n }\n\n & .gridWrapper {\n background-color: ", ";\n width: auto;\n padding-bottom: 35px;\n\n @media (min-width: 1024px) {\n height: 100%;\n overflow-y: auto;\n padding-bottom: 0;\n }\n @media print {\n margin: 0;\n width: 100%;\n height: auto;\n overflow-x: hidden;\n }\n }\n\n & .fullWidthGrid > .gridWrapper > div {\n width: 100% !important;\n }\n\n & .paginatorWrapper,\n & .buttonsStrip {\n @media print {\n display: none;\n }\n }\n & .cell {\n padding-left: 4px;\n padding-right: 4px;\n @media print {\n white-space: unset;\n }\n }\n\n .dataRow {\n &.grayedOut {\n background: lightGray1;\n }\n\n .sticky-right,\n .sticky-left {\n background: white;\n }\n\n .sticky-right {\n border-left: 1px solid #dfe1e6;\n }\n\n .sticky-left {\n border-right: 1px solid #dfe1e6;\n }\n\n &:hover,\n &.checked,\n &.selected {\n background-color: red30;\n }\n }\n\n .dataRow:nth-child(even) {\n .sticky-left,\n .sticky-right {\n background-color: bgLightGray;\n }\n }\n\n @media print {\n .filterRow .sticky {\n display: none;\n }\n\n .headRow .sticky {\n display: none;\n }\n\n .dataRow .sticky {\n display: none;\n }\n }\n\n .resizer {\n z-index: unset;\n }\n\n // hotfix table head\n .cell .sortable {\n display: flex;\n align-items: center;\n padding-right: 2px;\n }\n\n .sticky {\n position: sticky !important;\n z-index: 1;\n }\n\n .sticky-left {\n left: 0;\n }\n\n .sticky-right {\n right: 0;\n }\n"])), function (_a) {
|
|
26
26
|
var withButtonStrip = _a.withButtonStrip;
|
|
27
27
|
return (withButtonStrip ? gridButtonStripHeight : 0);
|
|
28
28
|
}, th('fonts.primary'), gridRowHeight, function (_a) {
|
|
@@ -3,7 +3,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled from '@xstyled/styled-components';
|
|
6
|
-
export var MenuItemsList = styled.ul(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display:
|
|
6
|
+
export var MenuItemsList = styled.ul(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: none;\n gap: 10px;\n\n @media (min-width: 1024px) {\n display: flex;\n }\n"], ["\n display: none;\n gap: 10px;\n\n @media (min-width: 1024px) {\n display: flex;\n }\n"])));
|
|
7
7
|
export var MenuItemsListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", ";\n\n a {\n text-decoration: none;\n border-color: red1;\n color: typoPrimary;\n }\n\n a:hover {\n border-bottom: 1px solid;\n color: red1;\n }\n"], ["\n ", ";\n\n a {\n text-decoration: none;\n border-color: red1;\n color: typoPrimary;\n }\n\n a:hover {\n border-bottom: 1px solid;\n color: red1;\n }\n"])), function (_a) {
|
|
8
8
|
var pointer = _a.pointer;
|
|
9
9
|
return pointer && 'cursor: pointer;';
|
|
@@ -4,8 +4,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { headerHeight } from './utils/constants';
|
|
6
6
|
import styled, { th } from '@xstyled/styled-components';
|
|
7
|
-
export var Container = styled.header(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0
|
|
7
|
+
export var Container = styled.header(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n height: ", ";\n border-bottom: 1px solid ", ";\n"], ["\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 20px;\n height: ", ";\n border-bottom: 1px solid ", ";\n"])), headerHeight, th.color('lightGray7'));
|
|
8
8
|
export var LeftSide = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
9
9
|
export var LanguageWrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n"], ["\n display: flex;\n justify-content: flex-end;\n"])));
|
|
10
|
-
export var RightSide = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n gap:
|
|
10
|
+
export var RightSide = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n gap: 20px;\n align-items: center;\n"], ["\n display: flex;\n gap: 20px;\n align-items: center;\n"])));
|
|
11
11
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useMemo,
|
|
3
|
-
import DropdownMenu from '../../Elements/DropdownMenu';
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
4
3
|
import Icon from '../../Elements/Icon/Icon';
|
|
5
|
-
import
|
|
6
|
-
import { StyledFlag, LanguageFlagWrap, LanguageSwitchWrap } from './styles';
|
|
7
|
-
var placementMap = {
|
|
8
|
-
left: 'bottom-start',
|
|
9
|
-
right: 'bottom-end'
|
|
10
|
-
};
|
|
4
|
+
import { useClickOutside } from '../Modal/hooks/useClickOutside';
|
|
5
|
+
import { StyledFlag, LanguageFlagWrap, LanguageSwitchWrap, StyledDropdownMenu } from './styles';
|
|
11
6
|
var LanguageSwitch = function (_a) {
|
|
12
7
|
var activeLanguage = _a.activeLanguage, onLanguageChange = _a.onLanguageChange, languageItems = _a.languageItems, _b = _a.placement, placement = _b === void 0 ? 'right' : _b, withTitle = _a.withTitle, languageFlagWrapBackgroundColor = _a.languageFlagWrapBackgroundColor;
|
|
13
8
|
var _c = useState(false), flagDropdownVisible = _c[0], setFlagDropdownVisible = _c[1];
|
|
14
|
-
var flagWrapRef = useRef(null);
|
|
15
9
|
var onClose = useCallback(function () {
|
|
16
10
|
setFlagDropdownVisible(false);
|
|
17
11
|
}, []);
|
|
12
|
+
var flagMenuRef = useClickOutside({ onClose: onClose });
|
|
18
13
|
var handleFlagClick = useCallback(function () {
|
|
19
14
|
setFlagDropdownVisible(!flagDropdownVisible);
|
|
20
15
|
}, [flagDropdownVisible]);
|
|
@@ -35,6 +30,6 @@ var LanguageSwitch = function (_a) {
|
|
|
35
30
|
}, [filteredLanguages, languageToggle]);
|
|
36
31
|
if (!activeLanguageObj || !languageItems)
|
|
37
32
|
return null;
|
|
38
|
-
return (_jsxs(LanguageSwitchWrap, { children: [_jsxs(LanguageFlagWrap, {
|
|
33
|
+
return (_jsxs(LanguageSwitchWrap, { ref: flagMenuRef, children: [_jsxs(LanguageFlagWrap, { onClick: handleFlagClick, backgroundColor: languageFlagWrapBackgroundColor, withTitle: withTitle, children: [_jsxs(StyledFlag, { children: [activeLanguageObj.icon, withTitle && activeLanguageObj.title] }), _jsx(Icon, { icon: "chevronDown", size: "10px" })] }), _jsx(StyledDropdownMenu, { showMenu: flagDropdownVisible, items: formattedLanguages, placement: placement })] }));
|
|
39
34
|
};
|
|
40
35
|
export default LanguageSwitch;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { Placement } from './types';
|
|
2
|
+
|
|
1
3
|
export declare const StyledFlag: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|
|
4
|
+
export declare const StyledDropdownMenu: import('styled-components').StyledComponent<(<T extends import('../../Elements/DropdownMenu/types').Item>({ items, showMenu, className, ItemComponent, header, footer, ...rest }: import('../../Elements/DropdownMenu/types').DropdownMenuProps<T>) => import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>), import('@xstyled/system').Theme, {
|
|
5
|
+
placement: Placement;
|
|
6
|
+
}, never>;
|
|
2
7
|
export declare const LanguageSwitchWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {}, never>;
|
|
3
8
|
export declare const LanguageFlagWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
4
9
|
backgroundColor?: string | undefined;
|
|
@@ -2,14 +2,22 @@ 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 DropdownMenu from '../../Elements/DropdownMenu';
|
|
5
6
|
import styled from '@xstyled/styled-components';
|
|
6
7
|
export var StyledFlag = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: pointer;\n font-size: 16px;\n display: flex;\n gap: 6px;\n align-items: center;\n"], ["\n cursor: pointer;\n font-size: 16px;\n display: flex;\n gap: 6px;\n align-items: center;\n"])));
|
|
7
|
-
export var
|
|
8
|
-
|
|
8
|
+
export var StyledDropdownMenu = styled(DropdownMenu)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: 30px;\n right: -5px;\n\n width: max-content;\n @media (min-width: 1024px) {\n ", "\n }\n & > ul > a > * {\n display: flex;\n align-items: center;\n }\n\n :before {\n content: '';\n top: -1px;\n right: 15px;\n position: absolute;\n height: 10px;\n width: 10px;\n -webkit-transform: rotate(45deg) translate(-7px);\n -ms-transform: rotate(45deg) translate(-7px);\n transform: rotate(45deg) translate(-7px);\n border-left: 1px solid rgba(0, 0, 0, 0.1);\n background: white;\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n @media (min-width: 1024px) {\n ", "\n }\n }\n"], ["\n position: absolute;\n top: 30px;\n right: -5px;\n\n width: max-content;\n @media (min-width: 1024px) {\n ", "\n }\n & > ul > a > * {\n display: flex;\n align-items: center;\n }\n\n :before {\n content: '';\n top: -1px;\n right: 15px;\n position: absolute;\n height: 10px;\n width: 10px;\n -webkit-transform: rotate(45deg) translate(-7px);\n -ms-transform: rotate(45deg) translate(-7px);\n transform: rotate(45deg) translate(-7px);\n border-left: 1px solid rgba(0, 0, 0, 0.1);\n background: white;\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n @media (min-width: 1024px) {\n ", "\n }\n }\n"])), function (_a) {
|
|
9
|
+
var placement = _a.placement;
|
|
10
|
+
return "".concat(placement, ": -5px");
|
|
11
|
+
}, function (_a) {
|
|
12
|
+
var placement = _a.placement;
|
|
13
|
+
return "".concat(placement, ": 15px");
|
|
14
|
+
});
|
|
15
|
+
export var LanguageSwitchWrap = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items: center;\n width: fit-content;\n"], ["\n position: relative;\n display: flex;\n align-items: center;\n width: fit-content;\n"])));
|
|
16
|
+
export var LanguageFlagWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n padding: 7px 12px;\n border-radius: 10px;\n background: ", ";\n"], ["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n padding: 7px 12px;\n border-radius: 10px;\n background: ", ";\n"])), function (_a) {
|
|
9
17
|
var withTitle = _a.withTitle;
|
|
10
18
|
return (withTitle ? '16px' : '8px');
|
|
11
19
|
}, function (_a) {
|
|
12
20
|
var backgroundColor = _a.backgroundColor;
|
|
13
21
|
return backgroundColor || 'white';
|
|
14
22
|
});
|
|
15
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
23
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -6,7 +6,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { HamburgerMenu as HamburgerMenuIcon } from '../../../Elements/Icon/icons/HamburgerMenu';
|
|
8
8
|
import { MobileCancel } from '../../../Elements/Icon/icons/MobileCancel';
|
|
9
|
-
import { css, x
|
|
9
|
+
import { css, x } from '@xstyled/styled-components';
|
|
10
|
+
import { useTheme } from '@xstyled/styled-components';
|
|
10
11
|
import { th } from '@xstyled/system';
|
|
11
12
|
var HamburgerMenuWrapper = styled(x.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 36px;\n height: 36px;\n border-radius: 70px;\n background-color: ", ";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-shadow: ", ";\n &:hover {\n cursor: pointer;\n }\n\n ", ";\n\n @media (min-width: 1024px) {\n display: none;\n }\n"], ["\n width: 36px;\n height: 36px;\n border-radius: 70px;\n background-color: ", ";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-shadow: ", ";\n &:hover {\n cursor: pointer;\n }\n\n ", ";\n\n @media (min-width: 1024px) {\n display: none;\n }\n"])), th.color('neutral20'), th.shadow('dropShadow'), function (_a) {
|
|
12
13
|
var isLeftMenuOpen = _a.isLeftMenuOpen;
|
|
@@ -18,6 +19,6 @@ export var HamburgerMenuButton = function (_a) {
|
|
|
18
19
|
var theme = useTheme();
|
|
19
20
|
var neutralColor = th.color('neutral20')({ theme: theme });
|
|
20
21
|
var dispalyedIcon = isLeftMenuOpen ? (_jsx(MobileCancel, { fill: neutralColor })) : (_jsx(HamburgerMenuIcon, { fill: neutralColor, stroke: 'none' }));
|
|
21
|
-
return (_jsx(HamburgerMenuWrapper, { mr:
|
|
22
|
+
return (_jsx(HamburgerMenuWrapper, { mr: 3, onClick: onClick, isLeftMenuOpen: !!isLeftMenuOpen, children: dispalyedIcon }));
|
|
22
23
|
};
|
|
23
24
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
import styled, { css } from '@xstyled/styled-components';
|
|
7
|
-
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n
|
|
7
|
+
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"], ["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"])), function (props) {
|
|
8
8
|
return props.hasSeparator && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-top: slim;\n border-color: lightGray2;\n "], ["\n border-top: slim;\n border-color: lightGray2;\n "])));
|
|
9
9
|
});
|
|
10
10
|
var IconWrap = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-right: 10px;\n"], ["\n margin-right: 10px;\n"])));
|