@qoretechnologies/reqore 0.37.7 → 0.37.9

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 (54) hide show
  1. package/build-storybook.log +487 -3177
  2. package/chromatic.config.json +1 -0
  3. package/dist/components/Breadcrumbs/index.d.ts +1 -1
  4. package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
  5. package/dist/components/Breadcrumbs/index.js +11 -12
  6. package/dist/components/Breadcrumbs/index.js.map +1 -1
  7. package/dist/components/Button/index.d.ts +3 -0
  8. package/dist/components/Button/index.d.ts.map +1 -1
  9. package/dist/components/Button/index.js +4 -4
  10. package/dist/components/Button/index.js.map +1 -1
  11. package/dist/components/Effect/index.d.ts +1 -0
  12. package/dist/components/Effect/index.d.ts.map +1 -1
  13. package/dist/components/Effect/index.js +2 -1
  14. package/dist/components/Effect/index.js.map +1 -1
  15. package/dist/components/Icon/index.d.ts +1 -0
  16. package/dist/components/Icon/index.d.ts.map +1 -1
  17. package/dist/components/Icon/index.js +5 -2
  18. package/dist/components/Icon/index.js.map +1 -1
  19. package/dist/components/Message/index.d.ts +2 -0
  20. package/dist/components/Message/index.d.ts.map +1 -1
  21. package/dist/components/Message/index.js +2 -2
  22. package/dist/components/Message/index.js.map +1 -1
  23. package/dist/components/Panel/index.js +1 -1
  24. package/dist/components/Panel/index.js.map +1 -1
  25. package/dist/components/Spinner/index.d.ts +3 -1
  26. package/dist/components/Spinner/index.d.ts.map +1 -1
  27. package/dist/components/Spinner/index.js +2 -2
  28. package/dist/components/Spinner/index.js.map +1 -1
  29. package/dist/components/Tabs/index.d.ts +2 -2
  30. package/dist/components/Tabs/index.d.ts.map +1 -1
  31. package/dist/components/Tabs/list.d.ts +3 -0
  32. package/dist/components/Tabs/list.d.ts.map +1 -1
  33. package/dist/components/Tabs/list.js +13 -7
  34. package/dist/components/Tabs/list.js.map +1 -1
  35. package/dist/components/Tag/index.d.ts +3 -0
  36. package/dist/components/Tag/index.d.ts.map +1 -1
  37. package/dist/components/Tag/index.js +2 -2
  38. package/dist/components/Tag/index.js.map +1 -1
  39. package/package.json +2 -1
  40. package/src/components/Breadcrumbs/index.tsx +18 -24
  41. package/src/components/Button/index.tsx +8 -2
  42. package/src/components/Effect/index.tsx +7 -3
  43. package/src/components/Icon/index.tsx +4 -2
  44. package/src/components/Message/index.tsx +5 -1
  45. package/src/components/Panel/index.tsx +1 -1
  46. package/src/components/Spinner/index.tsx +4 -0
  47. package/src/components/Tabs/index.tsx +2 -2
  48. package/src/components/Tabs/list.tsx +14 -6
  49. package/src/components/Tag/index.tsx +7 -1
  50. package/src/mock/breadcrumbs.ts +3 -3
  51. package/src/stories/Button/Button.stories.tsx +2 -0
  52. package/src/stories/Icon/Icon.stories.tsx +13 -0
  53. package/src/stories/Tabs/Tabs.stories.tsx +1 -1
  54. package/tests.json +1 -1
@@ -27,15 +27,16 @@ export interface IReqoreIconProps
27
27
  margin?: 'right' | 'left' | 'both';
28
28
  image?: string;
29
29
  rounded?: boolean;
30
+ rotation?: number;
30
31
  animation?: 'spin' | 'heartbeat';
31
32
  }
32
33
 
33
34
  const SpinKeyframes = keyframes`
34
35
  0% {
35
- transform: rotate(0deg);
36
+ rotate: 0deg;
36
37
  }
37
38
  100% {
38
- transform: rotate(360deg);
39
+ rotate: 360deg;
39
40
  }
40
41
  `;
