@integrigo/integrigo-ui 1.6.16-b → 1.6.16-d

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
3
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
4
4
  size?: "s" | "m" | "l" | "xl" | undefined;
5
5
  label?: string | undefined;
6
6
  } & React.RefAttributes<HTMLInputElement>>>;
7
7
  export default _default;
8
- export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
8
+ export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
9
9
  size?: "s" | "m" | "l" | "xl" | undefined;
10
10
  label?: string | undefined;
11
11
  } & React.RefAttributes<HTMLInputElement>>>;
12
- export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
12
+ export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
13
13
  size?: "s" | "m" | "l" | "xl" | undefined;
14
14
  label?: string | undefined;
15
15
  } & React.RefAttributes<HTMLInputElement>>>;
16
- export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
16
+ export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
17
17
  size?: "s" | "m" | "l" | "xl" | undefined;
18
18
  label?: string | undefined;
19
19
  } & React.RefAttributes<HTMLInputElement>>>;
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
2
  import { ComponentMeta, ComponentStory } from '@storybook/react';
3
3
  import { Size } from './Radio';
4
- declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
4
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
5
5
  size?: Size | undefined;
6
6
  label?: string | undefined;
7
7
  } & React.RefAttributes<HTMLInputElement>>>;
8
8
  export default _default;
9
- export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
9
+ export declare const Basic: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
10
10
  size?: Size | undefined;
11
11
  label?: string | undefined;
12
12
  } & React.RefAttributes<HTMLInputElement>>>;
13
- export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
13
+ export declare const Controlled: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
14
14
  size?: Size | undefined;
15
15
  label?: string | undefined;
16
16
  } & React.RefAttributes<HTMLInputElement>>>;
17
- export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
17
+ export declare const WithLabel: ComponentStory<React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
18
18
  size?: Size | undefined;
19
19
  label?: string | undefined;
20
20
  } & React.RefAttributes<HTMLInputElement>>>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://npm.pkg.github.com/integrigo"
5
5
  },
6
- "version": "1.6.16b",
6
+ "version": "1.6.16d",
7
7
  "main": "lib/index.js",
8
8
  "module": "lib/index.esm.js",
9
9
  "types": "lib/index.d.ts",
@@ -162,15 +162,15 @@ const getVariantStyles = (variant: ChipVariant, clickable: boolean): string => {
162
162
  `;
163
163
  case ChipVariant.grey:
164
164
  return `
165
- background-color: var(--shades-of-grey-40);
165
+ background-color: var(--shades-of-grey-20);
166
166
 
167
167
  ${clickable && `
168
168
  &:hover {
169
- background-color: var(--shades-of-grey-60);
169
+ background-color: var(--shades-of-grey-40);
170
170
  }
171
171
 
172
172
  &:active {
173
- background-color: var(--shades-of-grey-60);
173
+ background-color: var(--shades-of-grey-40);
174
174
  }
175
175
  `}
176
176
  `;
@@ -27,6 +27,7 @@ const Root = styled.div<{ size: number, color: string }>`
27
27
  background-color: ${p => p.color};
28
28
  color: var(--color-white);
29
29
  display: flex;
30
+ font-size: ${p => `calc(${p.size}px / 2)`};
30
31
  align-items: center;
31
32
  justify-content: center;
32
33
  text-transform: uppercase;
@@ -10,6 +10,14 @@ type ProfileProps = Partial<React.ComponentProps<typeof Avatar>> & {
10
10
  children?: React.ReactNode;
11
11
  };
12
12
 
13
+ const fontSizeVariant = {
14
+ s: 12,
15
+ m: 16,
16
+ l: 20,
17
+ xl: 24,
18
+ xxl: 32,
19
+ };
20
+
13
21
  const getInitials = (text: string): string =>
14
22
  text
15
23
  .split(' ')
@@ -32,7 +40,7 @@ export const Profile: React.FC<ProfileProps> = ({
32
40
  )}
33
41
 
34
42
  <Details>
35
- <Name as="span">{name}</Name>
43
+ <Name as="span" size={size}>{name}</Name>
36
44
  {children}
37
45
  </Details>
38
46
  </Root>
@@ -46,8 +54,9 @@ const Root = styled.div`
46
54
 
47
55
  Root.displayName = 'Root';
48
56
 
49
- const Name = styled(Hero)`
57
+ const Name = styled(Hero)<{ size: ProfileProps['size']}>`
50
58
  font-weight: var(--font-bold);
59
+ font-size: ${p => fontSizeVariant[p.size || 'm']}px;
51
60
  `;
52
61
 
53
62
  Name.displayName = 'Name';