@equinor/amplify-component-lib 10.2.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 (72) 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/index.d.ts +2 -1
  6. package/dist/index.js +1 -1
  7. package/dist/molecules/Chip/Chip.d.ts +2 -2
  8. package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
  9. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  10. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  11. package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
  12. package/dist/molecules/IconCell/IconCell.d.ts +2 -2
  13. package/dist/molecules/ListItem/ListItem.d.ts +2 -2
  14. package/dist/molecules/OptionDrawer/OptionDrawer.d.ts +2 -2
  15. package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
  16. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  17. package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +6 -6
  18. package/dist/molecules/RichTextEditor/index.d.ts +6 -6
  19. package/dist/molecules/Search/Search.d.ts +2 -2
  20. package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
  21. package/dist/molecules/Select/Select.styles.d.ts +4 -4
  22. package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
  23. package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
  24. package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
  25. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
  26. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.js +3 -4
  27. package/dist/molecules/TableHeader/TableHeader.d.ts +32 -0
  28. package/dist/molecules/TableHeader/TableHeader.js +1 -0
  29. package/dist/molecules/TableHeader/TableHeader.styles.js +48 -0
  30. package/dist/molecules/TableHeader/TableHeader.utils.js +1 -0
  31. package/dist/molecules/index.d.ts +1 -0
  32. package/dist/molecules/index.js +1 -1
  33. package/dist/organisms/Faq/AppPageWrapper.js +8 -0
  34. package/dist/organisms/Faq/Category/Category.js +1 -9
  35. package/dist/organisms/Faq/Category/Category.styles.js +14 -0
  36. package/dist/organisms/Faq/Category/CategorySkeleton.js +17 -0
  37. package/dist/organisms/Faq/Category/Question/Question.js +1 -0
  38. package/dist/organisms/Faq/Category/Question/Question.styles.js +64 -0
  39. package/dist/organisms/Faq/Category/Subcategory.js +34 -0
  40. package/dist/organisms/Faq/Faq.d.ts +5 -1
  41. package/dist/organisms/Faq/Faq.js +20 -1
  42. package/dist/organisms/Faq/Faq.utils.js +1 -0
  43. package/dist/organisms/Faq/Search.js +5 -0
  44. package/dist/organisms/Filter/Filter.d.ts +2 -2
  45. package/dist/organisms/Filter/SortMenu.d.ts +2 -2
  46. package/dist/organisms/SideBar/SideBar.d.ts +2 -2
  47. package/dist/organisms/Status/Action.d.ts +2 -2
  48. package/dist/organisms/Status/Description.d.ts +2 -2
  49. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  50. package/dist/organisms/Status/Title.d.ts +2 -2
  51. package/dist/organisms/Status/collections/BadRequest.d.ts +2 -2
  52. package/dist/organisms/Status/collections/GenericError.d.ts +2 -2
  53. package/dist/organisms/Status/collections/MissingPermissions.d.ts +2 -2
  54. package/dist/organisms/Status/collections/PageNotFound.d.ts +2 -2
  55. package/dist/organisms/Status/collections/ServerError.d.ts +2 -2
  56. package/dist/organisms/TableOfContents/TableOfContents.styles.js +0 -2
  57. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  58. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  59. package/dist/organisms/TopBar/Actions.d.ts +2 -2
  60. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -3
  61. package/dist/organisms/TopBar/FieldMenu/FieldMenu.js +1 -1
  62. package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
  63. package/dist/organisms/TopBar/Resources/Feedback/Feedback.js +1 -1
  64. package/dist/organisms/TopBar/Resources/Feedback/providers/FeedbackContextProvider.js +1 -1
  65. package/dist/organisms/TopBar/TopBar.d.ts +0 -2
  66. package/dist/organisms/TopBar/TopBar.js +1 -1
  67. package/dist/organisms/TopBar/TopBarInternalContextProvider.js +1 -0
  68. package/package.json +3 -3
  69. package/dist/organisms/Faq/Category/Question.js +0 -22
  70. package/dist/organisms/Faq/CategorySkeleton.js +0 -29
  71. package/dist/organisms/Faq/Faq.styles.js +0 -8
  72. package/dist/organisms/Faq/Header.js +0 -14
