@qoretechnologies/reqore 0.44.0 → 0.45.0
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/package.json +1 -1
- package/tests.json +1 -1
- package/.eslintrc.js +0 -40
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/ISSUE_TEMPLATE/new-component.md +0 -20
- package/.github/ISSUE_TEMPLATE/visual-bug-report.md +0 -38
- package/.github/workflows/beta_release.yml +0 -100
- package/.github/workflows/tests.yml +0 -84
- package/.gitpod.yml +0 -11
- package/.jest-test-results.json +0 -1
- package/.prettierrc +0 -7
- package/.vscode/settings.json +0 -0
- package/__tests__/breadcrumbs.test.tsx +0 -75
- package/__tests__/button.test.tsx +0 -218
- package/__tests__/checkbox.test.tsx +0 -45
- package/__tests__/collection.test.tsx +0 -243
- package/__tests__/containers/paging.test.tsx +0 -138
- package/__tests__/control_group.test.tsx +0 -32
- package/__tests__/drawer.test.tsx +0 -140
- package/__tests__/dropdown.test.tsx +0 -381
- package/__tests__/effect.test.tsx +0 -70
- package/__tests__/heading.test.tsx +0 -58
- package/__tests__/helpers/colors.test.tsx +0 -18
- package/__tests__/helpers/table.test.tsx +0 -67
- package/__tests__/hooks/useLatestZIndex.test.tsx +0 -10
- package/__tests__/hooks/useReqorePaging.test.tsx +0 -271
- package/__tests__/hooks/useTheme.test.tsx +0 -31
- package/__tests__/icon.test.tsx +0 -53
- package/__tests__/input.test.tsx +0 -482
- package/__tests__/layout.test.tsx +0 -37
- package/__tests__/menu.test.tsx +0 -65
- package/__tests__/messages.test.tsx +0 -79
- package/__tests__/modal.test.tsx +0 -204
- package/__tests__/multiselect.test.tsx +0 -458
- package/__tests__/navbar.test.tsx +0 -31
- package/__tests__/notifications.test.tsx +0 -178
- package/__tests__/pagination.test.tsx +0 -437
- package/__tests__/panel.test.tsx +0 -243
- package/__tests__/popover.test.tsx +0 -282
- package/__tests__/radiogroup.test.tsx +0 -47
- package/__tests__/setup.js +0 -8
- package/__tests__/stories/Collection.stories.tsx +0 -0
- package/__tests__/table.test.tsx +0 -647
- package/__tests__/tabs.test.tsx +0 -321
- package/__tests__/tag.test.tsx +0 -160
- package/__tests__/textarea.test.tsx +0 -467
- package/__tests__/timeAgo.test.tsx +0 -27
- package/__tests__/tree.test.tsx +0 -58
- package/build-storybook.log +0 -491
- package/chromatic.config.json +0 -1
- package/icons.ts +0 -1
- package/migration-storybook.log +0 -56
- package/public/logo-dark.png +0 -0
- package/public/logo.png +0 -0
- package/public/q-symbol-small.png +0 -0
- package/public/q-symbol.png +0 -0
- package/public/qoreLogo-dark.png +0 -0
- package/public/qoreLogo.png +0 -0
- package/src/components/Breadcrumbs/index.tsx +0 -254
- package/src/components/Breadcrumbs/item.tsx +0 -44
- package/src/components/Button/index.tsx +0 -633
- package/src/components/Checkbox/index.tsx +0 -388
- package/src/components/Collection/index.tsx +0 -426
- package/src/components/Collection/item.tsx +0 -267
- package/src/components/Columns/column.tsx +0 -27
- package/src/components/Columns/index.tsx +0 -41
- package/src/components/Comment/index.tsx +0 -141
- package/src/components/CommentFeed/index.tsx +0 -34
- package/src/components/Content/index.tsx +0 -34
- package/src/components/Content/wrapper.tsx +0 -36
- package/src/components/ControlGroup/index.tsx +0 -523
- package/src/components/DatePicker/index.tsx +0 -347
- package/src/components/Drawer/backdrop.tsx +0 -54
- package/src/components/Drawer/index.tsx +0 -365
- package/src/components/Dropdown/index.tsx +0 -153
- package/src/components/Dropdown/item.tsx +0 -33
- package/src/components/Dropdown/list.tsx +0 -222
- package/src/components/Effect/index.tsx +0 -464
- package/src/components/ExportModal/index.tsx +0 -99
- package/src/components/Header/index.tsx +0 -81
- package/src/components/Icon/index.tsx +0 -184
- package/src/components/Input/index.tsx +0 -295
- package/src/components/InputClearButton/index.tsx +0 -59
- package/src/components/InternalPopover/index.tsx +0 -303
- package/src/components/KeyValueTable/index.tsx +0 -192
- package/src/components/Label/index.tsx +0 -10
- package/src/components/Layout/content.tsx +0 -31
- package/src/components/Layout/index.tsx +0 -55
- package/src/components/Menu/divider.tsx +0 -92
- package/src/components/Menu/index.tsx +0 -141
- package/src/components/Menu/item.tsx +0 -137
- package/src/components/Menu/section.tsx +0 -81
- package/src/components/Message/index.tsx +0 -220
- package/src/components/Modal/index.tsx +0 -26
- package/src/components/MultiSelect/index.tsx +0 -288
- package/src/components/Navbar/divider.tsx +0 -50
- package/src/components/Navbar/group.tsx +0 -53
- package/src/components/Navbar/index.tsx +0 -82
- package/src/components/Navbar/item.tsx +0 -92
- package/src/components/Notifications/index.tsx +0 -57
- package/src/components/Notifications/notification.tsx +0 -362
- package/src/components/Paging/index.tsx +0 -321
- package/src/components/Panel/LabelEditor.tsx +0 -67
- package/src/components/Panel/NonResponsiveActions.tsx +0 -79
- package/src/components/Panel/__screenshots__/linux/panel-SomePanel.png +0 -0
- package/src/components/Panel/index.tsx +0 -912
- package/src/components/Panel/panel.screenshot.tsx +0 -29
- package/src/components/Paragraph/index.tsx +0 -43
- package/src/components/Popover/index.tsx +0 -68
- package/src/components/RadioGroup/index.tsx +0 -71
- package/src/components/Slider/index.tsx +0 -358
- package/src/components/Spacer/index.tsx +0 -142
- package/src/components/Spinner/index.tsx +0 -74
- package/src/components/Table/body.tsx +0 -109
- package/src/components/Table/cell.tsx +0 -136
- package/src/components/Table/header.tsx +0 -236
- package/src/components/Table/headerCell.tsx +0 -203
- package/src/components/Table/helpers.ts +0 -308
- package/src/components/Table/index.tsx +0 -797
- package/src/components/Table/row.tsx +0 -288
- package/src/components/Table/value.tsx +0 -28
- package/src/components/Tabs/content.tsx +0 -68
- package/src/components/Tabs/index.tsx +0 -124
- package/src/components/Tabs/item.tsx +0 -198
- package/src/components/Tabs/list.tsx +0 -381
- package/src/components/Tag/group.tsx +0 -73
- package/src/components/Tag/index.tsx +0 -463
- package/src/components/Textarea/index.tsx +0 -277
- package/src/components/TimeAgo/index.tsx +0 -15
- package/src/components/Tree/index.tsx +0 -271
- package/src/constants/animations.ts +0 -9
- package/src/constants/colors.ts +0 -13
- package/src/constants/paging.ts +0 -93
- package/src/constants/sizes.ts +0 -185
- package/src/constants/theme.ts +0 -122
- package/src/containers/Paging.tsx +0 -136
- package/src/containers/PopoverProvider.tsx +0 -124
- package/src/containers/ReqoreProvider.tsx +0 -289
- package/src/containers/ThemeProvider.tsx +0 -12
- package/src/containers/UIProvider.tsx +0 -101
- package/src/context/PopoverContext.tsx +0 -11
- package/src/context/ReqoreContext.tsx +0 -47
- package/src/context/ThemeContext.tsx +0 -4
- package/src/helpers/animations.ts +0 -13
- package/src/helpers/colors.ts +0 -335
- package/src/helpers/time.ts +0 -21
- package/src/helpers/utils.ts +0 -152
- package/src/hooks/useAutoFocus.ts +0 -106
- package/src/hooks/useCloneThroughFragments.ts +0 -39
- package/src/hooks/useCombinedRefs.ts +0 -26
- package/src/hooks/useLatestZIndex.ts +0 -13
- package/src/hooks/useOutsideClick.ts +0 -29
- package/src/hooks/usePaging.ts +0 -128
- package/src/hooks/usePopover.tsx +0 -220
- package/src/hooks/useQueryWithDelay.ts +0 -30
- package/src/hooks/useReqore.ts +0 -12
- package/src/hooks/useReqoreContext.ts +0 -16
- package/src/hooks/useReqoreEffect.ts +0 -49
- package/src/hooks/useTextareaAutoSize.ts +0 -22
- package/src/hooks/useTheme.ts +0 -48
- package/src/hooks/useTooltip.ts +0 -40
- package/src/hooks/useWhyDidYouUpdate.ts +0 -32
- package/src/icons.json +0 -2295
- package/src/index.tsx +0 -80
- package/src/mock/breadcrumbs.ts +0 -146
- package/src/mock/collectionData.tsx +0 -380
- package/src/mock/data.json +0 -11000
- package/src/mock/icons.ts +0 -32
- package/src/mock/menu.ts +0 -93
- package/src/mock/multiSelect.ts +0 -71
- package/src/mock/object.json +0 -317
- package/src/mock/styleMock.js +0 -1
- package/src/mock/tableData.ts +0 -64
- package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +0 -27
- package/src/stories/Button/Button.stories.tsx +0 -405
- package/src/stories/Checkbox/Checkbox.stories.tsx +0 -75
- package/src/stories/Collection/Collection.stories.tsx +0 -317
- package/src/stories/Columns/Columns.stories.tsx +0 -158
- package/src/stories/Comment/Comment.stories.tsx +0 -136
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +0 -399
- package/src/stories/DatePicker/DatePicker.stories.tsx +0 -348
- package/src/stories/Drawer/Drawer.stories.tsx +0 -294
- package/src/stories/Dropdown/Dropdown.stories.tsx +0 -375
- package/src/stories/Dropdown/DropdownTests.stories.tsx +0 -111
- package/src/stories/ExportModal/ExportModal.stories.tsx +0 -18
- package/src/stories/Header/Header.stories.tsx +0 -108
- package/src/stories/Icon/Icon.stories.tsx +0 -162
- package/src/stories/Input/Input.stories.tsx +0 -220
- package/src/stories/KeyValueTable/KeyValueTable.stories.tsx +0 -346
- package/src/stories/Label/Label.stories.tsx +0 -33
- package/src/stories/Menu/Menu.stories.tsx +0 -367
- package/src/stories/Message/Message.stories.tsx +0 -167
- package/src/stories/Modal/Manager.stories.tsx +0 -192
- package/src/stories/Modal/Modal.stories.tsx +0 -252
- package/src/stories/MultiSelect/MultiSelect.stories.tsx +0 -140
- package/src/stories/Navbar/Navbar.stories.tsx +0 -119
- package/src/stories/Notifications/Interactive.stories.tsx +0 -117
- package/src/stories/Notifications/Notification.stories.tsx +0 -216
- package/src/stories/Notifications/Notifications.stories.tsx +0 -81
- package/src/stories/Paging/Paging.stories.tsx +0 -255
- package/src/stories/Panel/Panel.stories.tsx +0 -753
- package/src/stories/Paragraph/Paragraph.stories.tsx +0 -108
- package/src/stories/Popover/Popover.stories.tsx +0 -510
- package/src/stories/RadioGroup/RadioGroup.stories.tsx +0 -212
- package/src/stories/Slider/Slider.stories.tsx +0 -173
- package/src/stories/Spacer/Spacer.stories.tsx +0 -100
- package/src/stories/Spinner/Spinner.stories.tsx +0 -82
- package/src/stories/Table/Table.stories.tsx +0 -571
- package/src/stories/Tabs/Tabs.stories.tsx +0 -346
- package/src/stories/Tag/Tag.stories.tsx +0 -381
- package/src/stories/Tag/TagGroup.stories.tsx +0 -307
- package/src/stories/TextArea/TextArea.stories.tsx +0 -287
- package/src/stories/TextArea/TextAreaTests.stories.tsx +0 -108
- package/src/stories/Tree/Tree.stories.tsx +0 -124
- package/src/stories/Wrapper.tsx +0 -13
- package/src/stories/utils/args.ts +0 -151
- package/src/stories/utils.ts +0 -39
- package/src/styles.ts +0 -124
- package/src/types/global.ts +0 -211
- package/src/types/icons.ts +0 -2272
- package/tsconfig.prod.json +0 -26
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { expect } from '@storybook/jest';
|
|
2
|
-
import { StoryObj } from '@storybook/react';
|
|
3
|
-
import { fireEvent, waitFor, within } from '@storybook/testing-library';
|
|
4
|
-
import { noop } from 'lodash';
|
|
5
|
-
import { useEffect, useState } from 'react';
|
|
6
|
-
import { ReqoreBackdrop } from '../../components/Drawer/backdrop';
|
|
7
|
-
import {
|
|
8
|
-
ReqoreButton,
|
|
9
|
-
ReqoreCollection,
|
|
10
|
-
ReqoreControlGroup,
|
|
11
|
-
ReqoreInput,
|
|
12
|
-
ReqoreModal,
|
|
13
|
-
ReqorePanel,
|
|
14
|
-
useReqoreProperty,
|
|
15
|
-
} from '../../index';
|
|
16
|
-
import { StoryMeta } from '../utils';
|
|
17
|
-
|
|
18
|
-
const TIMEOUT = 2000;
|
|
19
|
-
|
|
20
|
-
const meta = {
|
|
21
|
-
title: 'Utilities/Global Modal/Tests',
|
|
22
|
-
component: ReqoreModal,
|
|
23
|
-
render: ({ data, updateToData, options }) => {
|
|
24
|
-
const addModal = useReqoreProperty('addModal');
|
|
25
|
-
const [modalId, setModalId] = useState<string>(undefined);
|
|
26
|
-
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (updateToData && modalId) {
|
|
29
|
-
setTimeout(() => {
|
|
30
|
-
addModal(updateToData, modalId);
|
|
31
|
-
}, TIMEOUT);
|
|
32
|
-
}
|
|
33
|
-
}, [modalId]);
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<ReqoreControlGroup>
|
|
37
|
-
<ReqoreButton
|
|
38
|
-
id='modal'
|
|
39
|
-
onClick={() => {
|
|
40
|
-
setModalId(addModal(data, 'modal', options));
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
Open new modal
|
|
44
|
-
</ReqoreButton>
|
|
45
|
-
</ReqoreControlGroup>
|
|
46
|
-
);
|
|
47
|
-
},
|
|
48
|
-
} as StoryMeta<any>;
|
|
49
|
-
|
|
50
|
-
export default meta;
|
|
51
|
-
type Story = StoryObj<typeof meta>;
|
|
52
|
-
|
|
53
|
-
export const FromObject: Story = {
|
|
54
|
-
args: {
|
|
55
|
-
data: {
|
|
56
|
-
label: 'Test modal',
|
|
57
|
-
children: (
|
|
58
|
-
<ReqorePanel collapsible>This is a modal from an object with complex children</ReqorePanel>
|
|
59
|
-
),
|
|
60
|
-
bottomActions: [
|
|
61
|
-
{
|
|
62
|
-
label: 'Cancel',
|
|
63
|
-
onClick: noop,
|
|
64
|
-
icon: 'CloseLine',
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
play: async ({ canvasElement }) => {
|
|
70
|
-
const canvas = within(canvasElement);
|
|
71
|
-
|
|
72
|
-
await fireEvent.click(canvas.getAllByText('Open new modal')[0]);
|
|
73
|
-
|
|
74
|
-
await expect(document.querySelector('.reqore-modal')).toBeTruthy();
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const ModalWithState = (props) => {
|
|
79
|
-
const [text, setText] = useState('This is a modal with its own state');
|
|
80
|
-
const addModal = useReqoreProperty('addModal');
|
|
81
|
-
const removeModal = useReqoreProperty('removeModal');
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<ReqoreModal label={props.label} {...props}>
|
|
85
|
-
<ReqoreControlGroup>
|
|
86
|
-
<ReqoreInput
|
|
87
|
-
value={text}
|
|
88
|
-
intent={props.intent}
|
|
89
|
-
onChange={(e: any) => setText(e.target.value)}
|
|
90
|
-
/>
|
|
91
|
-
<ReqoreButton
|
|
92
|
-
onClick={() => addModal(<ModalWithState label='Another modal' />)}
|
|
93
|
-
tooltip='Open sesame'
|
|
94
|
-
>
|
|
95
|
-
Open another modal
|
|
96
|
-
</ReqoreButton>
|
|
97
|
-
<ReqoreButton onClick={() => removeModal('modal')}>Remove modal</ReqoreButton>
|
|
98
|
-
</ReqoreControlGroup>
|
|
99
|
-
<ReqoreCollection items={[{ label: 'Item 1' }, { label: 'Item 2' }]} />
|
|
100
|
-
</ReqoreModal>
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export const FromElement: Story = {
|
|
105
|
-
args: {
|
|
106
|
-
data: (<ModalWithState label='Test modal' />) as any,
|
|
107
|
-
},
|
|
108
|
-
play: async ({ canvasElement, ...rest }) => {
|
|
109
|
-
await FromObject.play({ canvasElement, ...rest });
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const FromCustomElement: Story = {
|
|
114
|
-
args: {
|
|
115
|
-
data: (
|
|
116
|
-
<>
|
|
117
|
-
<ReqoreBackdrop />
|
|
118
|
-
<div
|
|
119
|
-
className='custom-modal reqore-modal'
|
|
120
|
-
style={{
|
|
121
|
-
position: 'fixed',
|
|
122
|
-
left: '50%',
|
|
123
|
-
top: '50%',
|
|
124
|
-
transform: 'translate(-50%, -50%)',
|
|
125
|
-
width: 500,
|
|
126
|
-
height: 300,
|
|
127
|
-
display: 'flex',
|
|
128
|
-
justifyContent: 'center',
|
|
129
|
-
alignItems: 'center',
|
|
130
|
-
border: '1px solid red',
|
|
131
|
-
zIndex: 10000,
|
|
132
|
-
}}
|
|
133
|
-
>
|
|
134
|
-
This is a custom modal
|
|
135
|
-
</div>
|
|
136
|
-
</>
|
|
137
|
-
),
|
|
138
|
-
},
|
|
139
|
-
play: async ({ canvasElement, ...rest }) => {
|
|
140
|
-
await FromObject.play({ canvasElement, ...rest });
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export const CanBeClosed: Story = {
|
|
145
|
-
...FromObject,
|
|
146
|
-
play: async ({ canvasElement, ...rest }) => {
|
|
147
|
-
await FromObject.play({ canvasElement, ...rest });
|
|
148
|
-
await fireEvent.click(document.querySelector('.reqore-drawer-close-button'));
|
|
149
|
-
|
|
150
|
-
await expect(document.querySelector('.reqore-modal')).toBeNull();
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export const CanBeClosedManually: Story = {
|
|
155
|
-
...FromElement,
|
|
156
|
-
play: async ({ canvasElement, ...rest }) => {
|
|
157
|
-
const canvas = within(canvasElement);
|
|
158
|
-
await FromObject.play({ canvasElement, ...rest });
|
|
159
|
-
await waitFor(async () => await canvas.findAllByText('Remove modal')[0], { timeout: 10000 });
|
|
160
|
-
|
|
161
|
-
await fireEvent.click(canvas.getAllByText('Remove modal')[0]);
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
export const CannotBeClosed: Story = {
|
|
166
|
-
args: {
|
|
167
|
-
data: {
|
|
168
|
-
children: 'I cannot be closed',
|
|
169
|
-
},
|
|
170
|
-
options: {
|
|
171
|
-
closable: false,
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
play: async ({ canvasElement, ...rest }) => {
|
|
175
|
-
await FromObject.play({ canvasElement, ...rest });
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export const CanBeUpdated: Story = {
|
|
180
|
-
args: {
|
|
181
|
-
data: (<ModalWithState label='Test modal' />) as any,
|
|
182
|
-
updateToData: (<ModalWithState label='Updated modal' intent='info' />) as any,
|
|
183
|
-
},
|
|
184
|
-
play: async ({ canvasElement, ...rest }) => {
|
|
185
|
-
const canvas = within(canvasElement);
|
|
186
|
-
await FromElement.play({ canvasElement, ...rest });
|
|
187
|
-
|
|
188
|
-
await waitFor(async () => await canvas.findByText('Updated modal'), { timeout: 10000 });
|
|
189
|
-
|
|
190
|
-
await expect(canvas.findByText('Updated modal')).toBeTruthy();
|
|
191
|
-
},
|
|
192
|
-
};
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
|
-
import { noop } from 'lodash';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { useMount } from 'react-use';
|
|
5
|
-
import { IReqoreModalProps } from '../../components/Modal';
|
|
6
|
-
import { ReqoreModal, ReqorePanel, useReqoreProperty } from '../../index';
|
|
7
|
-
import { StoryMeta } from '../utils';
|
|
8
|
-
import { FlatArg, IntentArg, argManager } from '../utils/args';
|
|
9
|
-
|
|
10
|
-
const { createArg } = argManager<IReqoreModalProps>();
|
|
11
|
-
|
|
12
|
-
const meta = {
|
|
13
|
-
title: 'Dialogs/Modal/Stories',
|
|
14
|
-
component: ReqoreModal,
|
|
15
|
-
args: {
|
|
16
|
-
isOpen: true,
|
|
17
|
-
label: 'This is a test',
|
|
18
|
-
blur: 3,
|
|
19
|
-
opacity: 1,
|
|
20
|
-
hasBackdrop: true,
|
|
21
|
-
width: '80vw',
|
|
22
|
-
height: '50vh',
|
|
23
|
-
},
|
|
24
|
-
argTypes: {
|
|
25
|
-
...IntentArg,
|
|
26
|
-
...FlatArg,
|
|
27
|
-
...createArg('isOpen', {
|
|
28
|
-
type: 'boolean',
|
|
29
|
-
defaultValue: true,
|
|
30
|
-
name: 'Is Open',
|
|
31
|
-
description: 'Whether the modal is open or not',
|
|
32
|
-
}),
|
|
33
|
-
...createArg('label', {
|
|
34
|
-
defaultValue: 'This is a test',
|
|
35
|
-
name: 'Label',
|
|
36
|
-
type: 'string',
|
|
37
|
-
}),
|
|
38
|
-
...createArg('blur', {
|
|
39
|
-
defaultValue: 3,
|
|
40
|
-
name: 'Backdrop blur',
|
|
41
|
-
type: 'number',
|
|
42
|
-
}),
|
|
43
|
-
...createArg('opacity', {
|
|
44
|
-
defaultValue: 1,
|
|
45
|
-
name: 'Modal Opacity',
|
|
46
|
-
type: 'number',
|
|
47
|
-
}),
|
|
48
|
-
...createArg('hasBackdrop', {
|
|
49
|
-
defaultValue: true,
|
|
50
|
-
name: 'Has Backdrop',
|
|
51
|
-
type: 'boolean',
|
|
52
|
-
}),
|
|
53
|
-
...createArg('width', {
|
|
54
|
-
defaultValue: '80vw',
|
|
55
|
-
name: 'Width',
|
|
56
|
-
type: 'string',
|
|
57
|
-
}),
|
|
58
|
-
...createArg('height', {
|
|
59
|
-
defaultValue: '50vh',
|
|
60
|
-
name: 'Height',
|
|
61
|
-
type: 'string',
|
|
62
|
-
}),
|
|
63
|
-
},
|
|
64
|
-
} as StoryMeta<typeof ReqoreModal>;
|
|
65
|
-
|
|
66
|
-
export default meta;
|
|
67
|
-
type Story = StoryObj<typeof meta>;
|
|
68
|
-
|
|
69
|
-
const Template: StoryFn<IReqoreModalProps & { confirm?: boolean }> = (args) => {
|
|
70
|
-
const confirmAction = useReqoreProperty('confirmAction');
|
|
71
|
-
const [count, setCount] = useState(0);
|
|
72
|
-
|
|
73
|
-
const handleConfirm = () => {
|
|
74
|
-
confirmAction({
|
|
75
|
-
description: 'How is the wheather going to be?',
|
|
76
|
-
title: 'Tell me something',
|
|
77
|
-
onConfirm: noop,
|
|
78
|
-
onCancel: noop,
|
|
79
|
-
});
|
|
80
|
-
setCount(count + 1);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
useMount(() => {
|
|
84
|
-
if (args.confirm) {
|
|
85
|
-
handleConfirm();
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<>
|
|
91
|
-
<ReqorePanel label='Just some background text' padded>
|
|
92
|
-
By impossible of in difficulty discovered celebrated ye. Justice joy manners boy met resolve
|
|
93
|
-
produce. Bed head loud next plan rent had easy add him. As earnestly shameless elsewhere
|
|
94
|
-
defective estimable fulfilled of. Esteem my advice it an excuse enable. Few household
|
|
95
|
-
abilities believing determine zealously his repulsive. To open draw dear be by side like.
|
|
96
|
-
Allow miles wound place the leave had. To sitting subject no improve studied limited. Ye
|
|
97
|
-
indulgence unreserved connection alteration appearance my an astonished. Up as seen sent
|
|
98
|
-
make he they of. Her raising and himself pasture believe females. Fancy she stuff after
|
|
99
|
-
aware merit small his. Charmed esteems luckily age out. At ourselves direction believing do
|
|
100
|
-
he departure. Celebrated her had sentiments understood are projection set. Possession ye no
|
|
101
|
-
mr unaffected remarkably at. Wrote house in never fruit up. Pasture imagine my garrets an
|
|
102
|
-
he. However distant she request behaved see nothing. Talking settled at pleased an of me
|
|
103
|
-
brother weather. Breakfast procuring nay end happiness allowance assurance frankness. Met
|
|
104
|
-
simplicity nor difficulty unreserved who. Entreaties mr conviction dissimilar me astonished
|
|
105
|
-
estimating cultivated. On no applauded exquisite my additions. Pronounce add boy estimable
|
|
106
|
-
nay suspected. You sudden nay elinor thirty esteem temper. Quiet leave shy you gay off asked
|
|
107
|
-
large style. Rooms oh fully taken by worse do. Points afraid but may end law lasted. Was out
|
|
108
|
-
laughter raptures returned outweigh. Luckily cheered colonel me do we attacks on highest
|
|
109
|
-
enabled. Tried law yet style child. Bore of true of no be deal. Frequently sufficient in be
|
|
110
|
-
unaffected. The furnished she concluded depending procuring concealed. In to am attended
|
|
111
|
-
desirous raptures declared diverted confined at. Collected instantly remaining up certainly
|
|
112
|
-
to necessary as. Over walk dull into son boy door went new. At or happiness commanded
|
|
113
|
-
daughters as. Is handsome an declared at received in extended vicinity subjects. Into miss
|
|
114
|
-
on he over been late pain an. Only week bore boy what fat case left use. Match round scale
|
|
115
|
-
now sex style far times. Your me past an much. Able an hope of body. Any nay shyness article
|
|
116
|
-
matters own removal nothing his forming. Gay own additions education satisfied the
|
|
117
|
-
perpetual. If he cause manor happy. Without farther she exposed saw man led. Along on happy
|
|
118
|
-
could cease green oh. Her old collecting she considered discovered. So at parties he warrant
|
|
119
|
-
oh staying. Square new horses and put better end. Sincerity collected happiness do is
|
|
120
|
-
contented. Sigh ever way now many. Alteration you any nor unsatiable diminution reasonable
|
|
121
|
-
companions shy partiality. Leaf by left deal mile oh if easy. Added woman first get led joy
|
|
122
|
-
not early jokes. As am hastily invited settled at limited civilly fortune me. Really spring
|
|
123
|
-
in extent an by. Judge but built gay party world. Of so am he remember although required.
|
|
124
|
-
Bachelor unpacked be advanced at. Confined in declared marianne is vicinity. It sportsman
|
|
125
|
-
earnestly ye preserved an on. Moment led family sooner cannot her window pulled any. Or
|
|
126
|
-
raillery if improved landlord to speaking hastened differed he. Furniture discourse
|
|
127
|
-
elsewhere yet her sir extensive defective unwilling get. Why resolution one motionless you
|
|
128
|
-
him thoroughly. Noise is round to in it quick timed doors. Written address greatly get
|
|
129
|
-
attacks inhabit pursuit our but. Lasted hunted enough an up seeing in lively letter. Had
|
|
130
|
-
judgment out opinions property the supplied.
|
|
131
|
-
</ReqorePanel>
|
|
132
|
-
<ReqoreModal
|
|
133
|
-
{...args}
|
|
134
|
-
onClose={() => noop}
|
|
135
|
-
bottomActions={[
|
|
136
|
-
{ label: 'Confirm', intent: 'success', position: 'right', onClick: handleConfirm },
|
|
137
|
-
{ label: 'Cancel', intent: 'danger', position: 'left' },
|
|
138
|
-
]}
|
|
139
|
-
>
|
|
140
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
|
141
|
-
labore et dolore magna aliqua. Sit amet purus gravida quis blandit turpis cursus in hac.
|
|
142
|
-
Ultricies lacus sed turpis tincidunt. Ac tincidunt vitae semper quis lectus nulla at.
|
|
143
|
-
Aliquam vestibulum morbi blandit cursus risus at ultrices. Risus feugiat in ante metus
|
|
144
|
-
dictum. Enim blandit volutpat maecenas volutpat. Nulla posuere sollicitudin aliquam ultrices
|
|
145
|
-
sagittis orci a scelerisque. Mollis nunc sed id semper risus in hendrerit gravida. Sem nulla
|
|
146
|
-
pharetra diam sit amet nisl suscipit. Congue eu consequat ac felis donec et odio
|
|
147
|
-
pellentesque diam. Augue mauris augue neque gravida in fermentum et sollicitudin. Nulla
|
|
148
|
-
pellentesque dignissim enim sit amet venenatis urna. Nunc sed blandit libero volutpat sed.
|
|
149
|
-
Mi in nulla posuere sollicitudin. Eu consequat ac felis donec et odio pellentesque diam.
|
|
150
|
-
Viverra nam libero justo laoreet sit amet cursus sit amet. Posuere sollicitudin aliquam
|
|
151
|
-
ultrices sagittis orci a scelerisque. Et netus et malesuada fames ac. Arcu non odio euismod
|
|
152
|
-
lacinia at quis risus sed vulputate. Sapien eget mi proin sed libero enim sed. Suspendisse
|
|
153
|
-
faucibus interdum posuere lorem ipsum. In est ante in nibh mauris cursus. Urna cursus eget
|
|
154
|
-
nunc scelerisque. Mi eget mauris pharetra et ultrices neque. Turpis nunc eget lorem dolor
|
|
155
|
-
sed viverra ipsum nunc aliquet. Id aliquet lectus proin nibh. At auctor urna nunc id cursus.
|
|
156
|
-
Erat pellentesque adipiscing commodo elit at imperdiet. Ipsum dolor sit amet consectetur
|
|
157
|
-
adipiscing elit. Suspendisse interdum consectetur libero id faucibus nisl. Leo vel orci
|
|
158
|
-
porta non pulvinar neque laoreet. Ut diam quam nulla porttitor massa. By impossible of in
|
|
159
|
-
difficulty discovered celebrated ye. Justice joy manners boy met resolve produce. Bed head
|
|
160
|
-
loud next plan rent had easy add him. As earnestly shameless elsewhere defective estimable
|
|
161
|
-
fulfilled of. Esteem my advice it an excuse enable. Few household abilities believing
|
|
162
|
-
determine zealously his repulsive. To open draw dear be by side like. Allow miles wound
|
|
163
|
-
place the leave had. To sitting subject no improve studied limited. Ye indulgence unreserved
|
|
164
|
-
connection alteration appearance my an astonished. Up as seen sent make he they of. Her
|
|
165
|
-
raising and himself pasture believe females. Fancy she stuff after aware merit small his.
|
|
166
|
-
Charmed esteems luckily age out. At ourselves direction believing do he departure.
|
|
167
|
-
Celebrated her had sentiments understood are projection set. Possession ye no mr unaffected
|
|
168
|
-
remarkably at. Wrote house in never fruit up. Pasture imagine my garrets an he. However
|
|
169
|
-
distant she request behaved see nothing. Talking settled at pleased an of me brother
|
|
170
|
-
weather. Breakfast procuring nay end happiness allowance assurance frankness. Met simplicity
|
|
171
|
-
nor difficulty unreserved who. Entreaties mr conviction dissimilar me astonished estimating
|
|
172
|
-
cultivated. On no applauded exquisite my additions. Pronounce add boy estimable nay
|
|
173
|
-
suspected. You sudden nay elinor thirty esteem temper. Quiet leave shy you gay off asked
|
|
174
|
-
large style. Rooms oh fully taken by worse do. Points afraid but may end law lasted. Was out
|
|
175
|
-
laughter raptures returned outweigh. Luckily cheered colonel me do we attacks on highest
|
|
176
|
-
enabled. Tried law yet style child. Bore of true of no be deal. Frequently sufficient in be
|
|
177
|
-
unaffected. The furnished she concluded depending procuring concealed. In to am attended
|
|
178
|
-
desirous raptures declared diverted confined at. Collected instantly remaining up certainly
|
|
179
|
-
to necessary as. Over walk dull into son boy door went new. At or happiness commanded
|
|
180
|
-
daughters as. Is handsome an declared at received in extended vicinity subjects. Into miss
|
|
181
|
-
on he over been late pain an. Only week bore boy what fat case left use. Match round scale
|
|
182
|
-
now sex style far times. Your me past an much. Able an hope of body. Any nay shyness article
|
|
183
|
-
matters own removal nothing his forming. Gay own additions education satisfied the
|
|
184
|
-
perpetual. If he cause manor happy. Without farther she exposed saw man led. Along on happy
|
|
185
|
-
could cease green oh. Her old collecting she considered discovered. So at parties he warrant
|
|
186
|
-
oh staying. Square new horses and put better end. Sincerity collected happiness do is
|
|
187
|
-
contented. Sigh ever way now many. Alteration you any nor unsatiable diminution reasonable
|
|
188
|
-
companions shy partiality. Leaf by left deal mile oh if easy. Added woman first get led joy
|
|
189
|
-
not early jokes. As am hastily invited settled at limited civilly fortune me. Really spring
|
|
190
|
-
in extent an by. Judge but built gay party world. Of so am he remember although required.
|
|
191
|
-
Bachelor unpacked be advanced at. Confined in declared marianne is vicinity. It sportsman
|
|
192
|
-
earnestly ye preserved an on. Moment led family sooner cannot her window pulled any. Or
|
|
193
|
-
raillery if improved landlord to speaking hastened differed he. Furniture discourse
|
|
194
|
-
elsewhere yet her sir extensive defective unwilling get. Why resolution one motionless you
|
|
195
|
-
him thoroughly. Noise is round to in it quick timed doors. Written address greatly get
|
|
196
|
-
attacks inhabit pursuit our but. Lasted hunted enough an up seeing in lively letter. Had
|
|
197
|
-
judgment out opinions property the supplied. By impossible of in difficulty discovered
|
|
198
|
-
celebrated ye. Justice joy manners boy met resolve produce. Bed head loud next plan rent had
|
|
199
|
-
easy add him. As earnestly shameless elsewhere defective estimable fulfilled of. Esteem my
|
|
200
|
-
advice it an excuse enable. Few household abilities believing determine zealously his
|
|
201
|
-
repulsive. To open draw dear be by side like. Allow miles wound place the leave had. To
|
|
202
|
-
sitting subject no improve studied limited. Ye indulgence unreserved connection alteration
|
|
203
|
-
appearance my an astonished. Up as seen sent make he they of. Her raising and himself
|
|
204
|
-
pasture believe females. Fancy she stuff after aware merit small his. Charmed esteems
|
|
205
|
-
luckily age out. At ourselves direction believing do he departure. Celebrated her had
|
|
206
|
-
sentiments understood are projection set. Possession ye no mr unaffected remarkably at.
|
|
207
|
-
Wrote house in never fruit up. Pasture imagine my garrets an he. However distant she request
|
|
208
|
-
behaved see nothing. Talking settled at pleased an of me brother weather. Breakfast
|
|
209
|
-
procuring nay end happiness allowance assurance frankness. Met simplicity nor difficulty
|
|
210
|
-
unreserved who. Entreaties mr conviction dissimilar me astonished estimating cultivated. On
|
|
211
|
-
no applauded exquisite my additions. Pronounce add boy estimable nay suspected. You sudden
|
|
212
|
-
nay elinor thirty esteem temper. Quiet leave shy you gay off asked large style. Rooms oh
|
|
213
|
-
fully taken by worse do. Points afraid but may end law lasted. Was out laughter raptures
|
|
214
|
-
returned outweigh. Luckily cheered colonel me do we attacks on highest enabled. Tried law
|
|
215
|
-
yet style child. Bore of true of no be deal. Frequently sufficient in be unaffected. The
|
|
216
|
-
furnished she concluded depending procuring concealed. In to am attended desirous raptures
|
|
217
|
-
declared diverted confined at. Collected instantly remaining up certainly to necessary as.
|
|
218
|
-
Over walk dull into son boy door went new. At or happiness commanded daughters as. Is
|
|
219
|
-
handsome an declared at received in extended vicinity subjects. Into miss on he over been
|
|
220
|
-
late pain an. Only week bore boy what fat case left use. Match round scale now sex style far
|
|
221
|
-
times. Your me past an much. Able an hope of body. Any nay shyness article matters own
|
|
222
|
-
removal nothing his forming. Gay own additions education satisfied the perpetual. If he
|
|
223
|
-
cause manor happy. Without farther she exposed saw man led. Along on happy could cease green
|
|
224
|
-
oh. Her old collecting she considered discovered. So at parties he warrant oh staying.
|
|
225
|
-
Square new horses and put better end. Sincerity collected happiness do is contented. Sigh
|
|
226
|
-
ever way now many. Alteration you any nor unsatiable diminution reasonable companions shy
|
|
227
|
-
partiality. Leaf by left deal mile oh if easy. Added woman first get led joy not early
|
|
228
|
-
jokes. As am hastily invited settled at limited civilly fortune me. Really spring in extent
|
|
229
|
-
an by. Judge but built gay party world. Of so am he remember although required. Bachelor
|
|
230
|
-
unpacked be advanced at. Confined in declared marianne is vicinity. It sportsman earnestly
|
|
231
|
-
ye preserved an on. Moment led family sooner cannot her window pulled any. Or raillery if
|
|
232
|
-
improved landlord to speaking hastened differed he. Furniture discourse elsewhere yet her
|
|
233
|
-
sir extensive defective unwilling get. Why resolution one motionless you him thoroughly.
|
|
234
|
-
Noise is round to in it quick timed doors. Written address greatly get attacks inhabit
|
|
235
|
-
pursuit our but. Lasted hunted enough an up seeing in lively letter. Had judgment out
|
|
236
|
-
opinions property the supplied.
|
|
237
|
-
</ReqoreModal>
|
|
238
|
-
</>
|
|
239
|
-
);
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
export const Basic: Story = {
|
|
243
|
-
render: Template,
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
export const ConfirmationModal: Story = {
|
|
247
|
-
render: Template,
|
|
248
|
-
|
|
249
|
-
args: {
|
|
250
|
-
confirm: true,
|
|
251
|
-
},
|
|
252
|
-
};
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { IReqoreMultiSelectProps, ReqoreMultiSelect } from '../../components/MultiSelect';
|
|
4
|
-
import { MultiSelectItems } from '../../mock/multiSelect';
|
|
5
|
-
import { IReqoreIconName } from '../../types/icons';
|
|
6
|
-
import { StoryMeta } from '../utils';
|
|
7
|
-
import { FlatArg, IconArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
8
|
-
|
|
9
|
-
const { createArg } = argManager<IReqoreMultiSelectProps>();
|
|
10
|
-
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Form/Multi Select/Stories',
|
|
13
|
-
component: ReqoreMultiSelect,
|
|
14
|
-
parameters: {
|
|
15
|
-
chromatic: {
|
|
16
|
-
delay: 500,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
args: {
|
|
20
|
-
canCreateItems: true,
|
|
21
|
-
canRemoveItems: true,
|
|
22
|
-
},
|
|
23
|
-
argTypes: {
|
|
24
|
-
...FlatArg,
|
|
25
|
-
...MinimalArg(),
|
|
26
|
-
...SizeArg,
|
|
27
|
-
...createArg('canCreateItems', {
|
|
28
|
-
defaultValue: true,
|
|
29
|
-
name: 'Can create items',
|
|
30
|
-
type: 'boolean',
|
|
31
|
-
}),
|
|
32
|
-
...createArg('canRemoveItems', {
|
|
33
|
-
defaultValue: true,
|
|
34
|
-
name: 'Can remove items',
|
|
35
|
-
type: 'boolean',
|
|
36
|
-
}),
|
|
37
|
-
...IconArg('onItemClickIcon', 'Clickable item right icon', null),
|
|
38
|
-
},
|
|
39
|
-
} as StoryMeta<typeof ReqoreMultiSelect>;
|
|
40
|
-
|
|
41
|
-
export default meta;
|
|
42
|
-
type Story = StoryObj<typeof meta>;
|
|
43
|
-
|
|
44
|
-
const Template: StoryFn<IReqoreMultiSelectProps> = (args: IReqoreMultiSelectProps) => {
|
|
45
|
-
const [selected, setSelected] = useState<string[]>([
|
|
46
|
-
'Existing item 3',
|
|
47
|
-
'Disabled item',
|
|
48
|
-
'itemWithNoLabel',
|
|
49
|
-
]);
|
|
50
|
-
|
|
51
|
-
console.log({ selected });
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<ReqoreMultiSelect
|
|
55
|
-
value={selected}
|
|
56
|
-
{...args}
|
|
57
|
-
onValueChange={setSelected}
|
|
58
|
-
enterKeySelects
|
|
59
|
-
selectorProps={{
|
|
60
|
-
listHeight: '600px',
|
|
61
|
-
...args.selectorProps,
|
|
62
|
-
}}
|
|
63
|
-
items={MultiSelectItems}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export const Basic: Story = {
|
|
69
|
-
render: Template,
|
|
70
|
-
|
|
71
|
-
args: {
|
|
72
|
-
onItemClickIcon: 'EditLine',
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const Empty: Story = {
|
|
77
|
-
render: Template,
|
|
78
|
-
|
|
79
|
-
args: {
|
|
80
|
-
value: [],
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const AutoOpen: Story = {
|
|
85
|
-
render: Template,
|
|
86
|
-
|
|
87
|
-
args: {
|
|
88
|
-
openOnMount: true,
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export const Flat: Story = {
|
|
93
|
-
render: Template,
|
|
94
|
-
|
|
95
|
-
args: {
|
|
96
|
-
flat: true,
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const Minimal: Story = {
|
|
101
|
-
render: Template,
|
|
102
|
-
|
|
103
|
-
args: {
|
|
104
|
-
minimal: true,
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export const Clickable: Story = {
|
|
109
|
-
render: Template,
|
|
110
|
-
|
|
111
|
-
args: {
|
|
112
|
-
onItemClick: (item) => console.log('onItemClick', item),
|
|
113
|
-
onItemClickIcon: 'EditLine' as IReqoreIconName,
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const WithEffect: Story = {
|
|
118
|
-
render: Template,
|
|
119
|
-
|
|
120
|
-
args: {
|
|
121
|
-
selectedItemEffect: {
|
|
122
|
-
gradient: {
|
|
123
|
-
colors: {
|
|
124
|
-
0: '#7f60ea',
|
|
125
|
-
100: '#00fd67',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
selectorProps: {
|
|
130
|
-
effect: {
|
|
131
|
-
gradient: {
|
|
132
|
-
colors: {
|
|
133
|
-
0: '#7f60ea',
|
|
134
|
-
100: '#00fd67',
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
};
|