@equinor/amplify-component-lib 8.18.1 → 8.19.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.
@@ -1 +1 @@
1
- import{useState as e,useRef as n,useMemo as r,useEffect as t}from"react";import{flattenOptions as l}from"../../molecules/Select/Select.utils.js";const u=u=>{const{loading:a,disabled:c,sortValues:o,onSearchChange:d,onOpenCallback:s}=u,[i,v]=e(!1),[h,m]=e(""),f=n(null),g=n([]),p=n(-1),[y,k]=e(void 0),S=n(!1),I=n(0),A=r((()=>{let e,n=[];return"values"in u?n=u.values:u.value&&(n=[u.value]),o?(e="groups"in u&&u.groups?u.groups.flatMap((e=>e.items)):u.items.flatMap((e=>[{...e},...e.children||[]])),n.sort(((n,r)=>e.findIndex((e=>e.value===n.value))-e.findIndex((e=>e.value===r.value))))):n}),[u,o]);t((()=>{void 0!==s&&s(i)}),[s,i]),t((()=>{S.current&&I.current!==A.length&&(I.current=A.length,S.current=!1,f.current?.focus())}),[A.length]);const O=()=>{i||c||a||(f.current?.focus(),v(!0))},w=()=>{v(!1),m(""),p.current=0},C=e=>{!("values"in u)||a||c||u.onSelect(u.values.filter((n=>n.value!==e.value)),e)};return{handleOnAddItem:()=>{"onAddItem"in u&&u.onAddItem&&(u.onAddItem(h),m(""))},handleOnItemSelect:e=>{"value"in u?u.onSelect(e):u.onSelect(((e,n)=>{const r=structuredClone(e);return r.some((e=>e.value===n.value))?r.filter((e=>e.value!==n.value)):"values"in u&&void 0!==u.syncParentChildSelection&&!u.syncParentChildSelection?[n,...r]:[n,...r.filter((e=>(!(void 0===n.children||n.children.length>0)||!l([n]).some((n=>n.value===e.value)))&&(void 0===e.children||0===e.children.length||l([e]).every((e=>e.value!==n.value)))))]})(u.values,e),e),""!==h&&m(""),S.current=!0},handleOnItemKeyDown:e=>{"ArrowDown"===e.key&&p.current<g.current.length-1?(p.current+=1,g.current.at(p.current)?.focus()):"ArrowUp"===e.key&&p.current>0?(p.current-=1,g.current.at(p.current)?.focus()):"ArrowUp"===e.key&&0===p.current&&(p.current=-1,f.current?.focus())},handleOnSearchKeyDown:e=>{"Enter"===e.key&&""!==h&&"onAddItem"in u&&u.onAddItem?(e.preventDefault(),u.onAddItem(h),m("")):"Space"===e.key||"Enter"===e.key?O():"Escape"===e.key?(f.current?.blur(),w()):"ArrowDown"!==e.key&&"ArrowUp"!==e.key||!g.current.at(0)?"Backspace"===e.key&&void 0===y&&"values"in u&&""===h?(k(A?.at(-1)),setTimeout((()=>{f.current?.focus()}))):"Backspace"===e.key&&y&&(C(y),k(void 0)):(g.current[0]?.focus(),p.current=0)},handleOnClear:()=>{"value"in u?u.onSelect(void 0):u.onSelect([])},handleOnSearchChange:e=>{" "===e.target.value||a||c||(m(e.target.value),d?.(e.target.value),i||v(!0),A.length>0&&""!==e.target.value&&setTimeout((()=>{f.current?.focus()})))},handleToggleOpen:()=>{c||a||(i?w():O())},handleOnClose:w,handleOnOpen:O,handleOnRemoveItem:C,search:h,searchRef:f,itemRefs:g,selectedValues:A,open:i,tryingToRemoveItem:y}};export{u as useSelect};
1
+ import{useState as e,useRef as n,useMemo as r,useEffect as t}from"react";import{flattenOptions as l}from"../../molecules/Select/Select.utils.js";const u=u=>{const{loading:a,disabled:c,sortValues:o,onSearchChange:d,onOpenCallback:s}=u,[v,i]=e(!1),[h,m]=e(""),f=n(null),g=n([]),p=n(-1),[y,S]=e(void 0),k=n(!1),I=n(0),A=r((()=>{let e,n=[];return"values"in u?n=u.values:u.value&&(n=[u.value]),o?(e="groups"in u&&u.groups?u.groups.flatMap((e=>e.items)):u.items.flatMap((e=>[{...e},...e.children||[]])),n.sort(((n,r)=>e.findIndex((e=>e.value===n.value))-e.findIndex((e=>e.value===r.value))))):n}),[u,o]);t((()=>{void 0!==s&&s(v)}),[s,v]),t((()=>{k.current&&I.current!==A.length&&(I.current=A.length,k.current=!1,f.current?.focus())}),[A.length]);const O=()=>{v||c||a||(f.current?.focus(),i(!0))},w=()=>{i(!1),m(""),p.current=0},C=e=>{!("values"in u)||a||c||u.onSelect(u.values.filter((n=>n.value!==e.value)),e)};return{handleOnAddItem:()=>{"onAddItem"in u&&u.onAddItem&&(u.onAddItem(h),m(""))},handleOnItemSelect:e=>{"value"in u?u.value?.value===e.value?u.onSelect(void 0):u.onSelect(e):u.onSelect(((e,n)=>{const r=structuredClone(e);return r.some((e=>e.value===n.value))?r.filter((e=>e.value!==n.value)):"values"in u&&void 0!==u.syncParentChildSelection&&!u.syncParentChildSelection?[n,...r]:[n,...r.filter((e=>(!(void 0===n.children||n.children.length>0)||!l([n]).some((n=>n.value===e.value)))&&(void 0===e.children||0===e.children.length||l([e]).every((e=>e.value!==n.value)))))]})(u.values,e),e),""!==h&&m(""),k.current=!0},handleOnItemKeyDown:e=>{"ArrowDown"===e.key&&p.current<g.current.length-1?(p.current+=1,g.current.at(p.current)?.focus()):"ArrowUp"===e.key&&p.current>0?(p.current-=1,g.current.at(p.current)?.focus()):"ArrowUp"===e.key&&0===p.current&&(p.current=-1,f.current?.focus())},handleOnSearchKeyDown:e=>{"Enter"===e.key&&""!==h&&"onAddItem"in u&&u.onAddItem?(e.preventDefault(),u.onAddItem(h),m("")):"Space"===e.key||"Enter"===e.key?O():"Escape"===e.key?(f.current?.blur(),w()):"ArrowDown"!==e.key&&"ArrowUp"!==e.key||!g.current.at(0)?"Backspace"===e.key&&void 0===y&&"values"in u&&""===h?(S(A?.at(-1)),setTimeout((()=>{f.current?.focus()}))):"Backspace"===e.key&&y&&(C(y),S(void 0)):(g.current[0]?.focus(),p.current=0)},handleOnClear:()=>{"value"in u?u.onSelect(void 0):u.onSelect([])},handleOnSearchChange:e=>{" "===e.target.value||a||c||(m(e.target.value),d?.(e.target.value),v||i(!0),A.length>0&&""!==e.target.value&&setTimeout((()=>{f.current?.focus()})))},handleToggleOpen:()=>{c||a||(v?w():O())},handleOnClose:w,handleOnOpen:O,handleOnRemoveItem:C,search:h,searchRef:f,itemRefs:g,selectedValues:A,open:v,tryingToRemoveItem:y}};export{u as useSelect};
@@ -13,5 +13,8 @@ import{colors as t}from"../../atoms/style/colors.js";import o from"styled-compon
13
13
 
