@thecb/components 5.4.4 → 5.6.1
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/dist/index.cjs.js +31 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +31 -13
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/breadcrumb/Breadcrumb.js +6 -2
- package/src/components/atoms/layouts/Reel.js +9 -0
- package/src/components/atoms/layouts/Reel.styled.js +11 -0
- package/src/components/atoms/processing-fee/ProcessingFee.js +2 -2
- package/src/components/molecules/collapsible-section/CollapsibleSection.js +4 -4
- package/src/components/molecules/editable-list/EditableList.js +2 -2
- package/src/components/molecules/highlight-tab-row/HighlightTabRow.js +2 -1
- package/src/util/general.js +2 -0
package/package.json
CHANGED
|
@@ -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
|
|
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
|
|
49
|
+
{index < breadcrumbsList.length - 1 ? (
|
|
50
|
+
<IconChevron />
|
|
51
|
+
) : (
|
|
52
|
+
<Fragment />
|
|
53
|
+
)}
|
|
50
54
|
</Fragment>
|
|
51
55
|
)
|
|
52
56
|
)}
|
|
@@ -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",
|
|
@@ -24,7 +30,10 @@ const Reel = ({
|
|
|
24
30
|
justifyContent={justifyContent}
|
|
25
31
|
disableScroll={disableScroll}
|
|
26
32
|
as={elementType}
|
|
33
|
+
useOrderedList={useOrderedList}
|
|
34
|
+
useUnorderedList={useUnorderedList}
|
|
27
35
|
{...rest}
|
|
36
|
+
role={useOrderedList || useUnorderedList ? "list" : "section"}
|
|
28
37
|
>
|
|
29
38
|
{safeChildren(children, <Fragment />)}
|
|
30
39
|
</ReelStyled>
|
|
@@ -14,4 +14,15 @@ export const ReelStyled = styled.div`
|
|
|
14
14
|
> * {
|
|
15
15
|
flex: 0 0 ${({ childWidth }) => childWidth};
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
${({ useOrderedList, useUnorderedList }) =>
|
|
19
|
+
useOrderedList || useUnorderedList
|
|
20
|
+
? `
|
|
21
|
+
margin: 0;
|
|
22
|
+
margin-block-start: 0;
|
|
23
|
+
margin-block-end: 0;
|
|
24
|
+
padding-inline-start: 0;
|
|
25
|
+
list-style-type: none;
|
|
26
|
+
`
|
|
27
|
+
: ``}
|
|
17
28
|
`;
|
|
@@ -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(""),
|
|
@@ -2,7 +2,7 @@ import React, { Fragment } from "react";
|
|
|
2
2
|
import { fallbackValues } from "./CollapsibleSection.theme";
|
|
3
3
|
import { AnimatePresence } from "framer-motion";
|
|
4
4
|
import { themeComponent } from "../../../util/themeUtils";
|
|
5
|
-
import
|
|
5
|
+
import Title from "../../atoms/title";
|
|
6
6
|
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
7
7
|
import { Box, Cluster, Stack, Motion } from "../../atoms/layouts";
|
|
8
8
|
import { ChevronIcon } from "../../atoms/icons";
|
|
@@ -98,14 +98,14 @@ const CollapsibleSection = ({
|
|
|
98
98
|
{title}
|
|
99
99
|
</Box>
|
|
100
100
|
) : (
|
|
101
|
-
<
|
|
102
|
-
variant="h6"
|
|
101
|
+
<Title
|
|
103
102
|
weight={FONT_WEIGHT_SEMIBOLD}
|
|
104
103
|
color={themeValues.titleColor}
|
|
105
104
|
as="h6"
|
|
105
|
+
variant="small"
|
|
106
106
|
>
|
|
107
107
|
{title}
|
|
108
|
-
</
|
|
108
|
+
</Title>
|
|
109
109
|
)}
|
|
110
110
|
<Motion
|
|
111
111
|
variants={icon}
|
|
@@ -111,7 +111,7 @@ const EditableList = ({
|
|
|
111
111
|
text="Remove"
|
|
112
112
|
action={() => removeItem(item.id)}
|
|
113
113
|
extraStyles={`min-width: 0;`}
|
|
114
|
-
aria-label={`Remove ${itemName}
|
|
114
|
+
aria-label={`Remove ${itemName}`}
|
|
115
115
|
/>
|
|
116
116
|
)}
|
|
117
117
|
</Box>
|
|
@@ -129,7 +129,7 @@ const EditableList = ({
|
|
|
129
129
|
text="Edit"
|
|
130
130
|
action={() => editItem(item.id)}
|
|
131
131
|
extraStyles={`min-width: 0;`}
|
|
132
|
-
aria-label={`Edit ${itemName}
|
|
132
|
+
aria-label={`Edit ${itemName}`}
|
|
133
133
|
/>
|
|
134
134
|
</Box>
|
|
135
135
|
)}
|
|
@@ -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"
|
package/src/util/general.js
CHANGED