@dloizides/ui-forms 1.34.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -594,11 +594,15 @@ type ChipVariant = 'solid' | 'outline';
594
594
  * survive the package boundary for consumers compiled with `isolatedModules`.
595
595
  */
596
596
  type ChipSingleSelectRole = 'button' | 'radio';
597
+ /** How a long chip label fits: `none` (default) grows the chip, `wrap` and `truncate` cap it at its container. */
598
+ type ChipLabelWrap = 'none' | 'wrap' | 'truncate';
597
599
  interface ChipOption<T> {
598
600
  value: T;
599
601
  label: string;
600
602
  /** Optional decorative icon rendered before the label; hidden from assistive tech. */
601
603
  icon?: React.ReactNode;
604
+ /** Long-label behaviour for this chip; defaults to `none`. */
605
+ labelWrap?: ChipLabelWrap;
602
606
  }
603
607
  interface ChipSelectorProps<T> {
604
608
  /** Optional — with no label, no label row is rendered (no phantom gap above the chips). */
@@ -670,6 +674,14 @@ interface ChipSelectorProps<T> {
670
674
 
671
675
  declare const ChipSelector: <T extends string | number>({ label, options, value, onChange, multiple, disabled, variant, containerStyle, spacing, required, error, testID, chipTestIDPrefix, optionAccessibilityHint, singleSelectRole, }: ChipSelectorProps<T>) => React.ReactElement;
672
676
 
677
+ interface ChipLabelLayout {
678
+ boxStyle: ViewStyle | undefined;
679
+ textStyle: TextStyle | undefined;
680
+ numberOfLines: number | undefined;
681
+ }
682
+ /** Resolves a chip's box and label layout for its `labelWrap` mode; `none` keeps today's render. */
683
+ declare function chipLabelLayout(labelWrap: ChipLabelWrap | undefined): ChipLabelLayout;
684
+
673
685
  /**
674
686
  * Reusable form switch/toggle with an optional description.
675
687
  */
@@ -1557,4 +1569,4 @@ declare function useBlurVerdict<T>(validate: () => T): BlurVerdict<T>;
1557
1569
  /** The pre-localized message for a refusal, or null when there is no verdict, it passed, or no labels were given. */
1558
1570
  declare function rejectionMessage<R extends string, N extends R>(rejection: R | null, none: N, labels: Readonly<Record<Exclude<R, N>, string>> | undefined): string | null;
1559
1571
 
1560
- export { AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, buildSearchSelectSections, controlStyles, countryFlag, countryOptions, draftBic, draftIban, dropdownFrame, findOption, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isFallbackFlag, isFixBarVisible, isOutside, isUnmatched, isWideFormLayout, moveHighlight, nextHighlight, placeDropdown, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateIban };
1572
+ export { AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChipLabelLayout, type ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, buildSearchSelectSections, chipLabelLayout, controlStyles, countryFlag, countryOptions, draftBic, draftIban, dropdownFrame, findOption, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isFallbackFlag, isFixBarVisible, isOutside, isUnmatched, isWideFormLayout, moveHighlight, nextHighlight, placeDropdown, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateIban };
package/dist/index.d.ts CHANGED
@@ -594,11 +594,15 @@ type ChipVariant = 'solid' | 'outline';
594
594
  * survive the package boundary for consumers compiled with `isolatedModules`.
595
595
  */
596
596
  type ChipSingleSelectRole = 'button' | 'radio';
597
+ /** How a long chip label fits: `none` (default) grows the chip, `wrap` and `truncate` cap it at its container. */
598
+ type ChipLabelWrap = 'none' | 'wrap' | 'truncate';
597
599
  interface ChipOption<T> {
598
600
  value: T;
599
601
  label: string;
600
602
  /** Optional decorative icon rendered before the label; hidden from assistive tech. */
601
603
  icon?: React.ReactNode;
604
+ /** Long-label behaviour for this chip; defaults to `none`. */
605
+ labelWrap?: ChipLabelWrap;
602
606
  }
603
607
  interface ChipSelectorProps<T> {
604
608
  /** Optional — with no label, no label row is rendered (no phantom gap above the chips). */
@@ -670,6 +674,14 @@ interface ChipSelectorProps<T> {
670
674
 
671
675
  declare const ChipSelector: <T extends string | number>({ label, options, value, onChange, multiple, disabled, variant, containerStyle, spacing, required, error, testID, chipTestIDPrefix, optionAccessibilityHint, singleSelectRole, }: ChipSelectorProps<T>) => React.ReactElement;
672
676
 
677
+ interface ChipLabelLayout {
678
+ boxStyle: ViewStyle | undefined;
679
+ textStyle: TextStyle | undefined;
680
+ numberOfLines: number | undefined;
681
+ }
682
+ /** Resolves a chip's box and label layout for its `labelWrap` mode; `none` keeps today's render. */
683
+ declare function chipLabelLayout(labelWrap: ChipLabelWrap | undefined): ChipLabelLayout;
684
+
673
685
  /**
674
686
  * Reusable form switch/toggle with an optional description.
675
687
  */
@@ -1557,4 +1569,4 @@ declare function useBlurVerdict<T>(validate: () => T): BlurVerdict<T>;
1557
1569
  /** The pre-localized message for a refusal, or null when there is no verdict, it passed, or no labels were given. */
1558
1570
  declare function rejectionMessage<R extends string, N extends R>(rejection: R | null, none: N, labels: Readonly<Record<Exclude<R, N>, string>> | undefined): string | null;
1559
1571
 
1560
- export { AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, buildSearchSelectSections, controlStyles, countryFlag, countryOptions, draftBic, draftIban, dropdownFrame, findOption, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isFallbackFlag, isFixBarVisible, isOutside, isUnmatched, isWideFormLayout, moveHighlight, nextHighlight, placeDropdown, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateIban };
1572
+ export { AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChipLabelLayout, type ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipVariant, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, type DateFieldProps, DateInput, type DateInputProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FixBar, type FixBarProps, type FlagShape, FlagShapeKind, type Focusable, type FocusableRefs, FormActions, type FormActionsProps, FormCell, type FormCellProps, FormCheckbox, type FormCheckboxProps, FormField, type FormFieldProps, FormGrid, type FormGridProps, FormSection, type FormSectionProps, FormStack, type FormStackProps, FormStatusLine, type FormStatusLineProps, FormSwitch, type FormSwitchProps, type GroupSelection, IBAN_MAX_LENGTH, IBAN_REGISTERED_COUNTRY_COUNT, INLINE_FIELD_ROW_MIN_WIDTH, type IbanDraft, IbanInput, type IbanInputProps, IbanRejection, type IbanRejectionLabels, type IbanVerdict, InlineFieldRow, type InlineFieldRowLayout, type InlineFieldRowProps, PHONE_MAX_WIDTH, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type StepNeighbours, StepperNav, type StepperNavLabels, type StepperNavProps, type StepperStep, StepperTabs, type StepperTabsProps, type ThemedInput, ThemedTextInput, type ThemedTextInputProps, TypeaheadControl, type TypeaheadControlProps, type TypeaheadSearch, type TypeaheadSearchProps, UploadWithLinkField, type UploadWithLinkFieldProps, type UploadWithLinkLabels, type UseThemedInputOptions, buildSearchSelectSections, chipLabelLayout, controlStyles, countryFlag, countryOptions, draftBic, draftIban, dropdownFrame, findOption, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isFallbackFlag, isFixBarVisible, isOutside, isUnmatched, isWideFormLayout, moveHighlight, nextHighlight, placeDropdown, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, suggestOptions, toCountryValue, toggleGroupSelection, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useThemedInput, validateBic, validateIban };
package/dist/index.js CHANGED
@@ -1202,6 +1202,18 @@ var TRANSPARENT_COLOR = "transparent";
1202
1202
  var CHIP_HIT_SLOP = { top: 10, bottom: 10, left: 4, right: 4 };
1203
1203
  var CHIP_GUTTER = 8;
1204
1204
  var DEFAULT_CHIP_TESTID_PREFIX = "chip-selector-chip";
1205
+
1206
+ // src/ChipSelector/utils/chipLabelLayout.ts
1207
+ var CAPPED_BOX = { maxWidth: "100%", flexShrink: 1 };
1208
+ var SHRINKING_TEXT = { flexShrink: 1 };
1209
+ var SINGLE_LINE = 1;
1210
+ function chipLabelLayout(labelWrap) {
1211
+ if (labelWrap === "wrap")
1212
+ return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: void 0 };
1213
+ if (labelWrap === "truncate")
1214
+ return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: SINGLE_LINE };
1215
+ return { boxStyle: void 0, textStyle: void 0, numberOfLines: void 0 };
1216
+ }
1205
1217
  var SOLID_RADIUS = 20;
1206
1218
  var OUTLINE_RADIUS = 999;
1207
1219
  var OUTLINE_PAD_H = 12;
@@ -1233,8 +1245,8 @@ var chipStyles = reactNative.StyleSheet.create({
1233
1245
  chipText: {},
1234
1246
  chipTextOutline: { fontSize: OUTLINE_FONT_SIZE }
1235
1247
  });
1236
- function ChipContent({ icon, label, textStyle }) {
1237
- const text = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: textStyle, children: label });
1248
+ function ChipContent({ icon, label, textStyle, numberOfLines }) {
1249
+ const text = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines, style: textStyle, children: label });
1238
1250
  if (icon === void 0 || icon === null)
