@qoretechnologies/reqore 0.30.6 → 0.30.8

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 (215) hide show
  1. package/CODE_OF_CONDUCT.md +104 -104
  2. package/CONTRIBUTING.MD +78 -78
  3. package/LICENSE +1 -1
  4. package/README.md +1 -1
  5. package/SECURITY.md +5 -5
  6. package/__tests__/collection.test.tsx +1 -1
  7. package/__tests__/{control_group.text.tsx → control_group.test.tsx} +4 -2
  8. package/__tests__/modal.test.tsx +74 -2
  9. package/__tests__/panel.test.tsx +96 -24
  10. package/__tests__/popover.test.tsx +24 -2
  11. package/__tests__/tabs.test.tsx +75 -0
  12. package/dist/components/Button/index.d.ts +6 -1
  13. package/dist/components/Button/index.d.ts.map +1 -1
  14. package/dist/components/Button/index.js +30 -20
  15. package/dist/components/Button/index.js.map +1 -1
  16. package/dist/components/Checkbox/index.d.ts.map +1 -1
  17. package/dist/components/Checkbox/index.js +6 -3
  18. package/dist/components/Checkbox/index.js.map +1 -1
  19. package/dist/components/Collection/index.d.ts +7 -2
  20. package/dist/components/Collection/index.d.ts.map +1 -1
  21. package/dist/components/Collection/index.js +57 -53
  22. package/dist/components/Collection/index.js.map +1 -1
  23. package/dist/components/Collection/item.d.ts +5 -5
  24. package/dist/components/Collection/item.d.ts.map +1 -1
  25. package/dist/components/Collection/item.js +15 -4
  26. package/dist/components/Collection/item.js.map +1 -1
  27. package/dist/components/Columns/column.d.ts.map +1 -1
  28. package/dist/components/Columns/column.js +1 -1
  29. package/dist/components/Columns/column.js.map +1 -1
  30. package/dist/components/ControlGroup/index.d.ts +21 -4
  31. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  32. package/dist/components/ControlGroup/index.js +250 -55
  33. package/dist/components/ControlGroup/index.js.map +1 -1
  34. package/dist/components/Drawer/index.d.ts +2 -2
  35. package/dist/components/Drawer/index.d.ts.map +1 -1
  36. package/dist/components/Drawer/index.js +27 -16
  37. package/dist/components/Drawer/index.js.map +1 -1
  38. package/dist/components/Dropdown/index.d.ts +1 -0
  39. package/dist/components/Dropdown/index.d.ts.map +1 -1
  40. package/dist/components/Dropdown/index.js +2 -2
  41. package/dist/components/Dropdown/index.js.map +1 -1
  42. package/dist/components/Effect/index.d.ts +1 -1
  43. package/dist/components/Effect/index.d.ts.map +1 -1
  44. package/dist/components/Effect/index.js +7 -6
  45. package/dist/components/Effect/index.js.map +1 -1
  46. package/dist/components/Icon/index.d.ts +5 -6
  47. package/dist/components/Icon/index.d.ts.map +1 -1
  48. package/dist/components/Icon/index.js +14 -7
  49. package/dist/components/Icon/index.js.map +1 -1
  50. package/dist/components/Input/index.d.ts +2 -0
  51. package/dist/components/Input/index.d.ts.map +1 -1
  52. package/dist/components/Input/index.js +10 -4
  53. package/dist/components/Input/index.js.map +1 -1
  54. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  55. package/dist/components/InternalPopover/index.js +12 -10
  56. package/dist/components/InternalPopover/index.js.map +1 -1
  57. package/dist/components/Menu/index.d.ts.map +1 -1
  58. package/dist/components/Menu/index.js +1 -1
  59. package/dist/components/Menu/index.js.map +1 -1
  60. package/dist/components/Message/index.d.ts +2 -0
  61. package/dist/components/Message/index.d.ts.map +1 -1
  62. package/dist/components/Message/index.js +2 -2
  63. package/dist/components/Message/index.js.map +1 -1
  64. package/dist/components/MultiSelect/index.d.ts +1 -1
  65. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  66. package/dist/components/MultiSelect/index.js +10 -10
  67. package/dist/components/MultiSelect/index.js.map +1 -1
  68. package/dist/components/Panel/index.d.ts +13 -6
  69. package/dist/components/Panel/index.d.ts.map +1 -1
  70. package/dist/components/Panel/index.js +78 -44
  71. package/dist/components/Panel/index.js.map +1 -1
  72. package/dist/components/Popover/index.d.ts +1 -2
  73. package/dist/components/Popover/index.d.ts.map +1 -1
  74. package/dist/components/Popover/index.js +2 -2
  75. package/dist/components/Popover/index.js.map +1 -1
  76. package/dist/components/Spacer/index.d.ts +2 -0
  77. package/dist/components/Spacer/index.d.ts.map +1 -1
  78. package/dist/components/Spacer/index.js +29 -7
  79. package/dist/components/Spacer/index.js.map +1 -1
  80. package/dist/components/Table/header.js +2 -2
  81. package/dist/components/Table/header.js.map +1 -1
  82. package/dist/components/Table/headerCell.js +2 -2
  83. package/dist/components/Table/headerCell.js.map +1 -1
  84. package/dist/components/Table/helpers.d.ts +3 -2
  85. package/dist/components/Table/helpers.d.ts.map +1 -1
  86. package/dist/components/Table/helpers.js +6 -3
  87. package/dist/components/Table/helpers.js.map +1 -1
  88. package/dist/components/Table/index.d.ts +1 -0
  89. package/dist/components/Table/index.d.ts.map +1 -1
  90. package/dist/components/Table/index.js.map +1 -1
  91. package/dist/components/Table/row.d.ts +0 -5
  92. package/dist/components/Table/row.d.ts.map +1 -1
  93. package/dist/components/Table/row.js +3 -7
  94. package/dist/components/Table/row.js.map +1 -1
  95. package/dist/components/Tabs/content.d.ts +3 -1
  96. package/dist/components/Tabs/content.d.ts.map +1 -1
  97. package/dist/components/Tabs/content.js +8 -3
  98. package/dist/components/Tabs/content.js.map +1 -1
  99. package/dist/components/Tabs/index.d.ts +4 -1
  100. package/dist/components/Tabs/index.d.ts.map +1 -1
  101. package/dist/components/Tabs/index.js +12 -4
  102. package/dist/components/Tabs/index.js.map +1 -1
  103. package/dist/components/Tabs/item.d.ts +1 -0
  104. package/dist/components/Tabs/item.d.ts.map +1 -1
  105. package/dist/components/Tabs/item.js +7 -7
  106. package/dist/components/Tabs/item.js.map +1 -1
  107. package/dist/components/Tabs/list.d.ts +1 -1
  108. package/dist/components/Tabs/list.d.ts.map +1 -1
  109. package/dist/components/Tabs/list.js +7 -6
  110. package/dist/components/Tabs/list.js.map +1 -1
  111. package/dist/components/Tag/group.d.ts +2 -2
  112. package/dist/components/Tag/group.d.ts.map +1 -1
  113. package/dist/components/Tag/group.js +7 -8
  114. package/dist/components/Tag/group.js.map +1 -1
  115. package/dist/components/Tag/index.d.ts +6 -2
  116. package/dist/components/Tag/index.d.ts.map +1 -1
  117. package/dist/components/Tag/index.js +24 -12
  118. package/dist/components/Tag/index.js.map +1 -1
  119. package/dist/components/Tree/index.js +1 -1
  120. package/dist/components/Tree/index.js.map +1 -1
  121. package/dist/constants/animations.js +1 -1
  122. package/dist/constants/sizes.js +10 -10
  123. package/dist/constants/sizes.js.map +1 -1
  124. package/dist/containers/PopoverProvider.d.ts.map +1 -1
  125. package/dist/containers/PopoverProvider.js +10 -8
  126. package/dist/containers/PopoverProvider.js.map +1 -1
  127. package/dist/containers/ReqoreProvider.d.ts.map +1 -1
  128. package/dist/containers/ReqoreProvider.js +4 -2
  129. package/dist/containers/ReqoreProvider.js.map +1 -1
  130. package/dist/containers/UIProvider.d.ts +7 -0
  131. package/dist/containers/UIProvider.d.ts.map +1 -1
  132. package/dist/containers/UIProvider.js.map +1 -1
  133. package/dist/context/ReqoreContext.d.ts +2 -0
  134. package/dist/context/ReqoreContext.d.ts.map +1 -1
  135. package/dist/context/ReqoreContext.js.map +1 -1
  136. package/dist/helpers/colors.d.ts +1 -1
  137. package/dist/helpers/colors.d.ts.map +1 -1
  138. package/dist/helpers/colors.js +6 -2
  139. package/dist/helpers/colors.js.map +1 -1
  140. package/dist/helpers/utils.d.ts +3 -0
  141. package/dist/helpers/utils.d.ts.map +1 -1
  142. package/dist/helpers/utils.js +16 -1
  143. package/dist/helpers/utils.js.map +1 -1
  144. package/dist/hooks/useLatestZIndex.js +2 -2
  145. package/dist/hooks/useLatestZIndex.js.map +1 -1
  146. package/dist/hooks/usePopover.d.ts +1 -0
  147. package/dist/hooks/usePopover.d.ts.map +1 -1
  148. package/dist/hooks/usePopover.js +8 -6
  149. package/dist/hooks/usePopover.js.map +1 -1
  150. package/dist/styles.d.ts +1 -0
  151. package/dist/styles.d.ts.map +1 -1
  152. package/dist/styles.js +6 -5
  153. package/dist/styles.js.map +1 -1
  154. package/dist/types/global.d.ts +26 -0
  155. package/dist/types/global.d.ts.map +1 -1
  156. package/package.json +1 -1
  157. package/src/components/Button/index.tsx +79 -34
  158. package/src/components/Checkbox/index.tsx +3 -2
  159. package/src/components/Collection/index.tsx +93 -60
  160. package/src/components/Collection/item.tsx +29 -9
  161. package/src/components/Columns/column.tsx +1 -0
  162. package/src/components/ControlGroup/index.tsx +449 -104
  163. package/src/components/Drawer/index.tsx +28 -27
  164. package/src/components/Dropdown/index.tsx +3 -1
  165. package/src/components/Effect/index.tsx +22 -14
  166. package/src/components/Icon/index.tsx +81 -62
  167. package/src/components/Input/index.tsx +8 -3
  168. package/src/components/InternalPopover/index.tsx +131 -126
  169. package/src/components/Menu/index.tsx +7 -1
  170. package/src/components/Message/index.tsx +9 -1
  171. package/src/components/MultiSelect/index.tsx +180 -188
  172. package/src/components/Panel/index.tsx +227 -100
  173. package/src/components/Popover/index.tsx +1 -3
  174. package/src/components/Spacer/index.tsx +63 -14
  175. package/src/components/Table/header.tsx +2 -2
  176. package/src/components/Table/headerCell.tsx +2 -2
  177. package/src/components/Table/helpers.ts +12 -6
  178. package/src/components/Table/index.tsx +1 -0
  179. package/src/components/Table/row.tsx +2 -7
  180. package/src/components/Tabs/content.tsx +11 -3
  181. package/src/components/Tabs/index.tsx +14 -3
  182. package/src/components/Tabs/item.tsx +28 -5
  183. package/src/components/Tabs/list.tsx +7 -3
  184. package/src/components/Tag/group.tsx +6 -12
  185. package/src/components/Tag/index.tsx +69 -35
  186. package/src/components/Tree/index.tsx +1 -1
  187. package/src/constants/animations.ts +1 -1
  188. package/src/constants/sizes.ts +10 -10
  189. package/src/containers/PopoverProvider.tsx +11 -8
  190. package/src/containers/ReqoreProvider.tsx +40 -35
  191. package/src/containers/UIProvider.tsx +7 -0
  192. package/src/context/ReqoreContext.tsx +2 -0
  193. package/src/helpers/colors.ts +8 -2
  194. package/src/helpers/utils.ts +18 -0
  195. package/src/hooks/useLatestZIndex.ts +2 -2
  196. package/src/hooks/usePopover.tsx +9 -6
  197. package/src/mock/collectionData.tsx +33 -2
  198. package/src/stories/Button/Button.stories.tsx +72 -7
  199. package/src/stories/Checkbox/Checkbox.stories.tsx +6 -3
  200. package/src/stories/Collection/Collection.stories.tsx +18 -2
  201. package/src/stories/ControlGroup/ControlGroup.stories.tsx +282 -33
  202. package/src/stories/Drawer/Drawer.stories.tsx +70 -3
  203. package/src/stories/Dropdown/Dropdown.stories.tsx +13 -3
  204. package/src/stories/Icon/Icon.stories.tsx +1 -0
  205. package/src/stories/Input/Input.stories.tsx +5 -3
  206. package/src/stories/Menu/Menu.stories.tsx +2 -0
  207. package/src/stories/Message/Message.stories.tsx +7 -0
  208. package/src/stories/Panel/Panel.stories.tsx +147 -13
  209. package/src/stories/Popover/Popover.stories.tsx +88 -82
  210. package/src/stories/Tabs/Tabs.stories.tsx +33 -15
  211. package/src/stories/Tag/Tag.stories.tsx +23 -3
  212. package/src/stories/TextArea/TextArea.stories.tsx +3 -3
  213. package/src/styles.ts +6 -0
  214. package/src/types/global.ts +28 -0
  215. package/tests.json +1 -1
