@openmrs/esm-styleguide 10.0.1-pre.5652 → 10.0.1-pre.5664

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.
Files changed (58) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/internal.d.ts +0 -1
  3. package/dist/internal.d.ts.map +1 -1
  4. package/dist/internal.js +0 -1
  5. package/dist/public.d.ts +0 -1
  6. package/dist/public.d.ts.map +1 -1
  7. package/dist/public.js +0 -1
  8. package/package.json +25 -25
  9. package/src/internal.ts +0 -1
  10. package/src/public.ts +0 -1
  11. package/dist/workspaces/action-menu-button/action-menu-button.component.d.ts +0 -16
  12. package/dist/workspaces/action-menu-button/action-menu-button.component.d.ts.map +0 -1
  13. package/dist/workspaces/action-menu-button/action-menu-button.component.js +0 -79
  14. package/dist/workspaces/action-menu-button/action-menu-button.module.scss +0 -111
  15. package/dist/workspaces/container/action-menu.component.d.ts +0 -10
  16. package/dist/workspaces/container/action-menu.component.d.ts.map +0 -1
  17. package/dist/workspaces/container/action-menu.component.js +0 -40
  18. package/dist/workspaces/container/action-menu.module.scss +0 -89
  19. package/dist/workspaces/container/workspace-container.component.d.ts +0 -68
  20. package/dist/workspaces/container/workspace-container.component.d.ts.map +0 -1
  21. package/dist/workspaces/container/workspace-container.component.js +0 -227
  22. package/dist/workspaces/container/workspace-renderer.component.d.ts +0 -9
  23. package/dist/workspaces/container/workspace-renderer.component.d.ts.map +0 -1
  24. package/dist/workspaces/container/workspace-renderer.component.js +0 -47
  25. package/dist/workspaces/container/workspace.module.scss +0 -276
  26. package/dist/workspaces/index.d.ts +0 -6
  27. package/dist/workspaces/index.d.ts.map +0 -1
  28. package/dist/workspaces/index.js +0 -5
  29. package/dist/workspaces/notification/workspace-notification.component.d.ts +0 -7
  30. package/dist/workspaces/notification/workspace-notification.component.d.ts.map +0 -1
  31. package/dist/workspaces/notification/workspace-notification.component.js +0 -89
  32. package/dist/workspaces/notification/workspace-notification.module.scss +0 -5
  33. package/dist/workspaces/public.d.ts +0 -5
  34. package/dist/workspaces/public.d.ts.map +0 -1
  35. package/dist/workspaces/public.js +0 -3
  36. package/dist/workspaces/workspace-sidebar-store/useWorkspaceGroupStore.d.ts +0 -12
  37. package/dist/workspaces/workspace-sidebar-store/useWorkspaceGroupStore.d.ts.map +0 -1
  38. package/dist/workspaces/workspace-sidebar-store/useWorkspaceGroupStore.js +0 -38
  39. package/dist/workspaces/workspaces.d.ts +0 -254
  40. package/dist/workspaces/workspaces.d.ts.map +0 -1
  41. package/dist/workspaces/workspaces.js +0 -504
  42. package/src/workspaces/action-menu-button/action-menu-button.component.tsx +0 -93
  43. package/src/workspaces/action-menu-button/action-menu-button.module.scss +0 -111
  44. package/src/workspaces/action-menu-button/action-menu-button.test.tsx +0 -263
  45. package/src/workspaces/container/action-menu.component.tsx +0 -47
  46. package/src/workspaces/container/action-menu.module.scss +0 -89
  47. package/src/workspaces/container/workspace-container.component.tsx +0 -271
  48. package/src/workspaces/container/workspace-container.test.tsx +0 -258
  49. package/src/workspaces/container/workspace-renderer.component.tsx +0 -53
  50. package/src/workspaces/container/workspace-renderer.test.tsx +0 -67
  51. package/src/workspaces/container/workspace.module.scss +0 -276
  52. package/src/workspaces/index.ts +0 -5
  53. package/src/workspaces/notification/workspace-notification.component.tsx +0 -100
  54. package/src/workspaces/notification/workspace-notification.module.scss +0 -5
  55. package/src/workspaces/public.ts +0 -16
  56. package/src/workspaces/workspace-sidebar-store/useWorkspaceGroupStore.ts +0 -39
  57. package/src/workspaces/workspaces.test.ts +0 -820
  58. package/src/workspaces/workspaces.ts +0 -702
