@qoretechnologies/reqore 0.28.5 → 0.29.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.
Files changed (176) hide show
  1. package/.vscode/settings.json +2 -1
  2. package/__tests__/multiselect.test.tsx +361 -0
  3. package/__tests__/popover.test.tsx +35 -8
  4. package/dist/components/Button/index.js +3 -3
  5. package/dist/components/Button/index.js.map +1 -1
  6. package/dist/components/Checkbox/index.d.ts +3 -2
  7. package/dist/components/Checkbox/index.d.ts.map +1 -1
  8. package/dist/components/Checkbox/index.js +28 -24
  9. package/dist/components/Checkbox/index.js.map +1 -1
  10. package/dist/components/Collection/item.js +2 -2
  11. package/dist/components/Collection/item.js.map +1 -1
  12. package/dist/components/ControlGroup/index.d.ts +4 -4
  13. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  14. package/dist/components/ControlGroup/index.js +13 -15
  15. package/dist/components/ControlGroup/index.js.map +1 -1
  16. package/dist/components/Dropdown/index.d.ts +2 -1
  17. package/dist/components/Dropdown/index.d.ts.map +1 -1
  18. package/dist/components/Dropdown/index.js +3 -3
  19. package/dist/components/Dropdown/index.js.map +1 -1
  20. package/dist/components/Dropdown/list.d.ts +6 -3
  21. package/dist/components/Dropdown/list.d.ts.map +1 -1
  22. package/dist/components/Dropdown/list.js +19 -1
  23. package/dist/components/Dropdown/list.js.map +1 -1
  24. package/dist/components/Effect/index.d.ts +3 -1
  25. package/dist/components/Effect/index.d.ts.map +1 -1
  26. package/dist/components/Effect/index.js +24 -19
  27. package/dist/components/Effect/index.js.map +1 -1
  28. package/dist/components/Icon/index.d.ts +12 -2
  29. package/dist/components/Icon/index.d.ts.map +1 -1
  30. package/dist/components/Icon/index.js +35 -4
  31. package/dist/components/Icon/index.js.map +1 -1
  32. package/dist/components/Input/index.js +3 -3
  33. package/dist/components/Input/index.js.map +1 -1
  34. package/dist/components/InputClearButton/index.d.ts.map +1 -1
  35. package/dist/components/InputClearButton/index.js +1 -1
  36. package/dist/components/InputClearButton/index.js.map +1 -1
  37. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  38. package/dist/components/InternalPopover/index.js +31 -37
  39. package/dist/components/InternalPopover/index.js.map +1 -1
  40. package/dist/components/Menu/divider.d.ts +5 -2
  41. package/dist/components/Menu/divider.d.ts.map +1 -1
  42. package/dist/components/Menu/divider.js +41 -8
  43. package/dist/components/Menu/divider.js.map +1 -1
  44. package/dist/components/Menu/index.js +4 -3
  45. package/dist/components/Menu/index.js.map +1 -1
  46. package/dist/components/Message/index.d.ts +3 -2
  47. package/dist/components/Message/index.d.ts.map +1 -1
  48. package/dist/components/Message/index.js.map +1 -1
  49. package/dist/components/MultiSelect/index.d.ts +32 -0
  50. package/dist/components/MultiSelect/index.d.ts.map +1 -0
  51. package/dist/components/MultiSelect/index.js +177 -0
  52. package/dist/components/MultiSelect/index.js.map +1 -0
  53. package/dist/components/Notifications/notification.d.ts +3 -3
  54. package/dist/components/Notifications/notification.d.ts.map +1 -1
  55. package/dist/components/Notifications/notification.js +11 -8
  56. package/dist/components/Notifications/notification.js.map +1 -1
  57. package/dist/components/Panel/index.d.ts +1 -0
  58. package/dist/components/Panel/index.d.ts.map +1 -1
  59. package/dist/components/Panel/index.js +7 -7
  60. package/dist/components/Panel/index.js.map +1 -1
  61. package/dist/components/Popover/index.d.ts +1 -1
  62. package/dist/components/Popover/index.d.ts.map +1 -1
  63. package/dist/components/Popover/index.js +5 -2
  64. package/dist/components/Popover/index.js.map +1 -1
  65. package/dist/components/RadioGroup/index.d.ts +8 -6
  66. package/dist/components/RadioGroup/index.d.ts.map +1 -1
  67. package/dist/components/RadioGroup/index.js +6 -12
  68. package/dist/components/RadioGroup/index.js.map +1 -1
  69. package/dist/components/Table/row.js +2 -2
  70. package/dist/components/Table/row.js.map +1 -1
  71. package/dist/components/Tabs/item.js +1 -1
  72. package/dist/components/Tabs/item.js.map +1 -1
  73. package/dist/components/Tabs/list.d.ts.map +1 -1
  74. package/dist/components/Tabs/list.js +5 -4
  75. package/dist/components/Tabs/list.js.map +1 -1
  76. package/dist/components/Tag/group.d.ts +4 -3
  77. package/dist/components/Tag/group.d.ts.map +1 -1
  78. package/dist/components/Tag/group.js +12 -5
  79. package/dist/components/Tag/group.js.map +1 -1
  80. package/dist/components/Tag/index.js +5 -5
  81. package/dist/components/Tag/index.js.map +1 -1
  82. package/dist/components/Tree/index.js +1 -1
  83. package/dist/components/Tree/index.js.map +1 -1
  84. package/dist/constants/sizes.d.ts +7 -0
  85. package/dist/constants/sizes.d.ts.map +1 -1
  86. package/dist/constants/sizes.js +8 -1
  87. package/dist/constants/sizes.js.map +1 -1
  88. package/dist/containers/PopoverProvider.d.ts.map +1 -1
  89. package/dist/containers/PopoverProvider.js +28 -3
  90. package/dist/containers/PopoverProvider.js.map +1 -1
  91. package/dist/containers/ReqoreProvider.d.ts.map +1 -1
  92. package/dist/containers/ReqoreProvider.js +6 -5
  93. package/dist/containers/ReqoreProvider.js.map +1 -1
  94. package/dist/containers/UIProvider.d.ts +1 -0
  95. package/dist/containers/UIProvider.d.ts.map +1 -1
  96. package/dist/containers/UIProvider.js.map +1 -1
  97. package/dist/context/PopoverContext.d.ts +1 -0
  98. package/dist/context/PopoverContext.d.ts.map +1 -1
  99. package/dist/context/PopoverContext.js.map +1 -1
  100. package/dist/context/ReqoreContext.d.ts +1 -0
  101. package/dist/context/ReqoreContext.d.ts.map +1 -1
  102. package/dist/context/ReqoreContext.js +2 -1
  103. package/dist/context/ReqoreContext.js.map +1 -1
  104. package/dist/helpers/colors.d.ts +3 -0
  105. package/dist/helpers/colors.d.ts.map +1 -1
  106. package/dist/helpers/colors.js +28 -5
  107. package/dist/helpers/colors.js.map +1 -1
  108. package/dist/hooks/usePopover.d.ts +14 -3
  109. package/dist/hooks/usePopover.d.ts.map +1 -1
  110. package/dist/hooks/usePopover.js +12 -7
  111. package/dist/hooks/usePopover.js.map +1 -1
  112. package/dist/hooks/useReqore.d.ts +3 -0
  113. package/dist/hooks/useReqore.d.ts.map +1 -0
  114. package/dist/hooks/useReqore.js +17 -0
  115. package/dist/hooks/useReqore.js.map +1 -0
  116. package/dist/hooks/useTheme.d.ts +1 -1
  117. package/dist/hooks/useTheme.d.ts.map +1 -1
  118. package/dist/hooks/useTheme.js +3 -0
  119. package/dist/hooks/useTheme.js.map +1 -1
  120. package/dist/index.d.ts +3 -0
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.js +8 -2
  123. package/dist/index.js.map +1 -1
  124. package/package.json +1 -1
  125. package/src/components/Button/index.tsx +3 -3
  126. package/src/components/Checkbox/index.tsx +58 -30
  127. package/src/components/Collection/item.tsx +2 -2
  128. package/src/components/ControlGroup/index.tsx +54 -37
  129. package/src/components/Dropdown/index.tsx +7 -2
  130. package/src/components/Dropdown/list.tsx +29 -15
  131. package/src/components/Effect/index.tsx +58 -51
  132. package/src/components/Icon/index.tsx +75 -1
  133. package/src/components/Input/index.tsx +3 -3
  134. package/src/components/InputClearButton/index.tsx +1 -0
  135. package/src/components/InternalPopover/index.tsx +108 -50
  136. package/src/components/Menu/divider.tsx +35 -7
  137. package/src/components/Menu/index.tsx +3 -3
  138. package/src/components/Message/index.tsx +3 -0
  139. package/src/components/MultiSelect/index.tsx +283 -0
  140. package/src/components/Notifications/notification.tsx +23 -13
  141. package/src/components/Panel/index.tsx +14 -8
  142. package/src/components/Popover/index.tsx +8 -3
  143. package/src/components/RadioGroup/index.tsx +36 -27
  144. package/src/components/Table/row.tsx +2 -2
  145. package/src/components/Tabs/item.tsx +1 -1
  146. package/src/components/Tabs/list.tsx +11 -11
  147. package/src/components/Tag/group.tsx +15 -4
  148. package/src/components/Tag/index.tsx +7 -7
  149. package/src/components/Tree/index.tsx +3 -3
  150. package/src/constants/sizes.ts +8 -0
  151. package/src/containers/PopoverProvider.tsx +35 -3
  152. package/src/containers/ReqoreProvider.tsx +6 -4
  153. package/src/containers/UIProvider.tsx +1 -0
  154. package/src/context/PopoverContext.tsx +1 -0
  155. package/src/context/ReqoreContext.tsx +2 -0
  156. package/src/helpers/colors.ts +53 -7
  157. package/src/hooks/usePopover.tsx +39 -12
  158. package/src/hooks/useReqore.ts +12 -0
  159. package/src/hooks/useTheme.ts +6 -1
  160. package/src/index.tsx +3 -0
  161. package/src/mock/multiSelect.ts +61 -0
  162. package/src/stories/Button/Button.stories.tsx +20 -8
  163. package/src/stories/ControlGroup/ControlGroup.stories.tsx +13 -2
  164. package/src/stories/Dropdown/Dropdown.stories.tsx +6 -1
  165. package/src/stories/Icon/Icon.stories.tsx +99 -22
  166. package/src/stories/Input/Input.stories.tsx +25 -0
  167. package/src/stories/Menu/Menu.stories.tsx +3 -2
  168. package/src/stories/Message/Message.stories.tsx +7 -1
  169. package/src/stories/MultiSelect/MultiSelect.stories.tsx +99 -0
  170. package/src/stories/Panel/Panel.stories.tsx +3 -3
  171. package/src/stories/Popover/Popover.stories.tsx +91 -12
  172. package/src/stories/RadioGroup/RadioGroup.stories.tsx +29 -2
  173. package/src/stories/Tabs/Tabs.stories.tsx +23 -3
  174. package/src/stories/Tag/Tag.stories.tsx +12 -3
  175. package/src/stories/utils/args.ts +13 -0
  176. package/tests.json +1 -1
