@redsift/design-system-legacy 8.0.1 → 8.0.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 +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,342 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
3
|
-
import { FixedSizeList as OptionsContainerWindowed } from "react-window";
|
|
4
|
-
|
|
5
|
-
import { Typography, fontSizes } from '../Typography';
|
|
6
|
-
|
|
7
|
-
/*--------------------------*/
|
|
8
|
-
// Styled components
|
|
9
|
-
/*--------------------------*/
|
|
10
|
-
|
|
11
|
-
const colors = {
|
|
12
|
-
lightViolet: "#ebedf4",
|
|
13
|
-
lightGrey: "#f9f8f8",
|
|
14
|
-
lightMidGrey: "#d8d8d8",
|
|
15
|
-
midGrey: "#d5d5d5",
|
|
16
|
-
darkMidGrey: "#bfbfbf",
|
|
17
|
-
darkGrey: "#76767a",
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const Row = styled.div`
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: row;
|
|
23
|
-
align-items: center;
|
|
24
|
-
`;
|
|
25
|
-
const IconAndTextContainer = styled(Row)`
|
|
26
|
-
padding: 0 1.15rem 0 0;
|
|
27
|
-
::selection,
|
|
28
|
-
*::selection {
|
|
29
|
-
background-color: transparent;
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
const IconAndSelectedValueRenderContainer = styled(Row)`
|
|
33
|
-
flex: 1;
|
|
34
|
-
`;
|
|
35
|
-
const SelectOuterContainer = styled.div`
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
position: relative;
|
|
39
|
-
flex: 1;
|
|
40
|
-
margin: 0 0.5rem;
|
|
41
|
-
&:first-child {
|
|
42
|
-
margin-left: 0;
|
|
43
|
-
}
|
|
44
|
-
&:last-child {
|
|
45
|
-
margin-right: 0;
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
|
|
49
|
-
const SelectLegendText = styled(Typography)`
|
|
50
|
-
margin: 0;
|
|
51
|
-
width: auto;
|
|
52
|
-
font-size: 0.8125rem;
|
|
53
|
-
color: ${(props) => props.color};
|
|
54
|
-
transition: color 0.1s;
|
|
55
|
-
font-weight: 600;
|
|
56
|
-
margin: 0 0.25rem;
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
const handleSelectContainer = ({ variant, color }) => {
|
|
60
|
-
switch (variant) {
|
|
61
|
-
case "minimal":
|
|
62
|
-
return `
|
|
63
|
-
padding: 0 .5rem;
|
|
64
|
-
border: 1px solid transparent;
|
|
65
|
-
transition: border-color 125ms;
|
|
66
|
-
&:hover {
|
|
67
|
-
border: 1px solid ${color};
|
|
68
|
-
}
|
|
69
|
-
${IconAndTextContainer} {
|
|
70
|
-
padding: 0;
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
case "basic":
|
|
74
|
-
return `
|
|
75
|
-
padding: 0.22rem;
|
|
76
|
-
transition: border-color 250ms;
|
|
77
|
-
border-radius: 0;
|
|
78
|
-
border-top: 0;
|
|
79
|
-
border-left: 0;
|
|
80
|
-
border-right: 0;
|
|
81
|
-
border-bottom: 2px solid ${color};
|
|
82
|
-
legend {
|
|
83
|
-
height: 0.6rem;
|
|
84
|
-
}
|
|
85
|
-
${SelectLegendText} {
|
|
86
|
-
font-size: 0.75rem;
|
|
87
|
-
font-weight: 300;
|
|
88
|
-
margin-left: 0;
|
|
89
|
-
color: ${color};
|
|
90
|
-
}
|
|
91
|
-
${SelectedValueText} {
|
|
92
|
-
margin-left: 0.2rem;
|
|
93
|
-
}
|
|
94
|
-
`;
|
|
95
|
-
case "outlined":
|
|
96
|
-
return `
|
|
97
|
-
padding: 0.5rem;
|
|
98
|
-
transition: border-color 250ms;
|
|
99
|
-
border: 2px solid ${color};
|
|
100
|
-
`;
|
|
101
|
-
default:
|
|
102
|
-
return "";
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const SelectContainer = styled.fieldset`
|
|
106
|
-
border-radius: 5px;
|
|
107
|
-
${(props) => handleSelectContainer(props)}
|
|
108
|
-
cursor: ${(props) => (props.disabled ? "default" : "pointer")};
|
|
109
|
-
box-sizing: border-box;
|
|
110
|
-
g {
|
|
111
|
-
transition: transform 0.25s ease;
|
|
112
|
-
}
|
|
113
|
-
path {
|
|
114
|
-
transition: fill 0.25s;
|
|
115
|
-
}
|
|
116
|
-
${(props) => props.disabled && `background-color: ${colors.lightGrey}`};
|
|
117
|
-
`;
|
|
118
|
-
|
|
119
|
-
const SelectValueContainer = styled.div`
|
|
120
|
-
align-items: center;
|
|
121
|
-
display: flex;
|
|
122
|
-
flex-direction: row;
|
|
123
|
-
flex: 1;
|
|
124
|
-
height: 1.75rem;
|
|
125
|
-
padding: 0 0.5rem 0 0;
|
|
126
|
-
pointer-events: none;
|
|
127
|
-
`;
|
|
128
|
-
const SelectedValueText = styled(Typography)`
|
|
129
|
-
text-align: left;
|
|
130
|
-
flex: 1;
|
|
131
|
-
font-weight: 500;
|
|
132
|
-
margin-left: ${(props) => (props.withIcon ? "0.65rem" : "1rem")};
|
|
133
|
-
${(props) => props.disabled && `color: ${colors.darkMidGrey}`};
|
|
134
|
-
`;
|
|
135
|
-
const OptionsContainer = styled.ul`
|
|
136
|
-
display: ${(props) => (props["aria-expanded"] === "true" ? "block" : "none")};
|
|
137
|
-
background-color: white;
|
|
138
|
-
border-radius: 5px;
|
|
139
|
-
border: 1px solid ${colors.lightMidGrey};
|
|
140
|
-
box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.15);
|
|
141
|
-
list-style: none;
|
|
142
|
-
margin-top: 0.83rem;
|
|
143
|
-
overflow: hidden;
|
|
144
|
-
padding: 0;
|
|
145
|
-
position: absolute;
|
|
146
|
-
top: 100%;
|
|
147
|
-
width: 100%;
|
|
148
|
-
z-index: 1;
|
|
149
|
-
`;
|
|
150
|
-
|
|
151
|
-
const OptionBase = css`
|
|
152
|
-
background-color: ${(p) =>
|
|
153
|
-
p.selected && !p.disabled ? colors.lightViolet : "transparent"};
|
|
154
|
-
border: none;
|
|
155
|
-
font-family: Raleway, sans-serif;
|
|
156
|
-
font-size: 0.8125rem;
|
|
157
|
-
font-weight: 500;
|
|
158
|
-
color: ${(props) => (props.disabled ? "#aaa" : "#222")};
|
|
159
|
-
cursor: ${(props) => (props.disabled ? "default" : "pointer")};
|
|
160
|
-
:hover,
|
|
161
|
-
:focus {
|
|
162
|
-
outline: none;
|
|
163
|
-
&:not([disabled]) {
|
|
164
|
-
background-color: ${colors.lightGrey};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
::selection {
|
|
168
|
-
background-color: transparent;
|
|
169
|
-
}
|
|
170
|
-
`;
|
|
171
|
-
|
|
172
|
-
const Option = styled.li`
|
|
173
|
-
${OptionBase};
|
|
174
|
-
display: ${(p) => (p.display === "true" ? "auto" : "none")};
|
|
175
|
-
line-height: 1.3rem;
|
|
176
|
-
padding: 10px 23px;
|
|
177
|
-
`;
|
|
178
|
-
|
|
179
|
-
const OptionWindowed = styled.li`
|
|
180
|
-
${OptionBase};
|
|
181
|
-
display: flex;
|
|
182
|
-
align-items: center;
|
|
183
|
-
padding: 0 23px;
|
|
184
|
-
`;
|
|
185
|
-
|
|
186
|
-
const SelectSearchTextInput = styled.input`
|
|
187
|
-
flex: 1;
|
|
188
|
-
font-weight: 500;
|
|
189
|
-
margin-left: ${(props) => (props.withIcon ? "0.65rem" : "1rem")};
|
|
190
|
-
height: 100%;
|
|
191
|
-
font-family: Raleway;
|
|
192
|
-
font-size: ${fontSizes.body};
|
|
193
|
-
border: 0;
|
|
194
|
-
&:focus {
|
|
195
|
-
outline: none;
|
|
196
|
-
}
|
|
197
|
-
`;
|
|
198
|
-
|
|
199
|
-
/*--------------------------*/
|
|
200
|
-
// Auxiliar components
|
|
201
|
-
/*--------------------------*/
|
|
202
|
-
|
|
203
|
-
const optValue = (label, value) => {
|
|
204
|
-
if (label && typeof label === "string") {
|
|
205
|
-
return label;
|
|
206
|
-
} else if (label) {
|
|
207
|
-
return label(value);
|
|
208
|
-
}
|
|
209
|
-
return value;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
const OptionComponent = (props) => {
|
|
213
|
-
const { value, windowed, label, optionRef } = props;
|
|
214
|
-
const OptionComp = windowed ? OptionWindowed : Option;
|
|
215
|
-
return (
|
|
216
|
-
<OptionComp
|
|
217
|
-
{...props}
|
|
218
|
-
ref={optionRef}
|
|
219
|
-
aria-labelledby={`dropdown_${value} dropdown_${value}_option`}
|
|
220
|
-
tabIndex="0"
|
|
221
|
-
role="button"
|
|
222
|
-
>
|
|
223
|
-
{optValue(label, value)}
|
|
224
|
-
</OptionComp>
|
|
225
|
-
);
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const OptionsContainerWindowedComponent = ({
|
|
229
|
-
selectWindowedRef,
|
|
230
|
-
selectWindowedHeight,
|
|
231
|
-
visibleItems,
|
|
232
|
-
displayOptions,
|
|
233
|
-
disabled,
|
|
234
|
-
itemSize,
|
|
235
|
-
selectedIndex,
|
|
236
|
-
selectOptionIndex,
|
|
237
|
-
optionRefs,
|
|
238
|
-
options,
|
|
239
|
-
}) => {
|
|
240
|
-
const InnerElementType = React.useMemo(
|
|
241
|
-
() => React.forwardRef((props, ref) => <div {...props} ref={ref} />),
|
|
242
|
-
[]
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
const OuterElementType = React.useMemo(
|
|
246
|
-
() =>
|
|
247
|
-
React.forwardRef((props, ref) => {
|
|
248
|
-
return (
|
|
249
|
-
<OptionsContainer
|
|
250
|
-
aria-expanded={displayOptions ? "true" : "false"}
|
|
251
|
-
{...props}
|
|
252
|
-
ref={ref}
|
|
253
|
-
style={{ ...props.style, position: "absolute" }}
|
|
254
|
-
/>
|
|
255
|
-
);
|
|
256
|
-
}),
|
|
257
|
-
[displayOptions]
|
|
258
|
-
);
|
|
259
|
-
|
|
260
|
-
useEffect(() => {
|
|
261
|
-
if (!displayOptions) {
|
|
262
|
-
selectWindowedRef.current && selectWindowedRef.current.scrollToItem(0);
|
|
263
|
-
}
|
|
264
|
-
}, [displayOptions]);
|
|
265
|
-
|
|
266
|
-
return (
|
|
267
|
-
<OptionsContainerWindowed
|
|
268
|
-
ref={selectWindowedRef}
|
|
269
|
-
height={selectWindowedHeight}
|
|
270
|
-
itemCount={visibleItems.length}
|
|
271
|
-
itemSize={itemSize}
|
|
272
|
-
itemData={visibleItems}
|
|
273
|
-
outerElementType={OuterElementType}
|
|
274
|
-
innerElementType={InnerElementType}
|
|
275
|
-
>
|
|
276
|
-
{({ data, index, style }) => {
|
|
277
|
-
const { value, label, disabled: optDisabled } = data[index];
|
|
278
|
-
return (
|
|
279
|
-
<OptionComponent
|
|
280
|
-
style={style}
|
|
281
|
-
value={value}
|
|
282
|
-
label={label}
|
|
283
|
-
disabled={disabled || optDisabled}
|
|
284
|
-
selected={selectedIndex === index}
|
|
285
|
-
onClick={() => {
|
|
286
|
-
const index = options.findIndex((opt) => opt.value === value);
|
|
287
|
-
return selectOptionIndex(index);
|
|
288
|
-
}}
|
|
289
|
-
optionRef={optionRefs.current[index]}
|
|
290
|
-
windowed
|
|
291
|
-
/>
|
|
292
|
-
);
|
|
293
|
-
}}
|
|
294
|
-
</OptionsContainerWindowed>
|
|
295
|
-
);
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
const OptionsContainerComponent = ({
|
|
299
|
-
displayOptions,
|
|
300
|
-
disabled,
|
|
301
|
-
selectedIndex,
|
|
302
|
-
selectOptionIndex,
|
|
303
|
-
optionRefs,
|
|
304
|
-
options,
|
|
305
|
-
isOptionVisibleForIndex,
|
|
306
|
-
}) => {
|
|
307
|
-
return (
|
|
308
|
-
<OptionsContainer aria-expanded={displayOptions ? "true" : "false"}>
|
|
309
|
-
{options.map((props, index) => {
|
|
310
|
-
const { value, disabled: optDisabled } = props;
|
|
311
|
-
return (
|
|
312
|
-
<OptionComponent
|
|
313
|
-
{...props}
|
|
314
|
-
disabled={disabled || optDisabled}
|
|
315
|
-
selected={selectedIndex === index}
|
|
316
|
-
key={value}
|
|
317
|
-
onClick={() => selectOptionIndex(index)}
|
|
318
|
-
optionRef={optionRefs.current[index]}
|
|
319
|
-
display={isOptionVisibleForIndex[index] ? "true" : "false"}
|
|
320
|
-
/>
|
|
321
|
-
);
|
|
322
|
-
})}
|
|
323
|
-
</OptionsContainer>
|
|
324
|
-
);
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
export {
|
|
328
|
-
colors,
|
|
329
|
-
IconAndTextContainer,
|
|
330
|
-
IconAndSelectedValueRenderContainer,
|
|
331
|
-
SelectOuterContainer,
|
|
332
|
-
SelectContainer,
|
|
333
|
-
SelectLegendText,
|
|
334
|
-
SelectValueContainer,
|
|
335
|
-
SelectedValueText,
|
|
336
|
-
OptionsContainer,
|
|
337
|
-
OptionsContainerWindowedComponent,
|
|
338
|
-
OptionsContainerComponent,
|
|
339
|
-
Option,
|
|
340
|
-
OptionWindowed,
|
|
341
|
-
SelectSearchTextInput,
|
|
342
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Select';
|