@qoretechnologies/reqore 0.29.0 → 0.29.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.
Files changed (91) hide show
  1. package/__tests__/checkbox.test.tsx +7 -12
  2. package/__tests__/multiselect.test.tsx +46 -0
  3. package/dist/components/Button/index.d.ts.map +1 -1
  4. package/dist/components/Button/index.js +4 -2
  5. package/dist/components/Button/index.js.map +1 -1
  6. package/dist/components/Checkbox/index.d.ts +9 -2
  7. package/dist/components/Checkbox/index.d.ts.map +1 -1
  8. package/dist/components/Checkbox/index.js +61 -31
  9. package/dist/components/Checkbox/index.js.map +1 -1
  10. package/dist/components/Effect/index.d.ts +18 -4
  11. package/dist/components/Effect/index.d.ts.map +1 -1
  12. package/dist/components/Effect/index.js +67 -26
  13. package/dist/components/Effect/index.js.map +1 -1
  14. package/dist/components/Icon/index.d.ts +2 -9
  15. package/dist/components/Icon/index.d.ts.map +1 -1
  16. package/dist/components/Icon/index.js +4 -28
  17. package/dist/components/Icon/index.js.map +1 -1
  18. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  19. package/dist/components/InternalPopover/index.js +16 -2
  20. package/dist/components/InternalPopover/index.js.map +1 -1
  21. package/dist/components/Menu/divider.d.ts +1 -1
  22. package/dist/components/Menu/divider.d.ts.map +1 -1
  23. package/dist/components/MultiSelect/index.d.ts +4 -2
  24. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  25. package/dist/components/MultiSelect/index.js +15 -14
  26. package/dist/components/MultiSelect/index.js.map +1 -1
  27. package/dist/components/Panel/index.d.ts.map +1 -1
  28. package/dist/components/Panel/index.js.map +1 -1
  29. package/dist/components/RadioGroup/index.d.ts +4 -1
  30. package/dist/components/RadioGroup/index.d.ts.map +1 -1
  31. package/dist/components/RadioGroup/index.js +2 -2
  32. package/dist/components/RadioGroup/index.js.map +1 -1
  33. package/dist/components/Tag/index.d.ts +1 -1
  34. package/dist/components/Tag/index.d.ts.map +1 -1
  35. package/dist/components/Tag/index.js +17 -14
  36. package/dist/components/Tag/index.js.map +1 -1
  37. package/dist/components/Textarea/index.js +3 -3
  38. package/dist/components/Textarea/index.js.map +1 -1
  39. package/dist/constants/sizes.d.ts +7 -0
  40. package/dist/constants/sizes.d.ts.map +1 -1
  41. package/dist/constants/sizes.js +8 -1
  42. package/dist/constants/sizes.js.map +1 -1
  43. package/dist/constants/theme.d.ts +4 -1
  44. package/dist/constants/theme.d.ts.map +1 -1
  45. package/dist/constants/theme.js.map +1 -1
  46. package/dist/helpers/colors.d.ts +5 -4
  47. package/dist/helpers/colors.d.ts.map +1 -1
  48. package/dist/helpers/colors.js +35 -8
  49. package/dist/helpers/colors.js.map +1 -1
  50. package/dist/hooks/useReqoreEffect.d.ts +4 -0
  51. package/dist/hooks/useReqoreEffect.d.ts.map +1 -0
  52. package/dist/hooks/useReqoreEffect.js +42 -0
  53. package/dist/hooks/useReqoreEffect.js.map +1 -0
  54. package/dist/hooks/useTheme.d.ts +1 -0
  55. package/dist/hooks/useTheme.d.ts.map +1 -1
  56. package/dist/hooks/useTheme.js.map +1 -1
  57. package/dist/index.d.ts +2 -0
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +5 -1
  60. package/dist/index.js.map +1 -1
  61. package/package.json +1 -1
  62. package/src/components/Button/index.tsx +5 -3
  63. package/src/components/Checkbox/index.tsx +217 -38
  64. package/src/components/Effect/index.tsx +125 -17
  65. package/src/components/Icon/index.tsx +4 -52
  66. package/src/components/InternalPopover/index.tsx +3 -0
  67. package/src/components/Menu/divider.tsx +1 -1
  68. package/src/components/MultiSelect/index.tsx +20 -11
  69. package/src/components/Panel/index.tsx +3 -3
  70. package/src/components/RadioGroup/index.tsx +10 -2
  71. package/src/components/Tag/index.tsx +19 -13
  72. package/src/components/Textarea/index.tsx +3 -3
  73. package/src/constants/sizes.ts +8 -0
  74. package/src/constants/theme.ts +8 -1
  75. package/src/helpers/colors.ts +54 -11
  76. package/src/hooks/useReqoreEffect.ts +49 -0
  77. package/src/hooks/useTheme.ts +2 -1
  78. package/src/index.tsx +2 -0
  79. package/src/mock/collectionData.tsx +6 -6
  80. package/src/mock/multiSelect.ts +8 -0
  81. package/src/stories/Button/Button.stories.tsx +14 -0
  82. package/src/stories/Checkbox/Checkbox.stories.tsx +42 -7
  83. package/src/stories/Icon/Icon.stories.tsx +42 -12
  84. package/src/stories/Menu/Menu.stories.tsx +2 -1
  85. package/src/stories/MultiSelect/MultiSelect.stories.tsx +9 -2
  86. package/src/stories/Panel/Panel.stories.tsx +1 -1
  87. package/src/stories/Popover/Popover.stories.tsx +19 -2
  88. package/src/stories/RadioGroup/RadioGroup.stories.tsx +98 -1
  89. package/src/stories/Tag/Tag.stories.tsx +2 -2
  90. package/src/stories/utils/args.ts +1 -1
  91. package/tests.json +1 -1