14
14
  div:has(> button) {
15
15
  outline-width: 1px;
16
+ > button:focus-visible {
17
+ outline: none;
18
+ }
16
19
  }
17
20
  `;export{e as DatePickerWrapper};
@@ -1 +1 @@
1
- import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useState as e,useEffect as i,useMemo as o}from"react";import{Icon as s,Typography as n}from"@equinor/eds-core-react";import{error_outlined as a,clear as m}from"@equinor/eds-icons";import{Rejection as p,DoneWrapper as l,LoadingWrapper as c,CircularProgress as d,CompactFileProgressContainer as j,FileTooltip as h,AdditionalText as u,CloseButton as v}from"./CompactFileProgress.styles.js";import{isFileImage as g,getFileIcon as S,readUploadedFileAsText as P}from"./FileProgress.utils.js";import{colors as f}from"../../atoms/style/colors.js";import"../AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../ApplicationIcon/ApplicationIcon.js";import"../Badge/Badge.styles.js";import"../Banner/Banner.styles.js";import"../Chip/Chip.js";import"../ContentMenu/ContentMenu.styles.js";import"../DatePicker/DatePicker.js";import"../Dialog/Dialog.js";import"../EquinorLogo/EquinorLogo.js";import"../RichTextEditor/custom-extensions/AmplifyKit.js";import"../RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../atoms/enums/Environment.js";import"../../atoms/utils/auth_environment.js";import"../../organisms/TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"../../providers/TutorialStepsProvider.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import"./RegularFileProgress.styles.js";import"../FileUploadArea/FileUploadArea.js";import"../FullPageSpinner/FullPageSpinner.js";import"../InfoElement/InfoElement.js";import{OptionalTooltip as E}from"../OptionalTooltip/OptionalTooltip.js";import"../ProfileAvatar/ProfileAvatar.js";import"@tiptap/react";import"../RichTextEditor/RichTextEditor.styles.js";import"../RichTextEditor/MenuBar/MenuBar.js";import"../RichTextEditor/MenuBar/MenuBar.styles.js";import"../RichTextEditor/MenuBar/MenuButton.js";import"../Search/Search.js";import"react-router-dom";import"../Sieve/Sieve.styles.js";import"../SingleFilterMenu/SingleFilterMenu.js";import"../Skeleton/SkeletonBase/SkeletonBase.js";import"../Skeleton/Skeleton.styles.js";import"../Stepper/Stepper.js";import"../OptionDrawer/OptionDrawer.js";import"../Select/Select.styles.js";import"../ListItem/ListItem.js";import"../SelectionControls/Checkbox/Checkbox.js";import"../SelectionControls/Radio/Radio.js";import"../SelectionControls/Switch/Switch.js";const k=({file:k,progressPercent:y,isError:T,shortErrorText:x,showCompleteState:C,fullErrorText:A,handleOnClick:B,isDeleting:R})=>{const[M,b]=e("");i((()=>{T||(async r=>{const t=await P(r);b(t)})(k)}),[T,k]);const F=o((()=>T?A&&A.length>0?A:"An error has occurred with the file":""),[A,T]),w=o((()=>T?r(p,{children:[t(s,{data:a,color:f.interactive.warning__text.rgba}),t("div",{children:x&&x.length>0?x:"Invalid file type"})]}):C&&!R&&g(k.name)?t(l,{children:t("img",{src:M,alt:` ${k.name}`})}):C&&!R?t(l,{children:t(s,{data:S(k.name)})}):r(c,{children:[t(d,{variant:void 0===y||R?"indeterminate":"determinate",value:y,size:24}),t(n,{variant:"meta",children:"Uploading..."})]})),[T,C,R,y,x,M,k.name]);return r(j,{$isError:T,children:[t(h,{title:F,children:w}),t(E,{title:k.name,children:t(u,{group:"paragraph",variant:"meta",children:k.name})}),!R&&t(v,{"data-testid":"attachment-delete-button",onClick:B,children:t(s,{color:f.text.static_icons__tertiary.rgba,data:m})})]})};export{k as default};
1
+ import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useState as e,useEffect as i,useMemo as o}from"react";import{Icon as s,Typography as n}from"@equinor/eds-core-react";import{error_outlined as a,clear as m}from"@equinor/eds-icons";import{Rejection as p,DoneWrapper as l,LoadingWrapper as c,CircularProgress as d,CompactFileProgressContainer as h,FileTooltip as j,AdditionalText as u,CloseButton as g}from"./CompactFileProgress.styles.js";import{isFileImage as v,getFileIcon as S,readUploadedFileAsText as x}from"./FileProgress.utils.js";import{colors as f}from"../../atoms/style/colors.js";import"../AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../ApplicationIcon/ApplicationIcon.js";import"../Badge/Badge.styles.js";import"../Banner/Banner.styles.js";import"../Chip/Chip.js";import"../ContentMenu/ContentMenu.styles.js";import"../DatePicker/DatePicker.js";import"../Dialog/Dialog.js";import"../EquinorLogo/EquinorLogo.js";import"../RichTextEditor/custom-extensions/AmplifyKit.js";import"../RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../atoms/enums/Environment.js";import"../../atoms/utils/auth_environment.js";import"../../organisms/TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"../../providers/TutorialStepsProvider.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import"./RegularFileProgress.styles.js";import"../FileUploadArea/FileUploadArea.js";import"../FullPageSpinner/FullPageSpinner.js";import"../InfoElement/InfoElement.js";import{OptionalTooltip as k}from"../OptionalTooltip/OptionalTooltip.js";import"../ProfileAvatar/ProfileAvatar.js";import"@tiptap/react";import"../RichTextEditor/RichTextEditor.styles.js";import"../RichTextEditor/MenuBar/MenuBar.js";import"../RichTextEditor/MenuBar/MenuBar.styles.js";import"../RichTextEditor/MenuBar/MenuButton.js";import"../Search/Search.js";import"react-router-dom";import"../Sieve/Sieve.styles.js";import"../SingleFilterMenu/SingleFilterMenu.js";import"../Skeleton/SkeletonBase/SkeletonBase.js";import"../Skeleton/Skeleton.styles.js";import"../Stepper/Stepper.js";import"../OptionDrawer/OptionDrawer.js";import"../Select/Select.styles.js";import"../ListItem/ListItem.js";import"../SelectionControls/Checkbox/Checkbox.js";import"../SelectionControls/Radio/Radio.js";import"../SelectionControls/Switch/Switch.js";const P=({file:P,progressPercent:w,isError:y,shortErrorText:E,showCompleteState:T,fullErrorText:B,handleOnClick:C,isDeleting:A})=>{const[b,R]=e("");i((()=>{y||(async r=>{const t=await x(r);R(t)})(P)}),[y,P]);const M=o((()=>y?B&&B.length>0?B:"An error has occurred with the file":""),[B,y]),_=o((()=>y?r(p,{children:[t(s,{data:a,color:f.interactive.warning__text.rgba}),t("div",{children:E&&E.length>0?E:"Invalid file type"}),t("svg",{width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{x:"1",y:"1",width:"86",height:"86",rx:"7",stroke:f.interactive.warning__text.rgba,strokeWidth:"2",strokeDasharray:"4 4"})})]}):T&&!A&&v(P.name)?t(l,{children:t("img",{src:b,alt:` ${P.name}`})}):T&&!A?t(l,{children:t(s,{data:S(P.name)})}):r(c,{children:[t(d,{variant:void 0===w||A?"indeterminate":"determinate",value:w,size:24}),t(n,{variant:"meta",children:"Uploading..."}),t("svg",{width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{x:"1",y:"1",width:"86",height:"86",rx:"7",stroke:f.ui.background__medium.rgba,strokeWidth:"2",strokeDasharray:"4 4"})})]})),[y,T,A,w,E,b,P.name]);return r(h,{$isError:y,children:[t(j,{title:M,children:_}),t(k,{title:P.name,children:t(u,{group:"paragraph",variant:"meta",children:P.name})}),!A&&t(g,{"data-testid":"attachment-delete-button",onClick:C,children:t(s,{color:f.text.static_icons__tertiary.rgba,data:m})})]})};export{P as default};
@@ -1,4 +1,4 @@
1
- export declare const BORDER_RADIUS = "8px";
1
+ export declare const BORDER_RADIUS = "7px";
2
2
  interface ContainerProps {
3
3
  $isError?: boolean;
4
4
  }
@@ -1,53 +1,57 @@
1
- import{Typography as i,Tooltip as r,CircularProgress as t}from"@equinor/eds-core-react";import{animation as e}from"../../atoms/style/animation.js";import{colors as o}from"../../atoms/style/colors.js";import{spacings as a}from"../../atoms/style/spacings.js";import s,{css as n}from"styled-components";const d="8px",l=s.div`
2
- border-radius: 4px;
1
+ import{Typography as i,Tooltip as t,CircularProgress as r}from"@equinor/eds-core-react";import{animation as e}from"../../atoms/style/animation.js";import{colors as o}from"../../atoms/style/colors.js";import{spacings as s}from"../../atoms/style/spacings.js";import a,{css as n}from"styled-components";const l="7px",d=a.div`
3
2
  margin: 10px 0;
4
3
  width: 88px;
5
4
  height: 88px;
6
5
  box-sizing: border-box;
7
6
  position: relative;
8
7
  transition: ${e.transitionMS};
8
+ border-radius: ${l};
9
9
  ${({$isError:i})=>i&&n`
