@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.
Files changed (211) hide show
  1. package/__tests__/collection.test.tsx +1 -22
  2. package/__tests__/table.test.tsx +1 -1
  3. package/__tests__/tree.test.tsx +0 -18
  4. package/dist/components/Breadcrumbs/index.js +1 -1
  5. package/dist/components/Breadcrumbs/index.js.map +1 -1
  6. package/dist/components/Button/index.d.ts +1 -4
  7. package/dist/components/Button/index.d.ts.map +1 -1
  8. package/dist/components/Button/index.js +11 -26
  9. package/dist/components/Button/index.js.map +1 -1
  10. package/dist/components/Collection/index.d.ts +2 -2
  11. package/dist/components/Collection/index.d.ts.map +1 -1
  12. package/dist/components/Collection/index.js +10 -10
  13. package/dist/components/Collection/index.js.map +1 -1
  14. package/dist/components/Collection/item.d.ts +3 -3
  15. package/dist/components/Collection/item.d.ts.map +1 -1
  16. package/dist/components/Collection/item.js.map +1 -1
  17. package/dist/components/Columns/index.d.ts +1 -1
  18. package/dist/components/Columns/index.d.ts.map +1 -1
  19. package/dist/components/Comment/index.d.ts +1 -1
  20. package/dist/components/Comment/index.d.ts.map +1 -1
  21. package/dist/components/CommentFeed/index.d.ts +1 -1
  22. package/dist/components/CommentFeed/index.d.ts.map +1 -1
  23. package/dist/components/ControlGroup/index.d.ts +1 -1
  24. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  25. package/dist/components/Dropdown/index.d.ts +1 -1
  26. package/dist/components/Dropdown/index.d.ts.map +1 -1
  27. package/dist/components/Dropdown/item.d.ts +2 -2
  28. package/dist/components/Dropdown/item.d.ts.map +1 -1
  29. package/dist/components/Dropdown/list.d.ts +1 -1
  30. package/dist/components/Dropdown/list.d.ts.map +1 -1
  31. package/dist/components/Effect/index.d.ts +2 -2
  32. package/dist/components/Effect/index.d.ts.map +1 -1
  33. package/dist/components/ExportModal/index.d.ts +11 -0
  34. package/dist/components/ExportModal/index.d.ts.map +1 -0
  35. package/dist/components/ExportModal/index.js +91 -0
  36. package/dist/components/ExportModal/index.js.map +1 -0
  37. package/dist/components/Header/index.d.ts +7 -7
  38. package/dist/components/Header/index.d.ts.map +1 -1
  39. package/dist/components/InputClearButton/index.d.ts +1 -0
  40. package/dist/components/InputClearButton/index.d.ts.map +1 -1
  41. package/dist/components/InternalPopover/index.js +2 -2
  42. package/dist/components/InternalPopover/index.js.map +1 -1
  43. package/dist/components/KeyValueTable/index.d.ts +7 -4
  44. package/dist/components/KeyValueTable/index.d.ts.map +1 -1
  45. package/dist/components/KeyValueTable/index.js +32 -2
  46. package/dist/components/KeyValueTable/index.js.map +1 -1
  47. package/dist/components/Layout/content.d.ts +1 -1
  48. package/dist/components/Layout/content.d.ts.map +1 -1
  49. package/dist/components/Layout/index.d.ts +1 -1
  50. package/dist/components/Layout/index.d.ts.map +1 -1
  51. package/dist/components/Menu/item.d.ts +1 -1
  52. package/dist/components/Menu/item.d.ts.map +1 -1
  53. package/dist/components/Menu/item.js +3 -3
  54. package/dist/components/Menu/item.js.map +1 -1
  55. package/dist/components/Message/index.d.ts +1 -0
  56. package/dist/components/Message/index.d.ts.map +1 -1
  57. package/dist/components/Message/index.js.map +1 -1
  58. package/dist/components/Modal/index.d.ts +1 -1
  59. package/dist/components/Modal/index.d.ts.map +1 -1
  60. package/dist/components/MultiSelect/index.d.ts +2 -2
  61. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  62. package/dist/components/Notifications/notification.d.ts +1 -0
  63. package/dist/components/Notifications/notification.d.ts.map +1 -1
  64. package/dist/components/Notifications/notification.js +23 -16
  65. package/dist/components/Notifications/notification.js.map +1 -1
  66. package/dist/components/Paging/index.d.ts +1 -1
  67. package/dist/components/Paging/index.d.ts.map +1 -1
  68. package/dist/components/Panel/NonResponsiveActions.d.ts +1 -1
  69. package/dist/components/Panel/NonResponsiveActions.d.ts.map +1 -1
  70. package/dist/components/Panel/index.js +1 -1
  71. package/dist/components/Panel/index.js.map +1 -1
  72. package/dist/components/Panel/panel.screenshot.d.ts +1 -1
  73. package/dist/components/Panel/panel.screenshot.d.ts.map +1 -1
  74. package/dist/components/Paragraph/index.d.ts +1 -1
  75. package/dist/components/Paragraph/index.d.ts.map +1 -1
  76. package/dist/components/Popover/index.d.ts +1 -1
  77. package/dist/components/Popover/index.d.ts.map +1 -1
  78. package/dist/components/Popover/index.js +2 -0
  79. package/dist/components/Popover/index.js.map +1 -1
  80. package/dist/components/RadioGroup/index.d.ts +1 -1
  81. package/dist/components/RadioGroup/index.d.ts.map +1 -1
  82. package/dist/components/Sidebar/item.d.ts +1 -1
  83. package/dist/components/Sidebar/item.d.ts.map +1 -1
  84. package/dist/components/Spacer/index.d.ts +3 -3
  85. package/dist/components/Spacer/index.d.ts.map +1 -1
  86. package/dist/components/Spinner/index.d.ts +1 -1
  87. package/dist/components/Spinner/index.d.ts.map +1 -1
  88. package/dist/components/Table/body.d.ts +1 -1
  89. package/dist/components/Table/body.d.ts.map +1 -1
  90. package/dist/components/Table/body.js +26 -21
  91. package/dist/components/Table/body.js.map +1 -1
  92. package/dist/components/Table/cell.d.ts +3 -2
  93. package/dist/components/Table/cell.d.ts.map +1 -1
  94. package/dist/components/Table/cell.js +8 -4
  95. package/dist/components/Table/cell.js.map +1 -1
  96. package/dist/components/Table/headerCell.d.ts +1 -1
  97. package/dist/components/Table/headerCell.d.ts.map +1 -1
  98. package/dist/components/Table/helpers.d.ts +8 -6
  99. package/dist/components/Table/helpers.d.ts.map +1 -1
  100. package/dist/components/Table/helpers.js +49 -16
  101. package/dist/components/Table/helpers.js.map +1 -1
  102. package/dist/components/Table/index.d.ts +5 -4
  103. package/dist/components/Table/index.d.ts.map +1 -1
  104. package/dist/components/Table/index.js +47 -38
  105. package/dist/components/Table/index.js.map +1 -1
  106. package/dist/components/Table/row.d.ts +7 -5
  107. package/dist/components/Table/row.d.ts.map +1 -1
  108. package/dist/components/Table/row.js +38 -36
  109. package/dist/components/Table/row.js.map +1 -1
  110. package/dist/components/Table/value.d.ts +1 -1
  111. package/dist/components/Table/value.d.ts.map +1 -1
  112. package/dist/components/Tabs/content.d.ts +1 -1
  113. package/dist/components/Tabs/content.d.ts.map +1 -1
  114. package/dist/components/Tabs/index.d.ts +1 -1
  115. package/dist/components/Tabs/index.d.ts.map +1 -1
  116. package/dist/components/Tabs/list.d.ts +1 -1
  117. package/dist/components/Tabs/list.d.ts.map +1 -1
  118. package/dist/components/Tabs/list.js +1 -1
  119. package/dist/components/Tabs/list.js.map +1 -1
  120. package/dist/components/Tag/group.d.ts +1 -1
  121. package/dist/components/Tag/group.d.ts.map +1 -1
  122. package/dist/components/Tree/index.d.ts +2 -1
  123. package/dist/components/Tree/index.d.ts.map +1 -1
  124. package/dist/components/Tree/index.js +35 -31
  125. package/dist/components/Tree/index.js.map +1 -1
  126. package/dist/constants/sizes.js +5 -5
  127. package/dist/containers/Paging.d.ts +1 -1
  128. package/dist/containers/Paging.d.ts.map +1 -1
  129. package/dist/containers/ThemeProvider.d.ts +1 -1
  130. package/dist/containers/ThemeProvider.d.ts.map +1 -1
  131. package/dist/helpers/utils.d.ts +2 -1
  132. package/dist/helpers/utils.d.ts.map +1 -1
  133. package/dist/helpers/utils.js +20 -2
  134. package/dist/helpers/utils.js.map +1 -1
  135. package/dist/hooks/useAutoFocus.d.ts +1 -1
  136. package/dist/hooks/useAutoFocus.d.ts.map +1 -1
  137. package/dist/hooks/usePopover.d.ts +1 -0
  138. package/dist/hooks/usePopover.d.ts.map +1 -1
  139. package/dist/index.d.ts +1 -1
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js.map +1 -1
  142. package/dist/styles.d.ts +3 -0
  143. package/dist/styles.d.ts.map +1 -1
  144. package/dist/styles.js +49 -11
  145. package/dist/styles.js.map +1 -1
  146. package/migration-storybook.log +88 -0
  147. package/package.json +26 -20
  148. package/src/components/Breadcrumbs/index.tsx +1 -1
  149. package/src/components/Button/index.tsx +3 -54
  150. package/src/components/Collection/index.tsx +18 -15
  151. package/src/components/Collection/item.tsx +2 -1
  152. package/src/components/ExportModal/index.tsx +98 -0
  153. package/src/components/InternalPopover/index.tsx +2 -2
  154. package/src/components/KeyValueTable/index.tsx +59 -11
  155. package/src/components/Menu/item.tsx +4 -4
  156. package/src/components/Message/index.tsx +1 -0
  157. package/src/components/Notifications/notification.tsx +14 -3
  158. package/src/components/Panel/index.tsx +2 -2
  159. package/src/components/Popover/index.tsx +3 -0
  160. package/src/components/Table/body.tsx +26 -20
  161. package/src/components/Table/cell.tsx +15 -4
  162. package/src/components/Table/helpers.ts +52 -21
  163. package/src/components/Table/index.tsx +119 -75
  164. package/src/components/Table/row.tsx +47 -46
  165. package/src/components/Tabs/list.tsx +1 -1
  166. package/src/components/Tree/index.tsx +82 -75
  167. package/src/constants/sizes.ts +5 -5
  168. package/src/helpers/utils.ts +10 -2
  169. package/src/hooks/useAutoFocus.ts +1 -1
  170. package/src/index.tsx +1 -1
  171. package/src/mock/tableData.ts +12 -0
  172. package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +11 -23
  173. package/src/stories/Button/Button.stories.tsx +83 -47
  174. package/src/stories/Checkbox/Checkbox.stories.tsx +19 -9
  175. package/src/stories/Collection/Collection.stories.tsx +195 -171
  176. package/src/stories/Columns/Columns.stories.tsx +38 -24
  177. package/src/stories/Comment/Comment.stories.tsx +15 -6
  178. package/src/stories/ControlGroup/ControlGroup.stories.tsx +102 -48
  179. package/src/stories/Drawer/Drawer.stories.tsx +52 -17
  180. package/src/stories/Dropdown/Dropdown.stories.tsx +184 -152
  181. package/src/stories/ExportModal/ExportModal.stories.tsx +18 -0
  182. package/src/stories/Header/Header.stories.tsx +65 -31
  183. package/src/stories/Icon/Icon.stories.tsx +139 -133
  184. package/src/stories/Input/Input.stories.tsx +68 -31
  185. package/src/stories/KeyValueTable/KeyValueTable.stories.tsx +183 -117
  186. package/src/stories/Menu/Menu.stories.tsx +56 -20
  187. package/src/stories/Message/Message.stories.tsx +96 -37
  188. package/src/stories/Modal/Modal.stories.tsx +28 -8
  189. package/src/stories/MultiSelect/MultiSelect.stories.tsx +66 -35
  190. package/src/stories/Navbar/Navbar.stories.tsx +15 -5
  191. package/src/stories/Notifications/Interactive.stories.tsx +40 -28
  192. package/src/stories/Notifications/Notification.stories.tsx +55 -41
  193. package/src/stories/Notifications/Notifications.stories.tsx +45 -29
  194. package/src/stories/Paging/Paging.stories.tsx +206 -177
  195. package/src/stories/Panel/Panel.stories.tsx +238 -168
  196. package/src/stories/Paragraph/Paragraph.stories.tsx +66 -31
  197. package/src/stories/Popover/Popover.stories.tsx +62 -40
  198. package/src/stories/RadioGroup/RadioGroup.stories.tsx +41 -19
  199. package/src/stories/Sidebar/Sidebar.stories.tsx +29 -10
  200. package/src/stories/Spacer/Spacer.stories.tsx +13 -5
  201. package/src/stories/Spinner/Spinner.stories.tsx +26 -12
  202. package/src/stories/Table/Table.stories.tsx +200 -144
  203. package/src/stories/Table/Tests.stories.tsx +9 -0
  204. package/src/stories/Tabs/Tabs.stories.tsx +82 -46
  205. package/src/stories/Tag/Tag.stories.tsx +56 -37
  206. package/src/stories/Tag/TagGroup.stories.tsx +297 -0
  207. package/src/stories/TextArea/TextArea.stories.tsx +82 -40
  208. package/src/stories/Tree/Tree.stories.tsx +84 -22
  209. package/src/stories/utils.ts +22 -1
  210. package/src/styles.ts +55 -2
  211. package/tests.json +1 -1
