@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,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
2
|
import { ReqoreButton, ReqoreControlGroup, ReqoreVerticalSpacer } from '../..';
|
|
3
3
|
import { IReqoreCollectionProps, ReqoreCollection } from '../../components/Collection';
|
|
4
4
|
import { IReqoreColumnsProps } from '../../components/Columns';
|
|
5
5
|
import { PADDING_FROM_SIZE } from '../../constants/sizes';
|
|
6
6
|
import items, { bigCollection } from '../../mock/collectionData';
|
|
7
7
|
|
|
8
|
+
import { StoryMeta } from '../utils';
|
|
8
9
|
import { argManager, IntentArg, SizeArg } from '../utils/args';
|
|
9
10
|
|
|
10
11
|
export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
@@ -13,54 +14,46 @@ export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
|
13
14
|
|
|
14
15
|
const { createArg, disableArgs } = argManager<IReqoreCollectionProps>();
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
const meta = {
|
|
17
18
|
title: 'Collections/Collection/Stories',
|
|
18
19
|
component: ReqoreCollection,
|
|
19
20
|
argTypes: {
|
|
20
21
|
...createArg('stacked', {
|
|
21
|
-
defaultValue: false,
|
|
22
22
|
type: 'boolean',
|
|
23
23
|
name: 'Stacked',
|
|
24
24
|
description: 'If true, the collection will be stacked',
|
|
25
25
|
}),
|
|
26
26
|
...createArg('maxItemHeight', {
|
|
27
|
-
defaultValue: 100,
|
|
28
27
|
type: 'number',
|
|
29
28
|
name: 'Max Item Height',
|
|
30
29
|
description: 'Max height of the collection item',
|
|
31
30
|
}),
|
|
32
31
|
...createArg('sortable', {
|
|
33
|
-
defaultValue: true,
|
|
34
32
|
type: 'boolean',
|
|
35
33
|
name: 'Sortable',
|
|
36
34
|
description: 'If true, the collection will be sortable',
|
|
37
35
|
}),
|
|
38
36
|
...createArg('filterable', {
|
|
39
|
-
defaultValue: true,
|
|
40
37
|
type: 'boolean',
|
|
41
38
|
name: 'Filterable',
|
|
42
39
|
description: 'If true, the collection will be filterable',
|
|
43
40
|
}),
|
|
44
41
|
...createArg('rounded', {
|
|
45
|
-
defaultValue: true,
|
|
46
42
|
type: 'boolean',
|
|
47
43
|
name: 'Rounded',
|
|
48
44
|
description: 'If true, the collection will be rounded when stacked',
|
|
49
45
|
}),
|
|
50
46
|
...createArg('height', {
|
|
51
|
-
defaultValue: undefined,
|
|
52
47
|
type: 'string',
|
|
53
48
|
name: 'Height',
|
|
54
49
|
description: 'Height of the collection',
|
|
55
50
|
}),
|
|
56
51
|
...createArg('fill', {
|
|
57
|
-
defaultValue: false,
|
|
58
52
|
type: 'boolean',
|
|
59
53
|
name: 'Fill parent',
|
|
60
54
|
description: 'If true, the collection will fill the parent',
|
|
61
55
|
}),
|
|
62
56
|
...createArg('label', {
|
|
63
|
-
defaultValue: undefined,
|
|
64
57
|
type: 'string',
|
|
65
58
|
name: 'Label',
|
|
66
59
|
description: 'Label of the collection',
|
|
@@ -69,193 +62,224 @@ export default {
|
|
|
69
62
|
...IntentArg,
|
|
70
63
|
...SizeArg,
|
|
71
64
|
},
|
|
72
|
-
|
|
65
|
+
args: {
|
|
66
|
+
selectedIcon: 'CheckLine',
|
|
67
|
+
maxItemHeight: 100,
|
|
68
|
+
sortable: true,
|
|
69
|
+
filterable: true,
|
|
70
|
+
rounded: true,
|
|
71
|
+
},
|
|
72
|
+
} as StoryMeta<typeof ReqoreCollection>;
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
74
|
+
export default meta;
|
|
75
|
+
type Story = StoryObj<typeof meta>;
|
|
77
76
|
|
|
78
|
-
export const Basic =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
export const Basic: Story = {
|
|
78
|
+
args: {
|
|
79
|
+
label: 'Config Items',
|
|
80
|
+
items,
|
|
81
|
+
actions: [
|
|
82
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
83
|
+
{ actions: [{ label: 'Test' }] },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
export const WithHeight =
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
export const WithHeight: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
label: 'Collection of items',
|
|
91
|
+
height: '600px',
|
|
92
|
+
items,
|
|
93
|
+
actions: [
|
|
94
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
95
|
+
{ actions: [{ label: 'Test' }] },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
97
98
|
};
|
|
98
99
|
|
|
99
|
-
export const Stacked =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
export const Stacked: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
label: 'Collection of items',
|
|
103
|
+
stacked: true,
|
|
104
|
+
items,
|
|
105
|
+
actions: [
|
|
106
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
107
|
+
{ actions: [{ label: 'Test' }] },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
108
110
|
};
|
|
109
111
|
|
|
110
|
-
export const Fill =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
export const Fill: Story = {
|
|
113
|
+
args: {
|
|
114
|
+
label: 'Collection of items',
|
|
115
|
+
fill: true,
|
|
116
|
+
items,
|
|
117
|
+
actions: [
|
|
118
|
+
{ label: 'Custom action', icon: 'Home7Line', fixed: true },
|
|
119
|
+
{ actions: [{ label: 'Test' }] },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
119
122
|
};
|
|
120
123
|
|
|
121
|
-
export const SelectedFirst =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
export const SelectedFirst: Story = {
|
|
125
|
+
args: {
|
|
126
|
+
label: 'Collection of items',
|
|
127
|
+
items,
|
|
128
|
+
showSelectedFirst: true,
|
|
129
|
+
},
|
|
126
130
|
};
|
|
127
131
|
|
|
128
|
-
export const Zoomable =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
export const Zoomable: Story = {
|
|
133
|
+
args: {
|
|
134
|
+
label: 'Collection of items',
|
|
135
|
+
items,
|
|
136
|
+
zoomable: true,
|
|
137
|
+
},
|
|
133
138
|
};
|
|
134
139
|
|
|
135
|
-
export const WithDefaultZoom =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
export const WithDefaultZoom: Story = {
|
|
141
|
+
args: {
|
|
142
|
+
label: 'Collection of items',
|
|
143
|
+
items,
|
|
144
|
+
zoomable: true,
|
|
145
|
+
size: 'tiny',
|
|
146
|
+
defaultZoom: 2,
|
|
147
|
+
},
|
|
142
148
|
};
|
|
143
149
|
|
|
144
|
-
export const CustomColumnsData =
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
export const CustomColumnsData: Story = {
|
|
151
|
+
args: {
|
|
152
|
+
columns: 2,
|
|
153
|
+
columnsGap: '50px',
|
|
154
|
+
minColumnWidth: '100px',
|
|
155
|
+
maxColumnWidth: '200px',
|
|
156
|
+
items,
|
|
157
|
+
label: '2 columns of max 200px width with 50px gap',
|
|
158
|
+
},
|
|
152
159
|
};
|
|
153
160
|
|
|
154
|
-
export const CustomPropsAndTexts =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
export const CustomPropsAndTexts: Story = {
|
|
162
|
+
args: {
|
|
163
|
+
label: 'Collection of items',
|
|
164
|
+
items,
|
|
165
|
+
inputProps: {
|
|
166
|
+
effect: {
|
|
167
|
+
gradient: { colors: 'warning' },
|
|
168
|
+
},
|
|
169
|
+
minimal: true,
|
|
161
170
|
},
|
|
162
|
-
|
|
171
|
+
inputPlaceholder: (items) => `Search in ${items.length} crazy items`,
|
|
172
|
+
sortButtonTooltip: (sort) => `Seradit ${sort === 'asc' ? 'vzestupne' : 'sestupne'}`,
|
|
173
|
+
displayButtonTooltip: (display) => `Zobrazit ${display === 'list' ? 'v liste' : 'v mriezke'}`,
|
|
163
174
|
},
|
|
164
|
-
inputPlaceholder: (items) => `Search in ${items.length} crazy items`,
|
|
165
|
-
sortButtonTooltip: (sort) => `Seradit ${sort === 'asc' ? 'vzestupne' : 'sestupne'}`,
|
|
166
|
-
displayButtonTooltip: (display) => `Zobrazit ${display === 'list' ? 'v liste' : 'v mriezke'}`,
|
|
167
175
|
};
|
|
168
176
|
|
|
169
|
-
export const ChildrenBeforeAndAfter =
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
177
|
+
export const ChildrenBeforeAndAfter: Story = {
|
|
178
|
+
args: {
|
|
179
|
+
label: 'Collection of items',
|
|
180
|
+
padded: false,
|
|
181
|
+
items,
|
|
182
|
+
contentRenderer: (children) => (
|
|
183
|
+
<>
|
|
184
|
+
<ReqoreControlGroup horizontalAlign='center' fluid>
|
|
185
|
+
<ReqoreButton fluid> I could be a filter of some kind</ReqoreButton>
|
|
186
|
+
</ReqoreControlGroup>
|
|
187
|
+
<ReqoreVerticalSpacer height={PADDING_FROM_SIZE.normal} />
|
|
188
|
+
{children}
|
|
189
|
+
<ReqoreVerticalSpacer height={PADDING_FROM_SIZE.normal} />
|
|
190
|
+
<ReqoreControlGroup horizontalAlign='center' fluid>
|
|
191
|
+
<ReqoreControlGroup fluid={false} fixed>
|
|
192
|
+
<ReqoreButton fixed textAlign='center'>
|
|
193
|
+
1
|
|
194
|
+
</ReqoreButton>
|
|
195
|
+
<ReqoreButton fixed textAlign='center'>
|
|
196
|
+
2
|
|
197
|
+
</ReqoreButton>
|
|
198
|
+
<ReqoreButton fixed textAlign='center'>
|
|
199
|
+
3
|
|
200
|
+
</ReqoreButton>
|
|
201
|
+
<ReqoreButton fixed textAlign='center'>
|
|
202
|
+
4
|
|
203
|
+
</ReqoreButton>
|
|
204
|
+
</ReqoreControlGroup>
|
|
196
205
|
</ReqoreControlGroup>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
206
|
+
</>
|
|
207
|
+
),
|
|
208
|
+
},
|
|
200
209
|
};
|
|
201
210
|
|
|
202
|
-
export const FilteringSearchingPaging =
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
export const FilteringSearchingPaging: Story = {
|
|
212
|
+
args: {
|
|
213
|
+
inputProps: {
|
|
214
|
+
fluid: true,
|
|
215
|
+
focusRules: {
|
|
216
|
+
type: 'keypress',
|
|
217
|
+
shortcut: 'letters',
|
|
218
|
+
clearOnFocus: true,
|
|
219
|
+
},
|
|
210
220
|
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
221
|
+
displayButtonProps: {
|
|
222
|
+
fixed: false,
|
|
223
|
+
},
|
|
224
|
+
sortButtonProps: {
|
|
225
|
+
fixed: false,
|
|
226
|
+
},
|
|
227
|
+
paging: 'buttons',
|
|
228
|
+
size: 'big',
|
|
229
|
+
padded: false,
|
|
230
|
+
items: bigCollection,
|
|
231
|
+
} as IReqoreCollectionProps,
|
|
232
|
+
};
|
|
223
233
|
|
|
224
|
-
export const CustomFilteringSearchingPaging =
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
234
|
+
export const CustomFilteringSearchingPaging: Story = {
|
|
235
|
+
args: {
|
|
236
|
+
inputProps: {
|
|
237
|
+
fluid: true,
|
|
238
|
+
focusRules: {
|
|
239
|
+
type: 'auto',
|
|
240
|
+
clearOnFocus: true,
|
|
241
|
+
},
|
|
231
242
|
},
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
243
|
+
paging: {
|
|
244
|
+
itemsPerPage: 55,
|
|
245
|
+
scrollToTopOnPageChange: true,
|
|
246
|
+
},
|
|
247
|
+
inputInTitle: false,
|
|
248
|
+
responsiveTitle: true,
|
|
249
|
+
size: 'small',
|
|
250
|
+
padded: false,
|
|
251
|
+
fill: true,
|
|
252
|
+
items: [
|
|
253
|
+
...bigCollection,
|
|
254
|
+
...bigCollection,
|
|
255
|
+
...bigCollection,
|
|
256
|
+
...bigCollection,
|
|
257
|
+
...bigCollection,
|
|
258
|
+
],
|
|
259
|
+
} as IReqoreCollectionProps,
|
|
260
|
+
};
|
|
244
261
|
|
|
245
|
-
export const DefaultFilter =
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
+
export const DefaultFilter: Story = {
|
|
263
|
+
args: {
|
|
264
|
+
inputProps: {
|
|
265
|
+
fluid: true,
|
|
266
|
+
},
|
|
267
|
+
defaultQuery: 'Med',
|
|
268
|
+
paging: {
|
|
269
|
+
itemsPerPage: 55,
|
|
270
|
+
scrollToTopOnPageChange: true,
|
|
271
|
+
},
|
|
272
|
+
inputInTitle: false,
|
|
273
|
+
responsiveTitle: true,
|
|
274
|
+
size: 'small',
|
|
275
|
+
padded: false,
|
|
276
|
+
fill: true,
|
|
277
|
+
items: [
|
|
278
|
+
...bigCollection,
|
|
279
|
+
...bigCollection,
|
|
280
|
+
...bigCollection,
|
|
281
|
+
...bigCollection,
|
|
282
|
+
...bigCollection,
|
|
283
|
+
],
|
|
284
|
+
} as IReqoreCollectionProps,
|
|
285
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
2
|
import { IReqoreColumnsProps } from '../../components/Columns';
|
|
3
3
|
import {
|
|
4
4
|
ReqoreButton,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ReqoreInput,
|
|
10
10
|
ReqoreVerticalSpacer,
|
|
11
11
|
} from '../../index';
|
|
12
|
+
import { StoryMeta } from '../utils';
|
|
12
13
|
import { argManager } from '../utils/args';
|
|
13
14
|
|
|
14
15
|
export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
@@ -17,15 +18,10 @@ export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
|
17
18
|
|
|
18
19
|
const { createArg, disableArgs } = argManager<IColumnsStoryArgs>();
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
const meta = {
|
|
21
22
|
title: 'Layout/Columns/Stories',
|
|
22
23
|
component: ReqoreColumns,
|
|
23
24
|
argTypes: {
|
|
24
|
-
...createArg('multipleColumns', {
|
|
25
|
-
defaultValue: false,
|
|
26
|
-
control: 'boolean',
|
|
27
|
-
name: 'Multiple Columns',
|
|
28
|
-
}),
|
|
29
25
|
...createArg('minColumnWidth', {
|
|
30
26
|
defaultValue: '200px',
|
|
31
27
|
}),
|
|
@@ -35,9 +31,6 @@ export default {
|
|
|
35
31
|
...createArg('alignItems', {
|
|
36
32
|
defaultValue: 'normal',
|
|
37
33
|
}),
|
|
38
|
-
...createArg('alignItems', {
|
|
39
|
-
defaultValue: 'normal',
|
|
40
|
-
}),
|
|
41
34
|
...createArg('columns', {
|
|
42
35
|
defaultValue: undefined,
|
|
43
36
|
type: 'string',
|
|
@@ -47,9 +40,17 @@ export default {
|
|
|
47
40
|
}),
|
|
48
41
|
...disableArgs(['className', 'multipleColumns']),
|
|
49
42
|
},
|
|
50
|
-
|
|
43
|
+
args: {
|
|
44
|
+
minColumnWidth: '200px',
|
|
45
|
+
maxColumnWidth: '300px',
|
|
46
|
+
alignItems: 'normal',
|
|
47
|
+
},
|
|
48
|
+
} as StoryMeta<typeof ReqoreColumns>;
|
|
49
|
+
|
|
50
|
+
export default meta;
|
|
51
|
+
type Story = StoryObj<typeof meta>;
|
|
51
52
|
|
|
52
|
-
const Template
|
|
53
|
+
const Template = (args) => {
|
|
53
54
|
return (
|
|
54
55
|
<ReqoreColumns {...args} columnsGap='10px'>
|
|
55
56
|
<ReqoreColumn
|
|
@@ -126,19 +127,32 @@ const Template: Story<IColumnsStoryArgs> = (args) => {
|
|
|
126
127
|
);
|
|
127
128
|
};
|
|
128
129
|
|
|
129
|
-
export const Basic =
|
|
130
|
-
|
|
131
|
-
MultipleColumns.args = {
|
|
132
|
-
multipleColumns: true,
|
|
130
|
+
export const Basic: Story = {
|
|
131
|
+
render: Template,
|
|
133
132
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
|
|
134
|
+
export const MultipleColumns: Story = {
|
|
135
|
+
render: Template,
|
|
136
|
+
|
|
137
|
+
args: {
|
|
138
|
+
multipleColumns: true,
|
|
139
|
+
},
|
|
138
140
|
};
|
|
139
141
|
|
|
140
|
-
export const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
export const CustomAlignment: Story = {
|
|
143
|
+
render: Template,
|
|
144
|
+
|
|
145
|
+
args: {
|
|
146
|
+
multipleColumns: true,
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const WithMinimumWidth = {
|
|
152
|
+
render: Template,
|
|
153
|
+
|
|
154
|
+
args: {
|
|
155
|
+
multipleColumns: true,
|
|
156
|
+
minColumnWidth: '500px',
|
|
157
|
+
},
|
|
144
158
|
};
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
2
|
import { IReqoreCommentFeedProps } from '../../components/CommentFeed';
|
|
3
3
|
import { ReqoreComment, ReqoreCommentFeed } from '../../index';
|
|
4
|
+
import { StoryMeta } from '../utils';
|
|
4
5
|
import { argManager } from '../utils/args';
|
|
5
6
|
|
|
6
7
|
const { createArg } = argManager<IReqoreCommentFeedProps>();
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const meta = {
|
|
9
10
|
title: 'Other/Comments/Stories',
|
|
11
|
+
component: ReqoreCommentFeed,
|
|
10
12
|
argTypes: {
|
|
11
13
|
...createArg('gapSize', {
|
|
12
|
-
defaultValue: '0',
|
|
13
14
|
type: 'string',
|
|
14
15
|
}),
|
|
15
16
|
},
|
|
16
|
-
|
|
17
|
+
args: {
|
|
18
|
+
gapSize: '0',
|
|
19
|
+
},
|
|
20
|
+
} as StoryMeta<typeof ReqoreCommentFeed>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
17
24
|
|
|
18
|
-
const Template
|
|
25
|
+
const Template = (args) => {
|
|
19
26
|
return (
|
|
20
27
|
<ReqoreCommentFeed {...args}>
|
|
21
28
|
<ReqoreComment title='Test comment' detail='2 hours ago' icon='UserFill'>
|
|
@@ -124,4 +131,6 @@ const Template: ComponentStory<typeof ReqoreCommentFeed> = (args) => {
|
|
|
124
131
|
);
|
|
125
132
|
};
|
|
126
133
|
|
|
127
|
-
export const Basic =
|
|
134
|
+
export const Basic: Story = {
|
|
135
|
+
render: Template,
|
|
136
|
+
};
|