Skip to content

Beautiful Open-Source Form Builder

Minimal theme (#882)

Julien Nahumd642d549f739
diff --git a/api/app/Models/Forms/Form.php b/api/app/Models/Forms/Form.php
index b1b3c1e17..5805ac86a 100644
--- a/api/app/Models/Forms/Form.php
+++ b/api/app/Models/Forms/Form.php
@@ -36,7 +36,7 @@ class Form extends Model implements CachableAttributes
public const BORDER_RADIUS = ['none', 'small', 'full'];
- public const THEMES = ['default', 'simple', 'notion'];
+ public const THEMES = ['default', 'simple', 'notion', 'minimal'];
public const WIDTHS = ['centered', 'full'];
diff --git a/client/components/forms/core/components/InputLabel.vue b/client/components/forms/core/components/InputLabel.vue
index a52f92ac5..05c5d722d 100644
--- a/client/components/forms/core/components/InputLabel.vue
+++ b/client/components/forms/core/components/InputLabel.vue
@@ -26,12 +26,16 @@ const props = defineProps({
uppercaseLabels: { type: Boolean, default: false },
required: { type: Boolean, default: false },
label: { type: String, required: true },
+ theme: { type: String, default: 'default' },
+ size: { type: String, default: 'md' },
ui: {type: Object, default: () => ({})}
})
// OPTIMIZED: Single computed following Nuxt UI pattern
const ui = computed(() => {
return tv(inputLabelTheme, props.ui)({
+ theme: props.theme,
+ size: props.size,
uppercaseLabels: props.uppercaseLabels
})
})
diff --git a/client/components/forms/core/components/InputWrapper.vue b/client/components/forms/core/components/InputWrapper.vue
index 5fcb3c24f..15cac9677 100644
--- a/client/components/forms/core/components/InputWrapper.vue
+++ b/client/components/forms/core/components/InputWrapper.vue
@@ -11,6 +11,8 @@
:required="required"
:native-for="id ? id : name"
:uppercase-labels="uppercaseLabels"
+ :theme="theme"
+ :size="resolvedSize"
:ui="ui?.label"
/>
</VTransition>
@@ -82,6 +84,7 @@ const props = defineProps({
required: { type: Boolean, default: false },
hasValidation: { type: Boolean, default: true },
// Theme configuration as strings for tailwind-variants
+ theme: {type: String, default: 'default'},
size: {type: String, default: null},
ui: {type: Object, default: () => ({})}
})
diff --git a/client/components/forms/heavy/MatrixInput.vue b/client/components/forms/heavy/MatrixInput.vue
index 3bc2d36cd..94b79d7f6 100644
--- a/client/components/forms/heavy/MatrixInput.vue
+++ b/client/components/forms/heavy/MatrixInput.vue
@@ -11,8 +11,11 @@
<td
v-for="column in columns"
:key="column"
- class="ltr:border-l rtl:border-r rtl:!border-l-0 max-w-24 overflow-hidden"
- :class="ui.cell()"
+ :class="[
+ resolvedTheme === 'minimal' ? '' : 'ltr:border-l rtl:border-r rtl:!border-l-0',
+ 'max-w-24 overflow-hidden',
+ ui.cell()
+ ]"
>
<div :class="ui.headerCell()">
{{ column }}
@@ -40,7 +43,7 @@
:tabindex="props.disabled ? -1 : 0"
:aria-checked="compVal && compVal[row] === column"
:class="[
- 'ltr:border-l rtl:border-r rtl:!border-l-0',
+ resolvedTheme === 'minimal' ? '' : 'ltr:border-l rtl:border-r rtl:!border-l-0',
ui.cell(),
ui.cellHover(),
ui.option()
diff --git a/client/components/forms/heavy/PhoneInput.vue b/client/components/forms/heavy/PhoneInput.vue
index 09048d743..2a8bda748 100644
--- a/client/components/forms/heavy/PhoneInput.vue
+++ b/client/components/forms/heavy/PhoneInput.vue
@@ -57,6 +57,12 @@
</div>
</template>
</v-select>
+ <div
+ v-if="resolvedTheme === 'minimal'"
+ :class="ui.separator()"
+ class="w-0 self-stretch"
+ aria-hidden="true"
+ />
<input
v-model="inputVal"
type="text"
diff --git a/client/components/forms/useFormInput.js b/client/components/forms/useFormInput.js
index 4d5ea8a05..cef8c30a5 100644
--- a/client/components/forms/useFormInput.js
+++ b/client/components/forms/useFormInput.js
@@ -104,6 +104,8 @@ export function useFormInput(props, context, options = {}) {
wrapperProps[key] = props[key]
}
})
+ // Add resolved theme to wrapper props
+ wrapperProps.theme = resolvedTheme.value
return wrapperProps
})
diff --git a/client/components/open/forms/components/form-components/FormCustomization.vue b/client/components/open/forms/components/form-components/FormCustomization.vue
index 31934f11b..4dcf0b945 100644
--- a/client/components/open/forms/components/form-components/FormCustomization.vue
+++ b/client/components/open/forms/components/form-components/FormCustomization.vue
@@ -13,6 +13,7 @@
{ name: 'Default', value: 'default' },
{ name: 'Notion', value: 'notion' },
{ name: 'Simple (no shadows)', value: 'simple' },
+ { name: 'Minimal', value: 'minimal' },
]"
:form="form"
label="Form Theme"
diff --git a/client/css/app.css b/client/css/app.css
index 50ce27d20..280c1811c 100644
--- a/client/css/app.css
+++ b/client/css/app.css
@@ -200,11 +200,11 @@
}
h1 {
- @apply text-2xl sm:text-3xl font-extrabold;
+ @apply text-2xl sm:text-3xl font-semibold;
}
h2 {
- @apply text-2xl font-extrabold;
+ @apply text-2xl font-semibold;
}
a {
diff --git a/client/lib/forms/themes/checkbox-icon.theme.js b/client/lib/forms/themes/checkbox-icon.theme.js
index ce053f950..9a5e5077c 100644
--- a/client/lib/forms/themes/checkbox-icon.theme.js
+++ b/client/lib/forms/themes/checkbox-icon.theme.js
@@ -23,6 +23,9 @@ export const checkboxIconTheme = {
},
notion: {
uncheckedIcon: 'text-notion-input-border dark:text-notion-input-borderDark'
+ },
+ minimal: {
+ uncheckedIcon: 'text-neutral-400 dark:text-neutral-600'
}
},
size: {
diff --git a/client/lib/forms/themes/code-input.theme.js b/client/lib/forms/themes/code-input.theme.js
index a51b51095..3801840f7 100644
--- a/client/lib/forms/themes/code-input.theme.js
+++ b/client/lib/forms/themes/code-input.theme.js
@@ -10,6 +10,7 @@ export const codeInputTheme = {
variants: {
theme: {
default: { container: 'border border-neutral-300 dark:border-neutral-600' },
+ minimal: { container: 'border-2 border-transparent bg-neutral-100 dark:bg-notion-dark-light' },
notion: { container: 'border border-notion-input-border dark:border-notion-input-borderDark' }
},
size: {
diff --git a/client/lib/forms/themes/date-input.theme.js b/client/lib/forms/themes/date-input.theme.js
index 20d92e500..ddb83ed6e 100644
--- a/client/lib/forms/themes/date-input.theme.js
+++ b/client/lib/forms/themes/date-input.theme.js
@@ -31,6 +31,14 @@ export const dateInputTheme = {
'text-neutral-900 dark:text-neutral-100',
'focus-visible:ring-form/40'
]
+ },
+ minimal: {
+ input: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300',
+ 'focus-visible:ring-0 focus-visible:border-form'
+ ]
}
},
size: {
diff --git a/client/lib/forms/themes/file-input.theme.js b/client/lib/forms/themes/file-input.theme.js
index 1a7b11f3d..c1014839b 100644
--- a/client/lib/forms/themes/file-input.theme.js
+++ b/client/lib/forms/themes/file-input.theme.js
@@ -14,6 +14,7 @@ export const fileInputTheme = {
variants: {
theme: {
default: { container: 'border-neutral-300 dark:border-neutral-600' },
+ minimal: { container: 'border-2 border-transparent bg-neutral-100 dark:bg-notion-dark-light text-neutral-700 dark:text-neutral-300 focus:ring-2 focus:ring-form/60' },
notion: {
container: 'border-notion-input-border dark:border-notion-input-borderDark bg-notion-input-background dark:bg-notion-dark-light text-neutral-900 dark:text-neutral-100'
}
diff --git a/client/lib/forms/themes/flat-select-input.theme.js b/client/lib/forms/themes/flat-select-input.theme.js
index 9f57c6326..a7e301cf9 100644
--- a/client/lib/forms/themes/flat-select-input.theme.js
+++ b/client/lib/forms/themes/flat-select-input.theme.js
@@ -53,6 +53,19 @@ export const flatSelectInputTheme = {
'space-x-2'
],
hover: 'hover:backdrop-brightness-95'
+ },
+ minimal: {
+ container: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300'
+ ],
+ option: [
+ 'cursor-pointer',
+ 'border-neutral-200 dark:border-neutral-700',
+ 'gap-x-2'
+ ],
+ hover: 'hover:bg-neutral-200/50 dark:hover:bg-neutral-900'
}
},
size: {
diff --git a/client/lib/forms/themes/image-input.theme.js b/client/lib/forms/themes/image-input.theme.js
index 21a12790f..057b7c3ff 100644
--- a/client/lib/forms/themes/image-input.theme.js
+++ b/client/lib/forms/themes/image-input.theme.js
@@ -19,6 +19,12 @@ export const imageInputTheme = {
'shadow-xs'
]
},
+ minimal: {
+ button: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 text-neutral-700 dark:bg-notion-dark-light dark:text-neutral-300'
+ ]
+ },
notion: {
button: [
'border border-notion-input-border dark:border-notion-input-borderDark',
diff --git a/client/lib/forms/themes/input-label.theme.js b/client/lib/forms/themes/input-label.theme.js
index bd4102721..c3d084646 100644
--- a/client/lib/forms/themes/input-label.theme.js
+++ b/client/lib/forms/themes/input-label.theme.js
@@ -6,21 +6,51 @@ export const inputLabelTheme = {
slots: {
label: [
'input-label',
- 'text-neutral-700 dark:text-neutral-300 font-semibold'
+ 'text-neutral-700 dark:text-neutral-300'
],
requiredDot: 'text-red-500 required-dot'
},
variants: {
+ theme: {
+ default: {
+ label: 'font-semibold'
+ },
+ simple: {
+ label: 'font-semibold'
+ },
+ notion: {
+ label: 'font-semibold'
+ },
+ minimal: {
+ label: 'font-medium text-neutral-600 dark:text-neutral-400'
+ }
+ },
+ size: {
+ xs: {
+ label: 'text-xs'
+ },
+ sm: {
+ label: 'text-xs'
+ },
+ md: {
+ label: 'text-sm'
+ },
+ lg: {
+ label: 'text-base'
+ }
+ },
uppercaseLabels: {
true: {
- label: 'uppercase text-xs'
+ label: 'uppercase'
},
false: {
- label: 'text-sm/none'
+ label: 'leading-none'
}
}
},
defaultVariants: {
+ theme: 'default',
+ size: 'md',
uppercaseLabels: false
}
}
\ No newline at end of file
diff --git a/client/lib/forms/themes/matrix-input.theme.js b/client/lib/forms/themes/matrix-input.theme.js
index 0b22923b6..0dd3e381d 100644
--- a/client/lib/forms/themes/matrix-input.theme.js
+++ b/client/lib/forms/themes/matrix-input.theme.js
@@ -40,6 +40,15 @@ export const matrixInputTheme = {
cell: 'border-notion-input-border dark:border-notion-input-borderDark',
cellHover: 'hover:backdrop-brightness-95',
option: 'hover:backdrop-brightness-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-form/40 focus-visible:ring-inset'
+ },
+ minimal: {
+ container: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light'
+ ],
+ cell: 'border-transparent',
+ cellHover: 'hover:bg-neutral-200/50 dark:hover:bg-neutral-900',
+ option: 'border-0 focus-visible:outline focus-visible:outline-2 focus-visible:outline-form focus-visible:outline-offset-[-2px] focus-visible:ring-0'
}
},
size: {
diff --git a/client/lib/forms/themes/mention-input.theme.js b/client/lib/forms/themes/mention-input.theme.js
index c7eac8143..3acafe850 100644
--- a/client/lib/forms/themes/mention-input.theme.js
+++ b/client/lib/forms/themes/mention-input.theme.js
@@ -15,6 +15,13 @@ export const mentionInputTheme = {
default: {
input: 'border-neutral-300 dark:border-neutral-600 bg-white text-neutral-700 dark:bg-notion-dark-light dark:text-neutral-300'
},
+ minimal: {
+ input: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300'
+ ]
+ },
notion: {
input: 'border-notion-input-border dark:border-notion-input-borderDark bg-notion-input-background dark:bg-notion-dark-light text-neutral-900 dark:text-neutral-100'
}
diff --git a/client/lib/forms/themes/option-selector-input.theme.js b/client/lib/forms/themes/option-selector-input.theme.js
index cb08471fe..195941339 100644
--- a/client/lib/forms/themes/option-selector-input.theme.js
+++ b/client/lib/forms/themes/option-selector-input.theme.js
@@ -18,6 +18,9 @@ export const optionSelectorInputTheme = {
default: {
option: ['border-neutral-300', 'hover:bg-neutral-100']
},
+ minimal: {
+ option: ['border-2 border-transparent', 'bg-neutral-100', 'hover:bg-neutral-200/50']
+ },
notion: {
option: ['border-notion-input-border dark:border-notion-input-borderDark', 'hover:backdrop-brightness-95']
}
diff --git a/client/lib/forms/themes/payment-input.theme.js b/client/lib/forms/themes/payment-input.theme.js
index 4eace23c7..b3ed07c48 100644
--- a/client/lib/forms/themes/payment-input.theme.js
+++ b/client/lib/forms/themes/payment-input.theme.js
@@ -19,6 +19,17 @@ export const paymentInputTheme = {
'bg-neutral-50 dark:bg-neutral-800'
]
},
+ minimal: {
+ container: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300'
+ ],
+ amountBar: [
+ 'border-2 border-transparent',
+ 'bg-neutral-200/50 dark:bg-neutral-900'
+ ]
+ },
notion: {
container: [
'border border-notion-input-border dark:border-notion-input-borderDark',
diff --git a/client/lib/forms/themes/phone-input.theme.js b/client/lib/forms/themes/phone-input.theme.js
index c60996b07..c75cbfc9b 100644
--- a/client/lib/forms/themes/phone-input.theme.js
+++ b/client/lib/forms/themes/phone-input.theme.js
@@ -14,6 +14,8 @@ export const phoneInputTheme = {
'focus:outline-hidden',
'placeholder-neutral-400 dark:placeholder-neutral-500'
]
+ ,
+ separator: ''
},
variants: {
theme: {
@@ -37,6 +39,15 @@ export const phoneInputTheme = {
'text-neutral-900 dark:text-neutral-100',
'focus:ring-2 focus:ring-form/40 focus:border-transparent'
]
+ },
+ minimal: {
+ input: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300',
+ 'focus:ring-0 focus:border-form'
+ ],
+ separator: 'ltr:border-l rtl:border-r border-neutral-200 dark:border-neutral-700'
}
},
size: {
diff --git a/client/lib/forms/themes/radio-button-icon.theme.js b/client/lib/forms/themes/radio-button-icon.theme.js
index 5121bae00..45db98c74 100644
--- a/client/lib/forms/themes/radio-button-icon.theme.js
+++ b/client/lib/forms/themes/radio-button-icon.theme.js
@@ -23,6 +23,9 @@ export const radioButtonIconTheme = {
},
notion: {
uncheckedIcon: 'text-notion-input-border dark:text-notion-input-borderDark'
+ },
+ minimal: {
+ uncheckedIcon: 'text-neutral-400 dark:text-neutral-600'
}
},
size: {
diff --git a/client/lib/forms/themes/rating-input.theme.js b/client/lib/forms/themes/rating-input.theme.js
index 90966147c..255ae906c 100644
--- a/client/lib/forms/themes/rating-input.theme.js
+++ b/client/lib/forms/themes/rating-input.theme.js
@@ -7,6 +7,11 @@ export const ratingInputTheme = {
star: 'cursor-pointer inline-block text-neutral-200 dark:text-neutral-700 focus-visible:ring-2 focus-visible:ring-form/100 focus-visible:rounded-full focus-visible:outline-none'
},
variants: {
+ theme: {
+ minimal: {
+ star: 'border-2 border-transparent focus-visible:ring-0 focus-visible:border-form rounded-full'
+ }
+ },
size: {
xs: { icon: 'w-4 h-4' },
sm: { icon: 'w-6 h-6' },
diff --git a/client/lib/forms/themes/rich-text-area-input.theme.js b/client/lib/forms/themes/rich-text-area-input.theme.js
index 645c521fd..75992908e 100644
--- a/client/lib/forms/themes/rich-text-area-input.theme.js
+++ b/client/lib/forms/themes/rich-text-area-input.theme.js
@@ -28,6 +28,13 @@ export const richTextAreaInputTheme = {
'bg-notion-input-background dark:bg-notion-dark-light',
'text-neutral-900 dark:text-neutral-100'
]
+ },
+ minimal: {
+ container: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300',
+ ]
}
},
size: {
diff --git a/client/lib/forms/themes/scale-input.theme.js b/client/lib/forms/themes/scale-input.theme.js
index a4218fd9d..dbde54abe 100644
--- a/client/lib/forms/themes/scale-input.theme.js
+++ b/client/lib/forms/themes/scale-input.theme.js
@@ -41,6 +41,15 @@ export const scaleInputTheme = {
'bg-notion-input-background dark:bg-notion-dark-light'
],
buttonHover: 'hover:brightness-95'
+ },
+ minimal: {
+ button: [
+ 'border-2 border-transparent'
+ ],
+ buttonUnselected: [
+ 'bg-neutral-100 dark:bg-notion-dark-light'
+ ],
+ buttonHover: 'hover:bg-neutral-200/50 dark:hover:bg-neutral-900'
}
},
size: {
diff --git a/client/lib/forms/themes/signature-input.theme.js b/client/lib/forms/themes/signature-input.theme.js
index a1842f1bc..2fa2c40f1 100644
--- a/client/lib/forms/themes/signature-input.theme.js
+++ b/client/lib/forms/themes/signature-input.theme.js
@@ -29,6 +29,13 @@ export const signatureInputTheme = {
'bg-notion-input-background dark:bg-notion-dark-light',
'text-neutral-900 dark:text-neutral-100'
]
+ },
+ minimal: {
+ container: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300'
+ ]
}
},
size: {
diff --git a/client/lib/forms/themes/slider-input.theme.js b/client/lib/forms/themes/slider-input.theme.js
index d3d3ba1ce..fb35be50c 100644
--- a/client/lib/forms/themes/slider-input.theme.js
+++ b/client/lib/forms/themes/slider-input.theme.js
@@ -16,6 +16,9 @@ export const sliderInputTheme = {
},
notion: {
slider: 'focus-visible:ring-form/40'
+ },
+ minimal: {
+ slider: 'focus-visible:ring-2 focus-visible:ring-form/60'
}
},
size: {
diff --git a/client/lib/forms/themes/text-area-input.theme.js b/client/lib/forms/themes/text-area-input.theme.js
index 6afd7494e..13c653d50 100644
--- a/client/lib/forms/themes/text-area-input.theme.js
+++ b/client/lib/forms/themes/text-area-input.theme.js
@@ -37,6 +37,14 @@ export const textAreaInputTheme = {
'text-neutral-900 dark:text-neutral-100',
'focus:ring-2 focus:ring-form/40 focus:border-transparent'
]
+ },
+ minimal: {
+ input: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300',
+ 'focus:ring-0 focus:border-form'
+ ]
}
},
size: {
diff --git a/client/lib/forms/themes/text-input.theme.js b/client/lib/forms/themes/text-input.theme.js
index a52423561..7168829e2 100644
--- a/client/lib/forms/themes/text-input.theme.js
+++ b/client/lib/forms/themes/text-input.theme.js
@@ -38,6 +38,14 @@ export const textInputTheme = {
'text-neutral-900 dark:text-neutral-100',
'focus:ring-2 focus:ring-form/40 focus:border-transparent'
]
+ },
+ minimal: {
+ input: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light',
+ 'text-neutral-700 dark:text-neutral-300',
+ 'focus:ring-0 focus:border-form'
+ ]
}
},
size: {
diff --git a/client/lib/forms/themes/uploaded-file.theme.js b/client/lib/forms/themes/uploaded-file.theme.js
index 88c674031..643ecd45f 100644
--- a/client/lib/forms/themes/uploaded-file.theme.js
+++ b/client/lib/forms/themes/uploaded-file.theme.js
@@ -8,6 +8,7 @@ export const uploadedFileTheme = {
variants: {
theme: {
default: { root: 'border-neutral-300 dark:border-neutral-600 dark:bg-notion-dark-light' },
+ minimal: { root: 'border-2 border-transparent bg-neutral-100 dark:bg-notion-dark-light' },
notion: { root: 'border-notion-input-border dark:border-notion-input-borderDark dark:bg-notion-dark-light rounded-xs' }
}
},
diff --git a/client/lib/forms/themes/v-select.theme.js b/client/lib/forms/themes/v-select.theme.js
index 89e0f05b9..b1daf938c 100644
--- a/client/lib/forms/themes/v-select.theme.js
+++ b/client/lib/forms/themes/v-select.theme.js
@@ -80,6 +80,14 @@ export const vSelectTheme = {
],
chevronGradient: 'bg-gradient-to-r from-transparent to-notion-input-background dark:to-notion-dark-light',
chevronContainer: 'bg-notion-input-background dark:bg-notion-dark-light'
+ },
+ minimal: {
+ anchor: [
+ 'border-2 border-transparent',
+ 'bg-neutral-100 dark:bg-notion-dark-light'
+ ],
+ chevronGradient: 'bg-gradient-to-r from-transparent to-neutral-100 dark:to-notion-dark-light',
+ chevronContainer: 'bg-neutral-100 dark:bg-notion-dark-light'
}
},
size: {