@thecb/components 3.5.0 → 3.5.3

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/dist/index.cjs.js CHANGED
@@ -13633,8 +13633,8 @@ var IconAdd = function IconAdd() {
13633
13633
  var TimeoutImage = function TimeoutImage() {
13634
13634
  return /*#__PURE__*/React__default.createElement("svg", {
13635
13635
  xmlns: "http://www.w3.org/2000/svg",
13636
- width: "458",
13637
- height: "308",
13636
+ width: "100%",
13637
+ height: "100%",
13638
13638
  viewBox: "0 0 458 308"
13639
13639
  }, /*#__PURE__*/React__default.createElement("g", {
13640
13640
  fill: "none",
@@ -17008,15 +17008,14 @@ var Dropdown = function Dropdown(_ref7) {
17008
17008
  }, /*#__PURE__*/React__default.createElement(Box, {
17009
17009
  as: "button",
17010
17010
  background: isOpen ? themeValues.hoverColor : WHITE,
17011
- minHeight: "52px",
17012
17011
  width: "100%",
17013
- padding: "16px",
17012
+ padding: "12px",
17014
17013
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
17015
17014
  focusStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
17016
17015
  borderSize: "1px",
17017
17016
  borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
17018
17017
  borderRadius: "2px",
17019
- extraStyles: "tabindex: 0;",
17018
+ extraStyles: "tabindex: 0; height: 48px;",
17020
17019
  dataQa: placeholder
17021
17020
  }, /*#__PURE__*/React__default.createElement(Stack, {
17022
17021
  direction: "row",
@@ -19072,7 +19071,7 @@ var Loading = function Loading() {
19072
19071
  return /*#__PURE__*/React__default.createElement(Box, {
19073
19072
  key: "spinner-container"
19074
19073
  }, /*#__PURE__*/React__default.createElement(Cover, {
19075
- minHeight: "100%",
19074
+ minHeight: "100vh",
19076
19075
  singleChild: true
19077
19076
  }, /*#__PURE__*/React__default.createElement(Center, {
19078
19077
  intrinsic: true
@@ -37811,16 +37810,20 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
37811
37810
 
37812
37811
  var Timeout = function Timeout(_ref) {
37813
37812
  var onLogout = _ref.onLogout;
37813
+
37814
+ var _useContext = React.useContext(styled.ThemeContext),
37815
+ isMobile = _useContext.isMobile;
37816
+
37814
37817
  return /*#__PURE__*/React__default.createElement(Cover, null, /*#__PURE__*/React__default.createElement(Center, {
37815
37818
  intrinsic: true
37816
37819
  }, /*#__PURE__*/React__default.createElement(Box, {
37817
37820
  padding: "0",
37818
- maxWidth: "500px"
37821
+ maxWidth: isMobile ? "100%" : "500px"
37819
37822
  }, /*#__PURE__*/React__default.createElement(Stack, {
37820
37823
  childGap: "32px",
37821
37824
  justify: "center"
37822
- }, /*#__PURE__*/React__default.createElement(Center, {
37823
- intrinsic: true
37825
+ }, /*#__PURE__*/React__default.createElement(Box, {
37826
+ padding: isMobile ? "1rem" : "0"
37824
37827
  }, /*#__PURE__*/React__default.createElement(TimeoutImage, null)), /*#__PURE__*/React__default.createElement(Box, {
37825
37828
  padding: "0"
37826
37829
  }, /*#__PURE__*/React__default.createElement(Heading$1, {
@@ -37840,6 +37843,8 @@ var Timeout = function Timeout(_ref) {
37840
37843
  })))))));
37841
37844
  };
37842
37845
 
37846
+ var Timeout$1 = withWindowSize(Timeout);
37847
+
37843
37848
  var WorkflowTile = function WorkflowTile(_ref) {
37844
37849
  var _ref$workflowName = _ref.workflowName,
37845
37850
  workflowName = _ref$workflowName === void 0 ? "Test Workflow" : _ref$workflowName,
@@ -38261,7 +38266,7 @@ exports.TableListItem = TableListItem;
38261
38266
  exports.TermsAndConditions = TermsAndConditions;
38262
38267
  exports.TermsAndConditionsModal = TermsAndConditionsModal$1;
38263
38268
  exports.Text = Text$1;
38264
- exports.Timeout = Timeout;
38269
+ exports.Timeout = Timeout$1;
38265
38270
  exports.TimeoutImage = TimeoutImage;
38266
38271
  exports.ToggleSwitch = ToggleSwitch$1;
38267
38272
  exports.VerifiedEmailIcon = VerifiedEmailIcon$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "3.5.0",
3
+ "version": "3.5.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -206,9 +206,8 @@ const Dropdown = ({
206
206
  <Box
207
207
  as="button"
208
208
  background={isOpen ? themeValues.hoverColor : WHITE}
209
- minHeight="52px"
210
209
  width="100%"
211
- padding="16px"
210
+ padding="12px"
212
211
  hoverStyles={`background-color: ${themeValues.hoverColor};`}
213
212
  focusStyles={`background-color: ${themeValues.hoverColor};`}
214
213
  borderSize="1px"
@@ -220,7 +219,7 @@ const Dropdown = ({
220
219
  : GREY_CHATEAU
221
220
  }
222
221
  borderRadius="2px"
223
- extraStyles={`tabindex: 0;`}
222
+ extraStyles={`tabindex: 0; height: 48px;`}
224
223
  dataQa={placeholder}
225
224
  >
226
225
  <Stack direction="row" bottomItem={2}>
@@ -4,8 +4,8 @@ const TimeoutImage = () => {
4
4
  return (
5
5
  <svg
6
6
  xmlns="http://www.w3.org/2000/svg"
7
- width="458"
8
- height="308"
7
+ width="100%"
8
+ height="100%"
9
9
  viewBox="0 0 458 308"
10
10
  >
11
11
  <g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
@@ -4,7 +4,7 @@ import { Box, Cover, Center } from "../layouts";
4
4
 
5
5
  const Loading = () => (
6
6
  <Box key="spinner-container">
7
- <Cover minHeight="100%" singleChild>
7
+ <Cover minHeight="100vh" singleChild>
8
8
  <Center intrinsic>
9
9
  <Box>
10
10
  <Spinner size="100" />
@@ -1,41 +1,46 @@
1
- import React from "react";
1
+ import React, { useContext } from "react";
2
+ import { ThemeContext } from "styled-components";
2
3
  import { Box, Stack, Center, Cover } from "../../atoms/layouts";
3
4
  import { TimeoutImage } from "../../atoms/icons";
4
5
  import ButtonWithAction from "../../atoms/button-with-action";
5
6
  import Heading from "../../atoms/heading";
6
7
  import { FONT_WEIGHT_BOLD } from "../../../constants/style_constants";
7
8
  import Paragraph from "../../atoms/paragraph";
9
+ import withWindowSize from "../../withWindowSize";
8
10
 
9
- const Timeout = ({ onLogout }) => (
10
- <Cover>
11
- <Center intrinsic>
12
- <Box padding="0" maxWidth="500px">
13
- <Stack childGap="32px" justify="center">
14
- <Center intrinsic>
15
- <TimeoutImage />
16
- </Center>
17
- <Box padding="0">
18
- <Heading textAlign="center" weight={FONT_WEIGHT_BOLD}>
19
- Request Timed Out
20
- </Heading>
21
- <Paragraph variant="pL" extraStyles={`text-align: center;`}>
22
- That was taking longer than we expected and your request timed
23
- out. Please log out, log back in, and then try again.
24
- </Paragraph>
25
- </Box>
26
- <Center intrinsic>
11
+ const Timeout = ({ onLogout }) => {
12
+ const { isMobile } = useContext(ThemeContext);
13
+ return (
14
+ <Cover>
15
+ <Center intrinsic>
16
+ <Box padding="0" maxWidth={isMobile ? "100%" : "500px"}>
17
+ <Stack childGap="32px" justify="center">
18
+ <Box padding={isMobile ? "1rem" : "0"}>
19
+ <TimeoutImage />
20
+ </Box>
27
21
  <Box padding="0">
28
- <ButtonWithAction
29
- variant="primary"
30
- text="Log out"
31
- action={onLogout}
32
- />
22
+ <Heading textAlign="center" weight={FONT_WEIGHT_BOLD}>
23
+ Request Timed Out
24
+ </Heading>
25
+ <Paragraph variant="pL" extraStyles={`text-align: center;`}>
26
+ That was taking longer than we expected and your request timed
27
+ out. Please log out, log back in, and then try again.
28
+ </Paragraph>
33
29
  </Box>
34
- </Center>
35
- </Stack>
36
- </Box>
37
- </Center>
38
- </Cover>
39
- );
30
+ <Center intrinsic>
31
+ <Box padding="0">
32
+ <ButtonWithAction
33
+ variant="primary"
34
+ text="Log out"
35
+ action={onLogout}
36
+ />
37
+ </Box>
38
+ </Center>
39
+ </Stack>
40
+ </Box>
41
+ </Center>
42
+ </Cover>
43
+ );
44
+ };
40
45
 
41
- export default Timeout;
46
+ export default withWindowSize(Timeout);