@qoretechnologies/reqore 0.26.0 → 0.27.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/.gitpod.yml +2 -2
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +7 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +50 -21
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +3 -1
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +2 -1
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +3 -2
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +2 -2
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Notifications/notification.js +1 -1
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +5 -2
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Spacer/index.d.ts.map +1 -1
- package/dist/components/Spacer/index.js +1 -1
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.d.ts +2 -1
- package/dist/components/Tabs/item.d.ts.map +1 -1
- package/dist/components/Tabs/item.js +2 -2
- 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 +1 -1
- package/dist/components/Tabs/list.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/components/Tree/index.d.ts +1 -0
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +4 -3
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/constants/animations.d.ts +4 -0
- package/dist/constants/animations.d.ts.map +1 -1
- package/dist/constants/animations.js +5 -1
- package/dist/constants/animations.js.map +1 -1
- package/dist/constants/sizes.d.ts +21 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +22 -1
- package/dist/constants/sizes.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +1 -2
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts +1 -0
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +0 -1
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/ReqoreContext.d.ts.map +1 -1
- package/dist/context/ReqoreContext.js +2 -1
- package/dist/context/ReqoreContext.js.map +1 -1
- package/dist/helpers/utils.d.ts +2 -0
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +11 -1
- package/dist/helpers/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Breadcrumbs/index.tsx +1 -0
- package/src/components/Button/index.tsx +164 -88
- package/src/components/Drawer/index.tsx +5 -3
- package/src/components/Effect/index.tsx +3 -0
- package/src/components/Menu/index.tsx +13 -1
- package/src/components/Menu/item.tsx +3 -2
- package/src/components/Notifications/notification.tsx +1 -1
- package/src/components/Panel/index.tsx +4 -3
- package/src/components/Spacer/index.tsx +1 -0
- package/src/components/Tabs/index.tsx +1 -1
- package/src/components/Tabs/item.tsx +7 -3
- package/src/components/Tabs/list.tsx +1 -0
- package/src/components/Tag/index.tsx +3 -2
- package/src/components/Tree/index.tsx +6 -2
- package/src/constants/animations.ts +5 -0
- package/src/constants/sizes.ts +24 -0
- package/src/containers/ReqoreProvider.tsx +1 -3
- package/src/containers/UIProvider.tsx +1 -2
- package/src/context/ReqoreContext.tsx +1 -0
- package/src/helpers/utils.ts +10 -0
- package/src/stories/Button/Button.stories.tsx +72 -1
- package/src/stories/Menu/Menu.stories.tsx +30 -5
- package/src/stories/Tabs/Tabs.stories.tsx +10 -5
- package/src/stories/Tag/Tag.stories.tsx +42 -4
- package/tests.json +1 -1
|
@@ -6,10 +6,11 @@ import { IReqoreCustomTheme, IReqoreTheme } from '../../constants/theme';
|
|
|
6
6
|
import { changeLightness } from '../../helpers/colors';
|
|
7
7
|
import { useCombinedRefs } from '../../hooks/useCombinedRefs';
|
|
8
8
|
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
9
|
+
import { IWithReqoreFlat } from '../../types/global';
|
|
9
10
|
import ReqoreButton from '../Button';
|
|
10
11
|
import ReqoreControlGroup from '../ControlGroup';
|
|
11
12
|
|
|
12
|
-
export interface IReqoreTabListItemProps extends IReqoreTabsListItem {
|
|
13
|
+
export interface IReqoreTabListItemProps extends IReqoreTabsListItem, IWithReqoreFlat {
|
|
13
14
|
active?: boolean;
|
|
14
15
|
vertical?: boolean;
|
|
15
16
|
onCloseClick?: any;
|
|
@@ -95,6 +96,8 @@ const ReqoreTabsListItem = memo(
|
|
|
95
96
|
closeIcon,
|
|
96
97
|
customTheme,
|
|
97
98
|
className,
|
|
99
|
+
flat = true,
|
|
100
|
+
wrapTabNames,
|
|
98
101
|
}: IReqoreTabListItemProps,
|
|
99
102
|
ref
|
|
100
103
|
) => {
|
|
@@ -122,10 +125,11 @@ const ReqoreTabsListItem = memo(
|
|
|
122
125
|
{label || icon ? (
|
|
123
126
|
<ReqoreControlGroup stack size={size} fluid={fill || vertical}>
|
|
124
127
|
<ReqoreButton
|
|
125
|
-
flat={
|
|
128
|
+
flat={active || intent ? false : flat}
|
|
126
129
|
fluid={fill || vertical}
|
|
127
130
|
icon={icon}
|
|
128
131
|
minimal
|
|
132
|
+
wrap={wrapTabNames}
|
|
129
133
|
intent={active ? activeIntent || intent : intent}
|
|
130
134
|
active={active}
|
|
131
135
|
disabled={disabled}
|
|
@@ -139,7 +143,7 @@ const ReqoreTabsListItem = memo(
|
|
|
139
143
|
{onCloseClick && !disabled ? (
|
|
140
144
|
<ReqoreButton
|
|
141
145
|
fixed
|
|
142
|
-
flat={
|
|
146
|
+
flat={active || intent ? false : flat}
|
|
143
147
|
icon={closeIcon || 'CloseLine'}
|
|
144
148
|
intent={active ? activeIntent || intent : intent}
|
|
145
149
|
minimal
|
|
@@ -4,6 +4,7 @@ import React, { forwardRef, useContext } from 'react';
|
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { ReqorePopover } from '../..';
|
|
6
6
|
import {
|
|
7
|
+
BADGE_SIZE_TO_PX,
|
|
7
8
|
PADDING_FROM_SIZE,
|
|
8
9
|
RADIUS_FROM_SIZE,
|
|
9
10
|
SIZE_TO_PX,
|
|
@@ -65,9 +66,9 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
|
|
|
65
66
|
overflow: hidden;
|
|
66
67
|
vertical-align: middle;
|
|
67
68
|
font-size: ${({ size }) => TEXT_FROM_SIZE[size]}px;
|
|
68
|
-
height: ${({ size }) => SIZE_TO_PX[size]}px;
|
|
69
|
+
height: ${({ size, badge }) => (badge ? BADGE_SIZE_TO_PX[size] : SIZE_TO_PX[size])}px;
|
|
69
70
|
min-width: ${({ size }) => SIZE_TO_PX[size]}px;
|
|
70
|
-
border-radius: ${({ badge, size }) => (badge ?
|
|
71
|
+
border-radius: ${({ badge, size }) => (badge ? 18 : RADIUS_FROM_SIZE[size])}px;
|
|
71
72
|
width: ${({ width }) => width || undefined};
|
|
72
73
|
transition: all 0.2s ease-out;
|
|
73
74
|
|
|
@@ -30,6 +30,10 @@ export interface ITreeStyle {
|
|
|
30
30
|
theme: IReqoreTheme;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
export const StyledTreeLabel = styled(ReqoreMessage)`
|
|
34
|
+
flex-shrink: 1;
|
|
35
|
+
`;
|
|
36
|
+
|
|
33
37
|
export const ReqoreTree = ({
|
|
34
38
|
data,
|
|
35
39
|
mode = 'tree',
|
|
@@ -135,13 +139,13 @@ export const ReqoreTree = ({
|
|
|
135
139
|
}
|
|
136
140
|
/>
|
|
137
141
|
{_showTypes ? <ReqoreTag className='reqore-tree-type' label={dataType} /> : null}
|
|
138
|
-
<
|
|
142
|
+
<StyledTreeLabel
|
|
139
143
|
flat
|
|
140
144
|
onClick={() => onItemClick(data[key], [...path, key])}
|
|
141
145
|
className='reqore-tree-label'
|
|
142
146
|
>
|
|
143
147
|
{JSON.stringify(data[key])}
|
|
144
|
-
</
|
|
148
|
+
</StyledTreeLabel>
|
|
145
149
|
</ReqoreControlGroup>
|
|
146
150
|
)}
|
|
147
151
|
{isExpandable && isObject
|
package/src/constants/sizes.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
export type TSizes = 'tiny' | 'small' | 'normal' | 'big' | 'huge';
|
|
2
2
|
export type TWeights = 'soft' | 'normal' | 'heavy';
|
|
3
3
|
|
|
4
|
+
export const SIZE_TO_NUMBER = {
|
|
5
|
+
tiny: 1,
|
|
6
|
+
small: 2,
|
|
7
|
+
normal: 3,
|
|
8
|
+
big: 4,
|
|
9
|
+
huge: 5,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const NUMBER_TO_SIZE = {
|
|
13
|
+
1: 'tiny',
|
|
14
|
+
2: 'small',
|
|
15
|
+
3: 'normal',
|
|
16
|
+
4: 'big',
|
|
17
|
+
5: 'huge',
|
|
18
|
+
};
|
|
19
|
+
|
|
4
20
|
export const SIZE_TO_PX = {
|
|
5
21
|
tiny: 10,
|
|
6
22
|
small: 20,
|
|
@@ -9,6 +25,14 @@ export const SIZE_TO_PX = {
|
|
|
9
25
|
huge: 50,
|
|
10
26
|
};
|
|
11
27
|
|
|
28
|
+
export const BADGE_SIZE_TO_PX = {
|
|
29
|
+
tiny: 10,
|
|
30
|
+
small: 17,
|
|
31
|
+
normal: 23,
|
|
32
|
+
big: 30,
|
|
33
|
+
huge: 36,
|
|
34
|
+
};
|
|
35
|
+
|
|
12
36
|
export const TABS_SIZE_TO_PX = {
|
|
13
37
|
tiny: 20,
|
|
14
38
|
small: 30,
|
|
@@ -109,8 +109,6 @@ const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options }) =
|
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
console.log(options);
|
|
113
|
-
|
|
114
112
|
return (
|
|
115
113
|
<>
|
|
116
114
|
<ReqoreContext.Provider
|
|
@@ -123,7 +121,7 @@ const ReqoreProvider: React.FC<IReqoreNotifications> = ({ children, options }) =
|
|
|
123
121
|
isTablet,
|
|
124
122
|
isMobileOrTablet,
|
|
125
123
|
getAndIncreaseZIndex,
|
|
126
|
-
animations: options?.animations || { buttons: true },
|
|
124
|
+
animations: options?.animations || { buttons: true, dialogs: true },
|
|
127
125
|
}}
|
|
128
126
|
>
|
|
129
127
|
{size(notifications) > 0 ? (
|
|
@@ -16,6 +16,7 @@ export interface IReqoreOptions {
|
|
|
16
16
|
uiScale?: number;
|
|
17
17
|
animations?: {
|
|
18
18
|
buttons?: boolean;
|
|
19
|
+
dialogs?: boolean;
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
export interface IReqoreUIProviderProps {
|
|
@@ -35,8 +36,6 @@ const ReqoreUIProvider: React.FC<IReqoreUIProviderProps> = ({ children, theme, o
|
|
|
35
36
|
const _defaultTheme: IReqoreTheme = cloneDeep(DEFAULT_THEME);
|
|
36
37
|
const rebuiltTheme: IReqoreTheme = buildTheme(merge(_defaultTheme, _theme));
|
|
37
38
|
|
|
38
|
-
console.log(options);
|
|
39
|
-
|
|
40
39
|
return (
|
|
41
40
|
<>
|
|
42
41
|
<ThemeContext.Provider value={{ ...rebuiltTheme }}>
|
package/src/helpers/utils.ts
CHANGED
|
@@ -8,6 +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
12
|
|
|
12
13
|
export const sleep = async (ms: number) => await new Promise((r) => setTimeout(r, ms));
|
|
13
14
|
|
|
@@ -73,3 +74,12 @@ export const calculateStringSizeInPixels = (value: string = '', fontSize: number
|
|
|
73
74
|
Array.from(value).reduce((acc, cur) => acc + (widths[cur.charCodeAt(0)] ?? avg), 0) * fontSize
|
|
74
75
|
);
|
|
75
76
|
};
|
|
77
|
+
|
|
78
|
+
export const getOneLessSize = (size: TSizes): TSizes => {
|
|
79
|
+
// Get the initial sizes number
|
|
80
|
+
const initialSizeNumber: number = SIZE_TO_NUMBER[size];
|
|
81
|
+
// Reduce the size number by one
|
|
82
|
+
const oneLessSizeNumber: number = initialSizeNumber - 1 === 0 ? 1 : initialSizeNumber - 1;
|
|
83
|
+
// Get the size name from the number
|
|
84
|
+
return NUMBER_TO_SIZE[oneLessSizeNumber];
|
|
85
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { noop } from 'lodash';
|
|
2
3
|
import ReqoreButton from '../../components/Button';
|
|
3
4
|
import { ReqoreControlGroup } from '../../index';
|
|
4
|
-
import { IconArg } from '../utils/args';
|
|
5
|
+
import { IconArg, SizeArg } from '../utils/args';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: 'Components/Button',
|
|
@@ -11,6 +12,7 @@ export default {
|
|
|
11
12
|
argTypes: {
|
|
12
13
|
...IconArg('icon', 'Icon'),
|
|
13
14
|
...IconArg('rightIcon', 'Right Icon'),
|
|
15
|
+
...SizeArg,
|
|
14
16
|
},
|
|
15
17
|
} as ComponentMeta<typeof ReqoreButton>;
|
|
16
18
|
|
|
@@ -18,7 +20,12 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
18
20
|
return (
|
|
19
21
|
<>
|
|
20
22
|
<ReqoreControlGroup size={buttonProps.size}>
|
|
23
|
+
<ReqoreButton {...buttonProps} icon='BankFill' rightIcon={null} />
|
|
24
|
+
<ReqoreButton {...buttonProps} />
|
|
21
25
|
<ReqoreButton {...buttonProps}>Default</ReqoreButton>
|
|
26
|
+
<ReqoreButton {...buttonProps} wrap maxWidth='150px'>
|
|
27
|
+
Default wrapped button with long text
|
|
28
|
+
</ReqoreButton>
|
|
22
29
|
<ReqoreButton {...buttonProps} disabled>
|
|
23
30
|
Disabled
|
|
24
31
|
</ReqoreButton>
|
|
@@ -31,9 +38,29 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
31
38
|
<ReqoreButton {...buttonProps} minimal>
|
|
32
39
|
Minimal
|
|
33
40
|
</ReqoreButton>
|
|
41
|
+
<ReqoreButton {...buttonProps} minimal flat>
|
|
42
|
+
Minimal flat
|
|
43
|
+
</ReqoreButton>
|
|
34
44
|
<ReqoreButton {...buttonProps} readOnly onClick={alert}>
|
|
35
45
|
Read only
|
|
36
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>
|
|
37
64
|
</ReqoreControlGroup>
|
|
38
65
|
<br />
|
|
39
66
|
<ReqoreControlGroup fluid>
|
|
@@ -41,6 +68,50 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
41
68
|
Fluid button
|
|
42
69
|
</ReqoreButton>
|
|
43
70
|
</ReqoreControlGroup>
|
|
71
|
+
<br />
|
|
72
|
+
<ReqoreControlGroup>
|
|
73
|
+
<ReqoreButton
|
|
74
|
+
{...buttonProps}
|
|
75
|
+
description='This is a very interesting description for a button, I like it very much'
|
|
76
|
+
>
|
|
77
|
+
With Default Description
|
|
78
|
+
</ReqoreButton>
|
|
79
|
+
<ReqoreButton
|
|
80
|
+
{...buttonProps}
|
|
81
|
+
description='This is a very interesting description for a button, I like it very much'
|
|
82
|
+
maxWidth='200px'
|
|
83
|
+
badge={{
|
|
84
|
+
color: '#00fafd',
|
|
85
|
+
labelKey: 'Cool',
|
|
86
|
+
label: 1234,
|
|
87
|
+
actions: [{ icon: 'ShuffleLine', onClick: noop }],
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
With description and max width
|
|
91
|
+
</ReqoreButton>
|
|
92
|
+
<ReqoreButton
|
|
93
|
+
{...buttonProps}
|
|
94
|
+
description='This is a very interesting description for a button, I like it very much'
|
|
95
|
+
maxWidth='200px'
|
|
96
|
+
badge={{
|
|
97
|
+
effect: {
|
|
98
|
+
gradient: { colors: { 0: '#00fafd', 130: '#eb0e8c' }, direction: 'to right bottom' },
|
|
99
|
+
uppercase: true,
|
|
100
|
+
},
|
|
101
|
+
labelKey: 'Cool',
|
|
102
|
+
label: 1234,
|
|
103
|
+
actions: [{ icon: 'ShuffleLine', onClick: noop }],
|
|
104
|
+
}}
|
|
105
|
+
wrap
|
|
106
|
+
>
|
|
107
|
+
With description and max width, wrapped
|
|
108
|
+
</ReqoreButton>
|
|
109
|
+
<ReqoreButton
|
|
110
|
+
{...buttonProps}
|
|
111
|
+
description='This is a very interesting description for a button, I like it very much'
|
|
112
|
+
wrap
|
|
113
|
+
/>
|
|
114
|
+
</ReqoreControlGroup>
|
|
44
115
|
</>
|
|
45
116
|
);
|
|
46
117
|
};
|
|
@@ -28,7 +28,7 @@ export default {
|
|
|
28
28
|
},
|
|
29
29
|
}),
|
|
30
30
|
...createArg('wrapText', {
|
|
31
|
-
defaultValue:
|
|
31
|
+
defaultValue: false,
|
|
32
32
|
name: 'Wrap text',
|
|
33
33
|
control: {
|
|
34
34
|
type: 'boolean',
|
|
@@ -59,7 +59,9 @@ const Template: Story<IReqoreMenuProps> = (args) => {
|
|
|
59
59
|
Delete
|
|
60
60
|
</ReqoreMenuItem>
|
|
61
61
|
|
|
62
|
-
<ReqoreMenuItem icon='Lock2Fill'
|
|
62
|
+
<ReqoreMenuItem icon='Lock2Fill' description='I also have a description'>
|
|
63
|
+
This is a really long item that should wrap
|
|
64
|
+
</ReqoreMenuItem>
|
|
63
65
|
<ReqoreMenuItem icon='Lock2Fill' disabled>
|
|
64
66
|
Disabled
|
|
65
67
|
</ReqoreMenuItem>
|
|
@@ -73,16 +75,33 @@ const Template: Story<IReqoreMenuProps> = (args) => {
|
|
|
73
75
|
{
|
|
74
76
|
icon: 'EmotionUnhappyLine',
|
|
75
77
|
rightIcon: 'Scissors2Fill',
|
|
78
|
+
wrap: args.wrapText,
|
|
79
|
+
flat: args.flat,
|
|
76
80
|
} as IReqoreMenuItemProps
|
|
77
81
|
}
|
|
82
|
+
openOnMount
|
|
78
83
|
content={
|
|
79
84
|
<ReqoreMenu {...args}>
|
|
80
85
|
<ReqoreMenuItem icon='ZhihuFill'>Item 1</ReqoreMenuItem>
|
|
81
|
-
<ReqoreMenuItem
|
|
86
|
+
<ReqoreMenuItem
|
|
87
|
+
icon='AccountCircleFill'
|
|
88
|
+
description='Would you look at that beautiful description'
|
|
89
|
+
intent='warning'
|
|
90
|
+
>
|
|
91
|
+
Item 2
|
|
92
|
+
</ReqoreMenuItem>
|
|
82
93
|
<ReqoreMenuItem icon='AnticlockwiseFill' disabled>
|
|
83
94
|
Item 3
|
|
84
95
|
</ReqoreMenuItem>
|
|
85
|
-
<ReqoreMenuItem
|
|
96
|
+
<ReqoreMenuItem
|
|
97
|
+
icon='ArchiveFill'
|
|
98
|
+
badge={{
|
|
99
|
+
label: '10',
|
|
100
|
+
effect: { gradient: { colors: { 0: '#00e3e8', 100: '#eb0e8c' } } },
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
Item 4
|
|
104
|
+
</ReqoreMenuItem>
|
|
86
105
|
</ReqoreMenu>
|
|
87
106
|
}
|
|
88
107
|
isReqoreComponent
|
|
@@ -106,6 +125,8 @@ const Template: Story<IReqoreMenuProps> = (args) => {
|
|
|
106
125
|
},
|
|
107
126
|
},
|
|
108
127
|
}}
|
|
128
|
+
description='I also have a description'
|
|
129
|
+
badge={10}
|
|
109
130
|
>
|
|
110
131
|
Fancy
|
|
111
132
|
</ReqoreMenuItem>
|
|
@@ -116,5 +137,9 @@ const Template: Story<IReqoreMenuProps> = (args) => {
|
|
|
116
137
|
export const Basic = Template.bind({});
|
|
117
138
|
export const WrappedText = Template.bind({});
|
|
118
139
|
WrappedText.args = {
|
|
119
|
-
wrapText:
|
|
140
|
+
wrapText: true,
|
|
141
|
+
};
|
|
142
|
+
export const NotFlat = Template.bind({});
|
|
143
|
+
NotFlat.args = {
|
|
144
|
+
flat: false,
|
|
120
145
|
};
|
|
@@ -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 { argManager,
|
|
4
|
+
import { argManager, IntentArg, SizeArg } from '../utils/args';
|
|
5
5
|
|
|
6
6
|
const tabs = [
|
|
7
7
|
{
|
|
@@ -74,9 +74,14 @@ const { createArg } = argManager<IReqoreTabsProps>();
|
|
|
74
74
|
export default {
|
|
75
75
|
title: 'Components/Tabs',
|
|
76
76
|
argTypes: {
|
|
77
|
-
...FlatArg,
|
|
78
77
|
...SizeArg,
|
|
79
78
|
...IntentArg,
|
|
79
|
+
...createArg('flat', {
|
|
80
|
+
type: 'boolean',
|
|
81
|
+
defaultValue: true,
|
|
82
|
+
name: 'Flat',
|
|
83
|
+
description: 'Whether the tabs should be flat or not',
|
|
84
|
+
}),
|
|
80
85
|
...createArg('fill', {
|
|
81
86
|
type: 'boolean',
|
|
82
87
|
defaultValue: false,
|
|
@@ -227,7 +232,7 @@ VerticalCustomWidth.args = {
|
|
|
227
232
|
width: '300px',
|
|
228
233
|
};
|
|
229
234
|
|
|
230
|
-
export const
|
|
231
|
-
|
|
232
|
-
flat:
|
|
235
|
+
export const NotFlat = Template.bind({});
|
|
236
|
+
NotFlat.args = {
|
|
237
|
+
flat: false,
|
|
233
238
|
};
|
|
@@ -47,7 +47,6 @@ export default {
|
|
|
47
47
|
icon: 'SpyFill',
|
|
48
48
|
onClick: noop,
|
|
49
49
|
intent: 'success',
|
|
50
|
-
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
51
50
|
},
|
|
52
51
|
],
|
|
53
52
|
table: {
|
|
@@ -60,7 +59,17 @@ export default {
|
|
|
60
59
|
const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }) => {
|
|
61
60
|
return (
|
|
62
61
|
<ReqoreTagGroup columns={columns} size={args.size}>
|
|
63
|
-
<ReqoreTag
|
|
62
|
+
<ReqoreTag {...args} actions={null} onRemoveClick={null} rightIcon={null} label={1} />
|
|
63
|
+
<ReqoreTag {...args} actions={null} onRemoveClick={null} rightIcon={null} label='Basic Tag' />
|
|
64
|
+
<ReqoreTag
|
|
65
|
+
{...args}
|
|
66
|
+
actions={null}
|
|
67
|
+
onRemoveClick={null}
|
|
68
|
+
rightIcon={null}
|
|
69
|
+
labelKey='Number'
|
|
70
|
+
label={2}
|
|
71
|
+
/>
|
|
72
|
+
<ReqoreTag label='With Icon' icon='AlarmWarningLine' {...args} />
|
|
64
73
|
<ReqoreTag labelKey='Tag with' label='Label Key' icon='AlarmWarningLine' {...args} />
|
|
65
74
|
<ReqoreTag labelKey='Key' label='value' {...args} />
|
|
66
75
|
<ReqoreTag icon='QuestionAnswerLine' {...args} />
|
|
@@ -71,10 +80,39 @@ const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }
|
|
|
71
80
|
icon='AlarmWarningLine'
|
|
72
81
|
{...args}
|
|
73
82
|
tooltip='I am wiiiiiiide'
|
|
83
|
+
actions={[
|
|
84
|
+
{
|
|
85
|
+
icon: '24HoursFill',
|
|
86
|
+
onClick: noop,
|
|
87
|
+
disabled: true,
|
|
88
|
+
intent: 'info',
|
|
89
|
+
tooltip: { content: 'I am a tooltip' },
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
icon: 'SpyFill',
|
|
93
|
+
onClick: noop,
|
|
94
|
+
intent: 'success',
|
|
95
|
+
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
96
|
+
},
|
|
97
|
+
]}
|
|
74
98
|
/>
|
|
75
99
|
<ReqoreTag label='Danger Tag' icon='AlarmWarningLine' intent='danger' {...args} />
|
|
76
|
-
<ReqoreTag
|
|
77
|
-
|
|
100
|
+
<ReqoreTag
|
|
101
|
+
label='Custom Color Tag'
|
|
102
|
+
icon='AlarmWarningLine'
|
|
103
|
+
color='#38fdb2'
|
|
104
|
+
{...args}
|
|
105
|
+
tooltip={{ content: 'Hm, another tooltip', openOnMount: true }}
|
|
106
|
+
/>
|
|
107
|
+
<ReqoreTag
|
|
108
|
+
{...args}
|
|
109
|
+
label='No Buttons Tag'
|
|
110
|
+
icon='CarLine'
|
|
111
|
+
color='#0b4578'
|
|
112
|
+
rightIcon={args.rightIcon}
|
|
113
|
+
actions={null}
|
|
114
|
+
onRemoveClick={null}
|
|
115
|
+
/>
|
|
78
116
|
</ReqoreTagGroup>
|
|
79
117
|
);
|
|
80
118
|
};
|