@@ -1,3 +1,3 @@
1
- [0] Successfully compiled: 124 files, copied 169 files with swc (287.62ms)
1
+ [0] Successfully compiled: 115 files, copied 165 files with swc (276.08ms)
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
@@ -27,7 +27,6 @@ export * from './snackbars/snackbar.component';
27
27
  export * from './spinner';
28
28
  export * from './toasts';
29
29
  export * from './toasts/toast.component';
30
- export * from './workspaces';
31
30
  export * from './workspaces2';
32
31
  export * from './workspaces2/workspace-windows-and-menu.component';
33
32
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oDAAoD,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,oDAAoD,CAAC"}
package/dist/internal.js CHANGED
@@ -27,6 +27,5 @@ export * from "./snackbars/snackbar.component.js";
27
27
  export * from "./spinner/index.js";
28
28
  export * from "./toasts/index.js";
29
29
  export * from "./toasts/toast.component.js";
30
- export * from "./workspaces/index.js";
31
30
  export * from "./workspaces2/index.js";
32
31
  export * from "./workspaces2/workspace-windows-and-menu.component.js";
package/dist/public.d.ts CHANGED
@@ -23,6 +23,5 @@ export * from './pictograms/pictograms';
23
23
  export * from './responsive-wrapper';
24
24
  export { showSnackbar, type SnackbarDescriptor, type SnackbarType, type SnackbarMeta } from './snackbars';
25
25
  export { showToast, type ToastDescriptor, type ToastType, type ToastNotificationMeta } from './toasts';
26
- export * from './workspaces/public';
27
26
  export { launchWorkspace2, launchWorkspaceGroup2, closeWorkspaceGroup2, getRegisteredWorkspace2Names, useWorkspace2Context, ActionMenuButton2, Workspace2, type Workspace2Definition, type Workspace2DefinitionProps, } from './workspaces2';
28
27
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,GAChC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAClH,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACvG,cAAc,qBAAqB,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GAC/B,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,GAChC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAClH,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACvG,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GAC/B,MAAM,eAAe,CAAC"}
package/dist/public.js CHANGED
@@ -20,5 +20,4 @@ export * from "./pictograms/pictograms.js";
20
20
  export * from "./responsive-wrapper/index.js";
21
21
  export { showSnackbar } from "./snackbars/index.js";
22
22
  export { showToast } from "./toasts/index.js";
23
- export * from "./workspaces/public.js";
24
23
  export { launchWorkspace2, launchWorkspaceGroup2, closeWorkspaceGroup2, getRegisteredWorkspace2Names, useWorkspace2Context, ActionMenuButton2, Workspace2 } from "./workspaces2/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-styleguide",
