Skip to content

Commit

Permalink
branch was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo Lopez committed Oct 23, 2023
2 parents 43a5643 + a0ab9ee commit 762197b
Show file tree
Hide file tree
Showing 36 changed files with 1,617 additions and 176 deletions.
86 changes: 44 additions & 42 deletions .ondevice/storybook.requires.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,67 @@
/* do not change this file, it is auto generated by storybook. */

import {
configure,
addDecorator,
addParameters,
addArgsEnhancer,
clearDecorators,
} from "@storybook/react-native";
configure,
addDecorator,
addParameters,
addArgsEnhancer,
clearDecorators,
} from '@storybook/react-native';

global.STORIES = [
{
titlePrefix: "",
directory: "./storybook/stories",
files: "**/*.stories.?(ts|tsx|js|jsx)",
importPathMatcher:
"^\\.[\\\\/](?:storybook\\/stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$",
},
{
titlePrefix: '',
directory: './storybook/stories',
files: '**/*.stories.?(ts|tsx|js|jsx)',
importPathMatcher:
'^\\.[\\\\/](?:storybook\\/stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$',
},
];

import "@storybook/addon-ondevice-actions/register";
import "@storybook/addon-ondevice-controls/register";
import '@storybook/addon-ondevice-actions/register';
import '@storybook/addon-ondevice-controls/register';

import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs";
import {argsEnhancers} from '@storybook/addon-actions/dist/modern/preset/addArgs';

import { decorators, parameters } from "./preview";
import {decorators, parameters} from './preview';

if (decorators) {
if (__DEV__) {
// stops the warning from showing on every HMR
require("react-native").LogBox.ignoreLogs([
"`clearDecorators` is deprecated and will be removed in Storybook 7.0",
]);
}
// workaround for global decorators getting infinitely applied on HMR, see https://github.com/storybookjs/react-native/issues/185
clearDecorators();
decorators.forEach((decorator) => addDecorator(decorator));
if (__DEV__) {
// stops the warning from showing on every HMR
require('react-native').LogBox.ignoreLogs([
'`clearDecorators` is deprecated and will be removed in Storybook 7.0',
]);
}
// workaround for global decorators getting infinitely applied on HMR, see https://github.com/storybookjs/react-native/issues/185
clearDecorators();
decorators.forEach((decorator) => addDecorator(decorator));
}

if (parameters) {
addParameters(parameters);
addParameters(parameters);
}

try {
argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer));
argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer));
} catch {}

