@openmrs/esm-styleguide 10.0.1-pre.5711 → 10.0.1-pre.5720

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,3 +1,3 @@
1
- [0] Successfully compiled: 117 files, copied 170 files with swc (259.29ms)
1
+ [0] Successfully compiled: 117 files, copied 171 files with swc (199.02ms)
2
2
  [0] swc --strip-leading-paths --copy-files src -d dist && svgo -rf dist --quiet exited with code 0
3
3
  [1] tsc --project tsconfig.build.json exited with code 0
@@ -1 +1 @@
1
- {"version":3,"file":"pictogram-registration.d.ts","sourceRoot":"","sources":["../../src/pictograms/pictogram-registration.ts"],"names":[],"mappings":"AAoCA,wBAAgB,eAAe,SAkC9B"}
1
+ {"version":3,"file":"pictogram-registration.d.ts","sourceRoot":"","sources":["../../src/pictograms/pictogram-registration.ts"],"names":[],"mappings":"AAqCA,wBAAgB,eAAe,SAmC9B"}
@@ -29,6 +29,7 @@ import pharmacy2 from "./svgs/pharmacy-2.svg";
29
29
  import patientRegistration from "./svgs/registration.svg";
30
30
  import reports from "./svgs/reports.svg";
31
31
  import serviceQueues from "./svgs/service-queues.svg";
32
+ import systemAdministration from "./svgs/system-administration.svg";
32
33
  import transfer from "./svgs/transfer.svg";
33
34
  import triage from "./svgs/triage.svg";
34
35
  import xray from "./svgs/x-ray.svg";
@@ -63,6 +64,7 @@ export function setupPictograms() {
63
64
  addPictogramSvg('omrs-pict-reports', reports);
64
65
  addPictogramSvg('omrs-pict-service-queues', serviceQueues);
65
66
  addPictogramSvg('omrs-pict-stock-management', stockManagement);
67
+ addPictogramSvg('omrs-pict-system-administration', systemAdministration);
66
68
  addPictogramSvg('omrs-pict-transfer', transfer);
67
69
  addPictogramSvg('omrs-pict-triage', triage);
68
70
  addPictogramSvg('omrs-pict-x-ray', xray);
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import { type Argument } from 'classnames';
4
4
  /** Array of all available OpenMRS pictogram IDs that can be used with the Pictogram component. */
5
- 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-cohorts", "omrs-pict-concept-dictionary", "omrs-pict-ct-scan", "omrs-pict-data-entry", "omrs-pict-dentistry", "omrs-pict-digital-trust", "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-metadata-export", "omrs-pict-obstetrics", "omrs-pict-patient-documents", "omrs-pict-patient-search", "omrs-pict-patients", "omrs-pict-payments-desk", "omrs-pict-pharmacy", "omrs-pict-pharmacy-2", "omrs-pict-registration", "omrs-pict-reports", "omrs-pict-service-queues", "omrs-pict-stock-management", "omrs-pict-transfer", "omrs-pict-triage", "omrs-pict-x-ray"];
5
+ 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-cohorts", "omrs-pict-concept-dictionary", "omrs-pict-ct-scan", "omrs-pict-data-entry", "omrs-pict-dentistry", "omrs-pict-digital-trust", "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-metadata-export", "omrs-pict-obstetrics", "omrs-pict-patient-documents", "omrs-pict-patient-search", "omrs-pict-patients", "omrs-pict-payments-desk", "omrs-pict-pharmacy", "omrs-pict-pharmacy-2", "omrs-pict-registration", "omrs-pict-reports", "omrs-pict-service-queues", "omrs-pict-stock-management", "omrs-pict-system-administration", "omrs-pict-transfer", "omrs-pict-triage", "omrs-pict-x-ray"];
6
6
  export type PictogramId = (typeof pictogramIds)[number];
7
7
  export type PictogramProps = {
8
8
  className?: Argument;
@@ -45,6 +45,7 @@ export declare const RegistrationPictogram: React.MemoExoticComponent<React.Forw
45
45
  export declare const ReportsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
46
46
  export declare const ServiceQueuesPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
47
47
  export declare const StockManagementPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
48
+ export declare const SystemAdministrationPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
48
49
  export declare const TransferPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
49
50
  export declare const TriagePictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
50
51
  export declare const XrayPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"pictograms.d.ts","sourceRoot":"","sources":["../../src/pictograms/pictograms.tsx"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,OAAO,KAA8C,MAAM,OAAO,CAAC;AACnE,OAAmB,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAIvD,kGAAkG;AAClG,eAAO,MAAM,YAAY,+zBAkCf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,qBAAqB,iHAIjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,iHAAwB,CAAC;AAE9D,eAAO,MAAM,oBAAoB,iHAIhC,C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C;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,+BAA+B;IAC/B,SAAS,EAAE,WAAW,CAAC;IACvB,2CAA2C;IAC3C,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,oHAcrB,CAAC"}
@@ -34,6 +34,7 @@ import style from "./pictograms.module.scss";
34
34
  'omrs-pict-reports',
35
35
  'omrs-pict-service-queues',
36
36
  'omrs-pict-stock-management',
37
+ 'omrs-pict-system-administration',
37
38
  'omrs-pict-transfer',
38
39
  'omrs-pict-triage',
39
40
  'omrs-pict-x-ray'
@@ -253,6 +254,13 @@ export const StockManagementPictogram = /*#__PURE__*/ memo(/*#__PURE__*/ forward
253
254
  pictogramProps: props
254
255
  });
255
256
  }));
