@qoretechnologies/reqore 0.28.5 → 0.28.6

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 (79) hide show
  1. package/dist/components/Button/index.js +3 -3
  2. package/dist/components/Button/index.js.map +1 -1
  3. package/dist/components/Checkbox/index.d.ts +3 -2
  4. package/dist/components/Checkbox/index.d.ts.map +1 -1
  5. package/dist/components/Checkbox/index.js +28 -24
  6. package/dist/components/Checkbox/index.js.map +1 -1
  7. package/dist/components/ControlGroup/index.d.ts +2 -1
  8. package/dist/components/ControlGroup/index.d.ts.map +1 -1
  9. package/dist/components/ControlGroup/index.js +8 -8
  10. package/dist/components/ControlGroup/index.js.map +1 -1
  11. package/dist/components/Dropdown/index.d.ts +1 -1
  12. package/dist/components/Dropdown/index.d.ts.map +1 -1
  13. package/dist/components/Dropdown/index.js +2 -2
  14. package/dist/components/Dropdown/index.js.map +1 -1
  15. package/dist/components/Icon/index.d.ts +12 -2
  16. package/dist/components/Icon/index.d.ts.map +1 -1
  17. package/dist/components/Icon/index.js +35 -4
  18. package/dist/components/Icon/index.js.map +1 -1
  19. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  20. package/dist/components/InternalPopover/index.js +28 -34
  21. package/dist/components/InternalPopover/index.js.map +1 -1
  22. package/dist/components/Menu/divider.d.ts +2 -0
  23. package/dist/components/Menu/divider.d.ts.map +1 -1
  24. package/dist/components/Menu/divider.js +40 -7
  25. package/dist/components/Menu/divider.js.map +1 -1
  26. package/dist/components/Message/index.d.ts +3 -2
  27. package/dist/components/Message/index.d.ts.map +1 -1
  28. package/dist/components/Message/index.js.map +1 -1
  29. package/dist/components/Notifications/notification.d.ts +3 -3
  30. package/dist/components/Notifications/notification.d.ts.map +1 -1
  31. package/dist/components/Notifications/notification.js +11 -8
  32. package/dist/components/Notifications/notification.js.map +1 -1
  33. package/dist/components/Panel/index.d.ts +1 -0
  34. package/dist/components/Panel/index.d.ts.map +1 -1
  35. package/dist/components/Panel/index.js +6 -6
  36. package/dist/components/Panel/index.js.map +1 -1
  37. package/dist/components/RadioGroup/index.d.ts +8 -6
  38. package/dist/components/RadioGroup/index.d.ts.map +1 -1
  39. package/dist/components/RadioGroup/index.js +6 -12
  40. package/dist/components/RadioGroup/index.js.map +1 -1
  41. package/dist/components/Tag/group.d.ts +2 -1
  42. package/dist/components/Tag/group.d.ts.map +1 -1
  43. package/dist/components/Tag/group.js +7 -3
  44. package/dist/components/Tag/group.js.map +1 -1
  45. package/dist/constants/sizes.d.ts +7 -0
  46. package/dist/constants/sizes.d.ts.map +1 -1
  47. package/dist/constants/sizes.js +8 -1
  48. package/dist/constants/sizes.js.map +1 -1
  49. package/dist/helpers/colors.d.ts.map +1 -1
  50. package/dist/helpers/colors.js +1 -2
  51. package/dist/helpers/colors.js.map +1 -1
  52. package/dist/hooks/usePopover.d.ts +6 -2
  53. package/dist/hooks/usePopover.d.ts.map +1 -1
  54. package/dist/hooks/usePopover.js.map +1 -1
  55. package/package.json +1 -1
  56. package/src/components/Button/index.tsx +3 -3
  57. package/src/components/Checkbox/index.tsx +58 -30
  58. package/src/components/ControlGroup/index.tsx +10 -4
  59. package/src/components/Dropdown/index.tsx +2 -2
  60. package/src/components/Icon/index.tsx +75 -1
  61. package/src/components/InternalPopover/index.tsx +105 -47
  62. package/src/components/Menu/divider.tsx +20 -3
  63. package/src/components/Message/index.tsx +3 -0
  64. package/src/components/Notifications/notification.tsx +23 -13
  65. package/src/components/Panel/index.tsx +14 -10
  66. package/src/components/RadioGroup/index.tsx +36 -27
  67. package/src/components/Tag/group.tsx +5 -2
  68. package/src/constants/sizes.ts +8 -0
  69. package/src/helpers/colors.ts +2 -4
  70. package/src/hooks/usePopover.tsx +15 -2
  71. package/src/stories/ControlGroup/ControlGroup.stories.tsx +7 -1
  72. package/src/stories/Icon/Icon.stories.tsx +99 -22
  73. package/src/stories/Message/Message.stories.tsx +7 -1
  74. package/src/stories/Panel/Panel.stories.tsx +3 -3
  75. package/src/stories/Popover/Popover.stories.tsx +91 -12
  76. package/src/stories/RadioGroup/RadioGroup.stories.tsx +29 -2
  77. package/src/stories/Tag/Tag.stories.tsx +4 -2
  78. package/src/stories/utils/args.ts +13 -0
  79. package/tests.json +1 -1
