diginet-core-ui 1.3.53-beta.1 → 1.3.53-beta.4

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.
@@ -9,26 +9,26 @@ import { color as colors } from '../../styles/colors';
9
9
  import ButtonIcon from '../button/icon';
10
10
  import Icon from '../../icons';
11
11
  import { hexToRGBA } from '../../styles/color-helper';
12
- import { typography } from '../../styles/typography';
13
- import { useTheme } from '../../theme';
14
12
  import { alignCenter, border, borderBox, borderRadius4px, breakWord, displayBlock, flexRow, justifyStart, positionRelative, userSelectNone } from '../../styles/general';
13
+ import theme from '../../theme/settings';
15
14
  const {
16
- heading3,
17
- heading4,
18
- heading5,
19
- paragraph1,
20
- paragraph2,
21
- paragraph3
22
- } = typography;
23
- const {
24
- system: {
25
- rest,
26
- white
27
- }
28
- } = colors;
29
- const {
30
- zIndex
31
- } = useTheme();
15
+ colors: {
16
+ system: {
17
+ rest,
18
+ white
19
+ }
20
+ },
21
+ typography: {
22
+ heading3,
23
+ heading4,
24
+ heading5,
25
+ paragraph1,
26
+ paragraph2,
27
+ paragraph3
28
+ },
29
+ spacing,
30
+ zIndex: zIndexCORE
31
+ } = theme;
32
32
  const iconMap = new Map([['info', 'Info'], ['success', 'ApprovalFilled'], ['warning', 'Warning'], ['danger', 'CancelFilled']]);
33
33
  const maxWidthMap = new Map([['tiny', 320], ['small', 400], ['medium', 480]]);
34
34
  const primaryTypoMap = new Map([['tiny', heading5], ['small', heading4], ['medium', heading3]]);
@@ -177,7 +177,7 @@ const AlertContainerCSS = (size, progressing, duration) => css`
177
177
  transition: opacity ${progressing ? duration / 2 + 1 : duration * 1}s ease ${progressing ? duration / 2 : 0}s;
178
178
  margin-bottom: 1rem;
179
179
  pointer-events: auto;
180
- z-index: ${zIndex(1)};
180
+ z-index: ${zIndexCORE(1)};
181
181
  `;
182
182
 
183
183
  const AlertInfoCSS = (mainColor, opacityColor) => css`
@@ -192,20 +192,21 @@ const AlertInfoCSS = (mainColor, opacityColor) => css`
192
192
  background-color: ${white};
193
193
  width: 100%;
194
194
  min-width: 320px;
195
- padding: 0 4px 0 16px;
195
+ padding: ${spacing([0, 1, 0, 4])};
196
196
  opacity: 1;
197
197
  `;
198
198
 
199
199
  const AlertIconCSS = css`
200
200
  display: inherit;
201
201
  margin-right: 10px;
202
- padding: 8px 0;
202
+ padding: ${spacing([2, 0])};
203
203
  `;
204
204
 
205
205
  const AlertTextCSS = clearAble => css`
206
206
  ${displayBlock};
207
207
  margin-right: ${clearAble ? '10px' : 0};
208
- padding: 8px 0;
208
+ padding: ${spacing([2, 0])};
209
+ align-self: center;
209
210
  `;
210
211
 
211
212
  const AlertPrimaryCSS = (secondary, size) => css`
@@ -214,13 +215,13 @@ const AlertPrimaryCSS = (secondary, size) => css`
214
215
  ${alignCenter};
215
216
  ${justifyStart};
216
217
  ${userSelectNone};
217
- ${secondary ? primaryTypoMap.get(size) : paragraph1}
218
+ ${secondary ? primaryTypoMap.get(size) : paragraph1};
218
219
  `;
219
220
 
220
221
  const AlertSecondaryCSS = size => css`
221
222
  ${displayBlock};
222
223
  ${userSelectNone};
223
- ${size === 'tiny' ? paragraph3 : paragraph2}
224
+ ${size === 'tiny' ? paragraph3 : paragraph2};
224
225
  `;
225
226
 
226
227
  const AlertClearIconCSS = css`
@@ -3,14 +3,14 @@ import ReactDOM from 'react-dom';
3
3
  import PropTypes from 'prop-types';
4
4
  import Alert from './';
5
5
  import { randomString } from '../../utils';
6
- import { useTheme } from '../../theme';
6
+ import theme from '../../theme/settings';
7
7
  const {
8
- zIndex
9
- } = useTheme();
8
+ zIndex: zIndexCORE
9
+ } = theme;
10
10
  const positions = {
11
11
  general: {
12
12
  position: 'fixed',
13
- zIndex: zIndex(2),
13
+ zIndex: zIndexCORE(2),
14
14
  backgroundColor: 'transparent',
15
15
  pointerEvents: 'none'
16
16
  },
@@ -123,15 +123,17 @@ const AlertNotify = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
123
123
 
124
124
  ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
125
125
  onClose: e => onClose(e, position),
126
+ secondary: message,
126
127
  ...props,
127
128
  ...options
128
- }, message), document.querySelector(`div[class^="Notify-Alert-${position.vertical}-${position.horizontal}"]`).appendChild(el));
129
+ }), document.querySelector(`div[class^="Notify-Alert-${position.vertical}-${position.horizontal}"]`).appendChild(el));
129
130
  } else {
130
131
  ReactDOM.render( /*#__PURE__*/React.createElement(Alert, {
131
132
  onClose: onClose,
133
+ secondary: message,
132
134
  ...props,
133
135
  ...options
134
- }, message), document.querySelector(`div[class^="Notify-Alert-"]`).appendChild(el));
136
+ }), document.querySelector(`div[class^="Notify-Alert-"]`).appendChild(el));
135
137
  }
136
138
  };
137
139