@equinor/amplify-component-lib 9.15.3-beta.1 → 9.16.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/useLocalStorage.d.ts +2 -2
  2. package/dist/atoms/hooks/useSearchParameter.d.ts +12 -0
  3. package/dist/atoms/hooks/useSearchParameter.js +1 -0
  4. package/dist/atoms/hooks/useSelect.d.ts +3 -3
  5. package/dist/atoms/index.d.ts +1 -0
  6. package/dist/atoms/index.js +1 -1
  7. package/dist/atoms/utils/date.d.ts +1 -1
  8. package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
  9. package/dist/deprecated/IconToggleButton.d.ts +2 -2
  10. package/dist/index.d.ts +5 -1
  11. package/dist/index.js +1 -1
  12. package/dist/molecules/Chip/Chip.d.ts +2 -2
  13. package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
  14. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  15. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  16. package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
  17. package/dist/molecules/IconCell/IconCell.d.ts +54 -0
  18. package/dist/molecules/IconCell/IconCell.js +1 -0
  19. package/dist/molecules/IconCell/IconCell.styles.js +108 -0
  20. package/dist/molecules/IconCell/IconCell.types.d.ts +33 -0
  21. package/dist/molecules/IconCell/IconCell.types.js +1 -0
  22. package/dist/molecules/IconCell/IconCell.utils.js +8 -0
  23. package/dist/molecules/ListItem/ListItem.d.ts +2 -2
  24. package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
  25. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  26. package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +5 -5
  27. package/dist/molecules/RichTextEditor/index.d.ts +5 -5
  28. package/dist/molecules/Search/Search.d.ts +2 -2
  29. package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
  30. package/dist/molecules/Select/Select.styles.d.ts +4 -4
  31. package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
  32. package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
  33. package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
  34. package/dist/molecules/SelectionControls/Switch/Switch.d.ts +2 -2
  35. package/dist/molecules/Sieve/Sieve.js +1 -1
  36. package/dist/molecules/Sieve/Sieve.types.d.ts +2 -0
  37. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
  38. package/dist/molecules/Tabs/Tabs.types.d.ts +1 -1
  39. package/dist/molecules/index.d.ts +3 -0
  40. package/dist/molecules/index.js +1 -1
  41. package/dist/organisms/Faq/Category/Category.js +2 -2
  42. package/dist/organisms/Faq/Faq.js +1 -1
  43. package/dist/organisms/Faq/Header.js +2 -2
  44. package/dist/organisms/Filter/Filter.d.ts +2 -2
  45. package/dist/organisms/Filter/QuickFilter.d.ts +2 -2
  46. package/dist/organisms/Filter/SortMenu.d.ts +2 -2
  47. package/dist/organisms/ReleaseNote/ReleaseNote.d.ts +3 -3
  48. package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
  49. package/dist/organisms/SideBar/MenuItem/CollapsableMenuItem.js +1 -1
  50. package/dist/organisms/SideBar/MenuItem/MenuItem.styles.js +1 -1
  51. package/dist/organisms/SideBar/SideBar.d.ts +2 -2
  52. package/dist/organisms/Status/Action.d.ts +2 -2
  53. package/dist/organisms/Status/Description.d.ts +2 -2
  54. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  55. package/dist/organisms/Status/Title.d.ts +2 -2
  56. package/dist/organisms/Status/collections/BadRequest.js +1 -1
  57. package/dist/organisms/Status/collections/GenericError.js +1 -1
  58. package/dist/organisms/Status/collections/MissingPermissions.js +1 -1
  59. package/dist/organisms/Status/collections/PageNotFound.js +1 -1
  60. package/dist/organisms/Status/collections/ServerError.js +1 -1
  61. package/dist/organisms/TableOfContents/TableOfContents.styles.js +1 -1
  62. package/dist/organisms/Template/Template.d.ts +3 -3
  63. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  64. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  65. package/dist/organisms/TopBar/Actions.d.ts +2 -2
  66. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
  67. package/dist/organisms/TopBar/Guidelines/Colorbox.d.ts +2 -2
  68. package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
  69. package/dist/organisms/TopBar/TopBar.styles.js +1 -1
  70. package/dist/providers/StepperProvider.js +1 -1
  71. package/dist/providers/TableOfContentsProvider.js +1 -1
  72. package/package.json +8 -4
@@ -1,4 +1,4 @@
1
- import * as react117 from "react";
1
+ import * as react141 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: react117.Context<NotificationContext | undefined>;
9
+ declare const NotificationContext: react141.Context<NotificationContext | undefined>;
10
10
  declare const useNotification: () => NotificationContext;
11
11
  //#endregion
12
12
  export { useNotification };