@@ -0,0 +1,48 @@
1
+ import{spacings as e}from"../../atoms/style/spacings.js";import{getButtonHoverColor as t,getHoverColor as n}from"./TableHeader.utils.js";import r,{css as i}from"styled-components";const a=r.th``,o=r.span`
2
+ display: flex;
3
+ gap: ${e.small};
4
+ margin-left: auto;
5
+ `,s=r.span`
6
+ display: flex;
7
+ gap: ${e.small};
8
+ padding: ${e.small};
9
+ align-items: center;
10
+ > ${o} > button {
11
+ margin-left: auto;
12
+ }
13
+ > ${o} > button:hover {
14
+ background: none;
15
+ &:before {
16
+ content: '';
17
+ width: 100%;
18
+ height: 100%;
19
+ position: absolute;
20
+ left: 0;
21
+ opacity: 0.15;
22
+ border-radius: 50%;
23
+ background: ${({$variant:e})=>t({variant:e})};
24
+ }
25
+ }
26
+ ${({$hasOnClick:e,$hasOnSort:r,$variant:a})=>!e&&!r?``:e?i`
27
+ cursor: pointer;
28
+ &:hover {
29
+ background: ${n({variant:a})};
30
+ }
31
+ `:i`
32
+ cursor: pointer;
33
+ &:hover:not(:has(> ${o} > button:hover)) {
34
+ > ${o} > button.sort-button {
35
+ &:before {
36
+ content: '';
37
+ width: 100%;
38
+ height: 100%;
39
+ position: absolute;
40
+ left: 0;
41
+ opacity: 0.15;
42
+ border-radius: 50%;
43
+ background: ${t({variant:a})};
44
+ }
45
+ }
46
+ }
47
+ `}
48
+ `;export{o as ActionsWrapper,s as Container,a as Wrapper};
@@ -0,0 +1 @@
1
+ import{colors as e}from"../../atoms/style/colors.js";import{arrow_down as t,arrow_up as n,error_outlined as r,warning_outlined as i}from"@equinor/eds-icons";function a(e){if(e.leadingIcon)return e.leadingIcon;switch(e.variant){case`warning`:return i;case`error`:return r}}function o(t){switch(t.variant){case`warning`:return e.interactive.warning__text.rgba;case`error`:return e.interactive.danger__text.rgba}return t.onClick?e.interactive.primary__resting.rgba:e.text.static_icons__tertiary.rgba}function s(t){switch(t.variant){case`warning`:return e.interactive.warning__text.rgba;case`error`:return e.interactive.danger__text.rgba}return e.interactive.primary__resting.rgba}function c(e){switch(e){case`asc`:return n;case`desc`:return t}}function l(t){if(t.onClick)switch(t.variant){case`warning`:return e.interactive.warning__text.rgba;case`error`:return e.interactive.danger__text.rgba;default:return e.interactive.primary__resting.rgba}return e.text.static_icons__default.rgba}function u(t){switch(t.variant){case`warning`:return e.interactive.warning__highlight.rgba;case`error`:return e.interactive.danger__highlight.rgba;default:return e.interactive.primary__hover_alt.rgba}}function d(t){switch(t.variant){case`warning`:return e.interactive.warning__text.rgba;case`error`:return e.interactive.danger__text.rgba;default:return e.interactive.primary__hover.rgba}}export{s as getActionIconColor,d as getButtonHoverColor,u as getHoverColor,a as getLeadingIcon,o as getLeadingIconColor,c as getSortingIcon,l as getTextColor};
@@ -27,6 +27,7 @@ import { RichText } from "./RichTextEditor/index.js";
27
27
  import { Tab } from "./Tabs/Tabs.types.js";
28
28
  import { Tabs, TabsProps } from "./Tabs/Tabs.js";
29
29
  import { TableMenuBar, TextTable } from "./RichTextEditor/MenuBar/Table/TableBar.js";
30
+ import { TableHeader, TableHeaderProps } from "./TableHeader/TableHeader.js";
30
31
  import { Search as Search$1 } from "./Search/Search.js";
31
32
  import { SkeletonBase, SkeletonBaseProps, skeletonBaseloading } from "./Skeleton/SkeletonBase/SkeletonBase.js";
32
33
  import { SkeletonGradient, SkeletonGradientProps } from "./Skeleton/SkeletonGradient/SkeletonGradient.js";
