@qoretechnologies/reqore 0.38.0 → 0.38.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__/dropdown.test.tsx +10 -8
- package/__tests__/table.test.tsx +0 -1
- package/build-storybook.log +144 -141
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +4 -4
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts +2 -2
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +5 -5
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/item.d.ts +6 -5
- package/dist/components/Dropdown/item.d.ts.map +1 -1
- package/dist/components/Dropdown/item.js +14 -6
- package/dist/components/Dropdown/item.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts +4 -2
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +33 -7
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +1 -1
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/Menu/index.js +4 -4
- package/dist/components/Menu/index.js.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 +6 -6
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +3 -4
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/MultiSelect/index.js +2 -2
- package/dist/components/MultiSelect/index.js.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 +10 -21
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Panel/LabelEditor.d.ts.map +1 -1
- package/dist/components/Panel/LabelEditor.js +1 -1
- package/dist/components/Panel/LabelEditor.js.map +1 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +26 -16
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +3 -4
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/index.js +2 -2
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +4 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +29 -8
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/constants/sizes.d.ts +7 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +8 -1
- package/dist/constants/sizes.js.map +1 -1
- package/migration-storybook.log +49 -81
- package/package.json +15 -15
- package/src/components/Button/index.tsx +5 -3
- package/src/components/Checkbox/index.tsx +7 -2
- package/src/components/Dropdown/index.tsx +16 -14
- package/src/components/Dropdown/item.tsx +26 -10
- package/src/components/Dropdown/list.tsx +80 -30
- package/src/components/Input/index.tsx +9 -3
- package/src/components/InputClearButton/index.tsx +1 -0
- package/src/components/Menu/index.tsx +2 -2
- package/src/components/Menu/item.tsx +93 -85
- package/src/components/Message/index.tsx +39 -35
- package/src/components/MultiSelect/index.tsx +2 -2
- package/src/components/Notifications/notification.tsx +34 -30
- package/src/components/Panel/LabelEditor.tsx +1 -0
- package/src/components/Panel/index.tsx +28 -17
- package/src/components/Tabs/list.tsx +7 -5
- package/src/components/Tag/index.tsx +3 -3
- package/src/components/Textarea/index.tsx +94 -30
- package/src/constants/sizes.ts +8 -0
- package/src/stories/Button/Button.stories.tsx +5 -0
- package/src/stories/Dropdown/Dropdown.stories.tsx +58 -0
- package/src/stories/Dropdown/DropdownTests.stories.tsx +111 -0
- package/src/stories/Input/Input.stories.tsx +1 -0
- package/src/stories/Message/Message.stories.tsx +13 -5
- package/src/stories/MultiSelect/MultiSelect.stories.tsx +2 -2
- package/src/stories/Panel/Panel.stories.tsx +96 -0
- package/src/stories/TextArea/TextArea.stories.tsx +50 -1
- package/src/stories/TextArea/TextAreaTests.stories.tsx +103 -0
- package/tests.json +1 -1
|
@@ -39,11 +39,8 @@ const Template: StoryFn<IReqoreMessageProps> = (args: IReqoreMessageProps) => {
|
|
|
39
39
|
return (
|
|
40
40
|
<>
|
|
41
41
|
<ReqoreMessage {...args} onClick={noop}>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
happiness commanded daughters as. Is handsome an declared at received in extended vicinity
|
|
45
|
-
subjects. Into miss on he over been late pain an. Only week bore boy what fat case left use.
|
|
46
|
-
Match round scale now sex style far times. Your me past an much.
|
|
42
|
+
{args.children ||
|
|
43
|
+
'In to am attended desirous raptures declared diverted confined at. Collected instantly remaining up certainly to necessary as. Over walk dull into son boy door went new. At or happiness commanded daughters as. Is handsome an declared at received in extended vicinity subjects. Into miss on he over been late pain an. Only week bore boy what fat case left use. Match round scale now sex style far times. Your me past an much.'}
|
|
47
44
|
</ReqoreMessage>
|
|
48
45
|
</>
|
|
49
46
|
);
|
|
@@ -53,6 +50,16 @@ export const Basic: Story = {
|
|
|
53
50
|
render: Template,
|
|
54
51
|
};
|
|
55
52
|
|
|
53
|
+
export const NoTitle: Story = {
|
|
54
|
+
render: Template,
|
|
55
|
+
args: {
|
|
56
|
+
icon: 'InformationFill',
|
|
57
|
+
flat: true,
|
|
58
|
+
title: undefined,
|
|
59
|
+
children: 'This is a test',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
56
63
|
export const Flat: Story = {
|
|
57
64
|
render: Template,
|
|
58
65
|
|
|
@@ -68,6 +75,7 @@ export const Minimal: Story = {
|
|
|
68
75
|
args: {
|
|
69
76
|
minimal: true,
|
|
70
77
|
intent: 'danger',
|
|
78
|
+
size: 'small',
|
|
71
79
|
},
|
|
72
80
|
};
|
|
73
81
|
|
|
@@ -43,13 +43,13 @@ type Story = StoryObj<typeof meta>;
|
|
|
43
43
|
|
|
44
44
|
const Template: StoryFn<IReqoreMultiSelectProps> = (args: IReqoreMultiSelectProps) => {
|
|
45
45
|
const [selected, setSelected] = useState<string[]>([
|
|
46
|
-
'Existing item 1',
|
|
47
46
|
'Existing item 3',
|
|
48
47
|
'Disabled item',
|
|
49
|
-
'Minimal item with border',
|
|
50
48
|
'itemWithNoLabel',
|
|
51
49
|
]);
|
|
52
50
|
|
|
51
|
+
console.log({ selected });
|
|
52
|
+
|
|
53
53
|
return (
|
|
54
54
|
<ReqoreMultiSelect
|
|
55
55
|
value={selected}
|
|
@@ -359,6 +359,94 @@ export const Minimal: Story = {
|
|
|
359
359
|
},
|
|
360
360
|
};
|
|
361
361
|
|
|
362
|
+
export const MinimalCollapsed: Story = {
|
|
363
|
+
render: Template,
|
|
364
|
+
|
|
365
|
+
args: {
|
|
366
|
+
minimal: true,
|
|
367
|
+
flat: true,
|
|
368
|
+
isCollapsed: true,
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
export const MinimalOnlyContent: Story = {
|
|
373
|
+
render: Template,
|
|
374
|
+
|
|
375
|
+
args: {
|
|
376
|
+
label: undefined,
|
|
377
|
+
badge: undefined,
|
|
378
|
+
icon: undefined,
|
|
379
|
+
minimal: true,
|
|
380
|
+
actions: [
|
|
381
|
+
{ label: 'test', show: false },
|
|
382
|
+
{
|
|
383
|
+
show: false,
|
|
384
|
+
group: [
|
|
385
|
+
{ label: 'test 2', show: true },
|
|
386
|
+
{ label: 'test 3', show: true },
|
|
387
|
+
],
|
|
388
|
+
},
|
|
389
|
+
],
|
|
390
|
+
bottomActions: [
|
|
391
|
+
{ label: 'test', show: false, position: 'left' },
|
|
392
|
+
{
|
|
393
|
+
position: 'right',
|
|
394
|
+
show: false,
|
|
395
|
+
group: [
|
|
396
|
+
{ label: 'test 2', show: true },
|
|
397
|
+
{ label: 'test 3', show: true },
|
|
398
|
+
],
|
|
399
|
+
},
|
|
400
|
+
],
|
|
401
|
+
collapsible: false,
|
|
402
|
+
},
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
export const MinimalOnlyTopBar: Story = {
|
|
406
|
+
render: Template,
|
|
407
|
+
|
|
408
|
+
args: {
|
|
409
|
+
label: undefined,
|
|
410
|
+
badge: undefined,
|
|
411
|
+
icon: undefined,
|
|
412
|
+
minimal: true,
|
|
413
|
+
bottomActions: [
|
|
414
|
+
{ label: 'test', show: false, position: 'left' },
|
|
415
|
+
{
|
|
416
|
+
position: 'right',
|
|
417
|
+
show: false,
|
|
418
|
+
group: [
|
|
419
|
+
{ label: 'test 2', show: true },
|
|
420
|
+
{ label: 'test 3', show: true },
|
|
421
|
+
],
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
collapsible: false,
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
export const MinimalOnlyBottomBar: Story = {
|
|
429
|
+
render: Template,
|
|
430
|
+
|
|
431
|
+
args: {
|
|
432
|
+
label: undefined,
|
|
433
|
+
badge: undefined,
|
|
434
|
+
icon: undefined,
|
|
435
|
+
minimal: true,
|
|
436
|
+
actions: [
|
|
437
|
+
{ label: 'test', show: false },
|
|
438
|
+
{
|
|
439
|
+
show: false,
|
|
440
|
+
group: [
|
|
441
|
+
{ label: 'test 2', show: true },
|
|
442
|
+
{ label: 'test 3', show: true },
|
|
443
|
+
],
|
|
444
|
+
},
|
|
445
|
+
],
|
|
446
|
+
collapsible: false,
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
|
|
362
450
|
export const MinimalWithIntent: Story = {
|
|
363
451
|
render: Template,
|
|
364
452
|
|
|
@@ -370,6 +458,14 @@ export const MinimalWithIntent: Story = {
|
|
|
370
458
|
},
|
|
371
459
|
};
|
|
372
460
|
|
|
461
|
+
export const WithOpacity: Story = {
|
|
462
|
+
render: Template,
|
|
463
|
+
|
|
464
|
+
args: {
|
|
465
|
+
opacity: 0.5,
|
|
466
|
+
},
|
|
467
|
+
};
|
|
468
|
+
|
|
373
469
|
export const Disabled: Story = {
|
|
374
470
|
render: Template,
|
|
375
471
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { expect } from '@storybook/jest';
|
|
1
2
|
import { StoryFn, StoryObj } from '@storybook/react';
|
|
3
|
+
import { fireEvent } from '@storybook/testing-library';
|
|
2
4
|
import { useState } from 'react';
|
|
3
5
|
import { IReqoreTextareaProps } from '../../components/Textarea';
|
|
6
|
+
import { sleep } from '../../helpers/utils';
|
|
4
7
|
import { ReqoreControlGroup, ReqoreTextarea } from '../../index';
|
|
5
8
|
import { StoryMeta } from '../utils';
|
|
6
9
|
import { DisabledArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
@@ -147,7 +150,7 @@ const Template: StoryFn<IReqoreTextareaProps> = (args) => {
|
|
|
147
150
|
onClearClick={handleValueClear}
|
|
148
151
|
value={value}
|
|
149
152
|
fluid
|
|
150
|
-
focusRules={{ type: '
|
|
153
|
+
focusRules={{ type: 'auto' }}
|
|
151
154
|
/>
|
|
152
155
|
</ReqoreControlGroup>
|
|
153
156
|
</>
|
|
@@ -236,3 +239,49 @@ export const Effect: Story = {
|
|
|
236
239
|
},
|
|
237
240
|
},
|
|
238
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
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { expect } 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
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
...MinimalArg(),
|
|
22
|
+
...DisabledArg,
|
|
23
|
+
...SizeArg,
|
|
24
|
+
...createArg('scaleWithContent', {
|
|
25
|
+
name: 'Scale with content',
|
|
26
|
+
description: 'Scale with content',
|
|
27
|
+
control: 'boolean',
|
|
28
|
+
defaultValue: true,
|
|
29
|
+
}),
|
|
30
|
+
...createArg('fluid', {
|
|
31
|
+
name: 'Fluid',
|
|
32
|
+
description: 'Fluid',
|
|
33
|
+
control: 'boolean',
|
|
34
|
+
defaultValue: undefined,
|
|
35
|
+
}),
|
|
36
|
+
...createArg('placeholder', {
|
|
37
|
+
name: 'Placeholder',
|
|
38
|
+
description: 'Placeholder',
|
|
39
|
+
control: 'text',
|
|
40
|
+
defaultValue: 'Placeholder',
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
} as StoryMeta<typeof ReqoreTextarea>;
|
|
44
|
+
|
|
45
|
+
export default meta;
|
|
46
|
+
type Story = StoryObj<typeof meta>;
|
|
47
|
+
|
|
48
|
+
export const ItemCanBeSelected: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
templates: {
|
|
51
|
+
handler: 'focus',
|
|
52
|
+
useTargetWidth: true,
|
|
53
|
+
noWrapper: true,
|
|
54
|
+
items: [
|
|
55
|
+
{
|
|
56
|
+
label: 'New message in discord',
|
|
57
|
+
icon: 'DiscordLine',
|
|
58
|
+
description: 'When a new message in discord is received',
|
|
59
|
+
items: [
|
|
60
|
+
{
|
|
61
|
+
divider: true,
|
|
62
|
+
label: 'Discord',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'Author',
|
|
66
|
+
description: 'Author of the message',
|
|
67
|
+
value: '$state:{1.field.author}',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: 'Content',
|
|
71
|
+
description: 'Content of the message',
|
|
72
|
+
value: '$state:{1.field.content}',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'New event in Google Calendar',
|
|
78
|
+
icon: 'Calendar2Fill',
|
|
79
|
+
description: 'When a new event is created in Google Calendar',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
play: async ({ canvasElement }) => {
|
|
86
|
+
const canvas = within(canvasElement);
|
|
87
|
+
|
|
88
|
+
await sleep(200);
|
|
89
|
+
await fireEvent.focusIn(document.querySelector('textarea'));
|
|
90
|
+
await sleep(200);
|
|
91
|
+
await expect(document.querySelector('.reqore-popover-content')).toBeTruthy();
|
|
92
|
+
await sleep(200);
|
|
93
|
+
await fireEvent.click(canvas.getAllByText('New message in discord')[0]);
|
|
94
|
+
|
|
95
|
+
await waitFor(() => expect(canvas.getAllByText('Author')[0]).toBeTruthy(), {
|
|
96
|
+
timeout: 5000,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
await fireEvent.click(canvas.getAllByText('Author')[0]);
|
|
100
|
+
|
|
101
|
+
await expect(canvas.getAllByText('$state:{1.field.author}')[0]).toBeTruthy();
|
|
102
|
+
},
|
|
103
|
+
};
|