@universal-tennis/ui-shared 0.0.15 → 0.0.17

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 (43) hide show
  1. package/.storybook/main.js +1 -1
  2. package/.storybook/variables.css +3 -0
  3. package/dist/components.d.ts +4 -2
  4. package/dist/components.js +4 -2
  5. package/dist/components.js.map +1 -1
  6. package/dist/stories/assets/css/variables.css +3 -0
  7. package/dist/stories/assets/icon-chat-blue.svg +10 -0
  8. package/dist/stories/atoms/Button/Button.d.ts +3 -1
  9. package/dist/stories/atoms/Button/Button.js +1 -0
  10. package/dist/stories/atoms/Button/Button.js.map +1 -1
  11. package/dist/stories/atoms/Typography/Typography.d.ts +2 -1
  12. package/dist/stories/atoms/Typography/Typography.js.map +1 -1
  13. package/dist/stories/molecules/Cards/Cards.stories.d.ts +6 -0
  14. package/dist/stories/molecules/Cards/Cards.stories.js +27 -0
  15. package/dist/stories/molecules/Cards/Cards.stories.js.map +1 -0
  16. package/dist/stories/molecules/Cards/ContactCard.d.ts +9 -0
  17. package/dist/stories/molecules/Cards/ContactCard.js +39 -0
  18. package/dist/stories/molecules/Cards/ContactCard.js.map +1 -0
  19. package/dist/stories/molecules/Cards/TeamCard.d.ts +7 -0
  20. package/dist/stories/molecules/Cards/TeamCard.js +21 -0
  21. package/dist/stories/molecules/Cards/TeamCard.js.map +1 -0
  22. package/dist/stories/molecules/Cards/shared.d.ts +9 -0
  23. package/dist/stories/molecules/Cards/shared.js +13 -0
  24. package/dist/stories/molecules/Cards/shared.js.map +1 -0
  25. package/package.json +3 -1
  26. package/src/components.jsx +5 -2
  27. package/src/stories/assets/css/variables.css +3 -0
  28. package/src/stories/assets/icon-chat-blue.svg +10 -0
  29. package/src/stories/atoms/Button/Button.tsx +3 -0
  30. package/src/stories/atoms/Typography/Typography.tsx +1 -0
  31. package/src/stories/molecules/Cards/Cards.stories.tsx +45 -0
  32. package/src/stories/molecules/Cards/ContactCard.tsx +53 -0
  33. package/src/stories/molecules/Cards/TeamCard.tsx +20 -0
  34. package/src/stories/molecules/Cards/shared.tsx +14 -0
  35. package/tsconfig.json +1 -1
  36. package/dist/stories/atoms/Button/index.d.ts +0 -1
  37. package/dist/stories/atoms/Button/index.js +0 -2
  38. package/dist/stories/atoms/Button/index.js.map +0 -1
  39. package/dist/stories/atoms/Typography/index.d.ts +0 -1
  40. package/dist/stories/atoms/Typography/index.js +0 -2
  41. package/dist/stories/atoms/Typography/index.js.map +0 -1
  42. package/src/stories/atoms/Button/index.tsx +0 -1
  43. package/src/stories/atoms/Typography/index.tsx +0 -1
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  stories: [
3
3
  "../src/**/*.stories.mdx",
4
- "../src/**/*.stories.@(js|jsx|ts|tsx)"
4
+ "../src/**/*.stories.@(js|jsx|ts|tsx)",
5
5
  ],
6
6
  addons: [
7
7
  "@storybook/addon-links",
@@ -6,4 +6,7 @@
6
6
  --white: #fff;
7
7
  --light-grey: #d7e0ea;
8
8
  --darkest-grey: #3b4859;
9
+
10
+ /* colors */
11
+ --cool-grey-300: #DDE3EB;
9
12
  }
@@ -1,2 +1,4 @@
1
- export { Button } from "./stories/atoms/Button";
2
- export { Typography } from "./stories/atoms/Typography";
1
+ export { default as Button } from "./stories/atoms/Button/Button";
2
+ export { default as Typography } from "./stories/atoms/Typography/Typography";
3
+ export { default as ContactCard } from "./stories/molecules/Cards/ContactCard";
4
+ export { default as TeamCard } from "./stories/molecules/Cards/TeamCard";
@@ -1,7 +1,9 @@
1
1
  // ATOMS
