neogestify-ui-components 2.2.1 → 2.3.0

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 (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +803 -349
  3. package/dist/components/ElementLibraryBuilder/index.js +299 -120
  4. package/dist/components/ElementLibraryBuilder/index.js.map +1 -1
  5. package/dist/components/ElementLibraryBuilder/index.mjs +300 -121
  6. package/dist/components/ElementLibraryBuilder/index.mjs.map +1 -1
  7. package/dist/components/VenueMapEditor/index.js.map +1 -1
  8. package/dist/components/VenueMapEditor/index.mjs.map +1 -1
  9. package/dist/components/alerts/index.js +108 -51
  10. package/dist/components/alerts/index.js.map +1 -1
  11. package/dist/components/alerts/index.mjs +109 -52
  12. package/dist/components/alerts/index.mjs.map +1 -1
  13. package/dist/components/html/index.d.mts +123 -11
  14. package/dist/components/html/index.d.ts +123 -11
  15. package/dist/components/html/index.js +607 -144
  16. package/dist/components/html/index.js.map +1 -1
  17. package/dist/components/html/index.mjs +608 -145
  18. package/dist/components/html/index.mjs.map +1 -1
  19. package/dist/components/icons/index.d.mts +5 -1
  20. package/dist/components/icons/index.d.ts +5 -1
  21. package/dist/components/icons/index.js +16 -0
  22. package/dist/components/icons/index.js.map +1 -1
  23. package/dist/components/icons/index.mjs +13 -1
  24. package/dist/components/icons/index.mjs.map +1 -1
  25. package/dist/context/theme/index.js +59 -37
  26. package/dist/context/theme/index.js.map +1 -1
  27. package/dist/context/theme/index.mjs +59 -37
  28. package/dist/context/theme/index.mjs.map +1 -1
  29. package/dist/index.d.mts +1 -1
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.js +611 -144
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +609 -146
  34. package/dist/index.mjs.map +1 -1
  35. package/package.json +1 -1
  36. package/src/components/html/Button.tsx +84 -38
  37. package/src/components/html/Form.tsx +33 -13
  38. package/src/components/html/Input.tsx +110 -31
  39. package/src/components/html/Loading.tsx +58 -33
  40. package/src/components/html/Modal.tsx +67 -20
  41. package/src/components/html/Select.tsx +92 -39
  42. package/src/components/html/Table.tsx +429 -38
  43. package/src/components/html/TextArea.tsx +81 -31
  44. package/src/components/icons/icons.tsx +32 -0
@@ -1,30 +1,52 @@
1
- import React__default, { FC, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, FormHTMLAttributes, FormEvent, SelectHTMLAttributes } from 'react';
1
+ import React__default, { FC, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, FormHTMLAttributes, FormEvent, SelectHTMLAttributes, CSSProperties } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
+ type ButtonVariant = 'primary' | 'secondary' | 'icon' | 'danger' | 'success' | 'outline' | 'nav' | 'custom' | 'link' | 'warning' | 'toggle' | 'ghost';
5
+ type ButtonSize = 'sm' | 'md' | 'lg';
6
+ type ButtonShape = 'rounded' | 'pill' | 'square';
4
7
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
- variant?: 'primary' | 'secondary' | 'icon' | 'danger' | 'success' | 'outline' | 'nav' | 'custom' | 'link' | 'warning' | 'toggle';
8
+ variant?: ButtonVariant;
6
9
  children: ReactNode;
7
10
  isLoading?: boolean;
8
11
  loadingText?: string;
9
12
  isActive?: boolean;
13
+ size?: ButtonSize;
14
+ leftIcon?: ReactNode;
15
+ rightIcon?: ReactNode;
16
+ fullWidth?: boolean;
17
+ shape?: ButtonShape;
10
18
  }
11
19
  declare const Button: FC<ButtonProps>;
12
20
 
13
- interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
21
+ type InputVariant = 'default' | 'outline' | 'filled' | 'minimal';
22
+ type InputSize = 'sm' | 'md' | 'lg';
23
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
14
24
  label?: string | ReactNode;
15
25
  error?: string;
16
26
  helperText?: string;
17
27
  icon?: ReactNode;
18
28
  iconSide?: 'left' | 'right';
29
+ variant?: InputVariant;
30
+ size?: InputSize;
31
+ prefix?: ReactNode;
32
+ suffix?: ReactNode;
33
+ clearable?: boolean;
34
+ onClear?: () => void;
19
35
  }
