diff --git a/components/FormBuilderFieldSettingsModal.vue b/components/FormBuilderFieldSettingsModal.vue index b030566..1222ebf 100644 --- a/components/FormBuilderFieldSettingsModal.vue +++ b/components/FormBuilderFieldSettingsModal.vue @@ -306,93 +306,6 @@ - -
-
-

- - Layout & Size -

-

Control how this field appears in your form

-
- -
-
- - - -
-
- -
-
-
-
-
- - -
-
- {{ option.name }} - - Recommended - -
-
{{ option.description }}
-
{{ option.useCase }}
-
-
-
- - -
- - - - -
-
-
-
-
- {{ getCurrentGridColumns() }}/12 columns ({{ configModel.width || '100%' }}) -
-
-
-
-
-
@@ -2459,6 +2372,61 @@ if (this.element.querySelector('.file-upload')) {
+ +
+
+
+

+ + Layout & Size +

+

Control how this field appears in your form

+
+ +
+
+ + + +
+ +
+ +
+ + +
+
+
+
+
+
+
+ {{ getCurrentWidthOption()?.name || 'Custom' }} ({{ getComponentWidthPercent() }}%) +
+
+
+
+
+
+
+
@@ -2931,6 +2899,11 @@ const availableTabs = computed(() => { { id: 'basic', label: 'Basic Settings', icon: 'heroicons:cog-6-tooth' } ] + // Add layout tab for components that support width settings + if (showField('width')) { + tabs.push({ id: 'layout', label: 'Layout', icon: 'heroicons:squares-2x2' }) + } + if (hasOptions.value) { tabs.push({ id: 'options', label: 'Options', icon: 'heroicons:list-bullet' }) } @@ -4082,6 +4055,84 @@ const getDefaultPropsForType = (type) => { @apply flex justify-between items-center py-1; } +/* Compact Width Selection - New Styles */ +.width-selector-compact { + @apply space-y-4; +} + +.width-buttons { + @apply flex flex-wrap gap-2; +} + +.width-button { + @apply flex-1 min-w-0 px-3 py-2 border border-gray-200 rounded-lg hover:border-blue-300 hover:bg-blue-50 transition-all duration-200 cursor-pointer text-center relative; +} + +.width-button.active { + @apply border-blue-500 bg-blue-50 ring-1 ring-blue-200; +} + +.width-button.recommended::before { + content: ''; + @apply absolute -top-1 -right-1 w-3 h-3 bg-green-500 rounded-full; +} + +.width-button.active.recommended { + @apply border-green-500 bg-green-50 ring-1 ring-green-200; +} + +.width-visual { + @apply w-full h-1.5 bg-gray-100 rounded-sm mb-2 overflow-hidden; +} + +.width-bar { + @apply h-full bg-blue-500 rounded-sm transition-all duration-300; +} + +.width-button.active .width-bar { + @apply bg-blue-600; +} + +.width-button.recommended .width-bar { + @apply bg-green-500; +} + +.width-button.active.recommended .width-bar { + @apply bg-green-600; +} + +.width-label { + @apply text-sm font-medium text-gray-700; +} + +.width-button.active .width-label { + @apply text-blue-700; +} + +.width-button.recommended .width-label { + @apply text-green-700; +} + +.width-preview { + @apply mt-4 p-3 bg-gray-50 rounded-lg border; +} + +.preview-container { + @apply w-full bg-white rounded border p-2 mb-2; +} + +.preview-field { + @apply transition-all duration-300; +} + +.preview-input { + @apply w-full h-8 border border-gray-100 rounded px-2 bg-blue-600; +} + +.preview-info { + @apply text-sm text-gray-600 text-center; +} + .feedback-label { @apply text-sm font-medium text-gray-600; }