@desynova-digital/components 9.1.40 → 9.1.42

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,250 +1,262 @@
1
- import React, { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
- import Button from '../button/index';
5
- import { Loader } from '../../components'
6
- import { colors } from '@desynova-digital/tokens';
7
- const SideBarOverlay = styled.div`
8
- position: fixed;
9
- width: 100%;
10
- height: 100%;
11
- top: 0;
12
- left: 0;
13
- background: rgba(0,0,0,0.5);
14
- z-index: 100;
15
- visibility: ${((props) => props.open ? 'visible' : 'hidden')};
16
- `;
17
-
18
- const SideBarBlock = styled.div`
19
- height: 100%;
20
- position: fixed;
21
- z-index: 101;
22
- top: 0;
23
- right: 0px;
24
- background-color: #121D29;
25
- box-shadow: 0px 2px 44px rgba(0, 0, 0, 0.5);
26
- overflow: hidden;
27
- width:0px;
28
-
29
- transition: width 250ms ease-in-out;
30
-
31
- .ball{
32
- background-color:#151717
33
- }
34
-
35
- .circle{
36
- border:4px solid #1d2020;
37
- height:10px;
38
- width:10px
39
- }
40
-
41
- div.loader-holder > div{
42
- height:20px;
43
- margin-left:5px;
44
- }
45
-
46
- .parentBox{
47
- width:18px;
48
- height:18px;
49
- }
50
-
51
- &.open{
52
- width:400px;
53
- .sidebar-header, .bodyContainer, .button-container {
54
- opacity: 1;
55
- }
56
- }
57
-
58
- .sidebar-header {
59
- transition: opacity 50ms ease-in-out 250ms;
60
- opacity:0;
61
- padding:20px;
62
- display: flex;
63
- justify-content: space-between;
64
- align-items: center;
65
- box-sizing: border-box;
66
-
67
- .header-title {
68
- font-family: SFUIText-Light;
69
- line-height: 14px;
70
- font-size: 16px;
71
- line-height: 14px;
72
- color: #FFFFFF;
73
- }
74
- ${Button.Element} {
75
- margin: 0;
76
- background: transparent;
77
- border-color: transparent;
78
- padding: 0;
79
- &:hover {
80
- background: transparent;
81
- border-color: transparent;
82
- }
83
- }
84
- }
85
-
86
- .bodyContainer {
87
- opacity:0;
88
- transition: opacity 50ms ease-in-out 250ms;
89
- color:white;
90
- font-family: SFUIText-Regular;
91
- overflow-y: scroll;
92
- overflow-x: hidden;
93
- height: calc(100% - 110px);
94
- padding:0px 20px 0px 20px;
95
- overflow-x: hidden;
96
- }
97
-
98
- .bodyContainer-without-footer {
99
- height: calc(100% - 70px) !important;
100
- }
101
-
102
- `;
103
-
104
- const ButtonContainer = styled.div`
105
- font-family: SFUIText-Regular;
106
- display: flex;
107
- justify-content:center;
108
- padding: 10px 0;
109
- background: #182738;
110
- box-shadow: 0px -12px 24px rgb(0 0 0 / 20%);
111
- width: 100%;
112
- bottom:0;
113
- position: absolute;
114
- opacity:0;
115
- transition: opacity 50ms ease-in-out 250ms;
116
-
117
- .btn{
118
- border-radius: 22px;
119
- color: #FFFFFF;
120
- font-size: 12px;
121
- line-height: 12px;
122
- text-align: center;
123
- min-width: 150px;
124
- text-transform: uppercase;
125
- padding: 10px 0;
126
- margin: 0 10px;
127
- max-width: 150px;
128
- cursor: pointer;
129
- display:flex;
130
- justify-content:center;
131
- align-items:center;
132
-
133
- :hover{
134
- color: ${props => colors[props.theme].sideBar.themeColor};
135
- }
136
- }
137
-
138
- .default{
139
- background: #303F51;
140
-
141
- :hover{
142
- color:${props => colors[props.theme].sideBar.lightthemeColor};
143
- }
144
- }
145
-
146
- .primary {
147
- color: rgb(12, 20, 29);
148
- background: ${props => colors[props.theme].sideBar.themeColor};
149
-
150
- :hover{
151
- color: rgb(12, 20, 29);
152
- transition: all 0.2s ease-in-out 0s;
153
- box-shadow: rgb(7 213 205 / 20%) 0px 12px 24px 0px;
154
- }
155
- }
156
- `;
157
-
158
- /**
159
- * @component
160
- * @name SideBar
161
- */
162
-
163
- export default class SideBar extends Component {
164
- constructor(props) {
165
- super(props);
166
- this.state = {
167
- show: false,
168
- renderFlag: false
169
- };
170
- }
171
- componentDidMount = () => {
172
- this.setState({
173
- renderFlag: true
174
- })
175
- }
176
-
177
- cancelClick() {
178
- const { onCancelClick } = this.props;
179
- onCancelClick();
180
- }
181
-
182
- buttonClick(field) {
183
- const { onButtonClick } = this.props;
184
- onButtonClick(field);
185
- this.setState({
186
- ...this.state
187
- })
188
- }
189
- render() {
190
- const { title, content, sideBarButtonObject, showSideBar, loadingBtn,theme } = this.props;
191
-
192
- return (
193
- <React.Fragment>
194
- <SideBarOverlay open={showSideBar} />
195
- <SideBarBlock theme={theme} className={showSideBar ? 'open' : 'close'}>
196
- <div className="sidebar-header">
197
- <p className="header-title">{title}</p>
198
- <Button
199
- theme={theme}
200
- appearance="cta"
201
- iconWidth={12}
202
- iconHeight={12}
203
- icon="cross"
204
- iconBackground={false}
205
- onClick={() => {
206
- this.buttonClick('cancel');
207
- }}
208
- />
209
- </div>
210
- <div className={`bodyContainer ${!sideBarButtonObject.length && 'bodyContainer-without-footer'}`}>
211
- {content}
212
- </div>
213
- {sideBarButtonObject && sideBarButtonObject.length ? <ButtonContainer theme={theme} className="button-container" >
214
- {
215
- sideBarButtonObject.map((object) => {
216
- return (
217
- <div
218
- key={object.field}
219
- className={`btn ${object.type || 'default'}`}
220
- onClick={() => { this.buttonClick(object.field) }}
221
- >
222
- {object.title}
223
- {object.isLoading ?
224
- <Loader theme={theme} loaderName='SpinningLoader' />
225
- : null}
226
- </div>
227
- )
228
- })
229
- }
230
- </ButtonContainer> : null
231
- }
232
- </SideBarBlock>
233
- </React.Fragment>
234
- );
235
- }
236
- }
237
-
238
- SideBar.propTypes = {
239
- theme: PropTypes.oneOf(['light', 'dark', 'nexc']),
240
- showSideBar: PropTypes.bool,
241
- title: PropTypes.string,
242
- content: PropTypes.object,
243
- sideBarButtonObject: PropTypes.object,
244
- onCancelClick: PropTypes.func,
245
- onButtonClick: PropTypes.func
246
- }
247
-
248
- SideBar.defaultProps = {
249
- theme: 'dark'
250
- };
1
+ import React, { Component } from "react";
2
+ import PropTypes from "prop-types";
3
+ import styled from "styled-components";
4
+ import Button from "../button/index";
5
+ import { Loader } from "../../components";
6
+ import { colors } from "@desynova-digital/tokens";
7
+ const SideBarOverlay = styled.div`
8
+ position: fixed;
9
+ width: 100%;
10
+ height: 100%;
11
+ top: 0;
12
+ left: 0;
13
+ background: rgba(0, 0, 0, 0.5);
14
+ z-index: 100;
15
+ visibility: ${(props) => (props.open ? "visible" : "hidden")};
16
+ `;
17
+
18
+ const SideBarBlock = styled.div`
19
+ height: 100%;
20
+ position: fixed;
21
+ z-index: 101;
22
+ top: 0;
23
+ right: 0px;
24
+ background-color: #121d29;
25
+ box-shadow: 0px 2px 44px rgba(0, 0, 0, 0.5);
26
+ overflow: hidden;
27
+ width: 0px;
28
+
29
+ transition: width 250ms ease-in-out;
30
+
31
+ .ball {
32
+ background-color: #151717;
33
+ }
34
+
35
+ .circle {
36
+ border: 4px solid #1d2020;
37
+ height: 10px;
38
+ width: 10px;
39
+ }
40
+
41
+ div.loader-holder > div {
42
+ height: 20px;
43
+ margin-left: 5px;
44
+ }
45
+
46
+ .parentBox {
47
+ width: 18px;
48
+ height: 18px;
49
+ }
50
+
51
+ &.open {
52
+ width: 400px;
53
+ .sidebar-header,
54
+ .bodyContainer,
55
+ .button-container {
56
+ opacity: 1;
57
+ }
58
+ }
59
+
60
+ .sidebar-header {
61
+ transition: opacity 50ms ease-in-out 250ms;
62
+ opacity: 0;
63
+ padding: 20px;
64
+ display: flex;
65
+ justify-content: space-between;
66
+ align-items: center;
67
+ box-sizing: border-box;
68
+
69
+ .header-title {
70
+ font-family: SFUIText-Light;
71
+ line-height: 14px;
72
+ font-size: 16px;
73
+ line-height: 14px;
74
+ color: #ffffff;
75
+ }
76
+ ${Button.Element} {
77
+ margin: 0;
78
+ background: transparent;
79
+ border-color: transparent;
80
+ padding: 0;
81
+ &:hover {
82
+ background: transparent;
83
+ border-color: transparent;
84
+ }
85
+ }
86
+ }
87
+
88
+ .bodyContainer {
89
+ opacity: 0;
90
+ transition: opacity 50ms ease-in-out 250ms;
91
+ color: white;
92
+ font-family: SFUIText-Regular;
93
+ overflow-y: scroll;
94
+ overflow-x: hidden;
95
+ height: calc(100% - 110px);
96
+ padding: 0px 10px 0px 20px;
97
+ overflow-x: hidden;
98
+ }
99
+
100
+ .bodyContainer-without-footer {
101
+ height: calc(100% - 70px) !important;
102
+ }
103
+ `;
104
+
105
+ const ButtonContainer = styled.div`
106
+ font-family: SFUIText-Regular;
107
+ display: flex;
108
+ justify-content: center;
109
+ padding: 10px 0;
110
+ background: #182738;
111
+ box-shadow: 0px -12px 24px rgb(0 0 0 / 20%);
112
+ width: 100%;
113
+ bottom: 0;
114
+ position: absolute;
115
+ opacity: 0;
116
+ transition: opacity 50ms ease-in-out 250ms;
117
+
118
+ .btn {
119
+ border-radius: 22px;
120
+ color: #ffffff;
121
+ font-size: 12px;
122
+ line-height: 12px;
123
+ text-align: center;
124
+ min-width: 150px;
125
+ text-transform: uppercase;
126
+ padding: 10px 0;
127
+ margin: 0 10px;
128
+ max-width: 150px;
129
+ cursor: pointer;
130
+ display: flex;
131
+ justify-content: center;
132
+ align-items: center;
133
+
134
+ :hover {
135
+ color: ${(props) => colors[props.theme].sideBar.themeColor};
136
+ }
137
+ }
138
+
139
+ .default {
140
+ background: #303f51;
141
+
142
+ :hover {
143
+ color: ${(props) => colors[props.theme].sideBar.lightthemeColor};
144
+ }
145
+ }
146
+
147
+ .primary {
148
+ color: rgb(12, 20, 29);
149
+ background: ${(props) => colors[props.theme].sideBar.themeColor};
150
+
151
+ :hover {
152
+ color: rgb(12, 20, 29);
153
+ transition: all 0.2s ease-in-out 0s;
154
+ box-shadow: rgb(7 213 205 / 20%) 0px 12px 24px 0px;
155
+ }
156
+ }
157
+ `;
158
+
159
+ /**
160
+ * @component
161
+ * @name SideBar
162
+ */
163
+
164
+ export default class SideBar extends Component {
165
+ constructor(props) {
166
+ super(props);
167
+ this.state = {
168
+ show: false,
169
+ renderFlag: false,
170
+ };
171
+ }
172
+ componentDidMount = () => {
173
+ this.setState({
174
+ renderFlag: true,
175
+ });
176
+ };
177
+
178
+ cancelClick() {
179
+ const { onCancelClick } = this.props;
180
+ onCancelClick();
181
+ }
182
+
183
+ buttonClick(field) {
184
+ const { onButtonClick } = this.props;
185
+ onButtonClick(field);
186
+ this.setState({
187
+ ...this.state,
188
+ });
189
+ }
190
+ render() {
191
+ const {
192
+ title,
193
+ content,
194
+ sideBarButtonObject,
195
+ showSideBar,
196
+ loadingBtn,
197
+ theme,
198
+ } = this.props;
199
+
200
+ return (
201
+ <React.Fragment>
202
+ <SideBarOverlay open={showSideBar} />
203
+ <SideBarBlock theme={theme} className={showSideBar ? "open" : "close"}>
204
+ <div className="sidebar-header">
205
+ <p className="header-title">{title}</p>
206
+ <Button
207
+ theme={theme}
208
+ appearance="cta"
209
+ iconWidth={12}
210
+ iconHeight={12}
211
+ icon="cross"
212
+ iconBackground={false}
213
+ onClick={() => {
214
+ this.buttonClick("cancel");
215
+ }}
216
+ />
217
+ </div>
218
+ <div
219
+ className={`bodyContainer ${!sideBarButtonObject.length &&
220
+ "bodyContainer-without-footer"}`}
221
+ >
222
+ {content}
223
+ </div>
224
+ {sideBarButtonObject && sideBarButtonObject.length ? (
225
+ <ButtonContainer theme={theme} className="button-container">
226
+ {sideBarButtonObject.map((object) => {
227
+ return (
228
+ <div
229
+ key={object.field}
230
+ className={`btn ${object.type || "default"}`}
231
+ onClick={() => {
232
+ this.buttonClick(object.field);
233
+ }}
234
+ >
235
+ {object.title}
236
+ {object.isLoading ? (
237
+ <Loader theme={theme} loaderName="SpinningLoader" />
238
+ ) : null}
239
+ </div>
240
+ );
241
+ })}
242
+ </ButtonContainer>
243
+ ) : null}
244
+ </SideBarBlock>
245
+ </React.Fragment>
246
+ );
247
+ }
248
+ }
249
+
250
+ SideBar.propTypes = {
251
+ theme: PropTypes.oneOf(["light", "dark", "nexc"]),
252
+ showSideBar: PropTypes.bool,
253
+ title: PropTypes.string,
254
+ content: PropTypes.object,
255
+ sideBarButtonObject: PropTypes.object,
256
+ onCancelClick: PropTypes.func,
257
+ onButtonClick: PropTypes.func,
258
+ };
259
+
260
+ SideBar.defaultProps = {
261
+ theme: "dark",
262
+ };
@@ -153,13 +153,13 @@ var TimeCodeMainInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
153
153
  });
154
154
  var onChangeFn = function onChangeFn(e) {
155
155
  onTimePickerChange(e.target.value, e);
156
- /*
157
- * checkIfTimeValid(e.target.value);
158
- * if(checkIfTimeValid(e.target.value)) {
159
- * if (e.target.value.length) {
160
- * updateFormDataExternally(inputFieldType, e.target.value);
161
- * }
162
- * }
156
+ /*
157
+ * checkIfTimeValid(e.target.value);
158
+ * if(checkIfTimeValid(e.target.value)) {
159
+ * if (e.target.value.length) {
160
+ * updateFormDataExternally(inputFieldType, e.target.value);
161
+ * }
162
+ * }
163
163
  */
164
164
  };
165
165
  var onKeyDownFn = function onKeyDownFn(e) {
@@ -383,9 +383,9 @@ var defaultDimensions = {
383
383
  }
384
384
  },
385
385
  type4: {
386
- /*
387
- * //width:'280px',
388
- * //height:'auto',
386
+ /*
387
+ * //width:'280px',
388
+ * //height:'auto',
389
389
  */
390
390
 
391
391
  large: {