@dloizides/ui-forms 1.47.0 → 1.48.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 +7 -0
- package/dist/index.d.mts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +86 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.48.0] - 2026-11-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `ChipSelector` `size="compact"`: a 28 px pill (padding 4/10, label 12/600, line height 18) drawn inside a transparent hit box of at least 44x44, on web as well as native (`hitSlop` is native-only on RN-web). Default size unchanged.
|
|
7
|
+
- `ChipSelector` `selectedFill`: background colour of a selected chip, passed by the app from its tokens; a selected chip then shows a leading check mark (decorative, `aria-hidden`, testID `<chip testID>-check`) and theme text ink. Works on both variants; `aria-checked` / `aria-pressed` unchanged. Unset keeps the current look.
|
|
8
|
+
- `ChipSize` type export.
|
|
9
|
+
|
|
3
10
|
## [1.47.0] - 2026-11-23
|
|
4
11
|
|
|
5
12
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -657,6 +657,9 @@ declare const enum ChipLabelWrap {
|
|
|
657
657
|
Truncate = "truncate"
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
+
/** Chip size. `default` = today's 44 px pill; `compact` = a 28 px pill inside a 44 px hit box. */
|
|
661
|
+
type ChipSize = 'default' | 'compact';
|
|
662
|
+
|
|
660
663
|
/**
|
|
661
664
|
* Public + internal types for ChipSelector. Split out of `ChipSelector.tsx` so the component, its
|
|
662
665
|
* two chip variants and the radio keyboard hook can share them without a circular import.
|
|
@@ -725,6 +728,10 @@ interface ChipSelectorProps<T> {
|
|
|
725
728
|
* stays a toggle button with `aria-pressed`.
|
|
726
729
|
*/
|
|
727
730
|
singleSelectRole?: ChipSingleSelectRole;
|
|
731
|
+
/** `compact` = a 28 px pill (padding 4/10, label 12/600) inside a 44 px hit box; defaults to `default`. */
|
|
732
|
+
size?: ChipSize;
|
|
733
|
+
/** Background of a selected chip, from the app's tokens; when set, a selected chip also shows a leading check. */
|
|
734
|
+
selectedFill?: string;
|
|
728
735
|
}
|
|
729
736
|
|
|
730
737
|
/**
|
|
@@ -747,7 +754,7 @@ interface ChipSelectorProps<T> {
|
|
|
747
754
|
* resolvers (`chipIdentity`, colours, radio key logic) in `utils/`.
|
|
748
755
|
*/
|
|
749
756
|
|
|
750
|
-
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;
|
|
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;
|
|
751
758
|
|
|
752
759
|
/**
|
|
753
760
|
* Reusable form switch/toggle with an optional description.
|
|
@@ -1983,4 +1990,4 @@ declare function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLa
|
|
|
1983
1990
|
declare function changedRules(previous: readonly PasswordRuleState[], next: readonly PasswordRuleState[]): PasswordRuleState[];
|
|
1984
1991
|
declare function ruleAnnouncement(changed: readonly PasswordRuleState[], labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>): string;
|
|
1985
1992
|
|
|
1986
|
-
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 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, 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 };
|
|
1993
|
+
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, 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,6 +657,9 @@ declare const enum ChipLabelWrap {
|
|
|
657
657
|
Truncate = "truncate"
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
+
/** Chip size. `default` = today's 44 px pill; `compact` = a 28 px pill inside a 44 px hit box. */
|
|
661
|
+
type ChipSize = 'default' | 'compact';
|
|
662
|
+
|
|
660
663
|
/**
|
|
661
664
|
* Public + internal types for ChipSelector. Split out of `ChipSelector.tsx` so the component, its
|
|
662
665
|
* two chip variants and the radio keyboard hook can share them without a circular import.
|
|
@@ -725,6 +728,10 @@ interface ChipSelectorProps<T> {
|
|
|
725
728
|
* stays a toggle button with `aria-pressed`.
|
|
726
729
|
*/
|
|
727
730
|
singleSelectRole?: ChipSingleSelectRole;
|
|
731
|
+
/** `compact` = a 28 px pill (padding 4/10, label 12/600) inside a 44 px hit box; defaults to `default`. */
|
|
732
|
+
size?: ChipSize;
|
|
733
|
+
/** Background of a selected chip, from the app's tokens; when set, a selected chip also shows a leading check. */
|
|
734
|
+
selectedFill?: string;
|
|
728
735
|
}
|
|
729
736
|
|
|
730
737
|
/**
|
|
@@ -747,7 +754,7 @@ interface ChipSelectorProps<T> {
|
|
|
747
754
|
* resolvers (`chipIdentity`, colours, radio key logic) in `utils/`.
|
|
748
755
|
*/
|
|
749
756
|
|
|
750
|
-
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;
|
|
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;
|
|
751
758
|
|
|
752
759
|
/**
|
|
753
760
|
* Reusable form switch/toggle with an optional description.
|
|
@@ -1983,4 +1990,4 @@ declare function RevealToggle({ revealed, onToggle, onPressIn, showLabel, hideLa
|
|
|
1983
1990
|
declare function changedRules(previous: readonly PasswordRuleState[], next: readonly PasswordRuleState[]): PasswordRuleState[];
|
|
1984
1991
|
declare function ruleAnnouncement(changed: readonly PasswordRuleState[], labels: Pick<PasswordFieldLabels, 'met' | 'unmet'>): string;
|
|
1985
1992
|
|
|
1986
|
-
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 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, 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 };
|
|
1993
|
+
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, 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
|
@@ -8,9 +8,9 @@ var designTokens = require('@dloizides/design-tokens');
|
|
|
8
8
|
var uiButtons = require('@dloizides/ui-buttons');
|
|
9
9
|
var reactDom = require('react-dom');
|
|
10
10
|
var a11y = require('@dloizides/a11y');
|
|
11
|
+
var uiIcons = require('@dloizides/ui-icons');
|
|
11
12
|
var apiClientBase = require('@dloizides/api-client-base');
|
|
12
13
|
var Svg = require('react-native-svg');
|
|
13
|
-
var uiIcons = require('@dloizides/ui-icons');
|
|
14
14
|
|
|
15
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
|
|
@@ -1417,19 +1417,57 @@ function chipLabelLayout(labelWrap) {
|
|
|
1417
1417
|
return { boxStyle: CAPPED_BOX, textStyle: SHRINKING_TEXT, numberOfLines: SINGLE_LINE };
|
|
1418
1418
|
return { boxStyle: void 0, textStyle: void 0, numberOfLines: void 0 };
|
|
1419
1419
|
}
|
|
1420
|
+
var MIN_TARGET_PX = 44;
|
|
1421
|
+
var COMPACT_PAD_V = 4;
|
|
1422
|
+
var COMPACT_PAD_H = 10;
|
|
1423
|
+
var COMPACT_FONT_SIZE = 12;
|
|
1424
|
+
var COMPACT_LINE_HEIGHT = 18;
|
|
1425
|
+
var CHIP_BORDER = 1;
|
|
1426
|
+
var chipSizeStyles = reactNative.StyleSheet.create({
|
|
1427
|
+
compactHitBox: {
|
|
1428
|
+
minHeight: MIN_TARGET_PX,
|
|
1429
|
+
minWidth: MIN_TARGET_PX,
|
|
1430
|
+
justifyContent: "center",
|
|
1431
|
+
alignItems: "center"
|
|
1432
|
+
},
|
|
1433
|
+
compactVisual: {
|
|
1434
|
+
paddingVertical: COMPACT_PAD_V,
|
|
1435
|
+
paddingHorizontal: COMPACT_PAD_H,
|
|
1436
|
+
minHeight: 0,
|
|
1437
|
+
minWidth: 0,
|
|
1438
|
+
borderWidth: CHIP_BORDER
|
|
1439
|
+
},
|
|
1440
|
+
compactText: {
|
|
1441
|
+
fontSize: COMPACT_FONT_SIZE,
|
|
1442
|
+
fontWeight: "600",
|
|
1443
|
+
lineHeight: COMPACT_LINE_HEIGHT
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
|
|
1447
|
+
// src/ChipSelector/utils/chipLook.ts
|
|
1448
|
+
function chipFill({ selected, selectedFill, ink, rest }) {
|
|
1449
|
+
if (!selected || selectedFill === void 0)
|
|
1450
|
+
return { ...rest, checkColor: void 0 };
|
|
1451
|
+
return { backgroundColor: selectedFill, textColor: ink, checkColor: ink };
|
|
1452
|
+
}
|
|
1453
|
+
function chipSizeLook(size) {
|
|
1454
|
+
if (size !== "compact")
|
|
1455
|
+
return { hitBox: void 0, visual: void 0, text: void 0 };
|
|
1456
|
+
return { hitBox: chipSizeStyles.compactHitBox, visual: chipSizeStyles.compactVisual, text: chipSizeStyles.compactText };
|
|
1457
|
+
}
|
|
1420
1458
|
var SOLID_RADIUS = 20;
|
|
1421
1459
|
var OUTLINE_RADIUS = 999;
|
|
1422
1460
|
var OUTLINE_PAD_H = 12;
|
|
1423
1461
|
var OUTLINE_PAD_V = 5;
|
|
1424
1462
|
var OUTLINE_FONT_SIZE = 13;
|
|
1425
1463
|
var CHIP_ICON_GAP = 6;
|
|
1426
|
-
var
|
|
1464
|
+
var MIN_TARGET_PX2 = 44;
|
|
1427
1465
|
var chipStyles = reactNative.StyleSheet.create({
|
|
1428
1466
|
chip: {
|
|
1429
1467
|
paddingHorizontal: 12,
|
|
1430
1468
|
paddingVertical: 6,
|
|
1431
|
-
minHeight:
|
|
1432
|
-
minWidth:
|
|
1469
|
+
minHeight: MIN_TARGET_PX2,
|
|
1470
|
+
minWidth: MIN_TARGET_PX2,
|
|
1433
1471
|
justifyContent: "center",
|
|
1434
1472
|
borderRadius: SOLID_RADIUS,
|
|
1435
1473
|
backgroundColor: TRANSPARENT_COLOR,
|
|
@@ -1438,8 +1476,8 @@ var chipStyles = reactNative.StyleSheet.create({
|
|
|
1438
1476
|
chipOutline: {
|
|
1439
1477
|
paddingHorizontal: OUTLINE_PAD_H,
|
|
1440
1478
|
paddingVertical: OUTLINE_PAD_V,
|
|
1441
|
-
minHeight:
|
|
1442
|
-
minWidth:
|
|
1479
|
+
minHeight: MIN_TARGET_PX2,
|
|
1480
|
+
minWidth: MIN_TARGET_PX2,
|
|
1443
1481
|
justifyContent: "center",
|
|
1444
1482
|
borderRadius: OUTLINE_RADIUS,
|
|
1445
1483
|
borderWidth: 1
|
|
@@ -1448,12 +1486,16 @@ var chipStyles = reactNative.StyleSheet.create({
|
|
|
1448
1486
|
chipText: {},
|
|
1449
1487
|
chipTextOutline: { fontSize: OUTLINE_FONT_SIZE }
|
|
1450
1488
|
});
|
|
1451
|
-
|
|
1489
|
+
var CHECK_SIZE = 12;
|
|
1490
|
+
function ChipContent(props) {
|
|
1491
|
+
const { icon, label, textStyle, numberOfLines, checkColor } = props;
|
|
1452
1492
|
const text = /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines, style: textStyle, children: label });
|
|
1453
|
-
|
|
1493
|
+
const hasIcon = icon !== void 0 && icon !== null;
|
|
1494
|
+
if (!hasIcon && checkColor === void 0)
|
|
1454
1495
|
return text;
|
|
1455
1496
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: chipStyles.chipContent, children: [
|
|
1456
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, children:
|
|
1497
|
+
checkColor === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, testID: props.checkTestID, children: /* @__PURE__ */ jsxRuntime.jsx(uiIcons.SvgIcon, { color: checkColor, name: "check", size: CHECK_SIZE }) }),
|
|
1498
|
+
hasIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, children: icon }) : null,
|
|
1457
1499
|
text
|
|
1458
1500
|
] });
|
|
1459
1501
|
}
|
|
@@ -1462,8 +1504,13 @@ function OutlineChip(props) {
|
|
|
1462
1504
|
const [hovered, setHovered] = React38__default.default.useState(false);
|
|
1463
1505
|
const active = selected || hovered;
|
|
1464
1506
|
const borderColor = active ? colors.primary : colors.border;
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1507
|
+
const fill = chipFill({
|
|
1508
|
+
selected,
|
|
1509
|
+
selectedFill: props.selectedFill,
|
|
1510
|
+
ink: colors.textStrong,
|
|
1511
|
+
rest: { backgroundColor: selected ? colors.tint : colors.muted, textColor: active ? colors.primary : colors.textMuted }
|
|
1512
|
+
});
|
|
1513
|
+
const sized = chipSizeLook(props.size);
|
|
1467
1514
|
const layout = chipLabelLayout(option.labelWrap);
|
|
1468
1515
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1469
1516
|
reactNative.Pressable,
|
|
@@ -1477,19 +1524,21 @@ function OutlineChip(props) {
|
|
|
1477
1524
|
"aria-pressed": props.ariaPressed,
|
|
1478
1525
|
disabled,
|
|
1479
1526
|
hitSlop: CHIP_HIT_SLOP,
|
|
1480
|
-
style: layout.boxStyle,
|
|
1527
|
+
style: [sized.hitBox, layout.boxStyle],
|
|
1481
1528
|
tabIndex: props.tabIndex,
|
|
1482
1529
|
testID,
|
|
1483
1530
|
onHoverIn: () => setHovered(true),
|
|
1484
1531
|
onHoverOut: () => setHovered(false),
|
|
1485
1532
|
onPress,
|
|
1486
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chipOutline, { borderColor, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chipOutline, sized.visual, { borderColor, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1487
1534
|
ChipContent,
|
|
1488
1535
|
{
|
|
1536
|
+
checkColor: fill.checkColor,
|
|
1537
|
+
checkTestID: `${testID}-check`,
|
|
1489
1538
|
icon: option.icon,
|
|
1490
1539
|
label: option.label,
|
|
1491
1540
|
numberOfLines: layout.numberOfLines,
|
|
1492
|
-
textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, { color: textColor }, layout.textStyle]
|
|
1541
|
+
textStyle: [chipStyles.chipText, chipStyles.chipTextOutline, sized.text, { color: fill.textColor }, layout.textStyle]
|
|
1493
1542
|
}
|
|
1494
1543
|
) })
|
|
1495
1544
|
}
|
|
@@ -1497,8 +1546,13 @@ function OutlineChip(props) {
|
|
|
1497
1546
|
}
|
|
1498
1547
|
function SolidChip(props) {
|
|
1499
1548
|
const { option, selected, disabled, colors, testID, accessibilityHint, onPress } = props;
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1549
|
+
const fill = chipFill({
|
|
1550
|
+
selected,
|
|
1551
|
+
selectedFill: props.selectedFill,
|
|
1552
|
+
ink: colors.textStrong,
|
|
1553
|
+
rest: { backgroundColor: selected ? colors.primary : TRANSPARENT_COLOR, textColor: selected ? colors.onPrimary : colors.textStrong }
|
|
1554
|
+
});
|
|
1555
|
+
const sized = chipSizeLook(props.size);
|
|
1502
1556
|
const layout = chipLabelLayout(option.labelWrap);
|
|
1503
1557
|
const rovingTabStop = { tabIndex: props.tabIndex };
|
|
1504
1558
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1513,17 +1567,19 @@ function SolidChip(props) {
|
|
|
1513
1567
|
"aria-pressed": props.ariaPressed,
|
|
1514
1568
|
disabled,
|
|
1515
1569
|
hitSlop: CHIP_HIT_SLOP,
|
|
1516
|
-
style: layout.boxStyle,
|
|
1570
|
+
style: [sized.hitBox, layout.boxStyle],
|
|
1517
1571
|
testID,
|
|
1518
1572
|
onPress,
|
|
1519
1573
|
...rovingTabStop,
|
|
1520
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, { borderColor: colors.border, backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1574
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [chipStyles.chip, sized.visual, { borderColor: colors.border, backgroundColor: fill.backgroundColor }, layout.boxStyle], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1521
1575
|
ChipContent,
|
|
1522
1576
|
{
|
|
1577
|
+
checkColor: fill.checkColor,
|
|
1578
|
+
checkTestID: `${testID}-check`,
|
|
1523
1579
|
icon: option.icon,
|
|
1524
1580
|
label: option.label,
|
|
1525
1581
|
numberOfLines: layout.numberOfLines,
|
|
1526
|
-
textStyle: [chipStyles.chipText, { color: textColor }, layout.textStyle]
|
|
1582
|
+
textStyle: [chipStyles.chipText, sized.text, { color: fill.textColor }, layout.textStyle]
|
|
1527
1583
|
}
|
|
1528
1584
|
) })
|
|
1529
1585
|
}
|
|
@@ -1668,7 +1724,9 @@ var ChipSelector = ({
|
|
|
1668
1724
|
testID,
|
|
1669
1725
|
chipTestIDPrefix = DEFAULT_CHIP_TESTID_PREFIX,
|
|
1670
1726
|
optionAccessibilityHint,
|
|
1671
|
-
singleSelectRole = "button"
|
|
1727
|
+
singleSelectRole = "button",
|
|
1728
|
+
size = "default",
|
|
1729
|
+
selectedFill
|
|
1672
1730
|
}) => {
|
|
1673
1731
|
const isRadioGroup = !multiple && singleSelectRole === "radio";
|
|
1674
1732
|
const { theme } = uiFeedback.useUi();
|
|
@@ -1693,6 +1751,8 @@ var ChipSelector = ({
|
|
|
1693
1751
|
disabled,
|
|
1694
1752
|
option,
|
|
1695
1753
|
selected,
|
|
1754
|
+
size,
|
|
1755
|
+
selectedFill,
|
|
1696
1756
|
...chipIdentity(option, selected, {
|
|
1697
1757
|
prefix: chipTestIDPrefix,
|
|
1698
1758
|
hint: optionAccessibilityHint,
|
|
@@ -5683,7 +5743,7 @@ var GatedChecklist = ({ title, items, checked, onToggle, testID, disabled = fals
|
|
|
5683
5743
|
children?.(complete)
|
|
5684
5744
|
] });
|
|
5685
5745
|
};
|
|
5686
|
-
var
|
|
5746
|
+
var MIN_TARGET_PX3 = 44;
|
|
5687
5747
|
var DOT_SIZE = 18;
|
|
5688
5748
|
var DOT_INNER = 8;
|
|
5689
5749
|
var ROW_GAP6 = 10;
|
|
@@ -5700,7 +5760,7 @@ var styles35 = reactNative.StyleSheet.create({
|
|
|
5700
5760
|
borderWidth: 1,
|
|
5701
5761
|
columnGap: ROW_GAP6,
|
|
5702
5762
|
flexDirection: "row",
|
|
5703
|
-
minHeight:
|
|
5763
|
+
minHeight: MIN_TARGET_PX3,
|
|
5704
5764
|
paddingHorizontal: PAD_H2,
|
|
5705
5765
|
paddingVertical: PAD_V2
|
|
5706
5766
|
},
|
|
@@ -5991,7 +6051,7 @@ function ruleTone(met, flagUnmet) {
|
|
|
5991
6051
|
return flagUnmet ? "refused" /* Refused */ : "unmet" /* Unmet */;
|
|
5992
6052
|
}
|
|
5993
6053
|
var MARK_SIZE = 16;
|
|
5994
|
-
var
|
|
6054
|
+
var CHECK_SIZE2 = 12;
|
|
5995
6055
|
var RING_WIDTH = 1.5;
|
|
5996
6056
|
var POP_FROM = 0.6;
|
|
5997
6057
|
var POP_PEAK = 1.12;
|
|
@@ -6018,7 +6078,7 @@ function RuleMark({ tone, colors }) {
|
|
|
6018
6078
|
}, [met, reduced, scale]);
|
|
6019
6079
|
const color = colors.mark[tone];
|
|
6020
6080
|
const shape = met ? { backgroundColor: color } : [styles40.ring, { borderColor: color }];
|
|
6021
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles40.mark, shape], children: met ? /* @__PURE__ */ jsxRuntime.jsx(uiIcons.SvgIcon, { color: colors.onMark, name: "check", size:
|
|
6081
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Animated.View, { style: { transform: [{ scale }] }, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles40.mark, shape], children: met ? /* @__PURE__ */ jsxRuntime.jsx(uiIcons.SvgIcon, { color: colors.onMark, name: "check", size: CHECK_SIZE2 }) : null }) });
|
|
6022
6082
|
}
|
|
6023
6083
|
var GAP8 = 6;
|
|
6024
6084
|
var ROW_GAP8 = 8;
|
|
@@ -6028,7 +6088,7 @@ var METER_HEIGHT = 4;
|
|
|
6028
6088
|
var RADIUS3 = 999;
|
|
6029
6089
|
var CHIP_PAD_V2 = 4;
|
|
6030
6090
|
var CHIP_PAD_H2 = 10;
|
|
6031
|
-
var
|
|
6091
|
+
var CHIP_BORDER2 = 1;
|
|
6032
6092
|
var HALF4 = "50%";
|
|
6033
6093
|
var styles41 = reactNative.StyleSheet.create({
|
|
6034
6094
|
column: { gap: GAP8 },
|
|
@@ -6039,7 +6099,7 @@ var styles41 = reactNative.StyleSheet.create({
|
|
|
6039
6099
|
grid: { flexDirection: "row", flexWrap: "wrap", rowGap: GAP8 },
|
|
6040
6100
|
cell: { flexBasis: HALF4, maxWidth: HALF4, paddingRight: GAP8 },
|
|
6041
6101
|
chips: { flexDirection: "row", flexWrap: "wrap", gap: GAP8 },
|
|
6042
|
-
chip: { borderRadius: RADIUS3, borderWidth:
|
|
6102
|
+
chip: { borderRadius: RADIUS3, borderWidth: CHIP_BORDER2, paddingVertical: CHIP_PAD_V2, paddingHorizontal: CHIP_PAD_H2 },
|
|
6043
6103
|
metPhrase: { fontWeight: "700", textDecorationLine: "underline" }
|
|
6044
6104
|
});
|
|
6045
6105
|
function RuleList({ rules, flagUnmet, colors, testID, listStyle, itemStyle, outlined = false }) {
|