@equinor/amplify-component-lib 9.17.0-beta.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
- package/dist/atoms/hooks/useSelect.d.ts +3 -3
- package/dist/atoms/types/Guidelines.d.ts +1 -1
- package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
- package/dist/deprecated/IconToggleButton.d.ts +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/molecules/Chip/Chip.d.ts +2 -2
- package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
- package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/molecules/Dialog/Dialog.d.ts +2 -2
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- package/dist/molecules/FileUploadArea/FileUploadArea.js +1 -1
- package/dist/molecules/IconCell/IconCell.d.ts +2 -2
- package/dist/molecules/IconCell/IconCell.styles.js +1 -1
- package/dist/molecules/IconCell/IconCell.types.d.ts +6 -5
- package/dist/molecules/IconCell/IconCell.types.js +1 -1
- package/dist/molecules/IconCell/IconCell.utils.js +2 -2
- package/dist/molecules/ListItem/ListItem.d.ts +2 -2
- package/dist/molecules/OptionDrawer/OptionDrawer.d.ts +2 -2
- package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
- package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
- package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +6 -6
- package/dist/molecules/RichTextEditor/index.d.ts +6 -6
- package/dist/molecules/Search/Search.d.ts +2 -2
- package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
- package/dist/molecules/Select/Select.styles.d.ts +5 -5
- package/dist/molecules/Select/Select.styles.js +0 -1
- package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
- package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
- package/dist/molecules/SelectionControls/Switch/Switch.d.ts +2 -2
- package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +3 -3
- package/dist/molecules/Stepper/Step/Step.js +8 -8
- package/dist/molecules/Stepper/Stepper.js +6 -4
- package/dist/molecules/TextField/TextField.d.ts +12 -0
- package/dist/molecules/TextField/TextField.js +3 -3
- package/dist/molecules/index.d.ts +4 -5
- package/dist/molecules/index.js +1 -1
- package/dist/organisms/DataGrid/DataGrid.d.ts +2 -2
- package/dist/organisms/Faq/Category/Category.js +2 -2
- package/dist/organisms/Faq/Header.js +2 -2
- package/dist/organisms/ReleaseNote/ReleaseNote.d.ts +3 -3
- package/dist/organisms/ReleaseNotesPage/ReleaseNoteFilter.js +12 -0
- package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.d.ts +6 -0
- package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.js +1 -0
- package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.styles.js +35 -0
- package/dist/organisms/ReleaseNotesPage/ReleaseNotesPage.utils.js +1 -0
- package/dist/organisms/ReleaseNotesPage/ReleasePosts/ReleasePost/ReleasePost.js +1 -0
- package/dist/organisms/ReleaseNotesPage/ReleasePosts/ReleasePost/ReleasePostSkeleton.js +37 -0
- package/dist/organisms/ReleaseNotesPage/ReleasePosts/ReleasePosts.js +17 -0
- package/dist/organisms/ReleaseNotesPage/hooks/useFilteredReleaseNotes.js +1 -0
- package/dist/organisms/ReleaseNotesPage/hooks/useReleaseNotesFilters.js +1 -0
- package/dist/organisms/SideBar/CreateItem.styles.js +8 -6
- package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
- package/dist/organisms/SideBar/MenuItem/MenuItem.styles.js +0 -1
- package/dist/organisms/SideBar/SideBar.d.ts +2 -2
- package/dist/organisms/Status/Action.d.ts +2 -2
- package/dist/organisms/Status/Description.d.ts +2 -2
- package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
- package/dist/organisms/Status/Title.d.ts +2 -2
- package/dist/organisms/Template/Template.d.ts +5 -5
- package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
- package/dist/organisms/TopBar/Actions.d.ts +2 -2
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
- package/dist/organisms/TopBar/Guidelines/Guidelines.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/Header/Header.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/Header/Header.styles.js +2 -5
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.js +1 -1
- package/dist/organisms/TopBar/Settings.js +1 -1
- package/dist/organisms/TopBar/TopBar.d.ts +1 -0
- package/dist/organisms/index.d.ts +1 -0
- package/dist/organisms/index.js +1 -1
- package/dist/providers/ReleaseNotesProvider.d.ts +0 -1
- package/dist/providers/ReleaseNotesProvider.js +1 -1
- package/dist/providers/TableOfContentsProvider.js +1 -1
- package/package.json +6 -4
- package/dist/molecules/ContentMenu/ContentMenu.d.ts +0 -17
- package/dist/molecules/ContentMenu/ContentMenu.js +0 -1
- package/dist/molecules/ContentMenu/ContentMenu.styles.js +0 -52
- package/dist/molecules/SingleFilterMenu/SingleFilterMenu.d.ts +0 -15
- package/dist/molecules/SingleFilterMenu/SingleFilterMenu.js +0 -20
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesDialog.utils.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react134 from "react";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/Actions.d.ts
|
|
5
|
-
declare const Actions:
|
|
5
|
+
declare const Actions: react134.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react134.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Actions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Field } from "../../../atoms/types/Field.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react132 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/FieldMenu/FieldMenu.d.ts
|
|
5
5
|
interface FieldMenuProps {
|
|
@@ -9,6 +9,6 @@ interface FieldMenuProps {
|
|
|
9
9
|
itemNameSingular?: string;
|
|
10
10
|
showAccessITLink?: boolean;
|
|
11
11
|
}
|
|
12
|
-
declare const FieldMenu:
|
|
12
|
+
declare const FieldMenu: react132.ForwardRefExoticComponent<FieldMenuProps & react132.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { FieldMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TopBarMenu as e}from"../TopBarMenu.js";import{TopBarButton as t}from"../TopBar.styles.js";import{Colorbox as n}from"./Colorbox.js";import{Item as r}from"./Item.js";import{Section as i}from"./Section.js";import{isValidElement as a,useRef as o,useState as s}from"react";import{Icon as c}from"@equinor/eds-core-react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{info_circle as f}from"@equinor/eds-icons";const p=({sections:p})=>{let[m,h]=s(!1),g=o(null),_=()=>{h(
|
|
1
|
+
import{TopBarMenu as e}from"../TopBarMenu.js";import{TopBarButton as t}from"../TopBar.styles.js";import{Colorbox as n}from"./Colorbox.js";import{Item as r}from"./Item.js";import{Section as i}from"./Section.js";import{isValidElement as a,useRef as o,useState as s}from"react";import{Icon as c}from"@equinor/eds-core-react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{info_circle as f}from"@equinor/eds-icons";const p=({sections:p})=>{let[m,h]=s(!1),g=o(null),_=()=>{h(e=>!e)};return d(l,{children:[u(t,{variant:`ghost_icon`,ref:g,onClick:_,"data-testid":`show-hide-button`,children:u(c,{data:f})},`topbar-notifications`),u(e,{open:m,anchorEl:g.current,onClose:_,withGap:!0,children:p.map((e,t)=>u(i,{title:e.sectionName,children:e.items.map((e,i)=>a(e)?e:`element`in e?u(r,{title:e.title,children:e.element},`${i}-${t}`):d(r,{title:e.title,children:[e.colorBox&&u(n,{"data-testid":`color-box-${e.title}`,$color:e.color}),u(c,{data:e.icon,color:e.color,size:24})]},`${i}-${t}`))},`section-${e.sectionName}`))})]})};p.displayName=`TopBar.Guidelines`;export{p as Guidelines};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react121 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:
|
|
9
|
+
declare const NotificationContext: react121.Context<NotificationContext | undefined>;
|
|
10
10
|
declare const useNotification: () => NotificationContext;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNotification };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useReleaseNotes as e}from"../../../../../providers/ReleaseNotesProvider.js";import{
|
|
1
|
+
import{useReleaseNotes as e}from"../../../../../providers/ReleaseNotesProvider.js";import{Wrapper as t}from"./Header.styles.js";import{Button as n,Icon as r,Typography as i}from"@equinor/eds-core-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{close as s}from"@equinor/eds-icons";const c=()=>{let{setOpen:c}=e();return o(t,{children:[a(i,{variant:`h1`,bold:!0,children:`What's new?`}),a(n,{variant:`ghost_icon`,onClick:()=>{c(!1)},"aria-label":`close modal`,children:a(r,{data:s})})]})};export{c as Header};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"styled-components";const t=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
|
-
|
|
5
|
-
display: flex;
|
|
6
|
-
gap: ${e.medium};
|
|
7
|
-
`;export{r as ButtonContainer,n as Wrapper};
|
|
4
|
+
`;export{t as Wrapper};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Status as e}from"../../../Status/index.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{useReleaseNotes as n}from"../../../../providers/ReleaseNotesProvider.js";import{Button as r}from"../../../../molecules/Button/Button.js";import{Header as i}from"./Header/Header.js";import{AllReleaseNotesWrapper as a,LoadingWrapper as o,StyledDialog as s}from"./ReleaseNotesDialog.styles.js";import{ReleaseNote as c}from"../../../ReleaseNote/ReleaseNote.js";import{CircularProgress as l}from"@equinor/eds-core-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{ReleaseNotesService as
|
|
1
|
+
import{Status as e}from"../../../Status/index.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{useReleaseNotes as n}from"../../../../providers/ReleaseNotesProvider.js";import{Button as r}from"../../../../molecules/Button/Button.js";import{Header as i}from"./Header/Header.js";import{AllReleaseNotesWrapper as a,LoadingWrapper as o,StyledDialog as s}from"./ReleaseNotesDialog.styles.js";import{ReleaseNote as c}from"../../../ReleaseNote/ReleaseNote.js";import{CircularProgress as l}from"@equinor/eds-core-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{Link as p}from"@tanstack/react-router";import{ReleaseNotesService as m,useReleaseNotesQuery as h}from"@equinor/subsurface-app-management";const g=({enabled:g})=>{let{setOpen:_,open:v,mostRecentReleaseNote:y}=n(),{isLoading:b}=h({enabled:g}),{isPrefetching:x}=t({richTextValues:y?.body?[y.body]:[],onImageRead:m.getReleaseNoteImage});return f(s,{open:v,onClose:()=>{_(!1)},isDismissable:!0,children:[d(i,{}),b||x?d(o,{children:d(l,{})}):y?f(u,{children:[d(c,{...y,expanded:!0}),d(a,{children:d(r,{as:p,variant:`ghost`,to:`/release-notes`,children:`See all release notes`})})]}):f(e,{children:[d(e.Title,{title:`No published release notes`}),d(e.Description,{text:`This application has no published release notes yet.`})]})]})};export{g as ReleaseNotesDialog};
|
|
@@ -22,4 +22,4 @@ import{spacings as e}from"../../atoms/style/spacings.js";import{elevation as t}f
|
|
|
22
22
|
padding-top: ${e.small};
|
|
23
23
|
padding-left: ${e.medium};
|
|
24
24
|
}
|
|
25
|
-
`,x=({allSettings:e,children:t})=>{let p=c(null),[x,S]=l(!1),C=o(r),w=()=>S(!1),T=()=>S(!x),E=s(()=>C?[{title:`Theme`,value:C.theme,onChange:e=>C.setTheme(e),items:[{label:`Light Mode`,name:`theme-group`,value:n.LIGHT,colorBox:`#ffffff`},{label:`Dark Mode`,name:`theme-group`,value:n.DARK,colorBox:`#243746`}]},...e??[]]:e??[],[e,C]);if(E.length===0)throw Error(`Empty settings in TopBar.Settings!`);return g(m,{children:[h(a,{variant:`ghost_icon`,onClick:T,ref:p,children:h(u,{data:_,size:24})}),g(i,{open:x,title:`Settings`,onClose:w,anchorEl:p.current,children:[h(b,{children:E.map((e,t)=>g(`div`,{children:[h(f,{variant:`overline`,children:e.title}),e.items.map((t,n)=>g(v,{children:[h(d,{id:t.label,disabled:t.disabled,label:t.label,name:e.title,value:`${t.label}-${n}`,checked:e.value===t.value,onChange:()=>e.onChange?.(t.value)}),t.colorBox&&h(y,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&h(f,{variant:`h6`,children:t.text}),t.element&&t.element]},n))]},t))}),t]})]})};x.displayName=`TopBar.Settings`;export{x as Settings};
|
|
25
|
+
`,x=({allSettings:e,children:t})=>{let p=c(null),[x,S]=l(!1),C=o(r),w=()=>S(!1),T=()=>S(!x),E=s(()=>C?[{title:`Theme`,value:C.theme,onChange:e=>C.setTheme(e),items:[{label:`Light Mode`,name:`theme-group`,value:n.LIGHT,colorBox:`#ffffff`},{label:`Dark Mode`,name:`theme-group`,value:n.DARK,colorBox:`#243746`}]},...e??[]]:e??[],[e,C]);if(E.length===0)throw Error(`Empty settings in TopBar.Settings!`);return g(m,{children:[h(a,{variant:`ghost_icon`,onClick:T,ref:p,"data-testid":`show-hide-button`,children:h(u,{data:_,size:24})}),g(i,{open:x,title:`Settings`,onClose:w,anchorEl:p.current,children:[h(b,{children:E.map((e,t)=>g(`div`,{children:[h(f,{variant:`overline`,children:e.title}),e.items.map((t,n)=>g(v,{children:[h(d,{id:t.label,disabled:t.disabled,label:t.label,name:e.title,value:`${t.label}-${n}`,checked:e.value===t.value,onChange:()=>e.onChange?.(t.value)}),t.colorBox&&h(y,{$color:t.colorBox,"data-testid":`colorbox-${t.colorBox}`}),t.text&&h(f,{variant:`h6`,children:t.text}),t.element&&t.element]},n))]},t))}),t]})]})};x.displayName=`TopBar.Settings`;export{x as Settings};
|
|
@@ -3,6 +3,7 @@ import { EnvironmentType } from "../../atoms/enums/Environment.js";
|
|
|
3
3
|
import React, { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/organisms/TopBar/TopBar.d.ts
|
|
6
|
+
|
|
6
7
|
declare const TopBar: React.ForwardRefExoticComponent<{
|
|
7
8
|
applicationIcon: string;
|
|
8
9
|
applicationName: string;
|
|
@@ -19,6 +19,7 @@ import { PageTitle } from "./PageTitle/PageTitle.js";
|
|
|
19
19
|
import { ReleaseNote, ReleaseNoteProps } from "./ReleaseNote/ReleaseNote.js";
|
|
20
20
|
import { ToggleGroup } from "./ToggleGroup/index.js";
|
|
21
21
|
import { Faq } from "./Faq/Faq.js";
|
|
22
|
+
import { ReleaseNotesPage } from "./ReleaseNotesPage/ReleaseNotesPage.js";
|
|
22
23
|
import { Card as Card$1, CardProps } from "@equinor/eds-core-react";
|
|
23
24
|
import { EdsDataGridProps as DataGridProps } from "@equinor/eds-data-grid-react";
|
|
24
25
|
export { Card$1 as Card, type CardProps, type DataGridProps };
|
package/dist/organisms/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Status as e}from"./Status/index.js";import{MissingAccessToApp as t}from"./Status/collections/MissingAccessToApp.js";import{DataGrid as n}from"./DataGrid/DataGrid.js";import{Template as r}from"./Template/Template.js";import{FieldSelector as i}from"./FieldSelector/FieldSelector.js";import{Filter as a}from"./Filter/index.js";import{SideBar as o}from"./SideBar/index.js";import{ReleaseNote as s}from"./ReleaseNote/ReleaseNote.js";import{TopBar as c}from"./TopBar/index.js";import{BadRequest as l}from"./Status/collections/BadRequest.js";import{GenericError as u}from"./Status/collections/GenericError.js";import{MissingPermissions as d}from"./Status/collections/MissingPermissions.js";import{PageNotFound as f}from"./Status/collections/PageNotFound.js";import{ServerError as p}from"./Status/collections/ServerError.js";import{ApiResponseError as m}from"./Status/collections/ApiResponseError.js";import{TableOfContents as h}from"./TableOfContents/TableOfContents.js";import{PageTitle as g}from"./PageTitle/PageTitle.js";import{ToggleGroup as _}from"./ToggleGroup/index.js";import{Faq as v}from"./Faq/Faq.js";import{
|
|
1
|
+
import{Status as e}from"./Status/index.js";import{MissingAccessToApp as t}from"./Status/collections/MissingAccessToApp.js";import{DataGrid as n}from"./DataGrid/DataGrid.js";import{Template as r}from"./Template/Template.js";import{FieldSelector as i}from"./FieldSelector/FieldSelector.js";import{Filter as a}from"./Filter/index.js";import{SideBar as o}from"./SideBar/index.js";import{ReleaseNote as s}from"./ReleaseNote/ReleaseNote.js";import{TopBar as c}from"./TopBar/index.js";import{BadRequest as l}from"./Status/collections/BadRequest.js";import{GenericError as u}from"./Status/collections/GenericError.js";import{MissingPermissions as d}from"./Status/collections/MissingPermissions.js";import{PageNotFound as f}from"./Status/collections/PageNotFound.js";import{ServerError as p}from"./Status/collections/ServerError.js";import{ApiResponseError as m}from"./Status/collections/ApiResponseError.js";import{TableOfContents as h}from"./TableOfContents/TableOfContents.js";import{PageTitle as g}from"./PageTitle/PageTitle.js";import{ToggleGroup as _}from"./ToggleGroup/index.js";import{Faq as v}from"./Faq/Faq.js";import{ReleaseNotesPage as y}from"./ReleaseNotesPage/ReleaseNotesPage.js";import{Card as b}from"@equinor/eds-core-react";export{b as Card};
|
|
@@ -6,7 +6,6 @@ interface ReleaseNotesContextState {
|
|
|
6
6
|
open: boolean;
|
|
7
7
|
setOpen: (open: boolean) => void;
|
|
8
8
|
mostRecentReleaseNote: ReleaseNote | undefined;
|
|
9
|
-
showAllReleaseNotesLink: string;
|
|
10
9
|
}
|
|
11
10
|
declare const useReleaseNotes: () => ReleaseNotesContextState;
|
|
12
11
|
interface ReleaseNotesContextProviderProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useLocalStorage as e}from"../atoms/hooks/useLocalStorage.js";import{usingReleaseNoteDate as t}from"../organisms/ReleaseNote/ReleaseNote.utils.js";import{sortReleaseNotesByDate as n}from"./ReleaseNotesProvider.utils.js";import{createContext as r,useContext as i,useEffect as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";import{useReleaseNotesQuery as c}from"@equinor/subsurface-app-management";const l=r(void 0),u=()=>{let e=i(l);if(e===void 0)throw Error(`useReleaseNotes must be used within a ReleaseNotesProvider`);return e},d=1e3*60*60*24*14,f=({children:r,enabled:i,popUpNewReleaseNote:u=!1})=>{let{data:f}=c({enabled:i}),[p,m]=o(!1),[h,g]=e(`release-notes-was-viewed-key`,``,d),_=f?.toSorted(n).at(0);return a(()=>{if(!_||!u)return;let e=new Date(t(_)).getTime();Date.now()-e<=d&&h!==_.releaseId&&(m(!0),g(_.releaseId))},[h,_,u,g]),s(l.Provider,{value:{open:p,setOpen:m,mostRecentReleaseNote:_},children:r})};export{f as ReleaseNotesProvider,u as useReleaseNotes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useOnScreenMultiple as e}from"../atoms/hooks/useOnScreenMultiple.js";import{getValues as t}from"./TableOfContentsProvider.utils.js";import{createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import{useLocation as u,useNavigate as d}from"@tanstack/react-router";const f=n(void 0);function p(){let e=i(f);if(e===void 0)throw Error(`'useTableOfContents' must be used within provider`);return e}const m=({items:n,children:i,hashNavigation:p})=>{let m=d(),{hash:h}=u(),[g,_]=c(n[0]?.value),[v,y]=c([]),b=s(!1),x=o(()=>n.flatMap(e=>t([],e)),[n]);a(()=>{y(x.map(e=>document.getElementById(e)))},[x]),a(()=>{h.length||(b.current=!0)},[h]);let S=r(e=>e.value===g?!0:e.children&&g?t([],e).includes(g):!1,[g]),C=e(v),w=s(-1),T=r((e,t)=>{let n=x.findIndex(t=>t===e);if(p){_(x[n]),m({to:`.`,hash:`#${x[n]}`,hashScrollIntoView:!1,replace:!0});return}let r=v[n];if(r){let e=t?.behavior??`smooth`;r.scrollIntoView({block:`start`,behavior:e}),w.current=n;let i=1/0,a=0,o=()=>{let e=r?.getBoundingClientRect().top;if(e===i){if(a+=1,a>1){_(x[n]),w.current=-1;return}}else a=0,i=e;requestAnimationFrame(o)};requestAnimationFrame(o)}},[v,p,m,x]);return a(()=>{if(h&&!b.current){b.current=!0;let e=decodeURIComponent(h.replace(`#`,``));if(!e.length||!x.includes(e))return;_(e),m({to:`.`,hash:`#${e}`,hashScrollIntoView:{block:`start
|
|
1
|
+
import{useOnScreenMultiple as e}from"../atoms/hooks/useOnScreenMultiple.js";import{getValues as t}from"./TableOfContentsProvider.utils.js";import{createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import{useLocation as u,useNavigate as d}from"@tanstack/react-router";const f=n(void 0);function p(){let e=i(f);if(e===void 0)throw Error(`'useTableOfContents' must be used within provider`);return e}const m=({items:n,children:i,hashNavigation:p})=>{let m=d(),{hash:h}=u(),[g,_]=c(n[0]?.value),[v,y]=c([]),b=s(!1),x=o(()=>n.flatMap(e=>t([],e)),[n]);a(()=>{y(x.map(e=>document.getElementById(e)))},[x]),a(()=>{h.length||(b.current=!0)},[h]);let S=r(e=>e.value===g?!0:e.children&&g?t([],e).includes(g):!1,[g]),C=e(v),w=s(-1),T=r((e,t)=>{let n=x.findIndex(t=>t===e);if(p){_(x[n]),m({to:`.`,hash:`#${x[n]}`,hashScrollIntoView:!1,replace:!0});return}let r=v[n];if(r){let e=t?.behavior??`smooth`;r.scrollIntoView({block:`start`,behavior:e}),w.current=n;let i=1/0,a=0,o=()=>{let e=r?.getBoundingClientRect().top;if(e===i){if(a+=1,a>1){_(x[n]),w.current=-1;return}}else a=0,i=e;requestAnimationFrame(o)};requestAnimationFrame(o)}},[v,p,m,x]);return a(()=>{if(h&&!b.current){b.current=!0;let e=decodeURIComponent(h.replace(`#`,``));if(!e.length||!x.includes(e))return;_(e),m({to:`.`,hash:`#${e}`,hashScrollIntoView:{behavior:`instant`,block:`start`},replace:!0})}},[h,m,x]),a(()=>{if(C.length===0||C.length!==x.length||w.current!==-1||!b.current)return;let e=-1;for(let t=C.length-1;t>=0;t--)C[t]&&(e=t);e===-1||x.at(e)===void 0||(_(x[e]),p&&m({to:`.`,hash:`#${x[e]}`,hashScrollIntoView:!1,replace:!0}))},[T,p,m,x,C]),l(f.Provider,{value:{items:n,selected:g,setSelected:T,isActive:S},children:i})};export{m as TableOfContentsProvider,p as useTableOfContents};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/amplify-component-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Frontend Typescript components for the Amplify team",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -48,13 +48,15 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@azure/msal-browser": "3.28.0",
|
|
51
|
-
"@azure/msal-react": "2.2.0"
|
|
51
|
+
"@azure/msal-react": "2.2.0",
|
|
52
|
+
"@storybook/addon-vitest": "^9.1.10"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"@equinor/eds-icons": "^0.22.0",
|
|
55
|
-
"@equinor/subsurface-app-management": "
|
|
56
|
+
"@equinor/subsurface-app-management": "5.0.0",
|
|
56
57
|
"@eslint/js": "^9.22.0",
|
|
57
58
|
"@faker-js/faker": "^9.6.0",
|
|
59
|
+
"@storybook/addon-coverage": "^2.0.0",
|
|
58
60
|
"@storybook/addon-designs": "^10.0.2",
|
|
59
61
|
"@storybook/addon-docs": "^9.1.1",
|
|
60
62
|
"@storybook/addon-links": "^9.1.1",
|
|
@@ -110,7 +112,7 @@
|
|
|
110
112
|
},
|
|
111
113
|
"peerDependencies": {
|
|
112
114
|
"@equinor/eds-icons": "*",
|
|
113
|
-
"@equinor/subsurface-app-management": "
|
|
115
|
+
"@equinor/subsurface-app-management": "^5.0.0",
|
|
114
116
|
"@tanstack/react-query": "*",
|
|
115
117
|
"@tanstack/react-router": "*",
|
|
116
118
|
"react": "^19.0.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/molecules/ContentMenu/ContentMenu.d.ts
|
|
4
|
-
interface ContentMenuItemType {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
children?: ContentMenuItemType[];
|
|
8
|
-
}
|
|
9
|
-
interface ContentMenuProps {
|
|
10
|
-
items: ContentMenuItemType[];
|
|
11
|
-
value: string;
|
|
12
|
-
onChange: (value: string) => void;
|
|
13
|
-
isLoading?: boolean;
|
|
14
|
-
}
|
|
15
|
-
declare const ContentMenu: FC<ContentMenuProps>;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { ContentMenu, ContentMenuProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Container as e,ContentMenuChildItem as t,ContentMenuItem as n,ContentMenuItemSkeleton as r}from"./ContentMenu.styles.js";import{useCallback as i,useMemo as a,useState as o}from"react";import{Icon as s}from"@equinor/eds-core-react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{chevron_down as u,chevron_up as d}from"@equinor/eds-icons";const f=({items:f,value:p,onChange:m,isLoading:h=!1})=>{let[g,_]=o([]),v=i((e,t)=>{t&&(g.findIndex(t=>t===e)>=0?_(t=>t.filter(t=>t!==e)):_(t=>[...t,e])),m(e)},[m,g]),y=a(()=>{let e=[];for(let r of f)if(e.push(l(n,{$active:p===r.value,onClick:()=>v(r.value,!!r.children),children:[r.children&&c(s,{data:g.includes(r.value)?d:u}),r.label]},`content-menu-item-${r.label}`)),r.children&&g.includes(r.value))for(let n of r.children)e.push(c(t,{$active:p===n.value,onClick:()=>v(n.value,!1),children:n.label},`content-menu-item-${n.label}`));return e},[v,f,g,p]);return h?c(e,{"data-testid":`content-menu-container`,children:[,,,,,].fill(0).map((e,t)=>c(r,{$offset:t*100},`content-menu-item-skeleton-${e+t}`))}):c(e,{"data-testid":`content-menu-container`,children:y})};export{f as ContentMenu};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{shape as n}from"../../atoms/style/index.js";import{SkeletonBase as r}from"../Skeleton/SkeletonBase/SkeletonBase.js";import i from"styled-components";const a=i.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: ${t.small};
|
|
5
|
-
`,o=i.button`
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
gap: ${t.xx_small};
|
|
9
|
-
color: ${e.text.static_icons__default.rgba};
|
|
10
|
-
border: none;
|
|
11
|
-
border-radius: ${n.corners.borderRadius};
|
|
12
|
-
min-width: 150px;
|
|
13
|
-
width: fit-content;
|
|
14
|
-
padding: ${t.medium_small} ${t.medium};
|
|
15
|
-
text-align: left;
|
|
16
|
-
background: ${t=>t.$active?e.interactive.primary__hover_alt.rgba:`none`};
|
|
17
|
-
transition: background 150ms;
|
|
18
|
-
&:hover {
|
|
19
|
-
background: ${e.interactive.primary__hover_alt.rgba};
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
}
|
|
22
|
-
font-family: 'Equinor', sans-serif;
|
|
23
|
-
font-weight: 700;
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
`,s=i.button`
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
gap: ${t.xx_small};
|
|
29
|
-
color: ${e.text.static_icons__default.rgba};
|
|
30
|
-
border: none;
|
|
31
|
-
margin-left: ${t.medium_small};
|
|
32
|
-
border-radius: ${n.corners.borderRadius};
|
|
33
|
-
min-width: calc(150px - ${t.medium_small});
|
|
34
|
-
width: fit-content;
|
|
35
|
-
padding: ${t.medium_small} ${t.medium};
|
|
36
|
-
text-align: left;
|
|
37
|
-
background: ${t=>t.$active?e.interactive.primary__hover_alt.rgba:`none`};
|
|
38
|
-
transition: background 400ms;
|
|
39
|
-
&:hover {
|
|
40
|
-
background: ${e.interactive.primary__hover_alt.rgba};
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
}
|
|
43
|
-
font-family: 'Equinor', sans-serif;
|
|
44
|
-
font-weight: 700;
|
|
45
|
-
font-size: 14px;
|
|
46
|
-
`,c=i(r)`
|
|
47
|
-
border: none;
|
|
48
|
-
border-radius: ${n.corners.borderRadius};
|
|
49
|
-
width: 150px;
|
|
50
|
-
height: 1rem;
|
|
51
|
-
padding: ${t.medium_small} 0;
|
|
52
|
-
`;export{a as Container,s as ContentMenuChildItem,o as ContentMenuItem,c as ContentMenuItemSkeleton};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { IconData } from "@equinor/eds-icons";
|
|
3
|
-
|
|
4
|
-
//#region src/molecules/SingleFilterMenu/SingleFilterMenu.d.ts
|
|
5
|
-
interface SingleFilterMenuProps {
|
|
6
|
-
onChange: (selectedId: string | undefined | null) => void;
|
|
7
|
-
customIcon?: IconData;
|
|
8
|
-
menuTitle: string;
|
|
9
|
-
data: string[];
|
|
10
|
-
showChip?: boolean;
|
|
11
|
-
chipColor?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const SingleFilterMenu: FC<SingleFilterMenuProps>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { SingleFilterMenu, SingleFilterMenuProps };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{spacings as t}from"../../atoms/style/spacings.js";import n,{useState as r}from"react";import{Button as i,Chip as a,Icon as o,Menu as s,Typography as c}from"@equinor/eds-core-react";import l from"styled-components";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{filter_list as f}from"@equinor/eds-icons";const{colors:p}=e,m=l.div`
|
|
2
|
-
margin-left: auto;
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
gap: 25px;
|
|
6
|
-
`,h=l(a)`
|
|
7
|
-
background: ${e=>e.$backgroundColor};
|
|
8
|
-
`,g=l(i)`
|
|
9
|
-
justify-self: flex-end;
|
|
10
|
-
`,_=l(s)`
|
|
11
|
-
overflow-y: auto;
|
|
12
|
-
`,v=l.div`
|
|
13
|
-
padding: ${t.medium};
|
|
14
|
-
padding-left: ${t.large};
|
|
15
|
-
`,y=l(s.Item)`
|
|
16
|
-
&:focus {
|
|
17
|
-
outline: none;
|
|
18
|
-
background: ${p.ui.background__light.rgba};
|
|
19
|
-
}
|
|
20
|
-
`,b=({onChange:e,customIcon:t,menuTitle:n,data:i,showChip:a=!1,chipColor:s=p.ui.background__default.rgba})=>{let[l,b]=r(!1),[x,S]=r(null),[C,w]=r(),T=e=>{let t=e.target;S(t),b(!l)},E=()=>b(!1),D=t=>{b(!1),C===t?(w(void 0),e(void 0)):(w(t),e(t))},O=()=>{E(),e(void 0),w(void 0)};return d(m,{children:[a&&C&&u(h,{"data-testid":`chip`,onDelete:O,variant:`default`,$backgroundColor:s,children:C}),u(g,{"data-testid":`menuButton`,variant:`ghost_icon`,onClick:e=>T(e),children:u(o,{data:t??f})}),d(_,{open:l,anchorEl:x,onClose:E,placement:`bottom-end`,"data-testid":`menuContainer`,children:[u(v,{children:u(c,{group:`navigation`,variant:`label`,children:n})}),i.map((e,t)=>u(y,{onClick:()=>D(e),disabled:C===e&&a,active:C===e&&!a,children:u(c,{group:`navigation`,variant:`menu_title`,as:`span`,children:e})},e+t))]})]})};b.displayName=`SingleFilterMenu`;export{b as SingleFilterMenu};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{EnvironmentType as e}from"../../../../atoms/enums/Environment.js";function t(t,n){return t&&t!==e.PRODUCTION?`https://client-subsurfappmanagement-frontend-${t}.radix.equinor.com/release-notes?filters={"applications"%3A["${encodeURIComponent(n)}"]}`:`https://subsurfappmanagement.equinor.com/release-notes?filters={"applications"%3A["${encodeURIComponent(n)}"]}`}export{t as environmentAndAppNameToURL};
|