@equinor/amplify-component-lib 9.17.0 → 10.0.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.
Files changed (159) hide show
  1. package/dist/atoms/hooks/useFaqsInApplication.js +1 -1
  2. package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
  3. package/dist/atoms/hooks/usePrefetchRichTextImages.js +1 -1
  4. package/dist/atoms/hooks/useRichTextImage.js +1 -1
  5. package/dist/atoms/hooks/useSelect.d.ts +3 -3
  6. package/dist/atoms/hooks/useSelect.js +1 -1
  7. package/dist/atoms/index.d.ts +0 -1
  8. package/dist/atoms/index.js +1 -1
  9. package/dist/atoms/types/Guidelines.d.ts +1 -1
  10. package/dist/atoms/utils/auth_environment.js +1 -1
  11. package/dist/atoms/utils/date.js +1 -1
  12. package/dist/atoms/utils/map.js +1 -1
  13. package/dist/atoms/utils/size.js +1 -1
  14. package/dist/atoms/utils/url.js +1 -1
  15. package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
  16. package/dist/deprecated/IconToggleButton.d.ts +2 -2
  17. package/dist/deprecated/IconToggleButton.js +1 -1
  18. package/dist/deprecated/OldStepper/OldStepLine.js +1 -1
  19. package/dist/index.d.ts +5 -9
  20. package/dist/index.js +1 -1
  21. package/dist/molecules/ApplicationIcon/ApplicationIconBase.js +1 -1
  22. package/dist/molecules/Badge/Badge.styles.js +1 -1
  23. package/dist/molecules/Button/Button.js +1 -1
  24. package/dist/molecules/Chip/Chip.styles.js +1 -1
  25. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  26. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  27. package/dist/molecules/FileProgress/CompactFileProgress.js +1 -1
  28. package/dist/molecules/FileProgress/FileProgress.utils.js +1 -1
  29. package/dist/molecules/FileProgress/RegularFileProgress.js +1 -1
  30. package/dist/molecules/FileUploadArea/FileUploadArea.js +1 -1
  31. package/dist/molecules/IconCell/IconCell.styles.js +1 -1
  32. package/dist/molecules/IconCell/IconCell.types.d.ts +6 -5
  33. package/dist/molecules/IconCell/IconCell.types.js +1 -1
  34. package/dist/molecules/IconCell/IconCell.utils.js +2 -2
  35. package/dist/molecules/InfoElement/CopyText.js +1 -1
  36. package/dist/molecules/ListItem/ListItem.d.ts +2 -2
  37. package/dist/molecules/OptionDrawer/OptionDrawer.d.ts +2 -2
  38. package/dist/molecules/OptionDrawer/OptionDrawer.utils.js +1 -1
  39. package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
  40. package/dist/molecules/ProfileAvatar/ProfileAvatar.js +1 -1
  41. package/dist/molecules/RichTextEditor/MenuBar/AddImageButton.js +1 -1
  42. package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +5 -5
  43. package/dist/molecules/RichTextEditor/MenuBar/Table/TableColumn.js +1 -1
  44. package/dist/molecules/RichTextEditor/MenuBar/Table/TableMerge.js +1 -1
  45. package/dist/molecules/RichTextEditor/MenuBar/Table/TableRow.js +1 -1
  46. package/dist/molecules/RichTextEditor/MenuBar/Table/ToggleTable.js +1 -1
  47. package/dist/molecules/RichTextEditor/MenuBar/TextColor.js +1 -1
  48. package/dist/molecules/RichTextEditor/custom-extensions/ExtendedImage.js +1 -1
  49. package/dist/molecules/RichTextEditor/index.d.ts +5 -5
  50. package/dist/molecules/Search/Search.d.ts +2 -2
  51. package/dist/molecules/Select/AddTagItem.js +1 -1
  52. package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
  53. package/dist/molecules/Select/Select.styles.d.ts +4 -4
  54. package/dist/molecules/Select/Select.styles.js +0 -1
  55. package/dist/molecules/Select/SelectMenuItem.js +1 -1
  56. package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
  57. package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
  58. package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
  59. package/dist/molecules/SelectionControls/Switch/Switch.d.ts +2 -2
  60. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
  61. package/dist/molecules/Stepper/Step/Step.js +9 -9
  62. package/dist/molecules/Stepper/Stepper.js +6 -4
  63. package/dist/molecules/TextField/TextField.d.ts +12 -0
  64. package/dist/molecules/TextField/TextField.js +3 -3
  65. package/dist/molecules/Waves/Waves.js +1 -1
  66. package/dist/molecules/index.d.ts +4 -8
  67. package/dist/molecules/index.js +1 -1
  68. package/dist/organisms/Faq/Category/Category.js +2 -2
  69. package/dist/organisms/Faq/Category/Question.js +1 -1
  70. package/dist/organisms/Faq/Faq.js +1 -1
  71. package/dist/organisms/Faq/Header.js +2 -2
  72. package/dist/organisms/FieldSelector/FieldSelector.js +1 -1
  73. package/dist/organisms/Filter/ButtonWithMenu.js +1 -1
  74. package/dist/organisms/Filter/Filter.d.ts +2 -2
  75. package/dist/organisms/Filter/QuickFilter.d.ts +2 -2
  76. package/dist/organisms/Filter/SortMenu.d.ts +2 -2
  77. package/dist/organisms/ReleaseNote/ReleaseNote.d.ts +3 -3
  78. package/dist/organisms/ReleaseNote/ReleaseNote.js +1 -1
  79. package/dist/organisms/ReleaseNote/ReleaseNote.utils.js +1 -1
  80. package/dist/organisms/ReleaseNotesPage/ReleaseNoteFilter.js +12 -0
  81. package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.d.ts +6 -0
  82. package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.js +1 -0
  83. package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.styles.js +35 -0
  84. package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.utils.js +1 -0
  85. package/dist/organisms/ReleaseNotesPage/ReleasePosts/ReleasePost/ReleasePost.js +1 -0
  86. package/dist/organisms/ReleaseNotesPage/ReleasePosts/ReleasePost/ReleasePostSkeleton.js +37 -0
  87. package/dist/organisms/ReleaseNotesPage/ReleasePosts/ReleasePosts.js +17 -0
  88. package/dist/organisms/ReleaseNotesPage/hooks/useFilteredReleaseNotes.js +1 -0
  89. package/dist/organisms/ReleaseNotesPage/hooks/useReleaseNotesFilters.js +1 -0
  90. package/dist/organisms/SideBar/CreateItem.styles.js +8 -6
  91. package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
  92. package/dist/organisms/SideBar/MenuItem/CollapsableMenuItem.js +1 -1
  93. package/dist/organisms/SideBar/MenuItem/MenuItem.styles.js +1 -2
  94. package/dist/organisms/SideBar/MenuItem/MenuItem.utils.js +1 -1
  95. package/dist/organisms/SideBar/SideBar.d.ts +2 -2
  96. package/dist/organisms/Status/Action.d.ts +2 -2
  97. package/dist/organisms/Status/Description.d.ts +2 -2
  98. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  99. package/dist/organisms/Status/collections/BadRequest.js +2 -2
  100. package/dist/organisms/Status/collections/GenericError.js +1 -1
  101. package/dist/organisms/Status/collections/MissingAccessToApp.js +1 -1
  102. package/dist/organisms/Status/collections/MissingPermissions.js +1 -1
  103. package/dist/organisms/Status/collections/PageNotFound.js +2 -2
  104. package/dist/organisms/Status/collections/ServerError.js +2 -2
  105. package/dist/organisms/TableOfContents/TableOfContents.styles.js +1 -1
  106. package/dist/organisms/Template/Template.d.ts +3 -3
  107. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  108. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  109. package/dist/organisms/TopBar/Account/ImpersonateButton.js +1 -1
  110. package/dist/organisms/TopBar/Account/ImpersonateMenu/Actions.js +1 -1
  111. package/dist/organisms/TopBar/Account/ImpersonateMenu/CreateOrEditUser/CreateOrEditUser.js +1 -1
  112. package/dist/organisms/TopBar/Account/ImpersonateMenu/DeleteUser/DeleteUser.js +1 -1
  113. package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.js +1 -1
  114. package/dist/organisms/TopBar/Actions.d.ts +2 -2
  115. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
  116. package/dist/organisms/TopBar/Guidelines/Colorbox.d.ts +2 -2
  117. package/dist/organisms/TopBar/Guidelines/Guidelines.js +1 -1
  118. package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
  119. package/dist/organisms/TopBar/Resources/Feedback/Feedback.utils.js +2 -2
  120. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/FeedbackForm.js +1 -1
  121. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Severity.js +1 -1
  122. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/ImageFile.js +1 -1
  123. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/UploadFile/UploadFile.js +1 -1
  124. package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/Url.js +1 -1
  125. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponsePage.js +1 -1
  126. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponseStatus.js +1 -1
  127. package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/Header/Header.js +1 -1
  128. package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/Header/Header.styles.js +2 -5
  129. package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.js +1 -1
  130. package/dist/organisms/TopBar/Settings.js +1 -1
  131. package/dist/organisms/TopBar/TopBar.d.ts +1 -0
  132. package/dist/organisms/TopBar/TopBar.styles.js +1 -1
  133. package/dist/organisms/TopBar/Tutorials/TutorialItem.js +1 -1
  134. package/dist/organisms/index.d.ts +1 -0
  135. package/dist/organisms/index.js +1 -1
  136. package/dist/providers/AuthProvider/AuthProviderInner.js +1 -1
  137. package/dist/providers/ReleaseNotesProvider.d.ts +0 -1
  138. package/dist/providers/ReleaseNotesProvider.js +1 -1
  139. package/dist/providers/SideBarProvider.js +1 -1
  140. package/dist/providers/StepperProvider.js +1 -1
  141. package/dist/providers/TableOfContentsProvider.js +1 -1
  142. package/dist/providers/ThemeProvider/ThemeProvider.js +1 -1
  143. package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProviderInner.js +1 -1
  144. package/package.json +8 -10
  145. package/dist/atoms/hooks/useSearchParameter.d.ts +0 -12
  146. package/dist/atoms/hooks/useSearchParameter.js +0 -1
  147. package/dist/molecules/ContentMenu/ContentMenu.d.ts +0 -17
  148. package/dist/molecules/ContentMenu/ContentMenu.js +0 -1
  149. package/dist/molecules/ContentMenu/ContentMenu.styles.js +0 -52
  150. package/dist/molecules/Sieve/Filter.d.ts +0 -10
  151. package/dist/molecules/Sieve/Filter.js +0 -1
  152. package/dist/molecules/Sieve/Sieve.d.ts +0 -7
  153. package/dist/molecules/Sieve/Sieve.js +0 -1
  154. package/dist/molecules/Sieve/Sieve.styles.js +0 -43
  155. package/dist/molecules/Sieve/Sieve.types.d.ts +0 -28
  156. package/dist/molecules/Sieve/Sort.js +0 -1
  157. package/dist/molecules/SingleFilterMenu/SingleFilterMenu.d.ts +0 -15
  158. package/dist/molecules/SingleFilterMenu/SingleFilterMenu.js +0 -20
  159. package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.utils.js +0 -1
