diff --git a/package-lock.json b/package-lock.json
index 945674ce5..7d8b1ff80 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,7 @@
"version": "2.0.0",
"license": "GPL-2.0-or-later",
"dependencies": {
+ "@hugeicons/core-free-icons": "^4.1.1",
"@hugeicons/react": "^1.1.6",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
@@ -2413,6 +2414,12 @@
"@hapi/hoek": "^9.0.0"
}
},
+ "node_modules/@hugeicons/core-free-icons": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/@hugeicons/core-free-icons/-/core-free-icons-4.1.1.tgz",
+ "integrity": "sha512-teqIBvPHl90ygIwKyJwTxOH8aNp1X1PjDTcMvLkEwdPxPD+8mssrZ5kXKIAJJFYPsz69a8LYQY0UPid4PAdavg==",
+ "license": "MIT"
+ },
"node_modules/@hugeicons/react": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@hugeicons/react/-/react-1.1.6.tgz",
diff --git a/package.json b/package.json
index cd7dd66c9..aee7401a7 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,7 @@
"tw-animate-css": "^1.4.0"
},
"dependencies": {
+ "@hugeicons/core-free-icons": "^4.1.1",
"@hugeicons/react": "^1.1.6",
"@radix-ui/react-checkbox": "^1.3.3",
"@radix-ui/react-dialog": "^1.1.15",
diff --git a/src/admin/components/formBuilder/FieldPalette.js b/src/admin/components/formBuilder/FieldPalette.js
index c8fad8f4a..74fe61e9b 100644
--- a/src/admin/components/formBuilder/FieldPalette.js
+++ b/src/admin/components/formBuilder/FieldPalette.js
@@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
-import { Icon } from '@wordpress/icons';
+import { HugeiconsIcon } from '@hugeicons/react';
import { FIELD_CATEGORIES, getFieldTypesByCategory } from '../../config/fieldTypes';
import './FieldPalette.css';
@@ -37,7 +37,7 @@ export default function FieldPalette({ onDragStart }) {
onDragStart={(e) => handleDragStart(e, field.type)}
title={field.label}
>
-
+
{ field.label }
))}
diff --git a/src/admin/components/formBuilder/FieldSettingsPanel.js b/src/admin/components/formBuilder/FieldSettingsPanel.js
index 85b5b35ef..a006b51d1 100644
--- a/src/admin/components/formBuilder/FieldSettingsPanel.js
+++ b/src/admin/components/formBuilder/FieldSettingsPanel.js
@@ -3,7 +3,11 @@
*/
import { __ } from '@wordpress/i18n';
-import { TextControl, CheckboxControl, SelectControl, TextareaControl } from '@wordpress/components';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Switch } from '@/components/ui/switch';
+import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';
+import { Textarea } from '@/components/ui/textarea';
import { FIELD_TYPES } from '../../config/fieldTypes';
import FormFieldOptions from './FormFieldOptions';
import './FieldSettingsPanel.css';
@@ -53,44 +57,54 @@ export default function FieldSettingsPanel({
-
handleChange('label', value)}
- help={ __('The display label for this field', 'formipay') }
- />
+
+
+
handleChange('label', e.target.value)}
+ />
+
{ __('The display label for this field', 'formipay') }
+
- handleChange('field_id', value)}
- help={ __('Unique identifier for this field (used in form data)', 'formipay') }
- />
+
+
+
handleChange('field_id', e.target.value)}
+ />
+
{ __('Unique identifier for this field (used in form data)', 'formipay') }
+
{ hasPlaceholder && (
- handleChange('placeholder', value)}
- />
+
+
+ handleChange('placeholder', e.target.value)}
+ />
+
) }
{ hasDefaultValue && (
- handleChange('default_value', value)}
- />
+
+
+ handleChange('default_value', e.target.value)}
+ />
+
) }
{ hasDescription && (
- handleChange('description', value)}
- help={ __('Optional help text displayed below the field', 'formipay') }
- rows={3}
- />
+
+
+
) }
{ hasOptions && (
@@ -102,26 +116,36 @@ export default function FieldSettingsPanel({
) }
{ hasGridColumns && (
- handleChange('option_grid_columns', parseInt(value))}
- />
+
+
+
+
) }
{ isRequired && (
- handleChange('is_required', value)}
- help={ __('User must fill this field before submitting', 'formipay') }
- />
+
+
+
+ handleChange('is_required', value)}
+ />
+
+
{ __('User must fill this field before submitting', 'formipay') }
+
) }
diff --git a/src/admin/components/formBuilder/FormCanvas.js b/src/admin/components/formBuilder/FormCanvas.js
index 40cc979b5..887ddb47c 100644
--- a/src/admin/components/formBuilder/FormCanvas.js
+++ b/src/admin/components/formBuilder/FormCanvas.js
@@ -3,8 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
-import { Icon } from '@wordpress/icons';
-import plus from '@wordpress/icons/build/plus';
+import { Add01Icon } from '@hugeicons/react';
import { DEFAULT_FIELD_CONFIG, generateFieldId } from '../../config/fieldTypes';
import FormField from './FormField';
import './FormCanvas.css';
@@ -61,7 +60,7 @@ export default function FormCanvas({
>
{fields.length === 0 ? (
-
+
{ __('Drag fields from the palette to build your form', 'formipay') }
diff --git a/src/admin/components/formBuilder/FormField.js b/src/admin/components/formBuilder/FormField.js
index 150529cea..3346200b0 100644
--- a/src/admin/components/formBuilder/FormField.js
+++ b/src/admin/components/formBuilder/FormField.js
@@ -3,10 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
-import { Icon } from '@wordpress/icons';
-import chevronUp from '@wordpress/icons/build/chevron-up';
-import chevronDown from '@wordpress/icons/build/chevron-down';
-import trash from '@wordpress/icons/build/trash';
+import { ArrowUp01Icon, ArrowDown01Icon, Delete02Icon } from '@hugeicons/react';
import { FIELD_TYPES } from '../../config/fieldTypes';
import './FormField.css';
@@ -52,7 +49,7 @@ export default function FormField({
disabled={!onMoveUp}
title={ __('Move Up', 'formipay') }
>
-
+
diff --git a/src/admin/components/formBuilder/FormFieldOptions.js b/src/admin/components/formBuilder/FormFieldOptions.js
index f9f9cc33c..73daa643e 100644
--- a/src/admin/components/formBuilder/FormFieldOptions.js
+++ b/src/admin/components/formBuilder/FormFieldOptions.js
@@ -3,10 +3,10 @@
*/
import { __ } from '@wordpress/i18n';
-import { TextControl, Button } from '@wordpress/components';
-import { Icon as WPIcon } from '@wordpress/icons';
-import plus from '@wordpress/icons/build/plus';
-import trash from '@wordpress/icons/build/trash';
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import { Label } from '@/components/ui/label';
+import { Add01Icon, Delete02Icon } from '@hugeicons/react';
export default function FormFieldOptions({ options = [], onChange, fieldType }) {
const handleAddOption = () => {
@@ -46,10 +46,10 @@ export default function FormFieldOptions({ options = [], onChange, fieldType })
}
>
+
{ __('Add Option', 'formipay') }
@@ -58,38 +58,45 @@ export default function FormFieldOptions({ options = [], onChange, fieldType })
{options.map((option, index) => (
-
handleUpdateOption(index, { label: value })}
- placeholder={__('Option label', 'formipay')}
- />
+
+
+ handleUpdateOption(index, { label: e.target.value })}
+ placeholder={__('Option label', 'formipay')}
+ />
+
- handleUpdateOption(index, { value: value })}
- placeholder={__('Optional custom value', 'formipay')}
- />
+
+
+ handleUpdateOption(index, { value: e.target.value })}
+ placeholder={__('Optional custom value', 'formipay')}
+ />
+
- handleUpdateOption(index, { amount: value })}
- placeholder={__('0', 'formipay')}
- step="0.01"
- />
+
+
+ handleUpdateOption(index, { amount: e.target.value })}
+ placeholder={__('0', 'formipay')}
+ step="0.01"
+ />
+
))}
diff --git a/src/admin/config/fieldTypes.js b/src/admin/config/fieldTypes.js
index 7236a7d8a..67bef4545 100644
--- a/src/admin/config/fieldTypes.js
+++ b/src/admin/config/fieldTypes.js
@@ -2,23 +2,42 @@
* Form Field Type Definitions
*/
+import {
+ TextFontIcon,
+ Link01Icon,
+ Mail01Icon,
+ TelephoneIcon,
+ HashtagIcon,
+ Calendar01Icon,
+ Calendar03Icon,
+ PaintBoardIcon,
+ DropdownFieldTypeIcon,
+ CheckmarkSquare01Icon,
+ RadioButtonIcon,
+ EyeIcon,
+ ParagraphIcon,
+ MinusSignIcon,
+ NextIcon,
+ Globe02Icon,
+} from '@hugeicons/core-free-icons';
+
export const FIELD_TYPES = {
- text: { label: 'Text', icon: 'text', category: 'input' },
- url: { label: 'URL', icon: 'link', category: 'input' },
- email: { label: 'Email', icon: 'email', category: 'input' },
- tel: { label: 'Telephone', icon: 'phone', category: 'input' },
- number: { label: 'Number', icon: 'number', category: 'input' },
- date: { label: 'Date', icon: 'calendar', category: 'input' },
- datetime: { label: 'Date & Time', icon: 'calendar-alt', category: 'input' },
- color: { label: 'Color', icon: 'art', category: 'input' },
- select: { label: 'Select Dropdown', icon: 'list-view', category: 'choice' },
- checkbox: { label: 'Checkbox', icon: 'checkbox', category: 'choice' },
- radio: { label: 'Radio', icon: 'radio', category: 'choice' },
- hidden: { label: 'Hidden', icon: 'hidden', category: 'advanced' },
- textarea: { label: 'Textarea', icon: 'document', category: 'input' },
- divider: { label: 'Divider', icon: 'minus', category: 'layout' },
- page_break: { label: 'Page Break', icon: 'page-break', category: 'layout' },
- country_list: { label: 'Preset: Country List', icon: 'globe', category: 'preset' },
+ text: { label: 'Text', icon: TextFontIcon, category: 'input' },
+ url: { label: 'URL', icon: Link01Icon, category: 'input' },
+ email: { label: 'Email', icon: Mail01Icon, category: 'input' },
+ tel: { label: 'Telephone', icon: TelephoneIcon, category: 'input' },
+ number: { label: 'Number', icon: HashtagIcon, category: 'input' },
+ date: { label: 'Date', icon: Calendar01Icon, category: 'input' },
+ datetime: { label: 'Date & Time', icon: Calendar03Icon, category: 'input' },
+ color: { label: 'Color', icon: PaintBoardIcon, category: 'input' },
+ select: { label: 'Select Dropdown', icon: DropdownFieldTypeIcon, category: 'choice' },
+ checkbox: { label: 'Checkbox', icon: CheckmarkSquare01Icon, category: 'choice' },
+ radio: { label: 'Radio', icon: RadioButtonIcon, category: 'choice' },
+ hidden: { label: 'Hidden', icon: EyeIcon, category: 'advanced' },
+ textarea: { label: 'Textarea', icon: ParagraphIcon, category: 'input' },
+ divider: { label: 'Divider', icon: MinusSignIcon, category: 'layout' },
+ page_break: { label: 'Page Break', icon: NextIcon, category: 'layout' },
+ country_list: { label: 'Preset: Country List', icon: Globe02Icon, category: 'preset' },
};
export const FIELD_CATEGORIES = {