@monolith-forensics/monolith-ui 1.3.6 → 1.3.61
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/Input/Input.d.ts +3 -0
- package/dist/Input/Input.js +70 -4
- 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/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";
|
package/dist/Input/Input.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export interface InputProps {
|
|
|
5
5
|
size?: Size;
|
|
6
6
|
variant?: Variant;
|
|
7
7
|
width?: string | number | null | undefined;
|
|
8
|
+
password?: boolean;
|
|
9
|
+
clearable?: boolean;
|
|
10
|
+
onClear?: () => void;
|
|
8
11
|
}
|
|
9
12
|
declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
13
|
export default Input;
|
package/dist/Input/Input.js
CHANGED
|
@@ -9,9 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import styled from "styled-components";
|
|
14
|
-
import { forwardRef } from "react";
|
|
14
|
+
import { forwardRef, useState } from "react";
|
|
15
|
+
import { Eye, EyeOff, X } from "lucide-react";
|
|
15
16
|
const StyledInput = styled.input `
|
|
16
17
|
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
17
18
|
pointer-events: "all";
|
|
@@ -143,8 +144,73 @@ const StyledInput = styled.input `
|
|
|
143
144
|
opacity: 0.5;
|
|
144
145
|
}
|
|
145
146
|
`;
|
|
147
|
+
const InputContainer = styled.div `
|
|
148
|
+
position: relative;
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
width: ${({ width }) => {
|
|
152
|
+
if (typeof width === "undefined")
|
|
153
|
+
return "100%";
|
|
154
|
+
if (width === null)
|
|
155
|
+
return "100%";
|
|
156
|
+
if (typeof width === "string")
|
|
157
|
+
return width;
|
|
158
|
+
if (typeof width === "number")
|
|
159
|
+
return `${width}px`;
|
|
160
|
+
}};
|
|
161
|
+
`;
|
|
162
|
+
const InputButton = styled.button `
|
|
163
|
+
position: absolute;
|
|
164
|
+
right: 8px;
|
|
165
|
+
background: none;
|
|
166
|
+
border: none;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
color: ${(props) => props.theme.palette.text.secondary};
|
|
172
|
+
padding: 4px;
|
|
173
|
+
border-radius: 4px;
|
|
174
|
+
transition: all 0.2s ease;
|
|
175
|
+
|
|
176
|
+
&:hover {
|
|
177
|
+
color: ${(props) => props.theme.palette.text.primary};
|
|
178
|
+
background-color: ${(props) => props.theme.palette.action.hover};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&:focus {
|
|
182
|
+
outline: none;
|
|
183
|
+
box-shadow: 0 0 0 2px ${(props) => props.theme.palette.primary.main}40;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
svg {
|
|
187
|
+
width: 16px;
|
|
188
|
+
height: 16px;
|
|
189
|
+
}
|
|
190
|
+
`;
|
|
146
191
|
const Input = forwardRef((_a, ref) => {
|
|
147
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
148
|
-
|
|
192
|
+
var { className, password = false, clearable = false, onClear, width, value } = _a, props = __rest(_a, ["className", "password", "clearable", "onClear", "width", "value"]);
|
|
193
|
+
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
194
|
+
const hasButton = password || (clearable && value);
|
|
195
|
+
const handlePasswordToggle = (e) => {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
e.stopPropagation();
|
|
198
|
+
setPasswordVisible((prev) => !prev);
|
|
199
|
+
};
|
|
200
|
+
const handleClear = (e) => {
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
e.stopPropagation();
|
|
203
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
204
|
+
};
|
|
205
|
+
return (_jsxs(InputContainer, { className: className, width: width, children: [_jsx(StyledInput, Object.assign({ ref: ref, value: value, width: width, type: password && !passwordVisible ? "password" : "text", style: {
|
|
206
|
+
paddingRight: hasButton ? "36px" : undefined,
|
|
207
|
+
} }, props)), password ? (_jsx(InputButton, { onClick: handlePasswordToggle, onMouseDown: (e) => {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
e.stopPropagation();
|
|
210
|
+
}, type: "button", children: passwordVisible ? _jsx(Eye, {}) : _jsx(EyeOff, {}) })) : clearable && value ? (_jsx(InputButton, { onClick: handleClear, onMouseDown: (e) => {
|
|
211
|
+
e.preventDefault();
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
}, type: "button", children: _jsx(X, {}) })) : null] }));
|
|
149
214
|
});
|
|
215
|
+
Input.displayName = "Input";
|
|
150
216
|
export default Input;
|
|
@@ -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";
|
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";
|