@qoretechnologies/reqore 0.36.0 → 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 +4 -4
- package/dist/components/KeyValueTable/index.d.ts.map +1 -1
- 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/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 +45 -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 +3 -2
- 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/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/KeyValueTable/index.tsx +17 -11
- 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 +108 -75
- package/src/components/Table/row.tsx +12 -7
- 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 +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 +143 -118
- 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
|
@@ -1,18 +1,16 @@
|
|
|
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 { StoryMeta } from '../utils';
|
|
10
7
|
import { CustomIntentArg, FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
11
8
|
|
|
12
9
|
const { createArg } = argManager<IReqoreKeyValueTableProps>();
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
const meta = {
|
|
15
12
|
title: 'Collections/Key Value Table/Stories',
|
|
13
|
+
component: ReqoreKeyValueTable,
|
|
16
14
|
argTypes: {
|
|
17
15
|
...createArg('rounded', {
|
|
18
16
|
type: 'boolean',
|
|
@@ -37,32 +35,6 @@ export default {
|
|
|
37
35
|
description: 'The height of the table',
|
|
38
36
|
}),
|
|
39
37
|
...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
38
|
name: 'Data',
|
|
67
39
|
description: 'The data to be displayed in the table',
|
|
68
40
|
}),
|
|
@@ -77,123 +49,176 @@ export default {
|
|
|
77
49
|
...IntentArg,
|
|
78
50
|
...CustomIntentArg('selectedRowIntent'),
|
|
79
51
|
},
|
|
80
|
-
|
|
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>;
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
};
|
|
86
|
+
export default meta;
|
|
87
|
+
type Story = StoryObj<typeof meta>;
|
|
85
88
|
|
|
86
|
-
export const Basic =
|
|
87
|
-
|
|
88
|
-
NoLabel
|
|
89
|
-
|
|
89
|
+
export const Basic: Story = {};
|
|
90
|
+
|
|
91
|
+
export const NoLabel: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
label: undefined,
|
|
94
|
+
},
|
|
90
95
|
};
|
|
91
96
|
|
|
92
|
-
export const CustomWidth =
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
export const CustomWidth: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
width: 400,
|
|
100
|
+
},
|
|
95
101
|
};
|
|
96
102
|
|
|
97
|
-
export const NotFlat =
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
export const NotFlat: Story = {
|
|
104
|
+
args: {
|
|
105
|
+
flat: false,
|
|
106
|
+
},
|
|
100
107
|
};
|
|
101
|
-
|
|
102
|
-
Striped
|
|
103
|
-
|
|
108
|
+
|
|
109
|
+
export const Striped: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
striped: true,
|
|
112
|
+
},
|
|
104
113
|
};
|
|
105
|
-
|
|
106
|
-
Filterable
|
|
107
|
-
|
|
114
|
+
|
|
115
|
+
export const Filterable: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
filterable: true,
|
|
118
|
+
},
|
|
108
119
|
};
|
|
109
|
-
|
|
110
|
-
DefaultFilter
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
|
|
121
|
+
export const DefaultFilter: Story = {
|
|
122
|
+
args: {
|
|
123
|
+
filterable: true,
|
|
124
|
+
filter: 'Mach',
|
|
125
|
+
},
|
|
113
126
|
};
|
|
114
127
|
|
|
115
|
-
export const DefaultValueFilter =
|
|
116
|
-
|
|
117
|
-
|
|
128
|
+
export const DefaultValueFilter: Story = {
|
|
129
|
+
args: {
|
|
130
|
+
defaultValueFilter: 80,
|
|
131
|
+
},
|
|
118
132
|
};
|
|
119
133
|
|
|
120
|
-
export const AllFiltersActive =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
134
|
+
export const AllFiltersActive: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
filterable: true,
|
|
137
|
+
filter: 1,
|
|
138
|
+
defaultValueFilter: 80,
|
|
139
|
+
},
|
|
125
140
|
};
|
|
126
141
|
|
|
127
|
-
export const NoDataMessage =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
export const NoDataMessage: Story = {
|
|
143
|
+
args: {
|
|
144
|
+
filterable: true,
|
|
145
|
+
filter: 'asjkghakshgjkashg',
|
|
146
|
+
},
|
|
131
147
|
};
|
|
132
148
|
|
|
133
|
-
export const Zoomable =
|
|
134
|
-
|
|
135
|
-
|
|
149
|
+
export const Zoomable: Story = {
|
|
150
|
+
args: {
|
|
151
|
+
zoomable: true,
|
|
152
|
+
},
|
|
136
153
|
};
|
|
137
154
|
|
|
138
|
-
export const FillParent =
|
|
139
|
-
|
|
140
|
-
|
|
155
|
+
export const FillParent: Story = {
|
|
156
|
+
args: {
|
|
157
|
+
fill: true,
|
|
158
|
+
},
|
|
141
159
|
};
|
|
142
160
|
|
|
143
|
-
export const Sizes =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
161
|
+
export const Sizes: Story = {
|
|
162
|
+
args: {
|
|
163
|
+
size: 'small',
|
|
164
|
+
filterable: true,
|
|
165
|
+
wrapperSize: 'big',
|
|
166
|
+
},
|
|
148
167
|
};
|
|
149
168
|
|
|
150
|
-
export const DefaultPaging =
|
|
151
|
-
|
|
152
|
-
|
|
169
|
+
export const DefaultPaging: Story = {
|
|
170
|
+
args: {
|
|
171
|
+
paging: 'buttons',
|
|
172
|
+
},
|
|
153
173
|
};
|
|
154
174
|
|
|
155
|
-
export const CustomColumnWidths =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
175
|
+
export const CustomColumnWidths: Story = {
|
|
176
|
+
args: {
|
|
177
|
+
minValueWidth: 500,
|
|
178
|
+
maxKeyWidth: 100,
|
|
179
|
+
},
|
|
159
180
|
};
|
|
160
181
|
|
|
161
|
-
export const CustomKeyIntent =
|
|
162
|
-
|
|
163
|
-
|
|
182
|
+
export const CustomKeyIntent: Story = {
|
|
183
|
+
args: {
|
|
184
|
+
keyColumnIntent: 'success',
|
|
185
|
+
},
|
|
164
186
|
};
|
|
165
187
|
|
|
166
|
-
export const CustomAlign =
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
188
|
+
export const CustomAlign: Story = {
|
|
189
|
+
args: {
|
|
190
|
+
keyAlign: 'right',
|
|
191
|
+
valueAlign: 'center',
|
|
192
|
+
},
|
|
170
193
|
};
|
|
171
194
|
|
|
172
|
-
export const CustomPaging =
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
+
},
|
|
181
205
|
};
|
|
182
206
|
|
|
183
|
-
export const CustomValueRenderer =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
+
},
|
|
198
223
|
},
|
|
199
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
|
};
|