@thecb/components 7.7.8-beta.0 → 7.7.8-beta.2

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": "7.7.8-beta.0",
3
+ "version": "7.7.8-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -67,6 +67,7 @@ const HighlightTabRow = ({
67
67
  color={themeValues.textColor}
68
68
  weight={FONT_WEIGHT_SEMIBOLD}
69
69
  extraStyles="display: block; white-space: nowrap;"
70
+ id={`${t?.toLowerCase()?.replace(/\s/g, "-")}-tab-text`}
70
71
  >
71
72
  {t}
72
73
  </Text>
@@ -1,9 +1,8 @@
1
1
  import React, { Fragment, memo } from "react";
2
2
  import { themeComponent } from "../../../util/themeUtils";
3
3
  import { fallbackValues } from "./Module.theme";
4
- import Heading from "../../atoms/heading";
5
4
  import Title from "../../atoms/title";
6
- import { Box } from "../../atoms/layouts";
5
+ import { Box, Cluster } from "../../atoms/layouts";
7
6
 
8
7
  /*
9
8
  New (01/22) - updated <Module /> to use <Title /> atom
@@ -25,6 +24,8 @@ const Module = ({
25
24
  variant = "default",
26
25
  fontSize,
27
26
  as,
27
+ titleID = "",
28
+ rightTitleContent,
28
29
  children
29
30
  }) => {
30
31
  const themedFontSize =
@@ -37,20 +38,28 @@ const Module = ({
37
38
  const themedElemType =
38
39
  variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
39
40
  const computedElemType = as || themedElemType;
41
+ const headingText = (
42
+ <Title
43
+ weight={themeValues.fontWeight}
44
+ color={themeValues.fontColor}
45
+ margin={`${spacing} 0 ${themeValues.titleSpacing} 0`}
46
+ textAlign={themeValues.textAlign}
47
+ as={computedElemType}
48
+ extraStyles={`font-size: ${computedFontSize};`}
49
+ id={titleID}
50
+ >
51
+ {heading}
52
+ </Title>
53
+ );
40
54
 
41
55
  return (
42
56
  <Fragment>
43
- {heading && (
44
- <Title
45
- weight={themeValues.fontWeight}
46
- color={themeValues.fontColor}
47
- margin={`${spacing} 0 ${themeValues.titleSpacing} 0`}
48
- textAlign={themeValues.textAlign}
49
- as={computedElemType}
50
- extraStyles={`font-size: ${computedFontSize};`}
51
- >
52
- {heading}
53
- </Title>
57
+ {heading && !rightTitleContent && headingText}
58
+ {heading && rightTitleContent && (
59
+ <Cluster justify="center" align="space-between">
60
+ {headingText}
61
+ {rightTitleContent}
62
+ </Cluster>
54
63
  )}
55
64
  <Box padding={`0 0 ${spacingBottom}`}>
56
65
  <Box