-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(Forms): add layoutOptions
for enhanced horizontal label layout
#4208
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
6877ae5
to
74b7485
Compare
Should we also document the props |
@@ -16,4 +16,4 @@ $THEME_FALLBACK: 'ui'; | |||
|
|||
@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-sbanken.scss'; | |||
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-sbanken.scss'; | |||
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-ui.scss'; | |||
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-sbanken.scss'; |
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.
Nice find 👏
Did this error cause some kind of styling issue as of today? 🤔
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.
Yes, indeed.
labelDescription
did change its color. But we did not have any visual tests on this one, so I added two now.
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.
I guess it makes sense that the height has decreased in this screenshot as part of this PR?
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.
@@ -21,6 +21,16 @@ export const fieldBlockSharedProperties: PropertiesTableProps = { | |||
type: 'string', | |||
status: 'optional', | |||
}, | |||
layoutOptions: { |
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.
layoutOptions: { | |
horizontalLayoutOptions: { |
Based on the description of the layoutOptions
prop, it seems like its only use is to set additional options for the horizontal
layout. Perhaps the prop name should reflect so as well? 🤔
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.
I had the same thought a while. But I don't think we need to do so. Because its an object. So its extendible. And we can add new properties to it.
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.
Nice findings. Thank you so much. I added some more tests.
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.
@@ -16,4 +16,4 @@ $THEME_FALLBACK: 'ui'; | |||
|
|||
@import '../../../extensions/forms/Field/Number/style/themes/dnb-number-theme-sbanken.scss'; | |||
@import '../../../extensions/forms/Wizard/style/themes/dnb-wizard-layout-theme-sbanken.scss'; | |||
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-ui.scss'; | |||
@import '../../../extensions/forms/FieldBlock/style/themes/dnb-field-block-theme-sbanken.scss'; |
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.
Yes, indeed.
labelDescription
did change its color. But we did not have any visual tests on this one, so I added two now.
74b7485
to
a0e6a34
Compare
a0e6a34
to
b44573b
Compare
## [10.55.0](v10.54.1...v10.55.0) (2024-11-08) ### ⚡ Refactoring * center cards on ultra-wide monitors and fix capitalization typo ([#4214](#4214)) ([0ec1388](0ec1388)) ### 📝 Documentation * **CountryFlag:** `iso` defaults to `NO` ([#4234](#4234)) ([cab3c32](cab3c32)) * display all Value components in the Value menu ([#4231](#4231)) ([d260a9c](d260a9c)) ### 🐛 Bug Fixes * ensure components having `fieldset` inside still can use spacing ([#4236](#4236)) ([d4e4334](d4e4334)) * **Forms:** add Iterate support for Field.PostalCodeAndCity when using `country` with a path ([#4215](#4215)) ([6f80ed9](6f80ed9)), closes [#4200](#4200) * **Forms:** ensure `Field.Number` with `percent` and without a value renders correctly ([#4230](#4230)) ([96fa2a5](96fa2a5)), closes [#4228](#4228) * **Forms:** fix vertical gap between Field.ArraySelection toggle buttons with checkbox variant ([#4217](#4217)) ([83f0b37](83f0b37)) * **Forms:** remove extra space from Value.* components with `inline` property ([#4246](#4246)) ([8b96fd1](8b96fd1)) * **Forms:** should display error underneath fields when nested inside Field.Selection or Field.ArraySelection ([#4225](#4225)) ([c0f1a02](c0f1a02)) * remove legacy `fieldset` reset ([#4237](#4237)) ([a2f368b](a2f368b)) * **Upload:** alignment when displaying single DL item ([#4210](#4210)) ([5f745f5](5f745f5)) * **Upload:** fix `UploadFile` type to include `id` as required ([#4218](#4218)) ([b24fdfd](b24fdfd)) ### ✨ Features * **Card:** add style for nested cards ([#4244](#4244)) ([f45aa4a](f45aa4a)) * **Card:** remove `beta` badge ([#4211](#4211)) ([67a4fbd](67a4fbd)) * **ChildrenWithAge:** add maximum possible value to joint-responsibility & daycare ([#4219](#4219)) ([9b9c517](9b9c517)) * **CountryFlag:** add iso to properties table ([#4232](#4232)) ([9dc57cb](9dc57cb)) * **DatePicker:** Convert to functional components with typescript and hooks ([#2799](#2799)) ([45687ea](45687ea)) * **Forms:** add `layoutOptions` for enhanced horizontal label layout ([#4208](#4208)) ([8d84d97](8d84d97)) * **Forms:** add `transformLabel` to Value.Composition ([#4207](#4207)) ([c966bc1](c966bc1)) * **Forms:** add `Value.Upload` component ([#4233](#4233)) ([3adddac](3adddac)) * **Forms:** add EditButton, CancelButton and DoneButton to Form.Section containers ([#4223](#4223)) ([092abcd](092abcd)) * **ListFormat:** add `ListFormat` component ([#4238](#4238)) ([63613f1](63613f1)) * **Upload:** add `download` prop to enable file downloads instead of opening in a new tab ([#4213](#4213)) ([3e92934](3e92934))
🎉 This PR is included in version 10.55.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR introduces a new property,
layoutOptions
, allowing for adjustment of the width in horizontally aligned layouts.Since its primary use case is for input fields, we are also updating the docs examples for the String and Number fields accordingly.
Quick example: