@stackvibe-studio/ui 0.2.0 → 0.3.1

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 CHANGED
@@ -1,55 +1,66 @@
1
1
  # @stackvibe-studio/ui
2
2
 
3
- Core React component library for product teams building premium SaaS experiences.
3
+ > Core accessible UI component library for StackVibe UI. Built for React 19, Tailwind CSS v4, and modern design systems.
4
4
 
5
- ## Highlights
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)
6
7
 
7
- - Accessible defaults for forms, cards, alerts, and calls to action
8
- - Flexible primitives with utility-friendly props
9
- - Tailwind-ready styling with a compact design language
10
- - New additions in v0.2.0: Tabs and Skeleton loaders
11
-
12
- ## Install
8
+ ## Installation
13
9
 
14
10
  ```bash
15
11
  npm install @stackvibe-studio/ui
12
+ # or
13
+ pnpm add @stackvibe-studio/ui
16
14
  ```
17
15
 
18
- ## Included components
16
+ ## Features
19
17
 
20
- - Button
21
- - Badge
22
- - Card
23
- - Input
24
- - Textarea
25
- - Select
26
- - Checkbox
27
- - Alert
28
- - Avatar
29
- - Tabs
30
- - Skeleton
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.
31
22
 
32
- ## Example
23
+ ## Usage
33
24
 
34
25
  ```tsx
35
- import { Button, Card, Tabs } from '@stackvibe-studio/ui';
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';
36
37
 
37
38
  export function Example() {
39
+ const [open, setOpen] = useState(false);
40
+
38
41
  return (
39
- <Card className="p-5">
40
- <Tabs
41
- items={[
42
- { id: 'overview', label: 'Overview', content: 'Overview content' },
43
- { id: 'activity', label: 'Activity', content: 'Activity content' },
44
- ]}
45
- />
46
- <Button className="mt-4">Launch</Button>
47
- </Card>
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>
48
55
  );
49
56
  }
50
57
  ```
51
58
 
52
59
  ## Documentation
53
60
 
54
- - Docs: https://stackvibe-studio.github.io/stackvibe-ui/
55
- - Playground: https://stackvibe-studio.github.io/stackvibe-ui/playground/
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,19 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface AccordionItemData {
3
+ id: string;
4
+ title: ReactNode;
5
+ content: ReactNode;
6
+ icon?: ReactNode;
7
+ }
8
+ export type AccordionVariant = 'bordered' | 'separated' | 'ghost';
9
+ export type AccordionRadius = 'sm' | 'md' | 'lg' | 'xl';
10
+ export interface AccordionProps {
11
+ items: AccordionItemData[];
12
+ type?: 'single' | 'multiple';
13
+ variant?: AccordionVariant;
14
+ radius?: AccordionRadius;
15
+ defaultOpen?: string[];
16
+ className?: string;
17
+ customIcon?: (isOpen: boolean) => ReactNode;
18
+ }
19
+ export declare function Accordion({ items, type, variant, radius, defaultOpen, className, customIcon, }: AccordionProps): import("react").JSX.Element;
@@ -1,7 +1,12 @@
1
- import type { HTMLAttributes } from 'react';
2
- export type AlertVariant = 'info' | 'success' | 'warning' | 'danger';
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ export type AlertVariant = 'info' | 'success' | 'warning' | 'destructive' | 'primary';
3
+ export type AlertRadius = 'sm' | 'md' | 'lg' | 'xl';
3
4
  export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
4
5
  title?: string;
5
6
  variant?: AlertVariant;
7
+ radius?: AlertRadius;
8
+ icon?: ReactNode;
9
+ dismissible?: boolean;
10
+ onDismiss?: () => void;
6
11
  }
7
- export declare function Alert({ title, variant, className, children, ...props }: AlertProps): import("react").JSX.Element;
12
+ export declare function Alert({ title, variant, radius, icon, dismissible, onDismiss, className, children, ...props }: AlertProps): import("react").JSX.Element | null;
@@ -1,6 +1,11 @@
1
1
  import type { ImgHTMLAttributes } from 'react';
2
+ export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
3
+ export type AvatarShape = 'circle' | 'rounded' | 'square';
4
+ export type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
2
5
  export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
3
6
  fallback?: string;
4
- size?: 'sm' | 'md' | 'lg';
7
+ size?: AvatarSize;
8
+ shape?: AvatarShape;
9
+ status?: AvatarStatus;
5
10
  }
