@qoretechnologies/reqore 0.28.1 → 0.28.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 (82) hide show
  1. package/__tests__/effect.test.tsx +6 -6
  2. package/dist/components/Button/index.d.ts +3 -1
  3. package/dist/components/Button/index.d.ts.map +1 -1
  4. package/dist/components/Button/index.js +2 -1
  5. package/dist/components/Button/index.js.map +1 -1
  6. package/dist/components/Dropdown/list.d.ts.map +1 -1
  7. package/dist/components/Dropdown/list.js +1 -2
  8. package/dist/components/Dropdown/list.js.map +1 -1
  9. package/dist/components/Effect/index.d.ts +14 -6
  10. package/dist/components/Effect/index.d.ts.map +1 -1
  11. package/dist/components/Effect/index.js +32 -20
  12. package/dist/components/Effect/index.js.map +1 -1
  13. package/dist/components/Header/index.d.ts.map +1 -1
  14. package/dist/components/Header/index.js +1 -2
  15. package/dist/components/Header/index.js.map +1 -1
  16. package/dist/components/Input/index.d.ts +1 -0
  17. package/dist/components/Input/index.d.ts.map +1 -1
  18. package/dist/components/Input/index.js +2 -2
  19. package/dist/components/Input/index.js.map +1 -1
  20. package/dist/components/InternalPopover/index.d.ts.map +1 -1
  21. package/dist/components/InternalPopover/index.js.map +1 -1
  22. package/dist/components/Menu/divider.js +1 -4
  23. package/dist/components/Menu/divider.js.map +1 -1
  24. package/dist/components/Menu/index.d.ts +3 -2
  25. package/dist/components/Menu/index.d.ts.map +1 -1
  26. package/dist/components/Menu/index.js +11 -7
  27. package/dist/components/Menu/index.js.map +1 -1
  28. package/dist/components/Message/index.d.ts.map +1 -1
  29. package/dist/components/Message/index.js +4 -1
  30. package/dist/components/Message/index.js.map +1 -1
  31. package/dist/components/Panel/index.d.ts.map +1 -1
  32. package/dist/components/Table/row.d.ts.map +1 -1
  33. package/dist/components/Table/row.js +4 -2
  34. package/dist/components/Table/row.js.map +1 -1
  35. package/dist/components/Tag/index.d.ts +3 -1
  36. package/dist/components/Tag/index.d.ts.map +1 -1
  37. package/dist/components/Tag/index.js +11 -5
  38. package/dist/components/Tag/index.js.map +1 -1
  39. package/dist/components/Textarea/index.d.ts +1 -0
  40. package/dist/components/Textarea/index.d.ts.map +1 -1
  41. package/dist/components/Textarea/index.js +2 -2
  42. package/dist/components/Textarea/index.js.map +1 -1
  43. package/dist/constants/colors.js +1 -1
  44. package/dist/constants/theme.d.ts +43 -42
  45. package/dist/constants/theme.d.ts.map +1 -1
  46. package/dist/constants/theme.js.map +1 -1
  47. package/dist/containers/UIProvider.d.ts +1 -1
  48. package/dist/containers/UIProvider.d.ts.map +1 -1
  49. package/dist/helpers/colors.d.ts +11 -10
  50. package/dist/helpers/colors.d.ts.map +1 -1
  51. package/dist/helpers/colors.js +34 -10
  52. package/dist/helpers/colors.js.map +1 -1
  53. package/dist/hooks/useTheme.d.ts +9 -1
  54. package/dist/hooks/useTheme.d.ts.map +1 -1
  55. package/dist/hooks/useTheme.js +7 -0
  56. package/dist/hooks/useTheme.js.map +1 -1
  57. package/dist/types/global.d.ts +13 -0
  58. package/dist/types/global.d.ts.map +1 -1
  59. package/package.json +1 -1
  60. package/src/components/Button/index.tsx +13 -5
  61. package/src/components/Dropdown/list.tsx +0 -2
  62. package/src/components/Effect/index.tsx +64 -19
  63. package/src/components/Header/index.tsx +1 -3
  64. package/src/components/Input/index.tsx +3 -0
  65. package/src/components/InternalPopover/index.tsx +2 -1
  66. package/src/components/Menu/divider.tsx +1 -1
  67. package/src/components/Menu/index.tsx +16 -7
  68. package/src/components/Message/index.tsx +4 -1
  69. package/src/components/Panel/index.tsx +1 -1
  70. package/src/components/Table/row.tsx +8 -5
  71. package/src/components/Tag/index.tsx +18 -6
  72. package/src/components/Textarea/index.tsx +3 -0
  73. package/src/constants/colors.ts +1 -1
  74. package/src/constants/theme.ts +44 -42
  75. package/src/containers/UIProvider.tsx +1 -1
  76. package/src/helpers/colors.ts +58 -26
  77. package/src/hooks/useTheme.ts +20 -3
  78. package/src/stories/Button/Button.stories.tsx +1 -1
  79. package/src/stories/Menu/Menu.stories.tsx +50 -3
  80. package/src/stories/Message/Message.stories.tsx +3 -4
  81. package/src/types/global.ts +14 -0
  82. package/tests.json +1 -1
