Commit Graph

44 Commits

Author SHA1 Message Date
Peter Abbondanzo 3d7973a3e6 Add focus/blur example to RNTester (#51634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51634

Creates an example in the ViewExample setup for how onBlur/onFocus behave when using keyboard navigation

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D75238317

fbshipit-source-id: e69122ca17727fc7f71e9bb7a09098a2771b098e
2025-05-28 21:29:51 -07:00
Tim Yung 1977dd6596 RN: Sort Pragmas in Headers (#51554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51554

Sorts pragma directives file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264593

fbshipit-source-id: 9e4b253dd0fc94dc2fc469d7114b93a8aae305f4
2025-05-22 21:18:53 -07:00
Nick Gerleman b91565dc5d Add box shadow examples which use objects and PlatformColor (#49504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49504

We didn't have these cases before.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D69433955

fbshipit-source-id: 3915b63ec6972412f1882d796ae60035bb5192f3
2025-02-18 18:56:12 -08:00
Joe Vilches a733930017 Add e2e tests for fixed transform cases (#49318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49318

tsia see previous diffs for fix. Added more tests to box shadow, filter, and borders

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D69416675

fbshipit-source-id: ae1e33750b56c1a4720e04e29fc110f1e11c0b3d
2025-02-11 15:44:59 -08:00
Dawid Małecki f36bfe5dfa Remove redundant {||} syntax (#48686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
2025-01-15 07:07:01 -08:00
Nick Gerleman 06751aa0d1 "experimental_layoutConformance" ViewProp -> "experimental_LayoutConformance" component (#48188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48188

Yoga is full of bugs! Some of these bugs cannot be fixed without breaking large swaths of product code. To get around this, we introduced "errata" to Yoga as a mechanism to preserve bug compatibility, and an `experimental_layoutConformance` prop in React Native to create layout conformance contexts. This has allowed us to create more compliant layout behavior for XPR.

This prop was originally designed as a context-like component, so you could set a conformance level at the root of your app, and individual components could change it for compatibility. This was difficult to achieve at the time, without introducing a primitive like `LayoutConformanceView`, which itself participated in the view tree. This prop has not been the desired end-goal, since it does not make clear that it is setting a whole new context, effecting children as well!

Now that we've landed support for `display: contents`, we can achieve this desired API pretty easily.

**Before**

```
import {View} from 'react-native';

// Root of the app
<View {...props} experimental_layoutConformance="strict">
  {content}
</View>

```

**After**

```
import {View, experimental_LayoutConformance as LayoutConformance} from 'react-native';

// Root of the app
<LayoutConformance mode="strict">
  <View {...props}>
    {content}
  </View>
</LayoutConformance>

```

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D66910054

fbshipit-source-id: e6a304b5c30ad3c5845a7ce2d1021996a74c2f34
2024-12-12 14:57:04 -08:00
Tim Yung c9ea05552f RN: Fix lint/sort-imports Errors (#47109)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47109

Fixes the `lint/sort-imports` errors that are now surfaced after fixing the lint configuration.

For a couple files, I added lint suppressions instead because the unsorted import ordering is important due to interleaved calls with side effects.

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D64569485

fbshipit-source-id: 26415d792e2b9efe08c05d1436f723faae549882
2024-10-18 04:07:02 -07:00
Peter Abbondanzo 09682b5109 Fix dark mode text (#46898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46898

Replaces *many* `Text` component usages with `RNTesterText`: a thin wrapper around `Text` that applies color based on the color scheme chosen by the user. It makes text legible for dark mode across 41 different example files. This changes intentionally do not touch a few larger component sites that expand beyond RNTester, like `Animated` and `NewAppScreen`

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64053464

fbshipit-source-id: 9516fef2afe1b364eb38e85e3a2dbb5c434e44db
2024-10-10 11:02:18 -07:00
Joe Vilches 3f1e381ded Add RNTester box sizing example and e2e test round 2
Summary:
Add the tests back!

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63844898

fbshipit-source-id: 6c08557e54be01a1dc156cf72f187a5bb6c5d791
2024-10-04 17:07:05 -07:00
Joe Vilches 32dd52e027 Back out "Add RNTester box sizing example and e2e test" (#46795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46795

Original commit changeset: d7bb6f115bca

Original Phabricator Diff: D63471840

See previous diff, there were some problems

Changelog: [Internal]

Differential Revision: D63777438

fbshipit-source-id: ea9f370eade10282fcee84d07d709b549dde1b6d
2024-10-02 15:56:38 -07:00
Joe Vilches e1246f04d1 Add RNTester box sizing example and e2e test (#46765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46765

Tests are good!

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63471840

fbshipit-source-id: d7bb6f115bcae502e9f8b5ce2a12df8e850d5c26
2024-10-01 15:19:22 -07:00
Jorge Cabiedes Acosta 1288e38423 Implement outline properties on iOS (#46444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46444

This diff adds:

`outline-width`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-width
`outline-color`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-color
`outline-style`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-style
`outline-offset`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset

Using `BackgroundStyleApplicator`

Changelog: [iOS] [Added] - Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset`

Reviewed By: joevilches

Differential Revision: D62273339

fbshipit-source-id: 0ed775218e7d1dfb13bbf1760bc6ec331a388b64
2024-09-19 16:41:46 -07:00
Joe Vilches 7e38cf32eb Fix crash that happens with shadow color with 0 alpha (#46551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46551

We crash if we pass a shadow color with 0 alpha due to some divide by 0 logic. This fixes that for inset and outset shadows and adds a test for that case.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D62899047

fbshipit-source-id: 2aff1d016dd97bed024df1c3f89bcc62e49f0306
2024-09-18 16:44:45 -07:00
Jorge Cabiedes Acosta 17faac4170 Implement outline properties on Android (#46284)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46284

This diff adds:

`outline-width`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-width
`outline-color`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-color
`outline-style`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-style
`outline-offset`: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset

Using `BackgroundStyleApplicator`

Changelog: [Android] [Added] - Outline properties `outline-width`, `outline-color`, `outline-style` & `outline-offset`

Reviewed By: NickGerleman

Differential Revision: D61293868

fbshipit-source-id: d8787bbf1560cf46b92ad039afde9c1e7ab669da
2024-09-13 17:26:37 -07:00
Jorge Cabiedes Acosta 2241c3146f Remove experimental_ prefix from boxShadow (#46404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46404

As title

Second attempt to rename the prop. BoxShadow caused no issues after renaming but it was batched with `filter` which we reverted.

Changelog: [General] [Changed] - Add official `boxShadow` CSSProperty.

Reviewed By: NickGerleman, cyan33

Differential Revision: D62400814

fbshipit-source-id: ad721f6d11d614e987048e55556b05ff74a4747d
2024-09-11 16:01:06 -07:00
Jorge Cabiedes Acosta acbde249b7 Revert D61726506 (#46266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46266

This diff reverts D61726506
T200279372

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61986793

fbshipit-source-id: bbf462b79192b67801a6cf56727f8f43ade8fd56
2024-08-29 20:34:19 -07:00
Jorge Cabiedes Acosta 6fa54f9b5d Remove experimental_ prefix from boxShadow and filter (#46245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46245

As title

Changelog: [General] [Changed] - Add official `boxShadow` and `filter` CSS properties

Reviewed By: cipolleschi

Differential Revision: D61726506

fbshipit-source-id: 8ee7a95d95a66f1f890a5ebb6791da73219b2c52
2024-08-28 23:03:41 -07:00
Jorge Cabiedes Acosta 4075418c14 Add support for assymetrical border radii when using % (#46009)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46009

as title

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61148739

fbshipit-source-id: 7cc37f98ab441df2e0df7cfa0415791cb642caaf
2024-08-22 21:03:28 -07:00
Joe Vilches d490354cd8 Add View box shadow e2e tests (#46054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46054

tsia, more test = good

Changelog: [Internal]

Reviewed By: necolas

Differential Revision: D60938608

fbshipit-source-id: abce5ab7d42a7f7f626f0edc852aa1374f8029f0
2024-08-15 20:59:11 -07:00
Jorge Cabiedes Acosta d69dbd6f15 Add support for assymetrical bonder radii when using % (#45985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45985

As title.

We can now create ellipses when using percentages. The algorithm for this is still flawed and to get it to be a 1:1 to web it will probably require a re-write of some of the logic but this should get us closer for now.

Some examples:

1. Border thinning on large single corner radii (100%)
 {F1798145800}
2. Thinning gets worse when having irregular border colors (100%)
 {F1798148002}

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61025927

fbshipit-source-id: 218d44af014bc8351c329ff1bca82658aebac38c
2024-08-15 12:35:15 -07:00
Gijs Weterings f4ec8cbdba Add rntester_android as a valid app in ReactNativeCoreE2ESetup
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D54662740

fbshipit-source-id: f845b127dc1cf5ef509eebea29c1c495a9ceb763
2024-05-29 07:06:19 -07:00
Gijs Weterings 143e31058c Fix xplat/endtoend/jest-e2e/apps/facebook_xplat/ReactNativeCoreE2E/__tests__/Border-corner-radii-elevation-percentages-e2e.js to actually use the right example (#44525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44525

These examples were added, but their names were duplicated. This caused our internal e2e tests to accidentally target the wrong examples.

Changelog:
[General][Fixed] RNTester examples for border percentages are now properly covered by E2E screenshot tests.

Reviewed By: NickGerleman

Differential Revision: D57207306

fbshipit-source-id: 32ed5cc6b136a8928b11afe8b824c752edcdd9e5
2024-05-10 09:38:34 -07:00
Jorge Cabiedes Acosta 9c4ee6df08 Add support for percentage on borderRadius ViewStyle props (#44140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44140

Why?
Previously we didn't support using percentages like:
```
style={{
  width=100,
  height=100,
  borderRadius='100%',
}}
```

These percentages refer to the corresponding dimension of the border box.

What?
Change the unit type for `BorderRadii` values to `ValueUnit`. This type allows us to have an object containing a `float`, and a `UnitType` properties. With this we conditionally calculate the corresponding point (dp) value for a given percentage (considering size). Ex:

```
result = {raw_percentage_value} / 100 * (max(height, width))
```

We know the maximum border radius for our current implementation is half the dp of the shorter side of our view, hence why we consider half our maximum view side as equivalent to 100%.

Note: We still don't support vertical/horizontal border radii

## Changelog:

[iOS][Added] - Added support for using percentages when defining border radius related properties.

Reviewed By: NickGerleman

Differential Revision: D56198302

fbshipit-source-id: 6cd510b1c7164dcb82ca5ad8a9861c5ce5c8b15b
2024-04-26 13:34:37 -07:00
Joe Vilches dc2e552a94 Add static zIndex example and e2e test to Catalyst (#42317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42317

Added a complicated zIndex test and corresponding screenshot test for it.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D52439963

fbshipit-source-id: 54bc8cfc9aa2e3c985279fe43027b3db88057c68
2024-01-18 21:22:05 -08:00
Samuel Susla 4885743998 use Pressable over TouchableWithoutFeedback (#42016)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42016

changelog: [internal]

TouchableWithoutFeedback is broken with React 18. Before we fix it, let's use Pressable in tests.

Reviewed By: fkgozali

Differential Revision: D52328529

fbshipit-source-id: 1d7d5032ffaf7f8ff5ffa47af2a87b733fd2e840
2023-12-21 06:37:23 -08:00
Kevin Gozali 08c916d52f ReactNativeCoreE2E: hardcode testIDs for View tests (#42026)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42026

Previously, the examples allow overriding the testIDs for each inner example from ViewExample.js in RNTester. However, that setup relies on another infra/abstraction to inject the testIDs properly. For simplicity, let's just make them hardcoded using the pattern view-test-<example-name>.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D52349100

fbshipit-source-id: 09d51935318d0592a9aae7da61cab0c87ac69152
2023-12-20 18:33:13 -08:00
Nick Gerleman 11d3e11a4a Add E2E Test for experimental_layoutConformance (#42002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42002

Adds an E2E test on top of the RNTester example for this (as a practice we should probably do this for new examples).

I didn't add unit tests for this originally, but probably should do that as well if it gets more interesting...

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D51639134

fbshipit-source-id: 379d95dfc676252e10b7076e294ac5534c6f06bf
2023-12-19 14:50:41 -08:00
Gijs Weterings e5df45c1c5 Stabilize View-backface-visibility-e2e.js (#41785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41785

Changelog: [Internal] modify backface visibility e2e test to comfortably fit within user viewport

Reviewed By: makovkastar

Differential Revision: D51806469

fbshipit-source-id: a8a8a1426a154b452c29df07561b7302f3150bd1
2023-12-04 10:51:58 -08:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Nick Gerleman f965da97f3 Add experimental_layoutConformance prop (#38746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38746

This adds a view prop which controls the layout conformance of it and its transitive children (including non-view ShadowNodes).

The implementation here is to traverse down before layout, updating any context-specific configuration.

Normally at the time of layout, unchanged child ShadowNodes are already sealed. These must be mutated already if layout results change, and we do this today via Yoga node clone callback, where Yoga clones nodes where it will do layout work (but not all of them).

We down-propagate configuration, but can terminate if we observe an already sealed node whose values match those of our current context, since any nodes under must also follow the same contexts (or any nested contexts of the sealed node).  This means that calling `layoutTree()` on a mostly clean ShadowTree will cause configuration to not traverse most nodes.

`Errata` and `PointScaleFactor` (DPI) are threaded to each Node's per-node config. The same values are retained when Yoga nodes are cloned (by cloning the ShadowNode). Since these are set before the first layout, config setting should only ever dirty layout [when layout-effecting values change](https://www.internalfb.com/code/fbsource/[1c95e981c740]/xplat/yoga/yoga/YGConfig.cpp?lines=13).

The prop is prefixed with `experimental` because we are likely to make more breaking conformance fixes in the strict mode, and I'm not sure this is the final API yet. I was previously looking at a context-like component which is more challenging to implement.

Changelog: [Internal]

bypass-github-export-checks

Reviewed By: rozele, sammy-SC

Differential Revision: D47940100

fbshipit-source-id: f72e1c73f537e0312c2bba19ae8c2e882c82aced
2023-08-07 19:37:41 -07:00
Luna Wei 2910f87b58 JestE2E: Add view screenshots
Summary: Changelog: [Internal] - Add e2e snapshot testing for our View examples on rntester

Reviewed By: NickGerleman

Differential Revision: D47073356

fbshipit-source-id: 979d34227a5ae77d2d03636d40617b7ecf44c28e
2023-07-03 13:24:11 -07:00
Ana Margarida Silva 1d51032278 fix: border rendering problem in Android (#36129)
Summary:
Fixes https://github.com/facebook/react-native/issues/36036

The problem was in `ReactViewBackgroundDrawable.java` that was not accounting for adjacent borders that add width set to 0.

## Changelog

[Android] [Fixed] - Fix border rendering issue when bottom borders has no width

Pull Request resolved: https://github.com/facebook/react-native/pull/36129

Test Plan:
| Previously | Now with the fix  |
| --------------- | --------------- |
| <img width="417" alt="image" src="https://user-images.githubusercontent.com/25725586/218149384-00e2145c-3c84-4590-87be-3258574489e5.png"> | <img width="414" alt="image" src="https://user-images.githubusercontent.com/25725586/218148215-a8d37158-0feb-47ae-874b-cba2f422d792.png">  |

Reviewed By: cipolleschi

Differential Revision: D43303228

Pulled By: javache

fbshipit-source-id: cf9d30fe12a5740d9ee8974a66904fd0850e7606
2023-02-16 08:09:22 -08:00
gabrieldonadel 597a1ff60b feat: Add logical border block color properties (#35999)
Summary:
This PR implements logical border block color properties as requested on https://github.com/facebook/react-native/issues/34425. This implementation includes the addition of the following style properties

- `borderBlockColor`, equivalent to `borderTopColor` and `borderBottomColor`.
- `borderBlockEndColor`, equivalent to `borderBottomColor`.
- `borderBlockStartColor`, equivalent to `borderTopColor`.

## Changelog

[GENERAL] [ADDED] - Add logical border block color properties

Pull Request resolved: https://github.com/facebook/react-native/pull/35999

Test Plan:
1. Open the RNTester app and navigate to the `View` page
2. Test the new style properties through the `Logical Border Color` section

<table>
<tr>
    <td>Android</td>
    <td>iOS</td>
</tr>
  <tr>
    <td><video src="https://user-images.githubusercontent.com/11707729/215384882-5b96518e-ad70-4157-a7f3-130f488cc41c.mov"  alt="1" width="360px"   />
    </td>
<td>
<video src="https://user-images.githubusercontent.com/11707729/215392728-cfc6a097-26c1-4ffe-ab0e-f0a5a71a902d.mov"2" width="360px"  />
</td>
   </tr>
</table>

Reviewed By: cipolleschi

Differential Revision: D42849911

Pulled By: jacdebug

fbshipit-source-id: 822cff5264689c42031d496105537032b5cd31ef
2023-01-31 10:58:24 -08:00
Gabriel Donadel Dall'Agnol 9669c10afc feat: Add Fabric implementation of inset logical properties (#35692)
Summary:
This PR implements `inset` logical properties as requested on https://github.com/facebook/react-native/issues/34425. This implementation includes the addition of the following style properties

- `inset`, equivalent to `top`, `bottom`, `right` and `left`.
- `insetBlock`, equivalent to `top` and `bottom`.
- `insetBlockEnd`, equivalent to `bottom`.
- `insetBlockStart`, equivalent to `top`.
- `insetInline`, equivalent to `right` and `left`.
- `insetInlineEnd`, equivalent to `right` or `left`.
- `insetInlineStart`, equivalent to `right` or `left`.

## Changelog

[GENERAL] [ADDED] - Add Fabric implementation of inset logical properties

Pull Request resolved: https://github.com/facebook/react-native/pull/35692

Test Plan:
1. Open the RNTester app and navigate to the `View` page
2. Test the new style properties through the `Insets` section

<table>
<tr>
    <td>Android</td>
    <td>iOS</td>
</tr>
  <tr>
    <td><img src="https://user-images.githubusercontent.com/11707729/208821212-fbbac6ed-09a4-43f4-ba98-dfd2cbabf044.png"  alt="1" width="360px"   />
    </td>
<td>
<img src="https://user-images.githubusercontent.com/11707729/208816997-ef044140-8824-4b1b-a77b-085f18ea9e0e.png" alt="2" width="360px"  />
</td>
   </tr>
</table>

Reviewed By: NickGerleman

Differential Revision: D42193661

Pulled By: ryancat

fbshipit-source-id: 3db8bcd2c4db0ef4886b9ec49a46424d57362620
2022-12-21 20:07:35 -08:00
Nishan 9f3a3e13cc feat: flex gap bindings (#34974)
Summary:
This PR adds React native binding for https://github.com/facebook/yoga/pull/1116

## Changelog

[General] [Added] - Flex gap yoga bindings

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Pull Request resolved: https://github.com/facebook/react-native/pull/34974

Test Plan:
Run rn tester app and go to view example. You'll find a flex gap example. Example location - `packages/rn-tester/js/examples/View/ViewExample.js`

### Tested on
- [x] iOS Fabric
- [x] iOS non-fabric
- [x] Android Fabric
- [x] Android non-fabric

To test on non-fabric Android, I just switched these booleans. Let me know if there's anything else I might have missed.

<img width="674" alt="Screenshot 2022-10-14 at 3 30 48 AM" src="https://user-images.githubusercontent.com/23293248/195718971-7aee4e7e-dbf0-4452-9d47-7925919c61dc.png">

Reviewed By: mdvacca

Differential Revision: D40527474

Pulled By: NickGerleman

fbshipit-source-id: 81c2c97c76f58fad3bb40fb378aaf8b6ebd30d63
2022-10-20 14:53:32 -07:00
Viraj-10 720cdbc658 feat: adding aria-label alias for accessibilityLabel (#34502)
Summary:
- Adding [aria-label](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) alias for [accessibilityLabel](https://reactnative.dev/docs/accessibility#accessibilitylabel)

https://github.com/facebook/react-native/issues/34424

## Changelog

[General] [Added] - Add `aria-label` prop to `Button`, `View`, `Pressable` component

Pull Request resolved: https://github.com/facebook/react-native/pull/34502

Test Plan:
```
<Button
     onPress={() => onButtonPress('cancelled')}
     testID="cancel_button"
     color={theme.SystemRedColor}
     title="Cancel Application"
     aria-lable="Press to cancel your application!"
/>
```

Reviewed By: NickGerleman

Differential Revision: D39055178

Pulled By: cipolleschi

fbshipit-source-id: 7513a4518dedd0834e99fa8e72b07e0dc0132b41
2022-09-09 11:16:28 -07:00
Pieter Vanderwerff ee3d3c248d Add missing class annotations xplat/js
Reviewed By: SamChou19815

Differential Revision: D38373443

fbshipit-source-id: 1222c4845ebd6b72bd6f54af1a27cf8542dd883a
2022-08-03 12:43:58 -07:00
Eric Edouard 8993ffc82e Added border curve style prop ("Squircle" effect - iOS only) (#33783)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
NOTE: PR is based on https://github.com/facebook/react-native/pull/32017 which went stale for quite a long time but can now safely be closed

![](https://preview.redd.it/nuvl4746ys471.png?width=960&crop=smart&auto=webp&s=084a517a645364ac246b70b7fa8e0f2470cc7af3)

Since iOS 13+, it is possible to change the corner curve property on iOS in order to smoothen border radius and make it more "rounded" (also called "squircle")
Here's an [article](https://medium.com/arthurofbabylon/a-smooth-corner-radius-in-ios-54b80aa2d372) explaining in details what it is.
This property is also built in figma, but currently there is no way to implement this directly with react-native despite it being available natively on iOS.

Many open source react-native libraries were created in order to simulate this behaviour:
[react-native-super-ellipse-mask](https://github.com/everdrone/react-native-super-ellipse-mask)
[react-native-squircle-view](https://github.com/everdrone/react-native-squircle-view)
[react-native-figma-squircle](https://github.com/tienphaw/react-native-figma-squircle)

But they rely on creating an SVG shape with the smoothed corners and masking the view behind. This makes it not very performant (flickering on mounting was a common side-effect)

This PR aims at implementing the property natively.

PR for the docs update: https://github.com/facebook/react-native-website/pull/2785

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] - Added `borderCurve` style prop for smooth border radius (squircle effect)

Pull Request resolved: https://github.com/facebook/react-native/pull/33783

Test Plan:
We used the RNTester app and added an example with `cornerCurve ` set to `'continuous'` (only on iOS).

As the difference is quite subtle, we also made some more tests to better illustrate the difference (these are not in the RN-tester app):

![IMG_0810](https://user-images.githubusercontent.com/19872411/133893536-26207c53-aade-4583-9eef-7a1739b6907b.PNG)

We overlapped two views with `position: absolute`, the one in the background has a red background and has `cornerRadius` set to `false`, and the one in the foreground is set to `true`. We can clearly see where the borders differs on the corners.

Reviewed By: sammy-SC

Differential Revision: D37883631

Pulled By: cipolleschi

fbshipit-source-id: 09f06de9628fa326323eba63875de30102c4a59e
2022-07-21 04:11:30 -07:00
Luna Wei 6958bbb28c Fix up lint errors under react-native-github (#33622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33622

Changelog: [Internal] Clean up eslint errors

Reviewed By: yungsters

Differential Revision: D35599445

fbshipit-source-id: bbb9061a3cf9df32daacad9a9b44eba94d3ce48c
2022-04-22 16:25:25 -07:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Tim Yung 77ecc7ede1 JS: Format with Prettier v2.4.1 [3/n]
Summary:
Changelog:
[General][Internal]

Reviewed By: zertosh

Differential Revision: D31883447

fbshipit-source-id: cbbf85e4bf935096d242336f41bf0cc5d6f92359
2021-11-02 22:14:16 -07:00
Valentin Shergin e3d8a6b222 Fabric: Stacking Context test covering a sequence of changes
Summary:
This diff adds another complexity level for Stacking Context and zIndex tests: Now we test not only "noting-to-something" cases but also cases where we apply changes to an already non-empty tree, validating our assumption of each step.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25623176

fbshipit-source-id: 29a447d93522a2a4e7912351f907c46ac7b218bb
2020-12-21 08:33:31 -08:00
Ankit Tiwari 1270873ed6 RNTester UI Redesign (#29685)
Summary:
This Pull request adds the UI changes to the RNTester app as discussed in the MLH Fellowship.

This list is not exhaustive.

- The initial App screen is redesigned.
  - A bottom Navbar has been added.
   - Filter pills are added.
   - The list card UI is updated.

- The example page UI is updated.

- Recently Viewed Sections are added. It shows the last 5 recently viewed components/APIs.

- Bookmarking functionality is added.

- The documentation URL is added to the example page.

- RNTester doesn't lose its state on a hard refresh (even on iOS).

<img width="373" src="https://user-images.githubusercontent.com/22813027/90530113-20346180-e192-11ea-8ef6-789fa25b402b.png" />
<img width="373" src="https://user-images.githubusercontent.com/22813027/90530112-20346180-e192-11ea-9539-706b540fcc5f.png" />
<img width="373" src="https://user-images.githubusercontent.com/22813027/90530100-1d397100-e192-11ea-8836-b88070643233.png" />
<img width="373" src="https://user-images.githubusercontent.com/22813027/90530110-1f9bcb00-e192-11ea-936b-64ee75fa4289.png" />

Pull Request resolved: https://github.com/facebook/react-native/pull/29685

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

{F302717939}

Note: this failed **before** this diff too:

{F302745716}

Reviewed By: mdvacca, cpojer

Differential Revision: D23240434

fbshipit-source-id: 65e2766a6a097eca0e0d0fda8dadf6871e9276c2

Co-authored-by: agarwalmanya <manya18ag@gmail.com>
Co-authored-by: chirag-singhal <csinghal208@gmail.com>
Co-authored-by: Ansh Godha <ag759@cornell.edu>
Co-authored-by: Yash Kumar Verma <yk.verma2000@gmail.com>
Co-authored-by: Sanskar Jethi <sansyrox@gmail.com>
Co-authored-by: Aniketh Saha <anik220798@gmail.com>
Co-authored-by: Xtremilicious <nilarjundas@outlook.com>
Co-authored-by: Jani Evakallio <jani.evakallio@gmail.com>
2020-08-26 08:45:57 -07:00
stealthanthrax 63992c0b96 Migrating RNTester to Packages Directory (#29567)
Summary:
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
This PR aims to migrate the RNTester App to `packages` directory. But is currently, open to inspect the CI issues and resolve the merge conflicts.

Currently done
 - Working on iOS
 - Working on Android
 - Detox Tests working on iOS

Need to work on
 - Errors generated by the CI builds

[General] [Changed] - Migrated the RNTester App to the packages directory.

Pull Request resolved: https://github.com/facebook/react-native/pull/29567

Test Plan: It runs on both ios and android for now and the detox iOS builds are working.

Reviewed By: cpojer

Differential Revision: D23034761

Pulled By: rickhanlonii

fbshipit-source-id: e04bb06e1c7ef15d340206090d1575a871b9e6f5
2020-08-19 17:57:08 -07:00