PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / trunk
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance vtrunk
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / team-updraft / lib-onboarding-wizard / Wizard / Onboarding / src / components / Fields / Text.tsx

Text.tsx in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance trunk, at vendor/team-updraft/lib-onboarding-wizard/Wizard/Onboarding/src/components/Fields/Text.tsx

59 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { memo } from 'react';
2 import FieldWrapper from './FieldWrapper';
3 import TextInput from './TextInput';
4 import { clsx } from 'clsx';
5
6 interface TextFieldProps {
7 field: {
8 id: string;
9 label?: string;
10 placeholder?: string;
11 is_lock?: boolean;
12 tooltip?: any;
13 context?: any;
14 context_html?: string;
15 prefix?: string;
16 [key: string]: any;
17 };
18 value: string;
19 onChange: (value: string) => void;
20 }
21
22 const Text = ({ field, value, onChange }: TextFieldProps) => {
23 const disabled = field.is_lock === true;
24
25 return (
26 <FieldWrapper
27 inputId={field.id}
28 label={field.label}
29 tooltip={field.tooltip}
30 context={field.context}
31 contextHtml={field.context_html ?? ''}
32 >
33 <div className={clsx(
34 "flex items-center w-full rounded-md border border-gray-400 focus-within:border-primary-dark focus-within:ring focus-within:ring-primary/20",
35 disabled && "bg-gray-200 border-gray-200"
36 )}>
37 {field.prefix && (
38 <span className="flex-shrink-0 bg-gray-100 text-gray-700 px-3 py-2 rounded-l-md border-r border-gray-400">
39 {field.prefix}
40 </span>
41 )}
42 <TextInput
43 id={field.id}
44 type="text"
45 placeholder={field.placeholder}
46 value={value}
47 onChange={(e) => onChange(e.target.value)}
48 disabled={disabled}
49 className={clsx(
50 "flex-1 border-none focus:ring-0 focus:border-none rounded-none",
51 field.prefix ? "rounded-r-md" : "rounded-md"
52 )}
53 />
54 </div>
55 </FieldWrapper>
56 );
57 };
58
59 export default memo(Text);