@qoretechnologies/reqore 0.29.4 → 0.29.6

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 (83) hide show
  1. package/dist/components/Button/index.d.ts +3 -0
  2. package/dist/components/Button/index.d.ts.map +1 -1
  3. package/dist/components/Button/index.js +6 -3
  4. package/dist/components/Button/index.js.map +1 -1
  5. package/dist/components/Collection/index.d.ts +4 -1
  6. package/dist/components/Collection/index.d.ts.map +1 -1
  7. package/dist/components/Collection/index.js +28 -3
  8. package/dist/components/Collection/index.js.map +1 -1
  9. package/dist/components/Collection/item.d.ts +1 -1
  10. package/dist/components/Collection/item.d.ts.map +1 -1
  11. package/dist/components/ControlGroup/index.d.ts +15 -3
  12. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  13. package/dist/components/ControlGroup/index.js +146 -43
  14. package/dist/components/ControlGroup/index.js.map +1 -1
  15. package/dist/components/Icon/index.d.ts +2 -1
  16. package/dist/components/Icon/index.d.ts.map +1 -1
  17. package/dist/components/Icon/index.js +4 -1
  18. package/dist/components/Icon/index.js.map +1 -1
  19. package/dist/components/Input/index.d.ts +2 -0
  20. package/dist/components/Input/index.d.ts.map +1 -1
  21. package/dist/components/Input/index.js +7 -4
  22. package/dist/components/Input/index.js.map +1 -1
  23. package/dist/components/Message/index.d.ts +2 -0
  24. package/dist/components/Message/index.d.ts.map +1 -1
  25. package/dist/components/Message/index.js +2 -2
  26. package/dist/components/Message/index.js.map +1 -1
  27. package/dist/components/Panel/index.d.ts +2 -1
  28. package/dist/components/Panel/index.d.ts.map +1 -1
  29. package/dist/components/Panel/index.js +2 -2
  30. package/dist/components/Panel/index.js.map +1 -1
  31. package/dist/components/Table/helpers.d.ts +3 -2
  32. package/dist/components/Table/helpers.d.ts.map +1 -1
  33. package/dist/components/Table/helpers.js +6 -3
  34. package/dist/components/Table/helpers.js.map +1 -1
  35. package/dist/components/Table/index.d.ts +1 -0
  36. package/dist/components/Table/index.d.ts.map +1 -1
  37. package/dist/components/Table/index.js.map +1 -1
  38. package/dist/components/Tabs/item.js +1 -1
  39. package/dist/components/Tabs/item.js.map +1 -1
  40. package/dist/components/Tabs/list.d.ts.map +1 -1
  41. package/dist/components/Tabs/list.js +1 -1
  42. package/dist/components/Tabs/list.js.map +1 -1
  43. package/dist/components/Tag/index.d.ts +3 -0
  44. package/dist/components/Tag/index.d.ts.map +1 -1
  45. package/dist/components/Tag/index.js +9 -9
  46. package/dist/components/Tag/index.js.map +1 -1
  47. package/dist/components/Textarea/index.d.ts.map +1 -1
  48. package/dist/components/Textarea/index.js +0 -1
  49. package/dist/components/Textarea/index.js.map +1 -1
  50. package/dist/styles.d.ts +1 -0
  51. package/dist/styles.d.ts.map +1 -1
  52. package/dist/styles.js +6 -5
  53. package/dist/styles.js.map +1 -1
  54. package/package.json +1 -1
  55. package/src/components/Button/index.tsx +14 -2
  56. package/src/components/Collection/index.tsx +35 -4
  57. package/src/components/Collection/item.tsx +1 -1
  58. package/src/components/ControlGroup/index.tsx +252 -103
  59. package/src/components/Icon/index.tsx +6 -3
  60. package/src/components/Input/index.tsx +7 -3
  61. package/src/components/Message/index.tsx +9 -1
  62. package/src/components/Panel/index.tsx +3 -0
  63. package/src/components/Table/helpers.ts +12 -6
  64. package/src/components/Table/index.tsx +1 -0
  65. package/src/components/Tabs/item.tsx +4 -4
  66. package/src/components/Tabs/list.tsx +1 -0
  67. package/src/components/Tag/index.tsx +34 -11
  68. package/src/components/Textarea/index.tsx +0 -2
  69. package/src/mock/collectionData.tsx +3 -0
  70. package/src/stories/Button/Button.stories.tsx +14 -6
  71. package/src/stories/Checkbox/Checkbox.stories.tsx +4 -3
  72. package/src/stories/Collection/Collection.stories.tsx +16 -1
  73. package/src/stories/ControlGroup/ControlGroup.stories.tsx +119 -35
  74. package/src/stories/Dropdown/Dropdown.stories.tsx +13 -3
  75. package/src/stories/Input/Input.stories.tsx +3 -2
  76. package/src/stories/Menu/Menu.stories.tsx +1 -0
  77. package/src/stories/Message/Message.stories.tsx +7 -0
  78. package/src/stories/Panel/Panel.stories.tsx +1 -0
  79. package/src/stories/Tabs/Tabs.stories.tsx +2 -1
  80. package/src/stories/Tag/Tag.stories.tsx +8 -0
  81. package/src/stories/TextArea/TextArea.stories.tsx +1 -1
  82. package/src/styles.ts +6 -0
  83. package/tests.json +1 -1
@@ -1,14 +1,20 @@
1
- import React, { forwardRef } from 'react';
2
- import styled, { css } from 'styled-components';
1
+ import React, { forwardRef, memo, useMemo } from 'react';
2
+ import styled from 'styled-components';
3
3
  import { GAP_FROM_SIZE, RADIUS_FROM_SIZE, TSizes } from '../../constants/sizes';
4
4
  import { IReqoreTheme } from '../../constants/theme';
5
- import { IWithReqoreFlat, IWithReqoreMinimal, IWithReqoreSize } from '../../types/global';
5
+ import {
6
+ IReqoreIntent,
7
+ IWithReqoreFlat,
8
+ IWithReqoreMinimal,
9
+ IWithReqoreSize,
10
+ } from '../../types/global';
6
11
 
7
12
  export interface IReqoreControlGroupProps
8
13
  extends React.HTMLAttributes<HTMLDivElement>,
9
14
  IWithReqoreFlat,
10
15
  IWithReqoreSize,
11
- IWithReqoreMinimal {
16
+ IWithReqoreMinimal,
17
+ IReqoreIntent {
12
18
  stack?: boolean;
13
19
  children: any;
14
20
  fluid?: boolean;
@@ -19,6 +25,18 @@ export interface IReqoreControlGroupProps
19
25
  */
20
26
  vertical?: boolean;
21
27
  wrap?: boolean;
28
+ isInsideStackGroup?: boolean;
29
+ isInsideVerticalGroup?: boolean;
30
+ isFirst?: boolean;
31
+ isLast?: boolean;
32
+ isLastInFirstGroup?: boolean;
33
+ isLastInLastGroup?: boolean;
34
+ isFirstInLastGroup?: boolean;
35
+ childrenCount?: number;
36
+ childId?: number;
37
+ isChild?: boolean;
38
+ isFirstGroup?: boolean;
39
+ isLastGroup?: boolean;
22
40
  }
23
41
 
24
42
  export interface IReqoreControlGroupStyle extends IReqoreControlGroupProps {
@@ -34,112 +52,243 @@ export const StyledReqoreControlGroup = styled.div<IReqoreControlGroupStyle>`
34
52
  gap: ${({ gapSize, stack }) => (!stack ? `${GAP_FROM_SIZE[gapSize]}px` : undefined)};
35
53
  flex-wrap: ${({ wrap }) => (wrap ? 'wrap' : 'nowrap')};
36
54
 
37
- > .reqore-control-wrapper .reqore-control {
55
+ > * {
38
56
  border-radius: ${({ stack }) => (!stack ? undefined : 0)};
39
57
  }
58
+ `;
40
59
 
41
- ${({ vertical }) =>
42
- vertical
43
- ? css`
44
- > .reqore-control,
45
- > .reqore-control-wrapper,
46
- > .reqore-tag,
47
- > * {
48
- &:not(:last-child) {
49
- border-bottom: ${({ stack }) => (!stack ? undefined : 0)};
50
- }
51
-
52
- border-radius: ${({ stack }) => (!stack ? undefined : 0)};
53
-
54
- ${({ rounded, size, stack }) =>
55
- rounded && stack
56
- ? css`
57
- &:first-child {
58
- border-top-left-radius: ${RADIUS_FROM_SIZE[size]}px;
59
- border-top-right-radius: ${RADIUS_FROM_SIZE[size]}px;
60
- }
61
-
62
- &:last-child {
63
- border-bottom-left-radius: ${RADIUS_FROM_SIZE[size]}px;
64
- border-bottom-right-radius: ${RADIUS_FROM_SIZE[size]}px;
65
- }
66
- `
67
- : undefined}
68
- }
60
+ const ReqoreControlGroup = memo(
61
+ forwardRef<HTMLDivElement, IReqoreControlGroupProps>(
62
+ (
63
+ {
64
+ children,
65
+ className,
66
+ minimal,
67
+ size = 'normal',
68
+ gapSize = 'normal',
69
+ fluid,
70
+ flat,
71
+ rounded = true,
72
+ wrap,
73
+ stack,
74
+ isInsideStackGroup,
75
+ isInsideVerticalGroup,
76
+ isFirstInLastGroup,
77
+ isLastInFirstGroup,
78
+ isLastInLastGroup,
79
+ intent,
80
+ isFirst,
81
+ isLast,
82
+ vertical,
83
+ childrenCount,
84
+ childId,
85
+ isChild,
86
+ isFirstGroup,
87
+ isLastGroup,
88
+ ...rest
89
+ }: IReqoreControlGroupProps,
90
+ ref
91
+ ) => {
92
+ const isStack = stack || isInsideStackGroup;
93
+ const isVertical = vertical || isInsideVerticalGroup;
94
+ const realChildCount = useMemo((): number => {
95
+ const count = React.Children.toArray(children).filter((child: any) => child).length;
96
+
97
+ return count < 0 ? 0 : count;
98
+ }, [children]);
99
+
100
+ const getIsFirst = (index: number): boolean => {
101
+ return !isInsideStackGroup || childrenCount === 1
102
+ ? index === 0
103
+ : (isFirst || isFirst !== false) && index === 0;
104
+ };
105
+ const getIsLast = (index: number): boolean => {
106
+ return !isInsideStackGroup
107
+ ? index === realChildCount - 1
108
+ : (isLast || isLast !== false) && index === realChildCount - 1;
109
+ };
110
+ const getIsLastInFirstGroup = (index: number): boolean => {
111
+ return !isInsideStackGroup
112
+ ? index === 0
113
+ : isFirstGroup && (isLast || isLast !== false) && index === realChildCount - 1;
114
+ };
115
+ const getIsFirstInLastGroup = (index: number): boolean => {
116
+ return !isInsideStackGroup
117
+ ? index === realChildCount - 1
118
+ : isLastGroup && (isFirst || isFirst !== false) && childId === 1 && index === 0;
119
+ };
120
+ const getIsLastInLastGroup = (index: number): boolean => {
121
+ return !isInsideStackGroup
122
+ ? index === realChildCount - 1
123
+ : isLastGroup && (isLast || isLast !== false) && index === realChildCount - 1;
124
+ };
125
+
126
+ const getBorderTopLeftRadius = (index: number): number | undefined => {
127
+ const _isFirstGroup =
128
+ !isInsideStackGroup || childrenCount === 1 ? true : isChild ? isFirstGroup : index === 0;
129
+
130
+ // If this is the first item
131
+ if (_isFirstGroup && getIsFirst(index)) {
132
+ return RADIUS_FROM_SIZE[size];
133
+ }
134
+
135
+ return undefined;
136
+ };
69
137
 
70
- > .reqore-control-wrapper:not(:last-child) .reqore-control {
71
- border-bottom: ${({ stack }) => (!stack ? undefined : 0)};
138
+ const getBorderTopRightRadius = (index: number): number | undefined => {
139
+ // If this group is not vertical we need to style the very last item
140
+ if (!isVertical || !isStack) {
141
+ const _isLastGroup =
142
+ !isInsideStackGroup || childrenCount === 1
143
+ ? true
144
+ : isChild
145
+ ? isLastGroup
146
+ : index === realChildCount - 1;
147
+
148
+ if (_isLastGroup && getIsLast(index)) {
149
+ return RADIUS_FROM_SIZE[size];
72
150
  }
73
- `
74
- : css`
75
- > .reqore-control,
76
- > .reqore-control-wrapper,
77
- > .reqore-tag,
78
- > * {
79
- &:not(:last-child) {
80
- border-right: ${({ stack }) => (!stack ? undefined : 0)};
81
- }
82
-
83
- border-radius: ${({ stack }) => (!stack ? undefined : 0)};
84
-
85
- ${({ rounded, size, stack }) =>
86
- rounded && stack
87
- ? css`
88
- &:first-child {
89
- border-top-left-radius: ${RADIUS_FROM_SIZE[size]}px;
90
- border-bottom-left-radius: ${RADIUS_FROM_SIZE[size]}px;
91
- }
92
-
93
- &:last-child {
94
- border-top-right-radius: ${RADIUS_FROM_SIZE[size]}px;
95
- border-bottom-right-radius: ${RADIUS_FROM_SIZE[size]}px;
96
- }
97
- `
98
- : undefined}
151
+
152
+ return undefined;
153
+ }
154
+
155
+ // This border only needs to apply when this group is vertical
156
+ // AND this item is the last item of the first group
157
+ if (getIsLastInFirstGroup(index)) {
158
+ return RADIUS_FROM_SIZE[size];
159
+ }
160
+
161
+ return undefined;
162
+ };
163
+
164
+ const getBorderBottomLeftRadius = (index: number): number | undefined => {
165
+ // If this group is not vertical we need to style the very first item
166
+ if (!isVertical || !isStack) {
167
+ const _isFirstGroup =
168
+ !isInsideStackGroup || childrenCount === 1
169
+ ? true
170
+ : isChild
171
+ ? isFirstGroup
172
+ : index === 0;
173
+
174
+ if (_isFirstGroup && getIsFirst(index)) {
175
+ return RADIUS_FROM_SIZE[size];
99
176
  }
100
- `}
101
- `;
102
177
 
103
- const ReqoreControlGroup = forwardRef<HTMLDivElement, IReqoreControlGroupProps>(
104
- (
105
- {
106
- children,
107
- className,
108
- minimal,
109
- size = 'normal',
110
- gapSize = 'normal',
111
- fluid,
112
- flat,
113
- rounded = true,
114
- wrap,
115
- ...rest
116
- }: IReqoreControlGroupProps,
117
- ref
118
- ) => (
119
- <StyledReqoreControlGroup
120
- {...rest}
121
- size={size}
122
- gapSize={gapSize}
123
- ref={ref}
124
- rounded={rounded}
125
- fluid={fluid}
126
- wrap={wrap}
127
- className={`${className || ''} reqore-control-group`}
128
- >
129
- {React.Children.map(children, (child) =>
130
- child
131
- ? React.cloneElement(child, {
132
- minimal:
133
- child.props?.minimal || child.props?.minimal === false
134
- ? child.props.minimal
135
- : minimal,
136
- size: child.props?.size || size,
137
- flat: child.props?.flat || child.props?.flat === false ? child.props.flat : flat,
138
- fluid: child.props?.fluid || child.props?.fluid === false ? child.props.fluid : fluid,
139
- })
140
- : null
141
- )}
142
- </StyledReqoreControlGroup>
178
+ return undefined;
179
+ }
180
+
181
+ // This border only needs to apply when this group is vertical
182
+ // AND this item is the first item of the last group
183
+ if (getIsFirstInLastGroup(index)) {
184
+ return RADIUS_FROM_SIZE[size];
185
+ }
186
+
187
+ return undefined;
188
+ };
189
+
190
+ const getBorderBottomRightRadius = (index: number): number | undefined => {
191
+ const _isLastGroup =
192
+ !isInsideStackGroup || childrenCount === 1
193
+ ? true
194
+ : isChild
195
+ ? isLastGroup
196
+ : index === realChildCount - 1;
197
+
198
+ // If this is the last item
199
+ if (_isLastGroup && getIsLast(index)) {
200
+ return RADIUS_FROM_SIZE[size];
201
+ }
202
+
203
+ return undefined;
204
+ };
205
+
206
+ let index = 0;
207
+
208
+ const getStuff = (index, child) => {
209
+ if (isStack) {
210
+ return {
211
+ style: {
212
+ borderTopLeftRadius: getBorderTopLeftRadius(index),
213
+ borderBottomLeftRadius: getBorderBottomLeftRadius(index),
214
+ borderTopRightRadius: getBorderTopRightRadius(index),
215
+ borderBottomRightRadius: getBorderBottomRightRadius(index),
216
+ ...(child.props?.style || {}),
217
+ },
218
+ rounded: !isStack,
219
+ isInsideStackGroup: isStack,
220
+ isInsideVerticalGroup: isVertical,
221
+ isFirst: isChild ? getIsFirst(index) : undefined,
222
+ isLast: isChild ? getIsLast(index) : undefined,
223
+ isLastInFirstGroup: getIsLastInFirstGroup(index),
224
+ isLastInLastGroup: getIsLastInLastGroup(index),
225
+ isFirstInLastGroup: getIsFirstInLastGroup(index),
226
+ childrenCount: realChildCount,
227
+ childId: index + 1,
228
+ isChild: true,
229
+ isFirstGroup: isChild ? isFirstGroup : index === 0,
230
+ isLastGroup: isChild ? isLastGroup : index === realChildCount - 1,
231
+ };
232
+ }
233
+
234
+ return {};
235
+ };
236
+
237
+ return (
238
+ <StyledReqoreControlGroup
239
+ {...rest}
240
+ vertical={vertical}
241
+ size={size}
242
+ gapSize={gapSize}
243
+ ref={ref}
244
+ rounded={rounded}
245
+ fluid={fluid}
246
+ wrap={wrap}
247
+ stack={isStack}
248
+ className={`${className || ''} reqore-control-group`}
249
+ >
250
+ {React.Children.map(children, (child) => {
251
+ /*
252
+ * Because of the way React.Children.map works, we have to
253
+ * manually decrement the index for every child that is `null`
254
+ * because react maps through null children and returns them in `Count`
255
+ * We filter these children out in the `realChildCount` variable,
256
+ * but the index is still incremented
257
+ * */
258
+ const result = child
259
+ ? React.cloneElement(child, {
260
+ key: index,
261
+ minimal:
262
+ child.props?.minimal || child.props?.minimal === false
263
+ ? child.props.minimal
264
+ : minimal,
265
+ size: child.props?.size || size,
266
+ flat: child.props?.flat || child.props?.flat === false ? child.props.flat : flat,
267
+ fluid:
268
+ child.props?.fluid || child.props?.fluid === false ? child.props.fluid : fluid,
269
+ stack:
270
+ child.props?.stack || child.props?.stack === false
271
+ ? child.props.stack
272
+ : isStack,
273
+ intent: child.props?.intent || intent,
274
+ ...getStuff(index, child),
275
+ })
276
+ : null;
277
+
278
+ /*
279
+ * Because of the way React.Children.map works, we have to
280
+ * manually decrement the index for every child that is `null`
281
+ * because react maps through null children and returns them in `Count`
282
+ * We filter these children out in the `realChildCount` variable,
283
+ * but the index is still incremented
284
+ * */
285
+ index = !child ? index : index + 1;
286
+
287
+ return result;
288
+ })}
289
+ </StyledReqoreControlGroup>
290
+ );
291
+ }
143
292
  )
144
293
  );
145
294
 
@@ -6,14 +6,15 @@ import styled, { css } from 'styled-components';
6
6
  import { ReqoreThemeContext } from '../..';
7
7
  import { ICON_FROM_SIZE, PADDING_FROM_SIZE, TSizes } from '../../constants/sizes';
8
8
  import { TReqoreIntent } from '../../constants/theme';
9
+ import { getColorFromMaybeString } from '../../helpers/colors';
9
10
  import { isStringSize } from '../../helpers/utils';
10
11
  import { IWithReqoreEffect } from '../../types/global';
11
12
  import { IReqoreIconName } from '../../types/icons';
12
- import { StyledEffect } from '../Effect';
13
+ import { StyledEffect, TReqoreEffectColor } from '../Effect';
13
14
 
14
15
  export interface IReqoreIconProps extends React.HTMLAttributes<HTMLSpanElement>, IWithReqoreEffect {
15
16
  icon?: IReqoreIconName;
16
- color?: string;
17
+ color?: TReqoreEffectColor;
17
18
  size?: TSizes | string;
18
19
  iconProps?: IconBaseProps;
19
20
  intent?: TReqoreIntent;
@@ -66,7 +67,9 @@ const ReqoreIcon = memo(
66
67
  }: IReqoreIconProps) => {
67
68
  const theme = useContext(ReqoreThemeContext);
68
69
  const Icon: IconType = RemixIcons[`Ri${icon}`];
69
- const finalColor: string | undefined = intent ? theme.intents[intent] : color;
70
+ const finalColor: string | undefined = intent
71
+ ? theme.intents[intent]
72
+ : getColorFromMaybeString(theme, color);
70
73
  const finalSize: string = isStringSize(size) ? ICON_FROM_SIZE[size] : size;
71
74
 
72
75
  if (image) {
@@ -22,7 +22,7 @@ import {
22
22
  IWithReqoreEffect,
23
23
  } from '../../types/global';
24
24
  import { IReqoreIconName } from '../../types/icons';
25
- import { StyledEffect } from '../Effect';
25
+ import { StyledEffect, TReqoreEffectColor } from '../Effect';
26
26
  import ReqoreIcon from '../Icon';
27
27
  import ReqoreInputClearButton from '../InputClearButton';
28
28
 
@@ -48,6 +48,7 @@ export interface IReqoreInputProps
48
48
  rounded?: boolean;
49
49
  type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';
50
50
  wrapperStyle?: React.CSSProperties;
51
+ iconColor?: TReqoreEffectColor;
51
52
  }
52
53
 
53
54
  export interface IReqoreInputStyle extends IReqoreInputProps {
@@ -60,7 +61,9 @@ export interface IReqoreInputStyle extends IReqoreInputProps {
60
61
  export const StyledInputWrapper = styled.div<IReqoreInputStyle>`
61
62
  height: ${({ _size }) => SIZE_TO_PX[_size]}px;
62
63
  width: ${({ width }) => (width ? `${width}px` : 'auto')};
63
- flex: ${({ fluid, fixed }) => (fixed ? '0 auto' : fluid ? '1 0 auto' : '0 0 auto')};
64
+ max-width: ${({ fluid, fixed }) => (fluid && !fixed ? '100%' : undefined)};
65
+ min-width: 60px;
66
+ flex: ${({ fluid, fixed }) => (fixed ? '0 auto' : fluid ? '1 auto' : '0 1 auto')};
64
67
  font-size: ${({ _size }) => TEXT_FROM_SIZE[_size]}px;
65
68
  position: relative;
66
69
  overflow: hidden;
@@ -150,6 +153,7 @@ const ReqoreInput = forwardRef<HTMLDivElement, IReqoreInputProps>(
150
153
  className,
151
154
  onClearClick,
152
155
  icon,
156
+ iconColor,
153
157
  flat,
154
158
  rounded = true,
155
159
  minimal,
@@ -185,7 +189,7 @@ const ReqoreInput = forwardRef<HTMLDivElement, IReqoreInputProps>(
185
189
  >
186
190
  {icon && (
187
191
  <StyledIconWrapper _size={size}>
188
- <ReqoreIcon size={size} icon={icon} />
192
+ <ReqoreIcon size={size} icon={icon} color={iconColor} />
189
193
  </StyledIconWrapper>
190
194
  )}
191
195
  <StyledInput
@@ -14,6 +14,7 @@ import {
14
14
  IWithReqoreSize,
15
15
  } from '../../types/global';
16
16
  import { IReqoreIconName } from '../../types/icons';
17
+ import { TReqoreEffectColor } from '../Effect';
17
18
  import { ReqoreHeading } from '../Header';
18
19
  import ReqoreIcon from '../Icon';
19
20
  import {
@@ -35,6 +36,7 @@ export interface IReqoreMessageProps
35
36
  title?: string;
36
37
  children: any;
37
38
  icon?: IReqoreIconName;
39
+ iconColor?: TReqoreEffectColor;
38
40
  onClose?: () => any;
39
41
  onClick?: () => any;
40
42
  duration?: number;
@@ -64,6 +66,7 @@ const ReqoreMessage = forwardRef<HTMLDivElement, IReqoreMessageProps>(
64
66
  minimal,
65
67
  size = 'normal',
66
68
  customTheme,
69
+ iconColor,
67
70
  ...rest
68
71
  },
69
72
  ref: any
@@ -128,7 +131,12 @@ const ReqoreMessage = forwardRef<HTMLDivElement, IReqoreMessageProps>(
128
131
  >
129
132
  {leftIcon ? (
130
133
  <StyledIconWrapper intent={intent} size={size} theme={theme}>
131
- <ReqoreIcon icon={leftIcon} margin={flat && minimal ? 'right' : 'both'} size={size} />
134
+ <ReqoreIcon
135
+ icon={leftIcon}
136
+ margin={flat && minimal ? 'right' : 'both'}
137
+ size={size}
138
+ color={iconColor}
139
+ />
132
140
  </StyledIconWrapper>
133
141
  ) : null}
134
142
  <StyledNotificationContentWrapper size={size} theme={theme}>
@@ -87,6 +87,7 @@ export interface IReqorePanelProps
87
87
  contentEffect?: IReqoreEffect;
88
88
  headerEffect?: IReqoreEffect;
89
89
  transparent?: boolean;
90
+ iconColor?: TReqoreEffectColor;
90
91
  }
91
92
 
92
93
  export interface IStyledPanel extends IReqorePanelProps {
@@ -266,6 +267,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
266
267
  minimal,
267
268
  tooltip,
268
269
  badge,
270
+ iconColor,
269
271
  ...rest
270
272
  }: IReqorePanelProps,
271
273
  ref
@@ -455,6 +457,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
455
457
  size={`${ICON_FROM_HEADER_SIZE[headerSize]}px`}
456
458
  icon={icon}
457
459
  margin='right'
460
+ color={iconColor}
458
461
  />
459
462
  )}
460
463
  {typeof label === 'string' ? (
@@ -1,19 +1,25 @@
1
- import { firstBy } from "thenby";
2
- import { IReqoreTableSort } from ".";
1
+ import { firstBy } from 'thenby';
2
+ import { IReqoreTableSort } from '.';
3
3
 
4
- export const flipSortDirection = (direction: "asc" | "desc"): "asc" | "desc" =>
5
- direction === "asc" ? "desc" : "asc";
4
+ export const flipSortDirection = (direction: 'asc' | 'desc'): 'asc' | 'desc' =>
5
+ direction === 'asc' ? 'desc' : 'asc';
6
6
 
7
7
  export const fixSort = (sort?: IReqoreTableSort) => {
8
- return { ...(sort || {}), direction: sort?.direction || "desc" };
8
+ return { ...(sort || {}), direction: sort?.direction || 'desc' };
9
9
  };
10
10
 
11
11
  export const sortTableData = (data: any[], sort: IReqoreTableSort) => {
12
- const { by, direction } = sort;
12
+ const { by, thenBy, direction } = sort;
13
13
 
14
14
  if (!by) {
15
15
  return data;
16
16
  }
17
17
 
18
+ if (thenBy) {
19
+ return [...data].sort(
20
+ firstBy(by, { ignoreCase: true, direction }).thenBy(thenBy, { ignoreCase: true, direction })
21
+ );
22
+ }
23
+
18
24
  return [...data].sort(firstBy(by, { ignoreCase: true, direction }));
19
25
  };
@@ -89,6 +89,7 @@ export interface IReqoreTableStyle {
89
89
 
90
90
  export interface IReqoreTableSort {
91
91
  by?: string;
92
+ thenBy?: string;
92
93
  direction?: 'asc' | 'desc';
93
94
  }
94
95
 
@@ -45,8 +45,8 @@ export const StyledTabListItem = styled.div<IReqoreTabListItemStyle>`
45
45
  border-right: 0;
46
46
  }
47
47
  ${StyledButton}:last-child {
48
- border-top-right-radius: 0;
49
- border-bottom-right-radius: 0;
48
+ border-top-right-radius: 0 !important;
49
+ border-bottom-right-radius: 0 !important;
50
50
  }
51
51
  `
52
52
  : css`
@@ -54,10 +54,10 @@ export const StyledTabListItem = styled.div<IReqoreTabListItemStyle>`
54
54
  border-bottom: 0;
55
55
  }
56
56
  ${StyledButton}:first-child {
57
- border-bottom-left-radius: 0;
57
+ border-bottom-left-radius: 0 !important;
58
58
  }
59
59
  ${StyledButton}:last-child {
60
- border-bottom-right-radius: 0;
60
+ border-bottom-right-radius: 0 !important;
61
61
  }
62
62
  `}
63
63
 
@@ -216,6 +216,7 @@ const ReqoreTabsList = ({
216
216
  }
217
217
  closeOnOutsideClick
218
218
  isReqoreComponent
219
+ noWrapper
219
220
  handler='hoverStay'
220
221
  content={
221
222
  <ReqoreMenu customTheme={theme}>