From 28fc5334237d2b076faca1b1b169758fe28ab2ce Mon Sep 17 00:00:00 2001 From: LIlGG <1103069291@qq.com> Date: Mon, 18 Mar 2024 15:37:29 +0800 Subject: [PATCH 1/2] pref: optimize the help style of some formkit components --- ui/src/formkit/theme.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/src/formkit/theme.ts b/ui/src/formkit/theme.ts index 70c9a91ad1..dd2934ac97 100644 --- a/ui/src/formkit/theme.ts +++ b/ui/src/formkit/theme.ts @@ -14,7 +14,7 @@ const boxClassification = { "group border border-gray-300 rounded-base px-2 py-2 focus-within:border-primary max-w-lg", wrapper: "flex items-center mb-1 cursor-pointer group-[.formkit-fieldset]:px-2", - help: "mb-2 mt-0 px-2", + help: "mb-2 mt-0", input: "form-check-input mr-2 bg-white", inner: "flex items-center", }; @@ -51,6 +51,7 @@ const theme: Record> = { radio: { ...boxClassification, input: boxClassification.input.replace("rounded-sm", "rounded-full"), + help: `${boxClassification.help} px-2`, }, range: { ...textClassification, @@ -83,7 +84,7 @@ const theme: Record> = { legend: `${textClassification.label} px-2`, fieldset: boxClassification.fieldset, wrapper: boxClassification.wrapper, - help: boxClassification.wrapper, + help: `${boxClassification.wrapper} mb-2`, inner: "flex flex-col gap-4", items: "flex flex-col w-full gap-2 rounded-base", item: "border rounded-base grid grid-cols-12 focus-within:border-primary transition-all overflow-visible focus-within:shadow-sm", @@ -98,7 +99,7 @@ const theme: Record> = { legend: `${textClassification.label} px-2`, fieldset: boxClassification.fieldset, wrapper: boxClassification.wrapper, - help: boxClassification.wrapper, + help: `${boxClassification.wrapper} mb-2`, inner: "flex flex-col px-2 divide-y divide-gray-100", }, tagSelect: { From 72d434d574368f55744e466f556505d033aa5bb6 Mon Sep 17 00:00:00 2001 From: LIlGG <1103069291@qq.com> Date: Thu, 21 Mar 2024 17:22:53 +0800 Subject: [PATCH 2/2] custom checkbox wrapper --- ui/src/formkit/theme.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/formkit/theme.ts b/ui/src/formkit/theme.ts index dd2934ac97..ef3b10a169 100644 --- a/ui/src/formkit/theme.ts +++ b/ui/src/formkit/theme.ts @@ -47,7 +47,10 @@ const theme: Record> = { fileItem: "block flex text-gray-800 text-sm mb-1", fileRemove: "ml-auto text-blue-500 text-sm", }, - checkbox: boxClassification, + checkbox: { + ...boxClassification, + wrapper: "flex items-center mb-1 cursor-pointer", + }, radio: { ...boxClassification, input: boxClassification.input.replace("rounded-sm", "rounded-full"),