@qoretechnologies/reqore 0.27.6 → 0.28.0
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/__tests__/tabs.test.tsx +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +4 -5
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Breadcrumbs/item.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/item.js +1 -1
- package/dist/components/Breadcrumbs/item.js.map +1 -1
- package/dist/components/Button/index.d.ts +8 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +41 -24
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Header/index.d.ts +2 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +5 -2
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.d.ts +2 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Icon/index.js +17 -6
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Menu/index.js +2 -2
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Message/index.d.ts +2 -3
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +8 -7
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts +3 -4
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +22 -19
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Panel/index.d.ts +3 -2
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +19 -11
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Table/row.js +1 -1
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +2 -6
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.d.ts.map +1 -1
- package/dist/components/Tabs/item.js +19 -10
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts +8 -0
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +30 -12
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.d.ts +2 -1
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tag/group.js +8 -4
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +3 -3
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/constants/sizes.d.ts +22 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +36 -14
- package/dist/constants/sizes.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +1 -1
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/helpers/colors.d.ts.map +1 -1
- package/dist/helpers/colors.js +8 -4
- package/dist/helpers/colors.js.map +1 -1
- package/dist/helpers/utils.d.ts +1 -0
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +7 -2
- package/dist/helpers/utils.js.map +1 -1
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +5 -3
- package/dist/styles.js.map +1 -1
- package/dist/types/global.d.ts +13 -0
- package/dist/types/global.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Breadcrumbs/index.tsx +6 -21
- package/src/components/Breadcrumbs/item.tsx +1 -7
- package/src/components/Button/index.tsx +88 -50
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Header/index.tsx +6 -3
- package/src/components/Icon/index.tsx +21 -8
- package/src/components/Input/index.tsx +1 -1
- package/src/components/Menu/index.tsx +6 -6
- package/src/components/Message/index.tsx +20 -13
- package/src/components/Notifications/notification.tsx +43 -39
- package/src/components/Panel/index.tsx +40 -8
- package/src/components/Table/row.tsx +1 -1
- package/src/components/Tabs/index.tsx +2 -6
- package/src/components/Tabs/item.tsx +33 -24
- package/src/components/Tabs/list.tsx +45 -15
- package/src/components/Tag/group.tsx +22 -5
- package/src/components/Tag/index.tsx +9 -11
- package/src/constants/sizes.ts +39 -13
- package/src/containers/ReqoreProvider.tsx +1 -1
- package/src/containers/UIProvider.tsx +3 -0
- package/src/helpers/colors.ts +8 -4
- package/src/helpers/utils.ts +7 -2
- package/src/mock/collectionData.tsx +4 -0
- package/src/stories/Button/Button.stories.tsx +43 -17
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +2 -2
- package/src/stories/Message/Message.stories.tsx +6 -6
- package/src/stories/Notifications/Notification.stories.tsx +4 -3
- package/src/stories/Panel/Panel.stories.tsx +17 -1
- package/src/stories/Tabs/Tabs.stories.tsx +20 -13
- package/src/styles.ts +5 -2
- package/src/types/global.ts +14 -0
- package/tests.json +1 -1
|
@@ -7,21 +7,38 @@ export interface IReqoreTagGroup extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
children: any;
|
|
8
8
|
size?: TSizes;
|
|
9
9
|
columns?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
10
|
+
hasBottomMargin?: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const StyledTagGroup = styled.div`
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
|
|
13
16
|
${StyledTag} {
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
&:not(:last-child) {
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
margin-bottom: ${({ hasBottomMargin }) => (hasBottomMargin ? '5px' : '0px')};
|
|
16
22
|
}
|
|
17
23
|
`;
|
|
18
24
|
|
|
19
|
-
const ReqoreTagGroup = ({
|
|
20
|
-
|
|
25
|
+
const ReqoreTagGroup = ({
|
|
26
|
+
children,
|
|
27
|
+
size,
|
|
28
|
+
className,
|
|
29
|
+
columns,
|
|
30
|
+
hasBottomMargin = true,
|
|
31
|
+
...rest
|
|
32
|
+
}: IReqoreTagGroup) => (
|
|
33
|
+
<StyledTagGroup
|
|
34
|
+
{...rest}
|
|
35
|
+
hasBottomMargin={hasBottomMargin}
|
|
36
|
+
className={`${className || ''} reqore-tag-group`}
|
|
37
|
+
>
|
|
21
38
|
{React.Children.map(children, (child) =>
|
|
22
39
|
child
|
|
23
40
|
? React.cloneElement(child, {
|
|
24
|
-
size,
|
|
41
|
+
size: child.props?.size || size,
|
|
25
42
|
width: columns ? `calc(${100 / columns}% - 5px)` : child.props.width,
|
|
26
43
|
})
|
|
27
44
|
: null
|
|
@@ -198,21 +198,19 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
198
198
|
>
|
|
199
199
|
{icon || labelKey ? (
|
|
200
200
|
<StyledTagContentWrapper size={size} className='reqore-tag-content' onClick={onClick}>
|
|
201
|
-
{icon &&
|
|
202
|
-
<ReqoreIcon
|
|
203
|
-
icon={icon}
|
|
204
|
-
size={`${TEXT_FROM_SIZE[size]}px`}
|
|
205
|
-
margin={label ? 'left' : 'both'}
|
|
206
|
-
/>
|
|
207
|
-
)}
|
|
201
|
+
{icon && <ReqoreIcon icon={icon} size={size} margin={label ? 'left' : 'both'} />}
|
|
208
202
|
{labelKey && <StyledTagContentKey size={size}>{labelKey}</StyledTagContentKey>}
|
|
209
203
|
</StyledTagContentWrapper>
|
|
210
204
|
) : null}
|
|
211
|
-
{label &&
|
|
205
|
+
{label && (
|
|
206
|
+
<StyledTagContent size={size} onClick={onClick}>
|
|
207
|
+
{label}
|
|
208
|
+
</StyledTagContent>
|
|
209
|
+
)}
|
|
212
210
|
{rightIcon && (
|
|
213
211
|
<StyledTagRightIcon
|
|
214
212
|
icon={rightIcon}
|
|
215
|
-
size={
|
|
213
|
+
size={size}
|
|
216
214
|
margin={label || icon ? 'right' : 'both'}
|
|
217
215
|
/>
|
|
218
216
|
)}
|
|
@@ -234,7 +232,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
234
232
|
: {})}
|
|
235
233
|
noWrapper
|
|
236
234
|
>
|
|
237
|
-
<ReqoreIcon icon={action.icon} size={
|
|
235
|
+
<ReqoreIcon icon={action.icon} size={size} />
|
|
238
236
|
</ReqorePopover>
|
|
239
237
|
</>
|
|
240
238
|
))
|
|
@@ -251,7 +249,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
251
249
|
noWrapper
|
|
252
250
|
content='Remove'
|
|
253
251
|
>
|
|
254
|
-
<ReqoreIcon icon='CloseLine' size={
|
|
252
|
+
<ReqoreIcon icon='CloseLine' size={size} />
|
|
255
253
|
</ReqorePopover>
|
|
256
254
|
) : null}
|
|
257
255
|
</StyledTag>
|
package/src/constants/sizes.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type TSizes = 'tiny' | 'small' | 'normal' | 'big' | 'huge';
|
|
2
2
|
export type TWeights = 'soft' | 'normal' | 'heavy';
|
|
3
3
|
|
|
4
|
+
export const SIZES = ['tiny', 'small', 'normal', 'big', 'huge'] as const;
|
|
5
|
+
|
|
4
6
|
export const SIZE_TO_NUMBER = {
|
|
5
7
|
tiny: 1,
|
|
6
8
|
small: 2,
|
|
@@ -17,6 +19,14 @@ export const NUMBER_TO_SIZE = {
|
|
|
17
19
|
5: 'huge',
|
|
18
20
|
};
|
|
19
21
|
|
|
22
|
+
export const HEADER_SIZE_TO_NUMBER = {
|
|
23
|
+
tiny: 5,
|
|
24
|
+
small: 4,
|
|
25
|
+
normal: 3,
|
|
26
|
+
big: 2,
|
|
27
|
+
huge: 1,
|
|
28
|
+
};
|
|
29
|
+
|
|
20
30
|
export const SIZE_TO_PX = {
|
|
21
31
|
tiny: 10,
|
|
22
32
|
small: 20,
|
|
@@ -27,8 +37,8 @@ export const SIZE_TO_PX = {
|
|
|
27
37
|
|
|
28
38
|
export const BADGE_SIZE_TO_PX = {
|
|
29
39
|
tiny: 10,
|
|
30
|
-
small:
|
|
31
|
-
normal:
|
|
40
|
+
small: 18,
|
|
41
|
+
normal: 24,
|
|
32
42
|
big: 30,
|
|
33
43
|
huge: 36,
|
|
34
44
|
};
|
|
@@ -73,12 +83,20 @@ export const TEXT_FROM_SIZE = {
|
|
|
73
83
|
huge: 21,
|
|
74
84
|
};
|
|
75
85
|
|
|
86
|
+
export const ICON_FROM_SIZE = {
|
|
87
|
+
tiny: 11,
|
|
88
|
+
small: 14,
|
|
89
|
+
normal: 17,
|
|
90
|
+
big: 20,
|
|
91
|
+
huge: 23,
|
|
92
|
+
};
|
|
93
|
+
|
|
76
94
|
export const PADDING_FROM_SIZE = {
|
|
77
|
-
tiny:
|
|
78
|
-
small:
|
|
79
|
-
normal:
|
|
80
|
-
big:
|
|
81
|
-
huge:
|
|
95
|
+
tiny: 5,
|
|
96
|
+
small: 8,
|
|
97
|
+
normal: 11,
|
|
98
|
+
big: 14,
|
|
99
|
+
huge: 17,
|
|
82
100
|
};
|
|
83
101
|
|
|
84
102
|
export const RADIUS_FROM_SIZE = {
|
|
@@ -90,12 +108,20 @@ export const RADIUS_FROM_SIZE = {
|
|
|
90
108
|
};
|
|
91
109
|
|
|
92
110
|
export const ICON_FROM_HEADER_SIZE = {
|
|
93
|
-
1:
|
|
94
|
-
2:
|
|
95
|
-
3:
|
|
96
|
-
4:
|
|
97
|
-
5:
|
|
98
|
-
6:
|
|
111
|
+
1: 23,
|
|
112
|
+
2: 20,
|
|
113
|
+
3: 17,
|
|
114
|
+
4: 14,
|
|
115
|
+
5: 11,
|
|
116
|
+
6: 8,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const ICON_WRAPPER_FROM_HEADER_SIZE = {
|
|
120
|
+
huge: 34,
|
|
121
|
+
big: 26,
|
|
122
|
+
normal: 19,
|
|
123
|
+
small: 17,
|
|
124
|
+
tiny: 15,
|
|
99
125
|
};
|
|
100
126
|
|
|
101
127
|
export const WEIGHT_TO_NUMBER = {
|
package/src/helpers/colors.ts
CHANGED
|
@@ -108,7 +108,7 @@ export const buildTheme = (theme: IReqoreTheme): IReqoreTheme => {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
if (!newTheme.notifications?.muted) {
|
|
111
|
-
newTheme.notifications.muted = newTheme.intents.muted || DEFAULT_INTENTS.muted
|
|
111
|
+
newTheme.notifications.muted = `${newTheme.intents.muted || DEFAULT_INTENTS.muted}30`;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
return newTheme;
|
|
@@ -122,9 +122,13 @@ export const mergeThemes = (element: string, theme: IReqoreTheme, customTheme: a
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
if (element === 'main' && customTheme) {
|
|
125
|
-
merge(clonedTheme, {
|
|
125
|
+
merge(clonedTheme, {
|
|
126
|
+
main: customTheme.main,
|
|
127
|
+
originalMain: clonedTheme.main,
|
|
128
|
+
text: customTheme.text,
|
|
129
|
+
});
|
|
126
130
|
} else {
|
|
127
|
-
merge(clonedTheme, { [element]: customTheme || {} });
|
|
131
|
+
merge(clonedTheme, { [element]: customTheme || {}, text: customTheme.text });
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
return clonedTheme;
|
|
@@ -135,7 +139,7 @@ export const getNotificationIntent = (theme: IReqoreTheme, intent?: TReqoreInten
|
|
|
135
139
|
return theme.notifications[intent];
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
return theme.main;
|
|
142
|
+
return changeLightness(theme.main, 0.1);
|
|
139
143
|
};
|
|
140
144
|
|
|
141
145
|
export const getMainBackgroundColor = (theme: IReqoreTheme): string =>
|
package/src/helpers/utils.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
isString,
|
|
9
9
|
isUndefined,
|
|
10
10
|
} from 'lodash';
|
|
11
|
-
import { NUMBER_TO_SIZE, SIZE_TO_NUMBER, TSizes } from '../constants/sizes';
|
|
11
|
+
import { NUMBER_TO_SIZE, SIZES, SIZE_TO_NUMBER, TSizes } from '../constants/sizes';
|
|
12
12
|
|
|
13
13
|
export const sleep = async (ms: number) => await new Promise((r) => setTimeout(r, ms));
|
|
14
14
|
|
|
@@ -71,10 +71,15 @@ export const calculateStringSizeInPixels = (value: string = '', fontSize: number
|
|
|
71
71
|
|
|
72
72
|
/* It's calculating the width of a string in pixels. */
|
|
73
73
|
return (
|
|
74
|
-
Array.from(value).reduce((acc, cur) => acc + (widths[cur.charCodeAt(0)] ?? avg), 0) *
|
|
74
|
+
Array.from(value).reduce((acc, cur) => acc + (widths[cur.charCodeAt(0)] ?? avg), 0) *
|
|
75
|
+
(fontSize * 1.15)
|
|
75
76
|
);
|
|
76
77
|
};
|
|
77
78
|
|
|
79
|
+
export const isStringSize = (value: TSizes | string | number) => {
|
|
80
|
+
return SIZES.includes(value as TSizes);
|
|
81
|
+
};
|
|
82
|
+
|
|
78
83
|
export const getOneLessSize = (size: TSizes): TSizes => {
|
|
79
84
|
// Get the initial sizes number
|
|
80
85
|
const initialSizeNumber: number = SIZE_TO_NUMBER[size];
|
|
@@ -50,18 +50,22 @@ export default [
|
|
|
50
50
|
],
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
+
icon: 'TextWrap',
|
|
53
54
|
label: 'Item that is not minimal',
|
|
54
55
|
tooltip: 'This is a test item',
|
|
55
56
|
content:
|
|
56
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',
|
|
57
58
|
minimal: false,
|
|
59
|
+
badge: 25,
|
|
58
60
|
},
|
|
59
61
|
{
|
|
62
|
+
icon: 'FolderWarningFill',
|
|
60
63
|
label: 'Expandable item',
|
|
61
64
|
tooltip: 'This is a test item',
|
|
62
65
|
content:
|
|
63
66
|
'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',
|
|
64
67
|
expandable: true,
|
|
68
|
+
badge: 10,
|
|
65
69
|
tags: [
|
|
66
70
|
{
|
|
67
71
|
label: 23,
|
|
@@ -44,23 +44,6 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
44
44
|
<ReqoreButton {...buttonProps} readOnly onClick={alert}>
|
|
45
45
|
Read only
|
|
46
46
|
</ReqoreButton>
|
|
47
|
-
<ReqoreButton {...buttonProps} readOnly badge={10} onClick={alert}>
|
|
48
|
-
With Badge
|
|
49
|
-
</ReqoreButton>
|
|
50
|
-
<ReqoreButton
|
|
51
|
-
{...buttonProps}
|
|
52
|
-
badge={{
|
|
53
|
-
effect: {
|
|
54
|
-
gradient: { colors: { 0: '#00fafd', 100: '#eb0e8c' }, direction: 'to right bottom' },
|
|
55
|
-
},
|
|
56
|
-
labelKey: 'Cool',
|
|
57
|
-
label: 1234,
|
|
58
|
-
actions: [{ icon: 'ShuffleLine', onClick: noop }],
|
|
59
|
-
}}
|
|
60
|
-
onClick={alert}
|
|
61
|
-
>
|
|
62
|
-
With modified Badge
|
|
63
|
-
</ReqoreButton>
|
|
64
47
|
</ReqoreControlGroup>
|
|
65
48
|
<br />
|
|
66
49
|
<ReqoreControlGroup fluid>
|
|
@@ -112,6 +95,49 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
112
95
|
wrap
|
|
113
96
|
/>
|
|
114
97
|
</ReqoreControlGroup>
|
|
98
|
+
<br />
|
|
99
|
+
<ReqoreControlGroup>
|
|
100
|
+
<ReqoreButton {...buttonProps} readOnly badge={10} onClick={alert}>
|
|
101
|
+
With Badge
|
|
102
|
+
</ReqoreButton>
|
|
103
|
+
<ReqoreButton {...buttonProps} minimal badge={20} onClick={alert}>
|
|
104
|
+
With Badge
|
|
105
|
+
</ReqoreButton>
|
|
106
|
+
<ReqoreButton
|
|
107
|
+
{...buttonProps}
|
|
108
|
+
badge={[
|
|
109
|
+
20,
|
|
110
|
+
{
|
|
111
|
+
effect: {
|
|
112
|
+
gradient: {
|
|
113
|
+
colors: { 0: '#00fafd', 100: '#eb0e8c' },
|
|
114
|
+
direction: 'to right bottom',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
labelKey: 'Cool',
|
|
118
|
+
label: 1234,
|
|
119
|
+
actions: [{ icon: 'ShuffleLine', onClick: noop }],
|
|
120
|
+
},
|
|
121
|
+
]}
|
|
122
|
+
onClick={alert}
|
|
123
|
+
>
|
|
124
|
+
With multiple badges
|
|
125
|
+
</ReqoreButton>
|
|
126
|
+
<ReqoreButton
|
|
127
|
+
{...buttonProps}
|
|
128
|
+
badge={{
|
|
129
|
+
effect: {
|
|
130
|
+
gradient: { colors: { 0: '#00fafd', 100: '#eb0e8c' }, direction: 'to right bottom' },
|
|
131
|
+
},
|
|
132
|
+
labelKey: 'Cool',
|
|
133
|
+
label: 1234,
|
|
134
|
+
actions: [{ icon: 'ShuffleLine', onClick: noop }],
|
|
135
|
+
}}
|
|
136
|
+
onClick={alert}
|
|
137
|
+
>
|
|
138
|
+
With modified Badge
|
|
139
|
+
</ReqoreButton>
|
|
140
|
+
</ReqoreControlGroup>
|
|
115
141
|
</>
|
|
116
142
|
);
|
|
117
143
|
};
|
|
@@ -2,7 +2,7 @@ import { Meta, Story } from '@storybook/react/types-6-0';
|
|
|
2
2
|
import { IReqoreControlGroupProps } from '../../components/ControlGroup';
|
|
3
3
|
import ReqoreInput from '../../components/Input';
|
|
4
4
|
import { ReqoreButton, ReqoreControlGroup } from '../../index';
|
|
5
|
-
import {
|
|
5
|
+
import { MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
6
6
|
|
|
7
7
|
const { createArg } = argManager<IReqoreControlGroupProps>();
|
|
8
8
|
|
|
@@ -38,7 +38,7 @@ const Template: Story<IReqoreControlGroupProps> = (args: IReqoreControlGroupProp
|
|
|
38
38
|
<ReqoreButton>Button</ReqoreButton>
|
|
39
39
|
<ReqoreInput icon='4KFill' value='Hello' />
|
|
40
40
|
<ReqoreButton disabled fixed>
|
|
41
|
-
Disabled
|
|
41
|
+
Disabled & Fixed
|
|
42
42
|
</ReqoreButton>
|
|
43
43
|
<ReqoreButton minimal>Minimal</ReqoreButton>
|
|
44
44
|
</ReqoreControlGroup>
|
|
@@ -17,10 +17,10 @@ export default {
|
|
|
17
17
|
type: 'string',
|
|
18
18
|
description: 'The title of the message',
|
|
19
19
|
}),
|
|
20
|
-
...createArg('
|
|
20
|
+
...createArg('minimal', {
|
|
21
21
|
defaultValue: false,
|
|
22
|
-
name: '
|
|
23
|
-
description: '
|
|
22
|
+
name: 'Minimal',
|
|
23
|
+
description: 'If the message should be minimal',
|
|
24
24
|
type: 'boolean',
|
|
25
25
|
}),
|
|
26
26
|
},
|
|
@@ -46,9 +46,9 @@ Flat.args = {
|
|
|
46
46
|
flat: true,
|
|
47
47
|
intent: 'success',
|
|
48
48
|
};
|
|
49
|
-
export const
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
export const Minimal: Story<IReqoreMessageProps> = Template.bind({});
|
|
50
|
+
Minimal.args = {
|
|
51
|
+
minimal: true,
|
|
52
52
|
intent: 'danger',
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -58,7 +58,7 @@ const Template: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
|
58
58
|
onClick={noop}
|
|
59
59
|
onClose={noop}
|
|
60
60
|
/>
|
|
61
|
-
<h4> Flat and
|
|
61
|
+
<h4> Flat and minimal </h4>
|
|
62
62
|
<ReqoreNotification
|
|
63
63
|
{...args}
|
|
64
64
|
type='danger'
|
|
@@ -67,7 +67,7 @@ const Template: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
|
67
67
|
onClick={noop}
|
|
68
68
|
onClose={noop}
|
|
69
69
|
flat
|
|
70
|
-
|
|
70
|
+
minimal
|
|
71
71
|
/>
|
|
72
72
|
<ReqoreNotification
|
|
73
73
|
{...args}
|
|
@@ -75,7 +75,8 @@ const Template: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
|
75
75
|
content="Hello, I am a very simple notification. Look at me, look at me? Isn't this great?"
|
|
76
76
|
onClick={noop}
|
|
77
77
|
onClose={noop}
|
|
78
|
-
|
|
78
|
+
intent='pending'
|
|
79
|
+
minimal
|
|
79
80
|
/>
|
|
80
81
|
<ReqoreNotification
|
|
81
82
|
{...args}
|
|
@@ -67,11 +67,27 @@ const Template: Story<IReqorePanelProps> = (args: IReqorePanelProps) => {
|
|
|
67
67
|
return (
|
|
68
68
|
<ReqorePanel
|
|
69
69
|
{...args}
|
|
70
|
+
badge={[
|
|
71
|
+
10,
|
|
72
|
+
{
|
|
73
|
+
effect: {
|
|
74
|
+
gradient: {
|
|
75
|
+
colors: { 0: '#f98304', 100: '#ffc20c' },
|
|
76
|
+
direction: 'to right bottom',
|
|
77
|
+
},
|
|
78
|
+
spaced: 2,
|
|
79
|
+
uppercase: true,
|
|
80
|
+
},
|
|
81
|
+
labelKey: 'Cool',
|
|
82
|
+
label: 1234,
|
|
83
|
+
actions: [{ icon: 'ShuffleLine', onClick: noop }],
|
|
84
|
+
},
|
|
85
|
+
]}
|
|
70
86
|
actions={[
|
|
71
87
|
{ label: 'Test', icon: '24HoursFill', intent: 'info' },
|
|
72
88
|
[
|
|
73
89
|
{ label: 'Stacked Action 1', icon: 'BallPenLine', intent: 'warning' },
|
|
74
|
-
{
|
|
90
|
+
{ icon: 'CopperCoinFill', intent: 'danger' },
|
|
75
91
|
],
|
|
76
92
|
{
|
|
77
93
|
as: ReqoreInput,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
2
|
import { IReqoreTabsProps } from '../../components/Tabs';
|
|
3
3
|
import { ReqoreTabs, ReqoreTabsContent } from '../../index';
|
|
4
|
-
import {
|
|
4
|
+
import { IntentArg, SizeArg, argManager } from '../utils/args';
|
|
5
5
|
|
|
6
6
|
const tabs = [
|
|
7
7
|
{
|
|
@@ -9,6 +9,7 @@ const tabs = [
|
|
|
9
9
|
id: 'tab1',
|
|
10
10
|
icon: 'Home3Line',
|
|
11
11
|
tooltip: 'Hooooooome!',
|
|
12
|
+
badge: 5,
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
15
|
label: 'Tab 2',
|
|
@@ -18,6 +19,11 @@ const tabs = [
|
|
|
18
19
|
props: {
|
|
19
20
|
href: 'https://google.com',
|
|
20
21
|
},
|
|
22
|
+
badge: {
|
|
23
|
+
rightIcon: 'ExternalLinkLine',
|
|
24
|
+
label: 'Link',
|
|
25
|
+
intent: 'info',
|
|
26
|
+
},
|
|
21
27
|
},
|
|
22
28
|
{
|
|
23
29
|
label: 'Really long tab name with tooltip',
|
|
@@ -56,6 +62,9 @@ const tabs = [
|
|
|
56
62
|
onCloseClick: (id) => {
|
|
57
63
|
alert(`${id} close click`);
|
|
58
64
|
},
|
|
65
|
+
customTheme: {
|
|
66
|
+
main: '#00e3e8',
|
|
67
|
+
},
|
|
59
68
|
},
|
|
60
69
|
{
|
|
61
70
|
label: 'Tab 8',
|
|
@@ -204,6 +213,16 @@ Fill.args = {
|
|
|
204
213
|
fill: true,
|
|
205
214
|
};
|
|
206
215
|
|
|
216
|
+
export const CustomActiveIntent = Template.bind({});
|
|
217
|
+
CustomActiveIntent.args = {
|
|
218
|
+
activeTabIntent: 'warning',
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export const NotFlat = Template.bind({});
|
|
222
|
+
NotFlat.args = {
|
|
223
|
+
flat: false,
|
|
224
|
+
};
|
|
225
|
+
|
|
207
226
|
export const Vertical = Template.bind({});
|
|
208
227
|
Vertical.args = {
|
|
209
228
|
vertical: true,
|
|
@@ -217,13 +236,6 @@ VerticalWithWrapping.args = {
|
|
|
217
236
|
wrapTabNames: true,
|
|
218
237
|
};
|
|
219
238
|
|
|
220
|
-
export const VerticalFill = Template.bind({});
|
|
221
|
-
VerticalFill.args = {
|
|
222
|
-
vertical: true,
|
|
223
|
-
fill: true,
|
|
224
|
-
fillParent: true,
|
|
225
|
-
};
|
|
226
|
-
|
|
227
239
|
export const VerticalCustomWidth = Template.bind({});
|
|
228
240
|
VerticalCustomWidth.args = {
|
|
229
241
|
vertical: true,
|
|
@@ -231,8 +243,3 @@ VerticalCustomWidth.args = {
|
|
|
231
243
|
fillParent: true,
|
|
232
244
|
width: '300px',
|
|
233
245
|
};
|
|
234
|
-
|
|
235
|
-
export const NotFlat = Template.bind({});
|
|
236
|
-
NotFlat.args = {
|
|
237
|
-
flat: false,
|
|
238
|
-
};
|
package/src/styles.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { css } from 'styled-components';
|
|
|
2
2
|
import { StyledActiveContent, StyledInActiveContent } from './components/Button';
|
|
3
3
|
import { StyledIconWrapper } from './components/Icon';
|
|
4
4
|
|
|
5
|
+
export const INACTIVE_ICON_SCALE = 0.85;
|
|
6
|
+
export const ACTIVE_ICON_SCALE = 1;
|
|
7
|
+
|
|
5
8
|
export const AnimatedTextElement = css`
|
|
6
9
|
${StyledActiveContent} {
|
|
7
10
|
transform: translateY(0px);
|
|
@@ -18,13 +21,13 @@ export const AnimatedTextElement = css`
|
|
|
18
21
|
|
|
19
22
|
export const InactiveIconScale = css`
|
|
20
23
|
${StyledIconWrapper} {
|
|
21
|
-
transform: scale(
|
|
24
|
+
transform: scale(${INACTIVE_ICON_SCALE});
|
|
22
25
|
}
|
|
23
26
|
`;
|
|
24
27
|
|
|
25
28
|
export const ActiveIconScale = css`
|
|
26
29
|
${StyledIconWrapper} {
|
|
27
|
-
transform: scale(
|
|
30
|
+
transform: scale(${ACTIVE_ICON_SCALE});
|
|
28
31
|
}
|
|
29
32
|
`;
|
|
30
33
|
|
package/src/types/global.ts
CHANGED
|
@@ -126,6 +126,20 @@ export interface IWithReqoreFlat {
|
|
|
126
126
|
flat?: boolean;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
export interface IWithReqoreMinimal {
|
|
130
|
+
/**
|
|
131
|
+
* If true, the component will be minimal
|
|
132
|
+
* @default false
|
|
133
|
+
* @type boolean
|
|
134
|
+
* @example
|
|
135
|
+
* <ReqoreButton minimal />
|
|
136
|
+
* <ReqoreButton minimal={true} />
|
|
137
|
+
* <ReqoreButton minimal={false} />
|
|
138
|
+
*
|
|
139
|
+
*/
|
|
140
|
+
minimal?: boolean;
|
|
141
|
+
}
|
|
142
|
+
|
|
129
143
|
export interface IWithReqoreEffect {
|
|
130
144
|
/**
|
|
131
145
|
* If true, the component will have an effect
|