@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
|
@@ -1,176 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useId as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { useOverlayTriggerState as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { PaginationLink as K } from "./parts/PaginationLink.js";
|
|
11
|
-
import { PaginationNavButton as y } from "./parts/PaginationNavButton.js";
|
|
12
|
-
import { generatePaginationWithWindow as O } from "./utils/pagination-window.js";
|
|
13
|
-
const S = q({
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k, useRef as x, useCallback as f } from "react";
|
|
3
|
+
import { uyTv as D } from "@payfit/unity-themes";
|
|
4
|
+
import { useId as L } from "react-aria";
|
|
5
|
+
import { useIntl as A } from "react-intl";
|
|
6
|
+
import { useOverlayTriggerState as I } from "react-stately";
|
|
7
|
+
import { PaginationJumpDialog as T } from "../client-side-pagination/parts/PaginationJumpDialog.js";
|
|
8
|
+
import { PaginationContext as R } from "./PaginationContext.js";
|
|
9
|
+
const g = D({
|
|
14
10
|
slots: {
|
|
15
|
-
base: "uy:flex uy:gap-100 uy:relative"
|
|
16
|
-
pagesList: "uy:flex uy:gap-100 uy:list-none uy:m-0 uy:p-0"
|
|
11
|
+
base: "uy:flex uy:gap-100 uy:relative"
|
|
17
12
|
}
|
|
18
|
-
}),
|
|
19
|
-
({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
currentPage: u,
|
|
23
|
-
onPageHover: b,
|
|
24
|
-
onPageChange: f,
|
|
25
|
-
onNextPress: P,
|
|
26
|
-
onPreviousPress: w,
|
|
27
|
-
...D
|
|
28
|
-
}, A) => {
|
|
29
|
-
const p = E(), l = R(), v = u !== void 0 && f !== void 0 && c === void 0, { currentPage: s, goToPage: i } = $({
|
|
30
|
-
pageCount: t,
|
|
31
|
-
initialPage: v ? u : c,
|
|
32
|
-
onPageChange: f,
|
|
33
|
-
isControlled: v
|
|
34
|
-
}), m = W({}), r = M(/* @__PURE__ */ new Map()), L = T(
|
|
35
|
-
() => O(
|
|
36
|
-
t,
|
|
37
|
-
s,
|
|
38
|
-
H
|
|
39
|
-
),
|
|
40
|
-
[t, s]
|
|
41
|
-
), h = new Intl.NumberFormat(l.locale, {
|
|
42
|
-
notation: "standard"
|
|
43
|
-
}), k = (e) => {
|
|
44
|
-
i(e), m.close(), requestAnimationFrame(() => {
|
|
45
|
-
const a = r.current.get(e);
|
|
46
|
-
a && a.focus();
|
|
47
|
-
});
|
|
48
|
-
}, d = (e, a) => {
|
|
49
|
-
switch (e.key) {
|
|
50
|
-
case "ArrowLeft":
|
|
51
|
-
case "ArrowUp":
|
|
52
|
-
e.preventDefault(), a > 1 && (i(a - 1), requestAnimationFrame(() => {
|
|
53
|
-
r.current.get(a - 1)?.focus();
|
|
54
|
-
}));
|
|
55
|
-
break;
|
|
56
|
-
case "ArrowRight":
|
|
57
|
-
case "ArrowDown":
|
|
58
|
-
e.preventDefault(), a < t && (i(a + 1), requestAnimationFrame(() => {
|
|
59
|
-
r.current.get(a + 1)?.focus();
|
|
60
|
-
}));
|
|
61
|
-
break;
|
|
62
|
-
case "Home":
|
|
63
|
-
e.preventDefault(), i(1), requestAnimationFrame(() => {
|
|
64
|
-
r.current.get(1)?.focus();
|
|
65
|
-
});
|
|
66
|
-
break;
|
|
67
|
-
case "End":
|
|
68
|
-
e.preventDefault(), i(t), requestAnimationFrame(() => {
|
|
69
|
-
r.current.get(t)?.focus();
|
|
70
|
-
});
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}, g = {
|
|
74
|
-
paginationLabel: l.formatMessage({
|
|
13
|
+
}), j = k(
|
|
14
|
+
({ children: c, pageCount: o, currentPage: i, onPageChange: s, ...p }, d) => {
|
|
15
|
+
const y = L(), b = A(), n = I({}), e = x(/* @__PURE__ */ new Map()), w = {
|
|
16
|
+
paginationLabel: b.formatMessage({
|
|
75
17
|
id: "unity:component:pagination:label",
|
|
76
18
|
defaultMessage: "Pagination"
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
19
|
+
})
|
|
20
|
+
}, l = {
|
|
21
|
+
paginationListId: `uy:pagination-${y}__list`
|
|
22
|
+
}, u = f(
|
|
23
|
+
(t) => {
|
|
24
|
+
s(t, i, Math.sign(t - i)), n.close(), requestAnimationFrame(() => {
|
|
25
|
+
const a = e.current.get(t);
|
|
26
|
+
a && a.focus();
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
[s, n, e, i]
|
|
30
|
+
), v = f(
|
|
31
|
+
(t) => {
|
|
32
|
+
t.preventDefault();
|
|
33
|
+
let a = i;
|
|
34
|
+
switch (t.key) {
|
|
35
|
+
case "ArrowLeft":
|
|
36
|
+
case "ArrowDown":
|
|
37
|
+
a = Math.max(1, i - 1);
|
|
38
|
+
break;
|
|
39
|
+
case "ArrowRight":
|
|
40
|
+
case "ArrowUp":
|
|
41
|
+
a = o === -1 ? i + 1 : Math.min(i + 1, o);
|
|
42
|
+
break;
|
|
43
|
+
case "Home":
|
|
44
|
+
a = 1;
|
|
45
|
+
break;
|
|
46
|
+
case "End":
|
|
47
|
+
o !== -1 && (a = o);
|
|
48
|
+
break;
|
|
86
49
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
50
|
+
a !== i && (s(
|
|
51
|
+
a,
|
|
52
|
+
i,
|
|
53
|
+
Math.sign(a - i)
|
|
54
|
+
), setTimeout(() => {
|
|
55
|
+
const m = e.current.get(a);
|
|
56
|
+
m && m.focus();
|
|
57
|
+
}, 0));
|
|
58
|
+
},
|
|
59
|
+
[o, i, s]
|
|
60
|
+
), { base: M } = g();
|
|
61
|
+
return /* @__PURE__ */ r(
|
|
62
|
+
R.Provider,
|
|
91
63
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/* @__PURE__ */ n("ul", { className: F(), "aria-label": g.pageListLabel, children: L.map(
|
|
117
|
-
(e, a) => e.type === "page" ? /* @__PURE__ */ n(
|
|
118
|
-
"li",
|
|
119
|
-
{
|
|
120
|
-
"aria-setsize": t,
|
|
121
|
-
"aria-posinset": e.value,
|
|
122
|
-
children: /* @__PURE__ */ n(
|
|
123
|
-
K,
|
|
124
|
-
{
|
|
125
|
-
ref: (o) => {
|
|
126
|
-
o ? r.current.set(e.value, o) : r.current.delete(e.value);
|
|
127
|
-
},
|
|
128
|
-
onPress: () => {
|
|
129
|
-
i(e.value);
|
|
130
|
-
},
|
|
131
|
-
onHoverChange: (o) => {
|
|
132
|
-
o && b?.(e.value);
|
|
133
|
-
},
|
|
134
|
-
onKeyDown: (o) => {
|
|
135
|
-
d(o, e.value);
|
|
136
|
-
},
|
|
137
|
-
isActive: e.value === s,
|
|
138
|
-
value: e.value,
|
|
139
|
-
children: h.format(e.value)
|
|
140
|
-
}
|
|
141
|
-
)
|
|
142
|
-
},
|
|
143
|
-
`pagination-${p}-item-${a}`
|
|
144
|
-
) : /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
145
|
-
j,
|
|
146
|
-
{
|
|
147
|
-
value: e.value,
|
|
148
|
-
onKeyDown: (o) => {
|
|
149
|
-
d(o, -1);
|
|
150
|
-
},
|
|
151
|
-
onPress: () => {
|
|
152
|
-
m.open();
|
|
64
|
+
value: {
|
|
65
|
+
pageCount: o,
|
|
66
|
+
currentPage: i,
|
|
67
|
+
onPageChange: s,
|
|
68
|
+
a11yIds: l,
|
|
69
|
+
pageRefs: e,
|
|
70
|
+
onKeyDown: v
|
|
71
|
+
},
|
|
72
|
+
children: /* @__PURE__ */ h(
|
|
73
|
+
"nav",
|
|
74
|
+
{
|
|
75
|
+
"data-dd-privacy": "allow",
|
|
76
|
+
...p,
|
|
77
|
+
ref: d,
|
|
78
|
+
className: M(),
|
|
79
|
+
"aria-label": w.paginationLabel,
|
|
80
|
+
"aria-describedby": l.paginationListId,
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ r(
|
|
83
|
+
T,
|
|
84
|
+
{
|
|
85
|
+
pageCount: o,
|
|
86
|
+
onJumpToPage: u,
|
|
87
|
+
state: n
|
|
153
88
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
variant: "next",
|
|
161
|
-
isDisabled: s === t,
|
|
162
|
-
onClick: () => {
|
|
163
|
-
i("next"), P?.();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
)
|
|
167
|
-
]
|
|
89
|
+
),
|
|
90
|
+
c
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
)
|
|
168
94
|
}
|
|
169
95
|
);
|
|
170
96
|
}
|
|
171
97
|
);
|
|
172
|
-
|
|
98
|
+
j.displayName = "Pagination";
|
|
173
99
|
export {
|
|
174
|
-
|
|
175
|
-
|
|
100
|
+
j as Pagination,
|
|
101
|
+
g as pagination
|
|
176
102
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
export interface PaginationContextValue {
|
|
3
|
+
pageCount: number;
|
|
4
|
+
currentPage: number;
|
|
5
|
+
onPageChange: (page: number, previous: number, direction: -1 | 1) => void;
|
|
6
|
+
onKeyDown: (event: React.KeyboardEvent) => void;
|
|
7
|
+
a11yIds: Record<string, string>;
|
|
8
|
+
pageRefs: MutableRefObject<Map<number, HTMLElement | null>>;
|
|
9
|
+
}
|
|
10
|
+
export declare const PaginationContext: import('react').Context<PaginationContextValue | null>;
|
|
11
|
+
export declare const usePaginationContext: () => PaginationContextValue;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext as n, useContext as o } from "react";
|
|
2
|
+
const e = n(
|
|
3
|
+
null
|
|
4
|
+
), a = () => {
|
|
5
|
+
const t = o(e);
|
|
6
|
+
if (!t)
|
|
7
|
+
throw new Error(
|
|
8
|
+
"usePaginationContext must be used within a Pagination component"
|
|
9
|
+
);
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
e as PaginationContext,
|
|
14
|
+
a as usePaginationContext
|
|
15
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface UsePaginationStateOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The total number of pages.
|
|
4
|
+
* Use -1 to indicate an unknown page count (e.g., for server-paginated data where total pages are not known upfront).
|
|
5
|
+
*/
|
|
6
|
+
pageCount: number;
|
|
7
|
+
/**
|
|
8
|
+
* The initial page to start at (1-based)
|
|
9
|
+
* @default 1
|
|
10
|
+
*/
|
|
11
|
+
initialPage?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Callback fired when the page changes
|
|
14
|
+
* @param page - The new page number
|
|
15
|
+
* @param previous - The previous page number
|
|
16
|
+
* @param direction - The direction of navigation (1 for forward, -1 for backward)
|
|
17
|
+
*/
|
|
18
|
+
onPageChange?: (page: number, previous: number, direction: -1 | 1) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Hook that manages pagination state for client-side pagination.
|
|
22
|
+
* This hook provides state management and navigation helpers for pagination components.
|
|
23
|
+
* @param options - Configuration options for pagination state
|
|
24
|
+
* @param options.pageCount - The total number of pages.
|
|
25
|
+
* @param options.initialPage - The initial page to start at (1-based)
|
|
26
|
+
* @param options.onPageChange - Callback fired when the page changes
|
|
27
|
+
* @returns Object containing current pagination state and navigation functions: currentPage (current active page), previousPage (page before current), nextPage (page after current), and goToPage (navigation function accepting page number or 'next'/'previous')
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* import { usePaginationState, Pagination, PaginationContent, PaginationItem, RawPaginationLink } from '@payfit/unity-components'
|
|
31
|
+
*
|
|
32
|
+
* function MyPagination() {
|
|
33
|
+
* const { currentPage, goToPage } = usePaginationState({
|
|
34
|
+
* pageCount: 10,
|
|
35
|
+
* initialPage: 1,
|
|
36
|
+
* })
|
|
37
|
+
*
|
|
38
|
+
* return (
|
|
39
|
+
* <Pagination
|
|
40
|
+
* pageCount={10}
|
|
41
|
+
* currentPage={currentPage}
|
|
42
|
+
* onPageChange={goToPage}
|
|
43
|
+
* >
|
|
44
|
+
* <PaginationContent>
|
|
45
|
+
* {Array.from({ length: 10 }, (_, i) => i + 1).map(page => (
|
|
46
|
+
* <PaginationItem key={page}>
|
|
47
|
+
* <RawPaginationLink value={page}>
|
|
48
|
+
* {page}
|
|
49
|
+
* </RawPaginationLink>
|
|
50
|
+
* </PaginationItem>
|
|
51
|
+
* ))}
|
|
52
|
+
* </PaginationContent>
|
|
53
|
+
* </Pagination>
|
|
54
|
+
* )
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function usePaginationState({ pageCount, initialPage, onPageChange, }: UsePaginationStateOptions): {
|
|
59
|
+
currentPage: number;
|
|
60
|
+
previousPage: number;
|
|
61
|
+
nextPage: number;
|
|
62
|
+
goToPage: (page: "previous" | "next" | number) => void;
|
|
63
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useState as l, useCallback as o } from "react";
|
|
2
|
+
function m({
|
|
3
|
+
pageCount: i,
|
|
4
|
+
initialPage: r = 1,
|
|
5
|
+
onPageChange: n
|
|
6
|
+
}) {
|
|
7
|
+
const [t, a] = l(r), c = t - 1, u = t + 1, s = o(
|
|
8
|
+
(e) => {
|
|
9
|
+
n && n(e, t, Math.sign(e - t)), a(Math.max(1, Math.min(i, e)));
|
|
10
|
+
},
|
|
11
|
+
[t, i, n]
|
|
12
|
+
), f = o(
|
|
13
|
+
(e) => {
|
|
14
|
+
s(e === "previous" ? t - 1 : e === "next" ? t + 1 : e);
|
|
15
|
+
},
|
|
16
|
+
[t, s]
|
|
17
|
+
);
|
|
18
|
+
return {
|
|
19
|
+
currentPage: t,
|
|
20
|
+
previousPage: c,
|
|
21
|
+
nextPage: u,
|
|
22
|
+
goToPage: f
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
m as usePaginationState
|
|
27
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type PaginationWindowItem = {
|
|
2
|
+
type: 'page';
|
|
3
|
+
value: number;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'ellipsis';
|
|
6
|
+
value: [number, number];
|
|
7
|
+
};
|
|
8
|
+
export interface UsePaginationWindowOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The total number of pages.
|
|
11
|
+
* Use -1 to indicate an unknown page count (e.g., for infinite scroll or server-paginated data).
|
|
12
|
+
* When -1, the hook will show pages from 1 to currentPage + offset, ending with an ellipsis indicating unknown pages beyond.
|
|
13
|
+
*/
|
|
14
|
+
pageCount: number;
|
|
15
|
+
/**
|
|
16
|
+
* The current page (1-based)
|
|
17
|
+
*/
|
|
18
|
+
currentPage: number;
|
|
19
|
+
/**
|
|
20
|
+
* The maximum number of pages to show in the window
|
|
21
|
+
* @default 7
|
|
22
|
+
*/
|
|
23
|
+
windowSize?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook that generates a pagination window with ellipsis for large page counts.
|
|
27
|
+
* This hook provides the logic for determining which pages to show in a pagination component.
|
|
28
|
+
* @param options - Configuration options for the pagination window
|
|
29
|
+
* @param options.pageCount - The total number of pages.
|
|
30
|
+
* @param options.currentPage - The current page (1-based).
|
|
31
|
+
* @param options.windowSize - The maximum number of pages to show in the window.
|
|
32
|
+
* @returns Array of pagination items (pages and ellipsis)
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* import { usePaginationWindow } from '@payfit/unity-components'
|
|
36
|
+
*
|
|
37
|
+
* function MyPagination() {
|
|
38
|
+
* const pages = usePaginationWindow({
|
|
39
|
+
* pageCount: 20,
|
|
40
|
+
* currentPage: 5,
|
|
41
|
+
* windowSize: 7
|
|
42
|
+
* })
|
|
43
|
+
*
|
|
44
|
+
* return (
|
|
45
|
+
* <Pagination>
|
|
46
|
+
* <PaginationContent>
|
|
47
|
+
* {pages.map((page, index) => (
|
|
48
|
+
* <PaginationItem key={index}>
|
|
49
|
+
* {page.type === 'page' ? (
|
|
50
|
+
* <RawPaginationLink href={`/page/${page.value}`}>
|
|
51
|
+
* {page.value}
|
|
52
|
+
* </RawPaginationLink>
|
|
53
|
+
* ) : (
|
|
54
|
+
* <PaginationEllipsis />
|
|
55
|
+
* )}
|
|
56
|
+
* </PaginationItem>
|
|
57
|
+
* ))}
|
|
58
|
+
* </PaginationContent>
|
|
59
|
+
* </Pagination>
|
|
60
|
+
* )
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function usePaginationWindow({ pageCount, currentPage, windowSize, }: UsePaginationWindowOptions): PaginationWindowItem[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useMemo as t } from "react";
|
|
2
|
+
import { generatePaginationWithWindow as r } from "../utils/pagination-window.js";
|
|
3
|
+
function a({
|
|
4
|
+
pageCount: o,
|
|
5
|
+
currentPage: i,
|
|
6
|
+
windowSize: n = 7
|
|
7
|
+
}) {
|
|
8
|
+
return t(
|
|
9
|
+
() => r(o, i, n),
|
|
10
|
+
[o, i, n]
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
a as usePaginationWindow
|
|
15
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
3
|
+
export declare const paginationContent: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "uy:flex uy:gap-100 uy:list-none uy:m-0 uy:p-0", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "uy:flex uy:gap-100 uy:list-none uy:m-0 uy:p-0", unknown, unknown, undefined>>;
|
|
4
|
+
export interface PaginationContentProps extends VariantProps<typeof paginationContent>, ComponentPropsWithoutRef<'ul'> {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The PaginationContent component provides a list container for pagination items.
|
|
9
|
+
* This component renders as a ul element with proper list semantics.
|
|
10
|
+
* @param props.children - The children to render.
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { PaginationContent, PaginationItem, RawPaginationLink } from '@payfit/unity-components'
|
|
14
|
+
*
|
|
15
|
+
* function MyPaginationContent() {
|
|
16
|
+
* return (
|
|
17
|
+
* <PaginationContent>
|
|
18
|
+
* <PaginationItem>
|
|
19
|
+
* <RawPaginationLink href="/page/1">1</RawPaginationLink>
|
|
20
|
+
* </PaginationItem>
|
|
21
|
+
* <PaginationItem>
|
|
22
|
+
* <RawPaginationLink href="/page/2">2</RawPaginationLink>
|
|
23
|
+
* </PaginationItem>
|
|
24
|
+
* </PaginationContent>
|
|
25
|
+
* )
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare const PaginationContent: import('react').ForwardRefExoticComponent<PaginationContentProps & import('react').RefAttributes<HTMLUListElement>>;
|
|
30
|
+
export { PaginationContent };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m, useMemo as p } from "react";
|
|
3
|
+
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
|
+
import { useIntl as c } from "react-intl";
|
|
5
|
+
import { usePaginationContext as f } from "../PaginationContext.js";
|
|
6
|
+
const y = g({
|
|
7
|
+
base: "uy:flex uy:gap-100 uy:list-none uy:m-0 uy:p-0"
|
|
8
|
+
}), d = m(
|
|
9
|
+
({ children: t, ...o }, a) => {
|
|
10
|
+
const n = c(), { pageCount: e, currentPage: i, a11yIds: r } = f(), s = n.formatMessage(
|
|
11
|
+
{
|
|
12
|
+
id: "unity:component:pagination:page-list:label",
|
|
13
|
+
defaultMessage: "Page {current} of {total}"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
current: i,
|
|
17
|
+
total: e
|
|
18
|
+
}
|
|
19
|
+
), u = p(() => y(), []);
|
|
20
|
+
return /* @__PURE__ */ l(
|
|
21
|
+
"ul",
|
|
22
|
+
{
|
|
23
|
+
...o,
|
|
24
|
+
ref: a,
|
|
25
|
+
id: r.pagesList,
|
|
26
|
+
className: u,
|
|
27
|
+
"aria-label": s,
|
|
28
|
+
children: t
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
d.displayName = "PaginationContent";
|
|
34
|
+
export {
|
|
35
|
+
d as PaginationContent,
|
|
36
|
+
y as paginationContent
|
|
37
|
+
};
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import { VariantProps } from '@payfit/unity-themes';
|
|
2
2
|
import { ButtonProps } from 'react-aria-components';
|
|
3
|
-
import {
|
|
4
|
-
export interface PaginationEllipsisProps extends Omit<ButtonProps, 'value' | 'children' | 'className' | 'style' | 'slot'
|
|
5
|
-
|
|
3
|
+
declare const paginationEllipsis: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
4
|
+
export interface PaginationEllipsisProps extends VariantProps<typeof paginationEllipsis>, Omit<ButtonProps, 'value' | 'children' | 'className' | 'style' | 'slot'> {
|
|
5
|
+
/**
|
|
6
|
+
* The id of the ellipsis element
|
|
7
|
+
*/
|
|
6
8
|
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the ellipsis is disabled
|
|
11
|
+
*/
|
|
7
12
|
isDisabled?: boolean;
|
|
8
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The range of pages represented by this ellipsis [start, end]
|
|
15
|
+
* When end is Infinity, it indicates an unknown page count
|
|
16
|
+
*/
|
|
17
|
+
value: [number, number];
|
|
9
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* The PaginationEllipsis component renders an ellipsis indicator for pagination.
|
|
21
|
+
* This component is used to indicate that there are more pages between the visible range.
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { PaginationEllipsis } from '@payfit/unity-components'
|
|
25
|
+
*
|
|
26
|
+
* <PaginationEllipsis value={[5, 10]} />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
10
29
|
declare const PaginationEllipsis: import('react').ForwardRefExoticComponent<PaginationEllipsisProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
11
30
|
export { PaginationEllipsis };
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as r } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useIntl as p } from "react-intl";
|
|
6
|
-
const
|
|
3
|
+
import { uyTv as y } from "@payfit/unity-themes";
|
|
4
|
+
import { Button as c } from "react-aria-components";
|
|
5
|
+
import { useIntl as p, FormattedMessage as f } from "react-intl";
|
|
6
|
+
const m = y({
|
|
7
7
|
base: [
|
|
8
8
|
"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:cursor-default",
|
|
9
9
|
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-utility-focus-ring uy:focus-visible:outline-offset-2"
|
|
10
10
|
]
|
|
11
|
-
}),
|
|
12
|
-
const t = p(), [
|
|
13
|
-
|
|
11
|
+
}), d = r(({ value: n, ...s }, o) => {
|
|
12
|
+
const t = p(), [u, e] = n, l = e === 1 / 0 ? t.formatMessage({
|
|
13
|
+
id: "unity:component:common:unknown",
|
|
14
|
+
defaultMessage: "unknown"
|
|
15
|
+
}) : e;
|
|
16
|
+
return /* @__PURE__ */ a(c, { ref: o, className: m(), ...s, children: [
|
|
14
17
|
/* @__PURE__ */ i("span", { "aria-hidden": !0, children: "…" }),
|
|
15
|
-
/* @__PURE__ */ i("span", { className: "uy:sr-only", children:
|
|
18
|
+
/* @__PURE__ */ i("span", { className: "uy:sr-only", children: /* @__PURE__ */ i(
|
|
19
|
+
f,
|
|
16
20
|
{
|
|
17
21
|
id: "unity:component:pagination:ellipsis:label",
|
|
18
|
-
defaultMessage: "More pages"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
defaultMessage: "More pages",
|
|
23
|
+
values: {
|
|
24
|
+
start: u,
|
|
25
|
+
end: l
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
28
|
) })
|
|
25
29
|
] });
|
|
26
30
|
});
|
|
27
|
-
|
|
31
|
+
d.displayName = "PaginationEllipsis";
|
|
28
32
|
export {
|
|
29
|
-
|
|
33
|
+
d as PaginationEllipsis
|
|
30
34
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface PaginationItemProps extends ComponentPropsWithoutRef<'li'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* The position of this item in the set (for aria-posinset)
|
|
6
|
+
* If not provided, will be calculated from context
|
|
7
|
+
*/
|
|
8
|
+
pageNumber?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The total number of pages (for aria-setsize)
|
|
11
|
+
* If not provided, will be calculated from context
|
|
12
|
+
*/
|
|
13
|
+
pageCount?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The PaginationItem component provides a list item wrapper for individual pagination controls.
|
|
17
|
+
* This component renders as a li element and should contain pagination links or buttons.
|
|
18
|
+
* It automatically gets pageCount from context and calculates aria attributes.
|
|
19
|
+
* @param props.children - The children to render.
|
|
20
|
+
* @param props.pageNumber - The position of this item in the set (for aria-posinset).
|
|
21
|
+
* @param props.pageCount - The total number of pages (for aria-setsize).
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { PaginationItem, RawPaginationLink } from '@payfit/unity-components'
|
|
25
|
+
*
|
|
26
|
+
* function MyPaginationItem() {
|
|
27
|
+
* return (
|
|
28
|
+
* <PaginationItem pageNumber={1}>
|
|
29
|
+
* <RawPaginationLink href="/page/1" isActive>
|
|
30
|
+
* 1
|
|
31
|
+
* </RawPaginationLink>
|
|
32
|
+
* </PaginationItem>
|
|
33
|
+
* )
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const PaginationItem: import('react').ForwardRefExoticComponent<PaginationItemProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
38
|
+
export { PaginationItem };
|