@@ -1 +1 @@
1
- import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{UploadFile as n}from"./UploadFile/UploadFile.js";import{Description as r}from"./Description.js";import i from"./Severity.js";import{Title as a}from"./Title.js";import{Url as o}from"./Url.js";import{Actions as s,Container as c,ContentWrapper as l,LockedFormWarning as u,ReportLocationText as d,UploadInfo as f}from"../Feedback.styles.js";import{useMemo as p}from"react";import{Button as m,Icon as h,Typography as g}from"@equinor/eds-core-react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{info_circle as b}from"@equinor/eds-icons";const x=()=>{let{isWrongDomain:x,selectedType:S,resetForm:C,feedbackContent:w,onDialogClose:T,serviceNowSuccess:E,handleSave:D,requestIsLoading:O}=t(),k=p(()=>w.title.length>0&&w.description.length>0&&!x,[w.title.length,w.description.length,x]);return v(l,{children:y(c,{children:[v(a,{}),S===e.BUG&&y(_,{children:[v(i,{}),v(o,{})]}),v(r,{}),y(f,{children:[v(h,{data:b}),v(g,{children:`Please make sure the uploaded files do not contain confidential or personal information`})]}),v(n,{}),v(d,{children:S===e.BUG?`Bug reports are sent to Service Now and to the development team directly`:`Feature suggestions are sent to the development team directly`}),E&&y(u,{children:[v(h,{data:b}),v(g,{children:`The report has already been sent to service now, and part of the form is locked, so you can retry sending it to the development team. Otherwise you can reset the form with the "Reset form" button in the bottom left corner.`})]}),y(s,{children:[v(m,{variant:`ghost`,onClick:C,"data-testid":`reset-form-button`,children:`Reset form`}),y(`div`,{children:[v(m,{variant:`ghost`,onClick:T,children:`Cancel`}),v(m,{onClick:D,disabled:!k||O,"data-testid":`submit-button`,children:E?`Send again`:`Send`})]})]})]})})};export{x as FeedbackForm};
1
+ import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{UploadFile as n}from"./UploadFile/UploadFile.js";import{Description as r}from"./Description.js";import{Severity as i}from"./Severity.js";import{Title as a}from"./Title.js";import{Url as o}from"./Url.js";import{Actions as s,Container as c,ContentWrapper as l,LockedFormWarning as u,ReportLocationText as d,UploadInfo as f}from"../Feedback.styles.js";import{useMemo as p}from"react";import{Button as m,Icon as h,Typography as g}from"@equinor/eds-core-react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{info_circle as b}from"@equinor/eds-icons";const x=()=>{let{isWrongDomain:x,selectedType:S,resetForm:C,feedbackContent:w,onDialogClose:T,serviceNowSuccess:E,handleSave:D,requestIsLoading:O}=t(),k=p(()=>w.title.length>0&&w.description.length>0&&!x,[w.title.length,w.description.length,x]);return v(l,{children:y(c,{children:[v(a,{}),S===e.BUG&&y(_,{children:[v(i,{}),v(o,{})]}),v(r,{}),y(f,{children:[v(h,{data:b}),v(g,{children:`Please make sure the uploaded files do not contain confidential or personal information`})]}),v(n,{}),v(d,{children:S===e.BUG?`Bug reports are sent to Service Now and to the development team directly`:`Feature suggestions are sent to the development team directly`}),E&&y(u,{children:[v(h,{data:b}),v(g,{children:`The report has already been sent to service now, and part of the form is locked, so you can retry sending it to the development team. Otherwise you can reset the form with the "Reset form" button in the bottom left corner.`})]}),y(s,{children:[v(m,{variant:`ghost`,onClick:C,"data-testid":`reset-form-button`,children:`Reset form`}),y(`div`,{children:[v(m,{variant:`ghost`,onClick:T,children:`Cancel`}),v(m,{onClick:D,disabled:!k||O,"data-testid":`submit-button`,children:E?`Send again`:`Send`})]})]})]})})};export{x as FeedbackForm};
@@ -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(),l=i.urgency?{value:i.urgency,label:i.urgency}:void 0;return a(o,{children:a(r,{show:t,children:a(e,{items:s,label:`Severity`,meta:`optional`,clearable:!1,disabled:t,value:l,placeholder:`Select error impact`,onSelect:e=>{c(`urgency`,e.value)}})})})};export{c as default};
3
+ `,s=Object.values(t).map(e=>({value:e,label:e})),c=()=>{let{serviceNowSuccess:t,feedbackContent:i,updateFeedback:c}=n(),l=i.urgency?{value:i.urgency,label:i.urgency}:void 0;return a(o,{children:a(r,{show:t,children:a(e,{items:s,label:`Severity`,meta:`optional`,clearable:!1,disabled:t,value:l,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(()=>{let n=async e=>{let n=await t(e);_(n)};v||n(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};
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=>{let n=await t(e);_(n)})(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(`.`)),n=new FileReader;n.readAsDataURL(e[0]);let r=[];s&&r.push(...s);let i=[...t,...r],a=d(i,(e,t)=>e.name===t.name&&e.size===t.size);f(a)}m(t)},g=e=>{let t=s?.filter(t=>t.name!==e.name&&t.size!==e.size)??[];f(t)},_=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};
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);let r=[...t,...n],i=d(r,(e,t)=>e.name===t.name&&e.size===t.size);f(i)}m(t)},g=e=>{let t=s?.filter(t=>t.name!==e.name&&t.size!==e.size)??[];f(t)},_=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};
@@ -1,3 +1,3 @@
1
1
  import{TextField as e}from"../../../../../molecules/TextField/TextField.js";import{EQUINOR_EMAIL_SUFFIX as t}from"../Feedback.const.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: 2/3;
3
- `,s=()=>{let{serviceNowSuccess:i,feedbackContent:s,updateFeedback:c,isWrongDomain:l,setIsWrongDomain:u}=n(),d=e=>{c(`url`,e.currentTarget.value),(e.currentTarget.value===``||l&&e.currentTarget.value.includes(t))&&u(!1)},f=e=>{let n=e.currentTarget.value;!n.includes(t)&&n.length!==0&&u(!0)};return a(o,{children:a(r,{show:i,children:a(e,{id:`feedback-url`,label:`URL`,disabled:i,meta:`optional`,value:s.url,placeholder:`URL of error location`,variant:l?`error`:void 0,helperText:l?`The provided URL must be from a ${t} domain`:``,onChange:d,onBlur:f})})})};export{s as Url};
3
+ `,s=()=>{let{serviceNowSuccess:i,feedbackContent:s,updateFeedback:c,isWrongDomain:l,setIsWrongDomain:u}=n();return a(o,{children:a(r,{show:i,children:a(e,{id:`feedback-url`,label:`URL`,disabled:i,meta:`optional`,value:s.url,placeholder:`URL of error location`,variant:l?`error`:void 0,helperText:l?`The provided URL must be from a ${t} domain`:``,onChange:e=>{c(`url`,e.currentTarget.value),(e.currentTarget.value===``||l&&e.currentTarget.value.includes(t))&&u(!1)},onBlur:e=>{let n=e.currentTarget.value;!n.includes(t)&&n.length!==0&&u(!0)}})})})};export{s as Url};
@@ -1,4 +1,4 @@
1
- import{spacings as e}from"../../../../../atoms/style/spacings.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{ContentWrapper as n}from"../Feedback.styles.js";import{AnimateChangeInHeight as r}from"./AnimateChangeInHeight.js";import i from"./ResponseStatus.js";import{Success as a}from"./Success.js";import{useEffect as o,useState as s}from"react";import{Button as c}from"@equinor/eds-core-react";import l from"styled-components";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{motion as f}from"framer-motion";const p=l(f.div)`
1
+ import{spacings as e}from"../../../../../atoms/style/spacings.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{ContentWrapper as n}from"../Feedback.styles.js";import{AnimateChangeInHeight as r}from"./AnimateChangeInHeight.js";import{ResponseStatus as i}from"./ResponseStatus.js";import{Success as a}from"./Success.js";import{useEffect as o,useState as s}from"react";import{Button as c}from"@equinor/eds-core-react";import l from"styled-components";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{motion as f}from"framer-motion";const p=l(f.div)`
2
2
  display: flex;
