@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,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
2
|
import ReqoreIcon from '../../components/Icon';
|
|
3
3
|
import { IReqoreKeyValueTableProps, ReqoreKeyValueTable } from '../../components/KeyValueTable';
|
|
4
|
-
import {
|
|
5
|
-
IReqoreTableProps,
|
|
6
|
-
IReqoreTableRowData,
|
|
7
|
-
TReqoreTableColumnContent,
|
|
8
|
-
} from '../../components/Table';
|
|
4
|
+
import { IReqoreTableRowData, TReqoreTableColumnContent } from '../../components/Table';
|
|
9
5
|
import { TReqorePaginationType } from '../../constants/paging';
|
|
6
|
+
import { Exportable as ExportableTable } from '../Table/Table.stories';
|
|
7
|
+
import { StoryMeta } from '../utils';
|
|
10
8
|
import { CustomIntentArg, FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
11
9
|
|
|
12
10
|
const { createArg } = argManager<IReqoreKeyValueTableProps>();
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
const meta = {
|
|
15
13
|
title: 'Collections/Key Value Table/Stories',
|
|
14
|
+
component: ReqoreKeyValueTable,
|
|
16
15
|
argTypes: {
|
|
17
16
|
...createArg('rounded', {
|
|
18
17
|
type: 'boolean',
|
|
@@ -37,32 +36,6 @@ export default {
|
|
|
37
36
|
description: 'The height of the table',
|
|
38
37
|
}),
|
|
39
38
|
...createArg('data', {
|
|
40
|
-
defaultValue: {
|
|
41
|
-
firstName: 'Filip',
|
|
42
|
-
lastName: 'Machinia',
|
|
43
|
-
age: 25,
|
|
44
|
-
married: false,
|
|
45
|
-
'In Relationship': true,
|
|
46
|
-
DOB: '1995-01-01',
|
|
47
|
-
occupation: 'Software Engineer',
|
|
48
|
-
address: {
|
|
49
|
-
street: 'Some street',
|
|
50
|
-
city: 'Some city',
|
|
51
|
-
country: 'Some country',
|
|
52
|
-
},
|
|
53
|
-
groups: ['Admin', 'User'],
|
|
54
|
-
race: 'Human',
|
|
55
|
-
sex: 'Male',
|
|
56
|
-
height: 180,
|
|
57
|
-
weight: 80,
|
|
58
|
-
device: undefined,
|
|
59
|
-
OS: 'MacOS',
|
|
60
|
-
browser: 'Chrome',
|
|
61
|
-
email: 'test@test.com',
|
|
62
|
-
phone: '+420 123 456 789',
|
|
63
|
-
website: 'https://machinia.com',
|
|
64
|
-
company: 'Machinia',
|
|
65
|
-
},
|
|
66
39
|
name: 'Data',
|
|
67
40
|
description: 'The data to be displayed in the table',
|
|
68
41
|
}),
|
|
@@ -77,123 +50,216 @@ export default {
|
|
|
77
50
|
...IntentArg,
|
|
78
51
|
...CustomIntentArg('selectedRowIntent'),
|
|
79
52
|
},
|
|
80
|
-
|
|
53
|
+
args: {
|
|
54
|
+
height: 600,
|
|
55
|
+
width: undefined,
|
|
56
|
+
fill: false,
|
|
57
|
+
label: 'Table',
|
|
58
|
+
data: {
|
|
59
|
+
firstName: 'Filip',
|
|
60
|
+
lastName: 'Machinia',
|
|
61
|
+
age: 25,
|
|
62
|
+
married: false,
|
|
63
|
+
'In Relationship': true,
|
|
64
|
+
DOB: '1995-01-01',
|
|
65
|
+
occupation: 'Software Engineer',
|
|
66
|
+
address: {
|
|
67
|
+
street: 'Some street',
|
|
68
|
+
city: 'Some city',
|
|
69
|
+
country: 'Some country',
|
|
70
|
+
},
|
|
71
|
+
groups: ['Admin', 'User'],
|
|
72
|
+
race: 'Human',
|
|
73
|
+
sex: 'Male',
|
|
74
|
+
height: 180,
|
|
75
|
+
weight: 80,
|
|
76
|
+
device: undefined,
|
|
77
|
+
OS: 'MacOS',
|
|
78
|
+
browser: 'Chrome',
|
|
79
|
+
email: 'test@test.com',
|
|
80
|
+
phone: '+420 123 456 789',
|
|
81
|
+
website: 'https://machinia.com',
|
|
82
|
+
company: 'Machinia',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
} as StoryMeta<typeof ReqoreKeyValueTable>;
|
|
86
|
+
|
|
87
|
+
export default meta;
|
|
88
|
+
type Story = StoryObj<typeof meta>;
|
|
89
|
+
|
|
90
|
+
export const Basic: Story = {};
|
|
81
91
|
|
|
82
|
-
const
|
|
83
|
-
|
|
92
|
+
export const NoLabel: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
label: undefined,
|
|
95
|
+
},
|
|
84
96
|
};
|
|
85
97
|
|
|
86
|
-
export const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
export const CustomWidth: Story = {
|
|
99
|
+
args: {
|
|
100
|
+
width: 400,
|
|
101
|
+
},
|
|
90
102
|
};
|
|
91
103
|
|
|
92
|
-
export const
|
|
93
|
-
|
|
94
|
-
|
|
104
|
+
export const NotFlat: Story = {
|
|
105
|
+
args: {
|
|
106
|
+
flat: false,
|
|
107
|
+
},
|
|
95
108
|
};
|
|
96
109
|
|
|
97
|
-
export const
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
export const Striped: Story = {
|
|
111
|
+
args: {
|
|
112
|
+
striped: true,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const Exportable: Story = {
|
|
117
|
+
args: {
|
|
118
|
+
exportable: true,
|
|
119
|
+
zoomable: true,
|
|
120
|
+
},
|
|
121
|
+
play: async ({ canvasElement, ...rest }) => {
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
await ExportableTable.play({ canvasElement, ...rest });
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const Sortable: Story = {
|
|
128
|
+
args: {
|
|
129
|
+
sortable: true,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const Filterable: Story = {
|
|
134
|
+
args: {
|
|
135
|
+
filterable: true,
|
|
136
|
+
},
|
|
100
137
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
138
|
+
|
|
139
|
+
export const DefaultFilter: Story = {
|
|
140
|
+
args: {
|
|
141
|
+
filterable: true,
|
|
142
|
+
filter: 'Mach',
|
|
143
|
+
},
|
|
104
144
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
145
|
+
|
|
146
|
+
export const DefaultValueFilter: Story = {
|
|
147
|
+
args: {
|
|
148
|
+
defaultValueFilter: 80,
|
|
149
|
+
},
|
|
108
150
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
151
|
+
|
|
152
|
+
export const AllFiltersActive: Story = {
|
|
153
|
+
args: {
|
|
154
|
+
filterable: true,
|
|
155
|
+
filter: 1,
|
|
156
|
+
defaultValueFilter: 80,
|
|
157
|
+
},
|
|
113
158
|
};
|
|
114
159
|
|
|
115
|
-
export const
|
|
116
|
-
|
|
117
|
-
|
|
160
|
+
export const WithActions: Story = {
|
|
161
|
+
args: {
|
|
162
|
+
rowActions: () => [
|
|
163
|
+
{
|
|
164
|
+
icon: 'EditLine',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
icon: 'DeleteBinLine',
|
|
168
|
+
intent: 'danger',
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
zoomable: true,
|
|
172
|
+
},
|
|
118
173
|
};
|
|
119
174
|
|
|
120
|
-
export const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
175
|
+
export const CustomTheme: Story = {
|
|
176
|
+
args: {
|
|
177
|
+
customTheme: { main: '#ff0000' },
|
|
178
|
+
flat: false,
|
|
179
|
+
transparent: false,
|
|
180
|
+
},
|
|
125
181
|
};
|
|
126
182
|
|
|
127
|
-
export const NoDataMessage =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
183
|
+
export const NoDataMessage: Story = {
|
|
184
|
+
args: {
|
|
185
|
+
filterable: true,
|
|
186
|
+
filter: 'asjkghakshgjkashg',
|
|
187
|
+
},
|
|
131
188
|
};
|
|
132
189
|
|
|
133
|
-
export const Zoomable =
|
|
134
|
-
|
|
135
|
-
|
|
190
|
+
export const Zoomable: Story = {
|
|
191
|
+
args: {
|
|
192
|
+
zoomable: true,
|
|
193
|
+
},
|
|
136
194
|
};
|
|
137
195
|
|
|
138
|
-
export const FillParent =
|
|
139
|
-
|
|
140
|
-
|
|
196
|
+
export const FillParent: Story = {
|
|
197
|
+
args: {
|
|
198
|
+
fill: true,
|
|
199
|
+
},
|
|
141
200
|
};
|
|
142
201
|
|
|
143
|
-
export const Sizes =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
202
|
+
export const Sizes: Story = {
|
|
203
|
+
args: {
|
|
204
|
+
size: 'small',
|
|
205
|
+
filterable: true,
|
|
206
|
+
wrapperSize: 'big',
|
|
207
|
+
},
|
|
148
208
|
};
|
|
149
209
|
|
|
150
|
-
export const DefaultPaging =
|
|
151
|
-
|
|
152
|
-
|
|
210
|
+
export const DefaultPaging: Story = {
|
|
211
|
+
args: {
|
|
212
|
+
paging: 'buttons',
|
|
213
|
+
},
|
|
153
214
|
};
|
|
154
215
|
|
|
155
|
-
export const CustomColumnWidths =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
216
|
+
export const CustomColumnWidths: Story = {
|
|
217
|
+
args: {
|
|
218
|
+
minValueWidth: 500,
|
|
219
|
+
maxKeyWidth: 100,
|
|
220
|
+
},
|
|
159
221
|
};
|
|
160
222
|
|
|
161
|
-
export const CustomKeyIntent =
|
|
162
|
-
|
|
163
|
-
|
|
223
|
+
export const CustomKeyIntent: Story = {
|
|
224
|
+
args: {
|
|
225
|
+
keyColumnIntent: 'success',
|
|
226
|
+
},
|
|
164
227
|
};
|
|
165
228
|
|
|
166
|
-
export const CustomAlign =
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
229
|
+
export const CustomAlign: Story = {
|
|
230
|
+
args: {
|
|
231
|
+
keyAlign: 'right',
|
|
232
|
+
valueAlign: 'center',
|
|
233
|
+
},
|
|
170
234
|
};
|
|
171
235
|
|
|
172
|
-
export const CustomPaging =
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
236
|
+
export const CustomPaging: Story = {
|
|
237
|
+
args: {
|
|
238
|
+
paging: {
|
|
239
|
+
fluid: true,
|
|
240
|
+
loadMoreLabel: 'Load more rows...',
|
|
241
|
+
showLabels: true,
|
|
242
|
+
infinite: true,
|
|
243
|
+
itemsPerPage: 2,
|
|
244
|
+
} as TReqorePaginationType<IReqoreTableRowData>,
|
|
245
|
+
},
|
|
181
246
|
};
|
|
182
247
|
|
|
183
|
-
export const CustomValueRenderer =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
248
|
+
export const CustomValueRenderer: Story = {
|
|
249
|
+
args: {
|
|
250
|
+
valueRenderer: ({ value, tableKey }, Component): TReqoreTableColumnContent | JSX.Element => {
|
|
251
|
+
switch (tableKey) {
|
|
252
|
+
case 'race':
|
|
253
|
+
return 'tag:success';
|
|
254
|
+
case 'sex':
|
|
255
|
+
return <ReqoreIcon icon={value === 'Male' ? 'User6Line' : 'User6Fill'} />;
|
|
256
|
+
case 'height':
|
|
257
|
+
return <>{value} cm</>;
|
|
258
|
+
case 'weight':
|
|
259
|
+
return <Component value={value} />;
|
|
260
|
+
default:
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
},
|
|
198
264
|
},
|
|
199
265
|
};
|
|
@@ -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,101 @@ const Template: Story<IReqoreMessageProps> = (args: IReqoreMessageProps) => {
|
|
|
40
49
|
);
|
|
41
50
|
};
|
|
42
51
|
|
|
43
|
-
export const Basic: Story
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
export const Basic: Story = {
|
|
53
|
+
render: Template,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Flat: Story = {
|
|
57
|
+
render: Template,
|
|
58
|
+
|
|
59
|
+
args: {
|
|
60
|
+
flat: true,
|
|
61
|
+
intent: 'success',
|
|
62
|
+
},
|
|
48
63
|
};
|
|
49
|
-
|
|
50
|
-
Minimal
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
112
|
+
export const WithMargin: Story = {
|
|
113
|
+
render: () => (
|
|
114
|
+
<>
|
|
115
|
+
<ReqoreMessage margin='both' title='Bottom & top margin'>
|
|
116
|
+
In to am attended desirous raptures declared diverted confined at. Collected instantly
|
|
117
|
+
remaining up certainly to necessary as. Over walk dull into son boy door went new. At or
|
|
118
|
+
happiness commanded daughters as.
|
|
119
|
+
</ReqoreMessage>
|
|
120
|
+
<ReqoreMessage margin='top' title='Top margin'>
|
|
121
|
+
In to am attended desirous raptures declared diverted confined at.
|
|
122
|
+
</ReqoreMessage>
|
|
123
|
+
<ReqoreMessage margin='bottom' size='big' title='Bottom margin'>
|
|
124
|
+
In to am attended desirous raptures declared diverted confined at. Collected instantly
|
|
125
|
+
remaining up certainly to necessary as. Over walk dull into son boy door went new. At or
|
|
126
|
+
happiness commanded daughters as.
|
|
127
|
+
</ReqoreMessage>
|
|
128
|
+
<ReqoreMessage margin='bottom' size='small' title='Bottom small margin'>
|
|
129
|
+
In to am attended desirous raptures declared diverted confined at. Collected instantly
|
|
130
|
+
remaining up certainly to necessary as. Over walk dull into son boy door went new. At or
|
|
131
|
+
happiness commanded daughters as.
|
|
132
|
+
</ReqoreMessage>
|
|
133
|
+
</>
|
|
134
|
+
),
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const Effect: Story = {
|
|
138
|
+
render: Template,
|
|
139
|
+
|
|
140
|
+
args: {
|
|
141
|
+
effect: {
|
|
142
|
+
gradient: {
|
|
143
|
+
colors: {
|
|
144
|
+
0: '#eb0e8c',
|
|
145
|
+
100: 'danger:darken:2',
|
|
146
|
+
},
|
|
88
147
|
},
|
|
89
148
|
},
|
|
90
149
|
},
|