@@ -1,15 +1,18 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import { ReqoreCheckbox } from "../..";
4
- import { TSizes } from "../../constants/sizes";
5
- import { IReqoreCheckboxProps } from "../Checkbox";
1
+ import React from 'react';
2
+ import { ReqoreCheckbox, ReqoreControlGroup } from '../..';
3
+ import { TSizes } from '../../constants/sizes';
4
+ import { IReqoreCheckboxProps } from '../Checkbox';
5
+ import { IReqoreControlGroupProps } from '../ControlGroup';
6
+ import ReqoreMenuDivider from '../Menu/divider';
6
7
 
7
8
  export interface IReqoreRadioGroupItem extends IReqoreCheckboxProps {
8
- value: string;
9
+ value?: string;
10
+ divider?: boolean;
9
11
  }
10
12
 
11
13
  export interface IReqoreRadioGroupProps
12
- extends React.HTMLAttributes<HTMLDivElement> {
14
+ extends Omit<IReqoreControlGroupProps, 'children'>,
15
+ Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
13
16
  items: IReqoreRadioGroupItem[];
14
17
  selected?: string;
15
18
  onSelectClick?: (value: string) => void;
@@ -18,11 +21,6 @@ export interface IReqoreRadioGroupProps
18
21
  asSwitch?: boolean;
19
22
  }
20
23
 
