@qoretechnologies/reqore 0.30.7 → 0.30.9

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 (88) hide show
  1. package/CODE_OF_CONDUCT.md +105 -0
  2. package/CONTRIBUTING.MD +78 -0
  3. package/README.md +44 -2
  4. package/SECURITY.md +5 -0
  5. package/__tests__/dropdown.test.tsx +40 -1
  6. package/__tests__/popover.test.tsx +23 -0
  7. package/dist/components/Button/index.d.ts +1 -1
  8. package/dist/components/Button/index.d.ts.map +1 -1
  9. package/dist/components/Button/index.js +4 -1
  10. package/dist/components/Button/index.js.map +1 -1
  11. package/dist/components/ControlGroup/index.js +1 -1
  12. package/dist/components/ControlGroup/index.js.map +1 -1
  13. package/dist/components/Drawer/index.d.ts +1 -1
  14. package/dist/components/Drawer/index.d.ts.map +1 -1
  15. package/dist/components/Dropdown/index.js +1 -1
  16. package/dist/components/Dropdown/index.js.map +1 -1
  17. package/dist/components/Dropdown/list.d.ts +3 -3
  18. package/dist/components/Dropdown/list.d.ts.map +1 -1
  19. package/dist/components/Effect/index.d.ts +9 -9
  20. package/dist/components/Effect/index.d.ts.map +1 -1
  21. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  22. package/dist/components/InternalPopover/index.js +13 -13
  23. package/dist/components/InternalPopover/index.js.map +1 -1
  24. package/dist/components/Message/index.d.ts +3 -3
  25. package/dist/components/Message/index.d.ts.map +1 -1
  26. package/dist/components/Message/index.js +8 -4
  27. package/dist/components/Message/index.js.map +1 -1
  28. package/dist/components/MultiSelect/index.d.ts +1 -1
  29. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  30. package/dist/components/Notifications/index.d.ts +1 -1
  31. package/dist/components/Notifications/index.d.ts.map +1 -1
  32. package/dist/components/Notifications/notification.d.ts +1 -1
  33. package/dist/components/Notifications/notification.d.ts.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 +7 -5
  37. package/dist/components/Panel/index.js.map +1 -1
  38. package/dist/components/Table/index.d.ts +3 -3
  39. package/dist/components/Table/index.d.ts.map +1 -1
  40. package/dist/components/Tabs/content.d.ts +1 -1
  41. package/dist/components/Tabs/content.d.ts.map +1 -1
  42. package/dist/components/Tabs/item.js +1 -1
  43. package/dist/components/Tabs/item.js.map +1 -1
  44. package/dist/components/Tag/index.js +2 -2
  45. package/dist/components/Tag/index.js.map +1 -1
  46. package/dist/constants/sizes.d.ts +2 -2
  47. package/dist/constants/sizes.d.ts.map +1 -1
  48. package/dist/constants/theme.d.ts +1 -1
  49. package/dist/constants/theme.d.ts.map +1 -1
  50. package/dist/containers/PopoverProvider.d.ts.map +1 -1
  51. package/dist/containers/PopoverProvider.js +6 -3
  52. package/dist/containers/PopoverProvider.js.map +1 -1
  53. package/dist/containers/UIProvider.d.ts +1 -0
  54. package/dist/containers/UIProvider.d.ts.map +1 -1
  55. package/dist/containers/UIProvider.js +33 -4
  56. package/dist/containers/UIProvider.js.map +1 -1
  57. package/dist/helpers/utils.js +1 -1
  58. package/dist/hooks/usePopover.d.ts +1 -1
  59. package/dist/hooks/usePopover.d.ts.map +1 -1
  60. package/dist/hooks/usePopover.js +9 -3
  61. package/dist/hooks/usePopover.js.map +1 -1
  62. package/dist/types/global.d.ts +1 -1
  63. package/dist/types/global.d.ts.map +1 -1
  64. package/dist/types/icons.d.ts +1 -1
  65. package/dist/types/icons.d.ts.map +1 -1
  66. package/package.json +1 -1
  67. package/public/logo-dark.png +0 -0
  68. package/public/logo.png +0 -0
  69. package/public/q-symbol.png +0 -0
  70. package/public/qoreLogo-dark.png +0 -0
  71. package/public/qoreLogo.png +0 -0
  72. package/src/components/Button/index.tsx +4 -1
  73. package/src/components/ControlGroup/index.tsx +1 -1
  74. package/src/components/Dropdown/index.tsx +1 -1
  75. package/src/components/InternalPopover/index.tsx +5 -6
  76. package/src/components/Message/index.tsx +127 -117
  77. package/src/components/Panel/index.tsx +55 -40
  78. package/src/components/Tabs/item.tsx +1 -1
  79. package/src/components/Tag/index.tsx +1 -1
  80. package/src/containers/PopoverProvider.tsx +5 -3
  81. package/src/containers/UIProvider.tsx +26 -2
  82. package/src/hooks/usePopover.tsx +13 -4
  83. package/src/stories/Columns/Columns.stories.tsx +83 -10
  84. package/src/stories/Dropdown/Dropdown.stories.tsx +1 -0
  85. package/src/stories/Panel/Panel.stories.tsx +16 -1
  86. package/src/stories/Popover/Popover.stories.tsx +138 -5
  87. package/src/stories/Tag/Tag.stories.tsx +35 -1
  88. package/tests.json +1 -1
