@qoretechnologies/reqore 0.40.1 → 0.40.3

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.
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components';
3
3
  import { RADIUS_FROM_SIZE } from '../../constants/sizes';
4
4
  import { IReqoreCustomTheme, IReqoreTheme, TReqoreIntent } from '../../constants/theme';
5
5
  import ReqoreThemeProvider from '../../containers/ThemeProvider';
6
- import { changeDarkness, changeLightness, getMainBackgroundColor } from '../../helpers/colors';
6
+ import { changeDarkness, getMainBackgroundColor } from '../../helpers/colors';
7
7
  import { useCloneThroughFragments } from '../../hooks/useCloneThroughFragments';
8
8
  import { useReqoreTheme } from '../../hooks/useTheme';
9
9
  import { IReqoreComponent, IWithReqoreMinimal, IWithReqoreTransparent } from '../../types/global';
@@ -43,14 +43,11 @@ const StyledReqoreMenu = styled.div<IReqoreMenuStyle>`
43
43
  transparent ? 'transparent' : changeDarkness(getMainBackgroundColor(theme), 0.03)};
44
44
  border-radius: ${({ rounded }) => (rounded ? `${RADIUS_FROM_SIZE['normal']}px` : `0`)};
45
45
 
46
- ${({ theme, position }) =>
46
+ ${({ theme, position, padded }) =>
47
47
  position &&
48
48
  css`
49
- border-${position === 'left' ? 'right' : 'left'}: 1px solid ${changeLightness(
50
- theme.main,
51
- 0.05
52
- )};
53
- padding-${position === 'left' ? 'right' : 'left'}: 10px;
49
+ border-${position === 'left' ? 'right' : 'left'}: 1px solid ${changeDarkness(theme.main, 0.04)};
50
+ padding-${position === 'left' ? 'right' : 'left'}: ${padded ? '10px' : undefined};
54
51
  `}
55
52
  `;
56
53
 
@@ -9,5 +9,5 @@ export const Colors: Record<string, TReqoreHexColor> = {
9
9
  YELLOW: '#d1a036',
10
10
  ORANGE: '#A66321',
11
11
  RED: '#A82A2A',
12
- GRAY: '#444444',
12
+ GRAY: '#44444450',
13
13
  };
@@ -173,3 +173,5 @@ export const WEIGHT_TO_NUMBER = {
173
173
  bold: 550,
174
174
  thick: 700,
175
175
  };
176
+
177
+ export const PILL_RADIUS_MODIFIER = 2.5;
@@ -10,6 +10,7 @@ export interface IReqoreAutoFocusRules {
10
10
  viewportMargin?: string;
11
11
  shortcut?: 'letters' | 'numbers' | string | ('letters' | 'numbers' | string)[];
12
12
  clearOnFocus?: boolean;
13
+ doNotInsertShortcut?: boolean;
13
14
  }
14
15
 
15
16
  export const useAutoFocus = (
@@ -96,9 +97,10 @@ export const useAutoFocus = (
96
97
 
97
98
  useEffect(() => {
98
99
  if (element && rules && rules.type === 'keypress') {
99
- window.addEventListener('keydown', handleKeyDown);
100
+ window.addEventListener(rules.doNotInsertShortcut ? 'keyup' : 'keydown', handleKeyDown);
100
101
  }
101
102
 
102
- return () => window.removeEventListener('keydown', handleKeyDown);
103
+ return () =>
104
+ window.removeEventListener(rules?.doNotInsertShortcut ? 'keyup' : 'keydown', handleKeyDown);
103
105
  }, [element, rules]);
104
106
  };
@@ -88,6 +88,28 @@ const Template: StoryFn<typeof ReqoreButton> = (buttonProps) => {
88
88
  Disabled not flat
89
89
  </ReqoreButton>
90
90
  </ReqoreControlGroup>
91
+ <ReqoreControlGroup fluid wrap>
92
+ <ReqoreButton {...buttonProps} verticalPadding='tiny'>
93
+ Vertical padding tiny
94
+ </ReqoreButton>
95
+ <ReqoreButton {...buttonProps} verticalPadding='small'>
96
+ Vertical padding small
97
+ </ReqoreButton>
98
+ <ReqoreButton {...buttonProps} verticalPadding='normal'>
99
+ Vertical padding normal
100
+ </ReqoreButton>
101
+ <ReqoreButton {...buttonProps} verticalPadding='big'>
102
+ Vertical padding big
103
+ </ReqoreButton>
104
+ <ReqoreButton
105
+ {...buttonProps}
106
+ verticalPadding='huge'
107
+ badge={10}
108
+ description='This is a description'
109
+ >
110
+ Vertical padding huge
111
+ </ReqoreButton>
112
+ </ReqoreControlGroup>
91
113
  <ReqoreControlGroup fluid wrap>
92
114
  <ReqoreButton {...buttonProps} fluid>
93
115
  Fluid button
@@ -347,3 +369,11 @@ export const GlobalEffect: Story = {
347
369
  },
348
370
  },
349
371
  };
372
+
373
+ export const Pill: Story = {
374
+ render: Template,
375
+
376
+ args: {
377
+ pill: true,
378
+ },
379
+ };
@@ -57,6 +57,7 @@ const Template: StoryFn<typeof ReqoreInput> = (args: IReqoreInputProps) => {
57
57
  placeholder='Clearable Input'
58
58
  onClearClick={handleValueClear}
59
59
  onChange={handleValueChange}
60
+ leftIconProps={{ size: 'tiny' }}
60
61
  />
61
62
  <ReqoreInput
62
63
  {...args}
@@ -66,6 +67,7 @@ const Template: StoryFn<typeof ReqoreInput> = (args: IReqoreInputProps) => {
66
67
  onChange={handleValueChange}
67
68
  rightIcon='EraserFill'
68
69
  rightIconColor='#8727b7'
70
+ focusRules={{ type: 'keypress', shortcut: '.', doNotInsertShortcut: true }}
69
71
  />
70
72
  <ReqoreInput {...args} placeholder='Disabled Input' disabled onChange={handleValueChange} />
71
73
  <ReqoreInput
@@ -208,3 +210,11 @@ export const Effect: Story = {
208
210
  },
209
211
  },
210
212
  };
213
+
214
+ export const Pill: Story = {
215
+ render: Template,
216
+
217
+ args: {
218
+ pill: true,
219
+ },
220
+ };
@@ -298,6 +298,16 @@ export const Transparent: Story = {
298
298
  },
299
299
  };
300
300
 
301
+ export const Positioned: Story = {
302
+ render: Template,
303
+
304
+ args: {
305
+ position: 'left',
306
+ padded: false,
307
+ rounded: false,
308
+ },
309
+ };
310
+
301
311
  export const BigGapSize: Story = {
302
312
  render: Template,
303
313