Commit Graph

571 Commits

Author SHA1 Message Date
Lucas Vieira
decbedbd82 feat: allow List.Accordion to behave as a controlled component (#638)
fixes #616, #635
closes #618
2018-11-05 22:13:41 +01:00
Andrei Barabas
8764f60370 fix: add tests for snackbar visibility on mount 2018-11-05 15:33:32 +01:00
Satyajit Sahoo
e4a48ba7dc test: fix bottom navigation tests 2018-11-05 15:28:10 +01:00
Brent Vatne
627aa90c2b Fix tab focus animation bug from react-native@~0.57 on Android (#637)
* Fix tab focus animation bug from react-native@~0.57
https://github.com/react-navigation/react-navigation-material-bottom-tabs/issues/22

* Add a comment to provide context for the change
2018-11-05 15:23:19 +01:00
Satyajit Sahoo
5265fb4e52 chore: upgrade deps 2018-11-05 15:10:54 +01:00
doomsower
37d911118d fix: ts declaration of TouchableRipple (#615)
* fix: ts declaration of TouchableRipple
2018-10-24 13:03:31 +02:00
Dawid
8c13f84387 feat: provide nice error message for users that use Portal without Provider. (#622)
### Motivation

This PR makes clear what is the cause of app crash when user doesn't wrap his components' tree with Provider component.

### Test plan

Render Portal component without wrapping components' tree with Provider component.
Nice error message with link to our docs will be presented.
2018-10-24 12:30:38 +02:00
Julian Hundeloh
d3d17e7f5a fix: make example typescript compatible (#623)
### Motivation

Other PRs break because of this (e.g. see `typescript` deploy script at https://github.com/callstack/react-native-paper/pull/620)

### Test plan

Run `yarn typescript` and it should not break anymore.
2018-10-23 18:08:48 +02:00
Julian Hundeloh
a4579bdb4c fix: hidden snackbar if initially visible (#621)
Problem: snackbar stays hidden if the `visible` property is initially `true`
2018-10-23 14:13:10 +02:00
Bruno Castro
706c13d888 fix: TextInput example (accept upperCase and lowerCase letters) (#619)
It should accept both uppercase and lowercase letters
2018-10-23 08:56:57 +02:00
Satyajit Sahoo
b980c365f7 fix: grow text input to fill available space. fixes #612 2018-10-18 16:56:58 +02:00
Satyajit Sahoo
5a51af4378 fix: fix helper text not shown the first time it's visible 2018-10-18 16:54:26 +02:00
Bruno Castro
56840ee6bf fix: don't update TextInput content if it's not editable (#608)
Prevent component to update current value when it isn't editable

Resolves #589
2018-10-18 16:20:47 +02:00
Rajendran Nadar
39ceec618c docs: add keyboardavoidingview to text input example (#588)
Added KeyBoardAvoidingView because it is hard to check the last TextInput in the example
2018-10-18 16:02:43 +02:00
Yukiya Nakagawa
2969b1d062 fix: fix Snackbar static constants type for typescript (#609)
### Motivation

Below `Snackbar` usage has error.

<img width="332" alt="2018-10-18 20 18 21" src="https://user-images.githubusercontent.com/434227/47150896-19790100-d313-11e8-8794-256703ab654b.png">

And error message:

```
path/to/my/component.tsx:131:17 - error TS2322: Type 'string' is not assignable to type 'number | undefined'.

131                 duration={Snackbar.DURATION_SHORT}
                    ~~~~~~~~

  node_modules/react-native-paper/typings/components/Snackbar.d.ts:10:3
    10   duration?: number;
         ~~~~~~~~
    The expected type comes from property 'duration' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Snackbar> & Readonly<{ children?: ReactNode; }> & Readonly<SnackbarProps>'
```

Because `duration` was defined as a `string` in the type definition file. I fixed it.

### Test plan

Typecheck for below jsx.

```jsx
<Snackbar
    visible={true}
    duration={Snackbar.DURATION_SHORT}>
    Foo
</Snackbar>
```
2018-10-18 14:17:46 +02:00
Andrew Durber
0697fb6ee2 fix: Always show error outline when including when unfocused (#595) (#598)
### Motivation

TextInput with outline in an error state should correctly indicate an error when unfocused. This would also close #595 

### Test plan

It could also be possible to add a different prop `keepOutline` (not 100% on the name) instead of relying on the error state. However I'm unsure how that might be useful. 

![focused-cropped](https://user-images.githubusercontent.com/5732291/46907418-eea13e00-cf09-11e8-8a16-725ef016f88c.png)
![unfocused-cropped](https://user-images.githubusercontent.com/5732291/46907419-eea13e00-cf09-11e8-9539-95020b73ec71.png)
2018-10-13 19:24:55 +02:00
Altaf Shaikh
ee954e8a8d fix: RadioButton dialog example should use status props. (#592)
* fix: use correct props in radio button dialog example

* fix: use correct props in radio button dialog example
2018-10-12 08:23:04 +02:00
Satyajit Sahoo
ec19ad1a05 chore: release 2.1.3 v2.1.3 2018-10-11 14:29:30 +02:00
Satyajit Sahoo
1cf7ae9b1a chore: fix publishing to npm 2018-10-11 14:27:52 +02:00
Kacper Wiszczuk
b21596c51c fix: upgrade react-theme-provider (#584) 2018-10-09 12:04:26 +02:00
Dawid
e8ac805186 chore: update expo to latest version. (#580)
This PR upgrades expo in example app to latest version.

Actually, there is no issue for that, but It's good to use latest stable version of libraries.
2018-10-08 10:58:17 +02:00
Satyajit Sahoo
295a7719c5 chore: generate changelog with conventional-changelog 2018-10-08 03:48:29 +02:00
Satyajit Sahoo
10cb0b201c chore: release 2.1.2 v2.1.2 2018-10-08 03:29:29 +02:00
Satyajit Sahoo
53b5c0f681 chore: automate release with relase-it. fixes #275 2018-10-08 03:28:02 +02:00
Kacper Wiszczuk
0837f8c2e8 fix: fix Typescript withTheme return type (#582)
Fix Typescript type for `withTheme`.

```typescript
const Wrapped = withTheme(Component);
render = () => <Wrapped theme={somePartialTheme} />
```
2018-10-07 21:56:31 +02:00
Dawid
4e9056286b fix: fix small issue in docs (Showcase section). (#581)
While i was trying to update React and Flow versions, i found a small issue in docs.  We were trying to access `android` and `ios` properties on wrong object.
2018-10-07 19:55:25 +02:00
Kacper Wiszczuk
0a2349ad9c fix: fix types for component wrapping other components (#579)
Fixes #578
2018-10-07 13:41:49 +02:00
Satyajit Sahoo
6a334ad212 chore: release 2.1.1 v2.1.1 2018-10-05 17:00:12 +02:00
Kacper Wiszczuk
6b6a3d1383 fix: fix withTheme typescript type (#577) 2018-10-05 16:52:01 +02:00
Satyajit Sahoo
0c40b6e511 chore: release 2.1.0 v2.1.0 2018-10-04 17:24:16 +02:00
Lucas Vieira
23d2761bbe fix: fix caption font size (#572)
Fixes #563
2018-10-04 15:13:36 +02:00
Grzegorz Gawrysiak
b4fe2b5f7d fix: Card action buttons alignment (#559)
### Motivation

Fixes #556. It appears like the default card actions padding is slightly wrong. The issue affects buttons as well.

This is somehow a possibly minor, but breaking change for existing projects, so I'll try to explain what's going on.

### Resources

Cards
![screen shot 2018-09-27 at 22 50 47](https://user-images.githubusercontent.com/7827311/46173876-d2659600-c2a7-11e8-8506-1b95d17a58c2.png)
According to MD guidelines the card actions padding is 8. The content's padding is 16. Cards use the "compact" buttons with smaller padding - 8 instead of standard 16.

Buttons
![screen shot 2018-09-27 at 22 09 27](https://user-images.githubusercontent.com/7827311/46172613-3d14d280-c2a4-11e8-8f7d-502c4f007cf8.png)
The standard horizontal padding is 16. Although it's different for card action buttons. Notice the min-width value, which is 64, but the buttons section doesn't really describe the compact buttons.

### Solution

The example provided by @brunohkbx presented a case where it got caught into the min-width trap. The text was too small and caused a larger button padding. If you run this [expo snack](https://snack.expo.io/HyqcT35KX), it presents the same case, just with different button text. First goes too far to the right, second goes too far to the left.

The first thing to fix was the card actions padding - switch from 4 to 8. It results in:
<img width="377" alt="screen shot 2018-09-27 at 22 21 01" src="https://user-images.githubusercontent.com/7827311/46172934-2a4ecd80-c2a5-11e8-9364-17911a79cce3.png">
So it works for the expo examples case, but not really for the [mentioned issue](#556). It still gives an extra button padding due to too short text (min-width).

After removing the min-width from compact buttons, it seems like it's finally there:
<img width="376" alt="screen shot 2018-09-27 at 22 13 03" src="https://user-images.githubusercontent.com/7827311/46173141-b95be580-c2a5-11e8-88dd-82a15f5981a5.png">

Finally, it also switches the dialog actions to 8 padding, since that's basically the same thing.

### Test plan

https://snack.expo.io/HydBnn5t7
Snapshot tests updated
2018-10-04 14:25:31 +02:00
Grzegorz Gawrysiak
526b8c1544 fix: Fix flow issues with ref (#551) 2018-10-04 12:19:25 +02:00
Waquid Valiya Peedikakkal
60e0782981 feat: RTL usage for icons (#566) 2018-10-04 12:08:24 +02:00
Kacper Wiszczuk
9e0fe32e14 feat: add typescript support (#561) 2018-10-04 12:04:10 +02:00
Dawid
224d473e51 docs: improve docs for fab component by adding styles. (#568)
* docs: improve docs for fab component by adding styles.

* refactor: remove unecessary white space.

* refactor: improve fab docs.
2018-10-03 11:52:55 +02:00
Kacper Wiszczuk
ce97029dc9 fix: Update test snapshots (#558) 2018-09-27 22:31:00 +02:00
Dawid
d3a7c48eee Add implementation of banner component. (#441)
* feat: initial implementation of banner component.

* feat: add props description.

* refactor: Change the way banner is structured.

* refactor: small refactor of banner component and example.

* refactor: remove some not needed logic from banner and add example.

* refactor: refactor of banner props description and little clean up in component.

* refactor: simplify implementation of banner

* feat: add snapshot tests for banner.

* feat: add banner gif.

* fix: fix example.

* fix: reduce banner gif size.

* fix: reduce gif size even more.
2018-09-27 13:58:08 +02:00
Iyad Thayyil
de7b124922 fix: Surface View to Animated.View (#557) 2018-09-26 22:15:37 +02:00
Kacper Wiszczuk
768094119c feat: add custom render to TextInput component 2018-09-26 15:56:40 +02:00
Satyajit Sahoo
9966be7704 chore: fix lint 2018-09-26 15:51:10 +02:00
Drew Rothstein
2397715aa4 feat: add onLongPress to Card (#538)
* feat: add onLongPress to Card

* feat: add onLongPress to Card: disable correction

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md
2018-09-25 10:49:58 +03:00
Satyajit Sahoo
41cb7165dd fix: StatusBar.currentHeight is Android-only 2018-09-21 13:55:06 +02:00
Grzegorz Gawrysiak
f145b98eab fix: Remove style prop from touchable (#550) 2018-09-20 12:45:25 +02:00
Tomasz Czajęcki
81b0177f0b docs: fix wrong URL to 'getting started' (#545)
I've noticed that link to the _getting started_ page in the docs seems to not working as expected since `*.html` extension is added anyway and it makes the link broken:
`https://callstack.github.io/react-native-paper/getting-started.html.html`.

### Motivation

The documentation is important part of the library and should be working properly.

### Test plan

Enter `/docs`, install using `yarn` and run it with `yarn start`.

> **NOTE:** _the current version works on localhost and breaks only in the prod env. Suggested change will probably work in both, but needs to be verified by someone who knows the deployment process._
2018-09-13 12:52:07 +02:00
Antonio Moreno Valls
241ddb3e8c docs: update RadioButton docs with new version 2.0.1 (#542)
### Motivation

Update documentation with new version `2.0.1` of `react-native-paper`. RadioButton props are quite different from version 1 to 2, so docs needed an update.
### Test plan

See docs.
2018-09-11 17:18:09 +02:00
Satyajit Sahoo
7b27b7cde7 chore: release v2.0.1 v2.0.1 2018-09-05 11:02:21 +02:00
Satyajit Sahoo
70f37b8785 fix: get label's background color from backgroundColor style of input 2018-09-04 19:59:40 +02:00
Satyajit Sahoo
b82f183178 docs: add more screenshots 2018-09-04 19:59:40 +02:00
Dawid
6afc38e8b1 fix: fix issue with sibling components being clipped. fixes #527 2018-09-04 16:19:08 +02:00