@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.
- package/dist/Button/Button.d.ts +25 -6
- package/dist/Button/Button.js +32 -85
- package/dist/Button/index.d.ts +1 -2
- package/dist/Button/index.js +1 -1
- package/dist/DropDownMenu/components/MenuItem.d.ts +38 -4
- package/dist/DropDownMenu/components/MenuItem.js +5 -2
- package/dist/FileViewer/FileViewer.js +1 -1
- package/dist/FormSection/FormSection.d.ts +3 -4
- package/dist/FormSection/FormSection.js +1 -2
- package/dist/FormSection/index.d.ts +1 -1
- package/dist/FormSection/index.js +1 -1
- package/dist/Grid/Grid.d.ts +8 -4
- package/dist/Grid/Grid.js +1 -2
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Grid/index.js +1 -1
- package/dist/IconButton/IconButton.d.ts +18 -1
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +8 -0
- package/dist/QueryFilter/QueryFilter.js +1 -1
- package/dist/RichTextEditor/Components/BubbleMenu.d.ts +1 -1
- package/dist/RichTextEditor/Components/BubbleMenu.js +2 -2
- package/dist/RichTextEditor/Enums/Controls.d.ts +1 -2
- package/dist/RichTextEditor/Enums/Controls.js +1 -2
- package/dist/RichTextEditor/Enums/Extensions.d.ts +1 -2
- package/dist/RichTextEditor/Enums/Extensions.js +1 -2
- package/dist/RichTextEditor/Enums/SlashCommands.d.ts +1 -2
- package/dist/RichTextEditor/Enums/SlashCommands.js +1 -2
- package/dist/RichTextEditor/Enums/index.d.ts +3 -0
- package/dist/RichTextEditor/Enums/index.js +3 -0
- package/dist/RichTextEditor/Extensions/getSlashCommand.d.ts +1 -1
- package/dist/RichTextEditor/Extensions/getSlashCommand.js +1 -1
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.d.ts +2 -2
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +2 -2
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +5 -6
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +1 -2
- package/dist/RichTextEditor/Plugins/index.d.ts +1 -0
- package/dist/RichTextEditor/Plugins/index.js +1 -0
- package/dist/RichTextEditor/RichTextEditor.d.ts +4 -4
- package/dist/RichTextEditor/RichTextEditor.js +5 -6
- package/dist/RichTextEditor/Toolbar/Control.d.ts +3 -4
- package/dist/RichTextEditor/Toolbar/Control.js +1 -3
- package/dist/RichTextEditor/Toolbar/Controls.js +1 -1
- package/dist/RichTextEditor/Toolbar/Toolbar.d.ts +6 -7
- package/dist/RichTextEditor/Toolbar/Toolbar.js +3 -4
- package/dist/RichTextEditor/Toolbar/index.d.ts +1 -1
- package/dist/RichTextEditor/Toolbar/index.js +1 -1
- package/dist/RichTextEditor/index.d.ts +4 -6
- package/dist/RichTextEditor/index.js +4 -4
- package/dist/SelectBox/SelectBox.d.ts +1 -2
- package/dist/SelectBox/SelectBox.js +9 -10
- package/dist/SelectBox/index.d.ts +1 -1
- package/dist/SelectBox/index.js +1 -1
- package/dist/SelectBox/types.d.ts +2 -2
- package/dist/Table/ActionButton.d.ts +18 -1
- package/dist/Table/ActionButton.js +1 -1
- package/dist/Table/TableMenu/TableMenu.js +2 -2
- package/dist/Tabs/Tab.d.ts +10 -0
- package/dist/Tabs/Tab.js +69 -0
- package/dist/Tabs/Tabs.d.ts +13 -0
- package/dist/Tabs/Tabs.js +29 -0
- package/dist/Tabs/Tabs.types.d.ts +2 -0
- package/dist/Tabs/Tabs.types.js +1 -0
- package/dist/Tabs/TabsProvider.d.ts +24 -0
- package/dist/Tabs/TabsProvider.js +32 -0
- package/dist/Tabs/index.d.ts +2 -0
- package/dist/Tabs/index.js +2 -0
- package/dist/TextInput/TextInput.d.ts +3 -4
- package/dist/TextInput/TextInput.js +1 -2
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/index.d.ts +7 -9
- package/dist/index.js +7 -6
- package/dist/theme/variants.js +20 -0
- package/package.json +1 -1
package/dist/Button/Button.d.ts
CHANGED
|
@@ -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
|
-
|
|
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?:
|
|
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:
|
|
21
|
-
export
|
|
38
|
+
};
|
|
39
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
40
|
+
export {};
|
package/dist/Button/Button.js
CHANGED
|
@@ -102,49 +102,36 @@ const StyledButton = styled.button `
|
|
|
102
102
|
return "white";
|
|
103
103
|
if (variant === "filled")
|
|
104
104
|
return "white";
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
|
121
|
-
|
|
122
|
-
|
|
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
|
|
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
|
|
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 (
|
|
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
|
|
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.
|
|
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.
|
|
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 "
|
|
209
|
+
return (resolvedColor || theme.palette.background.secondary) + "90";
|
|
257
210
|
case "filled":
|
|
258
|
-
return "
|
|
211
|
+
return (resolvedColor || theme.palette.background.secondary) + "90";
|
|
259
212
|
case "light":
|
|
260
|
-
return "
|
|
213
|
+
return (resolvedColor || theme.palette.background.secondary) + "70";
|
|
261
214
|
case "outlined":
|
|
262
|
-
return
|
|
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
|
|
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;
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type { ButtonProps } from "./Button";
|
|
1
|
+
export * from "./Button";
|
package/dist/Button/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./Button";
|
|
@@ -1,7 +1,41 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
1
2
|
import { MenuProps } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
}
|
|
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
|
-
}
|
|
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([
|
|
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
|
-
|
|
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
|
|
1
|
+
export * from "./FormSection";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./FormSection";
|
package/dist/Grid/Grid.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
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<
|
|
8
|
-
|
|
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;
|
package/dist/Grid/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./Grid";
|
package/dist/Grid/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
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<
|
|
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,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
|
|
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
|
-
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Extension } from "@tiptap/core";
|
|
2
2
|
import { HandleImageUpload } from "../Plugins/UploadImagesPlugin.js";
|
|
3
|
-
import SlashCommands from "../Enums
|
|
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
|
|
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
|
|
3
|
-
import Extensions from "../Enums
|
|
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
|
|
15
|
+
import { UploadImagesPlugin } from "../Plugins";
|
|
16
16
|
import getSlashCommand from "./getSlashCommand";
|
|
17
|
-
import Extensions from "../Enums
|
|
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
|
-
|
|
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
|
|
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";
|