@monolith-forensics/monolith-ui 1.3.0 → 1.3.2

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.
Files changed (65) hide show
  1. package/dist/Button/Button.d.ts +25 -6
  2. package/dist/Button/Button.js +39 -84
  3. package/dist/Button/index.d.ts +1 -2
  4. package/dist/Button/index.js +1 -1
  5. package/dist/DropDownMenu/components/MenuItem.d.ts +38 -4
  6. package/dist/DropDownMenu/components/MenuItem.js +5 -2
  7. package/dist/FileViewer/FileViewer.js +1 -1
  8. package/dist/FormSection/FormSection.d.ts +3 -4
  9. package/dist/FormSection/FormSection.js +1 -2
  10. package/dist/FormSection/index.d.ts +1 -1
  11. package/dist/FormSection/index.js +1 -1
  12. package/dist/Grid/Grid.d.ts +8 -4
  13. package/dist/Grid/Grid.js +1 -2
  14. package/dist/Grid/index.d.ts +1 -1
  15. package/dist/Grid/index.js +1 -1
  16. package/dist/IconButton/IconButton.d.ts +18 -1
  17. package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +8 -0
  18. package/dist/QueryFilter/QueryFilter.js +1 -1
  19. package/dist/RichTextEditor/Components/BubbleMenu.d.ts +1 -1
  20. package/dist/RichTextEditor/Components/BubbleMenu.js +2 -2
  21. package/dist/RichTextEditor/Enums/Controls.d.ts +1 -2
  22. package/dist/RichTextEditor/Enums/Controls.js +1 -2
  23. package/dist/RichTextEditor/Enums/Extensions.d.ts +1 -2
  24. package/dist/RichTextEditor/Enums/Extensions.js +1 -2
  25. package/dist/RichTextEditor/Enums/SlashCommands.d.ts +1 -2
  26. package/dist/RichTextEditor/Enums/SlashCommands.js +1 -2
  27. package/dist/RichTextEditor/Enums/index.d.ts +3 -0
  28. package/dist/RichTextEditor/Enums/index.js +3 -0
  29. package/dist/RichTextEditor/Extensions/getSlashCommand.d.ts +1 -1
  30. package/dist/RichTextEditor/Extensions/getSlashCommand.js +1 -1
  31. package/dist/RichTextEditor/Extensions/getTiptapExtensions.d.ts +2 -2
  32. package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +2 -2
  33. package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +5 -6
  34. package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +1 -2
  35. package/dist/RichTextEditor/Plugins/index.d.ts +1 -0
  36. package/dist/RichTextEditor/Plugins/index.js +1 -0
  37. package/dist/RichTextEditor/RichTextEditor.d.ts +4 -4
  38. package/dist/RichTextEditor/RichTextEditor.js +5 -6
  39. package/dist/RichTextEditor/Toolbar/Control.d.ts +3 -4
  40. package/dist/RichTextEditor/Toolbar/Control.js +1 -3
  41. package/dist/RichTextEditor/Toolbar/Controls.js +1 -1
  42. package/dist/RichTextEditor/Toolbar/Toolbar.d.ts +6 -7
  43. package/dist/RichTextEditor/Toolbar/Toolbar.js +3 -4
  44. package/dist/RichTextEditor/Toolbar/index.d.ts +1 -1
  45. package/dist/RichTextEditor/Toolbar/index.js +1 -1
  46. package/dist/RichTextEditor/index.d.ts +4 -6
  47. package/dist/RichTextEditor/index.js +4 -4
  48. package/dist/SelectBox/SelectBox.d.ts +1 -2
  49. package/dist/SelectBox/SelectBox.js +9 -10
  50. package/dist/SelectBox/index.d.ts +1 -1
  51. package/dist/SelectBox/index.js +1 -1
  52. package/dist/SelectBox/types.d.ts +2 -2
  53. package/dist/Table/ActionButton.d.ts +18 -1
  54. package/dist/Table/ActionButton.js +1 -1
  55. package/dist/Table/TableMenu/TableMenu.js +2 -2
  56. package/dist/Tabs/Tab.js +1 -1
  57. package/dist/Tabs/Tabs.js +4 -4
  58. package/dist/TextInput/TextInput.d.ts +3 -4
  59. package/dist/TextInput/TextInput.js +1 -2
  60. package/dist/TextInput/index.d.ts +1 -1
  61. package/dist/TextInput/index.js +1 -1
  62. package/dist/index.d.ts +6 -9
  63. package/dist/index.js +6 -6
  64. package/dist/theme/variants.js +20 -0
  65. package/package.json +1 -1
@@ -1,6 +1,25 @@
1
- import { ButtonHTMLAttributes, ReactNode } from "react";
1
+ import { ButtonHTMLAttributes, ReactNode, RefObject } from "react";
2
2
  import { Size, Variant } from "../core";
3
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ import { MonolithDefaultTheme } from "../MonolithUIProvider";
4
+ declare const colors: {
5
+ gray: string;
6
+ red: string;
7
+ pink: string;
8
+ grape: string;
9
+ violet: string;
10
+ indigo: string;
11
+ cyan: string;
12
+ teal: string;
13
+ green: string;
14
+ lime: string;
15
+ yellow: string;
16
+ orange: string;
17
+ };
18
+ type ColorKeys = keyof typeof colors;
19
+ type MonolithColorPalette = keyof Pick<MonolithDefaultTheme["palette"], "primary" | "error" | "secondary">;
20
+ export type ButtonColor = ColorKeys | MonolithColorPalette;
21
+ export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
22
+ ref?: RefObject<HTMLButtonElement>;
4
23
  children?: ReactNode | string;
5
24
  className?: string;
6
25
  loading?: boolean;
@@ -11,11 +30,11 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
11
30
  fullWidth?: boolean;
12
31
  size?: Size;
13
32
  variant?: Variant;
14
- color?: string;
33
+ color?: ButtonColor;
15
34
  disabled?: boolean;
16
35
  selected?: boolean;
17
36
  justify?: "start" | "center" | "end";
18
37
  onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