3
- "version": "10.0.1-pre.5652",
3
+ "version": "10.0.1-pre.5664",
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.5652",
83
- "@openmrs/esm-config": "^10.0.1-pre.5652",
84
- "@openmrs/esm-emr-api": "^10.0.1-pre.5652",
85
- "@openmrs/esm-error-handling": "^10.0.1-pre.5652",
86
- "@openmrs/esm-extensions": "^10.0.1-pre.5652",
87
- "@openmrs/esm-globals": "^10.0.1-pre.5652",
88
- "@openmrs/esm-navigation": "^10.0.1-pre.5652",
89
- "@openmrs/esm-react-utils": "^10.0.1-pre.5652",
90
- "@openmrs/esm-routes": "^10.0.1-pre.5652",
91
- "@openmrs/esm-state": "^10.0.1-pre.5652",
92
- "@openmrs/esm-translations": "^10.0.1-pre.5652",
93
- "@openmrs/esm-utils": "^10.0.1-pre.5652",
82
+ "@openmrs/esm-api": "^10.0.1-pre.5664",
83
+ "@openmrs/esm-config": "^10.0.1-pre.5664",
84
+ "@openmrs/esm-emr-api": "^10.0.1-pre.5664",
85
+ "@openmrs/esm-error-handling": "^10.0.1-pre.5664",
86
+ "@openmrs/esm-extensions": "^10.0.1-pre.5664",
87
+ "@openmrs/esm-globals": "^10.0.1-pre.5664",
88
+ "@openmrs/esm-navigation": "^10.0.1-pre.5664",
89
+ "@openmrs/esm-react-utils": "^10.0.1-pre.5664",
90
+ "@openmrs/esm-routes": "^10.0.1-pre.5664",
91
+ "@openmrs/esm-state": "^10.0.1-pre.5664",
92
+ "@openmrs/esm-translations": "^10.0.1-pre.5664",
93
+ "@openmrs/esm-utils": "^10.0.1-pre.5664",
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.5652",
103
- "@openmrs/esm-config": "10.0.1-pre.5652",
104
- "@openmrs/esm-emr-api": "10.0.1-pre.5652",
105
- "@openmrs/esm-error-handling": "10.0.1-pre.5652",
106
- "@openmrs/esm-extensions": "10.0.1-pre.5652",
107
- "@openmrs/esm-globals": "10.0.1-pre.5652",
108
- "@openmrs/esm-navigation": "10.0.1-pre.5652",
109
- "@openmrs/esm-react-utils": "10.0.1-pre.5652",
110
- "@openmrs/esm-routes": "10.0.1-pre.5652",
111
- "@openmrs/esm-state": "10.0.1-pre.5652",
112
- "@openmrs/esm-translations": "10.0.1-pre.5652",
113
- "@openmrs/esm-utils": "10.0.1-pre.5652",
102
+ "@openmrs/esm-api": "10.0.1-pre.5664",
103
+ "@openmrs/esm-config": "10.0.1-pre.5664",
104
+ "@openmrs/esm-emr-api": "10.0.1-pre.5664",
105
+ "@openmrs/esm-error-handling": "10.0.1-pre.5664",
106
+ "@openmrs/esm-extensions": "10.0.1-pre.5664",
107
+ "@openmrs/esm-globals": "10.0.1-pre.5664",
108
+ "@openmrs/esm-navigation": "10.0.1-pre.5664",
109
+ "@openmrs/esm-react-utils": "10.0.1-pre.5664",
110
+ "@openmrs/esm-routes": "10.0.1-pre.5664",
111
+ "@openmrs/esm-state": "10.0.1-pre.5664",
112
+ "@openmrs/esm-translations": "10.0.1-pre.5664",
113
+ "@openmrs/esm-utils": "10.0.1-pre.5664",
114
114
  "@swc/cli": "0.8.1",
115
115
  "@swc/core": "1.15.21",
116
116
  "@types/geopattern": "^1.2.9",
package/src/internal.ts CHANGED
@@ -27,6 +27,5 @@ export * from './snackbars/snackbar.component';
27
27
  export * from './spinner';
28
28
  export * from './toasts';
29
29
  export * from './toasts/toast.component';
30
- export * from './workspaces';
31
30
  export * from './workspaces2';
32
31
  export * from './workspaces2/workspace-windows-and-menu.component';
package/src/public.ts CHANGED
@@ -26,7 +26,6 @@ export * from './pictograms/pictograms';
26
26
  export * from './responsive-wrapper';
27
27
  export { showSnackbar, type SnackbarDescriptor, type SnackbarType, type SnackbarMeta } from './snackbars';
28
28
  export { showToast, type ToastDescriptor, type ToastType, type ToastNotificationMeta } from './toasts';
