@equinor/amplify-component-lib 10.2.0 → 10.4.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 (96) hide show
  1. package/dist/atoms/hooks/useFaqsInApplication.d.ts +23 -1
  2. package/dist/atoms/hooks/useFaqsInApplication.js +1 -1
  3. package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
  4. package/dist/atoms/hooks/useSelect.d.ts +3 -3
  5. package/dist/atoms/index.d.ts +1 -0
  6. package/dist/atoms/index.js +1 -1
  7. package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
  8. package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.js +1 -1
  9. package/dist/deprecated/IconToggleButton.d.ts +2 -2
  10. package/dist/index.d.ts +4 -1
  11. package/dist/index.js +1 -1
  12. package/dist/molecules/Chip/Chip.d.ts +2 -2
  13. package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
  14. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  15. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  16. package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
  17. package/dist/molecules/IconCell/IconCell.d.ts +2 -2
  18. package/dist/molecules/ListItem/ListItem.d.ts +2 -2
  19. package/dist/molecules/OptionDrawer/OptionDrawer.d.ts +2 -2
  20. package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
  21. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  22. package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +5 -5
  23. package/dist/molecules/Search/Search.d.ts +2 -2
  24. package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
  25. package/dist/molecules/Select/Select.styles.d.ts +4 -4
  26. package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
  27. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
  28. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.js +3 -4
  29. package/dist/molecules/TableHeader/TableHeader.d.ts +32 -0
  30. package/dist/molecules/TableHeader/TableHeader.js +1 -0
  31. package/dist/molecules/TableHeader/TableHeader.styles.js +48 -0
  32. package/dist/molecules/TableHeader/TableHeader.utils.js +1 -0
  33. package/dist/molecules/Tabs/Tab.styles.js +1 -1
  34. package/dist/molecules/Toast/Toast.d.ts +30 -0
  35. package/dist/molecules/Toast/Toast.js +1 -0
  36. package/dist/molecules/Toast/Toast.styles.js +117 -0
  37. package/dist/molecules/Toast/Toast.utils.js +1 -0
  38. package/dist/molecules/Waves/Waves.styles.js +1 -1
  39. package/dist/molecules/index.d.ts +2 -0
  40. package/dist/molecules/index.js +1 -1
  41. package/dist/organisms/Faq/AppPageWrapper.js +8 -0
  42. package/dist/organisms/Faq/Category/Category.js +1 -9
  43. package/dist/organisms/Faq/Category/Category.styles.js +14 -0
  44. package/dist/organisms/Faq/Category/CategorySkeleton.js +17 -0
  45. package/dist/organisms/Faq/Category/Question/Question.js +1 -0
  46. package/dist/organisms/Faq/Category/Question/Question.styles.js +64 -0
  47. package/dist/organisms/Faq/Category/Subcategory.js +34 -0
  48. package/dist/organisms/Faq/Faq.d.ts +5 -1
  49. package/dist/organisms/Faq/Faq.js +20 -1
  50. package/dist/organisms/Faq/Faq.utils.js +1 -0
  51. package/dist/organisms/Faq/Search.js +5 -0
  52. package/dist/organisms/Filter/Filter.d.ts +2 -2
  53. package/dist/organisms/Filter/Filter.js +1 -1
  54. package/dist/organisms/Filter/Filter.styles.js +1 -1
  55. package/dist/organisms/Filter/SortMenu.d.ts +2 -2
  56. package/dist/organisms/ReleaseNote/ReleaseNote.d.ts +3 -3
  57. package/dist/organisms/ReleaseNote/ReleaseNote.js +1 -1
  58. package/dist/organisms/SideBar/SideBar.d.ts +2 -2
  59. package/dist/organisms/Status/Action.d.ts +2 -2
  60. package/dist/organisms/Status/Description.d.ts +2 -2
  61. package/dist/organisms/Status/Illustration.js +1 -1
  62. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  63. package/dist/organisms/Status/Title.d.ts +2 -2
  64. package/dist/organisms/Status/collections/BadRequest.d.ts +2 -2
  65. package/dist/organisms/Status/collections/GenericError.d.ts +2 -2
  66. package/dist/organisms/Status/collections/MissingPermissions.d.ts +2 -2
  67. package/dist/organisms/Status/collections/PageNotFound.d.ts +2 -2
  68. package/dist/organisms/Status/collections/ServerError.d.ts +2 -2
  69. package/dist/organisms/TableOfContents/TableOfContents.styles.js +1 -3
  70. package/dist/organisms/TableOfContents/TableOfContentsItem.js +1 -1
  71. package/dist/organisms/Template/Template.d.ts +3 -3
  72. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  73. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  74. package/dist/organisms/TopBar/Actions.d.ts +2 -2
  75. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -3
  76. package/dist/organisms/TopBar/FieldMenu/FieldMenu.js +1 -1
  77. package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
  78. package/dist/organisms/TopBar/Resources/Feedback/Feedback.js +1 -1
  79. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/AnimateChangeInHeight.js +1 -1
  80. package/dist/organisms/TopBar/Resources/Feedback/ResponsePage/ResponsePage.js +1 -1
  81. package/dist/organisms/TopBar/Resources/Feedback/providers/FeedbackContextProvider.js +1 -1
  82. package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.js +1 -1
  83. package/dist/organisms/TopBar/TopBar.d.ts +0 -2
  84. package/dist/organisms/TopBar/TopBar.js +1 -1
  85. package/dist/organisms/TopBar/TopBarInternalContextProvider.js +1 -0
  86. package/dist/providers/ToastProvider/ToastProvider.d.ts +15 -0
  87. package/dist/providers/ToastProvider/ToastProvider.js +8 -0
  88. package/dist/providers/TutorialHighlightingProvider/TutorialHighlightingProviderInner.js +1 -1
  89. package/dist/providers/TutorialHighlightingProvider/TutorialPopover/TutorialPopover.js +1 -1
  90. package/dist/providers/TutorialHighlightingProvider/TutorialPopover/hooks/useTutorialPopoverPosition.js +1 -1
  91. package/dist/providers/TutorialHighlightingProvider/hooks/useReversedScrollY.js +1 -1
  92. package/package.json +11 -11
  93. package/dist/organisms/Faq/Category/Question.js +0 -22
  94. package/dist/organisms/Faq/CategorySkeleton.js +0 -29
  95. package/dist/organisms/Faq/Faq.styles.js +0 -8
  96. package/dist/organisms/Faq/Header.js +0 -14
@@ -1,9 +1,9 @@
1
- import * as react128 from "react";
1
+ import * as react125 from "react";
2
2
 
3
3
  //#region src/organisms/Status/Title.d.ts
4
4
  interface TitleProps {
5
5
  title?: string;
6
6
  }
7
- declare const Title: react128.ForwardRefExoticComponent<TitleProps & react128.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Title: react125.ForwardRefExoticComponent<TitleProps & react125.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Title };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/BadRequest.d.ts
4
4
  interface BadRequestProps {
@@ -12,6 +12,6 @@ declare const BadRequest: ({
12
12
  redirectFallbackUrl,
13
13
  onBackClick,
14
14
  hideBackButton
15
- }: BadRequestProps) => react_jsx_runtime10.JSX.Element;
15
+ }: BadRequestProps) => react_jsx_runtime8.JSX.Element;
16
16
  //#endregion
17
17
  export { BadRequest };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/GenericError.d.ts
