@equinor/amplify-component-lib 11.0.0 → 11.0.2

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 (31) hide show
  1. package/dist/atoms/hooks/useLocalStorage.d.ts +2 -2
  2. package/dist/atoms/hooks/useSelect.d.ts +3 -3
  3. package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
  4. package/dist/molecules/Chip/Chip.d.ts +2 -2
  5. package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
  6. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  7. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  8. package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
  9. package/dist/molecules/IconCell/IconCell.d.ts +2 -2
  10. package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +4 -4
  11. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  12. package/dist/molecules/RichTextEditor/index.d.ts +5 -5
  13. package/dist/molecules/Search/Search.d.ts +2 -2
  14. package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
  15. package/dist/molecules/TextField/TextField.js +1 -1
  16. package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
  17. package/dist/organisms/SideBar/MenuItem/CollapsableMenuItem.js +4 -4
  18. package/dist/organisms/SideBar/MenuItem/MenuItem.styles.js +8 -3
  19. package/dist/organisms/SideBar/MenuItem/MenuItem.utils.js +1 -1
  20. package/dist/organisms/Status/Action.d.ts +2 -2
  21. package/dist/organisms/Status/Description.d.ts +2 -2
  22. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  23. package/dist/organisms/Status/Title.d.ts +2 -2
  24. package/dist/organisms/Status/collections/BadRequest.d.ts +2 -2
  25. package/dist/organisms/Status/collections/GenericError.d.ts +2 -2
  26. package/dist/organisms/Status/collections/MissingPermissions.d.ts +2 -2
  27. package/dist/organisms/Status/collections/PageNotFound.d.ts +2 -2
  28. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  29. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  30. package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
  31. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import * as react149 from "react";
1
+ import * as react139 from "react";
2
2
 
3
3
  //#region src/atoms/hooks/useLocalStorage.d.ts
4
- declare const useLocalStorage: <T>(key: string, defaultState: T, keepAliveMs?: number) => readonly [T, react149.Dispatch<react149.SetStateAction<T>>, () => void];
4
+ declare const useLocalStorage: <T>(key: string, defaultState: T, keepAliveMs?: number) => readonly [T, react139.Dispatch<react139.SetStateAction<T>>, () => void];
5
5
  //#endregion
6
6
  export { useLocalStorage };
@@ -1,6 +1,6 @@
1
1
  import { SelectOption, SelectOptionRequired } from "../../molecules/Select/Select.types.js";
2
2
  import { SelectComponentProps } from "../../molecules/Select/Select.js";
3
- import * as react147 from "react";
3
+ import * as react141 from "react";
4
4
  import { ChangeEvent, KeyboardEvent } from "react";
5
5
 
6
6
  //#region src/atoms/hooks/useSelect.d.ts
