@citygross/components 0.7.80 → 0.7.81
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/build/@types/components/IconText/IconText.d.ts +1 -2
- package/build/@types/components/Nav/Nav.d.ts +1 -2
- package/build/@types/components/NavMainLink/NavMainLink.d.ts +1 -2
- package/build/@types/components/SearchBar/SearchBar.d.ts +1 -2
- package/build/@types/components/SideModal/SideModal.d.ts +1 -1
- package/build/cjs/components/src/components/IconText/IconText.js +20 -0
- package/build/cjs/components/src/components/IconText/IconText.js.map +1 -0
- package/build/cjs/components/src/components/IconText/IconText.styles.js +5 -1
- package/build/cjs/components/src/components/IconText/IconText.styles.js.map +1 -1
- package/build/cjs/components/src/components/Nav/Nav.js +77 -0
- package/build/cjs/components/src/components/Nav/Nav.js.map +1 -0
- package/build/cjs/components/src/components/Nav/Nav.styles.js +12 -6
- package/build/cjs/components/src/components/Nav/Nav.styles.js.map +1 -1
- package/build/cjs/components/src/components/NavMainLink/NavMainLink.js +18 -0
- package/build/cjs/components/src/components/NavMainLink/NavMainLink.js.map +1 -0
- package/build/cjs/components/src/components/NavMainLink/NavMainLink.styled.js +5 -1
- package/build/cjs/components/src/components/NavMainLink/NavMainLink.styled.js.map +1 -1
- package/build/cjs/components/src/components/SearchBar/SearchBar.js +34 -0
- package/build/cjs/components/src/components/SearchBar/SearchBar.js.map +1 -0
- package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js +13 -5
- package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js.map +1 -1
- package/build/cjs/components/src/index.js +8 -7
- package/build/cjs/components/src/index.js.map +1 -1
- package/build/es/components/src/components/IconText/IconText.js +12 -0
- package/build/es/components/src/components/IconText/IconText.js.map +1 -0
- package/build/es/components/src/components/IconText/IconText.styles.js +3 -1
- package/build/es/components/src/components/IconText/IconText.styles.js.map +1 -1
- package/build/es/components/src/components/Nav/Nav.js +69 -0
- package/build/es/components/src/components/Nav/Nav.js.map +1 -0
- package/build/es/components/src/components/Nav/Nav.styles.js +7 -7
- package/build/es/components/src/components/NavMainLink/NavMainLink.js +10 -0
- package/build/es/components/src/components/NavMainLink/NavMainLink.js.map +1 -0
- package/build/es/components/src/components/NavMainLink/NavMainLink.styled.js +3 -1
- package/build/es/components/src/components/NavMainLink/NavMainLink.styled.js.map +1 -1
- package/build/es/components/src/components/SearchBar/SearchBar.js +26 -0
- package/build/es/components/src/components/SearchBar/SearchBar.js.map +1 -0
- package/build/es/components/src/components/SearchBar/SearchBar.styles.js +7 -5
- package/build/es/components/src/components/SearchBar/SearchBar.styles.js.map +1 -1
- package/build/es/components/src/index.js +4 -7
- package/build/es/components/src/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,5 +5,4 @@ export declare type TIconText = {
|
|
|
5
5
|
showOnlyIcon?: boolean;
|
|
6
6
|
spacing?: number;
|
|
7
7
|
};
|
|
8
|
-
declare const IconText: ({ icon, spacing, children, showOnlyIcon }: TIconText) => JSX.Element;
|
|
9
|
-
export default IconText;
|
|
8
|
+
export declare const IconText: ({ icon, spacing, children, showOnlyIcon }: TIconText) => JSX.Element;
|
|
@@ -16,5 +16,4 @@ export declare type TNav = {
|
|
|
16
16
|
searchValue?: string;
|
|
17
17
|
onSearchClick?: () => void;
|
|
18
18
|
};
|
|
19
|
-
declare const Nav: ({ logo, maxWidth, height, topPosition, mainLinks, mainLinksBorderColor, rightContent, searchResultElement, searchCancelLabel, searchIcon, searchPlaceHolder, searchOnChange, searchValue, onSearchClick }: TNav) => JSX.Element;
|
|
20
|
-
export default Nav;
|
|
19
|
+
export declare const Nav: ({ logo, maxWidth, height, topPosition, mainLinks, mainLinksBorderColor, rightContent, searchResultElement, searchCancelLabel, searchIcon, searchPlaceHolder, searchOnChange, searchValue, onSearchClick }: TNav) => JSX.Element;
|
|
@@ -5,5 +5,4 @@ export declare type TNavMainLink = {
|
|
|
5
5
|
target?: '_blank' | '_self';
|
|
6
6
|
borderColor?: string;
|
|
7
7
|
};
|
|
8
|
-
declare const NavMainLink: ({ text, href, target, active, borderColor }: TNavMainLink) => JSX.Element;
|
|
9
|
-
export default NavMainLink;
|
|
8
|
+
export declare const NavMainLink: ({ text, href, target, active, borderColor }: TNavMainLink) => JSX.Element;
|
|
@@ -9,5 +9,4 @@ export declare type TSearchBar = styles.SearchInputProps & {
|
|
|
9
9
|
isOpen?: boolean;
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
};
|
|
12
|
-
declare const SearchBar: ({ flexGrow, isValid, inputSize, activeBorderColor, cancelLabel, icon, value, resultBoxTopPosition, children, inputRef, isOpen, onCancelClick, ...props }: TSearchBar) => JSX.Element;
|
|
13
|
-
export default SearchBar;
|
|
12
|
+
export declare const SearchBar: ({ flexGrow, isValid, inputSize, activeBorderColor, cancelLabel, icon, value, resultBoxTopPosition, children, inputRef, isOpen, onCancelClick, ...props }: TSearchBar) => JSX.Element;
|
|
@@ -7,6 +7,6 @@ export declare type TSideModal = {
|
|
|
7
7
|
isVisible?: boolean;
|
|
8
8
|
querySelector?: string;
|
|
9
9
|
slideFrom?: 'left' | 'right';
|
|
10
|
-
overlayBackground
|
|
10
|
+
overlayBackground?: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const SideModal: ({ onBackdropClick, background, overlayBackground, width, isVisible, slideFrom, querySelector, children }: TSideModal) => React.ReactPortal | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var IconText_styles = require('./IconText.styles.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
var IconText = function (_a) {
|
|
13
|
+
var icon = _a.icon, spacing = _a.spacing, children = _a.children, showOnlyIcon = _a.showOnlyIcon;
|
|
14
|
+
return (React__default["default"].createElement(IconText_styles.IconTextContainer, { spacing: spacing },
|
|
15
|
+
icon,
|
|
16
|
+
!showOnlyIcon && children));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.IconText = IconText;
|
|
20
|
+
//# sourceMappingURL=IconText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconText.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
4
6
|
var styled = require('styled-components');
|
|
5
7
|
|
|
@@ -7,6 +9,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
9
|
|
|
8
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
9
11
|
|
|
10
|
-
styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
|
|
12
|
+
var IconTextContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
|
|
11
13
|
var templateObject_1;
|
|
14
|
+
|
|
15
|
+
exports.IconTextContainer = IconTextContainer;
|
|
12
16
|
//# sourceMappingURL=IconText.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var designTokens = require('@citygross/design-tokens');
|
|
6
|
+
var utils = require('@citygross/utils');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var NavMainLink = require('../NavMainLink/NavMainLink.js');
|
|
9
|
+
var SearchBar = require('../SearchBar/SearchBar.js');
|
|
10
|
+
var Nav_styles = require('./Nav.styles.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
|
|
16
|
+
var Nav = function (_a) {
|
|
17
|
+
var _b, _c;
|
|
18
|
+
var logo = _a.logo, maxWidth = _a.maxWidth, height = _a.height, topPosition = _a.topPosition, mainLinks = _a.mainLinks, _d = _a.mainLinksBorderColor, mainLinksBorderColor = _d === void 0 ? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.primary : _d, rightContent = _a.rightContent, searchResultElement = _a.searchResultElement, searchCancelLabel = _a.searchCancelLabel, searchIcon = _a.searchIcon, searchPlaceHolder = _a.searchPlaceHolder, searchOnChange = _a.searchOnChange, searchValue = _a.searchValue, onSearchClick = _a.onSearchClick;
|
|
19
|
+
var searchContainerRef = React.useRef(null);
|
|
20
|
+
var searchInputRef = React.useRef(null);
|
|
21
|
+
var navRef = React.useRef(null);
|
|
22
|
+
var width = utils.useWindowSize().width;
|
|
23
|
+
var _e = React.useState(0), elToRemove = _e[0], setElToRemove = _e[1];
|
|
24
|
+
var widthRef = React.useRef(null);
|
|
25
|
+
var checkWidth = function () {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
if ((navRef === null || navRef === void 0 ? void 0 : navRef.current) &&
|
|
28
|
+
((_a = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) < ((_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.scrollWidth)) {
|
|
29
|
+
setElToRemove(function (prev) { return prev + 1; });
|
|
30
|
+
widthRef.current = width;
|
|
31
|
+
}
|
|
32
|
+
else if ((widthRef === null || widthRef === void 0 ? void 0 : widthRef.current) && width >= (widthRef === null || widthRef === void 0 ? void 0 : widthRef.current)) {
|
|
33
|
+
setElToRemove(0);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
React.useEffect(function () {
|
|
37
|
+
var debounce = setTimeout(function () {
|
|
38
|
+
checkWidth();
|
|
39
|
+
}, 300);
|
|
40
|
+
return function () {
|
|
41
|
+
clearTimeout(debounce);
|
|
42
|
+
};
|
|
43
|
+
}, [width]);
|
|
44
|
+
var _f = React.useState(false), openSearch = _f[0], setOpenSearch = _f[1];
|
|
45
|
+
React__default["default"].useEffect(function () {
|
|
46
|
+
var handleClick = function (event) {
|
|
47
|
+
var _a;
|
|
48
|
+
if ((searchContainerRef === null || searchContainerRef === void 0 ? void 0 : searchContainerRef.current) &&
|
|
49
|
+
!((_a = searchContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
50
|
+
event.stopPropagation();
|
|
51
|
+
setOpenSearch(false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
document.addEventListener('click', function (e) { return handleClick(e); }, true);
|
|
55
|
+
return function () {
|
|
56
|
+
document.removeEventListener('click', function (e) { return handleClick(e); }, true);
|
|
57
|
+
};
|
|
58
|
+
}, [searchContainerRef]);
|
|
59
|
+
return (React__default["default"].createElement(Nav_styles.Nav, { height: height, topPosition: topPosition, ref: navRef },
|
|
60
|
+
React__default["default"].createElement(Nav_styles.NavContainer, { maxWidth: maxWidth },
|
|
61
|
+
logo,
|
|
62
|
+
React__default["default"].createElement(Nav_styles.NavChildContainer, null,
|
|
63
|
+
openSearch ? (React__default["default"].createElement(Nav_styles.NavSearchContainer, { ref: searchContainerRef },
|
|
64
|
+
React__default["default"].createElement(SearchBar.SearchBar, { icon: searchIcon, cancelLabel: searchCancelLabel, flexGrow: 1, placeholder: searchPlaceHolder, onChange: searchOnChange, value: searchValue, inputRef: searchInputRef, onCancelClick: function () {
|
|
65
|
+
setOpenSearch(false);
|
|
66
|
+
}, isOpen: openSearch }, searchResultElement))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
67
|
+
React__default["default"].createElement(Nav_styles.NavMainLinks, null, (_c = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, mainLinks.length - elToRemove)) === null || _c === void 0 ? void 0 : _c.map(function (link) { return (React__default["default"].createElement(NavMainLink.NavMainLink, { text: link.text, active: link.active, borderColor: mainLinksBorderColor, href: link.href, key: link.text, target: link.target })); })),
|
|
68
|
+
React__default["default"].createElement(Nav_styles.NavDummySearchContainer, { onClick: function () {
|
|
69
|
+
onSearchClick ? onSearchClick() : setOpenSearch(true);
|
|
70
|
+
} },
|
|
71
|
+
React__default["default"].createElement(SearchBar.SearchBar, { icon: searchIcon, flexGrow: 1, placeholder: searchPlaceHolder })))),
|
|
72
|
+
rightContent)),
|
|
73
|
+
React__default["default"].createElement(Nav_styles.SearchResultOverlay, { show: openSearch })));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
exports.Nav = Nav;
|
|
77
|
+
//# sourceMappingURL=Nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -9,14 +9,20 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
11
|
|
|
12
|
-
styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
|
|
13
|
-
styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
14
|
-
styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
|
|
15
|
-
styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
12
|
+
var Nav = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
|
|
13
|
+
var NavContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
14
|
+
var NavChildContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
|
|
15
|
+
var NavMainLinks = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
16
16
|
var NavDummySearchContainer = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"], ["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
17
|
-
styled__default["default"](NavDummySearchContainer)(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
|
|
18
|
-
styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
|
|
17
|
+
var NavSearchContainer = styled__default["default"](NavDummySearchContainer)(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
|
|
18
|
+
var SearchResultOverlay = styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
|
|
19
19
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
20
20
|
|
|
21
|
+
exports.Nav = Nav;
|
|
22
|
+
exports.NavChildContainer = NavChildContainer;
|
|
23
|
+
exports.NavContainer = NavContainer;
|
|
21
24
|
exports.NavDummySearchContainer = NavDummySearchContainer;
|
|
25
|
+
exports.NavMainLinks = NavMainLinks;
|
|
26
|
+
exports.NavSearchContainer = NavSearchContainer;
|
|
27
|
+
exports.SearchResultOverlay = SearchResultOverlay;
|
|
22
28
|
//# sourceMappingURL=Nav.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nav.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Nav.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var NavMainLink_styled = require('./NavMainLink.styled.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
|
|
12
|
+
var NavMainLink = function (_a) {
|
|
13
|
+
var text = _a.text, href = _a.href, _b = _a.target, target = _b === void 0 ? '_self' : _b, active = _a.active, borderColor = _a.borderColor;
|
|
14
|
+
return (React__default["default"].createElement(NavMainLink_styled.MainLinkContainer, { href: href, target: target, active: active, borderColor: borderColor }, text));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.NavMainLink = NavMainLink;
|
|
18
|
+
//# sourceMappingURL=NavMainLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavMainLink.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
4
6
|
var styled = require('styled-components');
|
|
5
7
|
|
|
@@ -7,10 +9,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
9
|
|
|
8
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
9
11
|
|
|
10
|
-
styled__default["default"].a(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
|
|
12
|
+
var MainLinkContainer = styled__default["default"].a(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
|
|
11
13
|
var _a, _b;
|
|
12
14
|
return (props === null || props === void 0 ? void 0 : props.active) &&
|
|
13
15
|
"\n box-shadow: inset 0 -4px 0 " + ((_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary) + ";\n ";
|
|
14
16
|
}, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary; });
|
|
15
17
|
var templateObject_1;
|
|
18
|
+
|
|
19
|
+
exports.MainLinkContainer = MainLinkContainer;
|
|
16
20
|
//# sourceMappingURL=NavMainLink.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var SearchBar_styles = require('./SearchBar.styles.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
var SearchBar = function (_a) {
|
|
14
|
+
var flexGrow = _a.flexGrow, isValid = _a.isValid, _b = _a.inputSize, inputSize = _b === void 0 ? 'medium' : _b, activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, icon = _a.icon, value = _a.value, resultBoxTopPosition = _a.resultBoxTopPosition, children = _a.children, inputRef = _a.inputRef, isOpen = _a.isOpen, onCancelClick = _a.onCancelClick, props = _tslib.__rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "onCancelClick"]);
|
|
15
|
+
React.useEffect(function () {
|
|
16
|
+
var _a;
|
|
17
|
+
if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) {
|
|
18
|
+
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
19
|
+
}
|
|
20
|
+
}, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current]);
|
|
21
|
+
console.log(isOpen, '__________OPEN');
|
|
22
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
23
|
+
React__default["default"].createElement(SearchBar_styles.SearchBarContainer, { activeBorderColor: activeBorderColor, inputSize: inputSize, flexGrow: flexGrow, isOpen: isOpen },
|
|
24
|
+
React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, icon),
|
|
25
|
+
React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ flexGrow: flexGrow, isValid: isValid, inputSize: inputSize, activeBorderColor: activeBorderColor, ref: inputRef }, props, { value: value })),
|
|
26
|
+
cancelLabel ? (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { onClick: function (e) {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
onCancelClick && onCancelClick();
|
|
29
|
+
}, isOpen: isOpen }, cancelLabel)) : null,
|
|
30
|
+
React__default["default"].createElement(SearchBar_styles.SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen }, children))));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.SearchBar = SearchBar;
|
|
34
|
+
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
4
6
|
var styled = require('styled-components');
|
|
5
7
|
|
|
@@ -7,13 +9,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
9
|
|
|
8
10
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
9
11
|
|
|
10
|
-
styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
|
|
11
|
-
styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
12
|
-
styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
|
|
12
|
+
var SearchResultContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
|
|
13
|
+
var SearchRightLabel = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
14
|
+
var SearchBarContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
|
|
13
15
|
return props.isOpen &&
|
|
14
16
|
"\n flex-direction: row;\n box-shadow: inset 0 0 2px " + props.activeBorderColor + ";\n ";
|
|
15
17
|
});
|
|
16
|
-
styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
|
|
18
|
+
var SearchInput = styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
|
|
17
19
|
var _a, _b;
|
|
18
20
|
return props.inputSize === 'small'
|
|
19
21
|
? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs
|
|
@@ -24,6 +26,12 @@ styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.
|
|
|
24
26
|
? (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2
|
|
25
27
|
: (_b = props.theme.typography) === null || _b === void 0 ? void 0 : _b.size.s3;
|
|
26
28
|
}, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
|
|
27
|
-
styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
29
|
+
var SearchLeftIcon = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
28
30
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
31
|
+
|
|
32
|
+
exports.SearchBarContainer = SearchBarContainer;
|
|
33
|
+
exports.SearchInput = SearchInput;
|
|
34
|
+
exports.SearchLeftIcon = SearchLeftIcon;
|
|
35
|
+
exports.SearchResultContainer = SearchResultContainer;
|
|
36
|
+
exports.SearchRightLabel = SearchRightLabel;
|
|
29
37
|
//# sourceMappingURL=SearchBar.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -64,14 +64,11 @@ var TwoColumnsPageContainer = require('./containers/TwoColumnsContainer/TwoColum
|
|
|
64
64
|
var UnorderedList_styles = require('./components/UnorderedList/UnorderedList.styles.js');
|
|
65
65
|
var WarningLabel = require('./components/WarningLabel/WarningLabel.js');
|
|
66
66
|
var MobileTable_styles = require('./components/MobileTable/MobileTable.styles.js');
|
|
67
|
-
require('
|
|
68
|
-
require('
|
|
69
|
-
require('
|
|
70
|
-
require('./components/NavMainLink/NavMainLink.styled.js');
|
|
71
|
-
require('./components/SearchBar/SearchBar.styles.js');
|
|
72
|
-
require('./components/Nav/Nav.styles.js');
|
|
67
|
+
var Nav = require('./components/Nav/Nav.js');
|
|
68
|
+
var NavMainLink = require('./components/NavMainLink/NavMainLink.js');
|
|
69
|
+
var SearchBar = require('./components/SearchBar/SearchBar.js');
|
|
73
70
|
var SideModal = require('./components/SideModal/SideModal.js');
|
|
74
|
-
require('./components/IconText/IconText.
|
|
71
|
+
var IconText = require('./components/IconText/IconText.js');
|
|
75
72
|
var Logo = require('./components/Logo/Logo.js');
|
|
76
73
|
var Dropdown = require('./components/Dropdown/Dropdown.js');
|
|
77
74
|
|
|
@@ -170,7 +167,11 @@ exports.WarningLabel = WarningLabel.WarningLabel;
|
|
|
170
167
|
exports.MobileLabel = MobileTable_styles.MobileLabel;
|
|
171
168
|
exports.MobileTable = MobileTable_styles.MobileTable;
|
|
172
169
|
exports.MobileTd = MobileTable_styles.MobileTd;
|
|
170
|
+
exports.Nav = Nav.Nav;
|
|
171
|
+
exports.NavMainLink = NavMainLink.NavMainLink;
|
|
172
|
+
exports.SearchBar = SearchBar.SearchBar;
|
|
173
173
|
exports.SideModal = SideModal.SideModal;
|
|
174
|
+
exports.IconText = IconText.IconText;
|
|
174
175
|
exports.Logo = Logo.Logo;
|
|
175
176
|
exports.Dropdown = Dropdown.Dropdown;
|
|
176
177
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconTextContainer } from './IconText.styles.js';
|
|
3
|
+
|
|
4
|
+
var IconText = function (_a) {
|
|
5
|
+
var icon = _a.icon, spacing = _a.spacing, children = _a.children, showOnlyIcon = _a.showOnlyIcon;
|
|
6
|
+
return (React.createElement(IconTextContainer, { spacing: spacing },
|
|
7
|
+
icon,
|
|
8
|
+
!showOnlyIcon && children));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { IconText };
|
|
12
|
+
//# sourceMappingURL=IconText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconText.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
|
|
4
|
+
var IconTextContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
|
|
5
5
|
var templateObject_1;
|
|
6
|
+
|
|
7
|
+
export { IconTextContainer };
|
|
6
8
|
//# sourceMappingURL=IconText.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { theme } from '@citygross/design-tokens';
|
|
2
|
+
import { useWindowSize } from '@citygross/utils';
|
|
3
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
4
|
+
import { NavMainLink } from '../NavMainLink/NavMainLink.js';
|
|
5
|
+
import { SearchBar } from '../SearchBar/SearchBar.js';
|
|
6
|
+
import { Nav as Nav$1, NavContainer, NavChildContainer, NavSearchContainer, NavMainLinks, NavDummySearchContainer, SearchResultOverlay } from './Nav.styles.js';
|
|
7
|
+
|
|
8
|
+
var Nav = function (_a) {
|
|
9
|
+
var _b, _c;
|
|
10
|
+
var logo = _a.logo, maxWidth = _a.maxWidth, height = _a.height, topPosition = _a.topPosition, mainLinks = _a.mainLinks, _d = _a.mainLinksBorderColor, mainLinksBorderColor = _d === void 0 ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.primary : _d, rightContent = _a.rightContent, searchResultElement = _a.searchResultElement, searchCancelLabel = _a.searchCancelLabel, searchIcon = _a.searchIcon, searchPlaceHolder = _a.searchPlaceHolder, searchOnChange = _a.searchOnChange, searchValue = _a.searchValue, onSearchClick = _a.onSearchClick;
|
|
11
|
+
var searchContainerRef = useRef(null);
|
|
12
|
+
var searchInputRef = useRef(null);
|
|
13
|
+
var navRef = useRef(null);
|
|
14
|
+
var width = useWindowSize().width;
|
|
15
|
+
var _e = useState(0), elToRemove = _e[0], setElToRemove = _e[1];
|
|
16
|
+
var widthRef = useRef(null);
|
|
17
|
+
var checkWidth = function () {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if ((navRef === null || navRef === void 0 ? void 0 : navRef.current) &&
|
|
20
|
+
((_a = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) < ((_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.scrollWidth)) {
|
|
21
|
+
setElToRemove(function (prev) { return prev + 1; });
|
|
22
|
+
widthRef.current = width;
|
|
23
|
+
}
|
|
24
|
+
else if ((widthRef === null || widthRef === void 0 ? void 0 : widthRef.current) && width >= (widthRef === null || widthRef === void 0 ? void 0 : widthRef.current)) {
|
|
25
|
+
setElToRemove(0);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
var debounce = setTimeout(function () {
|
|
30
|
+
checkWidth();
|
|
31
|
+
}, 300);
|
|
32
|
+
return function () {
|
|
33
|
+
clearTimeout(debounce);
|
|
34
|
+
};
|
|
35
|
+
}, [width]);
|
|
36
|
+
var _f = useState(false), openSearch = _f[0], setOpenSearch = _f[1];
|
|
37
|
+
React.useEffect(function () {
|
|
38
|
+
var handleClick = function (event) {
|
|
39
|
+
var _a;
|
|
40
|
+
if ((searchContainerRef === null || searchContainerRef === void 0 ? void 0 : searchContainerRef.current) &&
|
|
41
|
+
!((_a = searchContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
setOpenSearch(false);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
document.addEventListener('click', function (e) { return handleClick(e); }, true);
|
|
47
|
+
return function () {
|
|
48
|
+
document.removeEventListener('click', function (e) { return handleClick(e); }, true);
|
|
49
|
+
};
|
|
50
|
+
}, [searchContainerRef]);
|
|
51
|
+
return (React.createElement(Nav$1, { height: height, topPosition: topPosition, ref: navRef },
|
|
52
|
+
React.createElement(NavContainer, { maxWidth: maxWidth },
|
|
53
|
+
logo,
|
|
54
|
+
React.createElement(NavChildContainer, null,
|
|
55
|
+
openSearch ? (React.createElement(NavSearchContainer, { ref: searchContainerRef },
|
|
56
|
+
React.createElement(SearchBar, { icon: searchIcon, cancelLabel: searchCancelLabel, flexGrow: 1, placeholder: searchPlaceHolder, onChange: searchOnChange, value: searchValue, inputRef: searchInputRef, onCancelClick: function () {
|
|
57
|
+
setOpenSearch(false);
|
|
58
|
+
}, isOpen: openSearch }, searchResultElement))) : (React.createElement(React.Fragment, null,
|
|
59
|
+
React.createElement(NavMainLinks, null, (_c = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, mainLinks.length - elToRemove)) === null || _c === void 0 ? void 0 : _c.map(function (link) { return (React.createElement(NavMainLink, { text: link.text, active: link.active, borderColor: mainLinksBorderColor, href: link.href, key: link.text, target: link.target })); })),
|
|
60
|
+
React.createElement(NavDummySearchContainer, { onClick: function () {
|
|
61
|
+
onSearchClick ? onSearchClick() : setOpenSearch(true);
|
|
62
|
+
} },
|
|
63
|
+
React.createElement(SearchBar, { icon: searchIcon, flexGrow: 1, placeholder: searchPlaceHolder })))),
|
|
64
|
+
rightContent)),
|
|
65
|
+
React.createElement(SearchResultOverlay, { show: openSearch })));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { Nav };
|
|
69
|
+
//# sourceMappingURL=Nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
|
|
5
|
-
styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
6
|
-
styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
|
|
7
|
-
styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
4
|
+
var Nav = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
|
|
5
|
+
var NavContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
6
|
+
var NavChildContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
|
|
7
|
+
var NavMainLinks = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
8
8
|
var NavDummySearchContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"], ["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
|
|
9
|
-
styled(NavDummySearchContainer)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
|
|
10
|
-
styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
|
|
9
|
+
var NavSearchContainer = styled(NavDummySearchContainer)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
|
|
10
|
+
var SearchResultOverlay = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
|
|
11
11
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
12
12
|
|
|
13
|
-
export { NavDummySearchContainer };
|
|
13
|
+
export { Nav, NavChildContainer, NavContainer, NavDummySearchContainer, NavMainLinks, NavSearchContainer, SearchResultOverlay };
|
|
14
14
|
//# sourceMappingURL=Nav.styles.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MainLinkContainer } from './NavMainLink.styled.js';
|
|
3
|
+
|
|
4
|
+
var NavMainLink = function (_a) {
|
|
5
|
+
var text = _a.text, href = _a.href, _b = _a.target, target = _b === void 0 ? '_self' : _b, active = _a.active, borderColor = _a.borderColor;
|
|
6
|
+
return (React.createElement(MainLinkContainer, { href: href, target: target, active: active, borderColor: borderColor }, text));
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { NavMainLink };
|
|
10
|
+
//# sourceMappingURL=NavMainLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavMainLink.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
styled.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
|
|
4
|
+
var MainLinkContainer = styled.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
|
|
5
5
|
var _a, _b;
|
|
6
6
|
return (props === null || props === void 0 ? void 0 : props.active) &&
|
|
7
7
|
"\n box-shadow: inset 0 -4px 0 " + ((_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary) + ";\n ";
|
|
8
8
|
}, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary; });
|
|
9
9
|
var templateObject_1;
|
|
10
|
+
|
|
11
|
+
export { MainLinkContainer };
|
|
10
12
|
//# sourceMappingURL=NavMainLink.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __rest, __assign } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import { SearchBarContainer, SearchLeftIcon, SearchInput, SearchRightLabel, SearchResultContainer } from './SearchBar.styles.js';
|
|
4
|
+
|
|
5
|
+
var SearchBar = function (_a) {
|
|
6
|
+
var flexGrow = _a.flexGrow, isValid = _a.isValid, _b = _a.inputSize, inputSize = _b === void 0 ? 'medium' : _b, activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, icon = _a.icon, value = _a.value, resultBoxTopPosition = _a.resultBoxTopPosition, children = _a.children, inputRef = _a.inputRef, isOpen = _a.isOpen, onCancelClick = _a.onCancelClick, props = __rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "onCancelClick"]);
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
var _a;
|
|
9
|
+
if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) {
|
|
10
|
+
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
11
|
+
}
|
|
12
|
+
}, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current]);
|
|
13
|
+
console.log(isOpen, '__________OPEN');
|
|
14
|
+
return (React.createElement(React.Fragment, null,
|
|
15
|
+
React.createElement(SearchBarContainer, { activeBorderColor: activeBorderColor, inputSize: inputSize, flexGrow: flexGrow, isOpen: isOpen },
|
|
16
|
+
React.createElement(SearchLeftIcon, null, icon),
|
|
17
|
+
React.createElement(SearchInput, __assign({ flexGrow: flexGrow, isValid: isValid, inputSize: inputSize, activeBorderColor: activeBorderColor, ref: inputRef }, props, { value: value })),
|
|
18
|
+
cancelLabel ? (React.createElement(SearchRightLabel, { onClick: function (e) {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
onCancelClick && onCancelClick();
|
|
21
|
+
}, isOpen: isOpen }, cancelLabel)) : null,
|
|
22
|
+
React.createElement(SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen }, children))));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { SearchBar };
|
|
26
|
+
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
|
|
5
|
-
styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
6
|
-
styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
|
|
4
|
+
var SearchResultContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
|
|
5
|
+
var SearchRightLabel = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
6
|
+
var SearchBarContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
|
|
7
7
|
return props.isOpen &&
|
|
8
8
|
"\n flex-direction: row;\n box-shadow: inset 0 0 2px " + props.activeBorderColor + ";\n ";
|
|
9
9
|
});
|
|
10
|
-
styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
|
|
10
|
+
var SearchInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
|
|
11
11
|
var _a, _b;
|
|
12
12
|
return props.inputSize === 'small'
|
|
13
13
|
? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs
|
|
@@ -18,6 +18,8 @@ styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n
|
|
|
18
18
|
? (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2
|
|
19
19
|
: (_b = props.theme.typography) === null || _b === void 0 ? void 0 : _b.size.s3;
|
|
20
20
|
}, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
|
|
21
|
-
styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
21
|
+
var SearchLeftIcon = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
22
22
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
23
|
+
|
|
24
|
+
export { SearchBarContainer, SearchInput, SearchLeftIcon, SearchResultContainer, SearchRightLabel };
|
|
23
25
|
//# sourceMappingURL=SearchBar.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -60,14 +60,11 @@ export { TwoColumnsPageContainer } from './containers/TwoColumnsContainer/TwoCol
|
|
|
60
60
|
export { UnorderedList, UnorderedListItem } from './components/UnorderedList/UnorderedList.styles.js';
|
|
61
61
|
export { WarningLabel } from './components/WarningLabel/WarningLabel.js';
|
|
62
62
|
export { MobileLabel, MobileTable, MobileTd } from './components/MobileTable/MobileTable.styles.js';
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
import './components/NavMainLink/NavMainLink.styled.js';
|
|
67
|
-
import './components/SearchBar/SearchBar.styles.js';
|
|
68
|
-
import './components/Nav/Nav.styles.js';
|
|
63
|
+
export { Nav } from './components/Nav/Nav.js';
|
|
64
|
+
export { NavMainLink } from './components/NavMainLink/NavMainLink.js';
|
|
65
|
+
export { SearchBar } from './components/SearchBar/SearchBar.js';
|
|
69
66
|
export { SideModal } from './components/SideModal/SideModal.js';
|
|
70
|
-
|
|
67
|
+
export { IconText } from './components/IconText/IconText.js';
|
|
71
68
|
export { Logo } from './components/Logo/Logo.js';
|
|
72
69
|
export { Dropdown } from './components/Dropdown/Dropdown.js';
|
|
73
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.81",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"moment": "^2.29.1",
|
|
72
72
|
"react-loading-skeleton": "^2.2.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "4434a3936ebb5616e0e59b7950267884f0789d63"
|
|
75
75
|
}
|