@monolith-forensics/monolith-ui 1.1.48 → 1.1.49

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/Grid/Grid.js CHANGED
@@ -5,7 +5,8 @@ const Grid = styled(({ className, children }) => {
5
5
  }) `
6
6
  display: grid;
7
7
  grid-template-columns: repeat(${({ col }) => col || 1}, minmax(0, 1fr));
8
- gap: 20px;
8
+ column-gap: 20px;
9
+ row-gap: 15px;
9
10
 
10
11
  width: ${({ width }) => Number.isInteger(width) ? `${width}px` : width || "100%"};
11
12
  height: auto;
@@ -10,5 +10,6 @@ declare const Modal: {
10
10
  ({ children, open, onClose, style, showCloseButton, FocusProps, }: ModalProps): import("react/jsx-runtime").JSX.Element;
11
11
  Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
12
12
  SubTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
13
+ Content: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
13
14
  };
14
15
  export default Modal;
@@ -70,11 +70,20 @@ const StyledClose = styled.div `
70
70
  color: ${(props) => props.theme.palette.text.secondary};
71
71
  `;
72
72
  const StyledButton = styled.button `
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ color: ${(props) => props.theme.palette.text.secondary};
73
77
  background-color: transparent;
78
+ border-radius: 4px;
74
79
  border: none;
75
80
  outline: none;
76
81
  cursor: pointer;
77
- padding: 0;
82
+ padding: 2px;
83
+
84
+ &:hover {
85
+ background-color: ${(props) => props.theme.palette.action.hover};
86
+ }
78
87
  `;
79
88
  const Title = styled.h1 `
80
89
  font-size: 20px;
@@ -87,6 +96,11 @@ const SubTitle = styled.h2 `
87
96
  margin: 0px;
88
97
  color: ${(props) => props.theme.palette.text.secondary};
89
98
  `;
99
+ const ModalContent = styled.div `
100
+ display: flex;
101
+ flex-direction: column;
102
+ gap: 1rem;
103
+ `;
90
104
  const Modal = ({ children, open = false, onClose, style = {}, showCloseButton = false, FocusProps = {}, }) => {
91
105
  const { refs, floatingStyles, context } = useFloating({
92
106
  open,
@@ -103,4 +117,5 @@ const Modal = ({ children, open = false, onClose, style = {}, showCloseButton =
103
117
  };
104
118
  Modal.Title = Title;
105
119
  Modal.SubTitle = SubTitle;
120
+ Modal.Content = ModalContent;
106
121
  export default Modal;
@@ -166,7 +166,7 @@ const SelectBox = styled(({ className, data = [], placeholder = "Select...", arr
166
166
  .concat(customItems) // Add custom items to the list
167
167
  .filter((item) => {
168
168
  const itemValue = (isObjectArray ? item.label : item);
169
- return itemValue.toLowerCase().includes(searchValue.toLowerCase());
169
+ return itemValue === null || itemValue === void 0 ? void 0 : itemValue.toLowerCase().includes(searchValue.toLowerCase());
170
170
  })
171
171
  .sort((a, b) => {
172
172
  if (grouped) {
@@ -219,9 +219,9 @@ const SelectBox = styled(({ className, data = [], placeholder = "Select...", arr
219
219
  };
220
220
  const handleClear = (e) => {
221
221
  e.preventDefault();
222
- e.stopPropagation();
223
222
  if (inputRef.current)
224
223
  inputRef.current.value = "";
224
+ setIsOpen(false);
225
225
  handleChangeSelection(null);
226
226
  setSelected(null);
227
227
  setSearchValue("");
@@ -434,7 +434,10 @@ const SelectBox = styled(({ className, data = [], placeholder = "Select...", arr
434
434
  setDropDownHeight(bottomHeight);
435
435
  };
436
436
  }, [topHeight, bottomHeight, isOpen]);
437
- return (_jsxs("div", { className: className, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: refs.setReference, onMouseDown: () => setIsOpen(true), width: width, onKeyDown: handleKeyDown, "data-open": isOpen, children: [_jsx(Input, { ref: inputRef, onChange: debouncedHandleOnChange, onFocus: handleFocus, autoFocus: focused, placeholder: placeholder, size: size, readOnly: !searchable, "data-button-right": arrow || clearable }), clearable && (selected || !!((_h = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _h === void 0 ? void 0 : _h.value)) ? (_jsx(ClearButton, { className: "input-btn", onClick: handleClear })) : arrow ? (_jsx(ArrowButton, { onClick: (e) => {
437
+ return (_jsxs("div", { className: className, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: refs.setReference, onMouseDown: () => setIsOpen(true), width: width, onKeyDown: handleKeyDown, "data-open": isOpen, children: [_jsx(Input, { ref: inputRef, onChange: debouncedHandleOnChange, onFocus: handleFocus, autoFocus: focused, placeholder: placeholder, size: size, readOnly: !searchable, "data-button-right": arrow || clearable }), clearable && (selected || !!((_h = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _h === void 0 ? void 0 : _h.value)) ? (_jsx(ClearButton, { className: "input-btn", onClick: handleClear, onMouseDown: (e) => {
438
+ e.preventDefault();
439
+ e.stopPropagation();
440
+ } })) : arrow ? (_jsx(ArrowButton, { onClick: (e) => {
438
441
  e.preventDefault();
439
442
  // e.stopPropagation();
440
443
  }, onMouseDown: (e) => {
@@ -359,7 +359,6 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
359
359
  };
360
360
  const handleClear = (e) => {
361
361
  e.preventDefault();
362
- e.stopPropagation();
363
362
  if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)
364
363
  inputRef.current.value = "";
365
364
  onChange === null || onChange === void 0 ? void 0 : onChange([]);
@@ -551,7 +550,10 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
551
550
  }
552
551
  update();
553
552
  }, placeholder: placeholder, size: size, readOnly: !(searchable || allowCustomValue) }))] }) }), clearable &&
554
- (selectedItems.length > 0 || !!((_f = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _f === void 0 ? void 0 : _f.value)) ? (_jsx(ClearButton, { onClick: handleClear })) : arrow ? (_jsx(ArrowButton, { onClick: (e) => {
553
+ (selectedItems.length > 0 || !!((_f = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _f === void 0 ? void 0 : _f.value)) ? (_jsx(ClearButton, { onClick: handleClear, onMouseDown: (e) => {
554
+ e.preventDefault();
555
+ e.stopPropagation();
556
+ } })) : arrow ? (_jsx(ArrowButton, { onClick: (e) => {
555
557
  e.preventDefault();
556
558
  }, onMouseDown: (e) => {
557
559
  e.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.1.48",
3
+ "version": "1.1.49",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",