20
36
  declare const Input: FC<InputProps>;
21
37
 
38
+ type TextAreaVariant = 'default' | 'outline' | 'filled' | 'minimal';
39
+ type TextAreaSize = 'small' | 'medium' | 'large';
40
+ type ResizeOption = 'vertical' | 'horizontal' | 'both' | 'none';
22
41
  interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
23
42
  label?: string | ReactNode;
24
43
  error?: string;
25
44
  helperText?: string;
26
- variant?: 'default' | 'outline' | 'filled' | 'minimal';
27
- size?: 'small' | 'medium' | 'large';
45
+ variant?: TextAreaVariant;
46
+ size?: TextAreaSize;
47
+ autoResize?: boolean;
48
+ showCount?: boolean;
49
+ resize?: ResizeOption;
28
50
  }
29
51
  declare const TextArea: FC<TextAreaProps>;
30
52
 
@@ -32,9 +54,13 @@ interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
32
54
  children: ReactNode;
33
55
  onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
34
56
  variant?: 'default' | 'modal' | 'card' | 'inline' | 'compact';
57
+ /** Number of columns for a CSS grid layout. 1 = single column, >1 = multi-column grid. */
58
+ columns?: number;
35
59
  }
36
60
  declare const Form: FC<FormProps>;
37
61
 