@@ -1,4 +1,4 @@
1
- import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{Button as r,CircularProgress as i,TopBar as a,Typography as o}from"@equinor/eds-core-react";import s,{css as c}from"styled-components";import{Link as l}from"@tanstack/react-router";const u=s(a)`
1
+ import{EnvironmentType as e}from"../../atoms/enums/Environment.js";import{colors as t}from"../../atoms/style/colors.js";import{spacings as n}from"../../atoms/style/spacings.js";import{Button as r,CircularProgress as i,TopBar as a,Typography as o}from"@equinor/eds-core-react";import s,{css as c}from"styled-components";import{Link as l}from"react-router-dom";const u=s(a)`
2
2
  border-bottom: 1px solid ${t.ui.background__medium.rgba};
3
3
  padding-left: ${n.medium};
4
4
  align-content: center;
@@ -1 +1 @@
1
- import{createContext as e,useCallback as t,useContext as n,useState as r}from"react";import{jsx as i}from"react/jsx-runtime";import{useLocation as a,useNavigate as o,useParams as s}from"@tanstack/react-router";const c=e(void 0);function l(){let e=n(c);if(!e)throw Error(`useStepper must be used within a StepperProvider`);return e}const u=({steps:e,children:n,isStepDisabled:l,...u})=>{let{step:d}=s({strict:!1}),f=o(),p=a().pathname.split(`/`).slice(0,-1).join(`/`),m=u.syncToURLParam?Number(d):u?.initialStep??0;if(u.syncToURLParam&&d&&isNaN(Number(d)))throw Error(`Step URL param must be a valid number when using "syncToURLParam"`);if(e.length<2)throw Error(`Stepper must have at least 2 steps`);let[h,g]=r(m),_=u.syncToURLParam?Number(d):h,[v,y]=r(0);if(m>=e.length||m<0)throw Error(`initialStep must be a valid index of the steps array`);let b=e=>{u.syncToURLParam?f({to:`${p}/${e}`}):g(e)},x=()=>{v!==0&&y(0)},S=()=>{if(`subSteps`in e[_]&&e[_].subSteps&&v<e[_].subSteps.length-1){y(e=>e+1);return}_!==e.length-1&&(b(_+1),x())},C=()=>{if(v>0&&`subSteps`in e[_]&&e[_].subSteps&&e[_].subSteps.length>0){y(e=>e-1);return}if(_===0)return;b(_-1);let t=e.at(_-1);t&&`subSteps`in t&&t.subSteps&&y(t.subSteps.length-1)},w=t(t=>l?l({step:e[t],stepIndex:t,currentStep:e[_],currentStepIndex:_}):!1,[l,_,e]);return i(c.Provider,{value:{steps:e,currentStep:_,currentSubStep:v,setCurrentStep:b,goToNextStep:S,goToPreviousStep:C,isStepAtIndexDisabled:w},children:n})};export{u as StepperProvider,l as useStepper};
1
+ import{createContext as e,useCallback as t,useContext as n,useState as r}from"react";import{jsx as i}from"react/jsx-runtime";import{useLocation as a,useNavigate as o,useParams as s}from"react-router";const c=e(void 0);function l(){let e=n(c);if(!e)throw Error(`useStepper must be used within a StepperProvider`);return e}const u=({steps:e,children:n,isStepDisabled:l,...u})=>{let{step:d}=s(),f=o(),p=a().pathname.split(`/`).slice(0,-1).join(`/`),m=u.syncToURLParam?Number(d):u?.initialStep??0;if(u.syncToURLParam&&d&&isNaN(Number(d)))throw Error(`Step URL param must be a valid number when using "syncToURLParam"`);if(e.length<2)throw Error(`Stepper must have at least 2 steps`);let[h,g]=r(m),_=u.syncToURLParam?Number(d):h,[v,y]=r(0);if(m>=e.length||m<0)throw Error(`initialStep must be a valid index of the steps array`);let b=e=>{u.syncToURLParam?f(`${p}/${e}`):g(e)},x=()=>{v!==0&&y(0)},S=()=>{if(`subSteps`in e[_]&&e[_].subSteps&&v<e[_].subSteps.length-1){y(e=>e+1);return}_!==e.length-1&&(b(_+1),x())},C=()=>{if(v>0&&`subSteps`in e[_]&&e[_].subSteps&&e[_].subSteps.length>0){y(e=>e-1);return}if(_===0)return;b(_-1);let t=e.at(_-1);t&&`subSteps`in t&&t.subSteps&&y(t.subSteps.length-1)},w=t(t=>l?l({step:e[t],stepIndex:t,currentStep:e[_],currentStepIndex:_}):!1,[l,_,e]);return i(c.Provider,{value:{steps:e,currentStep:_,currentSubStep:v,setCurrentStep:b,goToNextStep:S,goToPreviousStep:C,isStepAtIndexDisabled:w},children:n})};export{u as StepperProvider,l as useStepper};
@@ -1 +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=>{if(e.value===g)return!0;if(e.children&&g){let n=t([],e);return n.includes(g)}return!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`,behavior:`instant`},replace:!0})}},[h,m,x]),a(()=>{if(C.length===0||C.length!==x.length||w.current!==-1||!b.current)return;let e=-1;for(let t=C.length-1;t>=0;t--)C[t]&&(e=t);e===-1||x.at(e)===void 0||(_(x[e]),p&&m({to:`.`,hash:`#${x[e]}`,hashScrollIntoView:!1,replace:!0}))},[T,p,m,x,C]),l(f.Provider,{value:{items:n,selected:g,setSelected:T,isActive:S},children:i})};export{m as TableOfContentsProvider,p as useTableOfContents};
1
+ import{useOnScreenMultiple as e}from"../atoms/hooks/useOnScreenMultiple.js";import{getValues as t}from"./TableOfContentsProvider.utils.js";import{createContext as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import{useLocation as u,useNavigate as d}from"react-router";const f=n(void 0);function p(){let e=i(f);if(e===void 0)throw Error(`'useTableOfContents' must be used within provider`);return e}const m=({items:n,children:i,hashNavigation:p})=>{let m=d(),{hash:h}=u(),[g,_]=c(n[0]?.value),[v,y]=c([]),[b,x]=c(h!==``),S=s(!1),C=o(()=>n.flatMap(e=>t([],e)),[n]);a(()=>{y(C.map(e=>document.getElementById(e)))},[C]),a(()=>{h.length||(S.current=!0)},[h]);let w=r(e=>{if(e.value===g)return!0;if(e.children&&g){let n=t([],e);return n.includes(g)}return!1},[g]),T=e(v),E=s(-1),D=r((e,t)=>{let n=C.findIndex(t=>t===e),r=v[n];if(r){let e=t?.shouldInstantlyJumpOnMount&&b?`instant`:t?.behavior??`smooth`;r.scrollIntoView({block:`start`,behavior:e}),E.current=n;let i=1/0,a=0,o=()=>{let e=r?.getBoundingClientRect().top;if(e===i){if(a+=1,a>1){_(C[n]),p&&(m(`#${C[n]}`,{replace:!0}),x(!1)),E.current=-1;return}}else a=0,i=e;requestAnimationFrame(o)};requestAnimationFrame(o)}},[v,p,m,b,C]);return a(()=>{if(T.length===0||T.length!==C.length||E.current!==-1)return;let e=-1;for(let t=T.length-1;t>=0;t--)T[t]&&(e=t);if(e===-1||C.at(e)===void 0)return;let t=h.replace(`#`,``);if(!S.current&&t.length&&C.includes(t)){D(t,{behavior:`instant`,shouldInstantlyJumpOnMount:!0}),S.current=!0;return}_(C[e]),p&&m(`#${C[e]}`,{replace:!0})},[p,m,C,T]),l(f.Provider,{value:{items:n,selected:g,setSelected:D,isActive:w},children:i})};export{m as TableOfContentsProvider,p as useTableOfContents};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "9.15.3-beta.1",
3
+ "version": "9.16.0",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@equinor/eds-icons": "^0.22.0",
55
- "@equinor/subsurface-app-management": ">=4.4.3-beta.0",
55
+ "@equinor/subsurface-app-management": "^4.4.3",
56
56
  "@eslint/js": "^9.22.0",
57
57
  "@faker-js/faker": "^9.6.0",
58
58
  "@storybook/addon-designs": "^10.0.2",
@@ -72,6 +72,7 @@
72
72
  "@types/random-seed": "^0.3.5",
73
73
  "@types/react": "^19.0.10",
74
74
  "@types/react-dom": "^19.0.4",
75
+ "@types/react-router-dom": "^5.3.3",
75
76
  "@types/styled-components": "^5.1.34",
76
77
  "@types/uuid": "^10.0.0",
77
78
  "@types/wicg-file-system-access": "^2023.10.5",
@@ -92,6 +93,8 @@
92
93
  "prettier": "^3.5.3",
93
94
  "react": "^19.0.0",
94
95
  "react-dom": "^19.0.0",
96
+ "react-router": "^6.28.0",
97
+ "react-router-dom": "^6.28.0",
95
98
  "resize-observer-polyfill": "^1.5.1",
96
99
  "resolve-tspaths": "^0.8.23",
97
100
  "storybook": "^9.1.1",
@@ -110,11 +113,12 @@
110
113
  },
111
114
  "peerDependencies": {
112
115
  "@equinor/eds-icons": "*",
113
- "@equinor/subsurface-app-management": ">=4.4.3-beta.0",
116
+ "@equinor/subsurface-app-management": ">=4.4.3",
114
117
  "@tanstack/react-query": "*",
115
- "@tanstack/react-router": "*",
116
118
  "react": "^19.0.0",
117
119
  "react-dom": "^19.0.0",
120
+ "react-router": "^6.28.0",
121
+ "react-router-dom": "^6.28.0",
118
122
  "@equinor/eds-core-react": "0.44.0",
119
123
  "@equinor/eds-data-grid-react": "^0.7.5",
120
124
  "@tiptap/core": "^3.1.0",