grep-components 2.21.1 → 2.22.0-GREPF-2893.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,19 +11,19 @@ export declare const dimensions: {
11
11
  toolbarMenuWidth: number;
12
12
  toolbarMenuHeight: number;
13
13
  };
14
- export declare const ToolbarTitle: import("@emotion/styled").StyledComponent<import("react-router").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
15
- export declare const EnvironmentTitle: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
16
- export declare const Toolbar: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
- export declare const ToolbarFixer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
- export declare const ToolbarInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
14
+ export declare const ToolbarTitle: import("@emotion/styled").StyledComponent<import("react-router").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
15
+ export declare const EnvironmentTitle: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
16
+ export declare const Toolbar: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
17
+ export declare const ToolbarFixer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
18
+ export declare const ToolbarInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme> & {
19
19
  colors: v0colors;
20
20
  } & MUIStyledCommonProps<Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
- export declare const ToolbarLeft: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
- export declare const ToolbarRight: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
- export declare const UserContainer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
- export declare const AccountName: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
25
- export declare const ToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
- export declare const MobileToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
27
- export declare const ToolbarMenuInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
28
- export declare const ToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
29
- export declare const MobileToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
21
+ export declare const ToolbarLeft: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
+ export declare const ToolbarRight: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
23
+ export declare const UserContainer: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
+ export declare const AccountName: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
25
+ export declare const ToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const MobileToolbarMenu: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
27
+ export declare const ToolbarMenuInner: import("@emotion/styled").StyledComponent<MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
28
+ export declare const ToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
29
+ export declare const MobileToolbarMenuItem: import("@emotion/styled").StyledComponent<import("react-router").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement> & MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -12,6 +12,6 @@ declare const _default: {
12
12
  };
13
13
  export default _default;
14
14
  export declare const Standard: {
15
- render: () => React.JSX.Element;
15
+ decorators: (() => React.JSX.Element)[];
16
16
  name: string;
17
17
  };
@@ -3,10 +3,11 @@ import { DatePickerProps } from '@mui/x-date-pickers';
3
3
  import { TextFieldProps } from '@mui/material';
4
4
  import '../../utils/dateHelper';
5
5
  import { ParseableDate } from '../../utils/dateHelper';
6
- type InputProps = Pick<TextFieldProps, 'id' | 'variant' | 'label' | 'fullWidth' | 'placeholder' | 'helperText' | 'required' | 'onFocus' | 'margin' | 'sx'>;
6
+ type InputProps = Pick<TextFieldProps, 'id' | 'variant' | 'label' | 'fullWidth' | 'helperText' | 'required' | 'margin' | 'sx'>;
7
7
  export interface GrepDatePickerProps extends Omit<DatePickerProps, 'value' | 'renderInput'>, InputProps {
8
8
  value?: ParseableDate | null;
9
9
  errorMessage?: string;
10
+ clearable?: boolean;
10
11
  }
11
- export declare const DatePicker: React.FunctionComponent<GrepDatePickerProps>;
12
- export default DatePicker;
12
+ export declare const GrepDatePicker: React.FunctionComponent<GrepDatePickerProps>;
13
+ export default GrepDatePicker;
@@ -1,9 +1,14 @@
1
1
  import * as React from 'react';
