@monolith-forensics/monolith-ui 1.3.6 → 1.3.62
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/Divider/Divider.d.ts +6 -0
- package/dist/Divider/Divider.js +25 -0
- package/dist/Divider/index.d.ts +1 -0
- package/dist/Divider/index.js +1 -0
- package/dist/ItemTotal/ItemTotal.d.ts +11 -0
- package/dist/ItemTotal/ItemTotal.js +22 -0
- package/dist/ItemTotal/index.d.ts +2 -0
- package/dist/ItemTotal/index.js +1 -0
- package/dist/TextInput/TextInput.d.ts +4 -0
- package/dist/TextInput/TextInput.js +70 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from "react";
|
|
14
|
+
import styled from "styled-components";
|
|
15
|
+
const StyledDivider = styled.div `
|
|
16
|
+
height: 1px;
|
|
17
|
+
width: 100%;
|
|
18
|
+
background-color: ${({ theme }) => theme.palette.divider};
|
|
19
|
+
margin: 16px 0;
|
|
20
|
+
`;
|
|
21
|
+
export const Divider = forwardRef((_a, ref) => {
|
|
22
|
+
var { className, style } = _a, other = __rest(_a, ["className", "style"]);
|
|
23
|
+
return (_jsx(StyledDivider, Object.assign({ ref: ref, className: className, style: style }, other)));
|
|
24
|
+
});
|
|
25
|
+
Divider.displayName = "Divider";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Divider";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Divider";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ItemTotalProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
total: number;
|
|
5
|
+
Icon: React.ComponentType<any>;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const ItemTotal: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ItemTotalProps, never>> & string & Omit<({ className, total, Icon, style, title, }: ItemTotalProps) => import("react/jsx-runtime").JSX.Element, keyof React.Component<any, {}, any>>;
|
|
10
|
+
export default ItemTotal;
|
|
11
|
+
export type { ItemTotalProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const ItemTotal = styled(({ className, total, Icon, style = {}, title = "Total Items", }) => {
|
|
4
|
+
return (_jsxs("div", { className: className, title: title, style: style, children: [_jsx(Icon, { size: 14, style: {
|
|
5
|
+
fontSize: 14,
|
|
6
|
+
marginRight: 5,
|
|
7
|
+
} }), _jsx("div", { style: {
|
|
8
|
+
fontSize: 12,
|
|
9
|
+
}, children: total || 0 })] }));
|
|
10
|
+
}) `
|
|
11
|
+
display: flex;
|
|
12
|
+
align-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
margin-left: 10px;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
color: ${({ theme }) => theme.palette.text.secondary};
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
color: ${({ theme }) => theme.palette.text.primary};
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
export default ItemTotal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ItemTotal";
|
|
@@ -10,5 +10,9 @@ export type TextInputProps = InputProps & {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
12
12
|
style?: React.CSSProperties;
|
|
13
|
+
password?: boolean;
|
|
14
|
+
clearable?: boolean;
|
|
15
|
+
onClear?: () => void;
|
|
13
16
|
};
|
|
14
17
|
export declare const TextInput: React.FC<TextInputProps>;
|
|
18
|
+
export default TextInput;
|
|
@@ -13,11 +13,78 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import styled from "styled-components";
|
|
14
14
|
import { FieldLabel } from "..";
|
|
15
15
|
import Input from "../Input/Input";
|
|
16
|
-
import { forwardRef } from "react";
|
|
16
|
+
import { forwardRef, useState } from "react";
|
|
17
|
+
import { Eye, EyeOff, X } from "lucide-react";
|
|
17
18
|
const StyledContainer = styled.div `
|
|
18
19
|
grid-column: span ${({ colSpan }) => colSpan || 1};
|
|
19
20
|
`;
|
|
21
|
+
const InputContainer = styled.div `
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
width: ${({ width }) => {
|
|
26
|
+
if (typeof width === "undefined")
|
|
27
|
+
return "100%";
|
|
28
|
+
if (width === null)
|
|
29
|
+
return "100%";
|
|
30
|
+
if (typeof width === "string")
|
|
31
|
+
return width;
|
|
32
|
+
if (typeof width === "number")
|
|
33
|
+
return `${width}px`;
|
|
34
|
+
}};
|
|
35
|
+
`;
|
|
36
|
+
const InputButton = styled.button `
|
|
37
|
+
position: absolute;
|
|
38
|
+
right: 8px;
|
|
39
|
+
background: none;
|
|
40
|
+
border: none;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
46
|
+
padding: 4px;
|
|
47
|
+
border-radius: 4px;
|
|
48
|
+
transition: all 0.2s ease;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
52
|
+
background-color: ${(props) => props.theme.palette.action.hover};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:focus {
|
|
56
|
+
outline: none;
|
|
57
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.palette.primary.main}40;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
svg {
|
|
61
|
+
width: 16px;
|
|
62
|
+
height: 16px;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
20
65
|
export const TextInput = forwardRef((_a, ref) => {
|
|
21
|
-
var { className, label, error, required, colSpan = 1, description, size = "sm", inputProps } = _a, rest = __rest(_a, ["className", "label", "error", "required", "colSpan", "description", "size", "inputProps"]);
|
|
22
|
-
|
|
66
|
+
var { className, label, error, required, colSpan = 1, description, size = "sm", inputProps, password = false, clearable = false, onClear, type, style, value } = _a, rest = __rest(_a, ["className", "label", "error", "required", "colSpan", "description", "size", "inputProps", "password", "clearable", "onClear", "type", "style", "value"]);
|
|
67
|
+
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
68
|
+
const handlePasswordToggle = (e) => {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
setPasswordVisible((prev) => !prev);
|
|
72
|
+
};
|
|
73
|
+
const handleClear = (e) => {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
77
|
+
};
|
|
78
|
+
// Enhanced features: password or clearable functionality
|
|
79
|
+
const inputType = password && !passwordVisible ? "password" : type || "text";
|
|
80
|
+
const inputStyle = Object.assign(Object.assign({}, style), (password || (clearable && value) ? { paddingRight: "36px" } : {}));
|
|
81
|
+
return (_jsxs(StyledContainer, { className: className, colSpan: colSpan, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(InputContainer, { children: [_jsx(Input, Object.assign({ ref: ref, value: value, size: size, type: inputType, style: inputStyle }, inputProps, rest)), password ? (_jsx(InputButton, { onClick: handlePasswordToggle, onMouseDown: (e) => {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
}, type: "button", children: passwordVisible ? _jsx(Eye, {}) : _jsx(EyeOff, {}) })) : clearable && value ? (_jsx(InputButton, { onClick: handleClear, onMouseDown: (e) => {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
}, type: "button", children: _jsx(X, {}) })) : null] })] }));
|
|
23
88
|
});
|
|
89
|
+
TextInput.displayName = "TextInput";
|
|
90
|
+
export default TextInput;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export { default as Tooltip } from "./Tooltip";
|
|
|
28
28
|
export { default as Pill } from "./Pill";
|
|
29
29
|
export { default as Calendar } from "./Calendar";
|
|
30
30
|
export { default as Typography } from "./Typography";
|
|
31
|
+
export { default as ItemTotal } from "./ItemTotal";
|
|
32
|
+
export type { ItemTotalProps } from "./ItemTotal";
|
|
31
33
|
export * from "./RichTextEditor";
|
|
32
34
|
export { default as Loader } from "./Loader";
|
|
33
35
|
export type { LoaderProps } from "./Loader";
|
|
@@ -38,3 +40,4 @@ export * from "./FileViewer";
|
|
|
38
40
|
export * from "./Table";
|
|
39
41
|
export type { ColumnProps, TableProps } from "./Table";
|
|
40
42
|
export * from "./Tabs";
|
|
43
|
+
export * from "./Divider";
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { default as Tooltip } from "./Tooltip";
|
|
|
21
21
|
export { default as Pill } from "./Pill";
|
|
22
22
|
export { default as Calendar } from "./Calendar";
|
|
23
23
|
export { default as Typography } from "./Typography";
|
|
24
|
+
export { default as ItemTotal } from "./ItemTotal";
|
|
24
25
|
export * from "./RichTextEditor";
|
|
25
26
|
export { default as Loader } from "./Loader";
|
|
26
27
|
export * from "./QueryFilter";
|
|
@@ -29,3 +30,4 @@ export * from "./MonolithUIProvider";
|
|
|
29
30
|
export * from "./FileViewer";
|
|
30
31
|
export * from "./Table";
|
|
31
32
|
export * from "./Tabs";
|
|
33
|
+
export * from "./Divider";
|