@neuctra/ui 0.2.5 → 0.2.7
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/basic/Accordation.d.ts +9 -13
- package/dist/components/basic/Alert.d.ts +10 -23
- package/dist/components/basic/Avatar.d.ts +7 -16
- package/dist/components/basic/Badge.d.ts +9 -14
- package/dist/components/basic/Button.d.ts +9 -19
- package/dist/components/basic/CheckboxGroup.d.ts +1 -0
- package/dist/components/basic/Container.d.ts +2 -19
- package/dist/components/basic/Drawer.d.ts +7 -18
- package/dist/components/basic/DropDown.d.ts +20 -40
- package/dist/components/basic/FlexView.d.ts +16 -0
- package/dist/components/basic/GridView.d.ts +4 -9
- package/dist/components/basic/Image.d.ts +10 -31
- package/dist/components/basic/Input.d.ts +22 -35
- package/dist/components/basic/List.d.ts +6 -20
- package/dist/components/basic/Modal.d.ts +8 -8
- package/dist/components/basic/RadioGroup.d.ts +1 -0
- package/dist/components/basic/Stack.d.ts +4 -14
- package/dist/components/basic/SwitchGroup.d.ts +1 -0
- package/dist/components/basic/Table.d.ts +6 -1
- package/dist/components/basic/Text.d.ts +1109 -14
- package/dist/index.cjs.js +82 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.es.js +2004 -2914
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/basic/Accordation.js +25 -26
- package/dist/src/components/basic/Alert.js +33 -138
- package/dist/src/components/basic/AudioPlayer.js +54 -40
- package/dist/src/components/basic/Avatar.js +41 -154
- package/dist/src/components/basic/Badge.js +23 -62
- package/dist/src/components/basic/Button.js +24 -97
- package/dist/src/components/basic/CheckboxGroup.js +36 -13
- package/dist/src/components/basic/Container.js +19 -38
- package/dist/src/components/basic/Drawer.js +22 -73
- package/dist/src/components/basic/DropDown.js +94 -158
- package/dist/src/components/basic/FlexView.js +19 -0
- package/dist/src/components/basic/GridView.js +15 -48
- package/dist/src/components/basic/Image.js +39 -79
- package/dist/src/components/basic/Input.js +68 -109
- package/dist/src/components/basic/List.js +20 -62
- package/dist/src/components/basic/Modal.js +6 -58
- package/dist/src/components/basic/RadioGroup.js +35 -18
- package/dist/src/components/basic/Stack.js +19 -72
- package/dist/src/components/basic/SwitchGroup.js +42 -16
- package/dist/src/components/basic/Table.js +15 -36
- package/dist/src/components/basic/Tabs.js +3 -12
- package/dist/src/components/basic/Text.js +20 -112
- package/dist/src/index.js +3 -5
- package/dist/types/src/components/basic/Accordation.d.ts +9 -13
- package/dist/types/src/components/basic/Alert.d.ts +10 -23
- package/dist/types/src/components/basic/Avatar.d.ts +7 -16
- package/dist/types/src/components/basic/Badge.d.ts +9 -14
- package/dist/types/src/components/basic/Button.d.ts +9 -19
- package/dist/types/src/components/basic/CheckboxGroup.d.ts +1 -0
- package/dist/types/src/components/basic/Container.d.ts +2 -19
- package/dist/types/src/components/basic/Drawer.d.ts +7 -18
- package/dist/types/src/components/basic/DropDown.d.ts +20 -40
- package/dist/types/src/components/basic/FlexView.d.ts +16 -0
- package/dist/types/src/components/basic/GridView.d.ts +4 -9
- package/dist/types/src/components/basic/Image.d.ts +10 -31
- package/dist/types/src/components/basic/Input.d.ts +22 -35
- package/dist/types/src/components/basic/List.d.ts +6 -20
- package/dist/types/src/components/basic/Modal.d.ts +8 -8
- package/dist/types/src/components/basic/RadioGroup.d.ts +1 -0
- package/dist/types/src/components/basic/Stack.d.ts +4 -14
- package/dist/types/src/components/basic/SwitchGroup.d.ts +1 -0
- package/dist/types/src/components/basic/Table.d.ts +6 -1
- package/dist/types/src/components/basic/Text.d.ts +1109 -14
- package/dist/types/src/index.d.ts +3 -4
- package/dist/ui.css +1 -1
- package/package.json +2 -1
- package/dist/components/basic/Card.d.ts +0 -28
- package/dist/components/basic/Flexbox.d.ts +0 -25
- package/dist/components/basic/Section.d.ts +0 -36
- package/dist/src/components/basic/Card.js +0 -47
- package/dist/src/components/basic/Flexbox.js +0 -67
- package/dist/src/components/basic/Section.js +0 -100
- package/dist/types/src/components/basic/Card.d.ts +0 -28
- package/dist/types/src/components/basic/Flexbox.d.ts +0 -25
- package/dist/types/src/components/basic/Section.d.ts +0 -36
|
@@ -1,51 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
2
4
|
/* ---------------------------- Table Container ---------------------------- */
|
|
3
|
-
export const Table = ({ children, style, className }) => (_jsx("div", { style: {
|
|
4
|
-
overflowX: "auto",
|
|
5
|
+
export const Table = ({ children, style, className }) => (_jsx("div", { className: clsx("overflow-x-auto rounded-lg shadow-sm border border-gray-200", className), style: {
|
|
5
6
|
background: "#ffffff",
|
|
6
|
-
borderRadius: 12,
|
|
7
|
-
boxShadow: "0 2px 6px rgba(0,0,0,0.05)",
|
|
8
|
-
border: "1px solid #e5e7eb",
|
|
9
7
|
...style,
|
|
10
|
-
},
|
|
11
|
-
width: "100%",
|
|
12
|
-
borderCollapse: "collapse",
|
|
8
|
+
}, children: _jsx("table", { className: "w-full border-collapse", style: {
|
|
13
9
|
borderSpacing: 0,
|
|
14
10
|
borderRadius: 12,
|
|
15
11
|
overflow: "hidden",
|
|
16
12
|
}, children: children }) }));
|
|
17
13
|
/* ---------------------------- Table Head ---------------------------- */
|
|
18
|
-
export const THead = ({ children, style, className, }) => (_jsx("thead", { className: className, style: {
|
|
19
|
-
backgroundColor: "#f3f4f6",
|
|
20
|
-
color: "#111827",
|
|
21
|
-
fontWeight: 600,
|
|
14
|
+
export const THead = ({ children, style, className, }) => (_jsx("thead", { className: clsx("bg-gray-100 text-gray-900 font-semibold", className), style: {
|
|
22
15
|
...style,
|
|
23
16
|
}, children: children }));
|
|
24
17
|
/* ---------------------------- Table Body ---------------------------- */
|
|
25
|
-
export const TBody = ({ children, style, className
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
export const TBody = ({ children, style, className }) => (_jsx("tbody", { className: clsx("bg-white", className), style: { ...style }, children: children }));
|
|
19
|
+
export const TRow = ({ children, style, className, onClick, hoverBgColor = "#f9fafb", darkMode = false, }) => (_jsx("tr", { className: clsx("transition-colors duration-200 cursor-default", onClick ? "hover:cursor-pointer" : "", className), style: { borderBottom: "1px solid #e5e7eb", ...style }, onClick: onClick, onMouseEnter: (e) => {
|
|
20
|
+
if (!darkMode)
|
|
21
|
+
e.currentTarget.style.backgroundColor = hoverBgColor;
|
|
22
|
+
else
|
|
23
|
+
e.currentTarget.style.backgroundColor = "#1f2937";
|
|
24
|
+
}, onMouseLeave: (e) => {
|
|
25
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
28
26
|
}, children: children }));
|
|
29
|
-
/* ---------------------------- Table Row ---------------------------- */
|
|
30
|
-
export const TRow = ({ children, style, className, }) => (_jsx("tr", { className: className, style: {
|
|
31
|
-
borderBottom: "1px solid #e5e7eb",
|
|
32
|
-
transition: "background 0.2s ease",
|
|
33
|
-
cursor: "default",
|
|
34
|
-
...style,
|
|
35
|
-
}, onMouseEnter: (e) => (e.currentTarget.style.backgroundColor = "#f9fafb"), onMouseLeave: (e) => (e.currentTarget.style.backgroundColor = "transparent"), children: children }));
|
|
36
27
|
/* ---------------------------- Table Head Cell ---------------------------- */
|
|
37
|
-
export const TH = ({ children, style, className }) => (_jsx("th", { className: className, style: {
|
|
38
|
-
textAlign: "left",
|
|
39
|
-
padding: "12px 16px",
|
|
40
|
-
fontSize: "0.875rem",
|
|
41
|
-
color: "#374151",
|
|
42
|
-
borderBottom: "2px solid #e5e7eb",
|
|
43
|
-
...style,
|
|
44
|
-
}, children: children }));
|
|
28
|
+
export const TH = ({ children, style, className }) => (_jsx("th", { className: clsx("text-left px-4 py-3 text-sm text-gray-700 border-b-2 border-gray-200", className), style: { ...style }, children: children }));
|
|
45
29
|
/* ---------------------------- Table Data Cell ---------------------------- */
|
|
46
|
-
export const TD = ({ children, style, className }) => (_jsx("td", { className: className, style: {
|
|
47
|
-
padding: "12px 16px",
|
|
48
|
-
fontSize: "0.875rem",
|
|
49
|
-
color: "#4b5563",
|
|
50
|
-
...style,
|
|
51
|
-
}, children: children }));
|
|
30
|
+
export const TD = ({ children, style, className }) => (_jsx("td", { className: clsx("px-4 py-3 text-sm text-gray-600", className), style: { ...style }, children: children }));
|
|
@@ -61,11 +61,8 @@ export const Tabs = ({ tabs, defaultActive = 0, position = "top", variant = "sol
|
|
|
61
61
|
...activeTabStyle,
|
|
62
62
|
};
|
|
63
63
|
const inactiveTab = {
|
|
64
|
-
...(variant === "outline"
|
|
65
|
-
|
|
66
|
-
: variant === "underline"
|
|
67
|
-
? { borderBottomColor: "transparent" }
|
|
68
|
-
: {}),
|
|
64
|
+
...(variant === "outline" ? { borderColor } : {}),
|
|
65
|
+
...(variant === "underline" ? { borderBottomColor: "transparent" } : {}),
|
|
69
66
|
...inactiveTabStyle,
|
|
70
67
|
};
|
|
71
68
|
const hoverTab = {
|
|
@@ -91,7 +88,6 @@ export const Tabs = ({ tabs, defaultActive = 0, position = "top", variant = "sol
|
|
|
91
88
|
};
|
|
92
89
|
/** 🧱 Layout */
|
|
93
90
|
const isVertical = position === "left" || position === "right";
|
|
94
|
-
const layoutDir = isVertical ? "row" : "column";
|
|
95
91
|
return (_jsxs("div", { ref: containerRef, className: `modern-tabs ${className}`, style: {
|
|
96
92
|
display: "flex",
|
|
97
93
|
flexDirection: isVertical ? (position === "right" ? "row-reverse" : "row") : "column",
|
|
@@ -114,12 +110,7 @@ export const Tabs = ({ tabs, defaultActive = 0, position = "top", variant = "sol
|
|
|
114
110
|
justifyContent: "space-between",
|
|
115
111
|
width: "100%",
|
|
116
112
|
fontSize: 16,
|
|
117
|
-
}, children: [showDrawerLabel, _jsx("span", { children: drawerIcon })] }), drawerOpen && (_jsx("div", { style: {
|
|
118
|
-
display: "flex",
|
|
119
|
-
flexDirection: "column",
|
|
120
|
-
marginTop: 8,
|
|
121
|
-
gap,
|
|
122
|
-
}, children: tabs.map((tab, i) => {
|
|
113
|
+
}, children: [showDrawerLabel, _jsx("span", { children: drawerIcon })] }), drawerOpen && (_jsx("div", { style: { display: "flex", flexDirection: "column", marginTop: 8, gap }, children: tabs.map((tab, i) => {
|
|
123
114
|
const isActive = i === active;
|
|
124
115
|
const isHovered = hovered === i;
|
|
125
116
|
const isDisabled = tab.disabled;
|
|
@@ -1,117 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const defaultColors = {
|
|
12
|
-
light: {
|
|
13
|
-
default: "#111",
|
|
14
|
-
primary: "#2563eb",
|
|
15
|
-
secondary: "#64748b",
|
|
16
|
-
success: "#16a34a",
|
|
17
|
-
danger: "#dc2626",
|
|
18
|
-
white: "#ffffff",
|
|
19
|
-
muted: "#6b7280",
|
|
20
|
-
},
|
|
21
|
-
dark: {
|
|
22
|
-
default: "#f8fafc",
|
|
23
|
-
primary: "#60a5fa",
|
|
24
|
-
secondary: "#94a3b8",
|
|
25
|
-
success: "#22c55e",
|
|
26
|
-
danger: "#f87171",
|
|
27
|
-
white: "#ffffff",
|
|
28
|
-
muted: "#9ca3af",
|
|
29
|
-
},
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
const sizeClasses = {
|
|
5
|
+
xs: "text-xs",
|
|
6
|
+
sm: "text-sm",
|
|
7
|
+
md: "text-base",
|
|
8
|
+
lg: "text-lg",
|
|
9
|
+
xl: "text-xl",
|
|
10
|
+
"2xl": "text-2xl",
|
|
30
11
|
};
|
|
31
|
-
|
|
32
|
-
export function Text({ as, children, color = "default", size = "md", weight = "normal", align = "left", transform = "none", italic = false, underline = false, strikethrough = false, truncate = false, selectable = true, hoverable = false, onClick, darkMode = false, baseColor, className = "", style = {}, ...rest }) {
|
|
33
|
-
// element type as provided (constrained to HTML tags)
|
|
12
|
+
export function Text({ as, children, size = "md", weight = 400, align = "left", truncate = false, className, style, ...rest }) {
|
|
34
13
|
const Element = (as || "p");
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
success: adjustColor(baseColor, -30),
|
|
44
|
-
danger: "#dc2626",
|
|
45
|
-
white: "#ffffff",
|
|
46
|
-
muted: "#6b7280",
|
|
47
|
-
};
|
|
48
|
-
const darkModeTheme = {
|
|
49
|
-
default: "#f8fafc",
|
|
50
|
-
primary: adjustColor(baseColor, 80),
|
|
51
|
-
secondary: adjustColor(baseColor, 120),
|
|
52
|
-
success: adjustColor(baseColor, 100),
|
|
53
|
-
danger: "#f87171",
|
|
54
|
-
white: "#ffffff",
|
|
55
|
-
muted: "#9ca3af",
|
|
56
|
-
};
|
|
57
|
-
return darkMode ? darkModeTheme : lightMode;
|
|
58
|
-
}, [baseColor, darkMode]);
|
|
59
|
-
/** 📏 Font sizes */
|
|
60
|
-
const sizes = {
|
|
61
|
-
xs: "0.75rem",
|
|
62
|
-
sm: "0.875rem",
|
|
63
|
-
md: "1rem",
|
|
64
|
-
lg: "1.25rem",
|
|
65
|
-
xl: "1.5rem",
|
|
66
|
-
"2xl": "2rem",
|
|
67
|
-
};
|
|
68
|
-
/** 💅 Computed styles */
|
|
69
|
-
const computedStyle = {
|
|
70
|
-
color: theme[color] || color,
|
|
71
|
-
fontSize: sizes[size] || size,
|
|
72
|
-
fontWeight: weight,
|
|
73
|
-
textAlign: align,
|
|
74
|
-
textTransform: transform,
|
|
75
|
-
fontStyle: italic ? "italic" : "normal",
|
|
76
|
-
textDecoration: underline ? "underline" : strikethrough ? "line-through" : "none",
|
|
77
|
-
userSelect: selectable ? "text" : "none",
|
|
78
|
-
overflow: truncate ? "hidden" : undefined,
|
|
79
|
-
whiteSpace: truncate ? "nowrap" : undefined,
|
|
80
|
-
textOverflow: truncate ? "ellipsis" : undefined,
|
|
81
|
-
cursor: onClick ? "pointer" : "default",
|
|
82
|
-
transition: "all 0.25s ease-in-out",
|
|
83
|
-
...style,
|
|
84
|
-
};
|
|
85
|
-
/** 🧠 Hover events (narrow to HTMLElement at runtime) */
|
|
86
|
-
const handleMouseEnter = (e) => {
|
|
87
|
-
if (!hoverable)
|
|
88
|
-
return;
|
|
89
|
-
const target = e.currentTarget;
|
|
90
|
-
if (target instanceof HTMLElement) {
|
|
91
|
-
target.style.opacity = "0.8";
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
const handleMouseLeave = (e) => {
|
|
95
|
-
if (!hoverable)
|
|
96
|
-
return;
|
|
97
|
-
const target = e.currentTarget;
|
|
98
|
-
if (target instanceof HTMLElement) {
|
|
99
|
-
target.style.opacity = "1";
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Build props object. We cast only once to the correct intrinsic props type.
|
|
104
|
-
* This prevents TypeScript from having to compute giant unions for event types.
|
|
105
|
-
*/
|
|
106
|
-
const props = {
|
|
107
|
-
className,
|
|
108
|
-
style: computedStyle,
|
|
109
|
-
onClick,
|
|
110
|
-
onMouseEnter: handleMouseEnter,
|
|
111
|
-
onMouseLeave: handleMouseLeave,
|
|
14
|
+
return React.createElement(Element, {
|
|
15
|
+
className: clsx("text-inherit", // ✅ inherits parent color
|
|
16
|
+
sizeClasses[size] || "", truncate && "truncate", className),
|
|
17
|
+
style: {
|
|
18
|
+
fontWeight: weight,
|
|
19
|
+
textAlign: align,
|
|
20
|
+
...style,
|
|
21
|
+
},
|
|
112
22
|
...rest,
|
|
113
|
-
};
|
|
114
|
-
// Use React.createElement to avoid JSX generic complexity
|
|
115
|
-
return React.createElement(Element, props, children);
|
|
23
|
+
}, children);
|
|
116
24
|
}
|
|
117
25
|
export default Text;
|
package/dist/src/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import "./style.css"; // 🔹 Global styles import (keep this as the only CSS im
|
|
|
3
3
|
// ✅ BASIC COMPONENT EXPORTS
|
|
4
4
|
// ==============================
|
|
5
5
|
// Alerts & Notifications
|
|
6
|
-
export {
|
|
6
|
+
export { ToastProvider, useToast } from "./components/basic/Alert"; // ✅ Modern ShadCN-style toast
|
|
7
7
|
// Accordions
|
|
8
8
|
export { Accordion } from "./components/basic/Accordation"; // ✅ Finalized
|
|
9
9
|
// Avatars
|
|
10
|
-
export { Avatar
|
|
10
|
+
export { Avatar } from "./components/basic/Avatar"; // ✅ Finalized
|
|
11
11
|
// Audio Components
|
|
12
12
|
export { AudioPlayer } from "./components/basic/AudioPlayer"; // ✅ Finalized
|
|
13
13
|
export { AudioGallery } from "./components/basic/AudioGallery"; // ✅ Finalized
|
|
@@ -15,15 +15,13 @@ export { AudioGallery } from "./components/basic/AudioGallery"; // ✅ Finalized
|
|
|
15
15
|
export { Badge } from "./components/basic/Badge"; // ✅ Finalized
|
|
16
16
|
// Buttons
|
|
17
17
|
export { Button } from "./components/basic/Button"; // ✅ Finalized
|
|
18
|
-
// Cards
|
|
19
|
-
export { Card } from "./components/basic/Card"; // ✅ Finalized
|
|
20
18
|
// ✅ Checkbox, Radio & Switch Components
|
|
21
19
|
export { CheckboxGroup } from "./components/basic/CheckboxGroup";
|
|
22
20
|
export { RadioGroup } from "./components/basic/RadioGroup";
|
|
23
21
|
export { SwitchGroup } from "./components/basic/SwitchGroup";
|
|
24
22
|
// Containers & Layout
|
|
25
23
|
export { Container } from "./components/basic/Container"; // ✅ Finalized
|
|
26
|
-
export {
|
|
24
|
+
export { FlexView } from "./components/basic/FlexView"; // ✅ Finalized
|
|
27
25
|
export { Stack, HStack, VStack } from "./components/basic/Stack"; // ✅ Finalized
|
|
28
26
|
export { GridView } from "./components/basic/GridView"; // ✅ Finalized
|
|
29
27
|
// Drawers
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ReactNode, CSSProperties } from "react";
|
|
2
2
|
export interface AccordionItem {
|
|
3
|
-
title: string;
|
|
4
|
-
content:
|
|
3
|
+
title: string | ReactNode;
|
|
4
|
+
content: ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export interface AccordionProps {
|
|
7
7
|
items: AccordionItem[];
|
|
8
|
-
/** Allow multiple open items */
|
|
9
8
|
allowMultiple?: boolean;
|
|
10
|
-
/** Default open indexes */
|
|
11
9
|
defaultOpen?: number[];
|
|
12
10
|
/** Appearance */
|
|
13
11
|
borderColor?: string;
|
|
@@ -28,17 +26,15 @@ export interface AccordionProps {
|
|
|
28
26
|
fontWeight?: string | number;
|
|
29
27
|
contentFontSize?: string | number;
|
|
30
28
|
contentFontWeight?: string | number;
|
|
31
|
-
/** Icon
|
|
32
|
-
iconOpen?:
|
|
33
|
-
iconClose?:
|
|
29
|
+
/** Icon */
|
|
30
|
+
iconOpen?: ReactNode;
|
|
31
|
+
iconClose?: ReactNode;
|
|
34
32
|
iconSize?: string | number;
|
|
35
|
-
/** Motion
|
|
33
|
+
/** Motion */
|
|
36
34
|
transitionDuration?: string;
|
|
37
35
|
shadow?: string;
|
|
36
|
+
/** Class overrides */
|
|
38
37
|
className?: string;
|
|
39
|
-
style?:
|
|
38
|
+
style?: CSSProperties;
|
|
40
39
|
}
|
|
41
|
-
/**
|
|
42
|
-
* 🧠 Industry-standard, minimal, and fully customizable Accordion
|
|
43
|
-
*/
|
|
44
40
|
export declare const Accordion: React.FC<AccordionProps>;
|
|
@@ -1,30 +1,17 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
type AlertType = "success" | "error" | "warning" | "info";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
interface Toast {
|
|
4
|
+
id: number;
|
|
5
5
|
title?: string;
|
|
6
6
|
description?: string;
|
|
7
7
|
type?: AlertType;
|
|
8
|
-
dismissible?: boolean;
|
|
9
8
|
duration?: number;
|
|
10
|
-
onClose?: () => void;
|
|
11
|
-
/** Customization */
|
|
12
|
-
icon?: React.ReactNode;
|
|
13
|
-
actionButton?: React.ReactNode;
|
|
14
|
-
position?: AlertPosition;
|
|
15
|
-
backgroundColor?: string;
|
|
16
|
-
borderColor?: string;
|
|
17
|
-
textColor?: string;
|
|
18
|
-
borderRadius?: string | number;
|
|
19
|
-
shadow?: string;
|
|
20
|
-
padding?: string | number;
|
|
21
|
-
fontSize?: string | number;
|
|
22
|
-
fontWeight?: number | string;
|
|
23
|
-
descriptionColor?: string;
|
|
24
|
-
animationDuration?: string;
|
|
25
|
-
maxWidth?: string;
|
|
26
|
-
className?: string;
|
|
27
|
-
style?: React.CSSProperties;
|
|
28
9
|
}
|
|
29
|
-
|
|
10
|
+
interface ToastContextProps {
|
|
11
|
+
addToast: (toast: Omit<Toast, "id">) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const useToast: () => ToastContextProps;
|
|
14
|
+
export declare const ToastProvider: React.FC<{
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}>;
|
|
30
17
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
2
|
type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "responsive";
|
|
3
3
|
type AvatarVariant = "circular" | "rounded" | "square";
|
|
4
|
+
type StatusPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
4
5
|
interface AvatarProps {
|
|
5
6
|
src?: string;
|
|
6
7
|
alt?: string;
|
|
@@ -8,25 +9,15 @@ interface AvatarProps {
|
|
|
8
9
|
variant?: AvatarVariant;
|
|
9
10
|
isOnline?: boolean;
|
|
10
11
|
isOffline?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
style?: React.CSSProperties;
|
|
13
|
-
statusClassName?: string;
|
|
14
|
-
statusStyle?: React.CSSProperties;
|
|
15
|
-
statusPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
16
|
-
fallback?: string;
|
|
17
12
|
ring?: boolean;
|
|
18
13
|
ringColor?: string;
|
|
14
|
+
fallback?: string;
|
|
19
15
|
onClick?: () => void;
|
|
20
|
-
|
|
21
|
-
interface AvatarGroupProps {
|
|
22
|
-
avatars: AvatarProps[];
|
|
23
|
-
max?: number;
|
|
24
|
-
size?: AvatarSize;
|
|
16
|
+
statusPosition?: StatusPosition;
|
|
25
17
|
className?: string;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
statusClassName?: string;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
statusStyle?: CSSProperties;
|
|
29
21
|
}
|
|
30
22
|
export declare const Avatar: React.FC<AvatarProps>;
|
|
31
|
-
export declare const AvatarGroup: React.FC<AvatarGroupProps>;
|
|
32
23
|
export {};
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
export interface BadgeProps {
|
|
3
3
|
text?: string;
|
|
4
|
-
|
|
5
|
-
textColor?: string;
|
|
6
|
-
borderColor?: string;
|
|
7
|
-
borderWidth?: string;
|
|
8
|
-
icon?: ReactNode;
|
|
4
|
+
icon?: React.ReactNode;
|
|
9
5
|
iconPosition?: "left" | "right";
|
|
6
|
+
/** 🎨 Theme */
|
|
7
|
+
primaryTheme?: boolean;
|
|
8
|
+
primaryColor?: string;
|
|
9
|
+
/** 📏 Sizes */
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
/** Shape */
|
|
10
12
|
rounded?: boolean;
|
|
11
|
-
|
|
12
|
-
fontSize?: string;
|
|
13
|
-
fontWeight?: number | string;
|
|
14
|
-
horizontalPadding?: string;
|
|
15
|
-
verticalPadding?: string;
|
|
16
|
-
margin?: string;
|
|
17
|
-
shadow?: string;
|
|
13
|
+
/** Notification */
|
|
18
14
|
notificationDot?: boolean;
|
|
19
15
|
dotColor?: string;
|
|
20
16
|
count?: number | string;
|
|
21
17
|
pulse?: boolean;
|
|
22
|
-
style?: CSSProperties;
|
|
23
18
|
className?: string;
|
|
24
19
|
onClick?: () => void;
|
|
25
20
|
}
|
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
3
|
-
export interface ButtonProps {
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
3
|
children: React.ReactNode;
|
|
5
|
-
type?: "button" | "submit" | "reset";
|
|
6
|
-
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
7
4
|
iconBefore?: React.ReactNode;
|
|
8
5
|
iconAfter?: React.ReactNode;
|
|
9
|
-
className?: string;
|
|
10
|
-
style?: CSSProperties;
|
|
11
|
-
fullWidth?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
6
|
loading?: boolean;
|
|
14
7
|
loadingText?: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
/** 🎨 Theme */
|
|
10
|
+
primaryTheme?: boolean;
|
|
11
|
+
primaryColor?: string;
|
|
12
|
+
/** 📏 Sizes */
|
|
19
13
|
size?: "sm" | "md" | "lg";
|
|
20
|
-
|
|
21
|
-
/** 🧱 Border visibility */
|
|
22
|
-
showBorder?: boolean;
|
|
14
|
+
className?: string;
|
|
23
15
|
}
|
|
24
|
-
|
|
25
|
-
export declare const Button: FC<ButtonProps>;
|
|
26
|
-
export default Button;
|
|
16
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,32 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type ContainerSize = "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
3
3
|
export interface ContainerProps {
|
|
4
|
-
/** Predefined max-width based on common breakpoints */
|
|
5
4
|
size?: ContainerSize;
|
|
6
|
-
|
|
7
|
-
padding?: number | string;
|
|
8
|
-
/** Margin (accepts number in px or CSS string, e.g., 'auto' or '16px 8px') */
|
|
9
|
-
margin?: number | string;
|
|
10
|
-
/** Background color (any valid CSS color) */
|
|
11
|
-
backgroundColor?: string;
|
|
12
|
-
/** Center the container horizontally (adds `margin: 0 auto`) */
|
|
5
|
+
padding?: "none" | "sm" | "md" | "lg" | "xl";
|
|
13
6
|
center?: boolean;
|
|
14
|
-
/** Custom width override (defaults to container max width) */
|
|
15
|
-
width?: string;
|
|
16
|
-
/** Optional height */
|
|
17
|
-
height?: string;
|
|
18
|
-
/** Border radius (accepts number in px or CSS string) */
|
|
19
|
-
borderRadius?: number | string;
|
|
20
|
-
/** Additional inline styles */
|
|
21
|
-
style?: React.CSSProperties;
|
|
22
|
-
/** Tailwind or custom class names */
|
|
23
7
|
className?: string;
|
|
24
|
-
/** Container content */
|
|
25
8
|
children: React.ReactNode;
|
|
26
9
|
}
|
|
27
10
|
/**
|
|
28
11
|
* 🧱 Container Component
|
|
29
|
-
*
|
|
12
|
+
* Fully responsive, Tailwind-first layout wrapper
|
|
30
13
|
*/
|
|
31
14
|
export declare const Container: React.FC<ContainerProps>;
|
|
32
15
|
export default Container;
|
|
@@ -1,33 +1,22 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
interface DrawerButtonProps {
|
|
3
3
|
label?: string;
|
|
4
4
|
icon?: ReactNode;
|
|
5
5
|
iconPosition?: "left" | "right";
|
|
6
6
|
onClick?: () => void;
|
|
7
|
-
color?: string;
|
|
8
|
-
textColor?: string;
|
|
9
|
-
borderRadius?: string;
|
|
10
|
-
padding?: string;
|
|
11
|
-
fontSize?: string;
|
|
12
|
-
gap?: string;
|
|
13
|
-
style?: CSSProperties;
|
|
14
7
|
className?: string;
|
|
15
8
|
}
|
|
16
9
|
export declare const DrawerButton: React.FC<DrawerButtonProps>;
|
|
17
|
-
|
|
10
|
+
interface DrawerProps {
|
|
18
11
|
open: boolean;
|
|
19
12
|
onClose?: () => void;
|
|
20
13
|
position?: "left" | "right" | "top" | "bottom";
|
|
21
|
-
|
|
22
|
-
height?: string;
|
|
23
|
-
backgroundColor?: string;
|
|
24
|
-
backdropColor?: string;
|
|
25
|
-
transitionDuration?: number;
|
|
26
|
-
style?: CSSProperties;
|
|
14
|
+
size?: string;
|
|
27
15
|
className?: string;
|
|
16
|
+
overlayClassName?: string;
|
|
28
17
|
children?: ReactNode;
|
|
29
18
|
showCloseButton?: boolean;
|
|
30
|
-
|
|
31
|
-
closeButtonStyle?: CSSProperties;
|
|
19
|
+
closeButtonClassName?: string;
|
|
32
20
|
}
|
|
33
21
|
export declare const Drawer: React.FC<DrawerProps>;
|
|
22
|
+
export {};
|
|
@@ -1,53 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export interface
|
|
2
|
+
export interface SelectOption {
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
description?: string;
|
|
8
6
|
}
|
|
9
7
|
export interface DropdownProps {
|
|
10
|
-
|
|
8
|
+
label?: string;
|
|
9
|
+
name?: string;
|
|
11
10
|
value?: string;
|
|
12
|
-
values?: string[];
|
|
13
11
|
defaultValue?: string;
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
onChange?: (name: string, value: string) => void;
|
|
13
|
+
options?: SelectOption[];
|
|
16
14
|
placeholder?: string;
|
|
15
|
+
required?: boolean;
|
|
17
16
|
disabled?: boolean;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
textColor?: string;
|
|
32
|
-
hoverBg?: string;
|
|
33
|
-
selectedBg?: string;
|
|
34
|
-
disabledBg?: string;
|
|
35
|
-
disabledTextColor?: string;
|
|
36
|
-
placeholderColor?: string;
|
|
37
|
-
transitionDuration?: string;
|
|
38
|
-
className?: string;
|
|
39
|
-
controlClassName?: string;
|
|
40
|
-
menuClassName?: string;
|
|
17
|
+
error?: string | boolean;
|
|
18
|
+
success?: boolean;
|
|
19
|
+
helperText?: string;
|
|
20
|
+
labelIcon?: React.ElementType;
|
|
21
|
+
prefixIcon?: React.ElementType;
|
|
22
|
+
variant?: "dark" | "light";
|
|
23
|
+
/** 🔥 THEME SYSTEM */
|
|
24
|
+
primaryTheme?: boolean;
|
|
25
|
+
primaryColor?: string;
|
|
26
|
+
containerClassName?: string;
|
|
27
|
+
labelClassName?: string;
|
|
28
|
+
triggerClassName?: string;
|
|
29
|
+
dropdownClassName?: string;
|
|
41
30
|
optionClassName?: string;
|
|
42
|
-
|
|
43
|
-
controlStyle?: React.CSSProperties;
|
|
44
|
-
menuStyle?: React.CSSProperties;
|
|
45
|
-
optionStyle?: React.CSSProperties;
|
|
46
|
-
iconPrefix?: React.ReactNode;
|
|
47
|
-
iconSuffix?: React.ReactNode;
|
|
48
|
-
clearIcon?: React.ReactNode;
|
|
49
|
-
dropdownIcon?: React.ReactNode;
|
|
50
|
-
checkIcon?: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
51
32
|
}
|
|
52
33
|
export declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
-
export default Dropdown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type ScreenSize = "sm" | "md" | "lg";
|
|
3
|
+
type ResponsiveValue<T> = T | Partial<Record<ScreenSize, T>>;
|
|
4
|
+
interface FlexViewProps {
|
|
5
|
+
direction?: ResponsiveValue<"row" | "column" | "row-reverse" | "column-reverse">;
|
|
6
|
+
align?: ResponsiveValue<"start" | "end" | "center" | "stretch" | "baseline">;
|
|
7
|
+
justify?: ResponsiveValue<"start" | "end" | "center" | "between" | "around" | "evenly">;
|
|
8
|
+
wrap?: ResponsiveValue<"nowrap" | "wrap" | "wrap-reverse">;
|
|
9
|
+
gap?: ResponsiveValue<1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12>;
|
|
10
|
+
padding?: ResponsiveValue<1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12>;
|
|
11
|
+
margin?: ResponsiveValue<1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12>;
|
|
12
|
+
className?: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const FlexView: React.FC<FlexViewProps>;
|
|
16
|
+
export {};
|