@thecb/components 5.5.0 → 5.6.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": "5.5.0",
3
+ "version": "5.6.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -22,7 +22,7 @@ const Breadcrumbs = ({ breadcrumbsList = [] }) => {
22
22
  <Fragment key={`breadcrumb-${linkText}`}>
23
23
  <InternalLink
24
24
  aria-current={
25
- index === breadcrumbsList.length - 1 && "location"
25
+ index === breadcrumbsList.length - 1 ? "location" : ""
26
26
  }
27
27
  to={linkDestination}
28
28
  active={isActive.toString()}
@@ -46,7 +46,11 @@ const Breadcrumbs = ({ breadcrumbsList = [] }) => {
46
46
  >
47
47
  {linkText}
48
48
  </InternalLink>
49
- {index < breadcrumbsList.length - 1 && <IconChevron />}
49
+ {index < breadcrumbsList.length - 1 ? (
50
+ <IconChevron />
51
+ ) : (
52
+ <Fragment />
53
+ )}
50
54
  </Fragment>
51
55
  )
52
56
  )}
@@ -5,7 +5,7 @@ export { default as BoxWithShadow } from "./box-with-shadow";
5
5
  export { default as Breadcrumb } from "./breadcrumb";
6
6
  export { default as ButtonWithAction } from "./button-with-action";
7
7
  export { default as ButtonWithLink } from "./button-with-link";
8
- export { default as cardRegistry } from "./card";
8
+ export { default as cardRegistry } from "./welcome-card";
9
9
  export { default as Checkbox } from "./checkbox";
10
10
  export { default as CheckboxList } from "./checkbox-list";
11
11
  export { default as CountryDropdown } from "./country-dropdown";
@@ -2,6 +2,12 @@ import React, { Fragment } from "react";
2
2
  import { safeChildren } from "../../../util/general";
3
3
  import { ReelStyled } from "./Reel.styled";
4
4
 
5
+ /*
6
+ Safari has a bug where it refuses to recognize <ul /> tags as lists when list-style: none is used
7
+ This affects the apple voice over (mainly used on iOS devices)
8
+ The solution is to explicitly include "role=List"
9
+ */
10
+
5
11
  const Reel = ({
6
12
  childGap = "1rem",
7
13
  height = "auto",
@@ -27,6 +33,7 @@ const Reel = ({
27
33
  useOrderedList={useOrderedList}
28
34
  useUnorderedList={useUnorderedList}
29
35
  {...rest}
36
+ role={useOrderedList || useUnorderedList ? "list" : "section"}
30
37
  >
31
38
  {safeChildren(children, <Fragment />)}
32
39
  </ReelStyled>
@@ -4,7 +4,7 @@ import { fallbackValues } from "./ProcessingFee.theme";
4
4
  import { themeComponent } from "../../../util/themeUtils";
5
5
  import Box from "../layouts/Box";
6
6
  import Alert from "../alert";
7
- import { displayCurrency } from "../../../util/general";
7
+ import { displayCurrency, formatPercent } from "../../../util/general";
8
8
  const ProcessingFee = ({
9
9
  feeValue = 0,
10
10
  feeName = "",
@@ -23,7 +23,7 @@ const ProcessingFee = ({
23
23
  text={`There is a processing fee of ${
24
24
  feeType === "FLAT"
25
25
  ? `${displayCurrency(feeValue)}`
26
- : `${feeValue * 100}%`
26
+ : `${formatPercent(feeValue * 100)}%`
27
27
  } ${ifElse(
28
28
  isNil,
29
29
  always(""),
@@ -105,7 +105,10 @@ const Card = ({
105
105
  </Box>
106
106
  </Cover>
107
107
  </Box>
108
- <Box padding="0.5rem 1rem 1rem">
108
+ <Box
109
+ padding="0.5rem 1rem 1rem"
110
+ extraStyles={`display: flex; justify-content: center;`}
111
+ >
109
112
  <ButtonWithAction
110
113
  variant="smallPrimary"
111
114
  text={buttonText}
@@ -54,8 +54,9 @@ const HighlightTabRow = ({
54
54
  highlightIndex == i ? themeValues.textColor : "transparent"
55
55
  }
56
56
  borderWidthOverride="0 0 3px 0"
57
- extraStyles="text-align: center;"
57
+ extraStyles="text-align: center; display: block;"
58
58
  as="li"
59
+ aria-current={highlightIndex == i ? "step" : ""}
59
60
  >
60
61
  <Text
61
62
  variant="p"
@@ -50,6 +50,7 @@ const WorkflowTile = ({
50
50
  minWidth={"100%"}
51
51
  url={`/service/${slug}`}
52
52
  extraStyles={`width: 100%;`}
53
+ linkExtraStyles={`justify-content: center;`}
53
54
  />
54
55
  </Box>
55
56
  </Stack>
@@ -10,6 +10,8 @@ export const displayCurrency = cents =>
10
10
 
11
11
  export const convertCentsToMoneyInt = n => (n / 100).toFixed(0);
12
12
 
13
+ export const formatPercent = decimal => Number.parseFloat(decimal).toFixed(2);
14
+
13
15
  const createUniqueId = () =>
14
16
  "_" +
15
17
  Math.random()