@qoretechnologies/reqore 0.35.3 → 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.
Files changed (198) 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/KeyValueTable/index.d.ts +27 -0
  42. package/dist/components/KeyValueTable/index.d.ts.map +1 -0
  43. package/dist/components/KeyValueTable/index.js +87 -0
  44. package/dist/components/KeyValueTable/index.js.map +1 -0
  45. package/dist/components/Layout/content.d.ts +1 -1
  46. package/dist/components/Layout/content.d.ts.map +1 -1
  47. package/dist/components/Layout/index.d.ts +1 -1
  48. package/dist/components/Layout/index.d.ts.map +1 -1
  49. package/dist/components/Menu/item.d.ts +1 -1
  50. package/dist/components/Menu/item.d.ts.map +1 -1
  51. package/dist/components/Menu/item.js +3 -3
  52. package/dist/components/Menu/item.js.map +1 -1
  53. package/dist/components/Modal/index.d.ts +1 -1
  54. package/dist/components/Modal/index.d.ts.map +1 -1
  55. package/dist/components/MultiSelect/index.d.ts +2 -2
  56. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  57. package/dist/components/Notifications/notification.js +3 -3
  58. package/dist/components/Notifications/notification.js.map +1 -1
  59. package/dist/components/Paging/index.d.ts +1 -1
  60. package/dist/components/Paging/index.d.ts.map +1 -1
  61. package/dist/components/Panel/NonResponsiveActions.d.ts +1 -1
  62. package/dist/components/Panel/NonResponsiveActions.d.ts.map +1 -1
  63. package/dist/components/Panel/index.js +1 -1
  64. package/dist/components/Panel/index.js.map +1 -1
  65. package/dist/components/Panel/panel.screenshot.d.ts +1 -1
  66. package/dist/components/Panel/panel.screenshot.d.ts.map +1 -1
  67. package/dist/components/Paragraph/index.d.ts +1 -1
  68. package/dist/components/Paragraph/index.d.ts.map +1 -1
  69. package/dist/components/Popover/index.d.ts +1 -1
  70. package/dist/components/Popover/index.d.ts.map +1 -1
  71. package/dist/components/RadioGroup/index.d.ts +1 -1
  72. package/dist/components/RadioGroup/index.d.ts.map +1 -1
  73. package/dist/components/Sidebar/item.d.ts +1 -1
  74. package/dist/components/Sidebar/item.d.ts.map +1 -1
  75. package/dist/components/Spacer/index.d.ts +3 -3
  76. package/dist/components/Spacer/index.d.ts.map +1 -1
  77. package/dist/components/Spinner/index.d.ts +1 -1
  78. package/dist/components/Spinner/index.d.ts.map +1 -1
  79. package/dist/components/Table/body.d.ts +1 -1
  80. package/dist/components/Table/body.d.ts.map +1 -1
  81. package/dist/components/Table/body.js +4 -2
  82. package/dist/components/Table/body.js.map +1 -1
  83. package/dist/components/Table/cell.d.ts +1 -1
  84. package/dist/components/Table/cell.d.ts.map +1 -1
  85. package/dist/components/Table/headerCell.d.ts +1 -1
  86. package/dist/components/Table/headerCell.d.ts.map +1 -1
  87. package/dist/components/Table/helpers.d.ts +8 -6
  88. package/dist/components/Table/helpers.d.ts.map +1 -1
  89. package/dist/components/Table/helpers.js +49 -16
  90. package/dist/components/Table/helpers.js.map +1 -1
  91. package/dist/components/Table/index.d.ts +5 -4
  92. package/dist/components/Table/index.d.ts.map +1 -1
  93. package/dist/components/Table/index.js +63 -53
  94. package/dist/components/Table/index.js.map +1 -1
  95. package/dist/components/Table/row.d.ts +7 -5
  96. package/dist/components/Table/row.d.ts.map +1 -1
  97. package/dist/components/Table/row.js +12 -5
  98. package/dist/components/Table/row.js.map +1 -1
  99. package/dist/components/Table/value.d.ts +7 -0
  100. package/dist/components/Table/value.d.ts.map +1 -0
  101. package/dist/components/Table/value.js +37 -0
  102. package/dist/components/Table/value.js.map +1 -0
  103. package/dist/components/Tabs/content.d.ts +1 -1
  104. package/dist/components/Tabs/content.d.ts.map +1 -1
  105. package/dist/components/Tabs/index.d.ts +1 -1
  106. package/dist/components/Tabs/index.d.ts.map +1 -1
  107. package/dist/components/Tabs/list.d.ts +1 -1
  108. package/dist/components/Tabs/list.d.ts.map +1 -1
  109. package/dist/components/Tabs/list.js +1 -1
  110. package/dist/components/Tabs/list.js.map +1 -1
  111. package/dist/components/Tag/group.d.ts +1 -1
  112. package/dist/components/Tag/group.d.ts.map +1 -1
  113. package/dist/components/Tree/index.d.ts +2 -1
  114. package/dist/components/Tree/index.d.ts.map +1 -1
  115. package/dist/components/Tree/index.js +35 -31
  116. package/dist/components/Tree/index.js.map +1 -1
  117. package/dist/containers/Paging.d.ts +1 -1
  118. package/dist/containers/Paging.d.ts.map +1 -1
  119. package/dist/containers/ThemeProvider.d.ts +1 -1
  120. package/dist/containers/ThemeProvider.d.ts.map +1 -1
  121. package/dist/helpers/utils.d.ts +2 -1
  122. package/dist/helpers/utils.d.ts.map +1 -1
  123. package/dist/helpers/utils.js +20 -2
  124. package/dist/helpers/utils.js.map +1 -1
  125. package/dist/hooks/useAutoFocus.d.ts +1 -1
  126. package/dist/hooks/useAutoFocus.d.ts.map +1 -1
  127. package/dist/hooks/usePopover.d.ts +1 -0
  128. package/dist/hooks/usePopover.d.ts.map +1 -1
  129. package/dist/index.d.ts +2 -0
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +6 -2
  132. package/dist/index.js.map +1 -1
  133. package/dist/styles.d.ts +3 -0
  134. package/dist/styles.d.ts.map +1 -1
  135. package/dist/styles.js +49 -11
  136. package/dist/styles.js.map +1 -1
  137. package/migration-storybook.log +88 -0
  138. package/package.json +26 -20
  139. package/src/components/Breadcrumbs/index.tsx +1 -1
  140. package/src/components/Button/index.tsx +3 -54
  141. package/src/components/Collection/index.tsx +18 -15
  142. package/src/components/Collection/item.tsx +2 -1
  143. package/src/components/ExportModal/index.tsx +98 -0
  144. package/src/components/KeyValueTable/index.tsx +129 -0
  145. package/src/components/Menu/item.tsx +4 -4
  146. package/src/components/Notifications/notification.tsx +2 -2
  147. package/src/components/Panel/index.tsx +2 -2
  148. package/src/components/Table/body.tsx +6 -3
  149. package/src/components/Table/helpers.ts +52 -21
  150. package/src/components/Table/index.tsx +127 -90
  151. package/src/components/Table/row.tsx +21 -10
  152. package/src/components/Table/value.tsx +27 -0
  153. package/src/components/Tabs/list.tsx +1 -1
  154. package/src/components/Tree/index.tsx +82 -75
  155. package/src/helpers/utils.ts +10 -2
  156. package/src/hooks/useAutoFocus.ts +1 -1
  157. package/src/index.tsx +2 -0
  158. package/src/mock/tableData.ts +12 -0
  159. package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +11 -23
  160. package/src/stories/Button/Button.stories.tsx +83 -47
  161. package/src/stories/Checkbox/Checkbox.stories.tsx +19 -9
  162. package/src/stories/Collection/Collection.stories.tsx +195 -171
  163. package/src/stories/Columns/Columns.stories.tsx +38 -24
  164. package/src/stories/Comment/Comment.stories.tsx +15 -6
  165. package/src/stories/ControlGroup/ControlGroup.stories.tsx +102 -48
  166. package/src/stories/Drawer/Drawer.stories.tsx +52 -17
  167. package/src/stories/Dropdown/Dropdown.stories.tsx +184 -152
  168. package/src/stories/ExportModal/ExportModal.stories.tsx +18 -0
  169. package/src/stories/Header/Header.stories.tsx +65 -31
  170. package/src/stories/Icon/Icon.stories.tsx +139 -133
  171. package/src/stories/Input/Input.stories.tsx +68 -31
  172. package/src/stories/KeyValueTable/KeyValueTable.stories.tsx +224 -0
  173. package/src/stories/Menu/Menu.stories.tsx +56 -20
  174. package/src/stories/Message/Message.stories.tsx +71 -37
  175. package/src/stories/Modal/Modal.stories.tsx +28 -8
  176. package/src/stories/MultiSelect/MultiSelect.stories.tsx +66 -35
  177. package/src/stories/Navbar/Navbar.stories.tsx +15 -5
  178. package/src/stories/Notifications/Interactive.stories.tsx +40 -28
  179. package/src/stories/Notifications/Notification.stories.tsx +55 -41
  180. package/src/stories/Notifications/Notifications.stories.tsx +45 -29
  181. package/src/stories/Paging/Paging.stories.tsx +206 -177
  182. package/src/stories/Panel/Panel.stories.tsx +238 -168
  183. package/src/stories/Paragraph/Paragraph.stories.tsx +66 -31
  184. package/src/stories/Popover/Popover.stories.tsx +62 -40
  185. package/src/stories/RadioGroup/RadioGroup.stories.tsx +41 -19
  186. package/src/stories/Sidebar/Sidebar.stories.tsx +29 -10
  187. package/src/stories/Spacer/Spacer.stories.tsx +13 -5
  188. package/src/stories/Spinner/Spinner.stories.tsx +26 -12
  189. package/src/stories/Table/Table.stories.tsx +200 -144
  190. package/src/stories/Table/Tests.stories.tsx +9 -0
  191. package/src/stories/Tabs/Tabs.stories.tsx +82 -46
  192. package/src/stories/Tag/Tag.stories.tsx +56 -37
  193. package/src/stories/Tag/TagGroup.stories.tsx +297 -0
  194. package/src/stories/TextArea/TextArea.stories.tsx +82 -40
  195. package/src/stories/Tree/Tree.stories.tsx +84 -22
  196. package/src/stories/utils.ts +22 -1
  197. package/src/styles.ts +55 -2
  198. package/tests.json +1 -1