@@ -1 +1 @@
1
- import{FullPageSpinner as e}from"./FullPageSpinner/FullPageSpinner.js";import{DEFAULT_FEATURES as t,RichTextEditorFeatures as n}from"./RichTextEditor/RichTextEditor.types.js";import{AmplifyKit as r}from"./RichTextEditor/custom-extensions/AmplifyKit.js";import{AnimatedCheckmark as i}from"./AnimatedCheckmark/AnimatedCheckmark.js";import{ApplicationIcon as a}from"./ApplicationIcon/ApplicationIcon.js";import{Badge as o}from"./Badge/Badge.js";import{Banner as s}from"./Banner/Banner.js";import{Button as c}from"./Button/Button.js";import{Chip as ee}from"./Chip/Chip.js";import{SkeletonBase as te,skeletonBaseloading as ne}from"./Skeleton/SkeletonBase/SkeletonBase.js";import{DatePicker as l}from"./DatePicker/DatePicker.js";import{DateRangePicker as u}from"./DateRangePicker/DateRangePicker.js";import{OptionalTooltip as d}from"./OptionalTooltip/OptionalTooltip.js";import{Dialog as f}from"./Dialog/Dialog.js";import{EquinorLogo as p}from"./EquinorLogo/EquinorLogo.js";import{FileProgress as m}from"./FileProgress/FileProgress.js";import{FileUploadArea as h}from"./FileUploadArea/FileUploadArea.js";import{IconCellColors as g,IconCellStates as _,IconCellVariants as v}from"./IconCell/IconCell.types.js";import{IconCell as y}from"./IconCell/IconCell.js";import{InfoElement as b}from"./InfoElement/InfoElement.js";import{ProfileAvatar as x}from"./ProfileAvatar/ProfileAvatar.js";import{RichTextDisplay as S}from"./RichTextDisplay/RichTextDisplay.js";import{TableMenuBar as C,TextTable as w}from"./RichTextEditor/MenuBar/Table/TableBar.js";import{TextField as T}from"./TextField/TextField.js";import{AmplifyBar as E,EditorMenu as D,EditorText as re}from"./RichTextEditor/MenuBar/MenuBar.js";import{RichTextEditor as O}from"./RichTextEditor/RichTextEditor.js";import{RichText as k}from"./RichTextEditor/index.js";import{Tabs as A}from"./Tabs/Tabs.js";import{Search as j}from"./Search/Search.js";import{SkeletonGradient as M}from"./Skeleton/SkeletonGradient/SkeletonGradient.js";import{Stepper as N}from"./Stepper/Stepper.js";import{OptionDrawer as P}from"./OptionDrawer/OptionDrawer.js";import{ComboBoxChip as F}from"./Select/Select.styles.js";import{ComboBox as I}from"./Select/ComboBox/ComboBox.js";import{SingleSelect as L}from"./Select/SingleSelect/SingleSelect.js";import{FeedBackIcon as R}from"./FeedBackIcon/FeedBackIcon.js";import{ListItem as z}from"./ListItem/ListItem.js";import{Checkbox as B}from"./SelectionControls/Checkbox/Checkbox.js";import{Radio as V}from"./SelectionControls/Radio/Radio.js";import{Switch as H}from"./SelectionControls/Switch/Switch.js";import{Waves as U}from"./Waves/Waves.js";import{Accordion as W,Breadcrumbs as G,CircularProgress as K,Dialog as q,Divider as J,DotProgress as Y,Icon as X,LinearProgress as Z,Menu as Q,Typography as $}from"@equinor/eds-core-react";export{W as Accordion,G as Breadcrumbs,K as CircularProgress,J as Divider,Y as DotProgress,q as EDSDialog,X as Icon,Z as LinearProgress,Q as Menu,$ as Typography};
1
+ import{FullPageSpinner as e}from"./FullPageSpinner/FullPageSpinner.js";import{DEFAULT_FEATURES as t,RichTextEditorFeatures as n}from"./RichTextEditor/RichTextEditor.types.js";import{AmplifyKit as r}from"./RichTextEditor/custom-extensions/AmplifyKit.js";import{AnimatedCheckmark as i}from"./AnimatedCheckmark/AnimatedCheckmark.js";import{ApplicationIcon as a}from"./ApplicationIcon/ApplicationIcon.js";import{Badge as o}from"./Badge/Badge.js";import{Banner as s}from"./Banner/Banner.js";import{Button as ee}from"./Button/Button.js";import{Chip as te}from"./Chip/Chip.js";import{SkeletonBase as ne,skeletonBaseloading as re}from"./Skeleton/SkeletonBase/SkeletonBase.js";import{DatePicker as c}from"./DatePicker/DatePicker.js";import{DateRangePicker as l}from"./DateRangePicker/DateRangePicker.js";import{OptionalTooltip as u}from"./OptionalTooltip/OptionalTooltip.js";import{Dialog as d}from"./Dialog/Dialog.js";import{EquinorLogo as f}from"./EquinorLogo/EquinorLogo.js";import{FileProgress as p}from"./FileProgress/FileProgress.js";import{FileUploadArea as m}from"./FileUploadArea/FileUploadArea.js";import{IconCellColors as h,IconCellStates as g,IconCellVariants as _}from"./IconCell/IconCell.types.js";import{IconCell as v}from"./IconCell/IconCell.js";import{InfoElement as y}from"./InfoElement/InfoElement.js";import{ProfileAvatar as b}from"./ProfileAvatar/ProfileAvatar.js";import{RichTextDisplay as x}from"./RichTextDisplay/RichTextDisplay.js";import{TableMenuBar as S,TextTable as C}from"./RichTextEditor/MenuBar/Table/TableBar.js";import{TextField as w}from"./TextField/TextField.js";import{AmplifyBar as T,EditorMenu as E,EditorText as D}from"./RichTextEditor/MenuBar/MenuBar.js";import{RichTextEditor as O}from"./RichTextEditor/RichTextEditor.js";import{RichText as k}from"./RichTextEditor/index.js";import{Tabs as A}from"./Tabs/Tabs.js";import{TableHeader as ie}from"./TableHeader/TableHeader.js";import{Search as j}from"./Search/Search.js";import{SkeletonGradient as M}from"./Skeleton/SkeletonGradient/SkeletonGradient.js";import{Stepper as N}from"./Stepper/Stepper.js";import{OptionDrawer as P}from"./OptionDrawer/OptionDrawer.js";import{ComboBoxChip as F}from"./Select/Select.styles.js";import{ComboBox as I}from"./Select/ComboBox/ComboBox.js";import{SingleSelect as L}from"./Select/SingleSelect/SingleSelect.js";import{FeedBackIcon as R}from"./FeedBackIcon/FeedBackIcon.js";import{ListItem as z}from"./ListItem/ListItem.js";import{Checkbox as B}from"./SelectionControls/Checkbox/Checkbox.js";import{Radio as V}from"./SelectionControls/Radio/Radio.js";import{Switch as H}from"./SelectionControls/Switch/Switch.js";import{Waves as U}from"./Waves/Waves.js";import{Accordion as W,Breadcrumbs as G,CircularProgress as K,Dialog as q,Divider as J,DotProgress as Y,Icon as X,LinearProgress as Z,Menu as Q,Typography as $}from"@equinor/eds-core-react";export{W as Accordion,G as Breadcrumbs,K as CircularProgress,J as Divider,Y as DotProgress,q as EDSDialog,X as Icon,Z as LinearProgress,Q as Menu,$ as Typography};
@@ -0,0 +1,8 @@
1
+ import{spacings as e}from"../../atoms/style/spacings.js";import{styled as t}from"styled-components";import{jsx as n}from"react/jsx-runtime";const r=t.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ height: fit-content;
6
+ margin: 0 auto ${e.large};
7
+ max-width: 1280px;
8
+ `,i=({children:e,style:t})=>n(r,{style:t,children:e});export{i as AppPageWrapper};
@@ -1,9 +1 @@
1
- import{spacings as e}from"../../../atoms/style/spacings.js";import{Status as t}from"../../Status/index.js";import{Question as n}from"./Question.js";import{useMemo as r}from"react";import{Typography as i}from"@equinor/eds-core-react";import a from"styled-components";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useSearch as c}from"@tanstack/react-router";const l=a.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: ${e.medium};
5
- width: 100%;
6
- &:has(> div > div > svg) {
7
- transform: translateY(50%);
8
- }
9
- `,u=({categoryName:e,faqs:a,selectedTab:u})=>{let{search:d}=c({strict:!1}),f=r(()=>a.toSorted((e,t)=>(e.orderBy??0)-(t.orderBy??0)),[a]),p=r(()=>d?f.filter(t=>t.question.toLowerCase().includes(d.toLowerCase())||t.answer.toLowerCase().includes(d.toLowerCase())||e.toLowerCase().includes(d.toLowerCase())):f,[e,d,f]);return u!==void 0&&p.length===0?o(l,{children:s(t,{center:!1,children:[o(t.Title,{title:`No Questions Found`}),o(t.Description,{text:`No questions or answers matches your search in this category`})]})}):p.length===0?null:s(l,{children:[o(i,{variant:`h4`,children:e}),p.map(e=>o(n,{...e},e.id))]})};export{u as Category};
1
+ import{Typography as e}from"../../../molecules/index.js";import{Question as t}from"./Question/Question.js";import{Container as n,Content as r,Header as i}from"./Category.styles.js";import{Subcategory as a}from"./Subcategory.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=({faqs:c,id:l,categoryName:u,subCategories:d})=>s(n,{children:[o(i,{id:`category-${l}`,children:o(e,{variant:`h4`,children:u})}),s(r,{children:[c?.map(e=>o(t,{...e},e.id)),d?.map(e=>o(a,{...e},e.id))]})]});export{c as Category};
@@ -0,0 +1,14 @@
1
+ import{spacings as e}from"../../../atoms/style/spacings.js";import{HEADER_HEIGHT as t}from"../Faq.utils.js";import n from"styled-components";const r=n.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ margin-top: ${e.large};
5
+ gap: ${e.medium};
6
+ `,i=n.div`
7
+ display: flex;
8
+ flex-direction: column;
9
+ `,a=n.div`
10
+ display: flex;
11
+ gap: ${e.small};
12
+ align-items: center;
13
+ scroll-margin-top: ${t}px;
14
+ `;export{r as Container,i as Content,a as Header};
@@ -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_runtime4 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_runtime4.JSX.Element;
35
+ }: FilterProps<T>): react_jsx_runtime5.JSX.Element;
36
36
  //#endregion
37
37
  export { Filter };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Filter/SortMenu.d.ts
4
4
  interface SortMenuProps<S> {
@@ -13,6 +13,6 @@ declare function SortMenu<S>({
13
13
  value,
14
14
  onChange,
15
15
  items
16
- }: SortMenuProps<S>): react_jsx_runtime5.JSX.Element;
16
+ }: SortMenuProps<S>): react_jsx_runtime4.JSX.Element;
17
17
  //#endregion
18
18
  export { SortMenu };
@@ -1,4 +1,4 @@
1
- import * as react121 from "react";
1
+ import * as react117 from "react";
2
2
  import { HTMLAttributes, ReactNode } from "react";
3
3
 
4
4
  //#region src/organisms/SideBar/SideBar.d.ts
@@ -16,6 +16,6 @@ interface SideBarWithCreate extends SideBarProps {
16
16
  createDisabled?: boolean;
17
17
  createActive?: boolean;
18
18
  }
19
- declare const SideBar: react121.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react121.RefAttributes<HTMLDivElement>>;
19
+ declare const SideBar: react117.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react117.RefAttributes<HTMLDivElement>>;
20
20
  //#endregion
21
21
  export { SideBar };
@@ -1,10 +1,10 @@
1
- import * as react132 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: react132.ForwardRefExoticComponent<ActionProps & react132.RefAttributes<HTMLButtonElement>>;
8
+ declare const Action: react129.ForwardRefExoticComponent<ActionProps & react129.RefAttributes<HTMLButtonElement>>;
9
9
  //#endregion
10
10
  export { Action };
@@ -1,9 +1,9 @@
1
- import * as react130 from "react";
1
+ import * as react127 from "react";
2
2
 
3
3
  //#region src/organisms/Status/Description.d.ts
4
4
  interface DescriptionProps {
5
5
  text?: string;
6
6
  }
7
- declare const Description: react130.ForwardRefExoticComponent<DescriptionProps & react130.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Description: react127.ForwardRefExoticComponent<DescriptionProps & react127.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Description };
@@ -1,4 +1,4 @@
1
- import * as react134 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: react134.ForwardRefExoticComponent<MissingAccessesProps & react134.RefAttributes<HTMLDivElement>>;
12
+ declare const MissingAccesses: react125.ForwardRefExoticComponent<MissingAccessesProps & react125.RefAttributes<HTMLDivElement>>;
13
13
  //#endregion
14
14
  export { MissingAccesses };
@@ -1,9 +1,9 @@
1
- import * as react128 from "react";
1
+ import * as react123 from "react";
2
2
 
3
3
  //#region src/organisms/Status/Title.d.ts
4
4
  interface TitleProps {
5
5
  title?: string;
6
6
  }
7
- declare const Title: react128.ForwardRefExoticComponent<TitleProps & react128.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Title: react123.ForwardRefExoticComponent<TitleProps & react123.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_runtime7 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_runtime7.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_runtime8 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_runtime8.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_runtime11 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_runtime11.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_runtime10 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_runtime10.JSX.Element;
16
16
  //#endregion
17
17
  export { 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;
@@ -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 +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;