Conversation
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
|
||
| const valueStyles = style({ | ||
| ...fieldInput(), | ||
| minHeight: { |
There was a problem hiding this comment.
When LabeledValue is placed in a horizontal row next to components like TextField, Picker, or NumberField, the value needs extra vertical spacing so it aligns with the input text of those components. Standalone, however, LabeledValue should keep tight spacing between label and value. (See the Figma design for the spec)
Right now, the way I'm ensuring that LabeledValue is aligned correctly is by setting the height via controlSize when it is inside a Form (and setting alignItems: center).
However, some other use cases to consider:
- A user places Picker + LabeledValue side-by-side without a
<Form>wrapper → wants alignment, but formContext is null. - LabeledValue sits in a single vertical column inside a
<Form>→ doesn't want the extra spacing, but formContext is set.
Should we expect users to wrap LabeledValue inside <Form> if they want alignment? Do we care if there's extra vertical spacing if it sits in a single vertical column?
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
## API Changes
@react-spectrum/s2/@react-spectrum/s2:LabeledValue+LabeledValue <T extends LabeledValueTypes> {
+ LabeledValue: LabeledValueProps
+}/@react-spectrum/s2:LabeledValueContext+LabeledValueContext {
+ UNTYPED
+}/@react-spectrum/s2:LabeledValueProps+LabeledValueProps {
+ L: undefined
+} |
| "use client" | ||
| import {LabeledValue} from '@react-spectrum/s2/LabeledValue'; | ||
|
|
||
| <LabeledValue label="Price range" value={{start: 150, end: 400}} formatOptions={{style: 'currency', currency: 'USD', minimumFractionDigits: 0}} /> |
There was a problem hiding this comment.
nit: split this into multiple lines
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
Check docs + new stories
🧢 Your Project: