@qoretechnologies/reqore 0.30.5 → 0.30.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 (232) hide show
  1. package/CODE_OF_CONDUCT.md +105 -0
  2. package/CONTRIBUTING.MD +78 -0
  3. package/LICENSE +1 -1
  4. package/README.md +44 -2
  5. package/SECURITY.md +5 -0
  6. package/__tests__/collection.test.tsx +1 -1
  7. package/__tests__/{control_group.test.tsx → control_group.text.tsx} +2 -4
  8. package/__tests__/modal.test.tsx +2 -74
  9. package/__tests__/panel.test.tsx +24 -96
  10. package/__tests__/popover.test.tsx +2 -24
  11. package/__tests__/tabs.test.tsx +0 -75
  12. package/dist/components/Button/index.d.ts +2 -7
  13. package/dist/components/Button/index.d.ts.map +1 -1
  14. package/dist/components/Button/index.js +20 -30
  15. package/dist/components/Button/index.js.map +1 -1
  16. package/dist/components/Checkbox/index.d.ts.map +1 -1
  17. package/dist/components/Checkbox/index.js +3 -6
  18. package/dist/components/Checkbox/index.js.map +1 -1
  19. package/dist/components/Collection/index.d.ts +2 -7
  20. package/dist/components/Collection/index.d.ts.map +1 -1
  21. package/dist/components/Collection/index.js +53 -57
  22. package/dist/components/Collection/index.js.map +1 -1
  23. package/dist/components/Collection/item.d.ts +5 -5
  24. package/dist/components/Collection/item.d.ts.map +1 -1
  25. package/dist/components/Collection/item.js +4 -15
  26. package/dist/components/Collection/item.js.map +1 -1
  27. package/dist/components/Columns/column.d.ts.map +1 -1
  28. package/dist/components/Columns/column.js +1 -1
  29. package/dist/components/Columns/column.js.map +1 -1
  30. package/dist/components/ControlGroup/index.d.ts +4 -21
  31. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  32. package/dist/components/ControlGroup/index.js +55 -250
  33. package/dist/components/ControlGroup/index.js.map +1 -1
  34. package/dist/components/Drawer/index.d.ts +3 -3
  35. package/dist/components/Drawer/index.d.ts.map +1 -1
  36. package/dist/components/Drawer/index.js +16 -27
  37. package/dist/components/Drawer/index.js.map +1 -1
  38. package/dist/components/Dropdown/index.d.ts +0 -1
  39. package/dist/components/Dropdown/index.d.ts.map +1 -1
  40. package/dist/components/Dropdown/index.js +2 -2
  41. package/dist/components/Dropdown/index.js.map +1 -1
  42. package/dist/components/Dropdown/list.d.ts +3 -3
  43. package/dist/components/Dropdown/list.d.ts.map +1 -1
  44. package/dist/components/Effect/index.d.ts +10 -10
  45. package/dist/components/Effect/index.d.ts.map +1 -1
  46. package/dist/components/Effect/index.js +6 -7
  47. package/dist/components/Effect/index.js.map +1 -1
  48. package/dist/components/Icon/index.d.ts +6 -5
  49. package/dist/components/Icon/index.d.ts.map +1 -1
  50. package/dist/components/Icon/index.js +7 -14
  51. package/dist/components/Icon/index.js.map +1 -1
  52. package/dist/components/Input/index.d.ts +0 -2
  53. package/dist/components/Input/index.d.ts.map +1 -1
  54. package/dist/components/Input/index.js +4 -10
  55. package/dist/components/Input/index.js.map +1 -1
  56. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  57. package/dist/components/InternalPopover/index.js +10 -12
  58. package/dist/components/InternalPopover/index.js.map +1 -1
  59. package/dist/components/Menu/index.d.ts.map +1 -1
  60. package/dist/components/Menu/index.js +1 -1
  61. package/dist/components/Menu/index.js.map +1 -1
  62. package/dist/components/Message/index.d.ts +0 -2
  63. package/dist/components/Message/index.d.ts.map +1 -1
  64. package/dist/components/Message/index.js +2 -2
  65. package/dist/components/Message/index.js.map +1 -1
  66. package/dist/components/MultiSelect/index.d.ts +2 -2
  67. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  68. package/dist/components/MultiSelect/index.js +10 -10
  69. package/dist/components/MultiSelect/index.js.map +1 -1
  70. package/dist/components/Notifications/index.d.ts +1 -1
  71. package/dist/components/Notifications/index.d.ts.map +1 -1
  72. package/dist/components/Notifications/notification.d.ts +1 -1
  73. package/dist/components/Notifications/notification.d.ts.map +1 -1
  74. package/dist/components/Panel/index.d.ts +6 -13
  75. package/dist/components/Panel/index.d.ts.map +1 -1
  76. package/dist/components/Panel/index.js +44 -78
  77. package/dist/components/Panel/index.js.map +1 -1
  78. package/dist/components/Popover/index.d.ts +2 -1
  79. package/dist/components/Popover/index.d.ts.map +1 -1
  80. package/dist/components/Popover/index.js +2 -2
  81. package/dist/components/Popover/index.js.map +1 -1
  82. package/dist/components/Spacer/index.d.ts +0 -2
  83. package/dist/components/Spacer/index.d.ts.map +1 -1
  84. package/dist/components/Spacer/index.js +7 -29
  85. package/dist/components/Spacer/index.js.map +1 -1
  86. package/dist/components/Table/header.js +2 -2
  87. package/dist/components/Table/header.js.map +1 -1
  88. package/dist/components/Table/headerCell.js +2 -2
  89. package/dist/components/Table/headerCell.js.map +1 -1
  90. package/dist/components/Table/helpers.d.ts +2 -3
  91. package/dist/components/Table/helpers.d.ts.map +1 -1
  92. package/dist/components/Table/helpers.js +3 -6
  93. package/dist/components/Table/helpers.js.map +1 -1
  94. package/dist/components/Table/index.d.ts +3 -4
  95. package/dist/components/Table/index.d.ts.map +1 -1
  96. package/dist/components/Table/index.js.map +1 -1
  97. package/dist/components/Table/row.d.ts +5 -0
  98. package/dist/components/Table/row.d.ts.map +1 -1
  99. package/dist/components/Table/row.js +7 -3
  100. package/dist/components/Table/row.js.map +1 -1
  101. package/dist/components/Tabs/content.d.ts +1 -3
  102. package/dist/components/Tabs/content.d.ts.map +1 -1
  103. package/dist/components/Tabs/content.js +3 -8
  104. package/dist/components/Tabs/content.js.map +1 -1
  105. package/dist/components/Tabs/index.d.ts +1 -4
  106. package/dist/components/Tabs/index.d.ts.map +1 -1
  107. package/dist/components/Tabs/index.js +4 -12
  108. package/dist/components/Tabs/index.js.map +1 -1
  109. package/dist/components/Tabs/item.d.ts +0 -1
  110. package/dist/components/Tabs/item.d.ts.map +1 -1
  111. package/dist/components/Tabs/item.js +7 -7
  112. package/dist/components/Tabs/item.js.map +1 -1
  113. package/dist/components/Tabs/list.d.ts +1 -1
  114. package/dist/components/Tabs/list.d.ts.map +1 -1
  115. package/dist/components/Tabs/list.js +6 -7
  116. package/dist/components/Tabs/list.js.map +1 -1
  117. package/dist/components/Tag/group.d.ts +2 -2
  118. package/dist/components/Tag/group.d.ts.map +1 -1
  119. package/dist/components/Tag/group.js +8 -7
  120. package/dist/components/Tag/group.js.map +1 -1
  121. package/dist/components/Tag/index.d.ts +2 -6
  122. package/dist/components/Tag/index.d.ts.map +1 -1
  123. package/dist/components/Tag/index.js +12 -24
  124. package/dist/components/Tag/index.js.map +1 -1
  125. package/dist/components/Tree/index.js +1 -1
  126. package/dist/components/Tree/index.js.map +1 -1
  127. package/dist/constants/animations.js +1 -1
  128. package/dist/constants/sizes.d.ts +2 -2
  129. package/dist/constants/sizes.d.ts.map +1 -1
  130. package/dist/constants/sizes.js +10 -10
  131. package/dist/constants/sizes.js.map +1 -1
  132. package/dist/constants/theme.d.ts +1 -1
  133. package/dist/constants/theme.d.ts.map +1 -1
  134. package/dist/containers/PopoverProvider.d.ts.map +1 -1
  135. package/dist/containers/PopoverProvider.js +8 -10
  136. package/dist/containers/PopoverProvider.js.map +1 -1
  137. package/dist/containers/ReqoreProvider.d.ts.map +1 -1
  138. package/dist/containers/ReqoreProvider.js +2 -4
  139. package/dist/containers/ReqoreProvider.js.map +1 -1
  140. package/dist/containers/UIProvider.d.ts +0 -7
  141. package/dist/containers/UIProvider.d.ts.map +1 -1
  142. package/dist/containers/UIProvider.js.map +1 -1
  143. package/dist/context/ReqoreContext.d.ts +0 -2
  144. package/dist/context/ReqoreContext.d.ts.map +1 -1
  145. package/dist/context/ReqoreContext.js.map +1 -1
  146. package/dist/helpers/colors.d.ts +1 -1
  147. package/dist/helpers/colors.d.ts.map +1 -1
  148. package/dist/helpers/colors.js +2 -6
  149. package/dist/helpers/colors.js.map +1 -1
  150. package/dist/helpers/utils.d.ts +0 -3
  151. package/dist/helpers/utils.d.ts.map +1 -1
  152. package/dist/helpers/utils.js +2 -17
  153. package/dist/helpers/utils.js.map +1 -1
  154. package/dist/hooks/useLatestZIndex.js +2 -2
  155. package/dist/hooks/useLatestZIndex.js.map +1 -1
  156. package/dist/hooks/usePopover.d.ts +0 -1
  157. package/dist/hooks/usePopover.d.ts.map +1 -1
  158. package/dist/hooks/usePopover.js +6 -8
  159. package/dist/hooks/usePopover.js.map +1 -1
  160. package/dist/styles.d.ts +0 -1
  161. package/dist/styles.d.ts.map +1 -1
  162. package/dist/styles.js +5 -6
  163. package/dist/styles.js.map +1 -1
  164. package/dist/types/global.d.ts +1 -27
  165. package/dist/types/global.d.ts.map +1 -1
  166. package/dist/types/icons.d.ts +1 -1
  167. package/dist/types/icons.d.ts.map +1 -1
  168. package/package.json +1 -1
  169. package/public/logo-dark.png +0 -0
  170. package/public/logo.png +0 -0
  171. package/public/q-symbol.png +0 -0
  172. package/public/qoreLogo-dark.png +0 -0
  173. package/public/qoreLogo.png +0 -0
  174. package/src/components/Button/index.tsx +34 -79
  175. package/src/components/Checkbox/index.tsx +2 -3
  176. package/src/components/Collection/index.tsx +60 -93
  177. package/src/components/Collection/item.tsx +9 -29
  178. package/src/components/Columns/column.tsx +0 -1
  179. package/src/components/ControlGroup/index.tsx +104 -449
  180. package/src/components/Drawer/index.tsx +27 -28
  181. package/src/components/Dropdown/index.tsx +1 -3
  182. package/src/components/Effect/index.tsx +14 -22
  183. package/src/components/Icon/index.tsx +62 -81
  184. package/src/components/Input/index.tsx +3 -8
  185. package/src/components/InternalPopover/index.tsx +126 -131
  186. package/src/components/Menu/index.tsx +1 -7
  187. package/src/components/Message/index.tsx +1 -9
  188. package/src/components/MultiSelect/index.tsx +188 -180
  189. package/src/components/Panel/index.tsx +100 -227
  190. package/src/components/Popover/index.tsx +3 -1
  191. package/src/components/Spacer/index.tsx +14 -63
  192. package/src/components/Table/header.tsx +2 -2
  193. package/src/components/Table/headerCell.tsx +2 -2
  194. package/src/components/Table/helpers.ts +6 -12
  195. package/src/components/Table/index.tsx +0 -1
  196. package/src/components/Table/row.tsx +7 -2
  197. package/src/components/Tabs/content.tsx +3 -11
  198. package/src/components/Tabs/index.tsx +3 -14
  199. package/src/components/Tabs/item.tsx +5 -28
  200. package/src/components/Tabs/list.tsx +3 -7
  201. package/src/components/Tag/group.tsx +12 -6
  202. package/src/components/Tag/index.tsx +35 -69
  203. package/src/components/Tree/index.tsx +1 -1
  204. package/src/constants/animations.ts +1 -1
  205. package/src/constants/sizes.ts +10 -10
  206. package/src/containers/PopoverProvider.tsx +8 -11
  207. package/src/containers/ReqoreProvider.tsx +35 -40
  208. package/src/containers/UIProvider.tsx +0 -7
  209. package/src/context/ReqoreContext.tsx +0 -2
  210. package/src/helpers/colors.ts +2 -8
  211. package/src/helpers/utils.ts +0 -18
  212. package/src/hooks/useLatestZIndex.ts +2 -2
  213. package/src/hooks/usePopover.tsx +6 -9
  214. package/src/mock/collectionData.tsx +2 -33
  215. package/src/stories/Button/Button.stories.tsx +7 -72
  216. package/src/stories/Checkbox/Checkbox.stories.tsx +3 -6
  217. package/src/stories/Collection/Collection.stories.tsx +2 -18
  218. package/src/stories/ControlGroup/ControlGroup.stories.tsx +33 -282
  219. package/src/stories/Drawer/Drawer.stories.tsx +3 -70
  220. package/src/stories/Dropdown/Dropdown.stories.tsx +3 -13
  221. package/src/stories/Icon/Icon.stories.tsx +0 -1
  222. package/src/stories/Input/Input.stories.tsx +3 -5
  223. package/src/stories/Menu/Menu.stories.tsx +0 -2
  224. package/src/stories/Message/Message.stories.tsx +0 -7
  225. package/src/stories/Panel/Panel.stories.tsx +13 -147
  226. package/src/stories/Popover/Popover.stories.tsx +82 -88
  227. package/src/stories/Tabs/Tabs.stories.tsx +15 -33
  228. package/src/stories/Tag/Tag.stories.tsx +3 -23
  229. package/src/stories/TextArea/TextArea.stories.tsx +3 -3
  230. package/src/styles.ts +0 -6
  231. package/src/types/global.ts +0 -28
  232. package/tests.json +1 -1
