@citygross/components 0.7.174 → 0.7.176

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.
@@ -17,16 +17,6 @@ var SearchBar = function (_a) {
17
17
  var flexGrow = _a.flexGrow, isValid = _a.isValid, _e = _a.inputSize, inputSize = _e === void 0 ? 'medium' : _e, 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, mobileTopPosition = _a.mobileTopPosition, props = _tslib.__rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "searchOnSubmit", "searchInputMobileRef", "mobileTopPosition"]);
18
18
  var width = utils.useWindowSize().width;
19
19
  var theme = styled.useTheme();
20
- React.useEffect(function () {
21
- var _a, _b;
22
- if (theme && theme.constants) {
23
- if ((searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current) &&
24
- width < ((_a = theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint) &&
25
- isOpen) {
26
- (_b = searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current) === null || _b === void 0 ? void 0 : _b.focus();
27
- }
28
- }
29
- }, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current, isOpen]);
30
20
  var resultVariants = {
31
21
  closed: {
32
22
  height: '0',
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -25,7 +25,7 @@ var SearchInput = styled__default["default"].input(templateObject_4 || (template
25
25
  : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs2;
26
26
  }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.mediumDark; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.mediumDark; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.mediumDark; });
27
27
  var MobileSearchFormContainer = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n background: ", ";\n padding: ", ";\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n background: ", ";\n padding: ", ";\n @media (min-width: ", "px) {\n display: none;\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px 10px"); }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; });
28
- var SearchForm = styled__default["default"].form(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n ", "\n }\n"], ["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n ", "\n }\n"])), function (props) { return (props.hideInMobile ? 'none' : 'flex'); }, function (props) { var _a, _b; return "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs, "px ").concat((_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.searchBarHorizontalPadding, "px"); }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue; }, 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.searchBarHorizontalPadding; }, 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.dark; }, function (props) {
28
+ var SearchForm = styled__default["default"].form(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n ", "\n }\n"], ["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n ", "\n }\n"])), function (props) { return (props.hideInMobile ? 'none' : 'flex'); }, function (props) { var _a, _b; return "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs, "px ").concat((_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.searchBarHorizontalPadding, "px"); }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.dark; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue; }, 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.searchBarHorizontalPadding; }, 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) {
29
29
  return props.isOpen &&
30
30
  "\n flex-direction: row;\n ";
31
31
  });
@@ -1,6 +1,6 @@
1
1
  import { __rest, __assign } from '../../../../_virtual/_tslib.js';
2
2
  import { useWindowSize } from '@citygross/utils';
3
- import React, { useEffect } from 'react';
3
+ import React from 'react';
4
4
  import { useTheme } from 'styled-components';
5
5
  import { SearchBarContainer, SearchForm, SearchLeftIcon, SearchInput, SearchRightLabel, MobileSearchIconContainer, SearchResultContainer, MobileSearchFormContainer } from './SearchBar.styles.js';
6
6
 
@@ -9,16 +9,6 @@ var SearchBar = function (_a) {
9
9
  var flexGrow = _a.flexGrow, isValid = _a.isValid, _e = _a.inputSize, inputSize = _e === void 0 ? 'medium' : _e, 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, mobileTopPosition = _a.mobileTopPosition, props = __rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "searchOnSubmit", "searchInputMobileRef", "mobileTopPosition"]);
10
10
  var width = useWindowSize().width;
11
11
  var theme = useTheme();
12
- useEffect(function () {
13
- var _a, _b;
14
- if (theme && theme.constants) {
15
- if ((searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current) &&
16
- width < ((_a = theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint) &&
17
- isOpen) {
18
- (_b = searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current) === null || _b === void 0 ? void 0 : _b.focus();
19
- }
20
- }
21
- }, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current, searchInputMobileRef === null || searchInputMobileRef === void 0 ? void 0 : searchInputMobileRef.current, isOpen]);
22
12
  var resultVariants = {
23
13
  closed: {
24
14
  height: '0',
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,7 +17,7 @@ var SearchInput = styled.input(templateObject_4 || (templateObject_4 = __makeTem
17
17
  : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs2;
18
18
  }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.mediumDark; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.mediumDark; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.mediumDark; });
19
19
  var MobileSearchFormContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: ", ";\n padding: ", ";\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n background: ", ";\n padding: ", ";\n @media (min-width: ", "px) {\n display: none;\n }\n"])), function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, "px 10px"); }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.headerBreakpoint; });
20
- var SearchForm = styled.form(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n ", "\n }\n"], ["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n ", "\n }\n"])), function (props) { return (props.hideInMobile ? 'none' : 'flex'); }, function (props) { var _a, _b; return "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs, "px ").concat((_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.searchBarHorizontalPadding, "px"); }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue; }, 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.searchBarHorizontalPadding; }, 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.dark; }, function (props) {
20
+ var SearchForm = styled.form(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n ", "\n }\n"], ["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n > div[data-lastpass-icon-root] {\n display: none;\n }\n @media (min-width: ", "px) {\n padding: 0px ", "px;\n display: flex;\n\n flex-direction: row;\n padding-left: ", "px;\n padding-right: ", "px;\n ", "\n }\n"])), function (props) { return (props.hideInMobile ? 'none' : 'flex'); }, function (props) { var _a, _b; return "".concat((_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xxs, "px ").concat((_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.searchBarHorizontalPadding, "px"); }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.white; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.dark; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.brandBlue; }, 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.searchBarHorizontalPadding; }, 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) {
21
21
  return props.isOpen &&
22
22
  "\n flex-direction: row;\n ";
23
23
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.174",
3
+ "version": "0.7.176",
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": "17aebc655f8672e0c36f0b14fc5d6d5ec17d5132"
74
+ "gitHead": "3e49d8f6b8ed965ae5e480bed5a6b9156eaa8906"
75
75
  }