@monolith-forensics/monolith-ui 1.0.12 → 1.1.1
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/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/{src/components → dist}/Calendar/CalendarStyles.js +32 -52
- 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.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.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.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.js +8 -0
- package/dist/TextAreaInput/TextAreaInput.d.ts +12 -0
- package/dist/TextAreaInput/TextAreaInput.js +23 -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.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/package.json +15 -20
- package/.gitattributes +0 -2
- package/rollup.config.js +0 -10
- package/src/components/ArrowButton/ArrowButton.tsx +0 -54
- 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/Calendar/Calendar.js +0 -365
- package/src/components/Calendar/calendarHelpers.js +0 -194
- package/src/components/DateInput/DateInput.js +0 -583
- package/src/components/FieldLabel/FieldLabel.tsx +0 -152
- package/src/components/FileInputField/FileInputField.js +0 -171
- package/src/components/Input/Input.tsx +0 -141
- package/src/components/Pill/Pill.tsx +0 -144
- package/src/components/SelectBox/SelectBox.js +0 -543
- package/src/components/TagBox/TagBox.js +0 -563
- package/src/components/TextArea/TextArea.tsx +0 -70
- package/src/components/TextAreaInput/TextAreaInput.tsx +0 -48
- package/src/components/TextInput/TextInput.tsx +0 -50
- package/src/components/core/index.js +0 -16
- package/src/components/index.ts +0 -7
- package/src/components/theme/breakpoints.js +0 -11
- package/src/components/theme/components.js +0 -140
- package/src/components/theme/index.js +0 -77
- package/src/components/theme/shadows.js +0 -33
- package/src/components/theme/typography.js +0 -58
- package/src/components/theme/variants.js +0 -235
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -109
- /package/{src/components/FieldLabel/index.ts → dist/FieldLabel/index.d.ts} +0 -0
- /package/{src/components/Input/index.tsx → dist/Input/index.d.ts} +0 -0
- /package/{src/components/Pill/index.ts → dist/Pill/index.d.ts} +0 -0
- /package/{src/components/TextArea/index.ts → dist/TextArea/index.d.ts} +0 -0
- /package/{src/components/TextAreaInput/index.ts → dist/TextAreaInput/index.d.ts} +0 -0
- /package/{src/components/TextInput/index.tsx → dist/TextInput/index.d.ts} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("@floating-ui/react");
|
|
8
|
+
const lucide_react_1 = require("lucide-react");
|
|
9
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
|
+
const ANIMATION_TIME = 300;
|
|
11
|
+
const StyledOverlay = (0, styled_components_1.default)(react_1.FloatingOverlay) `
|
|
12
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
13
|
+
position: fixed;
|
|
14
|
+
inset: 0;
|
|
15
|
+
z-index: 1400;
|
|
16
|
+
|
|
17
|
+
@keyframes overlayShow {
|
|
18
|
+
from {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
to {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
const StyledClose = styled_components_1.default.div `
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 20px;
|
|
29
|
+
right: 20px;
|
|
30
|
+
|
|
31
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
32
|
+
`;
|
|
33
|
+
const StyledButton = styled_components_1.default.button `
|
|
34
|
+
background-color: transparent;
|
|
35
|
+
border: none;
|
|
36
|
+
outline: none;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
padding: 0;
|
|
39
|
+
|
|
40
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: ${(props) => props.theme.palette.action.hover};
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
const StyledContent = styled_components_1.default.div `
|
|
47
|
+
background-color: ${({ theme }) => theme.name === "DARK"
|
|
48
|
+
? theme.palette.background.alt
|
|
49
|
+
: theme.palette.background.default};
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
border: 1px solid ${(props) => props.theme.palette.divider};
|
|
52
|
+
position: fixed;
|
|
53
|
+
margin: 10px;
|
|
54
|
+
|
|
55
|
+
top: 0px;
|
|
56
|
+
right: 0px;
|
|
57
|
+
width: 50vw;
|
|
58
|
+
height: calc(100vh - 20px);
|
|
59
|
+
|
|
60
|
+
box-shadow: rgba(0, 0, 0, 0.5) 0px 16px 70px;
|
|
61
|
+
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
flex: 1 1 auto;
|
|
65
|
+
|
|
66
|
+
overflow-y: hidden;
|
|
67
|
+
|
|
68
|
+
&:focus {
|
|
69
|
+
outline: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
animation: contentShow ${ANIMATION_TIME}ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
73
|
+
|
|
74
|
+
// slide in from right to left
|
|
75
|
+
@keyframes contentShow {
|
|
76
|
+
from {
|
|
77
|
+
transform: translate(100%, 0);
|
|
78
|
+
}
|
|
79
|
+
to {
|
|
80
|
+
transform: translate(0, 0);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
const StyledInnerContent = styled_components_1.default.div `
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
flex: 1 1 auto;
|
|
88
|
+
|
|
89
|
+
overflow-y: auto;
|
|
90
|
+
padding: 25px;
|
|
91
|
+
`;
|
|
92
|
+
const Flyout = ({ children, open = false, onClose = () => { }, style = {}, closeOnOutsideClick = true, showCloseButton = true, }) => {
|
|
93
|
+
const { refs, floatingStyles, context } = (0, react_1.useFloating)({
|
|
94
|
+
open,
|
|
95
|
+
onOpenChange: (isOpen) => {
|
|
96
|
+
if (!isOpen) {
|
|
97
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
const handleMouseDown = (event) => {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
const target = event.target;
|
|
104
|
+
if (((_b = (_a = target === null || target === void 0 ? void 0 : target.className) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, "mf-ModalOverlay")) &&
|
|
105
|
+
closeOnOutsideClick) {
|
|
106
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { preserveTabOrder: true, children: open && ((0, jsx_runtime_1.jsx)(StyledOverlay, { className: "mf-ModalOverlay", lockScroll: true, onMouseDown: handleMouseDown, children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: true, children: (0, jsx_runtime_1.jsxs)(StyledContent, Object.assign({ style: style, className: `mf-Modal mf-Flyout`, ref: refs.setFloating }, floatingStyles, { children: [showCloseButton && ((0, jsx_runtime_1.jsx)(StyledClose, { children: (0, jsx_runtime_1.jsx)(StyledButton, { onMouseDown: () => onClose === null || onClose === void 0 ? void 0 : onClose(), children: (0, jsx_runtime_1.jsx)(lucide_react_1.XIcon, { size: 18 }) }) })), (0, jsx_runtime_1.jsx)(StyledInnerContent, { className: "mf-Flyout inner-content", children: children })] })) }) })) }));
|
|
110
|
+
};
|
|
111
|
+
exports.default = Flyout;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
interface FlyoutHeaderProps {
|
|
2
|
+
hasBorder?: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare const FlyoutHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, FlyoutHeaderProps>> & string;
|
|
5
|
+
export default FlyoutHeader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const FlyoutHeader = styled_components_1.default.div `
|
|
8
|
+
border-bottom: ${({ theme, hasBorder }) => hasBorder ? `1px solid ${theme.palette.divider}` : "none"};
|
|
9
|
+
|
|
10
|
+
min-height: 50px;
|
|
11
|
+
`;
|
|
12
|
+
exports.default = FlyoutHeader;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const FlyoutTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
2
|
+
export default FlyoutTitle;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const FlyoutTitle = styled_components_1.default.h1 `
|
|
8
|
+
font-size: 24px;
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
margin: 0px;
|
|
11
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
12
|
+
`;
|
|
13
|
+
exports.default = FlyoutTitle;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FlyoutTitle = exports.FlyoutHeader = exports.default = void 0;
|
|
7
|
+
var Flyout_1 = require("./Flyout");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Flyout_1).default; } });
|
|
9
|
+
var FlyoutHeader_1 = require("./FlyoutHeader");
|
|
10
|
+
Object.defineProperty(exports, "FlyoutHeader", { enumerable: true, get: function () { return __importDefault(FlyoutHeader_1).default; } });
|
|
11
|
+
var FlyoutTitle_1 = require("./FlyoutTitle");
|
|
12
|
+
Object.defineProperty(exports, "FlyoutTitle", { enumerable: true, get: function () { return __importDefault(FlyoutTitle_1).default; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface FormSectionProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const FormSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<FormSectionProps, never>> & string & Omit<({ className, title, children, defaultOpen }: FormSectionProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
9
|
+
export default FormSection;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const lucide_react_1 = require("lucide-react");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
|
+
const FormSection = (0, styled_components_1.default)(({ className, title, children, defaultOpen = true }) => {
|
|
11
|
+
const [open, setOpen] = (0, react_1.useState)(defaultOpen);
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: className, children: [(0, jsx_runtime_1.jsxs)("div", { className: "section-header", onClick: (e) => setOpen((prev) => !prev), children: [(0, jsx_runtime_1.jsx)("h3", { children: title }), (0, jsx_runtime_1.jsx)("div", { className: "section-line" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDownIcon, { size: 18, className: open ? "open" : "" })] }), (0, jsx_runtime_1.jsx)("div", { className: "section-content", "data-open": open, children: children })] }));
|
|
13
|
+
}) `
|
|
14
|
+
h3 {
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.section-header {
|
|
19
|
+
user-select: none;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
margin-bottom: 10px;
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
gap: 10px;
|
|
26
|
+
align-items: center;
|
|
27
|
+
|
|
28
|
+
.section-line {
|
|
29
|
+
flex: 1;
|
|
30
|
+
height: 1px;
|
|
31
|
+
background-color: ${({ theme }) => theme.palette.divider};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
svg {
|
|
35
|
+
transition: transform 0.2s;
|
|
36
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
37
|
+
|
|
38
|
+
&.open {
|
|
39
|
+
transform: rotate(180deg);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.section-content {
|
|
45
|
+
padding: 10px 0px;
|
|
46
|
+
&[data-open="false"] {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
exports.default = FormSection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./FormSection";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var FormSection_1 = require("./FormSection");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(FormSection_1).default; } });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface GridProps {
|
|
2
|
+
col?: number;
|
|
3
|
+
width?: string | number;
|
|
4
|
+
}
|
|
5
|
+
declare const Grid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, GridProps>> & string;
|
|
6
|
+
export default Grid;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const Grid = styled_components_1.default.div `
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat(${({ col }) => col || 1}, minmax(0, 1fr));
|
|
10
|
+
gap: 20px;
|
|
11
|
+
|
|
12
|
+
width: ${({ width }) => Number.isInteger(width) ? `${width}px` : width || "100%"};
|
|
13
|
+
height: auto;
|
|
14
|
+
`;
|
|
15
|
+
exports.default = Grid;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Grid";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var Grid_1 = require("./Grid");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Grid_1).default; } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ButtonProps } from "../Button/Button.js";
|
|
2
|
+
declare const IconButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<ButtonProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
4
|
+
}, ButtonProps>> & string & Omit<import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
5
|
+
export default IconButton;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const __1 = require("..");
|
|
8
|
+
const IconButton = (0, styled_components_1.default)(__1.Button) `
|
|
9
|
+
padding: ${({ size, variant }) => {
|
|
10
|
+
if (variant === "text")
|
|
11
|
+
return `0px 0px`;
|
|
12
|
+
switch (size) {
|
|
13
|
+
case "xxs":
|
|
14
|
+
return `0px 4px`;
|
|
15
|
+
case "xs":
|
|
16
|
+
return `0px 4px`;
|
|
17
|
+
case "sm":
|
|
18
|
+
return `0px 6px`;
|
|
19
|
+
case "md":
|
|
20
|
+
return `0px 8px`;
|
|
21
|
+
case "lg":
|
|
22
|
+
return `0px 10px`;
|
|
23
|
+
case "xl":
|
|
24
|
+
return `0px 12px`;
|
|
25
|
+
default:
|
|
26
|
+
return `0px 6px`;
|
|
27
|
+
}
|
|
28
|
+
}};
|
|
29
|
+
`;
|
|
30
|
+
exports.default = IconButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./IconButton";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var IconButton_1 = require("./IconButton");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(IconButton_1).default; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Size, Variant } from "../core";
|
|
2
|
+
export interface InputProps {
|
|
3
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
4
|
+
className?: string;
|
|
5
|
+
size?: Size;
|
|
6
|
+
variant?: Variant;
|
|
7
|
+
width?: string | number | null | undefined;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
onKeyUp?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
12
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
13
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
14
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
15
|
+
autoFocus?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const Input: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>, "ref"> & {
|
|
19
|
+
ref?: ((instance: HTMLInputElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
20
|
+
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>, keyof import("react").Component<any, {}, any>>;
|
|
21
|
+
export default Input;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
19
|
+
const react_1 = require("react");
|
|
20
|
+
const Input = (0, styled_components_1.default)((0, react_1.forwardRef)((_a, ref) => {
|
|
21
|
+
var { className, size = "sm", variant = "outlined", width } = _a, rest = __rest(_a, ["className", "size", "variant", "width"]);
|
|
22
|
+
return (0, jsx_runtime_1.jsx)("input", Object.assign({ ref: ref, className: className }, rest));
|
|
23
|
+
})) `
|
|
24
|
+
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
25
|
+
pointer-events: "all";
|
|
26
|
+
user-select: "all";
|
|
27
|
+
outline: none;
|
|
28
|
+
|
|
29
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
30
|
+
font-size: ${({ size }) => size === "xs"
|
|
31
|
+
? "11px"
|
|
32
|
+
: size === "sm"
|
|
33
|
+
? "13px"
|
|
34
|
+
: size === "md"
|
|
35
|
+
? "15px"
|
|
36
|
+
: size === "lg"
|
|
37
|
+
? "17px"
|
|
38
|
+
: size === "xl"
|
|
39
|
+
? "19px"
|
|
40
|
+
: "11px"};
|
|
41
|
+
|
|
42
|
+
height: ${({ size }) => size === "xs"
|
|
43
|
+
? "26px"
|
|
44
|
+
: size === "sm"
|
|
45
|
+
? "30px"
|
|
46
|
+
: size === "md"
|
|
47
|
+
? "36px"
|
|
48
|
+
: size === "lg"
|
|
49
|
+
? "42px"
|
|
50
|
+
: size === "xl"
|
|
51
|
+
? "50px"
|
|
52
|
+
: "26px"};
|
|
53
|
+
|
|
54
|
+
min-height: ${({ size }) => size === "xs"
|
|
55
|
+
? "26px"
|
|
56
|
+
: size === "sm"
|
|
57
|
+
? "30px"
|
|
58
|
+
: size === "md"
|
|
59
|
+
? "36px"
|
|
60
|
+
: size === "lg"
|
|
61
|
+
? "42px"
|
|
62
|
+
: size === "xl"
|
|
63
|
+
? "50px"
|
|
64
|
+
: "26px"};
|
|
65
|
+
|
|
66
|
+
transition: border 0.1s ease-in-out;
|
|
67
|
+
border-radius: 4px;
|
|
68
|
+
border: 1px solid
|
|
69
|
+
${({ theme, variant }) => {
|
|
70
|
+
switch (variant) {
|
|
71
|
+
case "contained":
|
|
72
|
+
return "transparent";
|
|
73
|
+
case "filled":
|
|
74
|
+
return "transparent";
|
|
75
|
+
case "outlined":
|
|
76
|
+
return theme.palette.input.border;
|
|
77
|
+
case "text":
|
|
78
|
+
return "transparent";
|
|
79
|
+
default:
|
|
80
|
+
return theme.palette.input.border;
|
|
81
|
+
}
|
|
82
|
+
}};
|
|
83
|
+
|
|
84
|
+
padding: ${({ size }) => size === "xs"
|
|
85
|
+
? "0px 8px"
|
|
86
|
+
: size === "sm"
|
|
87
|
+
? "0px 10px"
|
|
88
|
+
: size === "md"
|
|
89
|
+
? "0px 12px"
|
|
90
|
+
: size === "lg"
|
|
91
|
+
? "0px 14px"
|
|
92
|
+
: size === "xl"
|
|
93
|
+
? "0px 16px"
|
|
94
|
+
: "0px 8px"};
|
|
95
|
+
|
|
96
|
+
width: ${({ width }) => {
|
|
97
|
+
if (typeof width === "undefined")
|
|
98
|
+
return "100%";
|
|
99
|
+
if (width === null)
|
|
100
|
+
return "100%";
|
|
101
|
+
if (typeof width === "string")
|
|
102
|
+
return width;
|
|
103
|
+
if (typeof width === "number")
|
|
104
|
+
return `${width}px`;
|
|
105
|
+
}};
|
|
106
|
+
|
|
107
|
+
background-color: ${({ theme, variant }) => {
|
|
108
|
+
switch (variant) {
|
|
109
|
+
case "contained":
|
|
110
|
+
return theme.palette.input.background;
|
|
111
|
+
case "filled":
|
|
112
|
+
return theme.palette.input.background;
|
|
113
|
+
case "outlined":
|
|
114
|
+
return theme.palette.input.background;
|
|
115
|
+
case "text":
|
|
116
|
+
return "transparent";
|
|
117
|
+
default:
|
|
118
|
+
return theme.palette.input.background;
|
|
119
|
+
}
|
|
120
|
+
}};
|
|
121
|
+
|
|
122
|
+
::placeholder {
|
|
123
|
+
font-size: ${({ size }) => size === "xs"
|
|
124
|
+
? "10px"
|
|
125
|
+
: size === "sm"
|
|
126
|
+
? "12px"
|
|
127
|
+
: size === "md"
|
|
128
|
+
? "14px"
|
|
129
|
+
: size === "lg"
|
|
130
|
+
? "16px"
|
|
131
|
+
: size === "xl"
|
|
132
|
+
? "18px"
|
|
133
|
+
: "10px"};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:focus {
|
|
137
|
+
border: 1px solid ${({ theme }) => theme.palette.primary.main};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&[data-button-right="true"] {
|
|
141
|
+
padding-right: 36px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&[readOnly] {
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
}
|
|
147
|
+
`;
|
|
148
|
+
exports.default = Input;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var Input_1 = require("./Input");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Input_1).default; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ModalProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
showCloseButton?: boolean;
|
|
7
|
+
FocusProps?: any;
|
|
8
|
+
}
|
|
9
|
+
declare const Modal: {
|
|
10
|
+
({ children, open, onClose, style, showCloseButton, FocusProps, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
12
|
+
SubTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
13
|
+
};
|
|
14
|
+
export default Modal;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
31
|
+
const RadixDialog = __importStar(require("@radix-ui/react-dialog"));
|
|
32
|
+
const lucide_react_1 = require("lucide-react");
|
|
33
|
+
const react_1 = require("@floating-ui/react");
|
|
34
|
+
const StyledOverlay = (0, styled_components_1.default)(react_1.FloatingOverlay) `
|
|
35
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
36
|
+
position: fixed;
|
|
37
|
+
inset: 0;
|
|
38
|
+
z-index: 1400;
|
|
39
|
+
|
|
40
|
+
@keyframes overlayShow {
|
|
41
|
+
from {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
to {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
const StyledContent = styled_components_1.default.div `
|
|
50
|
+
background-color: ${({ theme }) => theme.name === "DARK"
|
|
51
|
+
? theme.palette.background.default
|
|
52
|
+
: theme.palette.background.default};
|
|
53
|
+
border-radius: 6px;
|
|
54
|
+
border: 1px solid ${(props) => props.theme.palette.divider};
|
|
55
|
+
position: fixed;
|
|
56
|
+
top: 25px;
|
|
57
|
+
left: 50%;
|
|
58
|
+
transform: translate(-50%, 0px);
|
|
59
|
+
box-shadow: rgba(0, 0, 0, 0.5) 0px 16px 70px;
|
|
60
|
+
|
|
61
|
+
z-index: 2;
|
|
62
|
+
|
|
63
|
+
max-height: calc(100vh - 50px);
|
|
64
|
+
max-width: calc(100vw - 50px);
|
|
65
|
+
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
|
|
69
|
+
overflow-y: hidden;
|
|
70
|
+
|
|
71
|
+
&:focus {
|
|
72
|
+
outline: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@keyframes contentShow {
|
|
76
|
+
from {
|
|
77
|
+
opacity: 0;
|
|
78
|
+
transform: translate(-50%, -48%) scale(0.96);
|
|
79
|
+
}
|
|
80
|
+
to {
|
|
81
|
+
opacity: 1;
|
|
82
|
+
transform: translate(-50%, -50%) scale(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
const StyledInnerContent = styled_components_1.default.div `
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
|
|
90
|
+
overflow-y: auto;
|
|
91
|
+
padding: 25px;
|
|
92
|
+
`;
|
|
93
|
+
const StyledClose = (0, styled_components_1.default)(RadixDialog.Close) `
|
|
94
|
+
position: absolute;
|
|
95
|
+
top: 15px;
|
|
96
|
+
right: 15px;
|
|
97
|
+
|
|
98
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
99
|
+
`;
|
|
100
|
+
const StyledButton = styled_components_1.default.button `
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
border: none;
|
|
103
|
+
outline: none;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
padding: 0;
|
|
106
|
+
`;
|
|
107
|
+
const Title = styled_components_1.default.h1 `
|
|
108
|
+
font-size: 20px;
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
margin: 0px;
|
|
111
|
+
`;
|
|
112
|
+
const SubTitle = styled_components_1.default.h2 `
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
font-weight: 500;
|
|
115
|
+
margin: 0px;
|
|
116
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
117
|
+
`;
|
|
118
|
+
const Modal = ({ children, open = false, onClose, style = {}, showCloseButton = false, FocusProps = {}, }) => {
|
|
119
|
+
const { refs, floatingStyles, context } = (0, react_1.useFloating)({
|
|
120
|
+
open,
|
|
121
|
+
onOpenChange: (isOpen) => {
|
|
122
|
+
if (!isOpen) {
|
|
123
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
const handleMouseDown = () => {
|
|
128
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
129
|
+
};
|
|
130
|
+
return ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { preserveTabOrder: true, children: open && ((0, jsx_runtime_1.jsx)(StyledOverlay, { className: "mf-ModalOverlay", lockScroll: true, children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, Object.assign({ context: context, modal: true }, FocusProps, { children: (0, jsx_runtime_1.jsxs)(StyledContent, Object.assign({ style: style, className: "mf-Modal", ref: refs.setFloating }, floatingStyles, { children: [showCloseButton && ((0, jsx_runtime_1.jsx)(StyledClose, { asChild: true, children: (0, jsx_runtime_1.jsx)(StyledButton, { onMouseDown: handleMouseDown, children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 18 }) }) })), (0, jsx_runtime_1.jsx)(StyledInnerContent, { children: children })] })) })) })) }));
|
|
131
|
+
};
|
|
132
|
+
Modal.Title = Title;
|
|
133
|
+
Modal.SubTitle = SubTitle;
|
|
134
|
+
exports.default = Modal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Modal";
|