19
- }
20
- declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
21
- export default Button;
38
+ };
39
+ export declare const Button: React.FC<ButtonProps>;
40
+ export {};
@@ -102,49 +102,36 @@ const StyledButton = styled.button `
102
102
  return "white";
103
103
  if (variant === "filled")
104
104
  return "white";
105
- switch (color) {
106
- case "primary":
107
- return theme.palette.primary.main;
108
- case undefined:
109
- return theme.palette.text.primary;
110
- default:
111
- return color
112
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a[color]) === null || _b === void 0 ? void 0 : _b.main) ||
113
- colors[color] ||
114
- theme.palette.text.primary
115
- : theme.palette.text.primary;
105
+ if (color) {
106
+ return (((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.button) === null || _a === void 0 ? void 0 : _a.background) === null || _b === void 0 ? void 0 : _b[color]) ||
107
+ colors[color] ||
108
+ theme.palette.text.primary);
116
109
  }
110
+ return theme.palette.text.primary;
117
111
  }};
118
112
 
119
113
  background-color: ${({ theme, variant, color, selected }) => {
120
- var _a, _b, _c, _d, _e, _f;
121
- if (variant === "default")
122
- return "transparent";
114
+ var _a, _b;
115
+ let resolvedColor = null;
116
+ if (color) {
117
+ resolvedColor =
118
+ ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.button) === null || _a === void 0 ? void 0 : _a.background) === null || _b === void 0 ? void 0 : _b[color]) || colors[color];
119
+ }
123
120
  switch (variant) {
121
+ case "default":
122
+ return theme.button.background.default;
124
123
  case "contained":
125
- return color
126
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a[color]) === null || _b === void 0 ? void 0 : _b.main) ||
127
- colors[color] ||
128
- theme.palette.background.secondary
129
- : theme.palette.background.secondary;
124
+ return resolvedColor || theme.button.background.secondary;
130
125
  case "filled":
131
- return color
132
- ? ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c[color]) === null || _d === void 0 ? void 0 : _d.main) ||
133
- colors[color] ||
134
- theme.palette.background.secondary
135
- : theme.palette.background.secondary;
126
+ return resolvedColor || theme.button.background.secondary;
136
127
  case "light":
137
- return ((color
138
- ? ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _e === void 0 ? void 0 : _e[color]) === null || _f === void 0 ? void 0 : _f.main) ||
139
- colors[color] ||
140
- theme.palette.background.secondary
141
- : theme.palette.background.secondary) + "30");
128
+ return (resolvedColor || theme.palette.background.secondary) + "30";
142
129
  case "outlined":
143
130
  return "transparent";
144
131
  case "text":
145
132
  return "transparent";
146
133
  case "subtle":
147
- return selected ? theme.palette.action.hover : "transparent";
134
+ return "transparent";
148
135
  default:
149
136
  return "transparent";
150
137
  }
@@ -163,7 +150,7 @@ const StyledButton = styled.button `
163
150
  return "transparent";
164
151
  case "outlined":
165
152
  return color
166
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a[color]) === null || _b === void 0 ? void 0 : _b.main) ||
153
+ ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.button) === null || _a === void 0 ? void 0 : _a.background) === null || _b === void 0 ? void 0 : _b[color]) ||
167
154
  colors[color] ||
168
155
  theme.palette.divider
169
156
  : theme.palette.divider;
@@ -173,7 +160,7 @@ const StyledButton = styled.button `
173
160
  return "transparent";
174
161
  default:
175
162
  return color
176
- ? ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c[color]) === null || _d === void 0 ? void 0 : _d.main) ||
163
+ ? ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.button) === null || _c === void 0 ? void 0 : _c.background) === null || _d === void 0 ? void 0 : _d[color]) ||
177
164
  colors[color] ||
178
165
  theme.palette.divider
179
166
  : theme.palette.divider;
@@ -211,69 +198,38 @@ const StyledButton = styled.button `
211
198
 
212
199
  &:hover {
213
200
  background-color: ${({ theme, variant, color }) => {
214
- var _a, _b, _c, _d, _e, _f, _g, _h;
215
- if (variant === "default")
216
- return "transparent";
201
+ var _a, _b;
202
+ let resolvedColor = null;
203
+ if (color) {
204
+ resolvedColor =
205
+ ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.button) === null || _a === void 0 ? void 0 : _a.background) === null || _b === void 0 ? void 0 : _b[color]) || colors[color];
206
+ }
217
207
  switch (variant) {
218
208
  case "contained":
219
- return ((color
220
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a[color]) === null || _b === void 0 ? void 0 : _b.main) ||
221
- colors[color] ||
222
- theme.palette.background.secondary
223
- : theme.palette.background.secondary) + "90");
209
+ return (resolvedColor || theme.palette.background.secondary) + "90";
224
210
  case "filled":
225
- return ((color
226
- ? ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c[color]) === null || _d === void 0 ? void 0 : _d.main) ||
227
- colors[color] ||
228
- theme.palette.background.secondary
229
- : theme.palette.background.secondary) + "90");
211
+ return (resolvedColor || theme.palette.background.secondary) + "90";
230
212
  case "light":
231
- return ((color
232
- ? ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _e === void 0 ? void 0 : _e[color]) === null || _f === void 0 ? void 0 : _f.main) ||
233
- colors[color] ||
234
- theme.palette.background.secondary
235
- : theme.palette.background.secondary) + "70");
213
+ return resolvedColor
214
+ ? resolvedColor + "70"
215
+ : theme.palette.action.hover;
236
216
  case "outlined":
237
- return theme.palette.action.hover;
217
+ return resolvedColor
218
+ ? resolvedColor + "30"
219
+ : theme.palette.action.hover;
238
220
  case "text":
239
221
  return "transparent";
240
222
  case "subtle":
241
- return color
242
- ? (((_h = (_g = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _g === void 0 ? void 0 : _g[color]) === null || _h === void 0 ? void 0 : _h.main) ||
243
- colors[color]) + "30" ||
244
- theme.palette.action.hover
223
+ return resolvedColor
224
+ ? resolvedColor + "30"
245
225
  : theme.palette.action.hover;
246
226
  default:
247
- return theme.palette.action.hover;
227
+ return resolvedColor
228
+ ? resolvedColor + "30"
229
+ : theme.palette.action.hover;
248
230
  }
249
231
  }};
250
232
 
251
- border: 1px solid
252
- ${({ theme, variant, color }) => {
253
- var _a, _b;
254
- switch (variant) {
255
- case "contained":
256
- return "transparent";
257
- case "filled":
258
- return "transparent";
259
- case "light":
260
- return "transparent";
261
- case "outlined":
262
- return color
263
- ? colors[color] || theme.palette.divider
264
- : theme.palette.divider;
265
- case "text":
266
- return "transparent";
267
- case "subtle":
268
- return "transparent";
269
- default:
270
- return color
271
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a[color]) === null || _b === void 0 ? void 0 : _b.main) ||
272
- colors[color] ||
273
- theme.palette.divider
274
- : theme.palette.divider;
275
- }
276
- }};
277
233
  opacity: ${({ variant }) => (variant === "text" ? 0.8 : 1)};
278
234
  }
279
235
 
@@ -327,9 +283,8 @@ const StyledLoader = styled.span `
327
283
  }
328
284
  }
329
285
  `;