@@ -2,7 +2,7 @@ import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { IReqoreControlGroupProps } from '../../components/ControlGroup';
3
3
  import ReqoreInput from '../../components/Input';
4
4
  import { ReqoreButton, ReqoreControlGroup, ReqoreTag } from '../../index';
5
- import { MinimalArg, SizeArg, argManager } from '../utils/args';
5
+ import { argManager, GapSizeArg, MinimalArg, SizeArg } from '../utils/args';
6
6
 
7
7
  const { createArg } = argManager<IReqoreControlGroupProps>();
8
8
 
@@ -10,6 +10,7 @@ export default {
10
10
  title: 'Components/Control Group',
11
11
  argTypes: {
12
12
  ...SizeArg,
13
+ ...GapSizeArg,
13
14
  ...MinimalArg(),
14
15
  ...createArg('stack', {
15
16
  name: 'Stack',
@@ -38,7 +39,7 @@ const Template: Story<IReqoreControlGroupProps> = (args: IReqoreControlGroupProp
38
39
  <ReqoreButton>Button</ReqoreButton>
39
40
  <ReqoreButton
40
41
  flat={false}
41
- effect={{ gradient: { colors: { 0: 'success', 100: 'success:darken:1' } } }}
42
+ effect={{ gradient: { colors: { 0: 'success', 100: 'info:darken:1' } } }}
42
43
  >
43
44
  Non flat Button
44
45
  </ReqoreButton>
@@ -59,6 +60,11 @@ Minimal.args = {
59
60
  minimal: true,
60
61
  };
61
62
 
63
+ export const NotFlat = Template.bind({});
64
+ NotFlat.args = {
65
+ flat: false,
66
+ };
67
+
62
68
  export const Vertical = Template.bind({});
63
69
  Vertical.args = {
64
70
  vertical: true,
@@ -68,3 +74,8 @@ export const Stacked = Template.bind({});
68
74
  Stacked.args = {
69
75
  stack: true,
70
76
  };
77
+
78
+ export const BigGapSize = Template.bind({});
79
+ BigGapSize.args = {
80
+ gapSize: 'big',
81
+ };
@@ -47,6 +47,11 @@ export default {
47
47
  value: 'i aM diSAblEd',
48
48
  icon: 'StopCircleLine',
49
49
  },
50
+ {
51
+ divider: true,
52
+ label: 'Divider',
53
+ dividerAlign: 'left',
54
+ },
50
55
  {
51
56
  selected: true,
52
57
  value: 'Hello',
@@ -125,7 +130,7 @@ export default {
125
130
  } as Meta<IReqoreDropdownProps>;
126
131
 
127
132
  const Template: Story<IReqoreDropdownProps> = (args: IReqoreDropdownProps) => {
128
- const [selected, setSelected] = useState<string[]>(['Item 3', 'Item 6']);
133
+ const [selected, setSelected] = useState<(string | number)[]>(['Item 3', 'Item 6']);
129
134
 
130
135
  if (args.multiSelect) {
131
136
  return (
@@ -1,6 +1,6 @@
1
1
  import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { IReqoreIconProps } from '../../components/Icon';
3
- import { ReqoreIcon } from '../../index';
3
+ import { ReqoreIcon, ReqorePanel } from '../../index';
4
4
 
5
5
  export default {
6
6
  title: 'Components/Icon',
@@ -9,27 +9,104 @@ export default {
9
9
  export const Icon: Story<IReqoreIconProps> = () => {
10
10
  return (
11
11
  <>
12
- <ReqoreIcon icon='AccountCircleLine' size='12px' />
13
- <ReqoreIcon icon='4KFill' size='14px' />
14
- <ReqoreIcon icon='ArrowLeftCircleFill' intent='success' />
15
- <ReqoreIcon icon='HotelFill' size='18px' />
16
- <ReqoreIcon icon='SignalTowerFill' size='20px' color='#ff0000' />
17
- <h4> Margined </h4>
18
- <ReqoreIcon icon='AccountCircleLine' />
19
- No Margin
20
- <div>
21
- <ReqoreIcon icon='4KFill' margin='right' />
22
- Right Margin
23
- </div>
24
- <div>
25
- Left Margin
26
- <ReqoreIcon icon='ArrowLeftCircleFill' margin='left' />
27
- </div>
28
- <div>
29
- Both
30
- <ReqoreIcon icon='HotelFill' margin='both' />
31
- Sides
32
- </div>
12
+ <ReqorePanel label='Basic' flat minimal>
13
+ <ReqoreIcon icon='AccountCircleLine' size='12px' margin='both' />
14
+ <ReqoreIcon icon='4KFill' size='14px' margin='both' />
15
+ <ReqoreIcon icon='ArrowLeftCircleFill' intent='success' margin='both' />
16
+ <ReqoreIcon icon='HotelFill' size='18px' margin='both' />
17
+ <ReqoreIcon icon='SignalTowerFill' size='20px' color='#ff0000' margin='both' />
18
+ <ReqoreIcon icon='SignalTowerFill' size='20px' color='#291133' sepia margin='both' />
19
+ <ReqoreIcon icon='SignalTowerFill' size='20px' color='#0c7052' blur={1} margin='both' />
20
+ <ReqoreIcon
21
+ icon='SignalTowerFill'
22
+ size='20px'
23
+ color='#700c57'
24
+ contrast={150}
25
+ margin='both'
26
+ />
27
+ <ReqoreIcon icon='SignalTowerFill' size='20px' color='#d5be0f' grayscale margin='both' />
28
+ <ReqoreIcon icon='SignalTowerFill' size='20px' color='#0f5bd5' invert margin='both' />
29
+ <ReqoreIcon
30
+ icon='SignalTowerFill'
31
+ size='20px'
32
+ color='#ffffff'
33
+ opacity={0.5}
34
+ margin='both'
35
+ />
36
+ </ReqorePanel>
37
+ <br />
38
+ <ReqorePanel label='Image' flat minimal>
39
+ <ReqoreIcon
40
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
41
+ size='20px'
42
+ margin='both'
43
+ />
44
+ <ReqoreIcon
45
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
46
+ size='40px'
47
+ rounded
48
+ margin='both'
49
+ />
50
+ <ReqoreIcon
51
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
52
+ size='30px'
53
+ sepia
54
+ margin='both'
55
+ />
56
+ <ReqoreIcon
57
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
58
+ size='40px'
59
+ blur={3}
60
+ margin='both'
61
+ />
62
+ <ReqoreIcon
63
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
64
+ size='70px'
65
+ contrast={150}
66
+ margin='both'
67
+ />
68
+ <ReqoreIcon
69
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
70
+ size='40px'
71
+ brightness={150}
72
+ margin='both'
73
+ />
74
+ <ReqoreIcon
75
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
76
+ size='40px'
77
+ opacity={0.5}
78
+ margin='both'
79
+ />
80
+ <ReqoreIcon
81
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
82
+ size='40px'
83
+ invert
84
+ margin='both'
85
+ />
86
+ </ReqorePanel>
87
+ <br />
88
+ <ReqorePanel label='Margined' flat minimal>
89
+ <ReqoreIcon icon='AccountCircleLine' />
90
+ No Margin
91
+ <div>
92
+ <ReqoreIcon icon='4KFill' margin='right' />
93
+ Right Margin
94
+ </div>
95
+ <div>
96
+ Left Margin
97
+ <ReqoreIcon
98
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
99
+ size='20px'
100
+ rounded
101
+ margin='left'
102
+ />
103
+ </div>
104
+ <div>
105
+ Both
106
+ <ReqoreIcon icon='HotelFill' margin='both' />
107
+ Sides
108
+ </div>
109
+ </ReqorePanel>
33
110
  </>
34
111
  );
35
112
  };
@@ -26,6 +26,31 @@ const Template: Story<IReqoreInputProps> = (args: IReqoreInputProps) => {
26
26
 
27
27
  return (
28
28
  <>
29
+ <ReqoreControlGroup>
30
+ <ReqoreInput {...args} placeholder='Reqore Input' onChange={handleValueChange} />
31
+ <ReqoreInput {...args} placeholder='Minimal Input' minimal onChange={handleValueChange} />
32
+ <ReqoreInput
33
+ {...args}
34
+ placeholder='Flat Input'
35
+ flat
36
+ tooltip="I'm a tooltip"
37
+ onChange={handleValueChange}
38
+ />
39
+ <ReqoreInput
40
+ {...args}
41
+ placeholder='Clearable Input'
42
+ onClearClick={handleValueClear}
43
+ onChange={handleValueChange}
44
+ />
45
+ <ReqoreInput {...args} placeholder='Disabled Input' disabled onChange={handleValueChange} />
46
+ <ReqoreInput
47
+ {...args}
48
+ placeholder='Read Only Input'
49
+ readOnly
50
+ onChange={handleValueChange}
51
+ />
52
+ </ReqoreControlGroup>
53
+ <br />
29
54
  <ReqoreControlGroup>
30
55
  <ReqoreInput
31
56
  {...args}
@@ -8,7 +8,7 @@ import {
8
8
  ReqoreMenuItem,
9
9
  ReqorePopover,
10
10
  } from '../../index';
11
- import { IntentArg, argManager } from '../utils/args';
11
+ import { argManager, IntentArg } from '../utils/args';
12
12
 
13
13
  const { createArg } = argManager<IReqoreMenuProps>();
14
14
 
@@ -154,7 +154,8 @@ const Template: Story<IReqoreMenuProps> = (args) => {
154
154
  </ReqorePopover>
155
155
  <ReqoreMenuDivider
156
156
  label='Fancy divider'
157
- effect={{ textAlign: 'left', gradient: { colors: { 0: '#0d5ba5', 100: '#ff5dfd' } } }}
157
+ effect={{ gradient: { colors: { 0: '#0d5ba5', 100: '#ff5dfd' } } }}
158
+ align='left'
158
159
  />
159
160
  <ReqoreMenuItem icon='DualSim1Line' rightIcon='MoneyEuroBoxLine' selected>
160
161
  I am selected!
@@ -1,7 +1,7 @@
1
1
  import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { noop } from 'lodash';
3
3
  import ReqoreMessage, { IReqoreMessageProps } from '../../components/Message';
4
- import { argManager, FlatArg, IntentArg, SizeArg } from '../utils/args';
4
+ import { FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
5
5
 
6
6
  const { createArg } = argManager<IReqoreMessageProps>();
7
7
 
@@ -52,6 +52,12 @@ Minimal.args = {
52
52
  intent: 'danger',
53
53
  };
54
54
 
55
+ export const Opaque: Story<IReqoreMessageProps> = Template.bind({});
56
+ Opaque.args = {
57
+ opaque: true,
58
+ intent: 'info',
59
+ };
60
+
55
61
  export const CustomTheme: Story<IReqoreMessageProps> = Template.bind({});
56
62
  CustomTheme.args = {
57
63
  customTheme: {
@@ -0,0 +1,99 @@
1
+ import { Meta, Story } from '@storybook/react/types-6-0';
2
+ import { useState } from 'react';
3
+ import { IReqoreMultiSelectProps, ReqoreMultiSelect } from '../../components/MultiSelect';
4
+ import { MultiSelectItems } from '../../mock/multiSelect';
5
+ import { argManager, FlatArg, MinimalArg, SizeArg } from '../utils/args';
6
+
7
+ const { createArg } = argManager<IReqoreMultiSelectProps>();
8
+
9
+ export default {
10
+ title: 'Components/MultiSelect',
11
+ parameters: {
12
+ chromatic: {
13
+ delay: 500,
14
+ },
15
+ },
16
+ argTypes: {
17
+ ...FlatArg,
18
+ ...MinimalArg(),
19
+ ...SizeArg,
20
+ ...createArg('canCreateItems', {
21
+ defaultValue: true,
22
+ name: 'Can create items',
23
+ type: 'boolean',
24
+ }),
25
+ ...createArg('canRemoveItems', {
26
+ defaultValue: true,
27
+ name: 'Can remove items',
28
+ type: 'boolean',
29
+ }),
30
+ },
31
+ } as Meta<IReqoreMultiSelectProps>;
32
+
33
+ const Template: Story<IReqoreMultiSelectProps> = (args: IReqoreMultiSelectProps) => {
34
+ const [selected, setSelected] = useState<string[]>([
35
+ 'Existing item 1',
36
+ 'Existing item 3',
37
+ 'Disabled item',
38
+ 'Minimal item with border',
39
+ 'itemWithNoLabel',
40
+ ]);
41
+
42
+ return (
43
+ <ReqoreMultiSelect
44
+ value={selected}
45
+ {...args}
46
+ onValueChange={setSelected}
47
+ enterKeySelects
48
+ onItemClick={(item) => console.log('onItemClick', item)}
49
+ selectorProps={{
50
+ listHeight: '600px',
51
+ ...args.selectorProps,
52
+ }}
53
+ items={MultiSelectItems}
54
+ />
55
+ );
56
+ };
57
+
58
+ export const Basic = Template.bind({});
59
+ export const Empty = Template.bind({});
60
+ Empty.args = {
61
+ value: [],
62
+ };
63
+
64
+ export const AutoOpen = Template.bind({});
65
+ AutoOpen.args = {
66
+ openOnMount: true,
67
+ };
68
+
69
+ export const Flat = Template.bind({});
70
+ Flat.args = {
71
+ flat: true,
72
+ };
73
+
74
+ export const Minimal = Template.bind({});
75
+ Minimal.args = {
76
+ minimal: true,
77
+ };
78
+
79
+ export const WithEffect = Template.bind({});
80
+ WithEffect.args = {
81
+ selectedItemEffect: {
82
+ gradient: {
83
+ colors: {
84
+ 0: '#7f60ea',
85
+ 100: '#00fd67',
86
+ },
87
+ },
88
+ },
89
+ selectorProps: {
90
+ effect: {
91
+ gradient: {
92
+ colors: {
93
+ 0: '#7f60ea',
94
+ 100: '#00fd67',
95
+ },
96
+ },
97
+ },
98
+ },
99
+ };
@@ -162,9 +162,9 @@ NoLabel.args = {
162
162
  label: undefined,
163
163
  };
164
164
 
165
- export const Opaque: Story<IReqorePanelProps> = Template.bind({});
166
- Opaque.args = {
167
- opacity: 0,
165
+ export const Transparent: Story<IReqorePanelProps> = Template.bind({});
166
+ Transparent.args = {
167
+ transparent: true,
168
168
  };
169
169
 
170
170
  export const Minimal: Story<IReqorePanelProps> = Template.bind({});
@@ -2,18 +2,25 @@ import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { useState } from 'react';
3
3
  import { IReqorePopoverProps } from '../../components/Popover';
4
4
  import usePopover from '../../hooks/usePopover';
5
- import { ReqoreButton, ReqoreMessage, ReqorePanel, ReqorePopover } from '../../index';
6
- import { argManager } from '../utils/args';
5
+ import {
6
+ ReqoreButton,
7
+ ReqoreControlGroup,
8
+ ReqoreMessage,
9
+ ReqorePanel,
10
+ ReqorePopover,
11
+ ReqoreSpacer,
12
+ } from '../../index';
13
+ import { argManager, FlatArg } from '../utils/args';
7
14
 
8
15
  const { createArg } = argManager<IReqorePopoverProps>();
9
16
 
10
17
  export default {
11
18
  title: 'Components/Popover',
12
19
  argTypes: {
13
- ...createArg('opaque', {
20
+ ...createArg('transparent', {
14
21
  defaultValue: false,
15
- name: 'Opaque',
16
- description: 'Makes the popover opaque',
22
+ name: 'Transparent',
23
+ description: 'Makes the popover transparent',
17
24
  type: 'boolean',
18
25
  }),
19
26
  ...createArg('blur', {
@@ -40,6 +47,10 @@ export default {
40
47
  description: 'The content of the popover',
41
48
  type: 'string',
42
49
  }),
50
+ ...FlatArg,
51
+ },
52
+ args: {
53
+ flat: true,
43
54
  },
44
55
  } as Meta<IReqorePopoverProps>;
45
56
 
@@ -95,23 +106,91 @@ const HoverStayButton = (args: any) => {
95
106
 
96
107
  const Template: Story<IReqorePopoverProps> = (args: IReqorePopoverProps) => {
97
108
  return (
98
- <>
109
+ <ReqoreControlGroup vertical gapSize='huge'>
99
110
  <HoverButton {...args} />
100
- <br />
101
111
  <ClickButton {...args} />
102
- <br />
103
112
  <DelayButton {...args} />
104
- <br />
105
113
  <HoverStayButton {...args} />
106
- <br />
107
- <ReqorePopover {...args} component={ReqoreButton} isReqoreComponent openOnMount>
114
+ {typeof args.content === 'string' && (
115
+ <>
116
+ <ReqoreSpacer height={100} />
117
+ <ReqorePopover
118
+ {...args}
119
+ component={ReqoreButton}
120
+ isReqoreComponent
121
+ openOnMount
122
+ title='I opened on my own'
123
+ icon='CactusFill'
124
+ intent='success'
125
+ placement='top'
126
+ >
127
+ Full popover
128
+ </ReqorePopover>
129
+ <ReqoreControlGroup>
130
+ <ReqoreSpacer width={200} />
131
+ <ReqorePopover
132
+ {...args}
133
+ component={ReqoreButton}
134
+ isReqoreComponent
135
+ openOnMount
136
+ intent='info'
137
+ minimal
138
+ placement='left'
139
+ >
140
+ Minimal popover
141
+ </ReqorePopover>
142
+ </ReqoreControlGroup>
143
+ <ReqorePopover
144
+ {...args}
145
+ component={ReqoreButton}
146
+ isReqoreComponent
147
+ openOnMount
148
+ icon='CactusFill'
149
+ effect={{
150
+ gradient: {
151
+ colors: {
152
+ 0: 'warning',
153
+ 100: 'warning:darken:2',
154
+ },
155
+ },
156
+ spaced: 2,
157
+ uppercase: true,
158
+ weight: 'thick',
159
+ }}
160
+ placement='right'
161
+ >
162
+ Effect popover
163
+ </ReqorePopover>
164
+ <ReqorePopover
165
+ {...args}
166
+ component={ReqoreButton}
167
+ isReqoreComponent
168
+ openOnMount
169
+ transparent
170
+ placement='right'
171
+ >
172
+ Transparent popover
173
+ </ReqorePopover>
174
+ </>
175
+ )}
176
+ <ReqorePopover
177
+ {...args}
178
+ component={ReqoreButton}
179
+ isReqoreComponent
180
+ openOnMount
181
+ placement='bottom'
182
+ >
108
183
  Auto open popover
109
184
  </ReqorePopover>
110
- </>
185
+ </ReqoreControlGroup>
111
186
  );
112
187
  };
113
188
 
114
189
  export const Basic = Template.bind({});
190
+ export const NotFlat = Template.bind({});
191
+ NotFlat.args = {
192
+ flat: false,
193
+ };
115
194
  export const CustomContent = Template.bind({});
116
195
  CustomContent.args = {
117
196
  content: (
@@ -1,7 +1,7 @@
1
1
  import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { useState } from 'react';
3
3
  import ReqoreRadioGroup, { IReqoreRadioGroupProps } from '../../components/RadioGroup';
4
- import { argManager, DisabledArg } from '../utils/args';
4
+ import { DisabledArg, SizeArg, argManager } from '../utils/args';
5
5
 
6
6
  const { createArg } = argManager<IReqoreRadioGroupProps>();
7
7
 
@@ -14,6 +14,7 @@ export default {
14
14
  name: 'As Switch',
15
15
  description: 'If the radio group should be rendered as a switch',
16
16
  }),
17
+ ...SizeArg,
17
18
  ...DisabledArg,
18
19
  },
19
20
  } as Meta<IReqoreRadioGroupProps>;
@@ -34,8 +35,30 @@ const Template: Story<IReqoreRadioGroupProps> = (args: IReqoreRadioGroupProps) =
34
35
  value: 'opt2',
35
36
  },
36
37
  {
37
- label: 'Option 3',
38
+ divider: true,
39
+ label: 'Divider',
40
+ },
41
+ {
42
+ label: 'Beautiful option 3 with gradient effect',
38
43
  value: 'opt3',
44
+ effect: {
45
+ gradient: {
46
+ colors: {
47
+ 0: 'info',
48
+ 100: 'info:lighten:3',
49
+ },
50
+ },
51
+ weight: 'thick',
52
+ },
53
+ },
54
+ {
55
+ label: 'Custom Image Option',
56
+ value: 'customOpt',
57
+ image:
58
+ 'https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4',
59
+ },
60
+ {
61
+ divider: true,
39
62
  },
40
63
  {
41
64
  label: 'Read Only Option',
@@ -55,6 +78,10 @@ const Template: Story<IReqoreRadioGroupProps> = (args: IReqoreRadioGroupProps) =
55
78
  };
56
79
 
57
80
  export const Basic = Template.bind({});
81
+ export const Horizontal = Template.bind({});
82
+ Horizontal.args = {
83
+ vertical: false,
84
+ };
58
85
  export const Switch = Template.bind({});
59
86
  Switch.args = {
60
87
  asSwitch: true,
@@ -1,7 +1,7 @@
1
1
  import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { IReqoreTabsProps } from '../../components/Tabs';
3
3
  import { ReqoreTabs, ReqoreTabsContent } from '../../index';
4
- import { IntentArg, SizeArg, argManager } from '../utils/args';
4
+ import { argManager, IntentArg, SizeArg } from '../utils/args';
5
5
 
6
6
  const tabs = [
7
7
  {
@@ -67,14 +67,34 @@ const tabs = [
67
67
  },
68
68
  },
69
69
  {
70
- label: 'Tab 8',
70
+ label: 'With Effect',
71
71
  id: 'tab8',
72
72
  icon: 'MapPin3Line',
73
+ flat: false,
74
+ effect: {
75
+ gradient: {
76
+ colors: {
77
+ 0: 'info',
78
+ 100: 'danger',
79
+ },
80
+ },
81
+ },
73
82
  },
74
83
  {
75
- label: 'Tab 9',
84
+ label: 'With another effect',
76
85
  id: 'tab9',
77
86
  icon: 'EjectLine',
87
+ effect: {
88
+ glow: {
89
+ color: 'warning',
90
+ blur: 16,
91
+ size: -5,
92
+ },
93
+ spaced: 3,
94
+ uppercase: true,
95
+ weight: 'thick',
96
+ textSize: 'small',
97
+ },
78
98
  },
79
99
  ] as IReqoreTabsProps['tabs'];
80
100
 
@@ -3,7 +3,7 @@ import { noop } from 'lodash';
3
3
  import { IReqoreTagProps } from '../../components/Tag';
4
4
  import { IReqoreTagGroup } from '../../components/Tag/group';
5
5
  import { ReqoreTag, ReqoreTagGroup } from '../../index';
6
- import { SizeArg, argManager } from '../utils/args';
6
+ import { argManager, SizeArg } from '../utils/args';
7
7
 
8
8
  const { createArg } = argManager<IReqoreTagGroup & IReqoreTagProps>();
9
9
 
@@ -58,9 +58,16 @@ export default {
58
58
 
59
59
  const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }) => {
60
60
  return (
61
- <ReqoreTagGroup columns={columns} size={args.size}>
61
+ <ReqoreTagGroup columns={columns} size={args.size} gapSize={args.gapSize}>
62
62
  <ReqoreTag {...args} actions={null} onRemoveClick={null} rightIcon={null} label={1} />
63
- <ReqoreTag {...args} actions={null} onRemoveClick={null} rightIcon={null} label='Basic Tag' />
63
+ <ReqoreTag
64
+ {...args}
65
+ actions={null}
66
+ onRemoveClick={null}
67
+ rightIcon={null}
68
+ label='Basic Tag'
69
+ onClick={() => console.log('Tag clicked')}
70
+ />
64
71
  <ReqoreTag
65
72
  {...args}
66
73
  actions={null}
@@ -185,6 +192,8 @@ const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }
185
192
  };
186
193
 
187
194
  export const Basic = Template.bind({});
195
+ export const BigGapSize = Template.bind({});
196
+ BigGapSize.args = { gapSize: 'big' };
188
197
  export const Badge = Template.bind({});
189
198
  Badge.args = { badge: true };
190
199