decathlon-ui 0.1.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 +42 -0
- package/dist/components/Button/Button.d.ts +11 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +19 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# My React Native Library
|
|
2
|
+
|
|
3
|
+
Biblioteca de componentes React Native com Storybook para documentação hospedada no **GitHub Pages**.
|
|
4
|
+
|
|
5
|
+
## Scripts importantes
|
|
6
|
+
|
|
7
|
+
| Script | Descrição |
|
|
8
|
+
| ------ | --------- |
|
|
9
|
+
| `npm run storybook` | Inicia o Storybook em modo desenvolvimento (porta 6006). |
|
|
10
|
+
| `npm run build-storybook` | Gera a versão estática em `docs/` para publicar no GitHub Pages. |
|
|
11
|
+
| `npm run build` | Compila os componentes TypeScript para `dist/`. Utilizado antes de publicar no npm. |
|
|
12
|
+
|
|
13
|
+
## Publicação
|
|
14
|
+
|
|
15
|
+
1. Execute `npm run build` para gerar a pasta `dist`.
|
|
16
|
+
2. Faça login no npm (`npm login`).
|
|
17
|
+
3. `npm publish` – apenas o conteúdo de `dist` será incluído (veja campo `files` em `package.json`).
|
|
18
|
+
|
|
19
|
+
## GitHub Pages
|
|
20
|
+
|
|
21
|
+
Após rodar `npm run build-storybook`, faça commit da pasta `docs/`. No repositório do GitHub, configure **Settings → Pages** para servir a partir da pasta `docs` da branch `main`.
|
|
22
|
+
|
|
23
|
+
## Uso no React Native
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install my-react-native-library
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { Button } from 'my-react-native-library';
|
|
31
|
+
|
|
32
|
+
<Button title="Clique-me" onPress={() => console.log('oi')} />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Roadmap
|
|
36
|
+
|
|
37
|
+
- [ ] Adicionar mais componentes
|
|
38
|
+
- [ ] Testes automatizados
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
MIT License
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
title: string;
|
|
5
|
+
onPress?: () => void;
|
|
6
|
+
style?: ViewStyle;
|
|
7
|
+
textStyle?: TextStyle;
|
|
8
|
+
}
|
|
9
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
10
|
+
export default Button;
|
|
11
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAWxC,CAAC;AAgBF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable, StyleSheet, Text, } from "react-native";
|
|
3
|
+
export const Button = ({ title, onPress, style, textStyle, }) => {
|
|
4
|
+
return (_jsx(Pressable, { style: [styles.container, style], onPress: onPress, children: _jsx(Text, { style: [styles.text, textStyle], children: title }) }));
|
|
5
|
+
};
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
container: {
|
|
8
|
+
backgroundColor: "#1e90ff",
|
|
9
|
+
paddingVertical: 12,
|
|
10
|
+
paddingHorizontal: 24,
|
|
11
|
+
borderRadius: 4,
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
},
|
|
14
|
+
text: {
|
|
15
|
+
color: "#ffffff",
|
|
16
|
+
fontWeight: "600",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "./Button";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/Button";
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "decathlon-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Biblioteca de componentes React Native com Storybook e documentação via GitHub Pages.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"scripts": {
|
|
13
|
+
"storybook": "storybook dev -p 6006",
|
|
14
|
+
"build-storybook": "storybook build --output-dir docs",
|
|
15
|
+
"build": "tsc -p tsconfig.build.json",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": ">=17.0.0",
|
|
20
|
+
"react-native": ">=0.68.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@esbuild/darwin-arm64": "^0.25.5",
|
|
24
|
+
"esbuild": "^0.25.5"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@storybook/addon-docs": "^9.1.0-alpha.6",
|
|
28
|
+
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
29
|
+
"@storybook/addon-links": "^9.1.0-alpha.6",
|
|
30
|
+
"@storybook/react-vite": "^9.1.0-alpha.6",
|
|
31
|
+
"@types/react": "^18.2.24",
|
|
32
|
+
"@types/react-dom": "^18.2.8",
|
|
33
|
+
"@types/react-native": "^0.73.0",
|
|
34
|
+
"react": "^19.1.0",
|
|
35
|
+
"react-dom": "^19.1.0",
|
|
36
|
+
"react-native": "^0.80.1",
|
|
37
|
+
"react-native-web": "^0.19.9",
|
|
38
|
+
"storybook": "^9.1.0-alpha.6",
|
|
39
|
+
"typescript": "^5.2.2",
|
|
40
|
+
"vite": "^5.0.0"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/username/reponame.git"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://username.github.io/reponame/",
|
|
47
|
+
"keywords": [
|
|
48
|
+
"react-native",
|
|
49
|
+
"storybook",
|
|
50
|
+
"component-library"
|
|
51
|
+
],
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"packageManager": "yarn@4.9.2"
|
|
54
|
+
}
|