Skip to content

Commit

Permalink
Merge pull request #1682 from gluestack/release/@gluestack-ui/themed@…
Browse files Browse the repository at this point in the history
…1.0.39

Release/@gluestack UI/[email protected]
  • Loading branch information
ankit-tailor authored Jan 22, 2024
2 parents 816a14b + e7b548e commit 1d15dab
Show file tree
Hide file tree
Showing 20 changed files with 232 additions and 1 deletion.
2 changes: 2 additions & 0 deletions example/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ export const parameters = {
[
'FlatList',
'ScrollView',
'SafeAreaView',
'VirtualizedList',
'View',
'KeyboardAvoidingView',
'SectionList',
'StatusBar',
'Refresh Control',
'ImageBackground',
'InputAccessoryView',
],
'Hooks',
[
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ComponentMeta } from '@storybook/react-native';
import InputAccessoryViewStory from './InputAccessoryView';

const InputAccessoryViewMeta: ComponentMeta<typeof ScrollView> = {
title: 'stories/React Native Components/InputAccessoryView',
component: InputAccessoryViewStory,
};

export default InputAccessoryViewMeta;

export { InputAccessoryView };
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import {
ScrollView,
Button,
ButtonText,
Center,
Input,
InputAccessoryView,
} from '@gluestack-ui/themed';
import { config } from '@gluestack-ui/config';
import React from 'react';
import Wrapper from '../../components/Wrapper';

export default function SafeAreaViewStory() {
return (
<Center>
<ScrollView keyboardDismissMode="interactive">
<Input
style={{
padding: 16,
marginTop: 50,
}}
inputAccessoryViewID={inputAccessoryViewID}
onChangeText={setText}
value={text}
placeholder={'Please type here…'}
/>
</ScrollView>
<InputAccessoryView nativeID={inputAccessoryViewID}>
<Button onPress={() => setText(initialText)}>
<ButtonText>Clear text </ButtonText>
</Button>
</InputAccessoryView>
</Center>
);
}

export {
VStack,
Center,
Heading,
GluestackUIProvider,
SafeAreaView,
Text,
} from '@gluestack-ui/themed';

export { config, Wrapper };
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: InputAccessoryView | gluestack-ui

description: A component which enables customization of the keyboard input accessory view on iOS. The input accessory view is displayed above the keyboard whenever a TextInput has focus. This component can be used to create custom toolbars.
---

import { Meta } from '@storybook/addon-docs';

<Meta title="ui/React Native Components/InputAccessoryView" />

# InputAccessoryView

Following is the default implementation of the **InputAccessoryView** component without any additional customization. This serves as a starting point for users who are new to this library and want to learn about the basic functionality and appearance of the component.

> Note: InputAccessoryView component is only applicable to iOS devices with iOS version 11 or later.
<iframe
src="https://snack.expo.dev/embedded/@gluestack/inputaccessoryview-gluestack-ui?iframeId=ivy5yisd3p&preview=true&platform=ios&theme=dark"
style={{ width: '100%', height: '60vh', border: '0px' }}
/>

<br />

> Note: You can refer [here](https://github.com/gluestack/gluestack-ui/tree/main/packages/themed/src/components/InputAccessoryView/styled-components) to learn about default styling of InputAccessoryView component
### Import

To use this component in your project, include the following import statement in your file.

```bash
import { InputAccessoryView } from '@gluestack-ui/themed';
```
### Anatomy
The structure provided below can help you identify and understand a InputAccessoryView component's various parts.
```jsx
export default () => <InputAccessoryView />;
```
### API Reference
The following section contains a comprehensive list of the component's references, including descriptions, properties, types, and default behavior. This information is readily available for you to access, helping you effectively utilize the component library in your projects.
### InputAccessoryView
It inherits all the properties of React Native's [InputAccessoryView](https://reactnative.dev/docs/InputAccessoryView) component.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ComponentMeta } from '@storybook/react-native';
import SafeAreaViewStory from './SafeAreaView';

const SafeAreaViewMeta: ComponentMeta<typeof ScrollView> = {
title: 'stories/React Native Components/SafeAreaView',
component: SafeAreaViewStory,
};

export default SafeAreaViewMeta;

export { SafeAreaView };
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { SafeAreaView, Center, Text } from '@gluestack-ui/themed';
import { config } from '@gluestack-ui/config';
import React from 'react';
import Wrapper from '../../components/Wrapper';

export default function SafeAreaViewStory() {
return (
<Center>
<SafeAreaView flex={1}>
<Text fontSize="$md">Page content</Text>
</SafeAreaView>
</Center>
);
}

export {
VStack,
Center,
Heading,
GluestackUIProvider,
SafeAreaView,
Text,
} from '@gluestack-ui/themed';

export { config, Wrapper };
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: SafeAreaView | gluestack-ui

description: Component to ensure that your content is displayed within the safe area of a device screen. The safe area refers to the portion of the screen that is visible and not obstructed by device-specific elements like notches, status bars, and rounded corners. This is particularly important on modern smartphones, where screens may have irregular shapes or include areas that are not fully usable for displaying content.
---

import { Meta } from '@storybook/addon-docs';

<Meta title="ui/React Native Components/SafeAreaView" />

# SafeAreaView

Following is the default implementation of the **SafeAreaView** component without any additional customization. This serves as a starting point for users who are new to this library and want to learn about the basic functionality and appearance of the component.

> Note: SafeAreaView component is only applicable to iOS devices with iOS version 11 or later.
<iframe
src="https://snack.expo.dev/embedded/@gluestack/safeareaview-example-gluestack-ui?iframeId=o8ckls5o1n&preview=true&platform=ios&theme=dark"
style={{ width: '100%', height: '60vh', border: '0px' }}
/>

<br />

> Note: You can refer [here](https://github.com/gluestack/gluestack-ui/tree/main/packages/themed/src/components/SafeAreaView/styled-components) to learn about default styling of SafeAreaView component
### Import

To use this component in your project, include the following import statement in your file.

```bash
import { SafeAreaView } from '@gluestack-ui/themed';
```
### Anatomy
The structure provided below can help you identify and understand a SafeAreaView component's various parts.
```jsx
export default () => <SafeAreaView />;
```
### API Reference
The following section contains a comprehensive list of the component's references, including descriptions, properties, types, and default behavior. This information is readily available for you to access, helping you effectively utilize the component library in your projects.
### SafeAreaView
It inherits all the properties of React Native's [SafeAreaView](https://reactnative.dev/docs/SafeAreaView) component.
3 changes: 3 additions & 0 deletions packages/config/src/theme/InputAccessoryView.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createStyle } from '@gluestack-style/react';

export const InputAccessoryView = createStyle({});
3 changes: 3 additions & 0 deletions packages/config/src/theme/SafeAreaView.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createStyle } from '@gluestack-style/react';

export const SafeAreaView = createStyle({});
5 changes: 5 additions & 0 deletions packages/config/src/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,8 @@ export * from './TooltipContent';
export * from './TooltipText';
export * from './VStack';
export * from './View';
export * from './ImageBackground';
export * from './InputAccessoryView';
export * from './SafeAreaView';
export * from './RefreshControl';
export * from './VirtualizedList';
7 changes: 7 additions & 0 deletions packages/themed/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @gluestack-ui/themed

## 1.0.39

### Patch Changes

- - SaferAreaView
- InputAccessoryView

## 1.0.38

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/themed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gluestack-ui/themed",
"version": "1.0.38",
"version": "1.0.39",
"main": "build/index.js",
"types": "build/index.d.ts",
"module": "build/index",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "dependencies": {}, "keywords": ["components", "core"] }
3 changes: 3 additions & 0 deletions packages/themed/src/components/InputAccessoryView/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Root } from './styled-components';

export const InputAccessoryView = Root;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { InputAccessoryView } from 'react-native';
import { styled } from '@gluestack-style/react';

export default styled(InputAccessoryView, {}, {
componentName: 'InputAccessoryView',
} as const);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Root } from './Root';
1 change: 1 addition & 0 deletions packages/themed/src/components/SafeAreaView/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "dependencies": {}, "keywords": ["components", "core"] }
3 changes: 3 additions & 0 deletions packages/themed/src/components/SafeAreaView/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Root } from './styled-components';

export const SafeAreaView = Root;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { SafeAreaView } from 'react-native';
import { styled } from '@gluestack-style/react';

export default styled(SafeAreaView, {}, {
componentName: 'SafeAreaView',
} as const);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Root } from './Root';

0 comments on commit 1d15dab

Please sign in to comment.