@dimasbaguspm/versaur 0.0.3 → 0.0.5
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/dist/components/badge/badge.stories.d.ts +4 -0
- package/dist/components/badge/helpers.d.ts +1 -0
- package/dist/components/badge/types.d.ts +7 -0
- package/dist/components/button-icon/helpers.d.ts +11 -0
- package/dist/components/button-icon/types.d.ts +13 -17
- package/dist/components/icon/icon.d.ts +3 -3
- package/dist/components/icon/icon.stories.d.ts +1 -1
- package/dist/components/icon/types.d.ts +22 -4
- package/dist/index.js +597 -531
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Badge } from './badge';
|
|
3
|
+
/**
|
|
4
|
+
* Size variants for the Badge component.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Sizes: Story;
|
|
3
7
|
/**
|
|
4
8
|
* The Badge component is used to present or highlight values with various styles and configurations.
|
|
5
9
|
* It supports different variants (default/outline), sizes, shapes, colors, and icon positioning.
|
|
@@ -6,5 +6,6 @@ export declare const badgeVariants: (props?: ({
|
|
|
6
6
|
variant?: "default" | "outline" | null | undefined;
|
|
7
7
|
color?: "primary" | "secondary" | "tertiary" | "ghost" | "neutral" | "success" | "info" | "warning" | "danger" | null | undefined;
|
|
8
8
|
shape?: "square" | "rounded" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
9
10
|
iconOnly?: boolean | null | undefined;
|
|
10
11
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -8,6 +8,13 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
8
8
|
* @property iconRight - Icon to display on the right side
|
|
9
9
|
*/
|
|
10
10
|
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
11
|
+
/**
|
|
12
|
+
* Size of the badge
|
|
13
|
+
* - sm: Small (compact)
|
|
14
|
+
* - md: Medium (default)
|
|
15
|
+
* - lg: Large
|
|
16
|
+
*/
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
18
|
/**
|
|
12
19
|
* Visual style variant
|
|
13
20
|
* - default: Solid background with text
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonIconProps } from './types';
|
|
2
|
+
import { IconProps } from '../icon';
|
|
3
|
+
/**
|
|
4
|
+
* Maps ButtonIcon variant to Icon color prop
|
|
5
|
+
*/
|
|
6
|
+
export declare function getIconColorFromVariant(variant?: ButtonIconProps['variant']): IconProps['color'];
|
|
7
|
+
export declare const buttonIconVariants: (props?: ({
|
|
8
|
+
variant?: "outline" | "primary" | "secondary" | "tertiary" | "ghost" | "neutral" | "success" | "info" | "warning" | "danger" | "primary-outline" | "primary-ghost" | "secondary-outline" | "secondary-ghost" | "tertiary-outline" | "tertiary-ghost" | "ghost-outline" | "neutral-outline" | "neutral-ghost" | "success-outline" | "success-ghost" | "info-outline" | "info-ghost" | "warning-outline" | "warning-ghost" | "danger-outline" | "danger-ghost" | "destructive" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | "xs" | "xl" | null | undefined;
|
|
10
|
+
shape?: "circle" | "square" | "rounded" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { IconProps } from '../icon/types';
|
|
2
3
|
/**
|
|
3
4
|
* ButtonIconProps defines the props for the ButtonIcon component
|
|
4
|
-
* @property
|
|
5
|
+
* @property as - Icon component to render inside the button (e.g., from lucide-react)
|
|
5
6
|
* @property variant - Visual style variant based on Versaur color system
|
|
6
7
|
* @property shape - Shape type of the button (rounded, square, circle)
|
|
7
8
|
* @property size - Size of the button (sm, md, lg)
|
|
8
9
|
* @property disabled - Whether the button is disabled
|
|
9
|
-
* @property
|
|
10
|
+
* @property aria-label - Accessible label for screen readers (required for icon-only buttons)
|
|
11
|
+
*
|
|
12
|
+
* Inherits icon sizing and color props from IconProps for alignment
|
|
10
13
|
*/
|
|
11
|
-
export interface ButtonIconProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
14
|
+
export interface ButtonIconProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'color'>, Pick<IconProps, 'as'> {
|
|
12
15
|
/**
|
|
13
|
-
* Icon
|
|
14
|
-
* Accepts any ReactNode (SVG icons, components, etc.)
|
|
16
|
+
* Icon component to render inside the button (e.g., from lucide-react)
|
|
15
17
|
*/
|
|
16
|
-
children: ReactNode;
|
|
17
18
|
/**
|
|
18
19
|
* Visual style variant supporting Versaur color system
|
|
19
|
-
* Core variants: primary (coral), secondary (sage), tertiary (mist), ghost (slate), neutral (light gray)
|
|
20
|
-
* Semantic variants: success, info, warning, danger
|
|
21
|
-
* Each variant supports outline and ghost forms for flexible design expression
|
|
22
20
|
*/
|
|
23
21
|
variant?: 'primary' | 'primary-outline' | 'primary-ghost' | 'secondary' | 'secondary-outline' | 'secondary-ghost' | 'tertiary' | 'tertiary-outline' | 'tertiary-ghost' | 'ghost' | 'ghost-outline' | 'neutral' | 'neutral-outline' | 'neutral-ghost' | 'success' | 'success-outline' | 'success-ghost' | 'info' | 'info-outline' | 'info-ghost' | 'warning' | 'warning-outline' | 'warning-ghost' | 'danger' | 'danger-outline' | 'danger-ghost' | 'outline' | 'destructive';
|
|
22
|
+
/**
|
|
23
|
+
* Size of the button and icon
|
|
24
|
+
* xs: 24px, sm: 32px, md: 40px, lg: 48px, xl: 56px
|
|
25
|
+
*/
|
|
26
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
24
27
|
/**
|
|
25
28
|
* Shape type of the button
|
|
26
29
|
* rounded: Standard rounded corners (default)
|
|
@@ -28,13 +31,6 @@ export interface ButtonIconProps extends Omit<ButtonHTMLAttributes<HTMLButtonEle
|
|
|
28
31
|
* circle: Circular shape
|
|
29
32
|
*/
|
|
30
33
|
shape?: 'rounded' | 'square' | 'circle';
|
|
31
|
-
/**
|
|
32
|
-
* Size of the button
|
|
33
|
-
* sm: 32px, compact for space-constrained interfaces
|
|
34
|
-
* md: 40px, standard for most use cases
|
|
35
|
-
* lg: 48px, prominent for primary actions
|
|
36
|
-
*/
|
|
37
|
-
size?: 'sm' | 'md' | 'lg';
|
|
38
34
|
/**
|
|
39
35
|
* Whether the button is disabled
|
|
40
36
|
* When true, the button becomes non-interactive and visually dimmed
|
|
@@ -2,7 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IconProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Icon component for Versaur UI
|
|
5
|
-
*
|
|
6
|
-
* @example <Icon color="primary" size="md"
|
|
5
|
+
* Renders a single icon component (e.g., from lucide-react) with enforced size and color
|
|
6
|
+
* @example <Icon as={Circle} color="primary" size="md" />
|
|
7
7
|
*/
|
|
8
|
-
export declare const Icon: React.
|
|
8
|
+
export declare const Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: import('react').
|
|
3
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('./types').IconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
4
4
|
tags: string[];
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
/**
|
|
3
3
|
* IconProps defines the props for the Icon component
|
|
4
4
|
* @property color - Color variant based on Versaur color system
|
|
@@ -6,8 +6,26 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
6
6
|
* @property children - The icon element (usually from lucide-react)
|
|
7
7
|
* Extends HTMLAttributes<HTMLSpanElement> for native span props
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* IconProps defines the props for the Icon component
|
|
11
|
+
* @property as - Icon component to render (e.g., from lucide-react)
|
|
12
|
+
* @property color - Color variant based on Versaur color system
|
|
13
|
+
* @property size - Size of the icon (xs, sm, md, lg, xl)
|
|
14
|
+
* Extends SVG props for native SVG attributes
|
|
15
|
+
*/
|
|
16
|
+
export type IconProps = Omit<React.SVGProps<SVGSVGElement>, 'children'> & {
|
|
17
|
+
/**
|
|
18
|
+
* Icon component to render (e.g., from lucide-react)
|
|
19
|
+
*/
|
|
20
|
+
as: React.ComponentType<{
|
|
21
|
+
className?: string;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Color variant
|
|
25
|
+
*/
|
|
10
26
|
color?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger';
|
|
27
|
+
/**
|
|
28
|
+
* Size of the icon
|
|
29
|
+
*/
|
|
11
30
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
12
|
-
|
|
13
|
-
}
|
|
31
|
+
};
|