@equinor/amplify-component-lib 11.0.0 → 11.0.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.
- package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
- package/dist/atoms/hooks/useSelect.d.ts +3 -3
- package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
- package/dist/molecules/Chip/Chip.d.ts +2 -2
- package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
- package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/molecules/Dialog/Dialog.d.ts +2 -2
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- package/dist/molecules/IconCell/IconCell.d.ts +2 -2
- package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
- package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
- package/dist/molecules/RichTextEditor/index.d.ts +5 -5
- package/dist/molecules/Search/Search.d.ts +2 -2
- package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
- package/dist/molecules/TextField/TextField.js +1 -1
- package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
- package/dist/organisms/SideBar/MenuItem/CollapsableMenuItem.js +4 -4
- package/dist/organisms/SideBar/MenuItem/MenuItem.styles.js +8 -3
- package/dist/organisms/SideBar/MenuItem/MenuItem.utils.js +1 -1
- package/dist/organisms/Status/Action.d.ts +2 -2
- package/dist/organisms/Status/Description.d.ts +2 -2
- package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
- package/dist/organisms/Status/Title.d.ts +2 -2
- package/dist/organisms/Status/collections/BadRequest.d.ts +2 -2
- package/dist/organisms/Status/collections/GenericError.d.ts +2 -2
- package/dist/organisms/Status/collections/MissingPermissions.d.ts +2 -2
- package/dist/organisms/Status/collections/PageNotFound.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
- package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react139 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/atoms/hooks/useLocalStorage.d.ts
|
|
4
|
-
declare const useLocalStorage: <T>(key: string, defaultState: T, keepAliveMs?: number) => readonly [T,
|
|
4
|
+
declare const useLocalStorage: <T>(key: string, defaultState: T, keepAliveMs?: number) => readonly [T, react139.Dispatch<react139.SetStateAction<T>>, () => void];
|
|
5
5
|
//#endregion
|
|
6
6
|
export { useLocalStorage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectOption, SelectOptionRequired } from "../../molecules/Select/Select.types.js";
|
|
2
2
|
import { SelectComponentProps } from "../../molecules/Select/Select.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react141 from "react";
|
|
4
4
|
import { ChangeEvent, KeyboardEvent } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/atoms/hooks/useSelect.d.ts
|
|
@@ -16,8 +16,8 @@ declare const useSelect: <T extends SelectOptionRequired>(props: SelectComponent
|
|
|
16
16
|
handleOnOpen: () => void;
|
|
17
17
|
handleOnRemoveItem: (item: SelectOption<T>) => void;
|
|
18
18
|
search: string;
|
|
19
|
-
searchRef:
|
|
20
|
-
itemRefs:
|
|
19
|
+
searchRef: react141.RefObject<HTMLInputElement | null>;
|
|
20
|
+
itemRefs: react141.RefObject<(HTMLButtonElement | null)[]>;
|
|
21
21
|
selectedValues: T[];
|
|
22
22
|
open: boolean;
|
|
23
23
|
tryingToRemoveItem: T | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react0 from "react";
|
|
2
2
|
import { IconData } from "@equinor/eds-icons";
|
|
3
3
|
|
|
4
4
|
//#region src/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts
|
|
@@ -12,6 +12,6 @@ interface ExpandingIconButtonProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* @deprecated Being deprecated from amplify-component-lib move into app if you want the implementation
|
|
14
14
|
*/
|
|
15
|
-
declare const ExpandingIconButton:
|
|
15
|
+
declare const ExpandingIconButton: react0.ForwardRefExoticComponent<ExpandingIconButtonProps & react0.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { ExpandingIconButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react7 from "react";
|
|
2
2
|
import { HTMLAttributes, KeyboardEvent, MouseEvent, ReactNode } from "react";
|
|
3
3
|
import { IconData } from "@equinor/eds-icons";
|
|
4
4
|
|
|
@@ -25,6 +25,6 @@ type DeletableChipProps = BaseChipProps & InteractiveChipBase & {
|
|
|
25
25
|
onDelete: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
|
|
26
26
|
};
|
|
27
27
|
type ChipProps = Omit<HTMLAttributes<HTMLDivElement | HTMLButtonElement>, 'onClick'> & (ReadOnlyChipProps | ClickableChipProps | DeletableChipProps);
|
|
28
|
-
declare const Chip:
|
|
28
|
+
declare const Chip: react7.ForwardRefExoticComponent<ChipProps & react7.RefAttributes<HTMLDivElement | HTMLButtonElement>>;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { BaseChipProps, Chip, ClickableChipProps, DeletableChipProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Variants } from "../../atoms/types/variants.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react9 from "react";
|
|
3
3
|
import { DatePickerProps } from "@equinor/eds-core-react";
|
|
4
4
|
|
|
5
5
|
//#region src/molecules/DatePicker/DatePicker.d.ts
|
|
@@ -9,11 +9,11 @@ type DatePickerProps$1 = Omit<DatePickerProps, 'variant' | 'defaultValue'> & {
|
|
|
9
9
|
meta?: string;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
};
|
|
12
|
-
declare const DatePicker$1:
|
|
12
|
+
declare const DatePicker$1: react9.ForwardRefExoticComponent<Omit<DatePickerProps, "defaultValue" | "variant"> & {
|
|
13
13
|
variant?: Variants;
|
|
14
14
|
defaultValue?: Date | undefined;
|
|
15
15
|
meta?: string;
|
|
16
16
|
loading?: boolean;
|
|
17
|
-
} &
|
|
17
|
+
} & react9.RefAttributes<HTMLDivElement>>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { DatePicker$1 as DatePicker, DatePickerProps$1 as DatePickerProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Variants } from "../../atoms/types/variants.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react11 from "react";
|
|
3
3
|
import { DateRangePickerProps } from "@equinor/eds-core-react";
|
|
4
4
|
|
|
5
5
|
//#region src/molecules/DateRangePicker/DateRangePicker.d.ts
|
|
@@ -8,10 +8,10 @@ type DateRangePickerProps$1 = Omit<DateRangePickerProps, 'variant'> & {
|
|
|
8
8
|
meta?: string;
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
};
|
|
11
|
-
declare const DateRangePicker$1:
|
|
11
|
+
declare const DateRangePicker$1: react11.ForwardRefExoticComponent<Omit<DateRangePickerProps, "variant"> & {
|
|
12
12
|
variant?: Variants;
|
|
13
13
|
meta?: string;
|
|
14
14
|
loading?: boolean;
|
|
15
|
-
} &
|
|
15
|
+
} & react11.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { DateRangePicker$1 as DateRangePicker, DateRangePickerProps$1 as DateRangePickerProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react13 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { ButtonProps, DialogProps } from "@equinor/eds-core-react";
|
|
4
4
|
import { IconData } from "@equinor/eds-icons";
|
|
@@ -51,6 +51,6 @@ interface DialogProps$1 extends Omit<DialogProps, 'title'> {
|
|
|
51
51
|
* @param additionalInfo - Defaults to empty, and won't show the additional info button
|
|
52
52
|
* Also inherits props from EDS dialog
|
|
53
53
|
*/
|
|
54
|
-
declare const Dialog$1:
|
|
54
|
+
declare const Dialog$1: react13.ForwardRefExoticComponent<DialogProps$1 & react13.RefAttributes<HTMLDivElement>>;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { Dialog$1 as Dialog, DialogAction, DialogProps$1 as DialogProps };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SizeIconProps } from "../../atoms/types/Icon.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react5 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/EquinorLogo/EquinorLogo.d.ts
|
|
5
5
|
interface EquinorLogoProps extends Partial<SizeIconProps> {
|
|
6
6
|
large?: boolean;
|
|
7
7
|
color?: 'red' | 'white' | 'black';
|
|
8
8
|
}
|
|
9
|
-
declare const EquinorLogo:
|
|
9
|
+
declare const EquinorLogo: react5.ForwardRefExoticComponent<EquinorLogoProps & react5.RefAttributes<SVGSVGElement>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { EquinorLogo, EquinorLogoProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconCellColor, IconCellState, IconCellVariant, IconCellVariants } from "./IconCell.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react29 from "react";
|
|
3
3
|
import { HTMLAttributes, MouseEventHandler, ReactNode } from "react";
|
|
4
4
|
import { IconData } from "@equinor/eds-icons";
|
|
5
5
|
|
|
@@ -49,6 +49,6 @@ type IconCellProps = ScribbledOutProps | RegularIconCellProps;
|
|
|
49
49
|
* @param {React.Ref<HTMLButtonElement>} ref - Ref forwarded to the inner button element.
|
|
50
50
|
* @returns {JSX.Element} The rendered IconCell.
|
|
51
51
|
*/
|
|
52
|
-
declare const IconCell:
|
|
52
|
+
declare const IconCell: react29.ForwardRefExoticComponent<IconCellProps & react29.RefAttributes<HTMLButtonElement>>;
|
|
53
53
|
//#endregion
|
|
54
54
|
export { IconCell, IconCellProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react23 from "react";
|
|
2
2
|
import { TooltipProps } from "@equinor/eds-core-react";
|
|
3
3
|
import * as _floating_ui_utils0 from "@floating-ui/utils";
|
|
4
4
|
|
|
@@ -6,14 +6,14 @@ import * as _floating_ui_utils0 from "@floating-ui/utils";
|
|
|
6
6
|
type OptionalTooltipProps = {
|
|
7
7
|
textTransform?: string;
|
|
8
8
|
} & TooltipProps;
|
|
9
|
-
declare const OptionalTooltip:
|
|
9
|
+
declare const OptionalTooltip: react23.ForwardRefExoticComponent<{
|
|
10
10
|
textTransform?: string;
|
|
11
11
|
} & {
|
|
12
12
|
placement?: _floating_ui_utils0.Placement;
|
|
13
|
-
title?:
|
|
13
|
+
title?: react23.ReactNode;
|
|
14
14
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
15
15
|
enterDelay?: number;
|
|
16
16
|
portalContainer?: HTMLElement;
|
|
17
|
-
} & Omit<
|
|
17
|
+
} & Omit<react23.HTMLAttributes<HTMLDivElement>, "title"> & react23.RefAttributes<HTMLDivElement>>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { OptionalTooltip, OptionalTooltipProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react27 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/molecules/ProfileAvatar/ProfileAvatar.d.ts
|
|
4
4
|
interface ProfileAvatarProps {
|
|
@@ -7,6 +7,6 @@ interface ProfileAvatarProps {
|
|
|
7
7
|
size?: 'small' | 'small-medium' | 'medium' | 'large' | 'x-large' | number;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const ProfileAvatar:
|
|
10
|
+
declare const ProfileAvatar: react27.ForwardRefExoticComponent<ProfileAvatarProps & react27.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ProfileAvatar, ProfileAvatarProps };
|
|
@@ -2,16 +2,16 @@ import { EditorStylingProps, RichTextContentProps } from "./RichTextEditor.style
|
|
|
2
2
|
import { EditorProviderProps } from "./EditorProvider.js";
|
|
3
3
|
import { MenuBarProps } from "./MenuBar/MenuBar.js";
|
|
4
4
|
import { RichTextEditor } from "./RichTextEditor.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react15 from "react";
|
|
6
6
|
import * as _tiptap_react0 from "@tiptap/react";
|
|
7
7
|
import * as styled_components_dist_types0 from "styled-components/dist/types";
|
|
8
8
|
|
|
9
9
|
//#region src/molecules/RichTextEditor/index.d.ts
|
|
10
10
|
declare const RichText: {
|
|
11
|
-
Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<
|
|
12
|
-
Provider:
|
|
13
|
-
Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<Omit<_tiptap_react0.EditorContentProps, "ref"> &
|
|
14
|
-
Bar:
|
|
11
|
+
Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<react15.DetailedHTMLProps<react15.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, EditorStylingProps>> & string;
|
|
12
|
+
Provider: react15.FC<EditorProviderProps>;
|
|
13
|
+
Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<Omit<_tiptap_react0.EditorContentProps, "ref"> & react15.RefAttributes<HTMLDivElement>, RichTextContentProps>> & string & Omit<react15.NamedExoticComponent<Omit<_tiptap_react0.EditorContentProps, "ref"> & react15.RefAttributes<HTMLDivElement>>, keyof react15.Component<any, {}, any>>;
|
|
14
|
+
Bar: react15.FC<MenuBarProps>;
|
|
15
15
|
};
|
|
16
16
|
//#endregion
|
|
17
17
|
export { RichText };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react39 from "react";
|
|
2
2
|
import { SearchProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/Search/Search.d.ts
|
|
5
5
|
interface SearchProps$1 extends SearchProps {
|
|
6
6
|
lightBackground?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare const Search$1:
|
|
8
|
+
declare const Search$1: react39.ForwardRefExoticComponent<SearchProps$1 & react39.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Search$1 as Search };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react41 from "react";
|
|
2
2
|
import * as styled_components_dist_types6 from "styled-components/dist/types";
|
|
3
3
|
import * as styled_components_dist_models_Keyframes0 from "styled-components/dist/models/Keyframes";
|
|
4
4
|
|
|
@@ -7,6 +7,6 @@ declare const skeletonBaseloading: styled_components_dist_models_Keyframes0.defa
|
|
|
7
7
|
interface SkeletonBaseProps {
|
|
8
8
|
$offset?: number;
|
|
9
9
|
}
|
|
10
|
-
declare const SkeletonBase: styled_components_dist_types6.IStyledComponentBase<"web", styled_components_dist_types6.Substitute<
|
|
10
|
+
declare const SkeletonBase: styled_components_dist_types6.IStyledComponentBase<"web", styled_components_dist_types6.Substitute<react41.DetailedHTMLProps<react41.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SkeletonBaseProps>> & string;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { SkeletonBase, SkeletonBaseProps, skeletonBaseloading };
|
|
@@ -83,4 +83,4 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
83
83
|
display: flex;
|
|
84
84
|
gap: ${r.x_small};
|
|
85
85
|
align-items: center;
|
|
86
|
-
`,S=e=>{if(e.maxCharacters&&`type`in e&&e.type!==`text`)throw Error('`maxCharacters` prop is not supported for input types other than "text".');if(e.explanation&&!e.label)throw Error("`explanation` prop requires a `label` to be set on the TextField.");let i={...e,variant:e.variant===`dirty`?void 0:e.variant},s=e.loading?void 0:e.variant,p=o(e),m=a(e),h=u(`${Math.max(20,Math.random()*80)}%`),[S,C]=d(typeof e.value==`string`?e.value.length:0),[w,T]=d(0),E=e=>{if(e){let t=e.getBoundingClientRect().width;T(t)}},D=t=>{e.onChange&&e.onChange(t),e.maxCharacters&&C(t.target.value.length)};return l(()=>{typeof e.value==`string`&&e.maxCharacters&&e.value.length!==S&&C(e.value.length)},[S,e.maxCharacters,e.value]),_(v,{
|
|
86
|
+
`,S=e=>{if(e.maxCharacters&&`type`in e&&e.type!==`text`)throw Error('`maxCharacters` prop is not supported for input types other than "text".');if(e.explanation&&!e.label)throw Error("`explanation` prop requires a `label` to be set on the TextField.");let i={...e,variant:e.variant===`dirty`?void 0:e.variant},s=e.loading?void 0:e.variant,p=o(e),m=a(e),h=u(`${Math.max(20,Math.random()*80)}%`),[S,C]=d(typeof e.value==`string`?e.value.length:0),[w,T]=d(0),E=e=>{if(e){let t=e.getBoundingClientRect().width;T(t)}},D=t=>{e.onChange&&e.onChange(t),e.maxCharacters&&C(t.target.value.length)};return l(()=>{typeof e.value==`string`&&e.maxCharacters&&e.value.length!==S&&C(e.value.length)},[S,e.maxCharacters,e.value]),_(v,{ref:t=>{if(!t||!e.maxCharacters)return;let n=t.querySelector(`input, textarea`);n&&C(n.value.length)},$variant:s,$disabled:e.loading?!1:e.disabled,$helperRightWidth:w,style:{marginBottom:!e.helperText&&e.maxCharacters?`calc(${r.small} + 1rem)`:0},children:[g(f,{...i,label:i.label?_(x,{children:[i.label,e.explanation&&g(c,{position:e.explanationPosition,children:e.explanation})]}):void 0,disabled:e.loading||e.disabled,onChange:D}),e.loading&&g(y,{className:`skeleton`,role:`progressbar`,style:{top:p,height:m,width:h.current}}),e.maxCharacters&&_(b,{ref:E,variant:`helper`,group:`input`,color:i.variant?t[i.variant]:n.text.static_icons__tertiary.rgba,style:{bottom:e.helperText?`0`:`calc((${r.small} + 1rem) * -1)`},children:[S,` / `,e.maxCharacters]})]})};export{S as TextField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSideBar as e}from"../../../providers/SideBarProvider.js";import{OptionalTooltip as t}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as n,ItemText as r,Link as i,MenuItemWrapper as a}from"./MenuItem.styles.js";import{canNavigate as o
|
|
1
|
+
import{useSideBar as e}from"../../../providers/SideBarProvider.js";import{OptionalTooltip as t}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as n,ItemText as r,Link as i,MenuItemWrapper as a}from"./MenuItem.styles.js";import{canNavigate as o}from"./MenuItem.utils.js";import{useCallback as s,useMemo as c}from"react";import{Icon as l}from"@equinor/eds-core-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useMatchRoute as f}from"@tanstack/react-router";import{Feature as p}from"@equinor/subsurface-app-management";const m=({icon:m,onClick:h,replace:g=!1,name:_,disabled:v=!1,featureUuid:y,...b})=>{let{isOpen:x}=e(),S=!!f()({...b}),C=o({isActive:S,replace:g,disabled:v}),w=s(e=>{if(!C){e.preventDefault();return}h&&h()},[C,h]),T=c(()=>u(t,{title:_,placement:`right`,children:u(a,{children:d(i,{"aria-disabled":v,$disabled:v,onClick:w,tabIndex:0,"data-testid":`sidebar-menu-item`,...b,children:[u(n,{"data-testid":`icon-container`,children:u(l,{data:m,size:24})}),x&&u(r,{$active:S,$disabled:v,variant:`button`,group:`navigation`,children:_})]})})}),[v,w,m,S,x,_,b]);return y?u(p,{featureUuid:y,children:T}):T};export{m as BasicMenuItem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{useSideBar as n}from"../../../providers/SideBarProvider.js";import{usePrevious as r}from"../../../atoms/hooks/usePrevious.js";import{OptionalTooltip as i}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as a,ItemText as o,Link as s,MenuItemWrapper as c}from"./MenuItem.styles.js";import{
|
|
1
|
+
import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{useSideBar as n}from"../../../providers/SideBarProvider.js";import{usePrevious as r}from"../../../atoms/hooks/usePrevious.js";import{OptionalTooltip as i}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as a,ItemText as o,Link as s,MenuItemWrapper as c}from"./MenuItem.styles.js";import{useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Icon as p,Menu as m}from"@equinor/eds-core-react";import h,{css as g}from"styled-components";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{chevron_down as b,chevron_up as x}from"@equinor/eds-icons";import{Link as S,useLocation as C,useMatchRoute as w}from"@tanstack/react-router";const T=h.button`
|
|
2
2
|
position: relative;
|
|
3
3
|
width: 100%;
|
|
4
4
|
display: grid;
|
|
@@ -23,7 +23,7 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
${({$open:t})=>!t&&
|
|
26
|
+
${({$open:t})=>!t&&g`
|
|
27
27
|
&:after {
|
|
28
28
|
position: absolute;
|
|
29
29
|
right: -7px; // 1px border offset from 8px width
|
|
@@ -38,11 +38,11 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
|
|
|
38
38
|
z-index: 500;
|
|
39
39
|
}
|
|
40
40
|
`}
|
|
41
|
-
`,E=
|
|
41
|
+
`,E=h(s)`
|
|
42
42
|
display: grid;
|
|
43
43
|
grid-template-columns: 32px 1fr;
|
|
44
44
|
height: unset;
|
|
45
45
|
> p:first-child {
|
|
46
46
|
grid-column: 2;
|
|
47
47
|
}
|
|
48
|
-
`,D=({icon:t,name:s,items:g
|
|
48
|
+
`,D=({icon:t,name:s,items:h,...g})=>{let{pathname:D}=C(),O=w(),k=r(D),{isOpen:A}=n(),j=r(A),M=h.some(e=>!!O({...e})),N=d(null),[P,F]=f(!1),I=()=>F(e=>!e);l(()=>{(j&&!A&&P||k!==D&&P&&!A)&&F(!1)},[P,A,D,j,k]);let L=u(()=>v(i,{title:s,placement:`right`,children:v(c,{children:y(T,{ref:N,$open:A,$active:M,$expanded:P,onClick:I,...g,children:[v(a,{"data-testid":`icon-container`,children:v(p,{data:t,size:24,color:e.interactive.primary__resting.rgba})}),A&&y(_,{children:[v(o,{$active:!1,$disabled:!1,variant:`button`,group:`navigation`,children:s}),v(p,{data:P?x:b,size:24,color:e.interactive.primary__resting.rgba})]})]})})}),[P,t,M,A,s,g]);return P&&A?y(_,{children:[L,h.map((e,t)=>v(E,{$disabled:e.disabled||!1,...e,children:v(o,{$active:M,$disabled:e.disabled||!1,variant:`button`,group:`navigation`,children:e.name})},t))]}):P?y(_,{children:[L,v(m,{open:!0,anchorEl:N.current,placement:`right-start`,onClose:I,children:h.map(e=>v(m.Item,{as:S,active:!!O({...e}),style:{width:`256px`},...e,children:e.name},`${e.to}-${e.name}`))})]}):L};export{D as CollapsableMenuItem};
|
|
@@ -10,7 +10,6 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
|
|
|
10
10
|
gap: ${t.medium};
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
border-bottom: 1px solid ${e.ui.background__medium.rgba};
|
|
13
|
-
background: ${({$active:t})=>t&&e.interactive.primary__selected_highlight.rgba};
|
|
14
13
|
text-decoration: none;
|
|
15
14
|
transition: background 0.1s ease-out;
|
|
16
15
|
> div > svg {
|
|
@@ -19,9 +18,15 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
|
|
|
19
18
|
&:hover {
|
|
20
19
|
cursor: ${({$disabled:e})=>!e&&`pointer`};
|
|
21
20
|
text-decoration: none;
|
|
22
|
-
background: ${({$
|
|
21
|
+
background: ${({$disabled:t})=>!t&&e.interactive.primary__hover_alt.rgba};
|
|
23
22
|
> div > svg {
|
|
24
|
-
fill: ${({$disabled:t
|
|
23
|
+
fill: ${({$disabled:t})=>t?e.interactive.disabled__text.rgba:e.interactive.primary__hover.rgba};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
&[data-status='active'] {
|
|
27
|
+
background: ${e.interactive.primary__selected_highlight.rgba};
|
|
28
|
+
&:hover {
|
|
29
|
+
background: ${e.interactive.primary__selected_hover.rgba};
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
`),s=r.div`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=({
|
|
1
|
+
const e=({isActive:e,disabled:t,replace:n})=>!t&&(!e||e&&n);export{e as canNavigate};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react150 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/Action.d.ts
|
|
4
4
|
interface ActionProps {
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
buttonText?: string;
|
|
7
7
|
}
|
|
8
|
-
declare const Action:
|
|
8
|
+
declare const Action: react150.ForwardRefExoticComponent<ActionProps & react150.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Action };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react148 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/Description.d.ts
|
|
4
4
|
interface DescriptionProps {
|
|
5
5
|
text?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const Description:
|
|
7
|
+
declare const Description: react148.ForwardRefExoticComponent<DescriptionProps & react148.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Description };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react146 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/MissingAccesses.d.ts
|
|
4
4
|
interface AccessType {
|
|
@@ -9,6 +9,6 @@ interface MissingAccessesProps {
|
|
|
9
9
|
accesses?: AccessType[];
|
|
10
10
|
text?: string;
|
|
11
11
|
}
|
|
12
|
-
declare const MissingAccesses:
|
|
12
|
+
declare const MissingAccesses: react146.ForwardRefExoticComponent<MissingAccessesProps & react146.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { MissingAccesses };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react144 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/Title.d.ts
|
|
4
4
|
interface TitleProps {
|
|
5
5
|
title?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const Title:
|
|
7
|
+
declare const Title: react144.ForwardRefExoticComponent<TitleProps & react144.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Title };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/BadRequest.d.ts
|
|
4
4
|
interface BadRequestProps {
|
|
@@ -12,6 +12,6 @@ declare const BadRequest: ({
|
|
|
12
12
|
redirectFallbackUrl,
|
|
13
13
|
onBackClick,
|
|
14
14
|
hideBackButton
|
|
15
|
-
}: BadRequestProps) =>
|
|
15
|
+
}: BadRequestProps) => react_jsx_runtime9.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { BadRequest };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/GenericError.d.ts
|
|
4
4
|
interface GenericErrorProps {
|
|
@@ -14,6 +14,6 @@ declare const GenericError: ({
|
|
|
14
14
|
redirectFallbackUrl,
|
|
15
15
|
onBackClick,
|
|
16
16
|
hideBackButton
|
|
17
|
-
}: GenericErrorProps) =>
|
|
17
|
+
}: GenericErrorProps) => react_jsx_runtime11.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { GenericError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/MissingPermissions.d.ts
|
|
4
4
|
interface MissingPermissionsProps {
|
|
@@ -14,6 +14,6 @@ declare const MissingPermissions: ({
|
|
|
14
14
|
redirectFallbackUrl,
|
|
15
15
|
onBackClick,
|
|
16
16
|
hideBackButton
|
|
17
|
-
}: MissingPermissionsProps) =>
|
|
17
|
+
}: MissingPermissionsProps) => react_jsx_runtime8.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { MissingPermissions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/PageNotFound.d.ts
|
|
4
4
|
interface PageNotFoundProps {
|
|
@@ -12,6 +12,6 @@ declare const PageNotFound: ({
|
|
|
12
12
|
redirectFallbackUrl,
|
|
13
13
|
onBackClick,
|
|
14
14
|
hideBackButton
|
|
15
|
-
}: PageNotFoundProps) =>
|
|
15
|
+
}: PageNotFoundProps) => react_jsx_runtime10.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { PageNotFound };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ToggleGroup as ToggleGroup$1 } from "./ToggleGroup.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react137 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/ToggleGroup/ToggleGroup.d.ts
|
|
5
|
-
declare const ToggleGroup:
|
|
5
|
+
declare const ToggleGroup: react137.ForwardRefExoticComponent<ToggleGroup$1 & react137.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ToggleGroup };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ToggleGroupOption as ToggleGroupOption$1 } from "./ToggleGroup.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react135 from "react";
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/organisms/ToggleGroup/ToggleGroupOption.d.ts
|
|
6
6
|
type ToggleGroupOptionProps = ToggleGroupOption$1 & Omit<HTMLAttributes<HTMLButtonElement>, 'onToggle' | 'disabled'>;
|
|
7
|
-
declare const ToggleGroupOption:
|
|
7
|
+
declare const ToggleGroupOption: react135.ForwardRefExoticComponent<ToggleGroupOptionProps & react135.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ToggleGroupOption };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react143 from "react";
|
|
2
2
|
import { Dispatch, FC, ReactNode, SetStateAction } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/Notifications/NotificationProvider.d.ts
|
|
@@ -6,7 +6,7 @@ interface NotificationContext {
|
|
|
6
6
|
setIsOpen: Dispatch<SetStateAction<boolean>>;
|
|
7
7
|
isOpen: boolean;
|
|
8
8
|
}
|
|
9
|
-
declare const NotificationContext:
|
|
9
|
+
declare const NotificationContext: react143.Context<NotificationContext | undefined>;
|
|
10
10
|
declare const useNotification: () => NotificationContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNotification };
|