4
4
  interface GenericErrorProps {
@@ -14,6 +14,6 @@ declare const GenericError: ({
14
14
  redirectFallbackUrl,
15
15
  onBackClick,
16
16
  hideBackButton
17
- }: GenericErrorProps) => react_jsx_runtime11.JSX.Element;
17
+ }: GenericErrorProps) => react_jsx_runtime10.JSX.Element;
18
18
  //#endregion
19
19
  export { GenericError };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/MissingPermissions.d.ts
4
4
  interface MissingPermissionsProps {
@@ -14,6 +14,6 @@ declare const MissingPermissions: ({
14
14
  redirectFallbackUrl,
15
15
  onBackClick,
16
16
  hideBackButton
17
- }: MissingPermissionsProps) => react_jsx_runtime8.JSX.Element;
17
+ }: MissingPermissionsProps) => react_jsx_runtime7.JSX.Element;
18
18
  //#endregion
19
19
  export { MissingPermissions };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/PageNotFound.d.ts
4
4
  interface PageNotFoundProps {
@@ -12,6 +12,6 @@ declare const PageNotFound: ({
12
12
  redirectFallbackUrl,
13
13
  onBackClick,
14
14
  hideBackButton
15
- }: PageNotFoundProps) => react_jsx_runtime7.JSX.Element;
15
+ }: PageNotFoundProps) => react_jsx_runtime9.JSX.Element;
16
16
  //#endregion
17
17
  export { PageNotFound };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/ServerError.d.ts
4
4
  interface ServerErrorProps {
@@ -12,6 +12,6 @@ declare const ServerError: ({
12
12
  redirectFallbackUrl,
13
13
  onBackClick,
14
14
  hideBackButton
15
- }: ServerErrorProps) => react_jsx_runtime9.JSX.Element;
15
+ }: ServerErrorProps) => react_jsx_runtime11.JSX.Element;
16
16
  //#endregion
17
17
  export { ServerError };
@@ -1,4 +1,4 @@
1
- import{animation as e}from"../../atoms/style/animation.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{VERTICAL_ITEM_HEIGHT as r}from"./TableOfContents.constants.js";import i,{css as a}from"styled-components";import{motion as o}from"framer-motion";const s=i.button`
1
+ import{animation as e}from"../../atoms/style/animation.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{VERTICAL_ITEM_HEIGHT as r}from"./TableOfContents.constants.js";import i,{css as a}from"styled-components";import{motion as o}from"motion/react";const s=i.button`
2
2
  &:hover {
3
3
  background: ${t.interactive.primary__hover_alt.rgba};
4
4
  }
@@ -19,8 +19,6 @@ import{animation as e}from"../../atoms/style/animation.js";import{colors as t}fr
19
19
  min-height: ${r};
20
20
  transition: background 200ms;
21
21
  > span {
22
- display: flex;
23
- flex-direction: column;
24
22
  position: relative;
25
23
  text-align: left;
26
24
  font-family: 'Equinor', sans-serif;
@@ -1 +1 @@
1
- import{useTableOfContents as e}from"../../providers/TableOfContentsProvider.js";import{Badge as t}from"../../molecules/Badge/Badge.js";import{Button as n,ChildContainer as r,TableOfContentsItemContainer as i}from"./TableOfContents.styles.js";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{AnimatePresence as c}from"framer-motion";const l=({label:u,value:d,count:f,disabled:p=!1,children:m,onlyShowSelectedChildren:h})=>{let{isActive:g,selected:_,setSelected:v}=e(),y=a(()=>g({label:u,value:d,children:m})&&!p,[m,p,g,u,d]);return s(i,{layoutScroll:!0,layoutRoot:!0,children:[s(n,{$active:_===d,onClick:()=>{!p&&_!==d&&v(d)},disabled:p,children:[o(`span`,{title:u,children:u}),f!==void 0&&o(t,{variant:p?`empty`:`light`,value:f})]}),o(c,{children:m&&(h&&y||!h)&&o(r,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.4},children:m.map(e=>o(l,{onlyShowSelectedChildren:h,...e},e.value))})})]})};export{l as TableOfContentsItem};
1
+ import{useTableOfContents as e}from"../../providers/TableOfContentsProvider.js";import{Badge as t}from"../../molecules/Badge/Badge.js";import{Button as n,ChildContainer as r,TableOfContentsItemContainer as i}from"./TableOfContents.styles.js";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{AnimatePresence as c}from"motion/react";const l=({label:u,value:d,count:f,disabled:p=!1,children:m,onlyShowSelectedChildren:h})=>{let{isActive:g,selected:_,setSelected:v}=e(),y=a(()=>g({label:u,value:d,children:m})&&!p,[m,p,g,u,d]);return s(i,{layoutScroll:!0,layoutRoot:!0,children:[s(n,{$active:_===d,onClick:()=>{!p&&_!==d&&v(d)},disabled:p,children:[o(`span`,{title:u,children:u}),f!==void 0&&o(t,{variant:p?`empty`:`light`,value:f})]}),o(c,{children:m&&(h&&y||!h)&&o(r,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.4},children:m.map(e=>o(l,{onlyShowSelectedChildren:h,...e},e.value))})})]})};export{l as TableOfContentsItem};
@@ -1,4 +1,4 @@
1
- import * as react98 from "react";
1
+ import * as react100 from "react";
2
2
  import * as styled_components11 from "styled-components";
3
3
  import { IStyledComponent } from "styled-components";
4
4
  import * as styled_components_dist_types39 from "styled-components/dist/types";
@@ -7,8 +7,8 @@ import * as styled_components_dist_types39 from "styled-components/dist/types";
7
7
  interface ContentProps {
8
8
  $open: boolean;
9
9
  }