2
2
  import "./stories/assets/css/variables.css";
3
- export { Button } from './stories/atoms/Button';
4
- export { Typography } from './stories/atoms/Typography';
3
+ export { default as Button } from './stories/atoms/Button/Button';
4
+ export { default as Typography } from './stories/atoms/Typography/Typography';
5
5
  // MOLECULES
6
+ export { default as ContactCard } from './stories/molecules/Cards/ContactCard';
7
+ export { default as TeamCard } from './stories/molecules/Cards/TeamCard';
6
8
  // ORGANISMS
7
9
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,YAAY;AACZ,aAAa"}
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAE9E,YAAY;AACZ,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEzE,aAAa"}
@@ -6,4 +6,7 @@
6
6
  --white: #fff;
7
7
  --light-grey: #d7e0ea;
8
8
  --darkest-grey: #3b4859;
9
+
10
+ /* colors */
11
+ --cool-grey-300: #DDE3EB;
9
12
  }
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24">
2
+ <defs>
3
+ <path id="0s7v3h5tpa" d="M12 0c6.075 0 11 4.773 11 10.661 0 4.263-2.192 7.456-6.31 9.646l-6.523 3.625c-.084.047-.173.068-.26.068-.274 0-.526-.213-.526-.51v-2.472C3.438 19.61-.613 13.524 1.625 7.014 2.649 4.033 5.095 1.64 8.164.63 9.469.199 10.759 0 12 0zm0 1.015c-1.163 0-2.34.193-3.499.575-2.76.909-4.958 3.056-5.882 5.745-.943 2.743-.707 5.578.664 7.983 1.344 2.358 3.657 4.076 6.346 4.714.47.11.8.518.8.986v1.598l5.74-3.19c3.897-2.074 5.784-4.937 5.784-8.765 0-5.318-4.465-9.646-9.953-9.646zM14.095 13.2c.29 0 .524.224.524.5s-.234.5-.524.5h-6.81c-.288 0-.523-.224-.523-.5s.235-.5.524-.5zm3.143-3.046c.29 0 .524.224.524.5s-.235.5-.524.5H7.286c-.29 0-.524-.224-.524-.5s.235-.5.524-.5zm0-3.046c.29 0 .524.224.524.5s-.235.5-.524.5H7.286c-.29 0-.524-.224-.524-.5s.235-.5.524-.5z"/>
4
+ </defs>
5
+ <g fill="none" fill-rule="evenodd">
6
+ <g>
7
+ <use fill="#008DED" xlink:href="#0s7v3h5tpa"/>
8
+ </g>
9
+ </g>
10
+ </svg>
@@ -1,7 +1,9 @@
1
- import { ReactElement } from 'react';
1
+ import React, { ReactElement } from 'react';
2
2
  type ButtonProps = {
3
3
  children: string | ReactElement;
4
4
  category?: string;
5
+ onClick?: VoidFunction;
6
+ style?: React.CSSProperties;
5
7
  };
6
8
  export default function Button({ children, category, ...props }: ButtonProps): JSX.Element;
7
9
  export {};
