@monolith-forensics/monolith-ui 1.2.122 → 1.3.1

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 (73) hide show
  1. package/dist/Button/Button.d.ts +25 -6
  2. package/dist/Button/Button.js +32 -85
  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.d.ts +10 -0
  57. package/dist/Tabs/Tab.js +69 -0
  58. package/dist/Tabs/Tabs.d.ts +13 -0
  59. package/dist/Tabs/Tabs.js +29 -0
  60. package/dist/Tabs/Tabs.types.d.ts +2 -0
  61. package/dist/Tabs/Tabs.types.js +1 -0
  62. package/dist/Tabs/TabsProvider.d.ts +24 -0
  63. package/dist/Tabs/TabsProvider.js +32 -0
  64. package/dist/Tabs/index.d.ts +2 -0
  65. package/dist/Tabs/index.js +2 -0
  66. package/dist/TextInput/TextInput.d.ts +3 -4
  67. package/dist/TextInput/TextInput.js +1 -2
  68. package/dist/TextInput/index.d.ts +1 -1
  69. package/dist/TextInput/index.js +1 -1
  70. package/dist/index.d.ts +7 -9
  71. package/dist/index.js +7 -6
  72. package/dist/theme/variants.js +20 -0
  73. 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,30 @@ 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";
217
- switch (variant) {
218
- 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");
224
- 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");
230
- 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");
236
- case "outlined":
237
- return theme.palette.action.hover;
238
- case "text":
239
- return "transparent";
240
- 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
245
- : theme.palette.action.hover;
246
- default:
247
- return theme.palette.action.hover;
248
- }
249
- }};
250
-
251
- border: 1px solid
252
- ${({ theme, variant, color }) => {
253
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
+ }
254
207
  switch (variant) {
255
208
  case "contained":
256
- return "transparent";
209
+ return (resolvedColor || theme.palette.background.secondary) + "90";
257
210
  case "filled":
258
- return "transparent";
211
+ return (resolvedColor || theme.palette.background.secondary) + "90";
259
212
  case "light":
260
- return "transparent";
213
+ return (resolvedColor || theme.palette.background.secondary) + "70";
261
214
  case "outlined":
262
- return color
263
- ? colors[color] || theme.palette.divider
264
- : theme.palette.divider;
215
+ return (resolvedColor || theme.palette.action.hover) + "30";
265
216
  case "text":
266
217
  return "transparent";
267
218
  case "subtle":
268
- return "transparent";
219
+ return resolvedColor ? resolvedColor + "30" : "transparent";
269
220
  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;
221
+ return (resolvedColor || theme.palette.action.hover) + "30";
275
222
  }
276
223
  }};
224
+
277
225
  opacity: ${({ variant }) => (variant === "text" ? 0.8 : 1)};
278
226
  }
279
227
 
@@ -327,9 +275,8 @@ const StyledLoader = styled.span `
327
275
  }
328
276
  }
329
277
  `;
330
- const Button = forwardRef((props, ref) => {
278
+ export const Button = forwardRef((props, ref) => {
331
279
  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
280
  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
281
  return (_jsx(StyledButton, Object.assign({ ref: ref }, other, { children: href ? (_jsx(StyledAnchor, { href: href, download: download, children: buttonContent })) : (buttonContent) })));
334
282
  });
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";