2
- declare const _default: {
2
+ import { GrepDatePickerProps } from '..';
3
+ import { StoryObj } from '@storybook/react-vite';
4
+ declare const meta: {
5
+ component: (args: Omit<GrepDatePickerProps, "value" | "onChange">) => React.JSX.Element;
3
6
  title: string;
7
+ render: ({ ...args }: Omit<GrepDatePickerProps, "value" | "onChange">) => React.JSX.Element;
4
8
  decorators: ((storyFn: () => React.ReactNode) => React.JSX.Element)[];
5
9
  };
6
- export default _default;
7
- export declare const Standard: () => React.JSX.Element;
8
- export declare const Test: () => React.JSX.Element;
9
- export declare const Outlined: () => React.JSX.Element;
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const WithError: Story;
13
+ export declare const WithHelperText: Story;
14
+ export declare const WithMoreControls: Story;
@@ -4,7 +4,7 @@ import { GrepDatePickerProps } from '../GrepDatePicker';
4
4
  import { Dayjs } from 'dayjs';
5
5
  import { GridSpacing } from '@mui/material/Grid';
6
6
  type CommonProperties = Pick<GrepDatePickerProps, 'variant' | 'margin' | 'sx'>;
7
- interface Props extends CommonProperties {
7
+ export interface GrepDateRangeProps extends CommonProperties {
8
8
  from: Omit<GrepDatePickerProps, 'onChange'>;
9
9
  to: Omit<GrepDatePickerProps, 'onChange'>;
10
10
  onChange: (date: DateRangeValue) => void;
@@ -16,5 +16,5 @@ interface Props extends CommonProperties {
16
16
  minDate?: Dayjs;
17
17
  maxDate?: Dayjs;
18
18
  }
19
- export declare const GrepDateRange: React.FunctionComponent<Props>;
19
+ export declare const GrepDateRange: React.FunctionComponent<GrepDateRangeProps>;
20
20
  export default GrepDateRange;
@@ -1,8 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import 'dayjs/locale/nb';
3
- declare const _default: {
3
+ import { GrepDateRangeProps } from '..';
4
+ import { StoryObj } from '@storybook/react-vite';
5
+ declare const meta: {
6
+ component: (args: Omit<GrepDateRangeProps, "from" | "to" | "onChange">) => React.JSX.Element;
4
7
  title: string;
5
- decorators: ((storyFn: () => React.ReactNode) => React.JSX.Element)[];
6
8
  };
7
- export default _default;
8
- export declare const Standard: () => React.JSX.Element;
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Standard: Story;
@@ -1,47 +1,23 @@
1
1
  import * as React from 'react';
2
- declare const _default: {
2
+ import { StoryObj } from '@storybook/react-vite';
3
+ declare const meta: {
3
4
  title: string;
5
+ component: React.FunctionComponent<import("../entities").Properties>;
6
+ args: {
7
+ onContentChange: (editorState: import("lexical").EditorState, editor: import("lexical").LexicalEditor) => void;
8
+ };
4
9
  decorators: ((storyFn: () => React.ReactNode) => React.JSX.Element)[];
5
10
  };
6
- export default _default;
7
- export declare const Standard: () => React.JSX.Element;
8
- export declare const CustomStyles: {
9
- render: () => React.JSX.Element;
10
- name: string;
11
- };
12
- export declare const CustomToolbar: {
13
- render: () => React.JSX.Element;
14
- name: string;
15
- };
16
- export declare const CustomButtons: {
17
- render: () => React.JSX.Element;
18
- name: string;
19
- };
20
- export declare const PasteStrippingAndBlockedInlineStyles: {
21
- render: () => React.JSX.Element;
22
- name: string;
23
- };
24
- export declare const WithCharacterCount: {
25
- render: () => React.JSX.Element;
26
- name: string;
27
- };
28
- export declare const DisableAndStripNewlines: {
29
- render: () => React.JSX.Element;
30
- name: string;
31
- };
32
- export declare const DisablePasting: {
33
- render: () => React.JSX.Element;
34
- name: string;
35
- };
36
- export declare const WithLabel: {
37
- render: () => React.JSX.Element;
38
- name: string;
39
- };
40
- export declare const OnlyHeading: {
41
- render: () => React.JSX.Element;
42
- name: string;
43
- };
44
- export declare const ReadOnly: {
45
- render: () => React.JSX.Element;
46
- name: string;
47
- };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Standard: Story;
14
+ export declare const CustomStyles: Story;
15
+ export declare const CustomToolbar: Story;
16
+ export declare const CustomButtons: Story;
17
+ export declare const PasteStrippingAndBlockedInlineStyles: Story;
18
+ export declare const WithCharacterCount: Story;
19
+ export declare const DisableAndStripNewlines: Story;
20
+ export declare const DisablePasting: Story;
21
+ export declare const WithLabel: Story;
22
+ export declare const OnlyHeading: Story;
23
+ export declare const ReadOnly: Story;
@@ -1,12 +1,18 @@
1
1
  import React from 'react';
2
- declare const _default: {
2
+ import { LoadingOverlayProps } from '..';
3
+ import { StoryObj } from '@storybook/react-vite';
4
+ declare const meta: {
3
5
  title: string;
6
+ args: {
7
+ zIndex: number;
8
+ };
9
+ render: ({ ...args }: Omit<LoadingOverlayProps, "show">) => React.JSX.Element;
4
10
  };
5
- export default _default;
6
- export declare const Standard: {
7
- render: () => React.JSX.Element;
8
- name: string;
9
- };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Standard: Story;
10
14
  export declare const CustomOverlay: {
11
- render: () => React.JSX.Element;
15
+ args: {
16
+ overlay: string;
17
+ };
12
18
  };
@@ -1,4 +1,6 @@
1
1
  import * as React from 'react';
2
+ import { NavGuardProperties } from '..';
3
+ import { StoryObj } from '@storybook/react-vite';
2
4
  export declare const v0colors: {
3
5
  primary: string;
4
6
  secondary: string;
@@ -14,20 +16,24 @@ export declare const v0colors: {
14
16
  white: string;
15
17
  lightGrey: string;
16
18
  };
17
- declare const _default: {
19
+ type testType = 'button' | 'appBar';
20
+ declare const meta: {
21
+ args: {
22
+ when: true;
23
+ txt: string;
24
+ txtDiscard: string;
25
+ txtCancel: string;
26
+ txtSave: string;
27
+ testType: "button";
28
+ };
29
+ render: ({ ...args }: Omit<NavGuardProperties, "title" | "onSave" | "onCancel" | "onDiscard"> & {
30
+ testType: testType;
31
+ }) => React.JSX.Element;
18
32
  title: string;
19
33
  excludeStories: string[];
20
34
  };
21
- export default _default;
22
- export declare const Default: {
23
- render: () => React.JSX.Element;
24
- name: string;
25
- };
26
- export declare const WithAppBar: {
27
- render: () => React.JSX.Element;
28
- name: string;
29
- };
30
- export declare const WithExclude: {
31
- render: () => React.JSX.Element;
32
- name: string;
33
- };
35
+ export default meta;
36
+ type Story = StoryObj<typeof meta>;
37
+ export declare const Default: Story;
38
+ export declare const WithAppBar: Story;
39
+ export declare const WithExclude: Story;
@@ -1,16 +1,18 @@
1
1
  import React from 'react';
2
+ import { SidebarProps } from '..';
2
3
  import { NavigationProps } from '../../AppBarNavList';
4
+ import type { StoryObj } from '@storybook/react-vite';
3
5
  export declare const adminPages: NavigationProps[];
4
- declare const _default: {
6
+ declare const meta: {
7
+ component: (args: Omit<SidebarProps, "currentPageId" | "onPageClick">) => React.JSX.Element;
5
8
  title: string;
6
9
  excludeStories: string[];
10
+ args: {
11
+ pages: NavigationProps[];
12
+ };
13
+ render: ({ ...args }: Omit<SidebarProps, "onPageClick" | "currentPageId">) => React.JSX.Element;
7
14
  };
8
- export default _default;
9
- export declare const Standard: {
10
- render: () => React.JSX.Element;
11
- name: string;
12
- };
13
- export declare const ExpandAndClick: {
14
- render: () => React.JSX.Element;
15
- name: string;
16
- };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const Standard: Story;
18
+ export declare const ExpandAndClick: Story;
@@ -4,6 +4,6 @@ declare const _default: {
4
4
  };
5
5
  export default _default;
6
6
  export declare const SortableTableStory: {
7
- render: () => React.JSX.Element;
7
+ decorators: (() => React.JSX.Element)[];
8
8
  name: string;
9
9
  };
@@ -52,7 +52,6 @@ export { default as InfoContainer } from './InfoContainer';
52
52
  export { default as OverflowTooltip } from './OverflowTooltip';
53
53
  export { default as Sidebar } from './Sidebar';
54
54
  export { default as NavGuard } from './NavGuard';
55
- export { default as DatePicker } from './GrepDatePicker';
56
55
  export { default as GrepDatePicker } from './GrepDatePicker';
57
56
  export { default as GrepDateRange } from './GrepDateRange';
58
57
  export { default as ServiceMessage } from './ServiceMessage';
package/dist/index.js CHANGED
@@ -7,8 +7,8 @@ import React__default, { useRef, useMemo, createContext, useContext, forwardRef,
7
7
  import AccountCircle from '@mui/icons-material/AccountCircle';
8
8
  import ArrowDropdown from '@mui/icons-material/ArrowDropDown';
9
9
  import { Button, Box, Typography, Tabs, Tab, Collapse, MenuList, Tooltip, MenuItem as MenuItem$1, Menu as Menu$1, Container, List, ListItem, ListItemText, ListItemButton, CircularProgress, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, IconButton as IconButton$1, ToggleButtonGroup, ToggleButton, AppBar as AppBar$1, Toolbar as Toolbar$1, Divider as Divider$1, Dialog as Dialog$1, DialogTitle as DialogTitle$1, DialogContent as DialogContent$1, DialogContentText as DialogContentText$1, DialogActions as DialogActions$1 } from '@mui/material';
10
- import { useTheme, styled } from '@mui/material/styles';
11
10
  import { __unsafe_useEmotionCache } from '@emotion/react';
11
+ import { useTheme, styled } from '@mui/material/styles';
12
12
  import { useNavigate, NavLink, useBlocker, useLocation } from 'react-router';
13
13
  import MenuIcon from '@mui/icons-material/Menu';
14
14
  import Box$1 from '@mui/material/Box';
@@ -40,7 +40,8 @@ import Search from '@mui/icons-material/Search';
40
40
  import CircularProgress$1 from '@mui/material/CircularProgress';
41
41
  import Info from '@mui/icons-material/Info';
42
42
  import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
43
- import { LocalizationProvider, DesktopDatePicker } from '@mui/x-date-pickers';
43
+ import { LocalizationProvider } from '@mui/x-date-pickers';
44
+ import { DatePicker } from '@mui/x-date-pickers/DatePicker';
44
45
  import Grid from '@mui/material/Grid';
45
46
  import ListItem$1 from '@mui/material/ListItem';
46
47
  import Collapse$1 from '@mui/material/Collapse';
@@ -1462,15 +1463,11 @@ const { tss } = createTss({
1462
1463
  });
1463
1464
  tss.create({});
1464
1465
 
1465
- const { makeStyles, withStyles } = createMakeAndWithStyles({
1466
- useTheme,
1467
- /*
1468
- OR, if you have extended the default mui theme adding your own custom properties:
1469
- Let's assume the myTheme object that you provide to the <ThemeProvider /> is of
1470
- type MyTheme then you'll write:
1471
- */
1472
- //"useTheme": useTheme as (()=> MyTheme)
1466
+ const tssStyles = createMakeAndWithStyles({
1467
+ useTheme: useTheme,
1473
1468
  });
1469
+ const makeStyles = tssStyles.makeStyles;
1470
+ const withStyles = tssStyles.withStyles;
1474
1471
 
1475
1472
  const useStyles$h = makeStyles()(({ palette }) => ({
1476
1473
  user: {
@@ -1568,9 +1565,7 @@ const MobileAppBarNavList = ({ pages, }) => {
1568
1565
  return (React.createElement(Box$1, { style: { flexGrow: 1 }, className: classes.mobileNavList },
1569
1566
  React.createElement(IconButton, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
1570
1567
  React.createElement(MenuIcon, { fontSize: "large" })),
1571
- React.createElement(Menu, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav, MenuListProps: {
1572
- 'aria-labelledby': 'basic-button',
1573
- } }, pages.map((page) => (React.createElement(MenuItem, { key: page.id, onClick: () => {
1568
+ React.createElement(Menu, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav }, pages.map((page) => (React.createElement(MenuItem, { key: page.id, onClick: () => {
1574
1569
  handleCloseNav();
1575
1570
  navigate(page?.toUrl || '');
1576
1571
  }, onKeyDown: keyboard.onActivation(() => navigate(page?.toUrl || '')) }, page.label))))));
@@ -1584,13 +1579,20 @@ const AppBarNavList = ({ selectedPage, pages, onChange, }) => {
1584
1579
  onChange(newValue);
1585
1580
  };
1586
1581
  return (React.createElement(React.Fragment, null,
1587
- React.createElement(Tabs, { classes: { root: classes.tabs, indicator: classes.indicator }, value: value, onChange: handleChange, TabIndicatorProps: { children: React.createElement("div", null) } }, pages.map((page) => (React.createElement(Tab, { disableTouchRipple: true, className: classes.tab, key: page.id, label: page.label })))),
1582
+ React.createElement(Tabs, { classes: { root: classes.tabs, indicator: classes.indicator }, value: value, onChange: handleChange, slotProps: { indicator: { children: React.createElement("div", null) } } }, pages.map((page) => (React.createElement(Tab, { disableTouchRipple: true, className: classes.tab, key: page.id, label: page.label })))),
1588
1583
  React.createElement(MobileAppBarNavList, { pages: pages })));
1589
1584
  };
1590
1585
 
1591
- const BodyLayout = (props) => (React.createElement(Box, { width: "100%", paddingTop: "20px", display: "flex", flexDirection: "row", marginBottom: "20px", justifyContent: "space-between" }, props.children));
1586
+ const BodyLayout = (props) => (React.createElement(Box, { sx: {
1587
+ width: '100%',
1588
+ paddingTop: '20px',
1589
+ display: 'flex',
1590
+ flexDirection: 'row',
1591
+ marginBottom: '20px',
1592
+ justifyContent: 'space-between',
1593
+ } }, props.children));
1592
1594
 
1593
- const MainLayout = (props) => (React.createElement(Box, { display: "flex", flex: "1", flexDirection: "column" }, props.children));
1595
+ const MainLayout = (props) => (React.createElement(Box, { sx: { display: 'flex', flex: '1', flexDirection: 'column' } }, props.children));
1594
1596
 
1595
1597
  const CollapsableMenu = ({ children, onMenuClose, ...collapseProps }) => {
1596
1598
  const onKeyDown = (e) => {
@@ -1702,15 +1704,21 @@ const CollapsableMenuItem = ({ items, onClick, children, onClose: _onclose, tool
1702
1704
  return () => document.removeEventListener('click', onScrimClick);
1703
1705
  }, [listItemRef, onScrimClick]);
1704
1706
  const { classes } = useStyles$f({ open });
1705
- const renderInner = () => (React__default.createElement(Box, { display: "flex", flexDirection: "column", width: "100%" },
1706
- React__default.createElement(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", minHeight: 48 },
1707
+ const renderInner = () => (React__default.createElement(Box, { sx: { display: 'flex', flexDirection: 'column', width: '100%' } },
1708
+ React__default.createElement(Box, { sx: {
1709
+ display: 'flex',
1710
+ justifyContent: 'space-between',
1711
+ alignItems: 'center',
1712
+ minHeight: 48,
1713
+ } },
1707
1714
  children,
1708
1715
  items && React__default.createElement(ExpandMore, { className: classes.expander })),
1709
1716
  items && (React__default.createElement(CollapsableMenu, { className: classes.subMenu, in: open, onMenuClose: collapse, onEntered: () => requestAnimationFrame(() => window.dispatchEvent(new Event('resize'))), ...props }, items))));
1710
1717
  return tooltipText ? (React__default.createElement(Tooltip, { title: tooltipText, placement: tooltipPlacement, describeChild: true, arrow: true, open: openTooltip },
1711
1718
  React__default.createElement(MenuItem$1, { role: "menuitem", sx: disabled && !items
1712
1719
  ? { cursor: 'not-allowed', pointerEvents: 'inherit !important' }
1713
- : { pointerEvents: 'inherit !important' }, className: classes.root, onFocusVisible: handleOpenTooltip, onMouseOver: (e) => (e.currentTarget.focus(), handleOpenTooltip()), onMouseLeave: handleCloseTooltip, selected: open, ref: listItemRef, onClick: handleClick, onKeyDown: (e) => (handleKey(e), handleCloseTooltip()), ...props }, renderInner()))) : (React__default.createElement(MenuItem$1, { sx: disabled && !items ? { cursor: 'not-allowed' } : {}, className: classes.root, onMouseOver: (e) => e.currentTarget.focus(), ref: listItemRef, selected: open, onClick: handleClick, onKeyDown: handleKey, ...props }, renderInner()));
1720
+ : { pointerEvents: 'inherit !important' }, className: classes.root, onFocusVisible: handleOpenTooltip, onMouseOver: (e) => (e.currentTarget.focus(),
1721
+ handleOpenTooltip()), onMouseLeave: handleCloseTooltip, selected: open, ref: listItemRef, onClick: handleClick, onKeyDown: (e) => (handleKey(e), handleCloseTooltip()), ...props }, renderInner()))) : (React__default.createElement(MenuItem$1, { sx: disabled && !items ? { cursor: 'not-allowed' } : {}, className: classes.root, onMouseOver: (e) => e.currentTarget.focus(), ref: listItemRef, selected: open, onClick: handleClick, onKeyDown: handleKey, ...props }, renderInner()));
1714
1722
  };
1715
1723
 
1716
1724
  const useStyles$e = makeStyles()(({ palette }) => ({
@@ -1889,7 +1897,7 @@ const Footer = ({ items, serviceNameText, udirLink, udirLogo, }) => {
1889
1897
  : renderItem(item)))))))));
1890
1898
  };
1891
1899
 
1892
- const LinkList = (props) => (React__default.createElement(Box$1, { width: "100%", flexDirection: "column" },
1900
+ const LinkList = (props) => (React__default.createElement(Box$1, { sx: { width: '100%', flexDirection: 'column' } },
1893
1901
  React__default.createElement(Typography$1, { style: { fontSize: 24, color: Colors.black, marginBottom: 20 } }, props.title),
1894
1902
  React__default.createElement(List$1, null, props.pages.map((page) => (React__default.createElement(Box$1, { key: page.id },
1895
1903
  React__default.createElement(ListItemButton, { onMouseDown: (e) => {
@@ -2181,7 +2189,7 @@ const GrepTable = ({ placeholderText, dropdownItems, isRowDisabled, pagination,
2181
2189
  }
2182
2190
  }
2183
2191
  }, [tableRef, selectedRowIndex]);
2184
- React__default.useMemo(() => {
2192
+ React__default.useEffect(() => {
2185
2193
  setCurrentPage(0);
2186
2194
  }, [data.length, setCurrentPage]);
2187
2195
  const _openDropdown = (e, row) => {
@@ -2343,19 +2351,35 @@ const GrepTableCard = (props) => {
2343
2351
  React.createElement(GrepTable, { ...props, header: true })));
2344
2352
  };
2345
2353
 
2346
- const LoadingOverlay = ({ overlay = 'rgba(255,255,255, .5)', show, children, minTime, zIndex, sx, ...box }) => {
2354
+ const LoadingOverlay = ({ overlay = 'rgba(255,255,255, .5)', show, children, minTime, zIndex, minHeight, sx, ...box }) => {
2347
2355
  const [enabled, setEnabled] = useState(show);
2348
2356
  useEffect(() => {
2349
2357
  const timeout = setTimeout(() => setEnabled(show), show ? 0 : minTime);
2350
2358
  return () => clearTimeout(timeout);
2351
2359
  }, [show, minTime, setEnabled]);
2352
- return (React__default.createElement(Box, { position: "relative", display: "block", overflow: show ? 'hidden' : '' },
2360
+ return (React__default.createElement(Box, { sx: {
2361
+ position: 'relative',
2362
+ display: 'block',
2363
+ overflow: show ? 'hidden' : '',
2364
+ } },
2353
2365
  children,
2354
- React__default.createElement(Box, { position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", top: 0, left: 0, height: "100%", width: "100%", zIndex: enabled ? (zIndex ? zIndex : 999) : -999, style: {
2366
+ React__default.createElement(Box, { sx: {
2367
+ position: 'absolute',
2368
+ display: 'flex',
2369
+ alignItems: 'center',
2370
+ justifyContent: 'center',
2371
+ top: 0,
2372
+ left: 0,
2373
+ height: '100%',
2374
+ width: '100%',
2375
+ zIndex: enabled ? (zIndex ? zIndex : 999) : -999,
2376
+ minHeight: minHeight,
2377
+ ...sx,
2378
+ }, style: {
2355
2379
  backgroundColor: overlay,
2356
2380
  opacity: show ? 1 : 0,
2357
2381
  transition: `opacity ${show ? 0 : minTime}ms ease`,
2358
- }, sx: sx, ...box },
2382
+ }, ...box },
2359
2383
  React__default.createElement(CircularProgress, { "aria-label": "Laster inn" }))));
2360
2384
  };
2361
2385
 
@@ -2405,9 +2429,9 @@ const GrepCrumbs = ({ style, onClick, breadcrumbs, }) => {
2405
2429
  crumb.path && navigate(crumb.path);
2406
2430
  }
2407
2431
  };
2408
- return (React__default.createElement("div", { className: classes.container, style: style }, breadcrumbs.map((crumb, index) => crumb.path ? (React__default.createElement(Box$1, { key: index, display: "flex" },
2432
+ return (React__default.createElement("div", { className: classes.container, style: style }, breadcrumbs.map((crumb, index) => crumb.path ? (React__default.createElement(Box$1, { key: crumb.label, sx: { display: 'flex' } },
2409
2433
  React__default.createElement(Link, { className: classes.link, tabIndex: 0, component: "button", onClick: () => handleClick(crumb) }, crumb.label),
2410
- index !== breadcrumbs.length - 1 && (React__default.createElement(Box$1, { margin: "auto 8px", height: "fit-content" /*lineHeight="20px"*/ }, ">")))) : (React__default.createElement(Tooltip$1, { key: index, title: showTooltip ? crumb.label : '' },
2434
+ index !== breadcrumbs.length - 1 && (React__default.createElement(Box$1, { sx: { margin: 'auto 8px', height: 'fit-content' } }, ">")))) : (React__default.createElement(Tooltip$1, { key: crumb.label, title: showTooltip ? crumb.label : '' },
2411
2435
  React__default.createElement("div", { className: classes.current, ref: ref }, crumb.label))))));
2412
2436
  };
2413
2437
 
@@ -2487,7 +2511,13 @@ const GreyCover = ({ elevation, children }) => {
2487
2511
  return React.createElement(Box, { className: classes.cover }, children);
2488
2512
  };
2489
2513
 
2490
- const CircularLoading = ({ height, ...props }) => (React.createElement(Box, { height: height, width: "100%", display: "flex", alignItems: "center", justifyContent: "center" },
2514
+ const CircularLoading = ({ height, ...props }) => (React.createElement(Box, { sx: {
2515
+ height: { height },
2516
+ width: '100%',
2517
+ display: 'flex',
2518
+ alignItems: 'center',
2519
+ justifyContent: 'center',
2520
+ } },
2491
2521
  React.createElement(CircularProgress$1, { ...props })));
2492
2522
 
2493
2523
  const useStyles$7 = makeStyles()((theme) => ({
@@ -2622,6 +2652,7 @@ const useDate = (value = null, options) => {
2622
2652
  const nextDate = getDate(next);
2623
2653
  hasDateChanged(date, nextDate) && _setDate(nextDate);
2624
2654
  };
2655
+ // eslint-disable-next-line @eslint-react/use-memo
2625
2656
  useMemo(() => setDate(value ? parseDate(value, { utc }) : null), [value, utc]);
2626
2657
  return [date, setDate];
2627
2658
  };
@@ -3092,12 +3123,12 @@ const useContentElements = (container, selector, options) => {
3092
3123
  return elements;
3093
3124
  };
3094
3125
 
3095
- const DatePicker = ({ id, label, value, variant, errorMessage, placeholder, fullWidth, required, onFocus, margin, sx, ...props }) => {
3126
+ const GrepDatePicker = ({ id, label, value, variant, errorMessage, fullWidth, required, margin, clearable, sx, ...props }) => {
3096
3127
  const [date, setDate] = useDate(value);
3097
3128
  const [error, setError] = useState();
3098
3129
  const helperText = errorMessage || error || props.helperText;
3099
3130
  return (React__default.createElement(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: 'nb' },
3100
- React__default.createElement(DesktopDatePicker
3131
+ React__default.createElement(DatePicker
3101
3132
  // clearable @todo
3102
3133
  , {
3103
3134
  // clearable @todo
@@ -3120,14 +3151,13 @@ const DatePicker = ({ id, label, value, variant, errorMessage, placeholder, full
3120
3151
  setError(undefined);
3121
3152
  }
3122
3153
  }, value: date, onChange: setDate, slotProps: {
3154
+ field: { clearable: clearable },
3123
3155
  textField: {
3124
3156
  id: id,
3125
3157
  label: label,
3126
3158
  variant: variant,
3127
- onFocus: onFocus,
3128
3159
  required: required,
3129
3160
  fullWidth: fullWidth,
3130
- placeholder: placeholder,
3131
3161
  sx: sx,
3132
3162
  margin: margin,
3133
3163
  error: !!error || !!errorMessage,
@@ -3140,20 +3170,20 @@ const GrepDateRange = ({ onChange, spacing = 3, style, fullWidth, from: fromProp
3140
3170
  const [from, setFrom] = useDate(fromProperties.value);
3141
3171
  const [to, setTo] = useDate(toProperties.value);
3142
3172
  const { minDate, maxDate, ...commonProperties } = properties;
3143
- useEffect(() => onChange(new DateRangeValue(from, to)), [String(from), String(to)]);
3173
+ useCallback(() => onChange(new DateRangeValue(from ? String(from) : from, to ? String(to) : to)), [from, to, onChange]);
3144
3174
  return (React__default.createElement(Grid, { container: true, spacing: spacing, style: style },
3145
3175
  React__default.createElement(Grid, { size: { xs: 12, sm: fullWidth ? 12 : 6 } },
3146
- React__default.createElement(DatePicker, { id: String(fromProperties.label), fullWidth: true, minDate: minDate, ...commonProperties, ...fromProperties, value: from, maxDate: to?.subtract(1, 'day') || undefined, onChange: setFrom })),
3176
+ React__default.createElement(GrepDatePicker, { id: String(fromProperties.label), fullWidth: true, minDate: minDate, ...commonProperties, ...fromProperties, value: from, maxDate: to?.subtract(1, 'day') || undefined, onChange: setFrom })),
3147
3177
  React__default.createElement(Grid, { size: { xs: 12, sm: fullWidth ? 12 : 6 } },
3148
- React__default.createElement(DatePicker, { id: String(toProperties.label), fullWidth: true, maxDate: maxDate, ...commonProperties, ...toProperties, value: to, minDate: from?.add(1, 'day') || undefined, onChange: setTo }))));
3178
+ React__default.createElement(GrepDatePicker, { id: String(toProperties.label), fullWidth: true, maxDate: maxDate, ...commonProperties, ...toProperties, value: to, minDate: from?.add(1, 'day') || undefined, onChange: setTo }))));
3149
3179
  };
3150
3180
 
3151
- const renderField = ({ key, value }) => (React.createElement(Box$1, { key: key, display: "flex", marginRight: "20px" },
3181
+ const renderField = ({ key, value }) => (React.createElement(Box$1, { key: key, sx: { display: 'flex', marginRight: '20px' } },
3152
3182
  React.createElement(Typography$1, { variant: "body1", style: { color: Colors.grey, marginRight: '2rem' } },
3153
3183
  key,
3154
3184
  ":"),
3155
3185
  React.createElement(Typography$1, { variant: "body1" }, value)));
3156
- const renderHorizontal = (infoFields) => (React.createElement(Box$1, { display: "flex", flexWrap: "wrap", justifyContent: "space-between" }, infoFields.map(renderField)));
3186
+ const renderHorizontal = (infoFields) => (React.createElement(Box$1, { sx: { display: 'flex', flexWrap: 'wrap', justifyContent: 'space-between' } }, infoFields.map(renderField)));
3157
3187
  const renderVertical = (infoFields) => infoFields.map(renderField);
3158
3188
  const InfoContainer = (props) => (React.createElement(Box$1, { style: { paddingTop: 20, ...props.style } },
3159
3189
  props.header && (React.createElement(Typography$1, { variant: "h6", style: { paddingBottom: 10 } }, props.header)),
@@ -8394,7 +8424,7 @@ const SortableTable = ({ data, onChange, ...props }) => {
8394
8424
  return (React__default.createElement(TableCell, { key: `header-${index}` }, label.toString().charAt(0).toUpperCase() +
8395
8425
  label.toString().slice(1)));
8396
8426
  })))),
8397
- React__default.createElement(SortableContext, { items: stateItems, strategy: verticalListSortingStrategy },
8427
+ React__default.createElement(SortableContext, { items: stateItems, strategy: verticalListSortingStrategy, disabled: props.disabled },
8398
8428
  React__default.createElement(TableBody, null, stateItems.map((item) => (React__default.createElement(SortableTableRow2, { key: item.id, id: item.id, item: item, columns: props.columns })))))),
8399
8429
  React__default.createElement(DragOverlay, null, activeId !== '' ? (React__default.createElement(Table, { size: size, className: classes.dragOverlayRow, sx: { cursor: cursor } },
8400
8430
  React__default.createElement(TableBody, null,
@@ -8609,7 +8639,7 @@ function StyleWrapperPlugin({ showCharcount, helperText, readOnly, classes, labe
8609
8639
  React__default.createElement("legend", { className: clsx(styles.legend, classes?.legend) }),
8610
8640
  label && (React__default.createElement("label", { className: clsx(styles.label, classes?.label) }, label)),
8611
8641
  React__default.createElement(Box, { className: clsx(styles.editor, classes?.editor) }, children),
8612
- (showCharcount || helperText) && (React__default.createElement(Box, { margin: ".5rem" },
8642
+ (showCharcount || helperText) && (React__default.createElement(Box, { sx: { margin: '.5rem' } },
8613
8643
  showCharcount && (React__default.createElement(FormHelperText, { className: styles.charcount }, `Antall tegn: ${charCount}`)),
8614
8644
  helperText && (React__default.createElement(FormHelperText, { className: styles.helpertext }, helperText))))));
8615
8645
  }
@@ -9206,9 +9236,7 @@ function Editor({ html, label, classes, autoFocus, helperText, showCharCount, al
9206
9236
  setFloatingAnchorElem(_floatingAnchorElem);
9207
9237
  }
9208
9238
  };
9209
- if (!editorRef) {
9210
- editorRef = useRef(null);
9211
- }
9239
+ editorRef = useRef(null);
9212
9240
  const canStyle = allowedStyles === undefined || allowedStyles.length > 0;
9213
9241
  const buttons = !allowedStyles
9214
9242
  ? createDefaultButtons()
@@ -9481,17 +9509,13 @@ const MobileAppBar = ({ userMenuItems, menuItems, }) => {
9481
9509
  React.createElement(Toolbar$1, { style: { minHeight: '50px' } },
9482
9510
  React.createElement(IconButton$1, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
9483
9511
  React.createElement(MenuIcon, { sx: { color: 'white' } })),
9484
- React.createElement(Menu$1, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav, MenuListProps: {
9485
- 'aria-labelledby': 'basic-button',
9486
- } }, menuItems.map((page) => (React.createElement(MobileToolbarMenuItem, { key: page.name, to: page.redirectUrl || '' },
9512
+ React.createElement(Menu$1, { id: "basic-menu", anchorEl: anchorElNav, open: openNav, onClose: handleCloseNav }, menuItems.map((page) => (React.createElement(MobileToolbarMenuItem, { key: page.name, to: page.redirectUrl || '' },
9487
9513
  React.createElement(MenuItem$1, { sx: {
9488
9514
  width: '100%',
9489
9515
  }, key: page.name }, page.translatedTextRef))))),
9490
9516
  React.createElement(IconButton$1, { size: "medium", edge: "end", color: "inherit", "aria-label": "menu", style: { marginLeft: 'auto' }, onClick: handleClickMenu },
9491
9517
  React.createElement(MoreVert, { sx: { color: 'white' } })),
9492
- React.createElement(Menu$1, { id: "basic-menu", anchorEl: anchorElMenu, open: openMenu, onClose: handleCloseMenu, MenuListProps: {
9493
- 'aria-labelledby': 'basic-button',
9494
- } }, userMenuItems.map((i, index) => (React.createElement(Box, { key: i.id },
9518
+ React.createElement(Menu$1, { id: "basic-menu", anchorEl: anchorElMenu, open: openMenu, onClose: handleCloseMenu }, userMenuItems.map((i, index) => (React.createElement(Box, { key: i.id },
9495
9519
  React.createElement(MenuItem$1, { key: i.id, onClick: () => {
9496
9520
  handleCloseMenu();
9497
9521
  i.action && i.action();
@@ -10392,5 +10416,5 @@ const GrepTableOfContent = ({ style, className, setSelectedValue, percentageRend
10392
10416
  };
10393
10417
  GrepTableOfContent.displayName = 'Grep.ToC';
10394
10418
 
10395
- export { AppBar, AppBarNavList, AppBarProfile, BodyLayout, CircularLoading, Colors, ConfirmationServiceProvider, ContainedLinkList, DatePicker, DropdownMenu, Footer, GDPR, GrepCrumbs, DatePicker as GrepDatePicker, GrepDateRange, GrepDialogServiceProvider, GrepEditor, GrepInput, GrepSelect, GrepTable, GrepTableCard, GrepTableOfContent, GrepTableRow, GreyCover, InfoContainer, LinkList, LoadingOverlay, MainLayout, NavGuard, OverflowTooltip, ProfileInfo, SearchBar, ServiceMessage, Sidebar, SortableTable, index as Utils, convertToRgba, filterElements as filterContentElements, hex2rgb, hex2rgba, makeStyles, useConfirmation, useContentElements, useDate, useDebounce, useGrepDialog, useStyles$c as useStyles, withStyles };
10419
+ export { AppBar, AppBarNavList, AppBarProfile, BodyLayout, CircularLoading, Colors, ConfirmationServiceProvider, ContainedLinkList, DropdownMenu, Footer, GDPR, GrepCrumbs, GrepDatePicker, GrepDateRange, GrepDialogServiceProvider, GrepEditor, GrepInput, GrepSelect, GrepTable, GrepTableCard, GrepTableOfContent, GrepTableRow, GreyCover, InfoContainer, LinkList, LoadingOverlay, MainLayout, NavGuard, OverflowTooltip, ProfileInfo, SearchBar, ServiceMessage, Sidebar, SortableTable, index as Utils, convertToRgba, filterElements as filterContentElements, hex2rgb, hex2rgba, makeStyles, useConfirmation, useContentElements, useDate, useDebounce, useGrepDialog, useStyles$c as useStyles, withStyles };
10396
10420
  //# sourceMappingURL=index.js.map