1239
1251
  return text;
1240
1252
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: chipStyles.chipContent, children: [
@@ -1249,6 +1261,7 @@ function OutlineChip(props) {
1249
1261
  const borderColor = active ? colors.primary : colors.border;
1250
1262
  const backgroundColor = selected ? colors.tint : colors.muted;
1251
1263
  const textColor = active ? colors.primary : colors.textMuted;
1264
+ const layout = chipLabelLayout(option.labelWrap);
1252
1265
  return /* @__PURE__ */ jsxRuntime.jsx(
1253
1266
  reactNative.Pressable,
1254
1267
  {
@@ -1261,17 +1274,19 @@ function OutlineChip(props) {
1261
1274
  "aria-pressed": props.ariaPressed,
1262
1275
  disabled,
1263
1276
  hitSlop: CHIP_HIT_SLOP,
1277
+ style: layout.boxStyle,
1264
1278
  tabIndex: props.tabIndex,
1265
1279
  testID,
1266
1280
  onHoverIn: () => setHovered(true),
1267
1281
  onHoverOut: () => setHovered(false),
1268
1282
  onPress,
1269
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chipOutline, { borderColor, backgroundColor }], children: /* @__PURE__ */ jsxRuntime.jsx(
1283
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chipOutline, { borderColor, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
1270
1284
  ChipContent,
1271
1285
  {
1272
1286
  icon: option.icon,
1273
1287
  label: option.label,
1274
- textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, { color: textColor }]
1288
+ numberOfLines: layout.numberOfLines,
1289
+ textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, { color: textColor }, layout.textStyle]
1275
1290
  }
1276
1291
  ) })
1277
1292
  }
