@preply/ds-rn-lib 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -0
- package/dist/components/Text/Text.d.ts +3 -0
- package/dist/components/Text/Text.js +9 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# `@preply/ds-rn-lib`
|
|
2
|
+
|
|
3
|
+
> DS component library for React Native
|
|
4
|
+
|
|
5
|
+
## Using the Design System in a React Native app?
|
|
6
|
+
|
|
7
|
+
Follow the instructions in [@preply/ds-workspace](../../README.md).
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
**tl;dr:**
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { RootProvider } from '@preply/ds-rn-root';
|
|
14
|
+
import { Text } from '@preply/ds-rn-lib';
|
|
15
|
+
|
|
16
|
+
export const App: FC = () => (
|
|
17
|
+
<RootProvider>
|
|
18
|
+
<Text>Hello!</Text>
|
|
19
|
+
</RootProvider>
|
|
20
|
+
);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Specific for React Native:
|
|
24
|
+
|
|
25
|
+
#### Install the packages
|
|
26
|
+
|
|
27
|
+
`yarn add @preply/ds-rn-lib @preply/ds-rn-root`
|
|
28
|
+
|
|
29
|
+
#### Add `RootProvider`
|
|
30
|
+
|
|
31
|
+
It should wrap the whole app as in the example above and will use the default theme. You can also override the theme by passing it as prop:
|
|
32
|
+
|
|
33
|
+
`<AppProvider theme="bold-ui">`
|
|
34
|
+
|
|
35
|
+
## Contributing
|
|
36
|
+
|
|
37
|
+
Reach out to [#design-system-public](https://preply.slack.com/archives/C024EAEHP6V) if you think you can help and keep an eye on [DS Confluence](https://preply.atlassian.net/wiki/spaces/DS/overview) for more docs, guides, work in progress, decisions, the works.
|
|
38
|
+
|
|
39
|
+
## Development
|
|
40
|
+
|
|
41
|
+
You probably want to execute `yarn dev` in the root, as per instructions in [@preply/ds-workspace](../../README.md).
|
|
42
|
+
|
|
43
|
+
For quicker - and more focused - feedback, you can also directly use the scripts in this package directory, but make sure you have first executed `yarn build` in root, or that you have the root `yarn dev` script running in the background.
|
|
44
|
+
|
|
45
|
+
## Tooling
|
|
46
|
+
|
|
47
|
+
Details about tools and configurations in [@preply/ds-workspace](../../README.md).
|
|
48
|
+
|
|
49
|
+
## Dependencies
|
|
50
|
+
|
|
51
|
+
**Note:** `@preply/ds-***` are declared both as direct and peer dependencies:
|
|
52
|
+
|
|
53
|
+
- to ensure `rollup` excludes them from the bundle.
|
|
54
|
+
- to ensure Lerna honours build sequence (does not do so for peer dependencies).
|
|
55
|
+
|
|
56
|
+
### Dev dependencies
|
|
57
|
+
|
|
58
|
+
We only list the dependencies used directly in tests (`@testing-library/react-native`, `metro-react-native-babel-preset`) and some in which we need a specific version to avoid version mismatch and the tests crashing (`react`, `react-native`, `react-test-renderer`)
|
|
59
|
+
|
|
60
|
+
**Do NOT add dependencies on** linting, testing, building tools unless:
|
|
61
|
+
|
|
62
|
+
- you need to require some resource in a doc file or a test.
|
|
63
|
+
- you need to add a very specific plugin to this package only and you want to signal the dependency loudly.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text as Text$1 } from 'react-native';
|
|
3
|
+
|
|
4
|
+
const Text = props => {
|
|
5
|
+
return React.createElement(Text$1, Object.assign({}, props));
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { Text };
|
|
9
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGV4dC5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvVGV4dC9UZXh0LnRzeCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgRkMgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBUZXh0IGFzIFJOVGV4dCwgVGV4dFByb3BzIH0gZnJvbSAncmVhY3QtbmF0aXZlJztcblxuZXhwb3J0IGNvbnN0IFRleHQ6IEZDPFRleHRQcm9wcz4gPSBwcm9wcyA9PiB7XG4gICAgcmV0dXJuIDxSTlRleHQgey4uLnByb3BzfSAvPjtcbn07XG4iXSwibmFtZXMiOlsiUk5UZXh0Il0sIm1hcHBpbmdzIjoiOzs7TUFHYSxJQUFJLEdBQWtCLEtBQUs7SUFDcEMsT0FBTyxvQkFBQ0EsTUFBTSxvQkFBSyxLQUFLLEVBQUksQ0FBQztBQUNqQzs7OzsifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Text } from './Text/Text';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@preply/ds-rn-lib",
|
|
3
|
+
"version": "0.42.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"scripts": {
|
|
13
|
+
"clean": "rm -rf dist",
|
|
14
|
+
"lint": "run --top-level eslint --ext .js,.ts,.tsx,.mdx *.config.js src/",
|
|
15
|
+
"test": "run --top-level jest --coverage",
|
|
16
|
+
"build": "NODE_ENV=production && run build:rollup",
|
|
17
|
+
"build:rollup": "run --top-level rollup -c rollup.config.js",
|
|
18
|
+
"dev": "run build:rollup -w"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@preply/ds-core": "0.42.0",
|
|
22
|
+
"@preply/ds-rn-core": "0.42.0",
|
|
23
|
+
"@preply/ds-rn-root": "0.42.0"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@preply/ds-core": "0.42.0",
|
|
27
|
+
"@preply/ds-rn-core": "0.42.0",
|
|
28
|
+
"@preply/ds-rn-root": "0.42.0",
|
|
29
|
+
"react": "^18.0.0",
|
|
30
|
+
"react-native": "^0.69.4"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@testing-library/react-native": "11.0.0",
|
|
34
|
+
"metro-react-native-babel-preset": "0.72.2",
|
|
35
|
+
"react": "18.0.0",
|
|
36
|
+
"react-native": "0.69.4",
|
|
37
|
+
"react-test-renderer": "18.0.0"
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "5a72612d98a18f41c14aa59f0e6ac0f1f3760ace"
|
|
40
|
+
}
|