@underverse-ui/underverse 0.2.63 → 0.2.65

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
@@ -94,7 +94,31 @@ All components follow [Vercel Web Interface Guidelines](https://github.com/verce
94
94
 
95
95
  ---
96
96
 
97
- ## 🚀 Quick Start
97
+ ## Entry Points
98
+
99
+ Package được chia thành 2 entry points để tối ưu cho Server Components:
100
+
101
+ ### Main Entry (Server-safe)
102
+
103
+ ```tsx
104
+ // dist/index.js - Các components không phụ thuộc react-hook-form
105
+ // Có thể sử dụng trong cả Server Components và Client Components
106
+ import { Button, Skeleton, DatePicker, DataTable } from "@underverse-ui/underverse";
107
+ ```
108
+
109
+ ### Form Entry (Client-only)
110
+
111
+ ```tsx
112
+ // dist/form.js - Form components (phụ thuộc react-hook-form)
113
+ // Chỉ sử dụng trong Client Components ("use client")
114
+ import { Form, FormField, FormItem, FormLabel, FormMessage } from "@underverse-ui/underverse/form";
115
+ ```
116
+
117
+ **Lưu ý:** Form components yêu cầu `react-hook-form` và `@hookform/resolvers` nên chỉ hoạt động ở client-side.
118
+
119
+ ---
120
+
121
+ ## �🚀 Quick Start
98
122
 
99
123
  ### Standalone React (Vite, CRA, etc.)
100
124
 
@@ -0,0 +1,110 @@
1
+ import * as React from 'react';
2
+ import React__default, { InputHTMLAttributes } from 'react';
3
+
4
+ declare const VARIANT_STYLES_BTN: {
5
+ default: string;
6
+ outline: string;
7
+ primary: string;
8
+ secondary: string;
9
+ success: string;
10
+ danger: string;
11
+ destructive: string;
12
+ warning: string;
13
+ info: string;
14
+ ghost: string;
15
+ link: string;
16
+ gradient: string;
17
+ };
18
+ declare const SIZE_STYLES_BTN: {
19
+ sm: string;
20
+ md: string;
21
+ lg: string;
22
+ smx: string;
23
+ icon: string;
24
+ };
25
+
26
+ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
27
+ onClick?: (event: React__default.MouseEvent<HTMLButtonElement>) => void;
28
+ children?: React__default.ReactNode;
29
+ type?: "button" | "submit" | "reset";
30
+ icon?: React__default.ComponentType<{
31
+ className?: string;
32
+ }>;
33
+ iconRight?: React__default.ComponentType<{
34
+ className?: string;
35
+ }>;
36
+ variant?: keyof typeof VARIANT_STYLES_BTN;
37
+ size?: keyof typeof SIZE_STYLES_BTN;
38
+ className?: string;
39
+ iConClassName?: string;
40
+ disabled?: boolean;
41
+ loading?: boolean;
42
+ fullWidth?: boolean;
43
+ title?: string;
44
+ spinner?: React__default.ComponentType<{
45
+ className?: string;
46
+ }>;
47
+ loadingText?: React__default.ReactNode;
48
+ preserveChildrenOnLoading?: boolean;
49
+ preventDoubleClick?: boolean;
50
+ lockMs?: number;
51
+ asContainer?: boolean;
52
+ noWrap?: boolean;
53
+ noHoverOverlay?: boolean;
54
+ gradient?: boolean;
55
+ }
56
+ declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
57
+
58
+ interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
59
+ label?: React.ReactNode;
60
+ labelClassName?: string;
61
+ containerClassName?: string;
62
+ }
63
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
64
+
65
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
66
+ label?: string;
67
+ error?: string;
68
+ description?: string;
69
+ variant?: "default" | "filled" | "outlined" | "minimal";
70
+ size?: "sm" | "md" | "lg";
71
+ leftIcon?: React__default.ComponentType<{
72
+ className?: string;
73
+ }>;
74
+ rightIcon?: React__default.ComponentType<{
75
+ className?: string;
76
+ }>;
77
+ clearable?: boolean;
78
+ loading?: boolean;
79
+ success?: boolean;
80
+ onClear?: () => void;
81
+ hint?: string;
82
+ counter?: boolean;
83
+ maxLength?: number;
84
+ }
85
+ declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
86
+ interface SearchInputProps extends Omit<InputProps, "leftIcon" | "type"> {
87
+ onSearch?: (value: string) => void;
88
+ searchDelay?: number;
89
+ }
90
+ declare const SearchInput: React__default.ForwardRefExoticComponent<SearchInputProps & React__default.RefAttributes<HTMLInputElement>>;
91
+ interface PasswordInputProps extends Omit<InputProps, "type"> {
92
+ showStrength?: boolean;
93
+ strengthLabels?: string[];
94
+ }
95
+ declare const PasswordInput: React__default.ForwardRefExoticComponent<PasswordInputProps & React__default.RefAttributes<HTMLInputElement>>;
96
+ interface NumberInputProps extends Omit<InputProps, "type" | "value" | "onChange"> {
97
+ min?: number;
98
+ max?: number;
99
+ step?: number;
100
+ showSteppers?: boolean;
101
+ onIncrement?: () => void;
102
+ onDecrement?: () => void;
103
+ formatThousands?: boolean;
104
+ locale?: string;
105
+ value?: number | string;
106
+ onChange?: React__default.ChangeEventHandler<HTMLInputElement>;
107
+ }
108
+ declare const NumberInput: React__default.ForwardRefExoticComponent<NumberInputProps & React__default.RefAttributes<HTMLInputElement>>;
109
+
110
+ export { Button as B, Checkbox as C, Input as I, NumberInput as N, PasswordInput as P, SearchInput as S, VARIANT_STYLES_BTN as V, type ButtonProps as a, type CheckboxProps as b, type InputProps as c, SIZE_STYLES_BTN as d };
@@ -0,0 +1,110 @@
1
+ import * as React from 'react';
2
+ import React__default, { InputHTMLAttributes } from 'react';
3
+
4
+ declare const VARIANT_STYLES_BTN: {
5
+ default: string;
6
+ outline: string;
7
+ primary: string;
8
+ secondary: string;
9
+ success: string;
10
+ danger: string;
11
+ destructive: string;
12
+ warning: string;
13
+ info: string;
14
+ ghost: string;
15
+ link: string;
16
+ gradient: string;
17
+ };
18
+ declare const SIZE_STYLES_BTN: {
19
+ sm: string;
20
+ md: string;
21
+ lg: string;
22
+ smx: string;
23
+ icon: string;
24
+ };
25
+
26
+ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
27
+ onClick?: (event: React__default.MouseEvent<HTMLButtonElement>) => void;
28
+ children?: React__default.ReactNode;
29
+ type?: "button" | "submit" | "reset";
30
+ icon?: React__default.ComponentType<{
31
+ className?: string;
32
+ }>;
33
+ iconRight?: React__default.ComponentType<{
34
+ className?: string;
35
+ }>;
36
+ variant?: keyof typeof VARIANT_STYLES_BTN;
37
+ size?: keyof typeof SIZE_STYLES_BTN;
38
+ className?: string;
39
+ iConClassName?: string;
40
+ disabled?: boolean;
41
+ loading?: boolean;
42
+ fullWidth?: boolean;
43
+ title?: string;
44
+ spinner?: React__default.ComponentType<{
45
+ className?: string;
46
+ }>;
47
+ loadingText?: React__default.ReactNode;
48
+ preserveChildrenOnLoading?: boolean;
49
+ preventDoubleClick?: boolean;
50
+ lockMs?: number;
51
+ asContainer?: boolean;
52
+ noWrap?: boolean;
53
+ noHoverOverlay?: boolean;
54
+ gradient?: boolean;
55
+ }
56
+ declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
57
+
58
+ interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
59
+ label?: React.ReactNode;
60
+ labelClassName?: string;
61
+ containerClassName?: string;
62
+ }
63
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
64
+
65
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
66
+ label?: string;
67
+ error?: string;
68
+ description?: string;
69
+ variant?: "default" | "filled" | "outlined" | "minimal";
70
+ size?: "sm" | "md" | "lg";
71
+ leftIcon?: React__default.ComponentType<{
72
+ className?: string;
73
+ }>;
74
+ rightIcon?: React__default.ComponentType<{
75
+ className?: string;
76
+ }>;
77
+ clearable?: boolean;
78
+ loading?: boolean;
79
+ success?: boolean;
80
+ onClear?: () => void;
81
+ hint?: string;
82
+ counter?: boolean;
83
+ maxLength?: number;
84
+ }
85
+ declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
86
+ interface SearchInputProps extends Omit<InputProps, "leftIcon" | "type"> {
87
+ onSearch?: (value: string) => void;
88
+ searchDelay?: number;
89
+ }
90
+ declare const SearchInput: React__default.ForwardRefExoticComponent<SearchInputProps & React__default.RefAttributes<HTMLInputElement>>;
91
+ interface PasswordInputProps extends Omit<InputProps, "type"> {
92
+ showStrength?: boolean;
93
+ strengthLabels?: string[];
94
+ }
95
+ declare const PasswordInput: React__default.ForwardRefExoticComponent<PasswordInputProps & React__default.RefAttributes<HTMLInputElement>>;
96
+ interface NumberInputProps extends Omit<InputProps, "type" | "value" | "onChange"> {
97
+ min?: number;
98
+ max?: number;
99
+ step?: number;
100
+ showSteppers?: boolean;
101
+ onIncrement?: () => void;
102
+ onDecrement?: () => void;
103
+ formatThousands?: boolean;
104
+ locale?: string;
105
+ value?: number | string;
106
+ onChange?: React__default.ChangeEventHandler<HTMLInputElement>;
107
+ }
108
+ declare const NumberInput: React__default.ForwardRefExoticComponent<NumberInputProps & React__default.RefAttributes<HTMLInputElement>>;
109
+
110
+ export { Button as B, Checkbox as C, Input as I, NumberInput as N, PasswordInput as P, SearchInput as S, VARIANT_STYLES_BTN as V, type ButtonProps as a, type CheckboxProps as b, type InputProps as c, SIZE_STYLES_BTN as d };