@qoretechnologies/reqore 0.27.6 → 0.28.0

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.
Files changed (111) hide show
  1. package/__tests__/tabs.test.tsx +1 -1
  2. package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
  3. package/dist/components/Breadcrumbs/index.js +4 -5
  4. package/dist/components/Breadcrumbs/index.js.map +1 -1
  5. package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
  6. package/dist/components/Breadcrumbs/item.js +1 -1
  7. package/dist/components/Breadcrumbs/item.js.map +1 -1
  8. package/dist/components/Button/index.d.ts +8 -2
  9. package/dist/components/Button/index.d.ts.map +1 -1
  10. package/dist/components/Button/index.js +41 -24
  11. package/dist/components/Button/index.js.map +1 -1
  12. package/dist/components/Checkbox/index.js +1 -1
  13. package/dist/components/Checkbox/index.js.map +1 -1
  14. package/dist/components/Header/index.d.ts +2 -1
  15. package/dist/components/Header/index.d.ts.map +1 -1
  16. package/dist/components/Header/index.js +5 -2
  17. package/dist/components/Header/index.js.map +1 -1
  18. package/dist/components/Icon/index.d.ts +2 -1
  19. package/dist/components/Icon/index.d.ts.map +1 -1
  20. package/dist/components/Icon/index.js +17 -6
  21. package/dist/components/Icon/index.js.map +1 -1
  22. package/dist/components/Input/index.js +1 -1
  23. package/dist/components/Input/index.js.map +1 -1
  24. package/dist/components/Menu/index.js +2 -2
  25. package/dist/components/Menu/index.js.map +1 -1
  26. package/dist/components/Message/index.d.ts +2 -3
  27. package/dist/components/Message/index.d.ts.map +1 -1
  28. package/dist/components/Message/index.js +8 -7
  29. package/dist/components/Message/index.js.map +1 -1
  30. package/dist/components/Notifications/notification.d.ts +3 -4
  31. package/dist/components/Notifications/notification.d.ts.map +1 -1
  32. package/dist/components/Notifications/notification.js +22 -19
  33. package/dist/components/Notifications/notification.js.map +1 -1
  34. package/dist/components/Panel/index.d.ts +3 -2
  35. package/dist/components/Panel/index.d.ts.map +1 -1
  36. package/dist/components/Panel/index.js +19 -11
  37. package/dist/components/Panel/index.js.map +1 -1
  38. package/dist/components/Table/row.js +1 -1
  39. package/dist/components/Table/row.js.map +1 -1
  40. package/dist/components/Tabs/index.d.ts +2 -6
  41. package/dist/components/Tabs/index.d.ts.map +1 -1
  42. package/dist/components/Tabs/index.js.map +1 -1
  43. package/dist/components/Tabs/item.d.ts.map +1 -1
  44. package/dist/components/Tabs/item.js +19 -10
  45. package/dist/components/Tabs/item.js.map +1 -1
  46. package/dist/components/Tabs/list.d.ts +8 -0
  47. package/dist/components/Tabs/list.d.ts.map +1 -1
  48. package/dist/components/Tabs/list.js +30 -12
  49. package/dist/components/Tabs/list.js.map +1 -1
  50. package/dist/components/Tag/group.d.ts +2 -1
  51. package/dist/components/Tag/group.d.ts.map +1 -1
  52. package/dist/components/Tag/group.js +8 -4
  53. package/dist/components/Tag/group.js.map +1 -1
  54. package/dist/components/Tag/index.d.ts.map +1 -1
  55. package/dist/components/Tag/index.js +3 -3
  56. package/dist/components/Tag/index.js.map +1 -1
  57. package/dist/constants/sizes.d.ts +22 -0
  58. package/dist/constants/sizes.d.ts.map +1 -1
  59. package/dist/constants/sizes.js +36 -14
  60. package/dist/constants/sizes.js.map +1 -1
  61. package/dist/containers/ReqoreProvider.d.ts +1 -1
  62. package/dist/containers/ReqoreProvider.d.ts.map +1 -1
  63. package/dist/containers/UIProvider.d.ts.map +1 -1
  64. package/dist/containers/UIProvider.js +1 -1
  65. package/dist/containers/UIProvider.js.map +1 -1
  66. package/dist/helpers/colors.d.ts.map +1 -1
  67. package/dist/helpers/colors.js +8 -4
  68. package/dist/helpers/colors.js.map +1 -1
  69. package/dist/helpers/utils.d.ts +1 -0
  70. package/dist/helpers/utils.d.ts.map +1 -1
  71. package/dist/helpers/utils.js +7 -2
  72. package/dist/helpers/utils.js.map +1 -1
  73. package/dist/styles.d.ts +2 -0
  74. package/dist/styles.d.ts.map +1 -1
  75. package/dist/styles.js +5 -3
  76. package/dist/styles.js.map +1 -1
  77. package/dist/types/global.d.ts +13 -0
  78. package/dist/types/global.d.ts.map +1 -1
  79. package/package.json +1 -1
  80. package/src/components/Breadcrumbs/index.tsx +6 -21
  81. package/src/components/Breadcrumbs/item.tsx +1 -7
  82. package/src/components/Button/index.tsx +88 -50
  83. package/src/components/Checkbox/index.tsx +1 -1
  84. package/src/components/Header/index.tsx +6 -3
  85. package/src/components/Icon/index.tsx +21 -8
  86. package/src/components/Input/index.tsx +1 -1
  87. package/src/components/Menu/index.tsx +6 -6
  88. package/src/components/Message/index.tsx +20 -13
  89. package/src/components/Notifications/notification.tsx +43 -39
  90. package/src/components/Panel/index.tsx +40 -8
  91. package/src/components/Table/row.tsx +1 -1
  92. package/src/components/Tabs/index.tsx +2 -6
  93. package/src/components/Tabs/item.tsx +33 -24
  94. package/src/components/Tabs/list.tsx +45 -15
  95. package/src/components/Tag/group.tsx +22 -5
  96. package/src/components/Tag/index.tsx +9 -11
  97. package/src/constants/sizes.ts +39 -13
  98. package/src/containers/ReqoreProvider.tsx +1 -1
  99. package/src/containers/UIProvider.tsx +3 -0
  100. package/src/helpers/colors.ts +8 -4
  101. package/src/helpers/utils.ts +7 -2
  102. package/src/mock/collectionData.tsx +4 -0
  103. package/src/stories/Button/Button.stories.tsx +43 -17
  104. package/src/stories/ControlGroup/ControlGroup.stories.tsx +2 -2
  105. package/src/stories/Message/Message.stories.tsx +6 -6
  106. package/src/stories/Notifications/Notification.stories.tsx +4 -3
  107. package/src/stories/Panel/Panel.stories.tsx +17 -1
  108. package/src/stories/Tabs/Tabs.stories.tsx +20 -13
  109. package/src/styles.ts +5 -2
  110. package/src/types/global.ts +14 -0
  111. package/tests.json +1 -1
