Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pref: optimize the help style of some formkit components #5521

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions ui/src/formkit/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};
Expand Down Expand Up @@ -47,10 +47,14 @@ const theme: Record<string, Record<string, string>> = {
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"),
help: `${boxClassification.help} px-2`,
},
range: {
...textClassification,
Expand Down Expand Up @@ -83,7 +87,7 @@ const theme: Record<string, Record<string, string>> = {
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",
Expand All @@ -98,7 +102,7 @@ const theme: Record<string, Record<string, string>> = {
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: {
Expand Down