@redsift/design-system-legacy 8.0.1 → 8.0.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 +3 -2
- package/dist/package.json +0 -65
- package/rollup.config.js +0 -70
- package/src/components/Alert/Alert.jsx +0 -94
- package/src/components/Alert/index.ts +0 -1
- package/src/components/Alert/readme.md +0 -114
- package/src/components/Button/Button.jsx +0 -161
- package/src/components/Button/index.ts +0 -1
- package/src/components/Button/readme.md +0 -173
- package/src/components/Card/Card.jsx +0 -34
- package/src/components/Card/index.ts +0 -1
- package/src/components/Card/readme.md +0 -54
- package/src/components/CardHeader/CardHeader.jsx +0 -40
- package/src/components/CardHeader/index.ts +0 -1
- package/src/components/Checkbox/Checkbox.jsx +0 -123
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/Checkbox/readme.md +0 -54
- package/src/components/CheckboxTree/CheckboxTree.jsx +0 -167
- package/src/components/CheckboxTree/CheckboxTree.styles.ts +0 -49
- package/src/components/CheckboxTree/index.ts +0 -1
- package/src/components/CheckboxTree/readme.md +0 -60
- package/src/components/IconContainer/IconContainer.jsx +0 -51
- package/src/components/IconContainer/index.ts +0 -1
- package/src/components/Input/Input.jsx +0 -27
- package/src/components/Input/OutlineInput/OutlineInput.jsx +0 -188
- package/src/components/Input/RegularInput/RegularInput.jsx +0 -55
- package/src/components/Input/RegularInput/RegularInput.styles.ts +0 -98
- package/src/components/Input/index.ts +0 -1
- package/src/components/Input/readme.md +0 -82
- package/src/components/Pagination/Pagination.jsx +0 -111
- package/src/components/Pagination/index.ts +0 -1
- package/src/components/Pagination/readme.md +0 -34
- package/src/components/Radio/Radio.jsx +0 -121
- package/src/components/Radio/index.ts +0 -1
- package/src/components/Radio/readme.md +0 -90
- package/src/components/Select/Select.jsx +0 -360
- package/src/components/Select/SelectComponents.jsx +0 -342
- package/src/components/Select/index.ts +0 -1
- package/src/components/Select/readme.md +0 -2507
- package/src/components/Switch/Switch.jsx +0 -130
- package/src/components/Switch/index.ts +0 -1
- package/src/components/Switch/readme.md +0 -55
- package/src/components/Table/ExportCSVButton.jsx +0 -34
- package/src/components/Table/Table.jsx +0 -872
- package/src/components/Table/TableComponents.jsx +0 -239
- package/src/components/Table/TableFilters.jsx +0 -23
- package/src/components/Table/TableStyles.jsx +0 -514
- package/src/components/Table/index.ts +0 -1
- package/src/components/Table/readme.md +0 -2190
- package/src/components/Tabs/Tabs.jsx +0 -116
- package/src/components/Tabs/TabsComponents.jsx +0 -124
- package/src/components/Tabs/index.ts +0 -1
- package/src/components/Tabs/readme.md +0 -171
- package/src/components/Typography/Typography.jsx +0 -77
- package/src/components/Typography/index.ts +0 -1
- package/src/components/Typography/readme.md +0 -88
- package/src/components/icons/ActionsIcon.jsx +0 -24
- package/src/components/icons/AddIcon.jsx +0 -8
- package/src/components/icons/Arrow.jsx +0 -39
- package/src/components/icons/ArrowDown.jsx +0 -8
- package/src/components/icons/ArrowIcon.jsx +0 -25
- package/src/components/icons/ArrowUp.jsx +0 -8
- package/src/components/icons/BarchartHorizontal.jsx +0 -18
- package/src/components/icons/BellIcon.jsx +0 -19
- package/src/components/icons/BimiSetupIcon.jsx +0 -25
- package/src/components/icons/Chevron.jsx +0 -42
- package/src/components/icons/ChevronLeft.jsx +0 -8
- package/src/components/icons/ChevronRight.jsx +0 -8
- package/src/components/icons/ClearIcon.jsx +0 -8
- package/src/components/icons/Cloud.jsx +0 -34
- package/src/components/icons/Cross.jsx +0 -25
- package/src/components/icons/DeleteIcon.jsx +0 -19
- package/src/components/icons/DynamicDmarcIcon.jsx +0 -43
- package/src/components/icons/EditOutline.jsx +0 -8
- package/src/components/icons/Email.jsx +0 -68
- package/src/components/icons/EmailSourcesIcon.jsx +0 -36
- package/src/components/icons/ExpandLayoutIcon.jsx +0 -38
- package/src/components/icons/ExportIcon.jsx +0 -7
- package/src/components/icons/Eye.jsx +0 -28
- package/src/components/icons/Facebook.jsx +0 -31
- package/src/components/icons/FilterList.jsx +0 -8
- package/src/components/icons/FindOutHowIcon.jsx +0 -49
- package/src/components/icons/FlatArrow.jsx +0 -33
- package/src/components/icons/ForwardArrowIcon.jsx +0 -54
- package/src/components/icons/Github.jsx +0 -41
- package/src/components/icons/Globe.jsx +0 -29
- package/src/components/icons/Hand.jsx +0 -21
- package/src/components/icons/InfinityLoop.jsx +0 -22
- package/src/components/icons/InfinityLoopBreak.jsx +0 -35
- package/src/components/icons/IngrainIcon.jsx +0 -33
- package/src/components/icons/LanguageIcon.jsx +0 -44
- package/src/components/icons/Linkedin.jsx +0 -37
- package/src/components/icons/LocationPin.jsx +0 -34
- package/src/components/icons/MicrosoftShield.jsx +0 -44
- package/src/components/icons/News.jsx +0 -65
- package/src/components/icons/Nodes.jsx +0 -17
- package/src/components/icons/OnDmarcIcon.jsx +0 -29
- package/src/components/icons/OnDmarcLogo.jsx +0 -74
- package/src/components/icons/OnDomainIcon.jsx +0 -27
- package/src/components/icons/OnInboxIcon.jsx +0 -42
- package/src/components/icons/OnInboxLogo.jsx +0 -97
- package/src/components/icons/OnInboxManagerIcon.jsx +0 -46
- package/src/components/icons/OpenInNewTabIcon.jsx +0 -28
- package/src/components/icons/Padlock.jsx +0 -37
- package/src/components/icons/PlusIcon.jsx +0 -16
- package/src/components/icons/Question.jsx +0 -19
- package/src/components/icons/Recruiting.jsx +0 -34
- package/src/components/icons/ReportsIcon.jsx +0 -25
- package/src/components/icons/SearchIcon.jsx +0 -7
- package/src/components/icons/Shield.jsx +0 -17
- package/src/components/icons/ShieldPassIcon.jsx +0 -23
- package/src/components/icons/ShieldSolid.jsx +0 -33
- package/src/components/icons/ShieldWarningIcon.jsx +0 -40
- package/src/components/icons/ShieldWarningInvertedIcon.jsx +0 -36
- package/src/components/icons/Spinner.jsx +0 -100
- package/src/components/icons/Team.jsx +0 -164
- package/src/components/icons/ThreeDotsIcon.jsx +0 -18
- package/src/components/icons/Thumb.jsx +0 -17
- package/src/components/icons/Traffic.jsx +0 -22
- package/src/components/icons/Twitter.jsx +0 -47
- package/src/components/icons/Upload.jsx +0 -12
- package/src/components/icons/VerticalDots.jsx +0 -28
- package/src/components/icons/Warning.jsx +0 -36
- package/src/components/icons/WarningTriangle.jsx +0 -44
- package/src/components/icons/Youtube.jsx +0 -28
- package/src/components/icons/index.ts +0 -69
- package/src/hooks/useDebouncedValue.jsx +0 -19
- package/src/hooks/useFetch.jsx +0 -26
- package/src/hooks/useIsMobile.jsx +0 -25
- package/src/hooks/useOnClickOutside.jsx +0 -14
- package/src/hooks/useToggle.jsx +0 -8
- package/src/index.ts +0 -23
- package/tsconfig.json +0 -3
- /package/{dist/CONTRIBUTING.md → CONTRIBUTING.md} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/index.js.map → index.js.map} +0 -0
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import React, { Fragment, useState } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
import { Typography } from '../Typography';
|
|
5
|
-
import { ArrowIcon, DeleteIcon, ClearIcon, EditOutline } from '../icons';
|
|
6
|
-
import {
|
|
7
|
-
ActionIcon,
|
|
8
|
-
Cell,
|
|
9
|
-
DeleteConfirmButton,
|
|
10
|
-
Row,
|
|
11
|
-
GreyButton,
|
|
12
|
-
} from "./TableStyles";
|
|
13
|
-
|
|
14
|
-
const BlankRows = ({
|
|
15
|
-
onDelete,
|
|
16
|
-
showDeleteColumn,
|
|
17
|
-
onSelectionChange,
|
|
18
|
-
staticPageSize,
|
|
19
|
-
noPagination,
|
|
20
|
-
headerGroups,
|
|
21
|
-
rowSubComponent,
|
|
22
|
-
editRowEnabled,
|
|
23
|
-
bordered,
|
|
24
|
-
rows,
|
|
25
|
-
page,
|
|
26
|
-
}) => {
|
|
27
|
-
const brows =
|
|
28
|
-
staticPageSize &&
|
|
29
|
-
staticPageSize - (noPagination ? rows.length : page.length) > 0
|
|
30
|
-
? [
|
|
31
|
-
...Array(
|
|
32
|
-
staticPageSize - (noPagination ? rows.length : page.length)
|
|
33
|
-
).keys(),
|
|
34
|
-
]
|
|
35
|
-
: (noPagination ? rows.length : page.length) < 1
|
|
36
|
-
? ["0"]
|
|
37
|
-
: [];
|
|
38
|
-
return (
|
|
39
|
-
<Fragment>
|
|
40
|
-
{brows.map((id) => {
|
|
41
|
-
return (
|
|
42
|
-
<Row bordered={bordered} key={`emptyrow-${id}`} isEmpty>
|
|
43
|
-
{onSelectionChange && <Cell />}
|
|
44
|
-
{headerGroups[headerGroups.length - 1].headers.map(
|
|
45
|
-
(header, idx) => {
|
|
46
|
-
return <Cell key={`emptycell-${idx}`} />;
|
|
47
|
-
}
|
|
48
|
-
)}
|
|
49
|
-
{editRowEnabled || (onDelete && showDeleteColumn) ? (
|
|
50
|
-
<Cell
|
|
51
|
-
size={editRowEnabled && onDelete && showDeleteColumn ? 90 : 80}
|
|
52
|
-
/>
|
|
53
|
-
) : null}
|
|
54
|
-
{rowSubComponent && !editRowEnabled && <Cell size={50} />}
|
|
55
|
-
</Row>
|
|
56
|
-
);
|
|
57
|
-
})}
|
|
58
|
-
</Fragment>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const ClearSearchButton = ({ title, handleClearSearch }) => {
|
|
63
|
-
return (
|
|
64
|
-
<Button aria-label={title} onClick={handleClearSearch} flatIcon>
|
|
65
|
-
<ClearIcon alt={title} />
|
|
66
|
-
</Button>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const EditButton = ({ title, ...props }) => {
|
|
71
|
-
let onClick = props.onClick;
|
|
72
|
-
if (props.customOnEdit) {
|
|
73
|
-
onClick = () => {
|
|
74
|
-
props.customOnEdit(props.row);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<ActionIcon
|
|
80
|
-
title={title}
|
|
81
|
-
aria-label={title}
|
|
82
|
-
icon={EditOutline}
|
|
83
|
-
unPadded
|
|
84
|
-
{...props}
|
|
85
|
-
onClick={onClick}
|
|
86
|
-
/>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const ButtonsRowContainer = ({ size = 80, children }) => {
|
|
91
|
-
return <Cell size={size}>{children}</Cell>;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const ActionButtons = ({
|
|
95
|
-
row,
|
|
96
|
-
disabled,
|
|
97
|
-
onDelete,
|
|
98
|
-
editButtonProps,
|
|
99
|
-
customOnEdit,
|
|
100
|
-
locales,
|
|
101
|
-
}) => {
|
|
102
|
-
const [confirm, setConfirm] = useState(false);
|
|
103
|
-
|
|
104
|
-
const handleOnDelete = (row) => {
|
|
105
|
-
if (!("_id" in row.original)) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const { _id } = row.original;
|
|
109
|
-
onDelete([_id]);
|
|
110
|
-
setConfirm(false);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const ConfirmButtons = () => {
|
|
114
|
-
return (
|
|
115
|
-
<div
|
|
116
|
-
style={{
|
|
117
|
-
display: "flex",
|
|
118
|
-
flexDirection: "column",
|
|
119
|
-
justifyContent: "center",
|
|
120
|
-
alignItems: "center",
|
|
121
|
-
}}
|
|
122
|
-
>
|
|
123
|
-
<DeleteConfirmButton confirm onClick={() => handleOnDelete(row)}>
|
|
124
|
-
{locales["remove"] || "Remove"}
|
|
125
|
-
</DeleteConfirmButton>
|
|
126
|
-
<DeleteConfirmButton flat onClick={() => setConfirm(false)}>
|
|
127
|
-
{locales["cancel"] || "Cancel"}
|
|
128
|
-
</DeleteConfirmButton>
|
|
129
|
-
</div>
|
|
130
|
-
);
|
|
131
|
-
};
|
|
132
|
-
if (confirm) {
|
|
133
|
-
return <ConfirmButtons />;
|
|
134
|
-
}
|
|
135
|
-
if (editButtonProps) {
|
|
136
|
-
return (
|
|
137
|
-
<Fragment>
|
|
138
|
-
<EditButton
|
|
139
|
-
row={row}
|
|
140
|
-
customOnEdit={customOnEdit}
|
|
141
|
-
{...editButtonProps}
|
|
142
|
-
/>
|
|
143
|
-
<ActionIcon
|
|
144
|
-
title={locales["delete"] || "Delete"}
|
|
145
|
-
aria-label={locales["delete"] || "Delete"}
|
|
146
|
-
onClick={() => setConfirm(true)}
|
|
147
|
-
icon={DeleteIcon}
|
|
148
|
-
disabled={disabled}
|
|
149
|
-
unPadded
|
|
150
|
-
style={{ opacity: !disabled ? "1" : "0.2" }}
|
|
151
|
-
/>
|
|
152
|
-
</Fragment>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
return (
|
|
156
|
-
<ActionIcon
|
|
157
|
-
title={locales["delete"] || "Delete"}
|
|
158
|
-
aria-label={locales["delete"] || "Delete"}
|
|
159
|
-
onClick={() => setConfirm(true)}
|
|
160
|
-
icon={DeleteIcon}
|
|
161
|
-
disabled={disabled}
|
|
162
|
-
style={{ opacity: !disabled ? "1" : "0.2" }}
|
|
163
|
-
/>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const DeleteConfirmBanner = ({ onDelete, onCancel, locales }) => {
|
|
168
|
-
const Banner = styled.div`
|
|
169
|
-
display: flex;
|
|
170
|
-
background: rgb(255, 227, 224);
|
|
171
|
-
justify-content: space-between;
|
|
172
|
-
align-items: center;
|
|
173
|
-
margin-top: 10px;
|
|
174
|
-
border: 1px solid rgb(235, 237, 244);
|
|
175
|
-
border-style: solid;
|
|
176
|
-
border-color: rgb(235, 237, 244);
|
|
177
|
-
border-radius: 5px;
|
|
178
|
-
padding: 20px;
|
|
179
|
-
@media (max-width:480px) {
|
|
180
|
-
flex-direction: column;
|
|
181
|
-
span {
|
|
182
|
-
margin-bottom: 16px;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
`;
|
|
186
|
-
|
|
187
|
-
const ButtonContainer = styled.div`
|
|
188
|
-
display: flex;
|
|
189
|
-
button:first-child {
|
|
190
|
-
margin-right: 10px;
|
|
191
|
-
}
|
|
192
|
-
@media (max-width:480px) {
|
|
193
|
-
width: 100%;
|
|
194
|
-
justify-content: center;
|
|
195
|
-
button {
|
|
196
|
-
padding: 6px 32px;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
`;
|
|
200
|
-
return (
|
|
201
|
-
<Banner>
|
|
202
|
-
<Typography component="span">
|
|
203
|
-
{locales["delete-select-are-you-sure"] ||
|
|
204
|
-
"Are you sure you wish to delete all selected items?"}
|
|
205
|
-
</Typography>
|
|
206
|
-
<ButtonContainer>
|
|
207
|
-
<Button outlined color={"#333"} onClick={onCancel}>
|
|
208
|
-
{locales["cancel"] || "Cancel"}
|
|
209
|
-
</Button>
|
|
210
|
-
<Button danger onClick={onDelete}>
|
|
211
|
-
{locales["confirm"] || "Confirm"}
|
|
212
|
-
</Button>
|
|
213
|
-
</ButtonContainer>
|
|
214
|
-
</Banner>
|
|
215
|
-
);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
const SortButton = ({ onSort, action, row, rowSpacing }) => {
|
|
219
|
-
return (
|
|
220
|
-
<GreyButton
|
|
221
|
-
action={action}
|
|
222
|
-
title={action}
|
|
223
|
-
aria-label={action}
|
|
224
|
-
rowSpacing={rowSpacing}
|
|
225
|
-
onClick={() => onSort(action, row)}
|
|
226
|
-
>
|
|
227
|
-
<ArrowIcon title={action} />
|
|
228
|
-
</GreyButton>
|
|
229
|
-
);
|
|
230
|
-
};
|
|
231
|
-
export {
|
|
232
|
-
BlankRows,
|
|
233
|
-
ClearSearchButton,
|
|
234
|
-
ActionButtons,
|
|
235
|
-
DeleteConfirmBanner,
|
|
236
|
-
ButtonsRowContainer,
|
|
237
|
-
EditButton,
|
|
238
|
-
SortButton,
|
|
239
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { matchSorter } from "match-sorter";
|
|
3
|
-
import { Input } from '../Input';
|
|
4
|
-
|
|
5
|
-
const DefaultColumnFilter = ({ column: { filterValue, setFilter } }) => {
|
|
6
|
-
return (
|
|
7
|
-
<Input
|
|
8
|
-
value={filterValue || ""}
|
|
9
|
-
onChange={(e) => {
|
|
10
|
-
setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely
|
|
11
|
-
}}
|
|
12
|
-
showClear
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const fuzzyTextFilterFn = (rows, id, filterValue) => {
|
|
18
|
-
return matchSorter(rows, filterValue, { keys: [(row) => row.values[id]] });
|
|
19
|
-
};
|
|
20
|
-
// Let the table remove the filter if the string is empty
|
|
21
|
-
fuzzyTextFilterFn.autoRemove = (val) => !val;
|
|
22
|
-
|
|
23
|
-
export { DefaultColumnFilter, fuzzyTextFilterFn };
|