@equinor/amplify-component-lib 10.0.6 → 10.2.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/atoms/hooks/useLocalStorage.d.ts +2 -2
- package/dist/atoms/hooks/useSelect.d.ts +3 -3
- package/dist/atoms/hooks/useStatusNavigation.d.ts +19 -0
- package/dist/atoms/hooks/useStatusNavigation.js +1 -0
- package/dist/atoms/index.d.ts +1 -0
- package/dist/atoms/index.js +1 -1
- package/dist/atoms/style/colors.d.ts +3 -0
- package/dist/atoms/style/colors.js +1 -1
- package/dist/atoms/style/darkTokens.js +1 -0
- package/dist/atoms/style/lightTokens.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/molecules/Badge/Badge.styles.js +1 -1
- 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/ListItem/ListItem.d.ts +2 -2
- package/dist/molecules/OptionDrawer/OptionDrawer.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/MenuBar/MenuBar.d.ts +5 -5
- package/dist/molecules/Search/Search.d.ts +2 -2
- package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
- package/dist/molecules/Select/Select.styles.d.ts +4 -4
- package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
- package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
- package/dist/molecules/SelectionControls/Switch/Switch.d.ts +2 -2
- package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.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/Filter/SortMenu.d.ts +2 -2
- package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.js +1 -1
- 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 +13 -2
- package/dist/organisms/Status/collections/BadRequest.js +2 -2
- package/dist/organisms/Status/collections/GenericError.d.ts +15 -2
- package/dist/organisms/Status/collections/GenericError.js +1 -1
- package/dist/organisms/Status/collections/MissingPermissions.d.ts +15 -2
- package/dist/organisms/Status/collections/MissingPermissions.js +1 -1
- package/dist/organisms/Status/collections/PageNotFound.d.ts +13 -2
- package/dist/organisms/Status/collections/PageNotFound.js +1 -2
- package/dist/organisms/Status/collections/ServerError.d.ts +13 -2
- package/dist/organisms/Status/collections/ServerError.js +2 -2
- package/dist/organisms/TableOfContents/TableOfContents.constants.js +1 -1
- package/dist/organisms/TableOfContents/TableOfContents.d.ts +2 -3
- package/dist/organisms/TableOfContents/TableOfContents.js +1 -1
- package/dist/organisms/TableOfContents/TableOfContents.styles.js +56 -138
- package/dist/organisms/TableOfContents/TableOfContents.types.d.ts +2 -2
- package/dist/organisms/TableOfContents/TableOfContentsItem.js +1 -5
- 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/dist/providers/AuthProvider/AuthProviderInner.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react132 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: react132.ForwardRefExoticComponent<ActionProps & react132.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Action };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react130 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: react130.ForwardRefExoticComponent<DescriptionProps & react130.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Description };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react134 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: react134.ForwardRefExoticComponent<MissingAccessesProps & react134.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { MissingAccesses };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react128 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: react128.ForwardRefExoticComponent<TitleProps & react128.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Title };
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/BadRequest.d.ts
|
|
4
|
-
|
|
4
|
+
interface BadRequestProps {
|
|
5
|
+
description?: string;
|
|
6
|
+
redirectFallbackUrl?: string;
|
|
7
|
+
onBackClick?: () => void;
|
|
8
|
+
hideBackButton?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const BadRequest: ({
|
|
11
|
+
description,
|
|
12
|
+
redirectFallbackUrl,
|
|
13
|
+
onBackClick,
|
|
14
|
+
hideBackButton
|
|
15
|
+
}: BadRequestProps) => react_jsx_runtime10.JSX.Element;
|
|
5
16
|
//#endregion
|
|
6
17
|
export { BadRequest };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Status as e}from"../index.js";import{
|
|
1
|
+
import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({description:i=`We encountered some confusion regarding your request.
|
|
2
2
|
Please try again later, or if the issue persists, kindly report
|
|
3
|
-
it using the feedback form located in the top bar
|
|
3
|
+
it using the feedback form located in the top bar.`,redirectFallbackUrl:a,onBackClick:o,hideBackButton:s=!1})=>{let c=t({onBackClick:o,redirectFallbackUrl:a});return r(e,{color:`#AB9067`,children:[n(e.Title,{title:`Bad request`}),n(e.Description,{text:i}),!s&&n(e.Action,{onClick:c})]})};export{i as BadRequest};
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import
|
|
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 {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
redirectFallbackUrl?: string;
|
|
8
|
+
onBackClick?: () => void;
|
|
9
|
+
hideBackButton?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const GenericError: ({
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
redirectFallbackUrl,
|
|
15
|
+
onBackClick,
|
|
16
|
+
hideBackButton
|
|
17
|
+
}: GenericErrorProps) => react_jsx_runtime11.JSX.Element;
|
|
5
18
|
//#endregion
|
|
6
19
|
export { GenericError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Status as e}from"../index.js";import{
|
|
1
|
+
import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({title:i,description:a,redirectFallbackUrl:o,onBackClick:s,hideBackButton:c=!1})=>{let l=t({onBackClick:s,redirectFallbackUrl:o});return r(e,{children:[n(e.Title,{title:i}),n(e.Description,{text:a}),!c&&n(e.Action,{onClick:l})]})};export{i as GenericError};
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import
|
|
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 {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
redirectFallbackUrl?: string;
|
|
8
|
+
onBackClick?: () => void;
|
|
9
|
+
hideBackButton?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const MissingPermissions: ({
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
redirectFallbackUrl,
|
|
15
|
+
onBackClick,
|
|
16
|
+
hideBackButton
|
|
17
|
+
}: MissingPermissionsProps) => react_jsx_runtime8.JSX.Element;
|
|
5
18
|
//#endregion
|
|
6
19
|
export { MissingPermissions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Status as e}from"../index.js";import{
|
|
1
|
+
import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({title:i=`It looks like you don't have permission to access this page.`,description:a,redirectFallbackUrl:o,onBackClick:s,hideBackButton:c=!1})=>{let l=t({onBackClick:s,redirectFallbackUrl:o});return r(e,{children:[n(e.Title,{title:i}),a&&n(e.Description,{text:a}),!c&&n(e.Action,{onClick:l})]})};export{i as MissingPermissions};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/PageNotFound.d.ts
|
|
4
|
-
|
|
4
|
+
interface PageNotFoundProps {
|
|
5
|
+
description?: string;
|
|
6
|
+
redirectFallbackUrl?: string;
|
|
7
|
+
onBackClick?: () => void;
|
|
8
|
+
hideBackButton?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const PageNotFound: ({
|
|
11
|
+
description,
|
|
12
|
+
redirectFallbackUrl,
|
|
13
|
+
onBackClick,
|
|
14
|
+
hideBackButton
|
|
15
|
+
}: PageNotFoundProps) => react_jsx_runtime7.JSX.Element;
|
|
5
16
|
//#endregion
|
|
6
17
|
export { PageNotFound };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{Status as e}from"../index.js";import{
|
|
2
|
-
Please check the URL and try again.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as PageNotFound};
|
|
1
|
+
import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({description:i=`It looks like the page you're looking for has gone missing. Please check the URL and try again.`,redirectFallbackUrl:a,onBackClick:o,hideBackButton:s=!1})=>{let c=t({onBackClick:o,redirectFallbackUrl:a});return r(e,{center:!1,children:[n(e.Title,{title:`Page not found`}),n(e.Description,{text:i}),!s&&n(e.Action,{onClick:c})]})};export{i as PageNotFound};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/ServerError.d.ts
|
|
4
|
-
|
|
4
|
+
interface ServerErrorProps {
|
|
5
|
+
description?: string;
|
|
6
|
+
redirectFallbackUrl?: string;
|
|
7
|
+
onBackClick?: () => void;
|
|
8
|
+
hideBackButton?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const ServerError: ({
|
|
11
|
+
description,
|
|
12
|
+
redirectFallbackUrl,
|
|
13
|
+
onBackClick,
|
|
14
|
+
hideBackButton
|
|
15
|
+
}: ServerErrorProps) => react_jsx_runtime9.JSX.Element;
|
|
5
16
|
//#endregion
|
|
6
17
|
export { ServerError };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Status as e}from"../index.js";import{
|
|
1
|
+
import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({description:i=`Our server encountered an unexpected issue. Please try
|
|
2
2
|
again shortly, or reach out via the feedback form if the problem
|
|
3
|
-
continues
|
|
3
|
+
continues.`,redirectFallbackUrl:a,onBackClick:o,hideBackButton:s=!1})=>{let c=t({onBackClick:o,redirectFallbackUrl:a});return r(e,{color:`#C47E84`,children:[n(e.Title,{title:`Something is wrong on our servers`}),n(e.Description,{text:i}),!s&&n(e.Action,{onClick:c})]})};export{i as ServerError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=`34px`;export{e as VERTICAL_ITEM_HEIGHT};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TableOfContentsMode } from "./TableOfContents.types.js";
|
|
2
2
|
import { FC } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TableOfContents/TableOfContents.d.ts
|
|
5
5
|
interface TableOfContentsProps {
|
|
6
|
-
|
|
6
|
+
mode?: TableOfContentsMode;
|
|
7
7
|
onlyShowSelectedChildren?: boolean;
|
|
8
|
-
isLink?: boolean;
|
|
9
8
|
}
|
|
10
9
|
declare const TableOfContents: FC<TableOfContentsProps>;
|
|
11
10
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getValues as e}from"../../providers/TableOfContentsProvider.utils.js";import{useTableOfContents as t}from"../../providers/TableOfContentsProvider.js";import{
|
|
1
|
+
import{getValues as e}from"../../providers/TableOfContentsProvider.utils.js";import{useTableOfContents as t}from"../../providers/TableOfContentsProvider.js";import{Tabs as n}from"../../molecules/Tabs/Tabs.js";import{HorizontalItemsContainer as r,TableOfContentsContainer as i,VerticalItemsContainer as a}from"./TableOfContents.styles.js";import{TableOfContentsItem as o}from"./TableOfContentsItem.js";import{useMemo as s}from"react";import{jsx as c}from"react/jsx-runtime";const l=({mode:l=`vertical`,onlyShowSelectedChildren:u=!0})=>{let{items:d,selected:f,setSelected:p}=t(),m=s(()=>{for(let[t,n]of d.entries()){let r=e([],n);if(n.value===f||f&&r.includes(f))return t}return-1},[d,f]);return l===`horizontal`?c(r,{children:c(n,{selected:f,onChange:e=>{e&&p(e)},options:d})}):c(i,{className:`page-menu`,layoutRoot:!0,"data-testid":`table-of-contents-container`,children:d.map((e,t)=>c(a,{"data-testid":`border-items-container-${e.value}`,$index:t,$activeIndex:m,"aria-selected":m===t,children:c(o,{onlyShowSelectedChildren:u,...e})},e.value))})};export{l as TableOfContents};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{animation as e}from"../../atoms/style/animation.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{VERTICAL_ITEM_HEIGHT as r}from"./TableOfContents.constants.js";import i,{css as a}from"styled-components";import{motion as o}from"framer-motion";const s=i.button`
|
|
2
2
|
&:hover {
|
|
3
|
-
background: ${
|
|
3
|
+
background: ${t.interactive.primary__hover_alt.rgba};
|
|
4
4
|
}
|
|
5
5
|
${({$active:e})=>e?``:a`
|
|
6
6
|
&:focus:not(:hover) {
|
|
7
|
-
outline: 2px dashed ${
|
|
7
|
+
outline: 2px dashed ${t.interactive.focus.rgba};
|
|
8
8
|
outline-offset: -4px;
|
|
9
9
|
}
|
|
10
10
|
`}
|
|
@@ -13,10 +13,10 @@ import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
|
|
|
13
13
|
grid-template-columns: auto 1fr;
|
|
14
14
|
align-items: center;
|
|
15
15
|
gap: ${n.small};
|
|
16
|
-
color: ${
|
|
16
|
+
color: ${t.text.static_icons__default.rgba};
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
padding: 0 ${n.medium};
|
|
19
|
-
height: ${
|
|
19
|
+
min-height: ${r};
|
|
20
20
|
transition: background 200ms;
|
|
21
21
|
> span {
|
|
22
22
|
display: flex;
|
|
@@ -27,104 +27,46 @@ import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
|
|
|
27
27
|
font-weight: 700;
|
|
28
28
|
font-size: 14px;
|
|
29
29
|
}
|
|
30
|
-
${({$
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`}}}
|
|
30
|
+
${({$active:e})=>a`
|
|
31
|
+
> span {
|
|
32
|
+
font-weight: ${e?700:500};
|
|
33
|
+
&:after {
|
|
34
|
+
height: 0;
|
|
35
|
+
display: block;
|
|
36
|
+
content: attr(title);
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
visibility: hidden;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`}
|
|
47
44
|
${({$active:e})=>!e&&a`
|
|
48
45
|
&:disabled {
|
|
49
|
-
color: ${
|
|
46
|
+
color: ${t.interactive.disabled__text.rgba};
|
|
50
47
|
cursor: not-allowed;
|
|
51
48
|
}
|
|
52
49
|
`}
|
|
53
|
-
`,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
&:hover {
|
|
62
|
-
background: ${c.interactive.primary__hover_alt.rgba};
|
|
63
|
-
}
|
|
64
|
-
&:focus-visible {
|
|
65
|
-
color: ${c.text.static_icons__default.rgba};
|
|
66
|
-
outline: 2px dashed ${c.interactive.focus.rgba};
|
|
67
|
-
outline-offset: -4px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
${({$disabled:e,$active:t})=>e&&!t&&a`
|
|
71
|
-
color: ${c.interactive.disabled__text.rgba} !important;
|
|
72
|
-
&:hover {
|
|
73
|
-
cursor: not-allowed;
|
|
50
|
+
`,c=i.div`
|
|
51
|
+
button[role='tab'] {
|
|
52
|
+
.count {
|
|
53
|
+
background: ${t.ui.background__light_medium.rgba};
|
|
54
|
+
padding: 0 ${n.x_small};
|
|
55
|
+
> span {
|
|
56
|
+
color: ${t.text.static_icons__tertiary.rgba};
|
|
74
57
|
}
|
|
75
|
-
|
|
58
|
+
}
|
|
76
59
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
height: ${({$variant:e})=>r[e]};
|
|
86
|
-
transition: background 200ms;
|
|
87
|
-
|
|
88
|
-
> span {
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
position: relative;
|
|
92
|
-
text-align: left;
|
|
93
|
-
font-family: 'Equinor', sans-serif;
|
|
94
|
-
font-weight: 700;
|
|
95
|
-
font-size: 14px;
|
|
96
|
-
}
|
|
97
|
-
${({$variant:e,$active:t})=>{switch(e){case`buttons`:return a`
|
|
98
|
-
border-radius: ${l.corners.borderRadius};
|
|
99
|
-
background: ${t?c.interactive.primary__hover_alt.rgba:`none`};
|
|
100
|
-
`;case`border`:return a`
|
|
101
|
-
> span {
|
|
102
|
-
font-weight: ${t?700:500};
|
|
103
|
-
&:after {
|
|
104
|
-
height: 0;
|
|
105
|
-
display: block;
|
|
106
|
-
content: attr(title);
|
|
107
|
-
font-weight: 700;
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
overflow: hidden;
|
|
110
|
-
visibility: hidden;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
`}}}
|
|
114
|
-
`,f=i.div`
|
|
115
|
-
display: flex;
|
|
116
|
-
position: relative;
|
|
117
|
-
&:after {
|
|
118
|
-
position: absolute;
|
|
119
|
-
left: 0;
|
|
120
|
-
bottom: ${({$activeIndex:e,$index:t})=>`${(e-t)*100}%`};
|
|
121
|
-
content: '';
|
|
122
|
-
width: 100%;
|
|
123
|
-
height: 2px;
|
|
124
|
-
background: ${c.interactive.primary__resting.rgba};
|
|
125
|
-
z-index: 100;
|
|
60
|
+
&:disabled {
|
|
61
|
+
.count {
|
|
62
|
+
background: ${t.interactive.disabled__fill.rgba};
|
|
63
|
+
> span {
|
|
64
|
+
color: ${t.interactive.disabled__text.rgba};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
126
68
|
}
|
|
127
|
-
`,
|
|
69
|
+
`,l=i.div`
|
|
128
70
|
display: flex;
|
|
129
71
|
flex-direction: column;
|
|
130
72
|
position: relative;
|
|
@@ -136,57 +78,33 @@ import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
|
|
|
136
78
|
content: '';
|
|
137
79
|
width: 2px;
|
|
138
80
|
height: 100%;
|
|
139
|
-
background: ${
|
|
81
|
+
background: ${t.interactive.primary__resting.rgba};
|
|
140
82
|
z-index: 100;
|
|
141
|
-
transition: top ${
|
|
83
|
+
transition: top ${e.transitionMS};
|
|
142
84
|
}
|
|
143
|
-
`,
|
|
85
|
+
`,u=i(o.div)`
|
|
144
86
|
display: flex;
|
|
145
87
|
flex-direction: column;
|
|
146
88
|
position: relative;
|
|
147
|
-
${
|
|
148
|
-
|
|
149
|
-
${e===`buttons`&&`gap: ${n.x_small};`}
|
|
150
|
-
`}
|
|
151
|
-
`,h=i(o.div)`
|
|
89
|
+
min-height: ${r};
|
|
90
|
+
`,d=i(o.div)`
|
|
152
91
|
display: flex;
|
|
153
|
-
flex-direction:
|
|
92
|
+
flex-direction: column;
|
|
154
93
|
height: fit-content;
|
|
155
94
|
overflow: hidden;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
`;case`borderHorizontal`:return a`
|
|
166
|
-
&:after {
|
|
167
|
-
position: absolute;
|
|
168
|
-
left: 0;
|
|
169
|
-
bottom: 0;
|
|
170
|
-
content: '';
|
|
171
|
-
width: 100%;
|
|
172
|
-
height: 2px;
|
|
173
|
-
background: ${c.ui.background__medium.rgba};
|
|
174
|
-
}
|
|
175
|
-
`}}}
|
|
176
|
-
`,g=i(o.div)`
|
|
95
|
+
&:after {
|
|
96
|
+
position: absolute;
|
|
97
|
+
left: 0;
|
|
98
|
+
content: '';
|
|
99
|
+
width: 2px;
|
|
100
|
+
height: 100%;
|
|
101
|
+
background: ${t.ui.background__medium.rgba};
|
|
102
|
+
}
|
|
103
|
+
`,f=i(o.div)`
|
|
177
104
|
display: flex;
|
|
178
105
|
flex-direction: column;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
`}
|
|
183
|
-
> div > button, a {
|
|
184
|
-
${({$variant:e})=>{switch(e){case`buttons`:return a`
|
|
185
|
-
margin-left: ${n.medium};
|
|
186
|
-
`;case`border`:return a`
|
|
187
|
-
padding-left: ${n.x_large};
|
|
188
|
-
`}}}
|
|
106
|
+
> div > button,
|
|
107
|
+
a {
|
|
108
|
+
padding-left: ${n.x_large};
|
|
189
109
|
}
|
|
190
|
-
|
|
191
|
-
${({$variant:e})=>e===`buttons`&&`gap:${n.x_small};`}
|
|
192
|
-
`;export{p as BorderItemsContainer,f as BorderItemsHorizontalContainer,u as Button,g as ChildContainer,d as Link,h as TableOfContentsContainer,m as TableOfContentsItemContainer};
|
|
110
|
+
`;export{s as Button,f as ChildContainer,c as HorizontalItemsContainer,d as TableOfContentsContainer,u as TableOfContentsItemContainer,l as VerticalItemsContainer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/organisms/TableOfContents/TableOfContents.types.d.ts
|
|
2
|
-
type
|
|
2
|
+
type TableOfContentsMode = 'vertical' | 'horizontal';
|
|
3
3
|
//#endregion
|
|
4
|
-
export {
|
|
4
|
+
export { TableOfContentsMode };
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import{useTableOfContents as e}from"../../providers/TableOfContentsProvider.js";import{Badge as t}from"../../molecules/Badge/Badge.js";import{
|
|
2
|
-
calc(
|
|
3
|
-
(${O?r[y]:`0`} * ${v.length})
|
|
4
|
-
${y===`buttons`?`+ (${n.buttons} * ${v.length-1})`:``}
|
|
5
|
-
)`},transition:{duration:.4},children:v.map(e=>d(p,{onlyShowSelectedChildren:b,variant:y,...e,isLink:x},e.value))})]})};export{p as TableOfContentsItem};
|
|
1
|
+
import{useTableOfContents as e}from"../../providers/TableOfContentsProvider.js";import{Badge as t}from"../../molecules/Badge/Badge.js";import{Button as n,ChildContainer as r,TableOfContentsItemContainer as i}from"./TableOfContents.styles.js";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{AnimatePresence as c}from"framer-motion";const l=({label:u,value:d,count:f,disabled:p=!1,children:m,onlyShowSelectedChildren:h})=>{let{isActive:g,selected:_,setSelected:v}=e(),y=a(()=>g({label:u,value:d,children:m})&&!p,[m,p,g,u,d]);return s(i,{layoutScroll:!0,layoutRoot:!0,children:[s(n,{$active:_===d,onClick:()=>{!p&&_!==d&&v(d)},disabled:p,children:[o(`span`,{title:u,children:u}),f!==void 0&&o(t,{variant:p?`empty`:`light`,value:f})]}),o(c,{children:m&&(h&&y||!h)&&o(r,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.4},children:m.map(e=>o(l,{onlyShowSelectedChildren:h,...e},e.value))})})]})};export{l as TableOfContentsItem};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react119 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: react119.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react119.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 react117 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/FieldMenu/FieldMenu.d.ts
|
|
5
5
|
interface FieldMenuProps {
|
|
@@ -9,6 +9,6 @@ interface FieldMenuProps {
|
|
|
9
9
|
itemNameSingular?: string;
|
|
10
10
|
showAccessITLink?: boolean;
|
|
11
11
|
}
|
|
12
|
-
declare const FieldMenu:
|
|
12
|
+
declare const FieldMenu: react117.ForwardRefExoticComponent<FieldMenuProps & react117.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { FieldMenu };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react127 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: react127.Context<NotificationContext | undefined>;
|
|
10
10
|
declare const useNotification: () => NotificationContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNotification };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{auth as e,environment as t}from"../../atoms/utils/auth_environment.js";import{FullPageSpinner as n}from"../../molecules/FullPageSpinner/FullPageSpinner.js";import{MissingAccessToApp as r}from"../../organisms/Status/collections/MissingAccessToApp.js";import{useEffect as i,useRef as a,useState as o}from"react";import{useMsal as s,useMsalAuthentication as c}from"@azure/msal-react";import{
|
|
1
|
+
import{auth as e,environment as t}from"../../atoms/utils/auth_environment.js";import{FullPageSpinner as n}from"../../molecules/FullPageSpinner/FullPageSpinner.js";import{MissingAccessToApp as r}from"../../organisms/Status/collections/MissingAccessToApp.js";import{useEffect as i,useRef as a,useState as o}from"react";import{useMsal as s,useMsalAuthentication as c}from"@azure/msal-react";import{BrowserAuthError as l,BrowserAuthErrorCodes as u,InteractionRequiredAuthError as d,InteractionType as f}from"@azure/msal-browser";import{jsx as p}from"react/jsx-runtime";import{jwtDecode as m}from"jwt-decode";const{GRAPH_ENDPOINTS:h,GRAPH_REQUESTS_LOGIN:g,GRAPH_REQUESTS_PHOTO:_,GRAPH_REQUESTS_BACKEND:v,fetchMsGraph:y,isInIframe:b}=e,{getApiScope:x}=t,S=({children:e,account:t,setAccount:S,setPhoto:C,setRoles:w,authState:T,setAuthState:E,withoutLoader:D,loadingComponent:O,unauthorizedComponent:k,withoutBackend:A})=>{let{instance:j,accounts:M,inProgress:N}=s(),{login:P,result:F,error:I,acquireToken:L}=c(f.Silent,g),[R,z]=o(!1),B=a(!1);return i(()=>{R||(async()=>{console.log(`[AuthProvider] Initializing`),await j.initialize(),console.log(`[AuthProvider] Finished initializing`),z(!0)})().catch(e=>{console.error(`[AuthProvider] Error during initialization`,e)})},[j,R]),i(()=>{R&&(I instanceof d&&!b()&&T!==`unauthorized`?(console.error(I),console.log(`[AuthProvider] No account found, need to login via. redirect`),P(f.Redirect,g).catch(e=>{console.error(`[AuthProvider] Error during login`,e)})):F?.account&&!t?(console.log(`[AuthProvider] Found account in useMsalAuth result, setting that one as active`),j.setActiveAccount(F.account),S(F.account)):M.length>0&&!t?(console.log(`[AuthProvider] Found account in accounts array, setting that one as active`),j.setActiveAccount(M[0]),S(M[0])):I instanceof l&&I.errorCode===u.monitorWindowTimeout?(console.error(I),console.log(`[AuthProvider] Trying to login again via. redirect due to monitor window timeout`),P(f.Redirect,g).catch(e=>{console.error(`[AuthProvider] Error during login`,e)})):I&&console.error(`[AuthProvider] Unexpected error:`,I))},[t,M,I,j,R,P,F,S,T]),i(()=>{if(!t||!R||B.current||N!==`none`)return;B.current=!0;let e=async()=>{try{let e=await L(f.Silent,_);if(e){let t=await y(h.PHOTO,e.accessToken);if(t.status===404)return null;let n=await t.blob();C((window.URL??window.webkitURL).createObjectURL(n))}}catch(e){console.error(e)}},n=async()=>{try{let e=await L(f.Silent,v(x(import.meta.env.VITE_API_SCOPE)));if(console.log(`[AuthProvider] Successfully acquired token`),e&&e.accessToken){console.log(`[AuthProvider] Decoding token`);let t=m(e.accessToken);if(console.log(`[AuthProvider] Token was valid`),t.roles)console.log(`[AuthProvider] Found roles`),w(t.roles);else throw Error(`Could not find roles in token`);E(`authorized`)}}catch(e){console.error(`[AuthProvider] Token error when trying to get roles!`,e),E(`unauthorized`)}};(async()=>{await e(),A?E(`authorized`):await n()})()},[t,L,I,R,N,E,C,w,A]),T===`unauthorized`?k??p(r,{}):D?e:T===`loading`||t===void 0?O??p(n,{variant:`application`}):e};export{S as AuthProviderInner};
|