@openmrs/esm-form-engine-lib 4.2.2-pre.2622 → 4.2.2-pre.2626

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,6 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import styles from "./file-thumbnail.scss";
3
- import { CloseFilled, DocumentPdf, DocumentUnknown } from "@carbon/react/icons";
3
+ import { Close, DocumentPdf, DocumentUnknown } from "@carbon/react/icons";
4
4
  import { Button } from "@carbon/react";
5
5
  export function FileThumbnail({ bytesContentFamily, removeFileCb, ...thumbnailProps }) {
6
6
  const Thumbnail = useMemo(()=>{
@@ -19,7 +19,7 @@ export function FileThumbnail({ bytesContentFamily, removeFileCb, ...thumbnailPr
19
19
  kind: "ghost",
20
20
  className: styles.removeButton,
21
21
  onClick: removeFileCb
22
- }, /*#__PURE__*/ React.createElement(CloseFilled, {
22
+ }, /*#__PURE__*/ React.createElement(Close, {
23
23
  size: 16,
24
24
  className: styles.closeIcon
25
25
  })));
@@ -1,15 +1,18 @@
1
+ @use '@carbon/colors';
1
2
  @use '@carbon/layout';
2
3
  @use '@openmrs/esm-styleguide/src/vars' as vars;
3
4
 
4
5
  .thumbnail {
6
+ position: relative;
5
7
  height: 7rem;
6
8
  width: 7rem;
9
+ background-color: colors.$white;
7
10
  }
8
11
 
9
12
  .imageThumbnail {
10
- max-width: 100%;
11
- max-height: 100%;
12
- object-fit: cover;
13
+ width: 100%;
14
+ height: 100%;
15
+ object-fit: contain;
13
16
  }
14
17
 
15
18
  .pdfThumbnail {
@@ -25,8 +28,15 @@
25
28
  position: absolute;
26
29
  top: layout.$spacing-02;
27
30
  right: layout.$spacing-02;
28
- background-color: transparent;
29
- border: none;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ width: 1.75rem;
35
+ height: 1.75rem;
36
+ min-width: 0;
37
+ border: 1px solid colors.$gray-50;
38
+ border-radius: 50%;
39
+ background-color: colors.$white;
30
40
  padding: 0;
31
41
  cursor: pointer;
32
42
  padding-block-start: 0;
@@ -34,9 +44,9 @@
34
44
  }
35
45
 
36
46
  .removeButton:hover {
37
- background-color: transparent;
47
+ background-color: colors.$gray-20;
38
48
  }
39
49
 
40
50
  .closeIcon {
41
- fill: white !important;
51
+ fill: colors.$gray-30 !important;
42
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-form-engine-lib",
3
- "version": "4.2.2-pre.2622",
3
+ "version": "4.2.2-pre.2626",
4
4
  "description": "React Form Engine for O3",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import styles from './file-thumbnail.scss';
3
- import { CloseFilled, DocumentPdf, DocumentUnknown } from '@carbon/react/icons';
3
+ import { Close, DocumentPdf, DocumentUnknown } from '@carbon/react/icons';
4
4
  import { Button } from '@carbon/react';
5
5
 
6
6
  interface FileThumbnailProps {
@@ -28,7 +28,7 @@ export function FileThumbnail({ bytesContentFamily, removeFileCb, ...thumbnailPr
28
28
  <div className={styles.thumbnail}>
29
29
  <Thumbnail {...thumbnailProps} />
30
30
  <Button kind="ghost" className={styles.removeButton} onClick={removeFileCb}>
31
- <CloseFilled size={16} className={styles.closeIcon} />
31
+ <Close size={16} className={styles.closeIcon} />
32
32
  </Button>
33
33
  </div>
34
34
  );
@@ -1,15 +1,18 @@
1
+ @use '@carbon/colors';
1
2
  @use '@carbon/layout';
2
3
  @use '@openmrs/esm-styleguide/src/vars' as vars;
3
4
 
4
5
  .thumbnail {
6
+ position: relative;
5
7
  height: 7rem;
6
8
  width: 7rem;
9
+ background-color: colors.$white;
7
10
  }
8
11
 
9
12
  .imageThumbnail {
10
- max-width: 100%;
11
- max-height: 100%;
12
- object-fit: cover;
13
+ width: 100%;
14
+ height: 100%;
15
+ object-fit: contain;
13
16
  }
14
17
 
15
18
  .pdfThumbnail {
@@ -25,8 +28,15 @@
25
28
  position: absolute;
26
29
  top: layout.$spacing-02;
27
30
  right: layout.$spacing-02;
28
- background-color: transparent;
29
- border: none;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
+ width: 1.75rem;
35
+ height: 1.75rem;
36
+ min-width: 0;
37
+ border: 1px solid colors.$gray-50;
38
+ border-radius: 50%;
39
+ background-color: colors.$white;
30
40
  padding: 0;
31
41
  cursor: pointer;
32
42
  padding-block-start: 0;
@@ -34,9 +44,9 @@
34
44
  }
35
45
 
36
46
  .removeButton:hover {
37
- background-color: transparent;
47
+ background-color: colors.$gray-20;
38
48
  }
39
49
 
40
50
  .closeIcon {
41
- fill: white !important;
51
+ fill: colors.$gray-30 !important;
42
52
  }