@qoretechnologies/reqore 0.37.0 → 0.37.2
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.
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js +2 -2
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Drawer/backdrop.d.ts +10 -0
- package/dist/components/Drawer/backdrop.d.ts.map +1 -0
- package/dist/components/Drawer/backdrop.js +64 -0
- package/dist/components/Drawer/backdrop.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +0 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +4 -20
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/ExportModal/index.d.ts.map +1 -1
- package/dist/components/ExportModal/index.js +1 -1
- package/dist/components/ExportModal/index.js.map +1 -1
- package/dist/components/Navbar/index.d.ts.map +1 -1
- package/dist/components/Navbar/index.js +1 -1
- package/dist/components/Navbar/index.js.map +1 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +2 -2
- package/dist/components/Sidebar/index.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/item.d.ts.map +1 -1
- package/dist/components/Tabs/item.js +2 -3
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +41 -13
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tree/index.d.ts +4 -0
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +16 -4
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +50 -48
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +3 -4
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/helpers/utils.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Collection/item.tsx +4 -5
- package/src/components/Drawer/backdrop.tsx +48 -0
- package/src/components/Drawer/index.tsx +4 -23
- package/src/components/ExportModal/index.tsx +1 -0
- package/src/components/Navbar/index.tsx +1 -0
- package/src/components/Sidebar/index.tsx +3 -4
- package/src/components/Tabs/index.tsx +1 -1
- package/src/components/Tabs/item.tsx +2 -5
- package/src/components/Tabs/list.tsx +70 -21
- package/src/components/Tree/index.tsx +18 -3
- package/src/containers/ReqoreProvider.tsx +94 -87
- package/src/containers/UIProvider.tsx +4 -8
- package/src/helpers/utils.ts +1 -1
- package/src/index.tsx +1 -0
- package/src/stories/Drawer/Drawer.stories.tsx +5 -1
- package/src/stories/Modal/Manager.stories.tsx +26 -1
- package/src/stories/Tabs/Tabs.stories.tsx +2 -2
- package/tests.json +1 -1
|
@@ -8,7 +8,6 @@ import { IReqoreNotificationsPosition } from '../components/Notifications';
|
|
|
8
8
|
import { DEFAULT_THEME, IReqoreTheme } from '../constants/theme';
|
|
9
9
|
import ThemeContext from '../context/ThemeContext';
|
|
10
10
|
import { buildTheme, getMainBackgroundColor, getReadableColor } from '../helpers/colors';
|
|
11
|
-
import PopoverProvider from './PopoverProvider';
|
|
12
11
|
import ReqoreProvider from './ReqoreProvider';
|
|
13
12
|
import ReqoreThemeProvider from './ThemeProvider';
|
|
14
13
|
|
|
@@ -43,19 +42,20 @@ const GlobalStyle = createGlobalStyle`
|
|
|
43
42
|
left: 0;
|
|
44
43
|
right: 0;
|
|
45
44
|
bottom: 0;
|
|
46
|
-
z-index:
|
|
45
|
+
z-index: 8998;
|
|
47
46
|
cursor: pointer;
|
|
48
47
|
background-color: ${({ theme }) => rgba(getMainBackgroundColor(theme), 0.3)};
|
|
49
48
|
backdrop-filter: blur(3px);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
.reqore-blur-z-index {
|
|
53
|
-
z-index:
|
|
52
|
+
z-index: 8999;
|
|
54
53
|
}
|
|
55
54
|
`;
|
|
56
55
|
|
|
57
56
|
const StyledPortal = styled.div`
|
|
58
57
|
z-index: 9999;
|
|
58
|
+
position: relative;
|
|
59
59
|
|
|
60
60
|
* {
|
|
61
61
|
box-sizing: border-box;
|
|
@@ -88,11 +88,7 @@ const ReqoreUIProvider: React.FC<IReqoreUIProviderProps> = ({ children, theme, o
|
|
|
88
88
|
<GlobalStyle />
|
|
89
89
|
</ReqoreThemeProvider>
|
|
90
90
|
<ReqoreLayoutWrapper withSidebar={options?.withSidebar}>
|
|
91
|
-
{modalPortal ?
|
|
92
|
-
<ReqoreProvider options={options}>
|
|
93
|
-
<PopoverProvider uiScale={options?.uiScale}>{children}</PopoverProvider>
|
|
94
|
-
</ReqoreProvider>
|
|
95
|
-
) : null}
|
|
91
|
+
{modalPortal ? <ReqoreProvider options={options}>{children}</ReqoreProvider> : null}
|
|
96
92
|
</ReqoreLayoutWrapper>
|
|
97
93
|
<ReqorePortal ref={setModalPortal} />
|
|
98
94
|
</ThemeContext.Provider>
|
package/src/helpers/utils.ts
CHANGED
|
@@ -86,7 +86,7 @@ export const calculateStringSizeInPixels = (value: string = '', fontSize: number
|
|
|
86
86
|
/* It's calculating the width of a string in pixels. */
|
|
87
87
|
return (
|
|
88
88
|
Array.from(value).reduce((acc, cur) => acc + (widths[cur.charCodeAt(0)] ?? avg), 0) *
|
|
89
|
-
(fontSize * 1.
|
|
89
|
+
(fontSize * 1.35)
|
|
90
90
|
);
|
|
91
91
|
};
|
|
92
92
|
|
package/src/index.tsx
CHANGED
|
@@ -10,6 +10,7 @@ export { ReqoreCommentFeed } from './components/CommentFeed';
|
|
|
10
10
|
export { default as ReqoreContent } from './components/Content';
|
|
11
11
|
export { default as ReqoreControlGroup } from './components/ControlGroup';
|
|
12
12
|
export { ReqoreDrawer } from './components/Drawer';
|
|
13
|
+
export { ReqoreBackdrop } from './components/Drawer/backdrop';
|
|
13
14
|
export { default as ReqoreDropdown } from './components/Dropdown';
|
|
14
15
|
export { ReqoreDropdownDivider, ReqoreDropdownItem } from './components/Dropdown/item';
|
|
15
16
|
export { ReqoreEffect, ReqoreTextEffect } from './components/Effect';
|
|
@@ -4,6 +4,7 @@ import { IReqoreDrawerProps, ReqoreDrawer } from '../../components/Drawer';
|
|
|
4
4
|
import { IReqoreInputProps } from '../../components/Input';
|
|
5
5
|
import {
|
|
6
6
|
ReqoreButton,
|
|
7
|
+
ReqoreCollection,
|
|
7
8
|
ReqoreInput,
|
|
8
9
|
ReqorePanel,
|
|
9
10
|
ReqoreTabs,
|
|
@@ -246,7 +247,10 @@ const Template: StoryFn<typeof ReqoreDrawer> = (args) => {
|
|
|
246
247
|
Hello I am a super long button that opens a modal on click
|
|
247
248
|
</ReqoreButton>
|
|
248
249
|
</ReqoreTabsContent>
|
|
249
|
-
<ReqoreTabsContent tabId='tab2'>
|
|
250
|
+
<ReqoreTabsContent tabId='tab2'>
|
|
251
|
+
Tab 2 here
|
|
252
|
+
<ReqoreCollection items={[{ label: 'Item 1' }, { label: 'Item 2' }]} />
|
|
253
|
+
</ReqoreTabsContent>
|
|
250
254
|
</ReqoreTabs>
|
|
251
255
|
</ReqoreDrawer>
|
|
252
256
|
</>
|
|
@@ -3,8 +3,10 @@ import { StoryObj } from '@storybook/react';
|
|
|
3
3
|
import { fireEvent, waitFor, within } from '@storybook/testing-library';
|
|
4
4
|
import { noop } from 'lodash';
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
|
+
import { ReqoreBackdrop } from '../../components/Drawer/backdrop';
|
|
6
7
|
import {
|
|
7
8
|
ReqoreButton,
|
|
9
|
+
ReqoreCollection,
|
|
8
10
|
ReqoreControlGroup,
|
|
9
11
|
ReqoreInput,
|
|
10
12
|
ReqoreModal,
|
|
@@ -86,11 +88,15 @@ const ModalWithState = (props) => {
|
|
|
86
88
|
intent={props.intent}
|
|
87
89
|
onChange={(e: any) => setText(e.target.value)}
|
|
88
90
|
/>
|
|
89
|
-
<ReqoreButton
|
|
91
|
+
<ReqoreButton
|
|
92
|
+
onClick={() => addModal(<ModalWithState label='Another modal' />)}
|
|
93
|
+
tooltip='Open sesame'
|
|
94
|
+
>
|
|
90
95
|
Open another modal
|
|
91
96
|
</ReqoreButton>
|
|
92
97
|
<ReqoreButton onClick={() => removeModal('modal')}>Remove modal</ReqoreButton>
|
|
93
98
|
</ReqoreControlGroup>
|
|
99
|
+
<ReqoreCollection items={[{ label: 'Item 1' }, { label: 'Item 2' }]} />
|
|
94
100
|
</ReqoreModal>
|
|
95
101
|
);
|
|
96
102
|
};
|
|
@@ -104,6 +110,25 @@ export const FromElement: Story = {
|
|
|
104
110
|
},
|
|
105
111
|
};
|
|
106
112
|
|
|
113
|
+
export const FromCustomElement: Story = {
|
|
114
|
+
args: {
|
|
115
|
+
data: (
|
|
116
|
+
<>
|
|
117
|
+
<ReqoreBackdrop />
|
|
118
|
+
<div
|
|
119
|
+
className='custom-modal reqore-modal'
|
|
120
|
+
style={{ position: 'fixed', left: '50%', top: '50%' }}
|
|
121
|
+
>
|
|
122
|
+
This is a custom modal
|
|
123
|
+
</div>
|
|
124
|
+
</>
|
|
125
|
+
),
|
|
126
|
+
},
|
|
127
|
+
play: async ({ canvasElement, ...rest }) => {
|
|
128
|
+
await FromObject.play({ canvasElement, ...rest });
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
107
132
|
export const CanBeClosed: Story = {
|
|
108
133
|
...FromObject,
|
|
109
134
|
play: async ({ canvasElement, ...rest }) => {
|