-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b6ac0e
commit 1b47f6a
Showing
18 changed files
with
436 additions
and
13,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
node_modules | ||
# Nuxt dev/build outputs | ||
.output | ||
.data | ||
.nuxt | ||
styled-system | ||
.nitro | ||
.cache | ||
dist | ||
|
||
# Node dependencies | ||
node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Misc | ||
.DS_Store | ||
.fleet | ||
.idea | ||
|
||
# Local env files | ||
.env | ||
.env.* | ||
!.env.example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,10 @@ | ||
<script setup lang="ts"> | ||
import { Divider, HStack, Stack, styled } from 'styled-system/jsx' | ||
import { container } from 'styled-system/patterns' | ||
import { card } from 'styled-system/recipes' | ||
import { Button } from '~/components/ui/button' | ||
import { Input } from '~/components/ui/input' | ||
import { Label } from '~/components/ui/label' | ||
const { body, description, footer, header, root, title } = card() | ||
const Typography = styled('p') | ||
import { Button } from '~/components/ui' | ||
</script> | ||
|
||
<template> | ||
<div :class="container({ py: '8', maxW: 'md' })"> | ||
<div :class="root"> | ||
<div :class="header"> | ||
<h2 :class="title">Sign Up</h2> | ||
<p :class="description"> | ||
Create an account and discover the worlds' best UI component framework. | ||
</p> | ||
</div> | ||
<div :class="body"> | ||
<Stack gap="4"> | ||
<Stack gap="3" direction="row"> | ||
<Button variant="outline" width="full">Google</Button> | ||
<Button variant="outline" width="full">GitHub</Button> | ||
</Stack> | ||
<HStack gap="2"> | ||
<Divider /> | ||
<Typography color="fg.subtle" textStyle="sm" whiteSpace="nowrap"> | ||
or sign up with | ||
</Typography> | ||
<Divider /> | ||
</HStack> | ||
<Stack gap="1.5"> | ||
<Label htmlFor="name">E-Mail</Label> | ||
<Input id="name" placeholder="Your E-Mail" /> | ||
</Stack> | ||
<Stack gap="1.5"> | ||
<Label htmlFor="password">Password</Label> | ||
<Input id="password" type="password" placeholder="Your Password" /> | ||
</Stack> | ||
</Stack> | ||
</div> | ||
<div :class="footer"> | ||
<Button width="full">Create Account</Button> | ||
</div> | ||
</div> | ||
<div> | ||
<NuxtRouteAnnouncer /> | ||
<Button>Park UI</Button> | ||
</div> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './primitives' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { styled } from 'styled-system/jsx' | ||
import { button } from 'styled-system/recipes' | ||
import type { ComponentProps } from 'styled-system/types' | ||
|
||
export type ButtonProps = ComponentProps<typeof Button> | ||
export const Button = styled('button', button) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Button, type ButtonProps } from './button' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { styled } from 'styled-system/jsx' | ||
import type { ElementType } from 'styled-system/types' | ||
import { type ComputedRef, computed, defineComponent, inject, provide } from 'vue' | ||
|
||
type Props = Record<string, unknown> | ||
type Recipe = { | ||
(props?: Props): Props | ||
splitVariantProps: (props: Props) => [Props, Props] | ||
} | ||
type Slot<R extends Recipe> = keyof ReturnType<R> | ||
type StyleContext<R extends Recipe> = Record<Slot<R>, string> | ||
|
||
export const createStyleContext = <R extends Recipe>(recipe: R) => { | ||
const withProvider = <P,>(Component: ElementType, slot: Slot<R>) => { | ||
const StyledComponent = styled(Component) | ||
|
||
return defineComponent<P>({ | ||
setup(props, { slots }) { | ||
const splittedProps = computed(() => { | ||
return recipe.splitVariantProps(props) | ||
}) | ||
|
||
const styles = computed(() => { | ||
const [variantProps] = splittedProps.value | ||
return recipe(variantProps) as StyleContext<R> | ||
}) | ||
|
||
provide('styles', styles) | ||
return () => ( | ||
<StyledComponent {...splittedProps.value[1]} class={styles.value[slot]}> | ||
{slots.default?.()} | ||
</StyledComponent> | ||
) | ||
}, | ||
}) | ||
} | ||
|
||
const withContext = <P,>(Component: ElementType, slot: Slot<R>) => { | ||
const StyledComponent = styled(Component) | ||
|
||
return defineComponent<P>({ | ||
setup(props, { slots }) { | ||
const slotStyles = inject<ComputedRef<StyleContext<R>>>('styles') | ||
|
||
return () => ( | ||
<StyledComponent {...props} class={slotStyles?.value?.[slot]}> | ||
{slots.default?.()} | ||
</StyledComponent> | ||
) | ||
}, | ||
}) | ||
} | ||
|
||
return { withProvider, withContext } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.