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
Add uncontained section design #11464
base: 3.x
Are you sure you want to change the base?
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@divdax, could you rework this to contained(false)
, just like already exists for wizard, tabs and others?
jo 👍 |
@zepfietje section is now using CanBeContained trait. |
packages/support/resources/views/components/section/index.blade.php
Outdated
Show resolved
Hide resolved
:contained="$isContained()" | ||
:compact="$isCompact()" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sort alphabetically :)
@@ -6,6 +6,7 @@ | |||
'aside' => false, | |||
'collapsed' => false, | |||
'collapsible' => false, | |||
'contained' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n
comes after m
;)
match ($aside) { | ||
true => 'fi-aside grid grid-cols-1 items-start gap-x-6 gap-y-4 md:grid-cols-3', | ||
false => 'rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10', | ||
false => $contained ? 'rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10' : '', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it once more, maybe it's easier to maintain if we got rid of the match expression and used two separate array items instead. One for the fi-aside
with a condition as the value and then the other one for contained non-aside. Not sure if that explanation is clear? 😂
@@ -62,7 +63,7 @@ | |||
'cursor-pointer' => $collapsible, | |||
match ($compact) { | |||
true => 'px-4 py-2.5', | |||
false => 'px-6 py-4', | |||
false => ! $contained ? 'py-4' : 'px-6 py-4', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you split these into separate array items too?
Also, is the vertical padding needed when uncontained?
@@ -163,10 +164,10 @@ | |||
<div | |||
@class([ | |||
'fi-section-content', | |||
'rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10' => $aside, | |||
'rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10' => $aside && (! $minimal), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like $minimal
was forgotten during the refactor?
match ($compact) { | ||
true => 'p-4', | ||
false => 'p-6', | ||
false => ! $contained ? 'pt-4' : 'p-6', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also get rid of the match expression here, because this gets quite unreadable otherwise. 🙂
@zepfietje can we remove the border under the header too? or perhaps only apply if its collapsible. |
Still going to do a visual review after the code review, and the border is one thing for sure that I'm still debating. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@divdax, could you merge 3.x into this PR's branch and add support for the recently introduced section footer actions?
@zepfietje i did the refactor. looking into the footer actions this weekend (hopefully) // edit: here an example why i used the border. Also looks better when using heading + description. |
# Conflicts: # packages/forms/src/Components/Section.php # packages/support/resources/views/components/section/index.blade.php
@zepfietje merged 3.x and updated footer classes. |
Looking great, nice work Heiko! Been missing this for years. |
Could you guys provide some context on how you're using uncontained sections, @divdax @ralphjsmit? Would help me in reviewing the design in this PR. |
Some examples that I do remember are e.g. inside a modal on a white area where you don't want to have the card/another border for the content. Just a simple heading/description/icon to distinguish on a page would be good. But mainly just serving as a visual indicator of splitting up the page without needing an indent/border/white background. |
I often use sections in modals to save space and create a cleaner look. When a section is within another "container" i usually don't need a second box. Used filament forms standalone on many pages where i placed the form in an already styled container. idea: |
This is already one of the main goals for v4. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@divdax, I've done some more research about when to use uncontained sections and have come to the conclusion that it's best to remove the border below the header and above the footer too. Could you update the PR so I can do a proper final review? 🙂
Hey @divdax, are you able to finish this PR? |
@zepfietje i know this can be achieved with css for now, but i can take his work and apply the requested changes if you wish... i'm kinda needing that too to clean up some code at my end. |
Yeah, please go ahead @saade, since this PR has been stale for a while now. |
@zepfietje i was on holidays. 🏖️ not sorry 😅 |
No worries, @divdax! |
@divdax i didnt started yet, lmk if you want to continue with your work |
Yeah let us know, @divdax, then I can reopen your PR. |
@zepfietje i'll take a look after work and make the final touches. i think it's just the heading border i have to remove. // edit: Border removed when contained = false |
Thanks, @divdax! |
@zepfietje yes |
@zepfietje dumdidumm 👀😬 |
false => 'rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10', | ||
}, | ||
'fi-aside grid grid-cols-1 items-start gap-x-6 gap-y-4 md:grid-cols-3' => $aside, | ||
'rounded-xl bg-white shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10' => $contained, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right?
The previously false
match arm only has a $contained
condition here.
@divdax "dumdidumm". 😂 |
Description
Extended Form Section with
->minimal()
for a minimalistic style.->minimal()
or maybe...
This could be useful if someone wants to use a self-styled component (not just the section) without removing all styles:
->compact(styles: false)
What do you think?
Code style
composer cs
command has been run.Testing
Documentation