10
- declare const Content: styled_components_dist_types39.IStyledComponentBase<"web", styled_components_dist_types39.Substitute<react98.DetailedHTMLProps<react98.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContentProps>> & string;
11
- declare const GlobalStyles: react98.NamedExoticComponent<styled_components11.ExecutionProps & object>;
10
+ declare const Content: styled_components_dist_types39.IStyledComponentBase<"web", styled_components_dist_types39.Substitute<react100.DetailedHTMLProps<react100.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContentProps>> & string;
11
+ declare const GlobalStyles: react100.NamedExoticComponent<styled_components11.ExecutionProps & object>;
12
12
  type TemplateType = IStyledComponent<'web', any> & {
13
13
  Container: IStyledComponent<'web', any>;
14
14
  Content: typeof Content;
@@ -1,7 +1,7 @@
1
1
  import { ToggleGroup } from "./ToggleGroup.types.js";
2
- import * as react138 from "react";
2
+ import * as react133 from "react";
3
3
 
4
4
  //#region src/organisms/ToggleGroup/ToggleGroup.d.ts
5
- declare const ToggleGroup$1: react138.ForwardRefExoticComponent<ToggleGroup & react138.RefAttributes<HTMLDivElement>>;
5
+ declare const ToggleGroup$1: react133.ForwardRefExoticComponent<ToggleGroup & react133.RefAttributes<HTMLDivElement>>;
6
6
  //#endregion
7
7
  export { ToggleGroup$1 as ToggleGroup };
@@ -1,9 +1,9 @@
1
1
  import { ToggleGroupOption } from "./ToggleGroup.types.js";
2
- import * as react136 from "react";
2
+ import * as react131 from "react";
3
3
  import { HTMLAttributes } from "react";
4
4
 
5
5
  //#region src/organisms/ToggleGroup/ToggleGroupOption.d.ts
6
6
  type ToggleGroupOptionProps = ToggleGroupOption & Omit<HTMLAttributes<HTMLButtonElement>, 'onToggle' | 'disabled'>;
7
- declare const ToggleGroupOption$1: react136.ForwardRefExoticComponent<ToggleGroupOptionProps & react136.RefAttributes<HTMLButtonElement>>;
7
+ declare const ToggleGroupOption$1: react131.ForwardRefExoticComponent<ToggleGroupOptionProps & react131.RefAttributes<HTMLButtonElement>>;
8
8
  //#endregion
9
9
  export { ToggleGroupOption$1 as ToggleGroupOption };
@@ -1,7 +1,7 @@
1
- import * as react119 from "react";
1
+ import * as react121 from "react";
2
2
  import { HTMLAttributes } from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/Actions.d.ts
5
- declare const Actions: react119.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react119.RefAttributes<HTMLDivElement>>;
5
+ declare const Actions: react121.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react121.RefAttributes<HTMLDivElement>>;
6
6
  //#endregion
7
7
  export { Actions };
@@ -1,14 +1,13 @@
1
1
  import { Field } from "../../../atoms/types/Field.js";
2
- import * as react117 from "react";
2
+ import * as react119 from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/FieldMenu/FieldMenu.d.ts
5
5
  interface FieldMenuProps {
6
- currentField?: Field;
7
6
  availableFields: Field[];
8
7
  onSelect: (selectedField: Field) => void;
9
8
  itemNameSingular?: string;
10
9
  showAccessITLink?: boolean;
11
10
  }
12
- declare const FieldMenu: react117.ForwardRefExoticComponent<FieldMenuProps & react117.RefAttributes<HTMLDivElement>>;
11
+ declare const FieldMenu: react119.ForwardRefExoticComponent<FieldMenuProps & react119.RefAttributes<HTMLDivElement>>;
13
12
  //#endregion
14
13
  export { FieldMenu };
@@ -1 +1 @@
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{TopBarMenu as n}from"../TopBarMenu.js";import{TopBarButton as r}from"../TopBar.styles.js";import{ListContainer as i,MenuFixedItem as a,MenuItem as o,MenuSection as s,NoFieldsText as c,NoSearchResultsContainer as l,SearchContainer as u,TextContainer as d}from"./FieldMenu.styles.js";import{forwardRef as f,useMemo as p,useRef as m,useState as h}from"react";import{Icon as g,Search as _,Typography as v}from"@equinor/eds-core-react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{arrow_drop_down as x,arrow_drop_up as S,check as C,exit_to_app as w,platform as T}from"@equinor/eds-icons";const{colors:E}=e,D=f(({currentField:e,availableFields:f,onSelect:D,itemNameSingular:O=`field`,showAccessITLink:k=!0},A)=>{let[j,M]=h(!1),N=m(null),P=m(null),[F,I]=h(``),L=()=>M(!1),R=()=>M(!j),z=e=>{I(e.target.value)};t(N.current,e=>{P.current!==e.target&&M(!1)});let B=p(()=>F===``?f.filter(t=>t.name?.toLowerCase()!==e?.name?.toLowerCase()):f.filter(e=>e.name?.toLowerCase().includes(F.toLowerCase())),[f,F,e]),V=p(()=>B.length===0&&f.length>1,[f.length,B.length]),H=p(()=>{if(e?.name)return e?.name?.charAt(0).toUpperCase()+e?.name?.slice(1)},[e?.name]),U=p(()=>B.length>=4||F!==``,[B,F]);return e===void 0?null:b(`div`,{ref:A,children:[b(r,{variant:`ghost`,ref:P,onClick:R,"data-testid":`field-selector-top-bar-button`,$fieldSelector:!0,children:[y(g,{data:T,size:24}),H,y(g,{data:j?S:x})]}),y(n,{open:j,title:`Field Selection`,onClose:L,anchorEl:P.current,contentPadding:!1,ref:N,children:b(`section`,{children:[b(s,{children:[U&&y(u,{children:y(_,{autoFocus:!0,placeholder:`Search fields`,value:F,onChange:z})}),b(i,{children:[e&&!V&&F===``&&y(a,{$active:!0,children:b(`div`,{children:[y(d,{children:y(v,{variant:`h6`,children:e.name?.toLowerCase()})}),y(g,{data:C,color:E.interactive.primary__resting.rgba,size:24})]})}),V?y(l,{children:b(c,{variant:`body_short`,color:E.text.static_icons__tertiary.rgba,children:[`No `,O,`s matching your search`]})}):B.map(e=>y(o,{onClick:()=>{D(e),L()},children:y(d,{children:y(v,{variant:`h6`,children:e.name?.toLowerCase()})})},e.uuid))]})]}),k&&!V&&y(a,{"data-testid":`access-it-link`,onClick:()=>window.open(`https://accessit.equinor.com/#`,`_blank`),children:b(`div`,{children:[b(d,{children:[b(v,{variant:`overline`,children:[`Missing a `,O,`?`]}),y(v,{variant:`h6`,children:`Go to AccessIT`})]}),y(g,{data:w,color:E.interactive.primary__resting.rgba,size:24})]})})]})})]})});D.displayName=`FieldSelector`;export{D as FieldMenu};
1
+ import{tokens as e}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{TopBarMenu as t}from"../TopBarMenu.js";import{TopBarButton as n}from"../TopBar.styles.js";import{ListContainer as r,MenuFixedItem as i,MenuItem as a,MenuSection as o,NoFieldsText as s,NoSearchResultsContainer as c,SearchContainer as l,TextContainer as u}from"./FieldMenu.styles.js";import{useTopBarInternalContext as d}from"../TopBarInternalContextProvider.js";import{forwardRef as f,useMemo as p,useRef as m,useState as h}from"react";import{Icon as g,Search as _,Typography as v}from"@equinor/eds-core-react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{arrow_drop_down as x,arrow_drop_up as S,check as C,exit_to_app as w,platform as T}from"@equinor/eds-icons";const{colors:E}=e,D=f(({availableFields:e,onSelect:f,itemNameSingular:D=`field`,showAccessITLink:O=!0},k)=>{let{selectedField:A}=d(),[j,M]=h(!1),N=m(null),[P,F]=h(``),I=()=>M(!1),L=()=>M(!j),R=p(()=>P===``?e.filter(e=>e.name?.toLowerCase()!==A?.name?.toLowerCase()):e.filter(e=>e.name?.toLowerCase().includes(P.toLowerCase())),[e,P,A]),z=R.length===0,B=p(()=>{if(A?.name)return A.name.charAt(0).toUpperCase()+A.name.slice(1)},[A?.name]),V=e=>{F(e.target.value)},H=e.length>=4;return A?b(`div`,{ref:k,children:[b(n,{variant:`ghost`,ref:N,onClick:L,"data-testid":`field-selector-top-bar-button`,$fieldSelector:!0,children:[y(g,{data:T,size:24}),B,y(g,{data:j?S:x})]}),y(t,{open:j,title:`Field Selection`,onClose:I,anchorEl:N.current,contentPadding:!1,children:b(`section`,{children:[b(o,{children:[H&&y(l,{children:y(_,{autoFocus:!0,placeholder:`Search fields`,value:P,onChange:V})}),b(r,{children:[!z&&P===``&&y(i,{$active:!0,children:b(`div`,{children:[y(u,{children:y(v,{variant:`h6`,children:A.name?.toLowerCase()})}),y(g,{data:C,color:E.interactive.primary__resting.rgba,size:24})]})}),z?y(c,{children:b(s,{variant:`body_short`,color:E.text.static_icons__tertiary.rgba,children:[`No `,D,`s matching your search`]})}):R.map(e=>y(a,{onClick:()=>{f(e),I()},children:y(u,{children:y(v,{variant:`h6`,children:e.name?.toLowerCase()})})},e.uuid))]})]}),O&&!z&&y(i,{"data-testid":`access-it-link`,onClick:()=>window.open(`https://accessit.equinor.com/#`,`_blank`),children:b(`div`,{children:[b(u,{children:[b(v,{variant:`overline`,children:[`Missing a `,D,`?`]}),y(v,{variant:`h6`,children:`Go to AccessIT`})]}),y(g,{data:w,color:E.interactive.primary__resting.rgba,size:24})]})})]})})]}):null});D.displayName=`FieldSelector`;export{D as FieldMenu};
@@ -1,4 +1,4 @@
1
- import * as react127 from "react";
1
+ import * as react139 from "react";
2
2
  import { Dispatch, FC, ReactNode, SetStateAction } from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/Notifications/NotificationProvider.d.ts
@@ -6,7 +6,7 @@ interface NotificationContext {
6
6
  setIsOpen: Dispatch<SetStateAction<boolean>>;
7
7
  isOpen: boolean;
8
8
  }
9
- declare const NotificationContext: react127.Context<NotificationContext | undefined>;
9
+ declare const NotificationContext: react139.Context<NotificationContext | undefined>;
10
10
  declare const useNotification: () => NotificationContext;
11
11
  //#endregion
12
12
  export { useNotification };
@@ -1 +1 @@
1
- import{FeedbackContextProvider as e}from"./providers/FeedbackContextProvider.js";import{FeedbackInner as t}from"./FeedbackInner.js";import{jsx as n}from"react/jsx-runtime";const r=({field:r,onClose:i,selectedType:a})=>n(e,{field:r,onClose:i,selectedType:a,children:n(t,{})});export{r as Feedback};
1
+ import{FeedbackContextProvider as e}from"./providers/FeedbackContextProvider.js";import{FeedbackInner as t}from"./FeedbackInner.js";import{jsx as n}from"react/jsx-runtime";const r=({onClose:r,selectedType:i})=>n(e,{onClose:r,selectedType:i,children:n(t,{})});export{r as Feedback};
@@ -1,4 +1,4 @@
1
- import{spacings as e}from"../../../../../atoms/style/spacings.js";import{useEffect as t,useRef as n,useState as r}from"react";import i from"styled-components";import{jsx as a}from"react/jsx-runtime";import{motion as o}from"framer-motion";const s=i(o.div)`
1
+ import{spacings as e}from"../../../../../atoms/style/spacings.js";import{useEffect as t,useRef as n,useState as r}from"react";import i from"styled-components";import{jsx as a}from"react/jsx-runtime";import{motion as o}from"motion/react";const s=i(o.div)`
2
2
  display: flex;
3
3
  gap: ${e.large};
4
4
  height: auto;
@@ -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{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)`
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"motion/react";const p=l(f.div)`
2
2
  display: flex;
3
3
  gap: ${e.large};
4
4
  height: auto;
@@ -1 +1 @@
1
- import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{useAuth as t}from"../../../../../providers/AuthProvider/AuthProvider.js";import{useLocalStorage as n}from"../../../../../atoms/hooks/useLocalStorage.js";import{FeedbackType as r,StatusEnum as i}from"../Feedback.types.js";import{DEFAULT_FEEDBACK_LOCAL_STORAGE as a,ONE_HOUR_IN_MS as o}from"../Feedback.const.js";import{createServiceNowDescription as ee,createServiceNowUrl as s,createSlackMessage as c,getUrgencyNumber as l}from"../Feedback.utils.js";import{useServiceNowIncident as u}from"../hooks/useServiceNowIncident.js";import{useSlackFileUpload as d}from"../hooks/useSlackFileUpload.js";import{useSlackPostMessage as te}from"../hooks/useSlackPostMessage.js";import{createContext as f,useCallback as p,useEffect as m,useMemo as h,useState as g}from"react";import{jsx as ne}from"react/jsx-runtime";const{getServiceNowConfigurationItem:re}=e,_=f(void 0),v=({children:e,selectedType:f,onClose:v,field:y})=>{let ie=re(import.meta.env.VITE_SERVICE_NOW_CONFIGURATION_ITEM)||`117499`,{account:b}=t(),x=b?.username,[S,C]=n(f+`-feedbackContentAndRequestStatus`,{...a},o),{feedbackContent:w,serviceNowRequestResponse:T}=S,[E,D]=g([]),[O,k]=g({status:i.idle}),[A,j]=g([]),[M,N]=g(!1),[P,F]=g(!1),{mutateAsync:I,isPending:L}=d(w),{mutateAsync:R,status:z}=te(w),{mutateAsync:B,status:V}=u(w),[H,U]=g(``),[W,G]=g(!1),K=h(()=>z===`pending`||V===`pending`||L,[L,z,V]),q=h(()=>T.status===i.success,[T.status]),J=h(()=>{let e=[O.status,...A.map(e=>e.status)];return e.every(e=>e===i.success)?i.success:e.includes(i.error)?i.partial:i.idle},[A,O.status]),Y=h(()=>J===i.error||J===i.partial,[J]),ae=h(()=>Y||T.status===i.error,[T.status,Y]),X=()=>{N(e=>!e)},Z=({status:e,response:t,error:n})=>{C({...S,serviceNowRequestResponse:{status:e,errorText:n?.message??void 0,serviceNowId:t?.sysId??void 0}})},Q=({status:e,filename:t,error:n})=>{j(r=>{let a=Array.from(r),o=a.find(e=>e.fileName===t);return o&&(o.status=e,o.errorText=e===i.error?n?.message:void 0),a})},$=({status:e,error:t})=>{k({status:e,errorText:t?.message??void 0})},oe=()=>{W?v():X()},se=(e,t)=>{C({...S,feedbackContent:{...w,[e]:t}})},ce=async()=>{X();let e=``;if(f===r.BUG&&x&&T.status!==i.success){let t=new FormData;t.append(`ConfigurationItem`,ie),t.append(`Title`,w.title),t.append(`Description`,ee(w,y)),t.append(`CallerEmail`,x),w.urgency&&t.append(`urgency`,l(w.urgency).toString()),E&&E.length>0&&E.forEach(e=>t.append(`Images`,e));try{let n=await B(t);e=n.sysId,Z({status:i.success,response:n})}catch(e){Z({status:i.error,error:e})}}let t=new FormData;t.append(`comment`,c(w,y,f,x,e));try{await R(t),$({status:i.success})}catch(e){$({status:i.error,error:e})}if(E&&E.length>0)for(let e of E){let t=new FormData;t.append(`comment`,`Title: ${w.title}`),t.append(`file`,e);try{await I(t),Q({status:i.success,filename:e.name})}catch(t){Q({status:i.error,filename:e.name,error:t})}}},le=p(()=>{C(a),D([]),k({status:i.idle}),j([])},[C]);return m(()=>()=>{T.status===i.success&&J===i.success&&setTimeout(()=>{C(a)},1100)},[J,T.status,C]),m(()=>{A.length!==E.length&&j(E.map(e=>({status:i.idle,fileName:e.name})))},[E,A.length]),m(()=>{T.serviceNowId&&T.serviceNowId.length!==0&&U(s(T.serviceNowId,!0))},[T.serviceNowId]),m(()=>{(f===r.SUGGESTION&&J===i.success||T.status===i.success&&J===i.success)&&G(!0)},[J,f,T.status]),ne(_.Provider,{value:{selectedType:f,showResponsePage:M,feedbackAttachments:E,slackAttachmentsRequestResponse:A,slackRequestResponse:O,updateFeedback:se,feedbackContent:w,serviceNowRequestResponse:T,handleResponsePageOnClose:oe,toggleShowResponsePage:X,onDialogClose:v,handleSave:ce,resetForm:le,requestIsLoading:K,serviceNowSuccess:q,isWrongDomain:P,setIsWrongDomain:F,setFeedbackAttachments:D,requestHasError:ae,showAllSlackRequests:Y,allSlackRequestStatus:J,serviceNowUrl:H,relevantRequestsHaveBeenSuccess:W},children:e})};export{_ as FeedbackContext,v as FeedbackContextProvider};
1
+ import{environment as e}from"../../../../../atoms/utils/auth_environment.js";import{useAuth as t}from"../../../../../providers/AuthProvider/AuthProvider.js";import{useLocalStorage as n}from"../../../../../atoms/hooks/useLocalStorage.js";import{useTopBarInternalContext as r}from"../../../TopBarInternalContextProvider.js";import{FeedbackType as i,StatusEnum as a}from"../Feedback.types.js";import{DEFAULT_FEEDBACK_LOCAL_STORAGE as o,ONE_HOUR_IN_MS as ee}from"../Feedback.const.js";import{createServiceNowDescription as te,createServiceNowUrl as s,createSlackMessage as c,getUrgencyNumber as l}from"../Feedback.utils.js";import{useServiceNowIncident as u}from"../hooks/useServiceNowIncident.js";import{useSlackFileUpload as ne}from"../hooks/useSlackFileUpload.js";import{useSlackPostMessage as re}from"../hooks/useSlackPostMessage.js";import{createContext as d,useCallback as f,useEffect as p,useMemo as m,useState as h}from"react";import{jsx as g}from"react/jsx-runtime";const{getServiceNowConfigurationItem:ie}=e,_=d(void 0),v=({children:e,selectedType:d,onClose:v})=>{let{selectedField:y}=r(),b=ie(import.meta.env.VITE_SERVICE_NOW_CONFIGURATION_ITEM)||`117499`,{account:ae}=t(),x=ae?.username,[S,C]=n(d+`-feedbackContentAndRequestStatus`,{...o},ee),{feedbackContent:w,serviceNowRequestResponse:T}=S,[E,D]=h([]),[O,k]=h({status:a.idle}),[A,j]=h([]),[M,N]=h(!1),[P,F]=h(!1),{mutateAsync:I,isPending:L}=ne(w),{mutateAsync:R,status:z}=re(w),{mutateAsync:B,status:V}=u(w),[H,U]=h(``),[W,G]=h(!1),K=m(()=>z===`pending`||V===`pending`||L,[L,z,V]),q=m(()=>T.status===a.success,[T.status]),J=m(()=>{let e=[O.status,...A.map(e=>e.status)];return e.every(e=>e===a.success)?a.success:e.includes(a.error)?a.partial:a.idle},[A,O.status]),Y=m(()=>J===a.error||J===a.partial,[J]),oe=m(()=>Y||T.status===a.error,[T.status,Y]),X=()=>{N(e=>!e)},Z=({status:e,response:t,error:n})=>{C({...S,serviceNowRequestResponse:{status:e,errorText:n?.message??void 0,serviceNowId:t?.sysId??void 0}})},Q=({status:e,filename:t,error:n})=>{j(r=>{let i=Array.from(r),o=i.find(e=>e.fileName===t);return o&&(o.status=e,o.errorText=e===a.error?n?.message:void 0),i})},$=({status:e,error:t})=>{k({status:e,errorText:t?.message??void 0})},se=()=>{W?v():X()},ce=(e,t)=>{C({...S,feedbackContent:{...w,[e]:t}})},le=async()=>{X();let e=``;if(d===i.BUG&&x&&T.status!==a.success){let t=new FormData;t.append(`ConfigurationItem`,b),t.append(`Title`,w.title),t.append(`Description`,te(w,y?.name)),t.append(`CallerEmail`,x),w.urgency&&t.append(`urgency`,l(w.urgency).toString()),E&&E.length>0&&E.forEach(e=>t.append(`Images`,e));try{let n=await B(t);e=n.sysId,Z({status:a.success,response:n})}catch(e){Z({status:a.error,error:e})}}let t=new FormData;t.append(`comment`,c(w,y?.name,d,x,e));try{await R(t),$({status:a.success})}catch(e){$({status:a.error,error:e})}if(E&&E.length>0)for(let e of E){let t=new FormData;t.append(`comment`,`Title: ${w.title}`),t.append(`file`,e);try{await I(t),Q({status:a.success,filename:e.name})}catch(t){Q({status:a.error,filename:e.name,error:t})}}},ue=f(()=>{C(o),D([]),k({status:a.idle}),j([])},[C]);return p(()=>()=>{T.status===a.success&&J===a.success&&setTimeout(()=>{C(o)},1100)},[J,T.status,C]),p(()=>{A.length!==E.length&&j(E.map(e=>({status:a.idle,fileName:e.name})))},[E,A.length]),p(()=>{T.serviceNowId&&T.serviceNowId.length!==0&&U(s(T.serviceNowId,!0))},[T.serviceNowId]),p(()=>{(d===i.SUGGESTION&&J===a.success||T.status===a.success&&J===a.success)&&G(!0)},[J,d,T.status]),g(_.Provider,{value:{selectedType:d,showResponsePage:M,feedbackAttachments:E,slackAttachmentsRequestResponse:A,slackRequestResponse:O,updateFeedback:ce,feedbackContent:w,serviceNowRequestResponse:T,handleResponsePageOnClose:se,toggleShowResponsePage:X,onDialogClose:v,handleSave:le,resetForm:ue,requestIsLoading:K,serviceNowSuccess:q,isWrongDomain:P,setIsWrongDomain:F,setFeedbackAttachments:D,requestHasError:oe,showAllSlackRequests:Y,allSlackRequestStatus:J,serviceNowUrl:H,relevantRequestsHaveBeenSuccess:W},children:e})};export{_ as FeedbackContext,v as FeedbackContextProvider};
@@ -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{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}),S=()=>{_(!1)};return f(s,{open:v,onClose:S,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`,onClick:S,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};
1
+ import{Status as e}from"../../../Status/index.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{Button as n}from"../../../../molecules/Button/Button.js";import{useReleaseNotes as r}from"../../../../providers/ReleaseNotesProvider.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}=r(),{isLoading:b}=h({enabled:g}),{isPrefetching:x}=t({richTextValues:y?.body?[y.body]:[],onImageRead:m.getReleaseNoteImage}),S=()=>{_(!1)};return f(s,{open:v,onClose:S,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(n,{as:p,variant:`ghost`,to:`/release-notes`,onClick:S,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};
@@ -7,8 +7,6 @@ import React, { ReactNode } from "react";
7
7
  declare const TopBar: React.ForwardRefExoticComponent<{
8
8
  applicationIcon: string;
9
9
  applicationName: string;
10
- /** @deprecated - Not needed anymore, clicking header wil go to '/' by default */
11
- onHeaderClick?: () => void;
12
10
  /** @param - Path when clicking header */
13
11
  headerLink?: string;
14
12
  environment?: EnvironmentType;
@@ -1 +1 @@
1
- import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{ApplicationIcon as t}from"../../molecules/ApplicationIcon/ApplicationIcon.js";import{AppAndFieldContainer as n,AppIdentifier as r,AppName as i,Bar as a,CircularProgress as o,EnvironmentTag as s}from"./TopBar.styles.js";import{FieldMenu as c}from"./FieldMenu/FieldMenu.js";import l,{forwardRef as u}from"react";import{Typography as d}from"@equinor/eds-core-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m=u(({id:l,children:u,headerLink:m,applicationIcon:h,applicationName:g,environment:_,isFetching:v=!1,capitalize:y=!1,availableFields:b,onSelectField:x,currentField:S,showAccessITLink:C,itemNameSingular:w},T)=>p(a,{ref:T,children:[p(n,{id:l,children:[p(r,{tabIndex:0,to:m||`/`,children:[f(t,{name:h,size:32,withHover:!0}),f(i,{group:`navigation`,variant:`menu_title`,$capitalize:y,children:y?g.toLowerCase():g})]}),b&&x&&f(c,{availableFields:b,onSelect:x,currentField:S,showAccessITLink:C,itemNameSingular:w}),v&&f(o,{size:16})]}),(_===e.DEVELOP||_===e.STAGING||_===e.LOCALHOST)&&f(s,{$environmentType:_,children:f(d,{group:`heading`,variant:`h5`,children:_})}),u]}));m.displayName=`TopBar`;export{m as TopBar};
1
+ import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{ApplicationIcon as t}from"../../molecules/ApplicationIcon/ApplicationIcon.js";import{AppAndFieldContainer as n,AppIdentifier as r,AppName as i,Bar as a,CircularProgress as o,EnvironmentTag as s}from"./TopBar.styles.js";import{TopBarInternalContextProvider as c}from"./TopBarInternalContextProvider.js";import{FieldMenu as l}from"./FieldMenu/FieldMenu.js";import u,{forwardRef as d}from"react";import{Typography as f}from"@equinor/eds-core-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h=d(({id:u,children:d,headerLink:h,applicationIcon:g,applicationName:_,environment:v,isFetching:y=!1,capitalize:b=!1,availableFields:x,onSelectField:S,currentField:C,showAccessITLink:w,itemNameSingular:T},E)=>p(c,{selectedField:C,children:m(a,{ref:E,children:[m(n,{id:u,children:[m(r,{tabIndex:0,to:h||`/`,children:[p(t,{name:g,size:32,withHover:!0}),p(i,{group:`navigation`,variant:`menu_title`,$capitalize:b,children:b?_.toLowerCase():_})]}),x&&S&&p(l,{availableFields:x,onSelect:S,showAccessITLink:w,itemNameSingular:T}),y&&p(o,{size:16})]}),(v===e.DEVELOP||v===e.STAGING||v===e.LOCALHOST)&&p(s,{$environmentType:v,children:p(f,{group:`heading`,variant:`h5`,children:v})}),d]})}));h.displayName=`TopBar`;export{h as TopBar};
@@ -0,0 +1 @@
1
+ import{createContext as e,useContext as t}from"react";import{jsx as n}from"react/jsx-runtime";const r=e(void 0);function i(){let e=t(r);if(!e)throw Error(`useTopBarInternalContext must be used within TopBarInternalContextProvider`);return e}const a=({selectedField:e,children:t})=>n(r.Provider,{value:{selectedField:e},children:t});export{a as TopBarInternalContextProvider,i as useTopBarInternalContext};
@@ -0,0 +1,15 @@
1
+ import { ToastProps } from "../../molecules/Toast/Toast.js";
2
+ import { FC, ReactNode } from "react";
3
+
4
+ //#region src/providers/ToastProvider/ToastProvider.d.ts
5
+ interface ToastContextType {
6
+ showToast: (props: string | Omit<ToastProps, 'onClose'>) => void;
7
+ hideAllToasts: () => void;
8
+ }
9
+ declare function useToasts(): ToastContextType;
10
+ interface ToastProviderProps {
11
+ children: ReactNode | ReactNode[];
12
+ }
13
+ declare const ToastProvider: FC<ToastProviderProps>;
14
+ //#endregion
15
+ export { ToastProvider, useToasts };
@@ -0,0 +1,8 @@
1
+ import{spacings as e}from"../../atoms/style/spacings.js";import{Toast as t}from"../../molecules/Toast/Toast.js";import{createContext as n,useContext as r,useState as i}from"react";import a from"styled-components";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{AnimatePresence as c,motion as l}from"motion/react";const u=a(l.div)`
2
+ position: fixed;
3
+ top: ${e.medium};
4
+ right: ${e.medium};
5
+ display: flex;
6
+ flex-direction: column-reverse;
7
+ z-index: 9999;
8
+ `,d=n(void 0);function f(){let e=r(d);if(!e)throw Error(`useToasts must be used within a ToastProvider`);return e}const p=({children:n})=>{let[r,a]=i([]),f=e=>{a(t=>t.filter(t=>t.uuid!==e))};return s(d.Provider,{value:{showToast:e=>{let t=crypto.randomUUID(),n={uuid:t,...typeof e==`string`?{title:e}:e,onClose:()=>f(t)};a(e=>[...e,n])},hideAllToasts:()=>{a([])}},children:[o(u,{layoutRoot:!0,children:o(c,{children:r.map(n=>o(l.div,{layout:!0,initial:{opacity:0,x:`100%`,marginBottom:e.medium},animate:{opacity:1,x:0,marginBottom:e.medium},exit:{opacity:0,x:`100%`,height:0,marginBottom:0},transition:{type:`spring`,duration:.4},children:o(t,{...n})},n.uuid))})}),n]})};export{p as ToastProvider,f as useToasts};
@@ -1,4 +1,4 @@
1
- import{spacings as e}from"../../atoms/style/spacings.js";import{getHighlightElementBoundingBox as t}from"../../atoms/utils/tutorials.js";import{useReversedScrollY as n}from"./hooks/useReversedScrollY.js";import{TUTORIAL_HIGHLIGHT_ANIMATION_PROPS as r}from"./TutorialHighlightingProvider.constants.js";import{TutorialPopover as i}from"./TutorialPopover/TutorialPopover.js";import{useEffect as a,useState as o}from"react";import s from"styled-components";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{motion as d}from"framer-motion";import{useTutorials as f}from"@equinor/subsurface-app-management";import{useIsFetching as p}from"@tanstack/react-query";const m=s.svg`
1
+ import{spacings as e}from"../../atoms/style/spacings.js";import{getHighlightElementBoundingBox as t}from"../../atoms/utils/tutorials.js";import{useReversedScrollY as n}from"./hooks/useReversedScrollY.js";import{TUTORIAL_HIGHLIGHT_ANIMATION_PROPS as r}from"./TutorialHighlightingProvider.constants.js";import{TutorialPopover as i}from"./TutorialPopover/TutorialPopover.js";import{useEffect as a,useState as o}from"react";import s from"styled-components";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{motion as d}from"motion/react";import{useTutorials as f}from"@equinor/subsurface-app-management";import{useIsFetching as p}from"@tanstack/react-query";const m=s.svg`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1,4 +1,4 @@
1
- import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{elevation as n}from"../../../atoms/style/index.js";import{TUTORIAL_HIGHLIGHT_ANIMATION_PROPS as r}from"../TutorialHighlightingProvider.constants.js";import{useTutorialPopoverPosition as i}from"./hooks/useTutorialPopoverPosition.js";import{StepIndicator as a}from"./StepIndicator.js";import{useTutorialHighlighting as o}from"../TutorialHighlightingProvider.js";import{useState as s}from"react";import{Button as c,Card as l,Icon as u,Typography as d}from"@equinor/eds-core-react";import f,{css as p}from"styled-components";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{info_circle as _}from"@equinor/eds-icons";import{motion as v}from"framer-motion";import{useTutorialStepImage as y,useTutorials as b}from"@equinor/subsurface-app-management";function x(e){switch(e){case`top`:return p`
1
+ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{elevation as n}from"../../../atoms/style/index.js";import{TUTORIAL_HIGHLIGHT_ANIMATION_PROPS as r}from"../TutorialHighlightingProvider.constants.js";import{useTutorialPopoverPosition as i}from"./hooks/useTutorialPopoverPosition.js";import{StepIndicator as a}from"./StepIndicator.js";import{useTutorialHighlighting as o}from"../TutorialHighlightingProvider.js";import{useState as s}from"react";import{Button as c,Card as l,Icon as u,Typography as d}from"@equinor/eds-core-react";import f,{css as p}from"styled-components";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{info_circle as _}from"@equinor/eds-icons";import{motion as v}from"motion/react";import{useTutorialStepImage as y,useTutorials as b}from"@equinor/subsurface-app-management";function x(e){switch(e){case`top`:return p`
2
2
  left: 50%;
3
3
  top: 0;
4
4
  transform: translate(-50%, 0) rotate(45deg);
@@ -1 +1 @@
1
- import{useReversedScrollY as e}from"../../hooks/useReversedScrollY.js";import{useTransform as t}from"framer-motion";function n({top:n,left:r,width:i,height:a,popoverSize:o,contentRef:s}){let c=e(s),l=n&&a?n+a+16:void 0,u=r&&i?r+i/2:void 0,d=!!l&&!!u,f=`top`,p=(o?.width??0)/2+16,m=window.innerWidth-16,h=window.innerHeight-16,g=n!==void 0&&a!==void 0&&r!==void 0&&i!==void 0&&u!==void 0&&o!==void 0&&u<o.width/2,_=n!==void 0&&a!==void 0&&r!==void 0&&i!==void 0&&u!==void 0&&o!==void 0&&u+o.width>window.innerWidth;g?(u=r+i+o.width/2+16,l=n-o.height/2-16/4,f=`left`):_&&(u=r-o.width/2-16,l=n-o.height/2-16/4,f=`right`);let v=n!==void 0&&a!==void 0&&l!==void 0&&o!==void 0&&n+a/2+o.height>=window.innerHeight,y=n!==void 0&&a!==void 0&&l!==void 0&&o!==void 0&&l<o.height;y?l=n+a+16:v&&(l=n-o.height-a-32),g&&(y||v)?u=r+o?.width/2:_&&(y||v)&&(u=r+i-o?.width/2),y&&g?f=`top-left`:y&&_&&(f=`top-right`),v&&g?f=`bottom-left`:v&&_?f=`bottom-right`:v&&(f=`bottom`);let b=t(c,e=>{if(!d||!l)return null;let t=e+l;return t<32?32:t>h?h:t});return u&&u<p?u=p:u&&u>m&&(u=m),{style:{position:d?`absolute`:void 0,top:b,left:u},highlightingElement:d,caretPosition:f}}export{n as useTutorialPopoverPosition};
1
+ import{useReversedScrollY as e}from"../../hooks/useReversedScrollY.js";import{useTransform as t}from"motion/react";function n({top:n,left:r,width:i,height:a,popoverSize:o,contentRef:s}){let c=e(s),l=n&&a?n+a+16:void 0,u=r&&i?r+i/2:void 0,d=!!l&&!!u,f=`top`,p=(o?.width??0)/2+16,m=window.innerWidth-16,h=window.innerHeight-16,g=n!==void 0&&a!==void 0&&r!==void 0&&i!==void 0&&u!==void 0&&o!==void 0&&u<o.width/2,_=n!==void 0&&a!==void 0&&r!==void 0&&i!==void 0&&u!==void 0&&o!==void 0&&u+o.width>window.innerWidth;g?(u=r+i+o.width/2+16,l=n-o.height/2-16/4,f=`left`):_&&(u=r-o.width/2-16,l=n-o.height/2-16/4,f=`right`);let v=n!==void 0&&a!==void 0&&l!==void 0&&o!==void 0&&n+a/2+o.height>=window.innerHeight,y=n!==void 0&&a!==void 0&&l!==void 0&&o!==void 0&&l<o.height;y?l=n+a+16:v&&(l=n-o.height-a-32),g&&(y||v)?u=r+o?.width/2:_&&(y||v)&&(u=r+i-o?.width/2),y&&g?f=`top-left`:y&&_&&(f=`top-right`),v&&g?f=`bottom-left`:v&&_?f=`bottom-right`:v&&(f=`bottom`);let b=t(c,e=>{if(!d||!l)return null;let t=e+l;return t<32?32:t>h?h:t});return u&&u<p?u=p:u&&u>m&&(u=m),{style:{position:d?`absolute`:void 0,top:b,left:u},highlightingElement:d,caretPosition:f}}export{n as useTutorialPopoverPosition};
@@ -1 +1 @@
1
- import{useScroll as e,useTransform as t}from"framer-motion";function n(n){let{scrollY:r}=e({container:n});return t(r,e=>e>0?e*-1:0)}export{n as useReversedScrollY};
1
+ import{useScroll as e,useTransform as t}from"motion/react";function n(n){let{scrollY:r}=e({container:n});return t(r,e=>e>0?e*-1:0)}export{n as useReversedScrollY};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "10.2.0",
3
+ "version": "10.4.0",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@equinor/eds-icons": "^0.22.0",
56
- "@equinor/subsurface-app-management": "5.0.0",
56
+ "@equinor/subsurface-app-management": "5.1.0",
57
57
  "@eslint/js": "^9.22.0",
58
58
  "@faker-js/faker": "^9.6.0",
59
59
  "@storybook/addon-coverage": "^2.0.0",
@@ -111,14 +111,12 @@
111
111
  "ws": "8.17.1"
112
112
  },
113
113
  "peerDependencies": {
114
+ "@equinor/eds-core-react": "0.44.0",
115
+ "@equinor/eds-data-grid-react": "^0.7.5",
114
116
  "@equinor/eds-icons": "*",
115
- "@equinor/subsurface-app-management": "^5.0.0",
117
+ "@equinor/subsurface-app-management": "^5.1.0",
116
118
  "@tanstack/react-query": "*",
117
119
  "@tanstack/react-router": "*",
118
- "react": "^19.0.0",
119
- "react-dom": "^19.0.0",
120
- "@equinor/eds-core-react": "0.44.0",
121
- "@equinor/eds-data-grid-react": "^0.7.5",
122
120
  "@tiptap/core": "^3.1.0",
123
121
  "@tiptap/extension-bold": "^3.1.0",
124
122
  "@tiptap/extension-code-block": "^3.1.0",
@@ -132,6 +130,7 @@
132
130
  "@tiptap/extension-image": "^3.1.0",
133
131
  "@tiptap/extension-italic": "^3.1.0",
134
132
  "@tiptap/extension-link": "^3.1.0",
133
+ "@tiptap/extension-list": "^3.1.0",
135
134
  "@tiptap/extension-paragraph": "^3.1.0",
136
135
  "@tiptap/extension-table": "^3.1.0",
137
136
  "@tiptap/extension-text": "^3.1.0",
@@ -139,19 +138,20 @@
139
138
  "@tiptap/extension-text-style": "^3.1.0",
140
139
  "@tiptap/extension-typography": "^3.1.0",
141
140
  "@tiptap/extensions": "^3.1.0",
142
- "@tiptap/extension-list": "^3.1.0",
143
141
  "@tiptap/pm": "^3.1.0",
144
142
  "@tiptap/react": "^3.1.0",
145
- "framer-motion": "^12.23.6",
146
143
  "html2canvas": "^1.4.1",
147
144
  "jwt-decode": "^4.0.0",
145
+ "lodash": "^4.17.21",
148
146
  "lowlight": "^3.3.0",
147
+ "motion": "^12.23.24",
149
148
  "proj4": "^2.15.0",
149
+ "react": "^19.0.0",
150
+ "react-dom": "^19.0.0",
150
151
  "react-dropzone": "^14.3.8",
151
152
  "react-markdown": "^10.1.0",
152
153
  "rehype-raw": "^7.0.0",
153
- "styled-components": "^6.1.15",
154
- "lodash": "^4.17.21"
154
+ "styled-components": "^6.1.15"
155
155
  },
156
156
  "msw": {
157
157
  "workerDirectory": [
@@ -1,22 +0,0 @@
1
- import{animation as e}from"../../../atoms/style/animation.js";import{colors as t}from"../../../atoms/style/colors.js";import{spacings as n}from"../../../atoms/style/spacings.js";import{shape as r}from"../../../atoms/style/index.js";import{formatDate as i}from"../../../atoms/utils/date.js";import{Button as a}from"../../../molecules/Button/Button.js";import{RichTextDisplay as o}from"../../../molecules/RichTextDisplay/RichTextDisplay.js";import{useState as s}from"react";import{Icon as c,Typography as l}from"@equinor/eds-core-react";import u from"styled-components";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{chevron_down as p,chevron_up as m}from"@equinor/eds-icons";import{AnimatePresence as h,motion as g}from"framer-motion";import{FaqService as _}from"@equinor/subsurface-app-management";const v=u.div`
2
- background: ${t.ui.background__default.rgba};
3
- width: 100%;
4
- display: grid;
5
- grid-template-columns: 1fr auto auto;
6
- align-items: center;
7
- padding: ${n.medium};
8
- border: 1px solid ${t.ui.background__heavy.rgba};
9
- border-radius: ${r.corners.borderRadius};
10
- cursor: pointer;
11
- transition: border-color ${e.transitionMS};
12
- > button {
13
- margin-left: ${n.medium};
14
- transition: background ${e.transitionMS};
15
- }
16
- &:hover {
17
- border-color: ${t.interactive.primary__resting.rgba};
18
- > button {
19
- background: ${t.interactive.primary__hover_alt.rgba};
20
- }
21
- }
22
- `,y=({question:e,answer:t,createdDate:n})=>{let[r,u]=s(!1);return f(v,{onClick:()=>u(e=>!e),children:[d(l,{variant:`h4`,children:e}),d(l,{variant:`caption`,children:i(n)}),d(a,{variant:`ghost_icon`,children:d(c,{data:r?m:p})}),d(h,{children:r&&d(g.div,{style:{overflow:`hidden`},initial:{height:0},animate:{height:`auto`},exit:{height:0},children:d(o,{value:t,onImageRead:_.getFaqImage})})})]})};export{y as Question};
@@ -1,29 +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{Button as r}from"../../molecules/Button/Button.js";import{SkeletonBase as i}from"../../molecules/Skeleton/SkeletonBase/SkeletonBase.js";import{Icon as a}from"@equinor/eds-core-react";import o from"styled-components";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{chevron_down as l}from"@equinor/eds-icons";const u=o.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: ${t.medium};
5
- `,d=o(i)`
6
- height: 32px;
7
- width: 12rem;
8
- border-radius: ${n.corners.borderRadius};
9
- `,f=o.div`
10
- background: ${e.ui.background__default.rgba};
11
- width: 100%;
12
- display: grid;
13
- grid-template-columns: 1fr auto auto;
14
- align-items: center;
15
- padding: ${t.medium};
16
- border: 1px solid ${e.ui.background__heavy.rgba};
17
- border-radius: ${n.corners.borderRadius};
18
- > button {
19
- margin-left: ${t.medium};
20
- }
21
- `,p=o(i)`
22
- height: 32px;
23
- width: 50%;
24
- border-radius: ${n.corners.borderRadius};
25
- `,m=o(i)`
26
- height: 16px;
27
- width: 5rem;
28
- border-radius: ${n.corners.borderRadius};
29
- `,h=()=>c(u,{children:[s(d,{}),[,,,].fill(0).map((e,t)=>c(f,{children:[s(p,{$offset:t*100}),s(m,{$offset:t*100}),s(r,{variant:`ghost_icon`,children:s(a,{data:l})})]},`card-${t}`))]});export{h as CategorySkeleton};
@@ -1,8 +0,0 @@
1
- import{spacings as e}from"../../atoms/style/spacings.js";import t from"styled-components";const n=t.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: ${e.x_large};
5
- margin: ${e.large} 0;
6
- height: fit-content;
7
- width: 100%;
8
- `;export{n as Container};
@@ -1,14 +0,0 @@
1
- import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{useFaqsInApplication as n}from"../../atoms/hooks/useFaqsInApplication.js";import{Tabs as r}from"../../molecules/Tabs/Tabs.js";import{useMemo as i}from"react";import{Search as a}from"@equinor/eds-core-react";import o from"styled-components";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useNavigate as l,useSearch as u}from"@tanstack/react-router";const d=o.div`
2
- position: sticky;
3
- top: 0;
4
- display: flex;
5
- flex-direction: column;
6
- gap: ${t.medium};
7
- background: ${e.ui.background__light.rgba};
8
- padding: ${t.x_large} 0;
9
- margin: calc(${t.x_large} * -1) 0;
10
- z-index: 400;
11
- > div[role='search'] > div {
12
- background: ${e.ui.background__default.rgba};
13
- }
14
- `,f=({setSelectedTab:e,selectedTab:t})=>{let{data:o}=n(),f=l(),{search:p}=u({strict:!1}),m=i(()=>o?[{value:`all`,label:`All categories`},...o.map(e=>({value:e.id.toString(),label:e.categoryName}))]:[{value:`all`,label:`All categories`}],[o]);return c(d,{children:[s(r,{style:{maxWidth:`100%`,width:`fit-content`},selected:t??`all`,onChange:t=>{e(t===`all`?void 0:t)},options:m}),s(a,{value:p,onChange:e=>{e.target.value?f({to:`.`,search:{search:e.target.value}}):f({to:`.`,search:null})},placeholder:`Search for answer by keyword`})]})};export{f as Header};