@thecb/components 11.10.2 → 11.10.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": "11.10.2",
3
+ "version": "11.10.3",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -5,6 +5,7 @@ import { fallbackValues } from "./FormLayouts.theme.js";
5
5
  import { themeComponent } from "../../../util/themeUtils";
6
6
  import { createIdFromString } from "../../../util/general.js";
7
7
  import Text from "../text";
8
+ import ButtonWithAction from "../button-with-action";
8
9
  import { Box, Cluster, Stack } from "../layouts";
9
10
  import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
10
11
  import { ERROR_COLOR, ROYAL_BLUE } from "../../../constants/colors";
@@ -171,7 +172,7 @@ const FormInput = ({
171
172
  </Cluster>
172
173
  ) : (
173
174
  <Box padding="0" minWidth="100%">
174
- <Cluster justify="space-between" align="center">
175
+ <Cluster justify="space-between" align="center" overflow>
175
176
  {labelDisplayOverride ? (
176
177
  labelDisplayOverride
177
178
  ) : (
@@ -191,22 +192,14 @@ const FormInput = ({
191
192
  </Text>
192
193
  )}
193
194
  {type === "password" && (
194
- <Text
195
- variant={labelTextVariant}
196
- color={themeValues.linkColor}
197
- weight={themeValues.fontWeight}
198
- hoverStyles={themeValues.hoverFocusStyles}
199
- extraStyles={`text-decoration: underline; cursor: pointer; &:focus { outline-offset: -2px; }`}
200
- onClick={() => setShowPassword(!showPassword)}
201
- tabIndex="0"
195
+ <ButtonWithAction
196
+ variant="smallGhost"
197
+ text={showPassword ? "Hide" : "Show"}
198
+ action={() => setShowPassword(!showPassword)}
202
199
  aria-label={showPassword ? "Hide Password" : "Show password"}
203
- aria-live="polite"
204
- onKeyPress={e =>
205
- e.key === "Enter" && setShowPassword(!showPassword)
206
- }
207
- >
208
- {showPassword ? "Hide" : "Show"}
209
- </Text>
200
+ extraStyles={`margin: 0; min-width: auto;`}
201
+ textExtraStyles={`color: ${themeValues.linkColor};`}
202
+ />
210
203
  )}
211
204
  {isMobile && decorator && (
212
205
  <Box padding="0 0 0 auto">{decorator}</Box>