generated from avior/template-web-astro
initial recommit
This commit is contained in:
35
src/components/global/Button/Default.astro
Normal file
35
src/components/global/Button/Default.astro
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
import { objectOmit } from '@dzeio/object-util'
|
||||
import type ButtonProps from './Props'
|
||||
|
||||
export interface Props extends ButtonProps {}
|
||||
|
||||
const classes = [
|
||||
"button",
|
||||
{outline: Astro.props.outline},
|
||||
{ghost: Astro.props.ghost},
|
||||
Astro.props.class
|
||||
]
|
||||
|
||||
---
|
||||
{'href' in Astro.props && (
|
||||
<a class:list={classes} {...objectOmit(Astro.props, 'type') as any}>
|
||||
<slot />
|
||||
</a>
|
||||
) || (
|
||||
<button class:list={classes} {...objectOmit(Astro.props, 'type') as any}>
|
||||
<slot />
|
||||
</button>
|
||||
)}
|
||||
|
||||
<style>
|
||||
.button {
|
||||
@apply outline-none inline-flex px-4 py-2 rounded-lg bg-amber-500 hover:bg-amber-600 active:bg-amber-700 text-white font-medium transition-colors
|
||||
}
|
||||
.button.outline {
|
||||
@apply bg-transparent border-2 text-amber-500 border-gray-200 hover:bg-gray-100 active:bg-gray-200 active:border-gray-300
|
||||
}
|
||||
.button.ghost {
|
||||
@apply text-black bg-transparent hover:bg-gray-200 active:bg-gray-300
|
||||
}
|
||||
</style>
|
29
src/components/global/Button/Linux.astro
Normal file
29
src/components/global/Button/Linux.astro
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
import { objectOmit } from '@dzeio/object-util'
|
||||
import type ButtonProps from './Props'
|
||||
|
||||
export interface Props extends ButtonProps {}
|
||||
|
||||
const classes = [
|
||||
"button",
|
||||
{outline: Astro.props.outline},
|
||||
{ghost: Astro.props.ghost},
|
||||
Astro.props.class
|
||||
]
|
||||
|
||||
---
|
||||
{'href' in Astro.props && (
|
||||
<a class:list={classes} {...objectOmit(Astro.props, 'type') as any}>
|
||||
<slot />
|
||||
</a>
|
||||
) || (
|
||||
<button class:list={classes} {...objectOmit(Astro.props, 'type') as any}>
|
||||
<slot />
|
||||
</button>
|
||||
)}
|
||||
|
||||
<style>
|
||||
.button {
|
||||
@apply inline-flex px-4 py-2 rounded-lg bg-gtk-neutral-200 hover:bg-gray-300 active:bg-gray-400 focus:outline-2 focus:outline outline-gtk-blue-300 text-black font-medium transition-all
|
||||
}
|
||||
</style>
|
4
src/components/global/Button/Props.d.ts
vendored
Normal file
4
src/components/global/Button/Props.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export default interface Props extends astroHTML.JSX.AnchorHTMLAttributes {
|
||||
outline?: boolean
|
||||
ghost?: boolean
|
||||
}
|
35
src/components/global/Button/Windows.astro
Normal file
35
src/components/global/Button/Windows.astro
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
import { objectOmit } from '@dzeio/object-util'
|
||||
import type ButtonProps from './Props'
|
||||
|
||||
export interface Props extends ButtonProps {}
|
||||
|
||||
const classes = [
|
||||
"button",
|
||||
{outline: Astro.props.outline},
|
||||
{ghost: Astro.props.ghost},
|
||||
Astro.props.class
|
||||
]
|
||||
|
||||
---
|
||||
{'href' in Astro.props && (
|
||||
<a class:list={classes} {...objectOmit(Astro.props, 'type') as any}>
|
||||
<slot />
|
||||
</a>
|
||||
) || (
|
||||
<button class:list={classes} {...objectOmit(Astro.props, 'type') as any}>
|
||||
<slot />
|
||||
</button>
|
||||
)}
|
||||
|
||||
<style>
|
||||
.button {
|
||||
@apply outline-none inline-flex px-4 py-2 rounded-lg bg-amber-500 hover:bg-amber-600 active:bg-amber-700 text-white font-medium transition-colors
|
||||
}
|
||||
.button.outline {
|
||||
@apply bg-transparent border-2 text-amber-500 border-gray-200 hover:bg-gray-100 active:bg-gray-200 active:border-gray-300
|
||||
}
|
||||
.button.ghost {
|
||||
@apply text-black bg-transparent hover:bg-gray-200 active:bg-gray-300
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user