@dloizides/ui-forms 1.34.1 → 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/CHANGELOG.md +533 -532
- package/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +31 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
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(
|
|
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
|
}
|
|
@@ -4105,6 +4130,7 @@ exports.ThemedTextInput = ThemedTextInput;
|
|
|
4105
4130
|
exports.TypeaheadControl = TypeaheadControl;
|
|
4106
4131
|
exports.UploadWithLinkField = UploadWithLinkField;
|
|
4107
4132
|
exports.buildSearchSelectSections = buildSearchSelectSections;
|
|
4133
|
+
exports.chipLabelLayout = chipLabelLayout;
|
|
4108
4134
|
exports.controlStyles = controlStyles;
|
|
4109
4135
|
exports.countryFlag = countryFlag;
|
|
4110
4136
|
exports.countryOptions = countryOptions;
|