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

Commit 9d9282c

Browse files
committed
chore: renames components
BREAKING CHANGE: FLIPMove has been renamed to Move. Target has been renamed to FocalTarget.
1 parent d5edce7 commit 9d9282c

14 files changed

Lines changed: 36 additions & 36 deletions

File tree

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"no-multi-str": "off",
1919
"react/prefer-stateless-function": "never",
2020
"react/sort-comp": "off",
21+
"react/destructuring-assignment": "never",
2122
"import/no-extraneous-dependencies": [
2223
"error",
2324
{ "devDependencies": ["**/*test.tsx", "**/*stories.tsx"] }

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ A range of different scenarios for each animation component. [Looking for compon
5757

5858
Transitioning the same element from one place to another.
5959

60-
- [Move](https://yubaba.netlify.com/?selectedKind=yubaba%2FFLIPMove&selectedStory=Default&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fnotes%2Fpanel)
60+
- [Move](https://yubaba.netlify.com/?selectedKind=yubaba%2FMove&selectedStory=Default&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fnotes%2Fpanel)
6161
- [CrossFadeMove](https://yubaba.netlify.com/?selectedKind=yubaba%2FCrossFadeMove&selectedStory=Default&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fnotes%2Fpanel)
6262
- [ConcealMove](https://yubaba.netlify.com/?selectedKind=yubaba%2FConcealMove&selectedStory=TargetHeight&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fnotes%2Fpanel)
6363
- [RevealMove](https://yubaba.netlify.com/?selectedKind=yubaba%2FRevealMove&selectedStory=TargetHeight&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fnotes%2Fpanel)
@@ -155,19 +155,19 @@ import Baba from 'yubaba';
155155
</Baba>;
156156
```
157157

158-
#### Target
158+
#### FocalTarget
159159

160-
[Docs](https://yubaba.netlify.com/typedoc/classes/target.html) | [Props](https://yubaba.netlify.com/typedoc/interfaces/targetprops.html)
160+
[Docs](https://yubaba.netlify.com/typedoc/classes/focaltarget.html) | [Props](https://yubaba.netlify.com/typedoc/interfaces/targetprops.html)
161161

162162
Used to explicitly mark the focal element,
163163
only a handful of animations require this component to be used,
164164
for example [Reveal](#reveal)`.
165165

166166
```jsx
167-
import Baba, { Target } from 'yubaba';
167+
import Baba, { FocalTarget } from 'yubaba';
168168

169169
<Baba name="target">
170-
<Target>{({ ref }) => <div ref={ref} />}</Target>
170+
<FocalTarget>{({ ref }) => <div ref={ref} />}</FocalTarget>
171171
</Baba>;
172172
```
173173

@@ -199,15 +199,15 @@ import { Collector } from 'yubaba';
199199

200200
Transitioning visually similar elements from one place to another.
201201

202-
#### Move ([example](https://yubaba.netlify.com/?selectedKind=yubaba%2FFLIPMove&selectedStory=Default&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fnotes%2Fpanel))
202+
#### Move ([example](https://yubaba.netlify.com/?selectedKind=yubaba%2FMove&selectedStory=Default&full=0&addons=1&stories=1&panelRight=1&addonPanel=storybook%2Fnotes%2Fpanel))
203203

204-
[Docs](https://yubaba.netlify.com/typedoc/classes/flipmove.html) | [Props](https://yubaba.netlify.com/typedoc/interfaces/flipmoveprops.html)
204+
[Docs](https://yubaba.netlify.com/typedoc/classes/Move.html) | [Props](https://yubaba.netlify.com/typedoc/interfaces/Moveprops.html)
205205

206206
Will transition the destination element **from** the origin element position.
207207

208208
```jsx
209209
// origin-element.js
210-
import Baba, { FLIPMove as Move } from 'yubaba';
210+
import Baba, { Move } from 'yubaba';
211211

212212
<Baba name="move">
213213
<Move>{baba => <div {...baba} />}</Move>
@@ -277,13 +277,13 @@ import Baba, { Reveal, Target } from 'yubaba';
277277
</Baba>;
278278

279279
// destination-element.js
280-
import Baba, { Target, Noop } from 'yubaba';
280+
import Baba, { FocalTarget, Noop } from 'yubaba';
281281

282282
<Baba name="reveal">
283283
<Noop>
284284
{baba => (
285285
<div {...baba}>
286-
<Target>{target => <div {...target} />}</Target>
286+
<FocalTarget>{target => <div {...target} />}</FocalTarget>
287287
</div>
288288
)}
289289
</Noop>
@@ -307,13 +307,13 @@ import Baba, { RevealMove } from 'yubaba';
307307
</Baba>;
308308

309309
// destination-element.js
310-
import Baba, { Target, Noop } from 'yubaba';
310+
import Baba, { FocalTarget, Noop } from 'yubaba';
311311

312312
<Baba name="reveal-move">
313313
<Noop>
314314
{baba => (
315315
<div {...baba}>
316-
<Target>{target => <div {...target} />}</Target>
316+
<FocalTarget>{target => <div {...target} />}</FocalTarget>
317317
</div>
318318
)}
319319
</Noop>
@@ -326,17 +326,17 @@ import Baba, { Target, Noop } from 'yubaba';
326326

327327
Useful for transitioning from a child to a parent,
328328
will shrink from the container to the focal element.
329-
Requires the use of the [Target](#target) component to specify the focal element.
329+
Requires the use of the [FocalTarget](#focaltarget) component to specify the focal element.
330330

331331
```jsx
332332
// origin-element.js
333-
import Baba, { Target, ConcealMove } from 'yubaba';
333+
import Baba, { FocalTarget, ConcealMove } from 'yubaba';
334334

335335
<Baba name="conceal-move">
336336
<ConcealMove>
337337
{baba => (
338338
<div {...baba}>
339-
<Target>{target => <div {...target} />}</Target>
339+
<FocalTarget>{target => <div {...target} />}</FocalTarget>
340340
</div>
341341
)}
342342
</ConcealMove>

packages/yubaba-examples/src/parentChild/emailThreads/stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { findDOMNode } from 'react-dom';
33
import { storiesOf } from '@storybook/react';
44
import { withMarkdownNotes } from '@storybook/addon-notes';
55
import { MemoryRouter, Route, Switch } from 'react-router-dom';
6-
import Baba, { RevealMove, ConcealMove, Target } from 'yubaba';
6+
import Baba, { RevealMove, ConcealMove, FocalTarget as Target } from 'yubaba';
77
import * as Common from 'yubaba-common';
88
import MenuIcon from '@material-ui/icons/Menu';
99
import SearchIcon from '@material-ui/icons/Search';

packages/yubaba-examples/src/parentChild/imageSearch/stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import BackIcon from '@material-ui/icons/Close';
55
import { IconButton } from '@material-ui/core';
66

77
import * as Common from 'yubaba-common';
8-
import Baba, { FLIPMove, BabaManager } from 'yubaba';
8+
import Baba, { Move, BabaManager } from 'yubaba';
99
import * as Styled from './styled';
1010

1111
const Image: React.StatelessComponent<Styled.ImageProps> = ({
@@ -19,7 +19,7 @@ const Image: React.StatelessComponent<Styled.ImageProps> = ({
1919
<Styled.Root>
2020
<Styled.ImageContainer>
2121
<Baba name={title} in={inn}>
22-
<FLIPMove>
22+
<Move>
2323
{({ ref, style }) => (
2424
<Styled.Img
2525
src={src}
@@ -28,7 +28,7 @@ const Image: React.StatelessComponent<Styled.ImageProps> = ({
2828
style={{ ...style, opacity: selected ? 0 : (style.opacity as any) }}
2929
/>
3030
)}
31-
</FLIPMove>
31+
</Move>
3232
</Baba>
3333

3434
<Styled.ImageBack />
@@ -53,9 +53,9 @@ const ImagePage: React.StatelessComponent<Styled.ImageProps> = ({ src, title, on
5353
</IconButton>
5454

5555
<Baba name={title}>
56-
<FLIPMove>
56+
<Move>
5757
{({ ref, style }) => <Styled.PageImage src={src} innerRef={ref} style={style} />}
58-
</FLIPMove>
58+
</Move>
5959
</Baba>
6060

6161
<Styled.ContentContainer>

packages/yubaba-examples/src/parentChild/musicPlayer/Album.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import styled from 'styled-components';
33
import StarIcon from '@material-ui/icons/StarBorder';
4-
import Baba, { FLIPMove as Move, CircleExpand, Collector } from 'yubaba';
4+
import Baba, { Move as Move, CircleExpand, Collector } from 'yubaba';
55
import { Album as AlbumData } from './data';
66
import { IconButton } from '@material-ui/core';
77

packages/yubaba-examples/src/parentChild/musicPlayer/AlbumDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import MoreVert from '@material-ui/icons/MoreVert';
1414
import StarIcon from '@material-ui/icons/StarBorder';
1515
import { lighten, readableColor } from 'polished';
1616
import { Album as AlbumData } from './data';
17-
import Baba, { FLIPMove as Move, CircleShrink, Wait, Collector } from 'yubaba';
17+
import Baba, { Move as Move, CircleShrink, Wait, Collector } from 'yubaba';
1818

1919
interface Props extends AlbumData {
2020
onClick?: () => void;

packages/yubaba-examples/src/transformation/search/stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { storiesOf } from '@storybook/react';
3-
import Baba, { FLIPMove as Move } from 'yubaba';
3+
import Baba, { Move as Move } from 'yubaba';
44
import { Toggler } from 'yubaba-common';
55
import * as Styled from './styled';
66

packages/yubaba-examples/src/transformation/select/stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import Select from 'react-select';
4-
import Baba, { FLIPMove as Move } from 'yubaba';
4+
import Baba, { Move as Move } from 'yubaba';
55
import { Toggler } from 'yubaba-common';
66
import * as Styled from './styled';
77
import data from './data';

packages/yubaba/src/Baba/test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import { mount } from 'enzyme';
33
import 'jest-enzyme';
44
import { Baba } from '../Baba';
5-
import Target from '../Target';
5+
import Target from '../FocalTarget';
66
import { getElementSizeLocation } from '../lib/dom';
77
import defer from '../lib/defer';
88
import * as utils from '../__tests__/utils';
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import * as React from 'react';
22
import { CollectorContext, SupplyRefHandler } from '../Collector';
33
import noop from '../lib/noop';
44

5-
interface TargetChildProps {
5+
interface FocalTargetChildProps {
66
ref: SupplyRefHandler;
77
}
88

9-
interface TargetProps {
10-
children: (props: TargetChildProps) => React.ReactNode;
9+
interface FocalTargetProps {
10+
children: (props: FocalTargetChildProps) => React.ReactNode;
1111
}
1212

13-
export default class Target extends React.Component<TargetProps> {
13+
export default class Target extends React.Component<FocalTargetProps> {
1414
render() {
1515
return (
1616
<CollectorContext.Consumer>

0 commit comments

Comments
 (0)