@@ -16,8 +16,8 @@ declare const useSelect: <T extends SelectOptionRequired>(props: SelectComponent
16
16
  handleOnOpen: () => void;
17
17
  handleOnRemoveItem: (item: SelectOption<T>) => void;
18
18
  search: string;
19
- searchRef: react147.RefObject<HTMLInputElement | null>;
20
- itemRefs: react147.RefObject<(HTMLButtonElement | null)[]>;
19
+ searchRef: react141.RefObject<HTMLInputElement | null>;
20
+ itemRefs: react141.RefObject<(HTMLButtonElement | null)[]>;
21
21
  selectedValues: T[];
22
22
  open: boolean;
23
23
  tryingToRemoveItem: T | undefined;
@@ -1,4 +1,4 @@
1
- import * as react3 from "react";
1
+ import * as react0 from "react";
2
2
  import { IconData } from "@equinor/eds-icons";
3
3
 
4
4
  //#region src/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts
@@ -12,6 +12,6 @@ interface ExpandingIconButtonProps {
12
12
  /**
13
13
  * @deprecated Being deprecated from amplify-component-lib move into app if you want the implementation
14
14
  */
15
- declare const ExpandingIconButton: react3.ForwardRefExoticComponent<ExpandingIconButtonProps & react3.RefAttributes<HTMLDivElement>>;
15
+ declare const ExpandingIconButton: react0.ForwardRefExoticComponent<ExpandingIconButtonProps & react0.RefAttributes<HTMLDivElement>>;
16
16
  //#endregion
17
17
  export { ExpandingIconButton };
@@ -1,4 +1,4 @@
1
- import * as react9 from "react";
1
+ import * as react7 from "react";
2
2
  import { HTMLAttributes, KeyboardEvent, MouseEvent, ReactNode } from "react";
3
3
  import { IconData } from "@equinor/eds-icons";
4
4
 
@@ -25,6 +25,6 @@ type DeletableChipProps = BaseChipProps & InteractiveChipBase & {
25
25
  onDelete: (event: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLButtonElement>) => void;
26
26
  };
27
27
  type ChipProps = Omit<HTMLAttributes<HTMLDivElement | HTMLButtonElement>, 'onClick'> & (ReadOnlyChipProps | ClickableChipProps | DeletableChipProps);
28
- declare const Chip: react9.ForwardRefExoticComponent<ChipProps & react9.RefAttributes<HTMLDivElement | HTMLButtonElement>>;
28
+ declare const Chip: react7.ForwardRefExoticComponent<ChipProps & react7.RefAttributes<HTMLDivElement | HTMLButtonElement>>;
29
29
  //#endregion
30
30
  export { BaseChipProps, Chip, ClickableChipProps, DeletableChipProps };
@@ -1,5 +1,5 @@
1
1
  import { Variants } from "../../atoms/types/variants.js";
2
- import * as react13 from "react";
2
+ import * as react9 from "react";
3
3
  import { DatePickerProps } from "@equinor/eds-core-react";
4
4
 
5
5
  //#region src/molecules/DatePicker/DatePicker.d.ts
@@ -9,11 +9,11 @@ type DatePickerProps$1 = Omit<DatePickerProps, 'variant' | 'defaultValue'> & {
9
9
  meta?: string;
10
10
  loading?: boolean;
11
11
  };
12
- declare const DatePicker$1: react13.ForwardRefExoticComponent<Omit<DatePickerProps, "defaultValue" | "variant"> & {
12
+ declare const DatePicker$1: react9.ForwardRefExoticComponent<Omit<DatePickerProps, "defaultValue" | "variant"> & {
13
13
  variant?: Variants;
14
14
  defaultValue?: Date | undefined;
15
15
  meta?: string;
16
16
  loading?: boolean;
17
- } & react13.RefAttributes<HTMLDivElement>>;
17
+ } & react9.RefAttributes<HTMLDivElement>>;
18
18
  //#endregion
19
19
  export { DatePicker$1 as DatePicker, DatePickerProps$1 as DatePickerProps };
@@ -1,5 +1,5 @@
1
1
  import { Variants } from "../../atoms/types/variants.js";
2
- import * as react5 from "react";
2
+ import * as react11 from "react";
3
3
  import { DateRangePickerProps } from "@equinor/eds-core-react";
4
4
 
5
5
  //#region src/molecules/DateRangePicker/DateRangePicker.d.ts
@@ -8,10 +8,10 @@ type DateRangePickerProps$1 = Omit<DateRangePickerProps, 'variant'> & {
8
8
  meta?: string;
9
9
  loading?: boolean;
10
10
  };
11
- declare const DateRangePicker$1: react5.ForwardRefExoticComponent<Omit<DateRangePickerProps, "variant"> & {
11
+ declare const DateRangePicker$1: react11.ForwardRefExoticComponent<Omit<DateRangePickerProps, "variant"> & {
12
12
  variant?: Variants;
13
13
  meta?: string;
14
14
  loading?: boolean;
15
- } & react5.RefAttributes<HTMLDivElement>>;
15
+ } & react11.RefAttributes<HTMLDivElement>>;
16
16
  //#endregion
17
17
  export { DateRangePicker$1 as DateRangePicker, DateRangePickerProps$1 as DateRangePickerProps };
@@ -1,4 +1,4 @@
1
- import * as react7 from "react";
1
+ import * as react13 from "react";
2
2
  import { ReactNode } from "react";
3
3
  import { ButtonProps, DialogProps } from "@equinor/eds-core-react";
4
4
  import { IconData } from "@equinor/eds-icons";
@@ -51,6 +51,6 @@ interface DialogProps$1 extends Omit<DialogProps, 'title'> {
51
51
  * @param additionalInfo - Defaults to empty, and won't show the additional info button
52
52
  * Also inherits props from EDS dialog
53
53
  */
54
- declare const Dialog$1: react7.ForwardRefExoticComponent<DialogProps$1 & react7.RefAttributes<HTMLDivElement>>;
54
+ declare const Dialog$1: react13.ForwardRefExoticComponent<DialogProps$1 & react13.RefAttributes<HTMLDivElement>>;
55
55
  //#endregion
56
56
  export { Dialog$1 as Dialog, DialogAction, DialogProps$1 as DialogProps };
@@ -1,11 +1,11 @@
1
1
  import { SizeIconProps } from "../../atoms/types/Icon.js";
2
- import * as react11 from "react";
2
+ import * as react5 from "react";
3
3
 
4
4
  //#region src/molecules/EquinorLogo/EquinorLogo.d.ts
5
5
  interface EquinorLogoProps extends Partial<SizeIconProps> {
6
6
  large?: boolean;
7
7
  color?: 'red' | 'white' | 'black';
8
8
  }
9
- declare const EquinorLogo: react11.ForwardRefExoticComponent<EquinorLogoProps & react11.RefAttributes<SVGSVGElement>>;
9
+ declare const EquinorLogo: react5.ForwardRefExoticComponent<EquinorLogoProps & react5.RefAttributes<SVGSVGElement>>;
10
10
  //#endregion
11
11
  export { EquinorLogo, EquinorLogoProps };
@@ -1,5 +1,5 @@
1
1
  import { IconCellColor, IconCellState, IconCellVariant, IconCellVariants } from "./IconCell.types.js";
2
- import * as react15 from "react";
2
+ import * as react29 from "react";
3
3
  import { HTMLAttributes, MouseEventHandler, ReactNode } from "react";
4
4
  import { IconData } from "@equinor/eds-icons";
5
5
 
@@ -49,6 +49,6 @@ type IconCellProps = ScribbledOutProps | RegularIconCellProps;
49
49
  * @param {React.Ref<HTMLButtonElement>} ref - Ref forwarded to the inner button element.
50
50
  * @returns {JSX.Element} The rendered IconCell.
51
51
  */
52
- declare const IconCell: react15.ForwardRefExoticComponent<IconCellProps & react15.RefAttributes<HTMLButtonElement>>;
52
+ declare const IconCell: react29.ForwardRefExoticComponent<IconCellProps & react29.RefAttributes<HTMLButtonElement>>;
53
53
  //#endregion
54
54
  export { IconCell, IconCellProps };
@@ -1,4 +1,4 @@
1
- import * as react19 from "react";
1
+ import * as react23 from "react";
2
2
  import { TooltipProps } from "@equinor/eds-core-react";
3
3
  import * as _floating_ui_utils0 from "@floating-ui/utils";
4
4
 
@@ -6,14 +6,14 @@ import * as _floating_ui_utils0 from "@floating-ui/utils";
6
6
  type OptionalTooltipProps = {
7
7
  textTransform?: string;
8
8
  } & TooltipProps;
9
- declare const OptionalTooltip: react19.ForwardRefExoticComponent<{
9
+ declare const OptionalTooltip: react23.ForwardRefExoticComponent<{
10
10
  textTransform?: string;
11
11
  } & {
12
12
  placement?: _floating_ui_utils0.Placement;
13
- title?: react19.ReactNode;
13
+ title?: react23.ReactNode;
14
14
  children: React.ReactElement & React.RefAttributes<HTMLElement>;
15
15
  enterDelay?: number;
16
16
  portalContainer?: HTMLElement;
17
- } & Omit<react19.HTMLAttributes<HTMLDivElement>, "title"> & react19.RefAttributes<HTMLDivElement>>;
17
+ } & Omit<react23.HTMLAttributes<HTMLDivElement>, "title"> & react23.RefAttributes<HTMLDivElement>>;
18
18
  //#endregion
19
19
  export { OptionalTooltip, OptionalTooltipProps };
@@ -1,4 +1,4 @@
1
- import * as react17 from "react";
1
+ import * as react27 from "react";
2
2
 
3
3
  //#region src/molecules/ProfileAvatar/ProfileAvatar.d.ts
4
4
  interface ProfileAvatarProps {
@@ -7,6 +7,6 @@ interface ProfileAvatarProps {
7
7
  size?: 'small' | 'small-medium' | 'medium' | 'large' | 'x-large' | number;
8
8
  disabled?: boolean;
9
9
  }
10
- declare const ProfileAvatar: react17.ForwardRefExoticComponent<ProfileAvatarProps & react17.RefAttributes<HTMLDivElement>>;
10
+ declare const ProfileAvatar: react27.ForwardRefExoticComponent<ProfileAvatarProps & react27.RefAttributes<HTMLDivElement>>;
11
11
  //#endregion
12
12
  export { ProfileAvatar, ProfileAvatarProps };
@@ -2,16 +2,16 @@ import { EditorStylingProps, RichTextContentProps } from "./RichTextEditor.style
2
2
  import { EditorProviderProps } from "./EditorProvider.js";
3
3
  import { MenuBarProps } from "./MenuBar/MenuBar.js";
4
4
  import { RichTextEditor } from "./RichTextEditor.js";
5
- import * as react23 from "react";
5
+ import * as react15 from "react";
6
6
  import * as _tiptap_react0 from "@tiptap/react";
7
7
  import * as styled_components_dist_types0 from "styled-components/dist/types";
8
8
 
9
9
  //#region src/molecules/RichTextEditor/index.d.ts
10
10
  declare const RichText: {
11
- Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<react23.DetailedHTMLProps<react23.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, EditorStylingProps>> & string;
12
- Provider: react23.FC<EditorProviderProps>;
13
- Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<Omit<_tiptap_react0.EditorContentProps, "ref"> & react23.RefAttributes<HTMLDivElement>, RichTextContentProps>> & string & Omit<react23.NamedExoticComponent<Omit<_tiptap_react0.EditorContentProps, "ref"> & react23.RefAttributes<HTMLDivElement>>, keyof react23.Component<any, {}, any>>;
14
- Bar: react23.FC<MenuBarProps>;
11
+ Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<react15.DetailedHTMLProps<react15.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, EditorStylingProps>> & string;
12
+ Provider: react15.FC<EditorProviderProps>;
13
+ Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components_dist_types0.Substitute<Omit<_tiptap_react0.EditorContentProps, "ref"> & react15.RefAttributes<HTMLDivElement>, RichTextContentProps>> & string & Omit<react15.NamedExoticComponent<Omit<_tiptap_react0.EditorContentProps, "ref"> & react15.RefAttributes<HTMLDivElement>>, keyof react15.Component<any, {}, any>>;
14
+ Bar: react15.FC<MenuBarProps>;
15
15
  };
16
16
  //#endregion
17
17
  export { RichText };
@@ -1,10 +1,10 @@
1
- import * as react41 from "react";
1
+ import * as react39 from "react";
2
2
  import { SearchProps } from "@equinor/eds-core-react";
3
3
 
4
4
  //#region src/molecules/Search/Search.d.ts
5
5
  interface SearchProps$1 extends SearchProps {
6
6
  lightBackground?: boolean;
7
7
  }
8
- declare const Search$1: react41.ForwardRefExoticComponent<SearchProps$1 & react41.RefAttributes<HTMLInputElement>>;
8
+ declare const Search$1: react39.ForwardRefExoticComponent<SearchProps$1 & react39.RefAttributes<HTMLInputElement>>;
9
9
  //#endregion
10
10
  export { Search$1 as Search };
@@ -1,4 +1,4 @@
1
- import * as react39 from "react";
1
+ import * as react41 from "react";
2
2
  import * as styled_components_dist_types6 from "styled-components/dist/types";
3
3
  import * as styled_components_dist_models_Keyframes0 from "styled-components/dist/models/Keyframes";
4
4
 
@@ -7,6 +7,6 @@ declare const skeletonBaseloading: styled_components_dist_models_Keyframes0.defa
7
7
  interface SkeletonBaseProps {
8
8
  $offset?: number;
9
9
  }
10
- declare const SkeletonBase: styled_components_dist_types6.IStyledComponentBase<"web", styled_components_dist_types6.Substitute<react39.DetailedHTMLProps<react39.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SkeletonBaseProps>> & string;
10
+ declare const SkeletonBase: styled_components_dist_types6.IStyledComponentBase<"web", styled_components_dist_types6.Substitute<react41.DetailedHTMLProps<react41.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SkeletonBaseProps>> & string;
11
11
  //#endregion
12
12
  export { SkeletonBase, SkeletonBaseProps, skeletonBaseloading };
@@ -83,4 +83,4 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
83
83
  display: flex;
84
84
  gap: ${r.x_small};
85
85
  align-items: center;
86
- `,S=e=>{if(e.maxCharacters&&`type`in e&&e.type!==`text`)throw Error('`maxCharacters` prop is not supported for input types other than "text".');if(e.explanation&&!e.label)throw Error("`explanation` prop requires a `label` to be set on the TextField.");let i={...e,variant:e.variant===`dirty`?void 0:e.variant},s=e.loading?void 0:e.variant,p=o(e),m=a(e),h=u(`${Math.max(20,Math.random()*80)}%`),[S,C]=d(typeof e.value==`string`?e.value.length:0),[w,T]=d(0),E=e=>{if(e){let t=e.getBoundingClientRect().width;T(t)}},D=t=>{e.onChange&&e.onChange(t),e.maxCharacters&&C(t.target.value.length)};return l(()=>{typeof e.value==`string`&&e.maxCharacters&&e.value.length!==S&&C(e.value.length)},[S,e.maxCharacters,e.value]),_(v,{$variant:s,$disabled:e.loading?!1:e.disabled,$helperRightWidth:w,style:{marginBottom:!e.helperText&&e.maxCharacters?`calc(${r.small} + 1rem)`:0},children:[g(f,{...i,label:i.label?_(x,{children:[i.label,e.explanation&&g(c,{position:e.explanationPosition,children:e.explanation})]}):void 0,disabled:e.loading||e.disabled,onChange:D}),e.loading&&g(y,{className:`skeleton`,role:`progressbar`,style:{top:p,height:m,width:h.current}}),e.maxCharacters&&_(b,{ref:E,variant:`helper`,group:`input`,color:i.variant?t[i.variant]:n.text.static_icons__tertiary.rgba,style:{bottom:e.helperText?`0`:`calc((${r.small} + 1rem) * -1)`},children:[S,` / `,e.maxCharacters]})]})};export{S as TextField};
86
+ `,S=e=>{if(e.maxCharacters&&`type`in e&&e.type!==`text`)throw Error('`maxCharacters` prop is not supported for input types other than "text".');if(e.explanation&&!e.label)throw Error("`explanation` prop requires a `label` to be set on the TextField.");let i={...e,variant:e.variant===`dirty`?void 0:e.variant},s=e.loading?void 0:e.variant,p=o(e),m=a(e),h=u(`${Math.max(20,Math.random()*80)}%`),[S,C]=d(typeof e.value==`string`?e.value.length:0),[w,T]=d(0),E=e=>{if(e){let t=e.getBoundingClientRect().width;T(t)}},D=t=>{e.onChange&&e.onChange(t),e.maxCharacters&&C(t.target.value.length)};return l(()=>{typeof e.value==`string`&&e.maxCharacters&&e.value.length!==S&&C(e.value.length)},[S,e.maxCharacters,e.value]),_(v,{ref:t=>{if(!t||!e.maxCharacters)return;let n=t.querySelector(`input, textarea`);n&&C(n.value.length)},$variant:s,$disabled:e.loading?!1:e.disabled,$helperRightWidth:w,style:{marginBottom:!e.helperText&&e.maxCharacters?`calc(${r.small} + 1rem)`:0},children:[g(f,{...i,label:i.label?_(x,{children:[i.label,e.explanation&&g(c,{position:e.explanationPosition,children:e.explanation})]}):void 0,disabled:e.loading||e.disabled,onChange:D}),e.loading&&g(y,{className:`skeleton`,role:`progressbar`,style:{top:p,height:m,width:h.current}}),e.maxCharacters&&_(b,{ref:E,variant:`helper`,group:`input`,color:i.variant?t[i.variant]:n.text.static_icons__tertiary.rgba,style:{bottom:e.helperText?`0`:`calc((${r.small} + 1rem) * -1)`},children:[S,` / `,e.maxCharacters]})]})};export{S as TextField};
@@ -1 +1 @@
1
- import{useSideBar as e}from"../../../providers/SideBarProvider.js";import{OptionalTooltip as t}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as n,ItemText as r,Link as i,MenuItemWrapper as a}from"./MenuItem.styles.js";import{canNavigate as o,isCurrentUrl as s}from"./MenuItem.utils.js";import{useCallback as c,useMemo as l}from"react";import{Icon as u}from"@equinor/eds-core-react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useLocation as p}from"@tanstack/react-router";import{Feature as m}from"@equinor/subsurface-app-management";const h=({icon:h,onClick:g,replace:_=!1,name:v,disabled:y=!1,featureUuid:b,...x})=>{let{pathname:S}=p(),C=s({currentUrl:S,link:x.to}),{isOpen:w}=e(),T=o({currentUrl:S,link:x.to,replace:_,disabled:y}),E=c(e=>{if(!T){e.preventDefault();return}g&&g()},[T,g]),D=l(()=>d(t,{title:v,placement:`right`,children:d(a,{children:f(i,{$active:C,"aria-disabled":y,$disabled:y,onClick:E,tabIndex:0,"data-testid":`sidebar-menu-item`,...x,children:[d(n,{"data-testid":`icon-container`,children:d(u,{data:h,size:24})}),w&&d(r,{$active:C,$disabled:y,variant:`button`,group:`navigation`,children:v})]})})}),[y,E,h,C,w,v,x]);return b?d(m,{featureUuid:b,children:D}):D};export{h as BasicMenuItem};
1
+ import{useSideBar as e}from"../../../providers/SideBarProvider.js";import{OptionalTooltip as t}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as n,ItemText as r,Link as i,MenuItemWrapper as a}from"./MenuItem.styles.js";import{canNavigate as o}from"./MenuItem.utils.js";import{useCallback as s,useMemo as c}from"react";import{Icon as l}from"@equinor/eds-core-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useMatchRoute as f}from"@tanstack/react-router";import{Feature as p}from"@equinor/subsurface-app-management";const m=({icon:m,onClick:h,replace:g=!1,name:_,disabled:v=!1,featureUuid:y,...b})=>{let{isOpen:x}=e(),S=!!f()({...b}),C=o({isActive:S,replace:g,disabled:v}),w=s(e=>{if(!C){e.preventDefault();return}h&&h()},[C,h]),T=c(()=>u(t,{title:_,placement:`right`,children:u(a,{children:d(i,{"aria-disabled":v,$disabled:v,onClick:w,tabIndex:0,"data-testid":`sidebar-menu-item`,...b,children:[u(n,{"data-testid":`icon-container`,children:u(l,{data:m,size:24})}),x&&u(r,{$active:S,$disabled:v,variant:`button`,group:`navigation`,children:_})]})})}),[v,w,m,S,x,_,b]);return y?u(p,{featureUuid:y,children:T}):T};export{m as BasicMenuItem};
@@ -1,4 +1,4 @@
1
- import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{useSideBar as n}from"../../../providers/SideBarProvider.js";import{usePrevious as r}from"../../../atoms/hooks/usePrevious.js";import{OptionalTooltip as i}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as a,ItemText as o,Link as s,MenuItemWrapper as c}from"./MenuItem.styles.js";import{isCurrentUrl as l}from"./MenuItem.utils.js";import{useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{Icon as m,Menu as h}from"@equinor/eds-core-react";import g,{css as _}from"styled-components";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{chevron_down as x,chevron_up as S}from"@equinor/eds-icons";import{Link as C,useLocation as w}from"@tanstack/react-router";const T=g.button`
1
+ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{useSideBar as n}from"../../../providers/SideBarProvider.js";import{usePrevious as r}from"../../../atoms/hooks/usePrevious.js";import{OptionalTooltip as i}from"../../../molecules/OptionalTooltip/OptionalTooltip.js";import{IconContainer as a,ItemText as o,Link as s,MenuItemWrapper as c}from"./MenuItem.styles.js";import{useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import{Icon as p,Menu as m}from"@equinor/eds-core-react";import h,{css as g}from"styled-components";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{chevron_down as b,chevron_up as x}from"@equinor/eds-icons";import{Link as S,useLocation as C,useMatchRoute as w}from"@tanstack/react-router";const T=h.button`
2
2
  position: relative;
3
3
  width: 100%;
4
4
  display: grid;
@@ -23,7 +23,7 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
23
23
  }
24
24
  }
