@universal-tennis/ui-shared 0.0.23 → 0.0.25

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.
@@ -0,0 +1,10 @@
1
+ :root {
2
+ --primary: #008ded;
3
+ --secondary: #e0004f;
4
+ --disabled: #bac6d6;
5
+ --black: #000;
6
+ --white: #fff;
7
+ --light-grey: #d7e0ea;
8
+ --darkest-grey: #3b4859;
9
+ --cool-grey-300: #DDE3EB;
10
+ }
@@ -1,7 +1,6 @@
1
1
  import React, {ReactElement} from 'react';
2
2
  import MuiButton from '@mui/material/Button';
3
3
  import { styled } from '@mui/material/styles';
4
- import {colors} from '../../theme/colors';
5
4
 
6
5
  type ButtonProps = {
7
6
  children: string | ReactElement;
@@ -29,37 +28,37 @@ const StyledButton = styled(MuiButton)({
29
28
  });
30
29
 
31
30
  const PrimaryButton = styled(StyledButton)((props: StyledButtonProps) => ({
32
- backgroundColor: colors.black,
33
- color: colors.white,
31
+ backgroundColor: 'var(--black)',
32
+ color: 'var(--white)',
34
33
  width: props.isExpanded ? '100%' : 'inherit',
35
34
 
36
35
  '&:hover': {
37
- backgroundColor: colors.darkestGrey,
38
- borderColor: colors.darkestGrey,
36
+ backgroundColor: 'var(--darkest-grey)',
37
+ borderColor: 'var(--darkest-grey)',
39
38
  },
40
39
  '&:disabled': {
41
- backgroundColor: colors.lightGrey,
42
- borderColor: colors.lightGrey,
40
+ backgroundColor: 'var(--light-grey)',
41
+ borderColor: 'var(--light-grey)',
43
42
  },
44
43
  }));
45
44
 
46
45
  const SecondaryButton = styled(StyledButton)({
47
- borderColor: colors.black,
46
+ borderColor: 'var(--black)',
48
47
  backgroundColor: 'transparent',
49
- color: colors.black,
48
+ color: 'var(--black)',
50
49
 
51
50
  '&:hover': {
52
- borderColor: colors.darkestGrey,
51
+ borderColor: 'var(--darkest-grey)',
53
52
  },
54
53
  '&:disabled': {
55
- borderColor: colors.disabled
54
+ borderColor: 'var(--disabled)'
56
55
  },
57
56
  });
58
57
 
59
58
  const LinkButton = styled(MuiButton)({
60
59
  borderColor: 'transparent',
61
60
  backgroundColor: 'transparent',
62
- color: colors.primary,
61
+ color: 'var(--primary)',
63
62
  textTransform: 'inherit',
64
63
  justifyContent: 'left',
65
64
  padding: 0,
@@ -69,7 +68,7 @@ const LinkButton = styled(MuiButton)({
69
68
  },
70
69
 
71
70
  '&:disabled': {
72
- borderColor: colors.disabled
71
+ borderColor: 'var(--disabled)'
73
72
  },
74
73
  });
75
74
 
@@ -1,6 +1,7 @@
1
1
  import React, {ReactElement} from 'react';
2
2
  import MuiTypography from '@mui/material/Typography';
3
3
  import { styled } from '@mui/material/styles';
4
+ import "../../assets/css/typography.css";
4
5
 
5
6
  type TypographyProps = {
6
7
  children: string | ReactElement;
@@ -52,19 +53,19 @@ const SECONDARY_SIZES = {
52
53
  };
53
54
 
54
55
  const DisplayTypography = styled(MuiTypography)((props: MuiTypographyProps) => ({
55
- fontFamily: `'UTR Numerals', 'Tungsten A', 'Tungsten B'`,
56
+ fontFamily: 'var(--display-font)',
56
57
  fontSize: DISPLAY_SIZES[props.size as keyof typeof DISPLAY_SIZES],
57
58
  fontWeight: props.weight
58
59
  }));
59
60
 
60
61
  const PrimaryTypography = styled(MuiTypography)((props: MuiTypographyProps) => ({
61
- fontFamily: `'Tungsten A', 'Tungsten B', 'Helvetica', Arial, sans-serif`,
62
+ fontFamily: 'var(--primary-font)',
62
63
  fontSize: PRIMARY_SIZES[props.size as keyof typeof PRIMARY_SIZES],
63
64
  fontWeight: props.weight
64
65
  }));
65
66
 
66
67
  const SecondaryTypography = styled(MuiTypography)((props: MuiTypographyProps) => ({
67
- fontFamily: `'Gotham SSm A', 'Gotham SSm B', 'Helvetica', Arial, sans-serif`,
68
+ fontFamily: 'var(--secondary-font)',
68
69
  fontSize: SECONDARY_SIZES[props.size as keyof typeof SECONDARY_SIZES],
69
70
  textTransform: props.isCap ? 'uppercase' : 'inherit',
70
71
  fontWeight: props.weight
@@ -13,11 +13,11 @@ type ContactCardProps = {
13
13
  name: string;
14
14
  phone: string;
15
15
  email: string;
16
- handleOnMessageClick?: VoidFunction;
16
+ onMessageClick?: VoidFunction;
17
17
  }
18
18
 
19
19
  export default function ContactCard({
20
- name, phone, email, handleOnMessageClick, ...props
20
+ name, phone, email, onMessageClick, ...props
21
21
  }: ContactCardProps) {
22
22
  const firstName = name.split(" ")[0];
23
23
  const parsedNumber = parsePhoneNumber(phone || '');
@@ -40,7 +40,7 @@ export default function ContactCard({
40
40
  <Typography category="secondary" size="x-small-book">{email}</Typography>
41
41
  </Link>
42
42
  )}
43
- <Button onClick={handleOnMessageClick} category="link" style={{marginTop: '8px'}}>
43
+ <Button onClick={onMessageClick} category="link" style={{marginTop: '8px'}}>
44
44
  <>
45
45
  <img src={ChatIcon} alt="message" style={{width: '20px'}} />
46
46
  <Typography style={{paddingLeft: '8px'}} category="secondary" size="x-small-book">
@@ -1,13 +1,12 @@
1
1
  import Box from '@mui/material/Box';
2
2
  import { styled } from '@mui/material/styles';
3
- import { colors } from 'stories/theme/colors';
4
3
 
5
4
  export const StyledCard = styled(Box)({
6
5
  display: 'flex',
7
6
  flexDirection: 'column',
8
7
  borderRadius: '4px',
9
8
  padding: '16px',
10
- border: `1px solid ${colors.coolGrey300}`,
9
+ border: `1px solid var(--cool-grey-300)`,
11
10
 
12
11
  '&:hover': {
13
12
  cursor: 'pointer'
@@ -1,10 +0,0 @@
1
- export declare const colors: {
2
- primary: string;
3
- secondary: string;
4
- disabled: string;
5
- black: string;
6
- white: string;
7
- lightGrey: string;
8
- darkestGrey: string;
9
- coolGrey300: string;
10
- };
@@ -1,11 +0,0 @@
1
- export const colors = {
2
- primary: '#008ded',
3
- secondary: '#e0004f',
4
- disabled: '#bac6d6',
5
- black: '#000',
6
- white: '#fff',
7
- lightGrey: '#d7e0ea',
8
- darkestGrey: '#3b4859',
9
- coolGrey300: '#DDE3EB'
10
- };
11
- //# sourceMappingURL=colors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../src/stories/theme/colors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,SAAS;CACvB,CAAC"}
@@ -1,10 +0,0 @@
1
- export const colors = {
2
- primary: '#008ded',
3
- secondary: '#e0004f',
4
- disabled: '#bac6d6',
5
- black: '#000',
6
- white: '#fff',
7
- lightGrey: '#d7e0ea',
8
- darkestGrey: '#3b4859',
9
- coolGrey300: '#DDE3EB'
10
- };