@equinor/amplify-component-lib 10.0.0 → 10.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +1 -1
- package/dist/atoms/hooks/useFaqsInApplication.js +1 -1
- package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
- package/dist/atoms/hooks/useSelect.d.ts +3 -3
- package/dist/atoms/hooks/useSelect.js +1 -1
- package/dist/atoms/style/index.d.ts +0 -3
- package/dist/atoms/style/index.js +1 -1
- package/dist/atoms/utils/size.js +1 -1
- package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
- package/dist/deprecated/IconToggleButton.d.ts +2 -2
- package/dist/deprecated/OldStepper/OldStepLine.js +1 -1
- package/dist/molecules/DatePicker/DatePicker.d.ts +4 -2
- package/dist/molecules/DatePicker/DatePicker.js +1 -1
- package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/molecules/Dialog/Dialog.d.ts +2 -2
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- package/dist/molecules/FeedBackIcon/FeedBackIcon.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.js +1 -1
- package/dist/molecules/FileProgress/RegularFileProgress.js +1 -1
- package/dist/molecules/IconCell/IconCell.styles.js +3 -3
- package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
- package/dist/molecules/RichTextEditor/EditorProvider.js +1 -1
- package/dist/molecules/RichTextEditor/index.d.ts +5 -5
- package/dist/molecules/Select/GroupedSelectMenu.js +1 -1
- package/dist/molecules/Select/Select.js +1 -1
- package/dist/molecules/Select/Select.utils.js +1 -1
- package/dist/molecules/Select/SelectMenuItem.utils.js +1 -1
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
- package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
- package/dist/molecules/Stepper/StepLine.js +1 -1
- package/dist/molecules/Waves/Waves.js +1 -1
- package/dist/organisms/Faq/Category/Category.js +1 -1
- 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/ReleaseNotesPage/hooks/useFilteredReleaseNotes.js +1 -1
- package/dist/organisms/ReleaseNotesPage/hooks/useReleaseNotesFilters.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/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
- package/dist/organisms/TopBar/Account/Account.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/CreateOrEditUser/CreateOrEditUser.js +1 -1
- package/dist/organisms/TopBar/Actions.d.ts +2 -2
- package/dist/organisms/TopBar/ApplicationDrawer/ApplicationDrawer.js +1 -1
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
- package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/LockedInputTooltip.js +2 -2
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Severity.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/ImageFile.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/UploadFile.js +1 -1
- package/dist/organisms/TopBar/Tutorials/TutorialItem.js +1 -1
- package/dist/providers/AuthProvider/AuthProviderInner.js +1 -1
- package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProviderInner.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=
|
|
1
|
+
var e=Object.defineProperty,t=t=>{let n={};for(var r in t)e(n,r,{get:t[r],enumerable:!0});return n};export{t as __export};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{environment as e}from"../utils/auth_environment.js";import{FaqService as t}from"@equinor/subsurface-app-management";import{useQuery as n}from"@tanstack/react-query";function r(){return n({queryKey:[`GET_FAQ_IN_APP`],queryFn:async()=>(await t.getCategoriesWithFaqsFromApplicationName(e.getAppName(import.meta.env.VITE_NAME))).toSorted((e,t)=>
|
|
1
|
+
import{environment as e}from"../utils/auth_environment.js";import{FaqService as t}from"@equinor/subsurface-app-management";import{useQuery as n}from"@tanstack/react-query";function r(){return n({queryKey:[`GET_FAQ_IN_APP`],queryFn:async()=>(await t.getCategoriesWithFaqsFromApplicationName(e.getAppName(import.meta.env.VITE_NAME))).toSorted((e,t)=>(e.orderBy??0)-(t.orderBy??0)),staleTime:1e3*60*5})}export{r as useFaqsInApplication};
|
|
@@ -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 react138 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: react138.RefObject<HTMLInputElement | null>;
|
|
20
|
+
itemRefs: react138.RefObject<(HTMLButtonElement | null)[]>;
|
|
21
21
|
selectedValues: T[];
|
|
22
22
|
open: boolean;
|
|
23
23
|
tryingToRemoveItem: T | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{flattenOptions as e}from"../../molecules/Select/Select.utils.js";import{useEffect as t,useMemo as n,useRef as r,useState as i}from"react";const a=a=>{let{loading:o,disabled:s,sortValues:c,onSearchChange:l,onOpenCallback:u}=a,[d,f]=i(!1),[p,m]=i(``),h=r(null),g=r([]),_=r(-1),[v,y]=i(void 0),b=r(!1),x=r(0),S=n(()=>{let e=[];if(`values`in a?e=a.values:a.value&&(e=[a.value]),!c)return e;let t=`groups`in a&&a.groups?a.groups.flatMap(e=>e.items):a.items.flatMap(e=>[{...e},...e.children||[]])
|
|
1
|
+
import{flattenOptions as e}from"../../molecules/Select/Select.utils.js";import{useEffect as t,useMemo as n,useRef as r,useState as i}from"react";const a=a=>{let{loading:o,disabled:s,sortValues:c,onSearchChange:l,onOpenCallback:u}=a,[d,f]=i(!1),[p,m]=i(``),h=r(null),g=r([]),_=r(-1),[v,y]=i(void 0),b=r(!1),x=r(0),S=n(()=>{let e=[];if(`values`in a?e=a.values:a.value&&(e=[a.value]),!c)return e;let t;return t=`groups`in a&&a.groups?a.groups.flatMap(e=>e.items):a.items.flatMap(e=>[{...e},...e.children||[]]),e.sort((e,n)=>t.findIndex(t=>t.value===e.value)-t.findIndex(e=>e.value===n.value))},[a,c]);t(()=>{u!==void 0&&u(d)},[u,d]),t(()=>{b.current&&x.current!==S.length&&(x.current=S.length,b.current=!1,h.current?.focus())},[S.length]);let C=()=>{!d&&!s&&!o&&(h.current?.focus(),f(!0))},w=()=>{f(!1),m(``),_.current=0},T=()=>{s||o||(d?w():C())},E=e=>{e.target.value===` `||o||s||(m(e.target.value),l?.(e.target.value),d||f(!0))},D=(t,n)=>{let r=structuredClone(t);return r.some(e=>e.value===n.value)?r.filter(e=>e.value!==n.value):`values`in a&&a.syncParentChildSelection!==void 0&&!a.syncParentChildSelection?[n,...r]:[n,...r.filter(t=>(n.children===void 0||n.children.length>0)&&e([n]).some(e=>e.value===t.value)?!1:t.children===void 0||t.children.length===0?!0:e([t]).every(e=>e.value!==n.value))]},O=e=>{`value`in a?a.value?.value===e.value?a.onSelect(void 0):a.onSelect(e):a.onSelect(D(a.values,e),e),p!==``&&m(``),b.current=!0},k=e=>{`values`in a&&!o&&!s&&a.onSelect(a.values.filter(t=>t.value!==e.value),e)};return{handleOnAddItem:()=>{`onAddItem`in a&&a.onAddItem&&(a.onAddItem(p),m(``))},handleOnItemSelect:O,handleOnItemKeyDown:e=>{e.key===`ArrowDown`&&_.current<g.current.length-1?(_.current+=1,g.current.at(_.current)?.focus()):e.key===`ArrowUp`&&_.current>0?(--_.current,g.current.at(_.current)?.focus()):e.key===`ArrowUp`&&_.current===0&&(_.current=-1,h.current?.focus())},handleOnSearchKeyDown:e=>{e.key===`Enter`&&p!==``&&`onAddItem`in a&&a.onAddItem?(e.preventDefault(),a.onAddItem(p),m(``)):e.key===`Space`||e.key===`Enter`?C():e.key===`Escape`?(h.current?.blur(),w()):(e.key===`ArrowDown`||e.key===`ArrowUp`)&&g.current.at(0)?(g.current[0]?.focus(),_.current=0):e.key===`Backspace`&&v===void 0&&`values`in a&&p===``?(y(S?.at(-1)),setTimeout(()=>{h.current?.focus()})):e.key===`Backspace`&&v&&(k(v),y(void 0),setTimeout(()=>{h.current?.focus()}))},handleOnClear:()=>{`value`in a?a.onSelect(void 0):a.onSelect([])},handleOnSearchChange:E,handleToggleOpen:T,handleOnClose:w,handleOnOpen:C,handleOnRemoveItem:k,search:p,searchRef:h,itemRefs:g,selectedValues:S,open:d,tryingToRemoveItem:v}};export{a as useSelect};
|
|
@@ -3,9 +3,6 @@ import { colors } from "./colors.js";
|
|
|
3
3
|
import { spacings } from "./spacings.js";
|
|
4
4
|
|
|
5
5
|
//#region src/atoms/style/index.d.ts
|
|
6
|
-
declare namespace index_d_exports {
|
|
7
|
-
export { animation, colors, elevation, shape, spacings, typography };
|
|
8
|
-
}
|
|
9
6
|
declare const shape: {
|
|
10
7
|
_modes: {
|
|
11
8
|
compact: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__export as e}from"../../_virtual/rolldown_runtime.js";import{tokens as t}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{animation as n}from"./animation.js";import{colors as r}from"./colors.js";import{spacings as i}from"./spacings.js";var a=
|
|
1
|
+
import{__export as e}from"../../_virtual/rolldown_runtime.js";import{tokens as t}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{animation as n}from"./animation.js";import{colors as r}from"./colors.js";import{spacings as i}from"./spacings.js";var a=e({animation:()=>n,colors:()=>r,elevation:()=>s,shape:()=>o,spacings:()=>i,typography:()=>c});const{shape:o,elevation:s,typography:c}=t;export{s as elevation,o as shape,a as style_exports,c as typography};
|
package/dist/atoms/utils/size.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=1024,t=(t,n=2)=>{if(t<0||t===0)return`0 Bytes`;if(t===1)return`1 Byte`;let r=n<0?0:n,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/e**+a).toFixed(r))+` `+i[a]},n=(n,r=2)=>t(n*e,r),r=[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`];function i({size:e,decimals:t=2,inputFormat:n=`KiB`}){if(e<0)throw Error(`Invalid size, must be a positive integer`);if(t<0)throw Error(`Invalid decimals, must be a positive integer`);if(e===0)return`${e} ${n}`;let i=r.indexOf(n),a=
|
|
1
|
+
const e=1024,t=(t,n=2)=>{if(t<0||t===0)return`0 Bytes`;if(t===1)return`1 Byte`;let r=n<0?0:n,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/e**+a).toFixed(r))+` `+i[a]},n=(n,r=2)=>t(n*e,r),r=[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`];function i({size:e,decimals:t=2,inputFormat:n=`KiB`}){if(e<0)throw Error(`Invalid size, must be a positive integer`);if(t<0)throw Error(`Invalid decimals, must be a positive integer`);if(e===0)return`${e} ${n}`;let i=e*1024**r.indexOf(n),a=Math.floor(Math.log(i)/Math.log(1024));return`${parseFloat((i/1024**a).toFixed(t))} ${r[a]}`}export{t as formatBytes,i as formatDataSize,n as formatKiloBytes};
|
|
@@ -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 };
|
|
@@ -4,4 +4,4 @@ import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
|
|
|
4
4
|
background: ${e=>e.$background};
|
|
5
5
|
border: none;
|
|
6
6
|
margin: 0;
|
|
7
|
-
`;var o=({done:e})=>{
|
|
7
|
+
`;var o=({done:e})=>r(a,{$background:t(()=>e?i.interactive.primary__resting.rgba:i.interactive.disabled__text.rgba,[e])});export{o as default};
|
|
@@ -3,13 +3,15 @@ import * as react7 from "react";
|
|
|
3
3
|
import { DatePickerProps } from "@equinor/eds-core-react";
|
|
4
4
|
|
|
5
5
|
//#region src/molecules/DatePicker/DatePicker.d.ts
|
|
6
|
-
type DatePickerProps$1 = Omit<DatePickerProps, 'variant'> & {
|
|
6
|
+
type DatePickerProps$1 = Omit<DatePickerProps, 'variant' | 'defaultValue'> & {
|
|
7
7
|
variant?: Variants;
|
|
8
|
+
defaultValue?: Date | undefined;
|
|
8
9
|
meta?: string;
|
|
9
10
|
loading?: boolean;
|
|
10
11
|
};
|
|
11
|
-
declare const DatePicker$1: react7.ForwardRefExoticComponent<Omit<DatePickerProps, "variant"> & {
|
|
12
|
+
declare const DatePicker$1: react7.ForwardRefExoticComponent<Omit<DatePickerProps, "defaultValue" | "variant"> & {
|
|
12
13
|
variant?: Variants;
|
|
14
|
+
defaultValue?: Date | undefined;
|
|
13
15
|
meta?: string;
|
|
14
16
|
loading?: boolean;
|
|
15
17
|
} & react7.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{getSkeletonHeight as t,getSkeletonTop as n}from"../../atoms/utils/skeleton.js";import{DatePickerWrapper as r}from"./DatePicker.styles.js";import{SkeletonField as i}from"../Skeleton/SkeletonField.js";import{forwardRef as a,useRef as o}from"react";import{DatePicker as s,Icon as c,Typography as l}from"@equinor/eds-core-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{calendar as f}from"@equinor/eds-icons";const p=a((a,p)=>{let m=a.locale??`en-GB`,h=a.formatOptions===void 0?{day:`2-digit`,month:`2-digit`,year:`numeric`}:a.formatOptions,g={...a,variant:a.variant===`dirty`?void 0:a.variant,loading:void 0},_=n(a),v=t({label:a.label,helperText:a.helperProps?.text,helperIcon:a.helperProps?.icon}),y=o(`${Math.max(40,Math.random()*80)}%`),b=a.loading||a.disabled;return d(r,{$variant:a.variant,$loading:a.loading,children:[u(s,{...g,ref:p,locale:m,formatOptions:h,disabled:b}),a.meta&&u(l,{variant:`helper`,group:`input`,children:a.meta}),a.loading&&u(i,{role:`progressbar`,style:{width:y.current,height:v,top:_}}),b&&u(c,{style:{top:_},data:f,size:24,color:e.interactive.disabled__fill.rgba})]})});p.displayName=`DatePicker`;export{p as DatePicker};
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{getSkeletonHeight as t,getSkeletonTop as n}from"../../atoms/utils/skeleton.js";import{DatePickerWrapper as r}from"./DatePicker.styles.js";import{SkeletonField as i}from"../Skeleton/SkeletonField.js";import{forwardRef as a,useRef as o}from"react";import{DatePicker as s,Icon as c,Typography as l}from"@equinor/eds-core-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{calendar as f}from"@equinor/eds-icons";const p=a((a,p)=>{let m=a.locale??`en-GB`,h=a.formatOptions===void 0?{day:`2-digit`,month:`2-digit`,year:`numeric`}:a.formatOptions,g={...a,defaultValue:a.defaultValue,variant:a.variant===`dirty`?void 0:a.variant,loading:void 0},_=n(a),v=t({label:a.label,helperText:a.helperProps?.text,helperIcon:a.helperProps?.icon}),y=o(`${Math.max(40,Math.random()*80)}%`),b=a.loading||a.disabled;return d(r,{$variant:a.variant,$loading:a.loading,children:[u(s,{...g,ref:p,locale:m,formatOptions:h,disabled:b}),a.meta&&u(l,{variant:`helper`,group:`input`,children:a.meta}),a.loading&&u(i,{role:`progressbar`,style:{width:y.current,height:v,top:_}}),b&&u(c,{style:{top:_},data:f,size:24,color:e.interactive.disabled__fill.rgba})]})});p.displayName=`DatePicker`;export{p as DatePicker};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Variants } from "../../atoms/types/variants.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react9 from "react";
|
|
3
3
|
import { DateRangePickerProps } from "@equinor/eds-core-react";
|
|
4
4
|
|
|
5
5
|
//#region src/molecules/DateRangePicker/DateRangePicker.d.ts
|
|
@@ -8,10 +8,10 @@ type DateRangePickerProps$1 = Omit<DateRangePickerProps, 'variant'> & {
|
|
|
8
8
|
meta?: string;
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
};
|
|
11
|
-
declare const DateRangePicker$1:
|
|
11
|
+
declare const DateRangePicker$1: react9.ForwardRefExoticComponent<Omit<DateRangePickerProps, "variant"> & {
|
|
12
12
|
variant?: Variants;
|
|
13
13
|
meta?: string;
|
|
14
14
|
loading?: boolean;
|
|
15
|
-
} &
|
|
15
|
+
} & react9.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { DateRangePicker$1 as DateRangePicker, DateRangePickerProps$1 as DateRangePickerProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react11 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: react11.ForwardRefExoticComponent<DialogProps$1 & react11.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 +1 @@
|
|
|
1
|
-
import{NegativeFilled as e}from"./NegativeFilled.js";import{NegativeOutlined as t}from"./NegativeOutlined.js";import{PositiveFilled as n}from"./PositiveFilled.js";import{PositiveOutlined as r}from"./PositiveOutlined.js";import{jsx as i}from"react/jsx-runtime";const a=[{iconName:`negative-outlined`,component:t},{iconName:`negative-filled`,component:e},{iconName:`positive-filled`,component:n},{iconName:`positive-outlined`,component:r}],o=({name:e,size:t=48,variant:n=`filled`})=>
|
|
1
|
+
import{NegativeFilled as e}from"./NegativeFilled.js";import{NegativeOutlined as t}from"./NegativeOutlined.js";import{PositiveFilled as n}from"./PositiveFilled.js";import{PositiveOutlined as r}from"./PositiveOutlined.js";import{jsx as i}from"react/jsx-runtime";const a=[{iconName:`negative-outlined`,component:t},{iconName:`negative-filled`,component:e},{iconName:`positive-filled`,component:n},{iconName:`positive-outlined`,component:r}],o=({name:e,size:t=48,variant:n=`filled`})=>i(a.find(t=>t.iconName===`${e}-${n}`).component,{size:t});export{o as FeedBackIcon};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{OptionalTooltip as t}from"../OptionalTooltip/OptionalTooltip.js";import{AdditionalText as n,CircularProgress as r,CloseButton as i,CompactFileProgressContainer as a,DoneWrapper as o,FileTooltip as s,LoadingWrapper as c,Rejection as l}from"./CompactFileProgress.styles.js";import{getFileIcon as u,isFileImage as d,readUploadedFileAsText as f}from"./FileProgress.utils.js";import{useEffect as p,useMemo as m,useState as h}from"react";import{Icon as g,Typography as _}from"@equinor/eds-core-react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{clear as b,error_outlined as x}from"@equinor/eds-icons";var S=({file:S,isError:C,shortErrorText:w,showCompleteState:T,fullErrorText:E,handleOnClick:D,isDeleting:O,...k})=>{let[A,j]=h(``);p(()=>{C||(async e=>{
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{OptionalTooltip as t}from"../OptionalTooltip/OptionalTooltip.js";import{AdditionalText as n,CircularProgress as r,CloseButton as i,CompactFileProgressContainer as a,DoneWrapper as o,FileTooltip as s,LoadingWrapper as c,Rejection as l}from"./CompactFileProgress.styles.js";import{getFileIcon as u,isFileImage as d,readUploadedFileAsText as f}from"./FileProgress.utils.js";import{useEffect as p,useMemo as m,useState as h}from"react";import{Icon as g,Typography as _}from"@equinor/eds-core-react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{clear as b,error_outlined as x}from"@equinor/eds-icons";var S=({file:S,isError:C,shortErrorText:w,showCompleteState:T,fullErrorText:E,handleOnClick:D,isDeleting:O,...k})=>{let[A,j]=h(``);return p(()=>{C||(async e=>{j(await f(e))})(S)},[C,S]),y(a,{$isError:C,children:[v(s,{title:m(()=>C?E&&E.length>0?E:`An error has occurred with the file`:``,[E,C]),children:m(()=>C?y(l,{children:[v(g,{data:x,color:e.interactive.warning__text.rgba}),v(`div`,{children:w&&w.length>0?w:`Invalid file type`}),v(`svg`,{width:`88`,height:`88`,viewBox:`0 0 88 88`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:v(`rect`,{x:`1`,y:`1`,width:`86`,height:`86`,rx:`7`,stroke:e.interactive.warning__text.rgba,strokeWidth:`2`,strokeDasharray:`4 4`})})]}):T&&!O&&d(S.name)?v(o,{children:v(`img`,{src:A,alt:` ${S.name}`})}):T&&!O?v(o,{children:v(g,{data:u(S.name)})}):y(c,{children:[v(r,{variant:k.indeterminate||O?`indeterminate`:`determinate`,value:!k.isDone&&!k.indeterminate?k.progressPercent:void 0,size:24}),v(_,{variant:`meta`,children:`Uploading...`}),v(`svg`,{width:`88`,height:`88`,viewBox:`0 0 88 88`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:v(`rect`,{x:`1`,y:`1`,width:`86`,height:`86`,rx:`7`,stroke:e.ui.background__medium.rgba,strokeWidth:`2`,strokeDasharray:`4 4`})})]}),[C,T,O,w,A,S.name,k])}),v(t,{title:S.name,children:v(n,{group:`paragraph`,variant:`meta`,children:S.name})}),!O&&k.onDelete&&v(i,{"data-testid":`delete-file`,onClick:D,children:v(g,{color:e.text.static_icons__tertiary.rgba,data:b})})]})};export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{formatDataSize as t}from"../../atoms/utils/size.js";import{Container as n,FileName as r,LinearProgress as i,ProgressWrapper as a,RegularFileProgressDetails as o,RegularFileProgressWrapper as s}from"./RegularFileProgress.styles.js";import{useMemo as c}from"react";import{Button as l,CircularProgress 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{close_circle_outlined as h,delete_to_trash as g,file as _,refresh as v}from"@equinor/eds-icons";var y=({onRetry:y,file:b,customLoadingText:x,customCompleteText:S,isError:C,fullErrorText:w,showCompleteState:T,handleOnClick:E,isDeleting:D,...O})=>{let k=c(()
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{formatDataSize as t}from"../../atoms/utils/size.js";import{Container as n,FileName as r,LinearProgress as i,ProgressWrapper as a,RegularFileProgressDetails as o,RegularFileProgressWrapper as s}from"./RegularFileProgress.styles.js";import{useMemo as c}from"react";import{Button as l,CircularProgress 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{close_circle_outlined as h,delete_to_trash as g,file as _,refresh as v}from"@equinor/eds-icons";var y=({onRetry:y,file:b,customLoadingText:x,customCompleteText:S,isError:C,fullErrorText:w,showCompleteState:T,handleOnClick:E,isDeleting:D,...O})=>{let k=c(()=>!b?.size||O.isDone||O.indeterminate||O.progressPercent===void 0?1:t({inputFormat:`B`,size:b.size/100*O.progressPercent,decimals:1}),[b?.size,O]),A=c(()=>C?w??`An error has occurred`:T?S??`File uploaded!`:x??`loading...`,[S,x,w,T,C]);return m(n,{$isError:C,children:[p(d,{data:_,color:C?e.interactive.warning__hover.rgba:e.interactive.primary__resting.rgba,size:32}),m(s,{children:[m(r,{children:[p(f,{variant:`caption`,children:b.name}),m(`div`,{children:[D?p(l,{variant:`ghost_icon`,children:p(u,{size:24})}):O.onDelete&&p(l,{variant:`ghost_icon`,onClick:E,"data-testid":`delete-file`,children:p(d,{data:T?g:h,color:e.text.static_icons__tertiary.rgba,size:24})}),C&&y&&p(l,{variant:`ghost_icon`,onClick:y,children:p(d,{data:v,color:e.text.static_icons__tertiary.rgba,size:24})})]})]}),p(a,{children:!T&&!O.isDone&&p(i,{variant:O.indeterminate?`indeterminate`:`determinate`,value:O.indeterminate?void 0:O.progressPercent})}),m(o,{children:[p(f,{variant:`overline`,children:A}),b?.size&&p(f,{variant:`overline`,children:T?t({size:b.size,decimals:1,inputFormat:`B`}):`${k} of ${t({size:b.size,decimals:1,inputFormat:`B`})}`})]})]})]})};export{y as default};
|
|
@@ -63,12 +63,12 @@ import{animation as e}from"../../atoms/style/animation.js";import{colors as t}fr
|
|
|
63
63
|
`}
|
|
64
64
|
|
|
65
65
|
// Overlay for Label & HelperIconContainer
|
|
66
|
-
${({$backgroundColor:e,$variant:n,$state:a})
|
|
66
|
+
${({$backgroundColor:e,$variant:n,$state:a})=>`
|
|
67
67
|
${f}::before,
|
|
68
68
|
${m}::before {
|
|
69
|
-
${u(
|
|
69
|
+
${u(n===i.COLOURED?a===r.ERROR?c[r.ERROR]:a===r.WARNING?c[r.WARNING]:e:t.ui.background__default.rgba)}
|
|
70
70
|
}
|
|
71
|
-
`}
|
|
71
|
+
`}
|
|
72
72
|
|
|
73
73
|
// Disabled state
|
|
74
74
|
&:disabled {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react19 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: react19.ForwardRefExoticComponent<{
|
|
10
10
|
textTransform?: string;
|
|
11
11
|
} & {
|
|
12
12
|
placement?: _floating_ui_utils0.Placement;
|
|
13
|
-
title?:
|
|
13
|
+
title?: react19.ReactNode;
|
|
14
14
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
15
15
|
enterDelay?: number;
|
|
16
16
|
portalContainer?: HTMLElement;
|
|
17
|
-
} & Omit<
|
|
17
|
+
} & Omit<react19.HTMLAttributes<HTMLDivElement>, "title"> & react19.RefAttributes<HTMLDivElement>>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { OptionalTooltip, OptionalTooltipProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useAmplifyKit as e}from"../../atoms/hooks/useAmplifyKit.js";import{useEffect as t,useRef as n}from"react";import{useEditor as r}from"@tiptap/react";import{useQueryClient as i}from"@tanstack/react-query";const a=({children:a,content:o,features:s,placeholder:c,onUpdate:l,onImageUpload:u,onImageRead:d,onImageRemove:f,onRemovedImagesChange:p,extensions:m=[]})=>{let h=e({features:s,placeholder:c,onImageUpload:u,onImageRead:d}),g=i(),_=n([]),v=n([]),y=n([]),b=e=>{let t=[];e.getJSON().content?.forEach(e=>{e.type===`image`&&e.attrs?.src&&t.push(e.attrs.src)});for(let e of t)if(!_.current.includes(e))_.current.push(e);else if(_.current.includes(e)&&f){let t=g.getQueryData([e]);if(t){let n=t.split(`,`),r=n[0].match(/:(.*?);/)[1],i=atob(n[n.length-1]),a=i.length,o=new Uint8Array(a);for(;a--;)o[a]=i.charCodeAt(a);let s=new File([o],e,{type:r});u?.(s)}}let n=_.current.filter(e=>!t.includes(e)&&!v.current.includes(e));if(f)for(let e of n)f?.(e),v.current.push(e);p&&y.current.length!==n.length&&(p(
|
|
1
|
+
import{useAmplifyKit as e}from"../../atoms/hooks/useAmplifyKit.js";import{useEffect as t,useRef as n}from"react";import{useEditor as r}from"@tiptap/react";import{useQueryClient as i}from"@tanstack/react-query";const a=({children:a,content:o,features:s,placeholder:c,onUpdate:l,onImageUpload:u,onImageRead:d,onImageRemove:f,onRemovedImagesChange:p,extensions:m=[]})=>{let h=e({features:s,placeholder:c,onImageUpload:u,onImageRead:d}),g=i(),_=n([]),v=n([]),y=n([]),b=e=>{let t=[];e.getJSON().content?.forEach(e=>{e.type===`image`&&e.attrs?.src&&t.push(e.attrs.src)});for(let e of t)if(!_.current.includes(e))_.current.push(e);else if(_.current.includes(e)&&f){let t=g.getQueryData([e]);if(t){let n=t.split(`,`),r=n[0].match(/:(.*?);/)[1],i=atob(n[n.length-1]),a=i.length,o=new Uint8Array(a);for(;a--;)o[a]=i.charCodeAt(a);let s=new File([o],e,{type:r});u?.(s)}}let n=_.current.filter(e=>!t.includes(e)&&!v.current.includes(e));if(f)for(let e of n)f?.(e),v.current.push(e);else p&&y.current.length!==n.length&&(p(n),y.current=n)},x=r({content:o,shouldRerenderOnTransaction:!0,extensions:[h,...m],onCreate:({editor:e})=>{b(e)},onUpdate:({editor:e})=>{b(e),l?.(e.getHTML())}});return t(()=>{x&&o!==x.getHTML()&&x.commands.setContent(o||``)},[o]),x?a(x):null};export{a as EditorProvider};
|
|
@@ -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 +1 @@
|
|
|
1
|
-
import{getCumulativeArrayFromNumberedArray as e}from"./Select.utils.js";import{NoItemsFoundText as t}from"./Select.styles.js";import{SelectMenuItem as n}from"./SelectMenuItem.js";import{useMemo as r}from"react";import{Menu as i}from"@equinor/eds-core-react";import{jsx as a}from"react/jsx-runtime";const o=o=>{let{onItemSelect:s,onItemKeyDown:c,itemRefs:l,groups:u,search:d,onSearchFilter:f,CustomMenuItemComponent:p}=o,m=r(()=>{if(d===``)return u;let e=new RegExp(d.trim(),`i`);return u.map(t=>({title:t.title,items:t.items.filter(t=>f===void 0?t.label.match(e):f(d,t))})).filter(e=>e.items.length>0)},[u,f,d]),h=r(()=>
|
|
1
|
+
import{getCumulativeArrayFromNumberedArray as e}from"./Select.utils.js";import{NoItemsFoundText as t}from"./Select.styles.js";import{SelectMenuItem as n}from"./SelectMenuItem.js";import{useMemo as r}from"react";import{Menu as i}from"@equinor/eds-core-react";import{jsx as a}from"react/jsx-runtime";const o=o=>{let{onItemSelect:s,onItemKeyDown:c,itemRefs:l,groups:u,search:d,onSearchFilter:f,CustomMenuItemComponent:p}=o,m=r(()=>{if(d===``)return u;let e=new RegExp(d.trim(),`i`);return u.map(t=>({title:t.title,items:t.items.filter(t=>f===void 0?t.label.match(e):f(d,t))})).filter(e=>e.items.length>0)},[u,f,d]),h=r(()=>e(m.map(e=>e.items.length)),[m]);return m.length===0?a(t,{children:`No items found`}):`values`in o?m.map((e,t)=>a(i.Section,{index:t,title:e.title,children:e.items.map((r,i)=>a(n,{index:i+h[t],childOffset:0,item:r,itemRefs:l,onItemKeyDown:c,onItemSelect:s,values:o.values,CustomMenuItemComponent:p},`${e.title}-${t}-item-${r.value}`))},`${e.title}-${t}`)):m.map((e,t)=>a(i.Section,{index:t,title:e.title,children:e.items.map((r,i)=>a(n,{index:i+h[t],childOffset:0,item:r,itemRefs:l,onItemKeyDown:c,onItemSelect:s,value:o.value,CustomMenuItemComponent:p},`${e.title}-${t}-item-${r.value}`))},`${e.title}-${t}`))};export{o as GroupedSelectMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{getVariantIcon as t}from"../../atoms/utils/forms.js";import{useSelect as n}from"../../atoms/hooks/useSelect.js";import{SkeletonField as r}from"../Skeleton/SkeletonField.js";import{useOutsideClick as i}from"../../node_modules/@equinor/eds-utils/dist/esm/hooks/useOutsideClick.js";import{ClearButton as ee,ComboBoxChip as
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{getVariantIcon as t}from"../../atoms/utils/forms.js";import{useSelect as n}from"../../atoms/hooks/useSelect.js";import{SkeletonField as r}from"../Skeleton/SkeletonField.js";import{useOutsideClick as i}from"../../node_modules/@equinor/eds-utils/dist/esm/hooks/useOutsideClick.js";import{ClearButton as ee,ComboBoxChip as te,Container as a,HelperWrapper as ne,PlaceholderText as o,Section as s,StyledMenu as c,ValueText as l,Wrapper as re}from"./Select.styles.js";import{GroupedSelectMenu as u}from"./GroupedSelectMenu.js";import{ListSelectMenu as d}from"./ListSelectMenu.js";import{useMemo as f,useRef as p}from"react";import{Icon as m,Label as h}from"@equinor/eds-core-react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{arrow_drop_down as ie,arrow_drop_up as ae,clear as v}from"@equinor/eds-icons";const y=y=>{let{clearable:b=!0,loading:x=!1,disabled:S=!1,lightBackground:C=!1,underlineHighlight:w=!1,sortValues:T=!0,placeholder:E=`Select...`,label:D,helperText:O,showHelperIcon:k=!0,meta:A,id:j=`amplify-combobox-${D}`,variant:M,inDialog:N=!1,onSearchFilter:P,"data-testid":F,CustomMenuItemComponent:I}=y,{handleOnAddItem:L,handleOnClear:R,handleOnItemKeyDown:z,handleOnItemSelect:B,handleOnSearchChange:V,handleOnSearchKeyDown:H,handleToggleOpen:U,itemRefs:W,search:G,selectedValues:K,handleOnClose:q,handleOnOpen:oe,handleOnRemoveItem:J,open:Y,searchRef:se,tryingToRemoveItem:X}=n({...y,clearable:b,loading:x,disabled:S,lightBackground:C,underlineHighlight:w,sortValues:T,placeholder:E}),ce=p(`${Math.max(40,Math.random()*80)}%`),Z=p(null),Q=p(null),le=f(()=>!!D||!!A,[D,A]),ue=f(()=>!!O,[O]),$=f(()=>{if(k)return t(M)},[k,M]);i(Q.current,e=>{N&&Y&&e.target&&Z.current&&Q.current&&!Z.current.contains(e.target)&&!Q.current?.contains(e.target)&&q()});let de=f(()=>{if(`value`in y&&y.value&&`customValueComponent`in y&&y.customValueComponent)return g(y.customValueComponent,{item:y.value});if(`value`in y&&y.value)return g(l,{children:y.value.label});if(`showSelectedAsText`in y&&y.showSelectedAsText){let e=y.items?y.items.length:y.groups.flatMap(e=>e.items).length;return g(l,{children:typeof y.showSelectedAsText==`function`?y.showSelectedAsText({selectedAmount:K.length,totalAmount:e}):`${K.length}/${e} Selected`})}else return K.map(e=>`customValueComponent`in y&&y.customValueComponent?g(y.customValueComponent,{item:e,onDelete:()=>J(e),tryingToRemove:X!==void 0&&X.value===e.value},e.value):g(te,{"data-testid":`amplify-combobox-chip`,className:`amplify-combo-box-chip`,onDelete:()=>J(e),$tryingToRemove:X?.value===e.value,$lightBackground:C,children:e.label},e.value))},[K,X,C,y,J]);return _(`div`,{children:[le&&g(h,{label:D,meta:A,htmlFor:j,disabled:S}),_(re,{children:[_(a,{"data-testid":F||`combobox-container`,ref:Z,onClick:oe,"aria-expanded":Y,$variant:M,$loading:x,$lightBackground:C,children:[_(s,{children:[!x&&G===``&&K.length===0&&g(o,{children:E}),(G===``&&`value`in y||`values`in y&&K.length>0&&(!y.showSelectedAsText||y.showSelectedAsText&&G===``))&&!x&&de,g(`input`,{id:j,disabled:S||x,ref:se,type:`search`,role:`combobox`,value:G,autoComplete:`off`,onChange:V,onKeyDownCapture:H}),x&&g(r,{role:`progressbar`,style:{width:ce.current,left:0,top:`50%`,transform:`translateY(-50%)`}})]}),g(m,{onClick:U,data:Y?ae:ie,color:x?e.interactive.disabled__fill.rgba:e.interactive.primary__resting.rgba}),b&&K.length>0&&!x&&g(ee,{id:`clear`,variant:`ghost_icon`,onClick:R,"data-testid":`clearBtn`,children:g(m,{data:v,size:18})})]}),ue&&_(ne,{$variant:S?`disabled`:M,children:[$&&g(m,{data:$,size:16}),g(h,{label:O,htmlFor:j})]})]}),Y&&g(c,{ref:Q,open:!0,id:`combobox-menu`,anchorEl:Z.current,onClose:q,placement:`bottom`,style:{width:`${Z.current?.clientWidth}px`,maxWidth:`${Z.current?.clientWidth}px`},children:`groups`in y&&y.groups?g(u,{...y,search:G,itemRefs:W,onItemSelect:B,onItemKeyDown:z,onSearchFilter:P,CustomMenuItemComponent:I}):g(d,{...y,search:G,itemRefs:W,onAddItem:y.onAddItem?L:void 0,onItemSelect:B,onItemKeyDown:z,onSearchFilter:P,CustomMenuItemComponent:I})},`select-menu-${G}`)]})};export{y as Select};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(t,n){
|
|
1
|
+
function e(t,n){return t.length+t.slice(0,n).map(t=>e(t.children??[],0)).reduce((e,t)=>e+t,0)}const t=e=>{let t=e=>{if(!e?.length)return[];let n=e.flatMap(({children:e,value:t})=>e?.map(e=>({...e,parent:t}))??[]);return[...n,...t(n)]};return[...e,...t(e)]},n=e=>{let t=Array(e.length).fill(0);for(let n=1;n<e.length;n++)t[n]=t[n-1]+e[n-1];return t};export{t as flattenOptions,e as getChildOffset,n as getCumulativeArrayFromNumberedArray};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{flattenOptions as e}from"./Select.utils.js";import{checkbox as t,checkbox_indeterminate as n,checkbox_outline as r}from"@equinor/eds-icons";const i={selected:t,indeterminate:n,none:r};function a(e,t){
|
|
1
|
+
import{flattenOptions as e}from"./Select.utils.js";import{checkbox as t,checkbox_indeterminate as n,checkbox_outline as r}from"@equinor/eds-icons";const i={selected:t,indeterminate:n,none:r};function a(e,t){return i[o(e,t)]}function o(t,n){if(!t.children||t.children.length===0)return`none`;let r=n.some(e=>e.value===t.value),i=n.map(({value:e})=>e),a=e([t])?.map(({value:e})=>e);return r?`selected`:a.some(e=>i.includes(e))?`indeterminate`:`none`}export{a as getParentIcon,o as getParentState};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react92 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: react92.ForwardRefExoticComponent<CheckboxProps$1 & react92.RefAttributes<HTMLInputElement>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Checkbox$1 as Checkbox, CheckboxProps$1 as CheckboxProps };
|
|
@@ -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 };
|
|
@@ -4,4 +4,4 @@ import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
|
|
|
4
4
|
background: ${e=>e.$background};
|
|
5
5
|
border: none;
|
|
6
6
|
margin: 0;
|
|
7
|
-
`,o=({done:e})=>{
|
|
7
|
+
`,o=({done:e})=>r(a,{$background:t(()=>e?i.interactive.primary__resting.rgba:i.interactive.disabled__text.rgba,[e])});export{o as StepLine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Container as e}from"./Waves.styles.js";import{WaveStatic as t}from"./WaveStatic.js";import{useEffect as n,useRef as r,useState as i}from"react";import{jsx as a}from"react/jsx-runtime";
|
|
1
|
+
import{Container as e}from"./Waves.styles.js";import{WaveStatic as t}from"./WaveStatic.js";import{useEffect as n,useRef as r,useState as i}from"react";import{jsx as a}from"react/jsx-runtime";const o=({gradientColors:o})=>{let s=r(null),[c,l]=i(s.current?.clientWidth??0),[u,d]=i(s.current?.clientHeight??0);return n(()=>{let e=()=>{s.current&&(l(s.current.clientWidth),d(s.current.clientHeight))};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),a(e,{ref:e=>{s.current=e,s.current&&(l(s.current.clientWidth),d(s.current.clientHeight))},children:a(t,{height:u,width:c,gradientColors:o})})};export{o as Waves};
|
|
@@ -6,4 +6,4 @@ import{spacings as e}from"../../../atoms/style/spacings.js";import{Status as t}f
|
|
|
6
6
|
&:has(> div > div > svg) {
|
|
7
7
|
transform: translateY(50%);
|
|
8
8
|
}
|
|
9
|
-
`,u=({categoryName:e,faqs:a,selectedTab:u})=>{let{search:d}=c({strict:!1}),f=r(()=>a.toSorted((e,t)=>
|
|
9
|
+
`,u=({categoryName:e,faqs:a,selectedTab:u})=>{let{search:d}=c({strict:!1}),f=r(()=>a.toSorted((e,t)=>(e.orderBy??0)-(t.orderBy??0)),[a]),p=r(()=>d?f.filter(t=>t.question.toLowerCase().includes(d.toLowerCase())||t.answer.toLowerCase().includes(d.toLowerCase())||e.toLowerCase().includes(d.toLowerCase())):f,[e,d,f]);return u!==void 0&&p.length===0?o(l,{children:s(t,{center:!1,children:[o(t.Title,{title:`No Questions Found`}),o(t.Description,{text:`No questions or answers matches your search in this category`})]})}):p.length===0?null:s(l,{children:[o(i,{variant:`h4`,children:e}),p.map(e=>o(n,{...e},e.id))]})};export{u as Category};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterProps } from "./Filter.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/Filter/Filter.d.ts
|
|
5
5
|
|
|
@@ -30,6 +30,6 @@ declare function Filter<T extends string>({
|
|
|
30
30
|
placeholder,
|
|
31
31
|
id,
|
|
32
32
|
...rest
|
|
33
|
-
}: FilterProps<T>):
|
|
33
|
+
}: FilterProps<T>): react_jsx_runtime5.JSX.Element;
|
|
34
34
|
//#endregion
|
|
35
35
|
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 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(),
|
|
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,variant:`border`})})]})})};export{m as ReleaseNotesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{sortByDate as e}from"../../../atoms/utils/sort.js";import{useReleaseNotesFilters as t}from"./useReleaseNotesFilters.js";import{useMemo as n}from"react";import{useReleaseNotesQuery as r}from"@equinor/subsurface-app-management";function i(){let{search:i,isFiltering:a}=t(),{data:o,isLoading:s}=r();return{data:n(()=>{let t=o??[];return i.releaseNoteTypes&&(t=t.filter(e=>i.releaseNoteTypes?.every(t=>!!e.tags?.includes(t)))),i.search&&(t=t.filter(e=>i.search?.every(t=>{let n=t.toLowerCase();return e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n)}))),t.sort((t,n)=>
|
|
1
|
+
import{sortByDate as e}from"../../../atoms/utils/sort.js";import{useReleaseNotesFilters as t}from"./useReleaseNotesFilters.js";import{useMemo as n}from"react";import{useReleaseNotesQuery as r}from"@equinor/subsurface-app-management";function i(){let{search:i,isFiltering:a}=t(),{data:o,isLoading:s}=r();return{data:n(()=>{let t=o??[];return i.releaseNoteTypes&&(t=t.filter(e=>i.releaseNoteTypes?.every(t=>!!e.tags?.includes(t)))),i.search&&(t=t.filter(e=>i.search?.every(t=>{let n=t.toLowerCase();return e.title.toLowerCase().includes(n)||e.body.toLowerCase().includes(n)}))),t.sort((t,n)=>e(t.releaseDate??t.createdDate,n.releaseDate??n.createdDate)),t},[o,i]),isLoading:s,isSearchingOrFiltering:a}}export{i as useFilteredReleaseNotes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{capitalize as e}from"../../../atoms/utils/string.js";import{useNavigate as t,useSearch as n}from"@tanstack/react-router";function r(){let r=n({strict:!1}),i=t(),
|
|
1
|
+
import{capitalize as e}from"../../../atoms/utils/string.js";import{useNavigate as t,useSearch as n}from"@tanstack/react-router";function r(){let r=n({strict:!1}),i=t();return{search:r,selected:{search:(r.search??[]).map(e=>({value:e,label:e})),releaseNoteTypes:(r.releaseNoteTypes??[]).map(t=>({value:t,label:e(t)}))},setSearchParam:(e,t)=>{i({to:`.`,search:n=>({...n,[e]:Array.isArray(t)&&t.length===0?void 0:t})})},clearAll:()=>{i({to:`.`,search:void 0})},isFiltering:r.search!==void 0||r.releaseNoteTypes!==void 0}}export{r as useReleaseNotesFilters};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react117 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: react117.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react117.RefAttributes<HTMLDivElement>>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { SideBar };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react125 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: react125.ForwardRefExoticComponent<ActionProps & react125.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Action };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react127 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: react127.ForwardRefExoticComponent<DescriptionProps & react127.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Description };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react129 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: react129.ForwardRefExoticComponent<MissingAccessesProps & react129.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { MissingAccesses };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react123 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: react123.ForwardRefExoticComponent<TitleProps & react123.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Title };
|
|
@@ -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 +1 @@
|
|
|
1
|
-
import{EnvironmentType as e}from"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import{useAuth as n}from"../../../providers/AuthProvider/AuthProvider.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,TextContent as d}from"./Account.styles.js";import{impersonateUserDtoToFullName as f}from"./ImpersonateMenu/Impersonate.utils.js";import{ImpersonateMenu as p}from"./ImpersonateMenu/ImpersonateMenu.js";import{AccountAvatar as m}from"./AccountAvatar.js";import{AccountButton as h}from"./AccountButton.js";import{ActiveUserImpersonationButton as g}from"./ActiveUserImpersonationButton.js";import{ImpersonateButton as _}from"./ImpersonateButton.js";import{RoleChips as v}from"./RoleChips.js";import{RoleList as ee}from"./RoleList.js";import{useCallback as te,useEffect as y,useMemo as b,useRef as x,useState as S}from"react";import{Icon as C,Typography as w}from"@equinor/eds-core-react";import{Fragment as T,jsx as E,jsxs as D}from"react/jsx-runtime";import{log_out as O}from"@equinor/eds-icons";const k=({renderCustomButton:k,hideRoles:A=!1,useDisplayNameForRole:j=!1,children:M,availableFields:N,availableWells:ne})=>{let P=t.getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME),F=t.getApiClientId(import.meta.env.VITE_API_CLIENT_ID),I=t.getAppName(import.meta.env.VITE_NAME),{account:L,roles:R,logout:z}=n(),[B,V]=S(!1),[H,U]=S(!1),W=x(null),{data:G=!0}=o(),{data:K}=a(),{mutate:q}=c(),J=s(K?K.roles:R??[],j),Y=K?f(K):L?.name,X=K?K.uniqueName:L?.username,Z=()=>V(!1),Q=te(()=>{V(e=>!e),U(!1)},[]),$=()=>{U(!0),V(!1)}
|
|
1
|
+
import{EnvironmentType as e}from"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import{useAuth as n}from"../../../providers/AuthProvider/AuthProvider.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,TextContent as d}from"./Account.styles.js";import{impersonateUserDtoToFullName as f}from"./ImpersonateMenu/Impersonate.utils.js";import{ImpersonateMenu as p}from"./ImpersonateMenu/ImpersonateMenu.js";import{AccountAvatar as m}from"./AccountAvatar.js";import{AccountButton as h}from"./AccountButton.js";import{ActiveUserImpersonationButton as g}from"./ActiveUserImpersonationButton.js";import{ImpersonateButton as _}from"./ImpersonateButton.js";import{RoleChips as v}from"./RoleChips.js";import{RoleList as ee}from"./RoleList.js";import{useCallback as te,useEffect as y,useMemo as b,useRef as x,useState as S}from"react";import{Icon as C,Typography as w}from"@equinor/eds-core-react";import{Fragment as T,jsx as E,jsxs as D}from"react/jsx-runtime";import{log_out as O}from"@equinor/eds-icons";const k=({renderCustomButton:k,hideRoles:A=!1,useDisplayNameForRole:j=!1,children:M,availableFields:N,availableWells:ne})=>{let P=t.getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME),F=t.getApiClientId(import.meta.env.VITE_API_CLIENT_ID),I=t.getAppName(import.meta.env.VITE_NAME),{account:L,roles:R,logout:z}=n(),[B,V]=S(!1),[H,U]=S(!1),W=x(null),{data:G=!0}=o(),{data:K}=a(),{mutate:q}=c(),J=s(K?K.roles:R??[],j),Y=K?f(K):L?.name,X=K?K.uniqueName:L?.username,Z=()=>V(!1),Q=te(()=>{V(e=>!e),U(!1)},[]),$=()=>{U(!0),V(!1)};return y(()=>{K&&K.appName!=null&&K.appName.toUpperCase()!=I.toUpperCase()&&q()},[K,I,q]),D(T,{children:[b(()=>k?k(W,Q):null,[k,Q])||E(h,{ref:W,onClick:Q}),D(i,{open:B,title:`Account`,onClose:Z,anchorEl:W.current,children:[D(u,{children:[K&&E(g,{onClick:$}),E(m,{}),D(d,{children:[E(w,{variant:`h6`,children:Y}),E(w,{children:X})]}),J&&!A&&E(T,{children:J.length<=3?E(v,{roles:J}):E(ee,{roles:J})}),M,G&&P!==e.PRODUCTION&&F&&E(_,{onOpenImpersonateMenu:$,onClose:Z})]}),E(l,{children:D(r,{variant:`ghost`,onClick:z,children:[E(C,{data:O}),`Log out`]})})]}),E(p,{open:H,onClose:()=>U(!1),anchorEl:W.current,availableFields:N,availableWells:ne})]})};k.displayName=`TopBar.Account`;export{k as Account};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{TextField as t}from"../../../../../molecules/TextField/TextField.js";import{ComboBox as n}from"../../../../../molecules/Select/ComboBox/ComboBox.js";import{SingleSelect as r}from"../../../../../molecules/Select/SingleSelect/SingleSelect.js";import{useAllAppRoles as i}from"../hooks/useAllAppRoles.js";import{useCreateImpersonation as a}from"../hooks/useCreateImpersonation.js";import{useEditImpersonation as o}from"../hooks/useEditImpersonation.js";import{Header as s}from"../Impersonate.styles.js";import{Container as c,Section as l}from"./CreateOrEditUser.styles.js";import{useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Button as m,DotProgress as h,Icon as g,Typography as _}from"@equinor/eds-core-react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{arrow_back as b}from"@equinor/eds-icons";const x=({editingUser:x,onBack:S,availableFields:C,availableWells:w})=>{let T=f(!1),[E,D]=p([]),[O,k]=p(``),[A,j]=p(``),[M,N]=p(``),[P,F]=p(void 0),[I,L]=p(void 0),{data:R,isLoading:z}=i();u(()=>{
|
|
1
|
+
import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{TextField as t}from"../../../../../molecules/TextField/TextField.js";import{ComboBox as n}from"../../../../../molecules/Select/ComboBox/ComboBox.js";import{SingleSelect as r}from"../../../../../molecules/Select/SingleSelect/SingleSelect.js";import{useAllAppRoles as i}from"../hooks/useAllAppRoles.js";import{useCreateImpersonation as a}from"../hooks/useCreateImpersonation.js";import{useEditImpersonation as o}from"../hooks/useEditImpersonation.js";import{Header as s}from"../Impersonate.styles.js";import{Container as c,Section as l}from"./CreateOrEditUser.styles.js";import{useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Button as m,DotProgress as h,Icon as g,Typography as _}from"@equinor/eds-core-react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{arrow_back as b}from"@equinor/eds-icons";const x=({editingUser:x,onBack:S,availableFields:C,availableWells:w})=>{let T=f(!1),[E,D]=p([]),[O,k]=p(``),[A,j]=p(``),[M,N]=p(``),[P,F]=p(void 0),[I,L]=p(void 0),{data:R,isLoading:z}=i();u(()=>{x&&R&&!T.current&&(T.current=!0,D(x.roles.map(e=>{let t=R.find(t=>t.value===e);return t?{value:e,label:t.displayName}:{value:e,label:e}})),C&&F(C.find(e=>e.uuid==x.field)?.name??void 0),w&&L(w.find(e=>e==x.well)??void 0),k(x.firstName),j(x.lastName),N(x.email??``))},[R,x,T,C,w]);let B=d(()=>R?.map(e=>({value:e.value,label:e.displayName}))??[],[R]),V=C?.map(e=>({value:e.uuid??``,label:e.name??``}))??[],H=w?.map(e=>({value:e,label:e}))??[],{mutateAsync:U,isPending:W}=a(),{mutateAsync:G,isPending:K}=o(),q=W||K,J=d(()=>O===``||A===``||E.length===0,[O,A,E.length]);return y(c,{children:[y(s,{children:[v(m,{variant:`ghost_icon`,onClick:S,children:v(g,{data:b})}),v(_,{variant:`h6`,children:x?`Edit user`:`Create new user`})]}),y(l,{children:[v(t,{id:`first-name`,label:`First name`,placeholder:`Add first name...`,value:O,onChange:e=>{k(e.target.value)}}),v(t,{id:`last-name`,label:`Last name`,placeholder:`Add last name...`,value:A,onChange:e=>{j(e.target.value)}}),v(t,{id:`email`,label:`E-mail`,placeholder:`Add e-mail...`,meta:`Optional`,value:M,onChange:e=>{N(e.target.value)}})]}),y(l,{children:[V&&V.length>0&&v(r,{placeholder:`Select field...`,label:`Field`,meta:`Optional (For internal application role purposes)`,value:V.find(e=>e.value===P),onSelect:e=>{F(e?.value)},items:V}),H&&H.length>0&&v(r,{label:`Well`,placeholder:`Select well...`,meta:`Optional (For internal application role purposes)`,value:H.find(e=>e.value===I),onSelect:e=>{L(e?.value)},items:H})]}),v(l,{children:v(n,{label:`Roles`,placeholder:`Select roles...`,values:E,onSelect:e=>{D(e)},items:B,loading:z})}),y(l,{children:[v(m,{variant:`outlined`,onClick:S,children:`Cancel`}),q?v(m,{children:v(h,{})}):v(m,{onClick:async()=>{x?(await G({id:x.id,firstName:O,lastName:A,fullName:`${O} ${A}`,email:M===``?void 0:M,field:P,well:I,roles:E.map(e=>e.value).sort(),uniqueName:x.uniqueName,appName:x.appName,activeUsers:[]}),S()):(await U({firstName:O,lastName:A,field:P,well:I,email:M===``?void 0:M,roles:E.map(e=>e.value).sort(),uniqueName:`${O}.${A}`.toLowerCase(),appName:e.getAppName(import.meta.env.VITE_NAME),activeUsers:[]}),S())},disabled:J,children:x?`Save`:`Create`})]})]})};export{x as CreateOrEditUser};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react121 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: react121.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react121.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Actions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{environment as e}from"../../../atoms/utils/auth_environment.js";import{colors as t}from"../../../atoms/style/colors.js";import{ApplicationIcon as n}from"../../../molecules/ApplicationIcon/ApplicationIcon.js";import{TopBarMenu as r}from"../TopBarMenu.js";import{TopBarButton as i}from"../TopBar.styles.js";import{ApplicationBox as a,ApplicationButton as o,ApplicationContent as s,ApplicationName as c,LoadingApplications as l,MenuFixedItem as u,MenuSection as d,NoApplications as f,TextContainer as p}from"./ApplicationDrawer.styles.js";import{TransferToAppDialog as m}from"../TransferToAppDialog.js";import{useRef as h,useState as g}from"react";import{DotProgress as _,Icon as v,Typography as y}from"@equinor/eds-core-react";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{apps as C,exit_to_app as w}from"@equinor/eds-icons";import{AmplifyApplicationService as T}from"@equinor/subsurface-app-management";import{useQuery as E}from"@tanstack/react-query";const{getAppName:D,PORTAL_URL_WITHOUT_LOCALHOST:O}=e,k=()=>{let[e,k]=g(!1),[A,j]=g(void 0),[M,N]=g(!1),{data:P=[],isLoading:F}=E({queryKey:[`userApplications`],queryFn:()=>T.userApplications()}),I=h(null),L=()=>k(!e),R=()=>{k(!1),j(void 0)},z=e=>{j(e)},B=()=>{N(!0)};return F?S(b,{children:[x(i,{variant:`ghost_icon`,onClick:L,ref:I,children:x(v,{data:C,size:24})}),x(r,{open:e,title:`Your available applications`,onClose:R,anchorEl:I.current,contentPadding:!1,children:x(b,{children:x(d,{children:x(s,{children:x(l,{children:x(_,{color:`primary`})})})})})})]}):S(b,{children:[x(i,{variant:`ghost`,onClick:L,ref:I,children:x(v,{data:C,size:24})}),x(r,{open:e,title:`Your available applications`,onClose:R,anchorEl:I.current,contentPadding:!1,children:S(b,{children:[S(d,{children:[P.length===0?x(f,{children:x(y,{group:`paragraph`,variant:`body_short`,style:{color:t.text.static_icons__tertiary.rgba},children:`You don't have access to other applications`})}):x(y,{group:`paragraph`,variant:`overline`,children:`SWITCH BETWEEN APPS`}),x(s,{children:x(b,{children:P.map((e,t)=>{
|
|
1
|
+
import{environment as e}from"../../../atoms/utils/auth_environment.js";import{colors as t}from"../../../atoms/style/colors.js";import{ApplicationIcon as n}from"../../../molecules/ApplicationIcon/ApplicationIcon.js";import{TopBarMenu as r}from"../TopBarMenu.js";import{TopBarButton as i}from"../TopBar.styles.js";import{ApplicationBox as a,ApplicationButton as o,ApplicationContent as s,ApplicationName as c,LoadingApplications as l,MenuFixedItem as u,MenuSection as d,NoApplications as f,TextContainer as p}from"./ApplicationDrawer.styles.js";import{TransferToAppDialog as m}from"../TransferToAppDialog.js";import{useRef as h,useState as g}from"react";import{DotProgress as _,Icon as v,Typography as y}from"@equinor/eds-core-react";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{apps as C,exit_to_app as w}from"@equinor/eds-icons";import{AmplifyApplicationService as T}from"@equinor/subsurface-app-management";import{useQuery as E}from"@tanstack/react-query";const{getAppName:D,PORTAL_URL_WITHOUT_LOCALHOST:O}=e,k=()=>{let[e,k]=g(!1),[A,j]=g(void 0),[M,N]=g(!1),{data:P=[],isLoading:F}=E({queryKey:[`userApplications`],queryFn:()=>T.userApplications()}),I=h(null),L=()=>k(!e),R=()=>{k(!1),j(void 0)},z=e=>{j(e)},B=()=>{N(!0)};return F?S(b,{children:[x(i,{variant:`ghost_icon`,onClick:L,ref:I,children:x(v,{data:C,size:24})}),x(r,{open:e,title:`Your available applications`,onClose:R,anchorEl:I.current,contentPadding:!1,children:x(b,{children:x(d,{children:x(s,{children:x(l,{children:x(_,{color:`primary`})})})})})})]}):S(b,{children:[x(i,{variant:`ghost`,onClick:L,ref:I,children:x(v,{data:C,size:24})}),x(r,{open:e,title:`Your available applications`,onClose:R,anchorEl:I.current,contentPadding:!1,children:S(b,{children:[S(d,{children:[P.length===0?x(f,{children:x(y,{group:`paragraph`,variant:`body_short`,style:{color:t.text.static_icons__tertiary.rgba},children:`You don't have access to other applications`})}):x(y,{group:`paragraph`,variant:`overline`,children:`SWITCH BETWEEN APPS`}),x(s,{children:x(b,{children:P.map((e,t)=>x(a,{$isSelected:D(import.meta.env.VITE_NAME)===e.name,"data-testid":`application-box-${e.name}`,children:S(o,{variant:`ghost_icon`,onClick:()=>z(e),"data-testid":e.name,children:[x(n,{name:e.name.toLowerCase(),size:36}),x(c,{children:x(y,{group:`paragraph`,variant:`caption`,children:e.name})})]})},t))})})]}),x(u,{"data-testid":`access-it-link`,onClick:B,children:S(`div`,{children:[S(p,{children:[x(y,{variant:`overline`,children:`Access to more applications?`}),x(y,{variant:`h6`,children:`Go to Application Portal`})]}),x(v,{data:w,color:t.interactive.primary__resting.rgba,size:24})]})})]})}),M&&x(m,{onClose:R,applicationName:`Portal`,url:O}),A&&x(m,{onClose:R,applicationName:A.name,url:A.url})]})};export{k as ApplicationDrawer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Field } from "../../../atoms/types/Field.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react119 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: react119.ForwardRefExoticComponent<FieldMenuProps & react119.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { FieldMenu };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react137 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: react137.Context<NotificationContext | undefined>;
|
|
10
10
|
declare const useNotification: () => NotificationContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNotification };
|
|
@@ -2,6 +2,6 @@ import{OptionalTooltip as e}from"../../../../../molecules/OptionalTooltip/Option
|
|
|
2
2
|
white-space: break-spaces;
|
|
3
3
|
text-align: center;
|
|
4
4
|
width: 400px;
|
|
5
|
-
`,o=t(({show:e,children:t},r)=>{
|
|
5
|
+
`,o=t(({show:e,children:t},r)=>i(a,{title:n(()=>e?`The report was successfully submitted to ServiceNow.
|
|
6
6
|
This field is locked so you can retry sending it to the development team.
|
|
7
|
-
To reset the form, use the button in the bottom left corner.`:``,[e])
|
|
7
|
+
To reset the form, use the button in the bottom left corner.`:``,[e]),children:i(`div`,{ref:r,children:t})}));o.displayName=`LockedInputTooltip`;export{o as LockedInputTooltip};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{SingleSelect as e}from"../../../../../molecules/Select/SingleSelect/SingleSelect.js";import{UrgencyOption as t}from"../Feedback.types.js";import{useFeedbackContext as n}from"../hooks/useFeedbackContext.js";import{LockedInputTooltip as r}from"./LockedInputTooltip.js";import i from"styled-components";import{jsx as a}from"react/jsx-runtime";const o=i.div`
|
|
2
2
|
grid-column: 1/2;
|
|
3
|
-
`,s=Object.values(t).map(e=>({value:e,label:e})),c=()=>{let{serviceNowSuccess:t,feedbackContent:i,updateFeedback:c}=n()
|
|
3
|
+
`,s=Object.values(t).map(e=>({value:e,label:e})),c=()=>{let{serviceNowSuccess:t,feedbackContent:i,updateFeedback:c}=n();return a(o,{children:a(r,{show:t,children:a(e,{items:s,label:`Severity`,meta:`optional`,clearable:!1,disabled:t,value:i.urgency?{value:i.urgency,label:i.urgency}:void 0,placeholder:`Select error impact`,onSelect:e=>{c(`urgency`,e.value)}})})})};export{c as Severity};
|
|
@@ -4,4 +4,4 @@ import{tokens as e}from"../../../../../../node_modules/@equinor/eds-tokens/dist/
|
|
|
4
4
|
width: 82px;
|
|
5
5
|
height: 82px;
|
|
6
6
|
position: relative;
|
|
7
|
-
`,_=e=>{let[u,_]=c(``),{error:v,onDelete:y}=e,b=s(()=>{if(!v)return;let t=e.errors[0].code,n=e.errors[0].message;return t===`file-too-large`?n=n.replace(/(\d+ bytes)/,`1MB`):t===`file-invalid-type`&&(n=n.replace(/(\w+\/\w+,)/g,``).replaceAll(`,`,`, `)),`${e.errors[0].code} \n${n}`},[v,e]),x=s(()=>e.file.name,[v,e]),S=s(()=>v?e.errors.find(e=>e.code.includes(`invalid`))?`Invalid file type`:e.errors.find(e=>e.code.includes(`large`))?`Invalid file size`:`Error`:``,[v,e]);return o(()=>{v||(async e=>{
|
|
7
|
+
`,_=e=>{let[u,_]=c(``),{error:v,onDelete:y}=e,b=s(()=>{if(!v)return;let t=e.errors[0].code,n=e.errors[0].message;return t===`file-too-large`?n=n.replace(/(\d+ bytes)/,`1MB`):t===`file-invalid-type`&&(n=n.replace(/(\w+\/\w+,)/g,``).replaceAll(`,`,`, `)),`${e.errors[0].code} \n${n}`},[v,e]),x=s(()=>e.file.name,[v,e]),S=s(()=>v?e.errors.find(e=>e.code.includes(`invalid`))?`Invalid file type`:e.errors.find(e=>e.code.includes(`large`))?`Invalid file size`:`Error`:``,[v,e]);return o(()=>{v||(async e=>{_(await t(e))})(e.file)},[v,e]),f(g,{children:[d(r,{title:`${x}${v?`: `+b:``}`,children:v?f(a,{children:[d(l,{data:m,color:h.interactive.warning__text.rgba}),d(`div`,{children:S})]}):d(i,{children:d(`img`,{src:u,alt:`Uploaded file: ${x}`})})}),d(n,{"data-testid":`attachment-delete-button`,onClick:y,children:d(l,{color:h.text.static_icons__tertiary.rgba,data:p,size:24})})]})};export{_ as ImageFile};
|
|
@@ -2,4 +2,4 @@ import{FileUploadArea as e}from"../../../../../../molecules/FileUploadArea/FileU
|
|
|
2
2
|
grid-column: 1/3;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function d(e,t){if(e.length===0||e.length===1)return e;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++)t(e[n],e[r])&&e.splice(n,1);return e}const f=()=>{let{feedbackAttachments:s,setFeedbackAttachments:f}=n(),[p,m]=o([]),h=(e,t)=>{if(e.length>=1){let t=e.filter(e=>!e.name.startsWith(`.`));new FileReader().readAsDataURL(e[0]);let n=[];s&&n.push(...s)
|
|
5
|
+
`;function d(e,t){if(e.length===0||e.length===1)return e;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++)t(e[n],e[r])&&e.splice(n,1);return e}const f=()=>{let{feedbackAttachments:s,setFeedbackAttachments:f}=n(),[p,m]=o([]),h=(e,t)=>{if(e.length>=1){let t=e.filter(e=>!e.name.startsWith(`.`));new FileReader().readAsDataURL(e[0]);let n=[];s&&n.push(...s),f(d([...t,...n],(e,t)=>e.name===t.name&&e.size===t.size))}m(t)},g=e=>{f(s?.filter(t=>t.name!==e.name&&t.size!==e.size)??[])},_=e=>{m(p?.filter(t=>t.file.name===e.file.name&&t.file.size!==e.file.size)??[])};return l(u,{children:[c(i,{group:`input`,variant:`label`,children:`Attachments (.jpg, .jpeg, .png) (max 1 MB)`}),l(r,{children:[c(e,{maxSize:t,onDrop:h,accept:{"image/jpeg":[`.jpeg`,`.jpg`],"image/png":[`.png`]},size:`small`}),s?.map(e=>c(a,{onDelete:()=>g(e),file:e},e.name+e.size)),p.map(e=>c(a,{...e,onDelete:()=>_(e),error:!0},e.file.name+e.file.size))]})]})};export{f as UploadFile};
|
|
@@ -18,4 +18,4 @@ import{animation as e}from"../../../atoms/style/animation.js";import{colors as t
|
|
|
18
18
|
&:hover {
|
|
19
19
|
background: ${t.interactive.primary__hover_alt.rgba};
|
|
20
20
|
}
|
|
21
|
-
`,f=({onTutorialStart:e,onClose:n,id:a,name:f})=>{let{startTutorial:p,seenTutorialIDs:m}=u()
|
|
21
|
+
`,f=({onTutorialStart:e,onClose:n,id:a,name:f})=>{let{startTutorial:p,seenTutorialIDs:m}=u();return s(d,{onClick:()=>{p(a),e?.(a),n()},children:[m.includes(a)&&s(`header`,{children:[o(r,{data:c,size:16,color:t.interactive.primary__resting.rgba}),o(i,{varinat:`caption`,children:`COMPLETED`})]}),o(i,{variant:`h4`,children:f}),o(r,{data:l,color:t.interactive.primary__resting.rgba})]})};export{f as TutorialItem};
|
|
@@ -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{InteractionRequiredAuthError as l,InteractionType as u}from"@azure/msal-browser";import{jsx as d}from"react/jsx-runtime";import{jwtDecode as f}from"jwt-decode";const{GRAPH_ENDPOINTS:p,GRAPH_REQUESTS_LOGIN:m,GRAPH_REQUESTS_PHOTO:h,GRAPH_REQUESTS_BACKEND:g,fetchMsGraph:_,isInIframe:v}=e,{getApiScope:y}=t,b=({children:e,account:t,setAccount:b,setPhoto:x,setRoles:S,authState:C,setAuthState:w,withoutLoader:T,loadingComponent:E,unauthorizedComponent:D,withoutBackend:O})=>{let{instance:k,accounts:A,inProgress:j}=s(),{login:M,result:N,error:P,acquireToken:F}=c(u.Silent,m),[I,L]=o(!1),R=a(!1);return i(()=>{I||(async()=>{console.log(`[AuthProvider] Initializing`),await k.initialize(),console.log(`[AuthProvider] Finished initializing`),L(!0)})().catch(e=>{console.error(`[AuthProvider] Error during initialization`,e)})},[k,I]),i(()=>{I&&(P instanceof l&&!v()&&C!==`unauthorized`?(console.error(P),console.log(`[AuthProvider] No account found, need to login via. redirect`),M(u.Redirect,m).catch(e=>{console.error(`[AuthProvider] Error during login`,e)})):N?.account&&!t?(console.log(`[AuthProvider] Found account in useMsalAuth result, setting that one as active`),k.setActiveAccount(N.account),b(N.account)):A.length>0&&!t?(console.log(`[AuthProvider] Found account in accounts array, setting that one as active`),k.setActiveAccount(A[0]),b(A[0])):P&&console.error(`[AuthProvider] Unexpected error:`,P))},[t,A,P,k,I,M,N,b,C]),i(()=>{if(!t||!I||R.current||j!==`none`)return;R.current=!0;let e=async()=>{try{let e=await F(u.Silent,h);if(e){let t=await _(p.PHOTO,e.accessToken);if(t.status===404)return null;let n=await t.blob()
|
|
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{InteractionRequiredAuthError as l,InteractionType as u}from"@azure/msal-browser";import{jsx as d}from"react/jsx-runtime";import{jwtDecode as f}from"jwt-decode";const{GRAPH_ENDPOINTS:p,GRAPH_REQUESTS_LOGIN:m,GRAPH_REQUESTS_PHOTO:h,GRAPH_REQUESTS_BACKEND:g,fetchMsGraph:_,isInIframe:v}=e,{getApiScope:y}=t,b=({children:e,account:t,setAccount:b,setPhoto:x,setRoles:S,authState:C,setAuthState:w,withoutLoader:T,loadingComponent:E,unauthorizedComponent:D,withoutBackend:O})=>{let{instance:k,accounts:A,inProgress:j}=s(),{login:M,result:N,error:P,acquireToken:F}=c(u.Silent,m),[I,L]=o(!1),R=a(!1);return i(()=>{I||(async()=>{console.log(`[AuthProvider] Initializing`),await k.initialize(),console.log(`[AuthProvider] Finished initializing`),L(!0)})().catch(e=>{console.error(`[AuthProvider] Error during initialization`,e)})},[k,I]),i(()=>{I&&(P instanceof l&&!v()&&C!==`unauthorized`?(console.error(P),console.log(`[AuthProvider] No account found, need to login via. redirect`),M(u.Redirect,m).catch(e=>{console.error(`[AuthProvider] Error during login`,e)})):N?.account&&!t?(console.log(`[AuthProvider] Found account in useMsalAuth result, setting that one as active`),k.setActiveAccount(N.account),b(N.account)):A.length>0&&!t?(console.log(`[AuthProvider] Found account in accounts array, setting that one as active`),k.setActiveAccount(A[0]),b(A[0])):P&&console.error(`[AuthProvider] Unexpected error:`,P))},[t,A,P,k,I,M,N,b,C]),i(()=>{if(!t||!I||R.current||j!==`none`)return;R.current=!0;let e=async()=>{try{let e=await F(u.Silent,h);if(e){let t=await _(p.PHOTO,e.accessToken);if(t.status===404)return null;let n=await t.blob();x((window.URL??window.webkitURL).createObjectURL(n))}}catch(e){console.error(e)}},n=async()=>{try{let e=await F(u.Silent,g(y(import.meta.env.VITE_API_SCOPE)));if(console.log(`[AuthProvider] Successfully acquired token`),e&&e.accessToken){console.log(`[AuthProvider] Decoding token`);let t=f(e.accessToken);if(console.log(`[AuthProvider] Token was valid`),t.roles)console.log(`[AuthProvider] Found roles`),S(t.roles);else throw Error(`Could not find roles in token`);w(`authorized`)}}catch(e){console.error(`[AuthProvider] Token error when trying to get roles!`,e),w(`unauthorized`)}};(async()=>{await e(),O?w(`authorized`):await n()})()},[t,F,P,I,j,w,x,S,O]),C===`unauthorized`?D??d(r,{}):T?e:C===`loading`||t===void 0?E??d(n,{variant:`application`}):e};export{b as AuthProviderInner};
|
|
@@ -21,4 +21,4 @@ import{spacings as e}from"../../atoms/style/spacings.js";import{getHighlightElem
|
|
|
21
21
|
height: 100vh;
|
|
22
22
|
background: none;
|
|
23
23
|
pointer-events: none;
|
|
24
|
-
`,g=({children:e,contentRef:s})=>{let{activeTutorial:g,activeStep:_,unseenTutorialsOnThisPage:v}=f(),y=p()>0,b=n(s),[x,S]=o({width:window.innerWidth,height:window.innerHeight});a(()=>{let e=()=>{S({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let[C,w]=o([]);a(()=>{y||(async()=>{if(g&&_!==void 0){if(!g.steps[_].highlightElement)return w([]);let e=await t(g.id,_,x);return w(e?[e]:[])}
|
|
24
|
+
`,g=({children:e,contentRef:s})=>{let{activeTutorial:g,activeStep:_,unseenTutorialsOnThisPage:v}=f(),y=p()>0,b=n(s),[x,S]=o({width:window.innerWidth,height:window.innerHeight});a(()=>{let e=()=>{S({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let[C,w]=o([]);a(()=>{y||(async()=>{if(g&&_!==void 0){if(!g.steps[_].highlightElement)return w([]);let e=await t(g.id,_,x);return w(e?[e]:[])}return w((await Promise.all(v.map(e=>{if(e.steps.at(0)?.highlightElement)return t(e.id,0,x)}))).filter(e=>e!==void 0))})()},[_,g,y,v,x]);let T=g?[g]:v.filter(e=>e.steps[0].highlightElement&&C.some(e=>e.id)||!e.steps[0].highlightElement);return T.length>0?u(c,{children:[e,l(h,{children:T.map(e=>{let t=C.find(t=>t.id===e.id);return l(i,{isHighlighting:C.length>0,contentRef:s,...e,...t},e.id)})}),u(m,{children:[u(`mask`,{id:`tutorials-rectangles`,children:[l(`rect`,{width:`100%`,height:`100%`,fill:`white`}),l(d.g,{style:{translateY:b},children:C.map(e=>l(d.path,{"data-testid":`tutorial-mask-${e.id}`,initial:{opacity:0,d:`M ${e.left} ${e.top} h ${e.width} v ${e.height} h -${e.width} Z`},animate:{opacity:1,d:`M ${e.left} ${e.top} h ${e.width} v ${e.height} h -${e.width} Z`},fill:`black`},e.id))})]}),l(d.rect,{width:`100%`,height:`100%`,fill:`rgba(111, 111, 111, 0.35)`,mask:`url(#tutorials-rectangles)`,...r})]})]}):l(c,{children:e})};export{g as TutorialHighlightingProviderInner};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/amplify-component-lib",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"description": "Frontend Typescript components for the Amplify team",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"@faker-js/faker": "^9.6.0",
|
|
59
59
|
"@storybook/addon-coverage": "^2.0.0",
|
|
60
60
|
"@storybook/addon-designs": "^10.0.2",
|
|
61
|
-
"@storybook/addon-docs": "^9.1.
|
|
62
|
-
"@storybook/addon-links": "^9.1.
|
|
63
|
-
"@storybook/react-vite": "^9.1.
|
|
61
|
+
"@storybook/addon-docs": "^9.1.10",
|
|
62
|
+
"@storybook/addon-links": "^9.1.10",
|
|
63
|
+
"@storybook/react-vite": "^9.1.10",
|
|
64
64
|
"@tanstack/react-query": "^5.67.2",
|
|
65
65
|
"@testing-library/dom": "^10.4.0",
|
|
66
66
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"react-dom": "^19.0.0",
|
|
97
97
|
"resize-observer-polyfill": "^1.5.1",
|
|
98
98
|
"resolve-tspaths": "^0.8.23",
|
|
99
|
-
"storybook": "^9.1.
|
|
99
|
+
"storybook": "^9.1.10",
|
|
100
100
|
"tsdown": "^0.14.2",
|
|
101
101
|
"typescript": "^5.8.2",
|
|
102
102
|
"typescript-eslint": "^8.26.1",
|