@thecb/components 10.12.1 → 10.12.2-beta.0
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 +222 -110
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +221 -111
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +14 -8
- package/src/components/atoms/icons/CheckboxCheckmarkIcon.js +45 -0
- package/src/components/atoms/icons/PaymentStatusIcon.d.ts +1 -0
- package/src/components/atoms/icons/PaymentStatusIcon.js +28 -0
- package/src/components/atoms/icons/PersonIcon.d.ts +1 -0
- package/src/components/atoms/icons/PersonIcon.js +28 -0
- package/src/components/atoms/icons/icons.stories.js +5 -1
- package/src/components/atoms/icons/index.js +5 -1
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +22 -20
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.stories.js +2 -4
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.styled.js +2 -2
- package/src/components/molecules/multiple-select-filter/__private__/ActionLinkButton.js +16 -13
- package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +13 -9
- package/src/components/molecules/multiple-select-filter/__private__/FilterDropdown.js +22 -18
- package/src/components/molecules/multiple-select-filter/__private__/FilterableList.js +43 -41
- package/src/components/molecules/multiple-select-filter/__private__/FilterableListItem.js +53 -41
- package/src/components/molecules/multiple-select-filter/__private__/SearchBox.js +10 -7
- package/src/components/molecules/multiple-select-filter/index.d.ts +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import Checkbox from "../../../atoms/checkbox";
|
|
3
|
-
import {
|
|
3
|
+
import { GHOST_GREY } from "../../../../constants/colors";
|
|
4
|
+
import CheckboxCheckmarkIcon from "../../../atoms/icons/CheckboxCheckmarkIcon";
|
|
4
5
|
|
|
5
6
|
const FilterableListItem = forwardRef(
|
|
6
7
|
(
|
|
@@ -12,54 +13,65 @@ const FilterableListItem = forwardRef(
|
|
|
12
13
|
disabled,
|
|
13
14
|
tabIndex,
|
|
14
15
|
name,
|
|
16
|
+
showDivider,
|
|
17
|
+
extraStyles,
|
|
15
18
|
themeValues
|
|
16
19
|
},
|
|
17
20
|
ref
|
|
18
21
|
) => {
|
|
22
|
+
const dividerStyles = `
|
|
23
|
+
::after {
|
|
24
|
+
content: '';
|
|
25
|
+
position: absolute;
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: block;
|
|
28
|
+
height: 1px;
|
|
29
|
+
background-color: ${GHOST_GREY};
|
|
30
|
+
bottom: -0.5rem;
|
|
31
|
+
left: 0;
|
|
32
|
+
}`;
|
|
19
33
|
return (
|
|
20
|
-
<
|
|
21
|
-
padding="0"
|
|
34
|
+
<Checkbox
|
|
22
35
|
key={index}
|
|
36
|
+
ref={ref}
|
|
37
|
+
title={option.name}
|
|
38
|
+
name={option.name}
|
|
39
|
+
role="option"
|
|
40
|
+
aria-selected={checked}
|
|
41
|
+
tabIndex={tabIndex}
|
|
42
|
+
dataQa={`${name}-option-${index}`}
|
|
43
|
+
checked={checked}
|
|
44
|
+
onChange={() => selectOption(option)}
|
|
45
|
+
textExtraStyles={`font-size: 0.875rem; margin: 0;`}
|
|
46
|
+
disabled={disabled}
|
|
23
47
|
extraStyles={`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
name={option.name}
|
|
35
|
-
checked={checked}
|
|
36
|
-
onChange={() => selectOption(option)}
|
|
37
|
-
textExtraStyles={`font-size: 0.875rem; margin: 0;`}
|
|
38
|
-
disabled={disabled}
|
|
39
|
-
extraStyles={`
|
|
40
|
-
padding: 0.075rem 0.325rem;
|
|
41
|
-
margin: 0;
|
|
42
|
-
:hover,
|
|
43
|
-
:active,
|
|
44
|
-
:focus {
|
|
45
|
-
background-color: ${themeValues.primaryColor};
|
|
46
|
-
}
|
|
48
|
+
padding: 0.375rem 0.625rem;
|
|
49
|
+
margin: 0;
|
|
50
|
+
:hover,
|
|
51
|
+
:active,
|
|
52
|
+
:focus {
|
|
53
|
+
background-color: ${themeValues.primaryColor};
|
|
54
|
+
outline-offset: -3px;
|
|
55
|
+
}
|
|
56
|
+
${showDivider && dividerStyles}
|
|
57
|
+
${extraStyles}
|
|
47
58
|
`}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
checkboxMargin={showDivider ? "0 0 1rem" : "0"}
|
|
60
|
+
hasIconOverride={true}
|
|
61
|
+
icon={CheckboxCheckmarkIcon}
|
|
62
|
+
checkboxExtraStyles={`
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
height: 20px;
|
|
67
|
+
width: 20px;
|
|
68
|
+
${
|
|
69
|
+
checked && !disabled
|
|
70
|
+
? `background: ` + themeValues.secondaryColor + `;`
|
|
71
|
+
: ""
|
|
72
|
+
}
|
|
73
|
+
`}
|
|
74
|
+
/>
|
|
63
75
|
);
|
|
64
76
|
}
|
|
65
77
|
);
|
|
@@ -22,13 +22,16 @@ const SearchBox = ({
|
|
|
22
22
|
placeholder={placeholder}
|
|
23
23
|
disabled={disabled}
|
|
24
24
|
extraStyles={`
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
height: 2.875rem;
|
|
26
|
+
border: 0;
|
|
27
|
+
border-radius: 0;
|
|
28
|
+
padding: 0.45rem;
|
|
29
|
+
font-size: 0.875rem;
|
|
30
|
+
border-bottom: 1px solid ${GHOST_GREY};
|
|
31
|
+
:focus {
|
|
32
|
+
outline-offset: -3px;
|
|
33
|
+
}
|
|
34
|
+
`}
|
|
32
35
|
/>
|
|
33
36
|
)}
|
|
34
37
|
</Box>
|
|
@@ -10,7 +10,9 @@ export interface MultipleSelectFilterProps {
|
|
|
10
10
|
actions: FieldActions;
|
|
11
11
|
autocompleteValue?: boolean;
|
|
12
12
|
btnContentOverride?: JSX.Element;
|
|
13
|
+
btnExtraStyles?: string;
|
|
13
14
|
disabled: boolean;
|
|
15
|
+
dropdownExtraStyles?: string;
|
|
14
16
|
extraStyles?: string;
|
|
15
17
|
fields: {
|
|
16
18
|
searchTerm: Field;
|
|
@@ -24,8 +26,6 @@ export interface MultipleSelectFilterProps {
|
|
|
24
26
|
options: SearchableSelectOption[];
|
|
25
27
|
placeholder?: string;
|
|
26
28
|
searchable?: boolean;
|
|
27
|
-
selectedOptions: SearchableSelectOption[];
|
|
28
|
-
setSelectedOptions: (options: SearchableSelectOption[]) => void;
|
|
29
29
|
themeValues?: any[];
|
|
30
30
|
truncateBtnTextWidth?: string;
|
|
31
31
|
}
|