@qoretechnologies/reqore 0.36.0 → 0.36.1
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 -22
- package/__tests__/table.test.tsx +1 -1
- package/__tests__/tree.test.tsx +0 -18
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +1 -4
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +11 -26
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +2 -2
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +10 -10
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.d.ts +3 -3
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/index.d.ts +1 -1
- package/dist/components/Columns/index.d.ts.map +1 -1
- package/dist/components/Comment/index.d.ts +1 -1
- package/dist/components/Comment/index.d.ts.map +1 -1
- package/dist/components/CommentFeed/index.d.ts +1 -1
- package/dist/components/CommentFeed/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.d.ts +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.d.ts +1 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/item.d.ts +2 -2
- package/dist/components/Dropdown/item.d.ts.map +1 -1
- package/dist/components/Dropdown/list.d.ts +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Effect/index.d.ts +2 -2
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/ExportModal/index.d.ts +11 -0
- package/dist/components/ExportModal/index.d.ts.map +1 -0
- package/dist/components/ExportModal/index.js +91 -0
- package/dist/components/ExportModal/index.js.map +1 -0
- package/dist/components/Header/index.d.ts +7 -7
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +1 -0
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/KeyValueTable/index.d.ts +4 -4
- package/dist/components/KeyValueTable/index.d.ts.map +1 -1
- package/dist/components/KeyValueTable/index.js.map +1 -1
- package/dist/components/Layout/content.d.ts +1 -1
- package/dist/components/Layout/content.d.ts.map +1 -1
- package/dist/components/Layout/index.d.ts +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Menu/item.d.ts +1 -1
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +3 -3
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +2 -2
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +3 -3
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Paging/index.d.ts +1 -1
- package/dist/components/Paging/index.d.ts.map +1 -1
- package/dist/components/Panel/NonResponsiveActions.d.ts +1 -1
- package/dist/components/Panel/NonResponsiveActions.d.ts.map +1 -1
- package/dist/components/Panel/index.js +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Panel/panel.screenshot.d.ts +1 -1
- package/dist/components/Panel/panel.screenshot.d.ts.map +1 -1
- package/dist/components/Paragraph/index.d.ts +1 -1
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/Sidebar/item.d.ts +1 -1
- package/dist/components/Sidebar/item.d.ts.map +1 -1
- package/dist/components/Spacer/index.d.ts +3 -3
- package/dist/components/Spacer/index.d.ts.map +1 -1
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/Spinner/index.d.ts.map +1 -1
- package/dist/components/Table/body.d.ts +1 -1
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +4 -2
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.d.ts +1 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/helpers.d.ts +8 -6
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +49 -16
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +5 -4
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +45 -38
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +7 -5
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +3 -2
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/value.d.ts +1 -1
- package/dist/components/Table/value.d.ts.map +1 -1
- package/dist/components/Tabs/content.d.ts +1 -1
- package/dist/components/Tabs/content.d.ts.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/list.d.ts +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 +1 -1
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tree/index.d.ts +2 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +35 -31
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/containers/Paging.d.ts +1 -1
- package/dist/containers/Paging.d.ts.map +1 -1
- package/dist/containers/ThemeProvider.d.ts +1 -1
- package/dist/containers/ThemeProvider.d.ts.map +1 -1
- package/dist/helpers/utils.d.ts +2 -1
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +20 -2
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/useAutoFocus.d.ts +1 -1
- package/dist/hooks/useAutoFocus.d.ts.map +1 -1
- package/dist/hooks/usePopover.d.ts +1 -0
- package/dist/hooks/usePopover.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.d.ts +3 -0
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +49 -11
- package/dist/styles.js.map +1 -1
- package/migration-storybook.log +88 -0
- package/package.json +26 -20
- package/src/components/Breadcrumbs/index.tsx +1 -1
- package/src/components/Button/index.tsx +3 -54
- package/src/components/Collection/index.tsx +18 -15
- package/src/components/Collection/item.tsx +2 -1
- package/src/components/ExportModal/index.tsx +98 -0
- package/src/components/KeyValueTable/index.tsx +17 -11
- package/src/components/Menu/item.tsx +4 -4
- package/src/components/Notifications/notification.tsx +2 -2
- package/src/components/Panel/index.tsx +2 -2
- package/src/components/Table/body.tsx +6 -3
- package/src/components/Table/helpers.ts +52 -21
- package/src/components/Table/index.tsx +108 -75
- package/src/components/Table/row.tsx +12 -7
- package/src/components/Tabs/list.tsx +1 -1
- package/src/components/Tree/index.tsx +82 -75
- package/src/helpers/utils.ts +10 -2
- package/src/hooks/useAutoFocus.ts +1 -1
- package/src/index.tsx +1 -1
- package/src/mock/tableData.ts +12 -0
- package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +11 -23
- package/src/stories/Button/Button.stories.tsx +83 -47
- package/src/stories/Checkbox/Checkbox.stories.tsx +19 -9
- package/src/stories/Collection/Collection.stories.tsx +195 -171
- package/src/stories/Columns/Columns.stories.tsx +38 -24
- package/src/stories/Comment/Comment.stories.tsx +15 -6
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +102 -48
- package/src/stories/Drawer/Drawer.stories.tsx +52 -17
- package/src/stories/Dropdown/Dropdown.stories.tsx +184 -152
- package/src/stories/ExportModal/ExportModal.stories.tsx +18 -0
- package/src/stories/Header/Header.stories.tsx +65 -31
- package/src/stories/Icon/Icon.stories.tsx +139 -133
- package/src/stories/Input/Input.stories.tsx +68 -31
- package/src/stories/KeyValueTable/KeyValueTable.stories.tsx +143 -118
- package/src/stories/Menu/Menu.stories.tsx +56 -20
- package/src/stories/Message/Message.stories.tsx +71 -37
- package/src/stories/Modal/Modal.stories.tsx +28 -8
- package/src/stories/MultiSelect/MultiSelect.stories.tsx +66 -35
- package/src/stories/Navbar/Navbar.stories.tsx +15 -5
- package/src/stories/Notifications/Interactive.stories.tsx +40 -28
- package/src/stories/Notifications/Notification.stories.tsx +55 -41
- package/src/stories/Notifications/Notifications.stories.tsx +45 -29
- package/src/stories/Paging/Paging.stories.tsx +206 -177
- package/src/stories/Panel/Panel.stories.tsx +238 -168
- package/src/stories/Paragraph/Paragraph.stories.tsx +66 -31
- package/src/stories/Popover/Popover.stories.tsx +62 -40
- package/src/stories/RadioGroup/RadioGroup.stories.tsx +41 -19
- package/src/stories/Sidebar/Sidebar.stories.tsx +29 -10
- package/src/stories/Spacer/Spacer.stories.tsx +13 -5
- package/src/stories/Spinner/Spinner.stories.tsx +26 -12
- package/src/stories/Table/Table.stories.tsx +200 -144
- package/src/stories/Table/Tests.stories.tsx +9 -0
- package/src/stories/Tabs/Tabs.stories.tsx +82 -46
- package/src/stories/Tag/Tag.stories.tsx +56 -37
- package/src/stories/Tag/TagGroup.stories.tsx +297 -0
- package/src/stories/TextArea/TextArea.stories.tsx +82 -40
- package/src/stories/Tree/Tree.stories.tsx +84 -22
- package/src/stories/utils.ts +22 -1
- package/src/styles.ts +55 -2
- package/tests.json +1 -1
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import { IReqoreTagProps } from '../../components/Tag';
|
|
4
4
|
import { IReqoreTagGroup } from '../../components/Tag/group';
|
|
5
5
|
import { ReqoreTag, ReqoreTagGroup } from '../../index';
|
|
6
|
+
import { StoryMeta } from '../utils';
|
|
6
7
|
import { SizeArg, argManager } from '../utils/args';
|
|
7
8
|
|
|
8
9
|
const { createArg } = argManager<IReqoreTagGroup & IReqoreTagProps>();
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const meta = {
|
|
11
12
|
title: 'Form/Tag/Stories',
|
|
13
|
+
component: ReqoreTag,
|
|
14
|
+
args: {
|
|
15
|
+
onClick: noop,
|
|
16
|
+
onRemoveClick: noop,
|
|
17
|
+
rightIcon: 'EBike2Line',
|
|
18
|
+
actions: [
|
|
19
|
+
{
|
|
20
|
+
icon: '24HoursFill',
|
|
21
|
+
onClick: noop,
|
|
22
|
+
disabled: true,
|
|
23
|
+
intent: 'info',
|
|
24
|
+
tooltip: { content: 'I am a tooltip' },
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
icon: 'SpyFill',
|
|
28
|
+
onClick: noop,
|
|
29
|
+
intent: 'success',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
12
33
|
argTypes: {
|
|
13
34
|
...SizeArg,
|
|
14
35
|
...createArg('columns', {
|
|
@@ -35,30 +56,19 @@ export default {
|
|
|
35
56
|
control: 'text',
|
|
36
57
|
}),
|
|
37
58
|
...createArg('actions', {
|
|
38
|
-
defaultValue: [
|
|
39
|
-
{
|
|
40
|
-
icon: '24HoursFill',
|
|
41
|
-
onClick: noop,
|
|
42
|
-
disabled: true,
|
|
43
|
-
intent: 'info',
|
|
44
|
-
tooltip: { content: 'I am a tooltip' },
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
icon: 'SpyFill',
|
|
48
|
-
onClick: noop,
|
|
49
|
-
intent: 'success',
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
59
|
table: {
|
|
53
60
|
disable: true,
|
|
54
61
|
},
|
|
55
62
|
}),
|
|
56
63
|
},
|
|
57
|
-
} as
|
|
64
|
+
} as StoryMeta<typeof ReqoreTag>;
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
export default meta;
|
|
67
|
+
type Story = StoryObj<typeof meta>;
|
|
68
|
+
|
|
69
|
+
const Template: StoryFn<IReqoreTagProps> = (args) => {
|
|
60
70
|
return (
|
|
61
|
-
<ReqoreTagGroup
|
|
71
|
+
<ReqoreTagGroup>
|
|
62
72
|
<ReqoreTag {...args} actions={null} onRemoveClick={null} rightIcon={null} label={1} />
|
|
63
73
|
<ReqoreTag
|
|
64
74
|
{...args}
|
|
@@ -321,25 +331,34 @@ const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }
|
|
|
321
331
|
);
|
|
322
332
|
};
|
|
323
333
|
|
|
324
|
-
export const Basic =
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
export const Badge = Template.bind({});
|
|
328
|
-
Badge.args = { asBadge: true };
|
|
329
|
-
export const NoWrap = Template.bind({});
|
|
330
|
-
NoWrap.args = { wrap: false };
|
|
334
|
+
export const Basic: Story = {
|
|
335
|
+
render: Template,
|
|
336
|
+
};
|
|
331
337
|
|
|
332
|
-
export const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
+
export const Badge: Story = {
|
|
339
|
+
render: Template,
|
|
340
|
+
args: { asBadge: true },
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
export const Wrap: Story = {
|
|
344
|
+
render: Template,
|
|
345
|
+
args: { wrap: true },
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
export const Effect = {
|
|
349
|
+
render: Template,
|
|
350
|
+
|
|
351
|
+
args: {
|
|
352
|
+
effect: {
|
|
353
|
+
gradient: {
|
|
354
|
+
direction: 'to right bottom',
|
|
355
|
+
colors: { 0: '#33023c', 100: '#0a487b' },
|
|
356
|
+
},
|
|
357
|
+
color: '#ffffff',
|
|
358
|
+
spaced: 2,
|
|
359
|
+
uppercase: true,
|
|
360
|
+
weight: 'thick',
|
|
361
|
+
textSize: 'small',
|
|
338
362
|
},
|
|
339
|
-
color: '#ffffff',
|
|
340
|
-
spaced: 2,
|
|
341
|
-
uppercase: true,
|
|
342
|
-
weight: 'thick',
|
|
343
|
-
textSize: 'small',
|
|
344
363
|
},
|
|
345
364
|
};
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
|
+
import { noop } from 'lodash';
|
|
3
|
+
import { IReqoreTagGroup } from '../../components/Tag/group';
|
|
4
|
+
import { ReqoreTag, ReqoreTagGroup } from '../../index';
|
|
5
|
+
import { StoryMeta } from '../utils';
|
|
6
|
+
import { SizeArg, argManager } from '../utils/args';
|
|
7
|
+
|
|
8
|
+
const { createArg } = argManager<IReqoreTagGroup>();
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Form/Tag Group/Stories',
|
|
12
|
+
component: ReqoreTagGroup,
|
|
13
|
+
args: {
|
|
14
|
+
onClick: noop,
|
|
15
|
+
onRemoveClick: noop,
|
|
16
|
+
rightIcon: 'EBike2Line',
|
|
17
|
+
actions: [
|
|
18
|
+
{
|
|
19
|
+
icon: '24HoursFill',
|
|
20
|
+
onClick: noop,
|
|
21
|
+
disabled: true,
|
|
22
|
+
intent: 'info',
|
|
23
|
+
tooltip: { content: 'I am a tooltip' },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
icon: 'SpyFill',
|
|
27
|
+
onClick: noop,
|
|
28
|
+
intent: 'success',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
argTypes: {
|
|
33
|
+
...SizeArg,
|
|
34
|
+
...createArg('columns', {
|
|
35
|
+
name: 'Columns',
|
|
36
|
+
description: 'Number of columns',
|
|
37
|
+
control: 'number',
|
|
38
|
+
}),
|
|
39
|
+
...createArg('onClick', {
|
|
40
|
+
defaultValue: noop,
|
|
41
|
+
table: {
|
|
42
|
+
disable: true,
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
} as StoryMeta<typeof ReqoreTagGroup>;
|
|
47
|
+
|
|
48
|
+
export default meta;
|
|
49
|
+
type Story = StoryObj<typeof meta>;
|
|
50
|
+
|
|
51
|
+
const Template: StoryFn<IReqoreTagGroup> = (args) => {
|
|
52
|
+
return (
|
|
53
|
+
<ReqoreTagGroup {...args}>
|
|
54
|
+
<ReqoreTag actions={null} onRemoveClick={null} rightIcon={null} label={1} />
|
|
55
|
+
<ReqoreTag
|
|
56
|
+
actions={null}
|
|
57
|
+
onRemoveClick={null}
|
|
58
|
+
rightIcon={null}
|
|
59
|
+
label='Basic Tag'
|
|
60
|
+
onClick={() => console.log('Tag clicked')}
|
|
61
|
+
/>
|
|
62
|
+
<ReqoreTag actions={null} onRemoveClick={null} rightIcon={null} labelKey='Number' label={2} />
|
|
63
|
+
<ReqoreTag label='With Icon' icon='AlarmWarningLine' />
|
|
64
|
+
<ReqoreTag label='With Icon Colors' icon='AlarmWarningLine' iconColor='warning:lighten:2' />
|
|
65
|
+
<ReqoreTag labelKey='Tag with' label='Label Key' icon='AlarmWarningLine' />
|
|
66
|
+
<ReqoreTag labelKey='Key' label='value' />
|
|
67
|
+
<ReqoreTag icon='QuestionAnswerLine' fixed />
|
|
68
|
+
<ReqoreTag label='Disabled Tag' disabled icon='AlarmWarningLine' />
|
|
69
|
+
<ReqoreTag
|
|
70
|
+
label='300px Tag'
|
|
71
|
+
width='300px'
|
|
72
|
+
fixed
|
|
73
|
+
icon='AlarmWarningLine'
|
|
74
|
+
tooltip='I am wiiiiiiide'
|
|
75
|
+
actions={[
|
|
76
|
+
{
|
|
77
|
+
icon: 'ErrorWarningLine',
|
|
78
|
+
onClick: noop,
|
|
79
|
+
intent: 'info',
|
|
80
|
+
tooltip: {
|
|
81
|
+
content: 'IF YOU CAN SEE ME ITS A BUG!!! I HAVE show: false',
|
|
82
|
+
openOnMount: true,
|
|
83
|
+
intent: 'danger',
|
|
84
|
+
},
|
|
85
|
+
show: false,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
icon: '24HoursFill',
|
|
89
|
+
onClick: noop,
|
|
90
|
+
disabled: true,
|
|
91
|
+
intent: 'info',
|
|
92
|
+
tooltip: { content: 'I am a tooltip' },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
icon: 'SpyFill',
|
|
96
|
+
onClick: noop,
|
|
97
|
+
intent: 'success',
|
|
98
|
+
},
|
|
99
|
+
]}
|
|
100
|
+
/>
|
|
101
|
+
<ReqoreTag
|
|
102
|
+
label='300px fixed Tag with a big description that should wrap and make the tag bigger'
|
|
103
|
+
width='300px'
|
|
104
|
+
fixed
|
|
105
|
+
icon='AlarmWarningLine'
|
|
106
|
+
tooltip='I am wiiiiiiide'
|
|
107
|
+
actions={[
|
|
108
|
+
{
|
|
109
|
+
icon: 'ErrorWarningLine',
|
|
110
|
+
onClick: noop,
|
|
111
|
+
intent: 'info',
|
|
112
|
+
tooltip: {
|
|
113
|
+
content: 'IF YOU CAN SEE ME ITS A BUG!!! I HAVE show: false',
|
|
114
|
+
openOnMount: true,
|
|
115
|
+
intent: 'danger',
|
|
116
|
+
},
|
|
117
|
+
show: false,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
icon: '24HoursFill',
|
|
121
|
+
onClick: noop,
|
|
122
|
+
disabled: true,
|
|
123
|
+
intent: 'info',
|
|
124
|
+
tooltip: { content: 'I am a tooltip' },
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
icon: 'SpyFill',
|
|
128
|
+
onClick: noop,
|
|
129
|
+
intent: 'success',
|
|
130
|
+
},
|
|
131
|
+
]}
|
|
132
|
+
/>
|
|
133
|
+
<ReqoreTag label='Danger Tag' icon='AlarmWarningLine' intent='danger' />
|
|
134
|
+
<ReqoreTag
|
|
135
|
+
label='Custom Color Tag'
|
|
136
|
+
icon='AlarmWarningLine'
|
|
137
|
+
color='#38fdb2'
|
|
138
|
+
tooltip={{ content: 'Hm, another tooltip', openOnMount: true }}
|
|
139
|
+
/>
|
|
140
|
+
<ReqoreTag
|
|
141
|
+
label='Custom Effect Tag'
|
|
142
|
+
effect={{
|
|
143
|
+
gradient: {
|
|
144
|
+
colors: '#ff47a3',
|
|
145
|
+
},
|
|
146
|
+
}}
|
|
147
|
+
labelKeyEffect={{
|
|
148
|
+
gradient: {
|
|
149
|
+
colors: '#b8f58a',
|
|
150
|
+
},
|
|
151
|
+
weight: 'thin',
|
|
152
|
+
spaced: 2,
|
|
153
|
+
uppercase: true,
|
|
154
|
+
}}
|
|
155
|
+
labelEffect={{
|
|
156
|
+
gradient: {
|
|
157
|
+
colors: {
|
|
158
|
+
0: '#00e3e8',
|
|
159
|
+
100: '#143a40',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
weight: 'bold',
|
|
163
|
+
}}
|
|
164
|
+
labelKey='Effect'
|
|
165
|
+
icon='Css3Fill'
|
|
166
|
+
/>
|
|
167
|
+
<ReqoreTag
|
|
168
|
+
label='No Buttons Tag'
|
|
169
|
+
icon='CarLine'
|
|
170
|
+
color='#0b4578'
|
|
171
|
+
actions={null}
|
|
172
|
+
onRemoveClick={null}
|
|
173
|
+
/>
|
|
174
|
+
<ReqoreTag
|
|
175
|
+
label='Minimal Tag'
|
|
176
|
+
minimal
|
|
177
|
+
icon='ShareForward2Fill'
|
|
178
|
+
actions={null}
|
|
179
|
+
onRemoveClick={null}
|
|
180
|
+
/>
|
|
181
|
+
<ReqoreTag
|
|
182
|
+
label='Minimal Tag with Intent'
|
|
183
|
+
minimal
|
|
184
|
+
intent='warning'
|
|
185
|
+
icon='ShareForward2Fill'
|
|
186
|
+
actions={null}
|
|
187
|
+
onRemoveClick={null}
|
|
188
|
+
/>
|
|
189
|
+
<ReqoreTag
|
|
190
|
+
labelKey='This is the key for a wrapped tag'
|
|
191
|
+
label='Wrapped tag with some long text and width specified, no wrap specified'
|
|
192
|
+
icon='ShareForward2Fill'
|
|
193
|
+
width='400px'
|
|
194
|
+
onRemoveClick={null}
|
|
195
|
+
actions={[
|
|
196
|
+
{
|
|
197
|
+
icon: '24HoursFill',
|
|
198
|
+
onClick: noop,
|
|
199
|
+
disabled: true,
|
|
200
|
+
intent: 'info',
|
|
201
|
+
tooltip: { content: 'I am a tooltip' },
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
icon: 'SpyFill',
|
|
205
|
+
onClick: noop,
|
|
206
|
+
intent: 'success',
|
|
207
|
+
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
208
|
+
},
|
|
209
|
+
]}
|
|
210
|
+
/>
|
|
211
|
+
<ReqoreTag
|
|
212
|
+
labelKey='This is the key for a wrapped tag'
|
|
213
|
+
label='Wrapped tag with some long text and NO width specified, AND wrap specified'
|
|
214
|
+
icon='ShareForward2Fill'
|
|
215
|
+
leftIconColor='#00fafd'
|
|
216
|
+
rightIconColor='#eb0e8c'
|
|
217
|
+
wrap
|
|
218
|
+
onRemoveClick={null}
|
|
219
|
+
actions={[
|
|
220
|
+
{
|
|
221
|
+
icon: '24HoursFill',
|
|
222
|
+
onClick: noop,
|
|
223
|
+
disabled: true,
|
|
224
|
+
intent: 'info',
|
|
225
|
+
tooltip: { content: 'I am a tooltip' },
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
icon: 'SpyFill',
|
|
229
|
+
onClick: noop,
|
|
230
|
+
intent: 'success',
|
|
231
|
+
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
232
|
+
},
|
|
233
|
+
]}
|
|
234
|
+
/>
|
|
235
|
+
<ReqoreTag
|
|
236
|
+
labelKey='Fixed'
|
|
237
|
+
fixed='key'
|
|
238
|
+
label='Wrapped tag with some long text and NO width specified, AND wrap specified, with fixed key'
|
|
239
|
+
icon='DriveLine'
|
|
240
|
+
wrap
|
|
241
|
+
onRemoveClick={null}
|
|
242
|
+
actions={[
|
|
243
|
+
{
|
|
244
|
+
icon: '24HoursFill',
|
|
245
|
+
onClick: noop,
|
|
246
|
+
disabled: true,
|
|
247
|
+
intent: 'info',
|
|
248
|
+
tooltip: { content: 'I am a tooltip' },
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
icon: 'SpyFill',
|
|
252
|
+
onClick: noop,
|
|
253
|
+
intent: 'success',
|
|
254
|
+
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
255
|
+
},
|
|
256
|
+
]}
|
|
257
|
+
/>
|
|
258
|
+
<ReqoreTag
|
|
259
|
+
labelKey='Wrapped tag with some long text and NO width specified, AND wrap specified, with fixed label, Wrapped tag with some long text and NO width specified, AND wrap specified, with fixed label'
|
|
260
|
+
fixed='label'
|
|
261
|
+
label='Fixed'
|
|
262
|
+
icon='DriveLine'
|
|
263
|
+
wrap
|
|
264
|
+
onRemoveClick={null}
|
|
265
|
+
actions={[
|
|
266
|
+
{
|
|
267
|
+
icon: '24HoursFill',
|
|
268
|
+
onClick: noop,
|
|
269
|
+
disabled: true,
|
|
270
|
+
intent: 'info',
|
|
271
|
+
tooltip: { content: 'I am a tooltip' },
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
icon: 'SpyFill',
|
|
275
|
+
onClick: noop,
|
|
276
|
+
intent: 'success',
|
|
277
|
+
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
278
|
+
},
|
|
279
|
+
]}
|
|
280
|
+
/>
|
|
281
|
+
</ReqoreTagGroup>
|
|
282
|
+
);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export const Basic: Story = {
|
|
286
|
+
render: Template,
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export const BigGapSize: Story = {
|
|
290
|
+
render: Template,
|
|
291
|
+
args: { gapSize: 'big' },
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export const NoWrap: Story = {
|
|
295
|
+
render: Template,
|
|
296
|
+
args: { wrap: false },
|
|
297
|
+
};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { IReqoreTextareaProps } from '../../components/Textarea';
|
|
4
4
|
import { ReqoreControlGroup, ReqoreTextarea } from '../../index';
|
|
5
|
+
import { StoryMeta } from '../utils';
|
|
5
6
|
import { DisabledArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
6
7
|
|
|
7
8
|
const { createArg } = argManager<IReqoreTextareaProps>();
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
const meta = {
|
|
10
11
|
title: 'Form/TextArea/Stories',
|
|
12
|
+
component: ReqoreTextarea,
|
|
13
|
+
args: {
|
|
14
|
+
scaleWithContent: true,
|
|
15
|
+
fluid: undefined,
|
|
16
|
+
placeholder: 'Placeholder',
|
|
17
|
+
},
|
|
11
18
|
argTypes: {
|
|
12
19
|
...MinimalArg(),
|
|
13
20
|
...DisabledArg,
|
|
@@ -31,7 +38,10 @@ export default {
|
|
|
31
38
|
defaultValue: 'Placeholder',
|
|
32
39
|
}),
|
|
33
40
|
},
|
|
34
|
-
} as
|
|
41
|
+
} as StoryMeta<typeof ReqoreTextarea>;
|
|
42
|
+
|
|
43
|
+
export default meta;
|
|
44
|
+
type Story = StoryObj<typeof meta>;
|
|
35
45
|
|
|
36
46
|
const str =
|
|
37
47
|
'✔ Checking your system\n' +
|
|
@@ -42,7 +52,7 @@ const str =
|
|
|
42
52
|
'✔ Compiling Preload Scripts\n' +
|
|
43
53
|
'✔ Launching Application\n';
|
|
44
54
|
|
|
45
|
-
const Template:
|
|
55
|
+
const Template: StoryFn<IReqoreTextareaProps> = (args) => {
|
|
46
56
|
const [value, setValue] = useState(str);
|
|
47
57
|
|
|
48
58
|
const handleValueChange = (e) => {
|
|
@@ -144,53 +154,85 @@ const Template: Story<IReqoreTextareaProps> = (args) => {
|
|
|
144
154
|
);
|
|
145
155
|
};
|
|
146
156
|
|
|
147
|
-
export const Basic =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
157
|
+
export const Basic: Story = {
|
|
158
|
+
render: Template,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const Info: Story = {
|
|
162
|
+
render: Template,
|
|
163
|
+
|
|
164
|
+
args: {
|
|
165
|
+
intent: 'info',
|
|
166
|
+
},
|
|
151
167
|
};
|
|
152
|
-
|
|
153
|
-
Success
|
|
154
|
-
|
|
168
|
+
|
|
169
|
+
export const Success: Story = {
|
|
170
|
+
render: Template,
|
|
171
|
+
|
|
172
|
+
args: {
|
|
173
|
+
intent: 'success',
|
|
174
|
+
},
|
|
155
175
|
};
|
|
156
|
-
|
|
157
|
-
Warning
|
|
158
|
-
|
|
176
|
+
|
|
177
|
+
export const Warning: Story = {
|
|
178
|
+
render: Template,
|
|
179
|
+
|
|
180
|
+
args: {
|
|
181
|
+
intent: 'warning',
|
|
182
|
+
},
|
|
159
183
|
};
|
|
160
|
-
|
|
161
|
-
Danger
|
|
162
|
-
|
|
184
|
+
|
|
185
|
+
export const Danger: Story = {
|
|
186
|
+
render: Template,
|
|
187
|
+
|
|
188
|
+
args: {
|
|
189
|
+
intent: 'danger',
|
|
190
|
+
},
|
|
163
191
|
};
|
|
164
|
-
|
|
165
|
-
Pending
|
|
166
|
-
|
|
192
|
+
|
|
193
|
+
export const Pending: Story = {
|
|
194
|
+
render: Template,
|
|
195
|
+
|
|
196
|
+
args: {
|
|
197
|
+
intent: 'pending',
|
|
198
|
+
},
|
|
167
199
|
};
|
|
168
|
-
|
|
169
|
-
Muted
|
|
170
|
-
|
|
200
|
+
|
|
201
|
+
export const Muted: Story = {
|
|
202
|
+
render: Template,
|
|
203
|
+
|
|
204
|
+
args: {
|
|
205
|
+
intent: 'muted',
|
|
206
|
+
},
|
|
171
207
|
};
|
|
172
208
|
|
|
173
|
-
export const Custom =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
209
|
+
export const Custom: Story = {
|
|
210
|
+
render: Template,
|
|
211
|
+
|
|
212
|
+
args: {
|
|
213
|
+
customTheme: {
|
|
214
|
+
main: '#38fdb2',
|
|
215
|
+
},
|
|
177
216
|
},
|
|
178
217
|
};
|
|
179
218
|
|
|
180
|
-
export const Effect =
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
219
|
+
export const Effect: Story = {
|
|
220
|
+
render: Template,
|
|
221
|
+
|
|
222
|
+
args: {
|
|
223
|
+
effect: {
|
|
224
|
+
gradient: {
|
|
225
|
+
type: 'radial',
|
|
226
|
+
colors: {
|
|
227
|
+
0: '#361554',
|
|
228
|
+
50: '#160013',
|
|
229
|
+
},
|
|
188
230
|
},
|
|
231
|
+
spaced: 2,
|
|
232
|
+
color: '#ffffff',
|
|
233
|
+
uppercase: true,
|
|
234
|
+
textSize: 'small',
|
|
235
|
+
weight: 'bold',
|
|
189
236
|
},
|
|
190
|
-
spaced: 2,
|
|
191
|
-
color: '#ffffff',
|
|
192
|
-
uppercase: true,
|
|
193
|
-
textSize: 'small',
|
|
194
|
-
weight: 'bold',
|
|
195
237
|
},
|
|
196
238
|
};
|