@@ -13,7 +13,12 @@ import {
13
13
  } from '../../constants/sizes';
14
14
  import { IReqoreTheme, TReqoreIntent } from '../../constants/theme';
15
15
  import ThemeContext from '../../context/ThemeContext';
16
- import { changeLightness, getReadableColor, getReadableColorFrom } from '../../helpers/colors';
16
+ import {
17
+ changeLightness,
18
+ getColorFromMaybeString,
19
+ getReadableColor,
20
+ getReadableColorFrom,
21
+ } from '../../helpers/colors';
17
22
  import { useCombinedRefs } from '../../hooks/useCombinedRefs';
18
23
  import { useTooltip } from '../../hooks/useTooltip';
19
24
  import {
@@ -24,7 +29,7 @@ import {
24
29
  IWithReqoreTooltip,
25
30
  } from '../../types/global';
26
31
  import { IReqoreIconName } from '../../types/icons';
27
- import { StyledEffect } from '../Effect';
32
+ import { StyledEffect, TReqoreEffectColor, TReqoreHexColor } from '../Effect';
28
33
  import ReqoreIcon from '../Icon';
29
34
 
30
35
  export interface IReqoreTagAction extends IWithReqoreTooltip, IReqoreDisabled, IReqoreIntent {
@@ -45,7 +50,7 @@ export interface IReqoreTagProps
45
50
  onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
46
51
  icon?: IReqoreIconName;
47
52
  rightIcon?: IReqoreIconName;
48
- color?: string;
53
+ color?: TReqoreEffectColor;
49
54
  actions?: IReqoreTagAction[];
50
55
  width?: string;
51
56
  badge?: boolean;
@@ -57,6 +62,7 @@ export interface IReqoreTagStyle extends IReqoreTagProps {
57
62
  theme: IReqoreTheme;
58
63
  removable?: boolean;
59
64
  interactive?: boolean;
65
+ color?: TReqoreHexColor;
60
66
  }
61
67
 
62
68
  export const StyledTag = styled(StyledEffect)<IReqoreTagStyle>`
@@ -183,14 +189,16 @@ const StyledButtonWrapper = styled.span<IReqoreTagStyle>`
183
189
  align-items: center;
184
190
  transition: all 0.2s ease-out;
185
191
 
186
- ${({ color }) =>
192
+ ${({ color, effect }) =>
187
193
  css`
188
194
  .reqore-icon {
189
195
  transform: scale(0.85);
190
196
  }
191
197
  &:hover {
192
198
  cursor: pointer;
193
- background-color: ${color ? changeLightness(color, 0.09) : rgba('#000000', 0.2)};
199
+ background-color: ${color && !effect?.gradient
200
+ ? changeLightness(color, 0.09)
201
+ : rgba('#000000', 0.2)};
194
202
 
195
203
  .reqore-icon {
196
204
  transform: scale(1);
@@ -228,7 +236,9 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
228
236
  useTooltip(targetRef.current, tooltip);
229
237
 
230
238
  // If color or intent was specified, set the color
231
- let customColor = intent ? theme.intents[intent] : color;
239
+ let customColor: TReqoreHexColor = intent
240
+ ? theme.intents[intent]
241
+ : getColorFromMaybeString(theme, color);
232
242
  customColor = minimal ? `${customColor || '#000000'}40` : customColor;
233
243
 
234
244
  return (
@@ -301,6 +311,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
301
311
  color: customColor,
302
312
  className: 'reqore-tag-action',
303
313
  onClick: action.onClick,
314
+ effect: rest.effect,
304
315
  }}
305
316
  {...(action.tooltip
306
317
  ? typeof action.tooltip === 'string'
@@ -322,6 +333,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
322
333
  color: customColor,
323
334
  className: 'reqore-tag-remove',
324
335
  onClick: onRemoveClick,
336
+ effect: rest.effect,
325
337
  }}
326
338
  noWrapper
327
339
  content='Remove'
@@ -41,6 +41,7 @@ export interface IReqoreTextareaProps
41
41
  rounded?: boolean;
42
42
  flat?: boolean;
43
43
  onClearClick?: () => any;
44
+ wrapperStyle?: React.CSSProperties;
44
45
  }
45
46
 
46
47
  export interface IReqoreTextareaStyle extends IReqoreTextareaProps {
@@ -132,6 +133,7 @@ const ReqoreInput = forwardRef<HTMLTextAreaElement, IReqoreTextareaProps>(
132
133
  customTheme,
133
134
  intent,
134
135
  rounded = true,
136
+ wrapperStyle,
135
137
  ...rest
136
138
  }: IReqoreTextareaProps,
137
139
  ref: any
@@ -149,6 +151,7 @@ const ReqoreInput = forwardRef<HTMLTextAreaElement, IReqoreTextareaProps>(
149
151
  fluid={fluid}
150
152
  _size={size}
151
153
  theme={theme}
154
+ style={wrapperStyle}
152
155
  >
153
156
  <StyledTextarea
154
157
  {...rest}
@@ -1,5 +1,5 @@
1
1
  export const Colors = {
2
- DARK: '#222222',
2
+ DARK: '#000000',
3
3
  LIGHT: '#ffffff',
4
4
  BLUE: '#0E5A8A',
5
5
  GREEN: '#0A6640',
@@ -1,64 +1,66 @@
1
+ import { TReqoreEffectColor, TReqoreHexColor } from '../components/Effect';
2
+
1
3
  export interface IReqoreSidebarTheme {
2
- main?: string;
3
- color?: string;
4
- border?: string;
4
+ main?: TReqoreHexColor;
5
+ color?: TReqoreHexColor;
6
+ border?: TReqoreHexColor;
5
7
  item?: {
6
- color?: string;
7
- background?: string;
8
- border?: string;
9
- hoverColor?: string;
10
- hoverBackground?: string;
11
- activeColor?: string;
12
- activeBackground?: string;
8
+ color?: TReqoreHexColor;
9
+ background?: TReqoreHexColor;
10
+ border?: TReqoreHexColor;
11
+ hoverColor?: TReqoreHexColor;
12
+ hoverBackground?: TReqoreHexColor;
13
+ activeColor?: TReqoreHexColor;
14
+ activeBackground?: TReqoreHexColor;
13
15
  };
14
16
  subItem?: {
15
- color?: string;
16
- border?: string;
17
- background?: string;
18
- hoverColor?: string;
19
- hoverBackground?: string;
20
- activeColor?: string;
21
- activeBackground?: string;
17
+ color?: TReqoreHexColor;
18
+ border?: TReqoreHexColor;
19
+ background?: TReqoreHexColor;
20
+ hoverColor?: TReqoreHexColor;
21
+ hoverBackground?: TReqoreHexColor;
22
+ activeColor?: TReqoreHexColor;
23
+ activeBackground?: TReqoreHexColor;
22
24
  };
23
25
  icon?: {
24
- color?: string;
25
- hoverColor?: string;
26
- activeColor?: string;
26
+ color?: TReqoreHexColor;
27
+ hoverColor?: TReqoreHexColor;
28
+ activeColor?: TReqoreHexColor;
27
29
  };
28
30
  section?: {
29
- background?: string;
31
+ background?: TReqoreHexColor;
30
32
  };
31
33
  }
32
34
 
33
35
  export interface IReqoreBreadcrumbsTheme {
34
- main?: string;
36
+ main?: TReqoreHexColor;
35
37
  item?: {
36
- color?: string;
37
- hoverColor?: string;
38
- activeColor?: string;
38
+ color?: TReqoreHexColor;
39
+ hoverColor?: TReqoreHexColor;
40
+ activeColor?: TReqoreHexColor;
39
41
  };
40
42
  }
41
43
 
42
44
  export interface IReqoreNavbarTheme {
43
- main?: string;
44
- color?: string;
45
- border?: string;
46
- background?: string;
47
- hoverColor?: string;
45
+ main?: TReqoreHexColor;
46
+ color?: TReqoreHexColor;
47
+ border?: TReqoreHexColor;
48
+ background?: TReqoreHexColor;
49
+ hoverColor?: TReqoreHexColor;
48
50
  }
49
51
 
50
52
  export interface IReqoreTheme {
51
- main: string;
52
- originalMain?: string;
53
+ main: TReqoreHexColor;
54
+ originalMain?: TReqoreHexColor;
53
55
  text?: {
54
- color?: string;
56
+ color?: TReqoreHexColor;
55
57
  dim?: boolean;
56
58
  };
57
59
  intents: IReqoreIntents;
58
60
  sidebar?: IReqoreSidebarTheme;
59
61
  notifications: IReqoreIntents;
60
62
  popover?: {
61
- main: string;
63
+ main: TReqoreHexColor;
62
64
  };
63
65
  header?: IReqoreNavbarTheme;
64
66
  footer?: IReqoreNavbarTheme;
@@ -66,20 +68,20 @@ export interface IReqoreTheme {
66
68
  }
67
69
 
68
70
  export interface IReqoreCustomTheme {
69
- main?: string;
71
+ main?: TReqoreEffectColor;
70
72
  text?: {
71
- color?: string;
73
+ color?: TReqoreEffectColor;
72
74
  dim?: boolean;
73
75
  };
74
76
  }
75
77
 
76
78
  export interface IReqoreIntents {
77
- info?: string;
78
- success?: string;
79
- pending?: string;
80
- warning?: string;
81
- danger?: string;
82
- muted?: string;
79
+ info?: TReqoreHexColor;
80
+ success?: TReqoreHexColor;
81
+ pending?: TReqoreHexColor;
82
+ warning?: TReqoreHexColor;
83
+ danger?: TReqoreHexColor;
84
+ muted?: TReqoreHexColor;
83
85
  }
84
86
 
85
87
  export type TReqoreIntent = 'info' | 'success' | 'pending' | 'warning' | 'danger' | 'muted';
@@ -20,7 +20,7 @@ export interface IReqoreOptions {
20
20
  };
21
21
  }
22
22
  export interface IReqoreUIProviderProps {
23
- children: any;
23
+ children?: any;
24
24
  theme?: Partial<IReqoreTheme>;
25
25
  options?: IReqoreOptions;
26
26
  }
@@ -1,15 +1,16 @@
1
1
  import { cloneDeep, merge } from 'lodash';
2
2
  import { darken, lighten, readableColor } from 'polished';
3
+ import { TReqoreEffectColor, TReqoreEffectColorList, TReqoreHexColor } from '../components/Effect';
3
4
  import { Colors } from '../constants/colors';
4
5
  import { DEFAULT_INTENTS, IReqoreTheme, TReqoreIntent } from '../constants/theme';
5
6
 
6
7
  export const getReadableColor: (
7
8
  theme: Partial<IReqoreTheme>,
8
- ifLight?: string,
9
- ifDark?: string,
9
+ ifLight?: TReqoreHexColor,
10
+ ifDark?: TReqoreHexColor,
10
11
  dimmed?: boolean,
11
- fallback?: string
12
- ) => string = (theme, ifLight, ifDark, dimmed, fallback) => {
12
+ fallback?: TReqoreHexColor
13
+ ) => TReqoreHexColor = (theme, ifLight, ifDark, dimmed, fallback) => {
13
14
  if (theme.text?.color) {
14
15
  return theme.text.dim
15
16
  ? dimmed
@@ -25,15 +26,15 @@ export const getReadableColor: (
25
26
  };
26
27
 
27
28
  export const getReadableColorFrom = (
28
- from: string,
29
+ from: TReqoreHexColor,
29
30
  dim?: boolean,
30
- ifLight?: string,
31
- ifDark?: string
32
- ) => {
31
+ ifLight?: TReqoreHexColor,
32
+ ifDark?: TReqoreHexColor
33
+ ): TReqoreHexColor => {
33
34
  const returnIfLight = ifLight || lighten(dim ? 0.05 : 0, Colors.DARK);
34
35
  const returnIfDark = ifDark || darken(dim ? 0.05 : 0, Colors.LIGHT);
35
36
 
36
- return readableColor(from, returnIfLight, returnIfDark, false);
37
+ return readableColor(from, returnIfLight, returnIfDark, false) as TReqoreHexColor;
37
38
  };
38
39
 
39
40
  export const percentToHexAlpha = (p: number) => {
@@ -44,29 +45,33 @@ export const percentToHexAlpha = (p: number) => {
44
45
  return hexValue.padStart(2, '0').toUpperCase(); // format with leading 0 and upper case characters
45
46
  };
46
47
 
47
- export const shouldDarken = (mainColor: string) => {
48
+ export const shouldDarken = (mainColor: TReqoreHexColor): boolean => {
48
49
  const contrast = getColorByBgColor(mainColor);
49
50
 
50
51
  return contrast === '#000000';
51
52
  };
52
53
 
53
- export const getMainColor: (theme: IReqoreTheme, component: string) => string = (
54
+ export const getMainColor: (theme: IReqoreTheme, component: string) => TReqoreHexColor = (
54
55
  theme,
55
56
  component
56
57
  ) => theme[component]?.main || theme.main;
57
58
 
58
59
  //export const changeBasedOnContrast = (color: string, lightness?: number): string =>
59
60
 
60
- export const changeLightness = (color: string, lightness?: number): string => {
61
+ export const changeLightness = (color: TReqoreHexColor, lightness?: number): TReqoreHexColor => {
61
62
  return lightness
62
63
  ? shouldDarken(color)
63
- ? darken(lightness, color)
64
- : lighten(lightness, color)
64
+ ? (darken(lightness, color) as TReqoreHexColor)
65
+ : (lighten(lightness, color) as TReqoreHexColor)
65
66
  : color;
66
67
  };
67
68
 
68
- export const changeDarkness = (color: string, lightness?: number): string =>
69
- lightness ? (shouldDarken(color) ? lighten(lightness, color) : darken(lightness, color)) : color;
69
+ export const changeDarkness = (color: TReqoreHexColor, lightness?: number): TReqoreHexColor =>
70
+ lightness
71
+ ? shouldDarken(color)
72
+ ? (lighten(lightness, color) as TReqoreHexColor)
73
+ : (darken(lightness, color) as TReqoreHexColor)
74
+ : color;
70
75
 
71
76
  export const getColorByBgColor = (bgColor) => {
72
77
  if (!bgColor) {
@@ -76,7 +81,7 @@ export const getColorByBgColor = (bgColor) => {
76
81
  };
77
82
 
78
83
  export const isValidSixCharHex = (hex: string): boolean => {
79
- return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(hex);
84
+ return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$/.test(hex);
80
85
  };
81
86
 
82
87
  export const buildTheme = (theme: IReqoreTheme): IReqoreTheme => {
@@ -142,20 +147,47 @@ export const getNotificationIntent = (theme: IReqoreTheme, intent?: TReqoreInten
142
147
  return changeLightness(theme.main, 0.1);
143
148
  };
144
149
 
145
- export const getMainBackgroundColor = (theme: IReqoreTheme): string =>
150
+ export const getMainBackgroundColor = (theme: IReqoreTheme): TReqoreHexColor =>
146
151
  changeLightness(theme.main, 0.02);
147
152
 
148
- export const getColorFromMaybeIntentOrString = (
153
+ export const getColorFromMaybeString = (
149
154
  theme: IReqoreTheme,
150
- intent: TReqoreIntent | string
151
- ): string => {
152
- if (theme.intents[intent]) {
153
- return theme.intents[intent];
155
+ color: TReqoreEffectColor
156
+ ): TReqoreHexColor => {
157
+ if (!color) {
158
+ return undefined;
159
+ }
160
+
161
+ const [providedColor, shading, multiplier = 1]: TReqoreEffectColorList = color.split(
162
+ ':'
163
+ ) as TReqoreEffectColorList;
164
+
165
+ if (providedColor === 'transparent') {
166
+ return '#00000000';
167
+ }
168
+
169
+ // First we need to get the actual color
170
+ let _color: TReqoreHexColor;
171
+
172
+ if (!providedColor || providedColor === 'main') {
173
+ _color = theme.main;
174
+ }
175
+
176
+ if (theme.intents[providedColor]) {
177
+ _color = theme.intents[providedColor];
178
+ }
179
+
180
+ if (isValidSixCharHex(color)) {
181
+ _color = providedColor as TReqoreHexColor;
154
182
  }
155
183
 
156
- if (isValidSixCharHex(intent)) {
157
- return intent;
184
+ if (shading) {
185
+ if (shading === 'lighten') {
186
+ _color = lighten(0.1 * multiplier, _color) as TReqoreHexColor;
187
+ } else if (shading === 'darken') {
188
+ _color = darken(0.1 * multiplier, _color) as TReqoreHexColor;
189
+ }
158
190
  }
159
191
 
160
- return theme.main;
192
+ return _color;
161
193
  };
@@ -1,16 +1,33 @@
1
1
  import { cloneDeep } from 'lodash';
2
2
  import { useContext } from 'react';
3
+ import { TReqoreEffectColor } from '../components/Effect';
3
4
  import { IReqoreTheme, TReqoreIntent } from '../constants/theme';
4
5
  import ThemeContext from '../context/ThemeContext';
5
- import { mergeThemes } from '../helpers/colors';
6
+ import { getColorFromMaybeString, mergeThemes } from '../helpers/colors';
7
+
8
+ export interface IReqoreCustomTheme extends Partial<Omit<IReqoreTheme, 'main' | 'text'>> {
9
+ main?: TReqoreEffectColor;
10
+ text?: {
11
+ color?: TReqoreEffectColor;
12
+ dim?: boolean;
13
+ };
14
+ }
6
15
 
7
16
  export const useReqoreTheme = (
8
17
  element: string,
9
- customTheme: Partial<IReqoreTheme> = {},
18
+ customTheme: IReqoreCustomTheme = {},
10
19
  intent?: TReqoreIntent
11
20
  ) => {
12
21
  const theme: IReqoreTheme = useContext<IReqoreTheme>(ThemeContext);
13
- let _customTheme: Partial<IReqoreTheme> = cloneDeep(customTheme);
22
+ let _customTheme: IReqoreCustomTheme = cloneDeep(customTheme);
23
+
24
+ if (_customTheme.main) {
25
+ _customTheme.main = getColorFromMaybeString(theme, customTheme.main);
26
+ }
27
+
28
+ if (_customTheme.text?.color) {
29
+ _customTheme.text.color = getColorFromMaybeString(theme, customTheme.text.color);
30
+ }
14
31
 
15
32
  if (element === 'main' && intent) {
16
33
  _customTheme.main = theme.intents[intent];
@@ -110,7 +110,7 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
110
110
  {
111
111
  effect: {
112
112
  gradient: {
113
- colors: { 0: '#00fafd', 100: '#eb0e8c' },
113
+ colors: { 0: 'danger', 100: 'danger:darken' },
114
114
  direction: 'to right bottom',
115
115
  },
116
116
  },
@@ -1,8 +1,14 @@
1
1
  import { Meta, Story } from '@storybook/react/types-6-0';
2
2
  import { IReqoreMenuProps } from '../../components/Menu';
3
3
  import { IReqoreMenuItemProps } from '../../components/Menu/item';
4
- import { ReqoreMenu, ReqoreMenuDivider, ReqoreMenuItem, ReqorePopover } from '../../index';
5
- import { IntentArg, argManager } from '../utils/args';
4
+ import {
5
+ ReqoreInput,
6
+ ReqoreMenu,
7
+ ReqoreMenuDivider,
8
+ ReqoreMenuItem,
9
+ ReqorePopover,
10
+ } from '../../index';
11
+ import { argManager, IntentArg } from '../utils/args';
6
12
 
7
13
  const { createArg } = argManager<IReqoreMenuProps>();
8
14
 
@@ -11,7 +17,7 @@ export default {
11
17
  argTypes: {
12
18
  ...createArg('width', {
13
19
  type: 'string',
14
- defaultValue: '160px',
20
+ defaultValue: '210px',
15
21
  name: 'Width',
16
22
  }),
17
23
  ...createArg('maxHeight', {
@@ -35,6 +41,38 @@ export default {
35
41
  },
36
42
  description: 'Whether to wrap text or not',
37
43
  }),
44
+ ...createArg('minimal', {
45
+ defaultValue: false,
46
+ name: 'Minimal',
47
+ control: {
48
+ type: 'boolean',
49
+ },
50
+ description: 'Whether to use minimal style or not',
51
+ }),
52
+ ...createArg('flat', {
53
+ defaultValue: true,
54
+ name: 'Flat',
55
+ control: {
56
+ type: 'boolean',
57
+ },
58
+ description: 'Whether to use flat style or not',
59
+ }),
60
+ ...createArg('rounded', {
61
+ defaultValue: true,
62
+ name: 'Rounded',
63
+ control: {
64
+ type: 'boolean',
65
+ },
66
+ description: 'Whether to use rounded style or not',
67
+ }),
68
+ ...createArg('transparent', {
69
+ defaultValue: false,
70
+ name: 'Transparent',
71
+ control: {
72
+ type: 'boolean',
73
+ },
74
+ description: 'Whether to use transparent style or not',
75
+ }),
38
76
  ...IntentArg,
39
77
  },
40
78
  } as Meta<IReqoreMenuProps>;
@@ -42,6 +80,7 @@ export default {
42
80
  const Template: Story<IReqoreMenuProps> = (args) => {
43
81
  return (
44
82
  <ReqoreMenu {...args}>
83
+ <ReqoreInput placeholder='Custom component' icon='Search2Fill' flat={false} />
45
84
  <ReqoreMenuItem icon='Save3Fill' intent='success' selected>
46
85
  Selected success
47
86
  </ReqoreMenuItem>
@@ -143,7 +182,15 @@ export const WrappedText = Template.bind({});
143
182
  WrappedText.args = {
144
183
  wrapText: true,
145
184
  };
185
+ export const Minimal = Template.bind({});
186
+ Minimal.args = {
187
+ minimal: true,
188
+ };
146
189
  export const NotFlat = Template.bind({});
147
190
  NotFlat.args = {
148
191
  flat: false,
149
192
  };
193
+ export const Transparent = Template.bind({});
194
+ Transparent.args = {
195
+ transparent: true,
196
+ };
@@ -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 { FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
4
+ import { argManager, FlatArg, IntentArg, SizeArg } from '../utils/args';
5
5
 
6
6
  const { createArg } = argManager<IReqoreMessageProps>();
7
7
 
@@ -64,10 +64,9 @@ Effect.args = {
64
64
  effect: {
65
65
  gradient: {
66
66
  colors: {
67
- 0: '#00e3e8',
68
- 100: '#eb0e8c',
67
+ 0: '#eb0e8c',
68
+ 100: 'danger:darken:2',
69
69
  },
70
70
  },
71
- color: '#000000',
72
71
  },
73
72
  };
@@ -140,6 +140,20 @@ export interface IWithReqoreMinimal {
140
140
  minimal?: boolean;
141
141
  }
142
142
 
143
+ export interface IWithReqoreTransparent {
144
+ /**
145
+ * If true, the component will be transparent
146
+ * @default false
147
+ * @type boolean
148
+ * @example
149
+ * <ReqoreButton transparent />
150
+ * <ReqoreButton transparent={true} />
151
+ * <ReqoreButton transparent={false} />
152
+ *
153
+ */
154
+ transparent?: boolean;
155
+ }
156
+
143
157
  export interface IWithReqoreEffect {
144
158
  /**
145
159
  * If true, the component will have an effect