@openmrs/esm-patient-common-lib 6.1.1-pre.3526 → 6.1.1-pre.3540
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-patient-common-lib",
|
|
3
|
-
"version": "6.1.1-pre.
|
|
3
|
+
"version": "6.1.1-pre.3540",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Library for common patient chart components",
|
|
6
6
|
"browser": "dist/openmrs-esm-patient-common-lib.js",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"react": "18.x",
|
|
39
39
|
"single-spa": "5.x"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "84a1003e0fba39932ace697904c61dc0ce11b145"
|
|
42
42
|
}
|
package/src/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './responsive-wrapper.component';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Layer } from '@carbon/react';
|
|
3
|
-
import { useLayoutType } from '@openmrs/esm-framework';
|
|
4
|
-
|
|
5
|
-
type ResponsiveWrapperProps = {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* ResponsiveWrapper enables a responsive behavior for the component its wraps, providing a different rendering based on the current layout type.
|
|
11
|
-
* On desktop, it renders the children as is, while on a tablet, it wraps them in a Carbon Layer https://react.carbondesignsystem.com/?path=/docs/components-layer--overview component.
|
|
12
|
-
* This provides a light background for form inputs on tablets, in accordance with the design requirements.
|
|
13
|
-
*/
|
|
14
|
-
export default function ResponsiveWrapper({ children }: ResponsiveWrapperProps) {
|
|
15
|
-
const layout = useLayoutType();
|
|
16
|
-
const isTablet = layout === 'tablet';
|
|
17
|
-
|
|
18
|
-
if (isTablet) {
|
|
19
|
-
return <Layer>{children}</Layer>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return <>{children}</>;
|
|
23
|
-
}
|