From f56a78746d0fd804267cb5ab17e2675f33f13e5e Mon Sep 17 00:00:00 2001 From: Yihui Liao <44729383+yihuiliao@users.noreply.github.com> Date: Fri, 9 Aug 2024 10:08:10 -0700 Subject: [PATCH] Add quiet styling to S2 Picker (#6812) * add quiet styling * remove spacing * fix spacing * simplify outline style * have label on a single line * long content in quiet picker to truncate in fixed width container * small fixes * offset dropdown when align is start * fix width of quiet picker dropdown * remove unused import * remove another unused import * update offset --------- Co-authored-by: Robert Snow --- packages/@react-spectrum/s2/src/Field.tsx | 7 +- packages/@react-spectrum/s2/src/Picker.tsx | 73 +++++++++++++++---- .../@react-spectrum/s2/src/style-utils.ts | 3 +- 3 files changed, 66 insertions(+), 17 deletions(-) diff --git a/packages/@react-spectrum/s2/src/Field.tsx b/packages/@react-spectrum/s2/src/Field.tsx index 55a668e7ad9..4c42adc0be3 100644 --- a/packages/@react-spectrum/s2/src/Field.tsx +++ b/packages/@react-spectrum/s2/src/Field.tsx @@ -35,6 +35,7 @@ interface FieldLabelProps extends Omit) { labelPosition, staticColor, contextualHelp, + isQuiet, UNSAFE_style, UNSAFE_className = '', ...labelProps @@ -80,9 +82,10 @@ function FieldLabel(props: FieldLabelProps, ref: DOMRef) { contain: { labelPosition: { top: 'inline-size' - } + }, + isQuiet: 'none' } - })({labelAlign, labelPosition})}> + })({labelAlign, labelPosition, isQuiet})}>