@qoretechnologies/reqore 0.38.0 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/__tests__/dropdown.test.tsx +10 -8
  2. package/__tests__/table.test.tsx +0 -1
  3. package/dist/components/Dropdown/index.d.ts +2 -2
  4. package/dist/components/Dropdown/index.d.ts.map +1 -1
  5. package/dist/components/Dropdown/index.js +5 -5
  6. package/dist/components/Dropdown/index.js.map +1 -1
  7. package/dist/components/Dropdown/item.d.ts +6 -5
  8. package/dist/components/Dropdown/item.d.ts.map +1 -1
  9. package/dist/components/Dropdown/item.js +14 -6
  10. package/dist/components/Dropdown/item.js.map +1 -1
  11. package/dist/components/Dropdown/list.d.ts +4 -2
  12. package/dist/components/Dropdown/list.d.ts.map +1 -1
  13. package/dist/components/Dropdown/list.js +33 -7
  14. package/dist/components/Dropdown/list.js.map +1 -1
  15. package/dist/components/Menu/index.js +4 -4
  16. package/dist/components/Menu/index.js.map +1 -1
  17. package/dist/components/Menu/item.d.ts +1 -1
  18. package/dist/components/Menu/item.d.ts.map +1 -1
  19. package/dist/components/Menu/item.js +6 -6
  20. package/dist/components/Menu/item.js.map +1 -1
  21. package/dist/components/Message/index.d.ts.map +1 -1
  22. package/dist/components/Message/index.js +3 -4
  23. package/dist/components/Message/index.js.map +1 -1
  24. package/dist/components/MultiSelect/index.js +2 -2
  25. package/dist/components/MultiSelect/index.js.map +1 -1
  26. package/dist/components/Notifications/notification.d.ts +1 -0
  27. package/dist/components/Notifications/notification.d.ts.map +1 -1
  28. package/dist/components/Notifications/notification.js +10 -21
  29. package/dist/components/Notifications/notification.js.map +1 -1
  30. package/dist/components/Panel/LabelEditor.d.ts.map +1 -1
  31. package/dist/components/Panel/LabelEditor.js +1 -1
  32. package/dist/components/Panel/LabelEditor.js.map +1 -1
  33. package/dist/components/Panel/index.d.ts.map +1 -1
  34. package/dist/components/Panel/index.js +22 -16
  35. package/dist/components/Panel/index.js.map +1 -1
  36. package/dist/components/Textarea/index.d.ts +4 -0
  37. package/dist/components/Textarea/index.d.ts.map +1 -1
  38. package/dist/components/Textarea/index.js +20 -5
  39. package/dist/components/Textarea/index.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/Dropdown/index.tsx +16 -14
  42. package/src/components/Dropdown/item.tsx +26 -10
  43. package/src/components/Dropdown/list.tsx +80 -30
  44. package/src/components/Menu/index.tsx +2 -2
  45. package/src/components/Menu/item.tsx +93 -85
  46. package/src/components/Message/index.tsx +39 -35
  47. package/src/components/MultiSelect/index.tsx +2 -2
  48. package/src/components/Notifications/notification.tsx +34 -30
  49. package/src/components/Panel/LabelEditor.tsx +1 -0
  50. package/src/components/Panel/index.tsx +24 -17
  51. package/src/components/Textarea/index.tsx +77 -27
  52. package/src/stories/Dropdown/Dropdown.stories.tsx +58 -0
  53. package/src/stories/Dropdown/DropdownTests.stories.tsx +78 -0
  54. package/src/stories/Message/Message.stories.tsx +13 -5
  55. package/src/stories/MultiSelect/MultiSelect.stories.tsx +2 -2
  56. package/src/stories/Panel/Panel.stories.tsx +86 -0
  57. package/src/stories/TextArea/TextArea.stories.tsx +49 -0
  58. package/src/stories/TextArea/TextAreaTests.stories.tsx +103 -0
  59. package/tests.json +1 -1
@@ -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
+ };