6
- export declare function Avatar({ src, alt, fallback, size, className, ...props }: AvatarProps): import("react").JSX.Element;
11
+ export declare function Avatar({ src, alt, fallback, size, shape, status, className, ...props }: AvatarProps): import("react").JSX.Element;
@@ -1,6 +1,13 @@
1
- import type { HTMLAttributes } from 'react';
2
- export type BadgeVariant = 'primary' | 'secondary' | 'outline';
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type BadgeVariant = 'primary' | 'secondary' | 'outline' | 'destructive' | 'success' | 'warning' | 'glass';
3
+ export type BadgeSize = 'sm' | 'md' | 'lg';
4
+ export type BadgeRadius = 'sm' | 'md' | 'lg' | 'full';
3
5
  export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
4
6
  variant?: BadgeVariant;
7
+ size?: BadgeSize;
8
+ radius?: BadgeRadius;
9
+ dot?: boolean;
10
+ leftIcon?: ReactNode;
11
+ rightIcon?: ReactNode;
5
12
  }
6
- export declare function Badge({ variant, className, ...props }: BadgeProps): import("react").JSX.Element;
13
+ export declare function Badge({ variant, size, radius, dot, leftIcon, rightIcon, children, className, ...props }: BadgeProps): import("react").JSX.Element;
@@ -1,9 +1,17 @@
1
- import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'react';
2
- export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline';
3
- export type ButtonSize = 'sm' | 'md' | 'lg';
1
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
2
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline' | 'destructive' | 'glass' | 'gradient';
3
+ export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ export type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
4
5
  interface BaseButtonProps {
5
6
  variant?: ButtonVariant;
6
7
  size?: ButtonSize;
8
+ radius?: ButtonRadius;
9
+ fullWidth?: boolean;
10
+ loading?: boolean;
11
+ loadingText?: string;
12
+ leftIcon?: ReactNode;
13
+ rightIcon?: ReactNode;
14
+ disabled?: boolean;
7
15
  className?: string;
8
16
  }
9
17
  type ButtonAsButtonProps = BaseButtonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -12,7 +20,7 @@ type ButtonAsButtonProps = BaseButtonProps & ButtonHTMLAttributes<HTMLButtonElem
12
20
  };
13
21
  type ButtonAsAnchorProps = BaseButtonProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'type'> & {
14
22
  as: 'a';
15
- href: string;
23
+ href?: string;
16
24
  };
17
25
  export type ButtonProps = ButtonAsButtonProps | ButtonAsAnchorProps;
18
26
  export declare function Button(props: ButtonProps): import("react").JSX.Element;
@@ -1,5 +1,12 @@
1
1
  import type { ElementType, HTMLAttributes } from 'react';
2
+ export type CardVariant = 'default' | 'glass' | 'gradient' | 'bordered' | 'interactive' | 'elevated';
3
+ export type CardRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
4
+ export type CardPadding = 'none' | 'sm' | 'md' | 'lg' | 'xl';
2
5
  export interface CardProps extends HTMLAttributes<HTMLDivElement> {
3
6
  as?: ElementType;
7
+ variant?: CardVariant;
8
+ radius?: CardRadius;
9
+ padding?: CardPadding;
10
+ glow?: boolean;
4
11
  }
5
- export declare function Card({ as: Component, className, ...props }: CardProps): import("react").JSX.Element;
12
+ export declare function Card({ as: Component, variant, radius, padding, glow, className, style, ...props }: CardProps): 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").ReactPortal | 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").ReactPortal | 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,14 @@
1
- import type { InputHTMLAttributes } from 'react';
2
- export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
1
+ import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ export type InputVariant = 'default' | 'filled' | 'flushed';
3
+ export type InputSize = 'sm' | 'md' | 'lg';
4
+ export type InputRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
5
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
6
+ variant?: InputVariant;
7
+ size?: InputSize;
8
+ radius?: InputRadius;
9
+ leftElement?: ReactNode;
10
+ rightElement?: ReactNode;
11
+ error?: boolean | string;
12
+ fullWidth?: boolean;
3
13
  }
4
- export declare function Input({ className, ...props }: InputProps): import("react").JSX.Element;
14
+ export declare function Input({ variant, size, radius, leftElement, rightElement, error, fullWidth, className, disabled, ...props }: InputProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export type ProgressVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'destructive' | 'gradient';
3
+ export type ProgressSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
+ export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
5
+ value?: number;
6
+ max?: number;
7
+ variant?: ProgressVariant;
8
+ size?: ProgressSize;
9
+ striped?: boolean;
10
+ animated?: boolean;
11
+ showLabel?: boolean;
12
+ label?: string;
13
+ }
14
+ export declare function Progress({ value, max, variant, size, striped, animated, showLabel, label, className, ...props }: ProgressProps): import("react").JSX.Element;
@@ -1,4 +1,12 @@
1
- import type { SelectHTMLAttributes } from 'react';
2
- export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
1
+ import type { ReactNode, SelectHTMLAttributes } from 'react';
2
+ export type SelectVariant = 'default' | 'filled';
3
+ export type SelectSize = 'sm' | 'md' | 'lg';
4
+ export type SelectRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
5
+ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
6
+ variant?: SelectVariant;
7
+ size?: SelectSize;
8
+ radius?: SelectRadius;
9
+ error?: boolean | string;
10
+ icon?: ReactNode;
3
11
  }