29
- export * from './workspaces/public';
30
29
  export {
31
30
  launchWorkspace2,
32
31
  launchWorkspaceGroup2,
@@ -1,16 +0,0 @@
1
- /** @module @category Workspace */
2
- import React from 'react';
3
- export interface ActionMenuButtonProps {
4
- getIcon: (props: object) => JSX.Element;
5
- label: string;
6
- iconDescription: string;
7
- handler: () => void;
8
- type: string;
9
- tagContent?: string | React.ReactNode;
10
- }
11
- /**
12
- * @depcreated migrate to workspace v2 and use ActionMenuButton2. See:
13
- * https://openmrs.atlassian.net/wiki/spaces/docs/pages/615677981/Workspace+v2+Migration+Guide
14
- */
15
- export declare const ActionMenuButton: React.FC<ActionMenuButtonProps>;
16
- //# sourceMappingURL=action-menu-button.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-menu-button.component.d.ts","sourceRoot":"","sources":["../../../src/workspaces/action-menu-button/action-menu-button.component.tsx"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACvC;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmD5D,CAAC"}
@@ -1,79 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /** @module @category Workspace */ import React from "react";
3
- import classNames from "classnames";
4
- import { Button, IconButton } from "@carbon/react";
5
- import { useLayoutType } from "@openmrs/esm-react-utils";
6
- import { useWorkspaces } from "../workspaces.js";
7
- import styles from "./action-menu-button.module.scss";
8
- function Tags({ getIcon, formOpenInTheBackground, tagContent }) {
9
- return /*#__PURE__*/ _jsxs(_Fragment, {
10
- children: [
11
- getIcon({
12
- size: 16
13
- }),
14
- formOpenInTheBackground ? /*#__PURE__*/ _jsx("span", {
15
- className: styles.interruptedTag,
16
- children: "!"
17
- }) : /*#__PURE__*/ _jsx("span", {
18
- className: styles.countTag,
19
- children: tagContent
20
- })
21
- ]
22
- });
23
- }
24
- /**
25
- * @depcreated migrate to workspace v2 and use ActionMenuButton2. See:
26
- * https://openmrs.atlassian.net/wiki/spaces/docs/pages/615677981/Workspace+v2+Migration+Guide
27
- */ export const ActionMenuButton = ({ getIcon, label, iconDescription, handler, type, tagContent })=>{
28
- const layout = useLayoutType();
29
- const { workspaces, workspaceWindowState } = useWorkspaces();
30
- const workspaceIndex = workspaces?.findIndex(({ type: workspaceType })=>workspaceType === type) ?? -1;
31
- const isWorkspaceActive = workspaceWindowState !== 'hidden' && workspaceIndex === 0;
32
- const formOpenInTheBackground = workspaceIndex > 0 || workspaceIndex === 0 && workspaceWindowState === 'hidden';
33
- if (layout === 'tablet' || layout === 'phone') {
34
- return /*#__PURE__*/ _jsxs(Button, {
35
- className: classNames(styles.container, {
36
- [styles.active]: isWorkspaceActive
37
- }),
38
- iconDescription: iconDescription,
39
- kind: "ghost",
40
- onClick: handler,
41
- role: "button",
42
- tabIndex: 0,
43
- size: "md",
44
- children: [
45
- /*#__PURE__*/ _jsx("span", {
46
- className: styles.elementContainer,
47
- children: /*#__PURE__*/ _jsx(Tags, {
48
- formOpenInTheBackground: formOpenInTheBackground,
49
- getIcon: getIcon,
50
- tagContent: tagContent
51
- })
52
- }),
53
- /*#__PURE__*/ _jsx("span", {
54
- children: label
55
- })
56
- ]
57
- });
58
- }
59
- return /*#__PURE__*/ _jsx(IconButton, {
60
- align: "left",
61
- "aria-label": iconDescription,
62
- className: classNames(styles.container, {
63
- [styles.active]: isWorkspaceActive
64
- }),
65
- enterDelayMs: 300,
66
- kind: "ghost",
67
- label: label,
68
- onClick: handler,
69
- size: "md",
70
- children: /*#__PURE__*/ _jsx("div", {
71
- className: styles.elementContainer,
72
- children: /*#__PURE__*/ _jsx(Tags, {
73
- formOpenInTheBackground: formOpenInTheBackground,
74
- getIcon: getIcon,
75
- tagContent: tagContent
76
- })
77
- })
78
- });
79
- };
@@ -1,111 +0,0 @@
1
- @use '@carbon/layout';
2
- @use '@carbon/type';
3
- @use '../../vars' as *;
4
-
5
- .container {
6
- margin-top: layout.$spacing-02;
7
- margin-bottom: layout.$spacing-02;
8
- border-radius: 50%;
9
- color: $ui-05;
10
- max-width: none;
11
-
12
- &:hover {
13
- background-color: $color-gray-30;
14
- color: $text-02;
15
- }
16
-
17
- &:focus {
18
- border-color: $interactive-01;
19
- }
20
-
21
- & > span {
22
- margin-top: layout.$spacing-02;
23
- @include type.type-style('body-compact-01');
24
- color: $text-02;
25
- }
26
-
27
- & svg {
28
- transform: scale(1.25);
29
- }
30
- }
31
-
32
- .elementContainer {
33
- display: flex;
34
- align-items: center;
35
- position: relative;
36
- flex-direction: column;
37
-
38
- .countTag {
39
- position: absolute;
40
- font-size: 10px;
41
- text-align: center;
42
- color: $ui-01;
43
- background-color: $danger;
44
- padding: 0 4px;
45
- border-radius: 50%;
46
- top: -14px;
47
- right: -12px;
48
- }
49
-
50
- .interruptedTag {
51
- @extend .countTag;
52
- font-size: 10px;
53
- padding: 0 5px;
54
- width: 14px;
55
- height: 14px;
56
- }
57
- }
58
-
59
- /* Desktop */
60
- :global(.omrs-breakpoint-gt-tablet) {
61
- .active {
62
- border: layout.$spacing-01 solid;
63
- @include brand-03(border-color);
64
- border-radius: 50%;
65
- background-color: $ui-02;
66
-
67
- &:focus {
68
- border-color: var(--brand-03) !important;
69
- }
70
- }
71
-
72
- .container {
73
- & svg {
74
- transform: scale(1.25);
75
- }
76
- }
77
- }
78
-
79
- /* Tablet */
80
- :global(.omrs-breakpoint-lt-desktop) {
81
- .container {
82
- margin-bottom: 0;
83
- margin-top: 0;
84
- border-radius: unset;
85
- color: $ui-05;
86
- max-width: none;
87
-
88
- display: flex;
89
- flex-direction: column;
90
- align-items: center;
91
- width: 100%;
92
- }
93
-
94
- .active {
95
- background-color: $color-blue-10;
96
- color: $interactive-01;
97
-
98
- &:hover {
99
- color: $interactive-01;
100
- }
101
-
102
- & > span {
103
- color: $interactive-01;
104
- @include type.type-style('heading-compact-01');
105
- }
106
-
107
- svg {
108
- fill: $interactive-01;
109
- }
110
- }
111
- }
@@ -1,10 +0,0 @@
1
- /** @module @category Workspace */
2
- import React from 'react';
3
- export interface ActionMenuProps {
4
- isWithinWorkspace?: boolean;
5
- name?: string;
6
- actionMenuProps?: Record<string, unknown>;
7
- }
8
- export declare function ActionMenu({ isWithinWorkspace, name, actionMenuProps }: ActionMenuProps): React.JSX.Element;
9
- export default ActionMenu;
10
- //# sourceMappingURL=action-menu.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-menu.component.d.ts","sourceRoot":"","sources":["../../../src/workspaces/container/action-menu.component.tsx"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,OAAO,KAAkD,MAAM,OAAO,CAAC;AAKvE,MAAM,WAAW,eAAe;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,eAAoB,EAAE,EAAE,eAAe,qBAgC5F;AAED,eAAe,UAAU,CAAC"}
@@ -1,40 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /** @module @category Workspace */ import React, { useContext, useEffect, useRef, useState } from "react";
3
- import classNames from "classnames";
4
- import { ComponentContext, ExtensionSlot, isDesktop, useLayoutType } from "@openmrs/esm-react-utils";
5
- import styles from "./action-menu.module.scss";
6
- export function ActionMenu({ isWithinWorkspace, name, actionMenuProps = {} }) {
7
- const [keyboardVisible, setKeyboardVisible] = useState(false);
8
- const initialHeight = useRef(window.innerHeight);
9
- const { featureName } = useContext(ComponentContext);
10
- const layout = useLayoutType();
11
- useEffect(()=>{
12
- const handleKeyboardVisibilityChange = ()=>{
13
- setKeyboardVisible(!isDesktop(layout) && initialHeight.current > window.innerHeight);
14
- if (initialHeight.current != window.innerHeight) {
15
- initialHeight.current = window.innerHeight;
16
- }
17
- };
18
- window.addEventListener('resize', handleKeyboardVisibilityChange);
19
- return ()=>window.removeEventListener('resize', handleKeyboardVisibilityChange);
20
- }, [
21
- initialHeight
22
- ]);
23
- const extensionSlotName = `action-menu-${name && name != 'default' ? name : featureName}-items-slot`;
24
- return /*#__PURE__*/ _jsx("aside", {
25
- className: classNames(styles.sideRail, {
26
- [styles.withinWorkspace]: isWithinWorkspace,
27
- [styles.sideRailHidden]: keyboardVisible,
28
- [styles.sideRailVisible]: !keyboardVisible
29
- }),
30
- children: /*#__PURE__*/ _jsx("div", {
31
- className: styles.container,
32
- children: /*#__PURE__*/ _jsx(ExtensionSlot, {
33
- className: styles.chartExtensions,
34
- name: extensionSlotName,
35
- state: actionMenuProps
36
- })
37
- })
38
- });
39
- }
40
- export default ActionMenu;
@@ -1,89 +0,0 @@
1
- @use '@carbon/layout';
2
- @use '../../vars' as *;
3
-
4
- $icon-button-size: layout.$spacing-08;
5
- $actionPanelOffset: layout.$spacing-09;
6
-
7
- .sideRailHidden {
8
- display: none;
9
- }
10
-
11
- .sideRailVisible {
12
- display: flex;
13
- }
14
-
15
- /* Desktop */
16
- :global(.omrs-breakpoint-gt-tablet) {
17
- .sideRail {
18
- width: $actionPanelOffset;
19
-
20
- .container {
21
- position: fixed;
22
- top: var(--omrs-navbar-height);
23
- right: 0;
24
- background: $ui-01;
25
- height: 100%;
26
- z-index: 1000;
27
- width: $actionPanelOffset;
28
- border-left: 1px solid $text-03;
29
- display: flex;
30
- align-items: center;
31
- flex-direction: column;
32
- }
33
-
34
- &.withinWorkspace .container {
35
- top: calc(var(--omrs-navbar-height) + var(--workspace-header-height));
36
- }
37
- }
38
- }
39
-
40
- /* Tablet */
41
- :global(.omrs-breakpoint-lt-desktop) {
42
- .sideRail {
43
- border-top: 1px solid $color-gray-30;
44
- background-color: $ui-02;
45
- position: fixed;
46
- left: 0;
47
- bottom: 0;
48
- z-index: 8003;
49
- width: 100%;
50
- display: flex;
51
- justify-content: stretch;
52
- }
53
-
54
- .chartExtensions {
55
- background-color: $ui-02;
56
- display: flex;
57
- width: 100%;
58
-
59
- > div {
60
- flex: 1;
61
- cursor: pointer;
62
- }
63
- }
64
-
65
- .container {
66
- display: flex;
67
- align-items: center;
68
- width: 100%;
69
- }
70
- }
71
-
72
- .divider {
73
- background-color: $text-03;
74
- margin: layout.$spacing-04 0;
75
- height: 1px;
76
- width: layout.$spacing-08;
77
- }
78
-
79
- // Overriding styles for RTL support
80
- html[dir='rtl'] {
81
- :global(.omrs-breakpoint-gt-tablet) {
82
- .sideRail {
83
- .container {
84
- right: unset;
85
- left: 0;
86
- }
87
- }
88
- }
89
- }
@@ -1,68 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * @deprecated Workspace container is no longer needed with workspace v2.
4
- */
5
- export interface WorkspaceContainerProps {
6
- /**
7
- * The context key is a path element that identifies the pages on which workspaces should
8
- * appear. Defined to ensure workspaces do not stay open when navigating between pages.
9
- * Must be a valid sub-path of the URL, with no initial or trailing slash.
10
- */
11
- contextKey: string;
12
- /** When true, renders the workspace as an overlay instead of a side panel window. */
13
- overlay?: boolean;
14
- /** When true, renders the Siderail (desktop) or Bottom Nav (tablet/mobile) action menu. */
15
- showSiderailAndBottomNav?: boolean;
16
- /**
17
- * Additional props to pass to the workspace. Using this is unusual; you will generally
18
- * want to pass props to the workspace when you open it using `launchWorkspace`. Use this
19
- * only for props that will apply to every workspace launched on the page where this
20
- * component is mounted.
21
- */
22
- additionalWorkspaceProps?: object;
23
- /** Props to pass to the action menu component. */
24
- actionMenuProps?: Record<string, unknown>;
25
- }
26
- /**
27
- * Use this component to render the [workspace window](https://zeroheight.com/23a080e38/p/483a22-workspace)
28
- * in an app such as the patient chart, or a workspace overlay in an app such as the clinic dashboard.
29
- * This allows workspaces to be opened on the page where this component is mounted. This component
30
- * must not be mounted multiple times on the same page. If there are multiple apps on a page, only
31
- * one of those apps should use this component—it "hosts" the workspaces.
32
- *
33
- * Workspaces may be opened with the [[launchWorkspace]] function from `@openmrs/esm-framework`
34
- * (among other options).
35
- *
36
- * The `overlay` prop determines whether the workspace is rendered as an overlay or a window.
37
- * When a workspace window is opened, the other content on the screen will be pushed to the left.
38
- * When an overlay is opened, it will cover other content on the screen.
39
- *
40
- * The context key is a string that appears in the URL, which defines the pages on which workspaces
41
- * are valid. If the URL changes in a way such that it no longer contains the context key, then
42
- * all workspaces will be closed. This ensures that, for example, workspaces on the home page do
43
- * not stay open when the user transitions to the patient dashboard; and also that workspaces do
44
- * not stay open when the user navigates to a different patient. The context key must be a valid
45
- * sub-path of the URL, with no initial or trailing slash. So if the URL is
46
- * `https://example.com/patient/123/foo`, then `patient` and `patient/123` and `123/foo` are valid
47
- * context keys, but `patient/12` and `pati` are not.
48
- *
49
- * An extension slot is provided in the workspace header. Its name is derived from the `featureName` of
50
- * the top-level component in which it is defined (feature names are generally provided in the lifecycle
51
- * functions in an app's `index.ts` file). The slot is named `workspace-header-${featureName}-slot`.
52
- * For the patient chart, this is `workspace-header-patient-chart-slot`.
53
- *
54
- * This component also provides the [Siderail and Bottom Nav](https://zeroheight.com/23a080e38/p/948cf1-siderail-and-bottom-nav/b/86907e).
55
- * To use this, pass the `showSiderailAndBottomNav` prop. The Siderail is rendered on the right side of the screen
56
- * on desktop, and the Bottom Nav is rendered at the bottom of the screen on tablet or mobile. The sidebar/bottom-nav
57
- * menu provides an extension slot, to which buttons are attached as extensions. The slot
58
- * derives its name from the `featureName` of the top-level component in which this `WorkspaceContainer`
59
- * appears (feature names are generally provided in the lifecycle functions in an app's `index.ts` file).
60
- * The slot is named `action-menu-${featureName}-items-slot`. For the patient chart, this is
61
- * `action-menu-patient-chart-items-slot`.
62
- *
63
- * This component also provides everything needed for workspace notifications to be rendered.
64
- *
65
- * @deprecated Workspace container is no longer needed with workspace v2.
66
- */
67
- export declare function WorkspaceContainer({ contextKey, overlay, showSiderailAndBottomNav, additionalWorkspaceProps, actionMenuProps, }: WorkspaceContainerProps): React.JSX.Element;
68
- //# sourceMappingURL=workspace-container.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-container.component.d.ts","sourceRoot":"","sources":["../../../src/workspaces/container/workspace-container.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgF,MAAM,OAAO,CAAC;AAcrG;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2FAA2F;IAC3F,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kDAAkD;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,OAAO,EACP,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,GAChB,EAAE,uBAAuB,qBA+DzB"}