@openmrs/esm-styleguide 8.0.1-pre.3537 → 8.0.1-pre.3547

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.
@@ -0,0 +1 @@
1
+ export declare function setupPictograms(): void;
@@ -0,0 +1,64 @@
1
+ /** @category Pictograms */
2
+ import React from 'react';
3
+ import { type Argument } from 'classnames';
4
+ export declare const pictogramIds: readonly ["omrs-pict-appointments", "omrs-pict-assessment-1", "omrs-pict-assessment-2", "omrs-pict-blood-bank", "omrs-pict-cardiology", "omrs-pict-ct-scan", "omrs-pict-dentistry", "omrs-pict-emergency-department", "omrs-pict-facility", "omrs-pict-geriatrics", "omrs-pict-gynaecology", "omrs-pict-in-patient", "omrs-pict-laboratory", "omrs-pict-labs-2", "omrs-pict-obstetrics", "omrs-pict-patient-search", "omrs-pict-patients", "omrs-pict-payments-desk", "omrs-pict-pharmacy", "omrs-pict-pharmacy-2", "omrs-pict-registration", "omrs-pict-service-queues", "omrs-pict-stock-management", "omrs-pict-transfer", "omrs-pict-triage", "omrs-pict-x-ray"];
5
+ export type PictogramId = (typeof pictogramIds)[number];
6
+ export type PictogramProps = {
7
+ className?: Argument;
8
+ size?: number;
9
+ };
10
+ export declare const AppointmentsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
11
+ /**
12
+ * @deprecated use AppointmentsPictogram instead
13
+ */
14
+ export declare const AppointmentsAltPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
15
+ export declare const Assessment1Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
16
+ export declare const Assessment2Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
17
+ export declare const BloodBankPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
18
+ export declare const CardiologyPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
19
+ export declare const CtScanPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
20
+ export declare const DentistryPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
21
+ export declare const EmergencyDepartmentPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
22
+ export declare const FacilityPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
23
+ export declare const GeriatricsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
24
+ export declare const GynaecologyPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
25
+ export declare const InPatientPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
26
+ export declare const LaboratoryPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
27
+ export declare const Labs2Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
28
+ export declare const ObstetricsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
29
+ export declare const PatientSearchPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
30
+ export declare const PatientsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
31
+ export declare const PaymentsDeskPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
32
+ export declare const PharmacyPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
33
+ export declare const Pharmacy2Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
34
+ export declare const RegistrationPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
35
+ export declare const ServiceQueuesPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
36
+ export declare const StockManagementPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
37
+ export declare const TransferPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
38
+ export declare const TriagePictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
39
+ export declare const XrayPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
40
+ export declare const HomePictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
41
+ export declare const PatientListsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
42
+ /**
43
+ * This is a utility component that takes an `pictogram` and render it if the sprite for the pictogram
44
+ * is available. The goal is to make it easier to conditionally render configuration-specified pictograms.
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * <MaybePictogram pictogram='omrs-icon-baby' className={styles.myPictogramStyles} />
49
+ * ```
50
+ */
51
+ export declare const MaybePictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
52
+ pictogram: string;
53
+ fallback?: React.ReactNode;
54
+ } & PictogramProps & React.RefAttributes<SVGSVGElement>>>;
55
+ export type SvgPictogramProps = {
56
+ /** the id of the pictogram */
57
+ pictogram: PictogramId;
58
+ /** properties when using the pictogram */
59
+ pictogramProps: PictogramProps;
60
+ };
61
+ /**
62
+ * This is a utility type for custom pictograms. Please maintain alphabetical order when adding new pictograms for readability.
63
+ */
64
+ export declare const Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<SvgPictogramProps & React.RefAttributes<SVGSVGElement>>>;
@@ -0,0 +1 @@
1
+ export declare function addSvg(htmlId: string, svgString: string): void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Array of valid values for Carbon tag's "type" attribute.
3
+ * Options from https://react.carbondesignsystem.com/?path=/docs/components-tag--overview
4
+ */
5
+ export declare const carbonTagColors: readonly ["red", "magenta", "purple", "blue", "teal", "cyan", "gray", "green", "warm-gray", "cool-gray", "high-contrast", "outline"];
6
+ export type CarbonTagColor = (typeof carbonTagColors)[number];
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface WorkspaceUnsavedChangesModal {
3
+ onConfirm: () => void;
4
+ onCancel: () => void;
5
+ affectedWorkspaceTitles: string[];
6
+ }
7
+ /**
8
+ * This modal is used for prompting user to confirm closing currently opened workspace.
9
+ */
10
+ declare const Workspace2ClosePromptModal: React.FC<WorkspaceUnsavedChangesModal>;
11
+ export default Workspace2ClosePromptModal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-styleguide",
3
- "version": "8.0.1-pre.3537",
3
+ "version": "8.0.1-pre.3547",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The styleguide for OpenMRS SPA",
6
6
  "main": "dist/openmrs-esm-styleguide.js",