25
25
 
26
- ${({$open:t})=>!t&&_`
26
+ ${({$open:t})=>!t&&g`
27
27
  &:after {
28
28
  position: absolute;
29
29
  right: -7px; // 1px border offset from 8px width
@@ -38,11 +38,11 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
38
38
  z-index: 500;
39
39
  }
40
40
  `}
41
- `,E=g(s)`
41
+ `,E=h(s)`
42
42
  display: grid;
43
43
  grid-template-columns: 32px 1fr;
44
44
  height: unset;
45
45
  > p:first-child {
46
46
  grid-column: 2;
47
47
  }
48
- `,D=({icon:t,name:s,items:g,..._})=>{let{pathname:D}=w(),O=r(D),{isOpen:k}=n(),A=r(k),j=g.some(e=>l({currentUrl:D,link:e.to})),M=f(null),[N,P]=p(!1),F=()=>P(e=>!e);u(()=>{(A&&!k&&N||O!==D&&N&&!k)&&P(!1)},[N,k,D,A,O]);let I=d(()=>y(i,{title:s,placement:`right`,children:y(c,{children:b(T,{ref:M,$open:k,$active:j,$expanded:N,onClick:F,..._,children:[y(a,{"data-testid":`icon-container`,children:y(m,{data:t,size:24,color:e.interactive.primary__resting.rgba})}),k&&b(v,{children:[y(o,{$active:!1,$disabled:!1,variant:`button`,group:`navigation`,children:s}),y(m,{data:N?S:x,size:24,color:e.interactive.primary__resting.rgba})]})]})})}),[N,t,j,k,s,_]);return N&&k?b(v,{children:[I,g.map((e,t)=>y(E,{$active:l({currentUrl:D,link:e.to}),$disabled:e.disabled||!1,...e,children:y(o,{$active:j,$disabled:e.disabled||!1,variant:`button`,group:`navigation`,children:e.name})},t))]}):N?b(v,{children:[I,y(h,{open:!0,anchorEl:M.current,placement:`right-start`,onClose:F,children:g.map(e=>y(h.Item,{as:C,active:l({currentUrl:D,link:e.to}),style:{width:`256px`},...e,children:e.name},e.to))})]}):I};export{D as CollapsableMenuItem};
48
+ `,D=({icon:t,name:s,items:h,...g})=>{let{pathname:D}=C(),O=w(),k=r(D),{isOpen:A}=n(),j=r(A),M=h.some(e=>!!O({...e})),N=d(null),[P,F]=f(!1),I=()=>F(e=>!e);l(()=>{(j&&!A&&P||k!==D&&P&&!A)&&F(!1)},[P,A,D,j,k]);let L=u(()=>v(i,{title:s,placement:`right`,children:v(c,{children:y(T,{ref:N,$open:A,$active:M,$expanded:P,onClick:I,...g,children:[v(a,{"data-testid":`icon-container`,children:v(p,{data:t,size:24,color:e.interactive.primary__resting.rgba})}),A&&y(_,{children:[v(o,{$active:!1,$disabled:!1,variant:`button`,group:`navigation`,children:s}),v(p,{data:P?x:b,size:24,color:e.interactive.primary__resting.rgba})]})]})})}),[P,t,M,A,s,g]);return P&&A?y(_,{children:[L,h.map((e,t)=>v(E,{$disabled:e.disabled||!1,...e,children:v(o,{$active:M,$disabled:e.disabled||!1,variant:`button`,group:`navigation`,children:e.name})},t))]}):P?y(_,{children:[L,v(m,{open:!0,anchorEl:N.current,placement:`right-start`,onClose:I,children:h.map(e=>v(m.Item,{as:S,active:!!O({...e}),style:{width:`256px`},...e,children:e.name},`${e.to}-${e.name}`))})]}):L};export{D as CollapsableMenuItem};
@@ -10,7 +10,6 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
10
10
  gap: ${t.medium};
11
11
  box-sizing: border-box;
12
12
  border-bottom: 1px solid ${e.ui.background__medium.rgba};
13
- background: ${({$active:t})=>t&&e.interactive.primary__selected_highlight.rgba};
14
13
  text-decoration: none;
15
14
  transition: background 0.1s ease-out;
16
15
  > div > svg {
@@ -19,9 +18,15 @@ import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}fro
19
18
  &:hover {
20
19
  cursor: ${({$disabled:e})=>!e&&`pointer`};
21
20
  text-decoration: none;
22
- background: ${({$active:t,$disabled:n})=>!n&&(t?e.interactive.primary__selected_hover.rgba:e.interactive.primary__hover_alt.rgba)};
21
+ background: ${({$disabled:t})=>!t&&e.interactive.primary__hover_alt.rgba};
23
22
  > div > svg {
24
- fill: ${({$disabled:t,$active:n})=>!t&&!n&&e.interactive.primary__hover.rgba};
23
+ fill: ${({$disabled:t})=>t?e.interactive.disabled__text.rgba:e.interactive.primary__hover.rgba};
24
+ }
25
+ }
26
+ &[data-status='active'] {
27
+ background: ${e.interactive.primary__selected_highlight.rgba};
28
+ &:hover {
29
+ background: ${e.interactive.primary__selected_hover.rgba};
25
30
  }
26
31
  }
27
32
  `),s=r.div`
@@ -1 +1 @@
1
- const e=({currentUrl:e,link:t})=>decodeURIComponent(e).includes(t)&&t!==`/`||t===e,t=({currentUrl:e,link:t})=>e.split(`?`)[0]===t,n=({currentUrl:n,link:r,disabled:i,replace:a})=>{let o=e({currentUrl:n,link:r}),s=t({currentUrl:n,link:r});return!i&&(!o||o&&!s&&a)};export{n as canNavigate,e as isCurrentUrl};
1
+ const e=({isActive:e,disabled:t,replace:n})=>!t&&(!e||e&&n);export{e as canNavigate};
@@ -1,10 +1,10 @@
1
- import * as react137 from "react";
1
+ import * as react150 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: react137.ForwardRefExoticComponent<ActionProps & react137.RefAttributes<HTMLButtonElement>>;
8
+ declare const Action: react150.ForwardRefExoticComponent<ActionProps & react150.RefAttributes<HTMLButtonElement>>;
9
9
  //#endregion
10
10
  export { Action };
@@ -1,9 +1,9 @@
1
- import * as react139 from "react";
1
+ import * as react148 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: react139.ForwardRefExoticComponent<DescriptionProps & react139.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Description: react148.ForwardRefExoticComponent<DescriptionProps & react148.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Description };
@@ -1,4 +1,4 @@
1
- import * as react141 from "react";
1
+ import * as react146 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: react141.ForwardRefExoticComponent<MissingAccessesProps & react141.RefAttributes<HTMLDivElement>>;
12
+ declare const MissingAccesses: react146.ForwardRefExoticComponent<MissingAccessesProps & react146.RefAttributes<HTMLDivElement>>;
13
13
  //#endregion
14
14
  export { MissingAccesses };
@@ -1,9 +1,9 @@
1
- import * as react135 from "react";
1
+ import * as react144 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: react135.ForwardRefExoticComponent<TitleProps & react135.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Title: react144.ForwardRefExoticComponent<TitleProps & react144.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Title };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 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_runtime8.JSX.Element;
15
+ }: BadRequestProps) => react_jsx_runtime9.JSX.Element;
16
16
  //#endregion
17
17
  export { BadRequest };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/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_runtime9.JSX.Element;
17
+ }: GenericErrorProps) => react_jsx_runtime11.JSX.Element;
18
18
  //#endregion
19
19
  export { GenericError };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/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_runtime10.JSX.Element;
17
+ }: MissingPermissionsProps) => react_jsx_runtime8.JSX.Element;
18
18
  //#endregion
19
19
  export { MissingPermissions };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/organisms/Status/collections/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_runtime11.JSX.Element;
15
+ }: PageNotFoundProps) => react_jsx_runtime10.JSX.Element;
16
16
  //#endregion
17
17
  export { PageNotFound };
@@ -1,7 +1,7 @@
1
1
  import { ToggleGroup as ToggleGroup$1 } from "./ToggleGroup.types.js";
2
- import * as react145 from "react";
2
+ import * as react137 from "react";
3
3
 
4
4
  //#region src/organisms/ToggleGroup/ToggleGroup.d.ts
5
- declare const ToggleGroup: react145.ForwardRefExoticComponent<ToggleGroup$1 & react145.RefAttributes<HTMLDivElement>>;
5
+ declare const ToggleGroup: react137.ForwardRefExoticComponent<ToggleGroup$1 & react137.RefAttributes<HTMLDivElement>>;
6
6
  //#endregion
7
7
  export { ToggleGroup };
@@ -1,9 +1,9 @@
1
1
  import { ToggleGroupOption as ToggleGroupOption$1 } from "./ToggleGroup.types.js";
2
- import * as react143 from "react";
2
+ import * as react135 from "react";
3
3
  import { HTMLAttributes } from "react";
4
4
 
5
5
  //#region src/organisms/ToggleGroup/ToggleGroupOption.d.ts
6
6
  type ToggleGroupOptionProps = ToggleGroupOption$1 & Omit<HTMLAttributes<HTMLButtonElement>, 'onToggle' | 'disabled'>;
7
- declare const ToggleGroupOption: react143.ForwardRefExoticComponent<ToggleGroupOptionProps & react143.RefAttributes<HTMLButtonElement>>;
7
+ declare const ToggleGroupOption: react135.ForwardRefExoticComponent<ToggleGroupOptionProps & react135.RefAttributes<HTMLButtonElement>>;
8
8
  //#endregion
9
9
  export { ToggleGroupOption };
@@ -1,4 +1,4 @@
1
- import * as react151 from "react";
1
+ import * as react143 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: react151.Context<NotificationContext | undefined>;
9
+ declare const NotificationContext: react143.Context<NotificationContext | undefined>;
10
10
  declare const useNotification: () => NotificationContext;
11
11
  //#endregion
12
12
  export { useNotification };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "11.0.0",
3
+ "version": "11.0.2",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",