@thecb/components 7.9.4-beta.1 → 7.9.4-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "7.9.4-beta.1",
3
+ "version": "7.9.4-beta.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -44,7 +44,6 @@ const HiddenCheckbox = styled.input.attrs({ type: "checkbox" })`
44
44
 
45
45
  const StyledCheckbox = styled.div`
46
46
  display: inline-block;
47
- margin-right: 16px;
48
47
  width: 24px;
49
48
  height: 24px;
50
49
  border-radius: 2px;
@@ -92,6 +91,7 @@ const Checkbox = ({
92
91
  themeValues,
93
92
  hidden = false,
94
93
  error = false,
94
+ checkboxMargin = "0 16px 0 0",
95
95
  extraStyles,
96
96
  textExtraStyles
97
97
  }) => {
@@ -112,7 +112,7 @@ const Checkbox = ({
112
112
  onKeyDown={e => handleClick(e, onChange)}
113
113
  hiddenStyles={hidden}
114
114
  background={themeValues.backgroundColor}
115
- extraStyles={`outline: none; ${extraStyles}`}
115
+ extraStyles={`outline: none; ${extraStyles}; margin: ${checkboxMargin};`}
116
116
  >
117
117
  <CheckboxLabelContainer>
118
118
  <CheckboxContainer data-qa="Checkbox">
@@ -149,20 +149,22 @@ const Checkbox = ({
149
149
  </CheckboxIcon>
150
150
  </StyledCheckbox>
151
151
  </CheckboxContainer>
152
- <Text
153
- variant="p"
154
- weight={themeValues.textFontWeight}
155
- color={themeValues.textColor}
156
- extraStyles={
157
- textExtraStyles
158
- ? `${textExtraStyles} ${disabled &&
159
- `color: #6e727e; background-color: #f7f7f7;`} `
160
- : `margin-left: 1rem ${disabled &&
161
- `color: #6e727e; background-color: #f7f7f7;`}`
162
- }
163
- >
164
- {title}
165
- </Text>
152
+ {title && (
153
+ <Text
154
+ variant="p"
155
+ weight={themeValues.textFontWeight}
156
+ color={themeValues.textColor}
157
+ extraStyles={
158
+ textExtraStyles
159
+ ? `${textExtraStyles} ${disabled &&
160
+ `color: #6e727e; background-color: #f7f7f7;`} `
161
+ : `margin-left: 1rem ${disabled &&
162
+ `color: #6e727e; background-color: #f7f7f7;`}`
163
+ }
164
+ >
165
+ {title}
166
+ </Text>
167
+ )}
166
168
  </CheckboxLabelContainer>
167
169
  </Box>
168
170
  );
@@ -24,7 +24,8 @@ const TermsAndConditionsControlV2 = ({
24
24
  id = "terms-and-conditions",
25
25
  displayInline = true,
26
26
  modalVariant = "default",
27
- containerBackground = ATHENS_GREY
27
+ containerBackground = ATHENS_GREY,
28
+ checkboxMargin = "0 0.5rem 0 0"
28
29
  }) => {
29
30
  const [showTerms, toggleShowTerms] = useState(false);
30
31
  const standardBoxShadow = generateShadows().standard.base;
@@ -39,13 +40,14 @@ const TermsAndConditionsControlV2 = ({
39
40
  >
40
41
  <Stack childGap="0.25rem">
41
42
  {html && <Box padding="0">{html}</Box>}
42
- <Cluster justify="flex-start" align="center" nowrap>
43
+ <Cluster justify="flex-start" align="flex-start" nowrap>
43
44
  {showCheckbox && (
44
45
  <Checkbox
45
46
  name={id}
46
47
  error={hasError}
47
48
  checked={isChecked}
48
49
  onChange={onCheck}
50
+ checkboxMargin={checkboxMargin}
49
51
  />
50
52
  )}
51
53
  <Stack childGap="0.25rem">