@orchestrator-ui/orchestrator-ui-components 0.0.1-alpha.1 → 0.0.1-alpha.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.
package/index.js CHANGED
@@ -3,7 +3,6 @@ import { css } from '@emotion/react';
3
3
  import { useState, createContext, useContext } from 'react';
4
4
  import { useEuiTheme, EuiBadge, EuiHeader, EuiHeaderSection, EuiHeaderSectionItem, EuiHeaderLogo, EuiBadgeGroup, EuiButtonIcon, EuiSideNav, EuiPageTemplate } from '@elastic/eui';
5
5
  import { useQuery } from 'react-query';
6
- import { useRouter } from 'next/router';
7
6
 
8
7
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
9
8
 
@@ -3068,7 +3067,7 @@ const OrchestratorPageHeader = ({
3068
3067
  color: theme.colors.success
3069
3068
  })
3070
3069
  }, {
3071
- children: ["Engine ", engineStatus === null || engineStatus === void 0 ? void 0 : engineStatus.global_status]
3070
+ children: ["Engine is ", engineStatus === null || engineStatus === void 0 ? void 0 : engineStatus.global_status]
3072
3071
  })), jsx(HeaderBadge, Object.assign({
3073
3072
  color: "emptyShade",
3074
3073
  iconType: () => jsx(XCircleFill, {
@@ -3096,45 +3095,37 @@ const OrchestratorPageHeader = ({
3096
3095
  };
3097
3096
 
3098
3097
  const OrchestratorSidebar = ({
3099
- text
3100
- }) => {
3101
- const router = useRouter();
3102
- return jsx(EuiSideNav, {
3103
- mobileTitle: "Nav Items",
3104
- isOpenOnMobile: false,
3098
+ routeTo
3099
+ }) => jsx(EuiSideNav, {
3100
+ mobileTitle: "Nav Items",
3101
+ isOpenOnMobile: false,
3102
+ items: [{
3103
+ name: 'Menu',
3104
+ id: 1,
3105
3105
  items: [{
3106
- name: 'Menu',
3107
- id: 1,
3108
- items: [{
3109
- name: 'Home',
3110
- id: 2,
3111
- onClick: e => {
3112
- e.preventDefault();
3113
- router.push('/');
3114
- },
3115
- href: '/'
3116
- }, {
3117
- name: 'Subscriptions',
3118
- id: 3,
3119
- // TODO: NEXT router / EUI seem to cause unneeded re-renders. At least in dev mode,
3120
- onClick: e => {
3121
- e.preventDefault();
3122
- router.push('/subscriptions');
3123
- },
3124
- href: '/subscriptions'
3125
- }
3126
- // {
3127
- // name: 'Anchor item',
3128
- // id: 4,
3129
- // href: '#',
3130
- // },
3131
- ]
3106
+ name: 'Home',
3107
+ id: 2,
3108
+ onClick: e => {
3109
+ e.preventDefault();
3110
+ routeTo('/');
3111
+ },
3112
+ href: '/'
3113
+ }, {
3114
+ name: 'Subscriptions',
3115
+ id: 3,
3116
+ // TODO: NEXT router / EUI seem to cause unneeded re-renders. At least in dev mode,
3117
+ onClick: e => {
3118
+ e.preventDefault();
3119
+ routeTo('/subscriptions');
3120
+ },
3121
+ href: '/subscriptions'
3132
3122
  }]
3133
- });
3134
- };
3123
+ }]
3124
+ });
3135
3125
 
3136
3126
  const OrchestratorPageTemplate = ({
3137
3127
  children,
3128
+ routeTo,
3138
3129
  getAppLogo
3139
3130
  }) => {
3140
3131
  const {
@@ -3160,7 +3151,7 @@ const OrchestratorPageTemplate = ({
3160
3151
  }
3161
3152
  }, {
3162
3153
  children: jsx(OrchestratorSidebar, {
3163
- text: "Sidebar"
3154
+ routeTo: routeTo
3164
3155
  })
3165
3156
  })), jsx(EuiPageTemplate.Section, Object.assign({
3166
3157
  css: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestrator-ui/orchestrator-ui-components",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.2",
4
4
  "main": "./index.js",
5
5
  "module": "./index.js",
6
6
  "type": "module",
@@ -10,7 +10,6 @@
10
10
  "react": "18.2.0",
11
11
  "@emotion/react": "11.10.6",
12
12
  "@elastic/eui": "75.1.2",
13
- "next": "13.1.1",
14
13
  "react-query": "3.39.3"
15
14
  }
16
15
  }
@@ -1,6 +1,7 @@
1
1
  import { FC, ReactElement, ReactNode } from 'react';
2
2
  export interface OrchestratorPageTemplateProps {
3
3
  getAppLogo: (navigationHeight: number) => ReactElement;
4
+ routeTo: (route: string) => void;
4
5
  children: ReactNode;
5
6
  }
6
7
  export declare const OrchestratorPageTemplate: FC<OrchestratorPageTemplateProps>;
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  export interface OrchestratorSidebarProps {
3
- text: string;
3
+ routeTo: (route: string) => void;
4
4
  }
5
5
  export declare const OrchestratorSidebar: FC<OrchestratorSidebarProps>;