@equinor/amplify-component-lib 9.5.2 → 9.5.3

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.
@@ -1,6 +1,6 @@
1
- import { FC } from 'react';
1
+ import { FC, HTMLAttributes } from 'react';
2
2
  import { MyTutorialDto } from '@equinor/subsurface-app-management';
3
- interface TutorialsProps {
3
+ interface TutorialsProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'color' | 'onClick'> {
4
4
  onTutorialStart?: (tutorialId: string) => void;
5
5
  filterTutorials?: (value: MyTutorialDto, index: number, array: MyTutorialDto[]) => boolean;
6
6
  }
@@ -1 +1 @@
1
- import{jsxs as r,Fragment as t,jsx as o}from"react/jsx-runtime";import{useState as i,useRef as e}from"react";import{Icon as n,Typography as a,Divider as l}from"@equinor/eds-core-react";import{youtube_alt as s}from"@equinor/eds-icons";import{useTutorials as c}from"@equinor/subsurface-app-management";import{TutorialItem as m}from"./TutorialItem.js";import{Container as p,TutorialList as u}from"./Tutorials.styles.js";import{TopBarButton as h}from"../TopBar.styles.js";import{TopBarMenu as d}from"../TopBarMenu.js";const f=({filterTutorials:f,onTutorialStart:T})=>{const{allTutorials:g,tutorialsOnThisPage:j}=c(),[v,C]=i(!1),q=e(null),x=f?g.filter(f):g,S=f?j.filter(f):j,b=x.filter((r=>-1===S.findIndex((t=>t.id===r.id)))),y=()=>C((r=>!r));return r(t,{children:[o(h,{variant:"ghost_icon",ref:q,onClick:y,children:o(n,{data:s})}),v&&o(d,{open:!0,onClose:y,anchorEl:q.current,children:r(p,{children:[r(a,{variant:"h4",children:["Available Tutorials (",x.length,")"]}),S.length>0&&r(u,{children:[o(a,{variant:"caption",children:"For current page"}),S.map((r=>o(m,{onTutorialStart:T,onClose:y,...r},r.id)))]}),S.length>0&&S.length>0&&o(l,{}),b.length>0&&r(u,{children:[o(a,{variant:"caption",children:"For other pages"}),b.map((r=>o(m,{onTutorialStart:T,onClose:y,...r},r.id)))]})]})})]})};export{f as Tutorials};
1
+ import{jsxs as r,Fragment as t,jsx as o}from"react/jsx-runtime";import{useState as i,useRef as e}from"react";import{Icon as n,Typography as a,Divider as l}from"@equinor/eds-core-react";import{youtube_alt as s}from"@equinor/eds-icons";import{useTutorials as c}from"@equinor/subsurface-app-management";import{TutorialItem as m}from"./TutorialItem.js";import{Container as p,TutorialList as u}from"./Tutorials.styles.js";import{TopBarButton as h}from"../TopBar.styles.js";import{TopBarMenu as d}from"../TopBarMenu.js";const f=({filterTutorials:f,onTutorialStart:T,...g})=>{const{allTutorials:j,tutorialsOnThisPage:v}=c(),[C,q]=i(!1),x=e(null),S=f?j.filter(f):j,b=f?v.filter(f):v,y=S.filter((r=>-1===b.findIndex((t=>t.id===r.id)))),B=()=>q((r=>!r));return r(t,{children:[o(h,{variant:"ghost_icon",ref:x,onClick:B,...g,children:o(n,{data:s})}),C&&o(d,{open:!0,onClose:B,anchorEl:x.current,children:r(p,{children:[r(a,{variant:"h4",children:["Available Tutorials (",S.length,")"]}),b.length>0&&r(u,{children:[o(a,{variant:"caption",children:"For current page"}),b.map((r=>o(m,{onTutorialStart:T,onClose:B,...r},r.id)))]}),b.length>0&&b.length>0&&o(l,{}),y.length>0&&r(u,{children:[o(a,{variant:"caption",children:"For other pages"}),y.map((r=>o(m,{onTutorialStart:T,onClose:B,...r},r.id)))]})]})})]})};export{f as Tutorials};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "9.5.2",
3
+ "version": "9.5.3",
4
4
  "description": "Frontend Typescript components for the Amplify team",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",