@thecb/components 7.9.4-beta.0 → 7.9.4-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.9.4-beta.0",
3
+ "version": "7.9.4-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",
@@ -44,7 +44,7 @@ const HiddenCheckbox = styled.input.attrs({ type: "checkbox" })`
44
44
 
45
45
  const StyledCheckbox = styled.div`
46
46
  display: inline-block;
47
- margin-right: 16px;
47
+ margin: ${({ checkboxMargin }) => checkboxMargin};
48
48
  width: 24px;
49
49
  height: 24px;
50
50
  border-radius: 2px;
@@ -92,6 +92,7 @@ const Checkbox = ({
92
92
  themeValues,
93
93
  hidden = false,
94
94
  error = false,
95
+ checkboxMargin = "0 16px 0 0",
95
96
  extraStyles,
96
97
  textExtraStyles
97
98
  }) => {
@@ -138,6 +139,7 @@ const Checkbox = ({
138
139
  disabledStyles={themeValues.disabledStyles}
139
140
  disabledCheckedStyles={themeValues.disabledCheckedStyles}
140
141
  focusedStyles={themeValues.focusedStyles}
142
+ checkboxMargin={checkboxMargin}
141
143
  >
142
144
  <CheckboxIcon
143
145
  viewBox="0 0 24 24"
@@ -149,20 +151,22 @@ const Checkbox = ({
149
151
  </CheckboxIcon>
150
152
  </StyledCheckbox>
151
153
  </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>
154
+ {title && (
155
+ <Text
156
+ variant="p"
157
+ weight={themeValues.textFontWeight}
158
+ color={themeValues.textColor}
159
+ extraStyles={
160
+ textExtraStyles
161
+ ? `${textExtraStyles} ${disabled &&
162
+ `color: #6e727e; background-color: #f7f7f7;`} `
163
+ : `margin-left: 1rem ${disabled &&
164
+ `color: #6e727e; background-color: #f7f7f7;`}`
165
+ }
166
+ >
167
+ {title}
168
+ </Text>
169
+ )}
166
170
  </CheckboxLabelContainer>
167
171
  </Box>
168
172
  );
@@ -39,18 +39,17 @@ const TermsAndConditionsControlV2 = ({
39
39
  >
40
40
  <Stack childGap="0.25rem">
41
41
  {html && <Box padding="0">{html}</Box>}
42
- <Cluster justify="flex-start" align="center" nowrap>
42
+ <Cluster justify="flex-start" align="flex-start" nowrap>
43
43
  {showCheckbox && (
44
44
  <Checkbox
45
45
  name={id}
46
- title="Terms and Conditions"
47
46
  error={hasError}
48
47
  checked={isChecked}
49
48
  onChange={onCheck}
50
49
  />
51
50
  )}
52
51
  <Stack childGap="0.25rem">
53
- <Cluster justify="flex-start" align="center" nowrap>
52
+ <Cluster justify="flex-start" align="flex-start" nowrap>
54
53
  {description && (
55
54
  <Text color={CHARADE_GREY}>{description}&nbsp;</Text>
56
55
  )}