62
+ type SelectVariant = 'default' | 'outline' | 'filled' | 'minimal' | 'custom' | 'small';
63
+ type SelectSize = 'sm' | 'md' | 'lg';
38
64
  interface Option {
39
65
  value: string | number;
40
66
  label: string;
@@ -44,31 +70,113 @@ interface Option {
44
70
  interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
45
71
  options: Option[];
46
72
  placeholder?: string;
47
- variant?: 'default' | 'small';
48
- error?: boolean;
73
+ variant?: SelectVariant;
74
+ size?: SelectSize;
75
+ error?: string | boolean;
49
76
  helperText?: string;
50
77
  label?: string | ReactNode;
78
+ icon?: ReactNode;
51
79
  }
52
80
  declare const Select: FC<SelectProps>;
53
81
 
82
+ type TableVariant = 'default' | 'striped' | 'bordered' | 'minimal' | 'ghost' | 'card' | 'accent' | 'dark' | 'custom';
83
+ type TableSize = 'sm' | 'md' | 'lg';
84
+ interface SortState {
85
+ key: string;
86
+ direction: 'asc' | 'desc';
87
+ }
88
+ interface ColumnDef {
89
+ /** Contenido del encabezado */
90
+ header: ReactNode;
91
+ /** Clase CSS adicional para toda la columna (th + td) */
92
+ className?: string;
93
+ /** Alinear el contenido de esta columna */
94
+ align?: 'left' | 'center' | 'right';
95
+ /** Ancho fijo (px, %, rem…) */
96
+ width?: string | number;
97
+ /** Ancho mínimo */
98
+ minWidth?: string | number;
99
+ /** Fija esta columna a la izquierda durante scroll horizontal */
100
+ sticky?: boolean;
101
+ /** Estilos inline exclusivos para <th> */
102
+ thStyle?: CSSProperties;
103
+ /** Estilos inline exclusivos para <td> */
104
+ tdStyle?: CSSProperties;
105
+ /** Muestra indicador de ordenación. Requiere `key` */
106
+ sortable?: boolean;
107
+ /** Clave usada en sortState y onSort */
108
+ key?: string;
109
+ }
54
110
  interface TableProps {
55
- headers: ReactNode[];
111
+ /**
112
+ * Definición de columnas. Acepta strings simples o ColumnDef para
113
+ * configuración avanzada (ancho, sticky, sort, etc.).
114
+ */
115
+ columns: (ColumnDef | ReactNode)[];
116
+ /** Filas del cuerpo. Cada fila es un arreglo de celdas. */
56
117
  rows: ReactNode[][];
57
- variant?: 'default' | 'custom';
118
+ /** Estilo visual. Default: 'default' */
119
+ variant?: TableVariant;
120
+ /** Tamaño de padding. Default: 'md' */
121
+ size?: TableSize;
122
+ /** Clase CSS adicional para el wrapper <div> */
58
123
  className?: string;
124
+ /** Clase CSS adicional para el <table> */
125
+ tableClassName?: string;
126
+ /** Clase CSS adicional para cada <th> */
59
127
  thClassName?: string;
128
+ /** Clase CSS adicional para cada <td> */
60
129
  tdClassName?: string;
130
+ /** Clase CSS adicional por fila del body */
131
+ trClassName?: string | ((rowIndex: number) => string);
132
+ /** Nodo a mostrar cuando rows está vacío */
133
+ emptyState?: ReactNode;
134
+ /** Callback al hacer click en una fila */
135
+ onRowClick?: (rowIndex: number) => void;
136
+ /** Oculta el thead */
137
+ hideHeader?: boolean;
138
+ /** Estilos inline para el <table> */
139
+ style?: CSSProperties;
140
+ /** Fija el thead al hacer scroll vertical */
141
+ stickyHeader?: boolean;
142
+ /** Caption accesible de la tabla */
143
+ caption?: ReactNode;
144
+ /** Filas del <tfoot> */
145
+ footerRows?: ReactNode[][];
146
+ /** Muestra esqueleto animado en lugar de rows */
147
+ loading?: boolean;
148
+ /** Número de filas esqueleto cuando loading=true. Default: 4 */
149
+ loadingRows?: number;
150
+ /** Estilo inline por fila del body */
151
+ getRowStyle?: (rowIndex: number) => CSSProperties;
152
+ /** Agrega rounded-lg al wrapper */
153
+ rounded?: boolean;
154
+ /** Agrega sombra al wrapper */
155
+ shadow?: boolean;
156
+ /** Desactiva el efecto hover en filas. Default: true */
157
+ hoverable?: boolean;
158
+ /** Estado actual de ordenación */
159
+ sortState?: SortState | null;
160
+ /** Callback al hacer click en un th sortable */
161
+ onSort?: (key: string) => void;
61
162
  }
62
- declare function Table({ headers, rows, variant, className, thClassName, tdClassName }: TableProps): react_jsx_runtime.JSX.Element;
163
+ declare function Table({ columns, rows, variant, size, className, tableClassName, thClassName, tdClassName, trClassName, emptyState, onRowClick, hideHeader, style, stickyHeader, caption, footerRows, loading, loadingRows, getRowStyle, rounded, shadow, hoverable, sortState, onSort, }: TableProps): react_jsx_runtime.JSX.Element;
63
164
 
165
+ type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
166
+ type ModalVariant = 'default' | 'danger' | 'success' | 'warning';
64
167
  interface ModalProps {
65
168
  onClose: () => void;
66
- title: string;
169
+ title: React__default.ReactNode;
67
170
  children: React__default.ReactNode;
68
171
  footer?: React__default.ReactNode;
172
+ /** @deprecated Use size instead */
69
173
  maxWidth?: string;
174
+ size?: ModalSize;
70
175
  showCloseButton?: boolean;
71
176
  zIndex?: number;
177
+ closeOnBackdrop?: boolean;
178
+ closeOnEsc?: boolean;
179
+ variant?: ModalVariant;
72
180
  }
73
181
  interface ModalRef {
74
182
  handleClose: () => void;
@@ -81,6 +189,10 @@ interface LoadingProps {
81
189
  color?: 'primary' | 'white' | 'gray' | 'success' | 'danger' | 'warning';
82
190
  label?: string;
83
191
  className?: string;
192
+ /** Renders over the nearest positioned ancestor (parent needs position: relative) */
193
+ overlay?: boolean;
194
+ /** Renders as a fixed full-page overlay */
195
+ fullPage?: boolean;
84
196
  }
85
197
  declare const Loading: FC<LoadingProps>;
86
198
 
@@ -1,30 +1,52 @@
1
- import React__default, { FC, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, FormHTMLAttributes, FormEvent, SelectHTMLAttributes } from 'react';
1
+ import React__default, { FC, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, FormHTMLAttributes, FormEvent, SelectHTMLAttributes, CSSProperties } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
+ type ButtonVariant = 'primary' | 'secondary' | 'icon' | 'danger' | 'success' | 'outline' | 'nav' | 'custom' | 'link' | 'warning' | 'toggle' | 'ghost';
5
+ type ButtonSize = 'sm' | 'md' | 'lg';
6
+ type ButtonShape = 'rounded' | 'pill' | 'square';
4
7
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
- variant?: 'primary' | 'secondary' | 'icon' | 'danger' | 'success' | 'outline' | 'nav' | 'custom' | 'link' | 'warning' | 'toggle';
8
+ variant?: ButtonVariant;
6
9
  children: ReactNode;
7
10
  isLoading?: boolean;
8
11
  loadingText?: string;
9
12
  isActive?: boolean;
13
+ size?: ButtonSize;
14
+ leftIcon?: ReactNode;
15
+ rightIcon?: ReactNode;
16
+ fullWidth?: boolean;
17
+ shape?: ButtonShape;
10
18
  }
11
19
  declare const Button: FC<ButtonProps>;
12
20
 
13
- interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
21
+ type InputVariant = 'default' | 'outline' | 'filled' | 'minimal';
22
+ type InputSize = 'sm' | 'md' | 'lg';
23
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
14
24
  label?: string | ReactNode;
15
25
  error?: string;
16
26
  helperText?: string;
17
27
  icon?: ReactNode;
18
28
  iconSide?: 'left' | 'right';
29
+ variant?: InputVariant;
30
+ size?: InputSize;
31
+ prefix?: ReactNode;
32
+ suffix?: ReactNode;
33
+ clearable?: boolean;
34
+ onClear?: () => void;
19
35
  }