@@ -1281,6 +1296,7 @@ function SolidChip(props) {
1281
1296
  const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
1282
1297
  const backgroundColor = selected ? colors.primary : TRANSPARENT_COLOR;
1283
1298
  const textColor = selected ? colors.onPrimary : colors.textStrong;
1299
+ const layout = chipLabelLayout(option.labelWrap);
1284
1300
  const rovingTabStop = { tabIndex: props.tabIndex };
1285
1301
  return /* @__PURE__ */ jsxRuntime.jsx(
1286
1302
  reactNative.TouchableOpacity,
@@ -1294,10 +1310,19 @@ function SolidChip(props) {
1294
1310
  "aria-pressed": props.ariaPressed,
1295
1311
  disabled,
1296
1312
  hitSlop: CHIP_HIT_SLOP,
1313
+ style: layout.boxStyle,
1297
1314
  testID,
1298
1315
  onPress,
1299
1316
  ...rovingTabStop,
1300
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, { borderColor: colors.border, backgroundColor }], children: /* @__PURE__ */ jsxRuntime.jsx(ChipContent, { icon: option.icon, label: option.label, textStyle: [chipStyles.chipText, { color: textColor }] }) })
1317
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, { borderColor: colors.border, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
1318
+ ChipContent,
1319
+ {
1320
+ icon: option.icon,
1321
+ label: option.label,
1322
+ numberOfLines: layout.numberOfLines,
1323
+ textStyle: [chipStyles.chipText, { color: textColor }, layout.textStyle]
1324
+ }
1325
+ ) })
1301
1326
  }
