@qoretechnologies/reqore 0.29.3 → 0.29.5
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__/collection.test.tsx +1 -1
- package/dist/components/Button/index.d.ts +3 -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/Collection/index.d.ts +6 -2
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +45 -15
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.d.ts +3 -2
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js +14 -7
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts +11 -3
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +139 -46
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/Dropdown/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 +4 -1
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +2 -2
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +6 -6
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/Message/index.d.ts +2 -0
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +2 -2
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Panel/index.d.ts +2 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +2 -2
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +1 -2
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +2 -2
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +3 -2
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +6 -3
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/item.js +1 -1
- 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/group.d.ts +2 -2
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tag/group.js +7 -8
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.d.ts +3 -0
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +11 -11
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/hooks/usePopover.d.ts +1 -0
- package/dist/hooks/usePopover.d.ts.map +1 -1
- package/dist/hooks/usePopover.js.map +1 -1
- package/dist/styles.d.ts +1 -0
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +6 -5
- package/dist/styles.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/index.tsx +14 -3
- package/src/components/Collection/index.tsx +60 -14
- package/src/components/Collection/item.tsx +16 -2
- package/src/components/ControlGroup/index.tsx +223 -107
- package/src/components/Dropdown/index.tsx +1 -0
- package/src/components/Icon/index.tsx +6 -3
- package/src/components/Input/index.tsx +4 -2
- package/src/components/InternalPopover/index.tsx +7 -6
- package/src/components/Message/index.tsx +9 -1
- package/src/components/Panel/index.tsx +3 -0
- package/src/components/Popover/index.tsx +1 -3
- package/src/components/Table/helpers.ts +12 -6
- package/src/components/Table/index.tsx +1 -0
- package/src/components/Tabs/item.tsx +4 -4
- package/src/components/Tabs/list.tsx +1 -0
- package/src/components/Tag/group.tsx +6 -12
- package/src/components/Tag/index.tsx +36 -13
- package/src/hooks/usePopover.tsx +1 -0
- package/src/mock/collectionData.tsx +10 -0
- package/src/stories/Button/Button.stories.tsx +14 -6
- package/src/stories/Checkbox/Checkbox.stories.tsx +4 -3
- package/src/stories/Collection/Collection.stories.tsx +18 -2
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +72 -31
- package/src/stories/Dropdown/Dropdown.stories.tsx +13 -3
- package/src/stories/Input/Input.stories.tsx +3 -2
- package/src/stories/Menu/Menu.stories.tsx +2 -0
- package/src/stories/Message/Message.stories.tsx +7 -0
- package/src/stories/Panel/Panel.stories.tsx +1 -0
- package/src/stories/Popover/Popover.stories.tsx +85 -79
- package/src/stories/Tabs/Tabs.stories.tsx +2 -1
- package/src/stories/Tag/Tag.stories.tsx +11 -1
- package/src/stories/TextArea/TextArea.stories.tsx +3 -3
- package/src/styles.ts +6 -0
- package/tests.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { StyledTag } from '.';
|
|
4
3
|
import { GAP_FROM_SIZE, TSizes } from '../../constants/sizes';
|
|
5
4
|
import { IWithReqoreMinimal, IWithReqoreSize } from '../../types/global';
|
|
6
5
|
|
|
@@ -11,19 +10,14 @@ export interface IReqoreTagGroup
|
|
|
11
10
|
children: any;
|
|
12
11
|
gapSize?: TSizes;
|
|
13
12
|
columns?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
14
|
-
|
|
13
|
+
wrap?: boolean;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
const StyledTagGroup = styled.div`
|
|
18
17
|
flex-shrink: 0;
|
|
19
|
-
|
|
20
|
-
${
|
|
21
|
-
|
|
22
|
-
margin-right: ${({ gapSize }: IReqoreTagGroup) => `${GAP_FROM_SIZE[gapSize]}px`};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
margin-bottom: ${({ hasBottomMargin }) => (hasBottomMargin ? '5px' : '0px')};
|
|
26
|
-
}
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: ${({ wrap }: IReqoreTagGroup) => (wrap ? 'wrap' : 'nowrap')};
|
|
20
|
+
gap: ${({ gapSize }: IReqoreTagGroup) => GAP_FROM_SIZE[gapSize]}px;
|
|
27
21
|
`;
|
|
28
22
|
|
|
29
23
|
const ReqoreTagGroup = ({
|
|
@@ -33,13 +27,13 @@ const ReqoreTagGroup = ({
|
|
|
33
27
|
minimal,
|
|
34
28
|
className,
|
|
35
29
|
columns,
|
|
36
|
-
|
|
30
|
+
wrap = true,
|
|
37
31
|
...rest
|
|
38
32
|
}: IReqoreTagGroup) => (
|
|
39
33
|
<StyledTagGroup
|
|
40
34
|
{...rest}
|
|
41
35
|
gapSize={gapSize}
|
|
42
|
-
|
|
36
|
+
wrap={wrap}
|
|
43
37
|
className={`${className || ''} reqore-tag-group`}
|
|
44
38
|
>
|
|
45
39
|
{React.Children.map(children, (child) =>
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from '../../helpers/colors';
|
|
22
22
|
import { useCombinedRefs } from '../../hooks/useCombinedRefs';
|
|
23
23
|
import { useTooltip } from '../../hooks/useTooltip';
|
|
24
|
+
import { ActiveIconScale, InactiveIconScale } from '../../styles';
|
|
24
25
|
import {
|
|
25
26
|
IReqoreDisabled,
|
|
26
27
|
IReqoreIntent,
|
|
@@ -50,6 +51,9 @@ export interface IReqoreTagProps
|
|
|
50
51
|
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
51
52
|
icon?: IReqoreIconName;
|
|
52
53
|
rightIcon?: IReqoreIconName;
|
|
54
|
+
iconColor?: TReqoreEffectColor;
|
|
55
|
+
leftIconColor?: TReqoreEffectColor;
|
|
56
|
+
rightIconColor?: TReqoreEffectColor;
|
|
53
57
|
color?: TReqoreEffectColor;
|
|
54
58
|
actions?: IReqoreTagAction[];
|
|
55
59
|
width?: string;
|
|
@@ -81,6 +85,8 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
|
|
|
81
85
|
width: ${({ width }) => width || undefined};
|
|
82
86
|
transition: all 0.2s ease-out;
|
|
83
87
|
|
|
88
|
+
${InactiveIconScale};
|
|
89
|
+
|
|
84
90
|
${({ wrap, hasWidth }) =>
|
|
85
91
|
wrap || hasWidth
|
|
86
92
|
? css`
|
|
@@ -106,16 +112,24 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
|
|
|
106
112
|
`}
|
|
107
113
|
|
|
108
114
|
${({ theme, color, interactive, minimal, effect }) =>
|
|
109
|
-
interactive
|
|
115
|
+
interactive
|
|
110
116
|
? css`
|
|
111
117
|
cursor: pointer;
|
|
112
118
|
&:hover {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
.reqore-tag-content,
|
|
120
|
+
.reqore-tag-key-content {
|
|
121
|
+
${ActiveIconScale}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
${!effect?.gradient &&
|
|
125
|
+
css`
|
|
126
|
+
background-color: ${changeLightness(color || theme.main, color ? 0.05 : 0.15)};
|
|
127
|
+
color: ${minimal
|
|
128
|
+
? getReadableColor(theme, undefined, undefined, false, theme.originalMain)
|
|
129
|
+
: color
|
|
130
|
+
? getReadableColorFrom(color)
|
|
131
|
+
: getReadableColor(theme, undefined, undefined)};
|
|
132
|
+
`}
|
|
119
133
|
}
|
|
120
134
|
`
|
|
121
135
|
: undefined}
|
|
@@ -130,8 +144,6 @@ export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
|
|
|
130
144
|
`}
|
|
131
145
|
`;
|
|
132
146
|
|
|
133
|
-
const StyledTagRightIcon = styled(ReqoreIcon)``;
|
|
134
|
-
|
|
135
147
|
const StyledTagKeyWrapper = styled.span<{ size: TSizes }>`
|
|
136
148
|
display: flex;
|
|
137
149
|
align-items: center;
|
|
@@ -227,6 +239,9 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
227
239
|
minimal,
|
|
228
240
|
wrap = false,
|
|
229
241
|
width,
|
|
242
|
+
leftIconColor,
|
|
243
|
+
rightIconColor,
|
|
244
|
+
iconColor,
|
|
230
245
|
...rest
|
|
231
246
|
}: IReqoreTagProps,
|
|
232
247
|
ref
|
|
@@ -276,7 +291,14 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
276
291
|
hasWidth={!!width}
|
|
277
292
|
hasKey={!!labelKey}
|
|
278
293
|
>
|
|
279
|
-
{icon &&
|
|
294
|
+
{icon && (
|
|
295
|
+
<ReqoreIcon
|
|
296
|
+
icon={icon}
|
|
297
|
+
size={size}
|
|
298
|
+
margin={label ? 'left' : 'both'}
|
|
299
|
+
color={leftIconColor || iconColor}
|
|
300
|
+
/>
|
|
301
|
+
)}
|
|
280
302
|
{labelKey && (
|
|
281
303
|
<StyledTagContentKey wrap={wrap} hasWidth={!!width} size={size}>
|
|
282
304
|
{labelKey}
|
|
@@ -299,10 +321,11 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
299
321
|
</StyledTagContent>
|
|
300
322
|
) : null}
|
|
301
323
|
{rightIcon && (
|
|
302
|
-
<
|
|
324
|
+
<ReqoreIcon
|
|
303
325
|
icon={rightIcon}
|
|
304
326
|
size={size}
|
|
305
327
|
margin={label || icon ? 'right' : 'both'}
|
|
328
|
+
color={rightIconColor || iconColor}
|
|
306
329
|
/>
|
|
307
330
|
)}
|
|
308
331
|
</StyledTagContentWrapper>
|
|
@@ -324,7 +347,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
324
347
|
? { tooltip: action.tooltip }
|
|
325
348
|
: action.tooltip
|
|
326
349
|
: {})}
|
|
327
|
-
|
|
350
|
+
isReqoreComponent
|
|
328
351
|
>
|
|
329
352
|
<ReqoreIcon icon={action.icon} size={size} />
|
|
330
353
|
</ReqorePopover>
|
|
@@ -341,7 +364,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
|
|
|
341
364
|
onClick: onRemoveClick,
|
|
342
365
|
effect: rest.effect,
|
|
343
366
|
}}
|
|
344
|
-
|
|
367
|
+
isReqoreComponent
|
|
345
368
|
content='Remove'
|
|
346
369
|
>
|
|
347
370
|
<ReqoreIcon icon='CloseLine' size={size} />
|
package/src/hooks/usePopover.tsx
CHANGED
|
@@ -32,6 +32,8 @@ export default [
|
|
|
32
32
|
tooltip: 'This is a test item',
|
|
33
33
|
headerSize: 2,
|
|
34
34
|
contentSize: 'huge',
|
|
35
|
+
selected: true,
|
|
36
|
+
icon: 'Hashtag',
|
|
35
37
|
content:
|
|
36
38
|
'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',
|
|
37
39
|
tags: [
|
|
@@ -58,6 +60,13 @@ export default [
|
|
|
58
60
|
minimal: false,
|
|
59
61
|
badge: 0,
|
|
60
62
|
},
|
|
63
|
+
{
|
|
64
|
+
icon: 'ZcoolLine',
|
|
65
|
+
label: 'Item without fade',
|
|
66
|
+
content:
|
|
67
|
+
'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 Hello I am a test item content and I am very long so will wrap to the next line and I will be very long. 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. 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. 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. 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. 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. 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 Hello I am a test item content and I am very long so will wrap to the next line and I will be very long. 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. 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. 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. 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. 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',
|
|
68
|
+
showContentFade: false,
|
|
69
|
+
},
|
|
61
70
|
{
|
|
62
71
|
icon: 'FolderWarningFill',
|
|
63
72
|
label: 'Expandable item',
|
|
@@ -82,6 +91,7 @@ export default [
|
|
|
82
91
|
{
|
|
83
92
|
label: 'Item with custom content when expanded',
|
|
84
93
|
tooltip: 'Expandable item with custom content',
|
|
94
|
+
selected: true,
|
|
85
95
|
content:
|
|
86
96
|
'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. 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. 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. 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. 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. 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',
|
|
87
97
|
expandable: true,
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
21
21
|
return (
|
|
22
22
|
<>
|
|
23
|
-
<ReqoreControlGroup size={buttonProps.size}>
|
|
23
|
+
<ReqoreControlGroup size={buttonProps.size} wrap>
|
|
24
24
|
<ReqoreButton {...buttonProps} icon='BankFill' rightIcon={null} />
|
|
25
25
|
<ReqoreButton {...buttonProps} />
|
|
26
26
|
<ReqoreButton {...buttonProps}>Default</ReqoreButton>
|
|
@@ -41,14 +41,21 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
41
41
|
</ReqoreButton>
|
|
42
42
|
</ReqoreControlGroup>
|
|
43
43
|
<br />
|
|
44
|
-
<ReqoreControlGroup size={buttonProps.size}>
|
|
44
|
+
<ReqoreControlGroup size={buttonProps.size} wrap>
|
|
45
45
|
<ReqoreButton {...buttonProps} active flat={false} tooltip='hello'>
|
|
46
46
|
Active Not Flat
|
|
47
47
|
</ReqoreButton>
|
|
48
48
|
<ReqoreButton {...buttonProps} flat={false}>
|
|
49
49
|
Not Flat
|
|
50
50
|
</ReqoreButton>
|
|
51
|
-
<ReqoreButton
|
|
51
|
+
<ReqoreButton
|
|
52
|
+
{...buttonProps}
|
|
53
|
+
minimal
|
|
54
|
+
flat={false}
|
|
55
|
+
iconColor='#38fdb2'
|
|
56
|
+
leftIconColor='#33023c:lighten:3'
|
|
57
|
+
rightIconColor='#0a487b:lighten:3'
|
|
58
|
+
>
|
|
52
59
|
Minimal not flat
|
|
53
60
|
</ReqoreButton>
|
|
54
61
|
<ReqoreButton {...buttonProps} readOnly onClick={alert} flat={false}>
|
|
@@ -59,16 +66,17 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
59
66
|
</ReqoreButton>
|
|
60
67
|
</ReqoreControlGroup>
|
|
61
68
|
<br />
|
|
62
|
-
<ReqoreControlGroup fluid>
|
|
69
|
+
<ReqoreControlGroup fluid wrap>
|
|
63
70
|
<ReqoreButton {...buttonProps} fluid>
|
|
64
71
|
Fluid button
|
|
65
72
|
</ReqoreButton>
|
|
66
73
|
</ReqoreControlGroup>
|
|
67
74
|
<br />
|
|
68
|
-
<ReqoreControlGroup>
|
|
75
|
+
<ReqoreControlGroup wrap>
|
|
69
76
|
<ReqoreButton
|
|
70
77
|
{...buttonProps}
|
|
71
78
|
description='This is a very interesting description for a button, I like it very much'
|
|
79
|
+
iconColor='#38fdb2'
|
|
72
80
|
>
|
|
73
81
|
With Default Description
|
|
74
82
|
</ReqoreButton>
|
|
@@ -109,7 +117,7 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
109
117
|
/>
|
|
110
118
|
</ReqoreControlGroup>
|
|
111
119
|
<br />
|
|
112
|
-
<ReqoreControlGroup>
|
|
120
|
+
<ReqoreControlGroup wrap>
|
|
113
121
|
<ReqoreButton {...buttonProps} readOnly badge={10} onClick={alert}>
|
|
114
122
|
Read only with badge
|
|
115
123
|
</ReqoreButton>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
2
|
import Checkbox from '../../components/Checkbox';
|
|
3
|
-
import { ReqoreCheckbox, ReqoreControlGroup } from '../../index';
|
|
3
|
+
import { ReqoreCheckbox, ReqoreControlGroup, ReqoreVerticalSpacer } from '../../index';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Components/Checkbox',
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
const Template: ComponentStory<typeof Checkbox> = (args) => {
|
|
11
11
|
return (
|
|
12
12
|
<ReqoreControlGroup vertical>
|
|
13
|
-
<ReqoreControlGroup>
|
|
13
|
+
<ReqoreControlGroup wrap>
|
|
14
14
|
<ReqoreCheckbox {...args} />
|
|
15
15
|
<ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelDetailPosition='left' />
|
|
16
16
|
<ReqoreCheckbox {...args} checked tooltip='I am checked' />
|
|
@@ -18,7 +18,8 @@ const Template: ComponentStory<typeof Checkbox> = (args) => {
|
|
|
18
18
|
<ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelPosition='left' />
|
|
19
19
|
<ReqoreCheckbox {...args} label='Read Only' labelPosition='left' readOnly />
|
|
20
20
|
</ReqoreControlGroup>
|
|
21
|
-
<
|
|
21
|
+
<ReqoreVerticalSpacer height={10} />
|
|
22
|
+
<ReqoreControlGroup wrap>
|
|
22
23
|
<ReqoreCheckbox {...args} intent='info' checked />
|
|
23
24
|
<ReqoreCheckbox
|
|
24
25
|
{...args}
|
|
@@ -2,7 +2,7 @@ import { Meta, Story } from '@storybook/react';
|
|
|
2
2
|
import { IReqoreCollectionProps, ReqoreCollection } from '../../components/Collection';
|
|
3
3
|
import { IReqoreColumnsProps } from '../../components/Columns';
|
|
4
4
|
import items from '../../mock/collectionData';
|
|
5
|
-
import {
|
|
5
|
+
import { IntentArg, SizeArg, argManager } from '../utils/args';
|
|
6
6
|
|
|
7
7
|
export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
8
8
|
multipleColumns?: boolean;
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
description: 'If true, the collection will be rounded when stacked',
|
|
46
46
|
}),
|
|
47
47
|
...createArg('height', {
|
|
48
|
-
defaultValue:
|
|
48
|
+
defaultValue: undefined,
|
|
49
49
|
type: 'string',
|
|
50
50
|
name: 'Height',
|
|
51
51
|
description: 'Height of the collection',
|
|
@@ -72,6 +72,8 @@ const Template: Story<IReqoreCollectionProps> = (args) => {
|
|
|
72
72
|
return (
|
|
73
73
|
<ReqoreCollection
|
|
74
74
|
{...args}
|
|
75
|
+
badge={10}
|
|
76
|
+
selectedIcon='CheckLine'
|
|
75
77
|
actions={[{ label: 'Custom action', icon: 'Home7Line' }, { actions: [{ value: 'Test' }] }]}
|
|
76
78
|
/>
|
|
77
79
|
);
|
|
@@ -83,6 +85,13 @@ Basic.args = {
|
|
|
83
85
|
items,
|
|
84
86
|
};
|
|
85
87
|
|
|
88
|
+
export const WithHeight = Template.bind({});
|
|
89
|
+
WithHeight.args = {
|
|
90
|
+
label: 'Collection of items',
|
|
91
|
+
height: '600px',
|
|
92
|
+
items,
|
|
93
|
+
};
|
|
94
|
+
|
|
86
95
|
export const Stacked = Template.bind({});
|
|
87
96
|
Stacked.args = {
|
|
88
97
|
label: 'Collection of items',
|
|
@@ -96,3 +105,10 @@ Fill.args = {
|
|
|
96
105
|
fill: true,
|
|
97
106
|
items,
|
|
98
107
|
};
|
|
108
|
+
|
|
109
|
+
export const SelectedFirst = Template.bind({});
|
|
110
|
+
SelectedFirst.args = {
|
|
111
|
+
label: 'Collection of items',
|
|
112
|
+
items,
|
|
113
|
+
showSelectedFirst: true,
|
|
114
|
+
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
2
|
import { IReqoreControlGroupProps } from '../../components/ControlGroup';
|
|
3
3
|
import ReqoreInput from '../../components/Input';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ReqoreButton,
|
|
6
|
+
ReqoreCheckbox,
|
|
7
|
+
ReqoreControlGroup,
|
|
8
|
+
ReqoreTag,
|
|
9
|
+
ReqoreVerticalSpacer,
|
|
10
|
+
} from '../../index';
|
|
5
11
|
import { GapSizeArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
6
12
|
|
|
7
13
|
const { createArg } = argManager<IReqoreControlGroupProps>();
|
|
@@ -35,37 +41,60 @@ export default {
|
|
|
35
41
|
|
|
36
42
|
const Template: Story<IReqoreControlGroupProps> = (args: IReqoreControlGroupProps) => {
|
|
37
43
|
return (
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
<>
|
|
45
|
+
<ReqoreControlGroup {...args}>
|
|
46
|
+
<ReqoreButton icon='PictureInPictureLine'>Button</ReqoreButton>
|
|
47
|
+
<ReqoreButton
|
|
48
|
+
icon='PictureInPictureLine'
|
|
49
|
+
flat={false}
|
|
50
|
+
effect={{ gradient: { colors: { 0: 'success', 100: 'info:darken:1' } } }}
|
|
51
|
+
>
|
|
52
|
+
Non flat Button
|
|
53
|
+
</ReqoreButton>
|
|
54
|
+
<ReqoreButton maxWidth='300px'>Button with max width</ReqoreButton>
|
|
55
|
+
<ReqoreTag label='A wild tag appears!' color='main:lighten:2' />
|
|
56
|
+
<ReqoreCheckbox
|
|
57
|
+
asSwitch
|
|
58
|
+
label='Switchy switch'
|
|
59
|
+
margin='both'
|
|
60
|
+
intent='warning'
|
|
61
|
+
checkedIcon='CheckFill'
|
|
62
|
+
checked
|
|
63
|
+
uncheckedIcon='CheckboxBlankLine'
|
|
64
|
+
/>
|
|
65
|
+
<ReqoreInput icon='4KFill' value='Hello' />
|
|
66
|
+
<ReqoreButton disabled fixed>
|
|
67
|
+
Disabled & Fixed
|
|
68
|
+
</ReqoreButton>
|
|
69
|
+
<ReqoreCheckbox checked margin='both'>
|
|
70
|
+
Checkbox
|
|
71
|
+
</ReqoreCheckbox>
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
<ReqoreButton minimal>Minimal</ReqoreButton>
|
|
74
|
+
<ReqoreTag label='smol tag' size='small' />
|
|
75
|
+
</ReqoreControlGroup>
|
|
76
|
+
<ReqoreVerticalSpacer height={15} />
|
|
77
|
+
<ReqoreControlGroup {...args} className='root-group'>
|
|
78
|
+
<ReqoreControlGroup intent='info' className='group-1'>
|
|
79
|
+
<ReqoreButton icon='PictureInPictureLine'>Group 1</ReqoreButton>
|
|
80
|
+
<ReqoreTag icon='PictureInPictureLine' label='Group 1' />
|
|
81
|
+
</ReqoreControlGroup>
|
|
82
|
+
<ReqoreButton icon='PictureInPictureLine'>Root group</ReqoreButton>
|
|
83
|
+
<ReqoreControlGroup intent='success' className='group-2'>
|
|
84
|
+
<ReqoreButton icon='PictureInPictureLine'>Group 2</ReqoreButton>
|
|
85
|
+
<ReqoreControlGroup intent='danger' className='group-3'>
|
|
86
|
+
<ReqoreButton icon='PictureInPictureLine'>Group 3</ReqoreButton>
|
|
87
|
+
<ReqoreButton icon='PictureInPictureLine'>Group 3</ReqoreButton>
|
|
88
|
+
</ReqoreControlGroup>
|
|
89
|
+
<ReqoreCheckbox label='Group 2' margin='both' />
|
|
90
|
+
</ReqoreControlGroup>
|
|
91
|
+
<ReqoreButton icon='PictureInPictureLine'>Root group</ReqoreButton>
|
|
92
|
+
<ReqoreControlGroup intent='warning' className='group-4'>
|
|
93
|
+
<ReqoreButton icon='PictureInPictureLine'>Group 4</ReqoreButton>
|
|
94
|
+
<ReqoreInput icon='PictureInPictureLine' value='Group 4' />
|
|
95
|
+
</ReqoreControlGroup>
|
|
96
|
+
</ReqoreControlGroup>
|
|
97
|
+
</>
|
|
69
98
|
);
|
|
70
99
|
};
|
|
71
100
|
|
|
@@ -85,6 +114,13 @@ Vertical.args = {
|
|
|
85
114
|
vertical: true,
|
|
86
115
|
};
|
|
87
116
|
|
|
117
|
+
export const VerticalStacked = Template.bind({});
|
|
118
|
+
VerticalStacked.args = {
|
|
119
|
+
vertical: true,
|
|
120
|
+
stack: true,
|
|
121
|
+
fluid: true,
|
|
122
|
+
};
|
|
123
|
+
|
|
88
124
|
export const Stacked = Template.bind({});
|
|
89
125
|
Stacked.args = {
|
|
90
126
|
stack: true,
|
|
@@ -94,3 +130,8 @@ export const BigGapSize = Template.bind({});
|
|
|
94
130
|
BigGapSize.args = {
|
|
95
131
|
gapSize: 'big',
|
|
96
132
|
};
|
|
133
|
+
|
|
134
|
+
export const Wrap = Template.bind({});
|
|
135
|
+
Wrap.args = {
|
|
136
|
+
wrap: true,
|
|
137
|
+
};
|
|
@@ -159,11 +159,21 @@ const Template: Story<IReqoreDropdownProps> = (args: IReqoreDropdownProps) => {
|
|
|
159
159
|
|
|
160
160
|
return (
|
|
161
161
|
<>
|
|
162
|
-
<ReqoreControlGroup>
|
|
162
|
+
<ReqoreControlGroup wrap>
|
|
163
163
|
<ReqoreDropdown label='Default Dropdown' {...args} />
|
|
164
164
|
<ReqoreDropdown label='Disabled if empty' {...args} items={[]} />
|
|
165
|
-
<ReqoreDropdown
|
|
166
|
-
|
|
165
|
+
<ReqoreDropdown
|
|
166
|
+
icon='SunCloudyLine'
|
|
167
|
+
label='Custom icon'
|
|
168
|
+
{...args}
|
|
169
|
+
leftIconColor='warning:lighten:2'
|
|
170
|
+
/>
|
|
171
|
+
<ReqoreDropdown
|
|
172
|
+
rightIcon='SunCloudyLine'
|
|
173
|
+
caretPosition='right'
|
|
174
|
+
{...args}
|
|
175
|
+
iconColor='success:lighten:2'
|
|
176
|
+
>
|
|
167
177
|
Custom icon with caret on right
|
|
168
178
|
</ReqoreDropdown>
|
|
169
179
|
<ReqoreDropdown
|
|
@@ -26,7 +26,7 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<>
|
|
29
|
-
<ReqoreControlGroup>
|
|
29
|
+
<ReqoreControlGroup wrap>
|
|
30
30
|
<ReqoreInput {...args} placeholder='Reqore Input' onChange={handleValueChange} />
|
|
31
31
|
<ReqoreInput {...args} placeholder='Minimal Input' minimal onChange={handleValueChange} />
|
|
32
32
|
<ReqoreInput
|
|
@@ -38,6 +38,7 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
38
38
|
/>
|
|
39
39
|
<ReqoreInput
|
|
40
40
|
{...args}
|
|
41
|
+
iconColor='pending:lighten:2'
|
|
41
42
|
placeholder='Clearable Input'
|
|
42
43
|
onClearClick={handleValueClear}
|
|
43
44
|
onChange={handleValueChange}
|
|
@@ -51,7 +52,7 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
|
|
|
51
52
|
/>
|
|
52
53
|
</ReqoreControlGroup>
|
|
53
54
|
<br />
|
|
54
|
-
<ReqoreControlGroup>
|
|
55
|
+
<ReqoreControlGroup wrap>
|
|
55
56
|
<ReqoreInput
|
|
56
57
|
{...args}
|
|
57
58
|
placeholder='Reqore Input'
|
|
@@ -118,6 +118,7 @@ const Template: Story<IReqoreMenuProps> = (args) => {
|
|
|
118
118
|
{
|
|
119
119
|
icon: 'EmotionUnhappyLine',
|
|
120
120
|
rightIcon: 'Scissors2Fill',
|
|
121
|
+
leftIconColor: 'danger:lighten',
|
|
121
122
|
wrap: args.wrapText,
|
|
122
123
|
flat: args.flat,
|
|
123
124
|
} as IReqoreMenuItemProps
|
|
@@ -148,6 +149,7 @@ const Template: Story<IReqoreMenuProps> = (args) => {
|
|
|
148
149
|
</ReqoreMenu>
|
|
149
150
|
}
|
|
150
151
|
isReqoreComponent
|
|
152
|
+
noWrapper
|
|
151
153
|
handler='click'
|
|
152
154
|
placement='right'
|
|
153
155
|
>
|
|
@@ -52,6 +52,13 @@ Minimal.args = {
|
|
|
52
52
|
intent: 'danger',
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
+
export const WithIconColor: Story<IReqoreMessageProps> = Template.bind({});
|
|
56
|
+
WithIconColor.args = {
|
|
57
|
+
minimal: true,
|
|
58
|
+
intent: 'success',
|
|
59
|
+
iconColor: '#00fd9f',
|
|
60
|
+
};
|
|
61
|
+
|
|
55
62
|
export const Opaque: Story<IReqoreMessageProps> = Template.bind({});
|
|
56
63
|
Opaque.args = {
|
|
57
64
|
opaque: true,
|