@equinor/amplify-component-lib 10.1.0 → 10.3.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 (65) 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/useStatusNavigation.d.ts +19 -0
  4. package/dist/atoms/hooks/useStatusNavigation.js +1 -0
  5. package/dist/atoms/index.d.ts +1 -0
  6. package/dist/atoms/index.js +1 -1
  7. package/dist/atoms/style/colors.d.ts +3 -0
  8. package/dist/atoms/style/colors.js +1 -1
  9. package/dist/atoms/style/darkTokens.js +1 -0
  10. package/dist/atoms/style/lightTokens.js +1 -0
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.js +1 -1
  13. package/dist/molecules/Chip/Chip.d.ts +2 -2
  14. package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
  15. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  16. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  17. package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
  18. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  19. package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +6 -6
  20. package/dist/molecules/RichTextEditor/index.d.ts +6 -6
  21. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.js +3 -4
  22. package/dist/molecules/TableHeader/TableHeader.d.ts +32 -0
  23. package/dist/molecules/TableHeader/TableHeader.js +1 -0
  24. package/dist/molecules/TableHeader/TableHeader.styles.js +48 -0
  25. package/dist/molecules/TableHeader/TableHeader.utils.js +1 -0
  26. package/dist/molecules/index.d.ts +1 -0
  27. package/dist/molecules/index.js +1 -1
  28. package/dist/organisms/Faq/AppPageWrapper.js +8 -0
  29. package/dist/organisms/Faq/Category/Category.js +1 -9
  30. package/dist/organisms/Faq/Category/Category.styles.js +14 -0
  31. package/dist/organisms/Faq/Category/CategorySkeleton.js +17 -0
  32. package/dist/organisms/Faq/Category/Question/Question.js +1 -0
  33. package/dist/organisms/Faq/Category/Question/Question.styles.js +64 -0
  34. package/dist/organisms/Faq/Category/Subcategory.js +34 -0
  35. package/dist/organisms/Faq/Faq.d.ts +5 -1
  36. package/dist/organisms/Faq/Faq.js +20 -1
  37. package/dist/organisms/Faq/Faq.utils.js +1 -0
  38. package/dist/organisms/Faq/Search.js +5 -0
  39. package/dist/organisms/Filter/Filter.d.ts +2 -2
  40. package/dist/organisms/Filter/QuickFilter.d.ts +2 -2
  41. package/dist/organisms/Status/Action.d.ts +2 -2
  42. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  43. package/dist/organisms/Status/collections/BadRequest.d.ts +13 -2
  44. package/dist/organisms/Status/collections/BadRequest.js +2 -2
  45. package/dist/organisms/Status/collections/GenericError.d.ts +15 -2
  46. package/dist/organisms/Status/collections/GenericError.js +1 -1
  47. package/dist/organisms/Status/collections/MissingPermissions.d.ts +15 -2
  48. package/dist/organisms/Status/collections/MissingPermissions.js +1 -1
  49. package/dist/organisms/Status/collections/PageNotFound.d.ts +13 -2
  50. package/dist/organisms/Status/collections/PageNotFound.js +1 -2
  51. package/dist/organisms/Status/collections/ServerError.d.ts +13 -2
  52. package/dist/organisms/Status/collections/ServerError.js +2 -2
  53. package/dist/organisms/TableOfContents/TableOfContents.styles.js +0 -2
  54. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +0 -1
  55. package/dist/organisms/TopBar/FieldMenu/FieldMenu.js +1 -1
  56. package/dist/organisms/TopBar/Resources/Feedback/Feedback.js +1 -1
  57. package/dist/organisms/TopBar/Resources/Feedback/providers/FeedbackContextProvider.js +1 -1
  58. package/dist/organisms/TopBar/TopBar.d.ts +0 -2
  59. package/dist/organisms/TopBar/TopBar.js +1 -1
  60. package/dist/organisms/TopBar/TopBarInternalContextProvider.js +1 -0
  61. package/package.json +3 -3
  62. package/dist/organisms/Faq/Category/Question.js +0 -22
  63. package/dist/organisms/Faq/CategorySkeleton.js +0 -29
  64. package/dist/organisms/Faq/Faq.styles.js +0 -8
  65. package/dist/organisms/Faq/Header.js +0 -14
