@stackvibe-studio/ui 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # @stackvibe-studio/ui
2
+
3
+ > Core accessible UI component library for StackVibe UI. Built for React 19, Tailwind CSS v4, and modern design systems.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@stackvibe-studio/ui.svg)](https://www.npmjs.com/package/@stackvibe-studio/ui)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @stackvibe-studio/ui
12
+ # or
13
+ pnpm add @stackvibe-studio/ui
14
+ ```
15
+
16
+ ## Features
17
+
18
+ - **19+ Production Primitives**: Dialog, Drawer, Tooltip, Accordion, Switch, Progress, Toast, DropdownMenu, Button, Input, Textarea, Select, Checkbox, Card, Alert, Badge, Avatar, Skeleton, Tabs.
19
+ - **Accessible (WAI-ARIA)**: Full keyboard navigation, focus management, and screen-reader support.
20
+ - **Tailwind Native**: Styled with modular tokens and high-contrast dark theme defaults.
21
+ - **Tree-shakeable**: Dual ESM and CJS bundle exports with zero unnecessary dependencies.
22
+
23
+ ## Usage
24
+
25
+ ```tsx
26
+ import {
27
+ Button,
28
+ Dialog,
29
+ DialogHeader,
30
+ DialogTitle,
31
+ toast,
32
+ Toaster,
33
+ Switch,
34
+ Progress,
35
+ } from '@stackvibe-studio/ui';
36
+ import { useState } from 'react';
37
+
38
+ export function Example() {
39
+ const [open, setOpen] = useState(false);
40
+
41
+ return (
42
+ <div>
43
+ <Toaster />
44
+ <Button onClick={() => setOpen(true)}>Open Modal</Button>
45
+ <Switch defaultChecked onCheckedChange={(val) => toast.info(`Toggled: ${val}`)} />
46
+ <Progress value={80} variant="primary" showLabel />
47
+
48
+ <Dialog open={open} onOpenChange={setOpen}>
49
+ <DialogHeader>
50
+ <DialogTitle>Modal Dialog</DialogTitle>
51
+ </DialogHeader>
52
+ <p>Dialog body content</p>
53
+ </Dialog>
54
+ </div>
55
+ );
56
+ }
57
+ ```
58
+
59
+ ## Documentation
60
+
61
+ Full documentation, props specifications, and live examples:
62
+ [https://stackvibe-studio.github.io/stackvibe-ui/docs](https://stackvibe-studio.github.io/stackvibe-ui/docs)
63
+
64
+ ## License
65
+
66
+ MIT © [StackVibe Studio](https://github.com/StackVibe-Studio)
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface AccordionItemData {
3
+ id: string;
4
+ title: ReactNode;
5
+ content: ReactNode;
6
+ }
7
+ export interface AccordionProps {
8
+ items: AccordionItemData[];
9
+ type?: 'single' | 'multiple';
10
+ defaultOpen?: string[];
11
+ className?: string;
12
+ }
13
+ export declare function Accordion({ items, type, defaultOpen, className, }: AccordionProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export type AlertVariant = 'info' | 'success' | 'warning' | 'danger';
3
+ export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
4
+ title?: string;
5
+ variant?: AlertVariant;
6
+ }
7
+ export declare function Alert({ title, variant, className, children, ...props }: AlertProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { ImgHTMLAttributes } from 'react';
2
+ export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
3
+ fallback?: string;
4
+ size?: 'sm' | 'md' | 'lg';
5
+ }
6
+ export declare function Avatar({ src, alt, fallback, size, className, ...props }: AvatarProps): import("react").JSX.Element;
@@ -1,8 +1,19 @@
1
- import type { ButtonHTMLAttributes } from 'react';
1
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
2
2
  export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline';
3
3
  export type ButtonSize = 'sm' | 'md' | 'lg';
4
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
+ interface BaseButtonProps {
5
5
  variant?: ButtonVariant;
6
6
  size?: ButtonSize;
7
+ className?: string;
7
8
  }
8
- export declare function Button({ variant, size, className, ...props }: ButtonProps): import("react").JSX.Element;
9
+ type ButtonAsButtonProps = BaseButtonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
10
+ as?: 'button';
11
+ href?: never;
12
+ };
13
+ type ButtonAsAnchorProps = BaseButtonProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'type'> & {
14
+ as: 'a';
15
+ href?: string;
16
+ };
17
+ export type ButtonProps = ButtonAsButtonProps | ButtonAsAnchorProps;
18
+ export declare function Button(props: ButtonProps): import("react").JSX.Element;
19
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { InputHTMLAttributes } from 'react';
2
+ export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ }
4
+ export declare function Checkbox({ className, ...props }: CheckboxProps): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface DialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ children: ReactNode;
6
+ className?: string;
7
+ }
8
+ export declare function Dialog({ open, onOpenChange, children, className }: DialogProps): import("react").JSX.Element | null;
9
+ export declare function DialogHeader({ children, className }: {
10
+ children: ReactNode;
11
+ className?: string;
12
+ }): import("react").JSX.Element;
13
+ export declare function DialogTitle({ children, className }: {
14
+ children: ReactNode;
15
+ className?: string;
16
+ }): import("react").JSX.Element;
17
+ export declare function DialogDescription({ children, className }: {
18
+ children: ReactNode;
19
+ className?: string;
20
+ }): import("react").JSX.Element;
21
+ export declare function DialogFooter({ children, className }: {
22
+ children: ReactNode;
23
+ className?: string;
24
+ }): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface DrawerProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ position?: 'left' | 'right' | 'bottom';
6
+ children: ReactNode;
7
+ className?: string;
8
+ }
9
+ export declare function Drawer({ open, onOpenChange, position, children, className, }: DrawerProps): import("react").JSX.Element | null;
10
+ export declare function DrawerHeader({ children, className }: {
11
+ children: ReactNode;
12
+ className?: string;
13
+ }): import("react").JSX.Element;
14
+ export declare function DrawerTitle({ children, className }: {
15
+ children: ReactNode;
16
+ className?: string;
17
+ }): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface DropdownMenuItem {
3
+ id: string;
4
+ label: ReactNode;
5
+ icon?: ReactNode;
6
+ onClick?: () => void;
7
+ disabled?: boolean;
8
+ destructive?: boolean;
9
+ }
10
+ export interface DropdownMenuProps {
11
+ trigger: ReactNode;
12
+ items: DropdownMenuItem[];
13
+ align?: 'left' | 'right';
14
+ className?: string;
15
+ }
16
+ export declare function DropdownMenu({ trigger, items, align, className, }: DropdownMenuProps): import("react").JSX.Element;
@@ -1,4 +1,11 @@
1
+ export * from './alert';
2
+ export * from './avatar';
1
3
  export * from './badge';
2
4
  export * from './button';
3
5
  export * from './card';
6
+ export * from './checkbox';
4
7
  export * from './input';
8
+ export * from './select';
9
+ export * from './skeleton';
10
+ export * from './tabs';
11
+ export * from './textarea';
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
3
+ value?: number;
4
+ max?: number;
5
+ variant?: 'primary' | 'secondary' | 'success' | 'warning';
6
+ showLabel?: boolean;
7
+ }
8
+ export declare function Progress({ value, max, variant, showLabel, className, ...props }: ProgressProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { SelectHTMLAttributes } from 'react';
2
+ export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
3
+ }
4
+ export declare function Select({ className, children, ...props }: SelectProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
3
+ rounded?: 'sm' | 'md' | 'lg' | 'full';
4
+ }
5
+ export declare function Skeleton({ className, rounded, ...props }: SkeletonProps): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export interface SwitchProps {
2
+ checked?: boolean;
3
+ defaultChecked?: boolean;
4
+ onCheckedChange?: (checked: boolean) => void;
5
+ disabled?: boolean;
6
+ className?: string;
7
+ id?: string;
8
+ 'aria-label'?: string;
9
+ }
10
+ export declare function Switch({ checked, defaultChecked, onCheckedChange, disabled, className, id, 'aria-label': ariaLabel, }: SwitchProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ export type TabItem = {
3
+ id: string;
4
+ label: string;
5
+ content: ReactNode;
6
+ };
7
+ export interface TabsProps {
8
+ items: TabItem[];
9
+ defaultTab?: string;
10
+ className?: string;
11
+ }
12
+ export declare function Tabs({ items, defaultTab, className }: TabsProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { TextareaHTMLAttributes } from 'react';
2
+ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
3
+ }
4
+ export declare function Textarea({ className, ...props }: TextareaProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export interface ToastMessage {
2
+ id: string;
3
+ title?: string;
4
+ message: string;
5
+ type?: 'success' | 'error' | 'info' | 'warning';
6
+ duration?: number;
7
+ }
8
+ export declare const toast: {
9
+ show(message: string, options?: Partial<Omit<ToastMessage, "id" | "message">>): string;
10
+ success(message: string, title?: string): string;
11
+ error(message: string, title?: string): string;
12
+ info(message: string, title?: string): string;
13
+ dismiss(id: string): void;
14
+ };
15
+ export declare function Toaster(): import("react").JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface TooltipProps {
3
+ content: ReactNode;
4
+ children: ReactNode;
5
+ side?: 'top' | 'bottom' | 'left' | 'right';
6
+ className?: string;
7
+ }
8
+ export declare function Tooltip({ content, children, side, className, }: TooltipProps): import("react").JSX.Element;