Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
adids1221 committed Jun 13, 2024
2 parents 7770877 + d4e69bd commit 0a095e7
Show file tree
Hide file tree
Showing 56 changed files with 766 additions and 678 deletions.
25 changes: 0 additions & 25 deletions demo/src/assets/Assets.ts

This file was deleted.

29 changes: 27 additions & 2 deletions demo/src/configurations.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
import {Colors, Typography, Spacings, TextField} from 'react-native-ui-lib'; // eslint-disable-line
import {Assets, Colors, Typography, Spacings, TextField} from 'react-native-ui-lib'; // eslint-disable-line

export const loadDemoConfigurations = () => {
require('./assets/Assets');
Assets.loadAssetsGroup('icons.demo', {
chevronDown: require('./assets/icons/chevronDown.png'),
chevronRight: require('./assets/icons/chevronRight.png'),
add: require('./assets/icons/add.png'),
camera: require('./assets/icons/cameraSelected.png'),
close: require('./assets/icons/close.png'),
dashboard: require('./assets/icons/dashboard.png'),
drag: require('./assets/icons/drag.png'),
image: require('./assets/icons/image.png'),
plus: require('./assets/icons/plus.png'),
refresh: require('./assets/icons/refresh.png'),
search: require('./assets/icons/search.png'),
settings: require('./assets/icons/settings.png'),
share: require('./assets/icons/share.png'),
info: require('./assets/icons/info.png'),
exclamation: require('./assets/icons/exclamationFillSmall.png')
});

Assets.loadAssetsGroup('images.demo', {
brokenImage: require('./assets/images/placeholderMissingImage.png')
});

Assets.loadAssetsGroup('svgs.demo', {
logo: require('./assets/svgs/headerLogo.svg').default
});

Typography.loadTypographies({
h1: {...Typography.text40},
h2: {...Typography.text50},
Expand Down
11 changes: 0 additions & 11 deletions demo/src/demoApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ import Storage, {DEFAULT_SCREEN} from './storage';
// gold: '#FFD700',
// });

// ThemeManager.setComponentTheme('Picker', (props) => {
// if (props.useNativePicker) {
// return {
// topBarProps: {
// doneLabel: Constants.isIOS ? 'Done2' : 'OK2',
// cancelLabel: Constants.isIOS ? 'Cancel2' : 'CANCEL2',
// },
// };
// }
// });

// const customAnimationsDefinitions = {
// customAnimation1: {
// from: {opacity: 0, translateY: 20},
Expand Down
4 changes: 4 additions & 0 deletions demo/src/screens/componentScreens/ChipsInputScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default class ChipsInputScreen extends Component {

this.setState({chips: newChips});
}}
validate={'required'}
validateOnChange
validationMessage={'You must add at least one chip'}
marginB-10
/>

<ChipsInput
Expand Down
3 changes: 1 addition & 2 deletions demo/src/screens/componentScreens/DrawerScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, {Component} from 'react';
import {StyleSheet, ScrollView, LayoutAnimation} from 'react-native';
import {Colors, Typography, View, Drawer, Text, Button, Avatar, Badge, DrawerProps} from 'react-native-ui-lib';
import {Assets, Colors, Typography, View, Drawer, Text, Button, Avatar, Badge, DrawerProps} from 'react-native-ui-lib';
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
import conversations from '../../data/conversations';
import Assets from '../../assets/Assets';

import {renderBooleanOption, renderSliderOption, renderColorOption} from '../ExampleScreenPresenter';

Expand Down
3 changes: 1 addition & 2 deletions demo/src/screens/componentScreens/HintsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import _ from 'lodash';
import React, {Component} from 'react';
import {Alert, ViewStyle} from 'react-native';
import {Colors, View, Text, Hint, Button, Incubator} from 'react-native-ui-lib';
import {Colors, View, Text, Hint, Button, Assets, Incubator} from 'react-native-ui-lib';
import {renderMultipleSegmentOptions, renderBooleanOption} from '../ExampleScreenPresenter';
import Assets from '../../assets/Assets';

const settingsIcon = require('../../assets/icons/settings.png');
const reactions = ['❤️', '😮', '😔', '😂', '😡'];
Expand Down
3 changes: 1 addition & 2 deletions demo/src/screens/componentScreens/ImageScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, {Component} from 'react';
import {ScrollView} from 'react-native';
import {View, Text, Icon, Image, Colors, OverlayTypes} from 'react-native-ui-lib';
import {View, Text, Icon, Image, Colors, Assets, OverlayTypes} from 'react-native-ui-lib';
import {renderBooleanOption, renderRadioGroup, renderSliderOption} from '../ExampleScreenPresenter';
import Assets from '../../assets/Assets';

const IMAGE_URL =
'https://images.pexels.com/photos/748837/pexels-photo-748837.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260';
Expand Down
3 changes: 1 addition & 2 deletions demo/src/screens/componentScreens/ModalScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, {Component} from 'react';
import {Alert, StyleSheet} from 'react-native';
import {Navigation} from 'react-native-navigation';
import {Colors, Carousel, PageControl, Modal, View, Text} from 'react-native-ui-lib'; // eslint-disable-line
import Assets from '../../assets/Assets';
import {Colors, Carousel, PageControl, Modal, View, Text, Assets} from 'react-native-ui-lib'; // eslint-disable-line

const BUTTONS_HIT_SLOP = {right: 5, left: 5, top: 10, bottom: 10};
interface ModalScreenProps {
Expand Down
6 changes: 3 additions & 3 deletions demo/src/screens/componentScreens/PickerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class PickerScreen extends Component {
language2: options[2].value,
languages: [],
option: undefined,
nativePickerValue: 'java',
wheelPickerValue: 'java',
dialogPickerValue: 'java',
customModalValues: [],
filter: filters[0].value,
Expand Down Expand Up @@ -157,8 +157,8 @@ export default class PickerScreen extends Component {
label="Wheel Picker"
placeholder="Pick a Language"
useWheelPicker
value={this.state.nativePickerValue}
onChange={nativePickerValue => this.setState({nativePickerValue})}
value={this.state.wheelPickerValue}
onChange={wheelPickerValue => this.setState({wheelPickerValue})}
trailingAccessory={<Icon source={dropdown}/>}
items={options}
/>
Expand Down
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/SortableListScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
TouchableOpacity,
Text,
Icon,
Assets,
Colors,
Button
} from 'react-native-ui-lib';
import Assets from '../../assets/Assets';
import {renderHeader} from '../ExampleScreenPresenter';

interface Item extends SortableListItemProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import _ from 'lodash';
import React, {Component} from 'react';
import {ActivityIndicator, StyleSheet} from 'react-native';
import {
Assets,
TabController,
Colors,
View,
Expand All @@ -11,7 +12,6 @@ import {
TabControllerImperativeMethods
} from 'react-native-ui-lib';
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
import Assets from '../../../assets/Assets';

import Tab1 from './tab1';
import Tab2 from './tab2';
Expand Down
50 changes: 41 additions & 9 deletions demo/src/screens/componentScreens/TextFieldScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {Component} from 'react';
import {ScrollView, ActivityIndicator} from 'react-native';
import {
Assets,
Colors,
Spacings,
View,
Expand All @@ -11,12 +12,11 @@ import {
TextFieldRef,
FieldContextType,
TextFieldProps,
SegmentedControl
SegmentedControl,
Icon
} from 'react-native-ui-lib';
import Assets from '../../assets/Assets';
const {KeyboardAwareInsetsView} = Keyboard;
const priceFormatter = Intl.NumberFormat('en-US');
const validationIcon = require('../../assets/icons/exclamationFillSmall.png');

export default class TextFieldScreen extends Component {
input = React.createRef<TextFieldRef>();
Expand Down Expand Up @@ -167,7 +167,7 @@ export default class TextFieldScreen extends Component {
};

renderValidationExample() {
const {errorPosition} = this.state;
const {errorPosition, preset} = this.state;

return (
<>
Expand All @@ -178,7 +178,7 @@ export default class TextFieldScreen extends Component {
<SegmentedControl segments={[{label: 'Bottom'}, {label: 'Top'}]} onChangeIndex={this.onChangeIndexValidation}/>
</View>
</View>

<TextField
value={this.state.value}
onChangeText={value => this.setState({value})}
Expand All @@ -204,7 +204,9 @@ export default class TextFieldScreen extends Component {
containerStyle={{flex: 1}}
validationMessagePosition={errorPosition}
helperText={'Enter first and last name'}
validationIcon={{source: validationIcon, style: {marginTop: 1}}}
validationIcon={{source: Assets.icons.demo.exclamation, style: {marginTop: 1}}}
topTrailingAccessory={<Icon source={Assets.icons.demo.info} size={16}/>}
preset={preset}
/>
<Button
outline
Expand Down Expand Up @@ -351,6 +353,26 @@ export default class TextFieldScreen extends Component {
);
}

renderClearButtonExample() {
return (
<>
<Text h3 marginB-s3>
Clear Button
</Text>

<TextField
label="Description"
placeholder="Enter text..."
showClearButton
value={this.state.value}
onChangeText={value => this.setState({value})}
trailingAccessory={<Icon source={Assets.icons.demo.search}/>}
// multiline
/>
</>
);
}

renderHintExample() {
return (
<>
Expand Down Expand Up @@ -400,7 +422,16 @@ export default class TextFieldScreen extends Component {
</Text>

<Text marginB-s1 $textPrimary>Centered:</Text>
<TextField label="PIN" placeholder="XXXX" centered/>
<TextField
label="PIN"
placeholder="XXXX"
centered
topTrailingAccessory={<Icon source={Assets.icons.demo.info} size={16}/>}
validate={'required'}
validationMessage={'This field is required'}
validateOnBlur
validationMessagePosition={this.state.errorPosition}
/>

<Text marginB-s1 $textPrimary>Inline:</Text>
<View row>
Expand All @@ -414,15 +445,16 @@ export default class TextFieldScreen extends Component {

render() {
return (
<ScrollView keyboardShouldPersistTaps="always" showsVerticalScrollIndicator={false}>
<View flex padding-page>
<ScrollView showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="always">
<View padding-page>
<Text h1 marginB-s4>TextField</Text>

{this.renderDefaultExample()}
{this.renderPresetExample()}
{this.renderPlaceholdersExample()}
{this.renderValidationExample()}
{this.renderHintExample()}
{this.renderClearButtonExample()}
{this.renderCherCounterExample()}
{this.renderAccessoriesExample()}
{this.renderStateColorsExample()}
Expand Down
4 changes: 2 additions & 2 deletions demo/src/screens/componentScreens/TimelineScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useCallback, useRef, useState} from 'react';
import {StyleSheet, ScrollView} from 'react-native';
import {Colors, Timeline, View, Card, Text, Button} from 'react-native-ui-lib';
import Assets from '../../assets/Assets';
import {Assets, Colors, Timeline, View, Card, Text, Button} from 'react-native-ui-lib';

const contents = [
'CURRENT (default) state with dashed line.\nAligned to title',
'SUCCESS state with label.',
Expand Down
4 changes: 2 additions & 2 deletions demo/src/screens/incubatorScreens/IncubatorToastScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, {Component} from 'react';
import {ScrollView, StyleSheet} from 'react-native';
import {Colors, View, Button, Text, Incubator} from 'react-native-ui-lib';
import {Assets, Colors, View, Button, Text, Incubator} from 'react-native-ui-lib';
import {renderMultipleSegmentOptions, renderBooleanOption, renderRadioGroup} from '../ExampleScreenPresenter';
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';
import Assets from '../../assets/Assets';

const {Toast} = Incubator;

const TOAST_ACTIONS = {
Expand Down
3 changes: 2 additions & 1 deletion demo/src/screens/incubatorScreens/PanViewScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {Component} from 'react';
import {StyleSheet, ScrollView} from 'react-native';
import {GestureHandlerRootView, FlatList} from 'react-native-gesture-handler';
import {
Assets,
View,
Text,
Colors,
Expand All @@ -14,7 +15,7 @@ import {
TouchableOpacity
} from 'react-native-ui-lib';
const {PanView} = Incubator;
import Assets from '../../assets/Assets';

interface Item {
value: string;
label: string;
Expand Down
3 changes: 1 addition & 2 deletions demo/src/screens/realExamples/Pinterest/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, {Component} from 'react';
import {StyleSheet, ScrollView} from 'react-native';
import {Colors, Spacings, View, Card, Text, Image, Button, Constants} from 'react-native-ui-lib';
import {Assets, Colors, Spacings, View, Card, Text, Image, Button, Constants} from 'react-native-ui-lib';
import _ from 'lodash';
import Assets from '../../../assets/Assets';

import './configurations';

Expand Down
3 changes: 1 addition & 2 deletions demo/src/screens/realExamples/ProductPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, {Component} from 'react';
import {ScrollView} from 'react-native';
import {View, Text, Icon, Colors, Image, Button, Carousel, Picker, PickerValue} from 'react-native-ui-lib';
import {Assets, View, Text, Icon, Colors, Image, Button, Carousel, Picker, PickerValue} from 'react-native-ui-lib';
import _ from 'lodash';
import Assets from '../../../assets/Assets';

const colorOptions = [
{label: 'Red', value: 'red', color: Colors.red30},
Expand Down
2 changes: 0 additions & 2 deletions docs/getting-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ The following are optional dependencies:
- @react-native-community/blur
- @react-native-community/datetimepicker
- @react-native-community/netinfo
- @react-native-picker/picker


## Install Native Dependencies
Expand All @@ -60,7 +59,6 @@ Some of the components are using the native dependencies listed below - those ar
- "@react-native-community/blur": ">=3.4.1" (required for Card component when passing `enableBlur` prop)
- "@react-native-community/datetimepicker": "^2.1.0"
- "@react-native-community/netinfo": "^5.6.2" (required for ConnectionStatusBar component)
- "@react-native-picker/picker": "^1.9.4" (required for Picker component when passing `useNativePicker` prop)

## Demo App

Expand Down
8 changes: 4 additions & 4 deletions scripts/prReleaseNotesCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ function getPRsByType(PRs, categories) {
const category = categories.find(category => {
return pr.branch.toLowerCase().startsWith(category.branch);
});
if (category) {
const foundCategory = categorizedPRs.find(cat => cat.name === category.name);
foundCategory.PRs.push(pr);
} else if (isSilent(pr)) {
if (isSilent(pr)) {
const silentCategory = categorizedPRs.find(cat => cat.name === 'silent');
silentCategory.PRs.push(pr);
} else if (category) {
const foundCategory = categorizedPRs.find(cat => cat.name === category.name);
foundCategory.PRs.push(pr);
} else {
const otherCategory = categorizedPRs.find(cat => cat.name === 'others');
otherCategory.PRs.push(pr);
Expand Down
Loading

0 comments on commit 0a095e7

Please sign in to comment.