@monolith-forensics/monolith-ui 1.1.0 → 1.1.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 +4 -1
- package/Button/Button.tsx +0 -382
- package/Button/index.ts +0 -2
- package/Calendar/Calendar.tsx +0 -376
- package/Calendar/CalendarStyles.tsx +0 -180
- package/Calendar/calendarHelpers.ts +0 -196
- package/Calendar/index.ts +0 -1
- package/CheckBox/CheckBox.tsx +0 -61
- package/CheckBox/index.ts +0 -1
- package/DateInput/DateInput.tsx +0 -717
- package/DateInput/index.ts +0 -1
- package/DropDownMenu/DropDownMenu.tsx +0 -402
- package/DropDownMenu/index.ts +0 -1
- package/Error/Error.tsx +0 -51
- package/Error/index.ts +0 -1
- package/FieldLabel/FieldLabel.tsx +0 -155
- package/FieldLabel/index.ts +0 -1
- package/FileInputField/FileInputField.tsx +0 -179
- package/FileInputField/index.ts +0 -1
- package/Flyout/Flyout.tsx +0 -172
- package/Flyout/FlyoutHeader.tsx +0 -14
- package/Flyout/FlyoutTitle.tsx +0 -10
- package/Flyout/index.ts +0 -3
- package/FormSection/FormSection.tsx +0 -71
- package/FormSection/index.ts +0 -1
- package/Grid/Grid.tsx +0 -18
- package/Grid/index.ts +0 -1
- package/IconButton/IconButton.tsx +0 -27
- package/IconButton/index.ts +0 -1
- package/Input/Input.tsx +0 -164
- package/Input/index.ts +0 -1
- package/Modal/Modal.tsx +0 -172
- package/Modal/index.ts +0 -1
- package/Pill/Pill.tsx +0 -174
- package/Pill/index.ts +0 -1
- package/SelectBox/SelectBox.tsx +0 -745
- package/SelectBox/index.ts +0 -1
- package/Switch/Switch.tsx +0 -204
- package/Switch/index.ts +0 -1
- package/TagBox/TagBox.tsx +0 -694
- package/TagBox/TagBoxStyles.tsx +0 -116
- package/TagBox/index.ts +0 -1
- package/TextArea/TextArea.tsx +0 -92
- package/TextArea/index.ts +0 -1
- package/TextAreaInput/TextAreaInput.tsx +0 -46
- package/TextAreaInput/index.ts +0 -1
- package/TextInput/TextInput.tsx +0 -48
- package/TextInput/index.ts +0 -1
- package/Tooltip/Tooltip.tsx +0 -68
- package/Tooltip/index.ts +0 -1
- package/core/ArrowButton.tsx +0 -51
- package/core/ClearButton.tsx +0 -51
- package/core/MonolithThemeProvider.js +0 -16
- package/core/StyledContent.tsx +0 -50
- package/core/StyledFloatContainer.tsx +0 -7
- package/core/Types/Size.ts +0 -3
- package/core/Types/Variant.ts +0 -10
- package/core/index.ts +0 -6
- package/index.ts +0 -22
- package/theme/breakpoints.js +0 -11
- package/theme/components.js +0 -138
- package/theme/index.js +0 -76
- package/theme/shadows.js +0 -33
- package/theme/typography.js +0 -58
- package/theme/variants.js +0 -234
- package/tsconfig.json +0 -109
package/Modal/Modal.tsx
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
3
|
-
import { X } from "lucide-react";
|
|
4
|
-
import {
|
|
5
|
-
FloatingFocusManager,
|
|
6
|
-
FloatingOverlay,
|
|
7
|
-
FloatingPortal,
|
|
8
|
-
useFloating,
|
|
9
|
-
} from "@floating-ui/react";
|
|
10
|
-
import { CSSProperties, Ref } from "react";
|
|
11
|
-
|
|
12
|
-
const StyledOverlay = styled(FloatingOverlay)`
|
|
13
|
-
background-color: rgba(0, 0, 0, 0.3);
|
|
14
|
-
position: fixed;
|
|
15
|
-
inset: 0;
|
|
16
|
-
z-index: 1400;
|
|
17
|
-
|
|
18
|
-
@keyframes overlayShow {
|
|
19
|
-
from {
|
|
20
|
-
opacity: 0;
|
|
21
|
-
}
|
|
22
|
-
to {
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
interface StyledContentProps {
|
|
29
|
-
style?: CSSProperties;
|
|
30
|
-
className?: string;
|
|
31
|
-
ref?: Ref<HTMLDivElement>;
|
|
32
|
-
// Add other props that StyledContent might receive
|
|
33
|
-
[key: string]: any; // For additional props such as `floatingStyles`
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const StyledContent = styled.div<StyledContentProps>`
|
|
37
|
-
background-color: ${({ theme }) =>
|
|
38
|
-
theme.name === "DARK"
|
|
39
|
-
? theme.palette.background.default
|
|
40
|
-
: theme.palette.background.default};
|
|
41
|
-
border-radius: 6px;
|
|
42
|
-
border: 1px solid ${(props) => props.theme.palette.divider};
|
|
43
|
-
position: fixed;
|
|
44
|
-
top: 25px;
|
|
45
|
-
left: 50%;
|
|
46
|
-
transform: translate(-50%, 0px);
|
|
47
|
-
box-shadow: rgba(0, 0, 0, 0.5) 0px 16px 70px;
|
|
48
|
-
|
|
49
|
-
z-index: 2;
|
|
50
|
-
|
|
51
|
-
max-height: calc(100vh - 50px);
|
|
52
|
-
max-width: calc(100vw - 50px);
|
|
53
|
-
|
|
54
|
-
display: flex;
|
|
55
|
-
flex-direction: column;
|
|
56
|
-
|
|
57
|
-
overflow-y: hidden;
|
|
58
|
-
|
|
59
|
-
&:focus {
|
|
60
|
-
outline: none;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@keyframes contentShow {
|
|
64
|
-
from {
|
|
65
|
-
opacity: 0;
|
|
66
|
-
transform: translate(-50%, -48%) scale(0.96);
|
|
67
|
-
}
|
|
68
|
-
to {
|
|
69
|
-
opacity: 1;
|
|
70
|
-
transform: translate(-50%, -50%) scale(1);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
|
-
const StyledInnerContent = styled.div`
|
|
76
|
-
display: flex;
|
|
77
|
-
flex-direction: column;
|
|
78
|
-
|
|
79
|
-
overflow-y: auto;
|
|
80
|
-
padding: 25px;
|
|
81
|
-
`;
|
|
82
|
-
|
|
83
|
-
const StyledClose = styled(RadixDialog.Close)`
|
|
84
|
-
position: absolute;
|
|
85
|
-
top: 15px;
|
|
86
|
-
right: 15px;
|
|
87
|
-
|
|
88
|
-
color: ${(props) => props.theme.palette.text.secondary};
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
const StyledButton = styled.button`
|
|
92
|
-
background-color: transparent;
|
|
93
|
-
border: none;
|
|
94
|
-
outline: none;
|
|
95
|
-
cursor: pointer;
|
|
96
|
-
padding: 0;
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
const Title = styled.h1`
|
|
100
|
-
font-size: 20px;
|
|
101
|
-
font-weight: 600;
|
|
102
|
-
margin: 0px;
|
|
103
|
-
`;
|
|
104
|
-
|
|
105
|
-
const SubTitle = styled.h2`
|
|
106
|
-
font-size: 14px;
|
|
107
|
-
font-weight: 500;
|
|
108
|
-
margin: 0px;
|
|
109
|
-
color: ${(props) => props.theme.palette.text.secondary};
|
|
110
|
-
`;
|
|
111
|
-
|
|
112
|
-
interface ModalProps {
|
|
113
|
-
children: React.ReactNode;
|
|
114
|
-
open?: boolean;
|
|
115
|
-
onClose?: () => void;
|
|
116
|
-
style?: React.CSSProperties;
|
|
117
|
-
showCloseButton?: boolean;
|
|
118
|
-
FocusProps?: any;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const Modal = ({
|
|
122
|
-
children,
|
|
123
|
-
open = false,
|
|
124
|
-
onClose,
|
|
125
|
-
style = {},
|
|
126
|
-
showCloseButton = false,
|
|
127
|
-
FocusProps = {},
|
|
128
|
-
}: ModalProps) => {
|
|
129
|
-
const { refs, floatingStyles, context } = useFloating({
|
|
130
|
-
open,
|
|
131
|
-
onOpenChange: (isOpen) => {
|
|
132
|
-
if (!isOpen) {
|
|
133
|
-
onClose?.();
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
const handleMouseDown = () => {
|
|
139
|
-
onClose?.();
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
<FloatingPortal preserveTabOrder>
|
|
144
|
-
{open && (
|
|
145
|
-
<StyledOverlay className="mf-ModalOverlay" lockScroll>
|
|
146
|
-
<FloatingFocusManager context={context} modal={true} {...FocusProps}>
|
|
147
|
-
<StyledContent
|
|
148
|
-
style={style}
|
|
149
|
-
className="mf-Modal"
|
|
150
|
-
ref={refs.setFloating}
|
|
151
|
-
{...floatingStyles}
|
|
152
|
-
>
|
|
153
|
-
{showCloseButton && (
|
|
154
|
-
<StyledClose asChild>
|
|
155
|
-
<StyledButton onMouseDown={handleMouseDown}>
|
|
156
|
-
<X size={18} />
|
|
157
|
-
</StyledButton>
|
|
158
|
-
</StyledClose>
|
|
159
|
-
)}
|
|
160
|
-
<StyledInnerContent>{children}</StyledInnerContent>
|
|
161
|
-
</StyledContent>
|
|
162
|
-
</FloatingFocusManager>
|
|
163
|
-
</StyledOverlay>
|
|
164
|
-
)}
|
|
165
|
-
</FloatingPortal>
|
|
166
|
-
);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
Modal.Title = Title;
|
|
170
|
-
Modal.SubTitle = SubTitle;
|
|
171
|
-
|
|
172
|
-
export default Modal;
|
package/Modal/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Modal";
|
package/Pill/Pill.tsx
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { X } from "lucide-react";
|
|
3
|
-
import { ButtonHTMLAttributes, ReactNode } from "react";
|
|
4
|
-
import { Size } from "../core";
|
|
5
|
-
|
|
6
|
-
interface StyledButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
-
children?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const StyledButton = styled.button<StyledButtonProps>`
|
|
11
|
-
background-color: transparent;
|
|
12
|
-
border: none;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
padding: 0;
|
|
18
|
-
margin: 0;
|
|
19
|
-
outline: none;
|
|
20
|
-
transition: color 0.2s;
|
|
21
|
-
padding-inline-end: 5px;
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
interface PillProps {
|
|
25
|
-
className?: string;
|
|
26
|
-
children?: ReactNode;
|
|
27
|
-
size?: Size;
|
|
28
|
-
showRemoveIcon?: boolean;
|
|
29
|
-
onRemove?: () => void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const Pill = styled(
|
|
33
|
-
({
|
|
34
|
-
className,
|
|
35
|
-
children,
|
|
36
|
-
size = "md",
|
|
37
|
-
showRemoveIcon = true,
|
|
38
|
-
onRemove,
|
|
39
|
-
}: PillProps) => {
|
|
40
|
-
const handleRemove = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
e.stopPropagation();
|
|
43
|
-
onRemove?.();
|
|
44
|
-
};
|
|
45
|
-
return (
|
|
46
|
-
<div className={className}>
|
|
47
|
-
<span className="pill-content">{children}</span>
|
|
48
|
-
{showRemoveIcon && (
|
|
49
|
-
<StyledButton onClick={handleRemove}>
|
|
50
|
-
<X />
|
|
51
|
-
</StyledButton>
|
|
52
|
-
)}
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
)`
|
|
57
|
-
user-select: none;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: space-between;
|
|
61
|
-
flex-direction: row;
|
|
62
|
-
width: fit-content;
|
|
63
|
-
max-width: 250px;
|
|
64
|
-
gap: 5px;
|
|
65
|
-
flex: 0;
|
|
66
|
-
|
|
67
|
-
font-weight: 500;
|
|
68
|
-
color: ${({ theme }) => theme.palette.text.primary};
|
|
69
|
-
|
|
70
|
-
padding-inline-end: ${({ size, showRemoveIcon }) => {
|
|
71
|
-
if (showRemoveIcon) {
|
|
72
|
-
return "0px";
|
|
73
|
-
}
|
|
74
|
-
switch (size) {
|
|
75
|
-
case "xs":
|
|
76
|
-
return "8px";
|
|
77
|
-
case "sm":
|
|
78
|
-
return "10px";
|
|
79
|
-
case "md":
|
|
80
|
-
return "12px";
|
|
81
|
-
case "lg":
|
|
82
|
-
return "14px";
|
|
83
|
-
case "xl":
|
|
84
|
-
return "16px";
|
|
85
|
-
default:
|
|
86
|
-
return "10px";
|
|
87
|
-
}
|
|
88
|
-
}};
|
|
89
|
-
|
|
90
|
-
padding-inline-start: ${({ size }) => {
|
|
91
|
-
switch (size) {
|
|
92
|
-
case "xs":
|
|
93
|
-
return "8px";
|
|
94
|
-
case "sm":
|
|
95
|
-
return "10px";
|
|
96
|
-
case "md":
|
|
97
|
-
return "12px";
|
|
98
|
-
case "lg":
|
|
99
|
-
return "14px";
|
|
100
|
-
case "xl":
|
|
101
|
-
return "16px";
|
|
102
|
-
default:
|
|
103
|
-
return "10px";
|
|
104
|
-
}
|
|
105
|
-
}};
|
|
106
|
-
|
|
107
|
-
height: ${({ size }) => {
|
|
108
|
-
switch (size) {
|
|
109
|
-
case "xs":
|
|
110
|
-
return "20px";
|
|
111
|
-
case "sm":
|
|
112
|
-
return "22px";
|
|
113
|
-
case "md":
|
|
114
|
-
return "24px";
|
|
115
|
-
case "lg":
|
|
116
|
-
return "26px";
|
|
117
|
-
case "xl":
|
|
118
|
-
return "28px";
|
|
119
|
-
default:
|
|
120
|
-
return "22px";
|
|
121
|
-
}
|
|
122
|
-
}};
|
|
123
|
-
|
|
124
|
-
border: 1px solid ${({ theme }) => theme.palette.divider};
|
|
125
|
-
border-radius: 1000px;
|
|
126
|
-
|
|
127
|
-
background-color: ${({ theme }) => theme.palette.background.secondary};
|
|
128
|
-
|
|
129
|
-
.pill-content {
|
|
130
|
-
white-space: nowrap;
|
|
131
|
-
overflow: hidden;
|
|
132
|
-
text-overflow: ellipsis;
|
|
133
|
-
|
|
134
|
-
font-size: ${({ size }) => {
|
|
135
|
-
switch (size) {
|
|
136
|
-
case "xs":
|
|
137
|
-
return "10px";
|
|
138
|
-
case "sm":
|
|
139
|
-
return "12px";
|
|
140
|
-
case "md":
|
|
141
|
-
return "14px";
|
|
142
|
-
case "lg":
|
|
143
|
-
return "16px";
|
|
144
|
-
case "xl":
|
|
145
|
-
return "18px";
|
|
146
|
-
default:
|
|
147
|
-
return "12px";
|
|
148
|
-
}
|
|
149
|
-
}};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
svg {
|
|
153
|
-
color: ${({ theme }) => theme.palette.text.primary};
|
|
154
|
-
|
|
155
|
-
width: ${({ size }) => {
|
|
156
|
-
switch (size) {
|
|
157
|
-
case "xs":
|
|
158
|
-
return "12px";
|
|
159
|
-
case "sm":
|
|
160
|
-
return "14px";
|
|
161
|
-
case "md":
|
|
162
|
-
return "16px";
|
|
163
|
-
case "lg":
|
|
164
|
-
return "18px";
|
|
165
|
-
case "xl":
|
|
166
|
-
return "20px";
|
|
167
|
-
default:
|
|
168
|
-
return "14px";
|
|
169
|
-
}
|
|
170
|
-
}};
|
|
171
|
-
}
|
|
172
|
-
`;
|
|
173
|
-
|
|
174
|
-
export default Pill;
|
package/Pill/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Pill";
|