@@ -1,6 +1,7 @@
1
- import React, { forwardRef, memo, useContext } from 'react';
1
+ import React, { forwardRef, memo, useCallback, useContext } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
  import {
4
+ ICON_FROM_SIZE,
4
5
  PADDING_FROM_SIZE,
5
6
  RADIUS_FROM_SIZE,
6
7
  SIZE_TO_PX,
@@ -26,6 +27,7 @@ import {
26
27
  IReqoreIntent,
27
28
  IReqoreReadOnly,
28
29
  IWithReqoreEffect,
30
+ IWithReqoreSize,
29
31
  TReqoreTooltipProp,
30
32
  } from '../../types/global';
31
33
  import { IReqoreIconName } from '../../types/icons';
@@ -33,6 +35,9 @@ import { ReqoreTextEffect, StyledEffect, StyledTextEffect } from '../Effect';
33
35
  import ReqoreIcon from '../Icon';
34
36
  import { ReqoreSpacer } from '../Spacer';
35
37
  import ReqoreTag, { IReqoreTagProps } from '../Tag';
38
+ import ReqoreTagGroup from '../Tag/group';
39
+
40
+ export type TReqoreBadge = string | number | IReqoreTagProps;
36
41
 
37
42
  export interface IReqoreButtonProps
38
43
  extends React.HTMLAttributes<HTMLButtonElement>,
@@ -51,7 +56,7 @@ export interface IReqoreButtonProps
51
56
  rightIcon?: IReqoreIconName;
52
57
  customTheme?: IReqoreCustomTheme;
53
58
  wrap?: boolean;
54
- badge?: string | number | IReqoreTagProps;
59
+ badge?: TReqoreBadge | TReqoreBadge[];
55
60
  description?: string | number;
56
61
  maxWidth?: string;
57
62
  textAlign?: 'left' | 'center' | 'right';
@@ -73,7 +78,6 @@ const getButtonMainColor = (theme: IReqoreTheme, color?: string) => {
73
78
  export const StyledAnimatedTextWrapper = styled.span`
74
79
  overflow: hidden;
75
80
  position: relative;
76
- padding: 4px 0;
77
81
  text-align: left;
78
82
  `;
79
83
 
@@ -85,13 +89,16 @@ export const StyledActiveContent = styled.span`
85
89
  filter: blur(10px);
86
90
 
87
91
  ${({ wrap }) =>
88
- !wrap &&
89
- css`
90
- overflow: hidden;
91
- text-overflow: ellipsis;
92
- white-space: nowrap;
93
- width: 100%;
94
- `}
92
+ !wrap
93
+ ? css`
94
+ overflow: hidden;
95
+ text-overflow: ellipsis;
96
+ white-space: nowrap;
97
+ width: 100%;
98
+ `
99
+ : css`
100
+ word-break: break-word;
101
+ `}
95
102
  `;
96
103
 
97
104
  export const StyledInActiveContent = styled.span`
@@ -100,13 +107,16 @@ export const StyledInActiveContent = styled.span`
100
107
  transition: all 0.2s ease-out;
101
108
 
102
109
  ${({ wrap }) =>
103
- !wrap &&
104
- css`
105
- overflow: hidden;
106
- text-overflow: ellipsis;
107
- white-space: nowrap;
108
- width: 100%;
109
- `}
110
+ !wrap
111
+ ? css`
112
+ overflow: hidden;
113
+ text-overflow: ellipsis;
114
+ white-space: nowrap;
115
+ width: 100%;
116
+ `
117
+ : css`
118
+ word-break: break-word;
119
+ `}
110
120
  `;
111
121
 
112
122
  export const StyledInvisibleContent = styled.span`
@@ -115,10 +125,13 @@ export const StyledInvisibleContent = styled.span`
115
125
  overflow: hidden;
116
126
 
117
127
  ${({ wrap }) =>
118
- !wrap &&
119
- css`
120
- white-space: nowrap;
121
- `}
128
+ !wrap
129
+ ? css`
130
+ white-space: nowrap;
131
+ `
132
+ : css`
133
+ word-break: break-word;
134
+ `}
122
135
  `;
123
136
 
124
137
  export const StyledButton = styled(StyledEffect)<IReqoreButtonStyle>`
@@ -139,7 +152,7 @@ export const StyledButton = styled(StyledEffect)<IReqoreButtonStyle>`
139
152
  min-width: ${({ size }) => SIZE_TO_PX[size]}px;
140
153
  max-width: ${({ maxWidth }) => maxWidth || undefined};
141
154
 
142
- flex: ${({ fluid, fixed }) => (fixed ? '0 auto' : fluid ? '1 auto' : '0 0 auto')};
155
+ flex: ${({ fluid, fixed }) => (fixed ? '0 0 auto' : fluid ? '1 auto' : '0 0 auto')};
143
156
 
144
157
  border-radius: ${({ size }) => RADIUS_FROM_SIZE[size]}px;
145
158
 
@@ -179,8 +192,8 @@ export const StyledButton = styled(StyledEffect)<IReqoreButtonStyle>`
179
192
  changeLightness(getButtonMainColor(theme, color), 0.05)};
180
193
  color: ${({ theme, color }) =>
181
194
  getReadableColor({ main: getButtonMainColor(theme, color) }, undefined, undefined)};
182
- border-color: ${({ minimal, theme, color }) =>
183
- minimal ? undefined : changeLightness(getButtonMainColor(theme, color), 0.1)};
195
+ border-color: ${({ flat, theme, color }) =>
196
+ flat ? undefined : changeLightness(getButtonMainColor(theme, color), 0.1)};
184
197
 
185
198
  ${animate &&
186
199
  css`
@@ -203,14 +216,12 @@ export const StyledButton = styled(StyledEffect)<IReqoreButtonStyle>`
203
216
  ${ReadOnlyElement};
204
217
  `}
205
218
 
206
- ${({ active, minimal, theme, color }: IReqoreButtonStyle) =>
219
+ ${({ active, flat, theme, color }: IReqoreButtonStyle) =>
207
220
  active &&
208
221
  css`
209
- background-color: ${changeLightness(getButtonMainColor(theme, color), 0.16)};
222
+ background-color: ${changeLightness(getButtonMainColor(theme, color), 0.1)};
210
223
  color: ${getReadableColor({ main: getButtonMainColor(theme, color) }, undefined, undefined)};
211
- border-color: ${minimal
212
- ? undefined
213
- : changeLightness(getButtonMainColor(theme, color), 0.075)};
224
+ border-color: ${flat ? undefined : changeLightness(getButtonMainColor(theme, color), 0.175)};
214
225
 
215
226
  ${ActiveIconScale}
216
227
  `}
@@ -239,8 +250,10 @@ export const StyledButtonContent = styled.div`
239
250
  align-items: center;
240
251
  width: 100%;
241
252
  height: 100%;
253
+ min-width: ${({ size }) => ICON_FROM_SIZE[size]}px;
242
254
  flex: 1;
243
255
  flex-shrink: 0;
256
+ padding: 4px 0;
244
257
  min-height: ${({ size, flat }) => (flat ? SIZE_TO_PX[size] : SIZE_TO_PX[size] - 2)}px;
245
258
  ${({ wrap, description }) =>
246
259
  !wrap && !description
@@ -250,6 +263,47 @@ export const StyledButtonContent = styled.div`
250
263
  : null}
