@universal-tennis/ui-shared 0.0.6 → 0.0.7
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.
- package/dist/components.js +1 -0
- package/dist/components.js.map +1 -1
- package/dist/stories/atoms/{Button.d.ts → Button/Button.d.ts} +1 -1
- package/dist/stories/atoms/{Button.js → Button/Button.js} +6 -3
- package/dist/stories/atoms/Button/Button.js.map +1 -0
- package/dist/stories/atoms/{Button.stories.d.ts → Button/Button.stories.d.ts} +2 -1
- package/dist/stories/atoms/{Button.stories.js → Button/Button.stories.js} +6 -1
- package/dist/stories/atoms/Button/Button.stories.js.map +1 -0
- package/dist/stories/atoms/Button/index.d.ts +1 -0
- package/dist/stories/atoms/Button/index.js +2 -0
- package/dist/stories/atoms/Button/index.js.map +1 -0
- package/dist/stories/atoms/Typography/Typography.d.ts +9 -0
- package/dist/stories/atoms/Typography/Typography.js +76 -0
- package/dist/stories/atoms/Typography/Typography.js.map +1 -0
- package/dist/stories/atoms/Typography/Typography.stories.d.ts +37 -0
- package/dist/stories/atoms/Typography/Typography.stories.js +191 -0
- package/dist/stories/atoms/Typography/Typography.stories.js.map +1 -0
- package/dist/stories/atoms/Typography/index.d.ts +1 -0
- package/dist/stories/atoms/Typography/index.js +2 -0
- package/dist/stories/atoms/Typography/index.js.map +1 -0
- package/package.json +1 -1
- package/public/index.html +2 -0
- package/src/components.jsx +1 -0
- package/src/stories/atoms/{Button.stories.tsx → Button/Button.stories.tsx} +7 -1
- package/src/stories/atoms/{Button.tsx → Button/Button.tsx} +18 -4
- package/src/stories/atoms/Button/index.tsx +1 -0
- package/src/stories/atoms/Typography/Typography.stories.tsx +229 -0
- package/src/stories/atoms/Typography/Typography.tsx +113 -0
- package/src/stories/atoms/Typography/index.tsx +1 -0
- package/src/stories/atoms/Typography/typography.css +26 -0
- package/dist/stories/atoms/Button.js.map +0 -1
- package/dist/stories/atoms/Button.stories.js.map +0 -1
package/dist/components.js
CHANGED
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEnE,YAAY;AACZ,aAAa"}
|
|
@@ -3,5 +3,5 @@ type ButtonProps = {
|
|
|
3
3
|
children: string | ReactElement;
|
|
4
4
|
category?: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export default function Button({ children, category, ...props }: ButtonProps): JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -21,9 +21,10 @@ const StyledButton = styled(MuiButton)({
|
|
|
21
21
|
lineHeight: '39px',
|
|
22
22
|
border: '1px solid transparent'
|
|
23
23
|
});
|
|
24
|
-
const PrimaryButton = styled(StyledButton)({
|
|
24
|
+
const PrimaryButton = styled(StyledButton)((props) => ({
|
|
25
25
|
backgroundColor: 'var(--black)',
|
|
26
26
|
color: 'var(--white)',
|
|
27
|
+
width: props.isExpanded ? '100%' : 'inherit',
|
|
27
28
|
'&:hover': {
|
|
28
29
|
backgroundColor: 'var(--darkest-grey)',
|
|
29
30
|
borderColor: 'var(--darkest-grey)',
|
|
@@ -32,7 +33,7 @@ const PrimaryButton = styled(StyledButton)({
|
|
|
32
33
|
backgroundColor: 'var(--lightest-grey)',
|
|
33
34
|
borderColor: 'var(--lightest-grey)',
|
|
34
35
|
},
|
|
35
|
-
});
|
|
36
|
+
}));
|
|
36
37
|
const SecondaryButton = styled(StyledButton)({
|
|
37
38
|
borderColor: 'var(--black)',
|
|
38
39
|
backgroundColor: 'transparent',
|
|
@@ -44,11 +45,13 @@ const SecondaryButton = styled(StyledButton)({
|
|
|
44
45
|
borderColor: 'var(--disabled)'
|
|
45
46
|
},
|
|
46
47
|
});
|
|
47
|
-
export function Button(_a) {
|
|
48
|
+
export default function Button(_a) {
|
|
48
49
|
var { children, category } = _a, props = __rest(_a, ["children", "category"]);
|
|
49
50
|
switch (category) {
|
|
50
51
|
case 'primary':
|
|
51
52
|
return (React.createElement(PrimaryButton, Object.assign({}, props), children));
|
|
53
|
+
case 'primary-expanded':
|
|
54
|
+
return (React.createElement(PrimaryButton, Object.assign({ isExpanded: true }, props), children));
|
|
52
55
|
case 'secondary':
|
|
53
56
|
return (React.createElement(SecondaryButton, Object.assign({}, props), children));
|
|
54
57
|
default:
|
|
@@ -0,0 +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,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,uBAAuB;CAChC,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;QACT,eAAe,EAAE,qBAAqB;QACtC,WAAW,EAAE,qBAAqB;KACnC;IACD,YAAY,EAAE;QACZ,eAAe,EAAE,sBAAsB;QACvC,WAAW,EAAE,sBAAsB;KACpC;CACF,CAAC,CAAC,CAAC;AAEJ,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IAC3C,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,aAAa;IAC9B,KAAK,EAAE,cAAc;IAErB,SAAS,EAAE;QACT,WAAW,EAAE,qBAAqB;KACnC;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,iBAAiB;KAC/B;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAA6C;QAA7C,EAAE,QAAQ,EAAE,QAAQ,OAAyB,EAApB,KAAK,cAA9B,wBAAgC,CAAF;IAC3D,QAAQ,QAAQ,EAAE;QAChB,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;YACE,OAAO,CACH,oBAAC,YAAY,oBACP,KAAK,GAEV,QAAQ,CACM,CAClB,CAAC;KACL;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Button from './Button';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: typeof Button;
|
|
@@ -10,5 +10,6 @@ declare const _default: {
|
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
12
12
|
export declare const Primary: any;
|
|
13
|
+
export declare const PrimaryExpanded: any;
|
|
13
14
|
export declare const Secondary: any;
|
|
14
15
|
export declare const Default: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import Button from './Button';
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Atoms/Button',
|
|
5
5
|
component: Button,
|
|
@@ -15,6 +15,11 @@ Primary.args = {
|
|
|
15
15
|
category: "primary",
|
|
16
16
|
children: 'Button',
|
|
17
17
|
};
|
|
18
|
+
export const PrimaryExpanded = Template.bind({});
|
|
19
|
+
PrimaryExpanded.args = {
|
|
20
|
+
category: "primary-expanded",
|
|
21
|
+
children: 'Button',
|
|
22
|
+
};
|
|
18
23
|
export const Secondary = Template.bind({});
|
|
19
24
|
Secondary.args = {
|
|
20
25
|
category: "secondary",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAO9B,eAAe;IACb,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE;QACR,eAAe,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;KACtC;CACF,CAAC;AAEF,SAAS,QAAQ,CAAC,IAAW;IAC3B,OAAO,oBAAC,MAAM,oBAAK,IAAI,EAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjD,eAAe,CAAC,IAAI,GAAG;IACrB,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IACf,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,QAAQ;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button } from './Button';
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import "./typography.css";
|
|
3
|
+
type TypographyProps = {
|
|
4
|
+
children: string | ReactElement;
|
|
5
|
+
category?: string;
|
|
6
|
+
size?: string;
|
|
7
|
+
};
|
|
8
|
+
export default function Typography({ children, category, size, ...props }: TypographyProps): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
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 MuiTypography from '@mui/material/Typography';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import "./typography.css";
|
|
16
|
+
const DISPLAY_SIZES = {
|
|
17
|
+
"XXX-large": '120px',
|
|
18
|
+
"XX-large": '100px',
|
|
19
|
+
"X-large": '75px',
|
|
20
|
+
large: '50px',
|
|
21
|
+
"large-light": '50px',
|
|
22
|
+
"medium-book": '36px',
|
|
23
|
+
};
|
|
24
|
+
const PRIMARY_SIZES = {
|
|
25
|
+
"large-bold": '34px',
|
|
26
|
+
"large-book": '34px',
|
|
27
|
+
"large-light": '34px',
|
|
28
|
+
"medium-semibold": '22px',
|
|
29
|
+
"medium-medium": '22px',
|
|
30
|
+
"medium-book": '22px',
|
|
31
|
+
"small-book": '16px',
|
|
32
|
+
"x-small-book": '12px',
|
|
33
|
+
};
|
|
34
|
+
const SECONDARY_SIZES = {
|
|
35
|
+
"large-medium": '20px',
|
|
36
|
+
"large-book": '20px',
|
|
37
|
+
"medium-medium": '16px',
|
|
38
|
+
"medium-book": '16px',
|
|
39
|
+
"small-medium-cap": '14px',
|
|
40
|
+
"small-medium": '14px',
|
|
41
|
+
"small-book": '14px',
|
|
42
|
+
"x-small-medium-cap": '12px',
|
|
43
|
+
"x-small-medium": '12px',
|
|
44
|
+
"x-small-book-cap": '12px',
|
|
45
|
+
"x-small-book": '12px',
|
|
46
|
+
"xx-small-medium-cap": '10px',
|
|
47
|
+
"xx-small-book": '10px',
|
|
48
|
+
};
|
|
49
|
+
const DisplayTypography = styled(MuiTypography)((props) => ({
|
|
50
|
+
fontFamily: 'var(--display)',
|
|
51
|
+
fontSize: DISPLAY_SIZES[props.size],
|
|
52
|
+
}));
|
|
53
|
+
const PrimaryTypography = styled(MuiTypography)((props) => ({
|
|
54
|
+
fontFamily: 'var(--primary)',
|
|
55
|
+
fontSize: PRIMARY_SIZES[props.size],
|
|
56
|
+
}));
|
|
57
|
+
const SecondaryTypography = styled(MuiTypography)((props) => ({
|
|
58
|
+
fontFamily: 'var(--secondary)',
|
|
59
|
+
fontSize: SECONDARY_SIZES[props.size],
|
|
60
|
+
textTransform: props.isCap ? 'uppercase' : 'inherit'
|
|
61
|
+
}));
|
|
62
|
+
export default function Typography(_a) {
|
|
63
|
+
var { children, category, size } = _a, props = __rest(_a, ["children", "category", "size"]);
|
|
64
|
+
const isCap = size === null || size === void 0 ? void 0 : size.includes("cap");
|
|
65
|
+
switch (category) {
|
|
66
|
+
case 'primary':
|
|
67
|
+
return (React.createElement(PrimaryTypography, Object.assign({ size: size }, props), children));
|
|
68
|
+
case 'secondary':
|
|
69
|
+
return (React.createElement(SecondaryTypography, Object.assign({ size: size, isCap: isCap }, props), children));
|
|
70
|
+
case 'display':
|
|
71
|
+
return (React.createElement(DisplayTypography, Object.assign({ size: size }, props), children));
|
|
72
|
+
default:
|
|
73
|
+
return (React.createElement(PrimaryTypography, Object.assign({ size: size }, props), children));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=Typography.js.map
|
|
@@ -0,0 +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,kBAAkB,CAAC;AAa1B,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,M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,EAAE,IAAI,OACR,EADa,KAAK,cADD,gCAElC,CADmC;IAElC,MAAM,KAAK,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpC,QAAQ,QAAQ,EAAE;QAChB,KAAK,SAAS;YACZ,OAAO,CACL,oBAAC,iBAAiB,kBAChB,IAAI,EAAE,IAAI,IACN,KAAK,GAER,QAAQ,CACS,CACrB,CAAC;QACJ,KAAK,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,37 @@
|
|
|
1
|
+
import Typography from './Typography';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: typeof Typography;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Default: any;
|
|
8
|
+
export declare const Display: any;
|
|
9
|
+
export declare const DisplayXXXLarge: any;
|
|
10
|
+
export declare const DisplayXXLarge: any;
|
|
11
|
+
export declare const DisplayXLarge: any;
|
|
12
|
+
export declare const DisplayLarge: any;
|
|
13
|
+
export declare const DisplayLargelight: any;
|
|
14
|
+
export declare const DisplayMediumBook: any;
|
|
15
|
+
export declare const Primary: any;
|
|
16
|
+
export declare const PrimaryLargeBold: any;
|
|
17
|
+
export declare const PrimaryLargeBook: any;
|
|
18
|
+
export declare const PrimaryLargeLight: any;
|
|
19
|
+
export declare const PrimaryMediumSemiBold: any;
|
|
20
|
+
export declare const PrimaryMediumMedium: any;
|
|
21
|
+
export declare const PrimaryMediumBook: any;
|
|
22
|
+
export declare const PrimarySmallBook: any;
|
|
23
|
+
export declare const PrimaryXSmallBook: any;
|
|
24
|
+
export declare const Secondary: any;
|
|
25
|
+
export declare const SecondaryLargeMedium: any;
|
|
26
|
+
export declare const SecondaryLargeBook: any;
|
|
27
|
+
export declare const SecondaryMediumMedium: any;
|
|
28
|
+
export declare const SecondaryMediumBook: any;
|
|
29
|
+
export declare const SecondarySmallMediumCap: any;
|
|
30
|
+
export declare const SecondarySmallMedium: any;
|
|
31
|
+
export declare const SecondarySmallBook: any;
|
|
32
|
+
export declare const SecondaryXSmallMediumCap: any;
|
|
33
|
+
export declare const SecondaryXSmallMedium: any;
|
|
34
|
+
export declare const SecondaryXSmallBookCap: any;
|
|
35
|
+
export declare const SecondaryXSmallBook: any;
|
|
36
|
+
export declare const SecondaryXXSmallMediumCap: any;
|
|
37
|
+
export declare const SecondaryXXSmallBook: any;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Typography from './Typography';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Atoms/Typography',
|
|
5
|
+
component: Typography,
|
|
6
|
+
};
|
|
7
|
+
function Template(args) {
|
|
8
|
+
return React.createElement(Typography, Object.assign({}, args));
|
|
9
|
+
}
|
|
10
|
+
export const Default = Template.bind({});
|
|
11
|
+
Default.args = {
|
|
12
|
+
children: 'Text',
|
|
13
|
+
};
|
|
14
|
+
export const Display = Template.bind({});
|
|
15
|
+
Display.args = {
|
|
16
|
+
category: "display",
|
|
17
|
+
children: 'Text',
|
|
18
|
+
};
|
|
19
|
+
export const DisplayXXXLarge = Template.bind({});
|
|
20
|
+
DisplayXXXLarge.args = {
|
|
21
|
+
children: 'Text',
|
|
22
|
+
category: "display",
|
|
23
|
+
size: 'XXX-large'
|
|
24
|
+
};
|
|
25
|
+
export const DisplayXXLarge = Template.bind({});
|
|
26
|
+
DisplayXXLarge.args = {
|
|
27
|
+
children: 'Text',
|
|
28
|
+
category: "display",
|
|
29
|
+
size: 'XX-large'
|
|
30
|
+
};
|
|
31
|
+
export const DisplayXLarge = Template.bind({});
|
|
32
|
+
DisplayXLarge.args = {
|
|
33
|
+
children: 'Text',
|
|
34
|
+
category: "display",
|
|
35
|
+
size: 'X-large'
|
|
36
|
+
};
|
|
37
|
+
export const DisplayLarge = Template.bind({});
|
|
38
|
+
DisplayLarge.args = {
|
|
39
|
+
children: 'Text',
|
|
40
|
+
category: "display",
|
|
41
|
+
size: 'large'
|
|
42
|
+
};
|
|
43
|
+
export const DisplayLargelight = Template.bind({});
|
|
44
|
+
DisplayLargelight.args = {
|
|
45
|
+
children: 'Text',
|
|
46
|
+
category: "display",
|
|
47
|
+
size: 'large-light'
|
|
48
|
+
};
|
|
49
|
+
export const DisplayMediumBook = Template.bind({});
|
|
50
|
+
DisplayMediumBook.args = {
|
|
51
|
+
children: 'Text',
|
|
52
|
+
category: "display",
|
|
53
|
+
size: 'medium-book'
|
|
54
|
+
};
|
|
55
|
+
export const Primary = Template.bind({});
|
|
56
|
+
Primary.args = {
|
|
57
|
+
category: "primary",
|
|
58
|
+
children: 'Text',
|
|
59
|
+
};
|
|
60
|
+
export const PrimaryLargeBold = Template.bind({});
|
|
61
|
+
PrimaryLargeBold.args = {
|
|
62
|
+
children: 'Text',
|
|
63
|
+
category: "primary",
|
|
64
|
+
size: 'large-bold'
|
|
65
|
+
};
|
|
66
|
+
export const PrimaryLargeBook = Template.bind({});
|
|
67
|
+
PrimaryLargeBook.args = {
|
|
68
|
+
children: 'Text',
|
|
69
|
+
category: "primary",
|
|
70
|
+
size: 'large-book'
|
|
71
|
+
};
|
|
72
|
+
export const PrimaryLargeLight = Template.bind({});
|
|
73
|
+
PrimaryLargeLight.args = {
|
|
74
|
+
children: 'Text',
|
|
75
|
+
category: "primary",
|
|
76
|
+
size: 'large-light'
|
|
77
|
+
};
|
|
78
|
+
export const PrimaryMediumSemiBold = Template.bind({});
|
|
79
|
+
PrimaryMediumSemiBold.args = {
|
|
80
|
+
children: 'Text',
|
|
81
|
+
category: "primary",
|
|
82
|
+
size: 'medium-semibold'
|
|
83
|
+
};
|
|
84
|
+
export const PrimaryMediumMedium = Template.bind({});
|
|
85
|
+
PrimaryMediumMedium.args = {
|
|
86
|
+
children: 'Text',
|
|
87
|
+
category: "primary",
|
|
88
|
+
size: 'medium-medium'
|
|
89
|
+
};
|
|
90
|
+
export const PrimaryMediumBook = Template.bind({});
|
|
91
|
+
PrimaryMediumBook.args = {
|
|
92
|
+
children: 'Text',
|
|
93
|
+
category: "primary",
|
|
94
|
+
size: 'medium-book'
|
|
95
|
+
};
|
|
96
|
+
export const PrimarySmallBook = Template.bind({});
|
|
97
|
+
PrimarySmallBook.args = {
|
|
98
|
+
children: 'Text',
|
|
99
|
+
category: "primary",
|
|
100
|
+
size: 'small-book'
|
|
101
|
+
};
|
|
102
|
+
export const PrimaryXSmallBook = Template.bind({});
|
|
103
|
+
PrimaryXSmallBook.args = {
|
|
104
|
+
children: 'Text',
|
|
105
|
+
category: "primary",
|
|
106
|
+
size: 'x-small-book'
|
|
107
|
+
};
|
|
108
|
+
export const Secondary = Template.bind({});
|
|
109
|
+
Secondary.args = {
|
|
110
|
+
category: "secondary",
|
|
111
|
+
children: 'Text',
|
|
112
|
+
};
|
|
113
|
+
export const SecondaryLargeMedium = Template.bind({});
|
|
114
|
+
SecondaryLargeMedium.args = {
|
|
115
|
+
category: "secondary",
|
|
116
|
+
children: 'Text',
|
|
117
|
+
size: 'large-medium'
|
|
118
|
+
};
|
|
119
|
+
export const SecondaryLargeBook = Template.bind({});
|
|
120
|
+
SecondaryLargeBook.args = {
|
|
121
|
+
category: "secondary",
|
|
122
|
+
children: 'Text',
|
|
123
|
+
size: 'large-book'
|
|
124
|
+
};
|
|
125
|
+
export const SecondaryMediumMedium = Template.bind({});
|
|
126
|
+
SecondaryMediumMedium.args = {
|
|
127
|
+
category: "secondary",
|
|
128
|
+
children: 'Text',
|
|
129
|
+
size: 'medium-medium'
|
|
130
|
+
};
|
|
131
|
+
export const SecondaryMediumBook = Template.bind({});
|
|
132
|
+
SecondaryMediumBook.args = {
|
|
133
|
+
category: "secondary",
|
|
134
|
+
children: 'Text',
|
|
135
|
+
size: 'medium-book'
|
|
136
|
+
};
|
|
137
|
+
export const SecondarySmallMediumCap = Template.bind({});
|
|
138
|
+
SecondarySmallMediumCap.args = {
|
|
139
|
+
category: "secondary",
|
|
140
|
+
children: 'Text',
|
|
141
|
+
size: 'small-medium-cap'
|
|
142
|
+
};
|
|
143
|
+
export const SecondarySmallMedium = Template.bind({});
|
|
144
|
+
SecondarySmallMedium.args = {
|
|
145
|
+
category: "secondary",
|
|
146
|
+
children: 'Text',
|
|
147
|
+
size: 'small-medium'
|
|
148
|
+
};
|
|
149
|
+
export const SecondarySmallBook = Template.bind({});
|
|
150
|
+
SecondarySmallBook.args = {
|
|
151
|
+
category: "secondary",
|
|
152
|
+
children: 'Text',
|
|
153
|
+
size: 'small-book'
|
|
154
|
+
};
|
|
155
|
+
export const SecondaryXSmallMediumCap = Template.bind({});
|
|
156
|
+
SecondaryXSmallMediumCap.args = {
|
|
157
|
+
category: "secondary",
|
|
158
|
+
children: 'Text',
|
|
159
|
+
size: 'x-small-medium-cap'
|
|
160
|
+
};
|
|
161
|
+
export const SecondaryXSmallMedium = Template.bind({});
|
|
162
|
+
SecondaryXSmallMedium.args = {
|
|
163
|
+
category: "secondary",
|
|
164
|
+
children: 'Text',
|
|
165
|
+
size: 'x-small-medium'
|
|
166
|
+
};
|
|
167
|
+
export const SecondaryXSmallBookCap = Template.bind({});
|
|
168
|
+
SecondaryXSmallBookCap.args = {
|
|
169
|
+
category: "secondary",
|
|
170
|
+
children: 'Text',
|
|
171
|
+
size: 'x-small-book-cap'
|
|
172
|
+
};
|
|
173
|
+
export const SecondaryXSmallBook = Template.bind({});
|
|
174
|
+
SecondaryXSmallBook.args = {
|
|
175
|
+
category: "secondary",
|
|
176
|
+
children: 'Text',
|
|
177
|
+
size: 'x-small-book'
|
|
178
|
+
};
|
|
179
|
+
export const SecondaryXXSmallMediumCap = Template.bind({});
|
|
180
|
+
SecondaryXXSmallMediumCap.args = {
|
|
181
|
+
category: "secondary",
|
|
182
|
+
children: 'Text',
|
|
183
|
+
size: 'xx-small-medium-cap'
|
|
184
|
+
};
|
|
185
|
+
export const SecondaryXXSmallBook = Template.bind({});
|
|
186
|
+
SecondaryXXSmallBook.args = {
|
|
187
|
+
category: "secondary",
|
|
188
|
+
children: 'Text',
|
|
189
|
+
size: 'xx-small-book'
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=Typography.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography.stories.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Typography/Typography.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,UAAU,MAAM,cAAc,CAAC;AAOtC,eAAe;IACb,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,UAAU;CACtB,CAAC;AAEF,SAAS,QAAQ,CAAC,IAAW;IAC3B,OAAO,oBAAC,UAAU,oBAAK,IAAI,EAAI,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,MAAM;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjD,eAAe,CAAC,IAAI,GAAG;IACrB,QAAQ,EAAE,MAAM;IACh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C,IAAI,GAAG;IAC5B,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,kBAAkB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrD,mBAAmB,CAAC,IAAI,GAAG;IACzB,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,cAAc;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,yBAAyB,CAAC,IAAI,GAAG;IAC/B,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,qBAAqB;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtD,oBAAoB,CAAC,IAAI,GAAG;IAC1B,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,eAAe;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Typography } from './Typography';
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
content="Web site created using create-react-app"
|
|
11
11
|
/>
|
|
12
12
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
+
<link rel="stylesheet" type="text/css" href="https://cloud.typography.com/6323816/6761592/css/fonts.css" />
|
|
14
|
+
|
|
13
15
|
<!--
|
|
14
16
|
manifest.json provides metadata used when your web app is installed on a
|
|
15
17
|
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
package/src/components.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import Button from './Button';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
children: string;
|
|
@@ -25,6 +25,12 @@ Primary.args = {
|
|
|
25
25
|
children: 'Button',
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
export const PrimaryExpanded = Template.bind({});
|
|
29
|
+
PrimaryExpanded.args = {
|
|
30
|
+
category: "primary-expanded",
|
|
31
|
+
children: 'Button',
|
|
32
|
+
};
|
|
33
|
+
|
|
28
34
|
export const Secondary = Template.bind({});
|
|
29
35
|
Secondary.args = {
|
|
30
36
|
category: "secondary",
|
|
@@ -7,6 +7,10 @@ type ButtonProps = {
|
|
|
7
7
|
category?: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
type StyledButtonProps = {
|
|
11
|
+
isExpanded?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
const StyledButton = styled(MuiButton)({
|
|
11
15
|
borderRadius: '24px',
|
|
12
16
|
fontSize: '12px',
|
|
@@ -17,10 +21,11 @@ const StyledButton = styled(MuiButton)({
|
|
|
17
21
|
border: '1px solid transparent'
|
|
18
22
|
});
|
|
19
23
|
|
|
20
|
-
const PrimaryButton = styled(StyledButton)({
|
|
24
|
+
const PrimaryButton = styled(StyledButton)((props: StyledButtonProps) => ({
|
|
21
25
|
backgroundColor: 'var(--black)',
|
|
22
26
|
color: 'var(--white)',
|
|
23
|
-
|
|
27
|
+
width: props.isExpanded ? '100%' : 'inherit',
|
|
28
|
+
|
|
24
29
|
'&:hover': {
|
|
25
30
|
backgroundColor: 'var(--darkest-grey)',
|
|
26
31
|
borderColor: 'var(--darkest-grey)',
|
|
@@ -29,7 +34,7 @@ const PrimaryButton = styled(StyledButton)({
|
|
|
29
34
|
backgroundColor: 'var(--lightest-grey)',
|
|
30
35
|
borderColor: 'var(--lightest-grey)',
|
|
31
36
|
},
|
|
32
|
-
});
|
|
37
|
+
}));
|
|
33
38
|
|
|
34
39
|
const SecondaryButton = styled(StyledButton)({
|
|
35
40
|
borderColor: 'var(--black)',
|
|
@@ -44,7 +49,7 @@ const SecondaryButton = styled(StyledButton)({
|
|
|
44
49
|
},
|
|
45
50
|
});
|
|
46
51
|
|
|
47
|
-
export function Button({ children, category, ...props }: ButtonProps) {
|
|
52
|
+
export default function Button({ children, category, ...props }: ButtonProps) {
|
|
48
53
|
switch (category) {
|
|
49
54
|
case 'primary':
|
|
50
55
|
return (
|
|
@@ -54,6 +59,15 @@ export function Button({ children, category, ...props }: ButtonProps) {
|
|
|
54
59
|
{children}
|
|
55
60
|
</PrimaryButton>
|
|
56
61
|
);
|
|
62
|
+
case 'primary-expanded':
|
|
63
|
+
return (
|
|
64
|
+
<PrimaryButton
|
|
65
|
+
isExpanded
|
|
66
|
+
{...props}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</PrimaryButton>
|
|
70
|
+
);
|
|
57
71
|
case 'secondary':
|
|
58
72
|
return (
|
|
59
73
|
<SecondaryButton
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button } from './Button';
|