3
3
  gap: ${e.large};
4
4
  height: auto;
@@ -1 +1 @@
1
- import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{RequestStatus as n}from"./RequestStatus.js";import{FullSlackResponse as r}from"./FullSlackResponse.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";const s=()=>{let{serviceNowRequestResponse:s,selectedType:c,showAllSlackRequests:l,allSlackRequestStatus:u}=t();return o(i,{children:[c===e.BUG&&a(n,{title:`Service Now`,requestStatus:s}),l?a(r,{allSlackRequestStatus:{status:u}}):a(n,{title:`Development team`,requestStatus:{status:u}})]})};export{s as default};
1
+ import{FeedbackType as e}from"../Feedback.types.js";import{useFeedbackContext as t}from"../hooks/useFeedbackContext.js";import{RequestStatus as n}from"./RequestStatus.js";import{FullSlackResponse as r}from"./FullSlackResponse.js";import{Fragment as i,jsx as a,jsxs as o}from"react/jsx-runtime";const s=()=>{let{serviceNowRequestResponse:s,selectedType:c,showAllSlackRequests:l,allSlackRequestStatus:u}=t();return o(i,{children:[c===e.BUG&&a(n,{title:`Service Now`,requestStatus:s}),l?a(r,{allSlackRequestStatus:{status:u}}):a(n,{title:`Development team`,requestStatus:{status:u}})]})};export{s as ResponseStatus};
@@ -1 +1 @@
1
- import{useReleaseNotes as e}from"../../../../../providers/ReleaseNotesProvider.js";import{ButtonContainer as t,Wrapper as n}from"./Header.styles.js";import{Button as r,Icon as i,Tooltip as a,Typography as o}from"@equinor/eds-core-react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{close as l,external_link as u}from"@equinor/eds-icons";const d=()=>{let{setOpen:d,showAllReleaseNotesLink:f}=e(),p=()=>{d(!1)};return c(n,{children:[s(o,{variant:`h1`,bold:!0,children:`What's new?`}),c(t,{children:[s(a,{title:`Release notes in SAM`,children:s(r,{variant:`ghost_icon`,href:f,target:`_blank`,children:s(i,{data:u})})}),s(r,{variant:`ghost_icon`,onClick:p,"aria-label":`close modal`,children:s(i,{data:l})})]})]})};export{d as Header};
1
+ import{useReleaseNotes as e}from"../../../../../providers/ReleaseNotesProvider.js";import{Wrapper as t}from"./Header.styles.js";import{Button as n,Icon as r,Typography as i}from"@equinor/eds-core-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{close as s}from"@equinor/eds-icons";const c=()=>{let{setOpen:c}=e();return o(t,{children:[a(i,{variant:`h1`,bold:!0,children:`What's new?`}),a(n,{variant:`ghost_icon`,onClick:()=>{c(!1)},"aria-label":`close modal`,children:a(r,{data:s})})]})};export{c as Header};
@@ -1,7 +1,4 @@
1
- import{spacings as e}from"../../../../../atoms/style/spacings.js";import t from"styled-components";const n=t.div`
1
+ import e from"styled-components";const t=e.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
- `,r=t.div`
5
- display: flex;
6
- gap: ${e.medium};
7
- `;export{r as ButtonContainer,n as Wrapper};
4
+ `;export{t as Wrapper};
@@ -1 +1 @@
1
- import{Status as e}from"../../../Status/index.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{useReleaseNotes as n}from"../../../../providers/ReleaseNotesProvider.js";import{Button as r}from"../../../../molecules/Button/Button.js";import{Header as i}from"./Header/Header.js";import{AllReleaseNotesWrapper as a,LoadingWrapper as o,StyledDialog as s}from"./ReleaseNotesDialog.styles.js";import{ReleaseNote as c}from"../../../ReleaseNote/ReleaseNote.js";import{CircularProgress as l}from"@equinor/eds-core-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{ReleaseNotesService as p,useReleaseNotesQuery as m}from"@equinor/subsurface-app-management";const h=({enabled:h})=>{let{setOpen:g,open:_,mostRecentReleaseNote:v,showAllReleaseNotesLink:y}=n(),{isLoading:b}=m({enabled:h}),{isPrefetching:x}=t({richTextValues:v?.body?[v.body]:[],onImageRead:p.getReleaseNoteImage}),S=()=>{g(!1)};return f(s,{open:_,onClose:S,isDismissable:!0,children:[d(i,{}),b||x?d(o,{children:d(l,{})}):v?f(u,{children:[d(c,{...v,expanded:!0}),d(a,{children:d(r,{variant:`ghost`,href:y,target:`_blank`,children:`See all release notes in SAM`})})]}):f(e,{children:[d(e.Title,{title:`No published release notes`}),d(e.Description,{text:`This application has no published release notes yet.`})]})]})};export{h as ReleaseNotesDialog};
1
+ import{Status as e}from"../../../Status/index.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{useReleaseNotes as n}from"../../../../providers/ReleaseNotesProvider.js";import{Button as r}from"../../../../molecules/Button/Button.js";import{Header as i}from"./Header/Header.js";import{AllReleaseNotesWrapper as a,LoadingWrapper as o,StyledDialog as s}from"./ReleaseNotesDialog.styles.js";import{ReleaseNote as c}from"../../../ReleaseNote/ReleaseNote.js";import{CircularProgress as l}from"@equinor/eds-core-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{Link as p}from"@tanstack/react-router";import{ReleaseNotesService as m,useReleaseNotesQuery as h}from"@equinor/subsurface-app-management";const g=({enabled:g})=>{let{setOpen:_,open:v,mostRecentReleaseNote:y}=n(),{isLoading:b}=h({enabled:g}),{isPrefetching:x}=t({richTextValues:y?.body?[y.body]:[],onImageRead:m.getReleaseNoteImage});return f(s,{open:v,onClose:()=>{_(!1)},isDismissable:!0,children:[d(i,{}),b||x?d(o,{children:d(l,{})}):y?f(u,{children:[d(c,{...y,expanded:!0}),d(a,{children:d(r,{as:p,variant:`ghost`,to:`/release-notes`,children:`See all release notes`})})]}):f(e,{children:[d(e.Title,{title:`No published release notes`}),d(e.Description,{text:`This application has no published release notes yet.`})]})]})};export{g as ReleaseNotesDialog};
@@ -22,4 +22,4 @@ import{spacings as e}from"../../atoms/style/spacings.js";import{elevation as t}f
22
22
  padding-top: ${e.small};
23
23
  padding-left: ${e.medium};
24
24
  }
25
- `,x=({allSettings:e,children:t})=>{let p=c(null),[x,S]=l(!1),C=o(r),w=()=>S(!1),T=()=>S(!x),E=s(()=>C?[{title:`Theme`,value:C.theme,onChange:e=>C.setTheme(e),items:[{label:`Light Mode`,name:`theme-group`,value:n.LIGHT,colorBox:`#ffffff`},{label:`Dark Mode`,name:`theme-group`,value:n.DARK,colorBox:`#243746`}]},...e??[]]:e??[],[e,C]);if(E.length===0)throw Error(`Empty settings in TopBar.Settings!`);return g(m,{children:[h(a,{variant:`ghost_icon`,onClick:T,ref:p,children:h(u,{data:_,size:24})}),g(i,{open:x,title:`Settings`,onClose:w,anchorEl:p.current,children:[h(b,{children:E.map((e,t)=>g(`div`,{children:[h(f,{variant:`overline`,children:e.title}),e.items.map((t,n)=>g(v,{children:[h(d,{id:t.label,disabled:t.disabled,label:t.label,name:e.title,value:`${t.label}-${n}`,checked:e.value===t.value,onChange:()=>e.onChange?.(t.value)}),t.colorBox&&h(y,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&h(f,{variant:`h6`,children:t.text}),t.element&&t.element]},n))]},t))}),t]})]})};x.displayName=`TopBar.Settings`;export{x as Settings};
25
+ `,x=({allSettings:e,children:t})=>{let p=c(null),[x,S]=l(!1),C=o(r),w=()=>S(!1),T=()=>S(!x),E=s(()=>C?[{title:`Theme`,value:C.theme,onChange:e=>C.setTheme(e),items:[{label:`Light Mode`,name:`theme-group`,value:n.LIGHT,colorBox:`#ffffff`},{label:`Dark Mode`,name:`theme-group`,value:n.DARK,colorBox:`#243746`}]},...e??[]]:e??[],[e,C]);if(E.length===0)throw Error(`Empty settings in TopBar.Settings!`);return g(m,{children:[h(a,{variant:`ghost_icon`,onClick:T,ref:p,"data-testid":`show-hide-button`,children:h(u,{data:_,size:24})}),g(i,{open:x,title:`Settings`,onClose:w,anchorEl:p.current,children:[h(b,{children:E.map((e,t)=>g(`div`,{children:[h(f,{variant:`overline`,children:e.title}),e.items.map((t,n)=>g(v,{children:[h(d,{id:t.label,disabled:t.disabled,label:t.label,name:e.title,value:`${t.label}-${n}`,checked:e.value===t.value,onChange:()=>e.onChange?.(t.value)}),t.colorBox&&h(y,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&h(f,{variant:`h6`,children:t.text}),t.element&&t.element]},n))]},t))}),t]})]})};x.displayName=`TopBar.Settings`;export{x as Settings};
@@ -3,6 +3,7 @@ import { EnvironmentType } from "../../atoms/enums/Environment.js";
3
3
  import React, { ReactNode } from "react";
4
4
 
5
5
  //#region src/organisms/TopBar/TopBar.d.ts
6
+
6
7
  declare const TopBar: React.ForwardRefExoticComponent<{
7
8
  applicationIcon: string;
8
9
  applicationName: string;
@@ -1,4 +1,4 @@
1
- import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{Button as r,CircularProgress as i,TopBar as a,Typography as o}from"@equinor/eds-core-react";import s,{css as c}from"styled-components";import{Link as l}from"react-router-dom";const u=s(a)`
1
+ import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{Button as r,CircularProgress as i,TopBar as a,Typography as o}from"@equinor/eds-core-react";import s,{css as c}from"styled-components";import{Link as l}from"@tanstack/react-router";const u=s(a)`
2
2
  border-bottom: 1px solid ${t.ui.background__medium.rgba};
3
3
  padding-left: ${n.medium};
4
4
  align-content: center;
@@ -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(),h=m.includes(a),g=()=>{p(a),e?.(a),n()};return s(d,{onClick:g,children:[h&&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};
21
+ `,f=({onTutorialStart:e,onClose:n,id:a,name:f})=>{let{startTutorial:p,seenTutorialIDs:m}=u(),h=m.includes(a);return s(d,{onClick:()=>{p(a),e?.(a),n()},children:[h&&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};
@@ -19,6 +19,7 @@ import { PageTitle } from "./PageTitle/PageTitle.js";
19
19
  import { ReleaseNote, ReleaseNoteProps } from "./ReleaseNote/ReleaseNote.js";
20
20
  import { ToggleGroup } from "./ToggleGroup/index.js";
21
21
  import { Faq } from "./Faq/Faq.js";
22
+ import { ReleaseNotesPage } from "./ReleaseNotesPage/ReleaseNotesPage.js";
22
23
  import { Card as Card$1, CardProps } from "@equinor/eds-core-react";
23
24
  import { EdsDataGridProps as DataGridProps } from "@equinor/eds-data-grid-react";
24
25
  export { Card$1 as Card, type CardProps, type DataGridProps };
@@ -1 +1 @@
1
- import{Status as e}from"./Status/index.js";import{MissingAccessToApp as t}from"./Status/collections/MissingAccessToApp.js";import{DataGrid as n}from"./DataGrid/DataGrid.js";import{Template as r}from"./Template/Template.js";import{FieldSelector as i}from"./FieldSelector/FieldSelector.js";import{Filter as a}from"./Filter/index.js";import{SideBar as o}from"./SideBar/index.js";import{ReleaseNote as s}from"./ReleaseNote/ReleaseNote.js";import{TopBar as c}from"./TopBar/index.js";import{BadRequest as l}from"./Status/collections/BadRequest.js";import{GenericError as u}from"./Status/collections/GenericError.js";import{MissingPermissions as d}from"./Status/collections/MissingPermissions.js";import{PageNotFound as f}from"./Status/collections/PageNotFound.js";import{ServerError as p}from"./Status/collections/ServerError.js";import{ApiResponseError as m}from"./Status/collections/ApiResponseError.js";import{TableOfContents as h}from"./TableOfContents/TableOfContents.js";import{PageTitle as g}from"./PageTitle/PageTitle.js";import{ToggleGroup as _}from"./ToggleGroup/index.js";import{Faq as v}from"./Faq/Faq.js";import{Card as y}from"@equinor/eds-core-react";export{y as Card};
1
+ import{Status as e}from"./Status/index.js";import{MissingAccessToApp as t}from"./Status/collections/MissingAccessToApp.js";import{DataGrid as n}from"./DataGrid/DataGrid.js";import{Template as r}from"./Template/Template.js";import{FieldSelector as i}from"./FieldSelector/FieldSelector.js";import{Filter as a}from"./Filter/index.js";import{SideBar as o}from"./SideBar/index.js";import{ReleaseNote as s}from"./ReleaseNote/ReleaseNote.js";import{TopBar as c}from"./TopBar/index.js";import{BadRequest as l}from"./Status/collections/BadRequest.js";import{GenericError as u}from"./Status/collections/GenericError.js";import{MissingPermissions as d}from"./Status/collections/MissingPermissions.js";import{PageNotFound as f}from"./Status/collections/PageNotFound.js";import{ServerError as p}from"./Status/collections/ServerError.js";import{ApiResponseError as m}from"./Status/collections/ApiResponseError.js";import{TableOfContents as h}from"./TableOfContents/TableOfContents.js";import{PageTitle as g}from"./PageTitle/PageTitle.js";import{ToggleGroup as _}from"./ToggleGroup/index.js";import{Faq as v}from"./Faq/Faq.js";import{ReleaseNotesPage as y}from"./ReleaseNotesPage/ReleaseNotesPage.js";import{Card as b}from"@equinor/eds-core-react";export{b as Card};
@@ -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(()=>{if(I)return;let e=async()=>{console.log(`[AuthProvider] Initializing`),await k.initialize(),console.log(`[AuthProvider] Finished initializing`),L(!0)};e().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(),r=window.URL??window.webkitURL,i=r.createObjectURL(n);x(i)}}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`)}},r=async()=>{await e(),O?w(`authorized`):await n()};r()},[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};
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(),r=(window.URL??window.webkitURL).createObjectURL(n);x(r)}}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};
@@ -6,7 +6,6 @@ interface ReleaseNotesContextState {
6
6
  open: boolean;
7
7
  setOpen: (open: boolean) => void;
8
8
  mostRecentReleaseNote: ReleaseNote | undefined;
9
- showAllReleaseNotesLink: string;
10
9
  }