1302
1327
  );
1303
1328
  }
@@ -2730,12 +2755,6 @@ var styles22 = reactNative.StyleSheet.create({
2730
2755
  sheetList: { maxHeight: SHEET_MAX_HEIGHT },
2731
2756
  empty: { padding: PANEL_PAD }
2732
2757
  });
2733
- var AFTER_SURFACE_UNMOUNT_MS = 0;
2734
- function useDeferredFocus(ref) {
2735
- return React2.useCallback(() => {
2736
- setTimeout(() => ref.current?.focus(), AFTER_SURFACE_UNMOUNT_MS);
2737
- }, [ref]);
2738
- }
2739
2758
  function useReducedMotion() {
2740
2759
  const [reduced, setReduced] = React2.useState(false);
2741
2760
  React2.useEffect(() => {
@@ -2751,6 +2770,13 @@ function useReducedMotion() {
2751
2770
  }, []);
2752
2771
  return reduced;
2753
2772
  }
2773
+ function useRefocusOnClose(open, ref) {
2774
+ const wasOpen = React2.useRef(false);
2775
+ React2.useEffect(() => {
2776
+ if (wasOpen.current && !open) ref.current?.focus();
2777
+ wasOpen.current = open;
2778
+ }, [open, ref]);
2779
+ }
2754
2780
 
2755
2781
  // src/SearchSelect/utils/searchSelectModel.ts
2756
2782
  var MIN_QUERY = 1;
@@ -2828,6 +2854,7 @@ function resolveSelectMotion(width, reducedMotion) {
2828
2854
  }
2829
2855
  var CHEVRON = "\u25BE";
2830
2856
  var VALUE_GAP = 8;
2857
+ var NOTHING_ON_CLOSE = () => void 0;
2831
2858
  function SearchSelect(props) {
2832
2859
  const { options, value, onChange, accessibilityLabel, accessibilityHint, labels, testID, recentKey, renderLeading, renderDetail } = props;
2833
2860
  const { theme } = uiFeedback.useUi();
@@ -2837,8 +2864,8 @@ function SearchSelect(props) {
2837
2864
  const { width } = reactNative.useWindowDimensions();
2838
2865
  const motion = resolveSelectMotion(width, useReducedMotion());
2839
2866
  const recents = useRecentValues(recentKey ?? `search-select:${testID}`);
2840
- const refocus = useDeferredFocus(triggerRef);
2841
- const state = useSearchSelectState(options, recents, onChange, refocus);
2867
+ const state = useSearchSelectState(options, recents, onChange, NOTHING_ON_CLOSE);
2868
+ useRefocusOnClose(state.open, triggerRef);
2842
2869
  const selected = findOption(options, value);
2843
2870
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: anchorRef, style: styles23.anchor, children: [
2844
2871
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2891,6 +2918,12 @@ function useOutsidePress(ref, onOutside) {
2891
2918
  return () => document.removeEventListener("pointerdown", onPointerDown, true);
2892
2919
  }, [ref, onOutside]);
2893
2920
  }
2921
+ var AFTER_SURFACE_UNMOUNT_MS = 0;
2922
+ function useDeferredFocus(ref) {
2923
+ return React2.useCallback(() => {
2924
+ setTimeout(() => ref.current?.focus(), AFTER_SURFACE_UNMOUNT_MS);
2925
+ }, [ref]);
2926
+ }
2894
2927
 
2895
2928
  // src/CountryFlag/data/flagPalette.ts
2896
2929
  var FLAG_PALETTE = {
@@ -4097,6 +4130,7 @@ exports.ThemedTextInput = ThemedTextInput;
4097
4130
  exports.TypeaheadControl = TypeaheadControl;
4098
4131
  exports.UploadWithLinkField = UploadWithLinkField;
4099
4132
  exports.buildSearchSelectSections = buildSearchSelectSections;
4133
+ exports.chipLabelLayout = chipLabelLayout;
4100
4134
  exports.controlStyles = controlStyles;
4101
4135
  exports.countryFlag = countryFlag;
4102
4136
  exports.countryOptions = countryOptions;