@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
@@ -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";
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from "react";
2
+ export declare const Tab: React.FC<{
3
+ value: string | number;
4
+ children: ReactNode;
5
+ style?: React.CSSProperties;
6
+ onClick?: () => void;
7
+ disabled?: boolean;
8
+ leftSection?: React.ReactNode;
9
+ rightSection?: React.ReactNode;
10
+ }>;
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styled, { css } from "styled-components";
3
+ import { Button } from "../Button";
4
+ import { useTabs } from "./TabsProvider";
5
+ const StyledTabButton = styled(Button) `
6
+ user-select: none;
7
+ cursor: pointer;
8
+
9
+ border: none;
10
+ border-radius: 0;
11
+
12
+ color: ${({ theme }) => theme.palette.text.secondary};
13
+ font-weight: 500;
14
+
15
+ ${({ orientation }) => orientation === "horizontal" &&
16
+ css `
17
+ border-bottom: 2px solid transparent;
18
+ border-top-left-radius: 5px;
19
+ border-top-right-radius: 5px;
20
+
21
+ &:hover {
22
+ border-top: 0;
23
+ border-left: 0;
24
+ border-right: 0;
25
+ border-bottom: 2px solid transparent;
26
+
27
+ background-color: ${({ theme }) => theme.palette.action.hover};
28
+ }
29
+
30
+ &[data-active="true"] {
31
+ border-bottom-color: ${({ theme }) => theme.palette.primary.main};
32
+ color: ${({ theme }) => theme.palette.primary.main};
33
+ }
34
+ `}
35
+
36
+ ${({ orientation }) => orientation === "vertical" &&
37
+ css `
38
+ width: auto;
39
+ border-right: 2px solid transparent;
40
+ border-bottom-left-radius: 5px;
41
+ border-top-left-radius: 5px;
42
+
43
+ .inner-span {
44
+ justify-content: flex-start !important;
45
+ }
46
+
47
+ &:hover {
48
+ border-top: 0;
49
+ border-left: 0;
50
+ border-bottom: 0;
51
+ border-right: 2px solid transparent;
52
+
53
+ background-color: ${({ theme }) => theme.palette.action.hover};
54
+ }
55
+
56
+ &[data-active="true"] {
57
+ border-right-color: ${({ theme }) => theme.palette.primary.main};
58
+ color: ${({ theme }) => theme.palette.primary.main};
59
+ }
60
+ `}
61
+ `;
62
+ export const Tab = ({ children, style, onClick, disabled, leftSection, rightSection, value, }) => {
63
+ const { size, value: activeValue, onChange, orientation } = useTabs();
64
+ const isActive = activeValue === value;
65
+ return (_jsx(StyledTabButton, { className: "tab-button", style: style, "data-active": isActive, onClick: () => {
66
+ onClick === null || onClick === void 0 ? void 0 : onClick();
67
+ onChange(value);
68
+ }, size: size, disabled: disabled, leftSection: leftSection, rightSection: rightSection, orientation: orientation, children: children }));
69
+ };
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from "react";
2
+ import { Size } from "../core";
3
+ import { Justify, Orientation } from "./Tabs.types";
4
+ export declare const Tabs: React.FC<{
5
+ defaultValue?: string | number;
6
+ value?: string | number;
7
+ onChange?: (value: string | number) => void;
8
+ children: ReactNode;
9
+ size?: Size;
10
+ showDivider?: boolean;
11
+ justify?: Justify;
12
+ orientation?: Orientation;
13
+ }>;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styled, { css } from "styled-components";
3
+ import { TabsProvider } from "./TabsProvider";
4
+ const StyledContainer = styled.div `
5
+ user-select: none;
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ justify-content: ${({ justify }) => justify};
9
+
10
+ ${({ orientation, $showDivider, theme }) => orientation === "vertical"
11
+ ? css `
12
+ flex-direction: column;
13
+ border-right: ${$showDivider
14
+ ? "1px solid " + theme.palette.divider
15
+ : "transparent"};
16
+ width: max-content;
17
+ `
18
+ : css `
19
+ flex-direction: row;
20
+ border-bottom: ${$showDivider
21
+ ? "1px solid " + theme.palette.divider
22
+ : "transparent"};
23
+ `}
24
+
25
+ color: ${({ theme }) => theme.palette.text.secondary};
26
+ `;
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 }) }));
29
+ };
@@ -0,0 +1,2 @@
1
+ export type Justify = "start" | "center" | "end" | "space-between" | "space-around";
2
+ export type Orientation = "horizontal" | "vertical";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import { Size } from "../core";
2
+ import { Orientation } from "./Tabs.types";
3
+ export declare const TabsContext: import("react").Context<{
4
+ value: string | number;
5
+ defaultValue?: string | number;
6
+ onChange: (value: string | number) => void;
7
+ size?: Size;
8
+ orientation?: Orientation;
9
+ }>;
10
+ export declare const TabsProvider: React.FC<{
11
+ children: React.ReactNode;
12
+ size?: Size;
13
+ value?: string | number;
14
+ defaultValue?: string | number;
15
+ onChange?: (value: string | number) => void;
16
+ orientation?: Orientation;
17
+ }>;
18
+ export declare const useTabs: () => {
19
+ value: string | number;
20
+ defaultValue?: string | number;
21
+ onChange: (value: string | number) => void;
22
+ size?: Size;
23
+ orientation?: Orientation;
24
+ };
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from "react";
3
+ import { useUncontrolled } from "@mantine/hooks";
4
+ export const TabsContext = createContext({
5
+ value: "",
6
+ defaultValue: "",
7
+ onChange: () => { },
8
+ size: "sm",
9
+ orientation: "horizontal",
10
+ });
11
+ export const TabsProvider = ({ children, size, value, defaultValue, onChange, orientation }) => {
12
+ const [_value, handleChange] = useUncontrolled({
13
+ value,
14
+ defaultValue,
15
+ finalValue: "Final",
16
+ onChange,
17
+ });
18
+ return (_jsx(TabsContext.Provider, { value: {
19
+ value: _value,
20
+ onChange: handleChange,
21
+ size,
22
+ defaultValue,
23
+ orientation,
24
+ }, children: children }));
25
+ };
26
+ export const useTabs = () => {
27
+ const context = useContext(TabsContext);
28
+ if (!context) {
29
+ throw new Error("useTabs must be used within a TabsProvider");
30
+ }
31
+ return context;
32
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./Tabs";
2
+ export * from "./Tab";
@@ -0,0 +1,2 @@
1
+ export * from "./Tabs";
2
+ export * from "./Tab";
@@ -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";
@@ -40,3 +37,4 @@ export * from "./MonolithUIProvider";
40
37
  export * from "./FileViewer";
41
38
  export * from "./Table";
42
39
  export type { ColumnProps, TableProps } from "./Table";
40
+ export * from "./Tabs";
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,10 +21,11 @@ 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";
28
28
  export * from "./MonolithUIProvider";
29
29
  export * from "./FileViewer";
30
30
  export * from "./Table";
31
+ export * from "./Tabs";
@@ -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;