@neuctra/ui 0.2.4 → 0.2.6

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.
Files changed (83) hide show
  1. package/dist/components/basic/Accordation.d.ts +9 -13
  2. package/dist/components/basic/Alert.d.ts +10 -23
  3. package/dist/components/basic/Avatar.d.ts +7 -16
  4. package/dist/components/basic/Badge.d.ts +9 -14
  5. package/dist/components/basic/Button.d.ts +9 -19
  6. package/dist/components/basic/CheckboxGroup.d.ts +1 -0
  7. package/dist/components/basic/Container.d.ts +2 -19
  8. package/dist/components/basic/Drawer.d.ts +7 -18
  9. package/dist/components/basic/DropDown.d.ts +20 -40
  10. package/dist/components/basic/FlexView.d.ts +16 -0
  11. package/dist/components/basic/GridView.d.ts +4 -9
  12. package/dist/components/basic/Image.d.ts +10 -31
  13. package/dist/components/basic/Input.d.ts +22 -35
  14. package/dist/components/basic/List.d.ts +6 -20
  15. package/dist/components/basic/Modal.d.ts +8 -8
  16. package/dist/components/basic/RadioGroup.d.ts +1 -0
  17. package/dist/components/basic/Stack.d.ts +4 -14
  18. package/dist/components/basic/SwitchGroup.d.ts +1 -0
  19. package/dist/components/basic/Table.d.ts +6 -1
  20. package/dist/index.cjs.js +82 -52
  21. package/dist/index.cjs.js.map +1 -1
  22. package/dist/index.d.ts +3 -4
  23. package/dist/index.es.js +2059 -2861
  24. package/dist/index.es.js.map +1 -1
  25. package/dist/src/components/basic/Accordation.js +25 -26
  26. package/dist/src/components/basic/Alert.js +33 -138
  27. package/dist/src/components/basic/AudioPlayer.js +54 -40
  28. package/dist/src/components/basic/Avatar.js +41 -154
  29. package/dist/src/components/basic/Badge.js +23 -62
  30. package/dist/src/components/basic/Button.js +24 -97
  31. package/dist/src/components/basic/CheckboxGroup.js +36 -13
  32. package/dist/src/components/basic/Container.js +19 -38
  33. package/dist/src/components/basic/Drawer.js +22 -73
  34. package/dist/src/components/basic/DropDown.js +94 -158
  35. package/dist/src/components/basic/FlexView.js +19 -0
  36. package/dist/src/components/basic/GridView.js +15 -48
  37. package/dist/src/components/basic/Image.js +39 -79
  38. package/dist/src/components/basic/Input.js +68 -109
  39. package/dist/src/components/basic/List.js +20 -62
  40. package/dist/src/components/basic/Modal.js +6 -58
  41. package/dist/src/components/basic/RadioGroup.js +35 -18
  42. package/dist/src/components/basic/Stack.js +19 -72
  43. package/dist/src/components/basic/SwitchGroup.js +42 -16
  44. package/dist/src/components/basic/Table.js +25 -27
  45. package/dist/src/components/basic/Tabs.js +3 -12
  46. package/dist/src/index.js +3 -5
  47. package/dist/types/src/components/basic/Accordation.d.ts +9 -13
  48. package/dist/types/src/components/basic/Alert.d.ts +10 -23
  49. package/dist/types/src/components/basic/Avatar.d.ts +7 -16
  50. package/dist/types/src/components/basic/Badge.d.ts +9 -14
  51. package/dist/types/src/components/basic/Button.d.ts +9 -19
  52. package/dist/types/src/components/basic/CheckboxGroup.d.ts +1 -0
  53. package/dist/types/src/components/basic/Container.d.ts +2 -19
  54. package/dist/types/src/components/basic/Drawer.d.ts +7 -18
  55. package/dist/types/src/components/basic/DropDown.d.ts +20 -40
  56. package/dist/types/src/components/basic/FlexView.d.ts +16 -0
  57. package/dist/types/src/components/basic/GridView.d.ts +4 -9
  58. package/dist/types/src/components/basic/Image.d.ts +10 -31
  59. package/dist/types/src/components/basic/Input.d.ts +22 -35
  60. package/dist/types/src/components/basic/List.d.ts +6 -20
  61. package/dist/types/src/components/basic/Modal.d.ts +8 -8
  62. package/dist/types/src/components/basic/RadioGroup.d.ts +1 -0
  63. package/dist/types/src/components/basic/Stack.d.ts +4 -14
  64. package/dist/types/src/components/basic/SwitchGroup.d.ts +1 -0
  65. package/dist/types/src/components/basic/Table.d.ts +6 -1
  66. package/dist/types/src/index.d.ts +3 -4
  67. package/dist/ui.css +1 -1
  68. package/package.json +2 -1
  69. package/dist/components/avatar/AvatarGroup.d.ts +0 -9
  70. package/dist/components/avatar/AvatarWithStatus.d.ts +0 -10
  71. package/dist/components/basic/Card.d.ts +0 -28
  72. package/dist/components/basic/Flexbox.d.ts +0 -25
  73. package/dist/components/basic/Section.d.ts +0 -36
  74. package/dist/src/components/avatar/AvatarGroup.js +0 -9
  75. package/dist/src/components/avatar/AvatarWithStatus.js +0 -18
  76. package/dist/src/components/basic/Card.js +0 -47
  77. package/dist/src/components/basic/Flexbox.js +0 -67
  78. package/dist/src/components/basic/Section.js +0 -100
  79. package/dist/types/src/components/avatar/AvatarGroup.d.ts +0 -9
  80. package/dist/types/src/components/avatar/AvatarWithStatus.d.ts +0 -10
  81. package/dist/types/src/components/basic/Card.d.ts +0 -28
  82. package/dist/types/src/components/basic/Flexbox.d.ts +0 -25
  83. package/dist/types/src/components/basic/Section.d.ts +0 -36