21
- const StyledRadioGroup = styled.div`
22
- display: flex;
23
- flex-flow: column;
24
- `;
25
-
26
24
  const ReqoreRadioGroup = ({
27
25
  items = [],
28
26
  selected,
@@ -30,23 +28,34 @@ const ReqoreRadioGroup = ({
30
28
  size,
31
29
  disabled,
32
30
  asSwitch,
31
+ vertical = true,
33
32
  ...rest
34
33
  }: IReqoreRadioGroupProps) => (
35
- <StyledRadioGroup {...rest}>
36
- {items.map(({ value, ...itemRest }) => (
37
- <ReqoreCheckbox
38
- asSwitch={asSwitch}
39
- {...itemRest}
40
- key={value}
41
- checked={value === selected}
42
- size={size || itemRest.size}
43
- disabled={disabled || itemRest.disabled}
44
- onClick={() => {
45
- onSelectClick(value);
46
- }}
47
- />
48
- ))}
49
- </StyledRadioGroup>
34
+ <ReqoreControlGroup {...rest} vertical={vertical}>
35
+ {items.map(({ value, divider, ...itemRest }) =>
36
+ divider ? (
37
+ <ReqoreMenuDivider
38
+ {...itemRest}
39
+ size={size || itemRest.size}
40
+ effect={{ ...itemRest.effect, textAlign: 'left' }}
41
+ margin='left'
42
+ label={vertical ? itemRest.label : undefined}
43
+ />
44
+ ) : (
45
+ <ReqoreCheckbox
46
+ asSwitch={asSwitch}
47
+ {...itemRest}
48
+ key={value}
49
+ checked={value === selected}
50
+ size={size || itemRest.size}
51
+ disabled={disabled || itemRest.disabled}
52
+ onClick={() => {
53
+ onSelectClick(value);
54
+ }}
55
+ />
56
+ )
57
+ )}
58
+ </ReqoreControlGroup>
50
59
  );
51
60
 
52
61
  export default ReqoreRadioGroup;
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { StyledTag } from '.';
4
- import { TSizes } from '../../constants/sizes';
4
+ import { GAP_FROM_SIZE, TSizes } from '../../constants/sizes';
5
5
 
6
6
  export interface IReqoreTagGroup extends React.HTMLAttributes<HTMLDivElement> {
7
7
  children: any;
8
8
  size?: TSizes;
9
+ gapSize?: TSizes;
9
10
  columns?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
10
11
  hasBottomMargin?: boolean;
11
12
  }
@@ -15,7 +16,7 @@ const StyledTagGroup = styled.div`
15
16
 
16
17
  ${StyledTag} {
17
18
  &:not(:last-child) {
18
- margin-right: 5px;
19
+ margin-right: ${({ gapSize }: IReqoreTagGroup) => `${GAP_FROM_SIZE[gapSize]}px`};
19
20
  }
20
21
 
21
22
  margin-bottom: ${({ hasBottomMargin }) => (hasBottomMargin ? '5px' : '0px')};
@@ -25,6 +26,7 @@ const StyledTagGroup = styled.div`
25
26
  const ReqoreTagGroup = ({
26
27
  children,
27
28
  size,
29
+ gapSize = 'normal',
28
30
  className,
29
31
  columns,
30
32
  hasBottomMargin = true,
@@ -32,6 +34,7 @@ const ReqoreTagGroup = ({
32
34
  }: IReqoreTagGroup) => (
33
35
  <StyledTagGroup
34
36
  {...rest}
37
+ gapSize={gapSize}
35
38
  hasBottomMargin={hasBottomMargin}
36
39
  className={`${className || ''} reqore-tag-group`}
37
40
  >
@@ -107,6 +107,14 @@ export const RADIUS_FROM_SIZE = {
107
107
  huge: 9,
108
108
  };
109
109
 
110
+ export const GAP_FROM_SIZE = {
111
+ tiny: 1,
112
+ small: 3,
113
+ normal: 5,
114
+ big: 18,
115
+ huge: 30,
116
+ };
117
+
110
118
  export const ICON_FROM_HEADER_SIZE = {
111
119
  1: 23,
112
120
  2: 20,
@@ -1,5 +1,5 @@
1
1
  import { cloneDeep, merge } from 'lodash';
2
- import { darken, lighten, readableColor } from 'polished';
2
+ import { darken, getLuminance, lighten, readableColor } from 'polished';
3
3
  import { TReqoreEffectColor, TReqoreEffectColorList, TReqoreHexColor } from '../components/Effect';
4
4
  import { Colors } from '../constants/colors';
5
5
  import { DEFAULT_INTENTS, IReqoreTheme, TReqoreIntent } from '../constants/theme';
@@ -46,9 +46,7 @@ export const percentToHexAlpha = (p: number) => {
46
46
  };
47
47
 
48
48
  export const shouldDarken = (mainColor: TReqoreHexColor): boolean => {
49
- const contrast = getColorByBgColor(mainColor);
50
-
51
- return contrast === '#000000';
49
+ return getLuminance(mainColor) > 0.2;
52
50
  };
53
51
 
54
52
  export const getMainColor: (theme: IReqoreTheme, component: string) => TReqoreHexColor = (
@@ -3,6 +3,13 @@ import { MutableRefObject, useContext, useEffect, useMemo, useRef } from 'react'
3
3
  import { useUnmount, useUpdateEffect } from 'react-use';
4
4
  import shortid from 'shortid';
5
5
  import PopoverContext from '../context/PopoverContext';
6
+ import {
7
+ IReqoreIntent,
8
+ IWithReqoreEffect,
9
+ IWithReqoreFlat,
10
+ IWithReqoreMinimal,
11
+ } from '../types/global';
12
+ import { IReqoreIconName } from '../types/icons';
6
13
 
7
14
  const startEvents = {
8
15
  hover: 'mouseenter',
@@ -18,7 +25,11 @@ const endEvents = {
18
25
  focus: null,
19
26
  };
20
27
 
21
- export interface IPopover {
28
+ export interface IPopover
29
+ extends IReqoreIntent,
30
+ IWithReqoreMinimal,
31
+ IWithReqoreEffect,
32
+ IWithReqoreFlat {
22
33
  content?: JSX.Element | string | undefined;
23
34
  handler?: 'hover' | 'click' | 'focus' | 'hoverStay';
24
35
  placement?: Placement;
@@ -30,9 +41,11 @@ export interface IPopover {
30
41
  closeOnAnyClick?: boolean;
31
42
  delay?: number;
32
43
  blur?: number;
33
- opaque?: boolean;
44
+ transparent?: boolean;
34
45
  maxWidth?: string;
35
46
  maxHeight?: string;
47
+ icon?: IReqoreIconName;
48
+ title?: string;
36
49
  }
37
50
 
38
51
  export interface IPopoverOptions extends IPopover {
@@ -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 { GapSizeArg, MinimalArg, SizeArg, argManager } 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',
@@ -68,3 +69,8 @@ export const Stacked = Template.bind({});
68
69
  Stacked.args = {
69
70
  stack: true,
70
71
  };
72
+
73
+ export const BigGapSize = Template.bind({});
74
+ BigGapSize.args = {
75
+ gapSize: 'big',
76
+ };
@@ -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
  };
@@ -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: {
@@ -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,
@@ -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,7 +58,7 @@ 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
63
  <ReqoreTag {...args} actions={null} onRemoveClick={null} rightIcon={null} label='Basic Tag' />
64
64
  <ReqoreTag
@@ -185,6 +185,8 @@ const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }
185
185
  };
186
186
 
187
187
  export const Basic = Template.bind({});
188
+ export const BigGapSize = Template.bind({});
189
+ BigGapSize.args = { gapSize: 'big' };
188
190
  export const Badge = Template.bind({});
189
191
  Badge.args = { badge: true };
190
192
 
@@ -110,6 +110,19 @@ export const SizeArg = {
110
110
  }),
111
111
  };
112
112
 
113
+ export const GapSizeArg = {
114
+ ...argManager<any>().createArg('gapSize', {
115
+ control: 'select',
116
+ description: 'The gap size of the elements',
117
+ options: ['tiny', 'small', 'normal', 'big', 'huge'] as TSizes[],
118
+ name: 'Gap Size',
119
+ defaultValue: 'normal' as TSizes,
120
+ table: {
121
+ defaultValue: { summary: 'normal' },
122
+ },
123
+ }),
124
+ };
125
+
113
126
  export const IntentArg = {
114
127
  ...argManager<any>().createArg('intent', {
115
128
  control: 'select',