@equinor/amplify-component-lib 10.0.6 → 10.1.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/molecules/Badge/Badge.styles.js +1 -1
- 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/RichTextEditor/index.d.ts +5 -5
- package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
- package/dist/molecules/SelectionControls/Switch/Switch.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/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/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/dist/providers/AuthProvider/AuthProviderInner.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react135 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, react135.Dispatch<react135.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 react137 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: react137.RefObject<HTMLInputElement | null>;
|
|
20
|
+
itemRefs: react137.RefObject<(HTMLButtonElement | null)[]>;
|
|
21
21
|
selectedValues: T[];
|
|
22
22
|
open: boolean;
|
|
23
23
|
tryingToRemoveItem: T | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import r from"styled-components";const{shape:i}=e,a=e=>({light:{background
|
|
1
|
+
import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import r from"styled-components";const{shape:i}=e,a=e=>({light:{background:t.ui.background__light_medium.rgba,color:t.text.static_icons__tertiary.rgba},danger:{background:t.interactive.danger__resting.rgba,color:t.text.static_icons__primary_white.rgba},empty:{background:t.interactive.disabled__fill.rgba,color:t.interactive.disabled__text.rgba},default:{background:t.text.static_icons__tertiary.rgba,color:t.text.static_icons__primary_white.rgba}})[e],o=r.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react17 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: react17.ForwardRefExoticComponent<{
|
|
10
10
|
textTransform?: string;
|
|
11
11
|
} & {
|
|
12
12
|
placement?: _floating_ui_utils0.Placement;
|
|
13
|
-
title?:
|
|
13
|
+
title?: react17.ReactNode;
|
|
14
14
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
15
15
|
enterDelay?: number;
|
|
16
16
|
portalContainer?: HTMLElement;
|
|
17
|
-
} & Omit<
|
|
17
|
+
} & Omit<react17.HTMLAttributes<HTMLDivElement>, "title"> & react17.RefAttributes<HTMLDivElement>>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { OptionalTooltip, OptionalTooltipProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react21 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: react21.ForwardRefExoticComponent<ProfileAvatarProps & react21.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ProfileAvatar, ProfileAvatarProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditorPanel, ImageExtensionFnProps, RichTextEditorFeatures } from "../RichTextEditor.types.js";
|
|
2
2
|
import { MenuButtonProps } from "./MenuButton.js";
|
|
3
3
|
import { AddImageProps } from "./AddImageButton.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react31 from "react";
|
|
5
5
|
import { FC } from "react";
|
|
6
6
|
import * as styled_components0 from "styled-components";
|
|
7
7
|
import { Editor } from "@tiptap/react";
|
|
@@ -14,10 +14,10 @@ interface MenuBarProps extends Pick<ImageExtensionFnProps, 'onImageUpload'> {
|
|
|
14
14
|
}
|
|
15
15
|
declare const AmplifyBar: FC<MenuBarProps>;
|
|
16
16
|
declare const EditorMenu: {
|
|
17
|
-
Bar: styled_components_dist_types3.IStyledComponentBase<"web", styled_components0.FastOmit<
|
|
18
|
-
Bars: styled_components_dist_types3.IStyledComponentBase<"web", styled_components0.FastOmit<
|
|
19
|
-
Button:
|
|
20
|
-
Section: styled_components_dist_types3.IStyledComponentBase<"web", styled_components0.FastOmit<
|
|
17
|
+
Bar: styled_components_dist_types3.IStyledComponentBase<"web", styled_components0.FastOmit<react31.DetailedHTMLProps<react31.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
+
Bars: styled_components_dist_types3.IStyledComponentBase<"web", styled_components0.FastOmit<react31.DetailedHTMLProps<react31.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
19
|
+
Button: react31.ForwardRefExoticComponent<Omit<MenuButtonProps, "ref"> & react31.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
Section: styled_components_dist_types3.IStyledComponentBase<"web", styled_components0.FastOmit<react31.DetailedHTMLProps<react31.HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
21
21
|
AddImageButton: FC<AddImageProps>;
|
|
22
22
|
};
|
|
23
23
|
declare const EditorText: {
|
|
@@ -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 react23 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<react23.DetailedHTMLProps<react23.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, EditorStylingProps>> & string;
|
|
12
|
+
Provider: react23.FC<EditorProviderProps>;
|
|
13
|
+
Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<Omit<_tiptap_react0.EditorContentProps, "ref"> & react23.RefAttributes<HTMLDivElement>, RichTextContentProps>> & string & Omit<react23.NamedExoticComponent<Omit<_tiptap_react0.EditorContentProps, "ref"> & react23.RefAttributes<HTMLDivElement>>, keyof react23.Component<any, {}, any>>;
|
|
14
|
+
Bar: react23.FC<MenuBarProps>;
|
|
15
15
|
};
|
|
16
16
|
//#endregion
|
|
17
17
|
export { RichText };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react94 from "react";
|
|
2
2
|
import { RadioProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/SelectionControls/Radio/Radio.d.ts
|
|
@@ -7,6 +7,6 @@ interface RadioProps$1 extends RadioProps {
|
|
|
7
7
|
outlined?: boolean;
|
|
8
8
|
error?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const Radio$1:
|
|
10
|
+
declare const Radio$1: react94.ForwardRefExoticComponent<RadioProps$1 & react94.RefAttributes<HTMLInputElement>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Radio$1 as Radio, RadioProps$1 as RadioProps };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react96 from "react";
|
|
2
2
|
import { SwitchProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/SelectionControls/Switch/Switch.d.ts
|
|
5
5
|
interface SwitchProps$1 extends SwitchProps {
|
|
6
6
|
outlined?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare const Switch$1:
|
|
8
|
+
declare const Switch$1: react96.ForwardRefExoticComponent<SwitchProps$1 & react96.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Switch$1 as Switch, SwitchProps$1 as SwitchProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterProps } from "./Filter.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 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_runtime6.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_runtime5 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_runtime5.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { QuickFilter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Filter/SortMenu.d.ts
|
|
4
4
|
interface SortMenuProps<S> {
|
|
@@ -13,6 +13,6 @@ declare function SortMenu<S>({
|
|
|
13
13
|
value,
|
|
14
14
|
onChange,
|
|
15
15
|
items
|
|
16
|
-
}: SortMenuProps<S>):
|
|
16
|
+
}: SortMenuProps<S>): react_jsx_runtime4.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { SortMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TableOfContentsProvider as e}from"../../providers/TableOfContentsProvider.js";import{TableOfContents as t}from"../TableOfContents/TableOfContents.js";import{useFilteredReleaseNotes as n}from"./hooks/useFilteredReleaseNotes.js";import{extractYearsData as r,monthValueToString as i,yearId as a}from"./ReleaseNotesPage.utils.js";import{ReleasePosts as o}from"./ReleasePosts/ReleasePosts.js";import{ReleaseNoteFilter as s}from"./ReleaseNoteFilter.js";import{Container as c,StickyRightSide as l}from"./ReleaseNotesPage.styles.js";import{useMemo as u}from"react";import{Typography as d}from"@equinor/eds-core-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=()=>{let{data:m}=n();return f(e,{items:u(()=>{let e=[];for(let t of r(m))e.push({value:a(t.value),label:t.label,children:t.months.map(e=>({label:e.label,value:i(e.value)}))});return e},[m]),children:p(c,{children:[f(d,{variant:`h1`,bold:!0,children:`Release Notes`}),p(`section`,{children:[f(s,{}),f(o,{})]}),f(l,{children:f(t,{onlyShowSelectedChildren:!1
|
|
1
|
+
import{TableOfContentsProvider as e}from"../../providers/TableOfContentsProvider.js";import{TableOfContents as t}from"../TableOfContents/TableOfContents.js";import{useFilteredReleaseNotes as n}from"./hooks/useFilteredReleaseNotes.js";import{extractYearsData as r,monthValueToString as i,yearId as a}from"./ReleaseNotesPage.utils.js";import{ReleasePosts as o}from"./ReleasePosts/ReleasePosts.js";import{ReleaseNoteFilter as s}from"./ReleaseNoteFilter.js";import{Container as c,StickyRightSide as l}from"./ReleaseNotesPage.styles.js";import{useMemo as u}from"react";import{Typography as d}from"@equinor/eds-core-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=()=>{let{data:m}=n();return f(e,{items:u(()=>{let e=[];for(let t of r(m))e.push({value:a(t.value),label:t.label,children:t.months.map(e=>({label:e.label,value:i(e.value)}))});return e},[m]),children:p(c,{children:[f(d,{variant:`h1`,bold:!0,children:`Release Notes`}),p(`section`,{children:[f(s,{}),f(o,{})]}),f(l,{children:f(t,{onlyShowSelectedChildren:!1})})]})})};export{m as ReleaseNotesPage};
|
|
@@ -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
1
|
import { ToggleGroup } from "./ToggleGroup.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react133 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/ToggleGroup/ToggleGroup.d.ts
|
|
5
|
-
declare const ToggleGroup$1:
|
|
5
|
+
declare const ToggleGroup$1: react133.ForwardRefExoticComponent<ToggleGroup & react133.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 react131 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: react131.ForwardRefExoticComponent<ToggleGroupOptionProps & react131.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ToggleGroupOption$1 as ToggleGroupOption };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react139 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: react139.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};
|