@platformatic/ui-components 0.8.7 → 0.8.8
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
package/src/components/Modal.jsx
CHANGED
|
@@ -42,13 +42,15 @@ function Modal ({
|
|
|
42
42
|
childrenClassContainer = '',
|
|
43
43
|
modalCloseClassName = '',
|
|
44
44
|
permanent = false,
|
|
45
|
-
showCloseButtonOnTop = true
|
|
45
|
+
showCloseButtonOnTop = true,
|
|
46
|
+
additionalModalClassName = ''
|
|
46
47
|
}) {
|
|
47
48
|
let contentFullscreen
|
|
48
49
|
let titleFullscreen
|
|
49
|
-
let modalClassName = `${styles.modal}`
|
|
50
|
+
let modalClassName = `${styles.modal} `
|
|
50
51
|
modalClassName += ' ' + styles[`modal--${layout}`]
|
|
51
52
|
modalClassName += ' ' + styles[`modal--${size}`]
|
|
53
|
+
modalClassName += ` ${additionalModalClassName || styles.modalDefaultFlex}`
|
|
52
54
|
let buttonFullRoundedClassName
|
|
53
55
|
const blurRef = useRef()
|
|
54
56
|
|
|
@@ -309,7 +311,11 @@ Modal.propTypes = {
|
|
|
309
311
|
/**
|
|
310
312
|
* showCloseButtonOnTop: show button on X
|
|
311
313
|
*/
|
|
312
|
-
showCloseButtonOnTop: PropTypes.bool
|
|
314
|
+
showCloseButtonOnTop: PropTypes.bool,
|
|
315
|
+
/**
|
|
316
|
+
* additionalModalClassName: show button on X
|
|
317
|
+
*/
|
|
318
|
+
additionalModalClassName: PropTypes.string
|
|
313
319
|
}
|
|
314
320
|
|
|
315
321
|
export default Modal
|
|
@@ -25,8 +25,12 @@
|
|
|
25
25
|
.modal {
|
|
26
26
|
@apply p-4 rounded-md mx-auto my-auto max-h-[85vh] overflow-y-auto;
|
|
27
27
|
}
|
|
28
|
+
.modalDefaultFlex {
|
|
29
|
+
@apply flex flex-col gap-y-2;
|
|
30
|
+
}
|
|
28
31
|
.modal--popup-v2 {
|
|
29
|
-
@apply bg-rich-black border border-solid
|
|
32
|
+
@apply bg-rich-black border border-solid;
|
|
33
|
+
border-color: rgba(255, 255, 255, .3);
|
|
30
34
|
}
|
|
31
35
|
.modal--popup {
|
|
32
36
|
@apply bg-light-blue;
|
|
@@ -5,7 +5,7 @@ import styles from './InputFileUpload.module.css'
|
|
|
5
5
|
import commonStyles from '../Common.module.css'
|
|
6
6
|
import PlatformaticIcon from '../PlatformaticIcon'
|
|
7
7
|
import Button from '../Button'
|
|
8
|
-
import { ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, RICH_BLACK, TRANSPARENT, WHITE } from '../constants'
|
|
8
|
+
import { ACTIVE_AND_INACTIVE_STATUS, ERROR_RED, MAIN_DARK_BLUE, MAIN_GREEN, RICH_BLACK, TRANSPARENT, WHITE } from '../constants'
|
|
9
9
|
|
|
10
10
|
function InputFileUpload ({
|
|
11
11
|
idInputFile = 'fileUpload',
|
|
@@ -19,12 +19,13 @@ function InputFileUpload ({
|
|
|
19
19
|
afterIcon = null,
|
|
20
20
|
backgroundColor = WHITE,
|
|
21
21
|
inputTextClassName = '',
|
|
22
|
-
detailTextClassName = '',
|
|
23
22
|
verticalPaddingClassName = '',
|
|
24
23
|
dataAttrName = '',
|
|
25
24
|
dataAttrValue = '',
|
|
26
25
|
readOnly = false,
|
|
27
26
|
removeFileButton = {},
|
|
27
|
+
showDetailButton = true,
|
|
28
|
+
detailFileButton = {},
|
|
28
29
|
onClickDetail = () => {},
|
|
29
30
|
acceptFiles = '*'
|
|
30
31
|
}) {
|
|
@@ -108,7 +109,20 @@ function InputFileUpload ({
|
|
|
108
109
|
>
|
|
109
110
|
{file !== null ? file.name : <span className={styles.inputPlaceholderClassName}>{inputPlaceholder}</span>}
|
|
110
111
|
</label>
|
|
111
|
-
{file !== null &&
|
|
112
|
+
{file !== null && showDetailButton && (
|
|
113
|
+
<div className={styles.afterInputDetail}>
|
|
114
|
+
<Button
|
|
115
|
+
textClass={detailFileButton?.textClass ?? ''}
|
|
116
|
+
paddingClass={detailFileButton?.paddingClass ?? ''}
|
|
117
|
+
label={detailFileButton?.label ?? 'Details'}
|
|
118
|
+
color={detailFileButton?.color ?? WHITE}
|
|
119
|
+
type='button'
|
|
120
|
+
onClick={() => onClickDetail()}
|
|
121
|
+
bordered={false}
|
|
122
|
+
hoverEffect={ACTIVE_AND_INACTIVE_STATUS}
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
)}
|
|
112
126
|
</div>
|
|
113
127
|
{file !== null && (
|
|
114
128
|
<Button
|
|
@@ -211,6 +225,14 @@ InputFileUpload.propTypes = {
|
|
|
211
225
|
* removeFileButton
|
|
212
226
|
*/
|
|
213
227
|
removeFileButton: PropTypes.object,
|
|
228
|
+
/**
|
|
229
|
+
* showDetailButton
|
|
230
|
+
*/
|
|
231
|
+
showDetailButton: PropTypes.bool,
|
|
232
|
+
/**
|
|
233
|
+
* detailFileButton
|
|
234
|
+
*/
|
|
235
|
+
detailFileButton: PropTypes.object,
|
|
214
236
|
/**
|
|
215
237
|
* onClickDetail
|
|
216
238
|
*/
|