@equinor/amplify-component-lib 10.7.0 → 10.8.0
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/_virtual/rolldown_runtime.js +1 -1
- package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
- package/dist/atoms/hooks/useSelect.d.ts +3 -3
- package/dist/atoms/utils/environmentToggle.js +1 -0
- package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
- package/dist/deprecated/IconToggleButton.d.ts +2 -2
- package/dist/molecules/Chip/Chip.d.ts +2 -2
- package/dist/molecules/Dialog/Dialog.d.ts +2 -2
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- package/dist/molecules/ListItem/ListItem.d.ts +2 -2
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
- package/dist/organisms/Filter/Filter.d.ts +2 -2
- package/dist/organisms/Filter/QuickFilter.d.ts +2 -2
- package/dist/organisms/SideBar/SideBar.d.ts +2 -2
- 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/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
- package/dist/organisms/TopBar/Account/Account.d.ts +1 -0
- package/dist/organisms/TopBar/Account/Account.js +1 -1
- package/dist/organisms/TopBar/Account/Account.styles.js +13 -5
- package/dist/organisms/TopBar/Account/AccountAvatar.js +8 -7
- package/dist/organisms/TopBar/Account/AccountButton.js +5 -5
- package/dist/organisms/TopBar/Account/EnvironmentToggle.js +1 -0
- package/dist/organisms/TopBar/Account/ImpersonateMenu/DeleteUser/DeleteUser.js +1 -1
- package/dist/organisms/TopBar/Account/StatusAvatar.js +7 -0
- package/dist/organisms/TopBar/Account/StatusChips.js +1 -0
- package/dist/organisms/TopBar/Actions.d.ts +2 -2
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
- package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
- package/package.json +3 -3
- package/dist/organisms/TopBar/Account/ImpersonateAvatar.js +0 -8
- package/dist/organisms/TopBar/Account/RoleChips.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=t=>{let
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n&&e(r,Symbol.toStringTag,{value:`Module`}),r};export{t as __export};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react127 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, react127.Dispatch<react127.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 react129 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: react129.RefObject<HTMLInputElement | null>;
|
|
20
|
+
itemRefs: react129.RefObject<(HTMLButtonElement | null)[]>;
|
|
21
21
|
selectedValues: T[];
|
|
22
22
|
open: boolean;
|
|
23
23
|
tryingToRemoveItem: T | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{colors as e}from"../style/colors.js";function t(e){return e.charAt(0).toUpperCase()+e.slice(1).replaceAll(`-`,` `)}const n={combined:{border:e.interactive.success__resting.rgba,background:e.interactive.warning__text.rgba,chipBackground:e.interactive.warning__resting.rgba,outline:e.interactive.success__resting.rgba},environment:{border:e.interactive.success__resting.rgba,background:e.interactive.success__text.rgba,chipBackground:e.interactive.success__resting.rgba,outline:e.interactive.success__resting.rgba},impersonate:{border:e.interactive.warning__resting.rgba,background:e.interactive.warning__text.rgba,chipBackground:e.interactive.warning__resting.rgba,outline:e.interactive.warning__resting.rgba}},r={border:e.interactive.warning__resting.rgba,background:e.interactive.warning__text.rgba,chipBackground:e.interactive.warning__resting.rgba,outline:e.interactive.warning__resting.rgba};function i(e){return e?n[e]:r}export{t as formatFeatureName,i as getVariantColors};
|
|
@@ -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 react1 from "react";
|
|
2
2
|
import { IconData } from "@equinor/eds-icons";
|
|
3
3
|
|
|
4
4
|
//#region src/deprecated/IconToggleButton.d.ts
|
|
@@ -21,6 +21,6 @@ interface IconToggleButtonProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* @deprecated Being deprecated from amplify-component-lib move into app if you want the implementation
|
|
23
23
|
*/
|
|
24
|
-
declare const IconToggleButton:
|
|
24
|
+
declare const IconToggleButton: react1.ForwardRefExoticComponent<IconToggleButtonProps & react1.RefAttributes<HTMLButtonElement>>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { IconToggleButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react5 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: react5.ForwardRefExoticComponent<ChipProps & react5.RefAttributes<HTMLDivElement | HTMLButtonElement>>;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { BaseChipProps, Chip, ClickableChipProps, DeletableChipProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react7 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: react7.ForwardRefExoticComponent<DialogProps$1 & react7.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 react13 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: react13.ForwardRefExoticComponent<EquinorLogoProps & react13.RefAttributes<SVGSVGElement>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { EquinorLogo, EquinorLogoProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react102 from "react";
|
|
2
2
|
import { FocusEventHandler, HTMLAttributes, MouseEventHandler, ReactNode } from "react";
|
|
3
3
|
import { IconData } from "@equinor/eds-icons";
|
|
4
4
|
|
|
@@ -15,6 +15,6 @@ interface ListItemProps extends HTMLAttributes<HTMLButtonElement> {
|
|
|
15
15
|
isChild?: boolean;
|
|
16
16
|
borderBottom?: boolean;
|
|
17
17
|
}
|
|
18
|
-
declare const ListItem:
|
|
18
|
+
declare const ListItem: react102.ForwardRefExoticComponent<ListItemProps & react102.RefAttributes<HTMLButtonElement>>;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { ListItem, ListItemProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react100 from "react";
|
|
2
2
|
import { CheckboxProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/SelectionControls/Checkbox/Checkbox.d.ts
|
|
@@ -7,6 +7,6 @@ interface CheckboxProps$1 extends CheckboxProps {
|
|
|
7
7
|
outlined?: boolean;
|
|
8
8
|
error?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const Checkbox$1:
|
|
10
|
+
declare const Checkbox$1: react100.ForwardRefExoticComponent<CheckboxProps$1 & react100.RefAttributes<HTMLInputElement>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Checkbox$1 as Checkbox, CheckboxProps$1 as CheckboxProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterProps } from "./Filter.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/Filter/Filter.d.ts
|
|
5
5
|
|
|
@@ -32,6 +32,6 @@ declare function Filter<T extends string>({
|
|
|
32
32
|
id,
|
|
33
33
|
openOnFocus,
|
|
34
34
|
...rest
|
|
35
|
-
}: FilterProps<T>):
|
|
35
|
+
}: FilterProps<T>): react_jsx_runtime7.JSX.Element;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { Filter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectOptionRequired } from "../../molecules/Select/Select.types.js";
|
|
2
2
|
import { FilterProps } from "./Filter.types.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/organisms/Filter/QuickFilter.d.ts
|
|
6
6
|
interface QuickFilterProps<T extends string> {
|
|
@@ -14,6 +14,6 @@ declare function QuickFilter<T extends string>({
|
|
|
14
14
|
items,
|
|
15
15
|
onQuickFilter,
|
|
16
16
|
label
|
|
17
|
-
}: QuickFilterProps<T>):
|
|
17
|
+
}: QuickFilterProps<T>): react_jsx_runtime6.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { QuickFilter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react132 from "react";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/SideBar/SideBar.d.ts
|
|
@@ -16,6 +16,6 @@ interface SideBarWithCreate extends SideBarProps {
|
|
|
16
16
|
createDisabled?: boolean;
|
|
17
17
|
createActive?: boolean;
|
|
18
18
|
}
|
|
19
|
-
declare const SideBar:
|
|
19
|
+
declare const SideBar: react132.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react132.RefAttributes<HTMLDivElement>>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { SideBar };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react138 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: react138.ForwardRefExoticComponent<ActionProps & react138.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Action };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react140 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: react140.ForwardRefExoticComponent<DescriptionProps & react140.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Description };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react142 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: react142.ForwardRefExoticComponent<MissingAccessesProps & react142.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_runtime8 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_runtime8.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { BadRequest };
|
|
@@ -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/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_runtime9.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { GenericError };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ToggleGroup } from "./ToggleGroup.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react148 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/ToggleGroup/ToggleGroup.d.ts
|
|
5
|
-
declare const ToggleGroup$1:
|
|
5
|
+
declare const ToggleGroup$1: react148.ForwardRefExoticComponent<ToggleGroup & react148.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ToggleGroup$1 as ToggleGroup };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ToggleGroupOption } from "./ToggleGroup.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react146 from "react";
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/organisms/ToggleGroup/ToggleGroupOption.d.ts
|
|
6
6
|
type ToggleGroupOptionProps = ToggleGroupOption & Omit<HTMLAttributes<HTMLButtonElement>, 'onToggle' | 'disabled'>;
|
|
7
|
-
declare const ToggleGroupOption$1:
|
|
7
|
+
declare const ToggleGroupOption$1: react146.ForwardRefExoticComponent<ToggleGroupOptionProps & react146.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ToggleGroupOption$1 as ToggleGroupOption };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EnvironmentType as e}from"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import{useAuth as
|
|
1
|
+
import{EnvironmentType as e}from"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import{useAuth as ee}from"../../../providers/AuthProvider/AuthProvider.js";import{useLocalStorage as n}from"../../../atoms/hooks/useLocalStorage.js";import{Button as r}from"../../../molecules/Button/Button.js";import{TopBarMenu as i}from"../TopBarMenu.js";import{useActiveImpersonationUser as a}from"./ImpersonateMenu/hooks/useActiveImpersonationUser.js";import{useCanImpersonate as o}from"./ImpersonateMenu/hooks/useCanImpersonate.js";import{useMappedRoles as s}from"./ImpersonateMenu/hooks/useMappedRoles.js";import{useStopImpersonation as c}from"./ImpersonateMenu/hooks/useStopImpersonation.js";import{ButtonWrapper as l,Container as u,EnvironmentToggleWrapper as d,TextContent as f}from"./Account.styles.js";import{impersonateUserDtoToFullName as p}from"./ImpersonateMenu/Impersonate.utils.js";import{ImpersonateMenu as m}from"./ImpersonateMenu/ImpersonateMenu.js";import{AccountAvatar as h}from"./AccountAvatar.js";import{AccountButton as te}from"./AccountButton.js";import{ActiveUserImpersonationButton as ne}from"./ActiveUserImpersonationButton.js";import{ImpersonateButton as re}from"./ImpersonateButton.js";import{RoleList as ie}from"./RoleList.js";import{EnvironmentToggle as ae}from"./EnvironmentToggle.js";import{StatusChips as g}from"./StatusChips.js";import{useCallback as _,useEffect as v,useMemo as y,useRef as b,useState as x}from"react";import{Icon as S,Typography as C}from"@equinor/eds-core-react";import{Fragment as w,jsx as T,jsxs as E}from"react/jsx-runtime";import{log_out as D}from"@equinor/eds-icons";import{ENVIRONMENT_TOGGLE_KEY as O}from"@equinor/subsurface-app-management";const k=({renderCustomButton:k,hideRoles:A=!1,useDisplayNameForRole:j=!1,children:M,availableFields:N,availableWells:P,enableEnvironmentToggle:F=!1})=>{let I=t.getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME),oe=t.getApiClientId(import.meta.env.VITE_API_CLIENT_ID),L=t.getAppName(import.meta.env.VITE_NAME),{account:R,roles:z,logout:B}=ee(),[V,H]=x(!1),[U,W]=x(!1),[G,K]=n(O,[]),q=b(null),{data:se=!0}=o(),{data:J}=a(),{mutate:Y}=c(),X=s(J?J.roles:z??[],j),ce=J?p(J):R?.name,le=J?J.uniqueName:R?.username,Z=()=>H(!1),Q=_(()=>{H(e=>!e),W(!1)},[]),$=()=>{W(!0),H(!1)};return v(()=>{J&&J.appName!=null&&J.appName.toUpperCase()!=L.toUpperCase()&&Y()},[J,L,Y]),E(w,{children:[y(()=>k?k(q,Q):null,[k,Q])||T(te,{ref:q,onClick:Q,environmentToggle:G}),E(i,{open:V,title:`Account`,onClose:Z,anchorEl:q.current,children:[E(u,{children:[J&&T(ne,{onClick:$}),T(h,{environmentToggle:G}),E(f,{children:[T(C,{variant:`h6`,children:ce}),T(C,{children:le})]}),G.length>0&&T(g,{statuses:G}),X&&!A&&T(w,{children:X.length<=3?T(g,{statuses:X}):T(ie,{roles:X})}),M,se&&I!==e.PRODUCTION&&oe&&T(re,{onOpenImpersonateMenu:$,onClose:Z})]}),F&&I!==e.PRODUCTION&&T(d,{children:T(ae,{setEnvironmentToggle:K,environmentToggle:G})}),T(l,{children:E(r,{variant:`ghost`,onClick:B,children:[T(S,{data:D}),`Log out`]})})]}),T(m,{open:U,onClose:()=>W(!1),anchorEl:q.current,availableFields:N,availableWells:P})]})};k.displayName=`TopBar.Account`;export{k as Account};
|
|
@@ -11,14 +11,22 @@ import{animation as e}from"../../../atoms/style/animation.js";import{colors as t
|
|
|
11
11
|
align-items: center;
|
|
12
12
|
gap: ${n.small};
|
|
13
13
|
`,c=a.div`
|
|
14
|
+
padding: ${n.medium} ${n.medium} 0 ${n.medium};
|
|
14
15
|
display: flex;
|
|
15
16
|
flex-direction: column;
|
|
16
|
-
align-items:
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
gap: ${n.small};
|
|
17
19
|
`,l=a.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
align-items: center;
|
|
23
|
+
`,u=a.div`
|
|
18
24
|
display: grid;
|
|
25
|
+
grid-auto-flow: column;
|
|
19
26
|
margin-top: ${n.x_large};
|
|
20
27
|
justify-content: center;
|
|
21
|
-
|
|
28
|
+
gap: ${n.small};
|
|
29
|
+
`,d=a.button`
|
|
22
30
|
display: grid;
|
|
23
31
|
grid-template-columns: auto 1fr auto;
|
|
24
32
|
align-items: center;
|
|
@@ -40,7 +48,7 @@ import{animation as e}from"../../../atoms/style/animation.js";import{colors as t
|
|
|
40
48
|
&:hover {
|
|
41
49
|
background: ${t.interactive.primary__hover_alt.rgba};
|
|
42
50
|
}
|
|
43
|
-
`,
|
|
51
|
+
`,f=a.section`
|
|
44
52
|
display: flex;
|
|
45
53
|
flex-wrap: wrap;
|
|
46
54
|
justify-content: center;
|
|
@@ -50,8 +58,8 @@ import{animation as e}from"../../../atoms/style/animation.js";import{colors as t
|
|
|
50
58
|
overflow-x: hidden;
|
|
51
59
|
gap: ${n.small};
|
|
52
60
|
margin-top: ${n.small};
|
|
53
|
-
`,
|
|
61
|
+
`,p=a(i)`
|
|
54
62
|
background: ${t.ui.background__light.rgba};
|
|
55
63
|
border: 1px solid ${t.ui.background__medium.rgba};
|
|
56
64
|
color: ${t.text.static_icons__default.rgba};
|
|
57
|
-
`;export{
|
|
65
|
+
`;export{u as ButtonWrapper,s as Container,c as EnvironmentToggleWrapper,d as OpenImpersonationMenuButton,o as ProfileButton,p as RoleChip,f as RolesContainer,l as TextContent};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{spacings as e}from"../../../atoms/style/spacings.js";import{useAuth as t}from"../../../providers/AuthProvider/AuthProvider.js";import{Chip as n}from"../../../molecules/Chip/Chip.js";import{ProfileAvatar as r}from"../../../molecules/ProfileAvatar/ProfileAvatar.js";import{useActiveImpersonationUser as i}from"./ImpersonateMenu/hooks/useActiveImpersonationUser.js";import{getVariantColors as a}from"../../../atoms/utils/environmentToggle.js";import{StatusAvatar as o}from"./StatusAvatar.js";import{impersonateUserDtoToFullName as s}from"./ImpersonateMenu/Impersonate.utils.js";import c from"styled-components";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";const f=c.div`
|
|
2
2
|
position: relative;
|
|
3
|
-
margin-bottom: ${
|
|
4
|
-
`,
|
|
3
|
+
margin-bottom: ${e.small};
|
|
4
|
+
`,p=c(n)`
|
|
5
5
|
position: absolute;
|
|
6
|
-
bottom: calc(${
|
|
6
|
+
bottom: calc(${e.x_small} * -1);
|
|
7
7
|
left: 50%;
|
|
8
8
|
transform: translateX(-50%);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
background: ${({$variant:e})=>a(e).chipBackground};
|
|
11
|
+
outline-color: ${({$variant:e})=>a(e).outline};
|
|
12
|
+
`,m=({environmentToggle:e})=>{let{account:n,photo:a}=t(),{data:c}=i(),m=c?s(c):n?.name,h=e!=null&&e.length>0,g=e==null?``:e.map(e=>e.label).join(`, `);return u(f,{children:(()=>h&&c?d(l,{children:[u(o,{size:64,variant:`combined`,name:`Impersonate & Environment`}),u(p,{$variant:`combined`,children:`Impersonate & Environment`})]}):h?d(l,{children:[u(o,{size:64,variant:`environment`,name:g}),u(p,{$variant:`environment`,children:`Environment`})]}):c?d(l,{children:[u(o,{size:64,variant:`impersonate`,name:m}),u(p,{$variant:`impersonate`,children:`Impersonating`})]}):u(r,{size:64,name:n?.name,url:a}))()})};export{m as AccountAvatar};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{spacings as e}from"../../../atoms/style/spacings.js";import{useAuth as t}from"../../../providers/AuthProvider/AuthProvider.js";import{Chip as n}from"../../../molecules/Chip/Chip.js";import{ProfileAvatar as r}from"../../../molecules/ProfileAvatar/ProfileAvatar.js";import{useActiveImpersonationUser as i}from"./ImpersonateMenu/hooks/useActiveImpersonationUser.js";import{ProfileButton as a}from"./Account.styles.js";import{formatFeatureName as o,getVariantColors as s}from"../../../atoms/utils/environmentToggle.js";import{StatusAvatar as c}from"./StatusAvatar.js";import{forwardRef as l}from"react";import u from"styled-components";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p=u.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
gap: ${
|
|
5
|
-
`,
|
|
6
|
-
background: ${e.
|
|
4
|
+
gap: ${e.xx_small};
|
|
5
|
+
`,m=u(n)`
|
|
6
|
+
background: ${({$variant:e})=>s(e).chipBackground};
|
|
7
7
|
outline: none;
|
|
8
8
|
padding: 0;
|
|
9
|
-
`,
|
|
9
|
+
`,h=l(({onClick:e,environmentToggle:n},s)=>{let{account:l,photo:u}=t(),{data:h}=i(),g=n!=null&&n.length>0,_=n==null?[]:n.map(e=>o(e.value)),v=h?.roles?.sort()??[];return f(p,{children:[v.at(0)&&d(m,{$variant:`impersonate`,children:v[0]}),v.length>1&&d(m,{$variant:`impersonate`,children:`+${v.length-1}`}),g&&_.at(0)&&d(m,{$variant:`environment`,children:_[0]}),_.length>1&&d(m,{$variant:`environment`,children:`+${_.length-1}`}),d(a,{ref:s,onClick:e,children:(()=>g&&h?d(c,{size:36,variant:`combined`}):g?d(c,{size:36,name:n.map(e=>e.value).join(`, `),variant:`environment`}):h?d(c,{size:36,variant:`impersonate`}):d(r,{size:36,name:l?.name,url:u}))()})]})});h.displayName=`AccountButton`;export{h as AccountButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ComboBox as e}from"../../../molecules/Select/ComboBox/ComboBox.js";import{formatFeatureName as t}from"../../../atoms/utils/environmentToggle.js";import{useState as n}from"react";import{jsx as r}from"react/jsx-runtime";import{EnvironmentToggleFeatures as i}from"@equinor/subsurface-app-management";import{useQueryClient as a}from"@tanstack/react-query";const o=({environmentToggle:o,setEnvironmentToggle:s})=>{let c=a(),[l,u]=n(!1);return r(e,{loading:l,items:Object.values(i).map(e=>({value:e.toString(),label:t(e)})),values:o,onSelect:e=>{s(e),u(!0),setTimeout(()=>{c.invalidateQueries(),u(!1)},2e3)},placeholder:`Set current environment for feature`,helperText:`This will use current environment for selected features.`})};export{o as EnvironmentToggle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../../../../atoms/style/colors.js";import{useSnackbar as t}from"../../../../../providers/SnackbarProvider/SnackbarProvider.js";import{Button as n}from"../../../../../molecules/Button/Button.js";import{Header as r}from"../Impersonate.styles.js";import{useDeleteImpersonation as i}from"../hooks/useDeleteImpersonation.js";import{Container as a}from"./DeleteUser.styles.js";import{RoleChip as o,RolesContainer as s,TextContent as c}from"../../Account.styles.js";import{
|
|
1
|
+
import{colors as e}from"../../../../../atoms/style/colors.js";import{useSnackbar as t}from"../../../../../providers/SnackbarProvider/SnackbarProvider.js";import{Button as n}from"../../../../../molecules/Button/Button.js";import{Header as r}from"../Impersonate.styles.js";import{useDeleteImpersonation as i}from"../hooks/useDeleteImpersonation.js";import{Container as a}from"./DeleteUser.styles.js";import{RoleChip as o,RolesContainer as s,TextContent as c}from"../../Account.styles.js";import{StatusAvatar as l}from"../../StatusAvatar.js";import{DotProgress as u,Icon as d,Typography as f}from"@equinor/eds-core-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{arrow_back as h,delete_to_trash as g}from"@equinor/eds-icons";const _=({user:_,onBack:v})=>{let{mutateAsync:y,isPending:b}=i(),{showSnackbar:x}=t(),S=`${_.firstName} ${_.lastName}`;return m(a,{children:[m(r,{children:[p(n,{variant:`ghost_icon`,onClick:v,children:p(d,{data:h})}),p(f,{variant:`h6`,children:`Delete user`})]}),m(`section`,{children:[p(f,{variant:`h4`,children:`You are deleting a user`}),m(f,{variant:`caption`,color:e.text.static_icons__tertiary.rgba,children:[`Are you sure you want to delete user "`,S,`"?`]})]}),p(l,{size:64,name:S,variant:`impersonate`}),m(c,{children:[p(f,{variant:`h6`,children:S}),p(f,{children:_.uniqueName})]}),p(s,{children:_.roles.map(e=>p(o,{children:e},e))}),m(`div`,{children:[b?p(n,{variant:`outlined`,color:`danger`,children:p(u,{color:`tertiary`})}):m(n,{variant:`outlined`,color:`danger`,onClick:async()=>{await y(_),x(`Deleted user "${S}" successfully`),v()},children:[p(d,{data:g}),` Delete user`]}),p(n,{variant:`ghost`,onClick:v,children:`Cancel`})]})]})};export{_ as DeleteUser};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{ProfileAvatar as e}from"../../../molecules/ProfileAvatar/ProfileAvatar.js";import{getVariantColors as t}from"../../../atoms/utils/environmentToggle.js";import n from"styled-components";import{jsx as r}from"react/jsx-runtime";const i=n.div`
|
|
2
|
+
width: fit-content;
|
|
3
|
+
border: 2px solid ${({$variant:e})=>t(e).border};
|
|
4
|
+
border-radius: 50%;
|
|
5
|
+
> div:first-child {
|
|
6
|
+
background: ${({$variant:e})=>t(e).background}
|
|
7
|
+
`,a=({size:t,name:n,variant:a})=>r(i,{$variant:a,children:r(e,{size:t,name:n??`Environment`})});export{a as StatusAvatar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{RoleChip as e,RolesContainer as t}from"./Account.styles.js";import{jsx as n}from"react/jsx-runtime";const r=({statuses:r})=>n(t,{children:r?.map(t=>n(e,{children:t.label},t.value))});export{r as StatusChips};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react134 from "react";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/Actions.d.ts
|
|
5
|
-
declare const Actions:
|
|
5
|
+
declare const Actions: react134.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react134.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Actions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Field } from "../../../atoms/types/Field.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react136 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/FieldMenu/FieldMenu.d.ts
|
|
5
5
|
interface FieldMenuProps {
|
|
@@ -8,6 +8,6 @@ interface FieldMenuProps {
|
|
|
8
8
|
itemNameSingular?: string;
|
|
9
9
|
showAccessITLink?: boolean;
|
|
10
10
|
}
|
|
11
|
-
declare const FieldMenu:
|
|
11
|
+
declare const FieldMenu: react136.ForwardRefExoticComponent<FieldMenuProps & react136.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { FieldMenu };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react131 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: react131.Context<NotificationContext | undefined>;
|
|
10
10
|
declare const useNotification: () => NotificationContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNotification };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/amplify-component-lib",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.0",
|
|
4
4
|
"description": "Frontend Typescript components for the Amplify team",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@equinor/eds-icons": "^0.22.0",
|
|
56
|
-
"@equinor/subsurface-app-management": "5.
|
|
56
|
+
"@equinor/subsurface-app-management": "5.2.0",
|
|
57
57
|
"@eslint/js": "^9.22.0",
|
|
58
58
|
"@faker-js/faker": "^9.6.0",
|
|
59
59
|
"@storybook/addon-coverage": "^2.0.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"@equinor/eds-core-react": "0.44.0",
|
|
115
115
|
"@equinor/eds-data-grid-react": "^0.7.5",
|
|
116
116
|
"@equinor/eds-icons": "*",
|
|
117
|
-
"@equinor/subsurface-app-management": "^5.
|
|
117
|
+
"@equinor/subsurface-app-management": "^5.2.0",
|
|
118
118
|
"@tanstack/react-query": "*",
|
|
119
119
|
"@tanstack/react-router": "*",
|
|
120
120
|
"@tiptap/core": "^3.1.0",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{colors as e}from"../../../atoms/style/colors.js";import{ProfileAvatar as t}from"../../../molecules/ProfileAvatar/ProfileAvatar.js";import{useActiveImpersonationUser as n}from"./ImpersonateMenu/hooks/useActiveImpersonationUser.js";import r from"styled-components";import{jsx as i}from"react/jsx-runtime";const a=r.div`
|
|
2
|
-
width: fit-content;
|
|
3
|
-
border: 2px solid ${e.interactive.warning__resting.rgba};
|
|
4
|
-
border-radius: 50%;
|
|
5
|
-
> div:first-child {
|
|
6
|
-
background: ${e.interactive.warning__text.rgba};
|
|
7
|
-
}
|
|
8
|
-
`,o=({size:e,fullName:r})=>{let{data:o}=n();return i(a,{children:i(t,{size:e,name:r||o?.firstName})})};export{o as ImpersonateAvatar};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{RoleChip as e,RolesContainer as t}from"./Account.styles.js";import{jsx as n}from"react/jsx-runtime";const r=({roles:r})=>n(t,{children:r.map(t=>n(e,{children:t.label},t.value))});export{r as RoleChips};
|