Skip to content

Commit

Permalink
Merge pull request #52 from castrogarciajs/main
Browse files Browse the repository at this point in the history
close #41
  • Loading branch information
orisme12 authored Mar 30, 2024
2 parents e5f5196 + 3ed0332 commit 6e26535
Show file tree
Hide file tree
Showing 15 changed files with 172 additions and 83 deletions.
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.22",
"astro": "^4.0.1",
"lucide-astro": "0.363.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "^3.4.3",
Expand Down
Binary file added apps/web/public/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/web/public/openui-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions apps/web/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
import { Image } from "astro:assets";
import {Github} from 'lucide-astro'
import Link from "./Link.astro";
---

<header class="py-4 px-8 flex justify-between items-center">
<figure class="m-0 flex items-center justify-center gap-2">
<Image src='/openui-logo.svg' alt='Logo de open UI design system' title='Logo de open ui' width='50' height='50' />
<h2 class="text-2xl font-medium">
Open UI
</h2>
</figure>
<div class="flex justify-center gap-8">
<nav class="flex justify-center items-center gap-6">
<a href="https://docs.openui.org" class="hover:text-white/90" target="_blank">Docs</a>
<a href="https://www.figma.com/community/file/1354464067434498042" class="hover:text-white/90" target="_blank">Figma</a>
</nav>
<nav class="flex justify-center gap-4 items-center">
<Link href="https://github.com/open-land/open-ui" target="_blank">
<Github class="size-6" />
Github
</Link>
</nav>
</div>
</header>
4 changes: 4 additions & 0 deletions apps/web/src/components/Link.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<a class="inline-flex items-center justify-center whitespace-nowrap rounded text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 text-black bg-white shadow hover:bg-white/90 h-9 px-4 py-2 gap-1 cursor-pointer" {...Astro.props} >
<slot />
</a>
11 changes: 8 additions & 3 deletions apps/web/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
import Header from '../components/Header.astro';
interface Props {
title: string;
}
Expand All @@ -22,7 +24,10 @@ const { title } = Astro.props;
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<slot />
<body class="bg-dark-900/95 text-white">
<Header />
<main class="container">
<slot />
</main>
</body>
</html>
</html>
34 changes: 29 additions & 5 deletions apps/web/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
---
import { Button } from '@openui-org/react'
import {ArrowUpRight} from 'lucide-astro'
import Layout from '../layouts/Layout.astro';
import Link from '../components/Link.astro';
---

<Layout title="Welcome to Open UI.">
<main>
<h1>Hello Open Land</h1>
<Button> Get Started </Button>
</main>
<img src="/gradient.png" alt="" class="absolute -top-8 left-2/4 -translate-x-1/2" width="800">
<section class="py-24 sm:py-32 md:py-40 relative dark:bg-gradient-to-b from-gray-950 to-gray-900">
<div class="mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl gap-16 sm:gap-y-24 flex flex-col">
<div class="text-center relative z-[1]">
<h1 class="text-6xl font-bold tracking-tight text-white text-balance">
<b class="text-secondary-500">
Open UI
</b>. A modern design system built with <b class="text-secondary-500">
Shadcn UI</b> and
<b class="text-secondary-500">
Tailwind CSS
</b>
</h1>
<p class="mt-6 text-lg tracking-tight text-dark-500 text-pretty">
Open UI is an open source design system with a completely cutting-edge system. <br> Fully customizable and modifiable you will make UI development much faster with fully stylized components.
</p>
<div class="mt-10 flex flex-wrap gap-x-6 gap-y-3 justify-center">

<Link href="https://docs.openui.org">
<ArrowUpRight class="size-6"/>
Get Started
</Link>

</div>
</div>
</div>
</section>
</Layout>
76 changes: 2 additions & 74 deletions examples/with-nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Image from 'next/image'
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from '@openui-org/react'
import { DialogDemo } from '@/components/test-dialog'
import { CheckboxWithText } from '@/components/checkbox'

export default function Home() {
return (
Expand Down Expand Up @@ -83,80 +84,7 @@ export default function Home() {
priority
/>
</div>

<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left">
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Docs
{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Find in-depth information about Next.js features and API.
</p>
</a>

<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Learn
{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Templates
{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">
Explore starter templates for Next.js.
</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30"
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
Deploy
{' '}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50 text-balance">
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
<CheckboxWithText />
<Table>
<TableCaption>A list of your recent invoices.</TableCaption>
<TableHeader>
Expand Down
19 changes: 19 additions & 0 deletions examples/with-nextjs/components/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client'

import { Checkbox, Label } from '@openui-org/react'

export function CheckboxWithText() {
return (
<div className="items-top flex space-x-2">
<Checkbox id="terms1" />
<div className="grid gap-1.5 leading-none">
<Label>
Accept terms and conditions
</Label>
<p className="text-sm text-muted-foreground">
You agree to our Terms of Service and Privacy Policy.
</p>
</div>
</div>
)
}
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@radix-ui/react-alert-dialog": "1.0.5",
"@radix-ui/react-aspect-ratio": "1.0.3",
"@radix-ui/react-avatar": "1.0.4",
"@radix-ui/react-checkbox": "1.0.4",
"@radix-ui/react-dialog": "1.0.5",
"@radix-ui/react-label": "2.0.2",
"@radix-ui/react-select": "2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type VariantProps, cva } from 'class-variance-authority'
import { cn } from '../lib/cn'

const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 text-white font-medium',
'inline-flex items-center justify-center whitespace-nowrap rounded text-base font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 text-white',
{
variants: {
variant: {
Expand All @@ -15,6 +15,7 @@ const buttonVariants = cva(
dark: 'bg-dark-900 shadow hover:bg-dark-900/90',
warn: 'bg-warn-500 shadow hover:bg-warn-500/90',
error: 'bg-error-500 shadow hover:bg-error-500/90',
ligth: 'bg-white shadow text-black hover:bg-white/90',
},
size: {
sm: 'h-8 rounded-md px-3 text-xs',
Expand Down
28 changes: 28 additions & 0 deletions packages/react/src/components/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from 'react'
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'

import { cn } from '../lib/cn'

const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
ref={ref}
className={cn(
'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
className,
)}
{...props}
>
<CheckboxPrimitive.Indicator
className={cn('flex items-center justify-center text-current')}
>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-check size-4"><path d="M20 6 9 17l-5-5" /></svg>
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
))

Checkbox.displayName = CheckboxPrimitive.Root.displayName

export { Checkbox }
1 change: 1 addition & 0 deletions packages/react/src/components/label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const labelVariants = cva(
dark: 'text-dark-900 hover:text-dark-900/90',
warn: 'text-warn-500 hover:text-warn-500/90',
error: 'text-error-500 hover:text-error-500/90',
ligth: 'text-white hover:text-white/90',
},
size: {
sm: 'text-sm',
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ export * from './components/dialog'
export * from './components/select'
export * from './components/card'
export * from './components/separator'
export * from './components/checkbox'
42 changes: 42 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e26535

Please sign in to comment.