@thecb/components 11.2.14-beta.0 → 11.2.14-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "11.2.14-beta.0",
3
+ "version": "11.2.14-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -4,7 +4,7 @@ import { Box, Motion } from "../../atoms/layouts";
4
4
  import { fallbackValues } from "./NavMenu.theme.js";
5
5
  import { themeComponent } from "../../../util/themeUtils";
6
6
 
7
- // Use transforms (x) rather than left/right
7
+ // Animate with transforms (x) instead of left/right
8
8
  const menuVariants = {
9
9
  invisible: {
10
10
  x: "-100vw",
@@ -23,10 +23,16 @@ const menuVariants = {
23
23
  };
24
24
 
25
25
  const ImposterMenu = styled(Motion)`
26
+ /* Full-screen fixed overlay */
26
27
  position: fixed;
27
- top: ${({ headerSize }) => headerSize};
28
+ top: 0;
28
29
  left: 0;
29
30
  right: 0;
31
+ bottom: 0;
32
+ /* Semi-transparent gray overlay color */
33
+ background: ${({ themeValues }) =>
34
+ themeValues?.overlayColor || "rgba(0, 0, 0, 0.5)"};
35
+ z-index: 9999; /* ensure it's above other content */
30
36
  `;
31
37
 
32
38
  const NavMenuMobile = ({
@@ -42,15 +48,19 @@ const NavMenuMobile = ({
42
48
  variants={menuVariants}
43
49
  initial="invisible"
44
50
  animate={visible ? "visible" : "invisible"}
45
- headerSize={headerSize}
51
+ themeValues={themeValues}
46
52
  >
53
+ {/*
54
+ The Box is the “menu” portion.
55
+ It’s narrower, but the parent ImposterMenu is full-screen & gray.
56
+ */}
47
57
  <Box
48
- width="100vw"
58
+ width="100%"
59
+ maxWidth="400px"
49
60
  padding="1rem 0.5rem"
50
61
  extraStyles={`
51
62
  position: relative;
52
- max-width: 400px;
53
- height: calc(100vh - 72px);
63
+ height: 100%;
54
64
  `}
55
65
  background={themeValues.backgroundColor}
56
66
  >
@@ -88,12 +88,12 @@ export const ProfileMenu = {
88
88
  };
89
89
 
90
90
  return (
91
- <Box>
91
+ <>
92
92
  <ButtonWithAction onClick={toggleMenu}>
93
93
  {visible ? "Hide Menu" : "Show Menu"}
94
94
  </ButtonWithAction>
95
95
  <NavMenuMobile {...args} visible={visible} />
96
- </Box>
96
+ </>
97
97
  );
98
98
  }
99
99
  };
@@ -113,12 +113,12 @@ export const InteractiveMenu = {
113
113
  };
114
114
 
115
115
  return (
116
- <Box>
116
+ <>
117
117
  <ButtonWithAction onClick={toggleMenu}>
118
118
  {visible ? "Hide Menu" : "Show Menu"}
119
119
  </ButtonWithAction>
120
120
  <NavMenuMobile {...args} visible={visible} />
121
- </Box>
121
+ </>
122
122
  );
123
123
  }
124
124
  };