@payfit/unity-components 2.0.0 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/alert/Alert.js +41 -29
- package/dist/esm/components/alert/parts/AlertTitle.js +8 -8
- package/dist/esm/components/app-layout/AppLayout.d.ts +2 -0
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +23 -23
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +1 -1
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +9 -9
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +0 -9
- package/dist/esm/components/autocomplete/Autocomplete.js +54 -57
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.js +8 -8
- package/dist/esm/components/avatar/Avatar.variants.js +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.js +26 -27
- package/dist/esm/components/badge/Badge.js +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +1 -1
- package/dist/esm/components/button/Button.js +6 -6
- package/dist/esm/components/button/Button.variants.d.ts +1 -0
- package/dist/esm/components/button/Button.variants.js +22 -15
- package/dist/esm/components/card/Card.context.d.ts +5 -0
- package/dist/esm/components/card/Card.context.js +14 -0
- package/dist/esm/components/card/Card.d.ts +210 -0
- package/dist/esm/components/card/Card.js +93 -0
- package/dist/esm/components/card/parts/CardContent.d.ts +37 -0
- package/dist/esm/components/card/parts/CardContent.js +8 -0
- package/dist/esm/components/card/parts/CardTitle.d.ts +55 -0
- package/dist/esm/components/card/parts/CardTitle.js +33 -0
- package/dist/esm/components/checkbox/Checkbox.js +38 -30
- package/dist/esm/components/checkbox/Checkbox.variants.d.ts +9 -9
- package/dist/esm/components/checkbox/Checkbox.variants.js +23 -7
- package/dist/esm/components/checkbox/TanstackCheckbox.d.ts +28 -0
- package/dist/esm/components/checkbox/TanstackCheckbox.js +51 -0
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +7 -7
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.d.ts +14 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.js +40 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.d.ts +4 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.js +37 -0
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.d.ts +72 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.js +40 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationNavButton.js +1 -1
- package/dist/esm/components/client-side-pagination/parts/RawPaginationLink.js +10 -10
- package/dist/esm/components/collapsible/parts/CollapsibleContent.js +5 -5
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +8 -8
- package/dist/esm/components/data-table/DataTable.d.ts +109 -16
- package/dist/esm/components/data-table/DataTable.js +107 -93
- package/dist/esm/components/data-table/mocks/employee-data.d.ts +1 -0
- package/dist/esm/components/date-calendar/DateCalendar.js +1 -1
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +1 -1
- package/dist/esm/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/esm/components/date-picker/DatePicker.js +59 -50
- package/dist/esm/components/date-picker/TanstackDatePicker.d.ts +22 -0
- package/dist/esm/components/date-picker/TanstackDatePicker.js +53 -0
- package/dist/esm/components/date-picker/parts/DateInput.js +4 -4
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.d.ts +71 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.js +41 -0
- package/dist/esm/components/definition-list/DefinitionList.context.d.ts +19 -0
- package/dist/esm/components/definition-list/DefinitionList.d.ts +24 -0
- package/dist/esm/components/definition-list/parts/DefinitionItem.d.ts +25 -0
- package/dist/esm/components/dialog/Dialog.d.ts +34 -22
- package/dist/esm/components/dialog/Dialog.js +90 -52
- package/dist/esm/components/dialog/parts/DialogActions.js +6 -6
- package/dist/esm/components/dialog/parts/DialogTitle.js +7 -4
- package/dist/esm/components/dialog/test-utils.d.ts +28 -0
- package/dist/esm/components/dialog/test-utils.js +78 -0
- package/dist/esm/components/error-state/ErrorState.js +7 -7
- package/dist/esm/components/filter/Filter.controls.d.ts +192 -0
- package/dist/esm/components/filter/Filter.controls.js +45 -0
- package/dist/esm/components/filter/Filter.d.ts +189 -0
- package/dist/esm/components/filter/Filter.js +147 -0
- package/dist/esm/components/filter/Filter.types.d.ts +121 -0
- package/dist/esm/components/filter/hooks/useFilterIds.d.ts +49 -0
- package/dist/esm/components/filter/hooks/useFilterIds.js +13 -0
- package/dist/esm/components/filter/hooks/useFilterState.d.ts +74 -0
- package/dist/esm/components/filter/hooks/useFilterState.js +23 -0
- package/dist/esm/components/filter/hooks/useFilterValue.d.ts +61 -0
- package/dist/esm/components/filter/hooks/useFilterValue.js +31 -0
- package/dist/esm/components/filter/parts/FilterButton.d.ts +75 -0
- package/dist/esm/components/filter/parts/FilterButton.js +55 -0
- package/dist/esm/components/filter/parts/FilterLabel.d.ts +96 -0
- package/dist/esm/components/filter/parts/FilterLabel.js +57 -0
- package/dist/esm/components/filter/parts/FilterPopover.d.ts +95 -0
- package/dist/esm/components/filter/parts/FilterPopover.js +79 -0
- package/dist/esm/components/filter/utils/value-formatters.d.ts +62 -0
- package/dist/esm/components/filter/utils/value-formatters.js +14 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.d.ts +110 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.js +172 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.types.d.ts +119 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.d.ts +96 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.js +132 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.d.ts +63 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.js +107 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.d.ts +18 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.js +18 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.d.ts +93 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.js +88 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.d.ts +24 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.js +19 -0
- package/dist/esm/components/form/Form.d.ts +2 -0
- package/dist/esm/components/form/TanstackForm.d.ts +24 -0
- package/dist/esm/components/form/TanstackForm.js +29 -0
- package/dist/esm/components/form-field/FormField.d.ts +2 -0
- package/dist/esm/components/form-field/TanstackFormField.context.d.ts +10 -0
- package/dist/esm/components/form-field/TanstackFormField.context.js +14 -0
- package/dist/esm/components/form-field/TanstackFormField.d.ts +49 -0
- package/dist/esm/components/form-field/TanstackFormField.js +46 -0
- package/dist/esm/components/form-field/parts/FormControl.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormFeedbackText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormHelperText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormLabel.d.ts +2 -0
- package/dist/esm/components/form-field/parts/RawFormContextualLink.d.ts +2 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.d.ts +12 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.js +32 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.d.ts +11 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.js +25 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.d.ts +8 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.js +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.d.ts +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.js +45 -0
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +9 -9
- package/dist/esm/components/icon-button/CircularIconButton.js +53 -36
- package/dist/esm/components/icon-button/IconButton.variants.d.ts +1 -0
- package/dist/esm/components/icon-button/IconButton.variants.js +44 -28
- package/dist/esm/components/input/Input.js +36 -35
- package/dist/esm/components/input/TanstackInput.d.ts +22 -0
- package/dist/esm/components/input/TanstackInput.js +38 -0
- package/dist/esm/components/label/Label.js +12 -12
- package/dist/esm/components/link/RawLink.js +38 -31
- package/dist/esm/components/list-view/ListView.d.ts +56 -0
- package/dist/esm/components/list-view/ListView.fixtures.d.ts +20 -0
- package/dist/esm/components/list-view/ListView.js +44 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.d.ts +34 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.d.ts +33 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewSection.d.ts +14 -0
- package/dist/esm/components/list-view/parts/ListViewSection.js +21 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.d.ts +102 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.js +80 -0
- package/dist/esm/components/multi-select/MultiSelect.d.ts +5 -7
- package/dist/esm/components/multi-select/MultiSelect.js +199 -176
- package/dist/esm/components/multi-select/MultiselectTypes.d.ts +114 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.d.ts +7 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.js +41 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.d.ts +2 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +62 -46
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +15 -15
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +45 -12
- package/dist/esm/components/multi-select-field/MultiSelectField.js +56 -66
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.d.ts +92 -0
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.js +48 -0
- package/dist/esm/components/multi-select-field/test-utils.d.ts +17 -0
- package/dist/esm/components/multi-select-field/test-utils.js +45 -0
- package/dist/esm/components/nav/parts/RawNavItem.js +6 -6
- package/dist/esm/components/navigation-card/NavigationCard.context.d.ts +31 -0
- package/dist/esm/components/navigation-card/NavigationCard.context.js +13 -0
- package/dist/esm/components/navigation-card/NavigationCard.d.ts +46 -0
- package/dist/esm/components/navigation-card/NavigationCard.js +62 -0
- package/dist/esm/components/navigation-card/NavigationCard.types.d.ts +37 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.d.ts +1147 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.js +164 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.d.ts +39 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.js +22 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.d.ts +146 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.js +93 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.d.ts +32 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.js +24 -0
- package/dist/esm/components/number-field/NumberField.d.ts +2 -0
- package/dist/esm/components/number-field/TanstackNumberField.d.ts +74 -0
- package/dist/esm/components/number-field/TanstackNumberField.js +44 -0
- package/dist/esm/components/number-input/NumberInput.js +31 -29
- package/dist/esm/components/number-input/TanstackNumberInput.d.ts +58 -0
- package/dist/esm/components/number-input/TanstackNumberInput.js +38 -0
- package/dist/esm/components/page/Page.js +12 -11
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +22 -22
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +13 -13
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +10 -10
- package/dist/esm/components/payfit-brand/PayFitBrand.d.ts +4 -0
- package/dist/esm/components/payfit-brand/PayFitBrand.js +30 -22
- package/dist/esm/components/payfit-brand/PayFitPreprod.js +25 -25
- package/dist/esm/components/phone-number/PhoneNumberInput.d.ts +67 -0
- package/dist/esm/components/phone-number/PhoneNumberInput.js +322 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.d.ts +64 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.js +33 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.d.ts +42 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.js +68 -0
- package/dist/esm/components/phone-number/unknownFlag.svg.js +4 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.d.ts +15 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.js +32 -0
- package/dist/esm/components/pill/Pill.d.ts +2 -2
- package/dist/esm/components/pill/Pill.js +8 -8
- package/dist/esm/components/popover/Popover.js +6 -6
- package/dist/esm/components/promo-dialog/PromoDialog.d.ts +149 -0
- package/dist/esm/components/promo-dialog/PromoDialog.js +219 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.d.ts +44 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.js +29 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.d.ts +43 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.js +20 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.d.ts +47 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.js +25 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.d.ts +53 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.js +21 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.d.ts +6 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.js +18 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.d.ts +13 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.js +43 -0
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +29 -11
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +53 -51
- package/dist/esm/components/radio-button-group-field/RadioButtonGroupField.d.ts +2 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.d.ts +13 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.js +38 -0
- package/dist/esm/components/search/Search.js +46 -46
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +5 -5
- package/dist/esm/components/select/Select.d.ts +5 -4
- package/dist/esm/components/select/Select.js +53 -45
- package/dist/esm/components/select/TanstackSelect.d.ts +80 -0
- package/dist/esm/components/select/TanstackSelect.js +34 -0
- package/dist/esm/components/select/parts/SearchInput.d.ts +4 -1
- package/dist/esm/components/select/parts/SearchInput.js +49 -31
- package/dist/esm/components/select/parts/SelectButton.js +19 -17
- package/dist/esm/components/select-field/SelectField.d.ts +2 -0
- package/dist/esm/components/select-field/SelectField.js +8 -9
- package/dist/esm/components/select-field/TanstackSelectField.d.ts +124 -0
- package/dist/esm/components/select-field/TanstackSelectField.js +44 -0
- package/dist/esm/components/select-list/SelectList.d.ts +95 -0
- package/dist/esm/components/select-list/SelectList.js +79 -0
- package/dist/esm/components/select-list/SelectList.types.d.ts +29 -0
- package/dist/esm/components/select-list/constants.d.ts +36 -0
- package/dist/esm/components/select-list/constants.js +29 -0
- package/dist/esm/components/select-list/helpers.d.ts +42 -0
- package/dist/esm/components/select-list/helpers.js +48 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.js +16 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.js +31 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.d.ts +8 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.js +25 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.d.ts +118 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.js +28 -0
- package/dist/esm/components/select-list/parts/SelectListOption.d.ts +24 -0
- package/dist/esm/components/select-list/parts/SelectListOption.js +72 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.d.ts +2 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.js +43 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.d.ts +54 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.js +35 -0
- package/dist/esm/components/select-list/utils/partition.d.ts +13 -0
- package/dist/esm/components/select-list/utils/partition.js +9 -0
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.context.d.ts +1 -5
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.ts +6 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +23 -23
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.d.ts +27 -0
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.js +34 -0
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.d.ts +1 -16
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +56 -57
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.d.ts +81 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.js +47 -0
- package/dist/esm/components/selectable-card/internals/Description.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/SelectableCardCheckboxGroup.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.d.ts +26 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/parts/SelectableCardCheckbox.js +24 -24
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.d.ts +2 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.js +12 -14
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.d.ts +28 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +14 -13
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.js +27 -25
- package/dist/esm/components/selectable-card/selectableCard.variant.js +5 -5
- package/dist/esm/components/selectable-card-checkbox-group-field/SelectableCardCheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.js +38 -0
- package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.js +38 -0
- package/dist/esm/components/table/Table.context.d.ts +5 -0
- package/dist/esm/components/table/Table.context.js +14 -13
- package/dist/esm/components/table/Table.d.ts +93 -0
- package/dist/esm/components/table/Table.js +135 -107
- package/dist/esm/components/table/parts/TableBody.js +83 -21
- package/dist/esm/components/table/parts/TableEmptyState.js +6 -6
- package/dist/esm/components/table/parts/TableHeader.js +1 -1
- package/dist/esm/components/table/parts/TablePagination.js +1 -1
- package/dist/esm/components/table/parts/TableRow.js +1 -0
- package/dist/esm/components/tabs/Tabs.variant.d.ts +0 -6
- package/dist/esm/components/tabs/Tabs.variant.js +11 -12
- package/dist/esm/components/task-menu/parts/RawSubTask.js +26 -26
- package/dist/esm/components/task-menu/parts/RawTask.js +32 -28
- package/dist/esm/components/task-menu/parts/TaskGroup.js +30 -26
- package/dist/esm/components/task-menu/parts/task.variants.js +4 -2
- package/dist/esm/components/text/Text.d.ts +11 -1
- package/dist/esm/components/text/Text.js +41 -31
- package/dist/esm/components/text/Text.variants.d.ts +12 -0
- package/dist/esm/components/text/Text.variants.js +4 -0
- package/dist/esm/components/text-area/TanstackTextArea.d.ts +21 -0
- package/dist/esm/components/text-area/TanstackTextArea.js +35 -0
- package/dist/esm/components/text-area/TextArea.js +31 -29
- package/dist/esm/components/text-field/TanstackTextField.d.ts +79 -0
- package/dist/esm/components/text-field/TanstackTextField.js +60 -0
- package/dist/esm/components/text-field/TextField.d.ts +2 -0
- package/dist/esm/components/toast/UnityToast.js +5 -5
- package/dist/esm/components/toast/test-utils.d.ts +36 -0
- package/dist/esm/components/toast/test-utils.js +118 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.d.ts +46 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.js +25 -0
- package/dist/esm/components/toggle-switch/ToggleSwitch.d.ts +21 -9
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +71 -32
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.d.ts +11 -0
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.js +34 -0
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.d.ts +57 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.js +23 -0
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +1 -1
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.d.ts +19 -0
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.js +50 -0
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -0
- package/dist/esm/docs/{table → examples/data}/mocks/employee-columns.d.ts +1 -1
- package/dist/esm/hooks/tanstack-form-context.d.ts +1 -0
- package/dist/esm/hooks/tanstack-form-context.js +8 -0
- package/dist/esm/hooks/use-form.d.ts +2 -0
- package/dist/esm/hooks/use-has-scroll.d.ts +71 -0
- package/dist/esm/hooks/use-has-scroll.js +75 -0
- package/dist/esm/hooks/use-tanstack-form.d.ts +369 -0
- package/dist/esm/hooks/use-tanstack-form.js +209 -0
- package/dist/esm/index.d.ts +44 -20
- package/dist/esm/index.js +457 -394
- package/dist/esm/index.storybook-testing.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +6 -1
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/TanstackFormContextualLink.d.ts +43 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.d.ts +34 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.js +25 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.js +32 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.d.ts +73 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.js +37 -0
- package/dist/esm/integrations/tanstack-router/index.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +1 -1
- package/dist/esm/integrations/tanstack-router.js +32 -26
- package/dist/esm/mocks/employees.d.ts +1 -5
- package/dist/esm/storybook-testing.js +8 -2
- package/dist/esm/storybook-utilities/previewTransform.d.ts +1 -0
- package/dist/esm/utils/scroll-detection.d.ts +77 -0
- package/dist/esm/utils/scroll-detection.js +33 -0
- package/dist/esm/utils/spacing.d.ts +63 -0
- package/dist/esm/utils/spacing.js +15 -0
- package/i18n/en-GB.json +21 -8
- package/i18n/es-ES.json +23 -10
- package/i18n/fr-FR.json +24 -11
- package/package.json +41 -42
- package/dist/esm/components/multi-select/Multiselect.types.d.ts +0 -109
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.d.ts +0 -6
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.js +0 -28
- package/dist/esm/integrations/react-router/v5/index.d.ts +0 -1
- package/dist/esm/integrations/react-router/v5.js +0 -4
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { Badge as
|
|
5
|
-
const
|
|
6
|
-
({ label: l, description:
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as t, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import o from "../../hooks/use-id.js";
|
|
4
|
+
import { Badge as f } from "../badge/Badge.js";
|
|
5
|
+
const u = p(
|
|
6
|
+
({ label: l, description: e, env: d, showOnlyMonogram: a = !1, ...s }, v) => {
|
|
7
|
+
const r = o(), h = `payfit-preprod-title-${r}`, i = `payfit-preprod-desc-${r}`, n = {
|
|
8
8
|
focusable: !1,
|
|
9
9
|
role: "img",
|
|
10
|
-
"aria-labelledby":
|
|
11
|
-
...
|
|
12
|
-
},
|
|
13
|
-
...
|
|
14
|
-
...
|
|
10
|
+
"aria-labelledby": h,
|
|
11
|
+
...e && { "aria-describedby": i }
|
|
12
|
+
}, m = {
|
|
13
|
+
...s,
|
|
14
|
+
...n
|
|
15
15
|
};
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ t("span", { className: "uy:flex uy:gap-200 uy:items-center", children: [
|
|
17
|
+
/* @__PURE__ */ t(
|
|
18
18
|
"svg",
|
|
19
19
|
{
|
|
20
|
-
...
|
|
20
|
+
...m,
|
|
21
21
|
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
-
viewBox: "0 0 104 32",
|
|
22
|
+
viewBox: a ? "0 0 32 32" : "0 0 104 32",
|
|
23
23
|
fill: "none",
|
|
24
|
-
ref:
|
|
25
|
-
width: 104,
|
|
24
|
+
ref: v,
|
|
25
|
+
width: a ? 32 : 104,
|
|
26
26
|
height: 32,
|
|
27
|
-
className: "uy:min-w-[104px]",
|
|
27
|
+
className: a ? "uy:min-w-[32px]" : "uy:min-w-[104px]",
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */ c("title", { id:
|
|
30
|
-
|
|
29
|
+
/* @__PURE__ */ c("title", { id: h, children: l }),
|
|
30
|
+
e && /* @__PURE__ */ c("desc", { id: i, children: e }),
|
|
31
31
|
/* @__PURE__ */ c(
|
|
32
32
|
"path",
|
|
33
33
|
{
|
|
@@ -37,7 +37,7 @@ const f = v(
|
|
|
37
37
|
clipRule: "evenodd"
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
/* @__PURE__ */ c(
|
|
40
|
+
!a && /* @__PURE__ */ c(
|
|
41
41
|
"path",
|
|
42
42
|
{
|
|
43
43
|
className: "uy:fill-content-neutral",
|
|
@@ -47,11 +47,11 @@ const f = v(
|
|
|
47
47
|
]
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
/* @__PURE__ */ c(
|
|
50
|
+
/* @__PURE__ */ c(f, { variant: "warning", children: d })
|
|
51
51
|
] });
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
|
|
54
|
+
u.displayName = "PayFitBrandPreprod";
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
u as PayFitBrandPreprod
|
|
57
57
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { InputProps as AriaInputProps } from 'react-aria-components';
|
|
2
|
+
import { CountryIso2, PhoneInputProps } from 'react-international-phone';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for the PhoneNumberInput component props.
|
|
5
|
+
*/
|
|
6
|
+
export interface PhoneNumberInputProps extends Omit<AriaInputProps, 'value' | 'style' | 'className' | 'onChange' | 'disabled' | 'aria-label'>, Omit<PhoneInputProps, 'countries' | 'preferredCountries' | 'disableDialCodePrefill' | 'inputRefProp'> {
|
|
7
|
+
/**
|
|
8
|
+
* Function called when the phone number value changes.
|
|
9
|
+
* @param phone The formatted phone number.
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (phone: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* ISO2 code of the country selected by default.
|
|
14
|
+
*/
|
|
15
|
+
defaultCountry?: CountryIso2;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the input is in an invalid state.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
isInvalid?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the input is disabled.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Function called when the clear button is pressed.
|
|
28
|
+
*/
|
|
29
|
+
onClearButtonPress?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Accessibility label for the phone number input.
|
|
32
|
+
*/
|
|
33
|
+
'aria-label': string;
|
|
34
|
+
/**
|
|
35
|
+
* Accessibility label for the country search input.
|
|
36
|
+
*/
|
|
37
|
+
searchInputAriaLabel: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The `PhoneNumberInput` component displays a styled phone number input field that follows the Unity design system language. It supports multiple states out of the box and can be used as a controlled or uncontrolled component. It is also compatible with the `Form` and `FormField` component as a form control.
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { PhoneNumberInput } from '@payfit/unity-components'
|
|
44
|
+
* import { useState } from 'react'
|
|
45
|
+
*
|
|
46
|
+
* function Example() {
|
|
47
|
+
* const [value, setValue] = useState('')
|
|
48
|
+
*
|
|
49
|
+
* const handlePhoneChange = (phone: string) => {
|
|
50
|
+
* setValue(phone)
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* return (
|
|
54
|
+
* <PhoneNumberInput
|
|
55
|
+
* aria-label="Phone number"
|
|
56
|
+
* placeholder="+33 6 12 34 56 78"
|
|
57
|
+
* value={value}
|
|
58
|
+
* onChange={handlePhoneChange}
|
|
59
|
+
* defaultCountry="fr"
|
|
60
|
+
* />
|
|
61
|
+
* )
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/components-phonenumber--docs
|
|
65
|
+
*/
|
|
66
|
+
declare const PhoneNumberInput: import('react').ForwardRefExoticComponent<PhoneNumberInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export { PhoneNumberInput };
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as J, useState as K, useRef as Q, useImperativeHandle as X } from "react";
|
|
3
|
+
import { uyTv as Y } from "@payfit/unity-themes";
|
|
4
|
+
import { useFilter as Z, Group as _, Select as ee, Button as re, Popover as te, Autocomplete as ae, Virtualizer as oe, ListLayout as ue, ListBox as de, Input as ne } from "react-aria-components";
|
|
5
|
+
import { defaultCountries as f, usePhoneInput as ie, FlagImage as le, parseCountry as se } from "react-international-phone";
|
|
6
|
+
import { useIntl as ye } from "react-intl";
|
|
7
|
+
import { CircularIconButton as ce } from "../icon-button/CircularIconButton.js";
|
|
8
|
+
import { Icon as m } from "../icon/Icon.js";
|
|
9
|
+
import { SearchInput as fe } from "../select/parts/SearchInput.js";
|
|
10
|
+
import { PhoneNumberItem as me } from "./parts/PhoneNumberItem.js";
|
|
11
|
+
import be from "./unknownFlag.svg.js";
|
|
12
|
+
const pe = Y({
|
|
13
|
+
slots: {
|
|
14
|
+
base: [
|
|
15
|
+
"uy:group",
|
|
16
|
+
// common
|
|
17
|
+
"uy:flex uy:w-full uy:border uy:border-border-form-enabled uy:bg-surface-form-enabled uy:border-solid uy:focus-within:outline-none uy:focus-within:ring-2 uy:focus-within:ring-utility-focus-ring uy:focus-within:ring-offset-2",
|
|
18
|
+
// common hover
|
|
19
|
+
'uy:data-[active="true"]:data-[hovered="true"]:border-border-form-hover uy:data-[active="true"]:data-[hovered="true"]:bg-surface-form-hover uy:data-[active="true"]:data-[hovered="true"]:text-content-form-hover',
|
|
20
|
+
// common pressed
|
|
21
|
+
'uy:data-[active="true"]:data-[pressed="true"]:border-border-form-pressed uy:data-[active="true"]:data-[pressed="true"]:bg-surface-form-pressed uy:data-[active="true"]:data-[pressed="true"]:text-content-form-pressed',
|
|
22
|
+
// common active
|
|
23
|
+
'uy:data-[active="true"]:border-border-form-active',
|
|
24
|
+
// common focus-visible
|
|
25
|
+
'uy:data-[focus-visible="true"]:outline-none uy:data-[focus-visible="true"]:ring-2 uy:data-[focus-visible="true"]:ring-utility-focus-ring uy:data-[focus-visible="true"]:ring-offset-2',
|
|
26
|
+
// common invalid
|
|
27
|
+
'uy:data-[invalid="true"]:border-border-form-error uy:data-[invalid="true"]:bg-surface-form-error uy:data-[invalid="true"]:text-content-form-danger-enabled',
|
|
28
|
+
// common disabled
|
|
29
|
+
'uy:data-[disabled="true"]:border-border-form-disabled uy:data-[disabled="true"]:bg-surface-form-disabled uy:data-[disabled="true"]:text-content-form-disabled uy:data-[disabled="true"]:cursor-not-allowed',
|
|
30
|
+
//mobile
|
|
31
|
+
"uy:h-5.5 uy:rounded-100",
|
|
32
|
+
// desktop
|
|
33
|
+
"uy:sm:h-500 uy:sm:rounded-75 "
|
|
34
|
+
],
|
|
35
|
+
prefix: [
|
|
36
|
+
// common
|
|
37
|
+
"uy:border-r uy:border-solid uy:border-border-form-enabled uy:text-content-form-enabled uy:flex-grow-0 uy:pl-150 uy:pr-100 uy:group-data-[active=true]:border-border-form-active uy:cursor-pointer",
|
|
38
|
+
// common invalid
|
|
39
|
+
'uy:group-data-[invalid="true"]:border-border-form-error',
|
|
40
|
+
// common disabled
|
|
41
|
+
'uy:group-data-[disabled="true"]:border-border-form-disabled uy:group-data-[disabled="true"]:text-content-form-disabled uy:data-[disabled="true"]:cursor-not-allowed',
|
|
42
|
+
//mobile
|
|
43
|
+
"uy:py-125",
|
|
44
|
+
// desktop
|
|
45
|
+
"uy:sm:py-100"
|
|
46
|
+
],
|
|
47
|
+
inputWrapper: [
|
|
48
|
+
// common
|
|
49
|
+
"uy:border-border-form-enabled uy:bg-surface-form-enabled uy:flex uy:gap-50 uy:flex-grow uy:flex-nowrap uy:px-150 uy:max-w-full uy:justify-between",
|
|
50
|
+
// common invalid
|
|
51
|
+
'uy:group-data-[invalid="true"]:bg-surface-form-error',
|
|
52
|
+
// common disabled
|
|
53
|
+
'uy:group-data-[disabled="true"]:bg-surface-form-disabled uy:data-[disabled="true"]:cursor-not-allowed',
|
|
54
|
+
// mobile
|
|
55
|
+
"uy:py-125 uy:rounded-100",
|
|
56
|
+
// desktop
|
|
57
|
+
"uy:sm:py-100 uy:sm:rounded-75"
|
|
58
|
+
],
|
|
59
|
+
input: [
|
|
60
|
+
// common
|
|
61
|
+
"uy:text-content-form-enabled uy:bg-surface-form-enabled uy:w-full uy:flex-1 uy:outline-none uy:typography-body uy:placeholder:text-content-neutral-lowest uy:min-w-0 uy:max-w-full uy:min-h-300",
|
|
62
|
+
// common invalid
|
|
63
|
+
'uy:group-data-[invalid="true"]:bg-surface-form-error uy:group-data-[invalid="true"]:text-content-danger-enabled',
|
|
64
|
+
// common disabled
|
|
65
|
+
'uy:group-data-[disabled="true"]:bg-surface-form-disabled uy:group-data-[disabled="true"]:text-content-form-disabled uy:data-[disabled="true"]:cursor-not-allowed'
|
|
66
|
+
],
|
|
67
|
+
state: [
|
|
68
|
+
// common
|
|
69
|
+
"uy:flex uy:gap-50 uy:items-center uy:shrink-0"
|
|
70
|
+
],
|
|
71
|
+
selectIcon: [
|
|
72
|
+
//common
|
|
73
|
+
""
|
|
74
|
+
],
|
|
75
|
+
selectButton: [
|
|
76
|
+
//common
|
|
77
|
+
"uy:cursor-pointer uy:flex uy:gap-50 uy:items-center uy:outline-none",
|
|
78
|
+
// common disabled
|
|
79
|
+
'uy:data-[disabled="true"]:cursor-not-allowed'
|
|
80
|
+
],
|
|
81
|
+
selectPopover: [
|
|
82
|
+
//common
|
|
83
|
+
"uy:border uy:border-solid uy:border-border-neutral uy:w-[var(--trigger-width)] uy:bg-surface-neutral-enabled",
|
|
84
|
+
// mobile
|
|
85
|
+
"uy:rounded-100",
|
|
86
|
+
// desktop
|
|
87
|
+
"uy:sm:rounded-75"
|
|
88
|
+
],
|
|
89
|
+
selectListbox: [
|
|
90
|
+
//common
|
|
91
|
+
"uy:overflow-y-auto uy:overflow-x-hidden uy:max-h-[296px]"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}), ge = J(
|
|
95
|
+
(b, p) => {
|
|
96
|
+
const n = ye(), {
|
|
97
|
+
onChange: g,
|
|
98
|
+
value: i,
|
|
99
|
+
defaultCountry: h = "unknown",
|
|
100
|
+
onClearButtonPress: v,
|
|
101
|
+
isInvalid: o = !1,
|
|
102
|
+
isDisabled: u = !1,
|
|
103
|
+
prefix: x = "+",
|
|
104
|
+
"aria-label": s,
|
|
105
|
+
defaultMask: w,
|
|
106
|
+
charAfterDialCode: C,
|
|
107
|
+
historySaveDebounceMS: I,
|
|
108
|
+
disableCountryGuess: N,
|
|
109
|
+
forceDialCode: P,
|
|
110
|
+
disableDialCodeAndPrefix: k,
|
|
111
|
+
disableFormatting: S,
|
|
112
|
+
searchInputAriaLabel: M,
|
|
113
|
+
...B
|
|
114
|
+
} = b, [D, L] = K(!1), { contains: O } = Z({ sensitivity: "base" }), d = Q(null);
|
|
115
|
+
X(p, () => d.current, [d]);
|
|
116
|
+
const R = [["", "unknown", "", ""], ...f], {
|
|
117
|
+
inputRef: y,
|
|
118
|
+
inputValue: c,
|
|
119
|
+
handlePhoneValueChange: j,
|
|
120
|
+
country: t,
|
|
121
|
+
setCountry: A,
|
|
122
|
+
phone: F
|
|
123
|
+
} = ie({
|
|
124
|
+
prefix: x,
|
|
125
|
+
defaultCountry: h,
|
|
126
|
+
value: i,
|
|
127
|
+
countries: R,
|
|
128
|
+
disableDialCodePrefill: !0,
|
|
129
|
+
defaultMask: w,
|
|
130
|
+
charAfterDialCode: C,
|
|
131
|
+
historySaveDebounceMS: I,
|
|
132
|
+
disableCountryGuess: N,
|
|
133
|
+
forceDialCode: P,
|
|
134
|
+
disableDialCodeAndPrefix: k,
|
|
135
|
+
disableFormatting: S,
|
|
136
|
+
onChange: (r) => {
|
|
137
|
+
g?.(t.iso2 === "unknown" ? "" : r.phone);
|
|
138
|
+
}
|
|
139
|
+
}), {
|
|
140
|
+
base: W,
|
|
141
|
+
prefix: $,
|
|
142
|
+
inputWrapper: V,
|
|
143
|
+
input: z,
|
|
144
|
+
selectPopover: G,
|
|
145
|
+
selectListbox: T,
|
|
146
|
+
selectIcon: U,
|
|
147
|
+
selectButton: E,
|
|
148
|
+
state: H
|
|
149
|
+
} = pe(), q = c.replace(F, "").trim() !== "" && !u;
|
|
150
|
+
return /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ a(
|
|
151
|
+
_,
|
|
152
|
+
{
|
|
153
|
+
className: W(),
|
|
154
|
+
"aria-label": `${s}${i ? `, ${i}` : ""}`,
|
|
155
|
+
"aria-invalid": o,
|
|
156
|
+
"data-invalid": o,
|
|
157
|
+
"data-disabled": u,
|
|
158
|
+
"aria-disabled": u,
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ a(
|
|
161
|
+
ee,
|
|
162
|
+
{
|
|
163
|
+
onOpenChange: (r) => {
|
|
164
|
+
L(r), r || setTimeout(() => {
|
|
165
|
+
y.current?.focus();
|
|
166
|
+
}, 0);
|
|
167
|
+
},
|
|
168
|
+
isDisabled: u,
|
|
169
|
+
value: t.iso2,
|
|
170
|
+
onChange: (r) => {
|
|
171
|
+
A(r);
|
|
172
|
+
},
|
|
173
|
+
className: $(),
|
|
174
|
+
isInvalid: o,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ a(
|
|
177
|
+
re,
|
|
178
|
+
{
|
|
179
|
+
"data-dd-privacy": "mask",
|
|
180
|
+
className: E(),
|
|
181
|
+
"aria-label": n.formatMessage(
|
|
182
|
+
{
|
|
183
|
+
id: "unity:component:phone-number:country-selector:label",
|
|
184
|
+
defaultMessage: "Select country code, {country} {dialCode}"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
country: t.name,
|
|
188
|
+
dialCode: t.dialCode
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
children: [
|
|
192
|
+
t.iso2 !== "unknown" ? /* @__PURE__ */ e(
|
|
193
|
+
le,
|
|
194
|
+
{
|
|
195
|
+
iso2: t.iso2,
|
|
196
|
+
alt: t.name,
|
|
197
|
+
size: 24,
|
|
198
|
+
"aria-hidden": "true",
|
|
199
|
+
"data-dd-privacy": "mask"
|
|
200
|
+
}
|
|
201
|
+
) : /* @__PURE__ */ e(
|
|
202
|
+
"img",
|
|
203
|
+
{
|
|
204
|
+
"aria-hidden": "true",
|
|
205
|
+
src: be,
|
|
206
|
+
alt: "",
|
|
207
|
+
"data-dd-privacy": "mask",
|
|
208
|
+
className: "react-international-phone-flag-emoji",
|
|
209
|
+
width: 24,
|
|
210
|
+
height: 24
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ e(
|
|
214
|
+
m,
|
|
215
|
+
{
|
|
216
|
+
className: U(),
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
src: D ? "CaretUpOutlined" : "CaretDownOutlined"
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ e(
|
|
225
|
+
te,
|
|
226
|
+
{
|
|
227
|
+
style: {
|
|
228
|
+
"--trigger-width": `${d.current?.offsetWidth}px`
|
|
229
|
+
},
|
|
230
|
+
triggerRef: d,
|
|
231
|
+
offset: 1,
|
|
232
|
+
containerPadding: 8,
|
|
233
|
+
className: G(),
|
|
234
|
+
children: /* @__PURE__ */ a(ae, { filter: O, children: [
|
|
235
|
+
/* @__PURE__ */ e(fe, { "aria-label": M }),
|
|
236
|
+
/* @__PURE__ */ e(
|
|
237
|
+
oe,
|
|
238
|
+
{
|
|
239
|
+
layout: ue,
|
|
240
|
+
layoutOptions: {
|
|
241
|
+
padding: 8
|
|
242
|
+
},
|
|
243
|
+
children: /* @__PURE__ */ e(
|
|
244
|
+
de,
|
|
245
|
+
{
|
|
246
|
+
className: T(),
|
|
247
|
+
items: f,
|
|
248
|
+
children: (r) => {
|
|
249
|
+
const l = se(r);
|
|
250
|
+
return /* @__PURE__ */ e(
|
|
251
|
+
me,
|
|
252
|
+
{
|
|
253
|
+
country: l,
|
|
254
|
+
id: l.iso2
|
|
255
|
+
},
|
|
256
|
+
l.iso2
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
] })
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ a("div", { className: V(), children: [
|
|
270
|
+
/* @__PURE__ */ e(
|
|
271
|
+
ne,
|
|
272
|
+
{
|
|
273
|
+
ref: y,
|
|
274
|
+
...B,
|
|
275
|
+
className: z(),
|
|
276
|
+
type: "tel",
|
|
277
|
+
onChange: j,
|
|
278
|
+
value: c,
|
|
279
|
+
"data-dd-privacy": "mask",
|
|
280
|
+
"aria-invalid": o,
|
|
281
|
+
disabled: u,
|
|
282
|
+
"aria-label": s
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
/* @__PURE__ */ a("div", { className: H(), children: [
|
|
286
|
+
o && /* @__PURE__ */ e(
|
|
287
|
+
m,
|
|
288
|
+
{
|
|
289
|
+
src: "WarningCircleOutlined",
|
|
290
|
+
color: "content.form.invalid",
|
|
291
|
+
role: "img",
|
|
292
|
+
"aria-label": n.formatMessage({
|
|
293
|
+
id: "unity:component:form-field:form-input:error:alt",
|
|
294
|
+
defaultMessage: "Error"
|
|
295
|
+
})
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
q && /* @__PURE__ */ e(
|
|
299
|
+
ce,
|
|
300
|
+
{
|
|
301
|
+
title: n.formatMessage({
|
|
302
|
+
id: "unity:component:common:clear:title",
|
|
303
|
+
defaultMessage: "Clear"
|
|
304
|
+
}),
|
|
305
|
+
color: "content.neutral.low",
|
|
306
|
+
icon: "CloseOutlined",
|
|
307
|
+
onPress: () => {
|
|
308
|
+
v?.();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
] })
|
|
313
|
+
] })
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
) });
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
ge.displayName = "PhoneNumberInput";
|
|
320
|
+
export {
|
|
321
|
+
ge as PhoneNumberInput
|
|
322
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PhoneNumberInputProps } from './PhoneNumberInput.js';
|
|
2
|
+
export type TanstackPhoneNumberInputProps = Omit<PhoneNumberInputProps, 'value' | 'isInvalid'>;
|
|
3
|
+
/**
|
|
4
|
+
* The `TanstackPhoneNumberInput` component renders a phone number input field
|
|
5
|
+
* wired to the TanStack Form context. It manages state and accessibility via the
|
|
6
|
+
* context provided by `useTanstackUnityForm` and `<form.AppField name="…">`.
|
|
7
|
+
*
|
|
8
|
+
* Behavior:
|
|
9
|
+
* - Displays a phone number input with integrated country selector and automatic formatting.
|
|
10
|
+
* - The field value and invalid state are derived from the TanStack form context.
|
|
11
|
+
* - Supports searchable country dropdown and full keyboard navigation.
|
|
12
|
+
*
|
|
13
|
+
* Accessibility:
|
|
14
|
+
* - Automatically wires `aria-labelledby`, `aria-describedby` (helper/feedback), and
|
|
15
|
+
* `aria-details` using identifiers from the `a11y` context.
|
|
16
|
+
*
|
|
17
|
+
* Key props:
|
|
18
|
+
* - `defaultCountry?: CountryIso2` — default country code (ISO 3166-1 alpha-2).
|
|
19
|
+
* - `placeholder?: string` — placeholder text displayed when the field is empty.
|
|
20
|
+
* - `prefix?: string` — prefix character for phone numbers (default: '+').
|
|
21
|
+
* - `onChange?: (phone: string) => void` — callback when phone number changes.
|
|
22
|
+
* - `onClearButtonPress?: () => void` — callback when clear button is pressed.
|
|
23
|
+
* - Inherits all props from `PhoneNumberInputProps` except `value` and `isInvalid`.
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { TanstackPhoneNumberInput } from '@/components/phone-number/TanstackPhoneNumberInput'
|
|
27
|
+
* import { useTanstackUnityForm } from '@/hooks/use-tanstack-form'
|
|
28
|
+
* import * as z from 'zod'
|
|
29
|
+
*
|
|
30
|
+
* function Example() {
|
|
31
|
+
* const schema = z.object({
|
|
32
|
+
* phoneNumber: z.e164({ message: 'Invalid phone number' }),
|
|
33
|
+
* })
|
|
34
|
+
*
|
|
35
|
+
* const form = useTanstackUnityForm({
|
|
36
|
+
* validators: {
|
|
37
|
+
* onBlur: schema,
|
|
38
|
+
* },
|
|
39
|
+
* })
|
|
40
|
+
*
|
|
41
|
+
* return (
|
|
42
|
+
* <form.AppForm>
|
|
43
|
+
* <form.Form>
|
|
44
|
+
* <form.AppField name="phoneNumber">
|
|
45
|
+
* {field => (
|
|
46
|
+
* <field.PhoneNumberInput
|
|
47
|
+
* aria-label="Phone number"
|
|
48
|
+
* defaultCountry="fr"
|
|
49
|
+
* placeholder="+33 6 12 34 56 78"
|
|
50
|
+
* />
|
|
51
|
+
* )}
|
|
52
|
+
* </form.AppField>
|
|
53
|
+
* </form.Form>
|
|
54
|
+
* </form.AppForm>
|
|
55
|
+
* )
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
* @remarks Migration from `PhoneNumberInput` (non‑TanStack):
|
|
59
|
+
* - Do not pass `value` or `isInvalid` props: these are derived from the TanStack form context.
|
|
60
|
+
* - Use `<form.AppField name="…">` to provide the field context.
|
|
61
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-field-components-phonenumber--docs
|
|
62
|
+
*/
|
|
63
|
+
declare const TanstackPhoneNumberInput: import('react').ForwardRefExoticComponent<TanstackPhoneNumberInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
64
|
+
export { TanstackPhoneNumberInput };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { useFieldContext as f } from "../../hooks/tanstack-form-context.js";
|
|
4
|
+
import { useFieldA11yContext as b } from "../form-field/TanstackFormField.context.js";
|
|
5
|
+
import { PhoneNumberInput as h } from "./PhoneNumberInput.js";
|
|
6
|
+
const C = c(({ onChange: r, onBlur: n, onClearButtonPress: i, isDisabled: l, ...s }, d) => {
|
|
7
|
+
const e = f(), t = b(), m = e.state.meta.isTouched && !e.state.meta.isValid, o = [t.helperTextId, t.feedbackTextId].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ u(
|
|
9
|
+
h,
|
|
10
|
+
{
|
|
11
|
+
ref: d,
|
|
12
|
+
...s,
|
|
13
|
+
value: e.state.value ?? "",
|
|
14
|
+
onChange: (a) => {
|
|
15
|
+
e.handleChange(a), r?.(a);
|
|
16
|
+
},
|
|
17
|
+
onBlur: (a) => {
|
|
18
|
+
e.handleBlur(), n?.(a);
|
|
19
|
+
},
|
|
20
|
+
onClearButtonPress: () => {
|
|
21
|
+
e.setValue(""), i?.();
|
|
22
|
+
},
|
|
23
|
+
isDisabled: l,
|
|
24
|
+
isInvalid: m,
|
|
25
|
+
"aria-labelledby": t.labelId,
|
|
26
|
+
"aria-describedby": o.length > 0 ? o : void 0,
|
|
27
|
+
"aria-details": t.contextualLinkId
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
export {
|
|
32
|
+
C as TanstackPhoneNumberInput
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
+
import { ListBoxItemProps } from 'react-aria-components';
|
|
3
|
+
import { ParsedCountry } from 'react-international-phone';
|
|
4
|
+
export declare const phoneNumberItem: import('tailwind-variants').TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
7
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
8
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
[x: string]: {
|
|
13
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
14
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
15
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
} | {}, {
|
|
19
|
+
base: string[];
|
|
20
|
+
name: string[];
|
|
21
|
+
}, undefined, {
|
|
22
|
+
[key: string]: {
|
|
23
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
24
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
25
|
+
name?: import('tailwind-merge').ClassNameValue;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
} | {}, {
|
|
29
|
+
base: string[];
|
|
30
|
+
name: string[];
|
|
31
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
32
|
+
base: string[];
|
|
33
|
+
name: string[];
|
|
34
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
35
|
+
export interface PhoneNumberItemProps extends VariantProps<typeof phoneNumberItem>, ListBoxItemProps {
|
|
36
|
+
country: ParsedCountry;
|
|
37
|
+
}
|
|
38
|
+
declare const PhoneNumberItem: {
|
|
39
|
+
({ country, isDisabled }: PhoneNumberItemProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
42
|
+
export { PhoneNumberItem };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a, Fragment as l } from "react/jsx-runtime";
|
|
2
|
+
import { uyTv as n } from "@payfit/unity-themes";
|
|
3
|
+
import { ListBoxItem as m } from "react-aria-components";
|
|
4
|
+
import { FlagImage as c } from "react-international-phone";
|
|
5
|
+
import { useIntl as y } from "react-intl";
|
|
6
|
+
import { Icon as p } from "../../icon/Icon.js";
|
|
7
|
+
import { Text as r } from "../../text/Text.js";
|
|
8
|
+
const b = n({
|
|
9
|
+
slots: {
|
|
10
|
+
base: [
|
|
11
|
+
//common
|
|
12
|
+
"uy:flex uy:py-100 uy:px-150 uy:typography-body uy:cursor-pointer uy:rounded-50",
|
|
13
|
+
// mobile
|
|
14
|
+
"uy:gap-125",
|
|
15
|
+
// desktop
|
|
16
|
+
"uy:sm:gap-100",
|
|
17
|
+
// hover
|
|
18
|
+
'uy:data-[hovered="true"]:bg-surface-neutral-hover',
|
|
19
|
+
// pressed
|
|
20
|
+
'uy:data-[pressed="true"]:bg-surface-neutral-pressed',
|
|
21
|
+
// selected
|
|
22
|
+
'uy:data-[selected="true"]:bg-surface-neutral-active',
|
|
23
|
+
// focus-visible
|
|
24
|
+
'uy:data-[focus-visible="true"]:outline-offset-2 uy:data-[focus-visible="true"]:outline-2 uy:data-[focus-visible="true"]:outline-solid uy:data-[focus-visible="true"]:outline-utility-focus-ring',
|
|
25
|
+
// disabled
|
|
26
|
+
'uy:data-[disabled="true"]:text-content-neutral-disabled uy:data-[disabled="true"]:bg-surface-neutral-disabled uy:data-[disabled="true"]:cursor-not-allowed'
|
|
27
|
+
],
|
|
28
|
+
name: [
|
|
29
|
+
//common
|
|
30
|
+
"uy:grow"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}), f = ({ country: e, isDisabled: u }) => {
|
|
34
|
+
const { base: s, name: o } = b(), i = y();
|
|
35
|
+
return /* @__PURE__ */ t(
|
|
36
|
+
m,
|
|
37
|
+
{
|
|
38
|
+
id: e.iso2,
|
|
39
|
+
textValue: `${e.name} ${e.dialCode}`,
|
|
40
|
+
className: s(),
|
|
41
|
+
"data-dd-privacy": "mask",
|
|
42
|
+
isDisabled: u,
|
|
43
|
+
children: ({ isSelected: d }) => /* @__PURE__ */ a(l, { children: [
|
|
44
|
+
/* @__PURE__ */ t(c, { iso2: e.iso2, alt: "", size: 24 }),
|
|
45
|
+
/* @__PURE__ */ t(r, { className: o(), children: e.name }),
|
|
46
|
+
/* @__PURE__ */ a(r, { children: [
|
|
47
|
+
"+",
|
|
48
|
+
e.dialCode
|
|
49
|
+
] }),
|
|
50
|
+
d && /* @__PURE__ */ t(
|
|
51
|
+
p,
|
|
52
|
+
{
|
|
53
|
+
src: "CheckOutlined",
|
|
54
|
+
alt: i.formatMessage({
|
|
55
|
+
id: "unity:component:phone-number:selected:label",
|
|
56
|
+
defaultMessage: "Selected"
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
f.displayName = "PhoneNumberItem";
|
|
65
|
+
export {
|
|
66
|
+
f as PhoneNumberItem,
|
|
67
|
+
b as phoneNumberItem
|
|
68
|
+
};
|