@citygross/components 0.7.108 → 0.7.110
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/Chips/Chip.styles.d.ts +2 -1
- package/build/@types/components/Nav/Nav.styles.d.ts +6 -3
- package/build/@types/components/RadioBox/RadioBoxItem.d.ts +2 -1
- package/build/@types/components/RadioBox/RadioBoxList.styles.d.ts +2 -1
- package/build/@types/components/RadioListItem/RadioListItem.styles.d.ts +2 -1
- package/build/@types/components/SearchBar/SearchBar.styles.d.ts +2 -2
- package/build/@types/components/Typography/bodyText.stories.d.ts +2 -1
- package/build/cjs/components/src/components/Dropdown/Dropdown.js +11 -5
- package/build/cjs/components/src/components/Dropdown/Dropdown.js.map +1 -1
- package/build/cjs/components/src/components/Nav/Nav.js +24 -7
- package/build/cjs/components/src/components/Nav/Nav.js.map +1 -1
- package/build/cjs/components/src/components/Nav/Nav.styles.js +7 -7
- package/build/cjs/components/src/components/RadioBox/RadioBoxItem.js +2 -2
- package/build/cjs/components/src/components/SearchBar/SearchBar.js +35 -4
- package/build/cjs/components/src/components/SearchBar/SearchBar.js.map +1 -1
- package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js +3 -2
- package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js.map +1 -1
- package/build/cjs/components/src/components/SideModal/SideModal.js +6 -1
- package/build/cjs/components/src/components/SideModal/SideModal.js.map +1 -1
- package/build/cjs/components/src/components/SlideInOutContainer/SlideInOutContainer.js +11 -4
- package/build/cjs/components/src/components/SlideInOutContainer/SlideInOutContainer.js.map +1 -1
- package/build/es/components/src/components/Dropdown/Dropdown.js +11 -5
- package/build/es/components/src/components/Dropdown/Dropdown.js.map +1 -1
- package/build/es/components/src/components/Nav/Nav.js +25 -8
- package/build/es/components/src/components/Nav/Nav.js.map +1 -1
- package/build/es/components/src/components/Nav/Nav.styles.js +8 -7
- package/build/es/components/src/components/Nav/Nav.styles.js.map +1 -1
- package/build/es/components/src/components/RadioBox/RadioBoxItem.js +2 -2
- package/build/es/components/src/components/SearchBar/SearchBar.js +35 -4
- package/build/es/components/src/components/SearchBar/SearchBar.js.map +1 -1
- package/build/es/components/src/components/SearchBar/SearchBar.styles.js +3 -2
- package/build/es/components/src/components/SearchBar/SearchBar.styles.js.map +1 -1
- package/build/es/components/src/components/SideModal/SideModal.js +7 -2
- package/build/es/components/src/components/SideModal/SideModal.js.map +1 -1
- package/build/es/components/src/components/SlideInOutContainer/SlideInOutContainer.js +11 -4
- package/build/es/components/src/components/SlideInOutContainer/SlideInOutContainer.js.map +1 -1
- package/package.json +3 -3
|
@@ -9,10 +9,11 @@ export declare type TChip = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare const BaseChip: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TChip, never>;
|
|
11
11
|
export declare const ChipCheckbox: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
export declare const ChipLabel: import("styled-components").StyledComponent<({ size, color, children, lineThrough, fontWeight, ...props }: {
|
|
12
|
+
export declare const ChipLabel: import("styled-components").StyledComponent<({ size, color, children, lineThrough, fontWeight, textAlign, ...props }: {
|
|
13
13
|
children: import("react").ReactNode;
|
|
14
14
|
size?: import("@citygross/typography/build/types/textTypes").TextSize | undefined;
|
|
15
15
|
color?: string | undefined;
|
|
16
16
|
lineThrough?: boolean | undefined;
|
|
17
17
|
fontWeight?: "regular" | "medium" | "semiBold" | "bold" | undefined;
|
|
18
|
+
textAlign?: "center" | "left" | "right" | undefined;
|
|
18
19
|
}) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -9,11 +9,14 @@ declare type TNavContainer = {
|
|
|
9
9
|
declare type TNavSearchOverlay = {
|
|
10
10
|
show?: boolean;
|
|
11
11
|
};
|
|
12
|
+
declare type TSearchIsOpen = {
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
};
|
|
12
15
|
export declare const Nav: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TNav, never>;
|
|
13
16
|
export declare const NavContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TNavContainer, never>;
|
|
14
17
|
export declare const NavChildContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
-
export declare const NavMainLinks: import("styled-components").StyledComponent<"
|
|
16
|
-
export declare const NavDummySearchContainer: import("styled-components").StyledComponent<"
|
|
17
|
-
export declare const NavSearchContainer: import("styled-components").StyledComponent<"
|
|
18
|
+
export declare const NavMainLinks: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
+
export declare const NavDummySearchContainer: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, TSearchIsOpen, never>;
|
|
20
|
+
export declare const NavSearchContainer: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, TSearchIsOpen, never>;
|
|
18
21
|
export declare const SearchResultOverlay: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TNavSearchOverlay, never>;
|
|
19
22
|
export {};
|
|
@@ -10,5 +10,6 @@ export declare type TRadioBox = styles.TBaseRadioBox & {
|
|
|
10
10
|
border?: string;
|
|
11
11
|
flexDirection?: string;
|
|
12
12
|
padding?: number;
|
|
13
|
+
hideRadioButton?: boolean;
|
|
13
14
|
};
|
|
14
|
-
export declare function RadioBoxItem({ radioColor, checked, isDisabled, name, align, setActive, background, border, boxShadow, children, flexDirection, padding }: TRadioBox): JSX.Element;
|
|
15
|
+
export declare function RadioBoxItem({ radioColor, checked, isDisabled, name, align, setActive, background, border, boxShadow, children, flexDirection, padding, hideRadioButton }: TRadioBox): JSX.Element;
|
|
@@ -3,10 +3,11 @@ import { TBaseRadioBox } from './RadioBoxItem.styles';
|
|
|
3
3
|
export declare const BaseRadioBoxList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TBaseRadioBox, never>;
|
|
4
4
|
export declare const RadioBoxListChildContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TBaseRadioBox, never>;
|
|
5
5
|
export declare const DividerPadding: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const RadioBoxListParagraph: import("styled-components").StyledComponent<({ size, color, children, lineThrough, fontWeight, ...props }: {
|
|
6
|
+
export declare const RadioBoxListParagraph: import("styled-components").StyledComponent<({ size, color, children, lineThrough, fontWeight, textAlign, ...props }: {
|
|
7
7
|
children: import("react").ReactNode;
|
|
8
8
|
size?: import("@citygross/typography/build/types/textTypes").TextSize | undefined;
|
|
9
9
|
color?: string | undefined;
|
|
10
10
|
lineThrough?: boolean | undefined;
|
|
11
11
|
fontWeight?: "regular" | "medium" | "semiBold" | "bold" | undefined;
|
|
12
|
+
textAlign?: "center" | "left" | "right" | undefined;
|
|
12
13
|
}) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -18,12 +18,13 @@ export declare const StyledH3: import("styled-components").StyledComponent<({ ch
|
|
|
18
18
|
as: string;
|
|
19
19
|
}, "as">;
|
|
20
20
|
export declare const RadioSecondaryWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
-
export declare const DisableText: import("styled-components").StyledComponent<({ size, color, children, lineThrough, fontWeight, ...props }: {
|
|
21
|
+
export declare const DisableText: import("styled-components").StyledComponent<({ size, color, children, lineThrough, fontWeight, textAlign, ...props }: {
|
|
22
22
|
children: import("react").ReactNode;
|
|
23
23
|
size?: import("@citygross/typography/build/types/textTypes").TextSize | undefined;
|
|
24
24
|
color?: string | undefined;
|
|
25
25
|
lineThrough?: boolean | undefined;
|
|
26
26
|
fontWeight?: "bold" | "regular" | "medium" | "semiBold" | undefined;
|
|
27
|
+
textAlign?: "center" | "left" | "right" | undefined;
|
|
27
28
|
}) => JSX.Element, import("styled-components").DefaultTheme, TWrapMobile, never>;
|
|
28
29
|
export declare const RadioFlex: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TWrapMobile, never>;
|
|
29
30
|
export declare const SecondaryColumn: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -12,8 +12,8 @@ declare type SearchResultContainerProps = {
|
|
|
12
12
|
topPosition?: string;
|
|
13
13
|
isOpen?: boolean;
|
|
14
14
|
};
|
|
15
|
-
export declare const SearchResultContainer: import("styled-components").StyledComponent<"
|
|
16
|
-
export declare const SearchRightLabel: import("styled-components").StyledComponent<"
|
|
15
|
+
export declare const SearchResultContainer: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, SearchResultContainerProps, never>;
|
|
16
|
+
export declare const SearchRightLabel: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
|
|
17
17
|
export declare const SearchBarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, SearchInputProps, never>;
|
|
18
18
|
export declare const SearchInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, SearchInputProps, never>;
|
|
19
19
|
export declare const MobileSearchFormContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -2,12 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { Story } from '@storybook/react';
|
|
3
3
|
import { BodyText } from '@citygross/typography';
|
|
4
4
|
declare const _default: {
|
|
5
|
-
component: ({ size, color, children, lineThrough, fontWeight, ...props }: {
|
|
5
|
+
component: ({ size, color, children, lineThrough, fontWeight, textAlign, ...props }: {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
size?: import("@citygross/typography/build/types/textTypes").TextSize | undefined;
|
|
8
8
|
color?: string | undefined;
|
|
9
9
|
lineThrough?: boolean | undefined;
|
|
10
10
|
fontWeight?: "bold" | "regular" | "medium" | "semiBold" | undefined;
|
|
11
|
+
textAlign?: "center" | "left" | "right" | undefined;
|
|
11
12
|
}) => JSX.Element;
|
|
12
13
|
title: string;
|
|
13
14
|
argTypes: {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var framerMotion = require('framer-motion');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var Dropdown_styles = require('./Dropdown.styles.js');
|
|
8
7
|
|
|
@@ -12,12 +11,19 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
12
11
|
|
|
13
12
|
var Dropdown = function (_a) {
|
|
14
13
|
var isOpen = _a.isOpen, onClick = _a.onClick, dropdownHeader = _a.dropdownHeader, children = _a.children;
|
|
14
|
+
var variants = {
|
|
15
|
+
closed: {
|
|
16
|
+
height: 0,
|
|
17
|
+
transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] }
|
|
18
|
+
},
|
|
19
|
+
open: {
|
|
20
|
+
height: 'auto',
|
|
21
|
+
transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] }
|
|
22
|
+
}
|
|
23
|
+
};
|
|
15
24
|
return (React__default["default"].createElement(Dropdown_styles.DropdownContainer, null,
|
|
16
25
|
React__default["default"].createElement(Dropdown_styles.DropdownHeader, { onClick: onClick }, dropdownHeader),
|
|
17
|
-
React__default["default"].createElement(
|
|
18
|
-
open: { height: 'auto' },
|
|
19
|
-
collapsed: { height: 0 }
|
|
20
|
-
}, transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] } }, children)))));
|
|
26
|
+
React__default["default"].createElement(Dropdown_styles.DropdownChildContainer, { isOpen: isOpen, variants: variants, animate: isOpen ? 'open' : 'closed', initial: 'closed' }, children)));
|
|
21
27
|
};
|
|
22
28
|
|
|
23
29
|
exports.Dropdown = Dropdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var designTokens = require('@citygross/design-tokens');
|
|
5
6
|
var utils = require('@citygross/utils');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var SearchBar = require('../SearchBar/SearchBar.js');
|
|
@@ -12,14 +13,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
14
|
|
|
14
15
|
var Nav = function (_a) {
|
|
15
|
-
var _b;
|
|
16
|
+
var _b, _c;
|
|
16
17
|
var logo = _a.logo, maxWidth = _a.maxWidth, height = _a.height, topPosition = _a.topPosition, mainLinks = _a.mainLinks, rightContent = _a.rightContent, searchResultElement = _a.searchResultElement, searchCancelLabel = _a.searchCancelLabel, searchIcon = _a.searchIcon, searchPlaceHolder = _a.searchPlaceHolder, searchOnChange = _a.searchOnChange, searchValue = _a.searchValue, searchOnSubmit = _a.searchOnSubmit, onSearchClick = _a.onSearchClick, closeSearch = _a.closeSearch, searchIsOpen = _a.searchIsOpen;
|
|
17
18
|
var navContainerRef = React.useRef(null);
|
|
18
19
|
var searchInputRef = React.useRef(null);
|
|
19
20
|
var searchInputMobileRef = React.useRef(null);
|
|
20
21
|
var navRef = React.useRef(null);
|
|
21
22
|
var width = utils.useWindowSize().width;
|
|
22
|
-
var
|
|
23
|
+
var _d = React.useState(0), elToRemove = _d[0], setElToRemove = _d[1];
|
|
23
24
|
var widthRef = React.useRef(null);
|
|
24
25
|
var checkWidth = function () {
|
|
25
26
|
var _a, _b;
|
|
@@ -53,17 +54,33 @@ var Nav = function (_a) {
|
|
|
53
54
|
document.removeEventListener('click', function (e) { return handleClick(e); }, true);
|
|
54
55
|
};
|
|
55
56
|
}, [navContainerRef]);
|
|
57
|
+
var variants = {
|
|
58
|
+
closed: {
|
|
59
|
+
width: '0',
|
|
60
|
+
transition: {
|
|
61
|
+
duration: 0.1,
|
|
62
|
+
ease: 'linear'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
open: {
|
|
66
|
+
width: 'auto',
|
|
67
|
+
transition: { duration: 0.1, ease: 'linear' }
|
|
68
|
+
}
|
|
69
|
+
};
|
|
56
70
|
return (React__default["default"].createElement(Nav_styles.Nav, { height: height, topPosition: topPosition, ref: navRef },
|
|
57
71
|
React__default["default"].createElement(Nav_styles.NavContainer, { maxWidth: maxWidth, ref: navContainerRef },
|
|
58
72
|
logo,
|
|
59
73
|
React__default["default"].createElement(Nav_styles.NavChildContainer, null,
|
|
60
|
-
|
|
61
|
-
React__default["default"].createElement(
|
|
62
|
-
|
|
74
|
+
React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
75
|
+
React__default["default"].createElement(Nav_styles.NavMainLinks, { variants: variants, animate: designTokens.theme.constants && width < ((_b = designTokens.theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint)
|
|
76
|
+
? false
|
|
77
|
+
: searchIsOpen
|
|
78
|
+
? 'closed'
|
|
79
|
+
: 'open' }, (_c = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, (mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.length) - elToRemove)) === null || _c === void 0 ? void 0 : _c.map(function (link) { return link; })),
|
|
63
80
|
React__default["default"].createElement(Nav_styles.NavDummySearchContainer, { onClick: function () {
|
|
64
81
|
onSearchClick && onSearchClick();
|
|
65
|
-
} },
|
|
66
|
-
React__default["default"].createElement(SearchBar.SearchBar, { icon: searchIcon, flexGrow: 1, placeholder: searchPlaceHolder, value: searchValue,
|
|
82
|
+
}, isOpen: searchIsOpen },
|
|
83
|
+
React__default["default"].createElement(SearchBar.SearchBar, { icon: searchIcon, cancelLabel: searchCancelLabel, flexGrow: 1, placeholder: searchPlaceHolder, onChange: searchOnChange, value: searchValue, inputRef: searchInputRef, searchInputMobileRef: searchInputMobileRef, searchOnSubmit: searchOnSubmit, isOpen: searchIsOpen }, searchResultElement))),
|
|
67
84
|
rightContent)),
|
|
68
85
|
React__default["default"].createElement(Nav_styles.SearchResultOverlay, { show: searchIsOpen })));
|
|
69
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
+
var framerMotion = require('framer-motion');
|
|
6
7
|
var styled = require('styled-components');
|
|
7
8
|
|
|
8
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
10
|
|
|
10
11
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
12
|
|
|
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 }
|
|
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: ", "
|
|
13
|
+
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.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
|
|
14
|
+
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: ", ";\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: ", ";\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.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a, _b, _c; return "".concat((_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px ").concat((_c = props.theme.spacings) === null || _c === void 0 ? void 0 : _c.sm, "px"); });
|
|
14
15
|
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
|
|
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
|
-
|
|
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: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a, _b; return "calc(".concat((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall, "px - ").concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)"); }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a
|
|
16
|
+
var NavMainLinks = styled__default["default"](framerMotion.motion.div)(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\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 gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, 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; });
|
|
17
|
+
var NavDummySearchContainer = styled__default["default"](framerMotion.motion.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 ((props === null || props === void 0 ? void 0 : props.isOpen) ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm); });
|
|
18
|
+
styled__default["default"](NavDummySearchContainer)(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
19
|
+
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: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a, _b; return "calc(".concat((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall, "px - ").concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)"); }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a; return "".concat((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall, "px"); });
|
|
19
20
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
20
21
|
|
|
21
22
|
exports.Nav = Nav;
|
|
@@ -23,6 +24,5 @@ exports.NavChildContainer = NavChildContainer;
|
|
|
23
24
|
exports.NavContainer = NavContainer;
|
|
24
25
|
exports.NavDummySearchContainer = NavDummySearchContainer;
|
|
25
26
|
exports.NavMainLinks = NavMainLinks;
|
|
26
|
-
exports.NavSearchContainer = NavSearchContainer;
|
|
27
27
|
exports.SearchResultOverlay = SearchResultOverlay;
|
|
28
28
|
//# sourceMappingURL=Nav.styles.js.map
|
|
@@ -13,9 +13,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
13
13
|
|
|
14
14
|
function RadioBoxItem(_a) {
|
|
15
15
|
var _b, _c, _d;
|
|
16
|
-
var _e = _a.radioColor, radioColor = _e === void 0 ? 'alertGreen' : _e, checked = _a.checked, isDisabled = _a.isDisabled, name = _a.name, _f = _a.align, align = _f === void 0 ? 'flex-start' : _f, setActive = _a.setActive, _g = _a.background, background = _g === void 0 ? (_b = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white : _g, _h = _a.border, border = _h === void 0 ? (_c = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.border : _h, _j = _a.boxShadow, boxShadow = _j === void 0 ? true : _j, children = _a.children, flexDirection = _a.flexDirection, _k = _a.padding, padding = _k === void 0 ? (_d = designTokens.theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k;
|
|
16
|
+
var _e = _a.radioColor, radioColor = _e === void 0 ? 'alertGreen' : _e, checked = _a.checked, isDisabled = _a.isDisabled, name = _a.name, _f = _a.align, align = _f === void 0 ? 'flex-start' : _f, setActive = _a.setActive, _g = _a.background, background = _g === void 0 ? (_b = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white : _g, _h = _a.border, border = _h === void 0 ? (_c = designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette) === null || _c === void 0 ? void 0 : _c.border : _h, _j = _a.boxShadow, boxShadow = _j === void 0 ? true : _j, children = _a.children, flexDirection = _a.flexDirection, _k = _a.padding, padding = _k === void 0 ? (_d = designTokens.theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k, _l = _a.hideRadioButton, hideRadioButton = _l === void 0 ? false : _l;
|
|
17
17
|
return (React__default["default"].createElement(RadioBoxItem_styles.BaseRadioBox, { align: align, checked: checked, isDisabled: isDisabled, onClick: !isDisabled ? setActive : function () { }, background: background, border: border, boxShadow: boxShadow, flexDirection: flexDirection, padding: padding },
|
|
18
|
-
React__default["default"].createElement(Radio.Radio, { customColor: radioColor, checked: checked, disabled: isDisabled, name: name, onChange: function () { return setActive; } }),
|
|
18
|
+
!hideRadioButton && React__default["default"].createElement(Radio.Radio, { customColor: radioColor, checked: checked, disabled: isDisabled, name: name, onChange: function () { return setActive; } }),
|
|
19
19
|
children));
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -13,7 +13,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
14
|
|
|
15
15
|
var SearchBar = function (_a) {
|
|
16
|
-
var
|
|
16
|
+
var _b, _c;
|
|
17
|
+
var flexGrow = _a.flexGrow, isValid = _a.isValid, _d = _a.inputSize, inputSize = _d === void 0 ? 'medium' : _d, activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, icon = _a.icon, value = _a.value, resultBoxTopPosition = _a.resultBoxTopPosition, children = _a.children, inputRef = _a.inputRef, isOpen = _a.isOpen, searchOnSubmit = _a.searchOnSubmit, searchInputMobileRef = _a.searchInputMobileRef, props = _tslib.__rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "searchOnSubmit", "searchInputMobileRef"]);
|
|
17
18
|
var width = utils.useWindowSize().width;
|
|
18
19
|
var theme = styled.useTheme();
|
|
19
20
|
React.useEffect(function () {
|
|
@@ -29,6 +30,36 @@ var SearchBar = function (_a) {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current]);
|
|
33
|
+
var resultVariants = {
|
|
34
|
+
closed: {
|
|
35
|
+
height: '0',
|
|
36
|
+
transition: { duration: 0, ease: 'linear' }
|
|
37
|
+
},
|
|
38
|
+
open: {
|
|
39
|
+
height: 'auto',
|
|
40
|
+
transition: {
|
|
41
|
+
duration: theme.constants && width < ((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint)
|
|
42
|
+
? 0
|
|
43
|
+
: 0.2,
|
|
44
|
+
delay: theme.constants && width < ((_c = theme.constants) === null || _c === void 0 ? void 0 : _c.headerBreakpoint)
|
|
45
|
+
? 0
|
|
46
|
+
: 0.1,
|
|
47
|
+
ease: 'linear'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var iconVariants = {
|
|
52
|
+
closed: {
|
|
53
|
+
opacity: 0,
|
|
54
|
+
display: 'none',
|
|
55
|
+
transition: { duration: 0, delay: 0, ease: 'linear' }
|
|
56
|
+
},
|
|
57
|
+
open: {
|
|
58
|
+
opacity: 1,
|
|
59
|
+
display: 'flex',
|
|
60
|
+
transition: { duration: 0.1, delay: 0.1, ease: 'linear' }
|
|
61
|
+
}
|
|
62
|
+
};
|
|
32
63
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
33
64
|
React__default["default"].createElement(SearchBar_styles.SearchBarContainer, { activeBorderColor: activeBorderColor, inputSize: inputSize, flexGrow: flexGrow, isOpen: isOpen },
|
|
34
65
|
React__default["default"].createElement(SearchBar_styles.SearchForm, { hideInMobile: true, isOpen: isOpen, onSubmit: function (e) {
|
|
@@ -39,10 +70,10 @@ var SearchBar = function (_a) {
|
|
|
39
70
|
React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ flexGrow: flexGrow, isValid: isValid, inputSize: inputSize, activeBorderColor: activeBorderColor, ref: inputRef }, props, { value: value })),
|
|
40
71
|
cancelLabel ? (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { onClick: function (e) {
|
|
41
72
|
e.stopPropagation();
|
|
42
|
-
},
|
|
73
|
+
}, variants: iconVariants, animate: isOpen ? 'open' : 'closed', initial: 'closed' }, cancelLabel)) : null),
|
|
43
74
|
React__default["default"].createElement(SearchBar_styles.MobileSearchIconContainer, null,
|
|
44
75
|
React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, icon)),
|
|
45
|
-
React__default["default"].createElement(SearchBar_styles.SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen },
|
|
76
|
+
React__default["default"].createElement(SearchBar_styles.SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen, variants: resultVariants, animate: isOpen ? 'open' : 'closed', initial: 'closed' },
|
|
46
77
|
React__default["default"].createElement(SearchBar_styles.MobileSearchFormContainer, null,
|
|
47
78
|
React__default["default"].createElement(SearchBar_styles.SearchForm, { onSubmit: function (e) {
|
|
48
79
|
e.preventDefault();
|
|
@@ -52,7 +83,7 @@ var SearchBar = function (_a) {
|
|
|
52
83
|
React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ flexGrow: flexGrow, isValid: isValid, inputSize: 'small', activeBorderColor: activeBorderColor, ref: searchInputMobileRef }, props, { value: value })),
|
|
53
84
|
cancelLabel ? (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { onClick: function (e) {
|
|
54
85
|
e.stopPropagation();
|
|
55
|
-
}
|
|
86
|
+
} }, cancelLabel)) : null)),
|
|
56
87
|
children))));
|
|
57
88
|
};
|
|
58
89
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
+
var framerMotion = require('framer-motion');
|
|
6
7
|
var styled = require('styled-components');
|
|
7
8
|
|
|
8
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
10
|
|
|
10
11
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
12
|
|
|
12
|
-
var SearchResultContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n
|
|
13
|
-
var SearchRightLabel = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display:
|
|
13
|
+
var SearchResultContainer = styled__default["default"](framerMotion.motion.div)(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"], ["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.searchModalZIndex; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + ".concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)"); });
|
|
14
|
+
var SearchRightLabel = styled__default["default"](framerMotion.motion.div)(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
14
15
|
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 ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n"])), function (props) { return props.flexGrow && "flex: 1;"; });
|
|
15
16
|
var SearchInput = styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\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\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n"], ["\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\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
|
|
16
17
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -15,9 +15,14 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
15
15
|
var SideModal = function (_a) {
|
|
16
16
|
var _b, _c;
|
|
17
17
|
var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, children = _a.children;
|
|
18
|
+
var ref = React.useRef(null);
|
|
18
19
|
var domSafe = typeof document !== 'undefined';
|
|
19
20
|
return domSafe
|
|
20
|
-
? reactDom.createPortal(React__default["default"].createElement(framerMotion.AnimatePresence, null, isVisible && (React__default["default"].createElement(SideModal_styles.SideModalOverlay, {
|
|
21
|
+
? reactDom.createPortal(React__default["default"].createElement(framerMotion.AnimatePresence, null, isVisible && (React__default["default"].createElement(SideModal_styles.SideModalOverlay, { ref: ref, onMouseDown: function (e) {
|
|
22
|
+
if (ref && e.target === (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
23
|
+
onBackdropClick();
|
|
24
|
+
}
|
|
25
|
+
}, overlayBackground: overlayBackground, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
|
|
21
26
|
type: 'just'
|
|
22
27
|
} },
|
|
23
28
|
React__default["default"].createElement(SideModal_styles.SideModalContainer, { slideFrom: slideFrom, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SideModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
-
var framerMotion = require('framer-motion');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var SlideInOutContainer_styles = require('./SlideInOutContainer.styles.js');
|
|
9
8
|
|
|
@@ -13,9 +12,17 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
13
12
|
|
|
14
13
|
var SlideInOutContainer = function (_a) {
|
|
15
14
|
var _b = _a.slideFrom, slideFrom = _b === void 0 ? 'right' : _b, isVisible = _a.isVisible, isInitial = _a.isInitial, fullHeight = _a.fullHeight, children = _a.children, props = _tslib.__rest(_a, ["slideFrom", "isVisible", "isInitial", "fullHeight", "children"]);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
var iconVariants = {
|
|
16
|
+
show: {
|
|
17
|
+
x: 0,
|
|
18
|
+
transition: { duration: isInitial ? 0 : 0.3, delay: 0, ease: 'linear' }
|
|
19
|
+
},
|
|
20
|
+
hide: {
|
|
21
|
+
x: isInitial ? 0 : slideFrom === 'left' ? '-100%' : '100%',
|
|
22
|
+
transition: { duration: 0.3, delay: 0, ease: 'linear' }
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return (React__default["default"].createElement(SlideInOutContainer_styles.SideModalContainer, _tslib.__assign({ slideFrom: slideFrom, onClick: function (e) { return e.stopPropagation(); }, fullHeight: fullHeight, exit: { x: slideFrom === 'left' ? '-100%' : '100%' }, initial: isInitial ? 'show' : 'hide', animate: isVisible ? 'show' : 'hide', variants: iconVariants }, props), children));
|
|
19
26
|
};
|
|
20
27
|
|
|
21
28
|
exports.SlideInOutContainer = SlideInOutContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideInOutContainer.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SlideInOutContainer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { AnimatePresence } from 'framer-motion';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { DropdownContainer, DropdownHeader, DropdownChildContainer } from './Dropdown.styles.js';
|
|
4
3
|
|
|
5
4
|
var Dropdown = function (_a) {
|
|
6
5
|
var isOpen = _a.isOpen, onClick = _a.onClick, dropdownHeader = _a.dropdownHeader, children = _a.children;
|
|
6
|
+
var variants = {
|
|
7
|
+
closed: {
|
|
8
|
+
height: 0,
|
|
9
|
+
transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] }
|
|
10
|
+
},
|
|
11
|
+
open: {
|
|
12
|
+
height: 'auto',
|
|
13
|
+
transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] }
|
|
14
|
+
}
|
|
15
|
+
};
|
|
7
16
|
return (React.createElement(DropdownContainer, null,
|
|
8
17
|
React.createElement(DropdownHeader, { onClick: onClick }, dropdownHeader),
|
|
9
|
-
React.createElement(
|
|
10
|
-
open: { height: 'auto' },
|
|
11
|
-
collapsed: { height: 0 }
|
|
12
|
-
}, transition: { duration: 0.3, ease: [0.04, 0.62, 0.23, 0.98] } }, children)))));
|
|
18
|
+
React.createElement(DropdownChildContainer, { isOpen: isOpen, variants: variants, animate: isOpen ? 'open' : 'closed', initial: 'closed' }, children)));
|
|
13
19
|
};
|
|
14
20
|
|
|
15
21
|
export { Dropdown };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { theme } from '@citygross/design-tokens';
|
|
1
2
|
import { useWindowSize } from '@citygross/utils';
|
|
2
3
|
import React, { useRef, useState, useEffect } from 'react';
|
|
3
4
|
import { SearchBar } from '../SearchBar/SearchBar.js';
|
|
4
|
-
import { Nav as Nav$1, NavContainer, NavChildContainer,
|
|
5
|
+
import { Nav as Nav$1, NavContainer, NavChildContainer, NavMainLinks, NavDummySearchContainer, SearchResultOverlay } from './Nav.styles.js';
|
|
5
6
|
|
|
6
7
|
var Nav = function (_a) {
|
|
7
|
-
var _b;
|
|
8
|
+
var _b, _c;
|
|
8
9
|
var logo = _a.logo, maxWidth = _a.maxWidth, height = _a.height, topPosition = _a.topPosition, mainLinks = _a.mainLinks, rightContent = _a.rightContent, searchResultElement = _a.searchResultElement, searchCancelLabel = _a.searchCancelLabel, searchIcon = _a.searchIcon, searchPlaceHolder = _a.searchPlaceHolder, searchOnChange = _a.searchOnChange, searchValue = _a.searchValue, searchOnSubmit = _a.searchOnSubmit, onSearchClick = _a.onSearchClick, closeSearch = _a.closeSearch, searchIsOpen = _a.searchIsOpen;
|
|
9
10
|
var navContainerRef = useRef(null);
|
|
10
11
|
var searchInputRef = useRef(null);
|
|
11
12
|
var searchInputMobileRef = useRef(null);
|
|
12
13
|
var navRef = useRef(null);
|
|
13
14
|
var width = useWindowSize().width;
|
|
14
|
-
var
|
|
15
|
+
var _d = useState(0), elToRemove = _d[0], setElToRemove = _d[1];
|
|
15
16
|
var widthRef = useRef(null);
|
|
16
17
|
var checkWidth = function () {
|
|
17
18
|
var _a, _b;
|
|
@@ -45,17 +46,33 @@ var Nav = function (_a) {
|
|
|
45
46
|
document.removeEventListener('click', function (e) { return handleClick(e); }, true);
|
|
46
47
|
};
|
|
47
48
|
}, [navContainerRef]);
|
|
49
|
+
var variants = {
|
|
50
|
+
closed: {
|
|
51
|
+
width: '0',
|
|
52
|
+
transition: {
|
|
53
|
+
duration: 0.1,
|
|
54
|
+
ease: 'linear'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
open: {
|
|
58
|
+
width: 'auto',
|
|
59
|
+
transition: { duration: 0.1, ease: 'linear' }
|
|
60
|
+
}
|
|
61
|
+
};
|
|
48
62
|
return (React.createElement(Nav$1, { height: height, topPosition: topPosition, ref: navRef },
|
|
49
63
|
React.createElement(NavContainer, { maxWidth: maxWidth, ref: navContainerRef },
|
|
50
64
|
logo,
|
|
51
65
|
React.createElement(NavChildContainer, null,
|
|
52
|
-
|
|
53
|
-
React.createElement(
|
|
54
|
-
|
|
66
|
+
React.createElement(React.Fragment, null,
|
|
67
|
+
React.createElement(NavMainLinks, { variants: variants, animate: theme.constants && width < ((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint)
|
|
68
|
+
? false
|
|
69
|
+
: searchIsOpen
|
|
70
|
+
? 'closed'
|
|
71
|
+
: 'open' }, (_c = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, (mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.length) - elToRemove)) === null || _c === void 0 ? void 0 : _c.map(function (link) { return link; })),
|
|
55
72
|
React.createElement(NavDummySearchContainer, { onClick: function () {
|
|
56
73
|
onSearchClick && onSearchClick();
|
|
57
|
-
} },
|
|
58
|
-
React.createElement(SearchBar, { icon: searchIcon, flexGrow: 1, placeholder: searchPlaceHolder, value: searchValue,
|
|
74
|
+
}, isOpen: searchIsOpen },
|
|
75
|
+
React.createElement(SearchBar, { icon: searchIcon, cancelLabel: searchCancelLabel, flexGrow: 1, placeholder: searchPlaceHolder, onChange: searchOnChange, value: searchValue, inputRef: searchInputRef, searchInputMobileRef: searchInputMobileRef, searchOnSubmit: searchOnSubmit, isOpen: searchIsOpen }, searchResultElement))),
|
|
59
76
|
rightContent)),
|
|
60
77
|
React.createElement(SearchResultOverlay, { show: searchIsOpen })));
|
|
61
78
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
|
|
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 }
|
|
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: ", "
|
|
5
|
+
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.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
|
|
6
|
+
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: ", ";\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: ", ";\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.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a, _b, _c; return "".concat((_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px ").concat((_c = props.theme.spacings) === null || _c === void 0 ? void 0 : _c.sm, "px"); });
|
|
6
7
|
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
|
|
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
|
-
|
|
10
|
-
var SearchResultOverlay = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a, _b; return "calc(".concat((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall, "px - ").concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)"); }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a
|
|
8
|
+
var NavMainLinks = styled(motion.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\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 gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, 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; });
|
|
9
|
+
var NavDummySearchContainer = styled(motion.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 ((props === null || props === void 0 ? void 0 : props.isOpen) ? 0 : (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm); });
|
|
10
|
+
styled(NavDummySearchContainer)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
11
|
+
var SearchResultOverlay = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: 100%;\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a, _b; return "calc(".concat((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall, "px - ").concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)"); }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a; return "".concat((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall, "px"); });
|
|
11
12
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
12
13
|
|
|
13
|
-
export { Nav, NavChildContainer, NavContainer, NavDummySearchContainer, NavMainLinks,
|
|
14
|
+
export { Nav, NavChildContainer, NavContainer, NavDummySearchContainer, NavMainLinks, SearchResultOverlay };
|
|
14
15
|
//# 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":";;;;;;;;;;;;;;;"}
|
|
@@ -5,9 +5,9 @@ import { BaseRadioBox } from './RadioBoxItem.styles.js';
|
|
|
5
5
|
|
|
6
6
|
function RadioBoxItem(_a) {
|
|
7
7
|
var _b, _c, _d;
|
|
8
|
-
var _e = _a.radioColor, radioColor = _e === void 0 ? 'alertGreen' : _e, checked = _a.checked, isDisabled = _a.isDisabled, name = _a.name, _f = _a.align, align = _f === void 0 ? 'flex-start' : _f, setActive = _a.setActive, _g = _a.background, background = _g === void 0 ? (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.white : _g, _h = _a.border, border = _h === void 0 ? (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.border : _h, _j = _a.boxShadow, boxShadow = _j === void 0 ? true : _j, children = _a.children, flexDirection = _a.flexDirection, _k = _a.padding, padding = _k === void 0 ? (_d = theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k;
|
|
8
|
+
var _e = _a.radioColor, radioColor = _e === void 0 ? 'alertGreen' : _e, checked = _a.checked, isDisabled = _a.isDisabled, name = _a.name, _f = _a.align, align = _f === void 0 ? 'flex-start' : _f, setActive = _a.setActive, _g = _a.background, background = _g === void 0 ? (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.white : _g, _h = _a.border, border = _h === void 0 ? (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.border : _h, _j = _a.boxShadow, boxShadow = _j === void 0 ? true : _j, children = _a.children, flexDirection = _a.flexDirection, _k = _a.padding, padding = _k === void 0 ? (_d = theme.spacings) === null || _d === void 0 ? void 0 : _d.md : _k, _l = _a.hideRadioButton, hideRadioButton = _l === void 0 ? false : _l;
|
|
9
9
|
return (React.createElement(BaseRadioBox, { align: align, checked: checked, isDisabled: isDisabled, onClick: !isDisabled ? setActive : function () { }, background: background, border: border, boxShadow: boxShadow, flexDirection: flexDirection, padding: padding },
|
|
10
|
-
React.createElement(Radio, { customColor: radioColor, checked: checked, disabled: isDisabled, name: name, onChange: function () { return setActive; } }),
|
|
10
|
+
!hideRadioButton && React.createElement(Radio, { customColor: radioColor, checked: checked, disabled: isDisabled, name: name, onChange: function () { return setActive; } }),
|
|
11
11
|
children));
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -5,7 +5,8 @@ import { useTheme } from 'styled-components';
|
|
|
5
5
|
import { SearchBarContainer, SearchForm, SearchLeftIcon, SearchInput, SearchRightLabel, MobileSearchIconContainer, SearchResultContainer, MobileSearchFormContainer } from './SearchBar.styles.js';
|
|
6
6
|
|
|
7
7
|
var SearchBar = function (_a) {
|
|
8
|
-
var
|
|
8
|
+
var _b, _c;
|
|
9
|
+
var flexGrow = _a.flexGrow, isValid = _a.isValid, _d = _a.inputSize, inputSize = _d === void 0 ? 'medium' : _d, activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, icon = _a.icon, value = _a.value, resultBoxTopPosition = _a.resultBoxTopPosition, children = _a.children, inputRef = _a.inputRef, isOpen = _a.isOpen, searchOnSubmit = _a.searchOnSubmit, searchInputMobileRef = _a.searchInputMobileRef, props = __rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "searchOnSubmit", "searchInputMobileRef"]);
|
|
9
10
|
var width = useWindowSize().width;
|
|
10
11
|
var theme = useTheme();
|
|
11
12
|
useEffect(function () {
|
|
@@ -21,6 +22,36 @@ var SearchBar = function (_a) {
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
}, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current]);
|
|
25
|
+
var resultVariants = {
|
|
26
|
+
closed: {
|
|
27
|
+
height: '0',
|
|
28
|
+
transition: { duration: 0, ease: 'linear' }
|
|
29
|
+
},
|
|
30
|
+
open: {
|
|
31
|
+
height: 'auto',
|
|
32
|
+
transition: {
|
|
33
|
+
duration: theme.constants && width < ((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint)
|
|
34
|
+
? 0
|
|
35
|
+
: 0.2,
|
|
36
|
+
delay: theme.constants && width < ((_c = theme.constants) === null || _c === void 0 ? void 0 : _c.headerBreakpoint)
|
|
37
|
+
? 0
|
|
38
|
+
: 0.1,
|
|
39
|
+
ease: 'linear'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var iconVariants = {
|
|
44
|
+
closed: {
|
|
45
|
+
opacity: 0,
|
|
46
|
+
display: 'none',
|
|
47
|
+
transition: { duration: 0, delay: 0, ease: 'linear' }
|
|
48
|
+
},
|
|
49
|
+
open: {
|
|
50
|
+
opacity: 1,
|
|
51
|
+
display: 'flex',
|
|
52
|
+
transition: { duration: 0.1, delay: 0.1, ease: 'linear' }
|
|
53
|
+
}
|
|
54
|
+
};
|
|
24
55
|
return (React.createElement(React.Fragment, null,
|
|
25
56
|
React.createElement(SearchBarContainer, { activeBorderColor: activeBorderColor, inputSize: inputSize, flexGrow: flexGrow, isOpen: isOpen },
|
|
26
57
|
React.createElement(SearchForm, { hideInMobile: true, isOpen: isOpen, onSubmit: function (e) {
|
|
@@ -31,10 +62,10 @@ var SearchBar = function (_a) {
|
|
|
31
62
|
React.createElement(SearchInput, __assign({ flexGrow: flexGrow, isValid: isValid, inputSize: inputSize, activeBorderColor: activeBorderColor, ref: inputRef }, props, { value: value })),
|
|
32
63
|
cancelLabel ? (React.createElement(SearchRightLabel, { onClick: function (e) {
|
|
33
64
|
e.stopPropagation();
|
|
34
|
-
},
|
|
65
|
+
}, variants: iconVariants, animate: isOpen ? 'open' : 'closed', initial: 'closed' }, cancelLabel)) : null),
|
|
35
66
|
React.createElement(MobileSearchIconContainer, null,
|
|
36
67
|
React.createElement(SearchLeftIcon, null, icon)),
|
|
37
|
-
React.createElement(SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen },
|
|
68
|
+
React.createElement(SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen, variants: resultVariants, animate: isOpen ? 'open' : 'closed', initial: 'closed' },
|
|
38
69
|
React.createElement(MobileSearchFormContainer, null,
|
|
39
70
|
React.createElement(SearchForm, { onSubmit: function (e) {
|
|
40
71
|
e.preventDefault();
|
|
@@ -44,7 +75,7 @@ var SearchBar = function (_a) {
|
|
|
44
75
|
React.createElement(SearchInput, __assign({ flexGrow: flexGrow, isValid: isValid, inputSize: 'small', activeBorderColor: activeBorderColor, ref: searchInputMobileRef }, props, { value: value })),
|
|
45
76
|
cancelLabel ? (React.createElement(SearchRightLabel, { onClick: function (e) {
|
|
46
77
|
e.stopPropagation();
|
|
47
|
-
}
|
|
78
|
+
} }, cancelLabel)) : null)),
|
|
48
79
|
children))));
|
|
49
80
|
};
|
|
50
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
|
|
4
|
-
var SearchResultContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
5
|
-
var SearchRightLabel = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display:
|
|
5
|
+
var SearchResultContainer = styled(motion.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"], ["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.searchModalZIndex; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + ".concat((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)"); });
|
|
6
|
+
var SearchRightLabel = styled(motion.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
|
|
6
7
|
var SearchBarContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n"])), function (props) { return props.flexGrow && "flex: 1;"; });
|
|
7
8
|
var SearchInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\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\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n"], ["\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\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
|
|
8
9
|
var _a, _b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import { AnimatePresence } from 'framer-motion';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { SideModalOverlay, SideModalContainer } from './SideModal.styles.js';
|
|
@@ -7,9 +7,14 @@ import { theme } from '@citygross/design-tokens';
|
|
|
7
7
|
var SideModal = function (_a) {
|
|
8
8
|
var _b, _c;
|
|
9
9
|
var onBackdropClick = _a.onBackdropClick, _d = _a.background, background = _d === void 0 ? '#fff' : _d, _e = _a.overlayBackground, overlayBackground = _e === void 0 ? (_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.darkOverlay) !== null && _c !== void 0 ? _c : '' : _e, _f = _a.width, width = _f === void 0 ? 375 : _f, isVisible = _a.isVisible, slideFrom = _a.slideFrom, _g = _a.querySelector, querySelector = _g === void 0 ? '#root' : _g, maxWidth = _a.maxWidth, children = _a.children;
|
|
10
|
+
var ref = useRef(null);
|
|
10
11
|
var domSafe = typeof document !== 'undefined';
|
|
11
12
|
return domSafe
|
|
12
|
-
? createPortal(React.createElement(AnimatePresence, null, isVisible && (React.createElement(SideModalOverlay, {
|
|
13
|
+
? createPortal(React.createElement(AnimatePresence, null, isVisible && (React.createElement(SideModalOverlay, { ref: ref, onMouseDown: function (e) {
|
|
14
|
+
if (ref && e.target === (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
15
|
+
onBackdropClick();
|
|
16
|
+
}
|
|
17
|
+
}, overlayBackground: overlayBackground, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
|
|
13
18
|
type: 'just'
|
|
14
19
|
} },
|
|
15
20
|
React.createElement(SideModalContainer, { slideFrom: slideFrom, maxWidth: maxWidth, transition: { type: 'just' }, width: width, onClick: function (e) { return e.stopPropagation(); }, background: background, initial: { x: slideFrom === 'left' ? '-100%' : '100%' }, animate: { x: 0 }, exit: { x: slideFrom === 'left' ? '-100%' : '100%' } }, children)))), document.querySelector(querySelector) || document.body)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SideModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { __rest, __assign } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import { AnimatePresence } from 'framer-motion';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { SideModalContainer } from './SlideInOutContainer.styles.js';
|
|
5
4
|
|
|
6
5
|
var SlideInOutContainer = function (_a) {
|
|
7
6
|
var _b = _a.slideFrom, slideFrom = _b === void 0 ? 'right' : _b, isVisible = _a.isVisible, isInitial = _a.isInitial, fullHeight = _a.fullHeight, children = _a.children, props = __rest(_a, ["slideFrom", "isVisible", "isInitial", "fullHeight", "children"]);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var iconVariants = {
|
|
8
|
+
show: {
|
|
9
|
+
x: 0,
|
|
10
|
+
transition: { duration: isInitial ? 0 : 0.3, delay: 0, ease: 'linear' }
|
|
11
|
+
},
|
|
12
|
+
hide: {
|
|
13
|
+
x: isInitial ? 0 : slideFrom === 'left' ? '-100%' : '100%',
|
|
14
|
+
transition: { duration: 0.3, delay: 0, ease: 'linear' }
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return (React.createElement(SideModalContainer, __assign({ slideFrom: slideFrom, onClick: function (e) { return e.stopPropagation(); }, fullHeight: fullHeight, exit: { x: slideFrom === 'left' ? '-100%' : '100%' }, initial: isInitial ? 'show' : 'hide', animate: isVisible ? 'show' : 'hide', variants: iconVariants }, props), children));
|
|
11
18
|
};
|
|
12
19
|
|
|
13
20
|
export { SlideInOutContainer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideInOutContainer.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SlideInOutContainer.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.110",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"@citygross/design-tokens": "^0.2.31",
|
|
66
66
|
"@citygross/icons": "^0.1.7",
|
|
67
67
|
"@citygross/react-use-bg-wizard": "^0.0.8",
|
|
68
|
-
"@citygross/typography": "^0.0.
|
|
68
|
+
"@citygross/typography": "^0.0.61",
|
|
69
69
|
"@citygross/utils": "^0.0.22",
|
|
70
70
|
"framer-motion": "^4.1.17",
|
|
71
71
|
"moment": "^2.29.1",
|
|
72
72
|
"react-loading-skeleton": "^2.2.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "56d50cbabf5990d59e717bbb451c2ab2eea986bf"
|
|
75
75
|
}
|