330
- const Button = forwardRef((props, ref) => {
286
+ export const Button = forwardRef((props, ref) => {
331
287
  const { children, loading = false, leftSection = null, rightSection = null, href = null, download = null, justify = "center" } = props, other = __rest(props, ["children", "loading", "leftSection", "rightSection", "href", "download", "justify"]);
332
288
  const buttonContent = (_jsx("div", { className: "inner-span", style: { height: "100%", width: "100%", justifyContent: justify }, children: loading ? (_jsx(StyledLoader, { children: _jsx(Loader2Icon, {}) })) : (_jsxs(_Fragment, { children: [leftSection && _jsx("div", { "data-position": "left", children: leftSection }), _jsx("div", { className: "button-label", children: children }), rightSection && _jsx("div", { "data-position": "right", children: rightSection })] })) }));
333
289
  return (_jsx(StyledButton, Object.assign({ ref: ref }, other, { children: href ? (_jsx(StyledAnchor, { href: href, download: download, children: buttonContent })) : (buttonContent) })));
334
290
  });
335
- export default Button;
@@ -1,2 +1 @@
1
- export { default } from "./Button";
2
- export type { ButtonProps } from "./Button";
1
+ export * from "./Button";
@@ -1 +1 @@
1
- export { default } from "./Button";
1
+ export * from "./Button";
@@ -1,7 +1,41 @@
1
+ import { RefObject } from "react";
1
2
  import { MenuProps } from "../types";
2
- import { ButtonProps } from "../../Button";
3
- export declare const MenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<MenuProps & ButtonProps & {
3
+ export declare const MenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<MenuProps & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
4
+ ref?: RefObject<HTMLButtonElement>;
5
+ children?: import("react").ReactNode | string;
6
+ className?: string;
7
+ loading?: boolean;
8
+ leftSection?: import("react").ReactNode;
9
+ rightSection?: import("react").ReactNode;
10
+ href?: string | null;
11
+ download?: string | null;
12
+ fullWidth?: boolean;
13
+ size?: import("../../core").Size;
14
+ variant?: import("../../core").Variant;
15
+ color?: import("../../Button").ButtonColor;
16
+ disabled?: boolean;
17
+ selected?: boolean;
18
+ justify?: "start" | "center" | "end";
19
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
20
+ } & {
4
21
  multiselect?: boolean;
5
- } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<unknown>, never>> & string & Omit<import("react").ForwardRefExoticComponent<MenuProps & ButtonProps & {
22
+ }, "ref"> & import("react").RefAttributes<unknown>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<MenuProps & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
23
+ ref?: RefObject<HTMLButtonElement>;
24
+ children?: import("react").ReactNode | string;
25
+ className?: string;
26
+ loading?: boolean;
27
+ leftSection?: import("react").ReactNode;
28
+ rightSection?: import("react").ReactNode;
29
+ href?: string | null;
30
+ download?: string | null;
31
+ fullWidth?: boolean;
32
+ size?: import("../../core").Size;
33
+ variant?: import("../../core").Variant;
34
+ color?: import("../../Button").ButtonColor;
35
+ disabled?: boolean;
36
+ selected?: boolean;
37
+ justify?: "start" | "center" | "end";
38
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
39
+ } & {
6
40
  multiselect?: boolean;
7
- } & import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<unknown>>, keyof import("react").Component<any, {}, any>>;
41
+ }, "ref"> & import("react").RefAttributes<unknown>>, keyof import("react").Component<any, {}, any>>;
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { forwardRef, useContext } from "react";
14
14
  import styled from "styled-components";
15
- import Button from "../../Button";
15
+ import { Button } from "../../Button";
16
16
  import { useFloatingTree, useListItem, useMergeRefs } from "@floating-ui/react";
17
17
  import { MenuContext } from "./MenuContext";
18
18
  import Tooltip from "../../Tooltip";
