@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.
- 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 +27 -0
- package/dist/components/KeyValueTable/index.d.ts.map +1 -0
- package/dist/components/KeyValueTable/index.js +87 -0
- package/dist/components/KeyValueTable/index.js.map +1 -0
- 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 +63 -53
- 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 +12 -5
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/value.d.ts +7 -0
- package/dist/components/Table/value.d.ts.map +1 -0
- package/dist/components/Table/value.js +37 -0
- package/dist/components/Table/value.js.map +1 -0
- 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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- 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 +129 -0
- 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 +127 -90
- package/src/components/Table/row.tsx +21 -10
- package/src/components/Table/value.tsx +27 -0
- 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 +2 -0
- 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 +224 -0
- 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
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import ReqoreIcon from '../../components/Icon';
|
|
3
|
+
import { IReqoreKeyValueTableProps, ReqoreKeyValueTable } from '../../components/KeyValueTable';
|
|
4
|
+
import { IReqoreTableRowData, TReqoreTableColumnContent } from '../../components/Table';
|
|
5
|
+
import { TReqorePaginationType } from '../../constants/paging';
|
|
6
|
+
import { StoryMeta } from '../utils';
|
|
7
|
+
import { CustomIntentArg, FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
8
|
+
|
|
9
|
+
const { createArg } = argManager<IReqoreKeyValueTableProps>();
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Collections/Key Value Table/Stories',
|
|
13
|
+
component: ReqoreKeyValueTable,
|
|
14
|
+
argTypes: {
|
|
15
|
+
...createArg('rounded', {
|
|
16
|
+
type: 'boolean',
|
|
17
|
+
name: 'Rounded',
|
|
18
|
+
description: 'If the table should have rounded corners',
|
|
19
|
+
}),
|
|
20
|
+
...createArg('striped', {
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
name: 'Striped',
|
|
23
|
+
description: 'If the table should have striped rows',
|
|
24
|
+
}),
|
|
25
|
+
...createArg('width', {
|
|
26
|
+
type: 'number',
|
|
27
|
+
defaultValue: undefined,
|
|
28
|
+
name: 'Width',
|
|
29
|
+
description: 'The width of the table',
|
|
30
|
+
}),
|
|
31
|
+
...createArg('height', {
|
|
32
|
+
type: 'number',
|
|
33
|
+
defaultValue: 600,
|
|
34
|
+
name: 'Height',
|
|
35
|
+
description: 'The height of the table',
|
|
36
|
+
}),
|
|
37
|
+
...createArg('data', {
|
|
38
|
+
name: 'Data',
|
|
39
|
+
description: 'The data to be displayed in the table',
|
|
40
|
+
}),
|
|
41
|
+
...createArg('fill', {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
defaultValue: false,
|
|
44
|
+
name: 'Fill',
|
|
45
|
+
description: 'Whether the table should fill the parent',
|
|
46
|
+
}),
|
|
47
|
+
...SizeArg,
|
|
48
|
+
...FlatArg,
|
|
49
|
+
...IntentArg,
|
|
50
|
+
...CustomIntentArg('selectedRowIntent'),
|
|
51
|
+
},
|
|
52
|
+
args: {
|
|
53
|
+
height: 600,
|
|
54
|
+
width: undefined,
|
|
55
|
+
fill: false,
|
|
56
|
+
label: 'Table',
|
|
57
|
+
data: {
|
|
58
|
+
firstName: 'Filip',
|
|
59
|
+
lastName: 'Machinia',
|
|
60
|
+
age: 25,
|
|
61
|
+
married: false,
|
|
62
|
+
'In Relationship': true,
|
|
63
|
+
DOB: '1995-01-01',
|
|
64
|
+
occupation: 'Software Engineer',
|
|
65
|
+
address: {
|
|
66
|
+
street: 'Some street',
|
|
67
|
+
city: 'Some city',
|
|
68
|
+
country: 'Some country',
|
|
69
|
+
},
|
|
70
|
+
groups: ['Admin', 'User'],
|
|
71
|
+
race: 'Human',
|
|
72
|
+
sex: 'Male',
|
|
73
|
+
height: 180,
|
|
74
|
+
weight: 80,
|
|
75
|
+
device: undefined,
|
|
76
|
+
OS: 'MacOS',
|
|
77
|
+
browser: 'Chrome',
|
|
78
|
+
email: 'test@test.com',
|
|
79
|
+
phone: '+420 123 456 789',
|
|
80
|
+
website: 'https://machinia.com',
|
|
81
|
+
company: 'Machinia',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
} as StoryMeta<typeof ReqoreKeyValueTable>;
|
|
85
|
+
|
|
86
|
+
export default meta;
|
|
87
|
+
type Story = StoryObj<typeof meta>;
|
|
88
|
+
|
|
89
|
+
export const Basic: Story = {};
|
|
90
|
+
|
|
91
|
+
export const NoLabel: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
label: undefined,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const CustomWidth: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
width: 400,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const NotFlat: Story = {
|
|
104
|
+
args: {
|
|
105
|
+
flat: false,
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const Striped: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
striped: true,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const Filterable: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
filterable: true,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const DefaultFilter: Story = {
|
|
122
|
+
args: {
|
|
123
|
+
filterable: true,
|
|
124
|
+
filter: 'Mach',
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const DefaultValueFilter: Story = {
|
|
129
|
+
args: {
|
|
130
|
+
defaultValueFilter: 80,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const AllFiltersActive: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
filterable: true,
|
|
137
|
+
filter: 1,
|
|
138
|
+
defaultValueFilter: 80,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const NoDataMessage: Story = {
|
|
143
|
+
args: {
|
|
144
|
+
filterable: true,
|
|
145
|
+
filter: 'asjkghakshgjkashg',
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const Zoomable: Story = {
|
|
150
|
+
args: {
|
|
151
|
+
zoomable: true,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const FillParent: Story = {
|
|
156
|
+
args: {
|
|
157
|
+
fill: true,
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const Sizes: Story = {
|
|
162
|
+
args: {
|
|
163
|
+
size: 'small',
|
|
164
|
+
filterable: true,
|
|
165
|
+
wrapperSize: 'big',
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const DefaultPaging: Story = {
|
|
170
|
+
args: {
|
|
171
|
+
paging: 'buttons',
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const CustomColumnWidths: Story = {
|
|
176
|
+
args: {
|
|
177
|
+
minValueWidth: 500,
|
|
178
|
+
maxKeyWidth: 100,
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export const CustomKeyIntent: Story = {
|
|
183
|
+
args: {
|
|
184
|
+
keyColumnIntent: 'success',
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export const CustomAlign: Story = {
|
|
189
|
+
args: {
|
|
190
|
+
keyAlign: 'right',
|
|
191
|
+
valueAlign: 'center',
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const CustomPaging: Story = {
|
|
196
|
+
args: {
|
|
197
|
+
paging: {
|
|
198
|
+
fluid: true,
|
|
199
|
+
loadMoreLabel: 'Load more rows...',
|
|
200
|
+
showLabels: true,
|
|
201
|
+
infinite: true,
|
|
202
|
+
itemsPerPage: 2,
|
|
203
|
+
} as TReqorePaginationType<IReqoreTableRowData>,
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const CustomValueRenderer: Story = {
|
|
208
|
+
args: {
|
|
209
|
+
valueRenderer: ({ value, tableKey }, Component): TReqoreTableColumnContent | JSX.Element => {
|
|
210
|
+
switch (tableKey) {
|
|
211
|
+
case 'race':
|
|
212
|
+
return 'tag:success';
|
|
213
|
+
case 'sex':
|
|
214
|
+
return <ReqoreIcon icon={value === 'Male' ? 'User6Line' : 'User6Fill'} />;
|
|
215
|
+
case 'height':
|
|
216
|
+
return <>{value} cm</>;
|
|
217
|
+
case 'weight':
|
|
218
|
+
return <Component value={value} />;
|
|
219
|
+
default:
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { IReqoreMenuProps } from '../../components/Menu';
|
|
3
3
|
import { IReqoreMenuItemProps } from '../../components/Menu/item';
|
|
4
4
|
import {
|
|
@@ -8,12 +8,23 @@ import {
|
|
|
8
8
|
ReqoreMenuItem,
|
|
9
9
|
ReqorePopover,
|
|
10
10
|
} from '../../index';
|
|
11
|
+
import { StoryMeta } from '../utils';
|
|
11
12
|
import { IntentArg, argManager } from '../utils/args';
|
|
12
13
|
|
|
13
14
|
const { createArg } = argManager<IReqoreMenuProps>();
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
const meta = {
|
|
16
17
|
title: 'Navigation/Menu/Stories',
|
|
18
|
+
component: ReqoreMenu,
|
|
19
|
+
args: {
|
|
20
|
+
width: '210px',
|
|
21
|
+
maxHeight: undefined,
|
|
22
|
+
wrapText: false,
|
|
23
|
+
minimal: false,
|
|
24
|
+
flat: true,
|
|
25
|
+
rounded: true,
|
|
26
|
+
transparent: false,
|
|
27
|
+
},
|
|
17
28
|
argTypes: {
|
|
18
29
|
...createArg('width', {
|
|
19
30
|
type: 'string',
|
|
@@ -75,9 +86,12 @@ export default {
|
|
|
75
86
|
}),
|
|
76
87
|
...IntentArg,
|
|
77
88
|
},
|
|
78
|
-
} as
|
|
89
|
+
} as StoryMeta<typeof ReqoreMenu>;
|
|
90
|
+
|
|
91
|
+
export default meta;
|
|
92
|
+
type Story = StoryObj<typeof meta>;
|
|
79
93
|
|
|
80
|
-
const Template:
|
|
94
|
+
const Template: StoryFn<IReqoreMenuProps> = (args) => {
|
|
81
95
|
return (
|
|
82
96
|
<ReqoreMenu {...args}>
|
|
83
97
|
<ReqoreInput placeholder='Custom component' icon='Search2Fill' flat={false} />
|
|
@@ -193,24 +207,46 @@ const Template: Story<IReqoreMenuProps> = (args) => {
|
|
|
193
207
|
);
|
|
194
208
|
};
|
|
195
209
|
|
|
196
|
-
export const Basic =
|
|
197
|
-
|
|
198
|
-
WrappedText.args = {
|
|
199
|
-
wrapText: true,
|
|
210
|
+
export const Basic: Story = {
|
|
211
|
+
render: Template,
|
|
200
212
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
213
|
+
|
|
214
|
+
export const WrappedText: Story = {
|
|
215
|
+
render: Template,
|
|
216
|
+
|
|
217
|
+
args: {
|
|
218
|
+
wrapText: true,
|
|
219
|
+
},
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export const Minimal: Story = {
|
|
223
|
+
render: Template,
|
|
224
|
+
|
|
225
|
+
args: {
|
|
226
|
+
minimal: true,
|
|
227
|
+
},
|
|
204
228
|
};
|
|
205
|
-
|
|
206
|
-
NoPadding
|
|
207
|
-
|
|
229
|
+
|
|
230
|
+
export const NoPadding: Story = {
|
|
231
|
+
render: Template,
|
|
232
|
+
|
|
233
|
+
args: {
|
|
234
|
+
padded: false,
|
|
235
|
+
},
|
|
208
236
|
};
|
|
209
|
-
|
|
210
|
-
NotFlat
|
|
211
|
-
|
|
237
|
+
|
|
238
|
+
export const NotFlat: Story = {
|
|
239
|
+
render: Template,
|
|
240
|
+
|
|
241
|
+
args: {
|
|
242
|
+
flat: false,
|
|
243
|
+
},
|
|
212
244
|
};
|
|
213
|
-
|
|
214
|
-
Transparent
|
|
215
|
-
|
|
245
|
+
|
|
246
|
+
export const Transparent: Story = {
|
|
247
|
+
render: Template,
|
|
248
|
+
|
|
249
|
+
args: {
|
|
250
|
+
transparent: true,
|
|
251
|
+
},
|
|
216
252
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import ReqoreMessage, { IReqoreMessageProps } from '../../components/Message';
|
|
4
|
+
import { StoryMeta } from '../utils';
|
|
4
5
|
import { FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
5
6
|
|
|
6
7
|
const { createArg } = argManager<IReqoreMessageProps>();
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const meta = {
|
|
9
10
|
title: 'Other/Message/Stories',
|
|
11
|
+
component: ReqoreMessage,
|
|
10
12
|
argTypes: {
|
|
11
13
|
...SizeArg,
|
|
12
14
|
...FlatArg,
|
|
@@ -24,9 +26,16 @@ export default {
|
|
|
24
26
|
type: 'boolean',
|
|
25
27
|
}),
|
|
26
28
|
},
|
|
27
|
-
|
|
29
|
+
args: {
|
|
30
|
+
title: 'This is a test',
|
|
31
|
+
minimal: false,
|
|
32
|
+
},
|
|
33
|
+
} as StoryMeta<typeof ReqoreMessage>;
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
28
37
|
|
|
29
|
-
const Template:
|
|
38
|
+
const Template: StoryFn<IReqoreMessageProps> = (args: IReqoreMessageProps) => {
|
|
30
39
|
return (
|
|
31
40
|
<>
|
|
32
41
|
<ReqoreMessage {...args} onClick={noop}>
|
|
@@ -40,51 +49,76 @@ const Template: Story<IReqoreMessageProps> = (args: IReqoreMessageProps) => {
|
|
|
40
49
|
);
|
|
41
50
|
};
|
|
42
51
|
|
|
43
|
-
export const Basic: Story
|
|
44
|
-
|
|
45
|
-
Flat.args = {
|
|
46
|
-
flat: true,
|
|
47
|
-
intent: 'success',
|
|
52
|
+
export const Basic: Story = {
|
|
53
|
+
render: Template,
|
|
48
54
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
|
|
56
|
+
export const Flat: Story = {
|
|
57
|
+
render: Template,
|
|
58
|
+
|
|
59
|
+
args: {
|
|
60
|
+
flat: true,
|
|
61
|
+
intent: 'success',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Minimal: Story = {
|
|
66
|
+
render: Template,
|
|
67
|
+
|
|
68
|
+
args: {
|
|
69
|
+
minimal: true,
|
|
70
|
+
intent: 'danger',
|
|
71
|
+
},
|
|
53
72
|
};
|
|
54
73
|
|
|
55
|
-
export const WithIconColor: Story
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
export const WithIconColor: Story = {
|
|
75
|
+
render: Template,
|
|
76
|
+
|
|
77
|
+
args: {
|
|
78
|
+
minimal: true,
|
|
79
|
+
intent: 'success',
|
|
80
|
+
iconColor: '#00fd9f',
|
|
81
|
+
},
|
|
60
82
|
};
|
|
61
83
|
|
|
62
|
-
export const Opaque: Story
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
84
|
+
export const Opaque: Story = {
|
|
85
|
+
render: Template,
|
|
86
|
+
|
|
87
|
+
args: {
|
|
88
|
+
opaque: true,
|
|
89
|
+
intent: 'info',
|
|
90
|
+
},
|
|
66
91
|
};
|
|
67
92
|
|
|
68
|
-
export const Pending: Story
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
93
|
+
export const Pending: Story = {
|
|
94
|
+
render: Template,
|
|
95
|
+
|
|
96
|
+
args: {
|
|
97
|
+
opaque: true,
|
|
98
|
+
intent: 'pending',
|
|
99
|
+
},
|
|
72
100
|
};
|
|
73
101
|
|
|
74
|
-
export const CustomTheme: Story
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
102
|
+
export const CustomTheme: Story = {
|
|
103
|
+
render: Template,
|
|
104
|
+
|
|
105
|
+
args: {
|
|
106
|
+
customTheme: {
|
|
107
|
+
main: '#6e1295',
|
|
108
|
+
},
|
|
78
109
|
},
|
|
79
110
|
};
|
|
80
111
|
|
|
81
|
-
export const Effect: Story
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
112
|
+
export const Effect: Story = {
|
|
113
|
+
render: Template,
|
|
114
|
+
|
|
115
|
+
args: {
|
|
116
|
+
effect: {
|
|
117
|
+
gradient: {
|
|
118
|
+
colors: {
|
|
119
|
+
0: '#eb0e8c',
|
|
120
|
+
100: 'danger:darken:2',
|
|
121
|
+
},
|
|
88
122
|
},
|
|
89
123
|
},
|
|
90
124
|
},
|
|
@@ -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
|
};
|