Skip to content
This repository was archived by the owner on Apr 14, 2020. It is now read-only.

Commit 21b5f99

Browse files
authored
Merge pull request #97 from madou/fix-move-anim-flashing
chore: fix builds, add more docz, type improvements
2 parents 77c5c6b + 84070f5 commit 21b5f99

7 files changed

Lines changed: 13 additions & 11 deletions

File tree

.storybook/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
test: /\.tsx$/,
1616
loader: 'ts-loader',
1717
include: path.resolve(__dirname, '../packages'),
18-
exclude: ['node_modules'],
18+
exclude: /node_modules/,
1919
options: {
2020
transpileOnly: true,
2121
},
@@ -24,7 +24,7 @@ module.exports = {
2424
test: /\.(jpg|gif|png|jpeg|webp)$/,
2525
loader: 'file-loader',
2626
include: path.resolve(__dirname, '../packages'),
27-
exclude: ['node_modules'],
27+
exclude: /node_modules/,
2828
},
2929
],
3030
},

packages/yubaba/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"size-limit": [
2626
{
27-
"limit": "5.82 KB",
27+
"limit": "6 KB",
2828
"path": "dist/esm/packages/yubaba/src/index.js"
2929
}
3030
],

packages/yubaba/src/Collector/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as React from 'react';
22
import { ElementBoundingBox } from '../lib/dom';
33

4+
export type InlineStyles = React.CSSProperties;
5+
46
export interface TargetProps {
57
style: InlineStyles;
68
className?: string;
@@ -64,10 +66,6 @@ export interface AnimationData {
6466
destination: ElementData;
6567
}
6668

67-
export interface InlineStyles {
68-
[key: string]: string | number | undefined;
69-
}
70-
7169
export interface ElementData {
7270
element: HTMLElement;
7371
elementBoundingBox: ElementBoundingBox;

packages/yubaba/src/__docs__/4-custom-animations/OneFullRotation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class OneFullRotation extends React.Component<CollectorChildrenPr
1313
...prevStyle,
1414
opacity: 1,
1515
transformOrigin: 'center',
16-
transform: combine((prevStyle.transform as string) || '', '')('rotate(360deg)'),
16+
transform: combine(prevStyle.transform, '')('rotate(360deg)'),
1717
}),
1818
});
1919

packages/yubaba/src/animations/Move/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default class Move extends React.Component<MoveProps> {
8585
transformOrigin: '0 0',
8686
visibility: 'visible',
8787
willChange: combine('transform')(prevStyles.willChange),
88-
transform: combine((prevStyles.transform as string) || '', '')(
88+
transform: combine(prevStyles.transform, '')(
8989
`translate3d(${toStartXOffset}px, ${toStartYOffset}px, 0) scale3d(${math.percentageDifference(
9090
originTarget.size.width,
9191
destinationTarget.size.width

packages/yubaba/src/animations/RevealMove/__docs__/docs.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,8 @@ starting from the [FocalTarget](/focal-target) element.
219219
Because of this is trashes layout as well as affects other elements on the screen,
220220
if the element you're revealing doesn't have a fixed width it will look _bad_.
221221

222-
One way of getting around this is by using the `useClipPath` prop - however it is not supported in IE11.
222+
It will also mean that if the target elements are vertically or horizontally centered -
223+
they will affect the flow of the page and elements will start moving around.
224+
Not great!
225+
226+
One way of getting around both of these is by using the `useClipPath` prop - however it is not supported in IE11.

packages/yubaba/src/lib/style.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const combine = (t1: string, delimeter = ',') => (t2?: string | number) => {
1+
export const combine = (t1: string = '', delimeter = ',') => (t2?: string | number) => {
22
if (t2) {
33
return `${t1}${delimeter} ${t2}`;
44
}

0 commit comments

Comments
 (0)