@@ -0,0 +1,17 @@
1
+ import{shape as e}from"../../../atoms/style/index.js";import{SkeletonBase as t}from"../../../molecules/Skeleton/SkeletonBase/SkeletonBase.js";import{Container as n,Header as r,TopRight as i,Wrapper as a}from"./Question/Question.styles.js";import{Container as o,Content as s}from"./Category.styles.js";import c from"styled-components";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=c(t)`
2
+ width: 20rem;
3
+ height: 1.6em;
4
+ border-radius: ${e.corners.borderRadius};
5
+ `,f=c(t)`
6
+ width: 10rem;
7
+ height: 1.25rem;
8
+ border-radius: ${e.corners.borderRadius};
9
+ `,p=c(t)`
10
+ width: 8rem;
11
+ height: 0.875rem;
12
+ border-radius: ${e.corners.borderRadius};
13
+ `,m=c(t)`
14
+ width: 1.5rem;
15
+ height: 1.5rem;
16
+ border-radius: 50%;
17
+ `,h=()=>u(o,{"aria-label":`Loading FAQ category`,children:[l(d,{}),l(s,{children:Array.from({length:4}).fill(null).map((e,t)=>l(a,{children:u(n,{children:[l(r,{children:l(f,{})}),u(i,{children:[l(p,{}),l(m,{})]})]})},`question-card-${t.toString()}`))})]});export{h as CategorySkeleton};
@@ -0,0 +1 @@
1
+ import{formatDate as e}from"../../../../atoms/utils/date.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{RichTextDisplay as n}from"../../../../molecules/RichTextDisplay/RichTextDisplay.js";import{Container as r,ExpandWrapper as i,Header as a,TopRight as o,Wrapper as s}from"./Question.styles.js";import{useState as c}from"react";import{Button as l,Icon as u,Typography as d}from"@equinor/eds-core-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{chevron_down as m,chevron_up as h}from"@equinor/eds-icons";import{AnimatePresence as g}from"framer-motion";import{FaqService as _}from"@equinor/subsurface-app-management";const v=({id:v,question:y,createdDate:b,answer:x})=>{t({richTextValues:x?[x]:[],onImageRead:e=>_.getFaqImage(e)});let[S,C]=c(!1);return f(s,{children:p(r,{children:[f(a,{id:`faq-${v}`,children:f(d,{variant:`h4`,children:y})}),p(o,{children:[f(d,{group:`paragraph`,variant:`caption`,children:e(b)}),f(l,{variant:`ghost_icon`,onClick:()=>{C(e=>!e)},"data-testid":`toggle-open`,"aria-label":S?`Collapse answer to: ${y}`:`Expand answer to: ${y}`,children:f(u,{data:S?h:m})})]}),f(g,{children:S&&f(i,{initial:{height:0},exit:{height:0},animate:{height:`auto`},children:f(n,{value:x,onImageRead:e=>_.getFaqImage(e),padding:`none`})})})]})})};export{v as Question};
@@ -0,0 +1,64 @@
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{HEADER_HEIGHT as r}from"../../Faq.utils.js";import{styled as i}from"styled-components";import{motion as a}from"framer-motion";const o=i.div`
2
+ flex-grow: 1;
3
+ display: grid;
4
+ grid-template-columns: 1fr auto;
5
+ align-items: center;
6
+ column-gap: ${t.medium};
7
+ padding: 0 ${t.medium};
8
+ `,s=i.div`
9
+ position: relative;
10
+ display: flex;
11
+ background: ${e.ui.background__default.rgba};
12
+ border-left: 1px solid ${e.ui.background__heavy.rgba};
13
+ border-right: 1px solid ${e.ui.background__heavy.rgba};
14
+ border-bottom: 1px solid ${e.ui.background__heavy.rgba};
15
+ &:first-child {
16
+ border-top-left-radius: ${n.corners.borderRadius};
17
+ border-top-right-radius: ${n.corners.borderRadius};
18
+ border-top: 1px solid ${e.ui.background__heavy.rgba};
19
+ }
20
+ &:last-child {
21
+ border-bottom-left-radius: ${n.corners.borderRadius};
22
+ border-bottom-right-radius: ${n.corners.borderRadius};
23
+ }
24
+ &::after {
25
+ pointer-events: none;
26
+ z-index: 100;
27
+ content: '';
28
+ position: absolute;
29
+ left: calc(${t.small} * -1);
30
+ width: calc(100% + (${t.small} * 2));
31
+ height: 5px;
32
+ background-color: ${e.interactive.primary__resting.rgba};
33
+ border-radius: ${n.corners.borderRadius};
34
+ opacity: 0;
35
+ }
36
+ `,c=i.header`
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: ${t.x_small};
40
+ padding: ${t.medium} 0;
41
+ scroll-margin-top: ${r}px;
42
+ > div {
43
+ display: flex;
44
+ align-items: center;
45
+ gap: ${t.x_small};
46
+ color: ${e.text.static_icons__tertiary.rgba};
47
+ }
48
+ `,l=i.section`
49
+ display: flex;
50
+ gap: ${t.medium};
51
+ align-items: center;
52
+ `,u=i(a.div)`
53
+ grid-column: 1 / 3;
54
+ display: flex;
55
+ flex-direction: column;
56
+ > button {
57
+ margin-left: auto;
58
+ margin-bottom: ${t.medium};
59
+ }
60
+ overflow: hidden;
61
+ > div {
62
+ padding-bottom: ${t.medium};
63
+ }
64
+ `;export{o as Container,u as ExpandWrapper,c as Header,l as TopRight,s as Wrapper};
@@ -0,0 +1,34 @@
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{Typography as r}from"../../../molecules/index.js";import{HEADER_HEIGHT as i}from"../Faq.utils.js";import{Question as a}from"./Question/Question.js";import o from"styled-components";import{jsx as s,jsxs as c}from"react/jsx-runtime";const l=o.div`
2
+ display: grid;
3
+ grid-template-columns: auto 1fr;
4
+ gap: ${t.medium};
5
+ padding: ${t.medium};
6
+ background: ${e.ui.background__default.rgba};
7
+ border-left: 1px solid ${e.ui.background__heavy.rgba};
8
+ border-right: 1px solid ${e.ui.background__heavy.rgba};
9
+ border-bottom: 1px solid ${e.ui.background__heavy.rgba};
10
+ &:first-child {
11
+ border-top-left-radius: ${n.corners.borderRadius};
12
+ border-top-right-radius: ${n.corners.borderRadius};
13
+ border-top: 1px solid ${e.ui.background__heavy.rgba};
14
+ }
15
+ &:last-child {
16
+ border-bottom-left-radius: ${n.corners.borderRadius};
17
+ border-bottom-right-radius: ${n.corners.borderRadius};
18
+ }
19
+ `,u=o.div`
20
+ display: flex;
21
+ gap: ${t.small};
22
+ align-items: center;
23
+ scroll-margin-top: ${i}px;
24
+ `,d=o.hr`
25
+ height: 100%;
26
+ width: 2px;
27
+ `,f=o.div`
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: ${t.medium};
31
+ `,p=o.div`
32
+ display: flex;
33
+ flex-direction: column;
34
+ `,m=({id:t,faqs:n,categoryName:i})=>c(l,{"aria-label":`Subcategory: ${i}`,children:[s(d,{}),c(f,{children:[s(u,{id:`subcategory-${t}`,children:s(r,{variant:`h5`,color:e.text.static_icons__tertiary.rgba,children:i})}),s(p,{children:n?.map(e=>s(a,{...e},e.id))})]})]});export{m as Subcategory};
@@ -1,6 +1,10 @@
1
1
  import { FC } from "react";
