@monolith-forensics/monolith-ui 1.3.32 → 1.3.34

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.
@@ -0,0 +1,8 @@
1
+ export type AlertVariant = "info" | "success" | "warning" | "error" | "default";
2
+ export type AlertProps = {
3
+ children: React.ReactNode;
4
+ variant?: AlertVariant;
5
+ title?: string;
6
+ onClose?: () => void;
7
+ };
8
+ export declare const Alert: React.FC<AlertProps>;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertCircleIcon, AlertTriangleIcon, CheckIcon, InfoIcon, } from "lucide-react";
3
+ import styled from "styled-components";
4
+ const Icons = {
5
+ info: _jsx(InfoIcon, { size: 18 }),
6
+ success: _jsx(CheckIcon, { size: 18 }),
7
+ warning: _jsx(AlertCircleIcon, { size: 18 }),
8
+ error: _jsx(AlertTriangleIcon, { size: 18 }),
9
+ default: _jsx(InfoIcon, { size: 18 }),
10
+ };
11
+ const StyledContainer = styled.div `
12
+ display: flex;
13
+ gap: 10px;
14
+ padding: 15px;
15
+ border-radius: 4px;
16
+
17
+ border: 1px solid ${({ theme, variant }) => theme.alert[variant].border};
18
+ background-color: ${({ theme, variant }) => theme.alert[variant].background};
19
+ color: ${({ theme, variant }) => theme.alert[variant].color};
20
+ `;
21
+ const StyledTitle = styled.h3 `
22
+ font-size: 14px;
23
+ font-weight: bold;
24
+ margin: 0px;
25
+
26
+ color: ${({ theme, variant }) => { var _a; return (_a = theme.alert[variant]) === null || _a === void 0 ? void 0 : _a.color; }};
27
+ `;
28
+ const StyledContent = styled.div `
29
+ display: flex;
30
+ font-size: 13px;
31
+ font-weight: 400;
32
+ margin: 0px;
33
+
34
+ color: ${({ theme, variant }) => theme.palette.text.primary};
35
+ `;
36
+ const StyledContentContainer = styled.div `
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: 5px;
40
+ `;
41
+ const StyledHeader = styled.div `
42
+ display: flex;
43
+ justify-content: flex-start;
44
+ padding-top: 1px;
45
+ `;
46
+ export const Alert = ({ children, variant = "info", title, onClose, }) => {
47
+ return (_jsxs(StyledContainer, { variant: variant, children: [_jsx(StyledHeader, { children: Icons[variant] }), _jsxs(StyledContentContainer, { children: [title && _jsx(StyledTitle, { variant: variant, children: title }), _jsx(StyledContent, { variant: variant, children: children })] })] }));
48
+ };
@@ -0,0 +1 @@
1
+ export * from "./Alert";
@@ -0,0 +1 @@
1
+ export * from "./Alert";
@@ -143,6 +143,33 @@ export interface MonolithDefaultTheme {
143
143
  error: string;
144
144
  };
145
145
  };
146
+ alert: {
147
+ info: {
148
+ background: string;
149
+ border: string;
150
+ color: string;
151
+ };
152
+ success: {
153
+ background: string;
154
+ border: string;
155
+ color: string;
156
+ };
157
+ warning: {
158
+ background: string;
159
+ border: string;
160
+ color: string;
161
+ };
162
+ error: {
163
+ background: string;
164
+ border: string;
165
+ color: string;
166
+ };
167
+ default: {
168
+ background: string;
169
+ border: string;
170
+ color: string;
171
+ };
172
+ };
146
173
  }
147
174
  export interface MonolithUIContextType {
148
175
  theme: MonolithDefaultTheme;
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from "./SelectBox";
10
10
  export * from "./Button";
11
11
  export * from "./DropDownMenu";
12
12
  export * from "./Switch";
13
+ export * from "./Alert";
13
14
  export { default as IconButton } from "./IconButton";
14
15
  export { default as DateInput } from "./DateInput";
15
16
  export { default as TextArea } from "./TextArea";
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export * from "./SelectBox";
5
5
  export * from "./Button";
6
6
  export * from "./DropDownMenu";
7
7
  export * from "./Switch";
8
+ export * from "./Alert";
8
9
  export { default as IconButton } from "./IconButton";
9
10
  export { default as DateInput } from "./DateInput";
10
11
  export { default as TextArea } from "./TextArea";
@@ -184,6 +184,33 @@ const lightVariant = {
184
184
  alternate: "#000",
185
185
  },
186
186
  },
187
+ alert: {
188
+ info: {
189
+ background: "#3f88de25",
190
+ border: "#3f88de50",
191
+ color: "#357fff",
192
+ },
193
+ success: {
194
+ background: "#4bef2a25",
195
+ border: "#4bef2a90",
196
+ color: "#2eb333",
197
+ },
198
+ warning: {
199
+ background: "#eaa82425",
200
+ border: "#eaa82450",
201
+ color: "#d18f0b",
202
+ },
203
+ error: {
204
+ background: "#ee1d1d25",
205
+ border: "#ee1d1d50",
206
+ color: "#e41a1a",
207
+ },
208
+ default: {
209
+ background: "#fff",
210
+ border: "#cacaca",
211
+ color: "#000000",
212
+ },
213
+ },
187
214
  };
188
215
  const darkVariant = merge(lightVariant, {
189
216
  name: THEMES.DARK,
@@ -300,6 +327,33 @@ const darkVariant = merge(lightVariant, {
300
327
  alternate: "rgba(255, 255, 255, 0.6)",
301
328
  },
302
329
  },
330
+ alert: {
331
+ info: {
332
+ background: "#3f88de25",
333
+ border: "#3f88de50",
334
+ color: "#75a8ff",
335
+ },
336
+ success: {
337
+ background: "#4bef2a25",
338
+ border: "#4bef2a50",
339
+ color: "#5fd964",
340
+ },
341
+ warning: {
342
+ background: "#eaa82425",
343
+ border: "#eaa82450",
344
+ color: "#da9c21",
345
+ },
346
+ error: {
347
+ background: "#ee1d1d25",
348
+ border: "#ee1d1d50",
349
+ color: "#e41a1a",
350
+ },
351
+ default: {
352
+ background: "#222222",
353
+ border: "rgba(255, 255, 255, 0.15)",
354
+ color: "#ffffff99",
355
+ },
356
+ },
303
357
  });
304
358
  const variants = [lightVariant, darkVariant];
305
359
  export default variants;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.3.32",
3
+ "version": "1.3.34",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",