@@ -98,17 +98,17 @@
98
98
  "swr": "2.x"
99
99
  },
100
100
  "devDependencies": {
101
- "@openmrs/esm-api": "8.0.1-pre.3537",
102
- "@openmrs/esm-config": "8.0.1-pre.3537",
103
- "@openmrs/esm-emr-api": "8.0.1-pre.3537",
104
- "@openmrs/esm-error-handling": "8.0.1-pre.3537",
105
- "@openmrs/esm-extensions": "8.0.1-pre.3537",
106
- "@openmrs/esm-globals": "8.0.1-pre.3537",
107
- "@openmrs/esm-navigation": "8.0.1-pre.3537",
108
- "@openmrs/esm-react-utils": "8.0.1-pre.3537",
109
- "@openmrs/esm-state": "8.0.1-pre.3537",
110
- "@openmrs/esm-translations": "8.0.1-pre.3537",
111
- "@openmrs/esm-utils": "8.0.1-pre.3537",
101
+ "@openmrs/esm-api": "8.0.1-pre.3547",
102
+ "@openmrs/esm-config": "8.0.1-pre.3547",
103
+ "@openmrs/esm-emr-api": "8.0.1-pre.3547",
104
+ "@openmrs/esm-error-handling": "8.0.1-pre.3547",
105
+ "@openmrs/esm-extensions": "8.0.1-pre.3547",
106
+ "@openmrs/esm-globals": "8.0.1-pre.3547",
107
+ "@openmrs/esm-navigation": "8.0.1-pre.3547",
108
+ "@openmrs/esm-react-utils": "8.0.1-pre.3547",
109
+ "@openmrs/esm-state": "8.0.1-pre.3547",
110
+ "@openmrs/esm-translations": "8.0.1-pre.3547",
111
+ "@openmrs/esm-utils": "8.0.1-pre.3547",
112
112
  "@rspack/cli": "^1.3.11",
113
113
  "@rspack/core": "^1.3.11",
114
114
  "@types/geopattern": "^1.2.9",
@@ -47,6 +47,8 @@ body {
47
47
  height: calc(100vh - var(--omrs-navbar-height));
48
48
  top: var(--omrs-navbar-height);
49
49
  z-index: 9000;
50
+ contain: layout style paint;
51
+ will-change: contents;
50
52
  }
51
53
 
52
54
  #omrs-top-nav-app-container {
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useMemo, useState } from 'react';
2
+ import classNames from 'classnames';
2
3
  import Parcel from 'single-spa-react/parcel';
3
4
  import { mountRootParcel, type ParcelConfig } from 'single-spa';
4
5
  import { InlineLoading } from '@carbon/react';
@@ -7,6 +8,7 @@ import { loadLifeCycles } from '@openmrs/esm-routes';
7
8
  import { getCoreTranslation } from '@openmrs/esm-translations';
8
9
  import { promptForClosingWorkspaces, useWorkspace2Store } from './workspace2';
9
10
  import { type Workspace2DefinitionProps } from './workspace2.component';
11
+ import styles from './workspace2.module.scss';
10
12
 
