From 584fbf83b5829097ed3febf33a572473952231bf Mon Sep 17 00:00:00 2001 From: Agustin Oberg <154552167+codeagus11@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:42:44 -0300 Subject: [PATCH 01/60] feat: base ui --- .gitignore | 175 ++++++++++++++++++++++++ .vscode/settings.json | 3 + README.md | 15 +++ apps/demo/.gitignore | 39 ++++++ apps/demo/App.tsx | 138 +++++++++++++++++++ apps/demo/app.json | 34 +++++ apps/demo/assets/adaptive-icon.png | Bin 0 -> 17547 bytes apps/demo/assets/favicon.png | Bin 0 -> 1466 bytes apps/demo/assets/icon.png | Bin 0 -> 22380 bytes apps/demo/assets/splash-icon.png | Bin 0 -> 17547 bytes apps/demo/babel.config.js | 11 ++ apps/demo/index.ts | 8 ++ apps/demo/package.json | 32 +++++ apps/demo/tsconfig.json | 9 ++ bun.lockb | Bin 0 -> 248016 bytes index.ts | 1 + package.json | 12 ++ packages/ui/.gitignore | 175 ++++++++++++++++++++++++ packages/ui/README.md | 15 +++ packages/ui/hooks/useFontConfig.ts | 0 packages/ui/index.ts | 12 ++ packages/ui/package.json | 11 ++ packages/ui/theme/unistyles.ts | 103 ++++++++++++++ packages/ui/tsconfig.json | 27 ++++ packages/ui/ui/avatar.tsx | 179 +++++++++++++++++++++++++ packages/ui/ui/badge.tsx | 110 +++++++++++++++ packages/ui/ui/button.tsx | 188 ++++++++++++++++++++++++++ packages/ui/ui/checkbox.tsx | 158 ++++++++++++++++++++++ packages/ui/ui/input.tsx | 166 +++++++++++++++++++++++ packages/ui/ui/progress.tsx | 89 +++++++++++++ packages/ui/ui/radio.tsx | 207 +++++++++++++++++++++++++++++ packages/ui/ui/switch.tsx | 158 ++++++++++++++++++++++ packages/ui/ui/text-area.tsx | 170 +++++++++++++++++++++++ packages/ui/ui/text.tsx | 120 +++++++++++++++++ tsconfig.json | 27 ++++ 35 files changed, 2392 insertions(+) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 README.md create mode 100644 apps/demo/.gitignore create mode 100644 apps/demo/App.tsx create mode 100644 apps/demo/app.json create mode 100644 apps/demo/assets/adaptive-icon.png create mode 100644 apps/demo/assets/favicon.png create mode 100644 apps/demo/assets/icon.png create mode 100644 apps/demo/assets/splash-icon.png create mode 100644 apps/demo/babel.config.js create mode 100644 apps/demo/index.ts create mode 100644 apps/demo/package.json create mode 100644 apps/demo/tsconfig.json create mode 100755 bun.lockb create mode 100644 index.ts create mode 100644 package.json create mode 100644 packages/ui/.gitignore create mode 100644 packages/ui/README.md create mode 100644 packages/ui/hooks/useFontConfig.ts create mode 100644 packages/ui/index.ts create mode 100644 packages/ui/package.json create mode 100644 packages/ui/theme/unistyles.ts create mode 100644 packages/ui/tsconfig.json create mode 100644 packages/ui/ui/avatar.tsx create mode 100644 packages/ui/ui/badge.tsx create mode 100644 packages/ui/ui/button.tsx create mode 100644 packages/ui/ui/checkbox.tsx create mode 100644 packages/ui/ui/input.tsx create mode 100644 packages/ui/ui/progress.tsx create mode 100644 packages/ui/ui/radio.tsx create mode 100644 packages/ui/ui/switch.tsx create mode 100644 packages/ui/ui/text-area.tsx create mode 100644 packages/ui/ui/text.tsx create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b1ee42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,175 @@ +# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore + +# Logs + +logs +_.log +npm-debug.log_ +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Caches + +.cache + +# Diagnostic reports (https://nodejs.org/api/report.html) + +report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json + +# Runtime data + +pids +_.pid +_.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover + +lib-cov + +# Coverage directory used by tools like istanbul + +coverage +*.lcov + +# nyc test coverage + +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) + +.grunt + +# Bower dependency directory (https://bower.io/) + +bower_components + +# node-waf configuration + +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) + +build/Release + +# Dependency directories + +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) + +web_modules/ + +# TypeScript cache + +*.tsbuildinfo + +# Optional npm cache directory + +.npm + +# Optional eslint cache + +.eslintcache + +# Optional stylelint cache + +.stylelintcache + +# Microbundle cache + +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history + +.node_repl_history + +# Output of 'npm pack' + +*.tgz + +# Yarn Integrity file + +.yarn-integrity + +# dotenv environment variable files + +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) + +.parcel-cache + +# Next.js build output + +.next +out + +# Nuxt.js build / generate output + +.nuxt +dist + +# Gatsby files + +# Comment in the public line in if your project uses Gatsby and not Next.js + +# https://nextjs.org/blog/next-9-1#public-directory-support + +# public + +# vuepress build output + +.vuepress/dist + +# vuepress v2.x temp and cache directory + +.temp + +# Docusaurus cache and generated files + +.docusaurus + +# Serverless directories + +.serverless/ + +# FuseBox cache + +.fusebox/ + +# DynamoDB Local files + +.dynamodb/ + +# TernJS port file + +.tern-port + +# Stores VSCode versions used for testing VSCode extensions + +.vscode-test + +# yarn v2 + +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# IntelliJ based IDEs +.idea + +# Finder (MacOS) folder config +.DS_Store diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..23fd35f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ff587c5 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# leshi + +To install dependencies: + +```bash +bun install +``` + +To run: + +```bash +bun run index.ts +``` + +This project was created using `bun init` in bun v1.1.33. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. diff --git a/apps/demo/.gitignore b/apps/demo/.gitignore new file mode 100644 index 0000000..df53d0b --- /dev/null +++ b/apps/demo/.gitignore @@ -0,0 +1,39 @@ +# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files + +# dependencies +node_modules/ + +# Expo +.expo/ +dist/ +web-build/ +expo-env.d.ts + +# Native +.kotlin/ +*.orig.* +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision + +# Metro +.metro-health-check* + +# debug +npm-debug.* +yarn-debug.* +yarn-error.* + +# macOS +.DS_Store +*.pem + +# local env files +.env*.local + +# typescript +*.tsbuildinfo +android +ios \ No newline at end of file diff --git a/apps/demo/App.tsx b/apps/demo/App.tsx new file mode 100644 index 0000000..c19fe58 --- /dev/null +++ b/apps/demo/App.tsx @@ -0,0 +1,138 @@ +// ProfileScreen.tsx +import { + Avatar, + AvatarFallback, + AvatarImage, + Badge, + Button, + Checkbox, + Input, + Progress, + Radio, + Switch, + Text, + Textarea, +} from "@leshi/ui"; +import React from "react"; +import { ScrollView, View, SafeAreaView } from "react-native"; +import { useUnistyles } from "react-native-unistyles"; +import { useFonts } from "@expo-google-fonts/chathura/useFonts"; +import { Chathura_100Thin } from "@expo-google-fonts/chathura/100Thin"; +import { Chathura_300Light } from "@expo-google-fonts/chathura/300Light"; +import { Chathura_400Regular } from "@expo-google-fonts/chathura/400Regular"; +import { Chathura_700Bold } from "@expo-google-fonts/chathura/700Bold"; +import { Chathura_800ExtraBold } from "@expo-google-fonts/chathura/800ExtraBold"; + +const ProfileScreen: React.FC = () => { + const { theme } = useUnistyles(); + const [marketing, setMarketing] = React.useState(true); + const [gender, setGender] = React.useState("female"); + const [terms, setTerms] = React.useState(false); + const [progress, setProgress] = React.useState(80); + let [fontsLoaded] = useFonts({ + Chathura_100Thin, + Chathura_300Light, + Chathura_400Regular, + Chathura_700Bold, + Chathura_800ExtraBold, + }); + if (!fontsLoaded) { + return null; + } + return ( + + + {/* aHeader */} + + + + AG + + + Hola, fuente + + + Ana Gómez + + + Activa + + + + {/* Inputs */} + + + + +