feat: initialize Vue component library and aligned documentation
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
/* Adapted from HeroUI v3, ce90ea3. Copyright 2025 NextUI Inc.
|
||||
* See third-party/HEROUI-LICENSE. Modified: hv- class prefix; Vue state adapters. */
|
||||
|
||||
import { tv, type VariantProps } from "tailwind-variants";
|
||||
|
||||
export const buttonVariants = tv({
|
||||
base: "hv-button",
|
||||
defaultVariants: {
|
||||
fullWidth: false,
|
||||
isIconOnly: false,
|
||||
size: "md",
|
||||
variant: "primary",
|
||||
},
|
||||
variants: {
|
||||
fullWidth: {
|
||||
false: "",
|
||||
true: "hv-button--full-width",
|
||||
},
|
||||
isIconOnly: {
|
||||
true: "hv-button--icon-only",
|
||||
},
|
||||
size: {
|
||||
lg: "hv-button--lg",
|
||||
md: "hv-button--md",
|
||||
sm: "hv-button--sm",
|
||||
},
|
||||
variant: {
|
||||
danger: "hv-button--danger",
|
||||
"danger-soft": "hv-button--danger-soft",
|
||||
ghost: "hv-button--ghost",
|
||||
outline: "hv-button--outline",
|
||||
primary: "hv-button--primary",
|
||||
secondary: "hv-button--secondary",
|
||||
tertiary: "hv-button--tertiary",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
||||
|
||||
const cardVariants = tv({
|
||||
defaultVariants: {
|
||||
variant: "default",
|
||||
},
|
||||
slots: {
|
||||
base: "hv-card",
|
||||
content: "hv-card__content",
|
||||
description: "hv-card__description",
|
||||
footer: "hv-card__footer",
|
||||
header: "hv-card__header",
|
||||
title: "hv-card__title",
|
||||
},
|
||||
variants: {
|
||||
variant: {
|
||||
default: {
|
||||
base: "hv-card--default",
|
||||
},
|
||||
secondary: {
|
||||
base: "hv-card--secondary",
|
||||
},
|
||||
tertiary: {
|
||||
base: "hv-card--tertiary",
|
||||
},
|
||||
transparent: {
|
||||
base: "hv-card--transparent",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export { cardVariants };
|
||||
export type CardVariants = VariantProps<typeof cardVariants>;
|
||||
|
||||
export const inputVariants = tv({
|
||||
base: "hv-input",
|
||||
defaultVariants: {
|
||||
fullWidth: false,
|
||||
variant: "primary",
|
||||
},
|
||||
variants: {
|
||||
fullWidth: {
|
||||
false: "",
|
||||
true: "hv-input--full-width",
|
||||
},
|
||||
variant: {
|
||||
primary: "hv-input--primary",
|
||||
secondary: "hv-input--secondary",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export type InputVariants = VariantProps<typeof inputVariants>;
|
||||
|
||||
export const switchVariants = tv({
|
||||
defaultVariants: {
|
||||
size: "md",
|
||||
},
|
||||
slots: {
|
||||
base: "hv-switch",
|
||||
content: "hv-switch__content",
|
||||
control: "hv-switch__control",
|
||||
icon: "hv-switch__icon",
|
||||
thumb: "hv-switch__thumb",
|
||||
},
|
||||
variants: {
|
||||
size: {
|
||||
lg: {
|
||||
base: "hv-switch--lg",
|
||||
},
|
||||
md: {
|
||||
base: "hv-switch--md",
|
||||
},
|
||||
sm: {
|
||||
base: "hv-switch--sm",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export type SwitchVariants = VariantProps<typeof switchVariants>;
|
||||
|
||||
export { tv, cn, type VariantProps } from "tailwind-variants";
|
||||
|
||||
export const closeButtonVariants = tv({
|
||||
base: "hv-close-button",
|
||||
defaultVariants: { variant: "default" },
|
||||
variants: { variant: { default: "hv-close-button--default" } },
|
||||
});
|
||||
export type CloseButtonVariants = VariantProps<typeof closeButtonVariants>;
|
||||
Reference in New Issue
Block a user