11
10
  declare const useReleaseNotes: () => ReleaseNotesContextState;
12
11
  interface ReleaseNotesContextProviderProps {
@@ -1 +1 @@
1
- import{EnvironmentType as e}from"../atoms/enums/Environment.js";import{environment as t}from"../atoms/utils/auth_environment.js";import{useLocalStorage as n}from"../atoms/hooks/useLocalStorage.js";import{usingReleaseNoteDate as r}from"../organisms/ReleaseNote/ReleaseNote.utils.js";import{environmentAndAppNameToURL as i}from"../organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.utils.js";import{sortReleaseNotesByDate as a}from"./ReleaseNotesProvider.utils.js";import{createContext as o,useContext as s,useEffect as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";import{useReleaseNotesQuery as d}from"@equinor/subsurface-app-management";const{getEnvironmentName:f,getAppName:p}=t,m=o(void 0),h=()=>{let e=s(m);if(e===void 0)throw Error(`useReleaseNotes must be used within a ReleaseNotesProvider`);return e},g=1e3*60*60*24*14,_=({children:t,enabled:o,popUpNewReleaseNote:s=!1})=>{let{data:h}=d({enabled:o}),[_,v]=l(!1),[y,b]=n(`release-notes-was-viewed-key`,``,g),x=h?.toSorted(a).at(0),S=p(import.meta.env.VITE_NAME),C=f(import.meta.env.VITE_ENVIRONMENT_NAME),w=C===e.LOCALHOST?e.DEVELOP:C,T=i(w,S);return c(()=>{if(!x||!s)return;let e=new Date(r(x)).getTime(),t=Date.now(),n=t-e;n<=g&&y!==x.releaseId&&(v(!0),b(x.releaseId))},[y,x,s,b]),u(m.Provider,{value:{open:_,setOpen:v,mostRecentReleaseNote:x,showAllReleaseNotesLink:T},children:t})};export{_ as ReleaseNotesProvider,h as useReleaseNotes};
1
+ import{useLocalStorage as e}from"../atoms/hooks/useLocalStorage.js";import{usingReleaseNoteDate as t}from"../organisms/ReleaseNote/ReleaseNote.utils.js";import{sortReleaseNotesByDate as n}from"./ReleaseNotesProvider.utils.js";import{createContext as r,useContext as i,useEffect as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";import{useReleaseNotesQuery as c}from"@equinor/subsurface-app-management";const l=r(void 0),u=()=>{let e=i(l);if(e===void 0)throw Error(`useReleaseNotes must be used within a ReleaseNotesProvider`);return e},d=1e3*60*60*24*14,f=({children:r,enabled:i,popUpNewReleaseNote:u=!1})=>{let{data:f}=c({enabled:i}),[p,m]=o(!1),[h,g]=e(`release-notes-was-viewed-key`,``,d),_=f?.toSorted(n).at(0);return a(()=>{if(!_||!u)return;let e=new Date(t(_)).getTime();Date.now()-e<=d&&h!==_.releaseId&&(m(!0),g(_.releaseId))},[h,_,u,g]),s(l.Provider,{value:{open:p,setOpen:m,mostRecentReleaseNote:_},children:r})};export{f as ReleaseNotesProvider,u as useReleaseNotes};
@@ -1 +1 @@
1
- import{createContext as e,useContext as t,useReducer as n}from"react";import{jsx as r}from"react/jsx-runtime";function i(){let e=t(a);if(e===void 0)throw Error(`Sidebar hook must be used within Provider`);return e}const a=e(void 0),o=`amplify-sidebar-state`,s=()=>{let e=localStorage.getItem(o);return e?JSON.parse(e):{isOpen:!1}},c=e=>{localStorage.setItem(o,JSON.stringify(e))},l=(e,t)=>(c(t),t),u=({children:e})=>{let[t,i]=n(l,s()),o=e=>{i({isOpen:e})};return r(a.Provider,{value:{isOpen:t.isOpen,setIsOpen:o},children:e})};export{u as SideBarProvider,i as useSideBar};
1
+ import{createContext as e,useContext as t,useReducer as n}from"react";import{jsx as r}from"react/jsx-runtime";function i(){let e=t(a);if(e===void 0)throw Error(`Sidebar hook must be used within Provider`);return e}const a=e(void 0),o=`amplify-sidebar-state`,s=()=>{let e=localStorage.getItem(o);return e?JSON.parse(e):{isOpen:!1}},c=e=>{localStorage.setItem(o,JSON.stringify(e))},l=(e,t)=>(c(t),t),u=({children:e})=>{let[t,i]=n(l,s());return r(a.Provider,{value:{isOpen:t.isOpen,setIsOpen:e=>{i({isOpen:e})}},children:e})};export{u as SideBarProvider,i as useSideBar};
@@ -1 +1 @@
1
- import{createContext as e,useCallback as t,useContext as n,useState as r}from"react";import{jsx as i}from"react/jsx-runtime";import{useLocation as a,useNavigate as o,useParams as s}from"react-router";const c=e(void 0);function l(){let e=n(c);if(!e)throw Error(`useStepper must be used within a StepperProvider`);return e}const u=({steps:e,children:n,isStepDisabled:l,...u})=>{let{step:d}=s(),f=o(),p=a().pathname.split(`/`).slice(0,-1).join(`/`),m=u.syncToURLParam?Number(d):u?.initialStep??0;if(u.syncToURLParam&&d&&isNaN(Number(d)))throw Error(`Step URL param must be a valid number when using "syncToURLParam"`);if(e.length<2)throw Error(`Stepper must have at least 2 steps`);let[h,g]=r(m),_=u.syncToURLParam?Number(d):h,[v,y]=r(0);if(m>=e.length||m<0)throw Error(`initialStep must be a valid index of the steps array`);let b=e=>{u.syncToURLParam?f(`${p}/${e}`):g(e)},x=()=>{v!==0&&y(0)},S=()=>{if(`subSteps`in e[_]&&e[_].subSteps&&v<e[_].subSteps.length-1){y(e=>e+1);return}_!==e.length-1&&(b(_+1),x())},C=()=>{if(v>0&&`subSteps`in e[_]&&e[_].subSteps&&e[_].subSteps.length>0){y(e=>e-1);return}if(_===0)return;b(_-1);let t=e.at(_-1);t&&`subSteps`in t&&t.subSteps&&y(t.subSteps.length-1)},w=t(t=>l?l({step:e[t],stepIndex:t,currentStep:e[_],currentStepIndex:_}):!1,[l,_,e]);return i(c.Provider,{value:{steps:e,currentStep:_,currentSubStep:v,setCurrentStep:b,goToNextStep:S,goToPreviousStep:C,isStepAtIndexDisabled:w},children:n})};export{u as StepperProvider,l as useStepper};
1
+ import{createContext as e,useCallback as t,useContext as n,useState as r}from"react";import{jsx as i}from"react/jsx-runtime";import{useLocation as a,useNavigate as o,useParams as s}from"@tanstack/react-router";const c=e(void 0);function l(){let e=n(c);if(!e)throw Error(`useStepper must be used within a StepperProvider`);return e}const u=({steps:e,children:n,isStepDisabled:l,...u})=>{let{step:d}=s({strict:!1}),f=o(),p=a().pathname.split(`/`).slice(0,-1).join(`/`),m=u.syncToURLParam?Number(d):u?.initialStep??0;if(u.syncToURLParam&&d&&isNaN(Number(d)))throw Error(`Step URL param must be a valid number when using "syncToURLParam"`);if(e.length<2)throw Error(`Stepper must have at least 2 steps`);let[h,g]=r(m),_=u.syncToURLParam?Number(d):h,[v,y]=r(0);if(m>=e.length||m<0)throw Error(`initialStep must be a valid index of the steps array`);let b=e=>{u.syncToURLParam?f({to:`${p}/${e}`}):g(e)},x=()=>{v!==0&&y(0)},S=()=>{if(`subSteps`in e[_]&&e[_].subSteps&&v<e[_].subSteps.length-1){y(e=>e+1);return}_!==e.length-1&&(b(_+1),x())},C=()=>{if(v>0&&`subSteps`in e[_]&&e[_].subSteps&&e[_].subSteps.length>0){y(e=>e-1);return}if(_===0)return;b(_-1);let t=e.at(_-1);t&&`subSteps`in t&&t.subSteps&&y(t.subSteps.length-1)},w=t(t=>l?l({step:e[t],stepIndex:t,currentStep:e[_],currentStepIndex:_}):!1,[l,_,e]);return i(c.Provider,{value:{steps:e,currentStep:_,currentSubStep:v,setCurrentStep:b,goToNextStep:S,goToPreviousStep:C,isStepAtIndexDisabled:w},children:n})};export{u as StepperProvider,l as useStepper};
@@ -1 +1 @@
1
- import{useOnScreenMultiple as e}from"../atoms/hooks/useOnScreenMultiple.js";import{getValues as t}from"./TableOfContentsProvider.utils.js";import{createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import{useLocation as u,useNavigate as d}from"react-router";const f=n(void 0);function p(){let e=i(f);if(e===void 0)throw Error(`'useTableOfContents' must be used within provider`);return e}const m=({items:n,children:i,hashNavigation:p})=>{let m=d(),{hash:h}=u(),[g,_]=c(n[0]?.value),[v,y]=c([]),[b,x]=c(h!==``),S=s(!1),C=o(()=>n.flatMap(e=>t([],e)),[n]);a(()=>{y(C.map(e=>document.getElementById(e)))},[C]),a(()=>{h.length||(S.current=!0)},[h]);let w=r(e=>{if(e.value===g)return!0;if(e.children&&g){let n=t([],e);return n.includes(g)}return!1},[g]),T=e(v),E=s(-1),D=r((e,t)=>{let n=C.findIndex(t=>t===e),r=v[n];if(r){let e=t?.shouldInstantlyJumpOnMount&&b?`instant`:t?.behavior??`smooth`;r.scrollIntoView({block:`start`,behavior:e}),E.current=n;let i=1/0,a=0,o=()=>{let e=r?.getBoundingClientRect().top;if(e===i){if(a+=1,a>1){_(C[n]),p&&(m(`#${C[n]}`,{replace:!0}),x(!1)),E.current=-1;return}}else a=0,i=e;requestAnimationFrame(o)};requestAnimationFrame(o)}},[v,p,m,b,C]);return a(()=>{if(T.length===0||T.length!==C.length||E.current!==-1)return;let e=-1;for(let t=T.length-1;t>=0;t--)T[t]&&(e=t);if(e===-1||C.at(e)===void 0)return;let t=h.replace(`#`,``);if(!S.current&&t.length&&C.includes(t)){D(t,{behavior:`instant`,shouldInstantlyJumpOnMount:!0}),S.current=!0;return}_(C[e]),p&&m(`#${C[e]}`,{replace:!0})},[p,m,C,T]),l(f.Provider,{value:{items:n,selected:g,setSelected:D,isActive:w},children:i})};export{m as TableOfContentsProvider,p as useTableOfContents};
1
+ import{useOnScreenMultiple as e}from"../atoms/hooks/useOnScreenMultiple.js";import{getValues as t}from"./TableOfContentsProvider.utils.js";import{createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import{useLocation as u,useNavigate as d}from"@tanstack/react-router";const f=n(void 0);function p(){let e=i(f);if(e===void 0)throw Error(`'useTableOfContents' must be used within provider`);return e}const m=({items:n,children:i,hashNavigation:p})=>{let m=d(),{hash:h}=u(),[g,_]=c(n[0]?.value),[v,y]=c([]),b=s(!1),x=o(()=>n.flatMap(e=>t([],e)),[n]);a(()=>{y(x.map(e=>document.getElementById(e)))},[x]),a(()=>{h.length||(b.current=!0)},[h]);let S=r(e=>e.value===g?!0:e.children&&g?t([],e).includes(g):!1,[g]),C=e(v),w=s(-1),T=r((e,t)=>{let n=x.findIndex(t=>t===e);if(p){_(x[n]),m({to:`.`,hash:`#${x[n]}`,hashScrollIntoView:!1,replace:!0});return}let r=v[n];if(r){let e=t?.behavior??`smooth`;r.scrollIntoView({block:`start`,behavior:e}),w.current=n;let i=1/0,a=0,o=()=>{let e=r?.getBoundingClientRect().top;if(e===i){if(a+=1,a>1){_(x[n]),w.current=-1;return}}else a=0,i=e;requestAnimationFrame(o)};requestAnimationFrame(o)}},[v,p,m,x]);return a(()=>{if(h&&!b.current){b.current=!0;let e=decodeURIComponent(h.replace(`#`,``));if(!e.length||!x.includes(e))return;_(e),m({to:`.`,hash:`#${e}`,hashScrollIntoView:{behavior:`instant`,block:`start`},replace:!0})}},[h,m,x]),a(()=>{if(C.length===0||C.length!==x.length||w.current!==-1||!b.current)return;let e=-1;for(let t=C.length-1;t>=0;t--)C[t]&&(e=t);e===-1||x.at(e)===void 0||(_(x[e]),p&&m({to:`.`,hash:`#${x[e]}`,hashScrollIntoView:!1,replace:!0}))},[T,p,m,x,C]),l(f.Provider,{value:{items:n,selected:g,setSelected:T,isActive:S},children:i})};export{m as TableOfContentsProvider,p as useTableOfContents};
@@ -1 +1 @@
1
- import{useLocalStorage as e}from"../../atoms/hooks/useLocalStorage.js";import{THEME_LOCALSTORAGE_KEY as t}from"./ThemeProvider.constants.js";import{Theme as n}from"../../atoms/enums/Theme.js";import{createContext as r,useContext as i,useEffect as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=r(void 0);function c(){let e=i(s);if(e===void 0)throw Error(`ThemeProvider must be used within Provider`);return e}const l=({children:r})=>{let[i,c]=e(t,n.LIGHT);a(()=>{document.documentElement.setAttribute(`data-theme`,i)},[i]);let l=e=>{c(e)};return o(s.Provider,{value:{theme:i,setTheme:l},children:r})};export{l as ThemeProvider,s as ThemeProviderContext,c as useThemeProvider};
1
+ import{useLocalStorage as e}from"../../atoms/hooks/useLocalStorage.js";import{THEME_LOCALSTORAGE_KEY as t}from"./ThemeProvider.constants.js";import{Theme as n}from"../../atoms/enums/Theme.js";import{createContext as r,useContext as i,useEffect as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=r(void 0);function c(){let e=i(s);if(e===void 0)throw Error(`ThemeProvider must be used within Provider`);return e}const l=({children:r})=>{let[i,c]=e(t,n.LIGHT);return a(()=>{document.documentElement.setAttribute(`data-theme`,i)},[i]),o(s.Provider,{value:{theme:i,setTheme:e=>{c(e)}},children:r})};export{l as ThemeProvider,s as ThemeProviderContext,c as useThemeProvider};
@@ -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(()=>{if(y)return;let e=async()=>{if(g&&_!==void 0){if(!g.steps[_].highlightElement)return w([]);let e=await t(g.id,_,x);return w(e?[e]:[])}let e=await Promise.all(v.map(e=>{if(e.steps.at(0)?.highlightElement)return t(e.id,0,x)}));return w(e.filter(e=>e!==void 0))};e()},[_,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};
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]:[])}let e=await Promise.all(v.map(e=>{if(e.steps.at(0)?.highlightElement)return t(e.id,0,x)}));return w(e.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": "9.17.0",
3
+ "version": "10.0.0",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -48,13 +48,15 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@azure/msal-browser": "3.28.0",
51
- "@azure/msal-react": "2.2.0"
51
+ "@azure/msal-react": "2.2.0",
52
+ "@storybook/addon-vitest": "^9.1.10"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@equinor/eds-icons": "^0.22.0",
55
- "@equinor/subsurface-app-management": "^4.4.3",
56
+ "@equinor/subsurface-app-management": "5.0.0",
56
57
  "@eslint/js": "^9.22.0",
57
58
  "@faker-js/faker": "^9.6.0",
59
+ "@storybook/addon-coverage": "^2.0.0",
58
60
  "@storybook/addon-designs": "^10.0.2",
59
61
  "@storybook/addon-docs": "^9.1.1",
60
62
  "@storybook/addon-links": "^9.1.1",
@@ -72,7 +74,6 @@
72
74
  "@types/random-seed": "^0.3.5",
73
75
  "@types/react": "^19.0.10",
74
76
  "@types/react-dom": "^19.0.4",
75
- "@types/react-router-dom": "^5.3.3",
76
77
  "@types/styled-components": "^5.1.34",
77
78
  "@types/uuid": "^10.0.0",
78
79
  "@types/wicg-file-system-access": "^2023.10.5",
@@ -93,12 +94,10 @@
93
94
  "prettier": "^3.5.3",
94
95
  "react": "^19.0.0",
95
96
  "react-dom": "^19.0.0",
96
- "react-router": "^6.28.0",
97
- "react-router-dom": "^6.28.0",
98
97
  "resize-observer-polyfill": "^1.5.1",
99
98
  "resolve-tspaths": "^0.8.23",
100
99
  "storybook": "^9.1.1",
101
- "tsdown": "^0.14.1",
100
+ "tsdown": "^0.14.2",
102
101
  "typescript": "^5.8.2",
103
102
  "typescript-eslint": "^8.26.1",
104
103
  "uuid": "^11.1.0",
@@ -113,12 +112,11 @@
113
112
  },
114
113
  "peerDependencies": {
115
114
  "@equinor/eds-icons": "*",
116
- "@equinor/subsurface-app-management": ">=4.4.3",
115
+ "@equinor/subsurface-app-management": "^5.0.0",
117
116
  "@tanstack/react-query": "*",
117
+ "@tanstack/react-router": "*",
118
118
  "react": "^19.0.0",
119
119
  "react-dom": "^19.0.0",
120
- "react-router": "^6.28.0",
121
- "react-router-dom": "^6.28.0",
122
120
  "@equinor/eds-core-react": "0.44.0",
123
121
  "@equinor/eds-data-grid-react": "^0.7.5",
124
122
  "@tiptap/core": "^3.1.0",
@@ -1,12 +0,0 @@
1
- //#region src/atoms/hooks/useSearchParameter.d.ts
2
- declare function useSearchParameter<T>({
3
- key,
4
- initialValue,
5
- parser
6
- }: {
7
- key: string;
8
- initialValue?: T;
9
- parser?: (value: string) => T;
10
- }): readonly [T | undefined, (action: ((value: T | undefined) => T) | T) => void];
11
- //#endregion
12
- export { useSearchParameter };
@@ -1 +0,0 @@
1
- import{useRef as e}from"react";import{useSearchParams as t}from"react-router-dom";function n({key:n,initialValue:r,parser:i}){let[a,o]=t(),s=e(!1),c=a.get(n)??void 0,l=i&&c?i(c):c,u=!s.current&&l===void 0?r:l,d=e=>{if(s.current||=!0,e instanceof Function){let t=e(u);d(t)}else{let t=new URLSearchParams(a),r=typeof e==`string`?e:JSON.stringify(e);r===void 0||r===``||r===`null`||r===`[]`||r===`{}`?t.delete(n):t.set(n,r),o(t)}};return[u,d]}export{n as useSearchParameter};
@@ -1,17 +0,0 @@
1
- import { FC } from "react";
2
-
3
- //#region src/molecules/ContentMenu/ContentMenu.d.ts
4
- interface ContentMenuItemType {
5
- label: string;
6
- value: string;
7
- children?: ContentMenuItemType[];
8
- }
9
- interface ContentMenuProps {
10
- items: ContentMenuItemType[];
11
- value: string;
12
- onChange: (value: string) => void;
13
- isLoading?: boolean;
14
- }
15
- declare const ContentMenu: FC<ContentMenuProps>;
16
- //#endregion
17
- export { ContentMenu, ContentMenuProps };
@@ -1 +0,0 @@
1
- import{Container as e,ContentMenuChildItem as t,ContentMenuItem as n,ContentMenuItemSkeleton as r}from"./ContentMenu.styles.js";import{useCallback as i,useMemo as a,useState as o}from"react";import{Icon as s}from"@equinor/eds-core-react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{chevron_down as u,chevron_up as d}from"@equinor/eds-icons";const f=({items:f,value:p,onChange:m,isLoading:h=!1})=>{let[g,_]=o([]),v=i((e,t)=>{if(t){let t=g.findIndex(t=>t===e);_(t>=0?t=>t.filter(t=>t!==e):t=>[...t,e])}m(e)},[m,g]),y=a(()=>{let e=[];for(let r of f)if(e.push(l(n,{$active:p===r.value,onClick:()=>v(r.value,!!r.children),children:[r.children&&c(s,{data:g.includes(r.value)?d:u}),r.label]},`content-menu-item-${r.label}`)),r.children&&g.includes(r.value))for(let n of r.children)e.push(c(t,{$active:p===n.value,onClick:()=>v(n.value,!1),children:n.label},`content-menu-item-${n.label}`));return e},[v,f,g,p]);return h?c(e,{"data-testid":`content-menu-container`,children:[,,,,,].fill(0).map((e,t)=>c(r,{$offset:t*100},`content-menu-item-skeleton-${e+t}`))}):c(e,{"data-testid":`content-menu-container`,children:y})};export{f as ContentMenu};
@@ -1,52 +0,0 @@
1
- import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{shape as n}from"../../atoms/style/index.js";import{SkeletonBase as r}from"../Skeleton/SkeletonBase/SkeletonBase.js";import i from"styled-components";const a=i.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: ${t.small};
5
- `,o=i.button`
6
- display: flex;
7
- align-items: center;
8
- gap: ${t.xx_small};
9
- color: ${e.text.static_icons__default.rgba};
10
- border: none;
11
- border-radius: ${n.corners.borderRadius};
12
- min-width: 150px;
13
- width: fit-content;
14
- padding: ${t.medium_small} ${t.medium};
15
- text-align: left;
16
- background: ${t=>t.$active?e.interactive.primary__hover_alt.rgba:`none`};
17
- transition: background 150ms;
18
- &:hover {
19
- background: ${e.interactive.primary__hover_alt.rgba};
20
- cursor: pointer;
21
- }
22
- font-family: 'Equinor', sans-serif;
23
- font-weight: 700;
24
- font-size: 14px;
25
- `,s=i.button`
26
- display: flex;
27
- align-items: center;
28
- gap: ${t.xx_small};
29
- color: ${e.text.static_icons__default.rgba};
30
- border: none;
31
- margin-left: ${t.medium_small};
32
- border-radius: ${n.corners.borderRadius};
33
- min-width: calc(150px - ${t.medium_small});
34
- width: fit-content;
35
- padding: ${t.medium_small} ${t.medium};
36
- text-align: left;
37
- background: ${t=>t.$active?e.interactive.primary__hover_alt.rgba:`none`};
38
- transition: background 400ms;
39
- &:hover {
40
- background: ${e.interactive.primary__hover_alt.rgba};
41
- cursor: pointer;
42
- }
43
- font-family: 'Equinor', sans-serif;
44
- font-weight: 700;
45
- font-size: 14px;
46
- `,c=i(r)`
47
- border: none;
48
- border-radius: ${n.corners.borderRadius};
49
- width: 150px;
50
- height: 1rem;
51
- padding: ${t.medium_small} 0;
52
- `;export{a as Container,s as ContentMenuChildItem,o as ContentMenuItem,c as ContentMenuItemSkeleton};
@@ -1,10 +0,0 @@
1
- import { SieveOption } from "./Sieve.types.js";
2
- import { FC } from "react";
3
-
4
- //#region src/molecules/Sieve/Filter.d.ts
5
- interface SieveFilterGroup {
6
- label: string;
7
- options: SieveOption[];
8
- }
9
- //#endregion
10
- export { SieveFilterGroup };
@@ -1 +0,0 @@
1
- import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{useOutsideClick as t}from"../../node_modules/@equinor/eds-utils/dist/esm/hooks/useOutsideClick.js";import{Chip as n,MenuItem as r}from"./Sieve.styles.js";import{useRef as i,useState as a}from"react";import{Icon as o,Menu as s}from"@equinor/eds-core-react";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{arrow_drop_right as d,checkbox as f,checkbox_outline as p,filter_list as m}from"@equinor/eds-icons";const{colors:h}=e,g=({options:e,filterValues:g,setFilterValues:_})=>{let v=i(null),[y,b]=a(null),x=i(null),S=i(null),[C,w]=a(-1),[T,E]=a(!1);t(v.current,e=>{y===null&&T&&x.current&&!x.current.contains(e.target)?E(!1):T&&y!==null&&x.current&&!x.current.contains(e.target)&&S.current&&!S.current.contains(e.target)&&(E(!1),w(-1),b(null))});let D=()=>{E(!T),w(-1),b(null)},O=(e,t)=>{C===t?(w(-1),b(null)):(w(t),b(e.currentTarget))},k=(e,t)=>{let n={...g};if(e in n&&n[e].some(e=>e.value===t.value)){let r=n[e].findIndex(e=>e.value===t.value);n[e].splice(r,1),n[e].length===0&&delete n[e]}else n[e]?n[e].push(t):n[e]=[t];Object.keys(n).flatMap(e=>n?.[e]).length===0&&(n=void 0),_(n)};return e.length===0?null:u(c,{children:[u(n,{ref:v,onClick:D,children:[`Filter by `,l(o,{data:m})]}),T&&l(s,{open:!0,ref:x,anchorEl:v.current,placement:`bottom-start`,children:l(s.Section,{title:`Filter by`,children:e.map((e,t)=>u(r,{active:C===t,onClick:e=>O(e,t),children:[e.label,l(o,{data:d,color:h.text.static_icons__tertiary.rgba})]},`filter-menu-item-${e.label}`))})}),C!==-1&&l(s,{open:!0,anchorEl:y,ref:S,placement:`right-start`,children:l(s.Section,{title:e[C].label,children:e[C]?.options.map(t=>u(r,{onClick:()=>k(e[C].label,t),children:[t.label,l(o,{data:g?.[e[C].label]?.some(e=>e.value===t.value)?f:p,color:h.interactive.primary__resting.rgba})]},`filter-option-${t.label}`))})})]})};export{g as default};
@@ -1,7 +0,0 @@
1
- import { SieveProps } from "./Sieve.types.js";
2
- import { FC } from "react";
3
-
4
- //#region src/molecules/Sieve/Sieve.d.ts
5
- declare const Sieve: FC<SieveProps>;
6
- //#endregion
7
- export { Sieve };
@@ -1 +0,0 @@
1
- import{Container as e,FilterChip as t,Search as n,Wrapper as r}from"./Sieve.styles.js";import i from"./Filter.js";import a from"./Sort.js";import{useCallback as o,useEffect as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{debounce as f}from"lodash";import{useSearchParams as p}from"react-router-dom";const m=({searchPlaceholder:m,sortOptions:h,filterOptions:g,sieveValue:_,onUpdate:v,showChips:y=!0,minSearchWidth:b=`24rem`,syncWithSearchParams:x=!1,isLoadingOptions:S=!1,debounceSearchValue:C=!1,onIsTyping:w})=>{let[T,E]=l(_.searchValue??``),D=c(!1),[O,k]=p(),A=c(!1);s(()=>{if(!A.current&&x&&!S){let e=O.get(`search`)??void 0,t=g?.map(e=>e.label)??[],n={};for(let e of t){let t=g?.find(t=>t.label===e)?.options,r=JSON.parse(O.get(e.toLowerCase())??`[]`);t!==void 0&&(n[e]=t.filter(e=>r.includes(e.label)))}v({searchValue:e,filterValues:n,sortValue:_.sortValue}),A.current=!0}},[g,A,S,v,O,_.sortValue,x]);let j=c(`{}`);s(()=>{if(x&&A.current&&!S&&JSON.stringify(_)!==j.current){_.searchValue===void 0?O.delete(`search`):O.set(`search`,_.searchValue);let e=g?.map(e=>e.label)??[],t=_.filterValues;for(let n of e)t?.[n]&&t[n].length>0?O.set(n.toLowerCase(),JSON.stringify(t[n].map(e=>e.label))):O.delete(n.toLowerCase());j.current=JSON.stringify(_),k(O),v(_)}},[g,A,S,v,O,k,_,x]);let M=o((e,t)=>{let n={..._,[e]:t};v(n)},[v,_]),N=o(f((e,t)=>{M(e,t),w?.(!1),D.current=!1},800),[M,w]),P=(e,t)=>{let n={..._.filterValues},r=n[e].findIndex(e=>e.value===t.value);n[e].splice(r,1),n[e].length===0&&delete n[e],Object.keys(n).flatMap(e=>n?.[e]).length===0&&(n=void 0),M(`filterValues`,n)},F=()=>{M(`filterValues`,void 0)},I=e=>{C?(E(e.target.value),e.target.value===``?(N.cancel(),M(`searchValue`,void 0),w?.(!1),D.current=!1):(N(`searchValue`,e.target.value),D.current||=(w?.(!0),!0))):M(`searchValue`,e.target.value===``?void 0:e.target.value)};return d(r,{className:`sieve-container`,children:[d(e,{children:[u(n,{style:{minWidth:b},placeholder:m,value:C?T:_.searchValue??``,onChange:I}),h!==void 0&&u(a,{options:h,selectedOption:_.sortValue,setSelectedOption:e=>M(`sortValue`,e)}),g!==void 0&&u(i,{options:g,filterValues:_.filterValues,setFilterValues:e=>M(`filterValues`,e)})]}),y&&d(e,{children:[Object.keys(_.filterValues??{}).map(e=>_.filterValues?.[e].map(n=>u(t,{onDelete:()=>P(e,n),children:n?.label},`filter-chip-${n?.value}`))),_.filterValues&&Object.keys(_.filterValues).flatMap(e=>_.filterValues?.[e]).length>1&&u(t,{onDelete:F,children:`Remove all`})]})]})};export{m as Sieve};
@@ -1,43 +0,0 @@
1
- import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{Chip as n,Menu as r,Search as i}from"@equinor/eds-core-react";import a from"styled-components";const o=a.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: ${t.medium};
5
- `,s=a.div`
6
- display: flex;
7
- gap: ${t.medium};
8
- align-items: center;
9
- `,c=a(n)`
10
- color: ${e.text.static_icons__default.rgba};
11
- background: ${e.ui.background__light.rgba};
12
- border: 1px solid ${e.ui.background__medium.rgba};
13
- line-height: normal;
14
- transition: background 0.15s ease-in;
15
-
16
- svg {
17
- z-index: auto;
18
- fill: ${e.text.static_icons__default.rgba};
19
- }
20
- `,l=a(i)`
21
- > div {
22
- box-shadow: none;
23
- outline: none !important;
24
- background: ${e.ui.background__default.rgba};
25
- > input {
26
- color: ${e.text.static_icons__default.rgba};
27
- box-shadow: inset 0 -1px 0 0 ${e.text.static_icons__tertiary.rgba};
28
- &:hover {
29
- box-shadow: inset 0 -2px 0 0 ${e.text.static_icons__tertiary.rgba};
30
- }
31
- &:focus {
32
- box-shadow: inset 0 -2px 0 0 ${e.interactive.primary__resting.rgba};
33
- }
34
- }
35
- }
36
- `,u=a(r.Item)`
37
- outline: none !important;
38
- > div {
39
- grid-template-columns: 1fr auto;
40
- }
41
- `,d=a(n)`
42
- background: none;
43
- `;export{d as Chip,s as Container,c as FilterChip,u as MenuItem,l as Search,o as Wrapper};
@@ -1,28 +0,0 @@
1
- import { SieveFilterGroup } from "./Filter.js";
2
-
3
- //#region src/molecules/Sieve/Sieve.types.d.ts
4
- interface SieveOption {
5
- label: string;
6
- value: string;
7
- }
8
- type FilterValues = Record<string, SieveOption[]>;
9
- interface SieveValue {
10
- searchValue: string | undefined;
11
- sortValue: SieveOption | undefined;
12
- filterValues: FilterValues | undefined;
13
- }
14
- interface SieveProps {
15
- searchPlaceholder: string;
16
- sortOptions?: SieveOption[];
17
- filterOptions?: SieveFilterGroup[];
18
- sieveValue: SieveValue;
19
- onUpdate: (value: SieveValue) => void;
20
- showChips?: boolean;
21
- minSearchWidth?: string;
22
- syncWithSearchParams?: boolean;
23
- isLoadingOptions?: boolean;
24
- debounceSearchValue?: boolean;
25
- onIsTyping?: (value: boolean) => void;
26
- }
27
- //#endregion
28
- export { type FilterValues, type SieveOption, type SieveProps, type SieveValue };
@@ -1 +0,0 @@
1
- import{colors as e}from"../../atoms/style/colors.js";import{Chip as t,MenuItem as n}from"./Sieve.styles.js";import{useRef as r,useState as i}from"react";import{Icon as a,Menu as o}from"@equinor/eds-core-react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{radio_button_selected as u,radio_button_unselected as d,sort as f}from"@equinor/eds-icons";const p=({options:p,selectedOption:m,setSelectedOption:h})=>{let g=r(null),[_,v]=i(!1),y=()=>{v(!_)},b=()=>{v(!1)},x=e=>{h(e)};return p.length===0?null:l(s,{children:[l(t,{ref:g,onClick:y,children:[`Sort by `,c(a,{data:f})]}),_&&c(o,{open:!0,anchorEl:g.current,onClose:b,placement:`bottom-start`,children:c(o.Section,{title:`Sort by`,children:p.map(t=>l(n,{onClick:()=>x(t),children:[t.label,c(a,{data:m?.value===t.value?u:d,color:e.interactive.primary__resting.rgba})]},`sort-item-${t.value}`))})})]})};export{p as default};
@@ -1,15 +0,0 @@
1
- import { FC } from "react";
2
- import { IconData } from "@equinor/eds-icons";
3
-
4
- //#region src/molecules/SingleFilterMenu/SingleFilterMenu.d.ts
5
- interface SingleFilterMenuProps {
6
- onChange: (selectedId: string | undefined | null) => void;
7
- customIcon?: IconData;
8
- menuTitle: string;
9
- data: string[];
10
- showChip?: boolean;
11
- chipColor?: string;
12
- }
13
- declare const SingleFilterMenu: FC<SingleFilterMenuProps>;
14
- //#endregion
15
- export { SingleFilterMenu, SingleFilterMenuProps };
@@ -1,20 +0,0 @@
1
- import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{spacings as t}from"../../atoms/style/spacings.js";import n,{useState as r}from"react";import{Button as i,Chip as a,Icon as o,Menu as s,Typography as c}from"@equinor/eds-core-react";import l from"styled-components";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{filter_list as f}from"@equinor/eds-icons";const{colors:p}=e,m=l.div`
2
- margin-left: auto;
3
- display: flex;
4
- align-items: center;
5
- gap: 25px;
6
- `,h=l(a)`
7
- background: ${e=>e.$backgroundColor};
8
- `,g=l(i)`
9
- justify-self: flex-end;
10
- `,_=l(s)`
11
- overflow-y: auto;
12
- `,v=l.div`
13
- padding: ${t.medium};
14
- padding-left: ${t.large};
15
- `,y=l(s.Item)`
16
- &:focus {
17
- outline: none;
18
- background: ${p.ui.background__light.rgba};
19
- }
20
- `,b=({onChange:e,customIcon:t,menuTitle:n,data:i,showChip:a=!1,chipColor:s=p.ui.background__default.rgba})=>{let[l,b]=r(!1),[x,S]=r(null),[C,w]=r(),T=e=>{let t=e.target;S(t),b(!l)},E=()=>b(!1),D=t=>{b(!1),C===t?(w(void 0),e(void 0)):(w(t),e(t))},O=()=>{E(),e(void 0),w(void 0)};return d(m,{children:[a&&C&&u(h,{"data-testid":`chip`,onDelete:O,variant:`default`,$backgroundColor:s,children:C}),u(g,{"data-testid":`menuButton`,variant:`ghost_icon`,onClick:e=>T(e),children:u(o,{data:t??f})}),d(_,{open:l,anchorEl:x,onClose:E,placement:`bottom-end`,"data-testid":`menuContainer`,children:[u(v,{children:u(c,{group:`navigation`,variant:`label`,children:n})}),i.map((e,t)=>u(y,{onClick:()=>D(e),disabled:C===e&&a,active:C===e&&!a,children:u(c,{group:`navigation`,variant:`menu_title`,as:`span`,children:e})},e+t))]})]})};b.displayName=`SingleFilterMenu`;export{b as SingleFilterMenu};
@@ -1 +0,0 @@
1
- import{EnvironmentType as e}from"../../../../atoms/enums/Environment.js";function t(t,n){return t&&t!==e.PRODUCTION?`https://client-subsurfappmanagement-frontend-${t}.radix.equinor.com/release-notes?filters={"applications"%3A["${encodeURIComponent(n)}"]}`:`https://subsurfappmanagement.equinor.com/release-notes?filters={"applications"%3A["${encodeURIComponent(n)}"]}`}export{t as environmentAndAppNameToURL};