@@ -1,100 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, useMemo } from "react";
3
- import { Container } from "./Container";
4
- /** 🎨 Preset Variants */
5
- const variantStyles = {
6
- light: { background: "#ffffff", color: "#111827" },
7
- dark: { background: "#0f172a", color: "#f9fafb" },
8
- gradient: {
9
- background: "linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)",
10
- color: "#ffffff",
11
- },
12
- transparent: { background: "transparent", color: "#111827" },
13
- primary: { background: "#3b82f6", color: "#ffffff" },
14
- };
15
- /** 🧩 Utility: Resolve responsive props safely */
16
- function resolveResponsive(prop, screen, fallback) {
17
- if (prop == null)
18
- return fallback;
19
- if (typeof prop !== "object")
20
- return prop;
21
- return prop[screen] ?? fallback;
22
- }
23
- /** 📱 Determine current breakpoint */
24
- function getScreenSize(width) {
25
- if (width < 768)
26
- return "sm";
27
- if (width < 1024)
28
- return "md";
29
- return "lg";
30
- }
31
- /**
32
- * 🧱 Section Component
33
- * A flexible layout wrapper that supports responsive backgrounds,
34
- * adaptive padding, and variant-based theming.
35
- */
36
- export const Section = ({ title, subtitle, variant = "light", background, overlay, color, paddingY = 60, paddingX = 20, size = "xl", height = "auto", align = "center", borderRadius = 0, className = "", style, children, }) => {
37
- const [screenSize, setScreenSize] = useState("lg");
38
- useEffect(() => {
39
- const updateSize = () => setScreenSize(getScreenSize(window.innerWidth));
40
- updateSize();
41
- window.addEventListener("resize", updateSize);
42
- return () => window.removeEventListener("resize", updateSize);
43
- }, []);
44
- const resolvedVariant = resolveResponsive(variant, screenSize, "light");
45
- const theme = variantStyles[resolvedVariant];
46
- const resolvedStyles = useMemo(() => {
47
- const bg = resolveResponsive(background, screenSize, theme.background);
48
- const textColor = resolveResponsive(color, screenSize, theme.color);
49
- const overlayColor = resolveResponsive(overlay, screenSize);
50
- const py = resolveResponsive(paddingY, screenSize, 60);
51
- const px = resolveResponsive(paddingX, screenSize, 20);
52
- const alignText = resolveResponsive(align, screenSize, "center");
53
- const h = resolveResponsive(height, screenSize, "auto");
54
- const radius = resolveResponsive(borderRadius, screenSize, 0);
55
- return {
56
- position: "relative",
57
- background: bg,
58
- color: textColor,
59
- paddingTop: typeof py === "number" ? `${py}px` : py,
60
- paddingBottom: typeof py === "number" ? `${py}px` : py,
61
- paddingLeft: typeof px === "number" ? `${px}px` : px,
62
- paddingRight: typeof px === "number" ? `${px}px` : px,
63
- textAlign: alignText,
64
- height: h,
65
- borderRadius: typeof radius === "number" ? `${radius}px` : radius,
66
- boxSizing: "border-box",
67
- overflow: "hidden",
68
- ...style,
69
- };
70
- }, [
71
- background,
72
- color,
73
- overlay,
74
- paddingY,
75
- paddingX,
76
- align,
77
- height,
78
- borderRadius,
79
- theme,
80
- screenSize,
81
- style,
82
- ]);
83
- const resolvedOverlay = resolveResponsive(overlay, screenSize);
84
- return (_jsxs("section", { style: resolvedStyles, className: className, children: [resolvedOverlay && (_jsx("div", { style: {
85
- position: "absolute",
86
- inset: 0,
87
- background: resolvedOverlay,
88
- pointerEvents: "none",
89
- } })), _jsxs(Container, { size: resolveResponsive(size, screenSize, "xl"), className: "relative z-10", children: [(title || subtitle) && (_jsxs("header", { style: { marginBottom: 32 }, children: [title && (_jsx("h2", { style: {
90
- fontSize: "2rem",
91
- fontWeight: 700,
92
- marginBottom: subtitle ? 8 : 0,
93
- }, children: title })), subtitle && (_jsx("p", { style: {
94
- fontSize: "1.125rem",
95
- color: resolvedVariant === "dark"
96
- ? "rgba(255,255,255,0.7)"
97
- : "rgba(0,0,0,0.6)",
98
- }, children: subtitle }))] })), children] })] }));
99
- };
100
- export default Section;
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- interface AvatarGroupProps {
3
- avatars: string[];
4
- size?: "small" | "medium" | "large";
5
- maxVisible?: number;
6
- className?: string;
7
- }
8
- export declare const AvatarGroup: React.FC<AvatarGroupProps>;
9
- export {};
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- interface AvatarWithStatusProps {
3
- src: string;
4
- alt?: string;
5
- status?: "online" | "offline" | "away" | "busy";
6
- size?: "small" | "medium" | "large";
7
- className?: string;
8
- }
9
- export declare const AvatarWithStatus: React.FC<AvatarWithStatusProps>;
10
- export {};
@@ -1,28 +0,0 @@
1
- import { CSSProperties, ReactNode, ElementType, ForwardedRef, ReactElement, ComponentPropsWithoutRef } from "react";
2
- type CardVariant = string;
3
- type CardOwnProps = {
4
- as?: ElementType;
5
- children?: ReactNode;
6
- className?: string;
7
- variant?: CardVariant;
8
- background?: string;
9
- textColor?: string;
10
- borderRadius?: string | number;
11
- border?: string;
12
- boxShadow?: string;
13
- hoverShadow?: string;
14
- padding?: string | number;
15
- margin?: string | number;
16
- width?: string | number;
17
- height?: string | number;
18
- style?: CSSProperties;
19
- hoverStyle?: CSSProperties;
20
- onClick?: () => void;
21
- };
22
- type CardProps<T extends ElementType = "div"> = CardOwnProps & Omit<ComponentPropsWithoutRef<T>, keyof CardOwnProps>;
23
- declare const Card: (<T extends ElementType = "div">(props: CardProps<T> & {
24
- ref?: ForwardedRef<HTMLDivElement>;
25
- }) => ReactElement) & {
26
- displayName: string;
27
- };
28
- export { Card };
@@ -1,25 +0,0 @@
1
- import React from "react";
2
- type ScreenSize = "sm" | "md" | "lg";
3
- type ResponsiveValue<T> = T | Partial<Record<ScreenSize, T>>;
4
- interface FlexboxProps {
5
- direction?: ResponsiveValue<"row" | "column" | "row-reverse" | "column-reverse">;
6
- align?: ResponsiveValue<"flex-start" | "flex-end" | "center" | "stretch" | "baseline">;
7
- justify?: ResponsiveValue<"flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly">;
8
- wrap?: ResponsiveValue<"nowrap" | "wrap" | "wrap-reverse">;
9
- gap?: ResponsiveValue<number | string>;
10
- padding?: ResponsiveValue<number | string>;
11
- margin?: ResponsiveValue<number | string>;
12
- backgroundColor?: ResponsiveValue<string>;
13
- width?: ResponsiveValue<string>;
14
- maxWidth?: ResponsiveValue<string>;
15
- height?: ResponsiveValue<string>;
16
- borderRadius?: ResponsiveValue<string>;
17
- border?: ResponsiveValue<string>;
18
- boxShadow?: ResponsiveValue<string>;
19
- overflow?: ResponsiveValue<"visible" | "hidden" | "auto" | "scroll">;
20
- children: React.ReactNode;
21
- style?: React.CSSProperties;
22
- className?: string;
23
- }
24
- export declare const Flexbox: React.FC<FlexboxProps>;
25
- export {};
@@ -1,36 +0,0 @@
1
- import React from "react";
2
- type ScreenSize = "sm" | "md" | "lg";
3
- type ResponsiveProp<T> = T | Partial<Record<ScreenSize, T>>;
4
- interface SectionProps {
5
- /** Headings */
6
- title?: string;
7
- subtitle?: string;
8
- /** Responsive variant styles */
9
- variant?: ResponsiveProp<"light" | "dark" | "gradient" | "transparent" | "primary">;
10
- /** Custom backgrounds */
11
- background?: ResponsiveProp<string>;
12
- overlay?: ResponsiveProp<string>;
13
- color?: ResponsiveProp<string>;
14
- /** Spacing */
15
- paddingY?: ResponsiveProp<number | string>;
16
- paddingX?: ResponsiveProp<number | string>;
17
- /** Container size */
18
- size?: ResponsiveProp<"sm" | "md" | "lg" | "xl" | "2xl" | "full">;
19
- /** Section height */
20
- height?: ResponsiveProp<string>;
21
- /** Text alignment */
22
- align?: ResponsiveProp<"left" | "center" | "right">;
23
- /** Border radius */
24
- borderRadius?: ResponsiveProp<number | string>;
25
- /** Optional styling */
26
- className?: string;
27
- style?: React.CSSProperties;
28
- children?: React.ReactNode;
29
- }
30
- /**
31
- * 🧱 Section Component
32
- * A flexible layout wrapper that supports responsive backgrounds,
33
- * adaptive padding, and variant-based theming.
34
- */
35
- export declare const Section: React.FC<SectionProps>;
36
- export default Section;