@@ -20,7 +20,7 @@ export default {
20
20
  const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
21
21
  return (
22
22
  <>
23
- <ReqoreControlGroup size={buttonProps.size}>
23
+ <ReqoreControlGroup size={buttonProps.size} wrap>
24
24
  <ReqoreButton {...buttonProps} icon='BankFill' rightIcon={null} />
25
25
  <ReqoreButton {...buttonProps} />
26
26
  <ReqoreButton {...buttonProps}>Default</ReqoreButton>
@@ -41,14 +41,21 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
41
41
  </ReqoreButton>
42
42
  </ReqoreControlGroup>
43
43
  <br />
44
- <ReqoreControlGroup size={buttonProps.size}>
44
+ <ReqoreControlGroup size={buttonProps.size} wrap>
45
45
  <ReqoreButton {...buttonProps} active flat={false} tooltip='hello'>
46
46
  Active Not Flat
47
47
  </ReqoreButton>
48
48
  <ReqoreButton {...buttonProps} flat={false}>
49
49
  Not Flat
50
50
  </ReqoreButton>
51
- <ReqoreButton {...buttonProps} minimal flat={false}>
51
+ <ReqoreButton
52
+ {...buttonProps}
53
+ minimal
54
+ flat={false}
55
+ iconColor='#38fdb2'
56
+ leftIconColor='#33023c:lighten:3'
57
+ rightIconColor='#0a487b:lighten:3'
58
+ >
52
59
  Minimal not flat
53
60
  </ReqoreButton>
54
61
  <ReqoreButton {...buttonProps} readOnly onClick={alert} flat={false}>
@@ -59,16 +66,49 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
59
66
  </ReqoreButton>
60
67
  </ReqoreControlGroup>
61
68
  <br />
62
- <ReqoreControlGroup fluid>
69
+ <ReqoreControlGroup fluid wrap>
63
70
  <ReqoreButton {...buttonProps} fluid>
64
71
  Fluid button
65
72
  </ReqoreButton>
66
73
  </ReqoreControlGroup>
67
74
  <br />
68
- <ReqoreControlGroup>
75
+ <ReqoreControlGroup fluid wrap>
76
+ <ReqoreButton {...buttonProps}>Left text</ReqoreButton>
77
+ <ReqoreButton
78
+ {...buttonProps}
79
+ textAlign='center'
80
+ maxWidth='250px'
81
+ badge='10'
82
+ wrap
83
+ description='I am a button with a center aligned text and description'
84
+ >
85
+ Center
86
+ </ReqoreButton>
87
+ <ReqoreButton
88
+ {...buttonProps}
89
+ textAlign='center'
90
+ maxWidth='200px'
91
+ badge="I'm a badge, baby"
92
+ wrap
93
+ description='I am a button with a center aligned text and description'
94
+ >
95
+ Center text with a longer text
96
+ </ReqoreButton>
97
+ <ReqoreButton
98
+ {...buttonProps}
99
+ textAlign='right'
100
+ badge="I'm a badge"
101
+ description='I am a button with a right aligned text and description'
102
+ >
103
+ Right text
104
+ </ReqoreButton>
105
+ </ReqoreControlGroup>
106
+ <br />
107
+ <ReqoreControlGroup wrap>
69
108
  <ReqoreButton
70
109
  {...buttonProps}
71
110
  description='This is a very interesting description for a button, I like it very much'
111
+ iconColor='#38fdb2'
72
112
  >
73
113
  With Default Description
74
114
  </ReqoreButton>
@@ -87,8 +127,22 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
87
127
  </ReqoreButton>
88
128
  <ReqoreButton
89
129
  {...buttonProps}
130
+ minimal
90
131
  description='This is a very interesting description for a button, I like it very much'
91
132
  maxWidth='200px'
133
+ labelEffect={{
134
+ gradient: { colors: { 0: '#00fafd', 130: '#eb0e8c' }, direction: 'to right bottom' },
135
+ }}
136
+ descriptionEffect={{
137
+ gradient: { colors: { 0: '#fd7600', 90: '#c997ff' }, type: 'radial' },
138
+ }}
139
+ effect={{
140
+ gradient: {
141
+ colors: { 0: '#be00fd', 130: '#e70eeb' },
142
+ direction: 'to left bottom',
143
+ animate: 'hover',
144
+ },
145
+ }}
92
146
  badge={{
93
147
  effect: {
94
148
  gradient: { colors: { 0: '#00fafd', 130: '#eb0e8c' }, direction: 'to right bottom' },
@@ -109,11 +163,22 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
109
163
  />
110
164
  </ReqoreControlGroup>
111
165
  <br />
112
- <ReqoreControlGroup>
166
+ <ReqoreControlGroup wrap>
113
167
  <ReqoreButton {...buttonProps} readOnly badge={10} onClick={alert}>
114
168
  Read only with badge
115
169
  </ReqoreButton>
116
- <ReqoreButton {...buttonProps} minimal badge={20} onClick={alert}>
170
+ <ReqoreButton
171
+ {...buttonProps}
172
+ minimal
173
+ badge={20}
174
+ onClick={alert}
175
+ effect={{
176
+ gradient: { colors: { 90: '#ffe69c', 0: '#ff7818' }, type: 'radial' },
177
+ }}
178
+ labelEffect={{
179
+ gradient: { colors: { 0: '#ffe69c', 90: '#ff7818' }, type: 'radial' },
180
+ }}
181
+ >
117
182
  Minimal with badge
118
183
  </ReqoreButton>
119
184
  <ReqoreButton
@@ -1,6 +1,6 @@
1
1
  import { ComponentMeta, ComponentStory } from '@storybook/react';
2
2
  import Checkbox from '../../components/Checkbox';
3
- import { ReqoreCheckbox, ReqoreControlGroup } from '../../index';
3
+ import { ReqoreCheckbox, ReqoreControlGroup, ReqoreVerticalSpacer } from '../../index';
4
4
 
5
5
  export default {
6
6
  title: 'Components/Checkbox',
@@ -10,7 +10,7 @@ export default {
10
10
  const Template: ComponentStory<typeof Checkbox> = (args) => {
11
11
  return (
12
12
  <ReqoreControlGroup vertical>
13
- <ReqoreControlGroup>
13
+ <ReqoreControlGroup wrap>
14
14
  <ReqoreCheckbox {...args} />
15
15
  <ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelDetailPosition='left' />
16
16
  <ReqoreCheckbox {...args} checked tooltip='I am checked' />
@@ -18,7 +18,8 @@ const Template: ComponentStory<typeof Checkbox> = (args) => {
18
18
  <ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelPosition='left' />
19
19
  <ReqoreCheckbox {...args} label='Read Only' labelPosition='left' readOnly />
20
20
  </ReqoreControlGroup>
21
- <ReqoreControlGroup>
21
+ <ReqoreVerticalSpacer height={10} />
22
+ <ReqoreControlGroup wrap>
22
23
  <ReqoreCheckbox {...args} intent='info' checked />
23
24
  <ReqoreCheckbox
24
25
  {...args}
@@ -34,6 +35,8 @@ const Template: ComponentStory<typeof Checkbox> = (args) => {
34
35
  effect={{ gradient: { colors: { 0: '#00fafd', 100: '#ff00d0' } } }}
35
36
  />
36
37
  <ReqoreCheckbox {...args} disabled onText='yes' offText='no' />
38
+ <ReqoreCheckbox {...args} onText='yes' offText='no' />
39
+ <ReqoreCheckbox {...args} onText='yes' offText='no' checked />
37
40
  <ReqoreCheckbox
38
41
  {...args}
39
42
  label='Label'
@@ -2,7 +2,7 @@ import { Meta, Story } from '@storybook/react';
2
2
  import { IReqoreCollectionProps, ReqoreCollection } from '../../components/Collection';
3
3
  import { IReqoreColumnsProps } from '../../components/Columns';
4
4
  import items from '../../mock/collectionData';
5
- import { argManager, IntentArg, SizeArg } from '../utils/args';
5
+ import { IntentArg, SizeArg, argManager } from '../utils/args';
6
6
 
7
7
  export interface IColumnsStoryArgs extends IReqoreColumnsProps {
8
8
  multipleColumns?: boolean;
@@ -45,7 +45,7 @@ export default {
45
45
  description: 'If true, the collection will be rounded when stacked',
46
46
  }),
47
47
  ...createArg('height', {
48
- defaultValue: '600px',
48
+ defaultValue: undefined,
49
49
  type: 'string',
50
50
  name: 'Height',
51
51
  description: 'Height of the collection',
@@ -72,6 +72,8 @@ const Template: Story<IReqoreCollectionProps> = (args) => {
72
72
  return (
73
73
  <ReqoreCollection
74
74
  {...args}
75
+ badge={10}
76
+ selectedIcon='CheckLine'
75
77
  actions={[{ label: 'Custom action', icon: 'Home7Line' }, { actions: [{ value: 'Test' }] }]}
76
78
  />
77
79
  );
@@ -83,6 +85,13 @@ Basic.args = {
83
85
  items,
84
86
  };
85
87
 
88
+ export const WithHeight = Template.bind({});
89
+ WithHeight.args = {
90
+ label: 'Collection of items',
91
+ height: '600px',
92
+ items,
93
+ };
94
+
86
95
  export const Stacked = Template.bind({});
87
96
  Stacked.args = {
88
97
  label: 'Collection of items',
@@ -96,3 +105,10 @@ Fill.args = {
96
105
  fill: true,
97
106
  items,
98
107
  };
108
+
109
+ export const SelectedFirst = Template.bind({});
110
+ SelectedFirst.args = {
111
+ label: 'Collection of items',
112
+ items,
113
+ showSelectedFirst: true,
114
+ };
@@ -1,7 +1,14 @@
1
1
  import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { IReqoreControlGroupProps } from '../../components/ControlGroup';
3
- import ReqoreInput from '../../components/Input';
4
- import { ReqoreButton, ReqoreCheckbox, ReqoreControlGroup, ReqoreTag } from '../../index';
3
+ import {
4
+ ReqoreButton,
5
+ ReqoreCheckbox,
6
+ ReqoreControlGroup,
7
+ ReqoreDropdown,
8
+ ReqoreInput,
9
+ ReqoreTag,
10
+ ReqoreVerticalSpacer,
11
+ } from '../../index';
5
12
  import { GapSizeArg, MinimalArg, SizeArg, argManager } from '../utils/args';
6
13
 
7
14
  const { createArg } = argManager<IReqoreControlGroupProps>();
@@ -30,42 +37,240 @@ export default {
30
37
  description: 'Whether the control group should be fluid',
31
38
  control: 'boolean',
32
39
  }),
40
+ ...createArg('wrap', {
41
+ name: 'wrap',
42
+ defaultValue: true,
43
+ description: 'Whether the control group should wrap',
44
+ control: 'boolean',
45
+ }),
33
46
  },
34
47
  } as Meta<IReqoreControlGroupProps>;
35
48
 
36
49
  const Template: Story<IReqoreControlGroupProps> = (args: IReqoreControlGroupProps) => {
50
+ if (args.fill) {
51
+ return (
52
+ <>
53
+ <ReqoreControlGroup {...args} stack>
54
+ <ReqoreButton icon='PictureInPictureLine' description='I will be a bit larger'>
55
+ Button
56
+ </ReqoreButton>
57
+ <ReqoreControlGroup stack>
58
+ <ReqoreButton maxWidth='300px'>Button with max width</ReqoreButton>
59
+ <ReqoreTag label='A wild tag appears!' color='main:lighten:2' />
60
+ </ReqoreControlGroup>
61
+ <ReqoreControlGroup stack>
62
+ <ReqoreControlGroup>
63
+ <ReqoreInput customTheme={{ main: '#00e3e8' }} placeholder='Level 2 deep' />
64
+ <ReqoreControlGroup fixed>
65
+ <ReqoreButton disabled fixed id='test'>
66
+ Level 3 deep and fixed
67
+ </ReqoreButton>
68
+ </ReqoreControlGroup>
69
+ </ReqoreControlGroup>
70
+ <ReqoreCheckbox checked margin='both' label='Level 1 deep' />
71
+ <ReqoreButton intent='danger'>Level 1 deep</ReqoreButton>
72
+ </ReqoreControlGroup>
73
+ </ReqoreControlGroup>
74
+ <ReqoreVerticalSpacer height={10} />
75
+ <ReqoreControlGroup {...args} stack>
76
+ <ReqoreButton
77
+ icon='PictureInPictureLine'
78
+ description='Here is a really weird and long description that needs to stretch the button a little bit so we can get some idea on how the other buttons are going to react.'
79
+ maxWidth='400px'
80
+ >
81
+ Please select
82
+ </ReqoreButton>
83
+ <ReqoreButton icon='AddLine' intent='info' />
84
+ <ReqoreButton>Edit</ReqoreButton>
85
+ <ReqoreButton icon='DeleteBinLine' intent='danger'>
86
+ Remove
87
+ </ReqoreButton>
88
+ </ReqoreControlGroup>
89
+ <ReqoreVerticalSpacer height={10} />
90
+ <ReqoreControlGroup {...args} stack fluid>
91
+ <ReqoreButton
92
+ icon='PictureInPictureLine'
93
+ description='Here is a really weird and long description that needs to stretch the button a little bit so we can get some idea on how the other buttons are going to react.'
94
+ >
95
+ Please select
96
+ </ReqoreButton>
97
+ <ReqoreButton icon='AddLine' intent='info' fixed />
98
+ <ReqoreButton fixed>Edit</ReqoreButton>
99
+ <ReqoreButton icon='DeleteBinLine' intent='danger' fixed>
100
+ Remove
101
+ </ReqoreButton>
102
+ </ReqoreControlGroup>
103
+ </>
104
+ );
105
+ }
106
+
107
+ if (args.responsive) {
108
+ return (
109
+ <div style={{ width: 600 }}>
110
+ <ReqoreControlGroup {...args} wrap={false}>
111
+ <ReqoreButton icon='PictureInPictureLine'>Button</ReqoreButton>
112
+ <ReqoreControlGroup stack>
113
+ <ReqoreTag label='A wild tag appears!' color='main:lighten:2' />
114
+ </ReqoreControlGroup>
115
+ <ReqoreControlGroup stack>
116
+ <ReqoreButton maxWidth='300px'>Button with max width</ReqoreButton>
117
+ <ReqoreTag label='A wild tag appears!' color='main:lighten:2' />
118
+ </ReqoreControlGroup>
119
+ <ReqoreControlGroup stack>
120
+ <ReqoreControlGroup>
121
+ <ReqoreButton customTheme={{ main: '#00e3e8' }}>Level 2 deep</ReqoreButton>
122
+ <ReqoreControlGroup fixed>
123
+ <ReqoreButton disabled fixed id='test'>
124
+ Level 3 deep and fixed
125
+ </ReqoreButton>
126
+ </ReqoreControlGroup>
127
+ </ReqoreControlGroup>
128
+ <ReqoreButton intent='danger'>Level 1 deep</ReqoreButton>
129
+ <ReqoreCheckbox checked margin='both' label='Level 1 deep' />
130
+ </ReqoreControlGroup>
131
+ <ReqoreButton icon='PictureInPictureLine'>Button</ReqoreButton>
132
+ <ReqoreButton maxWidth='300px'>Button with max width</ReqoreButton>
133
+ </ReqoreControlGroup>
134
+ </div>
135
+ );
136
+ }
137
+
37
138
  return (
38
- <ReqoreControlGroup {...args}>
39
- <ReqoreButton icon='PictureInPictureLine'>Button</ReqoreButton>
40
- <ReqoreButton
41
- icon='PictureInPictureLine'
42
- flat={false}
43
- effect={{ gradient: { colors: { 0: 'success', 100: 'info:darken:1' } } }}
44
- >
45
- Non flat Button
46
- </ReqoreButton>
47
- <ReqoreButton maxWidth='300px'>Button with max width</ReqoreButton>
48
- <ReqoreTag label='A wild tag appears!' color='main:lighten:2' />
49
- <ReqoreCheckbox
50
- asSwitch
51
- label='Switchy switch'
52
- margin='both'
53
- intent='warning'
54
- checkedIcon='CheckFill'
55
- checked
56
- uncheckedIcon='CheckboxBlankLine'
57
- />
58
- <ReqoreInput icon='4KFill' value='Hello' />
59
- <ReqoreButton disabled fixed>
60
- Disabled & Fixed
61
- </ReqoreButton>
62
- <ReqoreCheckbox checked margin='both'>
63
- Checkbox
64
- </ReqoreCheckbox>
65
-
66
- <ReqoreButton minimal>Minimal</ReqoreButton>
67
- <ReqoreTag label='smol tag' size='small' />
68
- </ReqoreControlGroup>
139
+ <>
140
+ <ReqoreControlGroup {...args}>
141
+ <ReqoreButton icon='PictureInPictureLine'>Button</ReqoreButton>
142
+ <ReqoreButton icon='PictureInPictureLine' fluid>
143
+ Fluid Button
144
+ </ReqoreButton>
145
+ <ReqoreButton
146
+ icon='PictureInPictureLine'
147
+ flat={false}
148
+ effect={{ gradient: { colors: { 0: 'success', 100: 'info:darken:1' } } }}
149
+ description="With a description, it's a bit longer than the button itself"
150
+ fixed
151
+ >
152
+ Non flat fixed Button
153
+ </ReqoreButton>
154
+ <ReqoreControlGroup stack>
155
+ <ReqoreButton maxWidth='300px'>Button with max width</ReqoreButton>
156
+ <ReqoreTag label='A wild tag appears!' color='main:lighten:2' />
157
+ </ReqoreControlGroup>
158
+ <ReqoreCheckbox
159
+ asSwitch
160
+ label='Switchy switch'
161
+ margin='both'
162
+ intent='warning'
163
+ checkedIcon='CheckFill'
164
+ checked
165
+ uncheckedIcon='CheckboxBlankLine'
166
+ />
167
+ <ReqoreInput icon='4KFill' value='Hello I am fluid' fluid />
168
+ <ReqoreControlGroup stack>
169
+ <ReqoreControlGroup>
170
+ <ReqoreButton customTheme={{ main: '#00e3e8' }}>Level 2 deep</ReqoreButton>
171
+ <ReqoreControlGroup fixed>
172
+ <ReqoreButton disabled fixed id='test'>
173
+ Level 3 deep and fixed
174
+ </ReqoreButton>
175
+ </ReqoreControlGroup>
176
+ </ReqoreControlGroup>
177
+ <ReqoreButton intent='danger'>Level 1 deep</ReqoreButton>
178
+ <ReqoreCheckbox checked margin='both' label='Level 1 deep' />
179
+ </ReqoreControlGroup>
180
+
181
+ <ReqoreButton minimal>Minimal</ReqoreButton>
182
+ <ReqoreTag label='smol tag' size='small' />
183
+ </ReqoreControlGroup>
184
+ <ReqoreVerticalSpacer height={15} />
185
+ <ReqoreControlGroup {...args} className='root-group' id='root-group'>
186
+ <ReqoreControlGroup intent='info' className='group-1' id='group-1-wrapper'>
187
+ <ReqoreControlGroup intent='info' className='group-1' id='group-1'>
188
+ <>
189
+ <ReqoreButton icon='PictureInPictureLine' id='group-1-button'>
190
+ Group 1
191
+ </ReqoreButton>
192
+ <ReqoreTag icon='PictureInPictureLine' label='Group 1' id='group-1-tag' />
193
+ </>
194
+ </ReqoreControlGroup>
195
+ <ReqoreControlGroup intent='pending' className='group-1-1' id='group-1-1'>
196
+ <ReqoreButton icon='PictureInPictureLine' id='group-1-1-button'>
197
+ Group 1-1
198
+ </ReqoreButton>
199
+ <ReqoreTag icon='PictureInPictureLine' label='Group 1-1' id='group-1-1-tag' />
200
+ <ReqoreDropdown
201
+ items={[
202
+ {
203
+ selected: true,
204
+ label: 'Hello',
205
+ value: 'hello',
206
+ icon: 'SunCloudyLine',
207
+ },
208
+ {
209
+ label: 'How are ya',
210
+ value: 'howareya',
211
+ icon: 'BatteryChargeFill',
212
+ },
213
+ {
214
+ disabled: true,
215
+ label: 'i aM diSAblEd',
216
+ value: 'disabled',
217
+ icon: 'StopCircleLine',
218
+ },
219
+ {
220
+ label: 'With right button',
221
+ value: 'kek',
222
+ icon: 'CheckDoubleLine',
223
+ },
224
+ ]}
225
+ >
226
+ Dropdown
227
+ </ReqoreDropdown>
228
+ </ReqoreControlGroup>
229
+ </ReqoreControlGroup>
230
+ <ReqoreButton icon='PictureInPictureLine' id='group-root-button'>
231
+ Root group
232
+ </ReqoreButton>
233
+ <ReqoreControlGroup intent='success' className='group-2' id='group-2'>
234
+ <>
235
+ <ReqoreButton icon='PictureInPictureLine' id='group-2-button' fixed>
236
+ Group 2
237
+ </ReqoreButton>
238
+ <ReqoreControlGroup intent='danger' className='group-3' id='group-3'>
239
+ <ReqoreButton icon='PictureInPictureLine' id='group-3-button-1'>
240
+ Group 3
241
+ </ReqoreButton>
242
+ <ReqoreButton icon='PictureInPictureLine' id='group-3-button-2'>
243
+ Group 3
244
+ </ReqoreButton>
245
+ </ReqoreControlGroup>
246
+ </>
247
+ <ReqoreCheckbox label='Group 2' margin='both' id='group-2-checkbox' />
248
+ </ReqoreControlGroup>
249
+ <ReqoreButton icon='PictureInPictureLine' id='group-root-button-2'>
250
+ Root group
251
+ </ReqoreButton>
252
+ <ReqoreControlGroup intent='warning' className='group-4' id='group-4'>
253
+ <ReqoreControlGroup id='group-4-1' fluid={false}>
254
+ <ReqoreTag icon='PictureInPictureLine' label='Group 4' id='group-4-1-tag' />
255
+ <ReqoreInput icon='PictureInPictureLine' value='Group 4' id='group-4-1-input' />
256
+ </ReqoreControlGroup>
257
+ <ReqoreControlGroup id='group-4-3'>
258
+ <ReqoreTag icon='PictureInPictureLine' label='Group 4' id='group-4-3-tag' />
259
+ <>
260
+ <ReqoreInput icon='PictureInPictureLine' value='Group 4' id='group-4-3-input' />
261
+ <ReqoreControlGroup id='group-5' intent='muted' fluid={false}>
262
+ <ReqoreTag icon='PictureInPictureLine' label='Group 5' id='group-4-3-1-tag' />
263
+ <ReqoreTag icon='PictureInPictureLine' label='Group 5' id='group-4-3-2-tag' />
264
+ <ReqoreTag icon='PictureInPictureLine' label='Group 5' id='group-4-3-3-tag' />
265
+ <ReqoreControlGroup id='group 6' intent='success'>
266
+ <ReqoreButton fixed>Group 6</ReqoreButton>
267
+ </ReqoreControlGroup>
268
+ </ReqoreControlGroup>
269
+ </>
270
+ </ReqoreControlGroup>
271
+ </ReqoreControlGroup>
272
+ </ReqoreControlGroup>
273
+ </>
69
274
  );
70
275
  };
71
276
 
@@ -75,6 +280,16 @@ Minimal.args = {
75
280
  minimal: true,
76
281
  };
77
282
 
283
+ export const Fluid = Template.bind({});
284
+ Fluid.args = {
285
+ fluid: true,
286
+ };
287
+
288
+ export const Fill = Template.bind({});
289
+ Fill.args = {
290
+ fill: true,
291
+ };
292
+
78
293
  export const NotFlat = Template.bind({});
79
294
  NotFlat.args = {
80
295
  flat: false,
@@ -85,6 +300,19 @@ Vertical.args = {
85
300
  vertical: true,
86
301
  };
87
302
 
303
+ export const VerticalFluid = Template.bind({});
304
+ VerticalFluid.args = {
305
+ vertical: true,
306
+ fluid: true,
307
+ };
308
+
309
+ export const VerticalStackedFluid = Template.bind({});
310
+ VerticalStackedFluid.args = {
311
+ vertical: true,
312
+ stack: true,
313
+ fluid: true,
314
+ };
315
+
88
316
  export const Stacked = Template.bind({});
89
317
  Stacked.args = {
90
318
  stack: true,
@@ -94,3 +322,24 @@ export const BigGapSize = Template.bind({});
94
322
  BigGapSize.args = {
95
323
  gapSize: 'big',
96
324
  };
325
+
326
+ export const NoWrap = Template.bind({});
327
+ NoWrap.args = {
328
+ wrap: false,
329
+ };
330
+
331
+ export const HorizontalAlign = Template.bind({});
332
+ HorizontalAlign.args = {
333
+ vertical: true,
334
+ horizontalAlign: 'center',
335
+ };
336
+
337
+ export const VerticalAlign = Template.bind({});
338
+ VerticalAlign.args = {
339
+ verticalAlign: 'flex-end',
340
+ };
341
+
342
+ export const Responsive = Template.bind({});
343
+ Responsive.args = {
344
+ responsive: true,
345
+ };
@@ -2,14 +2,16 @@ import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { noop } from 'lodash';
3
3
  import { useContext } from 'react';
4
4
  import { IReqoreDrawerProps, ReqoreDrawer } from '../../components/Drawer';
5
+ import { IReqoreInputProps } from '../../components/Input';
5
6
  import {
6
7
  ReqoreButton,
7
8
  ReqoreContext,
9
+ ReqoreInput,
8
10
  ReqorePanel,
9
11
  ReqoreTabs,
10
12
  ReqoreTabsContent,
11
13
  } from '../../index';
12
- import { argManager, FlatArg, IntentArg } from '../utils/args';
14
+ import { FlatArg, IntentArg, argManager } from '../utils/args';
13
15
 
14
16
  const { createArg } = argManager<IReqoreDrawerProps>();
15
17
 
@@ -46,7 +48,7 @@ export default {
46
48
  options: ['left', 'right', 'top', 'bottom'],
47
49
  }),
48
50
  ...createArg('size', {
49
- defaultValue: '450px',
51
+ defaultValue: 'auto',
50
52
  name: 'Size',
51
53
  type: 'string',
52
54
  }),
@@ -124,7 +126,68 @@ const Template: Story<IReqoreDrawerProps> = (args: IReqoreDrawerProps) => {
124
126
  attacks inhabit pursuit our but. Lasted hunted enough an up seeing in lively letter. Had
125
127
  judgment out opinions property the supplied.
126
128
  </ReqorePanel>
127
- <ReqoreDrawer {...args} label='This is a test' icon='EmphasisCn' onClose={noop}>
129
+ <ReqoreDrawer
130
+ {...args}
131
+ label='This is a test'
132
+ icon='EmphasisCn'
133
+ onClose={noop}
134
+ actions={[
135
+ {
136
+ responsive: false,
137
+ group: [
138
+ {
139
+ label: 'Non responsive',
140
+ icon: '24HoursFill',
141
+ customTheme: { main: '#eb0e8c' },
142
+ },
143
+ {
144
+ icon: 'FullscreenExitLine',
145
+ customTheme: { main: '#a40a62' },
146
+ },
147
+ ],
148
+ },
149
+ {
150
+ group: [
151
+ { label: 'Stacked Action 1', icon: 'BallPenLine', intent: 'warning' },
152
+ { icon: 'CopperCoinFill', intent: 'danger' },
153
+ ],
154
+ },
155
+ {
156
+ as: ReqoreInput,
157
+ props: {
158
+ placeholder: 'Custom action!',
159
+ icon: 'Search2Line',
160
+ minimal: false,
161
+ } as IReqoreInputProps,
162
+ },
163
+ {
164
+ label: 'More actions',
165
+ actions: [
166
+ { value: 'Sub Test', icon: 'FileDownloadLine' },
167
+ { value: 'Sub Test 2', icon: 'FileDownloadLine', intent: 'success' },
168
+ ],
169
+ intent: 'info',
170
+ },
171
+ ]}
172
+ bottomActions={[
173
+ {
174
+ position: 'left',
175
+ intent: 'success',
176
+ group: [
177
+ { label: 'Test 1', icon: '24HoursFill' },
178
+ { label: 'Test 2', icon: '24HoursFill' },
179
+ ],
180
+ },
181
+ {
182
+ label: 'More actions',
183
+ position: 'right',
184
+ actions: [
185
+ { value: 'Sub Test', icon: 'FileDownloadLine', intent: 'success' },
186
+ { value: 'Sub Test 2', icon: 'FileDownloadLine' },
187
+ ],
188
+ },
189
+ ]}
190
+ >
128
191
  <ReqoreTabs
129
192
  flat
130
193
  intent={args.intent}
@@ -179,3 +242,7 @@ export const Transparent = Template.bind({});
179
242
  Transparent.args = {
180
243
  opacity: 0.5,
181
244
  };
245
+ export const WithSize = Template.bind({});
246
+ WithSize.args = {
247
+ size: '500px',
248
+ };