const getStories = () => {
return {
"./storybook/stories/Avatar/Avatar.stories.js": require("../storybook/stories/Avatar/Avatar.stories.js"),
"./storybook/stories/CheckBox/CheckBox.stories.js": require("../storybook/stories/CheckBox/CheckBox.stories.js"),
"./storybook/stories/DesignStystem/Colors.stories.js": require("../storybook/stories/DesignStystem/Colors.stories.js"),
"./storybook/stories/Image/Image.stories.js": require("../storybook/stories/Image/Image.stories.js"),
"./storybook/stories/Input/Input.stories.js": require("../storybook/stories/Input/Input.stories.js"),
"./storybook/stories/Loading/Loading.stories.js": require("../storybook/stories/Loading/Loading.stories.js"),
"./storybook/stories/LoadingFullScreen/LoadingFullScreen.stories.js": require("../storybook/stories/LoadingFullScreen/LoadingFullScreen.stories.js"),
"./storybook/stories/RadioButton/RadioButton.stories.js": require("../storybook/stories/RadioButton/RadioButton.stories.js"),
"./storybook/stories/StatusChip/StatusChip.stories.js": require("../storybook/stories/StatusChip/StatusChip.stories.js"),
"./storybook/stories/Svg/Svg.stories.js": require("../storybook/stories/Svg/Svg.stories.js"),
"./storybook/stories/SwipeUp/SwipeUp.stories.js": require("../storybook/stories/SwipeUp/SwipeUp.stories.js"),
"./storybook/stories/Text/Text.stories.js": require("../storybook/stories/Text/Text.stories.js"),
};
return {
'./storybook/stories/Avatar/Avatar.stories.js': require('../storybook/stories/Avatar/Avatar.stories.js'),
'./storybook/stories/CheckBox/CheckBox.stories.js': require('../storybook/stories/CheckBox/CheckBox.stories.js'),
'./storybook/stories/DesignStystem/Colors.stories.js': require('../storybook/stories/DesignStystem/Colors.stories.js'),
'./storybook/stories/DesignStystem/Icons.stories.js': require('../storybook/stories/DesignStystem/Icons.stories.js'),
'./storybook/stories/Image/Image.stories.js': require('../storybook/stories/Image/Image.stories.js'),
'./storybook/stories/Input/Input.stories.js': require('../storybook/stories/Input/Input.stories.js'),
'./storybook/stories/Loading/Loading.stories.js': require('../storybook/stories/Loading/Loading.stories.js'),
'./storybook/stories/LoadingFullScreen/LoadingFullScreen.stories.js': require('../storybook/stories/LoadingFullScreen/LoadingFullScreen.stories.js'),
'./storybook/stories/RadioButton/RadioButton.stories.js': require('../storybook/stories/RadioButton/RadioButton.stories.js'),
'./storybook/stories/Select/Select.stories.js': require('../storybook/stories/Select/Select.stories.js'),
'./storybook/stories/StatusChip/StatusChip.stories.js': require('../storybook/stories/StatusChip/StatusChip.stories.js'),
'./storybook/stories/Svg/Svg.stories.js': require('../storybook/stories/Svg/Svg.stories.js'),
'./storybook/stories/SwipeUp/SwipeUp.stories.js': require('../storybook/stories/SwipeUp/SwipeUp.stories.js'),
'./storybook/stories/Text/Text.stories.js': require('../storybook/stories/Text/Text.stories.js'),
};
};

configure(getStories, module, false);
1 change: 1 addition & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ module.exports = {
autodocs: 'tag',
},
typescript: {reactDocgen: false},
staticDirs: ['../src/fonts/'],
};
13 changes: 13 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap" rel="stylesheet">

<!-- Or you can load custom head-tag JavaScript: -->

<style>
@font-face {
font-family: 'janis-font-icon';
src: url('./janis-font-icon.ttf') format('truetype');
font-style: normal;
font-weight: normal;
}
</style>




12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added icon component with Janis fonts
- Added select component

## [1.0.4] - 2023-09-29

### Changed

- Updated lockfileVersion to 2

### Added

- Added radio button component

### Fixed

- Fixed lint staged command in order to check typescript errors on commits
- Fixed Loading component in order to work with android 7 devices

## [1.0.3] - 2023-08-24

Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,41 @@ The minimum required versions for using the package are **react: 17.0.2** and **
npm install @janiscommerce/ui-native
```

## Icons Installation

You will need to add the following lines in the **android/app/build.gradle** file:

```sh
android {
...
sourceSets {
main {
assets.srcDirs += [
'src/main/assets',
'../../node_modules/@janiscommerce/ui-native/dist/android/app/src/main/assets'
]
}
}
}
```

## SwipeUp component dependencies

You will need to have the following dependencies pre-installed:

- **"@gorhom/bottom-sheet"**
- **"react-native-reanimated"**
- **"react-native-gesture-handler"**

```sh
npm i react-native-reanimated react-native-gesture-handler @gorhom/bottom-sheet
```

- gesture-handler will allow you to recognize the actions performed by the user.

- reanimated is responsible for displaying the animations in the bottom drawer.

- Bottom-sheet is the one that provides the base components for our swipe
## Usage Example

A quick example of how to import a component and start using **@janiscommerce/ui-native**:
Expand Down
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ dependencies {

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

implementation project(':react-native-vector-icons')

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
Expand Down Expand Up @@ -225,3 +227,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
Binary file not shown.
3 changes: 3 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
rootProject.name = 'ui-native'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
Loading

0 comments on commit 762197b

Please sign in to comment.