10
10
  &:hover {
11
11
  background: ${o.ui.background__warning.rgba};
12
12
  }
13
13
  `}
14
- `;s(i)`
15
- margin: ${a.small} ${a.small} 0 ${a.small};
14
+ `;a(i)`
15
+ margin: ${s.small} ${s.small} 0 ${s.small};
16
16
  color: ${o.text.static_icons__tertiary.rgba};
17
- `;const c=s.div`
17
+ `;const c=a.div`
18
18
  height: 100%;
19
19
  width: 100%;
20
20
  overflow: hidden;
21
- border: 2px dashed ${o.ui.background__medium.rgba};
22
21
  display: flex;
23
22
  flex-direction: column;
24
- gap: ${a.small};
23
+ gap: ${s.small};
25
24
  justify-content: center;
26
25
  align-items: center;
27
- border-radius: ${d};
28
- `,g=s.div`
26
+ border-radius: ${l};
27
+ > svg:last-child {
28
+ position: absolute;
29
+ }
30
+ `,p=a.div`
29
31
  height: 100%;
30
32
  width: 100%;
31
33
  overflow: hidden;
32
34
  border: 2px solid ${o.ui.background__medium.rgba};
33
- border-radius: ${d};
35
+ border-radius: ${l};
34
36
  position: relative;
35
37
  display: flex;
36
38
  justify-content: center;
37
39
  align-items: center;
40
+
38
41
  > img {
39
42
  object-fit: cover;
40
43
  width: 88px;
41
44
  height: 88px;
42
45
  }
46
+
43
47
  > svg {
44
48
  width: 40px;
45
49
  height: 40px;
46
50
  }
47
- `,p=s.div`
51
+ `,g=a.div`
48
52
  display: flex;
49
53
  flex-direction: column;
50
- gap: ${a.small};
54
+ gap: ${s.small};
51
55
  align-items: center;
52
56
  justify-content: center;
53
57
  height: 100%;
@@ -55,12 +59,14 @@ import{Typography as i,Tooltip as r,CircularProgress as t}from"@equinor/eds-core
55
59
  font-size: 11px;
56
60
  justify-items: center;
57
61
  text-align: center;
58
- border-radius: ${d};
59
- border: 2px dashed ${o.interactive.warning__text.rgba};
62
+ border-radius: ${l};
63
+ > svg:last-child {
64
+ position: absolute;
65
+ }
60
66
  > div {
61
67
  color: ${o.interactive.warning__text.rgba};
62
68
  }
63
- `,h=s.div`
69
+ `,h=a.div`
64
70
  background-color: ${o.text.static_icons__tertiary.rgba};
65
71
  border-radius: 50%;
66
72
  border: 2px solid ${o.ui.background__light.rgba};
@@ -75,20 +81,20 @@ import{Typography as i,Tooltip as r,CircularProgress as t}from"@equinor/eds-core
75
81
  height: 14px;
76
82
  fill: ${o.ui.background__light.rgba};
77
83
  }
78
- `,x=s(i)`
84
+ `,m=a(i)`
79
85
  font-size: 10px;
80
- padding-top: ${a.x_small};
86
+ padding-top: ${s.x_small};
81
87
  width: 100%;
82
88
  overflow: hidden;
83
89
  text-overflow: ellipsis;
84
90
  text-wrap: nowrap;
85
- `,m=s(r)`
91
+ `,x=a(t)`
86
92
  white-space: pre;
87
- `,b=s(t)`
93
+ `,b=a(r)`
88
94
  circle {
89
95
  stroke: ${o.interactive.primary__resting.rgba};
90
96
  }
91
97
  circle:first-child {
92
98
  stroke: ${o.interactive.primary__hover_alt.rgba};
93
99
  }
94
- `;export{x as AdditionalText,d as BORDER_RADIUS,b as CircularProgress,h as CloseButton,l as CompactFileProgressContainer,g as DoneWrapper,m as FileTooltip,c as LoadingWrapper,p as Rejection};
100
+ `;export{m as AdditionalText,l as BORDER_RADIUS,b as CircularProgress,h as CloseButton,d as CompactFileProgressContainer,p as DoneWrapper,x as FileTooltip,c as LoadingWrapper,g as Rejection};
@@ -1 +1 @@
1
- import{file as e,microsoft_excel as r,microsoft_powerpoint as n,microsoft_word as t,library_pdf as s}from"@equinor/eds-icons";function o(e){const r=new FileReader;return new Promise(((n,t)=>{r.onerror=()=>{r.abort(),t(new DOMException("Problem parsing input file."))},r.onload=()=>{n(r.result)},r.readAsDataURL(e)}))}function c(e){return/\.(jpe?g|png|gif|bmp)$/i.test(e)}function a(o){switch(o.split(".").pop()){case"pdf":return s;case"doc":case"docx":return t;case"ppt":case"pptx":return n;case"xls":case"xlsx":case"csv":return r;default:return e}}export{a as getFileIcon,c as isFileImage,o as readUploadedFileAsText};
1
+ import{file_description as e,library_pdf as n}from"@equinor/eds-icons";function r(e){const n=new FileReader;return new Promise(((r,o)=>{n.onerror=()=>{n.abort(),o(new DOMException("Problem parsing input file."))},n.onload=()=>{r(n.result)},n.readAsDataURL(e)}))}function o(e){return/\.(jpe?g|png|gif|bmp)$/i.test(e)}function t(r){return"pdf"===r.split(".").pop()?n:e}export{t as getFileIcon,o as isFileImage,r as readUploadedFileAsText};
@@ -1,10 +1,10 @@
1
- import{tokens as r}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{EditorContent as o}from"@tiptap/react";import e from"styled-components";import"react";import"./custom-extensions/AmplifyKit.js";import"./RichTextEditor.types.js";import"../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../atoms/enums/Environment.js";import"../../atoms/utils/auth_environment.js";import"../../organisms/TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"../../providers/TutorialStepsProvider.js";import{colors as t}from"../../atoms/style/colors.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"react/jsx-runtime";import"../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";const{spacings:i,typography:a,shape:n,colors:s}=r,d=e(o)`
1
+ import{tokens as r}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{EditorContent as o}from"@tiptap/react";import t from"styled-components";import"react";import"./custom-extensions/AmplifyKit.js";import"./RichTextEditor.types.js";import"../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../atoms/enums/Environment.js";import"../../atoms/utils/auth_environment.js";import"../../organisms/TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"../../providers/TutorialStepsProvider.js";import{colors as e}from"../../atoms/style/colors.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"react/jsx-runtime";import"../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";const{spacings:i,typography:a,shape:n,colors:s}=r,d=t(o)`
2
2
  display: grid;
3
3
  grid-template-rows: 1fr;
4
4
  overflow-y: auto;
5
5
  min-height: ${r=>r.$minHeight||"auto"};
6
6
  max-height: ${r=>r.$maxHeight||"auto"};
7
- `,p=e.div`
7
+ `,p=t.div`
8
8
  display: grid;
9
9
  background: ${s.ui.background__default.rgba};
10
10
  border-radius: ${n.corners.borderRadius} ${n.corners.borderRadius} 0 0;
@@ -25,7 +25,7 @@ import{tokens as r}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
25
25
  background: ${r=>r.$lightBackground?`${s.ui.background__default.rgba}`:`${s.ui.background__light.rgba}`};
26
26
 
27
27
  &[contenteditable='true'] {
28
- box-shadow: ${({$highlighted:r})=>r?`inset 0 -2px ${t.dataviz.darkblue.darker}`:`inset 0 -1px ${s.ui.background__medium.rgba}`};
28
+ box-shadow: ${({$highlighted:r})=>r?`inset 0 -2px ${e.dataviz.darkblue.darker}`:`inset 0 -1px ${s.ui.background__medium.rgba}`};
29
29
  }
30
30
 
31
31
  padding: ${r=>{switch(r.$padding){case"sm":return i.comfortable.small;case"md":return i.comfortable.medium;case"lg":return i.comfortable.large;default:return 0}}};
@@ -90,7 +90,7 @@ import{tokens as r}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
90
90
  }
91
91
 
92
92
  th {
93
- background-color: #f1f3f5;
93
+ background-color: ${({$lightBackground:r})=>r?"#f1f3f5":s.ui.background__default.rgba};
94
94
  font-weight: bold;
95
95
  text-align: left;
96
96
  }
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{Menu as i}from"@equinor/eds-core-react";import{NoItemsFoundText as m}from"./Select.styles.js";import{getCumulativeArrayFromNumberedArray as l}from"./Select.utils.js";import{SelectMenuItem as n}from"./SelectMenuItem.js";const r=r=>{const{onItemSelect:o,onItemKeyDown:s,itemRefs:c,groups:a,search:f,onSearchFilter:u}=r,p=t((()=>{if(""===f)return a;const e=new RegExp(f,"i");return a.map((t=>({title:t.title,items:t.items.filter((t=>void 0!==u?u(f,t):t.label.match(e)))}))).filter((e=>e.items.length>0))}),[a,u,f]),d=t((()=>{const e=p.map((e=>e.items.length));return l(e)}),[p]);return 0===p.length?e(m,{children:"No items found"}):"values"in r?p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(n,{index:l+d[m],childOffset:0,item:i,multiselect:!0,itemRefs:c,onItemKeyDown:s,onItemSelect:o,values:r.values},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`))):p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(n,{index:l+d[m],childOffset:0,item:i,itemRefs:c,onItemKeyDown:s,onItemSelect:o},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`)))};export{r as GroupedSelectMenu};
1
+ import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{Menu as i}from"@equinor/eds-core-react";import{NoItemsFoundText as m}from"./Select.styles.js";import{getCumulativeArrayFromNumberedArray as l}from"./Select.utils.js";import{SelectMenuItem as n}from"./SelectMenuItem.js";const r=r=>{const{onItemSelect:o,onItemKeyDown:s,itemRefs:c,groups:a,search:u,onSearchFilter:f}=r,p=t((()=>{if(""===u)return a;const e=new RegExp(u,"i");return a.map((t=>({title:t.title,items:t.items.filter((t=>void 0!==f?f(u,t):t.label.match(e)))}))).filter((e=>e.items.length>0))}),[a,f,u]),d=t((()=>{const e=p.map((e=>e.items.length));return l(e)}),[p]);return 0===p.length?e(m,{children:"No items found"}):"values"in r?p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(n,{index:l+d[m],childOffset:0,item:i,multiselect:!0,itemRefs:c,onItemKeyDown:s,onItemSelect:o,values:r.values},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`))):p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(n,{index:l+d[m],childOffset:0,item:i,itemRefs:c,onItemKeyDown:s,onItemSelect:o,value:r.value},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`)))};export{r as GroupedSelectMenu};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as m}from"react";import{Menu as i}from"@equinor/eds-core-react";import{AddTagItem as o}from"./AddTagItem.js";import{NoItemsFoundText as r,NoTagFoundText as l}from"./Select.styles.js";import{flattenOptions as s,getChildOffset as d}from"./Select.utils.js";import{SelectMenuItem as c}from"./SelectMenuItem.js";const a=a=>{const{search:u,items:f,onItemSelect:h,itemRefs:I,onItemKeyDown:p,onSearchFilter:x}=a,S=m((()=>{if(""===u)return f;const e=new RegExp(u,"i");return s(f).filter((t=>void 0!==x?x(u,t):t.label.match(e)))}),[f,x,u]);if(0===S.length&&!a.onAddItem)return e(r,{children:"No items found"});const g=S.some((e=>e.children&&e.children.length>0));if("values"in a){const m=S.map(((e,t)=>({childOffset:d(S,t),index:t,item:e,itemRefs:I,onItemKeyDown:p,onItemSelect:h,itemValue:e.value,values:a.values,parentHasNestedItems:g})));return"onAddItem"in a&&a.onAddItem&&""!==u?t(n,{children:[e(i.Section,{title:"Add tag",index:0,children:e(o,{index:0,itemRefs:I,onItemKeyDown:p,onAddItem:a.onAddItem,children:u})}),e(i.Section,{title:"Tag search results",index:1,children:m.length>0?m.map(((t,n)=>e(c,{multiselect:!0,...t,index:n+1},`menu-item-${n}-${t.itemValue}`))):t(l,{children:['No tag for "',u,'" found.']})})]}):m.map(((t,n)=>e(c,{multiselect:!0,...t},`menu-item-${n}-${t.itemValue}`)))}return S.map(((t,n)=>e(c,{childOffset:d(S,n),index:n,item:t,itemRefs:I,onItemKeyDown:p,onItemSelect:h,parentHasNestedItems:g},`menu-item-${n}-${t.value}`)))};export{a as ListSelectMenu};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as m}from"react";import{Menu as i}from"@equinor/eds-core-react";import{AddTagItem as o}from"./AddTagItem.js";import{NoItemsFoundText as r,NoTagFoundText as l}from"./Select.styles.js";import{flattenOptions as s,getChildOffset as d}from"./Select.utils.js";import{SelectMenuItem as c}from"./SelectMenuItem.js";const a=a=>{const{search:u,items:f,onItemSelect:h,itemRefs:I,onItemKeyDown:p,onSearchFilter:x}=a,S=m((()=>{if(""===u)return f;const e=new RegExp(u,"i");return s(f).filter((t=>void 0!==x?x(u,t):t.label.match(e)))}),[f,x,u]);if(0===S.length&&!a.onAddItem)return e(r,{children:"No items found"});const g=S.some((e=>e.children&&e.children.length>0));if("values"in a){const m=S.map(((e,t)=>({childOffset:d(S,t),index:t,item:e,itemRefs:I,onItemKeyDown:p,onItemSelect:h,itemValue:e.value,values:a.values,parentHasNestedItems:g})));return"onAddItem"in a&&a.onAddItem&&""!==u?t(n,{children:[e(i.Section,{title:"Add tag",index:0,children:e(o,{index:0,itemRefs:I,onItemKeyDown:p,onAddItem:a.onAddItem,children:u})}),e(i.Section,{title:"Tag search results",index:1,children:m.length>0?m.map(((t,n)=>e(c,{multiselect:!0,...t,index:n+1},`menu-item-${n}-${t.itemValue}`))):t(l,{children:['No tag for "',u,'" found.']})})]}):m.map(((t,n)=>e(c,{multiselect:!0,...t},`menu-item-${n}-${t.itemValue}`)))}return S.map(((t,n)=>e(c,{childOffset:d(S,n),index:n,item:t,itemRefs:I,onItemKeyDown:p,onItemSelect:h,parentHasNestedItems:g,value:a.value},`menu-item-${n}-${t.value}`)))};export{a as ListSelectMenu};
@@ -50,6 +50,7 @@ declare const ComboBoxChip: import("styled-components/dist/types").IStyledCompon
50
50
  }))) & import("react").RefAttributes<HTMLButtonElement | HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
51
51
  interface CustomMenuItemProps {
52
52
  $paddedLeft?: boolean;
53
+ $selected?: boolean;
53
54
  }
54
55
  declare const StyledMenuItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<{
55
56
  as?: import("react").ElementType | undefined;
@@ -93,7 +93,7 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
93
93
  width: calc(100% - 24px);
94
94
  }
95
95
  }
96
- `,u=d.section`
96
+ `,h=d.section`
97
97
  position: relative;
98
98
  display: flex;
99
99
  flex-wrap: wrap;
@@ -135,7 +135,7 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
135
135
  }
136
136
  }
137
137
  }
138
- `,h=d(t)`
138
+ `,u=d(t)`
139
139
  position: absolute;
140
140
  top: 50%;
141
141
  transform: translate(0, -50%);
@@ -154,10 +154,9 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
154
154
  background: ${({$tryingToRemove:t,$lightBackground:e})=>t?o.interactive.primary__hover_alt.rgba:e?o.ui.background__light.rgba:o.ui.background__default.rgba} !important;
155
155
  `,x=d(e.Item)`
156
156
  flex-grow: 1;
157
- border-radius: 2px;
158
157
  ${({$paddedLeft:t})=>t&&"margin-left: 36px"};
159
158
  padding-left: 10px;
160
-
159
+
161
160
  > div {
162
161
  grid-auto-columns: auto;
163
162
  justify-content: flex-start;
@@ -170,16 +169,24 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
170
169
  &:focus-visible {
171
170
  outline: 2px dashed ${o.interactive.primary__resting.rgba};
172
171
  }
172
+
173
+ ${({$selected:t})=>t?c`
174
+ background: ${o.interactive.primary__selected_highlight.rgba};
175
+
176
+ &:hover {
177
+ background: ${o.interactive.primary__selected_hover.rgba};
178
+ }
179
+ `:""}}
173
180
  `,_=d.hr`
174
181
  height: calc(100% + ${s.medium} * 2);
175
182
  justify-self: center;
176
183
  width: ${s.x_large};
177
- `,f=d(r)`
184
+ `,$=d(r)`
178
185
  position: absolute;
179
186
  color: ${o.text.static_icons__tertiary.rgba};
180
187
  top: calc(50%);
181
188
  transform: translate(0, -50%);
182
- `,$=d(f)`
189
+ `,f=d($)`
183
190
  white-space: nowrap;
184
191
  overflow: hidden;
185
192
  text-overflow: ellipsis;
@@ -200,8 +207,7 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
200
207
  `,k=d.div`
201
208
  display: flex;
202
209
  align-items: center;
203
- padding: 0 ${s.small};
204
210
  `,j=d(t)`
205
211
  width: 36px;
206
212
  height: 36px;
207
- `;export{h as ClearButton,m as ComboBoxChip,b as Container,g as HelperWrapper,_ as MenuItemSpacer,k as MenuItemWrapper,w as NoItemsFoundText,v as NoTagFoundText,f as PlaceholderText,u as Section,j as SmallButton,y as StyledMenu,x as StyledMenuItem,$ as ValueText,p as Wrapper};
213
+ `;export{u as ClearButton,m as ComboBoxChip,b as Container,g as HelperWrapper,_ as MenuItemSpacer,k as MenuItemWrapper,w as NoItemsFoundText,v as NoTagFoundText,$ as PlaceholderText,h as Section,j as SmallButton,y as StyledMenu,x as StyledMenuItem,f as ValueText,p as Wrapper};
@@ -54,7 +54,7 @@ export type SingleSelectMenuItemProps<T extends SelectOptionRequired> = {
54
54
  multiselect?: undefined;
55
55
  isParentSelected?: boolean;
56
56
  parentHasNestedItems?: boolean;
57
- } & Omit<SelectMenuProps<T>, 'search'> & SelectMenuItemProps<T>;
57
+ } & Omit<SelectMenuProps<T>, 'search'> & SelectMenuItemProps<T> & Pick<SingleSelectCommon<T>, 'value'>;
58
58
  export type MultiSelectMenuItemProps<T extends SelectOptionRequired> = {
59
59
  isParentSelected?: boolean;
60
60
  parentHasNestedItems?: boolean;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as n,useRef as c,useMemo as o}from"react";import{Icon as i}from"@equinor/eds-core-react";import{checkbox_outline as l,chevron_down as a,chevron_right as s,checkbox as u}from"@equinor/eds-icons";import{tokens as d}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{getChildOffset as m}from"./Select.utils.js";import{getParentIcon as p}from"./SelectMenuItem.utils.js";import{MenuItemSpacer as h,MenuItemWrapper as f,SmallButton as y,StyledMenuItem as w}from"./Select.styles.js";const{colors:g}=d,k=d=>{const{index:v,childOffset:b,depth:x=0,item:C,multiselect:D,itemRefs:A,onItemKeyDown:I,onItemSelect:$,parentHasNestedItems:_=!1}=d,[j,K]=n(!1),S=c(-1),O=c([]),q=("values"in d?d.values.map((({value:e})=>e)):[]).includes(C.value),M=o((()=>D?p(C,d.values):l),[C,D,d]),R=o((()=>new Array(x).fill(0).map(((r,t)=>e(h,{},`spacer-${r+t}`)))),[x]),H=e=>{e.preventDefault(),$(C)},L=e=>{e.stopPropagation(),K((e=>!e))},N=e=>{"ArrowDown"===e.key?S.current+=1:"ArrowUp"===e.key&&(S.current-=1),S.current<=-1?(A.current[v]?.focus(),S.current=-1):S.current+b===O.current.length?(S.current=-1,I(e),K(!1)):S.current>=0&&S.current<O.current.length-b&&O.current[S.current+b]?.focus()},U=e=>{!j&&"ArrowDown"===e.key||"ArrowUp"===e.key?I(e):"ArrowRight"===e.key||"ArrowLeft"===e.key?K((e=>!e)):j&&"ArrowDown"===e.key&&-1===S.current&&(S.current=0,O.current[S.current+b]?.focus())};return C.children&&C.children.length>0&&D?r(t,{children:[r(f,{children:[R,e(y,{variant:"ghost_icon",onClick:L,"data-testid":"toggle-button",children:e(i,{color:g.interactive.primary__resting.rgba,data:j?a:s})}),r(w,{$depth:x,ref:e=>{A.current[v]=e},index:v,closeMenuOnClick:!1,onKeyDownCapture:U,onClick:H,children:[e(i,{color:g.interactive.primary__resting.rgba,data:M}),e("span",{children:C.label})]})]}),j&&C.children.map(((r,t)=>e(k,{index:b+t,childOffset:b+m(C.children,t),depth:x+1,multiselect:!0,item:r,itemRefs:O,values:d.values,onItemKeyDown:N,onItemSelect:$,parentHasNestedItems:!0},`child-${t}-${r.value}-${C.value}`)))]}):D?r(f,{children:[R,r(w,{$depth:x,$paddedLeft:_,ref:e=>{A.current[v]=e},index:v,tabIndex:x,closeMenuOnClick:!1,onKeyDownCapture:I,onClick:H,children:[e(i,{color:g.interactive.primary__resting.rgba,data:q?u:l}),e("span",{children:C.label})]})]}):e(f,{children:e(w,{$depth:x,ref:e=>{A.current[v]=e},index:v,onKeyDownCapture:I,onClick:H,children:e("span",{children:C.label})})})};export{k as SelectMenuItem};
1
+ import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as n,useRef as o,useMemo as c}from"react";import{Icon as i}from"@equinor/eds-core-react";import{checkbox_outline as l,chevron_down as a,chevron_right as s,checkbox as u}from"@equinor/eds-icons";import{tokens as d}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{getChildOffset as m}from"./Select.utils.js";import{getParentIcon as p}from"./SelectMenuItem.utils.js";import{spacings as h}from"../../atoms/style/spacings.js";import{MenuItemSpacer as f,MenuItemWrapper as y,SmallButton as v,StyledMenuItem as g}from"./Select.styles.js";const{colors:w}=d,k=d=>{const{index:b,childOffset:x,depth:C=0,item:D,multiselect:$,itemRefs:A,onItemKeyDown:I,onItemSelect:_,parentHasNestedItems:j=!1}=d,[K,S]=n(!1),O=o(-1),q=o([]),L=("values"in d?d.values.map((({value:e})=>e)):[]).includes(D.value),M=c((()=>$?p(D,d.values):l),[D,$,d]),R=c((()=>new Array(C).fill(0).map(((r,t)=>e(f,{},`spacer-${r+t}`)))),[C]),H=e=>{e.preventDefault(),_(D)},N=e=>{e.stopPropagation(),S((e=>!e))},U=e=>{"ArrowDown"===e.key?O.current+=1:"ArrowUp"===e.key&&(O.current-=1),O.current<=-1?(A.current[b]?.focus(),O.current=-1):O.current+x===q.current.length?(O.current=-1,I(e),S(!1)):O.current>=0&&O.current<q.current.length-x&&q.current[O.current+x]?.focus()},P=e=>{!K&&"ArrowDown"===e.key||"ArrowUp"===e.key?I(e):"ArrowRight"===e.key||"ArrowLeft"===e.key?S((e=>!e)):K&&"ArrowDown"===e.key&&-1===O.current&&(O.current=0,q.current[O.current+x]?.focus())};return D.children&&D.children.length>0&&$?r(t,{children:[r(y,{style:{paddingLeft:0===C?h.small:0},children:[R,e(v,{variant:"ghost_icon",onClick:N,"data-testid":"toggle-button",children:e(i,{color:w.interactive.primary__resting.rgba,data:K?a:s})}),r(g,{$depth:C,ref:e=>{A.current[b]=e},index:b,closeMenuOnClick:!1,onKeyDownCapture:P,onClick:H,children:[e(i,{color:w.interactive.primary__resting.rgba,data:M}),e("span",{children:D.label})]})]}),K&&D.children.map(((r,t)=>e(k,{index:x+t,childOffset:x+m(D.children,t),depth:C+1,multiselect:!0,item:r,itemRefs:q,values:d.values,onItemKeyDown:U,onItemSelect:_,parentHasNestedItems:!0},`child-${t}-${r.value}-${D.value}`)))]}):$?r(y,{children:[R,r(g,{$depth:C,$paddedLeft:j,ref:e=>{A.current[b]=e},index:b,tabIndex:C,closeMenuOnClick:!1,onKeyDownCapture:I,onClick:H,children:[e(i,{color:w.interactive.primary__resting.rgba,data:L?u:l}),e("span",{children:D.label})]})]}):e(y,{children:e(g,{$depth:C,$selected:d.value&&D.value===d.value.value,ref:e=>{A.current[b]=e},index:b,onKeyDownCapture:I,onClick:H,children:e("span",{children:D.label})})})};export{k as SelectMenuItem};
@@ -1,61 +1,62 @@
1
- import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../atoms/enums/Environment.js";import"../../atoms/utils/auth_environment.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"../../providers/TutorialStepsProvider.js";import{shape as r,typography as t,elevation as i}from"../../atoms/style/index.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"react/jsx-runtime";import"../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import{Chip as o}from"../../molecules/Chip/Chip.js";import{motion as e}from"framer-motion";import a,{css as s}from"styled-components";import{colors as n}from"../../atoms/style/colors.js";import{spacings as d}from"../../atoms/style/spacings.js";const m=a.div`
1
+ import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../atoms/enums/Environment.js";import"../../atoms/utils/auth_environment.js";import"../TopBar/Notifications/NotificationProvider.js";import"../../providers/AuthProvider/AuthProvider.js";import"../../providers/ReleaseNotesProvider.js";import"../../providers/SideBarProvider.js";import"../../providers/SnackbarProvider/SnackbarProvider.js";import"../../providers/StepperProvider.js";import"../../providers/TableOfContentsProvider.js";import"../../providers/ThemeProvider/ThemeProvider.js";import"../../providers/TutorialStepsProvider.js";import{shape as r,typography as t}from"../../atoms/style/index.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"react/jsx-runtime";import"../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import{Chip as i}from"../../molecules/Chip/Chip.js";import{motion as e}from"framer-motion";import o,{css as a}from"styled-components";import{colors as s}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";const d=o.div`
2
2
  width: 100%;
3
- `,p=a.div`
3
+ border: 1px solid ${s.ui.background__heavy.rgba};
4
+ border-radius: ${r.corners.borderRadius};
5
+ overflow: hidden;
6
+ `,l=o.div`
4
7
  display: flex;
5
- background: ${n.ui.background__default.rgba};
8
+ background: ${s.ui.background__default.rgba};
6
9
  align-items: center;
7
10
  width: 100%;
8
- height: 36px;
9
- padding-left: ${d.small};
10
- border-bottom: 1px solid ${n.ui.background__medium.rgba};
11
- border-top-left-radius: ${r.corners.borderRadius};
12
- border-top-right-radius: ${r.corners.borderRadius};
13
- transition: border-bottom 200ms;
11
+ padding-left: ${n.small};
12
+ outline: 1px solid ${s.ui.background__medium.rgba};
14
13
  cursor: pointer;
15
14
  > section {
16
- margin-left: ${d.small};
15
+ min-height: 24px;
16
+ align-items: center;
17
17
  flex-grow: 1;
18
18
  display: flex;
19
19
  flex-wrap: wrap;
20
- gap: ${d.x_small};
20
+ gap: ${n.x_small};
21
+ margin: calc(${n.xx_small} + ${n.x_small}) 0
22
+ calc(${n.xx_small} + ${n.x_small}) ${n.small};
21
23
  }
22
- > button {
23
- height: 35px;
24
- padding: 0 ${d.small} 0 ${d.medium_small};
24
+ > button:not([data-testid='clear-all-x']) {
25
+ padding: 0 ${n.small} 0 ${n.medium_small};
25
26
  display: flex;
26
- gap: ${d.x_small};
27
+ gap: ${n.x_small};
27
28
  align-items: center;
28
29
  justify-content: center;
29
- border-left: 1px solid ${n.ui.background__medium.rgba};
30
- color: ${n.interactive.primary__resting.rgba};
30
+ border-left: 1px solid ${s.ui.background__medium.rgba};
31
+ color: ${s.interactive.primary__resting.rgba};
31
32
  span {
32
- color: ${n.interactive.primary__resting.rgba};
33
+ color: ${s.interactive.primary__resting.rgba};
33
34
  }
34
35
 
35
36
  &:hover {
36
- background: ${n.interactive.primary__hover_alt.rgba};
37
+ background: ${s.interactive.primary__hover_alt.rgba};
37
38
  }
38
39
  }
39
40
  > button[data-testid='clear-all-x'] {
40
41
  width: 24px;
41
42
  height: 24px;
42
43
  border-left: none;
43
- margin-right: ${d.small};
44
+ margin-right: ${n.xx_small};
44
45
  &:after {
45
46
  width: 24px;
46
47
  height: 24px;
47
48
  }
48
49
  }
49
50
  > button:last-child {
50
- border-left: 1px solid ${n.ui.background__medium.rgba};
51
+ border-left: 1px solid ${s.ui.background__medium.rgba};
51
52
  width: 36px;
52
53
  padding: 0;
54
+ align-self: stretch;
53
55
  &:hover {
54
- border-top-right-radius: ${r.corners.borderRadius};
55
- background: ${n.interactive.primary__hover_alt.rgba};
56
+ background: ${s.interactive.primary__hover_alt.rgba};
56
57
  }
57
58
  }
58
- `,l=a.input`
59
+ `,m=o.input`
59
60
  background: transparent;
60
61
  width: 0;
61
62
  flex-grow: 1;
@@ -63,34 +64,33 @@ import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit
63
64
  font-family: 'Equinor', sans-serif;
64
65
  font-size: ${t.input.text.fontSize};
65
66
  font-weight: ${t.input.text.fontWeight};
66
- color: ${n.text.static_icons__default.rgba};
67
+ color: ${s.text.static_icons__default.rgba};
67
68
  outline: none;
68
69
  border: none;
69
70
  &::placeholder {
70
71
  opacity: 1;
71
- color: ${n.text.static_icons__tertiary.rgba};
72
+ color: ${s.text.static_icons__tertiary.rgba};
72
73
  }
73
74
  &::-webkit-search-cancel-button,
74
75
  &::-webkit-search-results-button,
75
76
  &::-webkit-search-results-decoration {
76
77
  display: none;
77
78
  }
78
- `,u=a(e.div)`
79
+ `,p=o(e.div)`
79
80
  border-bottom-left-radius: ${r.corners.borderRadius};
80
81
  border-bottom-right-radius: ${r.corners.borderRadius};
81
- background: ${n.ui.background__default.rgba};
82
- box-shadow: ${i.raised};
82
+ background: ${s.ui.background__default.rgba};
83
83
  overflow: hidden;
84
84
  > section {
85
- padding: ${d.medium};
85
+ padding: ${n.medium};
86
86
  display: flex;
87
87
  flex-direction: column;
88
- gap: ${d.medium};
89
- ${({$showClearFilterButton:r})=>{if(r)return s`
88
+ gap: ${n.medium};
89
+ ${({$showClearFilterButton:r})=>{if(r)return a`
90
90
  > div:last-child {
91
91
  display: grid;
92
92
  grid-template-columns: 1fr auto;
93
- gap: ${d.medium};
93
+ gap: ${n.medium};
94
94
 
95
95
  > button {
96
96
  align-self: flex-end;
@@ -98,8 +98,8 @@ import"react";import"../../molecules/RichTextEditor/custom-extensions/AmplifyKit
98
98
  }
99
99
  `}}
100
100
  }