@@ -53,6 +53,7 @@ const LinkButton = styled(MuiButton)({
53
53
  backgroundColor: 'transparent',
54
54
  color: 'var(--primary)',
55
55
  textTransform: 'inherit',
56
+ justifyContent: 'left',
56
57
  padding: 0,
57
58
  '&:hover': {
58
59
  backgroundColor: 'transparent',
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAW9C,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,MAAM;IACd,UAA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KAAK,SAAS;YACZ,OAAO,CACL,oBAAC,aAAa,oBACR,KAAK,GAER,QAAQ,CACK,CACjB,CAAC;QACJ,KAAK,kBAAkB;YACrB,OAAO,CACH,oBAAC,aAAa,kBACZ,UAAU,UACN,KAAK,GAER,QAAQ,CACK,CACnB,CAAC;QACJ,KAAK,WAAW;YACd,OAAO,CACL,oBAAC,eAAe,oBACV,KAAK,GAER,QAAQ,CACO,CACnB,CAAC;QACJ,KAAK,MAAM;YACT,OAAO,CACH,oBAAC,UAAU,kBACT,kBAAkB,UACd,KAAK,GAER,QAAQ,CACE,CAChB,CAAC;QACJ;YACE,OAAO,CACH,oBAAC,YAAY,oBACP,KAAK,GAEV,QAAQ,CACM,CAClB,CAAC;KACL;AACH,CAAC"}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAa9C,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,MAAM;IAChB,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,uBAAuB;IAE/B,SAAS,EAAE;QACT,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,KAAwB,EAAE,EAAE,CAAC,CAAC;IACxE,eAAe,EAAE,cAAc;IAC/B,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;IAE5C,SAAS,EAAE;QAC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AQ,CACE,CAChB,CAAC;QACJ;YACE,OAAO,CACH,oBAAC,YAAY,oBACP,KAAK,GAEV,QAAQ,CACM,CAClB,CAAC;KACL;AACH,CAAC"}
@@ -1,9 +1,10 @@
1
- import { ReactElement } from 'react';
1
+ import React, { ReactElement } from 'react';
2
2
  import "../../assets/css/typography.css";
3
3
  type TypographyProps = {
4
4
  children: string | ReactElement;
5
5
  category?: string;
6
6
  size?: string;
7
+ style?: React.CSSProperties;
7
8
  };
8
9
  export default function Typography({ children, category, size, ...props }: TypographyProps): JSX.Element;
9
10
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,iCAAiC,CAAC;AAazC,MAAM,aAAa,GAAG;IACpB,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,MAAM;IACb,aAAa,EAAE,MAAM;IACrB,aAAa,EAAE,MAAM;CACtB,CAAC;AAEF,MAAM,aAAa,GAAG;IACpB,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,MAAM;IACrB,iBAAiB,EAAE,MAAM;IACzB,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,MAAM;IACrB,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,MAAM;CACvB,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,cAAc,EAAE,MAAM;IACtB,YAAY,EAAE,MAAM;IACpB,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,MAAM;IACrB,kBAAkB,EAAE,MAAM;IAC1B,cAAc,EAAE,MAAM;IACtB,YAAY,EAAE,MAAM;IACpB,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AK,WAAW;YACd,OAAO,CACL,oBAAC,mBAAmB,kBAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,IACR,KAAK,GAER,QAAQ,CACW,CACvB,CAAC;QACJ,KAAK,SAAS;YACZ,OAAO,CACL,oBAAC,iBAAiB,kBAChB,IAAI,EAAE,IAAI,IACN,KAAK,GAER,QAAQ,CACS,CACrB,CAAC;QACJ;YACE,OAAO,CACH,oBAAC,iBAAiB,kBAChB,IAAI,EAAE,IAAI,IACN,KAAK,GAEV,QAAQ,CACW,CACvB,CAAC;KACL;AACH,CAAC"}
1
+ {"version":3,"file":"Typography.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Typography/Typography.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,iCAAiC,CAAC;AAczC,MAAM,aAAa,GAAG;IACpB,WAAW,EAAE,OAAO;IACpB,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,MAAM;IACb,aAAa,EAAE,MAAM;IACrB,aAAa,EAAE,MAAM;CACtB,CAAC;AAEF,MAAM,aAAa,GAAG;IACpB,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,MAAM;IACrB,iBAAiB,EAAE,MAAM;IACzB,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,MAAM;IACrB,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,MAAM;CACvB,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,cAAc,EAAE,MAAM;IACtB,YAAY,EAAE,MAAM;IACpB,eAAe,EAAE,MAAM;IACvB,aAAa,EAAE,MAAM;IACrB,kBAAkB,EAAE,MAAM;IAC1B,cAAc,EAAE,MAAM;IACtB,YAAY,EAAE,MAAM;IACpB,oB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,WAAW;YACd,OAAO,CACL,oBAAC,mBAAmB,kBAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,IACR,KAAK,GAER,QAAQ,CACW,CACvB,CAAC;QACJ,KAAK,SAAS;YACZ,OAAO,CACL,oBAAC,iBAAiB,kBAChB,IAAI,EAAE,IAAI,IACN,KAAK,GAER,QAAQ,CACS,CACrB,CAAC;QACJ;YACE,OAAO,CACH,oBAAC,iBAAiB,kBAChB,IAAI,EAAE,IAAI,IACN,KAAK,GAEV,QAAQ,CACW,CACvB,CAAC;KACL;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const Contact: any;
6
+ export declare const Team: any;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import ContactCard from './ContactCard';
3
+ import TeamCard from './TeamCard';
4
+ // Default
5
+ export default {
6
+ title: 'Molecules/Cards',
7
+ };
8
+ // Templates
9
+ function ContactCardTemplate(args) {
10
+ return React.createElement(ContactCard, Object.assign({}, args));
11
+ }
12
+ function TeamCardTemplate(args) {
13
+ return React.createElement(TeamCard, Object.assign({}, args));
14
+ }
15
+ // Stories
16
+ export const Contact = ContactCardTemplate.bind({});
17
+ Contact.args = {
18
+ name: "Jessica Carson",
19
+ phone: "+1 222-234-4567",
20
+ email: "test@sample.com"
21
+ };
22
+ export const Team = TeamCardTemplate.bind({});
23
+ Team.args = {
24
+ title: 'team 1',
25
+ description: 'Captained by Lenny McDowell, Josh Palmer, and Michael Ballast. Requires a passcode for registration.'
26
+ };
27
+ //# sourceMappingURL=Cards.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cards.stories.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/Cards.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAelC,UAAU;AACV,eAAe;IACb,KAAK,EAAE,iBAAiB;CACzB,CAAC;AAEF,YAAY;AACZ,SAAS,mBAAmB,CAAC,IAAsB;IACjD,OAAO,oBAAC,WAAW,oBAAK,IAAI,EAAI,CAAC;AACnC,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAmB;IAC3C,OAAO,oBAAC,QAAQ,oBAAK,IAAI,EAAI,CAAC;AAChC,CAAC;AAED,UAAU;AACV,MAAM,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpD,OAAO,CAAC,IAAI,GAAG;IACb,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,iBAAiB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9C,IAAI,CAAC,IAAI,GAAG;IACV,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,sGAAsG;CACpH,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type ContactCardProps = {
3
+ name: string;
4
+ phone: string;
5
+ email: string;
6
+ handleOnMessageClick?: VoidFunction;
7
+ };
8
+ export default function ContactCard({ name, phone, email, handleOnMessageClick, ...props }: ContactCardProps): JSX.Element;
9
+ export {};
@@ -0,0 +1,39 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import parsePhoneNumber from 'libphonenumber-js';
14
+ import LocalPhoneOutlinedIcon from '@mui/icons-material/LocalPhoneOutlined';
15
+ import EmailOutlinedIcon from '@mui/icons-material/EmailOutlined';
16
+ import Link from '@mui/material/Link';
17
+ import Button from '../../atoms/Button/Button';
18
+ import Typography from '../../atoms/Typography/Typography';
19
+ import { ReactComponent as ChatIcon } from '../../assets/icon-chat-blue.svg';
20
+ import { StyledCard } from './shared';
21
+ export default function ContactCard(_a) {
22
+ var { name, phone, email, handleOnMessageClick } = _a, props = __rest(_a, ["name", "phone", "email", "handleOnMessageClick"]);
23
+ const firstName = name.split(" ")[0];
24
+ const parsedNumber = parsePhoneNumber(phone || '');
25
+ const phoneNumber = parsedNumber === null || parsedNumber === void 0 ? void 0 : parsedNumber.formatInternational();
26
+ return (React.createElement(StyledCard, Object.assign({}, props),
27
+ React.createElement(Typography, { style: { marginBottom: '8px' }, category: "secondary", size: "medium-medium" }, name),
28
+ phoneNumber && (React.createElement(Link, { sx: { display: 'flex' }, mt: 1, fontSize: 14, href: `tel:${phone}` },
29
+ React.createElement(LocalPhoneOutlinedIcon, { fontSize: "small", sx: { mr: 1 } }),
30
+ React.createElement(Typography, { category: "secondary", size: "x-small-book" }, phoneNumber))),
31
+ email && (React.createElement(Link, { sx: { display: 'flex' }, mt: 1, fontSize: 14, href: `mailto:${email}` },
32
+ React.createElement(EmailOutlinedIcon, { fontSize: "small", sx: { mr: 1 } }),
33
+ React.createElement(Typography, { category: "secondary", size: "x-small-book" }, email))),
34
+ React.createElement(Button, { onClick: handleOnMessageClick, category: "link", style: { marginTop: '8px' } },
35
+ React.createElement(React.Fragment, null,
36
+ React.createElement(ChatIcon, { width: 20 }),
37
+ React.createElement(Typography, { style: { paddingLeft: '8px' }, category: "secondary", size: "x-small-book" }, `Message ${firstName}`)))));
38
+ }
39
+ //# sourceMappingURL=ContactCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactCard.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/ContactCard.tsx"],"names":[],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AAE,GAAI;YAC1D,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,IAAE,WAAW,CAAc,CAC1E,CACN;QACA,KAAK,IAAI,CACV,oBAAC,IAAI,IAAC,EAAE,EAAE,EAAC,OAAO,EAAE,MAAM,EAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,KAAK,EAAE;YACrE,oBAAC,iBAAiB,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAI;YACrD,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,IAAE,KAAK,CAAc,CACtE,CACN;QACD,oBAAC,MAAM,IAAC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAC,MAAM,EAAC,KAAK,EAAE,EAAC,SAAS,EAAE,KAAK,EAAC;YAC9E;gBACE,oBAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,GAAI;gBACvB,oBAAC,UAAU,IAAC,KAAK,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC,EAAE,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,IAC5E,WAAW,SAAS,EAAE,CACd,CACZ,CACI,CACE,CAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type TeamCardProps = {
3
+ title: string;
4
+ description: string;
5
+ };
6
+ export default function TeamCard({ title, description, ...props }: TeamCardProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ import Typography from '../../atoms/Typography/Typography';
14
+ import { StyledCard } from './shared';
15
+ export default function TeamCard(_a) {
16
+ var { title, description } = _a, props = __rest(_a, ["title", "description"]);
17
+ return (React.createElement(StyledCard, Object.assign({}, props),
18
+ React.createElement(Typography, { category: "secondary", size: "medium-medium" }, title),
19
+ React.createElement(Typography, { category: "secondary", size: "x-small-book" }, description)));
20
+ }
21
+ //# sourceMappingURL=TeamCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TeamCard.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/TeamCard.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAOtC,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAA+C;QAA/C,EAAE,KAAK,EAAE,WAAW,OAA2B,EAAtB,KAAK,cAA9B,wBAAgC,CAAF;IAC7D,OAAO,CACH,oBAAC,UAAU,oBACL,KAAK;QAET,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,eAAe,IAAE,KAAK,CAAc;QAC1E,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,IAAE,WAAW,CAAc,CACpE,CAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledCard: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
+ children?: import("react").ReactNode;
4
+ component?: import("react").ElementType<any> | undefined;
5
+ ref?: import("react").Ref<unknown> | undefined;
6
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
7
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
8
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
9
+ }, "ref" | "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "component" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
@@ -0,0 +1,13 @@
1
+ import Box from '@mui/material/Box';
2
+ import { styled } from '@mui/material/styles';
3
+ export const StyledCard = styled(Box)({
4
+ display: 'flex',
5
+ flexDirection: 'column',
6
+ borderRadius: '4px',
7
+ padding: '16px',
8
+ border: '1px solid var(--cool-grey-300)',
9
+ '&:hover': {
10
+ cursor: 'pointer'
11
+ },
12
+ });
13
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/shared.tsx"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,gCAAgC;IAExC,SAAS,EAAE;QACT,MAAM,EAAE,SAAS;KAClB;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@universal-tennis/ui-shared",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "main": "dist/items.js",
5
5
  "license": "MIT",
6
6
  "homepage": "https://universaltennis.com",
7
7
  "dependencies": {
8
8
  "@emotion/react": "^11.10.5",
9
9
  "@emotion/styled": "^11.10.5",
10
+ "@mui/icons-material": "^5.11.0",
10
11
  "@mui/material": "5.5.3",
11
12
  "copyfiles": "^2.4.1",
12
13
  "cross-env": "^7.0.3",
14
+ "libphonenumber-js": "^1.10.18",
13
15
  "react": "^18.2.0",
14
16
  "react-dom": "^18.2.0",
15
17
  "react-scripts": "5.0.1",
@@ -1,8 +1,11 @@
1
1
  // ATOMS
2
2
  import "./stories/assets/css/variables.css";
3
3
 
4
- export { Button } from './stories/atoms/Button';
5
- export { Typography } from './stories/atoms/Typography';
4
+ export { default as Button } from './stories/atoms/Button/Button';
5
+ export { default as Typography } from './stories/atoms/Typography/Typography';
6
6
 
7
7
  // MOLECULES
8
+ export { default as ContactCard } from './stories/molecules/Cards/ContactCard';
9
+ export { default as TeamCard } from './stories/molecules/Cards/TeamCard';
10
+
8
11
  // ORGANISMS
@@ -6,4 +6,7 @@
6
6
  --white: #fff;
7
7
  --light-grey: #d7e0ea;
8
8
  --darkest-grey: #3b4859;
9
+
10
+ /* colors */
11
+ --cool-grey-300: #DDE3EB;
9
12
  }
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24">
2
+ <defs>
3
+ <path id="0s7v3h5tpa" d="M12 0c6.075 0 11 4.773 11 10.661 0 4.263-2.192 7.456-6.31 9.646l-6.523 3.625c-.084.047-.173.068-.26.068-.274 0-.526-.213-.526-.51v-2.472C3.438 19.61-.613 13.524 1.625 7.014 2.649 4.033 5.095 1.64 8.164.63 9.469.199 10.759 0 12 0zm0 1.015c-1.163 0-2.34.193-3.499.575-2.76.909-4.958 3.056-5.882 5.745-.943 2.743-.707 5.578.664 7.983 1.344 2.358 3.657 4.076 6.346 4.714.47.11.8.518.8.986v1.598l5.74-3.19c3.897-2.074 5.784-4.937 5.784-8.765 0-5.318-4.465-9.646-9.953-9.646zM14.095 13.2c.29 0 .524.224.524.5s-.234.5-.524.5h-6.81c-.288 0-.523-.224-.523-.5s.235-.5.524-.5zm3.143-3.046c.29 0 .524.224.524.5s-.235.5-.524.5H7.286c-.29 0-.524-.224-.524-.5s.235-.5.524-.5zm0-3.046c.29 0 .524.224.524.5s-.235.5-.524.5H7.286c-.29 0-.524-.224-.524-.5s.235-.5.524-.5z"/>
4
+ </defs>
5
+ <g fill="none" fill-rule="evenodd">
6
+ <g>
7
+ <use fill="#008DED" xlink:href="#0s7v3h5tpa"/>
8
+ </g>
9
+ </g>
10
+ </svg>
@@ -5,6 +5,8 @@ import { styled } from '@mui/material/styles';
5
5
  type ButtonProps = {
6
6
  children: string | ReactElement;
7
7
  category?: string;
8
+ onClick?: VoidFunction;
9
+ style?: React.CSSProperties;
8
10
  }
9
11
 
10
12
  type StyledButtonProps = {
@@ -58,6 +60,7 @@ const LinkButton = styled(MuiButton)({
58
60
  backgroundColor: 'transparent',
59
61
  color: 'var(--primary)',
60
62
  textTransform: 'inherit',
63
+ justifyContent: 'left',
61
64
  padding: 0,
62
65
 
63
66
  '&:hover': {
@@ -7,6 +7,7 @@ type TypographyProps = {
7
7
  children: string | ReactElement;
8
8
  category?: string;
9
9
  size?: string;
10
+ style?: React.CSSProperties;
10
11
  }
11
12
 
12
13
  type MuiTypographyProps = {
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+
3
+ import ContactCard from './ContactCard';
4
+ import TeamCard from './TeamCard';
5
+
6
+ // Prop types
7
+ interface ContactCardProps {
8
+ name: string;
9
+ phone: string;
10
+ email: string;
11
+ handleOnMessageClick?: VoidFunction;
12
+ }
13
+
14
+ interface TeamCardProps {
15
+ title: string;
16
+ description: string;
17
+ }
18
+
19
+ // Default
20
+ export default {
21
+ title: 'Molecules/Cards',
22
+ };
23
+
24
+ // Templates
25
+ function ContactCardTemplate(args: ContactCardProps) {
26
+ return <ContactCard {...args} />;
27
+ }
28
+
29
+ function TeamCardTemplate(args: TeamCardProps) {
30
+ return <TeamCard {...args} />;
31
+ }
32
+
33
+ // Stories
34
+ export const Contact = ContactCardTemplate.bind({});
35
+ Contact.args = {
36
+ name: "Jessica Carson",
37
+ phone: "+1 222-234-4567",
38
+ email: "test@sample.com"
39
+ };
40
+
41
+ export const Team = TeamCardTemplate.bind({});
42
+ Team.args = {
43
+ title: 'team 1',
44
+ description: 'Captained by Lenny McDowell, Josh Palmer, and Michael Ballast. Requires a passcode for registration.'
45
+ };
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import parsePhoneNumber from 'libphonenumber-js';
3
+ import LocalPhoneOutlinedIcon from '@mui/icons-material/LocalPhoneOutlined';
4
+ import EmailOutlinedIcon from '@mui/icons-material/EmailOutlined';
5
+ import Link from '@mui/material/Link';
6
+ import Button from '../../atoms/Button/Button';
7
+ import Typography from '../../atoms/Typography/Typography';
8
+ import { ReactComponent as ChatIcon } from '../../assets/icon-chat-blue.svg';
9
+
10
+ import { StyledCard } from './shared';
11
+
12
+ type ContactCardProps = {
13
+ name: string;
14
+ phone: string;
15
+ email: string;
16
+ handleOnMessageClick?: VoidFunction;
17
+ }
18
+
19
+ export default function ContactCard({
20
+ name, phone, email, handleOnMessageClick, ...props
21
+ }: ContactCardProps) {
22
+ const firstName = name.split(" ")[0];
23
+ const parsedNumber = parsePhoneNumber(phone || '');
24
+ const phoneNumber = parsedNumber?.formatInternational();
25
+
26
+ return (
27
+ <StyledCard
28
+ {...props}
29
+ >
30
+ <Typography style={{marginBottom: '8px'}} category="secondary" size="medium-medium">{name}</Typography>
31
+ {phoneNumber && (
32
+ <Link sx={{display: 'flex'}} mt={1} fontSize={14} href={`tel:${phone}`}>
33
+ <LocalPhoneOutlinedIcon fontSize="small" sx={{ mr: 1 }} />
34
+ <Typography category="secondary" size="x-small-book">{phoneNumber}</Typography>
35
+ </Link>
36
+ )}
37
+ {email && (
38
+ <Link sx={{display: 'flex'}} mt={1} fontSize={14} href={`mailto:${email}`}>
39
+ <EmailOutlinedIcon fontSize="small" sx={{ mr: 1 }} />
40
+ <Typography category="secondary" size="x-small-book">{email}</Typography>
41
+ </Link>
42
+ )}
43
+ <Button onClick={handleOnMessageClick} category="link" style={{marginTop: '8px'}}>
44
+ <>
45
+ <ChatIcon width={20} />
46
+ <Typography style={{paddingLeft: '8px'}} category="secondary" size="x-small-book">
47
+ {`Message ${firstName}`}
48
+ </Typography>
49
+ </>
50
+ </Button>
51
+ </StyledCard>
52
+ );
53
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import Typography from '../../atoms/Typography/Typography';
4
+ import { StyledCard } from './shared';
5
+
6
+ type TeamCardProps = {
7
+ title: string;
8
+ description: string;
9
+ }
10
+
11
+ export default function TeamCard({ title, description, ...props }: TeamCardProps) {
12
+ return (
13
+ <StyledCard
14
+ {...props}
15
+ >
16
+ <Typography category="secondary" size="medium-medium">{title}</Typography>
17
+ <Typography category="secondary" size="x-small-book">{description}</Typography>
18
+ </StyledCard>
19
+ );
20
+ }
@@ -0,0 +1,14 @@
1
+ import Box from '@mui/material/Box';
2
+ import { styled } from '@mui/material/styles';
3
+
4
+ export const StyledCard = styled(Box)({
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ borderRadius: '4px',
8
+ padding: '16px',
9
+ border: '1px solid var(--cool-grey-300)',
10
+
11
+ '&:hover': {
12
+ cursor: 'pointer'
13
+ },
14
+ });
package/tsconfig.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "lib": ["ES2017", "DOM"],
17
17
  "baseUrl": "src",
18
18
  "allowSyntheticDefaultImports": true,
19
- "noImplicitAny": true
19
+ "noImplicitAny": true,
20
20
  },
21
21
  "exclude": [
22
22
  "node_modules",
@@ -1 +0,0 @@
1
- export { default as Button } from './Button';
@@ -1,2 +0,0 @@
1
- export { default as Button } from './Button';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- export { default as Typography } from './Typography';
@@ -1,2 +0,0 @@
1
- export { default as Typography } from './Typography';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Typography/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -1 +0,0 @@
1
- export { default as Button } from './Button';
@@ -1 +0,0 @@
1
- export { default as Typography } from './Typography';