-
Notifications
You must be signed in to change notification settings - Fork 49
Form layout—Components (HDS-4885) #2898
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f52c81e
to
1cc5dd1
Compare
c4ccb5d
to
dcc2031
Compare
packages/components/src/components/hds/form/field-group/index.hbs
Outdated
Show resolved
Hide resolved
315ca62
to
df060d0
Compare
@KristinLBradley This PR seems close to being merged to |
…e for tool-versions
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.
Nothing blocking! Just a few small comments.
showcase/app/components/mock/app/main/generic-form/partials/account-signup.gts
Outdated
Show resolved
Hide resolved
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
|
||
import type { TemplateOnlyComponent } from '@ember/component/template-only'; |
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.
Suggestion: not sure if this is out of scope, but could any of these more "real" examples have validation?
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.
That seems likely a bit out of scope as these are meant to demonstrate layouts.
const MockAppMainGenericFormPartialsActions: TemplateOnlyComponent<MockAppMainGenericFormPartialsActionsSignature> = | ||
<template> | ||
{{#if @extraText}} | ||
<HdsLayoutFlex @gap="24" @align="center" ...attributes> |
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.
Question: should this use the Hds::Form::Footer
component?
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.
@didoo what do you think? This example seemed too custom to me, so I left it as is when I was adding the Form::Footer
.
showcase/app/components/mock/app/main/generic-form/partials/add-policy.gts
Outdated
Show resolved
Hide resolved
showcase/app/components/mock/app/main/generic-form/partials/add-policy.gts
Outdated
Show resolved
Hide resolved
showcase/app/components/mock/app/main/generic-form/partials/add-policy.gts
Outdated
Show resolved
Hide resolved
showcase/app/components/mock/app/main/generic-form/partials/add-user.gts
Outdated
Show resolved
Hide resolved
form: 'custom width / form', | ||
'header+section': 'custom width / header+section', | ||
section: 'custom width / section', | ||
// TODO! |
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.
Should this be done? or is it for a follow up ticket?
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.
@didoo What do you think? We don't have a real option for a custom width applied to just a single Form::Section
.
Custom width set via local CSS class only at section level (not at header/separator) | ||
{{else if (eq this.customWidthMode "section")}} | ||
Custom width set via local CSS class only at section level (not at header/separator) | ||
{{! TODO! }} |
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.
note: Theres still a couple todos in this file
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.
@didoo Do you think these TODOs here are really necessary?
Co-authored-by: Dylan Hyun <[email protected]>
16c47fa
Co-authored-by: Lee White <[email protected]>
📌 Summary
If merged, this PR adds
Form
layout components to HDS.👉 Showcase: https://hds-showcase-git-kristin-hds-4885-form-layout-d00037-hashicorp.vercel.app/components/form/layout
Related:
🛠️ Detailed description
Changes:
Form
component with@tag
prop.FormHeader
component with@hasMaxWidth
propFormHeaderTitle
component with@tag
&@size
propsFormHeaderDescription
component.FormSection
component with@hasMaxWidth
&@hasBorder
propsFormSectionHeader
componentFormSectionHeaderTitle
component with@tag
&@size
propsFormSectionHeaderDescription
component.FormSectionFieldGroup
component based offLayout::Flex
component which exposes@direction
prop & includes responsive behavior to stack Fields at screen width below 768pxFormSeparator
component with@hasMaxWidth
propComponent structure in use:
Form
FormHeader
FormHeaderTitle
FormHeaderDescription
FormSection
FormSectionHeader
FormSectionHeaderTitle
FormSectionHeaderDescription
TextInput::Field
(pre-existing)FieldGroup
(lay out related groups of inputs in a row or stacked)TextInput::Field
(pre-existing)FormSeparator
(extra visual separation between Sections)ButtonSet
(pre-existing, can be wrapped in Section to control max-width)How widths work:
For Form Sections & similar:
@isFullWidth="false"
(the default)FormSection
will expand to a max of 700px@isFullWidth="true"
FormSection
& similar will expand to 100% of available widthFor Field Groups:
Item
container.🔗 External links
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.