@equinor/amplify-component-lib 8.17.5 → 8.18.1

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.
@@ -7,6 +7,7 @@ export interface ToggleEventProps<T> {
7
7
  export interface OptionDrawerProps<T extends {
8
8
  id: string;
9
9
  label: string;
10
+ disabled?: boolean;
10
11
  parentId?: string;
11
12
  children?: T[];
12
13
  }> {
@@ -27,6 +28,7 @@ export declare const OptionDrawer: {
27
28
  <T extends {
28
29
  id: string;
29
30
  label: string;
31
+ disabled?: boolean;
30
32
  parentId?: string;
31
33
  children?: T[];
32
34
  }>({ item, onToggle, section, selectedItems, singleSelect, siblings, animateCheck, animateUncheck, animateParent, openAll, showIntermediateParent, parentHasNestedItems, }: OptionDrawerProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{Button as r,Checkbox as o}from"@equinor/eds-core-react";import{chevron_down as d,chevron_right as a}from"@equinor/eds-icons";import{StyledOptionWrapper as l,StyledOptionItem as c,StyledIcon as s,StyledOption as E}from"./OptionDrawer.styles.js";const m=e=>{if(0===e.length)return[];let t=[];return e.forEach((e=>{const n=m(e?.children??[]);t=[e,...t,...n]})),t},h=(e,t,n,i)=>{if(void 0!==t.find((t=>t.id===e.id)))return"CHECKED";if(void 0===e.children||0===e.children.length||n&&!i)return"NONE";const r=m(e?.children).map((e=>void 0!==t.find((t=>t.id===e.id))));return!n&&r.every(Boolean)?"CHECKED":r.every((e=>!e))?"NONE":"INTERMEDIATE"},p=({item:m,onToggle:g,section:C=0,selectedItems:N=[],singleSelect:f=!1,siblings:u,animateCheck:D,animateUncheck:I,animateParent:T,openAll:v,showIntermediateParent:H=!1,parentHasNestedItems:O=!1})=>{const[K,k]=n(!1),[y,A]=n(h(m,N,f,H)),[$,w]=n(!1);i((()=>{A(h(m,N,f,H))}),[m,N,f,H]),i((()=>{k(!!v)}),[v]);const M=e=>{const t=0===m.children?.length||f||void 0===m.children?[m]:[...m.children];"CHECKED"===y?(g({items:t,toggle:!1,event:e}),k(!1)):"NONE"!==y&&"INTERMEDIATE"!==y||(g({items:t,toggle:!0,event:e}),k(!0)),w(!1)},P=(e,t)=>{t&&T?(T(!0),A("CHECKED"===y?"NONE":"CHECKED"),setTimeout((()=>{M(e)}),400)):u?M(e):(w(!0),A("CHECKED"===y?"NONE":"CHECKED"),setTimeout((()=>{M(e)}),400))},R=e=>{if(u&&T){const t=N.filter((e=>e.id.includes(m.parentId??""))).length;if(!e&&D&&t===u-1)return!0;if(e&&I&&1===t)return!0}return!1},S=e=>{"CHECKED"===y&&I?P(e,R(!0)):"NONE"!==y&&"INTERMEDIATE"!==y||!D?M(e):P(e,R(!1))},b=m.children&&0!==m.children.length;return e(l,{$section:C,$animationActive:$,"data-testid":$?"animated-"+m.id:m.id,children:[e(c,{$paddedLeft:O&&!b,children:[b&&t(r,{variant:"ghost_icon",onClick:()=>{k((e=>!e))},"data-testid":"chevron-toggler-option-drawer",children:t(s,{data:K?d:a})}),e(E,{$section:C,onClick:e=>{m.children&&0!==m.children.length&&k((e=>!e)),S(e)},children:[t(o,{indeterminate:"INTERMEDIATE"===y,checked:"CHECKED"===y,color:"secondary",onChange:()=>null}),m.label]})]}),K&&m.children?.map((e=>t(p,{section:C+1,onToggle:g,selectedItems:N,item:e,singleSelect:f,siblings:m.children?.length,animateCheck:D,animateUncheck:I,animateParent:w,openAll:v,showIntermediateParent:H,parentHasNestedItems:!0},`OptionDrawer-${e.id}`)))]},$?`animated-StyledOptionWrapper-${m.id}`:`StyledOptionWrapper-${m.id}`)};p.displayName="OptionDrawer";export{p as OptionDrawer};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{Button as r,Checkbox as d}from"@equinor/eds-core-react";import{chevron_down as o,chevron_right as a}from"@equinor/eds-icons";import{StyledOptionWrapper as l,StyledOptionItem as c,StyledIcon as s,StyledOption as E}from"./OptionDrawer.styles.js";const m=e=>{if(0===e.length)return[];let t=[];return e.forEach((e=>{const i=m(e?.children??[]);t=[e,...t,...i]})),t},h=(e,t,i,n)=>{if(void 0!==t.find((t=>t.id===e.id)))return"CHECKED";if(void 0===e.children||0===e.children.length||i&&!n)return"NONE";const r=m(e?.children).map((e=>void 0!==t.find((t=>t.id===e.id))));return!i&&r.every(Boolean)?"CHECKED":r.every((e=>!e))?"NONE":"INTERMEDIATE"},p=({item:m,onToggle:g,section:C=0,selectedItems:N=[],singleSelect:f=!1,siblings:D,animateCheck:u,animateUncheck:I,animateParent:T,openAll:v,showIntermediateParent:H=!1,parentHasNestedItems:O=!1})=>{const[K,b]=i(!1),[k,y]=i(h(m,N,f,H)),[A,$]=i(!1);n((()=>{y(h(m,N,f,H))}),[m,N,f,H]),n((()=>{b(!!v)}),[v]);const w=e=>{const t=0===m.children?.length||f||void 0===m.children?[m]:[...m.children];"CHECKED"===k?(g({items:t,toggle:!1,event:e}),b(!1)):"NONE"!==k&&"INTERMEDIATE"!==k||(g({items:t,toggle:!0,event:e}),b(!0)),$(!1)},M=(e,t)=>{t&&T?(T(!0),y("CHECKED"===k?"NONE":"CHECKED"),setTimeout((()=>{w(e)}),400)):D?w(e):($(!0),y("CHECKED"===k?"NONE":"CHECKED"),setTimeout((()=>{w(e)}),400))},P=e=>{if(D&&T){const t=N.filter((e=>e.id.includes(m.parentId??""))).length;if(!e&&u&&t===D-1)return!0;if(e&&I&&1===t)return!0}return!1},R=e=>{"CHECKED"===k&&I?M(e,P(!0)):"NONE"!==k&&"INTERMEDIATE"!==k||!u?w(e):M(e,P(!1))},S=m.children&&0!==m.children.length;return e(l,{$section:C,$animationActive:A,"data-testid":A?"animated-"+m.id:m.id,children:[e(c,{$paddedLeft:O&&!S,children:[S&&t(r,{variant:"ghost_icon",onClick:()=>{b((e=>!e))},"data-testid":"chevron-toggler-option-drawer",children:t(s,{data:K?o:a})}),e(E,{$section:C,onClick:e=>{m.disabled||(m.children&&0!==m.children.length&&b((e=>!e)),R(e))},disabled:!!m.disabled,children:[t(d,{indeterminate:"INTERMEDIATE"===k,checked:"CHECKED"===k,color:"secondary",disabled:!!m.disabled}),m.label]})]}),K&&m.children?.map((e=>t(p,{section:C+1,onToggle:g,selectedItems:N,item:e,singleSelect:f,siblings:m.children?.length,animateCheck:u,animateUncheck:I,animateParent:$,openAll:v,showIntermediateParent:H,parentHasNestedItems:!0},`OptionDrawer-${e.id}`)))]},A?`animated-StyledOptionWrapper-${m.id}`:`StyledOptionWrapper-${m.id}`)};p.displayName="OptionDrawer";export{p as OptionDrawer};
@@ -3,7 +3,7 @@ interface StyledOptionProps {
3
3
  $animationActive?: boolean;
4
4
  }
5
5
  declare const StyledOptionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledOptionProps>> & string;
6
- declare const StyledOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledOptionProps>> & string;
6
+ declare const StyledOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, StyledOptionProps>> & string;
7
7
  declare const StyledIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Omit<Omit<{
8
8
  title?: string;
9
9
  color?: string;
@@ -1,4 +1,4 @@
1
- import{Icon as i}from"@equinor/eds-core-react";import{colors as e}from"../../atoms/style/colors.js";import t,{keyframes as o,css as r}from"styled-components";const a=o`
1
+ import{Icon as o}from"@equinor/eds-core-react";import{colors as t}from"../../atoms/style/colors.js";import e,{keyframes as i,css as r}from"styled-components";const a=i`
2
2
  0% {
3
3
  opacity: 1;
4
4
  }
@@ -9,29 +9,42 @@ import{Icon as i}from"@equinor/eds-core-react";import{colors as e}from"../../ato
9
9
  opacity: 0;
10
10
  display: none;
11
11
  }
12
- `,n=t.div`
13
- margin-left: ${({$section:i})=>i>0?"22px":""};
12
+ `,n=e.div`
13
+ margin-left: ${({$section:o})=>o>0?"22px":""};
14
14
  opacity: 1;
15
- color: ${e.text.static_icons__default.rgba};
16
- animation: ${({$animationActive:i})=>i?r`
15
+ color: ${t.text.static_icons__default.rgba};
16
+ animation: ${({$animationActive:o})=>o?r`
17
17
  ${a} 400ms ease-in
18
18
  `:"none"};
19
- `,s=t.div`
19
+ `,s=e.button`
20
20
  position: relative;
21
21
  display: flex;
22
22
  flex: 1;
23
23
  align-items: center;
24
24
  cursor: pointer;
25
25
  transition: background-color 0.1s ease-in;
26
- &:hover {
27
- background-color: ${e.interactive.primary__hover_alt.rgba};
26
+ font-family: 'Equinor', sans-serif;
27
+ font-size: 1rem;
28
+ color: ${t.text.static_icons__default.rgba};
29
+ &:hover:not(:disabled) {
30
+ background-color: ${t.interactive.primary__hover_alt.rgba};
31
+ }
32
+ &:disabled {
33
+ cursor: not-allowed;
34
+ color: ${t.interactive.disabled__text.rgba};
35
+ > button {
36
+ cursor: not-allowed;
37
+ }
38
+ }
39
+ > span::before {
40
+ display: none;
28
41
  }
29
42
 
30
43
  svg {
31
- fill: ${e.interactive.primary__resting.rgba};
44
+ fill: ${t.interactive.primary__resting.rgba};
32
45
  }
33
- `,c=t(i)``,l=t.div`
46
+ `,l=e(o)``,c=e.div`
34
47
  display: flex;
35
48
  align-items: center;
36
- ${({$paddedLeft:i})=>i&&"margin-left: 40px"};
37
- `;export{c as StyledIcon,s as StyledOption,l as StyledOptionItem,n as StyledOptionWrapper};
49
+ ${({$paddedLeft:o})=>o&&"margin-left: 40px"};
50
+ `;export{l as StyledIcon,s as StyledOption,c as StyledOptionItem,n as StyledOptionWrapper};
@@ -1,6 +1,7 @@
1
1
  export interface ValueType {
2
2
  id: string;
3
3
  label: string;
4
+ disabled?: boolean;
4
5
  children?: ValueType[];
5
6
  value: number;
6
7
  }
@@ -1 +1 @@
1
- import{jsxs as r,jsx as o}from"react/jsx-runtime";import"react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import"../../TopBar/Notifications/NotificationProvider.js";import"../../../providers/AuthProvider/AuthProvider.js";import"../../../providers/ReleaseNotesProvider.js";import"../../../providers/SideBarProvider.js";import"../../../providers/SnackbarProvider/SnackbarProvider.js";import"../../../providers/StepperProvider.js";import"../../../providers/TableOfContentsProvider.js";import"../../../providers/ThemeProvider/ThemeProvider.js";import"../../../providers/TutorialStepsProvider.js";import"../../../atoms/style/colors.js";import"../../../atoms/enums/Errors.js";import"../../../atoms/enums/Theme.js";import"../../../atoms/enums/SpacingsMode.js";import"../../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import{Status as e}from"../index.js";const i=()=>{const i=t.getAppName(import.meta.env.VITE_NAME);return r(e,{children:[o(e.Title,{title:`You don't have access to ${i}`}),o(e.Description,{text:"You can apply for acces to the app in AccessIT"}),o(e.Action,{onClick:()=>{window.open(`https://www.accessit.equinor.com/Search/Search?term=${encodeURIComponent(i)}`,"_blank")},buttonText:"Apply for access"})]})};export{i as MissingAccessToApp};
1
+ import{jsxs as r,jsx as o}from"react/jsx-runtime";import"react";import"../../../molecules/RichTextEditor/custom-extensions/AmplifyKit.js";import"../../../molecules/RichTextEditor/RichTextEditor.types.js";import"../../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../../atoms/enums/Environment.js";import{environment as t}from"../../../atoms/utils/auth_environment.js";import"../../TopBar/Notifications/NotificationProvider.js";import"../../../providers/AuthProvider/AuthProvider.js";import"../../../providers/ReleaseNotesProvider.js";import"../../../providers/SideBarProvider.js";import"../../../providers/SnackbarProvider/SnackbarProvider.js";import"../../../providers/StepperProvider.js";import"../../../providers/TableOfContentsProvider.js";import"../../../providers/ThemeProvider/ThemeProvider.js";import"../../../providers/TutorialStepsProvider.js";import"../../../atoms/style/colors.js";import"../../../atoms/enums/Errors.js";import"../../../atoms/enums/Theme.js";import"../../../atoms/enums/SpacingsMode.js";import"../../../deprecated/ErrorPage/illustrations/GlitchAnimation.js";import"../../../deprecated/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import{Status as e}from"../index.js";const i=()=>{const i=t.getAppName(import.meta.env.VITE_NAME);return r(e,{children:[o(e.Title,{title:`You don't have access to ${i}`}),o(e.Description,{text:"You can apply for acces to the app in AccessIT"}),o(e.Action,{onClick:()=>{window.open(`https://accessit.equinor.com/Search/Search?term=${encodeURIComponent(i)}`,"_blank")},buttonText:"Apply for access"})]})};export{i as MissingAccessToApp};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "8.17.5",
3
+ "version": "8.18.1",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",