@@ -1,14 +1,35 @@
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 { 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
- export default {
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 Meta<IReqoreTagGroup & IReqoreTagProps>;
64
+ } as StoryMeta<typeof ReqoreTag>;
58
65
 
59
- const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }) => {
66
+ export default meta;
67
+ type Story = StoryObj<typeof meta>;
68
+
69
+ const Template: StoryFn<IReqoreTagProps> = (args) => {
60
70
  return (
61
- <ReqoreTagGroup columns={columns} size={args.size} gapSize={args.gapSize} wrap={args.wrap}>
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 = Template.bind({});
325
- export const BigGapSize = Template.bind({});
326
- BigGapSize.args = { gapSize: 'big' };
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 Effect = Template.bind({});
333
- Effect.args = {
334
- effect: {
335
- gradient: {
336
- direction: 'to right bottom',
337
- colors: { 0: '#33023c', 100: '#0a487b' },
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 { Meta, Story } from '@storybook/react/types-6-0';
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
- export default {
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 Meta<IReqoreTextareaProps>;
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: Story<IReqoreTextareaProps> = (args) => {
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 = Template.bind({});
148
- export const Info = Template.bind({});
149
- Info.args = {
150
- intent: 'info',
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
- export const Success = Template.bind({});
153
- Success.args = {
154
- intent: 'success',
168
+
169
+ export const Success: Story = {
170
+ render: Template,
171
+
172
+ args: {
173
+ intent: 'success',
174
+ },
155
175
  };
156
- export const Warning = Template.bind({});
157
- Warning.args = {
158
- intent: 'warning',
176
+
177
+ export const Warning: Story = {
178
+ render: Template,
179
+
180
+ args: {
181
+ intent: 'warning',
182
+ },
159
183
  };
160
- export const Danger = Template.bind({});
161
- Danger.args = {
162
- intent: 'danger',
184
+
185
+ export const Danger: Story = {
186
+ render: Template,
187
+
188
+ args: {
189
+ intent: 'danger',
190
+ },
163
191
  };
164
- export const Pending = Template.bind({});
165
- Pending.args = {
166
- intent: 'pending',
192
+
193
+ export const Pending: Story = {
194
+ render: Template,
195
+
196
+ args: {
197
+ intent: 'pending',
198
+ },
167
199
  };
168
- export const Muted = Template.bind({});
169
- Muted.args = {
170
- intent: 'muted',
200
+
201
+ export const Muted: Story = {
202
+ render: Template,
203
+
204
+ args: {
205
+ intent: 'muted',
206
+ },
171
207
  };
172
208
 
173
- export const Custom = Template.bind({});
174
- Custom.args = {
175
- customTheme: {
176
- main: '#38fdb2',
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 = Template.bind({});
181
- Effect.args = {
182
- effect: {
183
- gradient: {
184
- type: 'radial',
185
- colors: {
186
- 0: '#361554',
187
- 50: '#160013',
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
  };