101
- `,c=a(o)`
102
- ${({$tryingToRemove:r})=>{if(r)return s`
103
- background: ${n.interactive.primary__hover_alt.rgba};
101
+ `,c=o(i)`
102
+ ${({$tryingToRemove:r})=>{if(r)return a`
103
+ background: ${s.interactive.primary__hover_alt.rgba};
104
104
  `}}
105
- `;export{p as Container,u as Content,l as SearchField,c as StyledChip,m as Wrapper};
105
+ `;export{l as Container,p as Content,m as SearchField,c as StyledChip,d as Wrapper};
@@ -2,10 +2,12 @@ import{Link as t}from"react-router-dom";import{tokens as e}from"../../node_modul
2
2
  &:hover {
3
3
  background: ${s.interactive.primary__hover_alt.rgba};
4
4
  }
5
- &:focus {
6
- outline: 2px dashed ${s.interactive.focus.rgba};
7
- outline-offset: -4px;
8
- }
5
+ ${({$active:t})=>t?"":n`
6
+ &:focus:not(:hover) {
7
+ outline: 2px dashed ${s.interactive.focus.rgba};
8
+ outline-offset: -4px;
9
+ }
10
+ `}
9
11
  position: relative;
10
12
  display: grid;
11
13
  grid-template-columns: auto 1fr;
@@ -111,7 +113,6 @@ import{Link as t}from"react-router-dom";import{tokens as e}from"../../node_modul
111
113
  `}}}
