@equinor/amplify-component-lib 12.0.3 → 12.0.5

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 (27) 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/DatePicker/DatePicker.d.ts +3 -3
  5. package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
  6. package/dist/molecules/Dialog/Dialog.d.ts +2 -2
  7. package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
  8. package/dist/molecules/RichTextEditor/index.d.ts +5 -5
  9. package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
  10. package/dist/molecules/SelectionControls/Switch/Switch.d.ts +2 -2
  11. package/dist/molecules/Tag/Tag.js +1 -1
  12. package/dist/molecules/TextField/TextField.js +6 -0
  13. package/dist/organisms/Filter/Filter.d.ts +2 -2
  14. package/dist/organisms/Filter/QuickFilter.d.ts +2 -2
  15. package/dist/organisms/Filter/SortMenu.d.ts +2 -2
  16. package/dist/organisms/SideBar/SideBar.d.ts +2 -2
  17. package/dist/organisms/Status/Action.d.ts +2 -2
  18. package/dist/organisms/Status/Description.d.ts +2 -2
  19. package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
  20. package/dist/organisms/Status/Title.d.ts +2 -2
  21. package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
  22. package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
  23. package/dist/organisms/TopBar/Actions.d.ts +2 -2
  24. package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +2 -2
  25. package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
  26. package/dist/providers/SurveyProvider/SurveyProvider.js +1 -1
  27. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import * as react191 from "react";