41
42
 
@@ -49,6 +50,7 @@ export const StyledIconWrapper = styled(StyledEffect)<{ margin: 'right' | 'left'
49
50
  overflow: hidden;
50
51
 
51
52
  border-radius: ${({ rounded }) => (rounded ? '50%' : undefined)};
53
+ rotate: ${({ rotation }) => (rotation ? `${rotation}deg` : undefined)};
52
54
 
53
55
  ${({ margin, size }) =>
54
56
  margin &&
@@ -21,7 +21,7 @@ import {
21
21
  import { IReqoreIconName } from '../../types/icons';
22
22
  import { TReqoreEffectColor } from '../Effect';
23
23
  import { ReqoreHeading } from '../Header';
24
- import ReqoreIcon from '../Icon';
24
+ import ReqoreIcon, { IReqoreIconProps } from '../Icon';
25
25
  import {
26
26
  StyledIconWrapper,
27
27
  StyledNotificationContent,
@@ -46,6 +46,7 @@ export interface IReqoreMessageProps
46
46
  children: any;
47
47
  icon?: IReqoreIconName;
48
48
  iconColor?: TReqoreEffectColor;
49
+ iconProps?: IReqoreIconProps;
49
50
  onClose?: () => any;
50
51
  onClick?: () => any;
51
52
  duration?: number;
@@ -81,6 +82,7 @@ const ReqoreMessage = memo(
81
82
  tooltip,
82
83
  fixed,
83
84
  fluid,
85
+ iconProps,
84
86
  ...rest
85
87
  },
86
88
  ref
@@ -159,6 +161,7 @@ const ReqoreMessage = memo(
159
161
  iconColor={iconColor}
160
162
  type={5}
161
163
  iconMargin={flat && minimal ? 'right' : 'both'}
164
+ iconProps={iconProps}
162
165
  />
163
166
  ) : (
164
167
  <ReqoreIcon
@@ -166,6 +169,7 @@ const ReqoreMessage = memo(
166
169
  margin={flat && minimal ? 'right' : 'both'}
167
170
  size={size}
168
171
  color={iconColor}
172
+ {...iconProps}
169
173
  />
170
174
  )}
171
175
  </StyledIconWrapper>
@@ -667,7 +667,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
667
667
  padded={false}
668
668
  margin='none'
669
669
  flat
670
- responsive={false}
670
+ responsive
671
671
  />
672
672
  ) : icon || iconImage || label ? (
673
673
  <StyledPanelTitleHeaderContent
@@ -5,6 +5,7 @@ import { TReqoreIntent } from '../../constants/theme';
5
5
  import { IWithReqoreEffect } from '../../types/global';
6
6
  import ReqoreControlGroup, { IReqoreControlGroupProps } from '../ControlGroup';
7
7
  import { IReqoreEffect, TReqoreEffectColor } from '../Effect';
8
+ import { IReqoreIconProps } from '../Icon';
8
9
 
9
10
  export interface IReqoreSpinnerProps
10
11
  extends Omit<IReqoreControlGroupProps, 'children' | 'size'>,
@@ -17,6 +18,7 @@ export interface IReqoreSpinnerProps
17
18
  labelEffect?: IReqoreEffect;
18
19
  iconMargin?: 'right' | 'left' | 'both';
19
20
  centered?: boolean;
21
+ iconProps?: IReqoreIconProps;
20
22
  }
21
23
 
22
24
  export const ReqoreSpinner = ({
@@ -29,6 +31,7 @@ export const ReqoreSpinner = ({
29
31
  effect,
30
32
  iconMargin,
31
33
  centered,
34
+ iconProps,
32
35
  ...rest
33
36
  }: IReqoreSpinnerProps) => {
34
37
  const renderContent = useCallback(() => {
@@ -41,6 +44,7 @@ export const ReqoreSpinner = ({
41
44
  animation='spin'
42
45
  className='reqore-spinner'
43
46
  margin={iconMargin || (children ? 'right' : undefined)}
47
+ {...iconProps}
44
48
  />
45
49
  );
46
50
  }, [size, intent, type, children, iconColor]);
@@ -9,10 +9,10 @@ import { TReqoreTabsContentPadding } from './content';
9
9
  import ReqoreTabsList from './list';
10
10
 
11
11
  export interface IReqoreTabsListItem extends Omit<IReqoreButtonProps, 'id'> {
12
- label: string | number;
12
+ label?: string | number;
13
13
  as?: any;
14
14
  id: string | number;
15
- props?: React.HTMLAttributes<any>;
15
+ props?: Record<string, any>;
16
16
  onClick?: (event: any) => any;
17
17
  onCloseClick?: (id: string | number) => any;
18
18
  activeIntent?: TReqoreIntent;
@@ -20,6 +20,7 @@ import {
20
20
  } from '../../helpers/colors';
21
21
  import { calculateStringSizeInPixels, getOneLessSize } from '../../helpers/utils';
22
22
  import { useReqoreTheme } from '../../hooks/useTheme';
23
+ import { IReqoreBreadcrumbItem } from '../Breadcrumbs';
23
24
  import { IReqoreButtonProps } from '../Button';
24
25
  import { TReqoreHexColor } from '../Effect';
25
26
  import ReqoreMenu from '../Menu';
@@ -104,8 +105,8 @@ const getBadgeLength = (badge: IReqoreButtonProps['badge'], tabsSize: TSizes = '
104
105
  );
105
106
  };
106
107
 
107
- const getLabelLength = (
108
- item: IReqoreTabsListItem | IReqoreTabsListItem[] | IReqoreTagProps,
108
+ export const getLabelLength = (
109
+ item: IReqoreBreadcrumbItem | IReqoreTabsListItem | IReqoreTabsListItem[] | IReqoreTagProps,
109
110
  activeTab?: string | number,
110
111
  tabsSize: TSizes = 'normal'
111
112
  ) => {
@@ -128,14 +129,21 @@ const getLabelLength = (
128
129
  const badgeLength = isArray(item)
129
130
  ? 0
130
131
  : getBadgeLength((item as IReqoreTabsListItem).badge, tabsSize);
132
+ const descriptionLength = isArray(item)
133
+ ? 0
134
+ : calculateStringSizeInPixels(
135
+ (item as IReqoreBreadcrumbItem | IReqoreTabsListItem)?.description?.toString(),
136
+ TEXT_FROM_SIZE[getOneLessSize(tabsSize)]
137
+ );
131
138
 
132
- return (
139
+ const topLabelLength =
133
140
  calculateStringSizeInPixels(label?.toString(), TEXT_FROM_SIZE[tabsSize]) +
134
141
  icon +
142
+ rightIcon +
135
143
  closeIconSize +
136
- badgeLength +
137
- rightIcon
138
- );
144
+ badgeLength;
145
+
146
+ return Math.max(topLabelLength, descriptionLength);
139
147
  };
140
148
 
141
149
  /**
@@ -38,7 +38,7 @@ import {
38
38
  TReqoreEffectColor,
39
39
  TReqoreHexColor,
40
40
  } from '../Effect';
41
- import ReqoreIcon from '../Icon';
41
+ import ReqoreIcon, { IReqoreIconProps } from '../Icon';
42
42
 
43
43
  export interface IReqoreTagAction extends IWithReqoreTooltip, IReqoreDisabled, IReqoreIntent {
44
44
  icon: IReqoreIconName;
@@ -61,10 +61,12 @@ export interface IReqoreTagProps
61
61
  onRemoveClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
62
62
  onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
63
63
  icon?: IReqoreIconName;
64
+ leftIconProps?: IReqoreIconProps;
64
65
  rightIcon?: IReqoreIconName;
65
66
  iconColor?: TReqoreEffectColor;
66
67
  leftIconColor?: TReqoreEffectColor;
67
68
  rightIconColor?: TReqoreEffectColor;
69
+ rightIconProps?: IReqoreIconProps;
68
70
  color?: TReqoreEffectColor;
69
71
  actions?: IReqoreTagAction[];
70
72
  width?: string;
@@ -261,6 +263,8 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
261
263
  iconColor,
262
264
  labelEffect,
263
265
  labelKeyEffect,
266
+ leftIconProps,
267
+ rightIconProps,
264
268
  ...rest
265
269
  }: IReqoreTagProps,
266
270
  ref
@@ -323,6 +327,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
323
327
  size={size}
324
328
  margin={label || labelKey ? 'left' : 'both'}
325
329
  color={leftIconColor || iconColor}
330
+ {...leftIconProps}
326
331
  />
327
332
  )}
328
333
  {labelKey && (
@@ -370,6 +375,7 @@ const ReqoreTag = forwardRef<HTMLSpanElement, IReqoreTagProps>(
370
375
  size={size}
371
376
  margin={label || (icon && !labelKey) ? 'right' : 'both'}
372
377
  color={rightIconColor || iconColor}
378
+ {...rightIconProps}
373
379
  />
374
380
  )}
375
381
  </StyledTagContentWrapper>
@@ -33,7 +33,7 @@ export default [
33
33
  {
34
34
  label: 'Jobs',
35
35
  icon: Icons.Jobs,
36
- customTheme: '#a9a9a9',
36
+ customTheme: { main: '#a9a9a9' },
37
37
  badge: 10,
38
38
  description: 'Some item description',
39
39
  intent: 'warning',
@@ -42,9 +42,9 @@ export default [
42
42
  {
43
43
  tooltip: 'Connections',
44
44
  icon: Icons.Connections,
45
- customTheme: '#a9a9a9',
45
+ customTheme: { main: 'danger:darken' },
46
46
  },
47
- ] as IReqoreBreadcrumbItem[];
47
+ ] satisfies IReqoreBreadcrumbItem[];
48
48
 
49
49
  export const breadcrumbsTabs = {
50
50
  withTabs: {
@@ -139,6 +139,8 @@ const Template: StoryFn<typeof ReqoreButton> = (buttonProps) => {
139
139
  <ReqoreControlGroup wrap>
140
140
  <ReqoreButton
141
141
  {...buttonProps}
142
+ leftIconProps={{ rotation: 180 }}
143
+ rightIconProps={{ rotation: 270 }}
142
144
  description='This is a very interesting description for a button, I like it very much'
143
145
  iconColor='#38fdb2'
144
146
  >
@@ -63,6 +63,13 @@ export const Basic: Story = {
63
63
  effect={{ opacity: 0.5 }}
64
64
  margin='both'
65
65
  />
66
+ <ReqoreIcon
67
+ icon='SignalTowerFill'
68
+ size='20px'
69
+ color='#8d2a5c'
70
+ rotation={90}
71
+ margin='both'
72
+ />
66
73
  </ReqorePanel>
67
74
  <br />
68
75
  <ReqorePanel label='Image' flat minimal>
@@ -119,6 +126,12 @@ export const Basic: Story = {
119
126
  effect={{ saturate: 150 }}
120
127
  margin='both'
121
128
  />
129
+ <ReqoreIcon
130
+ image='https://avatars.githubusercontent.com/u/44835090?s=400&u=371120ce0755102d2e432f11ad9aa0378c871b45&v=4'
131
+ size='40px'
132
+ rotation={180}
133
+ margin='both'
134
+ />
122
135
  </ReqorePanel>
123
136
  <br />
124
137
  <ReqorePanel label='Margined' flat minimal>
@@ -98,7 +98,7 @@ const tabs = [
98
98
  textSize: 'small',
99
99
  },
100
100
  },
101
- ] as IReqoreTabsProps['tabs'];
101
+ ] satisfies IReqoreTabsProps['tabs'];
102
102
 
103
103
  const { createArg } = argManager<IReqoreTabsProps>();
104
104