@basic-ui/material 1.0.0-alpha.8 → 1.0.0-alpha.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.
- package/build/cjs/index.js +66 -23
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Alert/Alert.d.ts +1 -1
- package/build/esm/AppBar/AppBar.d.ts +1 -1
- package/build/esm/AppBar/AppBar.js +2 -1
- package/build/esm/AppBar/AppBar.js.map +1 -1
- package/build/esm/AppBar/AppBarButton.d.ts +1 -1
- package/build/esm/Badge/Badge.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheet.d.ts +1 -1
- package/build/esm/BottomSheet/BottomSheetSurface.d.ts +1 -1
- package/build/esm/Button/BaseButton.d.ts +1 -1
- package/build/esm/Button/Button.d.ts +1 -1
- package/build/esm/Button/ButtonGroup.d.ts +1 -1
- package/build/esm/Button/FilledButton.d.ts +1 -1
- package/build/esm/Button/OutlinedButton.d.ts +1 -1
- package/build/esm/Button/TransparentButton.d.ts +1 -1
- package/build/esm/CheckBox/CheckBox.d.ts +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.d.ts +1 -1
- package/build/esm/CheckBox/CheckBoxIcon.js +2 -1
- package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
- package/build/esm/Chip/ButtonChip.d.ts +1 -1
- package/build/esm/Chip/ChipBase.d.ts +1 -1
- package/build/esm/Chip/ChoiceChip.d.ts +1 -1
- package/build/esm/Combobox/Combobox.d.ts +7 -7
- package/build/esm/Combobox/Combobox.js +2 -1
- package/build/esm/Combobox/Combobox.js.map +1 -1
- package/build/esm/Dialog/Dialog.d.ts +1 -1
- package/build/esm/Dialog/DialogBackdrop.d.ts +1 -1
- package/build/esm/Dialog/DialogContainer.d.ts +1 -1
- package/build/esm/Dialog/DialogSurface.d.ts +1 -1
- package/build/esm/Dialog/Scrim.d.ts +1 -1
- package/build/esm/Dialog/useDialogAnimation.js +3 -2
- package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
- package/build/esm/Divider/Divider.d.ts +1 -1
- package/build/esm/FloatingLabel/FloatingLabel.js +2 -1
- package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
- package/build/esm/LineRipple/LineRipple.d.ts +1 -1
- package/build/esm/LineRipple/LineRipple.js +2 -1
- package/build/esm/LineRipple/LineRipple.js.map +1 -1
- package/build/esm/Link/Link.d.ts +1 -1
- package/build/esm/List/List.d.ts +1 -1
- package/build/esm/ListItem/ListItem.d.ts +1 -1
- package/build/esm/Menu/Menu.d.ts +4 -4
- package/build/esm/Menu/Menu.js +4 -1
- package/build/esm/Menu/Menu.js.map +1 -1
- package/build/esm/NavRail/NavRailItem.d.ts +3 -3
- package/build/esm/NavRail/NavRailItem.js +3 -2
- package/build/esm/NavRail/NavRailItem.js.map +1 -1
- package/build/esm/NotchedOutline/styledComponents.d.ts +107 -0
- package/build/esm/NotchedOutline/styledComponents.js +3 -2
- package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
- package/build/esm/Paper/Paper.d.ts +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +1 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.js +2 -1
- package/build/esm/ProgressSpinner/ProgressSpinner.js.map +1 -1
- package/build/esm/RadioButton/RadioButtonIcon.js +2 -1
- package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
- package/build/esm/RadioButton/RadioGroup.d.ts +1 -1
- package/build/esm/Select/Select.d.ts +1 -1
- package/build/esm/Select/SelectIcon.d.ts +1 -1
- package/build/esm/Select/SelectIcon.js +2 -1
- package/build/esm/Select/SelectIcon.js.map +1 -1
- package/build/esm/SelectItem/SelectItem.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlLabel.d.ts +1 -1
- package/build/esm/SelectionControl/SelectionControlText.d.ts +1 -1
- package/build/esm/Skeleton/DelayAppearance.d.ts +1 -1
- package/build/esm/Skeleton/Skeleton.d.ts +1 -1
- package/build/esm/Snackbar/Snackbar.d.ts +1 -1
- package/build/esm/Snackbar/useSnackbarAnimation.js +2 -1
- package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
- package/build/esm/Switch/Switch.d.ts +1 -1
- package/build/esm/Switch/styledComponents.js +2 -1
- package/build/esm/Switch/styledComponents.js.map +1 -1
- package/build/esm/Tab/Tab.d.ts +1 -1
- package/build/esm/Tab/TabList.d.ts +1 -1
- package/build/esm/Tab/TabPanel.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.d.ts +1 -1
- package/build/esm/TabIndicator/TabIndicator.js +2 -1
- package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
- package/build/esm/Table/Table.d.ts +1 -1
- package/build/esm/Table/TableBody.d.ts +1 -1
- package/build/esm/Table/TableCell.d.ts +1 -1
- package/build/esm/Table/TableHead.d.ts +1 -1
- package/build/esm/Table/TableRow.d.ts +1 -1
- package/build/esm/Text/Text.d.ts +7 -3
- package/build/esm/Text/Text.js +4 -0
- package/build/esm/Text/Text.js.map +1 -1
- package/build/esm/TextField/FilledContainer.d.ts +1 -1
- package/build/esm/TextField/HelperText.d.ts +1 -1
- package/build/esm/TextField/Input.d.ts +1 -1
- package/build/esm/TextField/Input.js +2 -1
- package/build/esm/TextField/Input.js.map +1 -1
- package/build/esm/TextField/OutlinedContainer.d.ts +1 -1
- package/build/esm/TextField/TextField.d.ts +1 -1
- package/build/esm/Tooltip/Tooltip.d.ts +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/motion.d.ts +7 -0
- package/build/esm/motion.js +8 -0
- package/build/esm/motion.js.map +1 -0
- package/build/esm/theme/theme.d.ts +107 -0
- package/build/esm/theme/theme.js +34 -5
- package/build/esm/theme/theme.js.map +1 -1
- package/build/esm/theme/useTheme.d.ts +578 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/AppBar/AppBar.tsx +2 -1
- package/src/CheckBox/CheckBox.story.tsx +2 -2
- package/src/CheckBox/CheckBoxIcon.tsx +2 -2
- package/src/Combobox/Combobox.tsx +2 -2
- package/src/Dialog/useDialogAnimation.tsx +3 -4
- package/src/FloatingLabel/FloatingLabel.tsx +2 -1
- package/src/LineRipple/LineRipple.tsx +2 -1
- package/src/Menu/Menu.tsx +2 -1
- package/src/NavRail/NavRail.story.tsx +2 -1
- package/src/NavRail/NavRailItem.tsx +3 -2
- package/src/NotchedOutline/styledComponents.ts +2 -1
- package/src/ProgressSpinner/ProgressSpinner.tsx +2 -2
- package/src/RadioButton/RadioButtonIcon.tsx +2 -2
- package/src/Select/SelectIcon.tsx +2 -2
- package/src/Snackbar/useSnackbarAnimation.ts +2 -1
- package/src/Switch/styledComponents.tsx +2 -2
- package/src/TabIndicator/TabIndicator.tsx +2 -1
- package/src/Text/Text.story.tsx +44 -7
- package/src/Text/Text.tsx +22 -2
- package/src/TextField/Input.tsx +2 -1
- package/src/index.ts +1 -0
- package/src/motion.ts +7 -0
- package/src/theme/theme.ts +39 -4
|
@@ -5,6 +5,7 @@ import { rem } from 'polished';
|
|
|
5
5
|
|
|
6
6
|
import type { BoxProps } from '../Box';
|
|
7
7
|
import { Box } from '../Box';
|
|
8
|
+
import { EASING_STANDARD } from '../motion';
|
|
8
9
|
|
|
9
10
|
export type ProgressSpinnerProps = BoxProps & {
|
|
10
11
|
progress?: number;
|
|
@@ -105,8 +106,7 @@ export const ProgressSpinner = forwardRef<HTMLDivElement, ProgressSpinnerProps>(
|
|
|
105
106
|
strokeDashoffset: '0px',
|
|
106
107
|
}
|
|
107
108
|
: {
|
|
108
|
-
transition:
|
|
109
|
-
'stroke-dashoffset 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
|
|
109
|
+
transition: `stroke-dashoffset 300ms ${EASING_STANDARD} 0ms`,
|
|
110
110
|
strokeDasharray: circumference.toFixed(3),
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { rem } from 'polished';
|
|
4
4
|
|
|
5
5
|
import { Box } from '../Box';
|
|
6
|
+
import { EASING_STANDARD } from '../motion';
|
|
6
7
|
|
|
7
8
|
export interface RadioButtonIconProps
|
|
8
9
|
extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -34,8 +35,7 @@ export const RadioButtonIcon = forwardRef<HTMLDivElement, RadioButtonIconProps>(
|
|
|
34
35
|
borderRadius: 'full',
|
|
35
36
|
width: '100%',
|
|
36
37
|
height: '100%',
|
|
37
|
-
transition:
|
|
38
|
-
'transform .12s cubic-bezier(0,0,.2,1) 0ms,background-color .12s cubic-bezier(0,0,.2,1) 0ms',
|
|
38
|
+
transition: `transform .12s ${EASING_STANDARD} 0ms,background-color .12s ${EASING_STANDARD} 0ms`,
|
|
39
39
|
transform: checked ? 'scale(1)' : 'scale(0)',
|
|
40
40
|
}}
|
|
41
41
|
/>
|
|
@@ -7,6 +7,7 @@ import type { BoxProps } from '../Box';
|
|
|
7
7
|
import { Box } from '../Box';
|
|
8
8
|
import { alpha } from '../color';
|
|
9
9
|
import { PADDING_RIGHT_WITH_ICON } from '../TextField/consts';
|
|
10
|
+
import { EASING_STANDARD } from '../motion';
|
|
10
11
|
|
|
11
12
|
export type SelectIconProps = BoxProps<
|
|
12
13
|
SVGElement,
|
|
@@ -32,8 +33,7 @@ export const SelectIcon = forwardRef<SVGElement, SelectIconProps>(
|
|
|
32
33
|
color: open ? 'primary' : alpha('on.surface', 0.54),
|
|
33
34
|
pointerEvents: 'none',
|
|
34
35
|
transform: open ? 'rotate(180deg)' : undefined,
|
|
35
|
-
transition:
|
|
36
|
-
'transform .15s cubic-bezier(.4,0,.2,1), color .15s cubic-bezier(.4,0,.2,1)',
|
|
36
|
+
transition: `transform .15s ${EASING_STANDARD}, color .15s ${EASING_STANDARD}`,
|
|
37
37
|
}}
|
|
38
38
|
{...otherProps}
|
|
39
39
|
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
|
|
4
|
+
import { EASING_STANDARD } from '../motion';
|
|
4
5
|
import { useStackItem } from './Stack';
|
|
5
6
|
|
|
6
7
|
const TRANSITION_TIME = 150;
|
|
@@ -100,7 +101,7 @@ export const placements = {
|
|
|
100
101
|
const commonStyle = { position: 'fixed', zIndex: 'snackbar' };
|
|
101
102
|
|
|
102
103
|
function getTransition(timems: number) {
|
|
103
|
-
return `opacity ${timems}ms
|
|
104
|
+
return `opacity ${timems}ms ${EASING_STANDARD},transform ${timems}ms ${EASING_STANDARD}`;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
const defaultAnimation = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { rem } from 'polished';
|
|
2
2
|
|
|
3
3
|
import { Box } from '../Box';
|
|
4
|
+
import { EASING_STANDARD } from '../motion';
|
|
4
5
|
|
|
5
6
|
const BORDER_WIDTH = 2;
|
|
6
7
|
const TRAIL_WIDTH = 52;
|
|
@@ -48,8 +49,7 @@ export const SwitchThumb = ({ checked = false, ...otherProps }) => (
|
|
|
48
49
|
(TRAIL_WIDTH - CIRCLE_SIZE_INACTIVE_CHECKED - BORDER_WIDTH * 4) / 2
|
|
49
50
|
)})) translateY(-50%)`,
|
|
50
51
|
WebkitTapHighlightColor: 'transparent',
|
|
51
|
-
transition:
|
|
52
|
-
'background-color 90ms cubic-bezier(.4,0,.2,1),border-color 90ms cubic-bezier(.4,0,.2,1),transform 90ms cubic-bezier(.4,0,.2,1),height 90ms cubic-bezier(.4,0,.2,1),width 90ms cubic-bezier(.4,0,.2,1)',
|
|
52
|
+
transition: `background-color 90ms ${EASING_STANDARD},border-color 90ms ${EASING_STANDARD},transform 90ms ${EASING_STANDARD},height 90ms ${EASING_STANDARD},width 90ms ${EASING_STANDARD}`,
|
|
53
53
|
'& > input': {
|
|
54
54
|
width: THUMB_SIZE,
|
|
55
55
|
height: THUMB_SIZE,
|
|
@@ -5,6 +5,7 @@ import { assignMultipleRefs } from '@basic-ui/core';
|
|
|
5
5
|
import type { BoxProps } from '../Box';
|
|
6
6
|
import { Box } from '../Box';
|
|
7
7
|
import { useTabIndicatorContext } from './context';
|
|
8
|
+
import { EASING_STANDARD } from '../motion';
|
|
8
9
|
|
|
9
10
|
export interface TabIndicatorProps extends BoxProps {
|
|
10
11
|
selected?: boolean;
|
|
@@ -59,7 +60,7 @@ export const TabIndicator = forwardRef<HTMLDivElement, TabIndicatorProps>(
|
|
|
59
60
|
transform: `scale(1)`,
|
|
60
61
|
opacity: selected ? 1 : 0,
|
|
61
62
|
transformOrigin: 'left',
|
|
62
|
-
transition:
|
|
63
|
+
transition: `transform .25s ${EASING_STANDARD}`,
|
|
63
64
|
zIndex: 1,
|
|
64
65
|
}}
|
|
65
66
|
{...otherProps}
|
package/src/Text/Text.story.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
1
3
|
import { Text } from './';
|
|
2
4
|
import { Box } from '../Box';
|
|
3
5
|
// import './styles.css';
|
|
@@ -6,7 +8,46 @@ export default {
|
|
|
6
8
|
title: 'components/Text',
|
|
7
9
|
};
|
|
8
10
|
|
|
11
|
+
const loremIpsum =
|
|
12
|
+
'Lorem ipsum dolor sit amet consectetur adipisicing elit.' +
|
|
13
|
+
'Cupiditate aliquid ad quas sunt voluptatum officia dolorum cumque,' +
|
|
14
|
+
'possimus nihil molestias sapiente necessitatibus dolor saepe inventore,' +
|
|
15
|
+
'soluta id accusantium voluptas beatae.';
|
|
16
|
+
|
|
9
17
|
const Example = () => {
|
|
18
|
+
const variantMapping = {
|
|
19
|
+
'display-large': 'Display large',
|
|
20
|
+
'display-medium': 'Display medium',
|
|
21
|
+
'display-small': 'Display small',
|
|
22
|
+
'headline-large': 'Headline large',
|
|
23
|
+
'headline-medium': 'Headline medium',
|
|
24
|
+
'headline-small': 'Headline small',
|
|
25
|
+
'title-large': 'Title large',
|
|
26
|
+
'title-medium': 'Title medium',
|
|
27
|
+
'title-small': 'Title small',
|
|
28
|
+
'label-large': 'Label large',
|
|
29
|
+
'label-medium': 'Label medium',
|
|
30
|
+
'label-small': 'Label small',
|
|
31
|
+
'body-large': `Body large. ${loremIpsum}`,
|
|
32
|
+
'body-medium': `Body medium. ${loremIpsum}`,
|
|
33
|
+
'body-small': `Body small. ${loremIpsum}`,
|
|
34
|
+
};
|
|
35
|
+
const variants = Object.keys(variantMapping).map((v) => (
|
|
36
|
+
<Text key={v} variant={v as keyof typeof variantMapping} mb={2}>
|
|
37
|
+
{variantMapping[v]}
|
|
38
|
+
</Text>
|
|
39
|
+
));
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Box bg="surface" p="2">
|
|
43
|
+
{variants}
|
|
44
|
+
</Box>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const AllVariants = () => <Example />;
|
|
49
|
+
|
|
50
|
+
export const LegacyVariants = () => {
|
|
10
51
|
const variantMapping = {
|
|
11
52
|
h1: 'Heading 1',
|
|
12
53
|
h2: 'Heading 2',
|
|
@@ -16,16 +57,14 @@ const Example = () => {
|
|
|
16
57
|
h6: 'Heading 6',
|
|
17
58
|
subtitle1: 'Subtitle 1',
|
|
18
59
|
subtitle2: 'Subtitle 2',
|
|
19
|
-
body1:
|
|
20
|
-
|
|
21
|
-
body2:
|
|
22
|
-
'Body 2. Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate aliquid ad quas sunt voluptatum officia dolorum cumque, possimus nihil molestias sapiente necessitatibus dolor saepe inventore, soluta id accusantium voluptas beatae.',
|
|
60
|
+
body1: `Body 1. ${loremIpsum}`,
|
|
61
|
+
body2: `Body 2. ${loremIpsum}`,
|
|
23
62
|
button: 'Button text',
|
|
24
63
|
caption: 'Caption text',
|
|
25
64
|
overline: 'Overline text',
|
|
26
65
|
};
|
|
27
66
|
const variants = Object.keys(variantMapping).map((v) => (
|
|
28
|
-
<Text key={v} variant={v} mb={2}>
|
|
67
|
+
<Text key={v} variant={v as keyof typeof variantMapping} mb={2}>
|
|
29
68
|
{variantMapping[v]}
|
|
30
69
|
</Text>
|
|
31
70
|
));
|
|
@@ -36,5 +75,3 @@ const Example = () => {
|
|
|
36
75
|
</Box>
|
|
37
76
|
);
|
|
38
77
|
};
|
|
39
|
-
|
|
40
|
-
export const AllVariants = () => <Example />;
|
package/src/Text/Text.tsx
CHANGED
|
@@ -4,7 +4,10 @@ import * as React from 'react';
|
|
|
4
4
|
import type { BoxProps } from '../Box';
|
|
5
5
|
import { Box } from '../Box';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated
|
|
9
|
+
*/
|
|
10
|
+
export type LegacyTextVariants =
|
|
8
11
|
| 'h1'
|
|
9
12
|
| 'h2'
|
|
10
13
|
| 'h3'
|
|
@@ -19,8 +22,25 @@ export type TextVariants =
|
|
|
19
22
|
| 'overline'
|
|
20
23
|
| 'button';
|
|
21
24
|
|
|
25
|
+
export type TextVariants =
|
|
26
|
+
| 'display-large'
|
|
27
|
+
| 'display-medium'
|
|
28
|
+
| 'display-small'
|
|
29
|
+
| 'headline-large'
|
|
30
|
+
| 'headline-medium'
|
|
31
|
+
| 'headline-small'
|
|
32
|
+
| 'title-large'
|
|
33
|
+
| 'title-medium'
|
|
34
|
+
| 'title-small'
|
|
35
|
+
| 'label-large'
|
|
36
|
+
| 'label-medium'
|
|
37
|
+
| 'label-small'
|
|
38
|
+
| 'body-large'
|
|
39
|
+
| 'body-medium'
|
|
40
|
+
| 'body-small';
|
|
41
|
+
|
|
22
42
|
export interface TextProps extends BoxProps {
|
|
23
|
-
variant?: TextVariants;
|
|
43
|
+
variant?: LegacyTextVariants | TextVariants;
|
|
24
44
|
}
|
|
25
45
|
|
|
26
46
|
const mappings: { [key: string]: React.ElementType<any> } = {
|
package/src/TextField/Input.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { forwardRef } from 'react';
|
|
|
5
5
|
import type { BoxProps } from '../Box';
|
|
6
6
|
import { Box } from '../Box';
|
|
7
7
|
import { alpha } from '../color';
|
|
8
|
+
import { EASING_STANDARD } from '../motion';
|
|
8
9
|
import {
|
|
9
10
|
ICON_WIDTH,
|
|
10
11
|
PADDING_LEFT_WITHOUT_ICON,
|
|
@@ -72,7 +73,7 @@ export const Input = forwardRef<HTMLDivElement, InputProps>(function Input(
|
|
|
72
73
|
variant === 'filled'
|
|
73
74
|
? alpha('on.surface-variant', 0.87)
|
|
74
75
|
: alpha('on.surface-variant', 0.6),
|
|
75
|
-
transition: `opacity .18s
|
|
76
|
+
transition: `opacity .18s ${EASING_STANDARD}`,
|
|
76
77
|
},
|
|
77
78
|
':disabled::placeholder': {
|
|
78
79
|
color: alpha('on.surface', 0.38),
|
package/src/index.ts
CHANGED
package/src/motion.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const EASING_EMPHASIZED = 'cubic-bezier(0.2, 0, 0, 1)';
|
|
2
|
+
export const EASING_EMPHASIZED_ACCELERATE = 'cubic-bezier(0.3, 0, 0.8, 0.15)';
|
|
3
|
+
export const EASING_EMPHASIZED_DECELERATE = 'cubic-bezier(0.05, 0.7, 0.1, 1)';
|
|
4
|
+
export const EASING_LINEAR = 'cubic-bezier(0, 0, 1, 1)';
|
|
5
|
+
export const EASING_STANDARD = 'cubic-bezier(0.2, 0, 0, 1)';
|
|
6
|
+
export const EASING_STANDARD_ACCELERATE = 'cubic-bezier(0.3, 0, 1, 1)';
|
|
7
|
+
export const EASING_STANDARD_DECELERATE = 'cubic-bezier(0, 0, 0, 1)';
|
package/src/theme/theme.ts
CHANGED
|
@@ -5,6 +5,24 @@
|
|
|
5
5
|
// - https://material.io/design/typography/the-type-system.html#type-scale
|
|
6
6
|
import { rem, em } from 'polished';
|
|
7
7
|
|
|
8
|
+
import { EASING_STANDARD } from '../motion';
|
|
9
|
+
|
|
10
|
+
function font(
|
|
11
|
+
fontFamily: 'plain' | 'brand',
|
|
12
|
+
lineHeight: number,
|
|
13
|
+
fontSize: number,
|
|
14
|
+
letterSpacing: number,
|
|
15
|
+
weight: number
|
|
16
|
+
) {
|
|
17
|
+
return {
|
|
18
|
+
fontFamily,
|
|
19
|
+
lineHeight: rem(lineHeight),
|
|
20
|
+
fontSize: rem(fontSize),
|
|
21
|
+
letterSpacing: rem(letterSpacing),
|
|
22
|
+
weight,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
8
26
|
export const theme = {
|
|
9
27
|
googleFonts:
|
|
10
28
|
'https://fonts.googleapis.com/css?family=Roboto+Mono|Roboto:300,400,500,600,700&display=swap',
|
|
@@ -123,6 +141,8 @@ export const theme = {
|
|
|
123
141
|
fonts: {
|
|
124
142
|
body: 'Roboto, sans-serif',
|
|
125
143
|
heading: 'Roboto, sans-serif',
|
|
144
|
+
brand: 'Roboto, sans-serif',
|
|
145
|
+
plain: 'Roboto, sans-serif',
|
|
126
146
|
monospace: '"Roboto Mono", monospace',
|
|
127
147
|
},
|
|
128
148
|
fontSizes: {
|
|
@@ -172,6 +192,21 @@ export const theme = {
|
|
|
172
192
|
fontFamily: 'body',
|
|
173
193
|
lineHeight: 'body',
|
|
174
194
|
},
|
|
195
|
+
'display-large': font('brand', 64, 57, 0, 400),
|
|
196
|
+
'display-medium': font('brand', 52, 45, 0, 400),
|
|
197
|
+
'display-small': font('brand', 44, 36, 0, 400),
|
|
198
|
+
'headline-large': font('brand', 40, 32, 0, 400),
|
|
199
|
+
'headline-medium': font('brand', 36, 28, 0, 400),
|
|
200
|
+
'headline-small': font('brand', 32, 24, 0, 400),
|
|
201
|
+
'title-large': font('plain', 28, 22, 0, 400),
|
|
202
|
+
'title-medium': font('plain', 24, 16, 0.15, 500),
|
|
203
|
+
'title-small': font('plain', 20, 14, 0.1, 500),
|
|
204
|
+
'label-large': font('plain', 20, 14, 0.1, 500),
|
|
205
|
+
'label-medium': font('plain', 16, 12, 0.5, 500),
|
|
206
|
+
'label-small': font('plain', 16, 11, 0.5, 500),
|
|
207
|
+
'body-large': font('plain', 24, 16, 0.5, 400),
|
|
208
|
+
'body-medium': font('plain', 20, 14, 0.25, 400),
|
|
209
|
+
'body-small': font('plain', 16, 12, 0.4, 400),
|
|
175
210
|
h1: {
|
|
176
211
|
variant: 'text.heading',
|
|
177
212
|
fontWeight: 'light',
|
|
@@ -362,7 +397,7 @@ export const theme = {
|
|
|
362
397
|
elevations: {
|
|
363
398
|
none: {},
|
|
364
399
|
default: {
|
|
365
|
-
transition:
|
|
400
|
+
transition: `box-shadow .28s ${EASING_STANDARD}`,
|
|
366
401
|
'&:hover': {
|
|
367
402
|
boxShadow: 1,
|
|
368
403
|
},
|
|
@@ -371,7 +406,7 @@ export const theme = {
|
|
|
371
406
|
},
|
|
372
407
|
},
|
|
373
408
|
elevated: {
|
|
374
|
-
transition:
|
|
409
|
+
transition: `box-shadow .28s ${EASING_STANDARD}`,
|
|
375
410
|
boxShadow: 1,
|
|
376
411
|
'&:hover': {
|
|
377
412
|
boxShadow: 2,
|
|
@@ -381,7 +416,7 @@ export const theme = {
|
|
|
381
416
|
},
|
|
382
417
|
},
|
|
383
418
|
floating: {
|
|
384
|
-
transition:
|
|
419
|
+
transition: `box-shadow .28s ${EASING_STANDARD}`,
|
|
385
420
|
boxShadow: 3,
|
|
386
421
|
':hover': {
|
|
387
422
|
boxShadow: 4,
|
|
@@ -426,7 +461,7 @@ export const theme = {
|
|
|
426
461
|
height: rem(32),
|
|
427
462
|
borderRadius: 'small',
|
|
428
463
|
outline: 'none',
|
|
429
|
-
transition:
|
|
464
|
+
transition: `box-shadow .28s ${EASING_STANDARD}`,
|
|
430
465
|
},
|
|
431
466
|
filled: {
|
|
432
467
|
variant: 'chips.variants.base',
|