@@ -1,10 +1,12 @@
1
1
  import { animated } from '@react-spring/web';
2
- import React, { forwardRef, useEffect, useMemo, useState } from 'react';
2
+ import React, { forwardRef, memo, useEffect, useMemo, useState } from 'react';
3
3
  import { useMount, useUnmount } from 'react-use';
4
4
  import { IReqoreTheme } from '../../constants/theme';
5
5
  import ReqoreThemeProvider from '../../containers/ThemeProvider';
6
6
  import { getColorFromMaybeString } from '../../helpers/colors';
7
+ import { useCombinedRefs } from '../../hooks/useCombinedRefs';
7
8
  import { useReqoreTheme } from '../../hooks/useTheme';
9
+ import { useTooltip } from '../../hooks/useTooltip';
8
10
  import {
9
11
  IReqoreIntent,
10
12
  IWithReqoreCustomTheme,
@@ -12,6 +14,7 @@ import {
12
14
  IWithReqoreMinimal,
13
15
  IWithReqoreOpaque,
14
16
  IWithReqoreSize,
17
+ IWithReqoreTooltip,
15
18
  } from '../../types/global';
16
19
  import { IReqoreIconName } from '../../types/icons';
17
20
  import { TReqoreEffectColor } from '../Effect';
@@ -32,6 +35,7 @@ export interface IReqoreMessageProps
32
35
  IReqoreIntent,
33
36
  IWithReqoreMinimal,
34
37
  IWithReqoreOpaque,
38
+ IWithReqoreTooltip,
35
39
  React.HTMLAttributes<HTMLDivElement> {
36
40
  title?: string;
37
41
  children: any;
@@ -51,130 +55,136 @@ export interface IReqoreNotificationStyle extends IReqoreMessageProps {
51
55
  timeout?: number;
52
56
  }
53
57
 
54
- const ReqoreMessage = forwardRef<HTMLDivElement, IReqoreMessageProps>(
55
- (
56
- {
57
- intent,
58
- icon,
59
- title,
60
- children,
61
- onClose,
62
- onClick,
63
- duration,
64
- onFinish,
65
- flat,
66
- minimal,
67
- size = 'normal',
68
- customTheme,
69
- iconColor,
70
- ...rest
71
- },
72
- ref: any
73
- ) => {
74
- const [internalTimeout, setInternalTimeout] = useState<NodeJS.Timeout | null>(null);
75
- const theme = useReqoreTheme('main', customTheme, intent);
58
+ const ReqoreMessage = memo(
59
+ forwardRef<HTMLDivElement, IReqoreMessageProps>(
60
+ (
61
+ {
62
+ intent,
63
+ icon,
64
+ title,
65
+ children,
66
+ onClose,
67
+ onClick,
68
+ duration,
69
+ onFinish,
70
+ flat,
71
+ minimal,
72
+ size = 'normal',
73
+ customTheme,
74
+ iconColor,
75
+ tooltip,
76
+ ...rest
77
+ },
78
+ ref
79
+ ) => {
80
+ const [internalTimeout, setInternalTimeout] = useState<NodeJS.Timeout | null>(null);
81
+ const theme = useReqoreTheme('main', customTheme, intent);
82
+ const { targetRef } = useCombinedRefs(ref);
76
83
 
77
- useMount(() => {
78
- if (duration) {
79
- setInternalTimeout(
80
- setTimeout(() => {
81
- onFinish && onFinish();
82
- }, duration)
83
- );
84
- }
85
- });
84
+ useTooltip(targetRef.current, tooltip);
86
85
 
87
- useEffect(() => {
88
- if (internalTimeout) {
89
- clearTimeout(internalTimeout);
90
- setInternalTimeout(
91
- setTimeout(() => {
92
- onFinish && onFinish();
93
- }, duration)
94
- );
95
- }
96
- }, [duration, intent, children, title]);
86
+ useMount(() => {
87
+ if (duration) {
88
+ setInternalTimeout(
89
+ setTimeout(() => {
90
+ onFinish && onFinish();
91
+ }, duration)
92
+ );
93
+ }
94
+ });
97
95
 
98
- useUnmount(() => {
99
- if (internalTimeout) {
100
- clearTimeout(internalTimeout);
101
- }
102
- });
96
+ useEffect(() => {
97
+ if (internalTimeout) {
98
+ clearTimeout(internalTimeout);
99
+ setInternalTimeout(
100
+ setTimeout(() => {
101
+ onFinish && onFinish();
102
+ }, duration)
103
+ );
104
+ }
105
+ }, [duration, intent, children, title]);
103
106
 
104
- const leftIcon: IReqoreIconName | undefined = useMemo(
105
- () => icon || (intent ? typeToIcon[intent] : undefined),
106
- [icon, intent]
107
- );
107
+ useUnmount(() => {
108
+ if (internalTimeout) {
109
+ clearTimeout(internalTimeout);
110
+ }
111
+ });
108
112
 
109
- return (
110
- <ReqoreThemeProvider>
111
- <StyledReqoreNotification
112
- {...rest}
113
- effect={{
114
- interactive: !!onClick,
115
- ...rest?.effect,
116
- }}
117
- as={animated.div}
118
- key={`${duration}${intent}${title}${children}`}
119
- intent={intent}
120
- timeout={duration}
121
- clickable={!!onClick}
122
- onClick={onClick}
123
- flat={flat}
124
- minimal={minimal}
125
- asMessage
126
- fluid
127
- className={`${rest?.className || ''} reqore-message`}
128
- ref={ref}
129
- size={size}
130
- theme={theme}
131
- >
132
- {leftIcon ? (
133
- <StyledIconWrapper intent={intent} size={size} theme={theme}>
134
- <ReqoreIcon
135
- icon={leftIcon}
136
- margin={flat && minimal ? 'right' : 'both'}
137
- size={size}
138
- color={iconColor}
139
- />
140
- </StyledIconWrapper>
141
- ) : null}
142
- <StyledNotificationContentWrapper size={size} theme={theme}>
143
- {title && (
144
- <ReqoreHeading
113
+ const leftIcon: IReqoreIconName | undefined = useMemo(
114
+ () => icon || (intent ? typeToIcon[intent] : undefined),
115
+ [icon, intent]
116
+ );
117
+
118
+ return (
119
+ <ReqoreThemeProvider>
120
+ <StyledReqoreNotification
121
+ {...rest}
122
+ effect={{
123
+ interactive: !!onClick,
124
+ ...rest?.effect,
125
+ }}
126
+ as={animated.div}
127
+ key={`${duration}${intent}${title}${children}`}
128
+ intent={intent}
129
+ timeout={duration}
130
+ clickable={!!onClick}
131
+ onClick={onClick}
132
+ flat={flat}
133
+ minimal={minimal}
134
+ asMessage
135
+ fluid
136
+ className={`${rest?.className || ''} reqore-message`}
137
+ ref={targetRef}
138
+ size={size}
139
+ theme={theme}
140
+ >
141
+ {leftIcon ? (
142
+ <StyledIconWrapper intent={intent} size={size} theme={theme}>
143
+ <ReqoreIcon
144
+ icon={leftIcon}
145
+ margin={flat && minimal ? 'right' : 'both'}
146
+ size={size}
147
+ color={iconColor}
148
+ />
149
+ </StyledIconWrapper>
150
+ ) : null}
151
+ <StyledNotificationContentWrapper size={size} theme={theme}>
152
+ {title && (
153
+ <ReqoreHeading
154
+ size={size}
155
+ customTheme={
156
+ rest.effect?.color
157
+ ? { text: { color: getColorFromMaybeString(theme, rest.effect.color) } }
158
+ : undefined
159
+ }
160
+ >
161
+ {title}
162
+ </ReqoreHeading>
163
+ )}
164
+ <StyledNotificationContent theme={theme} hasTitle={!!title} size={size}>
165
+ {children}
166
+ </StyledNotificationContent>
167
+ </StyledNotificationContentWrapper>
168
+ {onClose && (
169
+ <StyledIconWrapper
170
+ theme={theme}
145
171
  size={size}
146
- customTheme={
147
- rest.effect?.color
148
- ? { text: { color: getColorFromMaybeString(theme, rest.effect.color) } }
149
- : undefined
150
- }
172
+ intent={intent}
173
+ clickable
174
+ className='reqore-message-close'
175
+ onClick={(event) => {
176
+ event.stopPropagation();
177
+ onClose && onClose();
178
+ }}
151
179
  >
152
- {title}
153
- </ReqoreHeading>
180
+ <ReqoreIcon icon='CloseFill' margin='both' size={size} />
181
+ </StyledIconWrapper>
154
182
  )}
155
- <StyledNotificationContent theme={theme} hasTitle={!!title} size={size}>
156
- {children}
157
- </StyledNotificationContent>
158
- </StyledNotificationContentWrapper>
159
- {onClose && (
160
- <StyledIconWrapper
161
- theme={theme}
162
- size={size}
163
- intent={intent}
164
- clickable
165
- className='reqore-message-close'
166
- onClick={(event) => {
167
- event.stopPropagation();
168
- onClose && onClose();
169
- }}
170
- >
171
- <ReqoreIcon icon='CloseFill' margin='both' size={size} />
172
- </StyledIconWrapper>
173
- )}
174
- </StyledReqoreNotification>
175
- </ReqoreThemeProvider>
176
- );
177
- }
183
+ </StyledReqoreNotification>
184
+ </ReqoreThemeProvider>
185
+ );
186
+ }
187
+ )
178
188
  );
179
189
 
180
190
  export default ReqoreMessage;
@@ -1,6 +1,6 @@
1
1
  import { size } from 'lodash';
2
2
  import { darken, rgba } from 'polished';
3
- import { ReactElement, forwardRef, useCallback, useMemo, useState } from 'react';
3
+ import { forwardRef, ReactElement, useCallback, useMemo, useState } from 'react';
4
4
  import { useUpdateEffect } from 'react-use';
5
5
  import styled, { css } from 'styled-components';
6
6
  import {
@@ -98,6 +98,7 @@ export interface IReqorePanelProps
98
98
  headerEffect?: IReqoreEffect;
99
99
  transparent?: boolean;
100
100
  iconColor?: TReqoreEffectColor;
101
+ responsiveActions?: boolean;
101
102
  }
102
103
 
103
104
  export interface IStyledPanel extends IReqorePanelProps {
@@ -286,6 +287,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
286
287
  badge,
287
288
  iconColor,
288
289
  fluid,
290
+ responsiveActions = true,
289
291
  size: panelSize = 'normal',
290
292
  ...rest
291
293
  }: IReqorePanelProps,
@@ -316,7 +318,13 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
316
318
  !!size(actions.filter(isActionShown)) ||
317
319
  !!badge ||
318
320
  !!icon,
319
- [label, collapsible, onClose, actions, badge]
321
+ [label, collapsible, onClose, actions, badge, icon]
322
+ );
323
+
324
+ // Return true if the card has a title bar, otherwise return false.
325
+ const hasTitleHeader: boolean = useMemo(
326
+ () => !!label || !!badge || !!icon,
327
+ [label, icon, badge]
320
328
  );
321
329
 
322
330
  // If collapsible is true, toggle the isCollapsed state
@@ -524,45 +532,47 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
524
532
  opacity={opacity ?? (minimal ? 0 : 1)}
525
533
  noHorizontalPadding={noHorizontalPadding}
526
534
  >
527
- <StyledPanelTitleHeader>
528
- {icon && (
529
- <ReqoreIcon
530
- size={`${
531
- ICON_FROM_HEADER_SIZE[headerSize || HEADER_SIZE_TO_NUMBER[panelSize]]
532
- }px`}
533
- icon={icon}
534
- margin='right'
535
- color={iconColor}
536
- />
537
- )}
538
- {typeof label === 'string' ? (
539
- <ReqoreHeading
540
- size={headerSize || panelSize}
541
- customTheme={theme}
542
- effect={{
543
- noWrap: true,
544
- ...headerEffect,
545
- }}
546
- >
547
- {label}
548
- </ReqoreHeading>
549
- ) : (
550
- label
551
- )}
552
- {badge || badge === 0 ? (
553
- <>
554
- <ButtonBadge
555
- color={changeLightness(theme.main, 0.18)}
556
- size={panelSize}
557
- content={badge}
535
+ {hasTitleHeader && (
536
+ <StyledPanelTitleHeader>
537
+ {icon && (
538
+ <ReqoreIcon
539
+ size={`${
540
+ ICON_FROM_HEADER_SIZE[headerSize || HEADER_SIZE_TO_NUMBER[panelSize]]
541
+ }px`}
542
+ icon={icon}
543
+ margin='right'
544
+ color={iconColor}
558
545
  />
559
- <ReqoreSpacer width={PADDING_FROM_SIZE.normal} />
560
- </>
561
- ) : null}
562
- </StyledPanelTitleHeader>
546
+ )}
547
+ {typeof label === 'string' ? (
548
+ <ReqoreHeading
549
+ size={headerSize || panelSize}
550
+ customTheme={theme}
551
+ effect={{
552
+ noWrap: true,
553
+ ...headerEffect,
554
+ }}
555
+ >
556
+ {label}
557
+ </ReqoreHeading>
558
+ ) : (
559
+ label
560
+ )}
561
+ {badge || badge === 0 ? (
562
+ <>
563
+ <ButtonBadge
564
+ color={changeLightness(theme.main, 0.18)}
565
+ size={panelSize}
566
+ content={badge}
567
+ />
568
+ <ReqoreSpacer width={PADDING_FROM_SIZE.normal} />
569
+ </>
570
+ ) : null}
571
+ </StyledPanelTitleHeader>
572
+ )}
563
573
  {hasResponsiveActions(actions) && (
564
574
  <ReqoreControlGroup
565
- responsive
575
+ responsive={responsiveActions}
566
576
  fluid
567
577
  horizontalAlign='flex-end'
568
578
  customTheme={theme}
@@ -634,7 +644,12 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
634
644
  </>
635
645
  ) : null}
636
646
  {hasResponsiveActions(leftBottomActions) && (
637
- <ReqoreControlGroup fluid responsive customTheme={theme} size={panelSize}>
647
+ <ReqoreControlGroup
648
+ fluid
649
+ responsive={responsiveActions}
650
+ customTheme={theme}
651
+ size={panelSize}
652
+ >
638
653
  {leftBottomActions.map(renderResponsiveActions)}
639
654
  </ReqoreControlGroup>
640
655
  )}
@@ -642,7 +657,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
642
657
  <ReqoreControlGroup
643
658
  fluid
644
659
  horizontalAlign='flex-end'
645
- responsive
660
+ responsive={responsiveActions}
646
661
  customTheme={theme}
647
662
  size={panelSize}
648
663
  >
@@ -84,7 +84,7 @@ export const StyledTabListItem = styled.div<IReqoreTabListItemStyle>`
84
84
 
85
85
  ${fill &&
86
86
  css`
87
- flex: 1;
87
+ flex: 1 0 auto;
88
88
  `}
89
89
 
90
90
  ${disabled &&
@@ -86,7 +86,7 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
86
86
  font-size: ${({ size }) => TEXT_FROM_SIZE[size]}px;
87
87
 
88
88
  min-width: ${({ size }) => SIZE_TO_PX[size]}px;
89
- max-width: ${({ fluid, fixed }) => (fluid && !fixed ? '100%' : undefined)};
89
+ max-width: ${({ fixed }) => (!fixed ? '100%' : undefined)};
90
90
  flex: ${({ fluid, fixed }) => (fixed ? '0 0 auto' : fluid ? '1 auto' : '0 0 auto')};
91
91
  align-self: ${({ fixed, fluid }) => (fixed ? 'flex-start' : fluid ? 'stretch' : undefined)};
92
92
  border-radius: ${({ asBadge, size }) => (asBadge ? 18 : RADIUS_FROM_SIZE[size])}px;
@@ -59,9 +59,11 @@ const PopoverProvider: React.FC<IReqorePopoverProviderProps> = ({ children, uiSc
59
59
 
60
60
  if (popover) {
61
61
  // Remove the blur
62
- if (popover.blur > 0) {
63
- popover.targetElement.style.position = 'initial';
64
- popover.targetElement.style.zIndex = 'initial';
62
+ if (popover.blur) {
63
+ // Remove the blur
64
+ document.getElementById(`reqore-blur-${id}`)?.remove();
65
+ // Remove the z index class
66
+ popover.targetElement.classList.remove('reqore-blur-z-index');
65
67
  }
66
68
  // Remove the popover
67
69
  setPopovers((cur: IPopoverData[]) => [...cur].filter((p) => p.id !== id));
@@ -1,14 +1,16 @@
1
1
  import { cloneDeep } from 'lodash';
2
2
  import merge from 'lodash/merge';
3
+ import { rgba } from 'polished';
3
4
  import React, { useState } from 'react';
4
- import styled from 'styled-components';
5
+ import styled, { createGlobalStyle } from 'styled-components';
5
6
  import ReqoreLayoutWrapper from '../components/Layout';
6
7
  import { IReqoreNotificationsPosition } from '../components/Notifications';
7
8
  import { DEFAULT_THEME, IReqoreTheme } from '../constants/theme';
8
9
  import ThemeContext from '../context/ThemeContext';
9
- import { buildTheme } from '../helpers/colors';
10
+ import { buildTheme, getMainBackgroundColor } from '../helpers/colors';
10
11
  import PopoverProvider from './PopoverProvider';
11
12
  import ReqoreProvider from './ReqoreProvider';
13
+ import ReqoreThemeProvider from './ThemeProvider';
12
14
 
13
15
  export interface IReqoreOptions {
14
16
  withSidebar?: boolean;
@@ -22,6 +24,7 @@ export interface IReqoreOptions {
22
24
  /**
23
25
  * Delay in ms before showing the tooltip
24
26
  * @default 0
27
+ * Works only for `hover` handler
25
28
  * */
26
29
  delay?: number;
27
30
  };
@@ -33,6 +36,24 @@ export interface IReqoreUIProviderProps {
33
36
  options?: IReqoreOptions;
34
37
  }
35
38
 
39
+ const GlobalStyle = createGlobalStyle`
40
+ .reqore-blur-wrapper {
41
+ position: fixed;
42
+ top: 0;
43
+ left: 0;
44
+ right: 0;
45
+ bottom: 0;
46
+ z-index: 999998;
47
+ cursor: pointer;
48
+ background-color: ${({ theme }) => rgba(getMainBackgroundColor(theme), 0.3)};
49
+ backdrop-filter: blur(3px);
50
+ }
51
+
52
+ .reqore-blur-z-index {
53
+ z-index: 999999;
54
+ }
55
+ `;
56
+
36
57
  const StyledPortal = styled.div`
37
58
  z-index: 9999;
38
59
  * {
@@ -50,6 +71,9 @@ const ReqoreUIProvider: React.FC<IReqoreUIProviderProps> = ({ children, theme, o
50
71
  return (
51
72
  <>
52
73
  <ThemeContext.Provider value={{ ...rebuiltTheme }}>
74
+ <ReqoreThemeProvider>
75
+ <GlobalStyle />
76
+ </ReqoreThemeProvider>
53
77
  <ReqoreLayoutWrapper withSidebar={options?.withSidebar}>
54
78
  {modalPortal ? (
55
79
  <ReqoreProvider options={options}>
@@ -50,7 +50,7 @@ export interface IPopover
50
50
  closeOnOutsideClick?: boolean;
51
51
  closeOnAnyClick?: boolean;
52
52
  delay?: number;
53
- blur?: number;
53
+ blur?: boolean;
54
54
  transparent?: boolean;
55
55
  maxWidth?: string;
56
56
  maxHeight?: string;
@@ -102,9 +102,18 @@ const usePopover = ({
102
102
  ...rest,
103
103
  });
104
104
 
105
- if (rest.blur > 0) {
106
- targetElement.style.position = 'relative';
107
- targetElement.style.zIndex = '999999';
105
+ if (rest.blur) {
106
+ // Create a div and prepend before the targetElement
107
+ const blurDiv = document.createElement('div');
108
+
109
+ blurDiv.id = `reqore-blur-${current}`;
110
+ blurDiv.classList.add('reqore-blur-wrapper');
111
+
112
+ // Add the blur div before the target element
113
+ targetElement.before(blurDiv);
114
+
115
+ // Add the highest z-index to the target element
116
+ targetElement.classList.add('reqore-blur-z-index');
108
117
  }
109
118
  };
110
119
 
@@ -1,6 +1,14 @@
1
1
  import { Meta, Story } from '@storybook/react';
2
2
  import { IReqoreColumnsProps } from '../../components/Columns';
3
- import { ReqoreColumn, ReqoreColumns } from '../../index';
3
+ import {
4
+ ReqoreButton,
5
+ ReqoreColumn,
6
+ ReqoreColumns,
7
+ ReqoreControlGroup,
8
+ ReqoreH2,
9
+ ReqoreInput,
10
+ ReqoreVerticalSpacer,
11
+ } from '../../index';
4
12
  import { argManager } from '../utils/args';
5
13
 
6
14
  export interface IColumnsStoryArgs extends IReqoreColumnsProps {
@@ -43,20 +51,74 @@ export default {
43
51
 
44
52
  const Template: Story<IColumnsStoryArgs> = (args) => {
45
53
  return (
46
- <ReqoreColumns {...args}>
47
- <ReqoreColumn {...args} style={{ border: '1px solid white', padding: '10px' }}>
48
- 1st column
54
+ <ReqoreColumns {...args} columnsGap='10px'>
55
+ <ReqoreColumn
56
+ {...args}
57
+ style={{ border: '1px solid white', padding: '10px' }}
58
+ flexFlow='column'
59
+ >
60
+ <ReqoreH2>Left Column</ReqoreH2>
61
+ <ReqoreVerticalSpacer height={20} lineSize='tiny' />
62
+ <ReqoreControlGroup fluid>
63
+ <ReqoreInput placeholder='Filter' />
64
+ </ReqoreControlGroup>
65
+ <ReqoreVerticalSpacer height={10} />
66
+ <ReqoreControlGroup vertical fluid>
67
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
68
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
69
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
70
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
71
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
72
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
73
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
74
+ </ReqoreControlGroup>
49
75
  </ReqoreColumn>
50
- <ReqoreColumn {...args} style={{ border: '1px solid white', padding: '10px' }}>
51
- 2nd column
76
+ <ReqoreColumn
77
+ {...args}
78
+ style={{ border: '1px solid white', padding: '10px' }}
79
+ flexFlow='column'
80
+ >
81
+ <ReqoreH2>Right Column</ReqoreH2>
82
+ <ReqoreVerticalSpacer height={20} lineSize='tiny' />
83
+ <ReqoreControlGroup fluid>
84
+ <ReqoreInput placeholder='Filter' />
85
+ </ReqoreControlGroup>
86
+ <ReqoreVerticalSpacer height={10} />
87
+ <ReqoreControlGroup vertical fluid>
88
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
89
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
90
+ </ReqoreControlGroup>
52
91
  </ReqoreColumn>
53
92
  {args.multipleColumns && (
54
93
  <>
55
- <ReqoreColumn {...args} style={{ border: '1px solid white', padding: '10px' }}>
56
- 4th column
94
+ <ReqoreColumn
95
+ {...args}
96
+ style={{ border: '1px solid white', padding: '10px' }}
97
+ flexFlow='column'
98
+ >
99
+ <ReqoreH2>3rd Column</ReqoreH2>
100
+ <ReqoreVerticalSpacer height={20} lineSize='tiny' />
101
+ <ReqoreControlGroup fluid>
102
+ <ReqoreInput placeholder='Filter' />
103
+ </ReqoreControlGroup>
104
+ <ReqoreVerticalSpacer height={10} />
105
+ <ReqoreControlGroup vertical fluid>
106
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
107
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
108
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
109
+ <ReqoreButton description='This is a button'>Button</ReqoreButton>
110
+ </ReqoreControlGroup>
57
111
  </ReqoreColumn>
58
- <ReqoreColumn {...args} style={{ border: '1px solid white', padding: '10px' }}>
59
- 3rd column
112
+ <ReqoreColumn
113
+ {...args}
114
+ style={{ border: '1px solid white', padding: '10px' }}
115
+ flexFlow='column'
116
+ >
117
+ <ReqoreH2>4th Column</ReqoreH2>
118
+ <ReqoreVerticalSpacer height={20} lineSize='tiny' />
119
+ <ReqoreControlGroup fluid>
120
+ <ReqoreInput placeholder='Filter' />
121
+ </ReqoreControlGroup>
60
122
  </ReqoreColumn>
61
123
  </>
62
124
  )}
@@ -69,3 +131,14 @@ export const MultipleColumns = Template.bind({});
69
131
  MultipleColumns.args = {
70
132
  multipleColumns: true,
71
133
  };
134
+ export const CustomAlignment = Template.bind({});
135
+ CustomAlignment.args = {
136
+ multipleColumns: true,
137
+ alignItems: 'center',
138
+ };
139
+
140
+ export const WithMinimumWidth = Template.bind({});
141
+ WithMinimumWidth.args = {
142
+ multipleColumns: true,
143
+ minColumnWidth: '500px',
144
+ };