@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,287 +0,0 @@
|
|
|
1
|
-
import { expect } from '@storybook/jest';
|
|
2
|
-
import { StoryFn, StoryObj } from '@storybook/react';
|
|
3
|
-
import { fireEvent } from '@storybook/testing-library';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
import { IReqoreTextareaProps } from '../../components/Textarea';
|
|
6
|
-
import { sleep } from '../../helpers/utils';
|
|
7
|
-
import { ReqoreControlGroup, ReqoreTextarea } from '../../index';
|
|
8
|
-
import { StoryMeta } from '../utils';
|
|
9
|
-
import { DisabledArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
10
|
-
|
|
11
|
-
const { createArg } = argManager<IReqoreTextareaProps>();
|
|
12
|
-
|
|
13
|
-
const meta = {
|
|
14
|
-
title: 'Form/TextArea/Stories',
|
|
15
|
-
component: ReqoreTextarea,
|
|
16
|
-
args: {
|
|
17
|
-
scaleWithContent: true,
|
|
18
|
-
fluid: undefined,
|
|
19
|
-
placeholder: 'Placeholder',
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
...MinimalArg(),
|
|
23
|
-
...DisabledArg,
|
|
24
|
-
...SizeArg,
|
|
25
|
-
...createArg('scaleWithContent', {
|
|
26
|
-
name: 'Scale with content',
|
|
27
|
-
description: 'Scale with content',
|
|
28
|
-
control: 'boolean',
|
|
29
|
-
defaultValue: true,
|
|
30
|
-
}),
|
|
31
|
-
...createArg('fluid', {
|
|
32
|
-
name: 'Fluid',
|
|
33
|
-
description: 'Fluid',
|
|
34
|
-
control: 'boolean',
|
|
35
|
-
defaultValue: undefined,
|
|
36
|
-
}),
|
|
37
|
-
...createArg('placeholder', {
|
|
38
|
-
name: 'Placeholder',
|
|
39
|
-
description: 'Placeholder',
|
|
40
|
-
control: 'text',
|
|
41
|
-
defaultValue: 'Placeholder',
|
|
42
|
-
}),
|
|
43
|
-
},
|
|
44
|
-
} as StoryMeta<typeof ReqoreTextarea>;
|
|
45
|
-
|
|
46
|
-
export default meta;
|
|
47
|
-
type Story = StoryObj<typeof meta>;
|
|
48
|
-
|
|
49
|
-
const str =
|
|
50
|
-
'✔ Checking your system\n' +
|
|
51
|
-
'✔ Locating Application\n' +
|
|
52
|
-
'✔ Preparing native dependencies\n' +
|
|
53
|
-
'✔ Compiling Main Process Code\n' +
|
|
54
|
-
'✔ Launch Dev Servers\n' +
|
|
55
|
-
'✔ Compiling Preload Scripts\n' +
|
|
56
|
-
'✔ Launching Application\n';
|
|
57
|
-
|
|
58
|
-
const Template: StoryFn<IReqoreTextareaProps> = (args) => {
|
|
59
|
-
const [value, setValue] = useState(str);
|
|
60
|
-
|
|
61
|
-
const handleValueChange = (e) => {
|
|
62
|
-
setValue(e.target.value);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const handleValueClear = () => {
|
|
66
|
-
setValue('');
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<>
|
|
71
|
-
<ReqoreControlGroup wrap>
|
|
72
|
-
<ReqoreTextarea {...args} onChange={handleValueChange} onClearClick={handleValueClear} />
|
|
73
|
-
<ReqoreTextarea
|
|
74
|
-
{...args}
|
|
75
|
-
onChange={handleValueChange}
|
|
76
|
-
onClearClick={handleValueClear}
|
|
77
|
-
tooltip={{
|
|
78
|
-
placement: 'right-start',
|
|
79
|
-
content: 'I am a tooltip',
|
|
80
|
-
}}
|
|
81
|
-
minimal
|
|
82
|
-
/>
|
|
83
|
-
<ReqoreTextarea
|
|
84
|
-
{...args}
|
|
85
|
-
onChange={handleValueChange}
|
|
86
|
-
onClearClick={handleValueClear}
|
|
87
|
-
tooltip="I'm a tooltip"
|
|
88
|
-
flat
|
|
89
|
-
/>
|
|
90
|
-
<ReqoreTextarea
|
|
91
|
-
{...args}
|
|
92
|
-
onChange={handleValueChange}
|
|
93
|
-
onClearClick={handleValueClear}
|
|
94
|
-
disabled
|
|
95
|
-
/>
|
|
96
|
-
<ReqoreTextarea
|
|
97
|
-
{...args}
|
|
98
|
-
onChange={handleValueChange}
|
|
99
|
-
onClearClick={handleValueClear}
|
|
100
|
-
readOnly
|
|
101
|
-
/>
|
|
102
|
-
</ReqoreControlGroup>
|
|
103
|
-
<br />
|
|
104
|
-
<ReqoreControlGroup wrap>
|
|
105
|
-
<ReqoreTextarea
|
|
106
|
-
{...args}
|
|
107
|
-
onChange={handleValueChange}
|
|
108
|
-
onClearClick={handleValueClear}
|
|
109
|
-
value={value}
|
|
110
|
-
/>
|
|
111
|
-
<ReqoreTextarea
|
|
112
|
-
{...args}
|
|
113
|
-
onChange={handleValueChange}
|
|
114
|
-
onClearClick={handleValueClear}
|
|
115
|
-
value={value}
|
|
116
|
-
tooltip={{
|
|
117
|
-
placement: 'right-start',
|
|
118
|
-
content: 'I am a tooltip',
|
|
119
|
-
}}
|
|
120
|
-
minimal
|
|
121
|
-
/>
|
|
122
|
-
<ReqoreTextarea
|
|
123
|
-
{...args}
|
|
124
|
-
onChange={handleValueChange}
|
|
125
|
-
onClearClick={handleValueClear}
|
|
126
|
-
value={value}
|
|
127
|
-
tooltip="I'm a tooltip"
|
|
128
|
-
flat
|
|
129
|
-
/>
|
|
130
|
-
<ReqoreTextarea
|
|
131
|
-
{...args}
|
|
132
|
-
onChange={handleValueChange}
|
|
133
|
-
onClearClick={handleValueClear}
|
|
134
|
-
value={value}
|
|
135
|
-
disabled
|
|
136
|
-
/>
|
|
137
|
-
<ReqoreTextarea
|
|
138
|
-
{...args}
|
|
139
|
-
onChange={handleValueChange}
|
|
140
|
-
onClearClick={handleValueClear}
|
|
141
|
-
value={value}
|
|
142
|
-
readOnly
|
|
143
|
-
/>
|
|
144
|
-
</ReqoreControlGroup>
|
|
145
|
-
<br />
|
|
146
|
-
<ReqoreControlGroup fluid>
|
|
147
|
-
<ReqoreTextarea
|
|
148
|
-
{...args}
|
|
149
|
-
onChange={handleValueChange}
|
|
150
|
-
onClearClick={handleValueClear}
|
|
151
|
-
value={value}
|
|
152
|
-
fluid
|
|
153
|
-
focusRules={{ type: 'auto' }}
|
|
154
|
-
/>
|
|
155
|
-
</ReqoreControlGroup>
|
|
156
|
-
</>
|
|
157
|
-
);
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
export const Basic: Story = {
|
|
161
|
-
render: Template,
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export const Info: Story = {
|
|
165
|
-
render: Template,
|
|
166
|
-
|
|
167
|
-
args: {
|
|
168
|
-
intent: 'info',
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export const Success: Story = {
|
|
173
|
-
render: Template,
|
|
174
|
-
|
|
175
|
-
args: {
|
|
176
|
-
intent: 'success',
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export const Warning: Story = {
|
|
181
|
-
render: Template,
|
|
182
|
-
|
|
183
|
-
args: {
|
|
184
|
-
intent: 'warning',
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
export const Danger: Story = {
|
|
189
|
-
render: Template,
|
|
190
|
-
|
|
191
|
-
args: {
|
|
192
|
-
intent: 'danger',
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
export const Pending: Story = {
|
|
197
|
-
render: Template,
|
|
198
|
-
|
|
199
|
-
args: {
|
|
200
|
-
intent: 'pending',
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
export const Muted: Story = {
|
|
205
|
-
render: Template,
|
|
206
|
-
|
|
207
|
-
args: {
|
|
208
|
-
intent: 'muted',
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
export const Custom: Story = {
|
|
213
|
-
render: Template,
|
|
214
|
-
|
|
215
|
-
args: {
|
|
216
|
-
customTheme: {
|
|
217
|
-
main: '#38fdb2',
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
export const Effect: Story = {
|
|
223
|
-
render: Template,
|
|
224
|
-
|
|
225
|
-
args: {
|
|
226
|
-
effect: {
|
|
227
|
-
gradient: {
|
|
228
|
-
type: 'radial',
|
|
229
|
-
colors: {
|
|
230
|
-
0: '#361554',
|
|
231
|
-
50: '#160013',
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
spaced: 2,
|
|
235
|
-
color: '#ffffff',
|
|
236
|
-
uppercase: true,
|
|
237
|
-
textSize: 'small',
|
|
238
|
-
weight: 'bold',
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export const WithTemplates: Story = {
|
|
244
|
-
render: (args) => <ReqoreTextarea {...args} />,
|
|
245
|
-
|
|
246
|
-
args: {
|
|
247
|
-
templates: {
|
|
248
|
-
handler: 'focus',
|
|
249
|
-
useTargetWidth: true,
|
|
250
|
-
noWrapper: true,
|
|
251
|
-
items: [
|
|
252
|
-
{
|
|
253
|
-
label: 'New message in discord',
|
|
254
|
-
icon: 'DiscordLine',
|
|
255
|
-
description: 'When a new message in discord is received',
|
|
256
|
-
items: [
|
|
257
|
-
{
|
|
258
|
-
divider: true,
|
|
259
|
-
label: 'Discord',
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
label: 'Author',
|
|
263
|
-
description: 'Author of the message',
|
|
264
|
-
value: '$state:{1.field.author}',
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
label: 'Content',
|
|
268
|
-
description: 'Content of the message',
|
|
269
|
-
value: '$state:{1.field.content}',
|
|
270
|
-
},
|
|
271
|
-
],
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
label: 'New event in Google Calendar',
|
|
275
|
-
icon: 'Calendar2Fill',
|
|
276
|
-
description: 'When a new event is created in Google Calendar',
|
|
277
|
-
},
|
|
278
|
-
],
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
play: async () => {
|
|
283
|
-
await sleep(200);
|
|
284
|
-
await fireEvent.focusIn(document.querySelector('textarea'));
|
|
285
|
-
await expect(document.querySelector('.reqore-popover-content')).toBeTruthy();
|
|
286
|
-
},
|
|
287
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { expect, jest } from '@storybook/jest';
|
|
2
|
-
import { StoryObj } from '@storybook/react';
|
|
3
|
-
import { fireEvent, waitFor, within } from '@storybook/testing-library';
|
|
4
|
-
import { IReqoreTextareaProps } from '../../components/Textarea';
|
|
5
|
-
import { sleep } from '../../helpers/utils';
|
|
6
|
-
import { ReqoreTextarea } from '../../index';
|
|
7
|
-
import { StoryMeta } from '../utils';
|
|
8
|
-
import { DisabledArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
9
|
-
|
|
10
|
-
const { createArg } = argManager<IReqoreTextareaProps>();
|
|
11
|
-
|
|
12
|
-
const meta = {
|
|
13
|
-
title: 'Form/TextArea/Tests',
|
|
14
|
-
component: ReqoreTextarea,
|
|
15
|
-
args: {
|
|
16
|
-
scaleWithContent: true,
|
|
17
|
-
fluid: undefined,
|
|
18
|
-
placeholder: 'Placeholder',
|
|
19
|
-
onChange: jest.fn(),
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
...MinimalArg(),
|
|
23
|
-
...DisabledArg,
|
|
24
|
-
...SizeArg,
|
|
25
|
-
...createArg('scaleWithContent', {
|
|
26
|
-
name: 'Scale with content',
|
|
27
|
-
description: 'Scale with content',
|
|
28
|
-
control: 'boolean',
|
|
29
|
-
defaultValue: true,
|
|
30
|
-
}),
|
|
31
|
-
...createArg('fluid', {
|
|
32
|
-
name: 'Fluid',
|
|
33
|
-
description: 'Fluid',
|
|
34
|
-
control: 'boolean',
|
|
35
|
-
defaultValue: undefined,
|
|
36
|
-
}),
|
|
37
|
-
...createArg('placeholder', {
|
|
38
|
-
name: 'Placeholder',
|
|
39
|
-
description: 'Placeholder',
|
|
40
|
-
control: 'text',
|
|
41
|
-
defaultValue: 'Placeholder',
|
|
42
|
-
}),
|
|
43
|
-
},
|
|
44
|
-
} as StoryMeta<typeof ReqoreTextarea>;
|
|
45
|
-
|
|
46
|
-
export default meta;
|
|
47
|
-
type Story = StoryObj<typeof meta>;
|
|
48
|
-
|
|
49
|
-
export const ItemCanBeSelected: Story = {
|
|
50
|
-
args: {
|
|
51
|
-
templates: {
|
|
52
|
-
handler: 'focus',
|
|
53
|
-
useTargetWidth: true,
|
|
54
|
-
noWrapper: true,
|
|
55
|
-
items: [
|
|
56
|
-
{
|
|
57
|
-
label: 'New message in discord',
|
|
58
|
-
icon: 'DiscordLine',
|
|
59
|
-
description: 'When a new message in discord is received',
|
|
60
|
-
items: [
|
|
61
|
-
{
|
|
62
|
-
divider: true,
|
|
63
|
-
label: 'Discord',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: 'Author',
|
|
67
|
-
description: 'Author of the message',
|
|
68
|
-
value: '$state:{1.field.author}',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
label: 'Content',
|
|
72
|
-
description: 'Content of the message',
|
|
73
|
-
value: '$state:{1.field.content}',
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
label: 'New event in Google Calendar',
|
|
79
|
-
icon: 'Calendar2Fill',
|
|
80
|
-
description: 'When a new event is created in Google Calendar',
|
|
81
|
-
items: [],
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
play: async ({ canvasElement, args }) => {
|
|
88
|
-
const canvas = within(canvasElement);
|
|
89
|
-
|
|
90
|
-
await sleep(200);
|
|
91
|
-
await fireEvent.focusIn(document.querySelector('textarea'));
|
|
92
|
-
await sleep(200);
|
|
93
|
-
await expect(document.querySelector('.reqore-popover-content')).toBeTruthy();
|
|
94
|
-
await sleep(200);
|
|
95
|
-
await fireEvent.click(canvas.getAllByText('New message in discord')[0]);
|
|
96
|
-
|
|
97
|
-
await waitFor(() => expect(canvas.getAllByText('Author')[0]).toBeTruthy(), {
|
|
98
|
-
timeout: 5000,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
await fireEvent.click(canvas.getAllByText('Author')[0]);
|
|
102
|
-
|
|
103
|
-
await expect(canvas.getAllByText('$state:{1.field.author}')[0]).toBeTruthy();
|
|
104
|
-
await expect(args.onChange).toHaveBeenCalledWith({
|
|
105
|
-
target: { value: '$state:{1.field.author}' },
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
2
|
-
import { noop } from 'lodash';
|
|
3
|
-
import { IReqoreTreeProps, ReqoreTree } from '../../components/Tree';
|
|
4
|
-
import MockObject from '../../mock/object.json';
|
|
5
|
-
import { StoryMeta } from '../utils';
|
|
6
|
-
import { SizeArg, argManager } from '../utils/args';
|
|
7
|
-
|
|
8
|
-
const { createArg } = argManager<IReqoreTreeProps>();
|
|
9
|
-
|
|
10
|
-
const meta: StoryMeta<typeof ReqoreTree> = {
|
|
11
|
-
title: 'Collections/Tree/Stories',
|
|
12
|
-
component: ReqoreTree,
|
|
13
|
-
args: {
|
|
14
|
-
withLabelCopy: true,
|
|
15
|
-
showTypes: true,
|
|
16
|
-
expanded: false,
|
|
17
|
-
onItemClick: noop,
|
|
18
|
-
data: MockObject,
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
...createArg('withLabelCopy', {
|
|
22
|
-
name: 'With label copy',
|
|
23
|
-
description: 'With label copy',
|
|
24
|
-
control: 'boolean',
|
|
25
|
-
defaultValue: true,
|
|
26
|
-
}),
|
|
27
|
-
...createArg('showTypes', {
|
|
28
|
-
name: 'Show types',
|
|
29
|
-
description: 'Show types',
|
|
30
|
-
control: 'boolean',
|
|
31
|
-
defaultValue: true,
|
|
32
|
-
}),
|
|
33
|
-
...createArg('expanded', {
|
|
34
|
-
name: 'Expanded',
|
|
35
|
-
description: 'Expanded',
|
|
36
|
-
control: 'boolean',
|
|
37
|
-
defaultValue: false,
|
|
38
|
-
}),
|
|
39
|
-
...SizeArg,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default meta;
|
|
44
|
-
type Story = StoryObj<typeof meta>;
|
|
45
|
-
|
|
46
|
-
export const Basic: Story = {};
|
|
47
|
-
|
|
48
|
-
export const TextView: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
mode: 'copy',
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const NoControls: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
showControls: false,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const Zoomable: Story = {
|
|
61
|
-
args: {
|
|
62
|
-
zoomable: true,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const Exportable: Story = {
|
|
67
|
-
args: {
|
|
68
|
-
zoomable: true,
|
|
69
|
-
exportable: true,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Object: Story = {
|
|
74
|
-
args: {
|
|
75
|
-
exportable: true,
|
|
76
|
-
data: {
|
|
77
|
-
_id: '606d4c955f96372fd1b8bcd1',
|
|
78
|
-
index: 0,
|
|
79
|
-
guid: 'd08cde5f-e18e-4d7f-80a9-6541848ab830',
|
|
80
|
-
isActive: false,
|
|
81
|
-
balance: '$3,219.32',
|
|
82
|
-
picture: 'http://placehold.it/32x32',
|
|
83
|
-
age: 25,
|
|
84
|
-
eyeColor: 'brown',
|
|
85
|
-
name: 'Zelma Short',
|
|
86
|
-
gender: 'female',
|
|
87
|
-
company: 'LINGOAGE',
|
|
88
|
-
email: 'zelmashort@lingoage.com',
|
|
89
|
-
phone: '+1 (840) 429-2274',
|
|
90
|
-
address: '757 Woodside Avenue, Winchester, Marshall Islands, 2032',
|
|
91
|
-
about:
|
|
92
|
-
'Ipsum est ex nisi veniam proident adipisicing. Occaecat Lorem minim amet aliqua laboris excepteur sint eu mollit laborum sunt. Duis aliquip nulla cillum labore culpa ullamco labore non in nostrud. Cupidatat nisi enim ullamco quis voluptate Lorem voluptate minim dolore esse irure eiusmod aliquip amet. Dolore laboris Lorem laboris irure magna sint dolor. In irure adipisicing minim ullamco commodo ad dolore elit occaecat dolor. Cillum commodo est commodo dolor enim velit.\r\n',
|
|
93
|
-
registered: '2015-03-19T05:00:22 -01:00',
|
|
94
|
-
latitude: -8.97737,
|
|
95
|
-
longitude: 110.576471,
|
|
96
|
-
tags: ['aute', 'qui', 'ut', 'mollit', 'culpa', 'qui', 'irure'],
|
|
97
|
-
friends: [
|
|
98
|
-
{
|
|
99
|
-
id: 0,
|
|
100
|
-
name: 'Angel Gallagher',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
id: 1,
|
|
104
|
-
name: 'Rose Farmer',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
id: 2,
|
|
108
|
-
name: 'Jaclyn Keith',
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
|
-
greeting: 'Hello, Zelma Short! You have 5 unread messages.',
|
|
112
|
-
favoriteFruit: 'banana',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const WithDefaultZoom: Story = {
|
|
118
|
-
args: {
|
|
119
|
-
label: 'Collection of items',
|
|
120
|
-
zoomable: true,
|
|
121
|
-
size: 'tiny',
|
|
122
|
-
defaultZoom: 2,
|
|
123
|
-
},
|
|
124
|
-
};
|
package/src/stories/Wrapper.tsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReqoreLayoutContent } from '..';
|
|
2
|
-
import ReqoreContent from '../components/Content';
|
|
3
|
-
import ReqoreUIProvider, { IReqoreUIProviderProps } from '../containers/UIProvider';
|
|
4
|
-
|
|
5
|
-
export const StoryWrapper = ({ children, ...args }: IReqoreUIProviderProps) => {
|
|
6
|
-
return (
|
|
7
|
-
<ReqoreUIProvider {...args}>
|
|
8
|
-
<ReqoreLayoutContent>
|
|
9
|
-
<ReqoreContent style={{ padding: '20px' }}>{children}</ReqoreContent>
|
|
10
|
-
</ReqoreLayoutContent>
|
|
11
|
-
</ReqoreUIProvider>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { TSizes } from '../../constants/sizes';
|
|
2
|
-
import { DEFAULT_INTENTS } from '../../constants/theme';
|
|
3
|
-
import Icons from '../../icons.json';
|
|
4
|
-
import { IReqoreIconName } from '../../types/icons';
|
|
5
|
-
|
|
6
|
-
export interface IArgData {
|
|
7
|
-
description?: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
control?: any;
|
|
10
|
-
options?: string[];
|
|
11
|
-
type?: string;
|
|
12
|
-
table?: any;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type TArg<T> = { [key: string]: (IArgData & { defaultValue?: T }) | undefined };
|
|
16
|
-
export type TDisabledArg = { [key: string]: { table: { disable: boolean } } };
|
|
17
|
-
|
|
18
|
-
export const argManager = <Target>() => {
|
|
19
|
-
return {
|
|
20
|
-
createArg<K extends keyof Target>(
|
|
21
|
-
name: K,
|
|
22
|
-
data: IArgData & { defaultValue?: Target[K] }
|
|
23
|
-
): TArg<Target[K]> {
|
|
24
|
-
return {
|
|
25
|
-
[name as string]: data,
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
disableArg<K extends keyof Target>(name: K): TDisabledArg {
|
|
29
|
-
return {
|
|
30
|
-
[name]: {
|
|
31
|
-
table: {
|
|
32
|
-
disable: true,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
disableArgs<K extends keyof Target>(names: K[]): TDisabledArg {
|
|
38
|
-
return names.reduce((newArgs: TDisabledArg, name) => {
|
|
39
|
-
return {
|
|
40
|
-
...newArgs,
|
|
41
|
-
...{
|
|
42
|
-
[name]: {
|
|
43
|
-
table: {
|
|
44
|
-
disable: true,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
}, {});
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const IconArg = (
|
|
55
|
-
iconKeyName: string = 'icon',
|
|
56
|
-
name?: string,
|
|
57
|
-
defaultValue?: IReqoreIconName
|
|
58
|
-
) =>
|
|
59
|
-
argManager<any>().createArg(iconKeyName, {
|
|
60
|
-
defaultValue: defaultValue || (defaultValue === null ? null : '24HoursFill'),
|
|
61
|
-
name: name || 'Icon',
|
|
62
|
-
description: 'The icon name used',
|
|
63
|
-
control: {
|
|
64
|
-
type: 'select',
|
|
65
|
-
},
|
|
66
|
-
options: Icons,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
export const MinimalArg = (): TArg<any> => {
|
|
70
|
-
return argManager<any>().createArg('minimal', {
|
|
71
|
-
description: 'Whether the component should be minimal',
|
|
72
|
-
name: 'Minimal',
|
|
73
|
-
defaultValue: false,
|
|
74
|
-
control: {
|
|
75
|
-
type: 'boolean',
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const FlatArg = {
|
|
81
|
-
...argManager<any>().createArg('flat', {
|
|
82
|
-
description: 'Whether the component should be flat',
|
|
83
|
-
name: 'Flat',
|
|
84
|
-
defaultValue: undefined,
|
|
85
|
-
control: {
|
|
86
|
-
type: 'boolean',
|
|
87
|
-
},
|
|
88
|
-
}),
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const NoContentArg = {
|
|
92
|
-
...argManager<any>().createArg('withoutContent', {
|
|
93
|
-
defaultValue: true,
|
|
94
|
-
table: {
|
|
95
|
-
disable: true,
|
|
96
|
-
},
|
|
97
|
-
}),
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const SizeArg = {
|
|
101
|
-
...argManager<any>().createArg('size', {
|
|
102
|
-
control: 'select',
|
|
103
|
-
description: 'The size of the element',
|
|
104
|
-
options: ['tiny', 'small', 'normal', 'big', 'huge'] as TSizes[],
|
|
105
|
-
name: 'Size',
|
|
106
|
-
defaultValue: 'normal' as TSizes,
|
|
107
|
-
table: {
|
|
108
|
-
defaultValue: { summary: 'normal' },
|
|
109
|
-
},
|
|
110
|
-
}),
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export const GapSizeArg = {
|
|
114
|
-
...argManager<any>().createArg('gapSize', {
|
|
115
|
-
control: 'select',
|
|
116
|
-
description: 'The gap size of the elements',
|
|
117
|
-
options: ['tiny', 'small', 'normal', 'big', 'huge'] as TSizes[],
|
|
118
|
-
name: 'Gap Size',
|
|
119
|
-
defaultValue: 'normal' as TSizes,
|
|
120
|
-
table: {
|
|
121
|
-
defaultValue: { summary: 'normal' },
|
|
122
|
-
},
|
|
123
|
-
}),
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const IntentArg = {
|
|
127
|
-
...argManager<any>().createArg('intent', {
|
|
128
|
-
control: 'select',
|
|
129
|
-
description: 'The intent of the element',
|
|
130
|
-
options: Object.keys(DEFAULT_INTENTS),
|
|
131
|
-
name: 'Intent',
|
|
132
|
-
}),
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export const CustomIntentArg = (key: string) => ({
|
|
136
|
-
...argManager<any>().createArg(key, {
|
|
137
|
-
control: 'select',
|
|
138
|
-
description: 'The custom intent',
|
|
139
|
-
options: Object.keys(DEFAULT_INTENTS),
|
|
140
|
-
name: 'Custom Intent',
|
|
141
|
-
}),
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
export const DisabledArg = {
|
|
145
|
-
...argManager<any>().createArg('disabled', {
|
|
146
|
-
control: 'boolean',
|
|
147
|
-
description: 'Whether the element should be disabled',
|
|
148
|
-
name: 'Disabled',
|
|
149
|
-
defaultValue: false,
|
|
150
|
-
}),
|
|
151
|
-
};
|