Skip to content

Stepper new design #1547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions demo/src/screens/componentScreens/StepperScreen.js

This file was deleted.

70 changes: 70 additions & 0 deletions demo/src/screens/componentScreens/StepperScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React, {Component} from 'react';
import {View, Text, Stepper} from 'react-native-ui-lib'; //eslint-disable-line


export default class StepperScreen extends Component {
state = {
stepperValue: 1
};

stepperProps = {
minValue: 0,
maxValue: 3,
value: 1
};

onValueChange = (value: number, _?: string) => {
this.setState({stepperValue: value});
};

render() {
const {stepperValue} = this.state;

return (
<View padding-page>
<Text text40 marginB-20>Stepper</Text>

<View centerV>
<View row spread centerV>
<Text text70>Default</Text>
<Stepper/>
</View>

<View row spread centerV marginT-30>
<Text text70>Disabled</Text>
<Stepper disabled/>
</View>

<View row spread marginT-30>
<Text text70>Step (0.5)</Text>
<Stepper step={0.5}/>
</View>

<View row spread marginT-30>
<Text text70>Small</Text>
<Stepper small/>
</View>

<View marginT-30>
<View row spread centerV>
<Text text70>Custom</Text>
<Stepper
onValueChange={this.onValueChange}
maxValue={this.stepperProps.maxValue}
minValue={this.stepperProps.minValue}
value={stepperValue}
testID={'Stepper1'}
/>
</View>
<View padding-5>
<Text text80M>Stepper value: {stepperValue}</Text>
<Text marginT-3>Initial value: {this.stepperProps.value}</Text>
<Text marginT-3>Min value: {this.stepperProps.minValue}</Text>
<Text marginT-3>Max value: {this.stepperProps.maxValue}</Text>
</View>
</View>
</View>
</View>
);
}
}
2 changes: 1 addition & 1 deletion generatedTypes/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export {default as View, ViewProps} from './src/components/view';
export {default as Text, TextProps} from './src/components/text';
export {default as TouchableOpacity, TouchableOpacityProps} from './src/components/touchableOpacity';
export {default as Button, ButtonSize, ButtonProps} from './src/components/button';
export {default as Stepper, StepperProps} from './src/components/stepper';
export {default as Checkbox, CheckboxProps} from './src/components/checkbox';
export {default as Chip, ChipProps} from './src/components/chip';
export {default as ColorPicker, ColorPickerProps} from './src/components/colorPicker';
Expand Down Expand Up @@ -92,7 +93,6 @@ export {
MaskedInput,
ProgressBar,
ColorSliderGroup,
Stepper,
ChipsInput,
SharedTransition,
Toast,
Expand Down
44 changes: 44 additions & 0 deletions generatedTypes/src/components/stepper/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from 'react';
interface Props {
/**
* Initial value of the Stepper.
*/
value?: number;
/**
* Minimum value.
*/
minValue?: number;
/**
* Maximum value.
*/
maxValue?: number;
/**
* The step to increase and decrease by (default is 1)
*/
step?: number;
/**
* On value change callback function
*/
onValueChange?: (value: number, testID?: string) => void;
/**
* disables interaction with the stepper
*/
disabled?: boolean;
/**
* Renders a small sized Stepper
*/
small?: boolean;
/**
* Component accessibility label
*/
accessibilityLabel?: string;
/**
* Test id for component
*/
testID?: string;
}
export declare type StepperProps = Props;
declare const _default: React.ComponentClass<Props & {
useCustomTheme?: boolean | undefined;
}, any>;
export default _default;
35 changes: 0 additions & 35 deletions src/components/stepper/StepperButton.js

This file was deleted.

Binary file added src/components/stepper/assets/minusOutline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/minusOutlineSmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/plusOutline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/plusOutlineSmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/stepper/assets/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
167 changes: 0 additions & 167 deletions src/components/stepper/index.js

This file was deleted.

Loading