112
114
  `,u=a.div`
113
115
  display: flex;
114
- flex-direction:;
115
116
  position: relative;
116
117
  &:after {
117
118
  position: absolute;
@@ -170,8 +171,7 @@ import{Link as t}from"react-router-dom";import{tokens as e}from"../../node_modul
170
171
  background: ${s.ui.background__medium.rgba};
171
172
  }
172
173
  `}}}
173
- data-testid="table-of-contents-container"
174
- `,b=a(r.div)`
174
+ `,$=a(r.div)`
175
175
  display: flex;
176
176
  flex-direction: column;
177
177
  ${({$shouldShowChildren:t})=>t?null:n`
@@ -187,4 +187,4 @@ import{Link as t}from"react-router-dom";import{tokens as e}from"../../node_modul
187
187
  }
188
188
 
189
189
  ${({$variant:t})=>"buttons"===t&&`gap:${i.x_small};`}
190
- `;export{f as BorderItemsContainer,u as BorderItemsHorizontalContainer,d as Button,b as ChildContainer,c as Link,g as TableOfContentsContainer,p as TableOfContentsItemContainer};
190
+ `;export{f as BorderItemsContainer,u as BorderItemsHorizontalContainer,d as Button,$ as ChildContainer,c as Link,g as TableOfContentsContainer,p as TableOfContentsItemContainer};
@@ -1,6 +1,7 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { SettingsSection } from './Settings.types';
3
3
  export interface SettingsProps {
4
4
  allSettings?: SettingsSection[];
5
+ children?: ReactNode | ReactNode[];
5
6
  }
