@payfit/unity-components 1.2.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/action-bar/ActionBar.js +14 -14
- package/dist/esm/components/actionable/Actionable.js +31 -28
- 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-layout/AppLayout.js +17 -17
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +23 -23
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +87 -5
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
- 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.context.js +3 -3
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +1 -1
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
- 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/ClientSidePagination.d.ts +103 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
- package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +1 -1
- package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
- package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +12 -12
- package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
- package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
- 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.d.ts +13 -1
- package/dist/esm/components/error-state/ErrorState.js +133 -92
- package/dist/esm/components/error-state/initConfig.js +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
- package/dist/esm/components/fieldset/Fieldset.js +32 -26
- 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/flex/Flex.js +52 -37
- 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/FormField.js +12 -12
- 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 +22 -0
- package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -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/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/icon/Icon.js +23 -19
- 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/{Link.variants.d.ts → RawLink.d.ts} +92 -0
- package/dist/esm/components/link/{Link.variants.js → RawLink.js} +78 -5
- 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/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
- package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
- 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/NavGroup.d.ts +3 -3
- package/dist/esm/components/nav/parts/NavGroup.js +62 -51
- package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
- package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
- 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 +13 -12
- package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
- package/dist/esm/components/page/parts/PageHeader.js +22 -20
- package/dist/esm/components/pagination/Pagination.d.ts +23 -44
- package/dist/esm/components/pagination/Pagination.js +89 -163
- package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
- package/dist/esm/components/pagination/PaginationContext.js +15 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
- package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
- package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
- package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
- package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
- package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
- 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 +79 -53
- 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/parts/SelectOption.js +9 -9
- 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/skip-links/SkipLinks.js +1 -1
- 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 +94 -0
- package/dist/esm/components/table/Table.js +145 -108
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
- package/dist/esm/components/table/parts/TableBody.js +83 -21
- package/dist/esm/components/table/parts/TableCell.js +29 -26
- 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.d.ts +5 -5
- package/dist/esm/components/table/parts/TablePagination.js +11 -11
- package/dist/esm/components/table/parts/TableRow.js +22 -18
- 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/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
- package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
- package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
- package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +43 -43
- package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +45 -41
- package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
- 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 +43 -30
- 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-container-query-level.d.ts +42 -0
- package/dist/esm/hooks/use-container-query-level.js +33 -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 +64 -30
- package/dist/esm/index.js +482 -394
- package/dist/esm/index.storybook-testing.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +45 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/TanstackFormContextualLink.d.ts +43 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -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/menu-item/MenuItem.d.ts +49 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -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/components/pagination/PaginationLink.d.ts +54 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
- package/dist/esm/integrations/tanstack-router/index.d.ts +19 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router.js +40 -0
- package/dist/esm/mocks/employees.d.ts +1 -5
- package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
- package/dist/esm/providers/router/RouterProvider.js +14 -10
- package/dist/esm/storybook-testing.js +8 -2
- package/dist/esm/storybook-utilities/previewTransform.d.ts +1 -0
- package/dist/esm/types/DataAttributes.d.ts +1 -1
- 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 +22 -8
- package/i18n/es-ES.json +24 -10
- package/i18n/fr-FR.json +25 -11
- package/package.json +66 -45
- package/dist/esm/components/form-field/parts/FormContextualLink.d.ts +0 -20
- package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
- package/dist/esm/components/link/Link.d.ts +0 -93
- package/dist/esm/components/link/Link.js +0 -68
- package/dist/esm/components/multi-select/Multiselect.types.d.ts +0 -109
- package/dist/esm/components/nav/parts/NavItem.js +0 -95
- 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
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { usePaginationContext as p } from "../PaginationContext.js";
|
|
4
|
+
const f = m(
|
|
5
|
+
({ children: o, pageNumber: a, pageCount: i, ...e }, n) => {
|
|
6
|
+
const { pageCount: r } = p(), t = i ?? r;
|
|
7
|
+
return /* @__PURE__ */ s(
|
|
8
|
+
"li",
|
|
9
|
+
{
|
|
10
|
+
...e,
|
|
11
|
+
ref: n,
|
|
12
|
+
"aria-setsize": t !== -1 ? t : void 0,
|
|
13
|
+
"aria-posinset": a,
|
|
14
|
+
children: o
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
f.displayName = "PaginationItem";
|
|
20
|
+
export {
|
|
21
|
+
f as PaginationItem
|
|
22
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
+
import { LinkProps } from 'react-aria-components';
|
|
3
|
+
export declare const paginationLink: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
4
|
+
export interface PaginationLinkProps extends LinkProps, VariantProps<typeof paginationLink> {
|
|
5
|
+
value: number;
|
|
6
|
+
id?: string;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
isCurrent?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const RawPaginationLink: import('react').ForwardRefExoticComponent<PaginationLinkProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
11
|
+
export { RawPaginationLink };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as w, useRef as h, useCallback as u } from "react";
|
|
3
|
+
import { uyTv as v } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as x } from "react-aria-components";
|
|
5
|
+
import { useIntl as P } from "react-intl";
|
|
6
|
+
import { usePaginationContext as k } from "../PaginationContext.js";
|
|
7
|
+
const R = v({
|
|
8
|
+
base: [
|
|
9
|
+
"uy:min-w-300 uy:h-300 uy:p-25 uy:flex uy:justify-center uy:items-center uy:typography-action uy:rounded-pill uy:transition-colors",
|
|
10
|
+
"uy:enabled:text-content-neutral-enabled uy:enabled:bg-transparent uy:cursor-pointer",
|
|
11
|
+
"uy:data-[disabled]:text-content-neutral-disabled uy:data-[disabled]:bg-surface-neutral-lowest-disabled uy:data-[disabled]:cursor-not-allowed",
|
|
12
|
+
"uy:hover:text-content-neutral-hover uy:hover:bg-surface-neutral-lowest-hover",
|
|
13
|
+
"uy:active:text-content-neutral-pressed uy:active:bg-surface-neutral-lowest-pressed uy:data-[pressed]:text-content-neutral-pressed uy:data-[pressed]:bg-surface-neutral-lowest-pressed",
|
|
14
|
+
"uy:aria-[current=page]:bg-surface-neutral-lowest-selected",
|
|
15
|
+
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-utility-focus-ring uy:focus-visible:outline-offset-2",
|
|
16
|
+
"uy:data-[focus-visible]:outline-2 uy:data-[focus-visible]:outline-solid uy:data-[focus-visible]:outline-utility-focus-ring uy:data-[focus-visible]:outline-offset-2"
|
|
17
|
+
]
|
|
18
|
+
}), C = w(
|
|
19
|
+
({ isCurrent: r, isDisabled: l, value: t, onPress: c, ...a }, n) => {
|
|
20
|
+
const y = P(), { currentPage: s, onKeyDown: f, pageRefs: i, onPageChange: o } = k(), d = h(null), g = u(
|
|
21
|
+
(e) => {
|
|
22
|
+
d.current = e, e ? i.current.set(t, e) : i.current.delete(t), typeof n == "function" ? n(e) : n && (n.current = e);
|
|
23
|
+
},
|
|
24
|
+
[t, i, n]
|
|
25
|
+
), b = r ?? s === t, p = u(() => {
|
|
26
|
+
if (!a.href) {
|
|
27
|
+
const e = t > s ? 1 : -1;
|
|
28
|
+
o(t, s, e);
|
|
29
|
+
}
|
|
30
|
+
}, [t, s, o, a.href]);
|
|
31
|
+
return /* @__PURE__ */ m(
|
|
32
|
+
x,
|
|
33
|
+
{
|
|
34
|
+
...a,
|
|
35
|
+
ref: g,
|
|
36
|
+
className: R(),
|
|
37
|
+
isDisabled: l,
|
|
38
|
+
onPress: c ?? p,
|
|
39
|
+
"aria-current": b ? "page" : void 0,
|
|
40
|
+
"aria-label": y.formatMessage(
|
|
41
|
+
{
|
|
42
|
+
id: "unity:component:pagination:link:label",
|
|
43
|
+
defaultMessage: "Page {page}"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
page: t
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
onKeyDown: (e) => {
|
|
50
|
+
f(e);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
C.displayName = "RawPaginationLink";
|
|
57
|
+
export {
|
|
58
|
+
C as RawPaginationLink,
|
|
59
|
+
R as paginationLink
|
|
60
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
+
import { LinkProps } from 'react-aria-components';
|
|
3
|
+
declare const paginationNavButton: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
4
|
+
export interface RawPaginationNextProps extends Omit<LinkProps, 'children' | 'className' | 'style' | 'isDisabled' | 'aria-label' | 'title'>, VariantProps<typeof paginationNavButton> {
|
|
5
|
+
id?: string;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The RawPaginationNext component renders a "Next" link for pagination.
|
|
11
|
+
* This component is always a link for consistent integration with routing libraries.
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { RawPaginationNext } from '@payfit/unity-components'
|
|
15
|
+
*
|
|
16
|
+
* <RawPaginationNext href="/page/3" isDisabled={currentPage === pageCount}>
|
|
17
|
+
* Next
|
|
18
|
+
* </RawPaginationNext>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const RawPaginationNext: import('react').ForwardRefExoticComponent<RawPaginationNextProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
22
|
+
export { RawPaginationNext };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
|
+
import { uyTv as b } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as x } from "react-aria-components";
|
|
5
|
+
import { useIntl as v } from "react-intl";
|
|
6
|
+
import { Icon as w } from "../../icon/Icon.js";
|
|
7
|
+
import { Tooltip as h } from "../../tooltip/Tooltip.js";
|
|
8
|
+
import { usePaginationContext as P } from "../PaginationContext.js";
|
|
9
|
+
const N = b({
|
|
10
|
+
base: [
|
|
11
|
+
"uy:min-w-300 uy:h-300 uy:p-25 uy:flex uy:justify-center uy:items-center uy:typography-action uy:rounded-circle uy:transition-colors",
|
|
12
|
+
"uy:text-content-neutral-lowest uy:enabled:bg-transparent uy:cursor-pointer",
|
|
13
|
+
"uy:hover:text-content-neutral-hover uy:hover:bg-surface-neutral-lowest-hover",
|
|
14
|
+
"uy:active:text-content-neutral-pressed uy:active:bg-surface-neutral-lowest-pressed",
|
|
15
|
+
"uy:data-[pressed=true]:text-content-neutral-pressed uy:data-[pressed=true]:bg-surface-neutral-lowest-pressed",
|
|
16
|
+
"uy:data-[disabled=true]:text-content-neutral-disabled uy:data-[disabled=true]:bg-transparent uy:data-[disabled=true]:cursor-not-allowed",
|
|
17
|
+
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-utility-focus-ring uy:focus-visible:outline-offset-2"
|
|
18
|
+
]
|
|
19
|
+
}), D = g(
|
|
20
|
+
({ isDisabled: i, href: n, onPress: s, ...u }, l) => {
|
|
21
|
+
const a = v(), {
|
|
22
|
+
onKeyDown: c,
|
|
23
|
+
currentPage: e,
|
|
24
|
+
pageCount: r,
|
|
25
|
+
onPageChange: y
|
|
26
|
+
} = P(), t = a.formatMessage({
|
|
27
|
+
id: "unity:component:common:next",
|
|
28
|
+
defaultMessage: "Next"
|
|
29
|
+
}), d = a.formatMessage(
|
|
30
|
+
{
|
|
31
|
+
id: "unity:component:pagination:nav-button:description",
|
|
32
|
+
defaultMessage: "Go to next page"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
variant: t
|
|
36
|
+
}
|
|
37
|
+
), p = (m) => {
|
|
38
|
+
c(m);
|
|
39
|
+
}, f = () => {
|
|
40
|
+
!n && (r === -1 || e < r) && y(e + 1, e, 1);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ o(h, { title: t, children: /* @__PURE__ */ o(
|
|
43
|
+
x,
|
|
44
|
+
{
|
|
45
|
+
ref: l,
|
|
46
|
+
href: n,
|
|
47
|
+
className: N(),
|
|
48
|
+
isDisabled: i,
|
|
49
|
+
onPress: s ?? f,
|
|
50
|
+
"aria-label": t,
|
|
51
|
+
"aria-description": d,
|
|
52
|
+
onKeyDown: p,
|
|
53
|
+
...u,
|
|
54
|
+
children: /* @__PURE__ */ o(
|
|
55
|
+
w,
|
|
56
|
+
{
|
|
57
|
+
src: "CaretRightOutlined",
|
|
58
|
+
size: 20,
|
|
59
|
+
color: "inherit",
|
|
60
|
+
role: "presentation"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
) });
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
D.displayName = "RawPaginationNext";
|
|
68
|
+
export {
|
|
69
|
+
D as RawPaginationNext
|
|
70
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
+
import { LinkProps } from 'react-aria-components';
|
|
3
|
+
declare const paginationNavButton: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
4
|
+
export interface RawPaginationPreviousProps extends Omit<LinkProps, 'children' | 'className' | 'style' | 'isDisabled' | 'aria-label' | 'title'>, VariantProps<typeof paginationNavButton> {
|
|
5
|
+
id?: string;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The RawPaginationPrevious component renders a "Next" link for pagination.
|
|
11
|
+
* This component is always a link for consistent integration with routing libraries.
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { RawPaginationPrevious } from '@payfit/unity-components'
|
|
15
|
+
*
|
|
16
|
+
* <RawPaginationPrevious href="/page/3" isDisabled={currentPage === pageCount}>
|
|
17
|
+
* Next
|
|
18
|
+
* </RawPaginationPrevious>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const RawPaginationPrevious: import('react').ForwardRefExoticComponent<RawPaginationPreviousProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
22
|
+
export { RawPaginationPrevious };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as v } from "react-aria-components";
|
|
5
|
+
import { useIntl as b } from "react-intl";
|
|
6
|
+
import { Icon as w } from "../../icon/Icon.js";
|
|
7
|
+
import { Tooltip as h } from "../../tooltip/Tooltip.js";
|
|
8
|
+
import { usePaginationContext as x } from "../PaginationContext.js";
|
|
9
|
+
const P = g({
|
|
10
|
+
base: [
|
|
11
|
+
"uy:min-w-300 uy:h-300 uy:p-25 uy:flex uy:justify-center uy:items-center uy:typography-action uy:rounded-circle uy:transition-colors",
|
|
12
|
+
"uy:text-content-neutral-lowest uy:enabled:bg-transparent uy:cursor-pointer",
|
|
13
|
+
"uy:hover:text-content-neutral-hover uy:hover:bg-surface-neutral-lowest-hover",
|
|
14
|
+
"uy:active:text-content-neutral-pressed uy:active:bg-surface-neutral-lowest-pressed",
|
|
15
|
+
"uy:data-[pressed]:text-content-neutral-pressed uy:data-[pressed]:bg-surface-neutral-lowest-pressed",
|
|
16
|
+
"uy:data-[disabled]:text-content-neutral-disabled uy:data-[disabled]:bg-transparent uy:data-[disabled]:cursor-not-allowed",
|
|
17
|
+
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-utility-focus-ring uy:focus-visible:outline-offset-2"
|
|
18
|
+
]
|
|
19
|
+
}), D = m(({ isDisabled: a, href: n, onPress: s, ...i }, u) => {
|
|
20
|
+
const r = b(), {
|
|
21
|
+
onKeyDown: l,
|
|
22
|
+
currentPage: e,
|
|
23
|
+
onPageChange: c
|
|
24
|
+
} = x(), t = r.formatMessage({
|
|
25
|
+
id: "unity:component:common:previous",
|
|
26
|
+
defaultMessage: "Previous"
|
|
27
|
+
}), y = r.formatMessage(
|
|
28
|
+
{
|
|
29
|
+
id: "unity:component:pagination:nav-button:description",
|
|
30
|
+
defaultMessage: "Go to previous page"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
variant: t
|
|
34
|
+
}
|
|
35
|
+
), d = (f) => {
|
|
36
|
+
l(f);
|
|
37
|
+
}, p = () => {
|
|
38
|
+
!n && e > 1 && c(e - 1, e, -1);
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ o(h, { title: t, children: /* @__PURE__ */ o(
|
|
41
|
+
v,
|
|
42
|
+
{
|
|
43
|
+
ref: u,
|
|
44
|
+
href: n,
|
|
45
|
+
className: P(),
|
|
46
|
+
isDisabled: a,
|
|
47
|
+
onPress: s ?? p,
|
|
48
|
+
"aria-label": t,
|
|
49
|
+
"aria-description": y,
|
|
50
|
+
onKeyDown: d,
|
|
51
|
+
...i,
|
|
52
|
+
children: /* @__PURE__ */ o(
|
|
53
|
+
w,
|
|
54
|
+
{
|
|
55
|
+
src: "CaretLeftOutlined",
|
|
56
|
+
size: 20,
|
|
57
|
+
color: "inherit",
|
|
58
|
+
role: "presentation"
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
) });
|
|
63
|
+
});
|
|
64
|
+
D.displayName = "RawPaginationPrevious";
|
|
65
|
+
export {
|
|
66
|
+
D as RawPaginationPrevious
|
|
67
|
+
};
|
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
function
|
|
2
|
-
return Array.from({ length:
|
|
3
|
-
(
|
|
1
|
+
function y(s, l) {
|
|
2
|
+
return Array.from({ length: l - s + 1 }, (p, t) => t + s).map(
|
|
3
|
+
(p) => ({
|
|
4
4
|
type: "page",
|
|
5
|
-
value:
|
|
5
|
+
value: p
|
|
6
6
|
})
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
9
|
const n = 5;
|
|
10
|
-
function
|
|
11
|
-
const
|
|
10
|
+
function d(s, l, p) {
|
|
11
|
+
const t = Math.max(
|
|
12
12
|
n,
|
|
13
|
-
|
|
14
|
-
),
|
|
15
|
-
if (
|
|
16
|
-
|
|
13
|
+
p % 2 === 0 ? p + 1 : p
|
|
14
|
+
), h = t - 2;
|
|
15
|
+
if (s === -1) {
|
|
16
|
+
const e = [];
|
|
17
|
+
e.push({ type: "page", value: 1 });
|
|
18
|
+
const o = h - 1, u = Math.floor(o / 2);
|
|
19
|
+
return l <= 3 + u ? (e.push(...y(2, t - 1)), e.push({ type: "ellipsis", value: [t, 1 / 0] })) : (e.push({ type: "ellipsis", value: [2, l - u] }), e.push(...y(l - u + 1, l + u)), e.push({
|
|
20
|
+
type: "ellipsis",
|
|
21
|
+
value: [l + u + 1, 1 / 0]
|
|
22
|
+
})), e;
|
|
23
|
+
}
|
|
24
|
+
if (s <= t)
|
|
25
|
+
return Array.from({ length: s }, (e, o) => ({
|
|
17
26
|
type: "page",
|
|
18
|
-
value:
|
|
27
|
+
value: o + 1
|
|
19
28
|
}));
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
return
|
|
29
|
+
const i = [];
|
|
30
|
+
i.push({ type: "page", value: 1 });
|
|
31
|
+
const v = h - 2, f = Math.floor(v / 2);
|
|
32
|
+
return l <= 3 + f ? (i.push(...y(2, h)), i.push({ type: "ellipsis", value: [h + 1, s - 1] })) : l >= s - (2 + f) ? (i.push({
|
|
24
33
|
type: "ellipsis",
|
|
25
|
-
value: [2,
|
|
26
|
-
}),
|
|
34
|
+
value: [2, s - (h - 1) - 1]
|
|
35
|
+
}), i.push(...y(s - (h - 1), s - 1))) : (i.push({ type: "ellipsis", value: [2, l - f - 1] }), i.push(...y(l - f, l + f)), i.push({
|
|
27
36
|
type: "ellipsis",
|
|
28
|
-
value: [
|
|
29
|
-
})),
|
|
37
|
+
value: [l + f + 1, s - 1]
|
|
38
|
+
})), i.push({ type: "page", value: s }), i;
|
|
30
39
|
}
|
|
31
40
|
export {
|
|
32
|
-
|
|
41
|
+
d as generatePaginationWithWindow
|
|
33
42
|
};
|
|
@@ -15,6 +15,10 @@ export type PayFitBrandProps = {
|
|
|
15
15
|
* The width of the brand. Defaults to the minimum of `104px`.
|
|
16
16
|
*/
|
|
17
17
|
width?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to display only the monogram or the full brand. Defaults to `false`.
|
|
20
|
+
*/
|
|
21
|
+
showOnlyMonogram?: boolean;
|
|
18
22
|
};
|
|
19
23
|
/**
|
|
20
24
|
* The PayFitBrand component represents the PayFit logo with several properties that follow our brand guidelines.
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as p, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f } from "react";
|
|
3
|
+
import { uyTv as u } from "@payfit/unity-themes";
|
|
4
|
+
import g from "../../hooks/use-id.js";
|
|
5
|
+
const b = u({
|
|
6
6
|
slots: {
|
|
7
|
-
base: "
|
|
7
|
+
base: "",
|
|
8
8
|
monogram: "",
|
|
9
9
|
logotype: ""
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
12
|
+
showOnlyMonogram: {
|
|
13
|
+
true: {
|
|
14
|
+
base: "uy:aspect-square uy:min-w-[32px]"
|
|
15
|
+
},
|
|
16
|
+
false: {
|
|
17
|
+
base: "uy:aspect-[13/4] uy:min-w-[104px]"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
12
20
|
color: {
|
|
13
21
|
original: {
|
|
14
22
|
monogram: "uy:fill-content-primary",
|
|
@@ -27,41 +35,41 @@ const g = f({
|
|
|
27
35
|
defaultVariants: {
|
|
28
36
|
color: "original"
|
|
29
37
|
}
|
|
30
|
-
}), Z =
|
|
31
|
-
({ color:
|
|
32
|
-
const o =
|
|
38
|
+
}), Z = f(
|
|
39
|
+
({ color: r, label: n, description: a, showOnlyMonogram: e = !1, ...i }, s) => {
|
|
40
|
+
const o = g(), t = `payfit-brand-title-${o}`, l = `payfit-brand-desc-${o}`, { base: m, monogram: h, logotype: d } = b({ color: r, showOnlyMonogram: e }), v = {
|
|
33
41
|
focusable: !1,
|
|
34
42
|
role: "img",
|
|
35
43
|
"aria-labelledby": t,
|
|
36
|
-
...a && { "aria-describedby":
|
|
37
|
-
},
|
|
38
|
-
...
|
|
39
|
-
...
|
|
44
|
+
...a && { "aria-describedby": l }
|
|
45
|
+
}, y = {
|
|
46
|
+
...i,
|
|
47
|
+
...v
|
|
40
48
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ p(
|
|
42
50
|
"svg",
|
|
43
51
|
{
|
|
44
|
-
...
|
|
45
|
-
ref:
|
|
52
|
+
...y,
|
|
53
|
+
ref: s,
|
|
46
54
|
fill: "none",
|
|
47
|
-
viewBox: "0 0 104 32",
|
|
48
|
-
className:
|
|
55
|
+
viewBox: e ? "0 0 32 32" : "0 0 104 32",
|
|
56
|
+
className: m(),
|
|
49
57
|
children: [
|
|
50
58
|
/* @__PURE__ */ c("title", { id: t, children: n ?? "PayFit Logo" }),
|
|
51
|
-
a && /* @__PURE__ */ c("desc", { id:
|
|
59
|
+
a && /* @__PURE__ */ c("desc", { id: l, children: a }),
|
|
52
60
|
/* @__PURE__ */ c(
|
|
53
61
|
"path",
|
|
54
62
|
{
|
|
55
63
|
fillRule: "evenodd",
|
|
56
|
-
className:
|
|
64
|
+
className: h(),
|
|
57
65
|
d: "M16 32C7.164 32 0 24.836 0 16S7.164 0 16 0s16 7.164 16 16-7.164 16-16 16Zm-.218-10.31v-3.18c0-.092.072-.183.163-.183h3.746a4.885 4.885 0 0 0 4.69-5.09 4.893 4.893 0 0 0-4.708-4.692h-9.127c-.2 0-.364.164-.364.364v12.836a2.801 2.801 0 0 0 5.6 0c.018-.036.018-.054 0-.054Zm.182-7.545h3.527a.73.73 0 0 0 .727-.727.73.73 0 0 0-.727-.727h-4.782c-.2 0-.364.163-.364.364v8.672c0 .746-.618 1.364-1.363 1.364a1.374 1.374 0 0 1-1.364-1.364V10.164c0-.091.073-.182.164-.182h7.708c1.91-.037 3.492 1.49 3.51 3.382.036 1.909-1.49 3.49-3.382 3.509h-3.654c-.091 0-.182-.073-.182-.164V14.327c0-.09.072-.163.182-.181Z",
|
|
58
66
|
clipRule: "evenodd"
|
|
59
67
|
}
|
|
60
68
|
),
|
|
61
|
-
/* @__PURE__ */ c(
|
|
69
|
+
!e && /* @__PURE__ */ c(
|
|
62
70
|
"path",
|
|
63
71
|
{
|
|
64
|
-
className:
|
|
72
|
+
className: d(),
|
|
65
73
|
d: "M76.49 11.945h-1.472c-.163 0-.309.11-.345.255-.073.218-.128.364-.146.455-.582 1.781-1.472 4.472-2.636 8.054-.018.055-.091.255-.237.582-.036.09-.145.127-.236.09a.219.219 0 0 1-.09-.09 7.862 7.862 0 0 1-.237-.582c-1.2-3.69-2.091-6.454-2.673-8.31-.018-.054-.036-.126-.054-.18a.372.372 0 0 0-.346-.255h-1.454a.365.365 0 0 0-.346.472c.018.055.036.091.055.146.909 2.582 2.272 6.436 4.09 11.582 0 .018 0 .018.019.036a.443.443 0 0 1 0 .218c0 .018 0 .018-.018.037-.019.072-.055.163-.073.236a1.805 1.805 0 0 1-1.691 1.2h-1.527c-.2 0-.364.164-.364.364v1.218c0 .2.164.363.364.363H68.6a3.72 3.72 0 0 0 3.418-2.236c.018-.055.037-.11.073-.164.018-.054 1.09-3.09 4.673-13.109.054-.127-.019-.29-.146-.345H76.6c-.055-.018-.073-.037-.11-.037ZM57.11 22.291c.345.109.708.163 1.072.163a4.232 4.232 0 0 0 2.89-1.2 2.949 2.949 0 0 0 .855-2.145v-.945a.163.163 0 0 0-.163-.164h-.037c-.182.018-.272.018-.272.018l-1.146.146-2.273.345c-1.218.2-1.963.69-2.2 1.455a1.923 1.923 0 0 0-.09.563c.018.818.581 1.527 1.363 1.764Zm6.854.8v.727c0 .2-.164.364-.364.364h-1.182a.365.365 0 0 1-.364-.364l-.018-1.2c0-.018-.018-.036-.018-.054a.088.088 0 0 0-.127 0 1.04 1.04 0 0 0-.2.2c-.946.945-2.236 1.418-3.91 1.418-1.2 0-2.181-.327-2.945-.964-.763-.636-1.127-1.527-1.127-2.654A3.316 3.316 0 0 1 54.036 19c.2-.418.491-.764.873-1.018a3.876 3.876 0 0 1 1.055-.546A5.45 5.45 0 0 1 57 17.164c1.764-.255 2.71-.382 2.89-.419.146-.018.728-.09 1.728-.236.073-.018.127-.018.2-.018.091-.018.164-.091.164-.182v-.51c0-.763-.2-1.363-.6-1.78-.4-.42-1.146-.637-2.218-.637-.491 0-.982.054-1.455.2-.364.109-.673.309-.927.6-.164.218-.31.436-.4.69-.018.055-.037.11-.055.183 0 .018 0 .036-.018.054a.371.371 0 0 1-.364.29h-1.363a.378.378 0 0 1-.346-.38v-.074c.019-.145.037-.254.055-.345.09-.345.236-.691.418-1a3.54 3.54 0 0 1 .818-.91c.437-.29.91-.508 1.418-.654a8.41 8.41 0 0 1 2.128-.254c3.29 0 4.89 1.309 4.89 3.963v7.346Zm26.963-10.873v11.564c0 .2.164.363.364.363h1.473c.2 0 .363-.163.363-.363V12.218c0-.2-.163-.364-.363-.364H91.29c-.2 0-.364.164-.364.364Zm0-3.673v1.473c0 .2.164.364.364.364h1.473c.2 0 .363-.164.363-.364V8.545c0-.2-.163-.363-.363-.363H91.29c-.2 0-.364.163-.364.363ZM100 13.782h3.109c.2 0 .364-.164.364-.364V12.2c0-.2-.164-.364-.364-.364H100c-.09 0-.182-.072-.182-.163V8.545c0-.2-.163-.363-.364-.363h-1.472c-.2 0-.364.163-.364.363v3.128c0 .09-.073.181-.163.181H96.09c-.2 0-.364.164-.364.364v1.218c0 .2.164.364.364.364h1.345c.091 0 .182.073.182.164V20.545c.073 2 1.71 3.6 3.709 3.6h1.655c.2 0 .363-.163.363-.363v-1.218c0-.2-.163-.364-.363-.364h-1.655a1.525 1.525 0 0 1-1.527-1.527v-6.71c.018-.108.09-.181.2-.181Zm-47.964-.637a4.96 4.96 0 0 0-4.854-4.963h-7c-.2 0-.364.163-.364.363v15.237c0 .2.164.363.364.363h1.472c.2 0 .364-.163.364-.363v-5.473c0-.09.073-.182.164-.182h5a4.975 4.975 0 0 0 4.854-4.982Zm-1.927 0a3.01 3.01 0 0 1-3.018 3.019h-4.873c-.09 0-.182-.073-.182-.164v-5.691c0-.09.073-.182.164-.182h4.891a3.01 3.01 0 0 1 3.018 3.018Zm31.2 4.928h5.527c.2 0 .364-.164.364-.364v-1.218c0-.2-.164-.364-.364-.364H81.31c-.09 0-.182-.072-.182-.163v-5.655c0-.09.073-.182.164-.182h6.8c.2 0 .364-.163.364-.363V8.545c0-.2-.164-.363-.364-.363h-8.8c-.2 0-.364.163-.364.363v15.237c0 .2.164.363.364.363h1.473c.2 0 .363-.163.363-.363v-5.527c0-.11.073-.182.182-.182Z"
|
|
66
74
|
}
|
|
67
75
|
)
|
|
@@ -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 };
|