Skip to content

Commit 9952a06

Browse files
authored
Merge pull request #137 from GeekyAnts/new-version/3.2.2
New version added
2 parents 298aa3a + 78af988 commit 9952a06

File tree

146 files changed

+10486
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+10486
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"clsx": "^1.1.1",
3636
"dedent": "^0.7.0",
3737
"docusaurus-tailwindcss-loader": "file:plugins/docusaurus-tailwindcss-loader",
38-
"native-base": "3.2.1",
38+
"native-base": "3.2.2",
3939
"object.fromentries": "^2.0.3",
4040
"patch-package": "^6.4.7",
4141
"postcss": "^7.0.34",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: FAB
3+
title: FAB
4+
---
5+
6+
import { ComponentTheme } from '../../src/components';
7+
8+
A floating action button is a circular icon button that hovers over content to promote a primary action in the application.
9+
10+
## Import
11+
12+
```jsx
13+
import { Fab } from 'native-base';
14+
```
15+
16+
## Example
17+
18+
### Basic
19+
20+
```ComponentSnackPlayer path=components,composites,Fab,Basic.tsx
21+
22+
```
23+
24+
### Placement
25+
26+
```ComponentSnackPlayer path=components,composites,Fab,Placement.tsx
27+
28+
```
29+
30+
### Custom Position
31+
32+
```ComponentSnackPlayer path=components,composites,Fab,CustomPosition.tsx
33+
34+
```
35+
36+
## Styling
37+
38+
<ComponentTheme name="fab" componentName="FAB" />
39+
40+
## Props
41+
42+
```ComponentPropTable path=composites,Fab,Fab.tsx
43+
44+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
id: v-stack
3+
title: VStack / Column
4+
---
5+
6+
`VStack` aligns items vertically.`Column` is also an alias for `VStack`.
7+
8+
## Import
9+
10+
```jsx
11+
import { VStack } from 'native-base';
12+
```
13+
14+
## Usage
15+
16+
```ComponentSnackPlayer path=components,primitives,VStack,basic.tsx
17+
18+
```
19+
20+
## Props
21+
22+
```ComponentPropTable path=primitives,Stack,VStack.tsx
23+
24+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: z-stack
3+
title: ZStack
4+
---
5+
6+
`ZStack` aligns items absolutely in the z-axis.
7+
8+
## Examples
9+
10+
### Basic
11+
12+
```ComponentSnackPlayer path=components,primitives,ZStack,example.tsx
13+
14+
```
15+
16+
### Items Centered
17+
18+
You can pass `alignItems="center"` `justifyContent="center"` to vertically and horizontally center the children.
19+
20+
```ComponentSnackPlayer path=components,primitives,ZStack,CenterStack.tsx
21+
22+
```
23+
24+
## Props
25+
26+
```ComponentPropTable path=primitives,ZStack,index.tsx
27+
28+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
id: accessibility
3+
title: Accessibility
4+
---
5+
6+
NativeBase comes with the latest accessibility standards out of the box including aria and role attributes, focus management, and keyboard navigation.
7+
8+
## Accessible Roles
9+
10+
NativeBase uses [React Native ARIA](https://react-native-aria.geekyants.com/) to implements [WAI-ARIA](https://www.w3.org/TR/wai-aria-1.2/) standards to its components. This is designed to provide meaning for controls that aren't built using components provided by the platform.
11+
12+
## Accessible Labels
13+
14+
When a view is marked as accessible, it is a good practice to set an `accessibilityLabel` on the view, so that people who use voice-over know what element they have selected. Voice-over will read this string when a user selects the associated element. NativeBase with the use of [React Native ARIA](https://react-native-aria.geekyants.com/) does this for you out of the box.
15+
16+
## Keyboard Navigation
17+
18+
Many complex components, like Tabs and Dialog, come with expectations from users on how to interact with their content using a keyboard or other non-mouse input modalities. NativeBase Primitives provide basic keyboard support in accordance with the [WAI-ARIA authoring practices](https://www.w3.org/TR/wai-aria-practices-1.2/).
19+
20+
## Focus Management
21+
22+
Proper keyboard navigation and good labelling often go hand-in-hand with managing focus. When a user interacts with a component and something changes as a result, it's often helpful to move focus with the interaction. And for screen reader users, moving focus often results in an announcement to convey the new context, which relies on proper labelling.
23+
24+
In many NativeBase Components, we move focus based on the interactions a user normally takes in a given component. For example, in `Modal`, when the modal is opened, the focus is programmatically moved to the `first focusable element` and trapped inside the modal to anticipate a response to the prompt.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
id: action-sheet
3+
title: ActionSheet
4+
---
5+
6+
import { ComponentTheme } from '../../src/components';
7+
8+
An Action Sheet is a dialog that displays a set of options. It appears on top of the app's content.
9+
10+
## Import
11+
12+
NativeBase exports 3 modal-related components:
13+
14+
- **Actionsheet**: Provides the context and state for all components.
15+
- **Actionsheet.Content**: Component to wrap the list of **Actionsheet.Item** components.
16+
- **Actionsheet.Item**: A button to wrap the options of the Actionsheet.
17+
18+
```jsx
19+
import { Actionsheet } from 'native-base';
20+
```
21+
22+
## Examples
23+
24+
### Usage
25+
26+
```ComponentSnackPlayer path=components,composites,Actionsheet,Usage.tsx
27+
28+
```
29+
30+
### Composition
31+
32+
```ComponentSnackPlayer path=components,composites,Actionsheet,Composition.tsx
33+
34+
```
35+
36+
### DisableOverlay
37+
38+
```ComponentSnackPlayer path=components,composites,Actionsheet,DisableOverlay.tsx
39+
40+
```
41+
42+
### Icons
43+
44+
```ComponentSnackPlayer path=components,composites,Actionsheet,Icon.tsx
45+
46+
```
47+
48+
## Props
49+
50+
### Actionsheet
51+
52+
```ComponentPropTable path=composites,Actionsheet,Actionsheet.tsx
53+
54+
```
55+
56+
### Actionsheet.Content
57+
58+
```ComponentPropTable path=composites,Actionsheet,ActionsheetContent.tsx
59+
60+
```
61+
62+
### Actionsheet.Item
63+
64+
ActionsheetItem implements [Button](button.md#props)
65+
66+
## Styling
67+
68+
<ComponentTheme name="actionsheet" />
69+
70+
## Accessibility
71+
72+
- ActionSheet has `aria-modal` set to true.
73+
- ActionSheet has `role` set to `dialog`.
74+
- When the ActionSheet opens, focus is trapped within it.
75+
- Pressing Esc closes the ActionSheet.
76+
- When the ActionSheet opens, focus is automatically set to the first enabled element.
77+
- Clicking on the overlay closes the ActionSheet.
78+
- Scrolling is blocked on the elements behind the ActionSheet.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
id: alert
3+
title: Alert
4+
---
5+
6+
import { ComponentTheme } from '../../src/components';
7+
8+
`Alerts` are used to communicate a state that affects a system, feature or page.
9+
10+
## Import
11+
12+
NativeBase exports 5 Alert related components:
13+
14+
- `Alert`: The wrapper for alert components.
15+
- `Alert.Icon`: The visual icon for the alert that changes based on the `status` prop.
16+
<!-- - `Alert.Title`: The title of the alert to be announced by screen readers. -->
17+
<!-- - `Alert.Description`: The description of the alert to be announced by screen readers. -->
18+
19+
```jsx
20+
import { Alert } from 'native-base';
21+
```
22+
23+
## Examples
24+
25+
### Basic
26+
27+
```ComponentSnackPlayer path=components,composites,Alert,usage.tsx
28+
29+
```
30+
31+
### Status
32+
33+
```ComponentSnackPlayer path=components,composites,Alert,status.tsx
34+
35+
```
36+
37+
### Variant
38+
39+
```ComponentSnackPlayer path=components,composites,Alert,variant.tsx
40+
41+
```
42+
43+
### Composition
44+
45+
```ComponentSnackPlayer path=components,composites,Alert,composition.tsx
46+
47+
```
48+
49+
### Action
50+
51+
```ComponentSnackPlayer path=components,composites,Alert,action.tsx
52+
53+
```
54+
55+
## Props
56+
57+
### Alert
58+
59+
```ComponentPropTable path=composites,Alert,Alert.tsx
60+
61+
```
62+
63+
### Alert.Icon
64+
65+
```ComponentPropTable path=composites,Alert,AlertIcon.tsx
66+
67+
```
68+
69+
### Alert.Title
70+
71+
```ComponentPropTable path=composites,Alert,AlertTitle.tsx
72+
73+
```
74+
75+
### Alert.Description
76+
77+
```ComponentPropTable path=composites,Alert,AlertDescription.tsx
78+
79+
```
80+
81+
## Styling
82+
83+
<ComponentTheme name="alert" />
84+
85+
## Accessibility
86+
87+
Alert has `role` set to `alert`.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
id: alert-dialog
3+
title: AlertDialog
4+
---
5+
6+
import { ComponentTheme } from '../../src/components';
7+
8+
`AlertDialog` component is used to interrupt the user with a mandatory confirmation or action. AlertDialog composes [`Modal`](modal.md) so you can use all its props.
9+
10+
## Import
11+
12+
- `AlertDialog`: provides context and state for the dialog.
13+
- `AlertDialog.Header`: contains the title announced by screen readers.
14+
- `AlertDialog.Body`: contains the description announced by screen readers.
15+
- `AlertDialog.Footer`: contains the actions of the dialog.
16+
- `AlertDialog.Content`: The wrapper for the alert dialog's content.
17+
- `AlertDialog.CloseButton`: The button that closes the dialog.
18+
19+
```jsx
20+
import { AlertDialog } from 'native-base';
21+
```
22+
23+
## Examples
24+
25+
### Basic
26+
27+
```ComponentSnackPlayer path=components,composites,AlertDialog,Basic.tsx
28+
29+
```
30+
31+
## Styling
32+
33+
<ComponentTheme name="alertDialog" />
34+
35+
## Props
36+
37+
AlertDialog and its components compose the **[Modal](modal.md)** component, so all the [`Modal props`](modal.md#props) can be passed to it. The only exception is that it requires `leastDestructiveRef` which is similar to `initialFocusRef` of `Modal`.
38+
39+
| Name | Type | Description | Default |
40+
| ------------------- | --------- | -------------------------------------------------------------- | ------- |
41+
| leastDestructiveRef | React.Ref | The least destructive action to get focus when dialog is open. | - |
42+
43+
## Accessibility
44+
45+
Adheres to the [Alert and Message Dialogs WAI-ARIA design pattern.](https://www.w3.org/TR/wai-aria-practices-1.2/#alertdialog)
46+
47+
### Keyboard Interactions
48+
49+
| Name | Description |
50+
| ----------- | --------------------------------------------------------- |
51+
| Space | Opens/closes the dialog. |
52+
| Enter | Opens/closes the dialog. |
53+
| Tab | Moves focus to the next focusable element. |
54+
| Shift + Tab | Moves focus to the previous focusable element. |
55+
| Esc | Closes the dialog and moves focus to AlertDialog.Trigger. |

0 commit comments

Comments
 (0)