From f100135f33d27ed9b7b64e690e3c137b51b31b93 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Fri, 28 Jun 2024 13:43:38 +0200 Subject: [PATCH] move classes --- resources/js/components/form/Hint.vue | 16 ++++++++++++++ resources/js/components/form/Label.vue | 19 +++++++++++++++++ resources/js/components/form/Text.vue | 17 ++++++--------- resources/js/components/form/Textarea.vue | 26 +++++++++++------------ resources/js/composables/useFieldSize.js | 9 ++++++++ 5 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 resources/js/components/form/Hint.vue create mode 100644 resources/js/components/form/Label.vue diff --git a/resources/js/components/form/Hint.vue b/resources/js/components/form/Hint.vue new file mode 100644 index 00000000..27189d21 --- /dev/null +++ b/resources/js/components/form/Hint.vue @@ -0,0 +1,16 @@ + + + diff --git a/resources/js/components/form/Label.vue b/resources/js/components/form/Label.vue new file mode 100644 index 00000000..c146a3d4 --- /dev/null +++ b/resources/js/components/form/Label.vue @@ -0,0 +1,19 @@ + + + diff --git a/resources/js/components/form/Text.vue b/resources/js/components/form/Text.vue index a25a6ea0..de93936f 100644 --- a/resources/js/components/form/Text.vue +++ b/resources/js/components/form/Text.vue @@ -1,9 +1,6 @@ @@ -31,6 +25,9 @@ diff --git a/resources/js/composables/useFieldSize.js b/resources/js/composables/useFieldSize.js index db02106c..f30c4926 100644 --- a/resources/js/composables/useFieldSize.js +++ b/resources/js/composables/useFieldSize.js @@ -16,6 +16,12 @@ export default function () { const defaultFieldClass = 'border-2 p-2 rounded-lg bg-gray-700 border-gray-600 text-gray-300 border-solid'; + const fieldHeight = 'group-[.field-base]:h-[35px] group-[.field-sm]:h-[23px]'; + const fieldAppearance = + 'group-[.field-base]:border-2 group-[.field-sm]:border border-gray-600 border-solid text-gray-300 bg-gray-700 leading-none rounded-lg group-[.field-base]:text-sm group-[.field-sm]:text-xs'; + + const paddingX = 'group-[.field-base]:px-2 group-[.field-sm]:px-1'; + function labelClass(size) { return sizes[size ? size : 'default'].label; } @@ -28,5 +34,8 @@ export default function () { labelClass, fieldClass, defaultFieldClass, + fieldHeight, + fieldAppearance, + paddingX, }; }