1
+ import * as react209 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, react191.Dispatch<react191.SetStateAction<T>>, () => void];
4
+ declare const useLocalStorage: <T>(key: string, defaultState: T, keepAliveMs?: number) => readonly [T, react209.Dispatch<react209.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 react193 from "react";
3
+ import * as react211 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: react193.RefObject<HTMLInputElement | null>;
20
- itemRefs: react193.RefObject<(HTMLButtonElement | null)[]>;
19
+ searchRef: react211.RefObject<HTMLInputElement | null>;
20
+ itemRefs: react211.RefObject<(HTMLButtonElement | null)[]>;
21
21
  selectedValues: T[];
22
22
  open: boolean;
23
23
  tryingToRemoveItem: T | undefined;
@@ -1,4 +1,4 @@
1
- import * as react0 from "react";
1
+ import * as react4 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: react0.ForwardRefExoticComponent<ExpandingIconButtonProps & react0.RefAttributes<HTMLDivElement>>;
15
+ declare const ExpandingIconButton: react4.ForwardRefExoticComponent<ExpandingIconButtonProps & react4.RefAttributes<HTMLDivElement>>;
16
16
  //#endregion
17
17
  export { ExpandingIconButton };
@@ -1,5 +1,5 @@
1
1
  import { Variants } from "../../atoms/types/variants.js";
2
- import * as react8 from "react";
2
+ import * as react10 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: react8.ForwardRefExoticComponent<Omit<DatePickerProps, "defaultValue" | "variant"> & {
12
+ declare const DatePicker$1: react10.ForwardRefExoticComponent<Omit<DatePickerProps, "defaultValue" | "variant"> & {
13
13
  variant?: Variants;
14
14
  defaultValue?: Date | undefined;
15
15
  meta?: string;
16
16
  loading?: boolean;
17
- } & react8.RefAttributes<HTMLDivElement>>;
17
+ } & react10.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 react10 from "react";
2
+ import * as react12 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: react10.ForwardRefExoticComponent<Omit<DateRangePickerProps, "variant"> & {
11
+ declare const DateRangePicker$1: react12.ForwardRefExoticComponent<Omit<DateRangePickerProps, "variant"> & {
12
12
  variant?: Variants;
13
13
  meta?: string;
14
14
  loading?: boolean;
15
- } & react10.RefAttributes<HTMLDivElement>>;
15
+ } & react12.RefAttributes<HTMLDivElement>>;
16
16
  //#endregion
17
17
  export { DateRangePicker$1 as DateRangePicker, DateRangePickerProps$1 as DateRangePickerProps };
@@ -1,4 +1,4 @@
1
- import * as react12 from "react";
1
+ import * as react8 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: react12.ForwardRefExoticComponent<DialogProps$1 & react12.RefAttributes<HTMLDivElement>>;
54
+ declare const Dialog$1: react8.ForwardRefExoticComponent<DialogProps$1 & react8.RefAttributes<HTMLDivElement>>;
55
55
  //#endregion
56
56
  export { Dialog$1 as Dialog, DialogAction, DialogProps$1 as DialogProps };
@@ -1,4 +1,4 @@
1
- import * as react22 from "react";
1
+ import * as react33 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: react22.ForwardRefExoticComponent<ProfileAvatarProps & react22.RefAttributes<HTMLDivElement>>;
10
+ declare const ProfileAvatar: react33.ForwardRefExoticComponent<ProfileAvatarProps & react33.RefAttributes<HTMLDivElement>>;
11
11
  //#endregion
12
12
  export { ProfileAvatar, ProfileAvatarProps };
@@ -2,17 +2,17 @@ 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 react24 from "react";
5
+ import * as react22 from "react";
6
6
  import * as styled_components0 from "styled-components";
7
7
  import * as _tiptap_react0 from "@tiptap/react";
8
8
  import * as styled_components_dist_types0 from "styled-components/dist/types";
9
9
 
10
10
  //#region src/molecules/RichTextEditor/index.d.ts
11
11
  declare const RichText: {
12
- Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<react24.DetailedHTMLProps<react24.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof EditorStylingProps> & EditorStylingProps, never> & Partial<Pick<styled_components0.FastOmit<react24.DetailedHTMLProps<react24.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof EditorStylingProps> & EditorStylingProps, never>>> & string;
13
- Provider: react24.FC<EditorProviderProps>;
14
- Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<Omit<_tiptap_react0.EditorContentProps, "ref"> & react24.RefAttributes<HTMLDivElement>, keyof RichTextContentProps> & RichTextContentProps, never> & Partial<Pick<styled_components0.FastOmit<Omit<_tiptap_react0.EditorContentProps, "ref"> & react24.RefAttributes<HTMLDivElement>, keyof RichTextContentProps> & RichTextContentProps, never>>> & string & Omit<react24.NamedExoticComponent<Omit<_tiptap_react0.EditorContentProps, "ref"> & react24.RefAttributes<HTMLDivElement>>, keyof react24.Component<any, {}, any>>;
15
- Bar: react24.FC<MenuBarProps>;
12
+ Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<react22.DetailedHTMLProps<react22.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof EditorStylingProps> & EditorStylingProps, never> & Partial<Pick<styled_components0.FastOmit<react22.DetailedHTMLProps<react22.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof EditorStylingProps> & EditorStylingProps, never>>> & string;
13
+ Provider: react22.FC<EditorProviderProps>;
14
+ Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<Omit<_tiptap_react0.EditorContentProps, "ref"> & react22.RefAttributes<HTMLDivElement>, keyof RichTextContentProps> & RichTextContentProps, never> & Partial<Pick<styled_components0.FastOmit<Omit<_tiptap_react0.EditorContentProps, "ref"> & react22.RefAttributes<HTMLDivElement>, keyof RichTextContentProps> & RichTextContentProps, never>>> & string & Omit<react22.NamedExoticComponent<Omit<_tiptap_react0.EditorContentProps, "ref"> & react22.RefAttributes<HTMLDivElement>>, keyof react22.Component<any, {}, any>>;
15
+ Bar: react22.FC<MenuBarProps>;
16
16
  };
17
17
  //#endregion
18
18
  export { RichText };
@@ -1,4 +1,4 @@
1
- import * as react157 from "react";
1
+ import * as react159 from "react";
2
2
  import { RadioProps } from "@equinor/eds-core-react";
3
3
 
4
4
  //#region src/molecules/SelectionControls/Radio/Radio.d.ts
@@ -7,6 +7,6 @@ interface RadioProps$1 extends RadioProps {
7
7
  outlined?: boolean;
8
8
  error?: boolean;
9
9
  }
10
- declare const Radio$1: react157.ForwardRefExoticComponent<RadioProps$1 & react157.RefAttributes<HTMLInputElement>>;
10
+ declare const Radio$1: react159.ForwardRefExoticComponent<RadioProps$1 & react159.RefAttributes<HTMLInputElement>>;
11
11
  //#endregion
12
12
  export { Radio$1 as Radio, RadioProps$1 as RadioProps };
@@ -1,10 +1,10 @@
1
- import * as react159 from "react";
1
+ import * as react157 from "react";
2
2
  import { SwitchProps } from "@equinor/eds-core-react";
3
3
 
4
4
  //#region src/molecules/SelectionControls/Switch/Switch.d.ts
5
5
  interface SwitchProps$1 extends SwitchProps {
6
6
  outlined?: boolean;
7
7
  }
8
- declare const Switch$1: react159.ForwardRefExoticComponent<SwitchProps$1 & react159.RefAttributes<HTMLInputElement>>;
8
+ declare const Switch$1: react157.ForwardRefExoticComponent<SwitchProps$1 & react157.RefAttributes<HTMLInputElement>>;
9
9
  //#endregion
10
10
  export { Switch$1 as Switch, SwitchProps$1 as SwitchProps };
@@ -5,7 +5,7 @@ import{spacings as e}from"../../atoms/style/spacings.js";import{shape as t}from"
5
5
  padding: ${e.xx_small} ${e.x_small};
6
6
  gap: ${e.x_small};
7
7
  background: ${({$color:e})=>n[e].background};
8
- min-height: calc(24px + 2 * ${e.xx_small});
8
+ min-height: 24px;
9
9
  > span {
10
10
  color: ${({$color:e})=>n[e].text};
11
11
  line-height: normal;
@@ -27,6 +27,12 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
27
27
  margin-right: ${({$helperRightWidth:e})=>e?`calc(${e}px + ${r.medium})`:0};
28
28
  }
29
29
 
30
+ ${({$disabled:e})=>!e&&h`
31
+ div[class*='Input__Adornments'] > span {
32
+ color: ${n.text.static_icons__tertiary.rgba};
33
+ }
34
+ `}
35
+
30
36
  ${({$variant:e,$disabled:r})=>r?h`
31
37
  div {
32
38
  outline: none !important;
@@ -1,5 +1,5 @@
1
1
  import { FilterProps } from "./Filter.types.js";
2
- import * as react_jsx_runtime5 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime6 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_runtime5.JSX.Element;
35
+ }: FilterProps<T>): react_jsx_runtime6.JSX.Element;
36
36
  //#endregion
37
37
  export { Filter };
@@ -1,6 +1,6 @@
1
1
  import { SelectOptionRequired } from "../../molecules/Select/Select.types.js";
2
2
  import { FilterProps } from "./Filter.types.js";
3
- import * as react_jsx_runtime6 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/organisms/Filter/QuickFilter.d.ts
6
6
  interface QuickFilterProps<T extends string> {
@@ -14,6 +14,6 @@ declare function QuickFilter<T extends string>({
14
14
  items,
15
15
  onQuickFilter,
16
16
  label
17
- }: QuickFilterProps<T>): react_jsx_runtime6.JSX.Element;
17
+ }: QuickFilterProps<T>): react_jsx_runtime7.JSX.Element;
18
18
  //#endregion
19
19
  export { QuickFilter };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 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_runtime7.JSX.Element;
16
+ }: SortMenuProps<S>): react_jsx_runtime5.JSX.Element;
17
17
  //#endregion
18
18
  export { SortMenu };
@@ -1,4 +1,4 @@
1
- import * as react196 from "react";
1
+ import * as react195 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: react196.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react196.RefAttributes<HTMLDivElement>>;
19
+ declare const SideBar: react195.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react195.RefAttributes<HTMLDivElement>>;
20
20
  //#endregion
21
21
  export { SideBar };
@@ -1,10 +1,10 @@
1
- import * as react206 from "react";
1
+ import * as react199 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: react206.ForwardRefExoticComponent<ActionProps & react206.RefAttributes<HTMLButtonElement>>;
8
+ declare const Action: react199.ForwardRefExoticComponent<ActionProps & react199.RefAttributes<HTMLButtonElement>>;
9
9
  //#endregion
10
10
  export { Action };
@@ -1,9 +1,9 @@
1
- import * as react208 from "react";
1
+ import * as react201 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: react208.ForwardRefExoticComponent<DescriptionProps & react208.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Description: react201.ForwardRefExoticComponent<DescriptionProps & react201.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Description };
@@ -1,4 +1,4 @@
1
- import * as react210 from "react";
1
+ import * as react203 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: react210.ForwardRefExoticComponent<MissingAccessesProps & react210.RefAttributes<HTMLDivElement>>;
12
+ declare const MissingAccesses: react203.ForwardRefExoticComponent<MissingAccessesProps & react203.RefAttributes<HTMLDivElement>>;
13
13
  //#endregion
14
14
  export { MissingAccesses };
@@ -1,9 +1,9 @@
1
- import * as react212 from "react";
1
+ import * as react197 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: react212.ForwardRefExoticComponent<TitleProps & react212.RefAttributes<HTMLHeadingElement>>;
7
+ declare const Title: react197.ForwardRefExoticComponent<TitleProps & react197.RefAttributes<HTMLHeadingElement>>;
8
8
  //#endregion
9
9
  export { Title };
@@ -1,7 +1,7 @@
1
1
  import { ToggleGroup as ToggleGroup$1 } from "./ToggleGroup.types.js";
2
- import * as react204 from "react";
2
+ import * as react207 from "react";
3
3
 
4
4
  //#region src/organisms/ToggleGroup/ToggleGroup.d.ts
5
- declare const ToggleGroup: react204.ForwardRefExoticComponent<ToggleGroup$1 & react204.RefAttributes<HTMLDivElement>>;
5
+ declare const ToggleGroup: react207.ForwardRefExoticComponent<ToggleGroup$1 & react207.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 react202 from "react";
2
+ import * as react205 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: react202.ForwardRefExoticComponent<ToggleGroupOptionProps & react202.RefAttributes<HTMLButtonElement>>;
7
+ declare const ToggleGroupOption: react205.ForwardRefExoticComponent<ToggleGroupOptionProps & react205.RefAttributes<HTMLButtonElement>>;
8
8
  //#endregion
9
9
  export { ToggleGroupOption };
@@ -1,7 +1,7 @@
1
- import * as react200 from "react";
1
+ import * as react193 from "react";
2
2
  import { HTMLAttributes } from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/Actions.d.ts
5
- declare const Actions: react200.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react200.RefAttributes<HTMLDivElement>>;
5
+ declare const Actions: react193.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react193.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 react198 from "react";
2
+ import * as react191 from "react";
3
3
 
4
4
  //#region src/organisms/TopBar/FieldMenu/FieldMenu.d.ts
5
5
  interface FieldMenuProps {
@@ -8,6 +8,6 @@ interface FieldMenuProps {
8
8
  itemNameSingular?: string;
9
9
  showAccessITLink?: boolean;
10
10
  }
11
- declare const FieldMenu: react198.ForwardRefExoticComponent<FieldMenuProps & react198.RefAttributes<HTMLDivElement>>;
11
+ declare const FieldMenu: react191.ForwardRefExoticComponent<FieldMenuProps & react191.RefAttributes<HTMLDivElement>>;
12
12
  //#endregion
13
13
  export { FieldMenu };
@@ -1,4 +1,4 @@
1
- import * as react195 from "react";
1
+ import * as react213 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: react195.Context<NotificationContext | undefined>;
9
+ declare const NotificationContext: react213.Context<NotificationContext | undefined>;
10
10
  declare const useNotification: () => NotificationContext;
11
11
  //#endregion
12
12
  export { useNotification };
@@ -1 +1 @@
1
- import{useToasts as e}from"../ToastProvider/ToastProvider.js";import{useConfetti as t}from"../ConfettiProvider/ConfettiProvider.js";import{SurveyDialog as n}from"./SurveyDialog/SurveyDialog.js";import{createContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useActiveSurvey as l,useAnswerQuestionActiveSurvey as u,useRespondActiveSurvey as d}from"@equinor/subsurface-app-management";const f=r(void 0),p=({children:r})=>{let{showToast:p}=e(),{shower:m}=t(),{data:h}=l(),[g,_]=o(0),[v,y]=o(void 0),[b,x]=o(!1),S=a(void 0),{mutateAsync:C}=d(),{mutateAsync:w}=u();i(()=>{h&&S.current!==h.surveyId.value&&(S.current=h.surveyId.value,_(h.questions.findIndex(e=>e.answer===void 0)))},[h]);let T=()=>{h&&(p({variant:`success`,title:`Survey completed`,description:`Thanks for helping us improve!`,duration:5}),h.showConfettiOnComplete&&m({mode:`shower`,shapes:[`square`],duration:5e3}))};return c(f.Provider,{value:{activeSurvey:h,activeQuestionIndex:g,setActiveQuestionIndex:_,answerQuestion:async e=>{if(!h||g===void 0||!h.questions[g])throw Error(`No active survey or question to answer`);let t=h.surveyResponseId?.value;t===void 0&&(t=(await C({surveyId:h.surveyId,optOut:!1})).value),await w({surveyResponseId:t??``,body:{id:h.questions[g].questionId,...e}}),y(void 0),g+1<h.questions.length?_(g+1):(_(void 0),T())},cancelSurvey:()=>{_(void 0),x(!0)},hideSurvey:()=>{h&&(_(void 0),C({surveyId:h.surveyId,optOut:!0}))},currentAnswer:v,setCurrentAnswer:y,isCancelled:b,completeSurvey:T},children:[r,s(n,{})]})};export{f as SurveyContext,p as SurveyProvider};
1
+ import{useToasts as e}from"../ToastProvider/ToastProvider.js";import{useConfetti as t}from"../ConfettiProvider/ConfettiProvider.js";import{SurveyDialog as n}from"./SurveyDialog/SurveyDialog.js";import{createContext as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useActiveSurvey as l,useAnswerQuestionActiveSurvey as u,useRespondActiveSurvey as d}from"@equinor/subsurface-app-management";const f=r(void 0),p=({children:r})=>{let{showToast:p}=e(),{shower:m}=t(),{data:h}=l(),[g,_]=o(0),[v,y]=o(void 0),[b,x]=o(!1),S=a(void 0),{mutateAsync:C}=d(),{mutateAsync:w}=u();i(()=>{if(h&&S.current!==h.surveyId.value){S.current=h.surveyId.value;let e=h.questions.findIndex(e=>e.answer===void 0);_(e>=0?e:0)}},[h]);let T=()=>{h&&(p({variant:`success`,title:`Survey completed`,description:`Thanks for helping us improve!`,duration:5}),h.showConfettiOnComplete&&m({mode:`shower`,shapes:[`square`],duration:5e3}))};return c(f.Provider,{value:{activeSurvey:h,activeQuestionIndex:g,setActiveQuestionIndex:_,answerQuestion:async e=>{if(!h||g===void 0||!h.questions[g])throw Error(`No active survey or question to answer`);let t=h.surveyResponseId?.value;t===void 0&&(t=(await C({surveyId:h.surveyId,optOut:!1})).value),await w({surveyResponseId:t??``,body:{id:h.questions[g].questionId,...e}}),y(void 0),g+1<h.questions.length?_(g+1):(_(void 0),T())},cancelSurvey:()=>{_(void 0),x(!0)},hideSurvey:()=>{h&&(_(void 0),C({surveyId:h.surveyId,optOut:!0}))},currentAnswer:v,setCurrentAnswer:y,isCancelled:b,completeSurvey:T},children:[r,s(n,{})]})};export{f as SurveyContext,p as SurveyProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "12.0.3",
3
+ "version": "12.0.5",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",