neogestify-ui-components 1.0.1 → 1.1.1

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.
@@ -0,0 +1,71 @@
1
+ import { type TextareaHTMLAttributes, type FC, type ReactNode } from 'react';
2
+
3
+ interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
4
+ label?: string | ReactNode;
5
+ error?: string;
6
+ helperText?: string;
7
+ variant?: 'default' | 'outline' | 'filled' | 'minimal';
8
+ size?: 'small' | 'medium' | 'large';
9
+ }
10
+
11
+ export const TextArea: FC<TextAreaProps> = ({
12
+ label,
13
+ error,
14
+ helperText,
15
+ variant = 'default',
16
+ size = 'medium',
17
+ className = '',
18
+ id,
19
+ ...props
20
+ }) => {
21
+ const textAreaId = id || `textarea-${Math.random().toString(36).substring(2, 9)}`;
22
+
23
+ const sizeClasses = {
24
+ small: 'px-2 py-1 text-xs',
25
+ medium: 'px-3 py-2 text-sm',
26
+ large: 'px-4 py-3 text-base'
27
+ };
28
+
29
+ const variantClasses = {
30
+ default: 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800',
31
+ outline: 'border-2 border-indigo-300 dark:border-indigo-600 bg-transparent',
32
+ filled: 'border-gray-300 dark:border-gray-600 bg-gray-100 dark:bg-gray-700',
33
+ minimal: 'border-0 bg-transparent focus:ring-0 focus:border-0'
34
+ };
35
+
36
+ const baseClasses = 'appearance-none relative block w-full placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500 focus:z-10 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 resize-vertical';
37
+
38
+ const errorClasses = error ? 'border-red-300 dark:border-red-600 focus:ring-red-500 dark:focus:ring-red-400 focus:border-red-500' : '';
39
+
40
+ const classes = `${baseClasses} ${sizeClasses[size]} ${variantClasses[variant]} ${errorClasses} ${className}`;
41
+
42
+ return (
43
+ <div className="space-y-1 w-full">
44
+ {label && typeof label === 'string' ? (
45
+ <label
46
+ htmlFor={textAreaId}
47
+ className="block text-sm font-medium text-gray-700 dark:text-gray-300"
48
+ >
49
+ {label}
50
+ </label>
51
+ ) : (
52
+ label
53
+ )}
54
+ <textarea
55
+ id={textAreaId}
56
+ className={classes}
57
+ {...props}
58
+ />
59
+ {error && (
60
+ <p className="text-sm text-red-600 dark:text-red-400" role="alert">
61
+ {error}
62
+ </p>
63
+ )}
64
+ {helperText && !error && (
65
+ <p className="text-sm text-gray-500 dark:text-gray-400">
66
+ {helperText}
67
+ </p>
68
+ )}
69
+ </div>
70
+ );
71
+ };
@@ -1,5 +1,6 @@
1
1
  export { Button } from './Button';
2
2
  export { Input } from './Input';
3
+ export { TextArea } from './TextArea';
3
4
  export { Form } from './Form';
4
5
  export { Select } from './Select';
5
6
  export { Table } from './Table';
@@ -544,4 +544,12 @@ export function LifeGuardIcon({ className }: Props) {
544
544
  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z" />
545
545
  </svg>
546
546
  )
547
+ }
548
+
549
+ export function MonitorIcon({ className }: Props) {
550
+ return (
551
+ <svg className={className} xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
552
+ <path fill="currentColor" d="M4 18q-.825 0-1.412-.587T2 16V5q0-.825.588-1.412T4 3h16q.825 0 1.413.588T22 5v11q0 .825-.587 1.413T20 18h-3l.7.7q.15.15.225.338t.075.387V20q0 .425-.288.712T17 21H7q-.425 0-.712-.288T6 20v-.575q0-.2.075-.387T6.3 18.7L7 18zm0-2h16V5H4zm0 0V5z" />
553
+ </svg>
554
+ )
547
555
  }