6
7
  export declare const Settings: FC<SettingsProps>;
@@ -1,25 +1,25 @@
1
- import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useRef as t,useState as i,useContext as l,useMemo as a}from"react";import{Icon as n,Typography as s,Radio as m}from"@equinor/eds-core-react";import{settings as d}from"@equinor/eds-icons";import{tokens as p}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{TopBarButton as c}from"./TopBar.styles.js";import{TopBarMenu as h}from"./TopBarMenu.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import{Theme as u}from"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import"../../atoms/style/colors.js";import{spacings as f}from"../../atoms/style/spacings.js";import{ThemeProviderContext as g}from"../../providers/ThemeProvider/ThemeProvider.js";import v from"styled-components";const{elevation:x}=p,$=v.div`
1
+ import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useRef as t,useState as i,useContext as l,useMemo as a}from"react";import{Icon as n,Typography as m,Radio as s}from"@equinor/eds-core-react";import{settings as d}from"@equinor/eds-icons";import{TopBarButton as p}from"./TopBar.styles.js";import{TopBarMenu as c}from"./TopBarMenu.js";import"../../atoms/enums/Errors.js";import"../../atoms/enums/Environment.js";import{Theme as h}from"../../atoms/enums/Theme.js";import"../../atoms/enums/SpacingsMode.js";import{elevation as u}from"../../atoms/style/index.js";import{ThemeProviderContext as f}from"../../providers/ThemeProvider/ThemeProvider.js";import g from"styled-components";import{spacings as x}from"../../atoms/style/spacings.js";const v=g.div`
2
2
  display: flex;
