@openmrs/esm-styleguide 9.0.3-pre.4788 → 9.0.3-pre.4809
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/.turbo/turbo-build.log +1 -1
- package/dist/empty-card/empty-card.component.d.ts.map +1 -1
- package/dist/empty-card/empty-card.component.js +5 -3
- package/dist/empty-card/empty-card.module.scss +26 -6
- package/dist/error-state/error-state.component.d.ts.map +1 -1
- package/dist/error-state/error-state.component.js +7 -3
- package/dist/error-state/error-state.module.scss +28 -0
- package/package.json +13 -13
- package/src/empty-card/empty-card.component.tsx +3 -2
- package/src/empty-card/empty-card.module.scss +26 -6
- package/src/error-state/error-state.component.tsx +6 -2
- package/src/error-state/error-state.module.scss +28 -0
- package/src/error-state/error-state.test.tsx +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
[0] Successfully compiled: 123 files, copied 164 files with swc (
|
|
1
|
+
[0] Successfully compiled: 123 files, copied 164 files with swc (210.35ms)
|
|
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":"empty-card.component.d.ts","sourceRoot":"","sources":["../../src/empty-card/empty-card.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"empty-card.component.d.ts","sourceRoot":"","sources":["../../src/empty-card/empty-card.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,cAAc;IAC7B,oHAAoH;IACpH,WAAW,EAAE,MAAM,CAAC;IACpB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,qBAAqB,GAAI;;;CAA+B,sBAMpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA4B9C,CAAC"}
|
|
@@ -3,7 +3,6 @@ import React from "react";
|
|
|
3
3
|
import { Button, Layer, Tile } from "@carbon/react";
|
|
4
4
|
import { useLayoutType } from "@openmrs/esm-react-utils";
|
|
5
5
|
import { getCoreTranslation } from "@openmrs/esm-translations";
|
|
6
|
-
import { CardHeader } from "../cards/index.js";
|
|
7
6
|
import styles from "./empty-card.module.scss";
|
|
8
7
|
export const EmptyCardIllustration = ({ width = '64', height = '64' })=>{
|
|
9
8
|
return /*#__PURE__*/ _jsx("svg", {
|
|
@@ -25,8 +24,11 @@ export const EmptyCardIllustration = ({ width = '64', height = '64' })=>{
|
|
|
25
24
|
children: /*#__PURE__*/ _jsxs(Tile, {
|
|
26
25
|
className: styles.tile,
|
|
27
26
|
children: [
|
|
28
|
-
/*#__PURE__*/ _jsx(
|
|
29
|
-
|
|
27
|
+
/*#__PURE__*/ _jsx("div", {
|
|
28
|
+
className: isTablet ? styles.tabletHeading : styles.desktopHeading,
|
|
29
|
+
children: /*#__PURE__*/ _jsx("h4", {
|
|
30
|
+
children: props.headerTitle
|
|
31
|
+
})
|
|
30
32
|
}),
|
|
31
33
|
/*#__PURE__*/ _jsx(EmptyCardIllustration, {}),
|
|
32
34
|
/*#__PURE__*/ _jsx("p", {
|
|
@@ -13,12 +13,32 @@
|
|
|
13
13
|
margin-bottom: layout.$spacing-03;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
.desktopHeading {
|
|
17
|
+
h4 {
|
|
18
|
+
@include type.type-style('heading-compact-02');
|
|
19
|
+
color: $text-02;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.tabletHeading {
|
|
24
|
+
h4 {
|
|
25
|
+
@include type.type-style('heading-03');
|
|
26
|
+
color: $text-02;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.desktopHeading,
|
|
31
|
+
.tabletHeading {
|
|
32
|
+
text-align: left;
|
|
33
|
+
margin-bottom: layout.$spacing-05;
|
|
34
|
+
|
|
35
|
+
h4:after {
|
|
36
|
+
content: '';
|
|
37
|
+
display: block;
|
|
38
|
+
width: layout.$spacing-07;
|
|
39
|
+
padding-top: 0.188rem;
|
|
40
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
41
|
+
}
|
|
22
42
|
}
|
|
23
43
|
|
|
24
44
|
.tile {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-state.component.d.ts","sourceRoot":"","sources":["../../src/error-state/error-state.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,eAAe;IAC9B,kGAAkG;IAClG,KAAK,EAAE,GAAG,CAAC;IACX,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"error-state.component.d.ts","sourceRoot":"","sources":["../../src/error-state/error-state.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,eAAe;IAC9B,kGAAkG;IAClG,KAAK,EAAE,GAAG,CAAC;IACX,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiBhD,CAAC;AAEF,eAAO,MAAM,SAAS,2BAAa,CAAC;AACpC,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Layer, Tile } from "@carbon/react";
|
|
4
|
+
import { useLayoutType } from "@openmrs/esm-react-utils";
|
|
4
5
|
import { getCoreTranslation } from "@openmrs/esm-translations";
|
|
5
6
|
import styles from "./error-state.module.scss";
|
|
6
|
-
import { CardHeader } from "../cards/index.js";
|
|
7
7
|
export const ErrorState = ({ error, headerTitle })=>{
|
|
8
|
+
const isTablet = useLayoutType() === 'tablet';
|
|
8
9
|
return /*#__PURE__*/ _jsx(Layer, {
|
|
9
10
|
children: /*#__PURE__*/ _jsxs(Tile, {
|
|
10
11
|
className: styles.tile,
|
|
11
12
|
children: [
|
|
12
|
-
/*#__PURE__*/ _jsx(
|
|
13
|
-
|
|
13
|
+
/*#__PURE__*/ _jsx("div", {
|
|
14
|
+
className: isTablet ? styles.tabletHeading : styles.desktopHeading,
|
|
15
|
+
children: /*#__PURE__*/ _jsx("h4", {
|
|
16
|
+
children: headerTitle
|
|
17
|
+
})
|
|
14
18
|
}),
|
|
15
19
|
/*#__PURE__*/ _jsxs("p", {
|
|
16
20
|
className: styles.errorMessage,
|
|
@@ -15,6 +15,34 @@
|
|
|
15
15
|
color: $text-02;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
.desktopHeading {
|
|
19
|
+
h4 {
|
|
20
|
+
@include type.type-style('heading-compact-02');
|
|
21
|
+
color: $text-02;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tabletHeading {
|
|
26
|
+
h4 {
|
|
27
|
+
@include type.type-style('heading-03');
|
|
28
|
+
color: $text-02;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.desktopHeading,
|
|
33
|
+
.tabletHeading {
|
|
34
|
+
text-align: left;
|
|
35
|
+
margin-bottom: layout.$spacing-05;
|
|
36
|
+
|
|
37
|
+
h4:after {
|
|
38
|
+
content: '';
|
|
39
|
+
display: block;
|
|
40
|
+
width: layout.$spacing-07;
|
|
41
|
+
padding-top: 0.188rem;
|
|
42
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
18
46
|
.tile {
|
|
19
47
|
text-align: center;
|
|
20
48
|
border: 1px solid $ui-03;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-styleguide",
|
|
3
|
-
"version": "9.0.3-pre.
|
|
3
|
+
"version": "9.0.3-pre.4809",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The styleguide for OpenMRS SPA",
|
|
6
6
|
"module": "dist/internal.js",
|
|
@@ -98,18 +98,18 @@
|
|
|
98
98
|
"swr": "2.x"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@openmrs/esm-api": "9.0.3-pre.
|
|
102
|
-
"@openmrs/esm-config": "9.0.3-pre.
|
|
103
|
-
"@openmrs/esm-emr-api": "9.0.3-pre.
|
|
104
|
-
"@openmrs/esm-error-handling": "9.0.3-pre.
|
|
105
|
-
"@openmrs/esm-extensions": "9.0.3-pre.
|
|
106
|
-
"@openmrs/esm-globals": "9.0.3-pre.
|
|
107
|
-
"@openmrs/esm-navigation": "9.0.3-pre.
|
|
108
|
-
"@openmrs/esm-react-utils": "9.0.3-pre.
|
|
109
|
-
"@openmrs/esm-routes": "9.0.3-pre.
|
|
110
|
-
"@openmrs/esm-state": "9.0.3-pre.
|
|
111
|
-
"@openmrs/esm-translations": "9.0.3-pre.
|
|
112
|
-
"@openmrs/esm-utils": "9.0.3-pre.
|
|
101
|
+
"@openmrs/esm-api": "9.0.3-pre.4809",
|
|
102
|
+
"@openmrs/esm-config": "9.0.3-pre.4809",
|
|
103
|
+
"@openmrs/esm-emr-api": "9.0.3-pre.4809",
|
|
104
|
+
"@openmrs/esm-error-handling": "9.0.3-pre.4809",
|
|
105
|
+
"@openmrs/esm-extensions": "9.0.3-pre.4809",
|
|
106
|
+
"@openmrs/esm-globals": "9.0.3-pre.4809",
|
|
107
|
+
"@openmrs/esm-navigation": "9.0.3-pre.4809",
|
|
108
|
+
"@openmrs/esm-react-utils": "9.0.3-pre.4809",
|
|
109
|
+
"@openmrs/esm-routes": "9.0.3-pre.4809",
|
|
110
|
+
"@openmrs/esm-state": "9.0.3-pre.4809",
|
|
111
|
+
"@openmrs/esm-translations": "9.0.3-pre.4809",
|
|
112
|
+
"@openmrs/esm-utils": "9.0.3-pre.4809",
|
|
113
113
|
"@swc/cli": "0.8.1",
|
|
114
114
|
"@swc/core": "1.15.21",
|
|
115
115
|
"@types/geopattern": "^1.2.9",
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { Button, Layer, Tile } from '@carbon/react';
|
|
3
3
|
import { useLayoutType } from '@openmrs/esm-react-utils';
|
|
4
4
|
import { getCoreTranslation } from '@openmrs/esm-translations';
|
|
5
|
-
import { CardHeader } from '../cards';
|
|
6
5
|
import styles from './empty-card.module.scss';
|
|
7
6
|
|
|
8
7
|
export interface EmptyCardProps {
|
|
@@ -32,7 +31,9 @@ export const EmptyCard: React.FC<EmptyCardProps> = (props) => {
|
|
|
32
31
|
return (
|
|
33
32
|
<Layer className={styles.layer}>
|
|
34
33
|
<Tile className={styles.tile}>
|
|
35
|
-
<
|
|
34
|
+
<div className={isTablet ? styles.tabletHeading : styles.desktopHeading}>
|
|
35
|
+
<h4>{props.headerTitle}</h4>
|
|
36
|
+
</div>
|
|
36
37
|
<EmptyCardIllustration />
|
|
37
38
|
<p className={styles.content}>
|
|
38
39
|
{getCoreTranslation('emptyStateText', 'There are no {{displayText}} to display', {
|
|
@@ -13,12 +13,32 @@
|
|
|
13
13
|
margin-bottom: layout.$spacing-03;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
.desktopHeading {
|
|
17
|
+
h4 {
|
|
18
|
+
@include type.type-style('heading-compact-02');
|
|
19
|
+
color: $text-02;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.tabletHeading {
|
|
24
|
+
h4 {
|
|
25
|
+
@include type.type-style('heading-03');
|
|
26
|
+
color: $text-02;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.desktopHeading,
|
|
31
|
+
.tabletHeading {
|
|
32
|
+
text-align: left;
|
|
33
|
+
margin-bottom: layout.$spacing-05;
|
|
34
|
+
|
|
35
|
+
h4:after {
|
|
36
|
+
content: '';
|
|
37
|
+
display: block;
|
|
38
|
+
width: layout.$spacing-07;
|
|
39
|
+
padding-top: 0.188rem;
|
|
40
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
41
|
+
}
|
|
22
42
|
}
|
|
23
43
|
|
|
24
44
|
.tile {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Layer, Tile } from '@carbon/react';
|
|
3
|
+
import { useLayoutType } from '@openmrs/esm-react-utils';
|
|
3
4
|
import { getCoreTranslation } from '@openmrs/esm-translations';
|
|
4
5
|
import styles from './error-state.module.scss';
|
|
5
|
-
import { CardHeader } from '../cards';
|
|
6
6
|
|
|
7
7
|
export interface ErrorStateProps {
|
|
8
8
|
/** The error that caused this error card to be rendered. Expected to be a failed fetch result. */
|
|
@@ -12,10 +12,14 @@ export interface ErrorStateProps {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const ErrorState: React.FC<ErrorStateProps> = ({ error, headerTitle }) => {
|
|
15
|
+
const isTablet = useLayoutType() === 'tablet';
|
|
16
|
+
|
|
15
17
|
return (
|
|
16
18
|
<Layer>
|
|
17
19
|
<Tile className={styles.tile}>
|
|
18
|
-
<
|
|
20
|
+
<div className={isTablet ? styles.tabletHeading : styles.desktopHeading}>
|
|
21
|
+
<h4>{headerTitle}</h4>
|
|
22
|
+
</div>
|
|
19
23
|
<p className={styles.errorMessage}>
|
|
20
24
|
{getCoreTranslation('error', 'Error')} {`${error?.response?.status}: `}
|
|
21
25
|
{error?.response?.statusText}
|
|
@@ -15,6 +15,34 @@
|
|
|
15
15
|
color: $text-02;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
.desktopHeading {
|
|
19
|
+
h4 {
|
|
20
|
+
@include type.type-style('heading-compact-02');
|
|
21
|
+
color: $text-02;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tabletHeading {
|
|
26
|
+
h4 {
|
|
27
|
+
@include type.type-style('heading-03');
|
|
28
|
+
color: $text-02;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.desktopHeading,
|
|
33
|
+
.tabletHeading {
|
|
34
|
+
text-align: left;
|
|
35
|
+
margin-bottom: layout.$spacing-05;
|
|
36
|
+
|
|
37
|
+
h4:after {
|
|
38
|
+
content: '';
|
|
39
|
+
display: block;
|
|
40
|
+
width: layout.$spacing-07;
|
|
41
|
+
padding-top: 0.188rem;
|
|
42
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
18
46
|
.tile {
|
|
19
47
|
text-align: center;
|
|
20
48
|
border: 1px solid $ui-03;
|
|
@@ -31,7 +31,7 @@ describe('ErrorState', () => {
|
|
|
31
31
|
|
|
32
32
|
render(<ErrorState headerTitle="test" error={{}} />);
|
|
33
33
|
// eslint-disable-next-line testing-library/no-node-access
|
|
34
|
-
expect(screen.getByRole('heading').parentElement?.getAttribute('class')).toContain('
|
|
34
|
+
expect(screen.getByRole('heading').parentElement?.getAttribute('class')).toContain('tabletHeading');
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
it('should render desktop layout when layout type is not tablet', () => {
|
|
@@ -39,7 +39,7 @@ describe('ErrorState', () => {
|
|
|
39
39
|
|
|
40
40
|
render(<ErrorState headerTitle="test" error={{}} />);
|
|
41
41
|
// eslint-disable-next-line testing-library/no-node-access
|
|
42
|
-
expect(screen.getByRole('heading').parentElement?.getAttribute('class')).toContain('
|
|
42
|
+
expect(screen.getByRole('heading').parentElement?.getAttribute('class')).toContain('desktopHeading');
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
it('should handle error with partial response data', () => {
|