@@ -22,7 +22,10 @@ export const MenuItem = styled(forwardRef((_a, forwardedRef) => {
22
22
  const item = useListItem({ label: disabled ? null : label });
23
23
  const tree = useFloatingTree();
24
24
  const isActive = item.index === menu.activeIndex;
25
- return (_jsx(Tooltip, { content: TooltipContent ? _jsx(TooltipContent, { data: itemData }) : null, side: "left", children: _jsx(Button, Object.assign({}, props, { ref: useMergeRefs([item.ref, forwardedRef]), type: "button", role: "menuitem", tabIndex: isActive ? 0 : -1, disabled: disabled, justify: "start" }, menu.getItemProps({
25
+ return (_jsx(Tooltip, { content: TooltipContent ? _jsx(TooltipContent, { data: itemData }) : null, side: "left", children: _jsx(Button, Object.assign({}, props, { ref: useMergeRefs([
26
+ item.ref,
27
+ forwardedRef,
28
+ ]), type: "button", role: "menuitem", tabIndex: isActive ? 0 : -1, disabled: disabled, justify: "start" }, menu.getItemProps({
26
29
  onClick(event) {
27
30
  var _a;
28
31
  (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
@@ -3,7 +3,7 @@ import styled from "styled-components";
3
3
  import { CodeViewer, ImageViewer, OfficeViewer, PdfViewer, VideoViewer, } from "./viewers";
4
4
  import { FloatingPortal } from "@floating-ui/react";
5
5
  import { DownloadIcon, XIcon, ZoomInIcon, ZoomOutIcon } from "lucide-react";
6
- import Button from "../Button";
6
+ import { Button } from "../Button";
7
7
  import { useState } from "react";
8
8
  import Loader from "../Loader";
9
9
  var ViewerTypes;
@@ -1,7 +1,7 @@
1
1
  import { LucideIcon } from "lucide-react";
2
2
  import { ReactNode } from "react";
3
3
  import { Size } from "../core";
4
- interface FormSectionProps {
4
+ export type FormSectionProps = {
5
5
  children?: ReactNode;
6
6
  className?: string;
7
7
  style?: React.CSSProperties;
@@ -13,6 +13,5 @@ interface FormSectionProps {
13
13
  size?: Size;
14
14
  icon?: LucideIcon;
15
15
  iconColor?: string;
16
- }
17
- declare const FormSection: ({ title, children, open, defaultOpen, onOpenChange, allowCollapse, size, style, icon: Icon, iconColor, }: FormSectionProps) => import("react/jsx-runtime").JSX.Element;
18
- export default FormSection;
16
+ };
17
+ export declare const FormSection: ({ title, children, open, defaultOpen, onOpenChange, allowCollapse, size, style, icon: Icon, iconColor, }: FormSectionProps) => import("react/jsx-runtime").JSX.Element;
@@ -72,7 +72,7 @@ const resolveIconSize = (size) => {
72
72
  return 18;
73
73
  }
74
74
  };
75
- const FormSection = ({ title, children, open, defaultOpen = true, onOpenChange, allowCollapse = true, size, style, icon: Icon, iconColor, }) => {
75
+ export const FormSection = ({ title, children, open, defaultOpen = true, onOpenChange, allowCollapse = true, size, style, icon: Icon, iconColor, }) => {
76
76
  const [_open, setOpen] = useState(defaultOpen);
77
77
  const openState = open !== null && open !== void 0 ? open : _open;
78
78
  return (_jsxs(StyledContainer, { className: "mfui-FormSection", size: size, style: style, children: [_jsxs("div", { className: "section-header", onClick: (e) => {
@@ -82,4 +82,3 @@ const FormSection = ({ title, children, open, defaultOpen = true, onOpenChange,
82
82
  }
83
83
  }, children: [Icon && _jsx(Icon, { size: resolveIconSize(size), color: iconColor }), _jsx("h3", { children: title }), _jsx("div", { className: "section-line" }), !!allowCollapse ? (_jsx(ChevronDownIcon, { size: 18, className: openState ? "open" : "" })) : ("")] }), _jsx("div", { className: "section-content", "data-open": openState, children: children })] }));
84
84
  };
85
- export default FormSection;
@@ -1 +1 @@
1
- export { default } from "./FormSection";
1
+ export * from "./FormSection";
@@ -1 +1 @@
1
- export { default } from "./FormSection";
1
+ export * from "./FormSection";
@@ -1,8 +1,12 @@
1
- interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
1
+ export type GridProps = React.HTMLAttributes<HTMLDivElement> & {
2
2
  className?: string;
3
3
  children: React.ReactNode;
4
4
  col?: number;
5
5
  width?: string | number;
6
- }
7
- declare const Grid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<GridProps, never>> & string & Omit<({ className, children }: GridProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
8
- export default Grid;
6
+ };
7
+ export declare const Grid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").HTMLAttributes<HTMLDivElement> & {
8
+ className?: string;
9
+ children: React.ReactNode;
10
+ col?: number;
11
+ width?: string | number;
12
+ }, never>> & string & Omit<({ className, children }: GridProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
package/dist/Grid/Grid.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
- const Grid = styled(({ className, children }) => {
3
+ export const Grid = styled(({ className, children }) => {
4
4
  return _jsx("div", { className: className, children: children });
5
5
  }) `
6
6
  display: grid;
@@ -11,4 +11,3 @@ const Grid = styled(({ className, children }) => {
11
11
  width: ${({ width }) => Number.isInteger(width) ? `${width}px` : width || "100%"};
12
12
  height: auto;
13
13
  `;
14
- export default Grid;
@@ -1 +1 @@
1
- export { default } from "./Grid";
1
+ export * from "./Grid";
@@ -1 +1 @@
1
- export { default } from "./Grid";
1
+ export * from "./Grid";
@@ -1,3 +1,20 @@
1
1
  import { ButtonProps } from "../Button/Button.js";
2
- declare const IconButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<ButtonProps & import("react").RefAttributes<HTMLButtonElement>, ButtonProps>> & string & Omit<import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
2
+ declare const IconButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
3
+ ref?: import("react").RefObject<HTMLButtonElement>;
4
+ children?: import("react").ReactNode | string;
5
+ className?: string;
6
+ loading?: boolean;
7
+ leftSection?: import("react").ReactNode;
8
+ rightSection?: import("react").ReactNode;
9
+ href?: string | null;
10
+ download?: string | null;
11
+ fullWidth?: boolean;
12
+ size?: import("../core").Size;
13
+ variant?: import("../core").Variant;
14
+ color?: import("..").ButtonColor;
15
+ disabled?: boolean;
16
+ selected?: boolean;
17
+ justify?: "start" | "center" | "end";
18
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
19
+ }, ButtonProps>> & string & Omit<import("react").FC<ButtonProps>, keyof import("react").Component<any, {}, any>>;
3
20
  export default IconButton;
@@ -127,6 +127,14 @@ export interface MonolithDefaultTheme {
127
127
  zIndex: {
128
128
  snackbar: number;
129
129
  };
130
+ button: {
131
+ background: {
132
+ default: string;
133
+ primary: string;
134
+ secondary: string;
135
+ error: string;
136
+ };
137
+ };
130
138
  }
131
139
  export interface MonolithUIContextType {
132
140
  theme: MonolithDefaultTheme;
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import styled, { useTheme } from "styled-components";
3
3
  import { XIcon } from "lucide-react";
4
4
  import DropDownMenu from "../DropDownMenu";
5
- import Button from "../Button";
5
+ import { Button } from "../Button";
6
6
  import { DefaultOperators } from "./DefaultOperators";
7
7
  import Input from "../Input";
8
8
  import DateInput from "../DateInput";
@@ -1,4 +1,4 @@
1
- import Extensions from "../Enums/Extensions";
1
+ import { Extensions } from "../Enums";
2
2
  import { DropDownItem, DropDownMenuProps } from "../../DropDownMenu";
3
3
  import { ReactElement } from "react";
4
4
  import { ButtonProps } from "../../Button";
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled, { useTheme } from "styled-components";
3
- import Extensions from "../Enums/Extensions";
3
+ import { Extensions } from "../Enums";
4
4
  import { BoldIcon, ItalicIcon, UnderlineIcon, CaseSensitiveIcon, ListIcon, ListOrderedIcon, StrikethroughIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, RemoveFormattingIcon, SquircleIcon, } from "lucide-react";
5
5
  import DropDownMenu from "../../DropDownMenu";
6
6
  import { FloatingPortal, useFloating } from "@floating-ui/react";
7
7
  import { useEffect, useRef } from "react";
8
- import Button from "../../Button";
8
+ import { Button } from "../../Button";
9
9
  import TextColors from "../Enums/TextColors";
10
10
  const getMenuItems = (editor, customMenuItems, theme) => {
11
11
  var _a, _b, _c, _d, _e, _f, _g;
@@ -1,4 +1,4 @@
1
- declare enum Controls {
1
+ export declare enum Controls {
2
2
  UNDO = "undo",
3
3
  REDO = "redo",
4
4
  BOLD = "bold",
@@ -18,4 +18,3 @@ declare enum Controls {
18
18
  FONT = "font",
19
19
  COLOR = "color"
20
20
  }
21
- export default Controls;
@@ -1,4 +1,4 @@
1
- var Controls;
1
+ export var Controls;
2
2
  (function (Controls) {
3
3
  Controls["UNDO"] = "undo";
4
4
  Controls["REDO"] = "redo";
@@ -19,4 +19,3 @@ var Controls;
19
19
  Controls["FONT"] = "font";
20
20
  Controls["COLOR"] = "color";
21
21
  })(Controls || (Controls = {}));
22
- export default Controls;
@@ -1,4 +1,4 @@
1
- declare enum Extensions {
1
+ export declare enum Extensions {
2
2
  ClearFormatting = "clearFormatting",
3
3
  HorizontalRule = "horizontalRule",
4
4
  Underline = "underline",
@@ -25,4 +25,3 @@ declare enum Extensions {
25
25
  SlashCommand = "slashCommand",
26
26
  BubbleMenu = "bubbleMenu"
27
27
  }
28
- export default Extensions;
@@ -1,4 +1,4 @@
1
- var Extensions;
1
+ export var Extensions;
2
2
  (function (Extensions) {
3
3
  Extensions["ClearFormatting"] = "clearFormatting";
4
4
  Extensions["HorizontalRule"] = "horizontalRule";
@@ -26,4 +26,3 @@ var Extensions;
26
26
  Extensions["SlashCommand"] = "slashCommand";
27
27
  Extensions["BubbleMenu"] = "bubbleMenu";
28
28
  })(Extensions || (Extensions = {}));
29
- export default Extensions;
@@ -1,4 +1,4 @@
1
- declare enum SlashCommands {
1
+ export declare enum SlashCommands {
2
2
  Text = "Text",
3
3
  Heading1 = "Heading 1",
4
4
  Heading2 = "Heading 2",
@@ -10,4 +10,3 @@ declare enum SlashCommands {
10
10
  CurrentTimestamp = "Current Timestamp",
11
11
  Image = "Image"
12
12
  }
13
- export default SlashCommands;
@@ -1,4 +1,4 @@
1
- var SlashCommands;
1
+ export var SlashCommands;
2
2
  (function (SlashCommands) {
3
3
  SlashCommands["Text"] = "Text";
4
4
  SlashCommands["Heading1"] = "Heading 1";
@@ -11,4 +11,3 @@ var SlashCommands;
11
11
  SlashCommands["CurrentTimestamp"] = "Current Timestamp";
12
12
  SlashCommands["Image"] = "Image";
13
13
  })(SlashCommands || (SlashCommands = {}));
14
- export default SlashCommands;
@@ -0,0 +1,3 @@
1
+ export * from "./Extensions";
2
+ export * from "./SlashCommands";
3
+ export * from "./Controls";
@@ -0,0 +1,3 @@
1
+ export * from "./Extensions";
2
+ export * from "./SlashCommands";
3
+ export * from "./Controls";
@@ -1,6 +1,6 @@
1
1
  import { Extension } from "@tiptap/core";
2
2
  import { HandleImageUpload } from "../Plugins/UploadImagesPlugin.js";
3
- import SlashCommands from "../Enums/SlashCommands";
3
+ import { SlashCommands } from "../Enums";
4
4
  type CommandName = keyof typeof SlashCommands;
5
5
  interface SlashCommandOptions {
6
6
  handleImageUpload?: HandleImageUpload;
@@ -15,7 +15,7 @@ import { Heading1, Heading2, Heading3, Heading4, List, ListOrdered, Text, Image
15
15
  import { startImageUpload, } from "../Plugins/UploadImagesPlugin.js";
16
16
  import { PluginKey } from "@tiptap/pm/state";
17
17
  import SlashCommandList from "./SlashCommandList";
18
- import SlashCommands from "../Enums/SlashCommands";
18
+ import { SlashCommands } from "../Enums";
19
19
  import moment from "moment/moment.js";
20
20
  const SlashCommandPluginKey = new PluginKey("slash-command");
21
21
  const getCommandItems = (values, options) => {
@@ -1,6 +1,6 @@
1
1
  import { Extension } from "@tiptap/core";
2
- import { HandleImageUpload } from "../Plugins/UploadImagesPlugin";
3
- import Extensions from "../Enums/Extensions";
2
+ import { HandleImageUpload } from "../Plugins";
3
+ import { Extensions } from "../Enums";
4
4
  import { BubbleMenuOptions } from "./BubbleMenuExtension";
5
5
  export type ExtensionType = (typeof Extensions)[keyof typeof Extensions];
6
6
  interface GetTipTapExtensionsProps {
@@ -12,9 +12,9 @@ import { Color } from "@tiptap/extension-color";
12
12
  import TextStyle from "@tiptap/extension-text-style";
13
13
  import { InputRule, Extension } from "@tiptap/core";
14
14
  import Focus from "@tiptap/extension-focus";
15
- import UploadImagesPlugin from "../Plugins/UploadImagesPlugin";
15
+ import { UploadImagesPlugin } from "../Plugins";
16
16
  import getSlashCommand from "./getSlashCommand";
17
- import Extensions from "../Enums/Extensions";
17
+ import { Extensions } from "../Enums";
18
18
  import BubbleMenu from "./BubbleMenuExtension";
19
19
  const CustomImage = TiptapImage.extend({
20
20
  // Add data-uuid attribute to image
@@ -1,16 +1,15 @@
1
1
  import { Plugin } from "@tiptap/pm/state";
2
2
  import { DecorationSet, EditorView } from "@tiptap/pm/view";
3
- interface HandleImageUploadProps {
3
+ export type HandleImageUploadProps = {
4
4
  file: File;
5
5
  name: string;
6
6
  id: string;
7
7
  md5: string;
8
8
  sha1: string;
9
9
  sha256: string;
10
- }
11
- export interface HandleImageUpload {
10
+ };
11
+ export type HandleImageUpload = {
12
12
  (props: HandleImageUploadProps): Promise<string> | undefined;
13
- }
13
+ };
14
14
  export declare const startImageUpload: (file: File, view: EditorView, pos: number, handleImageUpload: HandleImageUpload | undefined) => void;
15
- declare const UploadImagesPlugin: () => Plugin<DecorationSet>;
16
- export default UploadImagesPlugin;
15
+ export declare const UploadImagesPlugin: () => Plugin<DecorationSet>;
@@ -76,7 +76,7 @@ export const startImageUpload = (file, view, pos, handleImageUpload) => {
76
76
  });
77
77
  });
78
78
  };
79
- const UploadImagesPlugin = () => new Plugin({
79
+ export const UploadImagesPlugin = () => new Plugin({
80
80
  key: uploadKey,
81
81
  state: {
82
82
  init() {
@@ -111,4 +111,3 @@ const UploadImagesPlugin = () => new Plugin({
111
111
  },
112
112
  },
113
113
  });
114
- export default UploadImagesPlugin;
@@ -0,0 +1 @@
1
+ export * from "./UploadImagesPlugin";
@@ -0,0 +1 @@
1
+ export * from "./UploadImagesPlugin";
@@ -3,7 +3,7 @@ import { ExtensionType } from "./Extensions/getTiptapExtensions";
3
3
  import { HandleImageUpload } from "./Plugins/UploadImagesPlugin";
4
4
  import { BubbleMenuOptions } from "./Extensions/BubbleMenuExtension";
5
5
  import { ToolbarOptions } from "./Toolbar/Toolbar";
6
- interface RichTextEditorProps {
6
+ type RichTextEditorProps = {
7
7
  className?: string;
8
8
  editorInstanceRef?: React.RefObject<Editor>;
9
9
  extensions?: ExtensionType[];
@@ -21,6 +21,6 @@ interface RichTextEditorProps {
21
21
  toolbarOptions?: ToolbarOptions;
22
22
  autoFocus?: boolean;
23
23
  style?: React.CSSProperties;
24
- }
25
- declare const RichTextEditor: import("react").ForwardRefExoticComponent<RichTextEditorProps & import("react").RefAttributes<unknown>>;
26
- export default RichTextEditor;
24
+ };
25
+ export declare const RichTextEditor: React.FC<RichTextEditorProps>;
26
+ export {};
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useEffect, useState } from "react";
2
+ import { useEffect, useState } from "react";
3
3
  import styled from "styled-components";
4
4
  import { EditorContent, useEditor } from "@tiptap/react";
5
- import Toolbar from "./Toolbar";
5
+ import { Toolbar } from "./Toolbar";
6
6
  import getTipTapExtensions from "./Extensions/getTiptapExtensions";
7
- import Extensions from "./Enums/Extensions";
7
+ import { Extensions } from "./Enums";
8
8
  import { startImageUpload, } from "./Plugins/UploadImagesPlugin";
9
9
  import SaveBadge from "./Components/SaveBadge";
10
10
  import Fonts from "./Enums/Fonts";
@@ -278,7 +278,7 @@ const StyledContent = styled.div `
278
278
  margin: 0 0.125rem;
279
279
  }
280
280
  `;
281
- const RichTextEditor = forwardRef(({ className, editorInstanceRef, defaultValue = "", value = "", readOnly = false, font, showToolbar = true, saving = false, extensions = [], slashCommands = [], bubbleMenuOptions, toolbarOptions, autoFocus, onChange, handleImageUpload, style, }, ref) => {
281
+ export const RichTextEditor = ({ className, editorInstanceRef, defaultValue = "", value = "", readOnly = false, font, showToolbar = true, saving = false, extensions = [], slashCommands = [], bubbleMenuOptions, toolbarOptions, autoFocus, onChange, handleImageUpload, style, }) => {
282
282
  const [fontState, setFontState] = useState(font || Fonts.DEFAULT);
283
283
  // check if image extension is included
284
284
  if (extensions === null || extensions === void 0 ? void 0 : extensions.includes(Extensions.Image)) {
@@ -359,5 +359,4 @@ const RichTextEditor = forwardRef(({ className, editorInstanceRef, defaultValue
359
359
  font: fontState,
360
360
  setFont: setFontState,
361
361
  }, children: [showToolbar && (_jsx(Toolbar, { editor: editor, toolbarOptions: toolbarOptions })), saving && _jsx(SaveBadge, {}), _jsx(EditorContent, { className: "editor-content", editor: editor, "data-font": fontState || null, style: style })] }) }));
362
- });
363
- export default RichTextEditor;
362
+ };
@@ -1,5 +1,5 @@
1
1
  import { Editor } from "@tiptap/react";
2
- interface ControlProps {
2
+ export type ControlProps = {
3
3
  className?: string;
4
4
  editor: Editor | null;
5
5
  isActive?: any;
@@ -9,6 +9,5 @@ interface ControlProps {
9
9
  };
10
10
  label: string;
11
11
  icon: any;
12
- }
13
- declare const Control: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ControlProps, never>> & string & Omit<({ className, editor, isActive, operation, label, icon: Icon, }: ControlProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
14
- export default Control;
12
+ };
13
+ export declare const Control: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ControlProps, never>> & string & Omit<({ className, editor, isActive, operation, label, icon: Icon, }: ControlProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  import Labels from "./Labels";
4
- const Control = styled(({ className, editor, isActive, operation, label, icon: Icon, }) => {
4
+ export const Control = styled(({ className, editor, isActive, operation, label, icon: Icon, }) => {
5
5
  var _a;
6
6
  const _label = Labels[label];
7
7
  const active = (isActive === null || isActive === void 0 ? void 0 : isActive.name)
@@ -29,5 +29,3 @@ const Control = styled(({ className, editor, isActive, operation, label, icon: I
29
29
  color: ${({ theme }) => theme.palette.primary.main};
30
30
  }
31
31
  `;
32
- Control.displayName = "Control";
33
- export default Control;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { IconBold, IconItalic, IconUnderline, IconStrikethrough, IconH1, IconH2, IconH3, IconH4, IconList, IconListNumbers, IconAlignLeft, IconAlignRight, IconAlignCenter, IconAlignJustified, IconCornerUpLeft, IconCornerUpRight, } from "@tabler/icons-react";
3
- import Control from "./Control";
3
+ import { Control } from "./Control";
4
4
  export const UndoControl = ({ editor }) => {
5
5
  return (_jsx(Control, { editor: editor, label: "undoControlLabel", operation: {
6
6
  name: "undo",
@@ -1,5 +1,5 @@
1
1
  import { Editor } from "@tiptap/react";
2
- import Controls from "../Enums/Controls";
2
+ import { Controls } from "../Enums";
3
3
  import { DropDownMenuProps } from "../../DropDownMenu";
4
4
  import { ReactNode } from "react";
5
5
  import { ButtonProps } from "../../Button";
@@ -12,14 +12,13 @@ export type CustomItem = {
12
12
  type: "menu";
13
13
  options: DropDownMenuProps;
14
14
  };
15
- export interface ToolbarOptions {
15
+ export type ToolbarOptions = {
16
16
  controls?: Array<Controls | CustomItem>;
17
17
  customItems?: CustomItem[];
18
- }
19
- interface ToolbarProps {
18
+ };
19
+ export type ToolbarProps = {
20
20
  className?: string;
21
21
  editor: Editor | null;
22
22
  toolbarOptions?: ToolbarOptions;
23
- }
24
- declare const Toolbar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ToolbarProps, never>> & string & Omit<({ className, editor, toolbarOptions }: ToolbarProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
25
- export default Toolbar;
23
+ };
24
+ export declare const Toolbar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ToolbarProps, never>> & string & Omit<({ className, editor, toolbarOptions }: ToolbarProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled, { useTheme } from "styled-components";
3
3
  import ControlsGroup from "./ControlsGroup";
4
4
  import { UndoControl, RedoControl, BoldControl, ItalicControl, UnderlineControl, StrikeThroughControl, Heading1Control, Heading2Control, Heading3Control, Heading4Control, BulletListControl, OrderedListControl, AlignLeftControl, AlignCenterControl, AlignRightControl, AlignJustifiedControl, } from "./Controls";
5
- import Controls from "../Enums/Controls";
5
+ import { Controls } from "../Enums";
6
6
  import DropDownMenu from "../../DropDownMenu";
7
7
  import Fonts from "../Enums/Fonts";
8
8
  import { useContext } from "react";
9
9
  import RichTextEditorContext from "../Contexts/RichTextEditorContext";
10
- import Button from "../../Button";
10
+ import { Button } from "../../Button";
11
11
  import TextColors from "../Enums/TextColors";
12
12
  import { SquircleIcon } from "lucide-react";
13
- const Toolbar = styled(({ className, editor, toolbarOptions }) => {
13
+ export const Toolbar = styled(({ className, editor, toolbarOptions }) => {
14
14
  var _a;
15
15
  const theme = useTheme();
16
16
  const { controls } = toolbarOptions || {};
@@ -71,4 +71,3 @@ const Toolbar = styled(({ className, editor, toolbarOptions }) => {
71
71
  border-radius: 5px 5px 0 0;
72
72
  border: 1px solid transparent;
73
73
  `;
74
- export default Toolbar;
@@ -1 +1 @@
1
- export { default } from "./Toolbar";
1
+ export * from "./Toolbar";
@@ -1 +1 @@
1
- export { default } from "./Toolbar";
1
+ export * from "./Toolbar";
@@ -1,6 +1,4 @@
1
- export { default } from "./RichTextEditor";
2
- export { default as Extensions } from "./Enums/Extensions";
3
- export { default as SlashCommands } from "./Enums/SlashCommands";
4
- export { default as Controls } from "./Enums/Controls";
5
- export type { CustomItem } from "./Toolbar/Toolbar";
6
- export type { ToolbarOptions } from "./Toolbar/Toolbar";
1
+ export * from "./RichTextEditor";
2
+ export * from "./Plugins";
3
+ export * from "./Enums";
4
+ export * from "./Toolbar";
@@ -1,4 +1,4 @@
1
- export { default } from "./RichTextEditor";
2
- export { default as Extensions } from "./Enums/Extensions";
3
- export { default as SlashCommands } from "./Enums/SlashCommands";
4
- export { default as Controls } from "./Enums/Controls";
1
+ export * from "./RichTextEditor";
2
+ export * from "./Plugins";
3
+ export * from "./Enums";
4
+ export * from "./Toolbar";
@@ -2,5 +2,4 @@ import { SelectBoxProps } from "..";
2
2
  export declare const StyledInputContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
3
  width?: string | number | null;
4
4
  }>> & string;
5
- declare const SelectBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<SelectBoxProps, never>> & string & Omit<({ className, data, placeholder, arrow, onChange, onSearch, searchFn, onScroll, loading, defaultValue, value, onItemAdded, size, variant, width, allowCustomValue, searchable, clearable, label, description, required, error, openOnFocus, renderOption, actionComponent, focused, grouped, OptionTooltip, DropDownProps, debounceTime, sort, disabled, }: SelectBoxProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
6
- export default SelectBox;
5
+ export declare const SelectBox: React.FC<SelectBoxProps>;
@@ -202,7 +202,12 @@ const resolveValue = (value, data) => {
202
202
  }
203
203
  return value;
204
204
  };
205
- const SelectBox = styled(({ className, data = [], placeholder = "Select...", arrow = true, onChange, onSearch, searchFn, onScroll, loading, defaultValue, value, onItemAdded, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, label, description, required = false, error, openOnFocus = true, renderOption, actionComponent, focused, grouped, OptionTooltip, // Custom tooltip component for search menu items
205
+ const StyledContainer = styled.div `
206
+ position: relative;
207
+ cursor: pointer;
208
+ width: 100%;
209
+ `;
210
+ export const SelectBox = ({ className, data = [], placeholder = "Select...", arrow = true, onChange, onSearch, searchFn, onScroll, loading, defaultValue, value, onItemAdded, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, label, description, required = false, error, openOnFocus = true, renderOption, actionComponent, focused, grouped, OptionTooltip, // Custom tooltip component for search menu items
206
211
  DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
207
212
  var _a, _b, _c, _d, _e, _f, _g;
208
213
  const theme = useTheme();
@@ -456,8 +461,7 @@ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
456
461
  // get height between bottom of the floating container and the bottom of the viewport
457
462
  const bottomHeight = window.innerHeight - ((_f = referenceEl === null || referenceEl === void 0 ? void 0 : referenceEl.getBoundingClientRect()) === null || _f === void 0 ? void 0 : _f.bottom) - 10;
458
463
  // get height between top of the floating container and the top of the viewport
459
- const topHeight = (((_g = referenceEl === null || referenceEl === void 0 ? void 0 : referenceEl.getBoundingClientRect()) === null || _g === void 0 ? void 0 : _g.top) -
460
- 10);
464
+ const topHeight = (((_g = referenceEl === null || referenceEl === void 0 ? void 0 : referenceEl.getBoundingClientRect()) === null || _g === void 0 ? void 0 : _g.top) - 10);
461
465
  // Close on outside click
462
466
  useEffect(() => {
463
467
  const close = (e) => {
@@ -498,7 +502,7 @@ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
498
502
  setDropDownHeight(bottomHeight);
499
503
  };
500
504
  }, [topHeight, bottomHeight, isOpen]);
501
- 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, "data-disabled": disabled, children: [_jsx(Input, { ref: inputRef, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, autoFocus: focused, placeholder: placeholder, size: size, readOnly: !searchable && !allowCustomValue, "data-button-right": arrow || clearable, style: isOpen ? { borderColor: theme.palette.primary.main } : {} }), clearable && (_value || !!inputValue) ? (_jsx(ClearButton, { className: "input-btn", onClick: handleClear, onMouseDown: (e) => {
505
+ return (_jsxs(StyledContainer, { 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, "data-disabled": disabled, children: [_jsx(Input, { ref: inputRef, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, autoFocus: focused, placeholder: placeholder, size: size, readOnly: !searchable && !allowCustomValue, "data-button-right": arrow || clearable, style: isOpen ? { borderColor: theme.palette.primary.main } : {} }), clearable && (_value || !!inputValue) ? (_jsx(ClearButton, { className: "input-btn", onClick: handleClear, onMouseDown: (e) => {
502
506
  e.preventDefault();
503
507
  e.stopPropagation();
504
508
  } })) : arrow ? (_jsx(ArrowButton, { onClick: (e) => {
@@ -529,9 +533,4 @@ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
529
533
  : filteredItems.map((item, index) => {
530
534
  return (_jsx(Tooltip, { content: OptionTooltip ? (_jsx(OptionTooltip, { data: item.data })) : null, side: "left", children: _jsx(StyledItem, { className: "mfFloatingItem", onClick: (e) => handleItemClick(e, item), "data-selected": (_value === null || _value === void 0 ? void 0 : _value.value) === item.value, "data-disabled": item.disabled, size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || _jsx(_Fragment, { children: item === null || item === void 0 ? void 0 : item.label }) }, index) }, index));
531
535
  }) }))] })) }) }))] }));
532
- }) `
533
- position: relative;
534
- cursor: pointer;
535
- width: 100%;
536
- `;
537
- export default SelectBox;
536
+ };
@@ -1,2 +1,2 @@
1
- export { default } from "./SelectBox";
1
+ export * from "./SelectBox";
2
2
  export type { SelectBoxProps, Option } from "./types";
@@ -1 +1 @@
1
- export { default } from "./SelectBox";
1
+ export * from "./SelectBox";
@@ -7,7 +7,7 @@ export type Option = {
7
7
  data?: any;
8
8
  };
9
9
  export type Value = number | boolean | string | Option;
10
- export interface SelectBoxProps {
10
+ export type SelectBoxProps = {
11
11
  className?: string;
12
12
  defaultValue?: Option | string | number;
13
13
  value?: Option | string | number;
@@ -42,4 +42,4 @@ export interface SelectBoxProps {
42
42
  onSearch?: (value: string) => void;
43
43
  searchFn?: (value: string) => void;
44
44
  onItemAdded?: (item: Option | string) => void;
45
- }
45
+ };
@@ -1,2 +1,19 @@
1
- declare const ActionButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
1
+ declare const ActionButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
2
+ ref?: import("react").RefObject<HTMLButtonElement>;
3
+ children?: import("react").ReactNode | string;
4
+ className?: string;
5
+ loading?: boolean;
6
+ leftSection?: import("react").ReactNode;
7
+ rightSection?: import("react").ReactNode;
8
+ href?: string | null;
9
+ download?: string | null;
10
+ fullWidth?: boolean;
11
+ size?: import("../core").Size;
12
+ variant?: import("../core").Variant;
13
+ color?: import("../Button").ButtonColor;
14
+ disabled?: boolean;
15
+ selected?: boolean;
16
+ justify?: "start" | "center" | "end";
17
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
18
+ }, never>> & string & Omit<import("react").FC<import("../Button").ButtonProps>, keyof import("react").Component<any, {}, any>>;
2
19
  export default ActionButton;
@@ -1,5 +1,5 @@
1
1
  import styled from "styled-components";
2
- import Button from "../Button";
2
+ import { Button } from "../Button";
3
3
  const ActionButton = styled(Button) `
4
4
  padding: 2px;
5
5
  height: fit-content;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
- import Button from "../../Button";
4
- import TextInput from "../../TextInput";
3
+ import { Button } from "../../Button";
4
+ import { TextInput } from "../../TextInput";
5
5
  import { CheckSquareIcon, Columns3Icon, DownloadIcon, FilterIcon, Rows3Icon, Rows4Icon, } from "lucide-react";
6
6
  import DropDownMenu from "../../DropDownMenu";
7
7
  import useTable from "../useTable";
package/dist/Tabs/Tab.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styled, { css } from "styled-components";
3
- import Button from "../Button";
3
+ import { Button } from "../Button";
4
4
  import { useTabs } from "./TabsProvider";
5
5
  const StyledTabButton = styled(Button) `
6
6
  user-select: none;
package/dist/Tabs/Tabs.js CHANGED
@@ -7,17 +7,17 @@ const StyledContainer = styled.div `
7
7
  flex-wrap: wrap;
8
8
  justify-content: ${({ justify }) => justify};
9
9
 
10
- ${({ orientation, showDivider, theme }) => orientation === "vertical"
10
+ ${({ orientation, $showDivider, theme }) => orientation === "vertical"
11
11
  ? css `
12
12
  flex-direction: column;
13
- border-right: ${showDivider
13
+ border-right: ${$showDivider
14
14
  ? "1px solid " + theme.palette.divider
15
15
  : "transparent"};
16
16
  width: max-content;
17
17
  `
18
18
  : css `
19
19
  flex-direction: row;
20
- border-bottom: ${showDivider
20
+ border-bottom: ${$showDivider
21
21
  ? "1px solid " + theme.palette.divider
22
22
  : "transparent"};
23
23
  `}
@@ -25,5 +25,5 @@ const StyledContainer = styled.div `
25
25
  color: ${({ theme }) => theme.palette.text.secondary};
26
26
  `;
27
27
  export const Tabs = ({ children, size, showDivider = true, justify = "start", defaultValue, value, onChange, orientation = "horizontal", }) => {
28
- return (_jsx(TabsProvider, { size: size, value: value, defaultValue: defaultValue, onChange: onChange, orientation: orientation, children: _jsx(StyledContainer, { className: "tabs-container", size: size, showDivider: showDivider, justify: justify, orientation: orientation, children: children }) }));
28
+ return (_jsx(TabsProvider, { size: size, value: value, defaultValue: defaultValue, onChange: onChange, orientation: orientation, children: _jsx(StyledContainer, { className: "tabs-container", size: size, "$showDivider": showDivider, justify: justify, orientation: orientation, children: children }) }));
29
29
  };
@@ -1,6 +1,6 @@
1
1
  import { InputProps } from "../Input/Input";
2
2
  import { Size } from "../core";
3
- interface TextInputProps extends InputProps {
3
+ export type TextInputProps = InputProps & {
4
4
  className?: string;
5
5
  label?: string;
6
6
  error?: string;
@@ -10,6 +10,5 @@ interface TextInputProps extends InputProps {
10
10
  description?: string;
11
11
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
12
12
  style?: React.CSSProperties;
13
- }
14
- declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
15
- export default TextInput;
13
+ };
14
+ export declare const TextInput: React.FC<TextInputProps>;
@@ -17,8 +17,7 @@ import { forwardRef } from "react";
17
17
  const StyledContainer = styled.div `
18
18
  grid-column: span ${({ colSpan }) => colSpan || 1};
19
19
  `;
20
- const TextInput = forwardRef((_a, ref) => {
20
+ export const TextInput = forwardRef((_a, ref) => {
21
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
22
  return (_jsxs(StyledContainer, { className: className, colSpan: colSpan, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsx(Input, Object.assign({ ref: ref, size: size }, inputProps, rest))] }));
23
23
  });
24
- export default TextInput;
@@ -1 +1 @@
1
- export { default } from "./TextInput";
1
+ export * from "./TextInput";
@@ -1 +1 @@
1
- export { default } from "./TextInput";
1
+ export * from "./TextInput";
package/dist/index.d.ts CHANGED
@@ -3,13 +3,11 @@ declare module "styled-components" {
3
3
  interface DefaultTheme extends MonolithDefaultTheme {
4
4
  }
5
5
  }
6
- export { default as FormSection } from "./FormSection";
7
- export { default as Grid } from "./Grid";
8
- export { default as TextInput } from "./TextInput";
9
- export { default as SelectBox } from "./SelectBox";
10
- export type { SelectBoxProps, Option } from "./SelectBox";
11
- export { default as Button } from "./Button";
12
- export type { ButtonProps } from "./Button";
6
+ export * from "./FormSection";
7
+ export * from "./Grid";
8
+ export * from "./TextInput";
9
+ export * from "./SelectBox";
10
+ export * from "./Button";
13
11
  export { default as IconButton } from "./IconButton";
14
12
  export { default as DropDownMenu } from "./DropDownMenu";
15
13
  export type { DropDownItem } from "./DropDownMenu";
@@ -30,8 +28,7 @@ export { default as Tooltip } from "./Tooltip";
30
28
  export { default as Pill } from "./Pill";
31
29
  export { default as Calendar } from "./Calendar";
32
30
  export { default as Typography } from "./Typography";
33
- export { default as RichTextEditor, Extensions, SlashCommands, Controls, } from "./RichTextEditor";
34
- export type { CustomItem, ToolbarOptions } from "./RichTextEditor";
31
+ export * from "./RichTextEditor";
35
32
  export { default as Loader } from "./Loader";
36
33
  export type { LoaderProps } from "./Loader";
37
34
  export * from "./QueryFilter";
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { default as FormSection } from "./FormSection";
2
- export { default as Grid } from "./Grid";
3
- export { default as TextInput } from "./TextInput";
4
- export { default as SelectBox } from "./SelectBox";
5
- export { default as Button } from "./Button";
1
+ export * from "./FormSection";
2
+ export * from "./Grid";
3
+ export * from "./TextInput";
4
+ export * from "./SelectBox";
5
+ export * from "./Button";
6
6
  export { default as IconButton } from "./IconButton";
7
7
  export { default as DropDownMenu } from "./DropDownMenu";
8
8
  export { default as DateInput } from "./DateInput";
@@ -21,7 +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 RichTextEditor, Extensions, SlashCommands, Controls, } from "./RichTextEditor";
24
+ export * from "./RichTextEditor";
25
25
  export { default as Loader } from "./Loader";
26
26
  export * from "./QueryFilter";
27
27
  export * from "./hooks";
@@ -168,6 +168,14 @@ const lightVariant = {
168
168
  zIndex: {
169
169
  snackbar: 999999,
170
170
  },
171
+ button: {
172
+ background: {
173
+ default: "transparent",
174
+ primary: customBlue[500],
175
+ secondary: "#a1a1a1",
176
+ error: "#f44336",
177
+ },
178
+ },
171
179
  };
172
180
  const darkVariant = merge(lightVariant, {
173
181
  name: THEMES.DARK,
@@ -269,6 +277,18 @@ const darkVariant = merge(lightVariant, {
269
277
  primary: "#3f3f3f",
270
278
  secondary: "#252525",
271
279
  },
280
+ button: {
281
+ background: {
282
+ default: "transparent",
283
+ primary: customBlue[500],
284
+ secondary: "#3f3f3f",
285
+ error: "#f44336",
286
+ },
287
+ text: {
288
+ primary: "rgba(255, 255, 255, 0.95)",
289
+ secondary: "rgba(255, 255, 255, 0.6)",
290
+ },
291
+ },
272
292
  });
273
293
  const variants = [lightVariant, darkVariant];
274
294
  export default variants;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",