@qoretechnologies/reqore 0.37.1 → 0.37.3
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/Button/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +3 -3
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Drawer/backdrop.d.ts.map +1 -1
- package/dist/components/Drawer/backdrop.js +6 -1
- package/dist/components/Drawer/backdrop.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/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +3 -1
- package/dist/components/Notifications/notification.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/Tag/index.d.ts +2 -2
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +6 -6
- package/dist/components/Tag/index.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/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +2 -2
- 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/Button/index.tsx +5 -3
- package/src/components/Drawer/backdrop.tsx +6 -1
- package/src/components/ExportModal/index.tsx +1 -0
- package/src/components/Notifications/notification.tsx +3 -1
- 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/Tag/index.tsx +10 -6
- package/src/components/Tree/index.tsx +18 -3
- package/src/containers/UIProvider.tsx +3 -2
- package/src/helpers/utils.ts +1 -1
- package/src/index.tsx +1 -0
- package/src/stories/Modal/Manager.stories.tsx +1 -1
- package/src/stories/Tabs/Tabs.stories.tsx +2 -2
- package/src/stories/Tag/Tag.stories.tsx +6 -0
- package/tests.json +1 -1
|
@@ -24,6 +24,7 @@ import { ActiveIconScale, InactiveIconScale } from '../../styles';
|
|
|
24
24
|
import {
|
|
25
25
|
IReqoreDisabled,
|
|
26
26
|
IReqoreIntent,
|
|
27
|
+
IWithReqoreCustomTheme,
|
|
27
28
|
IWithReqoreEffect,
|
|
28
29
|
IWithReqoreFluid,
|
|
29
30
|
IWithReqoreMinimal,
|
|
@@ -51,7 +52,8 @@ export interface IReqoreTagProps
|
|
|
51
52
|
IReqoreDisabled,
|
|
52
53
|
IWithReqoreMinimal,
|
|
53
54
|
IWithReqoreFluid,
|
|
54
|
-
IWithReqoreEffect
|
|
55
|
+
IWithReqoreEffect,
|
|
56
|
+
IWithReqoreCustomTheme {
|
|
55
57
|
fixed?: boolean | 'key' | 'label';
|
|
56
58
|
size?: TSizes;
|
|
57
59
|
label?: string | number;
|
|
@@ -116,10 +118,10 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
|
|
|
116
118
|
css`
|
|
117
119
|
background-color: ${color || changeLightness(theme.main, 0.1)};
|
|
118
120
|
color: ${minimal
|
|
119
|
-
? getReadableColor(theme, undefined, undefined, true
|
|
121
|
+
? getReadableColor(theme, undefined, undefined, true)
|
|
120
122
|
: color
|
|
121
123
|
? getReadableColorFrom(color)
|
|
122
|
-
:
|
|
124
|
+
: getReadableColorFrom(changeLightness(theme.main, 0.1))};
|
|
123
125
|
|
|
124
126
|
${StyledTagKeyWrapper} {
|
|
125
127
|
background-color: ${labelKey ? rgba('#000000', 0.2) : undefined};
|
|
@@ -251,6 +253,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
251
253
|
intent,
|
|
252
254
|
color,
|
|
253
255
|
minimal,
|
|
256
|
+
customTheme,
|
|
254
257
|
wrap = false,
|
|
255
258
|
width,
|
|
256
259
|
leftIconColor,
|
|
@@ -263,7 +266,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
263
266
|
ref
|
|
264
267
|
) => {
|
|
265
268
|
const { targetRef } = useCombinedRefs(ref);
|
|
266
|
-
const theme: IReqoreTheme = useReqoreTheme();
|
|
269
|
+
const theme: IReqoreTheme = useReqoreTheme('main', customTheme);
|
|
267
270
|
const [itemRef, setItemRef] = useState<HTMLDivElement>(undefined);
|
|
268
271
|
|
|
269
272
|
useTooltip(itemRef, tooltip);
|
|
@@ -282,6 +285,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
282
285
|
return (
|
|
283
286
|
<StyledTag
|
|
284
287
|
{...rest}
|
|
288
|
+
theme={theme}
|
|
285
289
|
effect={{
|
|
286
290
|
...rest.effect,
|
|
287
291
|
gradient: intent ? undefined : rest.effect?.gradient,
|
|
@@ -317,7 +321,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
317
321
|
<ReqoreIcon
|
|
318
322
|
icon={icon}
|
|
319
323
|
size={size}
|
|
320
|
-
margin={label ? 'left' : 'both'}
|
|
324
|
+
margin={label || labelKey ? 'left' : 'both'}
|
|
321
325
|
color={leftIconColor || iconColor}
|
|
322
326
|
/>
|
|
323
327
|
)}
|
|
@@ -364,7 +368,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
364
368
|
<ReqoreIcon
|
|
365
369
|
icon={rightIcon}
|
|
366
370
|
size={size}
|
|
367
|
-
margin={label || icon ? 'right' : 'both'}
|
|
371
|
+
margin={label || (icon && !labelKey) ? 'right' : 'both'}
|
|
368
372
|
color={rightIconColor || iconColor}
|
|
369
373
|
/>
|
|
370
374
|
)}
|
|
@@ -2,6 +2,7 @@ import { cloneDeep, size as lodashSize } from 'lodash';
|
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { ReqoreMessage, ReqorePanel, useReqoreProperty } from '../..';
|
|
5
|
+
import { GAP_FROM_SIZE, TSizes } from '../../constants/sizes';
|
|
5
6
|
import { IReqoreTheme } from '../../constants/theme';
|
|
6
7
|
import { getTypeFromValue } from '../../helpers/utils';
|
|
7
8
|
import { IWithReqoreSize } from '../../types/global';
|
|
@@ -28,12 +29,21 @@ export interface IReqoreTreeProps extends IReqorePanelProps, IWithReqoreSize {
|
|
|
28
29
|
export interface ITreeStyle {
|
|
29
30
|
interactive?: boolean;
|
|
30
31
|
theme: IReqoreTheme;
|
|
32
|
+
level?: number;
|
|
33
|
+
size?: TSizes;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export const StyledTreeLabel = styled(ReqoreMessage)`
|
|
34
37
|
flex-shrink: 1;
|
|
35
38
|
`;
|
|
36
39
|
|
|
40
|
+
export const StyledTreeWrapper = styled.div<ITreeStyle>`
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-flow: column;
|
|
43
|
+
gap: ${({ size }) => GAP_FROM_SIZE[size]}px;
|
|
44
|
+
margin-left: ${({ level, size }) => (level ? level * GAP_FROM_SIZE[size] : 0)}px;
|
|
45
|
+
`;
|
|
46
|
+
|
|
37
47
|
export const ReqoreTree = ({
|
|
38
48
|
data,
|
|
39
49
|
size = 'normal',
|
|
@@ -98,7 +108,7 @@ export const ReqoreTree = ({
|
|
|
98
108
|
}
|
|
99
109
|
|
|
100
110
|
return (
|
|
101
|
-
<
|
|
111
|
+
<StyledTreeWrapper key={index} size={zoomToSize[zoom]} level={level}>
|
|
102
112
|
{isObject ? (
|
|
103
113
|
<ReqoreControlGroup size={zoomToSize[zoom]}>
|
|
104
114
|
<ReqoreButton
|
|
@@ -113,7 +123,7 @@ export const ReqoreTree = ({
|
|
|
113
123
|
{_showTypes ? <ReqoreTag label={dataType} className='reqore-tree-type' /> : null}
|
|
114
124
|
</ReqoreControlGroup>
|
|
115
125
|
) : (
|
|
116
|
-
<ReqoreControlGroup size={zoomToSize[zoom]}>
|
|
126
|
+
<ReqoreControlGroup size={zoomToSize[zoom]} verticalAlign='flex-start'>
|
|
117
127
|
<ReqoreTag
|
|
118
128
|
label={displayKey}
|
|
119
129
|
actions={
|
|
@@ -148,7 +158,7 @@ export const ReqoreTree = ({
|
|
|
148
158
|
{isExpandable && isObject
|
|
149
159
|
? renderTree(data[key], stateKey, level + 1, [...path, key])
|
|
150
160
|
: null}
|
|
151
|
-
</
|
|
161
|
+
</StyledTreeWrapper>
|
|
152
162
|
);
|
|
153
163
|
});
|
|
154
164
|
};
|
|
@@ -226,6 +236,11 @@ export const ReqoreTree = ({
|
|
|
226
236
|
flat
|
|
227
237
|
transparent
|
|
228
238
|
size={size}
|
|
239
|
+
contentStyle={{
|
|
240
|
+
display: 'flex',
|
|
241
|
+
flexFlow: 'column',
|
|
242
|
+
gap: `${GAP_FROM_SIZE[size]}px`,
|
|
243
|
+
}}
|
|
229
244
|
{...rest}
|
|
230
245
|
actions={actions}
|
|
231
246
|
>
|
|
@@ -42,19 +42,20 @@ const GlobalStyle = createGlobalStyle`
|
|
|
42
42
|
left: 0;
|
|
43
43
|
right: 0;
|
|
44
44
|
bottom: 0;
|
|
45
|
-
z-index:
|
|
45
|
+
z-index: 8998;
|
|
46
46
|
cursor: pointer;
|
|
47
47
|
background-color: ${({ theme }) => rgba(getMainBackgroundColor(theme), 0.3)};
|
|
48
48
|
backdrop-filter: blur(3px);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.reqore-blur-z-index {
|
|
52
|
-
z-index:
|
|
52
|
+
z-index: 8999;
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
55
|
|
|
56
56
|
const StyledPortal = styled.div`
|
|
57
57
|
z-index: 9999;
|
|
58
|
+
position: relative;
|
|
58
59
|
|
|
59
60
|
* {
|
|
60
61
|
box-sizing: border-box;
|
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';
|
|
@@ -117,7 +117,7 @@ export const FromCustomElement: Story = {
|
|
|
117
117
|
<ReqoreBackdrop />
|
|
118
118
|
<div
|
|
119
119
|
className='custom-modal reqore-modal'
|
|
120
|
-
style={{ position: '
|
|
120
|
+
style={{ position: 'fixed', left: '50%', top: '50%' }}
|
|
121
121
|
>
|
|
122
122
|
This is a custom modal
|
|
123
123
|
</div>
|
|
@@ -87,6 +87,12 @@ const Template: StoryFn<IReqoreTagProps> = (args) => {
|
|
|
87
87
|
label={2}
|
|
88
88
|
/>
|
|
89
89
|
<ReqoreTag label='With Icon' icon='AlarmWarningLine' {...args} />
|
|
90
|
+
<ReqoreTag
|
|
91
|
+
{...args}
|
|
92
|
+
labelKey='Without label'
|
|
93
|
+
icon='AlarmWarningLine'
|
|
94
|
+
rightIcon='24HoursFill'
|
|
95
|
+
/>
|
|
90
96
|
<ReqoreTag
|
|
91
97
|
label='With Icon Colors'
|
|
92
98
|
icon='AlarmWarningLine'
|