@openmrs/esm-styleguide 6.1.1-pre.2721 → 6.1.1-pre.2727

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.
@@ -51,4 +51,4 @@ WARNING in webpack performance recommendations:
51
51
  You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
52
52
  For more info visit https://webpack.js.org/guides/code-splitting/
53
53
 
54
- webpack 5.88.0 compiled with 3 warnings in 29103 ms
54
+ webpack 5.88.0 compiled with 3 warnings in 28895 ms
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-styleguide",
3
- "version": "6.1.1-pre.2721",
3
+ "version": "6.1.1-pre.2727",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The styleguide for OpenMRS SPA",
6
6
  "browser": "dist/openmrs-esm-styleguide.js",
@@ -63,12 +63,12 @@
63
63
  "rxjs": "6.x"
64
64
  },
65
65
  "devDependencies": {
66
- "@openmrs/esm-error-handling": "6.1.1-pre.2721",
67
- "@openmrs/esm-extensions": "6.1.1-pre.2721",
68
- "@openmrs/esm-navigation": "6.1.1-pre.2721",
69
- "@openmrs/esm-react-utils": "6.1.1-pre.2721",
70
- "@openmrs/esm-state": "6.1.1-pre.2721",
71
- "@openmrs/esm-translations": "6.1.1-pre.2721",
66
+ "@openmrs/esm-error-handling": "6.1.1-pre.2727",
67
+ "@openmrs/esm-extensions": "6.1.1-pre.2727",
68
+ "@openmrs/esm-navigation": "6.1.1-pre.2727",
69
+ "@openmrs/esm-react-utils": "6.1.1-pre.2727",
70
+ "@openmrs/esm-state": "6.1.1-pre.2727",
71
+ "@openmrs/esm-translations": "6.1.1-pre.2727",
72
72
  "@types/geopattern": "^1.2.9",
73
73
  "autoprefixer": "^9.8.8",
74
74
  "css-minimizer-webpack-plugin": "^1.2.0",
@@ -182,7 +182,11 @@ const Relationships: React.FC<{ patientId: string }> = ({ patientId }) => {
182
182
 
183
183
  export function PatientBannerContactDetails({ patientId, deceased }: ContactDetailsProps) {
184
184
  return (
185
- <div className={classNames(deceased && styles.deceased, styles.contactDetails)}>
185
+ <div
186
+ className={classNames(styles.contactDetails, {
187
+ [styles.deceased]: deceased,
188
+ })}
189
+ >
186
190
  <div className={styles.row}>
187
191
  <div className={styles.col}>
188
192
  <Address patientId={patientId} />
@@ -10,6 +10,13 @@ import styles from './patient-banner-patient-info.module.scss';
10
10
 
11
11
  interface PatientBannerPatientInfoProps {
12
12
  patient: fhir.Patient;
13
+
14
+ /**
15
+ * A unique string to identify where the PatientInfo is rendered from.
16
+ * (ex: Patient Chart, search app, etc...). This string is passed into extensions to
17
+ * affect how / if they should be rendered
18
+ */
19
+ renderedFrom?: string;
13
20
  }
14
21
 
15
22
  type Gender = 'female' | 'male' | 'other' | 'unknown';
@@ -51,11 +58,14 @@ const getGender = (gender: string) => {
51
58
  };
52
59
  };
53
60
 
54
- export function PatientBannerPatientInfo({ patient }: PatientBannerPatientInfoProps) {
61
+ export function PatientBannerPatientInfo({ patient, renderedFrom }: PatientBannerPatientInfoProps) {
55
62
  const name = `${patient?.name?.[0]?.given?.join(' ')} ${patient?.name?.[0]?.family}`;
56
63
  const genderInfo = patient?.gender && getGender(patient.gender);
57
64
 
58
- const extensionState = useMemo(() => ({ patientUuid: patient.id, patient }), [patient.id, patient]);
65
+ const extensionState = useMemo(
66
+ () => ({ patientUuid: patient.id, patient, renderedFrom }),
67
+ [patient.id, patient, renderedFrom],
68
+ );
59
69
 
60
70
  return (
61
71
  <div className={styles.patientInfo}>
@@ -83,6 +93,7 @@ export function PatientBannerPatientInfo({ patient }: PatientBannerPatientInfoPr
83
93
  </>
84
94
  )}
85
95
  <PatientBannerPatientIdentifiers identifiers={patient.identifier} showIdentifierLabel />
96
+ <ExtensionSlot className={styles.extensionSlot} name="patient-banner-bottom-slot" state={extensionState} />
86
97
  </div>
87
98
  </div>
88
99
  );
@@ -1,15 +1,15 @@
1
1
  import React, { Suspense, useCallback, useContext, useEffect, useMemo } from 'react';
2
+ import { I18nextProvider, useTranslation } from 'react-i18next';
2
3
  import classNames from 'classnames';
3
4
  import { Header, HeaderGlobalAction, HeaderGlobalBar, HeaderMenuButton, HeaderName } from '@carbon/react';
4
5
  import { DownToBottom, Maximize, Minimize } from '@carbon/react/icons';
5
6
  import { ComponentContext, ExtensionSlot, isDesktop, useBodyScrollLock, useLayoutType } from '@openmrs/esm-react-utils';
6
7
  import { getCoreTranslation } from '@openmrs/esm-translations';
7
- import { I18nextProvider, useTranslation } from 'react-i18next';
8
8
  import { ArrowLeftIcon, ArrowRightIcon, CloseIcon } from '../../icons';
9
9
  import { WorkspaceNotification } from '../notification/workspace-notification.component';
10
- import ActionMenu from './action-menu.component';
11
10
  import { type OpenWorkspace, updateWorkspaceWindowState, useWorkspaces } from '../workspaces';
12
11
  import { WorkspaceRenderer } from './workspace-renderer.component';
12
+ import ActionMenu from './action-menu.component';
13
13
  import styles from './workspace.module.scss';
14
14
 
15
15
  export interface WorkspaceContainerProps {
@@ -112,7 +112,7 @@ export function WorkspaceContainer({
112
112
  {workspaces.map((workspace, i) => (
113
113
  <div
114
114
  key={`workspace-container-${workspace ? workspace.name : `empty-${i}`}`}
115
- className={classNames({ [styles.hiddenExtraWorkspace]: i !== 0 }, styles.workspaceInnerContainer)}
115
+ className={classNames(styles.workspaceInnerContainer, { [styles.hiddenExtraWorkspace]: i !== 0 })}
116
116
  >
117
117
  <Suspense fallback={null}>
118
118
  <I18nextProvider i18n={window.i18next} defaultNS={workspace.moduleName}>