imbric-theme 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,7 @@
7
7
  font-size: var(--font-size-mini);
8
8
  font-weight: var(--font-weight-light);
9
9
  line-height: var(--line-height-tight);
10
+ align-items: center;
10
11
  }
11
12
 
12
13
  .is-hint {
@@ -8,9 +8,9 @@ import Icon from '../Icon'
8
8
  import Container from '../../layout/Container'
9
9
  import isEmpty from '../../utils/isEmpty'
10
10
 
11
-
12
11
  import useMedia from '../../hook/useMedia'
13
12
  import Heading from '../Heading'
13
+ import { Horizontal } from '../../layout/Spacer/components/Horizontal'
14
14
 
15
15
  // Sync with ./Modal.module.css#L13-L17
16
16
  const FADE_OUT_ANIMATION_TIME = 400
@@ -28,9 +28,21 @@ const handleSecondaryAction = ({ onSecondaryAction }) => () => {
28
28
  onSecondaryAction()
29
29
  }
30
30
 
31
+ const handleArrowsActionLeft = ({ onArrowsActionLeft }) => () => {
32
+ onArrowsActionLeft()
33
+ }
34
+
35
+ const handleArrowsActionRight = ({ onArrowsActionRight }) => () => {
36
+ onArrowsActionRight()
37
+ }
38
+
31
39
  export const Modal = ({
32
40
  onClose,
33
41
  secondaryAction,
42
+ viewSecondaryAction,
43
+ arrowsActionLeft,
44
+ arrowsActionRight,
45
+ viewArrowsAction,
34
46
  children,
35
47
  getStyles,
36
48
  type,
@@ -69,17 +81,58 @@ export const Modal = ({
69
81
  size={isDesktop ? 'lg' : 'md'}
70
82
  />
71
83
  )}
72
- {secondaryAction && !isEmpty(secondaryAction) && (
73
- <Icon
74
- color="inverted"
75
- name={secondaryAction?.icon}
76
- background="muted"
77
- onClick={handleSecondaryAction({
78
- onSecondaryAction: secondaryAction?.handler,
79
- })}
80
- />
84
+ {viewSecondaryAction && secondaryAction && !isEmpty(secondaryAction) && (
85
+ <>
86
+ <Icon
87
+ color={isDesktop && type === 'secondary' ? 'primary' : 'primary'}
88
+ name={secondaryAction?.icon}
89
+ background={isDesktop ? 'transparent' : 'muted'}
90
+ onClick={handleSecondaryAction({
91
+ onSecondaryAction: secondaryAction?.handler,
92
+ })}
93
+ size={isDesktop ? 'lg' : 'md'}
94
+ />
95
+
96
+ <Horizontal size="xs" />
97
+
98
+ </>
99
+
100
+ )}
101
+
102
+
103
+
104
+ {viewArrowsAction && arrowsActionLeft && arrowsActionRight && !isEmpty(arrowsActionLeft) && !isEmpty(arrowsActionRight) && (
105
+ <>
106
+
107
+ {arrowsActionRight.view ? <Icon
108
+ color={isDesktop && type === 'secondary' ? 'primary' : 'primary'}
109
+ name={arrowsActionRight?.icon}
110
+ background={isDesktop ? 'transparent' : 'muted'}
111
+ onClick={handleArrowsActionRight({
112
+ onArrowsActionRight: arrowsActionRight?.handler,
113
+ })}
114
+ size={isDesktop ? 'lg' : 'md'}
115
+ /> : null}
116
+
117
+ {arrowsActionLeft.view ? <Icon
118
+ color={isDesktop && type === 'secondary' ? 'primary' : 'primary'}
119
+ name={arrowsActionLeft?.icon}
120
+ background={isDesktop ? 'transparent' : 'muted'}
121
+ onClick={handleArrowsActionLeft({
122
+ onArrowsActionLeft: arrowsActionLeft?.handler,
123
+ })}
124
+ size={isDesktop ? 'lg' : 'md'}
125
+ /> : null}
126
+
127
+ <Horizontal size="xs" />
128
+
129
+ </>
130
+
81
131
  )}
82
132
 
133
+
134
+
135
+
83
136
  {isClickTitle ?
84
137
 
85
138
  <span style={{ cursor: 'pointer', textDecoration: 'underline', color: 'var(--color-primary)' }} onClick={onClickTitle}>
@@ -127,6 +180,8 @@ Modal.propTypes = {
127
180
  isFullWidthSoft: PropTypes.bool,
128
181
  titleModal: PropTypes.string,
129
182
  isClickTitle: PropTypes.bool,
183
+ viewSecondaryAction: PropTypes.bool,
184
+ viewArrowsAction: PropTypes.bool,
130
185
  }
131
186
 
132
187
  Modal.defaultProps = {
@@ -135,7 +190,9 @@ Modal.defaultProps = {
135
190
  titleModal: 'Ejemplo titulo',
136
191
  isFullWidth: false,
137
192
  isFullWidthSoft: false,
138
- isClickTitle: false
193
+ isClickTitle: false,
194
+ viewSecondaryAction: false,
195
+ viewArrowsAction: false
139
196
  }
140
197
 
141
198
  export default withStyles(styles)(Modal)
@@ -42,6 +42,10 @@
42
42
  font-size: var(--paragraph-font-size-lg);
43
43
  }
44
44
 
45
+ .size-xl {
46
+ font-size: var(--paragraph-font-size-xl);
47
+ }
48
+
45
49
  .weight-normal {
46
50
  font-weight: var(--font-weight-normal);
47
51
  }
@@ -69,4 +73,4 @@
69
73
 
70
74
  .is-centered {
71
75
  text-align: center;
72
- }
76
+ }
@@ -1,5 +1,5 @@
1
1
  export const options = {
2
2
  colors: ['base', 'muted', 'inverted', 'primary', 'tertiary'],
3
- sizes: ['xs', 'sm', 'md', 'lg'],
3
+ sizes: ['xs', 'sm', 'md', 'lg', 'xl'],
4
4
  weights: ['normal', 'medium', 'semibold'],
5
5
  }
@@ -20,6 +20,7 @@ export const Textarea = ({
20
20
  viewBoxCopyCode,
21
21
  txtBtnCopyCode,
22
22
  txtTootipCopyCode,
23
+ maxlength,
23
24
  }) => {
24
25
 
25
26
 
@@ -103,6 +104,7 @@ export const Textarea = ({
103
104
  onChange={onChange}
104
105
  value={value}
105
106
  disabled={disabled}
107
+ maxlength={maxlength}
106
108
  >
107
109
  {children}
108
110
  </textarea>
@@ -121,6 +123,7 @@ Textarea.propTypes = {
121
123
  viewBoxCopyCode: PropTypes.bool,
122
124
  txtBtnCopyCode: PropTypes.string,
123
125
  txtTootipCopyCode: PropTypes.string,
126
+ maxlength: PropTypes.string,
124
127
  }
125
128
 
126
129
  Textarea.defaultProps = {
@@ -131,7 +134,8 @@ Textarea.defaultProps = {
131
134
  disabled: false,
132
135
  viewBoxCopyCode: false,
133
136
  txtBtnCopyCode: 'COPIAR',
134
- txtTootipCopyCode: 'yeeeee'
137
+ txtTootipCopyCode: 'yeeeee',
138
+ maxlength: '',
135
139
  }
136
140
 
137
141
  export default withStyles(styles)(Textarea)
@@ -1,28 +1,21 @@
1
1
  import { useEffect, useState } from 'react'
2
- import {
3
- addDays,
4
- startOfMonth,
5
- endOfDay,
6
- } from "date-fns";
2
+ import { addDays, startOfMonth, endOfDay } from 'date-fns'
7
3
 
8
4
  const useStateDate = (rangeDefault) => {
9
-
10
5
  const [state, setState] = useState([
11
6
  {
12
- startDate: rangeDefault === 'quarter' ? addDays(new Date(), -59) : startOfMonth(new Date()),
7
+ startDate:
8
+ rangeDefault === 'quarter'
9
+ ? addDays(new Date(), -79)
10
+ : startOfMonth(new Date()),
13
11
  endDate: endOfDay(new Date()),
14
12
  key: 'selection',
15
- }
13
+ },
16
14
  ])
17
15
 
18
16
  // startDate: startOfMonth(new Date()),
19
17
  // endDate: endOfDay(new Date())
20
-
21
-
22
- useEffect(() => {
23
-
24
- }, [state]);
25
-
18
+ useEffect(() => { }, [state])
26
19
 
27
20
  return { state, setState }
28
21
  }
@@ -35,16 +35,20 @@ export const DynamicTable = ({
35
35
  isViewLeftBtn,
36
36
  isViewLeftBtnSecondary,
37
37
  isViewLeftBtnTertiary,
38
+ isViewLeftBtnExtra,
38
39
  isViewDownloadDoc,
39
40
  typeBtn,
40
41
  typeBtnSecondary,
41
42
  typeBtnTertiary,
43
+ typeBtnExtra,
42
44
  titleBtn,
43
45
  titleBtnSecondary,
44
46
  titleBtnTertiary,
47
+ titleBtnExtra,
45
48
  handleBtn,
46
49
  handleBtnSecondary,
47
50
  handleBtnTertiary,
51
+ handleBtnExtra,
48
52
  handleAddColumn,
49
53
  handleFilterTable,
50
54
  handleFilterSecondaryTable,
@@ -233,18 +237,18 @@ export const DynamicTable = ({
233
237
  ) : null}
234
238
 
235
239
 
236
- {isViewLeftBtnTertiary ? (
240
+ {isViewLeftBtnExtra ? (
237
241
 
238
242
  <>
239
243
 
240
244
  <div className={getStyles('opFunctionBox3')}>
241
245
 
242
246
  <Button
243
- type={typeBtnTertiary}
247
+ type={typeBtnExtra}
244
248
  isInline={true}
245
- onClick={handleBtnTertiary}
249
+ onClick={handleBtnExtra}
246
250
  >
247
- {titleBtnTertiary}
251
+ {titleBtnExtra}
248
252
  </Button>
249
253
 
250
254
  </div>
@@ -495,12 +499,16 @@ DynamicTable.propTypes = {
495
499
  handleBtn: PropTypes.func,
496
500
  isViewLeftBtnSecondary: PropTypes.bool,
497
501
  isViewLeftBtnTertiary: PropTypes.bool,
502
+ isViewLeftBtnExtra: PropTypes.bool,
498
503
  typeBtnSecondary: PropTypes.string,
499
504
  typeBtnTertiary: PropTypes.string,
505
+ typeBtnExtra: PropTypes.string,
500
506
  titleBtnSecondary: PropTypes.string,
501
507
  titleBtnTertiary: PropTypes.string,
508
+ titleBtnExtra: PropTypes.string,
502
509
  handleBtnSecondary: PropTypes.func,
503
510
  handleBtnTertiary: PropTypes.func,
511
+ handleBtnExtra: PropTypes.func,
504
512
  txtTootipFileDownload: PropTypes.string,
505
513
  titleHeadingTable: PropTypes.string,
506
514
  titleHeadingTableSecundary: PropTypes.string,
@@ -542,12 +550,16 @@ DynamicTable.defaultProps = {
542
550
  handleBtn: () => { },
543
551
  isViewLeftBtnSecondary: false,
544
552
  isViewLeftBtnTertiary: false,
553
+ isViewLeftBtnExtra: false,
545
554
  typeBtnSecondary: 'primary',
546
555
  typeBtnTertiary: 'primary',
556
+ typeBtnExtra: 'primary',
547
557
  titleBtnSecondary: '',
548
558
  titleBtnTertiary: '',
559
+ titleBtnExtra: '',
549
560
  handleBtnSecondary: () => { },
550
561
  handleBtnTertiary: () => { },
562
+ handleBtnExtra: () => { },
551
563
  txtTootipFileDownload: '',
552
564
  titleHeadingTable: 'Total: 200',
553
565
  titleHeadingTableSecundary: '',
@@ -1171,7 +1171,7 @@ export const RowTable = ({
1171
1171
  ?
1172
1172
  <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{(item[itemTd.accessor] / 1000).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1173
1173
  :
1174
- <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor].toFixed(2).toString().replace(/\./g, ',')} {itemTd.characterExtra}</td>
1174
+ <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]?.toFixed(2)?.toString()?.replace(/\./g, ',')} { item[itemTd.accessor] ? itemTd.characterExtra : ''}</td>
1175
1175
  :
1176
1176
  <td style={{ color: item.colorTxtRow }} className={getStyles('td')} key={[itemTd.accessor] + (indexTd + index)}>{item[itemTd.accessor]}</td>
1177
1177
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imbric-theme",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Components library IMBRIC",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -370,6 +370,7 @@
370
370
  --paragraph-font-size-sm: 1.2rem;
371
371
  --paragraph-font-size-md: 1.4rem;
372
372
  --paragraph-font-size-lg: 1.6rem;
373
+ --paragraph-font-size-xl: 2rem;
373
374
 
374
375
  --textarea-border-radius: 10px;
375
376
 
@@ -370,6 +370,7 @@
370
370
  --paragraph-font-size-sm: 1.2rem;
371
371
  --paragraph-font-size-md: 1.4rem;
372
372
  --paragraph-font-size-lg: 1.6rem;
373
+ --paragraph-font-size-xl: 2rem;
373
374
 
374
375
  --textarea-border-radius: 10px;
375
376
 
@@ -370,6 +370,7 @@
370
370
  --paragraph-font-size-sm: 1.2rem;
371
371
  --paragraph-font-size-md: 1.4rem;
372
372
  --paragraph-font-size-lg: 1.6rem;
373
+ --paragraph-font-size-xl: 2rem;
373
374
 
374
375
  --textarea-border-radius: 10px;
375
376
 
@@ -370,6 +370,7 @@
370
370
  --paragraph-font-size-sm: 1.2rem;
371
371
  --paragraph-font-size-md: 1.4rem;
372
372
  --paragraph-font-size-lg: 1.6rem;
373
+ --paragraph-font-size-xl: 2rem;
373
374
 
374
375
  --textarea-border-radius: 10px;
375
376
 
package/styles/tagos.css CHANGED
@@ -370,6 +370,8 @@
370
370
  --paragraph-font-size-sm: 1.2rem;
371
371
  --paragraph-font-size-md: 1.4rem;
372
372
  --paragraph-font-size-lg: 1.6rem;
373
+ --paragraph-font-size-xl: 2rem;
374
+ --paragraph-font-size-xl: 2rem;
373
375
 
374
376
  --textarea-border-radius: 10px;
375
377
 
@@ -370,6 +370,7 @@
370
370
  --paragraph-font-size-sm: 1.2rem;
371
371
  --paragraph-font-size-md: 1.4rem;
372
372
  --paragraph-font-size-lg: 1.6rem;
373
+ --paragraph-font-size-xl: 2rem;
373
374
 
374
375
  --textarea-border-radius: 10px;
375
376