251
264
  `;
252
265
 
266
+ export interface IReqoreButtonBadgeProps extends IWithReqoreSize {
267
+ color?: string;
268
+ content?: TReqoreBadge | TReqoreBadge[];
269
+ }
270
+
271
+ export const ButtonBadge = memo((props: IReqoreButtonBadgeProps) => {
272
+ const renderTag = useCallback(
273
+ ({ size, color, content, key }: IReqoreButtonBadgeProps & { key: number }) => (
274
+ <ReqoreTag
275
+ key={key}
276
+ size={getOneLessSize(size)}
277
+ badge
278
+ color={color ? `${color}70` : undefined}
279
+ {...(typeof content === 'string' || typeof content === 'number'
280
+ ? { label: content }
281
+ : content)}
282
+ />
283
+ ),
284
+ [props]
285
+ );
286
+
287
+ // If the content is a list
288
+ if (Array.isArray(props.content)) {
289
+ return (
290
+ <>
291
+ <ReqoreSpacer width={PADDING_FROM_SIZE[props.size]} />
292
+ <ReqoreTagGroup hasBottomMargin={false}>
293
+ {props.content.map((badge, index) => renderTag({ ...props, content: badge, key: index }))}
294
+ </ReqoreTagGroup>
295
+ </>
296
+ );
297
+ }
298
+
299
+ return (
300
+ <>
301
+ <ReqoreSpacer width={PADDING_FROM_SIZE[props.size]} />
302
+ {renderTag({ ...props, key: 0 })}
303
+ </>
304
+ );
305
+ });
306
+
253
307
  const ReqoreButton = memo(
254
308
  forwardRef<HTMLButtonElement, IReqoreButtonProps>(
255
309
  (
@@ -286,7 +340,7 @@ const ReqoreButton = memo(
286
340
  useTooltip(targetRef.current, tooltip);
287
341
 
288
342
  // If color or intent was specified, set the color
289
- const customColor = theme.main;
343
+ const customColor = intent ? theme.main : changeLightness(theme.main, 0.07);
290
344
  const _flat = minimal ? flat : flat !== false;
291
345
  const color = customColor
292
346
  ? minimal
@@ -294,18 +348,6 @@ const ReqoreButton = memo(
294
348
  : getReadableColorFrom(customColor, true)
295
349
  : getReadableColor(theme, undefined, undefined, true);
296
350
 
297
- const renderBadge = () => (
298
- <>
299
- <ReqoreSpacer width={PADDING_FROM_SIZE[size]} />
300
- <ReqoreTag
301
- size={getOneLessSize(size)}
302
- badge
303
- color={`${color}70`}
304
- {...(typeof badge === 'string' || typeof badge === 'number' ? { label: badge } : badge)}
305
- />
306
- </>
307
- );
308
-
309
351
  return (
310
352
  <StyledButton
311
353
  {...rest}
@@ -333,7 +375,7 @@ const ReqoreButton = memo(
333
375
  <StyledButtonContent size={size} wrap={wrap} description={description} flat={_flat}>
334
376
  {icon && (
335
377
  <>
336
- <ReqoreIcon icon={icon} size={`${TEXT_FROM_SIZE[size]}px`} />
378
+ <ReqoreIcon icon={icon} size={size} />
337
379
  {children || badge || rightIcon ? (
338
380
  <ReqoreSpacer width={PADDING_FROM_SIZE[size]} />
339
381
  ) : null}
@@ -344,18 +386,14 @@ const ReqoreButton = memo(
344
386
  <StyledActiveContent wrap={wrap}>{children}</StyledActiveContent>
345
387
  <StyledInActiveContent wrap={wrap}>{children}</StyledInActiveContent>
346
388
  <StyledInvisibleContent wrap={wrap}>{children}</StyledInvisibleContent>
347
- {badge && wrap ? renderBadge() : null}
389
+ {badge && wrap ? <ButtonBadge content={badge} size={size} color={color} /> : null}
348
390
  </StyledAnimatedTextWrapper>
349
391
  )}
350
- {badge && !wrap ? renderBadge() : null}
392
+ {badge && !wrap ? <ButtonBadge content={badge} size={size} color={color} /> : null}
351
393
  {rightIcon && (
352
394
  <>
353
395
  {children || badge ? <ReqoreSpacer width={PADDING_FROM_SIZE[size]} /> : null}
354
- <ReqoreIcon
355
- icon={rightIcon}
356
- size={`${TEXT_FROM_SIZE[size]}px`}
357
- style={{ marginLeft: 'auto' }}
358
- />
396
+ <ReqoreIcon icon={rightIcon} size={size} style={{ marginLeft: 'auto' }} />
359
397
  </>
360
398
  )}
361
399
  </StyledButtonContent>
@@ -151,7 +151,7 @@ const Checkbox = forwardRef<HTMLDivElement, IReqoreCheckboxProps>(
151
151
  <StyledSwitch size={size} labelPosition={labelPosition} checked={checked} />
152
152
  ) : (
153
153
  <ReqoreIcon
154
- size={`${TEXT_FROM_SIZE[size]}px`}
154
+ size={size}
155
155
  icon={checked ? checkedIcon : uncheckedIcon}
156
156
  margin={labelPosition}
157
157
  />
@@ -1,7 +1,9 @@
1
1
  import { memo, useMemo } from 'react';
2
2
  import styled from 'styled-components';
3
+ import { HEADER_SIZE_TO_NUMBER, TSizes } from '../../constants/sizes';
3
4
  import { IReqoreTheme, TReqoreIntent } from '../../constants/theme';
4
5
  import { getReadableColor } from '../../helpers/colors';
6
+ import { isStringSize } from '../../helpers/utils';
5
7
  import { useReqoreTheme } from '../../hooks/useTheme';
6
8
  import { IWithReqoreEffect } from '../../types/global';
7
9
  import { StyledTextEffect } from '../Effect';
@@ -10,7 +12,7 @@ export interface IReqoreHeadingProps
10
12
  extends IWithReqoreEffect,
11
13
  React.HTMLAttributes<HTMLHeadingElement> {
12
14
  intent?: TReqoreIntent;
13
- size?: 1 | 2 | 3 | 4 | 5 | 6;
15
+ size?: 1 | 2 | 3 | 4 | 5 | 6 | TSizes;
14
16
  customTheme?: Partial<IReqoreTheme>;
15
17
  }
16
18
 
@@ -28,9 +30,10 @@ export const StyledHeader = styled(StyledTextEffect)`
28
30
  export const ReqoreHeading = memo(
29
31
  ({ size, children, customTheme, intent, ...props }: IReqoreHeadingProps) => {
30
32
  const theme = useReqoreTheme('main', customTheme, intent);
33
+ const _size: number = isStringSize(size) ? HEADER_SIZE_TO_NUMBER[size] : size;
31
34
  const HTMLheaderElement = useMemo(() => {
32
- return `h${size}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
33
- }, [size]);
35
+ return `h${_size}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
36
+ }, [_size]);
34
37
 
35
38
  return (
36
39
  <StyledHeader as={HTMLheaderElement} theme={theme} intent={intent} {...props}>
@@ -4,13 +4,15 @@ import { IconBaseProps, IconType } from 'react-icons/lib';
4
4
  import * as RemixIcons from 'react-icons/ri';
5
5
  import styled, { css } from 'styled-components';
6
6
  import { ReqoreThemeContext } from '../..';
7
+ import { ICON_FROM_SIZE, PADDING_FROM_SIZE, TSizes } from '../../constants/sizes';
7
8
  import { TReqoreIntent } from '../../constants/theme';
9
+ import { isStringSize } from '../../helpers/utils';
8
10
  import { IReqoreIconName } from '../../types/icons';
9
11
 
10
12
  export interface IReqoreIconProps extends React.HTMLAttributes<HTMLSpanElement> {
11
13
  icon: IReqoreIconName;
12
14
  color?: string;
13
- size?: string;
15
+ size?: TSizes | string;
14
16
  iconProps?: IconBaseProps;
15
17
  intent?: TReqoreIntent;
16
18
  margin?: 'right' | 'left' | 'both';
@@ -22,18 +24,26 @@ export const StyledIconWrapper = styled.span<{ margin: 'right' | 'left' | 'both'
22
24
  vertical-align: text-bottom;
23
25
  transition: all 0.2s ease-out;
24
26
 
25
- ${({ margin }) =>
27
+ ${({ margin, size }) =>
26
28
  margin &&
27
29
  css`
28
- margin-left: ${(margin === 'left' || margin === 'both') && '10px'};
29
- margin-right: ${(margin === 'right' || margin === 'both') && '10px'};
30
+ margin-left: ${margin === 'left' || margin === 'both'
31
+ ? isStringSize(size)
32
+ ? `${PADDING_FROM_SIZE[size]}px`
33
+ : '10px'
34
+ : undefined};
35
+ margin-right: ${margin === 'right' || margin === 'both'
36
+ ? isStringSize(size)
37
+ ? `${PADDING_FROM_SIZE[size]}px`
38
+ : '10px'
39
+ : undefined};
30
40
  `}
31
41
  `;
32
42
 
33
43
  const ReqoreIcon = memo(
34
44
  ({
35
45
  icon,
36
- size = '17px',
46
+ size = 'normal',
37
47
  className,
38
48
  color,
39
49
  margin,
@@ -45,14 +55,16 @@ const ReqoreIcon = memo(
45
55
  const theme = useContext(ReqoreThemeContext);
46
56
  const Icon: IconType = RemixIcons[`Ri${icon}`];
47
57
  const finalColor: string | undefined = intent ? theme.intents[intent] : color;
58
+ const finalSize: string = isStringSize(size) ? ICON_FROM_SIZE[size] : size;
48
59
 
49
60
  if (!Icon) {
50
61
  return (
51
62
  <StyledIconWrapper
52
63
  {...rest}
64
+ size={size}
53
65
  margin={margin}
54
66
  className={`${className || ''} reqore-icon`}
55
- style={{ ...style, width: size, height: size }}
67
+ style={{ ...style, width: finalSize, height: finalSize }}
56
68
  />
57
69
  );
58
70
  }
@@ -61,13 +73,14 @@ const ReqoreIcon = memo(
61
73
  <StyledIconWrapper
62
74
  {...rest}
63
75
  margin={margin}
64
- style={{ ...style, width: size, height: size }}
76
+ size={size}
77
+ style={{ ...style, width: finalSize, height: finalSize }}
65
78
  className={`${className || ''} reqore-icon`}
66
79
  >
67
80
  <IconContext.Provider
68
81
  value={{
69
82
  color: finalColor || 'inherit',
70
- size,
83
+ size: finalSize,
71
84
  style: {
72
85
  verticalAlign: 'super',
73
86
  },
@@ -176,7 +176,7 @@ const ReqoreInput = forwardRef<HTMLDivElement, IReqoreInputProps>(
176
176
  >
177
177
  {icon && (
178
178
  <StyledIconWrapper _size={size}>
179
- <ReqoreIcon size={`${TEXT_FROM_SIZE[size]}px`} icon={icon} />
179
+ <ReqoreIcon size={size} icon={icon} />
180
180
  </StyledIconWrapper>
181
181
  )}
182
182
  <StyledInput
@@ -67,18 +67,18 @@ const ReqoreMenu = forwardRef<HTMLDivElement, IReqoreMenuProps>(
67
67
  return (
68
68
  <ReqoreThemeProvider theme={theme}>
69
69
  <StyledReqoreMenu {...rest} position={position} ref={ref} theme={theme}>
70
- {React.Children.map(children, (child) =>
71
- child
70
+ {React.Children.map(children, (child) => {
71
+ return child
72
72
  ? // @ts-ignore
73
73
  React.cloneElement(child, {
74
74
  _insidePopover,
75
75
  _popoverId,
76
- customTheme: theme,
76
+ customTheme: child?.props.customTheme || theme,
77
77
  wrap: wrapText,
78
- flat,
78
+ flat: child?.props.flat || flat,
79
79
  })
80
- : null
81
- )}
80
+ : null;
81
+ })}
82
82
  </StyledReqoreMenu>
83
83
  </ReqoreThemeProvider>
84
84
  );
@@ -1,7 +1,6 @@
1
1
  import { animated } from '@react-spring/web';
2
2
  import React, { forwardRef, useEffect, useMemo, useState } from 'react';
3
3
  import { useMount, useUnmount } from 'react-use';
4
- import { TEXT_FROM_SIZE } from '../../constants/sizes';
5
4
  import { IReqoreTheme } from '../../constants/theme';
6
5
  import ReqoreThemeProvider from '../../containers/ThemeProvider';
7
6
  import { useReqoreTheme } from '../../hooks/useTheme';
@@ -9,15 +8,16 @@ import {
9
8
  IReqoreIntent,
10
9
  IWithReqoreCustomTheme,
11
10
  IWithReqoreEffect,
11
+ IWithReqoreMinimal,
12
12
  IWithReqoreSize,
13
13
  } from '../../types/global';
14
14
  import { IReqoreIconName } from '../../types/icons';
15
+ import { ReqoreHeading } from '../Header';
15
16
  import ReqoreIcon from '../Icon';
16
17
  import {
17
18
  StyledIconWrapper,
18
19
  StyledNotificationContent,
19
20
  StyledNotificationContentWrapper,
20
- StyledNotificationTitle,
21
21
  StyledReqoreNotification,
22
22
  typeToIcon,
23
23
  } from '../Notifications/notification';
@@ -27,6 +27,7 @@ export interface IReqoreMessageProps
27
27
  IWithReqoreEffect,
28
28
  IWithReqoreSize,
29
29
  IReqoreIntent,
30
+ IWithReqoreMinimal,
30
31
  React.HTMLAttributes<HTMLDivElement> {
31
32
  title?: string;
32
33
  children: any;
@@ -36,7 +37,6 @@ export interface IReqoreMessageProps
36
37
  duration?: number;
37
38
  onFinish?: () => any;
38
39
  flat?: boolean;
39
- inverted?: boolean;
40
40
  }
41
41
 
42
42
  export interface IReqoreNotificationStyle extends IReqoreMessageProps {
@@ -57,7 +57,7 @@ const ReqoreMessage = forwardRef<HTMLDivElement, IReqoreMessageProps>(
57
57
  duration,
58
58
  onFinish,
59
59
  flat,
60
- inverted,
60
+ minimal,
61
61
  size = 'normal',
62
62
  customTheme,
63
63
  ...rest
@@ -114,7 +114,7 @@ const ReqoreMessage = forwardRef<HTMLDivElement, IReqoreMessageProps>(
114
114
  clickable={!!onClick}
115
115
  onClick={onClick}
116
116
  flat={flat}
117
- inverted={inverted}
117
+ minimal={minimal}
118
118
  asMessage
119
119
  fluid
120
120
  className={`${rest?.className || ''} reqore-message`}
@@ -124,16 +124,23 @@ const ReqoreMessage = forwardRef<HTMLDivElement, IReqoreMessageProps>(
124
124
  >
125
125
  {leftIcon ? (
126
126
  <StyledIconWrapper intent={intent} size={size} theme={theme}>
127
- <ReqoreIcon
128
- icon={leftIcon}
129
- margin={flat && inverted ? undefined : 'left'}
130
- size={`${TEXT_FROM_SIZE[size]}px`}
131
- />
127
+ <ReqoreIcon icon={leftIcon} margin={flat && minimal ? 'right' : 'both'} size={size} />
132
128
  </StyledIconWrapper>
133
129
  ) : null}
134
130
  <StyledNotificationContentWrapper size={size} theme={theme}>
135
- {title && <StyledNotificationTitle theme={theme}>{title}</StyledNotificationTitle>}
136
- <StyledNotificationContent theme={theme}>{children}</StyledNotificationContent>
131
+ {title && (
132
+ <ReqoreHeading
133
+ size={size}
134
+ customTheme={
135
+ rest.effect?.color ? { text: { color: rest.effect.color } } : undefined
136
+ }
137
+ >
138
+ {title}
139
+ </ReqoreHeading>
140
+ )}
141
+ <StyledNotificationContent theme={theme} hasTitle={!!title} size={size}>
142
+ {children}
143
+ </StyledNotificationContent>
137
144
  </StyledNotificationContentWrapper>
138
145
  {onClose && (
139
146
  <StyledIconWrapper
@@ -147,7 +154,7 @@ const ReqoreMessage = forwardRef<HTMLDivElement, IReqoreMessageProps>(
147
154
  onClose && onClose();
148
155
  }}
149
156
  >
150
- <ReqoreIcon icon='CloseFill' margin='both' size={`${TEXT_FROM_SIZE[size]}px`} />
157
+ <ReqoreIcon icon='CloseFill' margin='both' size={size} />
151
158
  </StyledIconWrapper>
152
159
  )}
153
160
  </StyledReqoreNotification>