@@ -1,14 +1,25 @@
1
- import { Meta, Story } from '@storybook/react/types-6-0';
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
- export default {
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 Meta<IReqoreModalProps>;
63
+ } as StoryMeta<typeof ReqoreModal>;
64
+
65
+ export default meta;
66
+ type Story = StoryObj<typeof meta>;
53
67
 
54
- const Template: Story<IReqoreModalProps & { confirm?: boolean }> = (args) => {
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 = Template.bind({});
222
- export const ConfirmationModal = Template.bind({});
223
- ConfirmationModal.args = {
224
- confirm: true,
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 { Meta, Story } from '@storybook/react/types-6-0';
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
- export default {
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 Meta<IReqoreMultiSelectProps>;
39
+ } as StoryMeta<typeof ReqoreMultiSelect>;
40
+
41
+ export default meta;
42
+ type Story = StoryObj<typeof meta>;
34
43
 
35
- const Template: Story<IReqoreMultiSelectProps> = (args: IReqoreMultiSelectProps) => {
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 = Template.bind({});
60
- Basic.args = {
61
- onItemClickIcon: 'EditLine' as IReqoreIconName,
62
- };
63
- export const Empty = Template.bind({});
64
- Empty.args = {
65
- value: [],
68
+ export const Basic: Story = {
69
+ render: Template,
70
+
71
+ args: {
72
+ onItemClickIcon: 'EditLine',
73
+ },
66
74
  };
67
75
 
68
- export const AutoOpen = Template.bind({});
69
- AutoOpen.args = {
70
- openOnMount: true,
76
+ export const Empty: Story = {
77
+ render: Template,
78
+
79
+ args: {
80
+ value: [],
81
+ },
71
82
  };
72
83
 
73
- export const Flat = Template.bind({});
74
- Flat.args = {
75
- flat: true,
84
+ export const AutoOpen: Story = {
85
+ render: Template,
86
+
87
+ args: {
88
+ openOnMount: true,
89
+ },
76
90
  };
77
91
 
78
- export const Minimal = Template.bind({});
79
- Minimal.args = {
80
- minimal: true,
92
+ export const Flat: Story = {
93
+ render: Template,
94
+
95
+ args: {
96
+ flat: true,
97
+ },
81
98
  };
82
99
 
83
- export const Clickable = Template.bind({});
84
- Clickable.args = {
85
- onItemClick: (item) => console.log('onItemClick', item),
86
- onItemClickIcon: 'EditLine' as IReqoreIconName,
100
+ export const Minimal: Story = {
101
+ render: Template,
102
+
103
+ args: {
104
+ minimal: true,
105
+ },
87
106
  };
88
107
 
89
- export const WithEffect = Template.bind({});
90
- WithEffect.args = {
91
- selectedItemEffect: {
92
- gradient: {
93
- colors: {
94
- 0: '#7f60ea',
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
- selectorProps: {
100
- effect: {
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 { Meta, Story } from '@storybook/react/types-6-0';
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
- export default {
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 Meta<IReqoreNavbarProps>;
30
+ } as StoryMeta<typeof ReqoreHeader>;
31
+
32
+ export default meta;
33
+ type Story = StoryObj<typeof meta>;
26
34
 
27
- const Template: Story<IReqoreNavbarProps> = (args: IReqoreNavbarProps) => {
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 = Template.bind({});
117
+ export const Basic: Story = {
118
+ render: Template,
119
+ };
@@ -1,14 +1,15 @@
1
- import { Meta, Story } from '@storybook/react/types-6-0';
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
- export default {
6
+ const meta = {
9
7
  title: 'Other/Notifications/Interactive/Stories',
10
8
  component: ReqoreNotification,
11
- } as Meta;
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: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
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.id && <UpdatingButton id={args.id} />}
72
+ {args.notificationId && <UpdatingButton id={args.id} />}
75
73
  </div>
76
74
  </ReqoreUIProvider>
77
75
  );
78
76
 
79
- export const Adding = Template.bind({});
77
+ export const Adding: Story = {
78
+ render: Template,
79
+ };
80
+
81
+ export const Updating: Story = {
82
+ render: Template,
80
83
 
81
- export const Updating = Template.bind({});
82
- Updating.args = {
83
- id: 'test',
84
+ args: {
85
+ notificationId: 'test',
86
+ },
84
87
  };
85
88
 
86
- export const Clickable = Template.bind({});
87
- Clickable.args = {
88
- onClick: (id) => {
89
- alert(`Notification ${id} clicked`);
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 = Template.bind({});
94
- CloseCallback.args = {
95
- onClose: (id) => {
96
- alert(`Notification ${id} closed`);
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 = Template.bind({});
101
- FinishCallback.args = {
102
- onFinish: (id) => {
103
- alert(`Notification ${id} finished`);
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 { Meta, Story } from '@storybook/react/types-6-0';
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
- export default {
12
+ const meta: StoryMeta<typeof ReqoreNotification> = {
12
13
  title: 'Other/Notifications/Item/Stories',
13
14
  component: ReqoreNotification,
14
- } as Meta;
15
+ };
16
+
17
+ export default meta;
18
+ type Story = StoryObj<typeof meta>;
15
19
 
16
- const Template: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
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: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
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 = Template.bind({});
135
+ export const Default: Story = {
136
+ render: Template,
137
+ };
132
138
 
133
- export const CustomColors = Template.bind({});
139
+ export const CustomColors: Story = {
140
+ render: Template,
134
141
 
135
- CustomColors.args = {
136
- theme: {
137
- notifications: {
138
- info: '#6c2d80',
139
- success: '#81a194',
140
- pending: '#b8d8f5',
141
- warning: '#382d31',
142
- danger: '#786714',
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
- } as IReqoreUIProviderProps;
146
-
147
- export const CustomColors2 = Template.bind({});
148
-
149
- CustomColors2.args = {
150
- theme: {
151
- notifications: {
152
- info: '#d6bac0',
153
- success: '#2aeb37',
154
- pending: '#181d7d',
155
- warning: '#96714e',
156
- danger: '#b87cd6',
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
- } as IReqoreUIProviderProps;
169
+ };
160
170
 
161
- export const WithTimeout = SingleTemplate.bind({});
171
+ export const WithTimeout: Story = {
172
+ render: SingleTemplate,
162
173
 
163
- WithTimeout.args = {
164
- type: 'info',
165
- content: 'I am a notification with a 10s timeout',
166
- onClick: noop,
167
- duration: 10000,
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: Story<IReqoreNotificationProps & IReqoreUIProviderProps> = ({
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 = UpdateTemplate.bind({});
207
+ export const WithUpdate: Story = {
208
+ render: UpdateTemplate,
196
209
 
197
- WithUpdate.args = {
198
- type: 'pending',
199
- content: 'I am a notification with a 10s timeout thats gonna update',
200
- onClick: noop,
201
- duration: 10000,
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 { Meta, Story } from '@storybook/react/types-6-0';
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
- export default {
11
+ const meta: StoryMeta<typeof ReqoreNotificationsWrapper> = {
13
12
  title: 'Other/Notifications/Wrapper/Stories',
14
- component: ReqoreNotification,
15
- } as Meta;
13
+ component: ReqoreNotificationsWrapper,
14
+ };
15
+
16
+ export default meta;
17
+ type Story = StoryObj<typeof meta>;
16
18
 
17
- const Template: Story<
18
- IReqoreNotificationProps & IReqoreUIProviderProps & IReqoreNotificationsWrapperProps
19
- > = ({
19
+ const Template: StoryFn<IReqoreUIProviderProps & IReqoreNotificationsWrapperProps> = ({
20
20
  theme,
21
21
  ...args
22
- }: IReqoreNotificationProps & IReqoreUIProviderProps & IReqoreNotificationsWrapperProps) => (
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 = Template.bind({});
42
- export const Bottom = Template.bind({});
43
- Bottom.args = {
44
- position: 'BOTTOM',
39
+ export const Top: Story = {
40
+ render: Template,
45
41
  };
46
42
 
47
- export const TopLeft = Template.bind({});
48
- TopLeft.args = {
49
- position: 'TOP LEFT',
43
+ export const Bottom: Story = {
44
+ render: Template,
45
+
46
+ args: {
47
+ position: 'BOTTOM',
48
+ },
50
49
  };
51
50
 
52
- export const TopRight = Template.bind({});
53
- TopRight.args = {
54
- position: 'TOP RIGHT',
51
+ export const TopLeft: Story = {
52
+ render: Template,
53
+
54
+ args: {
55
+ position: 'TOP LEFT',
56
+ },
55
57
  };
56
58
 
57
- export const BottomLeft = Template.bind({});
58
- BottomLeft.args = {
59
- position: 'BOTTOM LEFT',
59
+ export const TopRight: Story = {
60
+ render: Template,
61
+
62
+ args: {
63
+ position: 'TOP RIGHT',
64
+ },
60
65
  };
61
66
 
62
- export const BottomRight = Template.bind({});
63
- BottomRight.args = {
64
- position: 'BOTTOM RIGHT',
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
  };