@vtx-ui/react 0.0.1-beta.7 → 0.0.1-beta.9
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/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +7 -4
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/tokens.d.ts +17 -12
- package/package.json +42 -2
- package/dist/components/Accordion/Accordion.d.ts +0 -31
- package/dist/components/Accordion/Accordion.examples.d.ts +0 -3
- package/dist/components/Accordion/AccordionItem.d.ts +0 -5
- package/dist/components/Accordion/index.d.ts +0 -4
- package/dist/components/Accordion/types.d.ts +0 -98
- package/dist/components/Alert/Alert.d.ts +0 -119
- package/dist/components/Alert/index.d.ts +0 -3
- package/dist/components/Avatar/Avatar.d.ts +0 -63
- package/dist/components/Avatar/index.d.ts +0 -3
- package/dist/components/Badge/Badge.d.ts +0 -81
- package/dist/components/Badge/index.d.ts +0 -3
- package/dist/components/Button/Button.d.ts +0 -117
- package/dist/components/Button/index.d.ts +0 -3
- package/dist/components/Card/Card.d.ts +0 -120
- package/dist/components/Card/index.d.ts +0 -3
- package/dist/components/Checkbox/Checkbox.d.ts +0 -114
- package/dist/components/Checkbox/index.d.ts +0 -3
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +0 -121
- package/dist/components/CheckboxGroup/index.d.ts +0 -3
- package/dist/components/Chip/Chip.d.ts +0 -91
- package/dist/components/Chip/index.d.ts +0 -3
- package/dist/components/Divider/Divider.d.ts +0 -118
- package/dist/components/Divider/index.d.ts +0 -3
- package/dist/components/Flex/Flex.d.ts +0 -66
- package/dist/components/Flex/index.d.ts +0 -3
- package/dist/components/Grid/Grid.d.ts +0 -156
- package/dist/components/Grid/index.d.ts +0 -3
- package/dist/components/Header/Header.d.ts +0 -138
- package/dist/components/Header/index.d.ts +0 -3
- package/dist/components/Input/Input.d.ts +0 -129
- package/dist/components/Input/index.d.ts +0 -3
- package/dist/components/Menu/Menu.d.ts +0 -114
- package/dist/components/Menu/index.d.ts +0 -4
- package/dist/components/Modal/Modal.d.ts +0 -201
- package/dist/components/Modal/index.d.ts +0 -3
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -190
- package/dist/components/MultiSelect/index.d.ts +0 -3
- package/dist/components/Radio/Radio.d.ts +0 -105
- package/dist/components/Radio/index.d.ts +0 -3
- package/dist/components/RadioGroup/RadioGroup.d.ts +0 -134
- package/dist/components/RadioGroup/index.d.ts +0 -3
- package/dist/components/Select/Select.d.ts +0 -169
- package/dist/components/Select/index.d.ts +0 -3
- package/dist/components/SideMenu/SideMenu.d.ts +0 -118
- package/dist/components/SideMenu/index.d.ts +0 -4
- package/dist/components/Table/Table.d.ts +0 -211
- package/dist/components/Table/index.d.ts +0 -3
- package/dist/components/Text/Text.d.ts +0 -160
- package/dist/components/Text/index.d.ts +0 -3
- package/dist/components/Toast/Toast.d.ts +0 -56
- package/dist/components/Toast/ToastContainer.d.ts +0 -6
- package/dist/components/Toast/index.d.ts +0 -5
- package/dist/components/Toast/types.d.ts +0 -148
- package/dist/components/Toast/useToast.d.ts +0 -34
- package/dist/components/Tooltip/Tooltip.d.ts +0 -108
- package/dist/components/Tooltip/index.d.ts +0 -3
- package/dist/hoc/withParsedClasses.d.ts +0 -4
- package/dist/hooks/index.d.ts +0 -85
- package/dist/hooks/useTheme.d.ts +0 -268
- package/dist/index.d.ts +0 -55
- package/dist/theme/ThemeProvider.d.ts +0 -39
- package/dist/theme/cssVariables.d.ts +0 -9
- package/dist/theme/index.d.ts +0 -6
- package/dist/theme/tokens.d.ts +0 -258
- package/dist/types/widgets/Header/Header.examples.d.ts +0 -17
- package/dist/types/widgets/Header/Header.megamenu.examples.d.ts +0 -22
- package/dist/types/widgets/product-card-old/ProductCard.d.ts +0 -12
- package/dist/utils/parseClass.d.ts +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -25,9 +25,11 @@ export type { MenuItemProps, MenuProps } from './components/Menu';
|
|
|
25
25
|
export { Modal } from './components/Modal';
|
|
26
26
|
export type { ModalProps } from './components/Modal';
|
|
27
27
|
export { Toast, toast, ToastContainer, useToast } from './components/Toast';
|
|
28
|
-
export type { ToastContainerProps, ToastOptions, ToastProps } from './components/Toast/types';
|
|
28
|
+
export type { ToastContainerProps, ToastOptions, ToastProps, ToastVariant, ToastPosition, ToastInstance } from './components/Toast/types';
|
|
29
29
|
export { Tooltip } from './components/Tooltip';
|
|
30
30
|
export type { TooltipProps } from './components/Tooltip';
|
|
31
|
+
export { AdminHeader } from './components/AdminHeader';
|
|
32
|
+
export type { AdminHeaderProps, NotificationItem as AdminNotificationItem, UserMenuItem, QuickAction, SearchSuggestion } from './components/AdminHeader';
|
|
31
33
|
export { Avatar } from './components/Avatar';
|
|
32
34
|
export type { AvatarProps } from './components/Avatar';
|
|
33
35
|
export { Badge } from './components/Badge';
|
|
@@ -42,6 +44,7 @@ export { Header } from './components/Header';
|
|
|
42
44
|
export type { HeaderProps, NotificationItem } from './components/Header';
|
|
43
45
|
export { SideMenu } from './components/SideMenu';
|
|
44
46
|
export type { SideMenuItemProps, SideMenuProps } from './components/SideMenu';
|
|
47
|
+
export { SideMenuItem } from './components/SideMenu';
|
|
45
48
|
export { Table } from './components/Table';
|
|
46
49
|
export type { TableColumn, TableProps } from './components/Table';
|
|
47
50
|
export { Text } from './components/Text';
|
|
@@ -53,9 +56,9 @@ export type { FlexProps } from './components/Flex';
|
|
|
53
56
|
export { Grid } from './components/Grid';
|
|
54
57
|
export type { GridProps } from './components/Grid';
|
|
55
58
|
export { ThemeProvider, useThemeContext } from './theme';
|
|
56
|
-
export type { Theme, ThemeProviderProps } from './theme';
|
|
57
|
-
export { tokens, generateCSSVariables, injectCSSVariables } from './theme';
|
|
58
|
-
export type { Tokens, ColorScale, ColorShade } from './theme';
|
|
59
|
+
export type { Theme, ThemeProviderProps, Size } from './theme';
|
|
60
|
+
export { tokens, generateCSSVariables, injectCSSVariables, createCustomTokens, generateColorShades, normalizeColors } from './theme';
|
|
61
|
+
export type { Tokens, ColorScale, ColorShade, CustomTokens, CustomColors, ColorPalette } from './theme';
|
|
59
62
|
export { useBodyScrollLock, useClickOutside, useDebounce, useEscapeKey, useFocusTrap, useId, } from './hooks';
|
|
60
63
|
export { InfoCard } from './widgets/InfoCard';
|
|
61
64
|
export type { InfoCardBaseProps, InfoCardMetricProps } from './widgets/InfoCard';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ThemeProvider, useThemeContext } from './ThemeProvider';
|
|
2
|
-
export { tokens } from './tokens';
|
|
2
|
+
export { tokens, createCustomTokens, generateColorShades, normalizeColors } from './tokens';
|
|
3
3
|
export { generateCSSVariables, injectCSSVariables } from './cssVariables';
|
|
4
4
|
export type { Theme, ThemeProviderProps, Size } from './ThemeProvider';
|
|
5
5
|
export type { Tokens, ColorScale, ColorShade, CustomTokens, CustomColors, ColorPalette } from './tokens';
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* These tokens define the core visual language of the design system
|
|
4
4
|
*/
|
|
5
5
|
export declare const COLOR_KEYS: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
6
|
+
/**
|
|
7
|
+
* Generates a color palette from a single hex color
|
|
8
|
+
* Creates lighter shades (50-400) and darker shades (600-900) based on the base color (500)
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateColorShades(hexColor: string): Record<number, string>;
|
|
6
11
|
/**
|
|
7
12
|
* Normalizes a colors object so that:
|
|
8
13
|
* - String values (e.g., primary: "#fff") are expanded to full color palettes
|
|
@@ -12,18 +17,7 @@ export declare const COLOR_KEYS: readonly [50, 100, 200, 300, 400, 500, 600, 700
|
|
|
12
17
|
export declare function normalizeColors(colors: Record<string, any>): Record<string, any>;
|
|
13
18
|
export declare const tokens: {
|
|
14
19
|
colors: {
|
|
15
|
-
primary:
|
|
16
|
-
50: string;
|
|
17
|
-
100: string;
|
|
18
|
-
200: string;
|
|
19
|
-
300: string;
|
|
20
|
-
400: string;
|
|
21
|
-
500: string;
|
|
22
|
-
600: string;
|
|
23
|
-
700: string;
|
|
24
|
-
800: string;
|
|
25
|
-
900: string;
|
|
26
|
-
};
|
|
20
|
+
primary: Record<number, string>;
|
|
27
21
|
secondary: {
|
|
28
22
|
50: string;
|
|
29
23
|
100: string;
|
|
@@ -306,3 +300,14 @@ export type CustomTokens = {
|
|
|
306
300
|
};
|
|
307
301
|
export type ColorScale = keyof Colors;
|
|
308
302
|
export type ColorShade = keyof ColorPalette;
|
|
303
|
+
/**
|
|
304
|
+
* Helper function for creating custom tokens with proper type inference
|
|
305
|
+
* @example
|
|
306
|
+
* const myTokens = createCustomTokens({
|
|
307
|
+
* colors: {
|
|
308
|
+
* primary: '#0c6b58', // Auto-generates 50-900 shades
|
|
309
|
+
* secondary: { 500: '#ff5722', 600: '#f4511e' }, // Partial palette
|
|
310
|
+
* }
|
|
311
|
+
* });
|
|
312
|
+
*/
|
|
313
|
+
export declare function createCustomTokens(tokens: CustomTokens): CustomTokens;
|
package/package.json
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtx-ui/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.9",
|
|
4
4
|
"description": "A production-ready React + TypeScript UI library with enterprise-grade components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.cjs.js"
|
|
13
|
+
},
|
|
14
|
+
"./theme": {
|
|
15
|
+
"types": "./dist/types/theme/index.d.ts",
|
|
16
|
+
"import": "./dist/index.esm.js",
|
|
17
|
+
"require": "./dist/index.cjs.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"*": [
|
|
24
|
+
"dist/types/index.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"theme": [
|
|
27
|
+
"dist/types/theme/index.d.ts"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
8
31
|
"publishConfig": {
|
|
9
32
|
"access": "public"
|
|
10
33
|
},
|
|
@@ -24,6 +47,23 @@
|
|
|
24
47
|
"bugs": {
|
|
25
48
|
"url": "https://github.com/vertex-ui/react/issues"
|
|
26
49
|
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"react",
|
|
52
|
+
"react-component",
|
|
53
|
+
"react-components",
|
|
54
|
+
"ui",
|
|
55
|
+
"ui-library",
|
|
56
|
+
"component-library",
|
|
57
|
+
"design-system",
|
|
58
|
+
"typescript",
|
|
59
|
+
"vtx-ui",
|
|
60
|
+
"vertex-ui",
|
|
61
|
+
"accessibility",
|
|
62
|
+
"a11y",
|
|
63
|
+
"themeable",
|
|
64
|
+
"dark-mode",
|
|
65
|
+
"enterprise"
|
|
66
|
+
],
|
|
27
67
|
"scripts": {
|
|
28
68
|
"build": "rollup -c",
|
|
29
69
|
"test": "jest",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AccordionProps } from "./types";
|
|
3
|
-
import './Accordion.css';
|
|
4
|
-
/**
|
|
5
|
-
* Accordion component - Collapsible content panels for presenting information in a limited space.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* Basic usage with items prop:
|
|
9
|
-
* ```tsx
|
|
10
|
-
* <Accordion
|
|
11
|
-
* items={[
|
|
12
|
-
* { id: 'item1', header: 'Section 1', children: <div>Content 1</div> },
|
|
13
|
-
* { id: 'item2', header: 'Section 2', children: <div>Content 2</div> },
|
|
14
|
-
* ]}
|
|
15
|
-
* />
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* Usage with AccordionItem children:
|
|
20
|
-
* ```tsx
|
|
21
|
-
* <Accordion>
|
|
22
|
-
* <AccordionItem id="item1" header="Section 1">Content 1</AccordionItem>
|
|
23
|
-
* <AccordionItem id="item2" header="Section 2">Content 2</AccordionItem>
|
|
24
|
-
* </Accordion>
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
declare const Accordion: React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
declare const _default: React.FC<AccordionProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
export default _default;
|
|
30
|
-
export { Accordion };
|
|
31
|
-
export type { AccordionProps };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AccordionItemComponentProps, AccordionItemProps } from './types';
|
|
3
|
-
declare const _default: React.FC<AccordionItemComponentProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export declare const AccordionItemWrapper: React.FC<AccordionItemProps>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default as Accordion } from './Accordion';
|
|
2
|
-
export type { AccordionProps, AccordionItemProps, AccordionItemComponentProps } from './types';
|
|
3
|
-
export { Accordion as AccordionComponent } from './Accordion';
|
|
4
|
-
export { default as AccordionItem, AccordionItemWrapper } from './AccordionItem';
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface AccordionItemProps {
|
|
3
|
-
/** Unique identifier for the accordion item */
|
|
4
|
-
id: string;
|
|
5
|
-
/** The header content for the accordion item */
|
|
6
|
-
header: ReactNode;
|
|
7
|
-
/** The body content for the accordion item */
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/** Whether this item is disabled */
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
/** Custom class name for the accordion item */
|
|
12
|
-
className?: string;
|
|
13
|
-
/** Loading state for this specific item */
|
|
14
|
-
loading?: boolean;
|
|
15
|
-
/** Status indicator for the item */
|
|
16
|
-
status?: 'default' | 'success' | 'warning' | 'error' | 'featured';
|
|
17
|
-
/** Custom icon for this specific item (overrides accordion-level icons) */
|
|
18
|
-
icon?: {
|
|
19
|
-
expanded?: React.ReactNode;
|
|
20
|
-
collapsed?: React.ReactNode;
|
|
21
|
-
};
|
|
22
|
-
/** Additional data attributes for testing or analytics */
|
|
23
|
-
dataTestId?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface AccordionProps {
|
|
26
|
-
/** Array of accordion items */
|
|
27
|
-
items?: AccordionItemProps[];
|
|
28
|
-
/** Children accordion items (alternative to items prop) */
|
|
29
|
-
children?: ReactNode;
|
|
30
|
-
/** Whether multiple items can be open at once */
|
|
31
|
-
allowMultiple?: boolean;
|
|
32
|
-
/** Default open items (controlled) */
|
|
33
|
-
defaultOpenItems?: string[];
|
|
34
|
-
/** Open items (uncontrolled) */
|
|
35
|
-
openItems?: string[];
|
|
36
|
-
/** Callback when items are toggled */
|
|
37
|
-
onToggle?: (openItems: string[]) => void;
|
|
38
|
-
/** Visual variant style of the accordion */
|
|
39
|
-
variant?: 'default' | 'bordered' | 'separated' | 'flush';
|
|
40
|
-
/** Size variant of the accordion */
|
|
41
|
-
size?: 'sm' | 'md' | 'lg';
|
|
42
|
-
/** Custom class name */
|
|
43
|
-
className?: string;
|
|
44
|
-
/** Custom styles */
|
|
45
|
-
style?: React.CSSProperties;
|
|
46
|
-
/** Whether to show chevron icons */
|
|
47
|
-
showChevron?: boolean;
|
|
48
|
-
/** Position of the chevron icon */
|
|
49
|
-
chevronPosition?: 'left' | 'right';
|
|
50
|
-
/** Custom icon for expanded state */
|
|
51
|
-
expandedIcon?: React.ReactNode;
|
|
52
|
-
/** Custom icon for collapsed state */
|
|
53
|
-
collapsedIcon?: React.ReactNode;
|
|
54
|
-
/** Icon type preset */
|
|
55
|
-
iconType?: 'chevron' | 'plus-minus' | 'custom';
|
|
56
|
-
/** Whether to show divider lines between items */
|
|
57
|
-
showDivider?: boolean;
|
|
58
|
-
/** Whether items are collapsible (can all be closed) */
|
|
59
|
-
collapsible?: boolean;
|
|
60
|
-
/** Loading state for the entire accordion */
|
|
61
|
-
loading?: boolean;
|
|
62
|
-
/** Disable all accordion interactions */
|
|
63
|
-
disabled?: boolean;
|
|
64
|
-
/** Spacing variant for compact or spacious layouts */
|
|
65
|
-
spacing?: 'compact' | 'default' | 'spacious';
|
|
66
|
-
/** Disable animations for better performance or accessibility */
|
|
67
|
-
disableAnimations?: boolean;
|
|
68
|
-
}
|
|
69
|
-
export interface AccordionItemComponentProps {
|
|
70
|
-
/** The accordion item data */
|
|
71
|
-
item: AccordionItemProps;
|
|
72
|
-
/** Whether this item is open */
|
|
73
|
-
isOpen: boolean;
|
|
74
|
-
/** Function to toggle this item */
|
|
75
|
-
onToggle: () => void;
|
|
76
|
-
/** Variant from parent accordion */
|
|
77
|
-
variant: AccordionProps['variant'];
|
|
78
|
-
/** Size from parent accordion */
|
|
79
|
-
size: AccordionProps['size'];
|
|
80
|
-
/** Whether to show chevron */
|
|
81
|
-
showChevron: boolean;
|
|
82
|
-
/** Chevron position */
|
|
83
|
-
chevronPosition: AccordionProps['chevronPosition'];
|
|
84
|
-
/** Custom icon for expanded state */
|
|
85
|
-
expandedIcon?: React.ReactNode;
|
|
86
|
-
/** Custom icon for collapsed state */
|
|
87
|
-
collapsedIcon?: React.ReactNode;
|
|
88
|
-
/** Icon type preset */
|
|
89
|
-
iconType?: AccordionProps['iconType'];
|
|
90
|
-
/** Loading state from parent accordion */
|
|
91
|
-
loading?: boolean;
|
|
92
|
-
/** Disabled state from parent accordion */
|
|
93
|
-
disabled?: boolean;
|
|
94
|
-
/** Spacing variant from parent accordion */
|
|
95
|
-
spacing?: AccordionProps['spacing'];
|
|
96
|
-
/** Disable animations */
|
|
97
|
-
disableAnimations?: boolean;
|
|
98
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './Alert.css';
|
|
3
|
-
export interface AlertProps {
|
|
4
|
-
/**
|
|
5
|
-
* Content of the alert (primary message, can be any ReactNode)
|
|
6
|
-
*/
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Alert title
|
|
10
|
-
*/
|
|
11
|
-
title?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Alert description - alternative to children for simple text
|
|
14
|
-
*/
|
|
15
|
-
description?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Visual variant of the alert
|
|
18
|
-
* @default 'info'
|
|
19
|
-
*/
|
|
20
|
-
variant?: 'success' | 'error' | 'warning' | 'info' | 'neutral';
|
|
21
|
-
/**
|
|
22
|
-
* Visual style of the alert
|
|
23
|
-
* @default 'subtle'
|
|
24
|
-
*/
|
|
25
|
-
alertStyle?: 'filled' | 'outlined' | 'subtle' | 'left-accent';
|
|
26
|
-
/** Size of the alert. Defaults to theme defaultSize or 'md'. */
|
|
27
|
-
size?: 'sm' | 'md' | 'lg';
|
|
28
|
-
/**
|
|
29
|
-
* Custom icon or false to hide icon
|
|
30
|
-
* If not provided, shows default icon based on variant
|
|
31
|
-
*/
|
|
32
|
-
icon?: React.ReactNode | false;
|
|
33
|
-
/**
|
|
34
|
-
* If true, shows close button
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
dismissible?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Callback fired when alert is dismissed
|
|
40
|
-
*/
|
|
41
|
-
onClose?: () => void;
|
|
42
|
-
/**
|
|
43
|
-
* Action element (button or link) displayed on the right
|
|
44
|
-
*/
|
|
45
|
-
action?: React.ReactNode;
|
|
46
|
-
/**
|
|
47
|
-
* If true, alert takes full width of container
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
fullWidth?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Custom class name
|
|
53
|
-
*/
|
|
54
|
-
className?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Custom inline styles
|
|
57
|
-
*/
|
|
58
|
-
style?: React.CSSProperties;
|
|
59
|
-
/**
|
|
60
|
-
* Role attribute for accessibility
|
|
61
|
-
* @default 'alert'
|
|
62
|
-
*/
|
|
63
|
-
role?: string;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Alert component - Displays important messages and notifications
|
|
67
|
-
*
|
|
68
|
-
* A flexible alert component supporting multiple variants, styles, and interactive features.
|
|
69
|
-
* Can display simple messages or complex content with titles, actions, and custom icons.
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* Simple alert with children
|
|
73
|
-
* ```tsx
|
|
74
|
-
* <Alert variant="success">
|
|
75
|
-
* Your changes have been saved!
|
|
76
|
-
* </Alert>
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* Alert with title and description
|
|
81
|
-
* ```tsx
|
|
82
|
-
* <Alert
|
|
83
|
-
* variant="error"
|
|
84
|
-
* title="Error occurred"
|
|
85
|
-
* description="Unable to connect to the server."
|
|
86
|
-
* dismissible
|
|
87
|
-
* onClose={() => console.log('closed')}
|
|
88
|
-
* />
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* Alert with action button
|
|
93
|
-
* ```tsx
|
|
94
|
-
* <Alert
|
|
95
|
-
* variant="warning"
|
|
96
|
-
* title="Update available"
|
|
97
|
-
* style="left-accent"
|
|
98
|
-
* action={<Button size="small">Update Now</Button>}
|
|
99
|
-
* >
|
|
100
|
-
* A new version is available. Update to get the latest features.
|
|
101
|
-
* </Alert>
|
|
102
|
-
* ```
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* Alert with custom icon
|
|
106
|
-
* ```tsx
|
|
107
|
-
* <Alert
|
|
108
|
-
* variant="info"
|
|
109
|
-
* icon={<CustomIcon />}
|
|
110
|
-
* title="Custom notification"
|
|
111
|
-
* >
|
|
112
|
-
* This alert uses a custom icon.
|
|
113
|
-
* </Alert>
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
117
|
-
declare const _default: React.FC<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
118
|
-
export default _default;
|
|
119
|
-
export { Alert };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HTMLAttributes, ImgHTMLAttributes } from "react";
|
|
3
|
-
import './Avatar.css';
|
|
4
|
-
/**
|
|
5
|
-
* Avatar component - Displays user profile image, initials, or fallback
|
|
6
|
-
*
|
|
7
|
-
* The Avatar component supports images, fallback text, different sizes, shapes, and status indicators.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* Basic avatar with image
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <Avatar src="https://randomuser.me/api/portraits/men/1.jpg" alt="John Doe" />
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* Avatar with fallback text
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <Avatar fallback="JD" />
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* Different sizes
|
|
23
|
-
* ```tsx
|
|
24
|
-
* <Avatar src="..." size="small" />
|
|
25
|
-
* <Avatar src="..." size="large" />
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* Square shape
|
|
30
|
-
* ```tsx
|
|
31
|
-
* <Avatar src="..." shape="square" />
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* Status indicator
|
|
36
|
-
* ```tsx
|
|
37
|
-
* <Avatar
|
|
38
|
-
* src="..."
|
|
39
|
-
* statusIndicator={<span style={{ background: 'green', borderRadius: '50%', width: 12, height: 12, display: 'inline-block' }} />}
|
|
40
|
-
* statusPosition="top-right"
|
|
41
|
-
* />
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export interface AvatarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
45
|
-
src?: string;
|
|
46
|
-
alt?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Size of the avatar
|
|
49
|
-
* @default theme.defaultSize or 'md'
|
|
50
|
-
*/
|
|
51
|
-
size?: 'sm' | 'md' | 'lg';
|
|
52
|
-
shape?: 'circle' | 'square';
|
|
53
|
-
fallback?: string;
|
|
54
|
-
onImageError?: (error: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
55
|
-
onImageLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
56
|
-
imgProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'className' | 'onError' | 'onLoad'>;
|
|
57
|
-
statusIndicator?: React.ReactNode;
|
|
58
|
-
statusPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
59
|
-
}
|
|
60
|
-
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
-
declare const _default: React.FC<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
-
export default _default;
|
|
63
|
-
export { Avatar };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
import './Badge.css';
|
|
3
|
-
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
-
/**
|
|
5
|
-
* Visual variant of the badge
|
|
6
|
-
* @default 'neutral'
|
|
7
|
-
*/
|
|
8
|
-
variant?: 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
9
|
-
/**
|
|
10
|
-
* Size of the badge
|
|
11
|
-
* @default 'medium'
|
|
12
|
-
*/
|
|
13
|
-
size?: 'small' | 'medium' | 'large';
|
|
14
|
-
/**
|
|
15
|
-
* If true, badge will be pill-shaped with rounded ends
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
|
-
pill?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* If true, displays a dot indicator before the content
|
|
21
|
-
* Useful for status indicators
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
dot?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* If true, displays the badge with an outline style instead of filled
|
|
27
|
-
* @default false
|
|
28
|
-
*/
|
|
29
|
-
outline?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Maximum content length before truncation
|
|
32
|
-
* Useful for limiting badge text length
|
|
33
|
-
*/
|
|
34
|
-
maxLength?: number;
|
|
35
|
-
/**
|
|
36
|
-
* Icon to display before the badge content
|
|
37
|
-
*/
|
|
38
|
-
icon?: React.ReactNode;
|
|
39
|
-
/**
|
|
40
|
-
* Badge content - text, numbers, or custom elements
|
|
41
|
-
*/
|
|
42
|
-
children: React.ReactNode;
|
|
43
|
-
/**
|
|
44
|
-
* Callback fired when badge is clicked
|
|
45
|
-
*/
|
|
46
|
-
onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Badge component - Small labels and indicators for status, counts, or categories
|
|
50
|
-
*
|
|
51
|
-
* A versatile badge component that can display status indicators, counts, tags, or any short text
|
|
52
|
-
* with various visual styles and customization options.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* Basic status badges
|
|
56
|
-
* ```tsx
|
|
57
|
-
* <Badge variant="success">Active</Badge>
|
|
58
|
-
* <Badge variant="error" dot>Error</Badge>
|
|
59
|
-
* <Badge variant="primary" pill>NEW</Badge>
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* With icon and outline
|
|
64
|
-
* ```tsx
|
|
65
|
-
* <Badge variant="info" icon={<InfoIcon />} outline>
|
|
66
|
-
* Information
|
|
67
|
-
* </Badge>
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* Removable badge
|
|
72
|
-
* ```tsx
|
|
73
|
-
* <Badge variant="primary" onRemove={(e) => handleRemove()}>
|
|
74
|
-
* Tag 1
|
|
75
|
-
* </Badge>
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
79
|
-
declare const _default: React.FC<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
80
|
-
export default _default;
|
|
81
|
-
export { Badge };
|