@monolith-forensics/monolith-ui 1.0.12 → 1.1.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/Button/Button.tsx +382 -0
- package/Button/index.ts +2 -0
- package/{src/components/Calendar/Calendar.js → Calendar/Calendar.tsx} +104 -93
- package/{src/components/Calendar/CalendarStyles.js → Calendar/CalendarStyles.tsx} +26 -36
- package/{src/components/Calendar/calendarHelpers.js → Calendar/calendarHelpers.ts} +10 -8
- package/Calendar/index.ts +1 -0
- package/CheckBox/CheckBox.tsx +61 -0
- package/CheckBox/index.ts +1 -0
- package/{src/components/DateInput/DateInput.js → DateInput/DateInput.tsx} +227 -93
- package/DateInput/index.ts +1 -0
- package/DropDownMenu/DropDownMenu.tsx +402 -0
- package/DropDownMenu/index.ts +1 -0
- package/Error/Error.tsx +51 -0
- package/Error/index.ts +1 -0
- package/{src/components/FieldLabel → FieldLabel}/FieldLabel.tsx +25 -22
- package/{src/components/FileInputField/FileInputField.js → FileInputField/FileInputField.tsx} +23 -15
- package/FileInputField/index.ts +1 -0
- package/Flyout/Flyout.tsx +172 -0
- package/Flyout/FlyoutHeader.tsx +14 -0
- package/Flyout/FlyoutTitle.tsx +10 -0
- package/Flyout/index.ts +3 -0
- package/FormSection/FormSection.tsx +71 -0
- package/FormSection/index.ts +1 -0
- package/Grid/Grid.tsx +18 -0
- package/Grid/index.ts +1 -0
- package/IconButton/IconButton.tsx +27 -0
- package/IconButton/index.ts +1 -0
- package/{src/components/Input → Input}/Input.tsx +57 -34
- package/Modal/Modal.tsx +172 -0
- package/Modal/index.ts +1 -0
- package/{src/components/Pill → Pill}/Pill.tsx +41 -11
- package/SelectBox/SelectBox.tsx +745 -0
- package/SelectBox/index.ts +1 -0
- package/Switch/Switch.tsx +204 -0
- package/Switch/index.ts +1 -0
- package/TagBox/TagBox.tsx +694 -0
- package/TagBox/TagBoxStyles.tsx +116 -0
- package/TagBox/index.ts +1 -0
- package/{src/components/TextArea → TextArea}/TextArea.tsx +35 -13
- package/{src/components/TextAreaInput → TextAreaInput}/TextAreaInput.tsx +11 -13
- package/{src/components/TextInput → TextInput}/TextInput.tsx +11 -13
- package/Tooltip/Tooltip.tsx +68 -0
- package/Tooltip/index.ts +1 -0
- package/{src/components/ArrowButton → core}/ArrowButton.tsx +17 -20
- package/core/ClearButton.tsx +51 -0
- package/core/StyledContent.tsx +50 -0
- package/core/StyledFloatContainer.tsx +7 -0
- package/core/Types/Size.ts +3 -0
- package/core/Types/Variant.ts +10 -0
- package/core/index.ts +6 -0
- package/dist/Button/Button.d.ts +19 -0
- package/dist/Button/Button.js +332 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +8 -0
- package/dist/Calendar/Calendar.d.ts +15 -0
- package/dist/Calendar/Calendar.js +232 -0
- package/dist/Calendar/CalendarStyles.d.ts +36 -0
- package/dist/Calendar/CalendarStyles.js +170 -0
- package/dist/Calendar/calendarHelpers.d.ts +53 -0
- package/dist/Calendar/calendarHelpers.js +181 -0
- package/dist/Calendar/index.d.ts +1 -0
- package/dist/Calendar/index.js +8 -0
- package/dist/CheckBox/CheckBox.d.ts +11 -0
- package/dist/CheckBox/CheckBox.js +34 -0
- package/dist/CheckBox/index.d.ts +1 -0
- package/dist/CheckBox/index.js +8 -0
- package/dist/DateInput/DateInput.d.ts +24 -0
- package/dist/DateInput/DateInput.js +511 -0
- package/dist/DateInput/index.d.ts +1 -0
- package/dist/DateInput/index.js +8 -0
- package/dist/DropDownMenu/DropDownMenu.d.ts +36 -0
- package/dist/DropDownMenu/DropDownMenu.js +212 -0
- package/dist/DropDownMenu/index.d.ts +1 -0
- package/dist/DropDownMenu/index.js +8 -0
- package/dist/Error/Error.d.ts +4 -0
- package/dist/Error/Error.js +38 -0
- package/dist/Error/index.d.ts +1 -0
- package/dist/Error/index.js +8 -0
- package/dist/FieldLabel/FieldLabel.d.ts +19 -0
- package/dist/FieldLabel/FieldLabel.js +119 -0
- package/dist/FieldLabel/index.d.ts +1 -0
- package/dist/FieldLabel/index.js +8 -0
- package/dist/FileInputField/FileInputField.d.ts +18 -0
- package/dist/FileInputField/FileInputField.js +116 -0
- package/dist/FileInputField/index.d.ts +1 -0
- package/dist/FileInputField/index.js +8 -0
- package/dist/Flyout/Flyout.d.ts +10 -0
- package/dist/Flyout/Flyout.js +111 -0
- package/dist/Flyout/FlyoutHeader.d.ts +5 -0
- package/dist/Flyout/FlyoutHeader.js +12 -0
- package/dist/Flyout/FlyoutTitle.d.ts +2 -0
- package/dist/Flyout/FlyoutTitle.js +13 -0
- package/dist/Flyout/index.d.ts +3 -0
- package/dist/Flyout/index.js +12 -0
- package/dist/FormSection/FormSection.d.ts +9 -0
- package/dist/FormSection/FormSection.js +51 -0
- package/dist/FormSection/index.d.ts +1 -0
- package/dist/FormSection/index.js +8 -0
- package/dist/Grid/Grid.d.ts +6 -0
- package/dist/Grid/Grid.js +15 -0
- package/dist/Grid/index.d.ts +1 -0
- package/dist/Grid/index.js +8 -0
- package/dist/IconButton/IconButton.d.ts +5 -0
- package/dist/IconButton/IconButton.js +30 -0
- package/dist/IconButton/index.d.ts +1 -0
- package/dist/IconButton/index.js +8 -0
- package/dist/Input/Input.d.ts +21 -0
- package/dist/Input/Input.js +148 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Input/index.js +8 -0
- package/dist/Modal/Modal.d.ts +14 -0
- package/dist/Modal/Modal.js +134 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Modal/index.js +8 -0
- package/dist/Pill/Pill.d.ts +11 -0
- package/dist/Pill/Pill.js +146 -0
- package/dist/Pill/index.d.ts +1 -0
- package/dist/Pill/index.js +8 -0
- package/dist/SelectBox/SelectBox.d.ts +45 -0
- package/dist/SelectBox/SelectBox.js +469 -0
- package/dist/SelectBox/index.d.ts +1 -0
- package/dist/SelectBox/index.js +8 -0
- package/dist/Switch/Switch.d.ts +18 -0
- package/dist/Switch/Switch.js +157 -0
- package/dist/Switch/index.d.ts +1 -0
- package/dist/Switch/index.js +8 -0
- package/dist/TagBox/TagBox.d.ts +38 -0
- package/dist/TagBox/TagBox.js +440 -0
- package/dist/TagBox/TagBoxStyles.d.ts +11 -0
- package/dist/TagBox/TagBoxStyles.js +113 -0
- package/dist/TagBox/index.d.ts +1 -0
- package/dist/TagBox/index.js +8 -0
- package/dist/TextArea/TextArea.d.ts +16 -0
- package/dist/TextArea/TextArea.js +80 -0
- package/dist/TextArea/index.d.ts +1 -0
- package/dist/TextArea/index.js +8 -0
- package/dist/TextAreaInput/TextAreaInput.d.ts +12 -0
- package/dist/TextAreaInput/TextAreaInput.js +23 -0
- package/dist/TextAreaInput/index.d.ts +1 -0
- package/dist/TextAreaInput/index.js +8 -0
- package/dist/TextInput/TextInput.d.ts +12 -0
- package/dist/TextInput/TextInput.js +30 -0
- package/dist/TextInput/index.d.ts +1 -0
- package/dist/TextInput/index.js +8 -0
- package/dist/Tooltip/Tooltip.d.ts +12 -0
- package/dist/Tooltip/Tooltip.js +53 -0
- package/dist/Tooltip/index.d.ts +1 -0
- package/dist/Tooltip/index.js +8 -0
- package/dist/core/ArrowButton.d.ts +6 -0
- package/dist/core/ArrowButton.js +48 -0
- package/dist/core/ClearButton.d.ts +6 -0
- package/dist/core/ClearButton.js +48 -0
- package/dist/core/StyledContent.d.ts +7 -0
- package/dist/core/StyledContent.js +46 -0
- package/dist/core/StyledFloatContainer.d.ts +2 -0
- package/dist/core/StyledFloatContainer.js +10 -0
- package/dist/core/Types/Size.d.ts +2 -0
- package/dist/core/Types/Size.js +2 -0
- package/dist/core/Types/Variant.d.ts +2 -0
- package/dist/core/Types/Variant.js +2 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +14 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +51 -0
- package/index.ts +22 -0
- package/package.json +12 -20
- package/{src/components/theme → theme}/components.js +0 -2
- package/{src/components/theme → theme}/index.js +0 -1
- package/{src/components/theme → theme}/variants.js +0 -1
- package/tsconfig.json +11 -11
- package/.gitattributes +0 -2
- package/rollup.config.js +0 -10
- package/src/components/ArrowButton/index.tsx +0 -1
- package/src/components/Button/Button.tsx +0 -278
- package/src/components/Button/index.ts +0 -1
- package/src/components/SelectBox/SelectBox.js +0 -543
- package/src/components/TagBox/TagBox.js +0 -563
- package/src/components/index.ts +0 -7
- package/src/index.ts +0 -1
- /package/{src/components/FieldLabel → FieldLabel}/index.ts +0 -0
- /package/{src/components/Input/index.tsx → Input/index.ts} +0 -0
- /package/{src/components/Pill → Pill}/index.ts +0 -0
- /package/{src/components/TextArea → TextArea}/index.ts +0 -0
- /package/{src/components/TextAreaInput → TextAreaInput}/index.ts +0 -0
- /package/{src/components/TextInput/index.tsx → TextInput/index.ts} +0 -0
- /package/{src/components/core/index.js → core/MonolithThemeProvider.js} +0 -0
- /package/{src/components/theme → theme}/breakpoints.js +0 -0
- /package/{src/components/theme → theme}/shadows.js +0 -0
- /package/{src/components/theme → theme}/typography.js +0 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { XIcon } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
export const TagBoxContainer = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
`;
|
|
7
|
+
|
|
8
|
+
export const TagBoxInner = styled.div`
|
|
9
|
+
height: 33px;
|
|
10
|
+
display: flex;
|
|
11
|
+
border: 1px solid ${(props) => props.theme.palette.input.border};
|
|
12
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
13
|
+
outline: none;
|
|
14
|
+
padding: 8px 8px;
|
|
15
|
+
width: 100%;
|
|
16
|
+
background-color: ${(props) => props.theme.palette.input.background};
|
|
17
|
+
border-radius: 5px;
|
|
18
|
+
transition: border 0.1s ease-in-out;
|
|
19
|
+
overflow-x: hidden;
|
|
20
|
+
&:focus {
|
|
21
|
+
border: 1px solid ${(props) => props.theme.palette.primary.main};
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const TagsContainer = styled.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
-webkit-box-align: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
flex-wrap: nowrap;
|
|
30
|
+
margin-left: calc(-5px);
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const TagBoxInput = styled.input`
|
|
35
|
+
border: none;
|
|
36
|
+
outline: none;
|
|
37
|
+
width: 100%;
|
|
38
|
+
min-width: 50px;
|
|
39
|
+
background-color: transparent;
|
|
40
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
41
|
+
&:focus {
|
|
42
|
+
border: none;
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export const Tag = styled.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
-webkit-box-align: center;
|
|
50
|
+
align-items: center;
|
|
51
|
+
background-color: rgb(26, 27, 30);
|
|
52
|
+
color: rgb(193, 194, 197);
|
|
53
|
+
height: 22px;
|
|
54
|
+
padding-left: 10px;
|
|
55
|
+
padding-right: 0px;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
cursor: default;
|
|
60
|
+
user-select: none;
|
|
61
|
+
max-width: 120px;
|
|
62
|
+
margin: calc(3px) calc(5px);
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
export const TagText = styled.div`
|
|
66
|
+
display: flex;
|
|
67
|
+
-webkit-box-align: center;
|
|
68
|
+
align-items: center;
|
|
69
|
+
background-color: rgb(26, 27, 30);
|
|
70
|
+
color: rgb(193, 194, 197);
|
|
71
|
+
height: 22px;
|
|
72
|
+
padding-right: 0px;
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
font-size: 12px;
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
cursor: default;
|
|
77
|
+
user-select: none;
|
|
78
|
+
max-width: 75px;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
export const TagKillButton = styled(XIcon)`
|
|
85
|
+
-webkit-tap-highlight-color: transparent;
|
|
86
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
|
|
87
|
+
Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
appearance: none;
|
|
90
|
+
text-align: left;
|
|
91
|
+
text-decoration: none;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
border: 1px solid transparent;
|
|
94
|
+
background-color: transparent;
|
|
95
|
+
position: relative;
|
|
96
|
+
height: 19px;
|
|
97
|
+
min-height: 19px;
|
|
98
|
+
width: 22px;
|
|
99
|
+
min-width: 19px;
|
|
100
|
+
border-radius: 2px;
|
|
101
|
+
line-height: 1;
|
|
102
|
+
display: flex;
|
|
103
|
+
-webkit-box-align: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
-webkit-box-pack: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
color: rgb(193, 194, 197);
|
|
108
|
+
padding: 0px 3px;
|
|
109
|
+
&:hover {
|
|
110
|
+
color: rgb(255, 255, 255);
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
export const TagBoxOptions = styled.div``;
|
|
115
|
+
|
|
116
|
+
export const TagBoxOption = styled.div``;
|
package/TagBox/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./TagBox";
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import styled from "styled-components";
|
|
3
2
|
import TextareaAutosize from "react-textarea-autosize";
|
|
3
|
+
import { Size, Variant } from "../core";
|
|
4
4
|
|
|
5
|
-
interface
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
interface TextAreaProps {
|
|
6
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
7
|
+
className?: string;
|
|
8
|
+
size?: Size;
|
|
9
|
+
variant?: Variant;
|
|
10
|
+
width?: string | number | null | undefined;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
14
|
+
onKeyUp?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
8
15
|
}
|
|
9
16
|
|
|
10
|
-
const
|
|
17
|
+
const TextArea = styled(TextareaAutosize)<TextAreaProps>`
|
|
11
18
|
outline: none;
|
|
12
19
|
resize: none;
|
|
13
|
-
padding:
|
|
20
|
+
padding: 10px;
|
|
14
21
|
width: 100%;
|
|
15
22
|
height: 100%;
|
|
16
23
|
|
|
@@ -18,16 +25,16 @@ const StyledTextArea = styled(TextareaAutosize)<StyledTextAreaProps>`
|
|
|
18
25
|
color: ${(props) => props.theme.palette.text.primary};
|
|
19
26
|
font-size: ${({ size }) =>
|
|
20
27
|
size === "xs"
|
|
21
|
-
? "
|
|
28
|
+
? "11px"
|
|
22
29
|
: size === "sm"
|
|
23
|
-
? "
|
|
30
|
+
? "13px"
|
|
24
31
|
: size === "md"
|
|
25
|
-
? "
|
|
32
|
+
? "15px"
|
|
26
33
|
: size === "lg"
|
|
27
|
-
? "
|
|
34
|
+
? "17px"
|
|
28
35
|
: size === "xl"
|
|
29
|
-
? "
|
|
30
|
-
: "
|
|
36
|
+
? "19px"
|
|
37
|
+
: "11px"};
|
|
31
38
|
|
|
32
39
|
background-color: ${({ theme, variant }) => {
|
|
33
40
|
switch (variant) {
|
|
@@ -65,6 +72,21 @@ const StyledTextArea = styled(TextareaAutosize)<StyledTextAreaProps>`
|
|
|
65
72
|
&:focus {
|
|
66
73
|
border: 1px solid ${(props) => props.theme.palette.primary.main};
|
|
67
74
|
}
|
|
75
|
+
|
|
76
|
+
::placeholder {
|
|
77
|
+
font-size: ${({ size }) =>
|
|
78
|
+
size === "xs"
|
|
79
|
+
? "10px"
|
|
80
|
+
: size === "sm"
|
|
81
|
+
? "12px"
|
|
82
|
+
: size === "md"
|
|
83
|
+
? "14px"
|
|
84
|
+
: size === "lg"
|
|
85
|
+
? "16px"
|
|
86
|
+
: size === "xl"
|
|
87
|
+
? "18px"
|
|
88
|
+
: "10px"};
|
|
89
|
+
}
|
|
68
90
|
`;
|
|
69
91
|
|
|
70
|
-
export default
|
|
92
|
+
export default TextArea;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import FieldLabel from "
|
|
3
|
-
import StyledTextArea from "../TextArea";
|
|
1
|
+
import { Size } from "../core";
|
|
2
|
+
import { TextArea, FieldLabel } from "..";
|
|
4
3
|
|
|
5
4
|
interface TextAreaInputProps {
|
|
6
5
|
label?: string;
|
|
7
|
-
error?:
|
|
8
|
-
errorMessage?: string;
|
|
6
|
+
error?: string;
|
|
9
7
|
required?: boolean;
|
|
10
8
|
colSpan?: number;
|
|
11
|
-
size?:
|
|
12
|
-
description?: string
|
|
9
|
+
size?: Size;
|
|
10
|
+
description?: string;
|
|
11
|
+
inputRef?: React.RefObject<HTMLTextAreaElement> | null;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
const TextAreaInput
|
|
14
|
+
const TextAreaInput = ({
|
|
16
15
|
label,
|
|
17
16
|
error,
|
|
18
|
-
errorMessage,
|
|
19
17
|
required,
|
|
20
18
|
colSpan = 1,
|
|
21
|
-
size,
|
|
19
|
+
size = "sm",
|
|
22
20
|
description,
|
|
21
|
+
inputRef = null,
|
|
23
22
|
...other
|
|
24
|
-
}) => {
|
|
23
|
+
}: TextAreaInputProps) => {
|
|
25
24
|
return (
|
|
26
25
|
<div
|
|
27
26
|
style={{
|
|
@@ -32,7 +31,6 @@ const TextAreaInput: React.FC<TextAreaInputProps> = ({
|
|
|
32
31
|
{label && (
|
|
33
32
|
<FieldLabel
|
|
34
33
|
error={error}
|
|
35
|
-
errorMessage={errorMessage}
|
|
36
34
|
asterisk={required}
|
|
37
35
|
size={size}
|
|
38
36
|
description={description}
|
|
@@ -40,7 +38,7 @@ const TextAreaInput: React.FC<TextAreaInputProps> = ({
|
|
|
40
38
|
{label}
|
|
41
39
|
</FieldLabel>
|
|
42
40
|
)}
|
|
43
|
-
<
|
|
41
|
+
<TextArea ref={inputRef} size={size} {...other} />
|
|
44
42
|
</div>
|
|
45
43
|
);
|
|
46
44
|
};
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { FieldLabel } from "..";
|
|
2
|
+
import Input, { InputProps } from "../Input/Input";
|
|
3
|
+
import { Size } from "../core";
|
|
4
4
|
|
|
5
|
-
interface TextInputProps {
|
|
5
|
+
interface TextInputProps extends InputProps {
|
|
6
6
|
label?: string;
|
|
7
|
-
error?:
|
|
8
|
-
errorMessage?: string;
|
|
7
|
+
error?: string;
|
|
9
8
|
required?: boolean;
|
|
9
|
+
size?: Size;
|
|
10
10
|
colSpan?: number;
|
|
11
|
-
|
|
12
|
-
description?: string | null;
|
|
11
|
+
description?: string;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
const TextInput: React.FC<TextInputProps> = ({
|
|
16
15
|
label,
|
|
17
16
|
error,
|
|
18
|
-
errorMessage,
|
|
19
17
|
required,
|
|
20
18
|
colSpan = 1,
|
|
21
|
-
size,
|
|
22
19
|
description,
|
|
23
|
-
|
|
20
|
+
size,
|
|
21
|
+
...rest
|
|
24
22
|
}) => {
|
|
25
23
|
return (
|
|
26
24
|
<div
|
|
@@ -29,12 +27,12 @@ const TextInput: React.FC<TextInputProps> = ({
|
|
|
29
27
|
display: "flex",
|
|
30
28
|
flexDirection: "column",
|
|
31
29
|
justifyContent: "space-between",
|
|
30
|
+
width: "100%",
|
|
32
31
|
}}
|
|
33
32
|
>
|
|
34
33
|
{label && (
|
|
35
34
|
<FieldLabel
|
|
36
35
|
error={error}
|
|
37
|
-
errorMessage={errorMessage}
|
|
38
36
|
asterisk={required}
|
|
39
37
|
size={size}
|
|
40
38
|
description={description}
|
|
@@ -42,7 +40,7 @@ const TextInput: React.FC<TextInputProps> = ({
|
|
|
42
40
|
{label}
|
|
43
41
|
</FieldLabel>
|
|
44
42
|
)}
|
|
45
|
-
<
|
|
43
|
+
<Input size={size} {...rest} />
|
|
46
44
|
</div>
|
|
47
45
|
);
|
|
48
46
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
interface TooltipProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
content?: ReactNode;
|
|
9
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
10
|
+
sideOffset?: number;
|
|
11
|
+
align?: "start" | "center" | "end";
|
|
12
|
+
delayDuration?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const Tooltip = styled(
|
|
16
|
+
({
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
content,
|
|
20
|
+
side = "right",
|
|
21
|
+
sideOffset = 15,
|
|
22
|
+
align = "start",
|
|
23
|
+
delayDuration = 800,
|
|
24
|
+
}: TooltipProps) => {
|
|
25
|
+
if (!content) return children;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<RadixTooltip.Provider
|
|
29
|
+
delayDuration={delayDuration || 800}
|
|
30
|
+
skipDelayDuration={0}
|
|
31
|
+
disableHoverableContent
|
|
32
|
+
>
|
|
33
|
+
<RadixTooltip.Root>
|
|
34
|
+
<RadixTooltip.Trigger asChild>{children}</RadixTooltip.Trigger>
|
|
35
|
+
<RadixTooltip.Portal>
|
|
36
|
+
<RadixTooltip.Content
|
|
37
|
+
className={className}
|
|
38
|
+
side={side || "right"}
|
|
39
|
+
sideOffset={sideOffset || 15}
|
|
40
|
+
align={align || "start"}
|
|
41
|
+
onClick={(e) => e.stopPropagation()}
|
|
42
|
+
>
|
|
43
|
+
{content}
|
|
44
|
+
</RadixTooltip.Content>
|
|
45
|
+
</RadixTooltip.Portal>
|
|
46
|
+
</RadixTooltip.Root>
|
|
47
|
+
</RadixTooltip.Provider>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
)`
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
z-index: 999999;
|
|
53
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
54
|
+
padding: 15px;
|
|
55
|
+
border-radius: 5px;
|
|
56
|
+
border: 1px solid ${({ theme }) => theme.palette.divider};
|
|
57
|
+
font-size: 0.75rem;
|
|
58
|
+
|
|
59
|
+
white-space: pre-wrap;
|
|
60
|
+
|
|
61
|
+
.title {
|
|
62
|
+
font-size: 0.85rem;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
margin-bottom: 5px;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export default Tooltip;
|
package/Tooltip/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Tooltip";
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { ChevronDownIcon } from "lucide-react";
|
|
3
2
|
import styled from "styled-components";
|
|
4
3
|
|
|
5
4
|
interface ArrowIconProps {
|
|
6
5
|
className?: string;
|
|
6
|
+
[key: string]: React.SVGAttributes<SVGSVGElement> | any;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const ArrowIcon:
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
)
|
|
15
|
-
)`
|
|
9
|
+
const ArrowIcon = styled(({ className, ...props }: ArrowIconProps) => (
|
|
10
|
+
<div className={className} {...props}>
|
|
11
|
+
<ChevronDownIcon size={16} />
|
|
12
|
+
</div>
|
|
13
|
+
))`
|
|
16
14
|
color: ${(props) => props.theme.palette.text.secondary};
|
|
17
15
|
transition: transform 0.2s ease-in-out;
|
|
18
16
|
transform: rotate(0deg);
|
|
@@ -26,20 +24,19 @@ const ArrowIcon: React.FC<ArrowIconProps> = styled(
|
|
|
26
24
|
|
|
27
25
|
interface ArrowButtonProps {
|
|
28
26
|
className?: string;
|
|
27
|
+
[key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
const ArrowButton:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
)`
|
|
30
|
+
const ArrowButton = styled(({ className, ...props }: ArrowButtonProps) => (
|
|
31
|
+
<button
|
|
32
|
+
className={className}
|
|
33
|
+
{...props}
|
|
34
|
+
tabIndex={-1}
|
|
35
|
+
data-default-btn={true}
|
|
36
|
+
>
|
|
37
|
+
<ArrowIcon />
|
|
38
|
+
</button>
|
|
39
|
+
))`
|
|
43
40
|
position: absolute;
|
|
44
41
|
right: 0;
|
|
45
42
|
height: 100%;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { X } from "lucide-react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
|
|
4
|
+
interface ClearIconProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
[key: string]: React.SVGAttributes<SVGSVGElement> | any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ClearIcon = styled(({ className, ...props }: ClearIconProps) => (
|
|
10
|
+
<div className={className} {...props}>
|
|
11
|
+
<X size={16} />
|
|
12
|
+
</div>
|
|
13
|
+
))`
|
|
14
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
15
|
+
transition: transform 0.2s ease-in-out;
|
|
16
|
+
transform: rotate(0deg);
|
|
17
|
+
will-change: transform;
|
|
18
|
+
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
interface ClearButtonProps {
|
|
26
|
+
className?: string;
|
|
27
|
+
[key: string]: React.ButtonHTMLAttributes<HTMLButtonElement> | any;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const ClearButton = styled(({ className, ...props }: ClearButtonProps) => (
|
|
31
|
+
<button
|
|
32
|
+
className={className}
|
|
33
|
+
{...props}
|
|
34
|
+
tabIndex={-1}
|
|
35
|
+
data-default-btn={true}
|
|
36
|
+
>
|
|
37
|
+
<ClearIcon />
|
|
38
|
+
</button>
|
|
39
|
+
))`
|
|
40
|
+
position: absolute;
|
|
41
|
+
right: 0;
|
|
42
|
+
height: 100%;
|
|
43
|
+
padding-inline: 10px;
|
|
44
|
+
background: none;
|
|
45
|
+
border: none;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
margin: 0;
|
|
48
|
+
outline: none;
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export default ClearButton;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import Variant from "./Types/Variant";
|
|
3
|
+
|
|
4
|
+
interface StyledContentProps {
|
|
5
|
+
maxDropdownHeight?: number | string;
|
|
6
|
+
variant?: Variant;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const StyledContent = styled.div<StyledContentProps>`
|
|
10
|
+
position: relative;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
overflow-y: hidden;
|
|
14
|
+
overflow-x: hidden;
|
|
15
|
+
|
|
16
|
+
max-height: ${({ maxDropdownHeight }) =>
|
|
17
|
+
Number.isInteger(maxDropdownHeight)
|
|
18
|
+
? `${maxDropdownHeight}px`
|
|
19
|
+
: maxDropdownHeight || "250px"};
|
|
20
|
+
|
|
21
|
+
background-color: ${({ theme, variant }) => {
|
|
22
|
+
switch (variant) {
|
|
23
|
+
case "filled":
|
|
24
|
+
return theme.palette.input.background;
|
|
25
|
+
case "outlined":
|
|
26
|
+
return theme.palette.input.background;
|
|
27
|
+
case "text":
|
|
28
|
+
return "transparent";
|
|
29
|
+
default:
|
|
30
|
+
return theme.palette.input.background;
|
|
31
|
+
}
|
|
32
|
+
}};
|
|
33
|
+
|
|
34
|
+
border-radius: 5px;
|
|
35
|
+
border: 1px solid ${(props) => props.theme.palette.divider};
|
|
36
|
+
padding: 5px;
|
|
37
|
+
animation-duration: 400ms;
|
|
38
|
+
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
39
|
+
will-change: transform, opacity;
|
|
40
|
+
|
|
41
|
+
&[data-empty="true"] {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&[data-scroll-active="true"] {
|
|
46
|
+
padding-right: 5px;
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
export default StyledContent;
|
package/core/index.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as StyledContent } from "./StyledContent";
|
|
2
|
+
export { default as StyledFloatContainer } from "./StyledFloatContainer";
|
|
3
|
+
export { default as ArrowButton } from "./ArrowButton";
|
|
4
|
+
export { default as ClearButton } from "./ClearButton";
|
|
5
|
+
export type { default as Size } from "./Types/Size";
|
|
6
|
+
export type { default as Variant } from "./Types/Variant";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { Size, Variant } from "../core";
|
|
3
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
children?: ReactNode | string;
|
|
5
|
+
className?: string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
leftSection?: ReactNode;
|
|
8
|
+
rightSection?: ReactNode;
|
|
9
|
+
href?: string | null;
|
|
10
|
+
download?: string | null;
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
size?: Size;
|
|
13
|
+
variant?: Variant;
|
|
14
|
+
color?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
export default Button;
|