@@ -1,4 +1,8 @@
1
- import { TReqoreEffectColor, TReqoreHexColor } from '../components/Effect';
1
+ import {
2
+ TReqoreEffectColor,
3
+ TReqoreEffectGradientAnimationTrigger,
4
+ TReqoreHexColor,
5
+ } from '../components/Effect';
2
6
 
3
7
  export interface IReqoreSidebarTheme {
4
8
  main?: TReqoreHexColor;
@@ -65,6 +69,7 @@ export interface IReqoreTheme {
65
69
  header?: IReqoreNavbarTheme;
66
70
  footer?: IReqoreNavbarTheme;
67
71
  breadcrumbs?: IReqoreBreadcrumbsTheme;
72
+ buttons?: IReqoreCustomTheme;
68
73
  }
69
74
 
70
75
  export interface IReqoreCustomTheme {
@@ -73,6 +78,8 @@ export interface IReqoreCustomTheme {
73
78
  color?: TReqoreEffectColor;
74
79
  dim?: boolean;
75
80
  };
81
+ gradient?: boolean;
82
+ animate?: TReqoreEffectGradientAnimationTrigger;
76
83
  }
77
84
 
78
85
  export interface IReqoreIntents {
@@ -1,6 +1,12 @@
1
1
  import { cloneDeep, merge, reduce } from 'lodash';
2
2
  import { darken, getLuminance, lighten, mix, readableColor } from 'polished';
3
- import { TReqoreEffectColor, TReqoreEffectColorList, TReqoreHexColor } from '../components/Effect';
3
+ import {
4
+ TReqoreEffectColor,
5
+ TReqoreEffectColorList,
6
+ TReqoreEffectGradientColors,
7
+ TReqoreEffectGradientColorsObject,
8
+ TReqoreHexColor,
9
+ } from '../components/Effect';
4
10
  import { Colors } from '../constants/colors';
5
11
  import { DEFAULT_INTENTS, IReqoreTheme, TReqoreIntent } from '../constants/theme';
6
12
 
@@ -175,7 +181,7 @@ export const getColorFromMaybeString = (
175
181
  _color = theme.intents[providedColor];
176
182
  }
177
183
 
178
- if (isValidSixCharHex(color)) {
184
+ if (isValidSixCharHex(providedColor)) {
179
185
  _color = providedColor as TReqoreHexColor;
180
186
  }
181
187
 
@@ -192,28 +198,62 @@ export const getColorFromMaybeString = (
192
198
 
193
199
  export const createEffectGradient = (
194
200
  theme: IReqoreTheme,
195
- colors: Record<number, TReqoreEffectColor>,
201
+ colors: TReqoreEffectGradientColors,
196
202
  lighten: number = 0,
197
203
  minimal?: boolean
198
204
  ): string => {
205
+ let _colors: TReqoreEffectGradientColorsObject;
206
+ // Check if the colors are valid
207
+ if (!colors) {
208
+ throw new Error('You need to provide colors');
209
+ }
210
+
211
+ if (typeof colors === 'string') {
212
+ _colors = buildGradientColorsFromString(theme, colors);
213
+ } else {
214
+ _colors = colors;
215
+ }
216
+
199
217
  return reduce(
200
- colors,
218
+ _colors,
201
219
  (colorsString, color, percentage) => {
202
220
  return `${colorsString}, ${
203
- minimal ? theme.main : changeLightness(getColorFromMaybeString(theme, color), lighten)
221
+ minimal
222
+ ? theme.originalMain
223
+ : changeLightness(getColorFromMaybeString(theme, color), lighten)
204
224
  } ${percentage}%`;
205
225
  },
206
226
  ''
207
227
  );
208
228
  };
209
229
 
230
+ export const buildGradientColorsFromString = (
231
+ theme: IReqoreTheme,
232
+ color: 'main' | TReqoreHexColor | TReqoreIntent
233
+ ): TReqoreEffectGradientColorsObject => {
234
+ if (!color) {
235
+ throw new Error('You need to provide a color or intent');
236
+ }
237
+
238
+ const colorFrom: TReqoreHexColor = getColorFromMaybeString(theme, `${color}:lighten:1`);
239
+ const colorTo: TReqoreHexColor = getColorFromMaybeString(theme, `${color}`);
240
+
241
+ return {
242
+ 0: colorFrom,
243
+ 100: colorTo,
244
+ };
245
+ };
246
+
210
247
  export const getNthGradientColor = (
211
248
  theme: IReqoreTheme,
212
- colors?: Record<number, TReqoreEffectColor>,
249
+ colors?: TReqoreEffectGradientColors,
213
250
  nth: number = 1
214
251
  ): TReqoreHexColor | undefined => {
215
- if (colors) {
216
- return getColorFromMaybeString(theme, Object.values(colors)[nth - 1]);
252
+ const _colors =
253
+ typeof colors === 'string' ? buildGradientColorsFromString(theme, colors) : colors;
254
+
255
+ if (_colors) {
256
+ return getColorFromMaybeString(theme, Object.values(_colors)[nth - 1]);
217
257
  }
218
258
 
219
259
  return undefined;
@@ -221,12 +261,15 @@ export const getNthGradientColor = (
221
261
 
222
262
  export const getGradientMix = (
223
263
  theme: IReqoreTheme,
224
- colors: Record<number, TReqoreEffectColor>,
264
+ colors: TReqoreEffectGradientColors,
225
265
  fallback?: TReqoreHexColor
226
266
  ): TReqoreHexColor | undefined => {
267
+ const _colors =
268
+ typeof colors === 'string' ? buildGradientColorsFromString(theme, colors) : colors;
269
+
227
270
  if (colors && Object.keys(colors).length === 2) {
228
- const gradientColor1: TReqoreHexColor = getNthGradientColor(theme, colors);
229
- const gradientColor2: TReqoreHexColor = getNthGradientColor(theme, colors, 2);
271
+ const gradientColor1: TReqoreHexColor = getNthGradientColor(theme, _colors);
272
+ const gradientColor2: TReqoreHexColor = getNthGradientColor(theme, _colors, 2);
230
273
 
231
274
  return mix(
232
275
  0.5,
@@ -0,0 +1,49 @@
1
+ import { useContext, useMemo } from 'react';
2
+ import {
3
+ IReqoreEffect,
4
+ TReqoreEffectGradientAnimationTrigger,
5
+ TReqoreHexColor,
6
+ } from '../components/Effect';
7
+ import { IReqoreTheme } from '../constants/theme';
8
+ import ThemeContext from '../context/ThemeContext';
9
+
10
+ export const useReqoreEffect = (
11
+ component: 'buttons',
12
+ theme: IReqoreTheme,
13
+ effect?: IReqoreEffect
14
+ ): IReqoreEffect => {
15
+ let _theme: IReqoreTheme = useContext<IReqoreTheme>(ThemeContext);
16
+
17
+ // Return the effect if the component is not defined in the theme
18
+ if (!theme[component]) {
19
+ return effect;
20
+ }
21
+
22
+ if (theme) {
23
+ // No other way to conditionally use a hook
24
+ _theme = theme;
25
+ }
26
+
27
+ const colors: TReqoreHexColor = useMemo(() => {
28
+ return _theme[component].gradient ? _theme.main : undefined;
29
+ }, [_theme, effect]);
30
+
31
+ const animate: TReqoreEffectGradientAnimationTrigger = useMemo(() => {
32
+ return _theme[component].animate;
33
+ }, [_theme, effect]);
34
+
35
+ const _effect = useMemo(() => {
36
+ return {
37
+ ...effect,
38
+ gradient: {
39
+ colors,
40
+ animate,
41
+
42
+ // If the user has defined a gradient, we don't want to override it
43
+ ...effect?.gradient,
44
+ },
45
+ };
46
+ }, [colors, animate, effect]);
47
+
48
+ return _effect;
49
+ };
@@ -11,13 +11,14 @@ export interface IReqoreCustomTheme extends Partial<Omit<IReqoreTheme, 'main' |
11
11
  color?: TReqoreEffectColor;
12
12
  dim?: boolean;
13
13
  };
14
+ gradient?: boolean;
14
15
  }
15
16
 
16
17
  export const useReqoreTheme = (
17
18
  element?: string,
18
19
  customTheme: IReqoreCustomTheme = {},
19
20
  intent?: TReqoreIntent
20
- ) => {
21
+ ): IReqoreTheme => {
21
22
  const theme: IReqoreTheme = useContext<IReqoreTheme>(ThemeContext);
22
23
 
23
24
  if (!element) {
package/src/index.tsx CHANGED
@@ -54,6 +54,8 @@ export { default as ReqoreTextarea } from './components/Textarea';
54
54
  export { TimeAgo as ReqoreTimeAgo } from './components/TimeAgo';
55
55
  export { ReqoreTree } from './components/Tree';
56
56
  export { Colors as ReqoreColors } from './constants/colors';
57
+ export { ReqoreSizes } from './constants/sizes';
58
+ export { ReqoreIntents } from './constants/theme';
57
59
  export { default as ReqoreNotifications } from './containers/ReqoreProvider';
58
60
  export { default as ReqoreUIProvider } from './containers/UIProvider';
59
61
  export { default as ReqoreContext } from './context/ReqoreContext';
@@ -16,12 +16,12 @@ export default [
16
16
  tags: [
17
17
  {
18
18
  label: 23,
19
- badge: true,
19
+ asBadge: true,
20
20
  },
21
21
  {
22
22
  label: 2022,
23
23
  labelKey: 'Year',
24
- badge: true,
24
+ asBadge: true,
25
25
  onRemoveClick: noop,
26
26
  },
27
27
  ],
@@ -69,12 +69,12 @@ export default [
69
69
  tags: [
70
70
  {
71
71
  label: 23,
72
- badge: true,
72
+ asBadge: true,
73
73
  },
74
74
  {
75
75
  label: 2022,
76
76
  labelKey: 'Year',
77
- badge: true,
77
+ asBadge: true,
78
78
  onRemoveClick: noop(),
79
79
  },
80
80
  ],
@@ -273,12 +273,12 @@ export default [
273
273
  tags: [
274
274
  {
275
275
  label: 23,
276
- badge: true,
276
+ asBadge: true,
277
277
  },
278
278
  {
279
279
  label: 2022,
280
280
  labelKey: 'Year',
281
- badge: true,
281
+ asBadge: true,
282
282
  onRemoveClick: noop,
283
283
  },
284
284
  ],
@@ -16,6 +16,7 @@ export const MultiSelectItems: TReqoreMultiSelectItem[] = [
16
16
  value: 'Existing item 3',
17
17
  icon: 'DropboxFill',
18
18
  intent: 'info',
19
+ rightIcon: 'SunLine',
19
20
  },
20
21
  {
21
22
  label: 'Existing item 4',
@@ -42,6 +43,13 @@ export const MultiSelectItems: TReqoreMultiSelectItem[] = [
42
43
  {
43
44
  value: 'itemWithNoLabel',
44
45
  icon: 'TakeawayLine',
46
+ actions: [
47
+ {
48
+ icon: 'ArrowLeftUpFill',
49
+ onClick: () => console.log('clicked'),
50
+ intent: 'pending',
51
+ },
52
+ ],
45
53
  },
46
54
  {
47
55
  label: 'Other Item 1',
@@ -1,6 +1,7 @@
1
1
  import { ComponentMeta, ComponentStory } from '@storybook/react';
2
2
  import { noop } from 'lodash';
3
3
  import ReqoreButton from '../../components/Button';
4
+ import { IReqoreTheme } from '../../constants/theme';
4
5
  import { ReqoreControlGroup } from '../../index';
5
6
  import { IconArg, SizeArg } from '../utils/args';
6
7
 
@@ -185,6 +186,7 @@ Effect.args = {
185
186
  gradient: {
186
187
  direction: 'to right bottom',
187
188
  colors: { 0: '#33023c', 100: '#0a487b' },
189
+ animate: 'active',
188
190
  },
189
191
  spaced: 2,
190
192
  uppercase: true,
@@ -192,3 +194,15 @@ Effect.args = {
192
194
  textSize: 'small',
193
195
  },
194
196
  };
197
+
198
+ export const GlobalEffect: ComponentStory<
199
+ typeof ReqoreButton & { otherThemeOptions?: IReqoreTheme }
200
+ > = Template.bind({});
201
+ GlobalEffect.args = {
202
+ otherThemeOptions: {
203
+ buttons: {
204
+ gradient: true,
205
+ animate: 'active',
206
+ },
207
+ },
208
+ } as any;
@@ -9,13 +9,48 @@ export default {
9
9
 
10
10
  const Template: ComponentStory<typeof Checkbox> = (args) => {
11
11
  return (
12
- <ReqoreControlGroup>
13
- <ReqoreCheckbox {...args} />
14
- <ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelDetailPosition='left' />
15
- <ReqoreCheckbox {...args} checked tooltip='I am checked' />
16
- <ReqoreCheckbox {...args} disabled />
17
- <ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelPosition='left' />
18
- <ReqoreCheckbox {...args} label='Read Only' labelPosition='left' readOnly />
12
+ <ReqoreControlGroup vertical>
13
+ <ReqoreControlGroup>
14
+ <ReqoreCheckbox {...args} />
15
+ <ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelDetailPosition='left' />
16
+ <ReqoreCheckbox {...args} checked tooltip='I am checked' />
17
+ <ReqoreCheckbox {...args} disabled />
18
+ <ReqoreCheckbox {...args} label='Label' labelDetail='Detail' labelPosition='left' />
19
+ <ReqoreCheckbox {...args} label='Read Only' labelPosition='left' readOnly />
20
+ </ReqoreControlGroup>
21
+ <ReqoreControlGroup>
22
+ <ReqoreCheckbox {...args} intent='info' />
23
+ <ReqoreCheckbox
24
+ {...args}
25
+ label='Label'
26
+ labelDetail='Detail'
27
+ labelDetailPosition='left'
28
+ labelEffect={{ gradient: { colors: { 0: 'danger:lighten:1', 100: '#ff6700' } } }}
29
+ />
30
+ <ReqoreCheckbox
31
+ {...args}
32
+ checked
33
+ tooltip='I am checked'
34
+ effect={{ gradient: { colors: { 0: '#00fafd', 100: '#ff00d0' } } }}
35
+ />
36
+ <ReqoreCheckbox {...args} disabled onText='yes' offText='no' />
37
+ <ReqoreCheckbox
38
+ {...args}
39
+ label='Label'
40
+ labelDetail='Detail'
41
+ labelPosition='left'
42
+ checkedIcon='EmotionHappyFill'
43
+ uncheckedIcon='EmotionSadFill'
44
+ />
45
+ <ReqoreCheckbox
46
+ {...args}
47
+ label='Read Only'
48
+ labelPosition='left'
49
+ readOnly
50
+ checked
51
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
52
+ />
53
+ </ReqoreControlGroup>
19
54
  </ReqoreControlGroup>
20
55
  );
21
56
  };
@@ -15,22 +15,46 @@ export const Icon: Story<IReqoreIconProps> = () => {
15
15
  <ReqoreIcon icon='ArrowLeftCircleFill' intent='success' margin='both' />
16
16
  <ReqoreIcon icon='HotelFill' size='18px' margin='both' />
17
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' />
18
+ <ReqoreIcon
19
+ icon='SignalTowerFill'
20
+ size='20px'
21
+ color='#291133'
22
+ effect={{ sepia: true }}
23
+ margin='both'
24
+ />
25
+ <ReqoreIcon
26
+ icon='SignalTowerFill'
27
+ size='20px'
28
+ color='#0c7052'
29
+ effect={{ blur: 1 }}
30
+ margin='both'
31
+ />
20
32
  <ReqoreIcon
21
33
  icon='SignalTowerFill'
22
34
  size='20px'
23
35
  color='#700c57'
24
- contrast={150}
36
+ effect={{ contrast: 150 }}
37
+ margin='both'
38
+ />
39
+ <ReqoreIcon
40
+ icon='SignalTowerFill'
41
+ size='20px'
42
+ color='#d5be0f'
43
+ effect={{ grayscale: true }}
44
+ margin='both'
45
+ />
46
+ <ReqoreIcon
47
+ icon='SignalTowerFill'
48
+ size='20px'
49
+ color='#0f5bd5'
50
+ effect={{ invert: true }}
25
51
  margin='both'
26
52
  />
27
- <ReqoreIcon icon='SignalTowerFill' size='20px' color='#d5be0f' grayscale margin='both' />
28
- <ReqoreIcon icon='SignalTowerFill' size='20px' color='#0f5bd5' invert margin='both' />
29
53
  <ReqoreIcon
30
54
  icon='SignalTowerFill'
31
55
  size='20px'
32
56
  color='#ffffff'
33
- opacity={0.5}
57
+ effect={{ opacity: 0.5 }}
34
58
  margin='both'
35
59
  />
36
60
  </ReqorePanel>
@@ -50,37 +74,43 @@ export const Icon: Story<IReqoreIconProps> = () => {
50
74
  <ReqoreIcon
51
75
  image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
52
76
  size='30px'
53
- sepia
77
+ effect={{ sepia: true }}
54
78
  margin='both'
55
79
  />
56
80
  <ReqoreIcon
57
81
  image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
58
82
  size='40px'
59
- blur={3}
83
+ effect={{ grayscale: true }}
60
84
  margin='both'
61
85
  />
62
86
  <ReqoreIcon
63
87
  image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
64
88
  size='70px'
65
- contrast={150}
89
+ effect={{ blur: 1 }}
90
+ margin='both'
91
+ />
92
+ <ReqoreIcon
93
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
94
+ size='40px'
95
+ effect={{ contrast: 150 }}
66
96
  margin='both'
67
97
  />
68
98
  <ReqoreIcon
69
99
  image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
70
100
  size='40px'
71
- brightness={150}
101
+ effect={{ invert: true }}
72
102
  margin='both'
73
103
  />
74
104
  <ReqoreIcon
75
105
  image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
76
106
  size='40px'
77
- opacity={0.5}
107
+ effect={{ opacity: 0.5 }}
78
108
  margin='both'
79
109
  />
80
110
  <ReqoreIcon
81
111
  image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
82
112
  size='40px'
83
- invert
113
+ effect={{ saturate: 150 }}
84
114
  margin='both'
85
115
  />
86
116
  </ReqorePanel>
@@ -8,7 +8,7 @@ import {
8
8
  ReqoreMenuItem,
9
9
  ReqorePopover,
10
10
  } from '../../index';
11
- import { argManager, IntentArg } from '../utils/args';
11
+ import { IntentArg, argManager } from '../utils/args';
12
12
 
13
13
  const { createArg } = argManager<IReqoreMenuProps>();
14
14
 
@@ -113,6 +113,7 @@ const Template: Story<IReqoreMenuProps> = (args) => {
113
113
  <ReqoreMenuDivider label='Divider' />
114
114
  <ReqorePopover
115
115
  component={ReqoreMenuItem}
116
+ flat={args.flat}
116
117
  componentProps={
117
118
  {
118
119
  icon: 'EmotionUnhappyLine',
@@ -2,7 +2,8 @@ import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { useState } from 'react';
3
3
  import { IReqoreMultiSelectProps, ReqoreMultiSelect } from '../../components/MultiSelect';
4
4
  import { MultiSelectItems } from '../../mock/multiSelect';
5
- import { argManager, FlatArg, MinimalArg, SizeArg } from '../utils/args';
5
+ import { IReqoreIconName } from '../../types/icons';
6
+ import { FlatArg, IconArg, MinimalArg, SizeArg, argManager } from '../utils/args';
6
7
 
7
8
  const { createArg } = argManager<IReqoreMultiSelectProps>();
8
9
 
@@ -27,6 +28,7 @@ export default {
27
28
  name: 'Can remove items',
28
29
  type: 'boolean',
29
30
  }),
31
+ ...IconArg('onItemClickIcon', 'Clickable item right icon', null),
30
32
  },
31
33
  } as Meta<IReqoreMultiSelectProps>;
32
34
 
@@ -45,7 +47,6 @@ const Template: Story<IReqoreMultiSelectProps> = (args: IReqoreMultiSelectProps)
45
47
  {...args}
46
48
  onValueChange={setSelected}
47
49
  enterKeySelects
48
- onItemClick={(item) => console.log('onItemClick', item)}
49
50
  selectorProps={{
50
51
  listHeight: '600px',
51
52
  ...args.selectorProps,
@@ -76,6 +77,12 @@ Minimal.args = {
76
77
  minimal: true,
77
78
  };
78
79
 
80
+ export const Clickable = Template.bind({});
81
+ Clickable.args = {
82
+ onItemClick: (item) => console.log('onItemClick', item),
83
+ onItemClickIcon: 'EditLine' as IReqoreIconName,
84
+ };
85
+
79
86
  export const WithEffect = Template.bind({});
80
87
  WithEffect.args = {
81
88
  selectedItemEffect: {
@@ -181,7 +181,7 @@ WithEffect.args = {
181
181
  type: 'radial',
182
182
  shape: 'ellipse',
183
183
  colors: { 0: '#670079', 100: '#180222' },
184
- //borderColor: '#fff349',
184
+ animate: 'hover',
185
185
  },
186
186
  },
187
187
  headerEffect: {
@@ -10,7 +10,7 @@ import {
10
10
  ReqorePopover,
11
11
  ReqoreSpacer,
12
12
  } from '../../index';
13
- import { argManager, FlatArg } from '../utils/args';
13
+ import { FlatArg, argManager } from '../utils/args';
14
14
 
15
15
  const { createArg } = argManager<IReqorePopoverProps>();
16
16
 
@@ -178,10 +178,27 @@ const Template: Story<IReqorePopoverProps> = (args: IReqorePopoverProps) => {
178
178
  component={ReqoreButton}
179
179
  isReqoreComponent
180
180
  openOnMount
181
- placement='bottom'
181
+ placement='right'
182
182
  >
183
183
  Auto open popover
184
184
  </ReqorePopover>
185
+ <ReqorePopover
186
+ {...args}
187
+ component={ReqoreButton}
188
+ isReqoreComponent
189
+ openOnMount
190
+ placement='bottom'
191
+ content={
192
+ <ReqorePanel label='This is a test' flat>
193
+ <ReqoreMessage flat>
194
+ In to am attended desirous raptures declared diverted confined at. Collected instantly
195
+ remaining up certainly to necessary as. Over walk dull into
196
+ </ReqoreMessage>
197
+ </ReqorePanel>
198
+ }
199
+ >
200
+ With Custom Content
201
+ </ReqorePopover>
185
202
  </ReqoreControlGroup>
186
203
  );
187
204
  };