@qoretechnologies/reqore 0.36.0 → 0.36.2
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/InternalPopover/index.js +2 -2
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyValueTable/index.d.ts +7 -4
- package/dist/components/KeyValueTable/index.d.ts.map +1 -1
- package/dist/components/KeyValueTable/index.js +32 -2
- 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/Message/index.d.ts +1 -0
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.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.d.ts +1 -0
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +23 -16
- 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/Popover/index.js +2 -0
- package/dist/components/Popover/index.js.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 +26 -21
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts +3 -2
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +8 -4
- package/dist/components/Table/cell.js.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 +47 -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 +38 -36
- 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/constants/sizes.js +5 -5
- 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/InternalPopover/index.tsx +2 -2
- package/src/components/KeyValueTable/index.tsx +59 -11
- package/src/components/Menu/item.tsx +4 -4
- package/src/components/Message/index.tsx +1 -0
- package/src/components/Notifications/notification.tsx +14 -3
- package/src/components/Panel/index.tsx +2 -2
- package/src/components/Popover/index.tsx +3 -0
- package/src/components/Table/body.tsx +26 -20
- package/src/components/Table/cell.tsx +15 -4
- package/src/components/Table/helpers.ts +52 -21
- package/src/components/Table/index.tsx +119 -75
- package/src/components/Table/row.tsx +47 -46
- package/src/components/Tabs/list.tsx +1 -1
- package/src/components/Tree/index.tsx +82 -75
- package/src/constants/sizes.ts +5 -5
- 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 +183 -117
- package/src/stories/Menu/Menu.stories.tsx +56 -20
- package/src/stories/Message/Message.stories.tsx +96 -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,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import { useMount } from 'react-use';
|
|
4
4
|
import { IReqoreModalProps } from '../../components/Modal';
|
|
5
5
|
import { ReqoreModal, ReqorePanel, useReqoreProperty } from '../../index';
|
|
6
|
+
import { StoryMeta } from '../utils';
|
|
6
7
|
import { FlatArg, IntentArg, argManager } from '../utils/args';
|
|
7
8
|
|
|
8
9
|
const { createArg } = argManager<IReqoreModalProps>();
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const meta = {
|
|
11
12
|
title: 'Dialogs/Modal/Stories',
|
|
13
|
+
component: ReqoreModal,
|
|
14
|
+
args: {
|
|
15
|
+
isOpen: true,
|
|
16
|
+
label: 'This is a test',
|
|
17
|
+
blur: 3,
|
|
18
|
+
opacity: 1,
|
|
19
|
+
hasBackdrop: true,
|
|
20
|
+
width: '80vw',
|
|
21
|
+
height: '50vh',
|
|
22
|
+
},
|
|
12
23
|
argTypes: {
|
|
13
24
|
...IntentArg,
|
|
14
25
|
...FlatArg,
|
|
@@ -49,9 +60,12 @@ export default {
|
|
|
49
60
|
type: 'string',
|
|
50
61
|
}),
|
|
51
62
|
},
|
|
52
|
-
} as
|
|
63
|
+
} as StoryMeta<typeof ReqoreModal>;
|
|
64
|
+
|
|
65
|
+
export default meta;
|
|
66
|
+
type Story = StoryObj<typeof meta>;
|
|
53
67
|
|
|
54
|
-
const Template:
|
|
68
|
+
const Template: StoryFn<IReqoreModalProps & { confirm?: boolean }> = (args) => {
|
|
55
69
|
const confirmAction = useReqoreProperty('confirmAction');
|
|
56
70
|
|
|
57
71
|
useMount(() => {
|
|
@@ -218,8 +232,14 @@ const Template: Story<IReqoreModalProps & { confirm?: boolean }> = (args) => {
|
|
|
218
232
|
);
|
|
219
233
|
};
|
|
220
234
|
|
|
221
|
-
export const Basic =
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
235
|
+
export const Basic: Story = {
|
|
236
|
+
render: Template,
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export const ConfirmationModal: Story = {
|
|
240
|
+
render: Template,
|
|
241
|
+
|
|
242
|
+
args: {
|
|
243
|
+
confirm: true,
|
|
244
|
+
},
|
|
225
245
|
};
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { IReqoreMultiSelectProps, ReqoreMultiSelect } from '../../components/MultiSelect';
|
|
4
4
|
import { MultiSelectItems } from '../../mock/multiSelect';
|
|
5
5
|
import { IReqoreIconName } from '../../types/icons';
|
|
6
|
+
import { StoryMeta } from '../utils';
|
|
6
7
|
import { FlatArg, IconArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
7
8
|
|
|
8
9
|
const { createArg } = argManager<IReqoreMultiSelectProps>();
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const meta = {
|
|
11
12
|
title: 'Form/Multi Select/Stories',
|
|
13
|
+
component: ReqoreMultiSelect,
|
|
12
14
|
parameters: {
|
|
13
15
|
chromatic: {
|
|
14
16
|
delay: 500,
|
|
15
17
|
},
|
|
16
18
|
},
|
|
19
|
+
args: {
|
|
20
|
+
canCreateItems: true,
|
|
21
|
+
canRemoveItems: true,
|
|
22
|
+
},
|
|
17
23
|
argTypes: {
|
|
18
24
|
...FlatArg,
|
|
19
25
|
...MinimalArg(),
|
|
@@ -30,9 +36,12 @@ export default {
|
|
|
30
36
|
}),
|
|
31
37
|
...IconArg('onItemClickIcon', 'Clickable item right icon', null),
|
|
32
38
|
},
|
|
33
|
-
} as
|
|
39
|
+
} as StoryMeta<typeof ReqoreMultiSelect>;
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
type Story = StoryObj<typeof meta>;
|
|
34
43
|
|
|
35
|
-
const Template:
|
|
44
|
+
const Template: StoryFn<IReqoreMultiSelectProps> = (args: IReqoreMultiSelectProps) => {
|
|
36
45
|
const [selected, setSelected] = useState<string[]>([
|
|
37
46
|
'Existing item 1',
|
|
38
47
|
'Existing item 3',
|
|
@@ -56,48 +65,60 @@ const Template: Story<IReqoreMultiSelectProps> = (args: IReqoreMultiSelectProps)
|
|
|
56
65
|
);
|
|
57
66
|
};
|
|
58
67
|
|
|
59
|
-
export const Basic =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
value: [],
|
|
68
|
+
export const Basic: Story = {
|
|
69
|
+
render: Template,
|
|
70
|
+
|
|
71
|
+
args: {
|
|
72
|
+
onItemClickIcon: 'EditLine',
|
|
73
|
+
},
|
|
66
74
|
};
|
|
67
75
|
|
|
68
|
-
export const
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
export const Empty: Story = {
|
|
77
|
+
render: Template,
|
|
78
|
+
|
|
79
|
+
args: {
|
|
80
|
+
value: [],
|
|
81
|
+
},
|
|
71
82
|
};
|
|
72
83
|
|
|
73
|
-
export const
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
export const AutoOpen: Story = {
|
|
85
|
+
render: Template,
|
|
86
|
+
|
|
87
|
+
args: {
|
|
88
|
+
openOnMount: true,
|
|
89
|
+
},
|
|
76
90
|
};
|
|
77
91
|
|
|
78
|
-
export const
|
|
79
|
-
|
|
80
|
-
|
|
92
|
+
export const Flat: Story = {
|
|
93
|
+
render: Template,
|
|
94
|
+
|
|
95
|
+
args: {
|
|
96
|
+
flat: true,
|
|
97
|
+
},
|
|
81
98
|
};
|
|
82
99
|
|
|
83
|
-
export const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
100
|
+
export const Minimal: Story = {
|
|
101
|
+
render: Template,
|
|
102
|
+
|
|
103
|
+
args: {
|
|
104
|
+
minimal: true,
|
|
105
|
+
},
|
|
87
106
|
};
|
|
88
107
|
|
|
89
|
-
export const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
100: '#00fd67',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
108
|
+
export const Clickable: Story = {
|
|
109
|
+
render: Template,
|
|
110
|
+
|
|
111
|
+
args: {
|
|
112
|
+
onItemClick: (item) => console.log('onItemClick', item),
|
|
113
|
+
onItemClickIcon: 'EditLine' as IReqoreIconName,
|
|
98
114
|
},
|
|
99
|
-
|
|
100
|
-
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const WithEffect: Story = {
|
|
118
|
+
render: Template,
|
|
119
|
+
|
|
120
|
+
args: {
|
|
121
|
+
selectedItemEffect: {
|
|
101
122
|
gradient: {
|
|
102
123
|
colors: {
|
|
103
124
|
0: '#7f60ea',
|
|
@@ -105,5 +126,15 @@ WithEffect.args = {
|
|
|
105
126
|
},
|
|
106
127
|
},
|
|
107
128
|
},
|
|
129
|
+
selectorProps: {
|
|
130
|
+
effect: {
|
|
131
|
+
gradient: {
|
|
132
|
+
colors: {
|
|
133
|
+
0: '#7f60ea',
|
|
134
|
+
100: '#00fd67',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
108
139
|
},
|
|
109
140
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import ReqoreContent from '../../components/Content';
|
|
4
4
|
import ReqoreIcon from '../../components/Icon';
|
|
@@ -14,17 +14,25 @@ import {
|
|
|
14
14
|
ReqoreNavbarItem,
|
|
15
15
|
ReqorePopover,
|
|
16
16
|
} from '../../index';
|
|
17
|
+
import { StoryMeta } from '../utils';
|
|
17
18
|
import { FlatArg, NoContentArg } from '../utils/args';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const meta = {
|
|
20
21
|
title: 'Layout/Header & Footer/Stories',
|
|
22
|
+
component: ReqoreHeader,
|
|
23
|
+
args: {
|
|
24
|
+
withoutContent: true,
|
|
25
|
+
},
|
|
21
26
|
argTypes: {
|
|
22
27
|
...FlatArg,
|
|
23
28
|
...NoContentArg,
|
|
24
29
|
},
|
|
25
|
-
} as
|
|
30
|
+
} as StoryMeta<typeof ReqoreHeader>;
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
26
34
|
|
|
27
|
-
const Template:
|
|
35
|
+
const Template: StoryFn<IReqoreNavbarProps> = (args: IReqoreNavbarProps) => {
|
|
28
36
|
return (
|
|
29
37
|
<>
|
|
30
38
|
<ReqoreHeader {...args}>
|
|
@@ -106,4 +114,6 @@ const Template: Story<IReqoreNavbarProps> = (args: IReqoreNavbarProps) => {
|
|
|
106
114
|
);
|
|
107
115
|
};
|
|
108
116
|
|
|
109
|
-
export const Basic =
|
|
117
|
+
export const Basic: Story = {
|
|
118
|
+
render: Template,
|
|
119
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import ReqoreNotification
|
|
3
|
-
IReqoreNotificationProps,
|
|
4
|
-
} from '../../components/Notifications/notification';
|
|
5
|
-
import { IReqoreUIProviderProps } from '../../containers/UIProvider';
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import ReqoreNotification from '../../components/Notifications/notification';
|
|
6
3
|
import { ReqoreUIProvider, useReqoreProperty } from '../../index';
|
|
4
|
+
import { StoryMeta, StoryRenderer } from '../utils';
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
const meta = {
|
|
9
7
|
title: 'Other/Notifications/Interactive/Stories',
|
|
10
8
|
component: ReqoreNotification,
|
|
11
|
-
} as
|
|
9
|
+
} as StoryMeta<typeof ReqoreNotification>;
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
12
13
|
|
|
13
14
|
const AddingButton = ({ id, onClick, onClose, onFinish }: any) => {
|
|
14
15
|
const addNotification = useReqoreProperty('addNotification');
|
|
@@ -54,10 +55,7 @@ const UpdatingButton = ({ id }) => {
|
|
|
54
55
|
);
|
|
55
56
|
};
|
|
56
57
|
|
|
57
|
-
const Template:
|
|
58
|
-
theme,
|
|
59
|
-
...args
|
|
60
|
-
}: IReqoreNotificationProps & IReqoreUIProviderProps & { id?: string | number }) => (
|
|
58
|
+
const Template: StoryRenderer<typeof meta> = ({ theme, ...args }) => (
|
|
61
59
|
<ReqoreUIProvider theme={theme}>
|
|
62
60
|
<div
|
|
63
61
|
style={{
|
|
@@ -71,35 +69,49 @@ const Template: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
|
71
69
|
>
|
|
72
70
|
<h4>Hello, I am a notification testing page</h4>
|
|
73
71
|
<AddingButton {...args} />
|
|
74
|
-
{args.
|
|
72
|
+
{args.notificationId && <UpdatingButton id={args.id} />}
|
|
75
73
|
</div>
|
|
76
74
|
</ReqoreUIProvider>
|
|
77
75
|
);
|
|
78
76
|
|
|
79
|
-
export const Adding =
|
|
77
|
+
export const Adding: Story = {
|
|
78
|
+
render: Template,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const Updating: Story = {
|
|
82
|
+
render: Template,
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
args: {
|
|
85
|
+
notificationId: 'test',
|
|
86
|
+
},
|
|
84
87
|
};
|
|
85
88
|
|
|
86
|
-
export const Clickable =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
export const Clickable: Story = {
|
|
90
|
+
render: Template,
|
|
91
|
+
|
|
92
|
+
args: {
|
|
93
|
+
onClick: () => {
|
|
94
|
+
alert(`Notification clicked`);
|
|
95
|
+
},
|
|
90
96
|
},
|
|
91
97
|
};
|
|
92
98
|
|
|
93
|
-
export const CloseCallback =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
export const CloseCallback: Story = {
|
|
100
|
+
render: Template,
|
|
101
|
+
|
|
102
|
+
args: {
|
|
103
|
+
onClose: () => {
|
|
104
|
+
alert(`Notification closed`);
|
|
105
|
+
},
|
|
97
106
|
},
|
|
98
107
|
};
|
|
99
108
|
|
|
100
|
-
export const FinishCallback =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
export const FinishCallback: Story = {
|
|
110
|
+
render: Template,
|
|
111
|
+
|
|
112
|
+
args: {
|
|
113
|
+
onFinish: () => {
|
|
114
|
+
alert(`Notification finished`);
|
|
115
|
+
},
|
|
104
116
|
},
|
|
105
117
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { useMount } from 'react-use';
|
|
@@ -7,13 +7,17 @@ import ReqoreNotification, {
|
|
|
7
7
|
} from '../../components/Notifications/notification';
|
|
8
8
|
import { IReqoreUIProviderProps } from '../../containers/UIProvider';
|
|
9
9
|
import { ReqoreTag, ReqoreUIProvider } from '../../index';
|
|
10
|
+
import { StoryMeta } from '../utils';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
const meta: StoryMeta<typeof ReqoreNotification> = {
|
|
12
13
|
title: 'Other/Notifications/Item/Stories',
|
|
13
14
|
component: ReqoreNotification,
|
|
14
|
-
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
15
19
|
|
|
16
|
-
const Template:
|
|
20
|
+
const Template: StoryFn<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
17
21
|
theme,
|
|
18
22
|
...args
|
|
19
23
|
}: IReqoreNotificationProps & IReqoreUIProviderProps) => (
|
|
@@ -119,7 +123,7 @@ const Template: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
|
119
123
|
</ReqoreUIProvider>
|
|
120
124
|
);
|
|
121
125
|
|
|
122
|
-
const SingleTemplate:
|
|
126
|
+
const SingleTemplate: StoryFn<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
123
127
|
theme,
|
|
124
128
|
...args
|
|
125
129
|
}: IReqoreNotificationProps & IReqoreUIProviderProps) => (
|
|
@@ -128,46 +132,54 @@ const SingleTemplate: Story<IReqoreNotificationProps & IReqoreUIProviderProps> =
|
|
|
128
132
|
</ReqoreUIProvider>
|
|
129
133
|
);
|
|
130
134
|
|
|
131
|
-
export const Default =
|
|
135
|
+
export const Default: Story = {
|
|
136
|
+
render: Template,
|
|
137
|
+
};
|
|
132
138
|
|
|
133
|
-
export const CustomColors =
|
|
139
|
+
export const CustomColors: Story = {
|
|
140
|
+
render: Template,
|
|
134
141
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
args: {
|
|
143
|
+
theme: {
|
|
144
|
+
notifications: {
|
|
145
|
+
info: '#6c2d80',
|
|
146
|
+
success: '#81a194',
|
|
147
|
+
pending: '#b8d8f5',
|
|
148
|
+
warning: '#382d31',
|
|
149
|
+
danger: '#786714',
|
|
150
|
+
},
|
|
143
151
|
},
|
|
144
152
|
},
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export const CustomColors2 =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const CustomColors2: Story = {
|
|
156
|
+
render: Template,
|
|
157
|
+
|
|
158
|
+
args: {
|
|
159
|
+
theme: {
|
|
160
|
+
notifications: {
|
|
161
|
+
info: '#d6bac0',
|
|
162
|
+
success: '#2aeb37',
|
|
163
|
+
pending: '#181d7d',
|
|
164
|
+
warning: '#96714e',
|
|
165
|
+
danger: '#b87cd6',
|
|
166
|
+
},
|
|
157
167
|
},
|
|
158
168
|
},
|
|
159
|
-
}
|
|
169
|
+
};
|
|
160
170
|
|
|
161
|
-
export const WithTimeout =
|
|
171
|
+
export const WithTimeout: Story = {
|
|
172
|
+
render: SingleTemplate,
|
|
162
173
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
args: {
|
|
175
|
+
type: 'info',
|
|
176
|
+
content: 'I am a notification with a 10s timeout',
|
|
177
|
+
onClick: noop,
|
|
178
|
+
duration: 10000,
|
|
179
|
+
},
|
|
168
180
|
};
|
|
169
181
|
|
|
170
|
-
const UpdateTemplate:
|
|
182
|
+
const UpdateTemplate: StoryFn<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
|
|
171
183
|
theme,
|
|
172
184
|
...args
|
|
173
185
|
}: IReqoreNotificationProps & IReqoreUIProviderProps) => {
|
|
@@ -192,11 +204,13 @@ const UpdateTemplate: Story<IReqoreNotificationProps & IReqoreUIProviderProps> =
|
|
|
192
204
|
);
|
|
193
205
|
};
|
|
194
206
|
|
|
195
|
-
export const WithUpdate =
|
|
207
|
+
export const WithUpdate: Story = {
|
|
208
|
+
render: UpdateTemplate,
|
|
196
209
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
args: {
|
|
211
|
+
type: 'pending',
|
|
212
|
+
content: 'I am a notification with a 10s timeout thats gonna update',
|
|
213
|
+
onClick: noop,
|
|
214
|
+
duration: 10000,
|
|
215
|
+
},
|
|
202
216
|
};
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import ReqoreNotificationsWrapper, {
|
|
4
4
|
IReqoreNotificationsWrapperProps,
|
|
5
5
|
} from '../../components/Notifications';
|
|
6
|
-
import ReqoreNotification
|
|
7
|
-
IReqoreNotificationProps,
|
|
8
|
-
} from '../../components/Notifications/notification';
|
|
6
|
+
import ReqoreNotification from '../../components/Notifications/notification';
|
|
9
7
|
import { IReqoreUIProviderProps } from '../../containers/UIProvider';
|
|
10
8
|
import { ReqoreUIProvider } from '../../index';
|
|
9
|
+
import { StoryMeta } from '../utils';
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
const meta: StoryMeta<typeof ReqoreNotificationsWrapper> = {
|
|
13
12
|
title: 'Other/Notifications/Wrapper/Stories',
|
|
14
|
-
component:
|
|
15
|
-
}
|
|
13
|
+
component: ReqoreNotificationsWrapper,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
16
18
|
|
|
17
|
-
const Template:
|
|
18
|
-
IReqoreNotificationProps & IReqoreUIProviderProps & IReqoreNotificationsWrapperProps
|
|
19
|
-
> = ({
|
|
19
|
+
const Template: StoryFn<IReqoreUIProviderProps & IReqoreNotificationsWrapperProps> = ({
|
|
20
20
|
theme,
|
|
21
21
|
...args
|
|
22
|
-
}
|
|
22
|
+
}) => (
|
|
23
23
|
<ReqoreUIProvider theme={theme}>
|
|
24
24
|
<ReqoreNotificationsWrapper position={args.position}>
|
|
25
25
|
<ReqoreNotification
|
|
26
|
-
{...args}
|
|
27
26
|
type='info'
|
|
28
27
|
content="Hello, I am a very simple notification. Look at me, look at me? Isn't this great?"
|
|
29
28
|
onClick={noop}
|
|
30
29
|
/>
|
|
31
30
|
<ReqoreNotification
|
|
32
|
-
{...args}
|
|
33
31
|
type='info'
|
|
34
32
|
content="Hello, I am a very simple notification. Look at me, look at me? Isn't this great?"
|
|
35
33
|
onClick={noop}
|
|
@@ -38,28 +36,46 @@ const Template: Story<
|
|
|
38
36
|
</ReqoreUIProvider>
|
|
39
37
|
);
|
|
40
38
|
|
|
41
|
-
export const Top =
|
|
42
|
-
|
|
43
|
-
Bottom.args = {
|
|
44
|
-
position: 'BOTTOM',
|
|
39
|
+
export const Top: Story = {
|
|
40
|
+
render: Template,
|
|
45
41
|
};
|
|
46
42
|
|
|
47
|
-
export const
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
export const Bottom: Story = {
|
|
44
|
+
render: Template,
|
|
45
|
+
|
|
46
|
+
args: {
|
|
47
|
+
position: 'BOTTOM',
|
|
48
|
+
},
|
|
50
49
|
};
|
|
51
50
|
|
|
52
|
-
export const
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
export const TopLeft: Story = {
|
|
52
|
+
render: Template,
|
|
53
|
+
|
|
54
|
+
args: {
|
|
55
|
+
position: 'TOP LEFT',
|
|
56
|
+
},
|
|
55
57
|
};
|
|
56
58
|
|
|
57
|
-
export const
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
export const TopRight: Story = {
|
|
60
|
+
render: Template,
|
|
61
|
+
|
|
62
|
+
args: {
|
|
63
|
+
position: 'TOP RIGHT',
|
|
64
|
+
},
|
|
60
65
|
};
|
|
61
66
|
|
|
62
|
-
export const
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
export const BottomLeft: Story = {
|
|
68
|
+
render: Template,
|
|
69
|
+
|
|
70
|
+
args: {
|
|
71
|
+
position: 'BOTTOM LEFT',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const BottomRight: Story = {
|
|
76
|
+
render: Template,
|
|
77
|
+
|
|
78
|
+
args: {
|
|
79
|
+
position: 'BOTTOM RIGHT',
|
|
80
|
+
},
|
|
65
81
|
};
|