20
36
  declare const Input: FC<InputProps>;
21
37
 
38
+ type TextAreaVariant = 'default' | 'outline' | 'filled' | 'minimal';
39
+ type TextAreaSize = 'small' | 'medium' | 'large';
40
+ type ResizeOption = 'vertical' | 'horizontal' | 'both' | 'none';
22
41
  interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
23
42
  label?: string | ReactNode;
24
43
  error?: string;
25
44
  helperText?: string;
26
- variant?: 'default' | 'outline' | 'filled' | 'minimal';
27
- size?: 'small' | 'medium' | 'large';
45
+ variant?: TextAreaVariant;
46
+ size?: TextAreaSize;
47
+ autoResize?: boolean;
48
+ showCount?: boolean;
49
+ resize?: ResizeOption;
28
50
  }
29
51
  declare const TextArea: FC<TextAreaProps>;
30
52
 
@@ -32,9 +54,13 @@ interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
32
54
  children: ReactNode;
33
55
  onSubmit?: (e: FormEvent<HTMLFormElement>) => void;
34
56
  variant?: 'default' | 'modal' | 'card' | 'inline' | 'compact';
57
+ /** Number of columns for a CSS grid layout. 1 = single column, >1 = multi-column grid. */
58
+ columns?: number;
35
59
  }
36
60
  declare const Form: FC<FormProps>;
37
61
 