@@ -21,13 +21,10 @@ import {
21
21
  } from '../../helpers/colors';
22
22
  import { useCombinedRefs } from '../../hooks/useCombinedRefs';
23
23
  import { useTooltip } from '../../hooks/useTooltip';
24
- import { ActiveIconScale, InactiveIconScale } from '../../styles';
25
24
  import {
26
25
  IReqoreDisabled,
27
26
  IReqoreIntent,
28
27
  IWithReqoreEffect,
29
- IWithReqoreFixed,
30
- IWithReqoreFluid,
31
28
  IWithReqoreMinimal,
32
29
  IWithReqoreTooltip,
33
30
  } from '../../types/global';
@@ -37,7 +34,6 @@ import ReqoreIcon from '../Icon';
37
34
 
38
35
  export interface IReqoreTagAction extends IWithReqoreTooltip, IReqoreDisabled, IReqoreIntent {
39
36
  icon: IReqoreIconName;
40
- show?: boolean;
41
37
  onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
42
38
  }
43
39
 
@@ -46,9 +42,7 @@ export interface IReqoreTagProps
46
42
  IWithReqoreTooltip,
47
43
  IReqoreDisabled,
48
44
  IWithReqoreEffect,
49
- IWithReqoreMinimal,
50
- IWithReqoreFluid,
51
- IWithReqoreFixed {
45
+ IWithReqoreMinimal {
52
46
  size?: TSizes;
53
47
  label?: string | number;
54
48
  labelKey?: string | number;
@@ -56,9 +50,6 @@ export interface IReqoreTagProps
56
50
  onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
57
51
  icon?: IReqoreIconName;
58
52
  rightIcon?: IReqoreIconName;
59
- iconColor?: TReqoreEffectColor;
60
- leftIconColor?: TReqoreEffectColor;
61
- rightIconColor?: TReqoreEffectColor;
62
53
  color?: TReqoreEffectColor;
63
54
  actions?: IReqoreTagAction[];
64
55
  width?: string;
@@ -86,15 +77,10 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
86
77
  font-size: ${({ size }) => TEXT_FROM_SIZE[size]}px;
87
78
 
88
79
  min-width: ${({ size }) => SIZE_TO_PX[size]}px;
89
- max-width: ${({ fluid, fixed }) => (fluid && !fixed ? '100%' : undefined)};
90
- flex: ${({ fluid, fixed }) => (fixed ? '0 0 auto' : fluid ? '1 auto' : '0 0 auto')};
91
- align-self: ${({ fixed, fluid }) => (fixed ? 'flex-start' : fluid ? 'stretch' : undefined)};
92
80
  border-radius: ${({ asBadge, size }) => (asBadge ? 18 : RADIUS_FROM_SIZE[size])}px;
93
81
  width: ${({ width }) => width || undefined};
94
82
  transition: all 0.2s ease-out;
95
83
 
96
- ${InactiveIconScale};
97
-
98
84
  ${({ wrap, hasWidth }) =>
99
85
  wrap || hasWidth
100
86
  ? css`
@@ -120,24 +106,16 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
120
106
  `}
121
107
 
122
108
  ${({ theme, color, interactive, minimal, effect }) =>
123
- interactive
109
+ interactive && !effect?.gradient
124
110
  ? css`
125
111
  cursor: pointer;
126
112
  &:hover {
127
- .reqore-tag-content,
128
- .reqore-tag-key-content {
129
- ${ActiveIconScale}
130
- }
131
-
132
- ${!effect?.gradient &&
133
- css`
134
- background-color: ${changeLightness(color || theme.main, color ? 0.05 : 0.15)};
135
- color: ${minimal
136
- ? getReadableColor(theme, undefined, undefined, false, theme.originalMain)
137
- : color
138
- ? getReadableColorFrom(color)
139
- : getReadableColor(theme, undefined, undefined)};
140
- `}
113
+ background-color: ${changeLightness(color || theme.main, color ? 0.05 : 0.15)};
114
+ color: ${minimal
115
+ ? getReadableColor(theme, undefined, undefined, false, theme.originalMain)
116
+ : color
117
+ ? getReadableColorFrom(color)
118
+ : getReadableColor(theme, undefined, undefined)};
141
119
  }
142
120
  `
143
121
  : undefined}
@@ -152,6 +130,8 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
152
130
  `}
153
131
  `;
154
132
 
133
+ const StyledTagRightIcon = styled(ReqoreIcon)``;
134
+
155
135
  const StyledTagKeyWrapper = styled.span<{ size: TSizes }>`
156
136
  display: flex;
157
137
  align-items: center;
@@ -247,9 +227,6 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
247
227
  minimal,
248
228
  wrap = false,
249
229
  width,
250
- leftIconColor,
251
- rightIconColor,
252
- iconColor,
253
230
  ...rest
254
231
  }: IReqoreTagProps,
255
232
  ref
@@ -275,7 +252,6 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
275
252
  {...rest}
276
253
  effect={{
277
254
  ...rest.effect,
278
- gradient: intent ? undefined : rest.effect?.gradient,
279
255
  interactive: !!onClick && !rest.disabled,
280
256
  }}
281
257
  width={width}
@@ -300,14 +276,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
300
276
  hasWidth={!!width}
301
277
  hasKey={!!labelKey}
302
278
  >
303
- {icon && (
304
- <ReqoreIcon
305
- icon={icon}
306
- size={size}
307
- margin={label ? 'left' : 'both'}
308
- color={leftIconColor || iconColor}
309
- />
310
- )}
279
+ {icon && <ReqoreIcon icon={icon} size={size} margin={label ? 'left' : 'both'} />}
311
280
  {labelKey && (
312
281
  <StyledTagContentKey wrap={wrap} hasWidth={!!width} size={size}>
313
282
  {labelKey}
@@ -330,40 +299,37 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
330
299
  </StyledTagContent>
331
300
  ) : null}
332
301
  {rightIcon && (
333
- <ReqoreIcon
302
+ <StyledTagRightIcon
334
303
  icon={rightIcon}
335
304
  size={size}
336
305
  margin={label || icon ? 'right' : 'both'}
337
- color={rightIconColor || iconColor}
338
306
  />
339
307
  )}
340
308
  </StyledTagContentWrapper>
341
309
  ) : null}
342
310
  {_size(actions)
343
- ? actions
344
- .filter((action) => action.show !== false)
345
- .map((action, index) => (
346
- <React.Fragment key={index}>
347
- <ReqorePopover
348
- component={StyledButtonWrapper}
349
- componentProps={{
350
- size,
351
- color: getCustomColor(action.intent),
352
- className: 'reqore-tag-action',
353
- onClick: action.onClick,
354
- effect: rest.effect,
355
- }}
356
- {...(action.tooltip
357
- ? typeof action.tooltip === 'string'
358
- ? { tooltip: action.tooltip }
359
- : action.tooltip
360
- : {})}
361
- isReqoreComponent
362
- >
363
- <ReqoreIcon icon={action.icon} size={size} />
364
- </ReqorePopover>
365
- </React.Fragment>
366
- ))
311
+ ? actions.map((action, index) => (
312
+ <React.Fragment key={index}>
313
+ <ReqorePopover
314
+ component={StyledButtonWrapper}
315
+ componentProps={{
316
+ size,
317
+ color: getCustomColor(action.intent),
318
+ className: 'reqore-tag-action',
319
+ onClick: action.onClick,
320
+ effect: rest.effect,
321
+ }}
322
+ {...(action.tooltip
323
+ ? typeof action.tooltip === 'string'
324
+ ? { tooltip: action.tooltip }
325
+ : action.tooltip
326
+ : {})}
327
+ noWrapper
328
+ >
329
+ <ReqoreIcon icon={action.icon} size={size} />
330
+ </ReqorePopover>
331
+ </React.Fragment>
332
+ ))
367
333
  : null}
368
334
  {onRemoveClick && !rest.disabled ? (
369
335
  <ReqorePopover
@@ -375,7 +341,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
375
341
  onClick: onRemoveClick,
376
342
  effect: rest.effect,
377
343
  }}
378
- isReqoreComponent
344
+ noWrapper
379
345
  content='Remove'
380
346
  >
381
347
  <ReqoreIcon icon='CloseLine' size={size} />
@@ -181,7 +181,7 @@ export const ReqoreTree = ({
181
181
  return (
182
182
  <StyledTreeWrapper className='reqore-tree'>
183
183
  {showControls && (
184
- <ReqoreControlGroup stack size={size} responsive>
184
+ <ReqoreControlGroup stack size={size}>
185
185
  {isDeep() && !allExpanded ? (
186
186
  <ReqoreButton
187
187
  flat
@@ -1,5 +1,5 @@
1
1
  export const SPRING_CONFIG = {
2
- tension: 180,
2
+ tension: 120,
3
3
  friction: 20,
4
4
  };
5
5
 
@@ -37,19 +37,19 @@ export const HEADER_SIZE_TO_NUMBER = {
37
37
  };
38
38
 
39
39
  export const SIZE_TO_PX = {
40
- tiny: 18,
41
- small: 24,
40
+ tiny: 10,
41
+ small: 20,
42
42
  normal: 30,
43
43
  big: 40,
44
44
  huge: 50,
45
45
  };
46
46
 
47
47
  export const BADGE_SIZE_TO_PX = {
48
- tiny: 14,
49
- small: 20,
50
- normal: 26,
51
- big: 32,
52
- huge: 38,
48
+ tiny: 10,
49
+ small: 18,
50
+ normal: 24,
51
+ big: 30,
52
+ huge: 36,
53
53
  };
54
54
 
55
55
  export const TABS_SIZE_TO_PX = {
@@ -109,9 +109,9 @@ export const PADDING_FROM_SIZE = {
109
109
  };
110
110
 
111
111
  export const RADIUS_FROM_SIZE = {
112
- tiny: 4,
113
- small: 5,
114
- normal: 5.5,
112
+ tiny: 1,
113
+ small: 3,
114
+ normal: 5,
115
115
  big: 7,
116
116
  huge: 9,
117
117
  };
@@ -22,15 +22,12 @@ const PopoverProvider: React.FC<IReqorePopoverProviderProps> = ({ children, uiSc
22
22
  const handleClick = useCallback(
23
23
  (event: MouseEvent) => {
24
24
  popovers.forEach(({ popperRef, closeOnAnyClick, closeOnOutsideClick, id, targetElement }) => {
25
- if (closeOnAnyClick) {
26
- removePopover(id);
27
- return;
28
- }
29
-
30
25
  if (
31
- closeOnOutsideClick &&
32
- !(popperRef?.current && popperRef.current.contains(event.target)) &&
33
- !targetElement?.contains(event.target as Node)
26
+ closeOnAnyClick ||
27
+ (closeOnOutsideClick &&
28
+ popperRef?.current &&
29
+ !popperRef.current.contains(event.target) &&
30
+ !targetElement?.contains(event.target as Node))
34
31
  ) {
35
32
  removePopover(id);
36
33
  }
@@ -69,21 +66,21 @@ const PopoverProvider: React.FC<IReqorePopoverProviderProps> = ({ children, uiSc
69
66
  };
70
67
 
71
68
  useEffect(() => {
72
- document.addEventListener('click', handleClick, true);
69
+ document.addEventListener('click', handleClick);
73
70
 
74
71
  if (closePopoversOnEscPress) {
75
72
  document.addEventListener('keydown', handleKeyDown);
76
73
  }
77
74
 
78
75
  return () => {
79
- document.removeEventListener('click', handleClick, true);
76
+ document.removeEventListener('click', handleClick);
80
77
  document.removeEventListener('keydown', handleKeyDown);
81
78
  };
82
79
  }, [popovers]);
83
80
 
84
81
  useEffect(() => {
85
82
  if (!size(popovers)) {
86
- document.removeEventListener('click', handleClick, true);
83
+ document.removeEventListener('click', handleClick);
87
84
  document.removeEventListener('keydown', handleKeyDown);
88
85
  }
89
86
  }, [popovers]);
@@ -120,10 +120,8 @@ const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options = {}
120
120
  isMobile,
121
121
  isTablet,
122
122
  isMobileOrTablet,
123
- latestZIndex: latestZIndex.current,
124
123
  getAndIncreaseZIndex,
125
124
  animations: options.animations || { buttons: true, dialogs: true },
126
- tooltips: options.tooltips || { delay: 0 },
127
125
  closePopoversOnEscPress:
128
126
  'closePopoversOnEscPress' in options ? options.closePopoversOnEscPress : true,
129
127
  }}
@@ -158,47 +156,44 @@ const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options = {}
158
156
  </ReqoreNotificationsWrapper>
159
157
  ) : null}
160
158
  {children}
161
- {confirmationModal.isOpen && (
162
- <ReqoreModal
163
- isOpen
164
- flat
165
- opacity={0.9}
166
- blur={2}
167
- width='500px'
168
- intent={confirmationModal.intent}
169
- label={confirmationModal.title || 'Confirm your action'}
170
- icon='ErrorWarningFill'
171
- className='reqore-confirmation-modal'
172
- bottomActions={[
173
- {
174
- label: confirmationModal.cancelLabel || 'Cancel',
175
- icon: 'CloseLine',
176
- onClick: () => {
177
- confirmationModal?.onCancel?.();
178
- closeConfirmationModal();
179
- },
180
- position: 'left',
159
+ <ReqoreModal
160
+ isOpen={confirmationModal.isOpen}
161
+ flat
162
+ opacity={0.9}
163
+ blur={2}
164
+ width='500px'
165
+ intent={confirmationModal.intent}
166
+ label={confirmationModal.title || 'Confirm your action'}
167
+ icon='ErrorWarningFill'
168
+ bottomActions={[
169
+ {
170
+ label: confirmationModal.cancelLabel || 'Cancel',
171
+ icon: 'CloseLine',
172
+ onClick: () => {
173
+ confirmationModal?.onCancel?.();
174
+ closeConfirmationModal();
181
175
  },
182
- {
183
- label: confirmationModal.confirmLabel || 'Confirm',
184
- intent: confirmationModal.confirmButtonIntent || 'success',
185
- icon: confirmationModal.confirmIcon || 'CheckLine',
186
- onClick: () => {
187
- confirmationModal?.onConfirm?.();
188
- closeConfirmationModal();
189
- },
190
- position: 'right',
176
+ position: 'left',
177
+ },
178
+ {
179
+ label: confirmationModal.confirmLabel || 'Confirm',
180
+ intent: confirmationModal.confirmButtonIntent || 'success',
181
+ icon: confirmationModal.confirmIcon || 'CheckLine',
182
+ onClick: () => {
183
+ confirmationModal?.onConfirm?.();
184
+ closeConfirmationModal();
191
185
  },
192
- ]}
186
+ position: 'right',
187
+ },
188
+ ]}
189
+ >
190
+ <ReqoreTextEffect
191
+ as='p'
192
+ effect={{ textAlign: 'center', weight: 'bold', textSize: 'big' }}
193
193
  >
194
- <ReqoreTextEffect
195
- as='p'
196
- effect={{ textAlign: 'center', weight: 'bold', textSize: 'big' }}
197
- >
198
- {confirmationModal.description || 'Are you sure you want to proceed?'}
199
- </ReqoreTextEffect>
200
- </ReqoreModal>
201
- )}
194
+ {confirmationModal.description || 'Are you sure you want to proceed?'}
195
+ </ReqoreTextEffect>
196
+ </ReqoreModal>
202
197
  </ReqoreContext.Provider>
203
198
  </>
204
199
  );
@@ -18,13 +18,6 @@ export interface IReqoreOptions {
18
18
  buttons?: boolean;
19
19
  dialogs?: boolean;
20
20
  };
21
- tooltips?: {
22
- /**
23
- * Delay in ms before showing the tooltip
24
- * @default 0
25
- * */
26
- delay?: number;
27
- };
28
21
  closePopoversOnEscPress?: boolean;
29
22
  }
30
23
  export interface IReqoreUIProviderProps {
@@ -12,9 +12,7 @@ export interface IReqoreContext {
12
12
  readonly isMobileOrTablet?: boolean;
13
13
  readonly getAndIncreaseZIndex?: () => number;
14
14
  readonly animations?: IReqoreOptions['animations'];
15
- readonly tooltips?: IReqoreOptions['tooltips'];
16
15
  readonly closePopoversOnEscPress?: boolean;
17
- readonly latestZIndex?: number;
18
16
  }
19
17
 
20
18
  export default createContext<IReqoreContext>({
@@ -96,9 +96,6 @@ export const buildTheme = (theme: IReqoreTheme): IReqoreTheme => {
96
96
  newTheme.main = '#333333';
97
97
  }
98
98
 
99
- // Add the original theme main color to the theme
100
- newTheme.originalMain = newTheme.main;
101
-
102
99
  if (!newTheme.notifications?.info) {
103
100
  newTheme.notifications.info = newTheme.intents.info || DEFAULT_INTENTS.info;
104
101
  }
@@ -203,8 +200,7 @@ export const createEffectGradient = (
203
200
  theme: IReqoreTheme,
204
201
  colors: TReqoreEffectGradientColors,
205
202
  lighten: number = 0,
206
- minimal?: boolean,
207
- active?: boolean
203
+ minimal?: boolean
208
204
  ): string => {
209
205
  let _colors: TReqoreEffectGradientColorsObject;
210
206
  // Check if the colors are valid
@@ -223,9 +219,7 @@ export const createEffectGradient = (
223
219
  (colorsString, color, percentage) => {
224
220
  return `${colorsString}, ${
225
221
  minimal
226
- ? active
227
- ? theme.originalMain
228
- : changeLightness(theme.originalMain, lighten)
222
+ ? theme.originalMain
229
223
  : changeLightness(getColorFromMaybeString(theme, color), lighten)
230
224
  } ${percentage}%`;
231
225
  },
@@ -8,7 +8,6 @@ import {
8
8
  isString,
9
9
  isUndefined,
10
10
  } from 'lodash';
11
- import { IReqorePanelAction } from '../components/Panel';
12
11
  import { NUMBER_TO_SIZE, SIZES, SIZE_TO_NUMBER, TSizes } from '../constants/sizes';
13
12
 
14
13
  export const sleep = async (ms: number) => await new Promise((r) => setTimeout(r, ms));
@@ -89,20 +88,3 @@ export const getOneLessSize = (size: TSizes): TSizes => {
89
88
  // Get the size name from the number
90
89
  return NUMBER_TO_SIZE[oneLessSizeNumber];
91
90
  };
92
-
93
- export const isActionShown = (action: IReqorePanelAction) => action.show !== false;
94
-
95
- export const alignToFlexAlign = (
96
- align: 'left' | 'right' | 'center'
97
- ): 'flex-start' | 'center' | 'flex-end' => {
98
- switch (align) {
99
- case 'left':
100
- return 'flex-start';
101
- case 'right':
102
- return 'flex-end';
103
- case 'center':
104
- return 'center';
105
- default:
106
- return 'flex-start';
107
- }
108
- };
@@ -2,8 +2,8 @@ import { useContext, useMemo } from 'react';
2
2
  import { ReqoreContext } from '..';
3
3
 
4
4
  const useLatestZIndex = (): number => {
5
- const { getAndIncreaseZIndex, latestZIndex } = useContext(ReqoreContext);
6
- const zIndex = useMemo(() => getAndIncreaseZIndex(), [latestZIndex]);
5
+ const { getAndIncreaseZIndex } = useContext(ReqoreContext);
6
+ const zIndex = useMemo(() => getAndIncreaseZIndex(), []);
7
7
 
8
8
  return zIndex;
9
9
  };
@@ -11,7 +11,6 @@ import {
11
11
  IWithReqoreMinimal,
12
12
  } from '../types/global';
13
13
  import { IReqoreIconName } from '../types/icons';
14
- import { useReqore } from './useReqore';
15
14
 
16
15
  const startEvents = {
17
16
  hover: 'mouseenter',
@@ -45,7 +44,6 @@ export interface IPopover
45
44
  show?: boolean;
46
45
  openOnMount?: boolean;
47
46
  noArrow?: boolean;
48
- noWrapper?: boolean;
49
47
  useTargetWidth?: boolean;
50
48
  closeOnOutsideClick?: boolean;
51
49
  closeOnAnyClick?: boolean;
@@ -78,7 +76,6 @@ const usePopover = ({
78
76
  }: IPopoverOptions): IPopoverControls => {
79
77
  const { addPopover, removePopover, updatePopover, popovers, isPopoverOpen } =
80
78
  useContext(PopoverContext);
81
- const { tooltips } = useReqore();
82
79
  const { current }: MutableRefObject<string> = useRef(shortid.generate());
83
80
  let { current: timeout }: MutableRefObject<any> = useRef(0);
84
81
 
@@ -98,11 +95,11 @@ const usePopover = ({
98
95
  noArrow,
99
96
  useTargetWidth,
100
97
  closeOnOutsideClick,
101
- closeOnAnyClick: handler === 'hover',
98
+ closeOnAnyClick: handler === 'hover' || handler === 'hoverStay',
102
99
  ...rest,
103
100
  });
104
101
 
105
- if (rest.blur > 0) {
102
+ if (rest?.blur > 0) {
106
103
  targetElement.style.position = 'relative';
107
104
  targetElement.style.zIndex = '999999';
108
105
  }
@@ -111,13 +108,13 @@ const usePopover = ({
111
108
  const _addPopover = () => {
112
109
  if (currentPopover) {
113
110
  if (handler !== 'hoverStay' && handler !== 'focus') {
114
- _removePopover();
111
+ _removePopover?.();
115
112
  }
116
113
  } else if (show) {
117
- if (delay || tooltips.delay) {
114
+ if (delay) {
118
115
  timeout = setTimeout(() => {
119
116
  openPopover();
120
- }, delay || tooltips.delay);
117
+ }, delay);
121
118
  } else {
122
119
  openPopover();
123
120
  }
@@ -144,7 +141,7 @@ const usePopover = ({
144
141
  noArrow,
145
142
  useTargetWidth,
146
143
  closeOnOutsideClick,
147
- closeOnAnyClick: handler === 'hover',
144
+ closeOnAnyClick: handler === 'hover' || handler === 'hoverStay',
148
145
  ...rest,
149
146
  });
150
147
  }
@@ -32,8 +32,6 @@ export default [
32
32
  tooltip: 'This is a test item',
33
33
  headerSize: 2,
34
34
  contentSize: 'huge',
35
- selected: true,
36
- icon: 'Hashtag',
37
35
  content:
38
36
  'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
39
37
  tags: [
@@ -53,21 +51,13 @@ export default [
53
51
  },
54
52
  {
55
53
  icon: 'TextWrap',
56
- label: 'Small item that is not minimal',
54
+ label: 'Item that is not minimal',
57
55
  tooltip: 'This is a test item',
58
- size: 'small',
59
56
  content:
60
57
  'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
61
58
  minimal: false,
62
59
  badge: 0,
63
60
  },
64
- {
65
- icon: 'ZcoolLine',
66
- label: 'Item without fade',
67
- content:
68
- 'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long Hello I am a test item content and I am very long so will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long Hello I am a test item content and I am very long so will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
69
- showContentFade: false,
70
- },
71
61
  {
72
62
  icon: 'FolderWarningFill',
73
63
  label: 'Expandable item',
@@ -92,7 +82,6 @@ export default [
92
82
  {
93
83
  label: 'Item with custom content when expanded',
94
84
  tooltip: 'Expandable item with custom content',
95
- selected: true,
96
85
  content:
97
86
  'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
98
87
  expandable: true,
@@ -105,22 +94,6 @@ export default [
105
94
  weight: 'thin',
106
95
  spaced: 2,
107
96
  },
108
- expandedActions: [
109
- {
110
- label: 'Action 1',
111
- id: 'action1',
112
- icon: 'CapsuleFill',
113
- onClick: () => alert('Action 1 clicked'),
114
- position: 'left',
115
- },
116
- {
117
- label: 'Action 2',
118
- id: 'action2',
119
- icon: 'CapsuleFill',
120
- onClick: () => alert('Action 2 clicked'),
121
- position: 'right',
122
- },
123
- ],
124
97
  expandedContent: (
125
98
  <>
126
99
  <ReqoreMessage intent='info'>Hello I am a custom content</ReqoreMessage>
@@ -208,9 +181,6 @@ export default [
208
181
  },
209
182
  {
210
183
  label: 'I have intent!',
211
- transparent: true,
212
- minimal: false,
213
- flat: false,
214
184
  content: (
215
185
  <ReqoreP>
216
186
  'Well would you look at that. Lorem ipsum dolor{' '}
@@ -262,14 +232,13 @@ export default [
262
232
  {
263
233
  label: 'I have actions',
264
234
  content:
265
- 'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long. Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
235
+ 'Hello I am a test item content and I am very long so I will wrap to the next line and I will be very long',
266
236
  actions: [
267
237
  {
268
238
  label: 'Action 1',
269
239
  id: 'action1',
270
240
  icon: 'CapsuleFill',
271
241
  onClick: () => alert('Action 1 clicked'),
272
- show: false,
273
242
  },
274
243
  {
275
244
  label: 'Action 2',