2
2
 
3
3
  //#region src/organisms/Faq/Faq.d.ts
4
- declare const Faq: FC;
4
+ interface FaqProps {
5
+ searchPlaceholder?: string;
6
+ title?: string;
7
+ }
8
+ declare const Faq: FC<FaqProps>;
5
9
  //#endregion
6
10
  export { Faq };
@@ -1 +1,20 @@
1
- import{Status as e}from"../Status/index.js";import{useFaqsInApplication as t}from"../../atoms/hooks/useFaqsInApplication.js";import{Container as n}from"./Faq.styles.js";import{Header as r}from"./Header.js";import{Category as i}from"./Category/Category.js";import{CategorySkeleton as a}from"./CategorySkeleton.js";import{useMemo as o,useState as s}from"react";import{Typography as c}from"@equinor/eds-core-react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";const f=()=>{let{data:f,isLoading:p}=t(),[m,h]=s(void 0),g=o(()=>{if(f)return m?[f.find(e=>e.id==Number(m))]:f},[f,m]);return d(n,{children:[u(c,{variant:`h1`,bold:!0,children:`FAQ`}),u(r,{selectedTab:m,setSelectedTab:h}),g&&g.length>0?g.map(e=>u(i,{...e,selectedTab:m},e.id)):p?d(l,{children:[u(a,{}),u(a,{}),u(a,{})]}):u(e,{center:!1,children:u(e.Title,{title:`No FAQs available yet`})})]})};export{f as Faq};
1
+ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{Status as n}from"../Status/index.js";import{TableOfContentsProvider as r}from"../../providers/TableOfContentsProvider.js";import{useFaqsInApplication as i}from"../../atoms/hooks/useFaqsInApplication.js";import{TableOfContents as a}from"../TableOfContents/TableOfContents.js";import{HEADER_HEIGHT as o,categoryHasFaqs as s,filterCategory as c,mapCategoryToSearch as l}from"./Faq.utils.js";import{Category as u}from"./Category/Category.js";import{CategorySkeleton as d}from"./Category/CategorySkeleton.js";import{AppPageWrapper as f}from"./AppPageWrapper.js";import{Search as p}from"./Search.js";import{Typography as m}from"@equinor/eds-core-react";import h from"styled-components";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useSearch as v}from"@tanstack/react-router";const y=h.div`
2
+ display: grid;
3
+ grid-template-columns: ${({$showToc:e})=>e?`1fr 180px`:`1fr auto`};
4
+ gap: ${t.large};
5
+ `,b=h.div`
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: ${t.large};
9
+ `,x=h.div`
10
+ height: fit-content;
11
+ position: sticky;
12
+ top: ${o}px;
13
+ grid-row: span 2;
14
+ `,S=h.div`
15
+ position: sticky;
16
+ top: 0;
17
+ padding: ${t.large} 0;
18
+ background: ${e.ui.background__light.rgba};
19
+ z-index: 100;
20
+ `,C=({searchPlaceholder:e,title:t})=>{let{search:o}=v({strict:!1}),{data:h,isLoading:C}=i(),w=!!o,T=(h??[]).map(e=>l(e,o)).filter(c),E=T.map(e=>({label:e.categoryName??``,value:`category-${e.id}`,count:(e.faqs??[]).length+(e.subCategories?e.subCategories.reduce((e,t)=>e+(t.faqs??[]).length,0):0),children:[...(e.faqs??[]).map(e=>({label:e.question??``,value:`faq-${e.id}`})),...(e.subCategories??[]).map(e=>({label:e.categoryName??``,value:`subcategory-${e.id}`,count:(e.faqs??[]).length}))]})),D=!C&&(T.length===0||T.every(e=>!s(e))),O=C||E.length>0;return _(f,{children:[g(S,{children:g(m,{variant:`h1`,bold:!0,children:t??`FAQ`})}),g(r,{items:E,hashNavigation:!0,children:_(y,{$showToc:O,children:[g(p,{placeholder:e}),g(x,{children:g(a,{})}),g(b,{children:C?Array.from({length:2}).fill(null).map((e,t)=>g(d,{},`category-${t.toString()}`)):D?g(n,{center:!1,children:g(n.Title,{title:`No FAQs ${w?`found`:`yet`}`})}):T.map(e=>g(u,{...e},e.id))})]})})]})};export{C as Faq};
@@ -0,0 +1 @@
1
+ const e=89,t=e=>{let t=(e.faqs?.length??0)>0,n=e.subCategories?.some(e=>(e.faqs?.length??0)>0);return t||!!n};function n(e,t){let n=t.toLowerCase();return!e.answer||!e.question?!1:n===``?!0:e.answer.toLowerCase().includes(n)||e.question.toLowerCase().includes(n)}function r(e){return t(e)}function i(e,t){let r=(e.faqs??[]).filter(e=>!t||n(e,t)),i=(e.subCategories??[]).map(e=>{let r=(e.faqs??[]).filter(e=>!t||n(e,t));return r.length>0?{...e,faqs:r}:null}).filter(Boolean);return{...e,faqs:r,subCategories:i}}export{e as HEADER_HEIGHT,t as categoryHasFaqs,r as filterCategory,i as mapCategoryToSearch};
@@ -0,0 +1,5 @@
1
+ import{colors as e}from"../../atoms/style/colors.js";import{Search as t}from"../../molecules/Search/Search.js";import{styled as n}from"styled-components";import{jsx as r}from"react/jsx-runtime";import{useNavigate as i,useSearch as a}from"@tanstack/react-router";const o=n(t)`
2
+ > div {
3
+ background: ${e.ui.background__default.rgba};
4
+ }
5
+ `,s=({placeholder:e})=>{let t=i({from:`/faq`}),{search:n}=a({strict:!1});return r(o,{value:n??``,onChange:e=>{e.target.value?t({to:`.`,search:{search:e.target.value},replace:!0}):t({to:`.`,search:void 0,replace:!0})},placeholder:e??`Search for something...`})};export{s as Search};
@@ -1,5 +1,5 @@
1
1
  import { FilterProps } from "./Filter.types.js";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/organisms/Filter/Filter.d.ts
5
5
 
@@ -32,6 +32,6 @@ declare function Filter<T extends string>({
32
32
  id,
33
33
  openOnFocus,
34
34
  ...rest
35
- }: FilterProps<T>): react_jsx_runtime6.JSX.Element;
35
+ }: FilterProps<T>): react_jsx_runtime5.JSX.Element;
36
36
  //#endregion
37
37
  export { Filter };
@@ -1,6 +1,6 @@
1
1
  import { SelectOptionRequired } from "../../molecules/Select/Select.types.js";
2
2
  import { FilterProps } from "./Filter.types.js";
3
- import * as react_jsx_runtime5 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/organisms/Filter/QuickFilter.d.ts
6
6
  interface QuickFilterProps<T extends string> {
@@ -14,6 +14,6 @@ declare function QuickFilter<T extends string>({
14
14
  items,
15
15
  onQuickFilter,
16
16
  label
17
- }: QuickFilterProps<T>): react_jsx_runtime5.JSX.Element;
17
+ }: QuickFilterProps<T>): react_jsx_runtime6.JSX.Element;
18
18
  //#endregion
19
19
  export { QuickFilter };
@@ -1,10 +1,10 @@
1
- import * as react125 from "react";
1
+ import * as react129 from "react";
2
2
 
3
3
  //#region src/organisms/Status/Action.d.ts