3
3
  flex-direction: row;
4
4
  align-items: center;
5
- gap: ${f.x_small};
6
- padding: 0 ${f.large} 0 ${f.small};
5
+ gap: ${x.x_small};
6
+ padding: 0 ${x.large} 0 ${x.small};
7
7
  justify-content: space-between;
8
8
  > span {
9
- padding: ${f.small} ${f.x_small};
9
+ padding: ${x.small} ${x.x_small};
10
10
  }
11
- `,b=v.div`
11
+ `,$=g.div`
12
12
  width: 64px;
13
13
  height: 32px;
14
14
  background-color: ${e=>e.$color};
15
- box-shadow: ${x.raised};
15
+ box-shadow: ${u.raised};
16
16
  border-radius: 4px;
17
- `,j=v.div`
17
+ `,b=g.div`
18
18
  display: flex;
19
19
  flex-direction: column;
20
- gap: ${f.medium};
20
+ gap: ${x.medium};
21
21
  > div > p {
22
- padding-top: ${f.small};
23
- padding-left: ${f.medium};
22
+ padding-top: ${x.small};
23
+ padding-left: ${x.medium};
24
24
  }
25
- `,T=({allSettings:p})=>{const f=t(null),[v,x]=i(!1),T=l(g),y=a((()=>T?[{title:"Theme",value:T.theme,onChange:e=>T.setTheme(e),items:[{label:"Light Mode",name:"theme-group",value:u.LIGHT,colorBox:"#ffffff"},{label:"Dark Mode",name:"theme-group",value:u.DARK,colorBox:"#243746"}]},...p??[]]:p??[]),[p,T]);if(0===y.length)throw new Error("Empty settings in TopBar.Settings!");return e(o,{children:[r(c,{variant:"ghost_icon",onClick:()=>x(!v),ref:f,children:r(n,{data:d,size:24})}),r(h,{open:v,title:"Settings",onClose:()=>x(!1),anchorEl:f.current,children:r(j,{children:y.map(((o,t)=>e("div",{children:[r(s,{variant:"overline",children:o.title}),o.items.map(((t,i)=>e($,{children:[r(m,{id:t.label,disabled:t.disabled,label:t.label,name:o.title,value:`${t.label}-${i}`,checked:o.value===t.value,onChange:()=>o.onChange?.(t.value)}),t.colorBox&&r(b,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&r(s,{variant:"h6",children:t.text}),t.element&&t.element]},i)))]},t)))})})]})};T.displayName="TopBar.Settings";export{T as Settings};
25
+ `,j=({allSettings:u,children:g})=>{const x=t(null),[j,T]=i(!1),y=l(f),B=a((()=>y?[{title:"Theme",value:y.theme,onChange:e=>y.setTheme(e),items:[{label:"Light Mode",name:"theme-group",value:h.LIGHT,colorBox:"#ffffff"},{label:"Dark Mode",name:"theme-group",value:h.DARK,colorBox:"#243746"}]},...u??[]]:u??[]),[u,y]);if(0===B.length)throw new Error("Empty settings in TopBar.Settings!");return e(o,{children:[r(p,{variant:"ghost_icon",onClick:()=>T(!j),ref:x,children:r(n,{data:d,size:24})}),e(c,{open:j,title:"Settings",onClose:()=>T(!1),anchorEl:x.current,children:[r(b,{children:B.map(((o,t)=>e("div",{children:[r(m,{variant:"overline",children:o.title}),o.items.map(((t,i)=>e(v,{children:[r(s,{id:t.label,disabled:t.disabled,label:t.label,name:o.title,value:`${t.label}-${i}`,checked:o.value===t.value,onChange:()=>o.onChange?.(t.value)}),t.colorBox&&r($,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&r(m,{variant:"h6",children:t.text}),t.element&&t.element]},i)))]},t)))}),g]})]})};j.displayName="TopBar.Settings";export{j as Settings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "8.18.1",
3
+ "version": "8.19.0",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",