@monolith-forensics/monolith-ui 1.1.31 → 1.1.33

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.
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FloatingFocusManager, FloatingOverlay, FloatingPortal, useFloating, } from "@floating-ui/react";
3
3
  import { XIcon } from "lucide-react";
4
4
  import styled from "styled-components";
5
+ import { Themes } from "../theme";
5
6
  const ANIMATION_TIME = 300;
6
7
  const StyledOverlay = styled(FloatingOverlay) `
7
8
  background-color: rgba(0, 0, 0, 0.3);
@@ -39,7 +40,7 @@ const StyledButton = styled.button `
39
40
  }
40
41
  `;
41
42
  const StyledContent = styled.div `
42
- background-color: ${({ theme }) => theme.name === "DARK"
43
+ background-color: ${({ theme }) => theme.name === Themes.DARK
43
44
  ? theme.palette.background.alt
44
45
  : theme.palette.background.default};
45
46
  border-radius: 6px;
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  import { X } from "lucide-react";
4
4
  import { FloatingFocusManager, FloatingOverlay, FloatingPortal, useFloating, } from "@floating-ui/react";
5
+ import { Themes } from "../theme";
5
6
  const StyledOverlay = styled(FloatingOverlay) `
6
7
  background-color: rgba(0, 0, 0, 0.3);
7
8
  position: fixed;
@@ -18,7 +19,7 @@ const StyledOverlay = styled(FloatingOverlay) `
18
19
  }
19
20
  `;
20
21
  const StyledContent = styled.div `