4
4
  interface ActionProps {
5
5
  onClick: () => void;
6
6
  buttonText?: string;
7
7
  }
8
- declare const Action: react125.ForwardRefExoticComponent<ActionProps & react125.RefAttributes<HTMLButtonElement>>;
8
+ declare const Action: react129.ForwardRefExoticComponent<ActionProps & react129.RefAttributes<HTMLButtonElement>>;
9
9
  //#endregion
10
10
  export { Action };
@@ -1,4 +1,4 @@
1
- import * as react129 from "react";
1
+ import * as react125 from "react";
2
2
 
3
3
  //#region src/organisms/Status/MissingAccesses.d.ts
4
4
  interface AccessType {
@@ -9,6 +9,6 @@ interface MissingAccessesProps {
9
9
  accesses?: AccessType[];
10
10
  text?: string;
11
11
  }
12
- declare const MissingAccesses: react129.ForwardRefExoticComponent<MissingAccessesProps & react129.RefAttributes<HTMLDivElement>>;
12
+ declare const MissingAccesses: react125.ForwardRefExoticComponent<MissingAccessesProps & react125.RefAttributes<HTMLDivElement>>;
13
13
  //#endregion
14
14
  export { MissingAccesses };
@@ -1,6 +1,17 @@
1
- import { FC } from "react";
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/BadRequest.d.ts
4
- declare const BadRequest: FC;
4
+ interface BadRequestProps {
5
+ description?: string;
6
+ redirectFallbackUrl?: string;
7
+ onBackClick?: () => void;
8
+ hideBackButton?: boolean;
9
+ }
10
+ declare const BadRequest: ({
11
+ description,
12
+ redirectFallbackUrl,
13
+ onBackClick,
14
+ hideBackButton
15
+ }: BadRequestProps) => react_jsx_runtime7.JSX.Element;
5
16
  //#endregion
6
17
  export { BadRequest };
@@ -1,3 +1,3 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{color:`#AB9067`,children:[t(e.Title,{title:`Bad request`}),t(e.Description,{text:`We encountered some confusion regarding your request.
1
+ import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({description:i=`We encountered some confusion regarding your request.
2
2
  Please try again later, or if the issue persists, kindly report
3
- it using the feedback form located in the top bar.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as BadRequest};
3
+ it using the feedback form located in the top bar.`,redirectFallbackUrl:a,onBackClick:o,hideBackButton:s=!1})=>{let c=t({onBackClick:o,redirectFallbackUrl:a});return r(e,{color:`#AB9067`,children:[n(e.Title,{title:`Bad request`}),n(e.Description,{text:i}),!s&&n(e.Action,{onClick:c})]})};export{i as BadRequest};
@@ -1,6 +1,19 @@
1
- import { FC } from "react";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/GenericError.d.ts
4
- declare const GenericError: FC;
4
+ interface GenericErrorProps {
5
+ title?: string;
6
+ description?: string;
7
+ redirectFallbackUrl?: string;
8
+ onBackClick?: () => void;
9
+ hideBackButton?: boolean;
10
+ }
11
+ declare const GenericError: ({
12
+ title,
13
+ description,
14
+ redirectFallbackUrl,
15
+ onBackClick,
16
+ hideBackButton
17
+ }: GenericErrorProps) => react_jsx_runtime8.JSX.Element;
5
18
  //#endregion
6
19
  export { GenericError };
@@ -1 +1 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{children:[t(e.Title,{}),t(e.Description,{}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as GenericError};
1
+ import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({title:i,description:a,redirectFallbackUrl:o,onBackClick:s,hideBackButton:c=!1})=>{let l=t({onBackClick:s,redirectFallbackUrl:o});return r(e,{children:[n(e.Title,{title:i}),n(e.Description,{text:a}),!c&&n(e.Action,{onClick:l})]})};export{i as GenericError};
@@ -1,6 +1,19 @@
1
- import { FC } from "react";
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/MissingPermissions.d.ts
4
- declare const MissingPermissions: FC;
4
+ interface MissingPermissionsProps {
5
+ title?: string;
6
+ description?: string;
7
+ redirectFallbackUrl?: string;
8
+ onBackClick?: () => void;
9
+ hideBackButton?: boolean;
10
+ }
11
+ declare const MissingPermissions: ({
12
+ title,
13
+ description,
14
+ redirectFallbackUrl,
15
+ onBackClick,
16
+ hideBackButton
17
+ }: MissingPermissionsProps) => react_jsx_runtime11.JSX.Element;
5
18
  //#endregion
6
19
  export { MissingPermissions };
@@ -1 +1 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{children:[t(e.Title,{title:`It looks like you don't have permission to access this page.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as MissingPermissions};
1
+ import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({title:i=`It looks like you don't have permission to access this page.`,description:a,redirectFallbackUrl:o,onBackClick:s,hideBackButton:c=!1})=>{let l=t({onBackClick:s,redirectFallbackUrl:o});return r(e,{children:[n(e.Title,{title:i}),a&&n(e.Description,{text:a}),!c&&n(e.Action,{onClick:l})]})};export{i as MissingPermissions};
@@ -1,6 +1,17 @@
1
- import { FC } from "react";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/PageNotFound.d.ts
4
- declare const PageNotFound: FC;
4
+ interface PageNotFoundProps {
5
+ description?: string;
6
+ redirectFallbackUrl?: string;
7
+ onBackClick?: () => void;
8
+ hideBackButton?: boolean;
9
+ }
10
+ declare const PageNotFound: ({
11
+ description,
12
+ redirectFallbackUrl,
13
+ onBackClick,
14
+ hideBackButton
15
+ }: PageNotFoundProps) => react_jsx_runtime9.JSX.Element;
5
16
  //#endregion
6
17
  export { PageNotFound };
@@ -1,2 +1 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{center:!1,children:[t(e.Title,{title:`Page not found`}),t(e.Description,{text:`It looks like the page you're looking for has gone missing.
2
- Please check the URL and try again.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as PageNotFound};
1
+ import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({description:i=`It looks like the page you're looking for has gone missing. Please check the URL and try again.`,redirectFallbackUrl:a,onBackClick:o,hideBackButton:s=!1})=>{let c=t({onBackClick:o,redirectFallbackUrl:a});return r(e,{center:!1,children:[n(e.Title,{title:`Page not found`}),n(e.Description,{text:i}),!s&&n(e.Action,{onClick:c})]})};export{i as PageNotFound};
@@ -1,6 +1,17 @@
1
- import { FC } from "react";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/ServerError.d.ts
4
- declare const ServerError: FC;
4
+ interface ServerErrorProps {
5
+ description?: string;
6
+ redirectFallbackUrl?: string;
7
+ onBackClick?: () => void;
8
+ hideBackButton?: boolean;
9
+ }
10
+ declare const ServerError: ({
11
+ description,
12
+ redirectFallbackUrl,
13
+ onBackClick,
14
+ hideBackButton
15
+ }: ServerErrorProps) => react_jsx_runtime10.JSX.Element;
5
16
  //#endregion
6
17
  export { ServerError };
@@ -1,3 +1,3 @@
1
- import{Status as e}from"../index.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useRouter as r}from"@tanstack/react-router";const i=()=>{let{history:i}=r();return n(e,{color:`#C47E84`,children:[t(e.Title,{title:`Something is wrong on our servers`}),t(e.Description,{text:`Our server encountered an unexpected issue. Please try
1
+ import{Status as e}from"../index.js";import{useStatusNavigation as t}from"../../../atoms/hooks/useStatusNavigation.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";const i=({description:i=`Our server encountered an unexpected issue. Please try
2
2
  again shortly, or reach out via the feedback form if the problem
3
- continues.`}),t(e.Action,{onClick:()=>{i.go(-1)}})]})};export{i as ServerError};
3
+ continues.`,redirectFallbackUrl:a,onBackClick:o,hideBackButton:s=!1})=>{let c=t({onBackClick:o,redirectFallbackUrl:a});return r(e,{color:`#C47E84`,children:[n(e.Title,{title:`Something is wrong on our servers`}),n(e.Description,{text:i}),!s&&n(e.Action,{onClick:c})]})};export{i as ServerError};
@@ -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;
@@ -3,7 +3,6 @@ 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;
@@ -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 +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 +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};
@@ -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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "10.1.0",
3
+ "version": "10.3.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",
@@ -112,7 +112,7 @@
112
112
  },
113
113
  "peerDependencies": {
114
114
  "@equinor/eds-icons": "*",
115
- "@equinor/subsurface-app-management": "^5.0.0",
115
+ "@equinor/subsurface-app-management": "^5.1.0",
116
116
  "@tanstack/react-query": "*",
117
117
  "@tanstack/react-router": "*",
118
118
  "react": "^19.0.0",
@@ -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};