@dloizides/ui-forms 1.49.0 → 1.51.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 +12 -0
- package/dist/index.d.mts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +35 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.51.0] - 2026-11-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `ChipSelector` `size="dense"`: the `compact` 28 px pill in its 44 px hit box with no row gap, so wrapped rows stack at a 44 px pitch instead of 52 (MODC-1 S-23). Column gap and tap target unchanged; `compact` and `default` unchanged.
|
|
7
|
+
- `SelectControl` `native="fit"`: the web `<select>` sizes to its longest option instead of 100% width, so a narrow column no longer cuts the selected label (MODC-1 S-7). `native` / `native={true}` unchanged.
|
|
8
|
+
|
|
9
|
+
## [1.50.0] - 2026-11-24
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `ChipSelector` `outlineTone="strong"`: unselected chips draw their outline in the theme `textSecondary` ink instead of `border`, a darker edge (INVOICE-FU-26 D-FU26-1). Works on both variants; selected and hover looks unchanged. Default `default` keeps the current look.
|
|
13
|
+
- `ChipOutlineTone` type export.
|
|
14
|
+
|
|
3
15
|
## [1.49.0] - 2026-11-24
|
|
4
16
|
|
|
5
17
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -657,8 +657,11 @@ declare const enum ChipLabelWrap {
|
|
|
657
657
|
Truncate = "truncate"
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
-
/**
|
|
661
|
-
type
|
|
660
|
+
/** Outline of an unselected chip. `default` = theme `border`; `strong` = theme `textSecondary`, a darker edge. */
|
|
661
|
+
type ChipOutlineTone = 'default' | 'strong';
|
|
662
|
+
|
|
663
|
+
/** Chip size. `default` = 44 px pill; `compact` = 28 px pill in a 44 px hit box; `dense` = `compact` with no row gap (44 px row pitch). */
|
|
664
|
+
type ChipSize = 'default' | 'compact' | 'dense';
|
|
662
665
|
|
|
663
666
|
/**
|
|
664
667
|
* Public + internal types for ChipSelector. Split out of `ChipSelector.tsx` so the component, its
|
|
@@ -728,10 +731,12 @@ interface ChipSelectorProps<T> {
|
|
|
728
731
|
* stays a toggle button with `aria-pressed`.
|
|
729
732
|
*/
|
|
730
733
|
singleSelectRole?: ChipSingleSelectRole;
|
|
731
|
-
/** `compact` = a 28 px pill (padding 4/10, label 12/600)
|
|
734
|
+
/** `compact` = a 28 px pill (padding 4/10, label 12/600) in a 44 px hit box; `dense` = `compact` with no row gap; defaults to `default`. */
|
|
732
735
|
size?: ChipSize;
|
|
733
736
|
/** Background of a selected chip, from the app's tokens; when set, a selected chip also shows a leading check. */
|
|
734
737
|
selectedFill?: string;
|
|
738
|
+
/** `strong` = unselected chips get the darker theme `textSecondary` outline; defaults to `default`. */
|
|
739
|
+
outlineTone?: ChipOutlineTone;
|
|
735
740
|
}
|
|
736
741
|
|
|
737
742
|
/**
|
|
@@ -754,7 +759,7 @@ interface ChipSelectorProps<T> {
|
|
|
754
759
|
* resolvers (`chipIdentity`, colours, radio key logic) in `utils/`.
|
|
755
760
|
*/
|
|
756
761
|
|
|
757
|
-
declare const ChipSelector: <T extends string | number>({ label, options, value, onChange, multiple, disabled, variant, containerStyle, spacing, required, error, testID, chipTestIDPrefix, optionAccessibilityHint, singleSelectRole, size, selectedFill, }: ChipSelectorProps<T>) => React.ReactElement;
|
|
762
|
+
declare const ChipSelector: <T extends string | number>({ label, options, value, onChange, multiple, disabled, variant, containerStyle, spacing, required, error, testID, chipTestIDPrefix, optionAccessibilityHint, singleSelectRole, size, selectedFill, outlineTone, }: ChipSelectorProps<T>) => React.ReactElement;
|
|
758
763
|
|
|
759
764
|
/** `row` = label beside the switch (default); `box` = caption label over a bordered field box holding the state text and the switch. */
|
|
760
765
|
type FormSwitchVariant = 'row' | 'box';
|
|
@@ -883,8 +888,8 @@ interface SelectControlProps {
|
|
|
883
888
|
style?: StyleProp<ViewStyle>;
|
|
884
889
|
/** Trigger is `${testID}-trigger`, menu `${testID}-menu`, options `${testID}-option-${value}`. */
|
|
885
890
|
testID: string;
|
|
886
|
-
/** Web only: render a real `<select>` (
|
|
887
|
-
native?: boolean;
|
|
891
|
+
/** Web only: render a real `<select>` (plain `testID`); `'fit'` sizes it to its longest option instead of the full width. */
|
|
892
|
+
native?: boolean | 'fit';
|
|
888
893
|
}
|
|
889
894
|
declare function SelectControl(props: SelectControlProps): React.ReactElement;
|
|
890
895
|
|
|
@@ -1999,4 +2004,4 @@ declare function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLa
|
|
|
1999
2004
|
declare function changedRules(previous: readonly PasswordRuleState[], next: readonly PasswordRuleState[]): PasswordRuleState[];
|
|
2000
2005
|
declare function ruleAnnouncement(changed: readonly PasswordRuleState[], labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>): string;
|
|
2001
2006
|
|
|
2002
|
-
export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AssignedServerErrors, type AutoGrowRows, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChecklistItem, ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipSize, type ChipVariant, type CodeFormatter, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, type DateFieldProps, DateInput, type DateInputProps, type DatePickerLabels, DatePickerProvider, type DatePickerProviderProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DecisionChecklist, type DecisionError, type DecisionOutcome, DecisionPanel, type DecisionPanelLabels, type DecisionPanelProps, type DecisionPanelVariant, type DecisionSubmission, type DecisionTone, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FileInput, type FileInputProps, 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 FormSwitchVariant, GatedChecklist, type GatedChecklistProps, 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, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, type MultiSelectChipLabels, MultiSelectField, type MultiSelectFieldProps, PHONE_MAX_WIDTH, PasswordField, type PasswordFieldColors, type PasswordFieldLabels, type PasswordFieldProps, type PasswordRuleState, PasswordRules, PasswordRulesDisplay, type PasswordRulesProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, RevealToggle, type RevealToggleProps, type RuleColors, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type ServerFieldErrors, 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 UseServerFieldErrorsOptions, type UseThemedInputOptions, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
|
|
2007
|
+
export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AssignedServerErrors, type AutoGrowRows, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChecklistItem, ChipLabelWrap, type ChipOption, type ChipOutlineTone, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipSize, type ChipVariant, type CodeFormatter, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, type DateFieldProps, DateInput, type DateInputProps, type DatePickerLabels, DatePickerProvider, type DatePickerProviderProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DecisionChecklist, type DecisionError, type DecisionOutcome, DecisionPanel, type DecisionPanelLabels, type DecisionPanelProps, type DecisionPanelVariant, type DecisionSubmission, type DecisionTone, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FileInput, type FileInputProps, 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 FormSwitchVariant, GatedChecklist, type GatedChecklistProps, 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, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, type MultiSelectChipLabels, MultiSelectField, type MultiSelectFieldProps, PHONE_MAX_WIDTH, PasswordField, type PasswordFieldColors, type PasswordFieldLabels, type PasswordFieldProps, type PasswordRuleState, PasswordRules, PasswordRulesDisplay, type PasswordRulesProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, RevealToggle, type RevealToggleProps, type RuleColors, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type ServerFieldErrors, 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 UseServerFieldErrorsOptions, type UseThemedInputOptions, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
|
package/dist/index.d.ts
CHANGED
|
@@ -657,8 +657,11 @@ declare const enum ChipLabelWrap {
|
|
|
657
657
|
Truncate = "truncate"
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
-
/**
|
|
661
|
-
type
|
|
660
|
+
/** Outline of an unselected chip. `default` = theme `border`; `strong` = theme `textSecondary`, a darker edge. */
|
|
661
|
+
type ChipOutlineTone = 'default' | 'strong';
|
|
662
|
+
|
|
663
|
+
/** Chip size. `default` = 44 px pill; `compact` = 28 px pill in a 44 px hit box; `dense` = `compact` with no row gap (44 px row pitch). */
|
|
664
|
+
type ChipSize = 'default' | 'compact' | 'dense';
|
|
662
665
|
|
|
663
666
|
/**
|
|
664
667
|
* Public + internal types for ChipSelector. Split out of `ChipSelector.tsx` so the component, its
|
|
@@ -728,10 +731,12 @@ interface ChipSelectorProps<T> {
|
|
|
728
731
|
* stays a toggle button with `aria-pressed`.
|
|
729
732
|
*/
|
|
730
733
|
singleSelectRole?: ChipSingleSelectRole;
|
|
731
|
-
/** `compact` = a 28 px pill (padding 4/10, label 12/600)
|
|
734
|
+
/** `compact` = a 28 px pill (padding 4/10, label 12/600) in a 44 px hit box; `dense` = `compact` with no row gap; defaults to `default`. */
|
|
732
735
|
size?: ChipSize;
|
|
733
736
|
/** Background of a selected chip, from the app's tokens; when set, a selected chip also shows a leading check. */
|
|
734
737
|
selectedFill?: string;
|
|
738
|
+
/** `strong` = unselected chips get the darker theme `textSecondary` outline; defaults to `default`. */
|
|
739
|
+
outlineTone?: ChipOutlineTone;
|
|
735
740
|
}
|
|
736
741
|
|
|
737
742
|
/**
|
|
@@ -754,7 +759,7 @@ interface ChipSelectorProps<T> {
|
|
|
754
759
|
* resolvers (`chipIdentity`, colours, radio key logic) in `utils/`.
|
|
755
760
|
*/
|
|
756
761
|
|
|
757
|
-
declare const ChipSelector: <T extends string | number>({ label, options, value, onChange, multiple, disabled, variant, containerStyle, spacing, required, error, testID, chipTestIDPrefix, optionAccessibilityHint, singleSelectRole, size, selectedFill, }: ChipSelectorProps<T>) => React.ReactElement;
|
|
762
|
+
declare const ChipSelector: <T extends string | number>({ label, options, value, onChange, multiple, disabled, variant, containerStyle, spacing, required, error, testID, chipTestIDPrefix, optionAccessibilityHint, singleSelectRole, size, selectedFill, outlineTone, }: ChipSelectorProps<T>) => React.ReactElement;
|
|
758
763
|
|
|
759
764
|
/** `row` = label beside the switch (default); `box` = caption label over a bordered field box holding the state text and the switch. */
|
|
760
765
|
type FormSwitchVariant = 'row' | 'box';
|
|
@@ -883,8 +888,8 @@ interface SelectControlProps {
|
|
|
883
888
|
style?: StyleProp<ViewStyle>;
|
|
884
889
|
/** Trigger is `${testID}-trigger`, menu `${testID}-menu`, options `${testID}-option-${value}`. */
|
|
885
890
|
testID: string;
|
|
886
|
-
/** Web only: render a real `<select>` (
|
|
887
|
-
native?: boolean;
|
|
891
|
+
/** Web only: render a real `<select>` (plain `testID`); `'fit'` sizes it to its longest option instead of the full width. */
|
|
892
|
+
native?: boolean | 'fit';
|
|
888
893
|
}
|
|
889
894
|
declare function SelectControl(props: SelectControlProps): React.ReactElement;
|
|
890
895
|
|
|
@@ -1999,4 +2004,4 @@ declare function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLa
|
|
|
1999
2004
|
declare function changedRules(previous: readonly PasswordRuleState[], next: readonly PasswordRuleState[]): PasswordRuleState[];
|
|
2000
2005
|
declare function ruleAnnouncement(changed: readonly PasswordRuleState[], labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>): string;
|
|
2001
2006
|
|
|
2002
|
-
export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AssignedServerErrors, type AutoGrowRows, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChecklistItem, ChipLabelWrap, type ChipOption, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipSize, type ChipVariant, type CodeFormatter, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, type DateFieldProps, DateInput, type DateInputProps, type DatePickerLabels, DatePickerProvider, type DatePickerProviderProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DecisionChecklist, type DecisionError, type DecisionOutcome, DecisionPanel, type DecisionPanelLabels, type DecisionPanelProps, type DecisionPanelVariant, type DecisionSubmission, type DecisionTone, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FileInput, type FileInputProps, 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 FormSwitchVariant, GatedChecklist, type GatedChecklistProps, 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, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, type MultiSelectChipLabels, MultiSelectField, type MultiSelectFieldProps, PHONE_MAX_WIDTH, PasswordField, type PasswordFieldColors, type PasswordFieldLabels, type PasswordFieldProps, type PasswordRuleState, PasswordRules, PasswordRulesDisplay, type PasswordRulesProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, RevealToggle, type RevealToggleProps, type RuleColors, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type ServerFieldErrors, 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 UseServerFieldErrorsOptions, type UseThemedInputOptions, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
|
|
2007
|
+
export { ActionBar, type ActionBarProps, AddOnRequest, type AddOnRequestProps, AlignToControl, type AlignToControlProps, type AnchorRect, AnchoredMenu, type AnchoredMenuColors, type AnchoredMenuListbox, type AnchoredMenuPlacement, type AnchoredMenuProps, type AssignedServerErrors, type AutoGrowRows, type BicDraft, BicInput, type BicInputProps, BicRejection, type BicRejectionLabels, type BicVerdict, type BlurVerdict, COUNTRIES, type ChecklistItem, ChipLabelWrap, type ChipOption, type ChipOutlineTone, ChipSelector, type ChipSelectorProps, type ChipSingleSelectRole, type ChipSize, type ChipVariant, type CodeFormatter, type ControlOption, type Country, CountryField, type CountryFieldProps, CountryFlag, type CountryFlagProps, DEFAULT_DATE_PICKER_LABELS, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateDisplay, DateField, type DateFieldProps, DateInput, type DateInputProps, type DatePickerLabels, DatePickerProvider, type DatePickerProviderProps, DateRangeControl, type DateRangeControlProps, type DateRangeValue, DateTimeField, type DateTimeFieldProps, type DecisionChecklist, type DecisionError, type DecisionOutcome, DecisionPanel, type DecisionPanelLabels, type DecisionPanelProps, type DecisionPanelVariant, type DecisionSubmission, type DecisionTone, type DropdownFrame, DropdownPlacement, FLAG_HEIGHT, FLAG_WIDTH, Field, type FieldChildContext, type FieldChildren, type FieldLabelVariant, type FieldMarker, type FieldProps, type FieldSpacing, FileInput, type FileInputProps, 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 FormSwitchVariant, GatedChecklist, type GatedChecklistProps, 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, LINE_ITEMS_WIDE_MIN_WIDTH, type LineItemCell, type LineItemColumn, LineItems, type LineItemsLabels, type LineItemsProps, type MultiSelectChipLabels, MultiSelectField, type MultiSelectFieldProps, PHONE_MAX_WIDTH, PasswordField, type PasswordFieldColors, type PasswordFieldLabels, type PasswordFieldProps, type PasswordRuleState, PasswordRules, PasswordRulesDisplay, type PasswordRulesProps, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, RadioList, type RadioListProps, type RadioOption, type RadioRowIdentity, type RecentValues, ResponsiveFormLayout, type ResponsiveFormLayoutProps, RevealToggle, type RevealToggleProps, type RuleColors, RuleTone, SEGMENT_BESIDE_FIELD, SEGMENT_BESIDE_TEXT_INPUT, SearchSelect, type SearchSelectLabels, type SearchSelectProps, type SearchSelectSections, type SearchSelectState, type SearchSelectTrigger, SelectControl, type SelectControlProps, SelectField, type SelectFieldProps, type SelectMenuAnchor, type SelectMotion, SelectSurface, type ServerFieldErrors, 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 UseServerFieldErrorsOptions, type UseThemedInputOptions, actionBarPosition, assignServerErrors, buildSearchSelectSections, canRemoveLine, changedRules, controlStyles, countryFieldOptions, countryFlag, countryOptions, defaultDecisionVariant, draftBic, draftIban, dropdownFrame, findOption, fitDropdownWidth, flagShapes, groupAriaChecked, groupInFours, highlightAfterQuery, ibanCounter, ibanLengthFor, inlineFieldRowLayout, isAddOnOpen, isChecklistComplete, isFallbackFlag, isFixBarVisible, isLineItemsWide, isOutside, isUnmatched, isWideFormLayout, leadFirst, lineItemColumnFlex, lineNumberOf, moveHighlight, nextHighlight, placeDropdown, radioRowIdentity, rejectionMessage, resolveGroupSelection, resolveSelectMotion, resolveStepNeighbours, rowsForText, ruleAnnouncement, ruleColorsFrom, ruleTone, suggestOptions, toCountryValue, toggleGroupSelection, useAutoGrowRows, useBlurVerdict, useDeferredFocus, useFocusFirstInvalid, useKeepInView, useOutsidePress, useRecentValues, useReducedMotion, useSearchSelectState, useServerFieldErrors, useThemedInput, validateBic, validateDecision, validateIban };
|
package/dist/index.js
CHANGED
|
@@ -1444,6 +1444,11 @@ var chipSizeStyles = reactNative.StyleSheet.create({
|
|
|
1444
1444
|
}
|
|
1445
1445
|
});
|
|
1446
1446
|
|
|
1447
|
+
// src/ChipSelector/ChipSize.ts
|
|
1448
|
+
function isCompactSize(size) {
|
|
1449
|
+
return size === "compact" || size === "dense";
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1447
1452
|
// src/ChipSelector/utils/chipLook.ts
|
|
1448
1453
|
function chipFill({ selected, selectedFill, ink, rest }) {
|
|
1449
1454
|
if (!selected || selectedFill === void 0)
|
|
@@ -1451,10 +1456,17 @@ function chipFill({ selected, selectedFill, ink, rest }) {
|
|
|
1451
1456
|
return { backgroundColor: selectedFill, textColor: ink, checkColor: ink };
|
|
1452
1457
|
}
|
|
1453
1458
|
function chipSizeLook(size) {
|
|
1454
|
-
if (size
|
|
1459
|
+
if (!isCompactSize(size))
|
|
1455
1460
|
return { hitBox: void 0, visual: void 0, text: void 0 };
|
|
1456
1461
|
return { hitBox: chipSizeStyles.compactHitBox, visual: chipSizeStyles.compactVisual, text: chipSizeStyles.compactText };
|
|
1457
1462
|
}
|
|
1463
|
+
var DENSE_ROW_GAP = { rowGap: 0 };
|
|
1464
|
+
function chipRowGap(size) {
|
|
1465
|
+
return size === "dense" ? DENSE_ROW_GAP : void 0;
|
|
1466
|
+
}
|
|
1467
|
+
function restBorderColor(colors, tone) {
|
|
1468
|
+
return tone === "strong" ? colors.borderStrong : colors.border;
|
|
1469
|
+
}
|
|
1458
1470
|
var SOLID_RADIUS = 20;
|
|
1459
1471
|
var OUTLINE_RADIUS = 999;
|
|
1460
1472
|
var OUTLINE_PAD_H = 12;
|
|
@@ -1503,7 +1515,7 @@ function OutlineChip(props) {
|
|
|
1503
1515
|
const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
|
|
1504
1516
|
const [hovered, setHovered] = React39__default.default.useState(false);
|
|
1505
1517
|
const active = selected || hovered;
|
|
1506
|
-
const borderColor = active ? colors.primary : colors.
|
|
1518
|
+
const borderColor = active ? colors.primary : restBorderColor(colors, props.outlineTone);
|
|
1507
1519
|
const fill = chipFill({
|
|
1508
1520
|
selected,
|
|
1509
1521
|
selectedFill: props.selectedFill,
|
|
@@ -1571,7 +1583,7 @@ function SolidChip(props) {
|
|
|
1571
1583
|
testID,
|
|
1572
1584
|
onPress,
|
|
1573
1585
|
...rovingTabStop,
|
|
1574
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, sized.visual, { borderColor: colors.border, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1586
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, sized.visual, { borderColor: selected ? colors.border : restBorderColor(colors, props.outlineTone), backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1575
1587
|
ChipContent,
|
|
1576
1588
|
{
|
|
1577
1589
|
checkColor: fill.checkColor,
|
|
@@ -1669,6 +1681,7 @@ function buildChipColors(colors, palette) {
|
|
|
1669
1681
|
const primary = palette.primary[500];
|
|
1670
1682
|
return {
|
|
1671
1683
|
border: colors.border,
|
|
1684
|
+
borderStrong: colors.textSecondary,
|
|
1672
1685
|
textStrong: colors.text,
|
|
1673
1686
|
textMuted: colors.textSecondary,
|
|
1674
1687
|
primary,
|
|
@@ -1726,7 +1739,8 @@ var ChipSelector = ({
|
|
|
1726
1739
|
optionAccessibilityHint,
|
|
1727
1740
|
singleSelectRole = "button",
|
|
1728
1741
|
size = "default",
|
|
1729
|
-
selectedFill
|
|
1742
|
+
selectedFill,
|
|
1743
|
+
outlineTone = "default"
|
|
1730
1744
|
}) => {
|
|
1731
1745
|
const isRadioGroup = !multiple && singleSelectRole === "radio";
|
|
1732
1746
|
const { theme } = uiFeedback.useUi();
|
|
@@ -1753,6 +1767,7 @@ var ChipSelector = ({
|
|
|
1753
1767
|
selected,
|
|
1754
1768
|
size,
|
|
1755
1769
|
selectedFill,
|
|
1770
|
+
outlineTone,
|
|
1756
1771
|
...chipIdentity(option, selected, {
|
|
1757
1772
|
prefix: chipTestIDPrefix,
|
|
1758
1773
|
hint: optionAccessibilityHint,
|
|
@@ -1781,7 +1796,7 @@ var ChipSelector = ({
|
|
|
1781
1796
|
reactNative.View,
|
|
1782
1797
|
{
|
|
1783
1798
|
accessibilityRole: isRadioGroup ? "radiogroup" : void 0,
|
|
1784
|
-
style: styles13.chipContainer,
|
|
1799
|
+
style: [styles13.chipContainer, chipRowGap(size)],
|
|
1785
1800
|
...webFieldA11y({ describedById, hasError }),
|
|
1786
1801
|
...radio.groupProps,
|
|
1787
1802
|
children: options.map(renderChip)
|
|
@@ -2116,11 +2131,18 @@ var NATIVE_SELECT_BOX = {
|
|
|
2116
2131
|
fontFamily: "inherit",
|
|
2117
2132
|
width: "100%"
|
|
2118
2133
|
};
|
|
2119
|
-
|
|
2134
|
+
var FIT_SELECT_BOX = { width: "auto", maxWidth: "none" };
|
|
2135
|
+
var fitStyles = reactNative.StyleSheet.create({
|
|
2136
|
+
anchor: { alignSelf: "flex-start", flexShrink: 0 }
|
|
2137
|
+
});
|
|
2138
|
+
function nativeSelectBox(fit) {
|
|
2139
|
+
return fit ? { ...NATIVE_SELECT_BOX, ...FIT_SELECT_BOX } : NATIVE_SELECT_BOX;
|
|
2140
|
+
}
|
|
2141
|
+
function nativeSelectStyle(fit, borderColor, backgroundColor, color) {
|
|
2120
2142
|
const trigger = reactNative.StyleSheet.flatten(controlStyles.selectTrigger);
|
|
2121
2143
|
const text = reactNative.StyleSheet.flatten(controlStyles.selectTriggerText);
|
|
2122
2144
|
return {
|
|
2123
|
-
...
|
|
2145
|
+
...nativeSelectBox(fit),
|
|
2124
2146
|
minHeight: trigger.minHeight,
|
|
2125
2147
|
borderWidth: trigger.borderWidth,
|
|
2126
2148
|
borderRadius: trigger.borderRadius,
|
|
@@ -2141,20 +2163,22 @@ function NativeSelect({
|
|
|
2141
2163
|
accessibilityHint,
|
|
2142
2164
|
labelledById,
|
|
2143
2165
|
style,
|
|
2144
|
-
testID
|
|
2166
|
+
testID,
|
|
2167
|
+
native
|
|
2145
2168
|
}) {
|
|
2146
2169
|
const { theme } = uiFeedback.useUi();
|
|
2147
2170
|
const { colors } = theme;
|
|
2148
2171
|
const hasMatch = options.some((o) => o.value === value);
|
|
2149
2172
|
const textColor = hasMatch ? colors.text : colors.textSecondary;
|
|
2173
|
+
const fit = native === "fit";
|
|
2150
2174
|
const handleChange = (event) => onChange(event.target.value);
|
|
2151
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [controlStyles.anchor, style], children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2175
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [controlStyles.anchor, fit ? fitStyles.anchor : void 0, style], children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2152
2176
|
"select",
|
|
2153
2177
|
{
|
|
2154
2178
|
"aria-label": accessibilityLabel,
|
|
2155
2179
|
"aria-labelledby": labelledById,
|
|
2156
2180
|
"data-testid": testID,
|
|
2157
|
-
style: nativeSelectStyle(colors.border, colors.surfaceElevated, textColor),
|
|
2181
|
+
style: nativeSelectStyle(fit, colors.border, colors.surfaceElevated, textColor),
|
|
2158
2182
|
title: accessibilityHint,
|
|
2159
2183
|
value,
|
|
2160
2184
|
onChange: handleChange,
|
|
@@ -2208,7 +2232,7 @@ function listboxTriggerAria(testID, hasList, highlighted) {
|
|
|
2208
2232
|
};
|
|
2209
2233
|
}
|
|
2210
2234
|
function SelectControl(props) {
|
|
2211
|
-
return props.native === true && IS_WEB7 ? /* @__PURE__ */ jsxRuntime.jsx(NativeSelect, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(MenuSelectControl, { ...props });
|
|
2235
|
+
return (props.native === true || props.native === "fit") && IS_WEB7 ? /* @__PURE__ */ jsxRuntime.jsx(NativeSelect, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(MenuSelectControl, { ...props });
|
|
2212
2236
|
}
|
|
2213
2237
|
function MenuSelectControl({
|
|
2214
2238
|
options,
|