21
- background-color: ${({ theme }) => theme.name === "DARK"
22
+ background-color: ${({ theme }) => theme.name === Themes.DARK
22
23
  ? theme.palette.background.default
23
24
  : theme.palette.background.default};
24
25
  border-radius: 6px;
@@ -1,20 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import merge from "deepmerge";
3
3
  import { ThemeProvider } from "styled-components";
4
- import getTheme from "../theme";
4
+ import getTheme, { Themes } from "../theme";
5
5
  import { createContext, useState } from "react";
6
6
  import GlobalStyle from "./GlobalStyle";
7
7
  export const MonolithUIContext = createContext(undefined);
8
- const MonolithUIProvider = ({ children, theme = {}, defaultColorScheme = "dark", }) => {
8
+ const MonolithUIProvider = ({ children, theme = {}, defaultColorScheme = "DARK", }) => {
9
9
  const [colorScheme, setColorScheme] = useState(defaultColorScheme);
10
10
  const toggleColorScheme = () => {
11
- setColorScheme(colorScheme === "light" ? "dark" : "light");
11
+ setColorScheme(colorScheme === "LIGHT" ? "DARK" : "LIGHT");
12
12
  };
13
13
  const defaultTheme = getTheme(colorScheme);
14
14
  // override default theme with the provided theme
15
15
  const _theme = merge(defaultTheme, theme);
16
16
  return (_jsx(MonolithUIContext.Provider, { value: {
17
17
  theme: _theme,
18
+ Themes,
18
19
  colorScheme,
19
20
  toggleColorScheme,
20
21
  setColorScheme,
@@ -13,6 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import styled from "styled-components";
14
14
  import * as RadixSwitch from "@radix-ui/react-switch";
15
15
  import { FieldLabel } from "..";
16
+ import { Themes } from "../theme";
16
17
  const StyledRoot = styled(RadixSwitch.Root) `
17
18
  all: unset;
18
19
  cursor: pointer;
@@ -41,11 +42,11 @@ const StyledRoot = styled(RadixSwitch.Root) `
41
42
  ? "70px"
42
43
  : "26px"};
43
44
 
44
- background-color: ${({ theme }) => theme.name === "DARK" ? "#383838" : "#e3e3e3"};
45
+ background-color: ${({ theme }) => theme.name === Themes.DARK ? "#383838" : "#e3e3e3"};
45
46
  transition: background-color 100ms;
46
47
  border-radius: 9999px;
47
48
  border: 1px solid
48
- ${({ theme }) => theme.name === "DARK" ? theme.palette.input.border : "#e3e3e3"};
49
+ ${({ theme }) => theme.name === Themes.DARK ? theme.palette.input.border : "#e3e3e3"};
49
50
  position: relative;
50
51
  padding: ${({ size }) => size === "xs"
51
52
  ? "2px"
@@ -21,8 +21,9 @@ import { Maximize2Icon } from "lucide-react";
21
21
  import { ArrowUpIcon, ArrowDownIcon } from "lucide-react";
22
22
  import moment from "moment";
23
23
  import { CheckBox } from "..";
24
+ import { Themes } from "../theme";
24
25
  const MIN_COLUMN_WIDTH = 125;
25
- export const Column = ({ dataField, caption, columnId = shortUUID.generate(), sorting, format, componentType = "Column", }) => {
26
+ export const Column = ({ dataField, caption, columnId = shortUUID.generate(), sorting, format, }) => {
26
27
  return null;
27
28
  };
28
29
  Column.displayName = "Column";
@@ -157,7 +158,7 @@ const StyledTh = styled.th `
157
158
  }
158
159
 
159
160
  &:hover {
160
- background-color: ${({ theme }) => theme.name === "DARK" ? "#2e2e2e" : "#f5f5f5"};
161
+ background-color: ${({ theme }) => theme.name === Themes.DARK ? "#2e2e2e" : "#f5f5f5"};
161
162
  cursor: pointer;
162
163
  }
163
164
  &.dragging:active {
@@ -436,7 +437,7 @@ const Table = styled(({ className, children, data, rowHeight, headerHeight, tabl
436
437
  }, [children]);
437
438
  let columns = useMemo(() => {
438
439
  var _a, _b;
439
- return (_b = (_a = children === null || children === void 0 ? void 0 : children.filter) === null || _a === void 0 ? void 0 : _a.call(children, (child) => child.props.componentType === "Column")) === null || _b === void 0 ? void 0 : _b.map((column) => {
440
+ return (_b = (_a = children === null || children === void 0 ? void 0 : children.filter) === null || _a === void 0 ? void 0 : _a.call(children, (child) => { var _a; return ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === "Column"; })) === null || _b === void 0 ? void 0 : _b.map((column) => {
440
441
  return cloneElement(column, {
441
442
  columnId: shortUUID.generate(),
442
443
  allowResize: allowColumnResize !== undefined
@@ -1,4 +1,5 @@
1
1
  import variants from "./variants";
2
+ export { THEMES as Themes } from "./variants";
2
3
  const getTheme = (scheme) => {
3
4
  let themeConfig = variants.find((variant) => variant.name === scheme);
4
5
  if (!themeConfig) {
@@ -2,8 +2,8 @@ import merge from "deepmerge";
2
2
  import typography from "./typography";
3
3
  // Themes
4
4
  export const THEMES = {
5
- DARK: "dark",
6
- LIGHT: "light",
5
+ DARK: "DARK",
6
+ LIGHT: "LIGHT",
7
7
  };
8
8
  const customBlue = {
9
9
  50: "#e9f0fb",
@@ -45,7 +45,7 @@ const lightVariant = {
45
45
  name: THEMES.LIGHT,
46
46
  typography,
47
47
  palette: {
48
- mode: "light",
48
+ mode: THEMES.LIGHT,
49
49
  primary: {
50
50
  main: customBlue[700],
51
51
  contrastText: "#FFF",
@@ -168,7 +168,7 @@ const lightVariant = {
168
168
  const darkVariant = merge(lightVariant, {
169
169
  name: THEMES.DARK,
170
170
  palette: {
171
- mode: "dark",
171
+ mode: THEMES.DARK,
172
172
  divider: "rgba(255, 255, 255, 0.15)",
173
173
  action: {
174
174
  hover: "rgba(255, 255, 255, 0.05)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",