257
+ export const SystemAdministrationPictogram = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(function SystemAdministrationPictogram(props, ref) {
258
+ return /*#__PURE__*/ _jsx(Pictogram, {
259
+ ref: ref,
260
+ pictogram: "omrs-pict-system-administration",
261
+ pictogramProps: props
262
+ });
263
+ }));
256
264
  export const TransferPictogram = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(function TransferPictogram(props, ref) {
257
265
  return /*#__PURE__*/ _jsx(Pictogram, {
258
266
  ref: ref,
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg"><path fill="#CEE6E5" fill-rule="evenodd" d="M35.911 27.086c.612-.031 1.328-.501 1.599-1.051l1.136-2.309c.271-.55.958-.829 1.536-.623l5.81 2.073c.577.206.933.857.794 1.454l-.582 2.507c-.138.597.118 1.415.572 1.826l1.121 1.014c.454.411 1.293.585 1.874.387l2.436-.829a1.275 1.275 0 0 1 1.526.645l2.643 5.575a1.276 1.276 0 0 1-.467 1.59l-2.184 1.361c-.52.324-.917 1.083-.886 1.696l.075 1.509c.031.612.501 1.328 1.051 1.599l2.309 1.136c.55.271.829.958.623 1.536l-2.073 5.81a1.274 1.274 0 0 1-1.454.794l-2.507-.582c-.597-.138-1.415.118-1.826.572l-1.014 1.121c-.411.454-.585 1.293-.387 1.874l.829 2.436a1.275 1.275 0 0 1-.645 1.526l-5.575 2.643a1.276 1.276 0 0 1-1.59-.467l-1.361-2.184c-.324-.52-1.083-.917-1.696-.886l-1.509.075c-.612.031-1.328.501-1.599 1.051l-1.136 2.309c-.271.55-.958.829-1.536.623l-5.81-2.073a1.274 1.274 0 0 1-.794-1.454l.582-2.507c.138-.597-.118-1.415-.572-1.826l-1.121-1.014c-.454-.411-1.293-.585-1.874-.387l-2.436.829a1.275 1.275 0 0 1-1.526-.645l-2.643-5.575a1.276 1.276 0 0 1 .467-1.59l2.184-1.361c.52-.324.917-1.083.886-1.696l-.075-1.509c-.031-.612-.501-1.328-1.051-1.599l-2.309-1.136a1.275 1.275 0 0 1-.623-1.536l2.073-5.81a1.274 1.274 0 0 1 1.454-.794l2.507.582c.597.138 1.415-.118 1.826-.572l1.014-1.121c.411-.454.585-1.293.387-1.874l-.829-2.436a1.275 1.275 0 0 1 .645-1.526l5.575-2.643a1.276 1.276 0 0 1 1.59.467l1.361 2.184c.324.52 1.083.917 1.696.886ZM42 44a6 6 0 1 0-12 0 6 6 0 1 0 12 0" clip-rule="evenodd"/><path fill="#7BBCB9" fill-rule="evenodd" d="M62.551 20.628c.188.584.823 1.176 1.418 1.323l.94.233c.595.147.973.753.844 1.352l-.731 3.396a1.15 1.15 0 0 1-1.325.885l-.952-.174c-.603-.11-1.426.169-1.837.623l-.079.087c-.411.455-.607 1.301-.437 1.89l.269.93a1.15 1.15 0 0 1-.749 1.407l-3.306 1.066a1.15 1.15 0 0 1-1.429-.705l-.326-.912c-.206-.578-.858-1.151-1.458-1.279l-.114-.025c-.6-.129-1.43.125-1.855.566l-.672.698a1.15 1.15 0 0 1-1.593.055l-2.576-2.33a1.154 1.154 0 0 1-.104-1.591l.628-.738c.397-.467.566-1.318.378-1.902l-.036-.111c-.188-.584-.823-1.176-1.418-1.323l-.94-.233a1.15 1.15 0 0 1-.844-1.352l.731-3.396a1.15 1.15 0 0 1 1.325-.885l.952.174c.603.11 1.426-.169 1.837-.623l.079-.087c.411-.455.607-1.301.437-1.89l-.269-.93a1.15 1.15 0 0 1 .749-1.407l3.306-1.066a1.15 1.15 0 0 1 1.429.705l.326.912c.206.578.858 1.151 1.458 1.279l.114.025c.6.129 1.43-.125 1.855-.566l.672-.698a1.15 1.15 0 0 1 1.593-.055l2.576 2.33c.454.412.501 1.124.104 1.591l-.628.738c-.397.467-.566 1.318-.378 1.902ZM58.5 23a3.5 3.5 0 1 0-7 0 3.5 3.5 0 1 0 7 0" clip-rule="evenodd"/></svg>
@@ -1 +1 @@
1
- {"version":3,"file":"active-workspace-window.component.d.ts","sourceRoot":"","sources":["../../src/workspaces2/active-workspace-window.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAM5E,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGzE,UAAU,oBAAoB;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACvC,OAAO,EAAE,sBAAsB,CAAC;IAChC;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;CACzB;AAKD;;;GAGG;AACH,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4DzD,CAAC;AAoRF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"active-workspace-window.component.d.ts","sourceRoot":"","sources":["../../src/workspaces2/active-workspace-window.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAM5E,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGzE,UAAU,oBAAoB;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACvC,OAAO,EAAE,sBAAsB,CAAC;IAChC;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;CACzB;AAKD;;;GAGG;AACH,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA4DzD,CAAC;AAqRF,eAAe,qBAAqB,CAAC"}
@@ -9,7 +9,7 @@ import { isDesktop, useLayoutType, useStore } from "@openmrs/esm-react-utils";
9
9
  import { loadLifeCycles } from "@openmrs/esm-routes";
10
10
  import { getCoreTranslation } from "@openmrs/esm-translations";
11
11
  import { ArrowRightIcon, CloseIcon } from "../icons/index.js";
12
- import { closeWorkspaceGroup2, useWorkspace2Store } from "./workspace2.js";
12
+ import { closeWorkspaceGroup2, getOpenedWindowWidth, useWorkspace2Store } from "./workspace2.js";
13
13
  import styles from "./workspace2.module.scss";
14
14
  // module-level so the store subscription's snapshot getter stays stable across renders
15
15
  const selectRegisteredWorkspacesByName = (state)=>state.registeredWorkspacesByName;
@@ -171,12 +171,12 @@ const ActiveWorkspace = ({ lifeCycle, openedWorkspace, openedWindow, groupProps,
171
171
  * window system.
172
172
  */ const WorkspaceChrome = ({ openedWorkspace, openedWindow, isRootWorkspace, showActionMenu, closeWindow, children })=>{
173
173
  const layout = useLayoutType();
174
- const { openedGroup, openedWindows, registeredWindowsByName, registeredGroupsByName, isMostRecentlyOpenedWindowHidden, setWindowMaximized, hideWindow } = useWorkspace2Store();
174
+ const { openedGroup, openedWindows, registeredWindowsByName, registeredWorkspacesByName, registeredGroupsByName, isMostRecentlyOpenedWindowHidden, setWindowMaximized, hideWindow } = useWorkspace2Store();
175
175
  const windowName = openedWindow.windowName;
176
176
  const { maximized } = openedWindow;
177
177
  const title = openedWorkspace.title ?? '';
178
178
  const windowDef = registeredWindowsByName[windowName];
179
- const width = windowDef?.width ?? 'narrow';
179
+ const width = getOpenedWindowWidth(openedWindow, registeredWorkspacesByName, registeredWindowsByName);
180
180
  const icon = windowDef?.icon;
181
181
  const canMaximize = windowDef?.canMaximize;
182
182
  const canCloseGroup = openedGroup ? registeredGroupsByName[openedGroup.groupName]?.persistence === 'closable' : false;
@@ -1,4 +1,5 @@
1
1
  import { type OpenedWindow, type OpenedWorkspace, type WorkspaceStoreState2 } from '@openmrs/esm-extensions';
2
+ import { type WorkspaceDefinition2 } from '@openmrs/esm-globals';
2
3
  import { type Workspace2DefinitionProps } from './workspace2.component';
3
4
  /**
4
5
  * Attempts to launch the specified workspace group with the given group props. Note that only one workspace group
@@ -127,7 +128,7 @@ export declare const workspace2StoreActions: {
127
128
  registeredWindowsByName: Record<string, import("@openmrs/esm-globals").WorkspaceWindowDefinition2 & {
128
129
  moduleName: string;
129
130
  }>;
130
- registeredWorkspacesByName: Record<string, import("@openmrs/esm-globals").WorkspaceDefinition2 & {
131
+ registeredWorkspacesByName: Record<string, WorkspaceDefinition2 & {
131
132
  moduleName: string;
132
133
  }>;
133
134
  openedGroup: import("@openmrs/esm-extensions").OpenedGroup | null;
@@ -141,7 +142,7 @@ export declare const workspace2StoreActions: {
141
142
  registeredWindowsByName: Record<string, import("@openmrs/esm-globals").WorkspaceWindowDefinition2 & {
142
143
  moduleName: string;
143
144
  }>;
144
- registeredWorkspacesByName: Record<string, import("@openmrs/esm-globals").WorkspaceDefinition2 & {
145
+ registeredWorkspacesByName: Record<string, WorkspaceDefinition2 & {
145
146
  moduleName: string;
146
147
  }>;
147
148
  openedGroup: import("@openmrs/esm-extensions").OpenedGroup | null;
@@ -156,7 +157,7 @@ export declare const workspace2StoreActions: {
156
157
  registeredWindowsByName: Record<string, import("@openmrs/esm-globals").WorkspaceWindowDefinition2 & {
157
158
  moduleName: string;
158
159
  }>;
159
- registeredWorkspacesByName: Record<string, import("@openmrs/esm-globals").WorkspaceDefinition2 & {
160
+ registeredWorkspacesByName: Record<string, WorkspaceDefinition2 & {
160
161
  moduleName: string;
161
162
  }>;
162
163
  openedGroup: import("@openmrs/esm-extensions").OpenedGroup | null;
@@ -170,7 +171,7 @@ export declare const workspace2StoreActions: {
170
171
  registeredWindowsByName: Record<string, import("@openmrs/esm-globals").WorkspaceWindowDefinition2 & {
171
172
  moduleName: string;
172
173
  }>;
173
- registeredWorkspacesByName: Record<string, import("@openmrs/esm-globals").WorkspaceDefinition2 & {
174
+ registeredWorkspacesByName: Record<string, WorkspaceDefinition2 & {
174
175
  moduleName: string;
175
176
  }>;
176
177
  openedGroup: import("@openmrs/esm-extensions").OpenedGroup | null;
@@ -197,6 +198,12 @@ export declare const useWorkspace2Context: () => Workspace2DefinitionProps<objec
197
198
  * @returns a list of registered workspaces.
198
199
  */
199
200
  export declare const getRegisteredWorkspace2Names: () => string[];
201
+ /**
202
+ * Returns the width an opened window renders at: its leaf workspace's `width`, falling back to the
203
+ * window's `width`, then `'narrow'`. Every workspace in the window uses this width so that a wider
204
+ * workspace lower in the stack doesn't show behind a narrower one.
205
+ */
206
+ export declare function getOpenedWindowWidth(openedWindow: OpenedWindow, registeredWorkspacesByName: WorkspaceStoreState2['registeredWorkspacesByName'], registeredWindowsByName: WorkspaceStoreState2['registeredWindowsByName']): NonNullable<WorkspaceDefinition2['width']>;
200
207
  /**
201
208
  * Builds the window an `<ExportedWorkspace>` starts with: the workspace's real registered window
202
209
  * (so `launchChildWorkspace` keeps working), containing just the requested workspace.
@@ -1 +1 @@
1
- {"version":3,"file":"workspace2.d.ts","sourceRoot":"","sources":["../../src/workspaces2/workspace2.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,wB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AAiB,MAAM,qBAAqB,OAAO;6BAG1E,oBAAoB,iBAAiB,MAAM,SAAS,MAAM;CAG5C,CAAC;AAE1C,wBAAgB,kBAAkB;;;;;;;;EAEjC;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yDACyE,CAAC;AAE3G;;GAEG;AACH,eAAO,MAAM,4BAA4B,gBAExC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,YAAY,EAC1B,0BAA0B,EAAE,oBAAoB,CAAC,4BAA4B,CAAC,EAC9E,uBAAuB,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,GACvE,WAAW,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAI5C;AAWD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAC1C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GACvC,YAAY,GAAG,IAAI,CAYrB"}
@@ -606,6 +606,15 @@ export function useWorkspace2Store() {
606
606
  */ export const getRegisteredWorkspace2Names = ()=>{
607
607
  return Object.keys(workspace2Store.getState().registeredWorkspacesByName);
608
608
  };
609
+ /**
610
+ * Returns the width an opened window renders at: its leaf workspace's `width`, falling back to the
611
+ * window's `width`, then `'narrow'`. Every workspace in the window uses this width so that a wider
612
+ * workspace lower in the stack doesn't show behind a narrower one.
613
+ */ export function getOpenedWindowWidth(openedWindow, registeredWorkspacesByName, registeredWindowsByName) {
614
+ const leaf = openedWindow.openedWorkspaces[openedWindow.openedWorkspaces.length - 1];
615
+ const leafWidth = leaf ? registeredWorkspacesByName[leaf.workspaceName]?.width : undefined;
616
+ return leafWidth ?? registeredWindowsByName[openedWindow.windowName]?.width ?? 'narrow';
617
+ }
609
618
  function newOpenedWorkspace(workspaceName, workspaceProps) {
610
619
  return {
611
620
  workspaceName,
@@ -61,12 +61,9 @@ $extraWideWorkspaceWidth: 48.25rem;
61
61
  width: var(--workspaceWidth);
62
62
  border-inline-start: 1px solid $text-03;
63
63
  background-color: #fff;
64
- will-change: width;
65
- transition: width 0.5s ease-in-out;
66
64
 
67
65
  &.maximized {
68
66
  width: 100%;
69
- transition: none !important;
70
67
  }
71
68
  }
72
69
 
package/mock-jest.tsx CHANGED
@@ -135,6 +135,7 @@ export const RegistrationPictogram = () => <span>RegistrationPictogram</span>;
135
135
  export const ReportsPictogram = () => <span>ReportsPictogram</span>;
136
136
  export const ServiceQueuesPictogram = () => <span>ServiceQueuesPictogram</span>;
137
137
  export const StockManagementPictogram = () => <span>StockManagementPictogram</span>;
138
+ export const SystemAdministrationPictogram = () => <span>SystemAdministrationPictogram</span>;
138
139
  export const TransferPictogram = () => <span>TransferPictogram</span>;
139
140
  export const TriagePictogram = () => <span>TriagePictogram</span>;
140
141
  export const XrayPictogram = () => <span>XrayPictogram</span>;
package/mock.tsx CHANGED
@@ -136,6 +136,7 @@ export const RegistrationPictogram = () => <span>RegistrationPictogram</span>;
136
136
  export const ReportsPictogram = () => <span>ReportsPictogram</span>;
137
137
  export const ServiceQueuesPictogram = () => <span>ServiceQueuesPictogram</span>;
138
138
  export const StockManagementPictogram = () => <span>StockManagementPictogram</span>;
139
+ export const SystemAdministrationPictogram = () => <span>SystemAdministrationPictogram</span>;
139
140
  export const TransferPictogram = () => <span>TransferPictogram</span>;
140
141
  export const TriagePictogram = () => <span>TriagePictogram</span>;
141
142
  export const XrayPictogram = () => <span>XrayPictogram</span>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-styleguide",
3
- "version": "10.0.1-pre.5711",
3
+ "version": "10.0.1-pre.5720",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The styleguide for OpenMRS SPA",
6
6
  "module": "dist/internal.js",
@@ -79,18 +79,18 @@
79
79
  "uuid": "^11.1.1"
80
80
  },
81
81
  "peerDependencies": {
82
- "@openmrs/esm-api": "^10.0.1-pre.5711",
83
- "@openmrs/esm-config": "^10.0.1-pre.5711",
84
- "@openmrs/esm-emr-api": "^10.0.1-pre.5711",
85
- "@openmrs/esm-error-handling": "^10.0.1-pre.5711",
86
- "@openmrs/esm-extensions": "^10.0.1-pre.5711",
87
- "@openmrs/esm-globals": "^10.0.1-pre.5711",
88
- "@openmrs/esm-navigation": "^10.0.1-pre.5711",
89
- "@openmrs/esm-react-utils": "^10.0.1-pre.5711",
90
- "@openmrs/esm-routes": "^10.0.1-pre.5711",
91
- "@openmrs/esm-state": "^10.0.1-pre.5711",
92
- "@openmrs/esm-translations": "^10.0.1-pre.5711",
93
- "@openmrs/esm-utils": "^10.0.1-pre.5711",
82
+ "@openmrs/esm-api": "^10.0.1-pre.5720",
83
+ "@openmrs/esm-config": "^10.0.1-pre.5720",
84
+ "@openmrs/esm-emr-api": "^10.0.1-pre.5720",
85
+ "@openmrs/esm-error-handling": "^10.0.1-pre.5720",
86
+ "@openmrs/esm-extensions": "^10.0.1-pre.5720",
87
+ "@openmrs/esm-globals": "^10.0.1-pre.5720",
88
+ "@openmrs/esm-navigation": "^10.0.1-pre.5720",
89
+ "@openmrs/esm-react-utils": "^10.0.1-pre.5720",
90
+ "@openmrs/esm-routes": "^10.0.1-pre.5720",
91
+ "@openmrs/esm-state": "^10.0.1-pre.5720",
92
+ "@openmrs/esm-translations": "^10.0.1-pre.5720",
93
+ "@openmrs/esm-utils": "^10.0.1-pre.5720",
94
94
  "dayjs": "1.x",
95
95
  "i18next": "25.x",
96
96
  "react": "18.x",
@@ -99,18 +99,18 @@
99
99
  "swr": "2.x"
100
100
  },
101
101
  "devDependencies": {
102
- "@openmrs/esm-api": "10.0.1-pre.5711",
103
- "@openmrs/esm-config": "10.0.1-pre.5711",
104
- "@openmrs/esm-emr-api": "10.0.1-pre.5711",
105
- "@openmrs/esm-error-handling": "10.0.1-pre.5711",
106
- "@openmrs/esm-extensions": "10.0.1-pre.5711",
107
- "@openmrs/esm-globals": "10.0.1-pre.5711",
108
- "@openmrs/esm-navigation": "10.0.1-pre.5711",
109
- "@openmrs/esm-react-utils": "10.0.1-pre.5711",
110
- "@openmrs/esm-routes": "10.0.1-pre.5711",
111
- "@openmrs/esm-state": "10.0.1-pre.5711",
112
- "@openmrs/esm-translations": "10.0.1-pre.5711",
113
- "@openmrs/esm-utils": "10.0.1-pre.5711",
102
+ "@openmrs/esm-api": "10.0.1-pre.5720",
103
+ "@openmrs/esm-config": "10.0.1-pre.5720",
104
+ "@openmrs/esm-emr-api": "10.0.1-pre.5720",
105
+ "@openmrs/esm-error-handling": "10.0.1-pre.5720",
106
+ "@openmrs/esm-extensions": "10.0.1-pre.5720",
107
+ "@openmrs/esm-globals": "10.0.1-pre.5720",
108
+ "@openmrs/esm-navigation": "10.0.1-pre.5720",
109
+ "@openmrs/esm-react-utils": "10.0.1-pre.5720",
110
+ "@openmrs/esm-routes": "10.0.1-pre.5720",
111
+ "@openmrs/esm-state": "10.0.1-pre.5720",
112
+ "@openmrs/esm-translations": "10.0.1-pre.5720",
113
+ "@openmrs/esm-utils": "10.0.1-pre.5720",
114
114
  "@swc/cli": "0.8.1",
115
115
  "@swc/core": "1.15.21",
116
116
  "@types/geopattern": "^1.2.9",
@@ -29,6 +29,7 @@ import pharmacy2 from './svgs/pharmacy-2.svg';
29
29
  import patientRegistration from './svgs/registration.svg';
30
30
  import reports from './svgs/reports.svg';
31
31
  import serviceQueues from './svgs/service-queues.svg';
32
+ import systemAdministration from './svgs/system-administration.svg';
32
33
  import transfer from './svgs/transfer.svg';
33
34
  import triage from './svgs/triage.svg';
34
35
  import xray from './svgs/x-ray.svg';
@@ -65,6 +66,7 @@ export function setupPictograms() {
65
66
  addPictogramSvg('omrs-pict-reports', reports);
66
67
  addPictogramSvg('omrs-pict-service-queues', serviceQueues);
67
68
  addPictogramSvg('omrs-pict-stock-management', stockManagement);
69
+ addPictogramSvg('omrs-pict-system-administration', systemAdministration);
68
70
  addPictogramSvg('omrs-pict-transfer', transfer);
69
71
  addPictogramSvg('omrs-pict-triage', triage);
70
72
  addPictogramSvg('omrs-pict-x-ray', xray);
@@ -36,6 +36,7 @@ export const pictogramIds = [
36
36
  'omrs-pict-reports',
37
37
  'omrs-pict-service-queues',
38
38
  'omrs-pict-stock-management',
39
+ 'omrs-pict-system-administration',
39
40
  'omrs-pict-transfer',
40
41
  'omrs-pict-triage',
41
42
  'omrs-pict-x-ray',
@@ -236,6 +237,12 @@ export const StockManagementPictogram = memo(
236
237
  }),
237
238
  );
238
239
 
240
+ export const SystemAdministrationPictogram = memo(
241
+ forwardRef<SVGSVGElement, PictogramProps>(function SystemAdministrationPictogram(props, ref) {
242
+ return <Pictogram ref={ref} pictogram="omrs-pict-system-administration" pictogramProps={props} />;
243
+ }),
244
+ );
245
+
239
246
  export const TransferPictogram = memo(
240
247
  forwardRef<SVGSVGElement, PictogramProps>(function TransferPictogram(props, ref) {
241
248
  return <Pictogram ref={ref} pictogram="omrs-pict-transfer" pictogramProps={props} />;
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M35.911 27.086C36.523 27.055 37.239 26.585 37.51 26.035L38.646 23.726C38.917 23.176 39.604 22.897 40.182 23.103L45.992 25.176C46.569 25.382 46.925 26.033 46.786 26.63L46.204 29.137C46.066 29.734 46.322 30.552 46.776 30.963L47.897 31.977C48.351 32.388 49.19 32.562 49.771 32.364L52.207 31.535C52.787 31.338 53.471 31.626 53.733 32.18L56.376 37.755C56.638 38.309 56.429 39.021 55.909 39.345L53.725 40.706C53.205 41.03 52.808 41.789 52.839 42.402L52.914 43.911C52.945 44.523 53.415 45.239 53.965 45.51L56.274 46.646C56.824 46.917 57.103 47.604 56.897 48.182L54.824 53.992C54.618 54.569 53.967 54.925 53.37 54.786L50.863 54.204C50.266 54.066 49.448 54.322 49.037 54.776L48.023 55.897C47.612 56.351 47.438 57.19 47.636 57.771L48.465 60.207C48.662 60.787 48.374 61.471 47.82 61.733L42.245 64.376C41.691 64.638 40.979 64.429 40.655 63.909L39.294 61.725C38.97 61.205 38.211 60.808 37.598 60.839L36.089 60.914C35.477 60.945 34.761 61.415 34.49 61.965L33.354 64.274C33.083 64.824 32.396 65.103 31.818 64.897L26.008 62.824C25.431 62.618 25.075 61.967 25.214 61.37L25.796 58.863C25.934 58.266 25.678 57.448 25.224 57.037L24.103 56.023C23.649 55.612 22.81 55.438 22.229 55.636L19.793 56.465C19.213 56.662 18.529 56.374 18.267 55.82L15.624 50.245C15.362 49.691 15.571 48.979 16.091 48.655L18.275 47.294C18.795 46.97 19.192 46.211 19.161 45.598L19.086 44.089C19.055 43.477 18.585 42.761 18.035 42.49L15.726 41.354C15.176 41.083 14.897 40.396 15.103 39.818L17.176 34.008C17.382 33.431 18.033 33.075 18.63 33.214L21.137 33.796C21.734 33.934 22.552 33.678 22.963 33.224L23.977 32.103C24.388 31.649 24.562 30.81 24.364 30.229L23.535 27.793C23.338 27.213 23.626 26.529 24.18 26.267L29.755 23.624C30.309 23.362 31.021 23.571 31.345 24.091L32.706 26.275C33.03 26.795 33.789 27.192 34.402 27.161ZM42 44A6 6 0 1 0 30 44A6 6 0 1 0 42 44Z" fill="#CEE6E5"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M62.551 20.628C62.739 21.212 63.374 21.804 63.969 21.951L64.909 22.184C65.504 22.331 65.882 22.937 65.753 23.536L65.022 26.932C64.894 27.532 64.3 27.928 63.697 27.817L62.745 27.643C62.142 27.533 61.319 27.812 60.908 28.266L60.829 28.353C60.418 28.808 60.222 29.654 60.392 30.243L60.661 31.173C60.831 31.762 60.496 32.392 59.912 32.58L56.606 33.646C56.022 33.834 55.382 33.518 55.177 32.941L54.851 32.029C54.645 31.451 53.993 30.878 53.393 30.75L53.279 30.725C52.679 30.596 51.849 30.85 51.424 31.291L50.752 31.989C50.327 32.431 49.614 32.456 49.159 32.044L46.583 29.714C46.129 29.302 46.082 28.59 46.479 28.123L47.107 27.385C47.504 26.918 47.673 26.067 47.485 25.483L47.449 25.372C47.261 24.788 46.626 24.196 46.031 24.049L45.091 23.816C44.496 23.669 44.118 23.063 44.247 22.464L44.978 19.068C45.106 18.468 45.7 18.072 46.303 18.183L47.255 18.357C47.858 18.467 48.681 18.188 49.092 17.734L49.171 17.647C49.582 17.192 49.778 16.346 49.608 15.757L49.339 14.827C49.169 14.238 49.504 13.608 50.088 13.42L53.394 12.354C53.978 12.166 54.618 12.482 54.823 13.059L55.149 13.971C55.355 14.549 56.007 15.122 56.607 15.25L56.721 15.275C57.321 15.404 58.151 15.15 58.576 14.709L59.248 14.011C59.673 13.569 60.386 13.544 60.841 13.956L63.417 16.286C63.871 16.698 63.918 17.41 63.521 17.877L62.893 18.615C62.496 19.082 62.327 19.933 62.515 20.517ZM58.5 23A3.5 3.5 0 1 0 51.5 23A3.5 3.5 0 1 0 58.5 23Z" fill="#7BBCB9"/>
4
+ </svg>
@@ -15,7 +15,7 @@ import { isDesktop, useLayoutType, useStore } from '@openmrs/esm-react-utils';
15
15
  import { loadLifeCycles } from '@openmrs/esm-routes';
16
16
  import { getCoreTranslation } from '@openmrs/esm-translations';
17
17
  import { ArrowRightIcon, CloseIcon } from '../icons';
18
- import { closeWorkspaceGroup2, useWorkspace2Store } from './workspace2';
18
+ import { closeWorkspaceGroup2, getOpenedWindowWidth, useWorkspace2Store } from './workspace2';
19
19
  import { type Workspace2DefinitionProps } from './workspace2.component';
20
20
  import { type WorkspaceWindowActions } from './workspace-window-actions';
21
21
  import styles from './workspace2.module.scss';
@@ -262,6 +262,7 @@ const WorkspaceChrome: React.FC<WorkspaceChromeProps> = ({
262
262
  openedGroup,
263
263
  openedWindows,
264
264
  registeredWindowsByName,
265
+ registeredWorkspacesByName,
265
266
  registeredGroupsByName,
266
267
  isMostRecentlyOpenedWindowHidden,
267
268
  setWindowMaximized,
@@ -273,7 +274,7 @@ const WorkspaceChrome: React.FC<WorkspaceChromeProps> = ({
273
274
  const title = openedWorkspace.title ?? '';
274
275
 
275
276
  const windowDef = registeredWindowsByName[windowName];
276
- const width = windowDef?.width ?? 'narrow';
277
+ const width = getOpenedWindowWidth(openedWindow, registeredWorkspacesByName, registeredWindowsByName);
277
278
  const icon = windowDef?.icon;
278
279
  const canMaximize = windowDef?.canMaximize;
279
280
  const canCloseGroup = openedGroup ? registeredGroupsByName[openedGroup.groupName]?.persistence === 'closable' : false;
@@ -4,6 +4,7 @@ import { act, render, screen } from '@testing-library/react';
4
4
  import { workspace2Store, type OpenedWindow, type OpenedWorkspace } from '@openmrs/esm-extensions';
5
5
  import { loadLifeCycles } from '@openmrs/esm-routes';
6
6
  import ActiveWorkspaceWindow from './active-workspace-window.component';
7
+ import styles from './workspace2.module.scss';
7
8
  import { type Workspace2DefinitionProps } from './workspace2.component';
8
9
  import { type WorkspaceWindowActions } from './workspace-window-actions';
9
10
 
@@ -106,6 +107,48 @@ describe('ActiveWorkspaceWindow', () => {
106
107
  }
107
108
  });
108
109
 
110
+ it('applies the leaf width to loading and mounted chrome, and restores it when the child closes', async () => {
111
+ const state = workspace2Store.getState();
112
+ workspace2Store.setState({
113
+ registeredWorkspacesByName: {
114
+ ...state.registeredWorkspacesByName,
115
+ 'form-workspace': { ...state.registeredWorkspacesByName['form-workspace'], width: 'extra-wide' },
116
+ 'admit-workspace': { ...state.registeredWorkspacesByName['admit-workspace'], width: 'narrow' },
117
+ },
118
+ });
119
+ const parent = makeOpenedWorkspace('form-workspace', 'parent');
120
+ const child = makeOpenedWorkspace('admit-workspace', 'child');
121
+ const actions = makeActions();
122
+ let resolveChild: (config: { name: string }) => void;
123
+ mockLoadLifeCycles.mockImplementation((_, component) =>
124
+ component === 'form'
125
+ ? Promise.resolve({ name: 'form' } as never)
126
+ : (new Promise((resolve) => {
127
+ resolveChild = resolve as never;
128
+ }) as never),
129
+ );
130
+ const { container, rerender } = render(renderWindow(makeOpenedWindow([parent]), actions, true));
131
+ await flushLifeCycles();
132
+ // Width classes live on the chrome containers, including the loading state with no title bar.
133
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
134
+ expect(container.querySelectorAll(`.${styles.extraWideWorkspace}`)).toHaveLength(1);
135
+ rerender(renderWindow(makeOpenedWindow([parent, child]), actions, true));
136
+ // Width classes live on the chrome containers, including the loading state with no title bar.
137
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
138
+ expect(container.querySelectorAll(`.${styles.narrowWorkspace}`)).toHaveLength(2);
139
+ await act(async () => {
140
+ resolveChild({ name: 'admit' });
141
+ });
142
+ expect(screen.getAllByTestId('parcel')).toHaveLength(2);
143
+ // Width classes live on the chrome containers, including the loading state with no title bar.
144
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
145
+ expect(container.querySelectorAll(`.${styles.narrowWorkspace}`)).toHaveLength(2);
146
+ rerender(renderWindow(makeOpenedWindow([parent]), actions, true));
147
+ // Width classes live on the chrome containers, including the loading state with no title bar.
148
+ // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
149
+ expect(container.querySelectorAll(`.${styles.extraWideWorkspace}`)).toHaveLength(1);
150
+ });
151
+
109
152
  it('does not render a replaced workspace with the previous workspace lifecycle at the same stack position', async () => {
110
153
  // The form lifecycle resolves immediately. The admit lifecycle resolves only
111
154
  // when we release it, keeping the reload from the stack change pending, which
@@ -61,12 +61,9 @@ $extraWideWorkspaceWidth: 48.25rem;
61
61
  width: var(--workspaceWidth);
62
62
  border-inline-start: 1px solid $text-03;
63
63
  background-color: #fff;
64
- will-change: width;
65
- transition: width 0.5s ease-in-out;
66
64
 
67
65
  &.maximized {
68
66
  width: 100%;
69
- transition: none !important;
70
67
  }
71
68
  }
72
69
 
@@ -9,6 +9,7 @@ import {
9
9
  closeWorkspaceInWindow,
10
10
  openChildWorkspaceInWindow,
11
11
  updateOpenedWorkspaceInWindow,
12
+ getOpenedWindowWidth,
12
13
  workspace2StoreActions,
13
14
  } from './workspace2';
14
15
 
@@ -268,3 +269,70 @@ describe('updateOpenedWorkspaceInWindow', () => {
268
269
  expect(updateOpenedWorkspaceInWindow(window, 'uuid-parent-workspace', { hasUnsavedChanges: false })).toBe(window);
269
270
  });
270
271
  });
272
+
273
+ describe('getOpenedWindowWidth', () => {
274
+ const registeredWindowsByName = {
275
+ 'test-window': { name: 'test-window', group: 'test-group', width: 'wider' as const, moduleName: 'test' },
276
+ 'plain-window': { name: 'plain-window', group: 'test-group', moduleName: 'test' },
277
+ };
278
+ const registeredWorkspacesByName = {
279
+ 'inherits-width': { name: 'inherits-width', component: 'a', window: 'test-window', moduleName: 'test' },
280
+ 'extra-wide': {
281
+ name: 'extra-wide',
282
+ component: 'b',
283
+ window: 'test-window',
284
+ width: 'extra-wide' as const,
285
+ moduleName: 'test',
286
+ },
287
+ 'narrow-on-plain': { name: 'narrow-on-plain', component: 'c', window: 'plain-window', moduleName: 'test' },
288
+ };
289
+
290
+ function makeWindow(windowName: string, workspaceNames: Array<string>) {
291
+ return {
292
+ windowName,
293
+ openedWorkspaces: workspaceNames.map((n) => makeOpenedWorkspace(n)),
294
+ props: null,
295
+ maximized: false,
296
+ };
297
+ }
298
+
299
+ it("uses the window's width when the leaf workspace declares none", () => {
300
+ expect(
301
+ getOpenedWindowWidth(
302
+ makeWindow('test-window', ['inherits-width']),
303
+ registeredWorkspacesByName,
304
+ registeredWindowsByName,
305
+ ),
306
+ ).toBe('wider');
307
+ });
308
+
309
+ it("uses the leaf workspace's width over the window's width", () => {
310
+ expect(
311
+ getOpenedWindowWidth(
312
+ makeWindow('test-window', ['inherits-width', 'extra-wide']),
313
+ registeredWorkspacesByName,
314
+ registeredWindowsByName,
315
+ ),
316
+ ).toBe('extra-wide');
317
+ });
318
+
319
+ it('ignores the width of non-leaf workspaces', () => {
320
+ expect(
321
+ getOpenedWindowWidth(
322
+ makeWindow('test-window', ['extra-wide', 'inherits-width']),
323
+ registeredWorkspacesByName,
324
+ registeredWindowsByName,
325
+ ),
326
+ ).toBe('wider');
327
+ });
328
+
329
+ it("defaults to 'narrow' when neither the workspace nor the window declares a width", () => {
330
+ expect(
331
+ getOpenedWindowWidth(
332
+ makeWindow('plain-window', ['narrow-on-plain']),
333
+ registeredWorkspacesByName,
334
+ registeredWindowsByName,
335
+ ),
336
+ ).toBe('narrow');
337
+ });
338
+ });
@@ -10,6 +10,7 @@ import {
10
10
  workspace2Store,
11
11
  type WorkspaceStoreState2,
12
12
  } from '@openmrs/esm-extensions';
13
+ import { type WorkspaceDefinition2 } from '@openmrs/esm-globals';
13
14
  import { useStoreWithActions, type Actions } from '@openmrs/esm-react-utils';
14
15
  import { shallowEqual } from '@openmrs/esm-utils';
15
16
  import { showModal } from '../modals';
@@ -683,6 +684,21 @@ export const getRegisteredWorkspace2Names = () => {
683
684
  return Object.keys(workspace2Store.getState().registeredWorkspacesByName);
684
685
  };
685
686
 
687
+ /**
688
+ * Returns the width an opened window renders at: its leaf workspace's `width`, falling back to the
689
+ * window's `width`, then `'narrow'`. Every workspace in the window uses this width so that a wider
690
+ * workspace lower in the stack doesn't show behind a narrower one.
691
+ */
692
+ export function getOpenedWindowWidth(
693
+ openedWindow: OpenedWindow,
694
+ registeredWorkspacesByName: WorkspaceStoreState2['registeredWorkspacesByName'],
695
+ registeredWindowsByName: WorkspaceStoreState2['registeredWindowsByName'],
696
+ ): NonNullable<WorkspaceDefinition2['width']> {
697
+ const leaf = openedWindow.openedWorkspaces[openedWindow.openedWorkspaces.length - 1];
698
+ const leafWidth = leaf ? registeredWorkspacesByName[leaf.workspaceName]?.width : undefined;
699
+ return leafWidth ?? registeredWindowsByName[openedWindow.windowName]?.width ?? 'narrow';
700
+ }
701
+
686
702
  function newOpenedWorkspace(workspaceName: string, workspaceProps: Record<string, any> | null): OpenedWorkspace {
687
703
  return {
688
704
  workspaceName,