11
13
  interface WorkspaceWindowProps {
12
14
  openedWindow: OpenedWindow;
@@ -110,11 +112,41 @@ const ActiveWorkspace: React.FC<ActiveWorkspaceProps> = ({
110
112
  [openedWorkspace, closeWorkspace, openedGroup, openedWindow],
111
113
  );
112
114
 
113
- return lifeCycle ? (
114
- <Parcel key={openedWorkspace.workspaceName} config={lifeCycle} mountParcel={mountRootParcel} {...props} />
115
- ) : (
116
- <InlineLoading description={`${getCoreTranslation('loading')} ...`} />
117
- );
115
+ if (!lifeCycle) {
116
+ const { registeredWorkspacesByName } = workspace2Store.getState();
117
+ const workspaceDef = registeredWorkspacesByName[openedWorkspace.workspaceName];
118
+ const windowName = workspaceDef?.window;
119
+ const { registeredWindowsByName } = workspace2Store.getState();
120
+ const windowDef = registeredWindowsByName[windowName];
121
+ const width = windowDef?.width ?? 'narrow';
122
+
123
+ return (
124
+ <div
125
+ className={classNames(styles.workspaceOuterContainer, {
126
+ [styles.narrowWorkspace]: width === 'narrow',
127
+ [styles.widerWorkspace]: width === 'wider',
128
+ [styles.extraWideWorkspace]: width === 'extra-wide',
129
+ })}
130
+ >
131
+ <div className={styles.workspaceSpacer} />
132
+ <div
133
+ className={classNames(styles.workspaceMiddleContainer, {
134
+ [styles.isRootWorkspace]: isRootWorkspace,
135
+ })}
136
+ >
137
+ <div
138
+ className={classNames(styles.workspaceInnerContainer, {
139
+ [styles.isRootWorkspace]: isRootWorkspace,
140
+ })}
141
+ >
142
+ <InlineLoading className={styles.loader} description={`${getCoreTranslation('loading')} ...`} />
143
+ </div>
144
+ </div>
145
+ </div>
146
+ );
147
+ }
148
+
149
+ return <Parcel key={openedWorkspace.workspaceName} config={lifeCycle} mountParcel={mountRootParcel} {...props} />;
118
150
  };
119
151
 
120
152
  export default ActiveWorkspaceWindow;
@@ -35,9 +35,10 @@ $extraWideWorkspaceWidth: 48.25rem;
35
35
  bottom: 0;
36
36
  inset-inline-end: var(--actionPanelOffset);
37
37
  z-index: 100;
38
+ will-change: transform;
38
39
 
39
40
  &.isRootWorkspace {
40
- animation: growToWidth 0.5s ease-in-out;
41
+ animation: slideFromRight 0.5s ease-in-out;
41
42
  }
42
43
 
43
44
  transition: width 0.5s ease-in-out;
@@ -49,12 +50,12 @@ $extraWideWorkspaceWidth: 48.25rem;
49
50
  width: 0;
50
51
  }
51
52
 
52
- @keyframes growToWidth {
53
+ @keyframes slideFromRight {
53
54
  from {
54
- width: 0;
55
+ transform: translateX(100%);
55
56
  }
56
57
  to {
57
- width: inherit;
58
+ transform: translateX(0);
58
59
  }
59
60
  }
60
61
  }
@@ -69,6 +70,7 @@ $extraWideWorkspaceWidth: 48.25rem;
69
70
  width: var(--workspaceWidth);
70
71
  border-inline-start: 1px solid $text-03;
71
72
  background-color: #fff;
73
+ will-change: width;
72
74
 
73
75
  transition: width 0.5s ease-in-out;
74
76
 
@@ -85,6 +87,7 @@ $extraWideWorkspaceWidth: 48.25rem;
85
87
  .workspaceSpacer {
86
88
  width: inherit;
87
89
  height: 100%;
90
+ will-change: width;
88
91
  animation: growToWidth 0.5s ease-in-out;
89
92
 
90
93
  &.hidden {
@@ -113,9 +116,9 @@ $extraWideWorkspaceWidth: 48.25rem;
113
116
 
114
117
  .loader {
115
118
  display: flex;
116
- background-color: $openmrs-background-grey;
117
119
  justify-content: center;
118
- min-height: layout.$spacing-09;
120
+ align-items: center;
121
+ min-height: 50%;
119
122
  }
120
123
 
121
124
  .hiddenExtraWorkspace {