62
+ type SelectVariant = 'default' | 'outline' | 'filled' | 'minimal' | 'custom' | 'small';
63
+ type SelectSize = 'sm' | 'md' | 'lg';
38
64
  interface Option {
39
65
  value: string | number;
40
66
  label: string;
@@ -44,31 +70,113 @@ interface Option {
44
70
  interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
45
71
  options: Option[];
46
72
  placeholder?: string;
47
- variant?: 'default' | 'small';
48
- error?: boolean;
73
+ variant?: SelectVariant;
74
+ size?: SelectSize;
75
+ error?: string | boolean;
49
76
  helperText?: string;
50
77
  label?: string | ReactNode;
78
+ icon?: ReactNode;
51
79
  }
52
80
  declare const Select: FC<SelectProps>;
53
81
 
82
+ type TableVariant = 'default' | 'striped' | 'bordered' | 'minimal' | 'ghost' | 'card' | 'accent' | 'dark' | 'custom';
83
+ type TableSize = 'sm' | 'md' | 'lg';
84
+ interface SortState {
85
+ key: string;
86
+ direction: 'asc' | 'desc';
87
+ }
88
+ interface ColumnDef {
89
+ /** Contenido del encabezado */
90
+ header: ReactNode;
91
+ /** Clase CSS adicional para toda la columna (th + td) */
92
+ className?: string;
93
+ /** Alinear el contenido de esta columna */
94
+ align?: 'left' | 'center' | 'right';
95
+ /** Ancho fijo (px, %, rem…) */
96
+ width?: string | number;
97
+ /** Ancho mínimo */
98
+ minWidth?: string | number;
99
+ /** Fija esta columna a la izquierda durante scroll horizontal */
100
+ sticky?: boolean;
101
+ /** Estilos inline exclusivos para <th> */
102
+ thStyle?: CSSProperties;
103
+ /** Estilos inline exclusivos para <td> */
104
+ tdStyle?: CSSProperties;
105
+ /** Muestra indicador de ordenación. Requiere `key` */
106
+ sortable?: boolean;
107
+ /** Clave usada en sortState y onSort */
108
+ key?: string;
109
+ }
54
110
  interface TableProps {
55
- headers: ReactNode[];
111
+ /**
112
+ * Definición de columnas. Acepta strings simples o ColumnDef para
113
+ * configuración avanzada (ancho, sticky, sort, etc.).
114
+ */
115
+ columns: (ColumnDef | ReactNode)[];
116
+ /** Filas del cuerpo. Cada fila es un arreglo de celdas. */
56
117
  rows: ReactNode[][];
57
- variant?: 'default' | 'custom';
118
+ /** Estilo visual. Default: 'default' */
119
+ variant?: TableVariant;
120
+ /** Tamaño de padding. Default: 'md' */
121
+ size?: TableSize;
122
+ /** Clase CSS adicional para el wrapper <div> */
58
123
  className?: string;
124
+ /** Clase CSS adicional para el <table> */
125
+ tableClassName?: string;
126
+ /** Clase CSS adicional para cada <th> */
59
127
  thClassName?: string;
128
+ /** Clase CSS adicional para cada <td> */
60
129
  tdClassName?: string;
130
+ /** Clase CSS adicional por fila del body */
131
+ trClassName?: string | ((rowIndex: number) => string);
132
+ /** Nodo a mostrar cuando rows está vacío */
133
+ emptyState?: ReactNode;
134
+ /** Callback al hacer click en una fila */
135
+ onRowClick?: (rowIndex: number) => void;
136
+ /** Oculta el thead */
137
+ hideHeader?: boolean;
138
+ /** Estilos inline para el <table> */
139
+ style?: CSSProperties;
140
+ /** Fija el thead al hacer scroll vertical */
141
+ stickyHeader?: boolean;
142
+ /** Caption accesible de la tabla */
143
+ caption?: ReactNode;
144
+ /** Filas del <tfoot> */
145
+ footerRows?: ReactNode[][];
146
+ /** Muestra esqueleto animado en lugar de rows */
147
+ loading?: boolean;
148
+ /** Número de filas esqueleto cuando loading=true. Default: 4 */
149
+ loadingRows?: number;
150
+ /** Estilo inline por fila del body */
151
+ getRowStyle?: (rowIndex: number) => CSSProperties;
152
+ /** Agrega rounded-lg al wrapper */
153
+ rounded?: boolean;
154
+ /** Agrega sombra al wrapper */
155
+ shadow?: boolean;
156
+ /** Desactiva el efecto hover en filas. Default: true */
157
+ hoverable?: boolean;
158
+ /** Estado actual de ordenación */
159
+ sortState?: SortState | null;
160
+ /** Callback al hacer click en un th sortable */
161
+ onSort?: (key: string) => void;
61
162
  }
62
- declare function Table({ headers, rows, variant, className, thClassName, tdClassName }: TableProps): react_jsx_runtime.JSX.Element;
163
+ declare function Table({ columns, rows, variant, size, className, tableClassName, thClassName, tdClassName, trClassName, emptyState, onRowClick, hideHeader, style, stickyHeader, caption, footerRows, loading, loadingRows, getRowStyle, rounded, shadow, hoverable, sortState, onSort, }: TableProps): react_jsx_runtime.JSX.Element;
63
164
 
165
+ type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
166
+ type ModalVariant = 'default' | 'danger' | 'success' | 'warning';
64
167
  interface ModalProps {
65
168
  onClose: () => void;
66
- title: string;
169
+ title: React__default.ReactNode;
67
170
  children: React__default.ReactNode;
68
171
  footer?: React__default.ReactNode;
172
+ /** @deprecated Use size instead */
69
173
  maxWidth?: string;
174
+ size?: ModalSize;
70
175
  showCloseButton?: boolean;
71
176
  zIndex?: number;
177
+ closeOnBackdrop?: boolean;
178
+ closeOnEsc?: boolean;
179
+ variant?: ModalVariant;
72
180
  }
73
181
  interface ModalRef {
74
182
  handleClose: () => void;
@@ -81,6 +189,10 @@ interface LoadingProps {
81
189
  color?: 'primary' | 'white' | 'gray' | 'success' | 'danger' | 'warning';
82
190
  label?: string;
83
191
  className?: string;
192
+ /** Renders over the nearest positioned ancestor (parent needs position: relative) */
193
+ overlay?: boolean;
194
+ /** Renders as a fixed full-page overlay */
195
+ fullPage?: boolean;
84
196
  }
85
197
  declare const Loading: FC<LoadingProps>;
86
198