4
- export declare function Select({ className, children, ...props }: SelectProps): import("react").JSX.Element;
12
+ export declare function Select({ variant, size, radius, error, icon, className, children, disabled, ...props }: SelectProps): import("react").JSX.Element;
@@ -1,5 +1,8 @@
1
1
  import type { HTMLAttributes } from 'react';
2
+ export type SkeletonRounded = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
3
+ export type SkeletonAnimation = 'pulse' | 'shimmer' | 'none';
2
4
  export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
3
- rounded?: 'sm' | 'md' | 'lg' | 'full';
5
+ rounded?: SkeletonRounded;
6
+ animation?: SkeletonAnimation;
4
7
  }
5
- export declare function Skeleton({ className, rounded, ...props }: SkeletonProps): import("react").JSX.Element;
8
+ export declare function Skeleton({ className, rounded, animation, ...props }: SkeletonProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ export type SwitchSize = 'sm' | 'md' | 'lg';
3
+ export interface SwitchProps {
4
+ checked?: boolean;
5
+ defaultChecked?: boolean;
6
+ onCheckedChange?: (checked: boolean) => void;
7
+ size?: SwitchSize;
8
+ color?: string;
9
+ checkedIcon?: ReactNode;
10
+ uncheckedIcon?: ReactNode;
11
+ disabled?: boolean;
12
+ className?: string;
13
+ id?: string;
14
+ 'aria-label'?: string;
15
+ }
16
+ export declare function Switch({ checked, defaultChecked, onCheckedChange, size, color, checkedIcon, uncheckedIcon, disabled, className, id, 'aria-label': ariaLabel, }: SwitchProps): import("react").JSX.Element;
@@ -2,11 +2,18 @@ import { type ReactNode } from 'react';
2
2
  export type TabItem = {
3
3
  id: string;
4
4
  label: string;
5
+ icon?: ReactNode;
6
+ badge?: ReactNode;
5
7
  content: ReactNode;
6
8
  };
9
+ export type TabsVariant = 'pills' | 'underline' | 'bordered' | 'segmented';
10
+ export type TabsSize = 'sm' | 'md' | 'lg';
7
11
  export interface TabsProps {
8
12
  items: TabItem[];
9
13
  defaultTab?: string;
14
+ variant?: TabsVariant;
15
+ size?: TabsSize;
16
+ fullWidth?: boolean;
10
17
  className?: string;
11
18
  }
12
- export declare function Tabs({ items, defaultTab, className }: TabsProps): import("react").JSX.Element;
19
+ export declare function Tabs({ items, defaultTab, variant, size, fullWidth, className, }: TabsProps): import("react").JSX.Element;
@@ -1,4 +1,13 @@
1
1
  import type { TextareaHTMLAttributes } from 'react';
2
+ export type TextareaVariant = 'default' | 'filled';
3
+ export type TextareaSize = 'sm' | 'md' | 'lg';
4
+ export type TextareaRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl';
5
+ export type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both';
2
6
  export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
7
+ variant?: TextareaVariant;
8
+ size?: TextareaSize;
9
+ radius?: TextareaRadius;
10
+ resize?: TextareaResize;
11
+ error?: boolean | string;
3
12
  }
4
- export declare function Textarea({ className, ...props }: TextareaProps): import("react").JSX.Element;
13
+ export declare function Textarea({ variant, size, radius, resize, error, className, disabled, ...props }: TextareaProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
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
+ warning(message: string, title?: string): string;
14
+ dismiss(id: string): void;
15
+ };
16
+ export type ToasterPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'top-center' | 'bottom-center';
17
+ export declare function Toaster({ position }: {
18
+ position?: ToasterPosition;
19
+ }): import("react").ReactPortal | null;
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from 'react';
2
+ export type TooltipSide = 'top' | 'bottom' | 'left' | 'right';
3
+ export type TooltipTheme = 'dark' | 'light' | 'primary';
4
+ export interface TooltipProps {
5
+ content: ReactNode;
6
+ children: ReactNode;
7
+ side?: TooltipSide;
8
+ position?: TooltipSide;
9
+ theme?: TooltipTheme;
10
+ arrow?: boolean;
11
+ delay?: number;
12
+ className?: string;
13
+ }
14
+ export declare function Tooltip({ content, children, side, position, theme, arrow, delay, className, }: TooltipProps): import("react").JSX.Element;