@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,73 @@
|
|
|
1
|
+
import { RegisteredRouter, ValidateLinkOptions } from '@tanstack/react-router';
|
|
2
|
+
import { NavigationCardProps as RawNavigationCardProps } from '../../../../components/navigation-card/NavigationCard.js';
|
|
3
|
+
type NavigationCardRouterProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = Omit<RawNavigationCardProps, 'asElement' | 'prefix' | 'suffix'> & ValidateLinkOptions<TRouter, TOptions> & {
|
|
4
|
+
prefixElement?: RawNavigationCardProps['prefix'];
|
|
5
|
+
suffixElement?: RawNavigationCardProps['suffix'];
|
|
6
|
+
};
|
|
7
|
+
type NavigationCardButtonProps = Omit<RawNavigationCardProps, 'asElement' | 'prefix' | 'suffix' | 'href'> & {
|
|
8
|
+
prefixElement?: RawNavigationCardProps['prefix'];
|
|
9
|
+
suffixElement?: RawNavigationCardProps['suffix'];
|
|
10
|
+
onPress: NonNullable<RawNavigationCardProps['onPress']>;
|
|
11
|
+
};
|
|
12
|
+
export type NavigationCardProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = NavigationCardRouterProps<TRouter, TOptions> | NavigationCardButtonProps;
|
|
13
|
+
/**
|
|
14
|
+
* Unity's NavigationCard that integrates with Tanstack Router for seamless client-side navigation.
|
|
15
|
+
* Enables declarative routing with type-safe route parameters, search params, and automatic preloading capabilities.
|
|
16
|
+
* @param {NavigationCardProps} props - Either router-based props (with 'to') or button-based props (with 'onPress')
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { NavigationCard } from '@payfit/unity-components/integrations/tanstack-router'
|
|
20
|
+
* import { Icon } from '@payfit/unity-components'
|
|
21
|
+
* import { NavigationCardLabel } from '@payfit/unity-components'
|
|
22
|
+
* import { NavigationCardDescription } from '@payfit/unity-components'
|
|
23
|
+
*
|
|
24
|
+
* // Router mode - navigation card as a link
|
|
25
|
+
* function NavigationWithLink() {
|
|
26
|
+
* return (
|
|
27
|
+
* <NavigationCard
|
|
28
|
+
* to="/dashboard"
|
|
29
|
+
* prefixElement={<Icon src="LayoutDashboardOutlined" size={24} />}
|
|
30
|
+
* >
|
|
31
|
+
* <div>
|
|
32
|
+
* <NavigationCardLabel>Dashboard</NavigationCardLabel>
|
|
33
|
+
* <NavigationCardDescription>
|
|
34
|
+
* View your analytics
|
|
35
|
+
* </NavigationCardDescription>
|
|
36
|
+
* </div>
|
|
37
|
+
* </NavigationCard>
|
|
38
|
+
* )
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* // Button mode - navigation card as a button
|
|
42
|
+
* function NavigationWithButton() {
|
|
43
|
+
* return (
|
|
44
|
+
* <NavigationCard
|
|
45
|
+
* onPress={() => console.log('Clicked')}
|
|
46
|
+
* prefixElement={<Icon src="PlusOutlined" size={24} />}
|
|
47
|
+
* >
|
|
48
|
+
* <Text variant="h4">Add New</Text>
|
|
49
|
+
* </NavigationCard>
|
|
50
|
+
* )
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
* @remarks
|
|
54
|
+
* - Automatically renders as a link when 'to' prop is provided, or as a button when 'onPress' is provided
|
|
55
|
+
* - Supports type-safe navigation with route parameters and search params via `params` and `search` props
|
|
56
|
+
* - Provides automatic route preloading on hover or mount via the `preload` prop
|
|
57
|
+
* - Handles relative and absolute paths with `from` and `to` props for flexible routing
|
|
58
|
+
* - Integrates seamlessly with Tanstack Router's navigation system and loader functions
|
|
59
|
+
* - Maintains all accessibility features and styling options from the underlying RawNavigationCard component
|
|
60
|
+
* - Automatically detects external URLs and applies appropriate security attributes (target="_blank", rel="noopener noreferrer")
|
|
61
|
+
* - Supports both `compact` and `comfortable` variants for different layout needs
|
|
62
|
+
* - Use `prefixElement` and `suffixElement` props to add icons or other elements to the card
|
|
63
|
+
* @see {@link NavigationCardProps} for all available props
|
|
64
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/components/navigation-card GitHub}
|
|
65
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
66
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
67
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
|
|
68
|
+
*/
|
|
69
|
+
declare function NavigationCard<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>({ prefixElement, suffixElement, ...rest }: NavigationCardProps<TRouter, TOptions>): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
declare namespace NavigationCard {
|
|
71
|
+
var displayName: string;
|
|
72
|
+
}
|
|
73
|
+
export { NavigationCard };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createLink as n } from "@tanstack/react-router";
|
|
3
|
+
import { RawNavigationCard as t } from "../../../../components/navigation-card/NavigationCard.js";
|
|
4
|
+
const d = n(t);
|
|
5
|
+
function e({
|
|
6
|
+
prefixElement: i,
|
|
7
|
+
suffixElement: a,
|
|
8
|
+
...o
|
|
9
|
+
}) {
|
|
10
|
+
return "to" in o || "href" in o ? (
|
|
11
|
+
// @ts-expect-error - Complex type intersection between router props and component props
|
|
12
|
+
/* @__PURE__ */ r(
|
|
13
|
+
d,
|
|
14
|
+
{
|
|
15
|
+
...o,
|
|
16
|
+
asElement: "a",
|
|
17
|
+
prefix: i,
|
|
18
|
+
suffix: a
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
) : (
|
|
22
|
+
// @ts-expect-error - TypeScript cannot narrow union types at the type level. RawNavigationCardProps is a union of link and button props, and runtime check ensures only button props are passed here.
|
|
23
|
+
/* @__PURE__ */ r(
|
|
24
|
+
t,
|
|
25
|
+
{
|
|
26
|
+
...o,
|
|
27
|
+
asElement: "button",
|
|
28
|
+
prefix: i,
|
|
29
|
+
suffix: a
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
e.displayName = "NavigationCard";
|
|
35
|
+
export {
|
|
36
|
+
e as NavigationCard
|
|
37
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { RegisteredRouter, ValidateLinkOptions } from '@tanstack/react-router';
|
|
2
|
+
import { PaginationLinkProps as RawPaginationLinkProps } from '../../../../components/pagination/parts/RawPaginationLink.js';
|
|
3
|
+
type PaginationLinkRouterProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = Omit<RawPaginationLinkProps, 'href' | 'onPress'> & ValidateLinkOptions<TRouter, TOptions>;
|
|
4
|
+
export type PaginationLinkProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = PaginationLinkRouterProps<TRouter, TOptions>;
|
|
5
|
+
/**
|
|
6
|
+
* A pagination link component that integrates with Tanstack Router for seamless navigation.
|
|
7
|
+
* Provides type-safe, URL-driven pagination with support for preloading and active states.
|
|
8
|
+
* @param {PaginationLinkProps} props - Router-based props including 'to', 'search', and pagination-specific props
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { PaginationLink } from '@payfit/unity-components/integrations/tanstack-router'
|
|
12
|
+
* import { Pagination, PaginationContent, PaginationItem } from '@payfit/unity-components'
|
|
13
|
+
*
|
|
14
|
+
* function ProductPagination() {
|
|
15
|
+
* const search = useSearch({ from: '/products' })
|
|
16
|
+
* const currentPage = search.page || 1
|
|
17
|
+
*
|
|
18
|
+
* return (
|
|
19
|
+
* <Pagination pageCount={10} currentPage={currentPage} onPageChange={handlePageChange}>
|
|
20
|
+
* <PaginationContent>
|
|
21
|
+
* <PaginationItem>
|
|
22
|
+
* <PaginationLink
|
|
23
|
+
* to="/products"
|
|
24
|
+
* search={{ ...search, page: 1 }}
|
|
25
|
+
* value={1}
|
|
26
|
+
* isCurrent={currentPage === 1}
|
|
27
|
+
* preload="intent"
|
|
28
|
+
* >
|
|
29
|
+
* 1
|
|
30
|
+
* </PaginationLink>
|
|
31
|
+
* </PaginationItem>
|
|
32
|
+
* </PaginationContent>
|
|
33
|
+
* </Pagination>
|
|
34
|
+
* )
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
* @remarks
|
|
38
|
+
* - Automatically applies active styling when isCurrent is true
|
|
39
|
+
* - Supports type-safe route parameters and search params with Tanstack Router
|
|
40
|
+
* - Enables preload="intent" for data loading before navigation
|
|
41
|
+
* - Maintains accessibility with aria-current="page" for current page
|
|
42
|
+
* - Works with Pagination context for keyboard navigation support
|
|
43
|
+
* - Uses the 'value' prop to identify the page number for the link
|
|
44
|
+
* @see {@link PaginationLinkProps} for all available props
|
|
45
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/components/pagination GitHub}
|
|
46
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
47
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
48
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
|
|
49
|
+
*/
|
|
50
|
+
declare function PaginationLink<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(props: PaginationLinkProps<TRouter, TOptions>): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
declare namespace PaginationLink {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
54
|
+
export { PaginationLink };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createLink as t } from "@tanstack/react-router";
|
|
3
|
+
import { RawPaginationLink as r } from "../../../../components/pagination/parts/RawPaginationLink.js";
|
|
4
|
+
const a = t(r);
|
|
5
|
+
function o(i) {
|
|
6
|
+
return (
|
|
7
|
+
// @ts-expect-error - Complex type intersection between router props and component props
|
|
8
|
+
/* @__PURE__ */ n(
|
|
9
|
+
a,
|
|
10
|
+
{
|
|
11
|
+
activeOptions: { exact: !0, includeSearch: !0 },
|
|
12
|
+
...i,
|
|
13
|
+
activeProps: { isCurrent: !0 }
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
o.displayName = "PaginationLink";
|
|
19
|
+
export {
|
|
20
|
+
o as PaginationLink
|
|
21
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RegisteredRouter, ValidateLinkOptions } from '@tanstack/react-router';
|
|
2
|
+
import { RawPaginationNextProps } from '../../../../components/pagination/parts/RawPaginationNext.js';
|
|
3
|
+
type PaginationNextRouterProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = Omit<RawPaginationNextProps, 'href' | 'onPress'> & ValidateLinkOptions<TRouter, TOptions>;
|
|
4
|
+
export type PaginationNextProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = PaginationNextRouterProps<TRouter, TOptions>;
|
|
5
|
+
/**
|
|
6
|
+
* A pagination next button component that integrates with Tanstack Router for seamless navigation.
|
|
7
|
+
* Provides type-safe navigation to the next page with support for preloading.
|
|
8
|
+
* @param {PaginationNextProps} props - Router-based props including 'to', 'search', and 'isDisabled'
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { PaginationNext } from '@payfit/unity-components/integrations/tanstack-router'
|
|
12
|
+
* import { Pagination, PaginationContent, PaginationItem } from '@payfit/unity-components'
|
|
13
|
+
*
|
|
14
|
+
* function ProductPagination() {
|
|
15
|
+
* const search = useSearch({ from: '/products' })
|
|
16
|
+
* const currentPage = search.page || 1
|
|
17
|
+
* const pageCount = 10
|
|
18
|
+
*
|
|
19
|
+
* return (
|
|
20
|
+
* <Pagination pageCount={pageCount} currentPage={currentPage} onPageChange={handlePageChange}>
|
|
21
|
+
* <PaginationContent>
|
|
22
|
+
* <PaginationItem>
|
|
23
|
+
* <PaginationNext
|
|
24
|
+
* to="/products"
|
|
25
|
+
* search={{ ...search, page: currentPage + 1 }}
|
|
26
|
+
* isDisabled={currentPage === pageCount}
|
|
27
|
+
* preload="intent"
|
|
28
|
+
* />
|
|
29
|
+
* </PaginationItem>
|
|
30
|
+
* </PaginationContent>
|
|
31
|
+
* </Pagination>
|
|
32
|
+
* )
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
* @remarks
|
|
36
|
+
* - Automatically renders as a disabled button when isDisabled is true
|
|
37
|
+
* - Supports type-safe route parameters and search params with Tanstack Router
|
|
38
|
+
* - Enables preload="intent" for data loading before navigation
|
|
39
|
+
* - Includes tooltip with "Next" label for accessibility
|
|
40
|
+
* - Works with Pagination context for keyboard navigation support
|
|
41
|
+
* - Renders a right-facing caret icon
|
|
42
|
+
* @see {@link PaginationNextProps} for all available props
|
|
43
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/components/pagination GitHub}
|
|
44
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
45
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
46
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
|
|
47
|
+
*/
|
|
48
|
+
declare function PaginationNext<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(props: PaginationNextProps<TRouter, TOptions>): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare namespace PaginationNext {
|
|
50
|
+
var displayName: string;
|
|
51
|
+
}
|
|
52
|
+
export { PaginationNext };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { createLink as a } from "@tanstack/react-router";
|
|
3
|
+
import { RawPaginationNext as e } from "../../../../components/pagination/parts/RawPaginationNext.js";
|
|
4
|
+
const n = a(e);
|
|
5
|
+
function o(t) {
|
|
6
|
+
return (
|
|
7
|
+
// @ts-expect-error - Complex type intersection between router props and component props
|
|
8
|
+
/* @__PURE__ */ i(
|
|
9
|
+
n,
|
|
10
|
+
{
|
|
11
|
+
activeOptions: { exact: !0, includeSearch: !0 },
|
|
12
|
+
...t,
|
|
13
|
+
activeProps: {},
|
|
14
|
+
inactiveProps: {}
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
o.displayName = "PaginationNext";
|
|
20
|
+
export {
|
|
21
|
+
o as PaginationNext
|
|
22
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { RegisteredRouter, ValidateLinkOptions } from '@tanstack/react-router';
|
|
2
|
+
import { RawPaginationPreviousProps } from '../../../../components/pagination/parts/RawPaginationPrevious.js';
|
|
3
|
+
type PaginationPreviousRouterProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = Omit<RawPaginationPreviousProps, 'href' | 'onPress'> & ValidateLinkOptions<TRouter, TOptions>;
|
|
4
|
+
export type PaginationPreviousProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = PaginationPreviousRouterProps<TRouter, TOptions>;
|
|
5
|
+
/**
|
|
6
|
+
* A pagination previous button component that integrates with Tanstack Router for seamless navigation.
|
|
7
|
+
* Provides type-safe navigation to the previous page with support for preloading.
|
|
8
|
+
* @param {PaginationPreviousProps} props - Router-based props including 'to', 'search', and 'isDisabled'
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { PaginationPrevious } from '@payfit/unity-components/integrations/tanstack-router'
|
|
12
|
+
* import { Pagination, PaginationContent, PaginationItem } from '@payfit/unity-components'
|
|
13
|
+
*
|
|
14
|
+
* function ProductPagination() {
|
|
15
|
+
* const search = useSearch({ from: '/products' })
|
|
16
|
+
* const currentPage = search.page || 1
|
|
17
|
+
*
|
|
18
|
+
* return (
|
|
19
|
+
* <Pagination pageCount={10} currentPage={currentPage} onPageChange={handlePageChange}>
|
|
20
|
+
* <PaginationContent>
|
|
21
|
+
* <PaginationItem>
|
|
22
|
+
* <PaginationPrevious
|
|
23
|
+
* to="/products"
|
|
24
|
+
* search={{ ...search, page: currentPage - 1 }}
|
|
25
|
+
* isDisabled={currentPage === 1}
|
|
26
|
+
* preload="intent"
|
|
27
|
+
* />
|
|
28
|
+
* </PaginationItem>
|
|
29
|
+
* </PaginationContent>
|
|
30
|
+
* </Pagination>
|
|
31
|
+
* )
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
* @remarks
|
|
35
|
+
* - Automatically renders as a disabled button when isDisabled is true
|
|
36
|
+
* - Supports type-safe route parameters and search params with Tanstack Router
|
|
37
|
+
* - Enables preload="intent" for data loading before navigation
|
|
38
|
+
* - Includes tooltip with "Previous" label for accessibility
|
|
39
|
+
* - Works with Pagination context for keyboard navigation support
|
|
40
|
+
* - Renders a left-facing caret icon
|
|
41
|
+
* @see {@link PaginationPreviousProps} for all available props
|
|
42
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/components/pagination GitHub}
|
|
43
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
44
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
45
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
|
|
46
|
+
*/
|
|
47
|
+
declare function PaginationPrevious<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(props: PaginationPreviousProps<TRouter, TOptions>): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
declare namespace PaginationPrevious {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
export { PaginationPrevious };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { createLink as r } from "@tanstack/react-router";
|
|
3
|
+
import { RawPaginationPrevious as t } from "../../../../components/pagination/parts/RawPaginationPrevious.js";
|
|
4
|
+
const a = r(t);
|
|
5
|
+
function e(i) {
|
|
6
|
+
return (
|
|
7
|
+
// @ts-expect-error - Complex type intersection between router props and component props
|
|
8
|
+
/* @__PURE__ */ o(
|
|
9
|
+
a,
|
|
10
|
+
{
|
|
11
|
+
activeOptions: { exact: !0, includeSearch: !0 },
|
|
12
|
+
...i,
|
|
13
|
+
activeProps: {},
|
|
14
|
+
inactiveProps: {}
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
e.displayName = "PaginationPrevious";
|
|
20
|
+
export {
|
|
21
|
+
e as PaginationPrevious
|
|
22
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { TabsProps as BaseTabsProps } from '../../../../components/tabs/Tabs.js';
|
|
2
|
+
export interface TabsProps extends Omit<BaseTabsProps, 'selectedKey' | 'isExact'> {
|
|
3
|
+
/**
|
|
4
|
+
* The currently selected tab key. If not provided, automatically uses the current route pathname.
|
|
5
|
+
* @default location.pathname
|
|
6
|
+
*/
|
|
7
|
+
selectedKey?: BaseTabsProps['selectedKey'];
|
|
8
|
+
/**
|
|
9
|
+
* Whether to use exact matching for active tab detection. Possible values are:
|
|
10
|
+
* - 'exact' - The tab will be active if the current route pathname matches the tab's pathname exactly
|
|
11
|
+
* - 'fuzzy' - The tab will be active if the current route pathname is a substring of the tab's pathname
|
|
12
|
+
* @default 'fuzzy'
|
|
13
|
+
*/
|
|
14
|
+
routeMatch?: 'exact' | 'fuzzy';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A Tabs component that integrates with Tanstack Router for navigation.
|
|
18
|
+
* Provides both selection state management and routing capabilities with automatic route synchronization.
|
|
19
|
+
* @param {TabsProps} props - Standard Tabs props plus Tanstack Router integration options
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* import { Tabs, Tab, TabList, TabPanel } from '@payfit/unity-components/integrations/tanstack-router'
|
|
23
|
+
* import { Outlet } from '@tanstack/react-router'
|
|
24
|
+
*
|
|
25
|
+
* // Pattern 1: Single auto-updating TabPanel (recommended for consistent layouts)
|
|
26
|
+
* // Tabs automatically resolve their IDs from route definitions
|
|
27
|
+
* function NavigationTabs() {
|
|
28
|
+
* return (
|
|
29
|
+
* <Tabs>
|
|
30
|
+
* <TabList aria-label="Main navigation">
|
|
31
|
+
* <Tab to="/dashboard">Dashboard</Tab>
|
|
32
|
+
* <Tab to="/employees/$employeeId" params={{employeeId: '1'}}>Employee</Tab>
|
|
33
|
+
* </TabList>
|
|
34
|
+
* <TabPanel>
|
|
35
|
+
* <Outlet />
|
|
36
|
+
* </TabPanel>
|
|
37
|
+
* </Tabs>
|
|
38
|
+
* )
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* // Pattern 2: Multiple explicit TabPanels (for different layouts per tab)
|
|
42
|
+
* // When Tab has explicit id, you MUST provide matching TabPanel with same id
|
|
43
|
+
* function CustomLayoutTabs() {
|
|
44
|
+
* return (
|
|
45
|
+
* <Tabs>
|
|
46
|
+
* <TabList aria-label="Custom layouts">
|
|
47
|
+
* <Tab to="/dashboard" id="dashboard">Dashboard</Tab>
|
|
48
|
+
* <Tab to="/analytics" id="analytics">Analytics</Tab>
|
|
49
|
+
* </TabList>
|
|
50
|
+
* <TabPanel id="dashboard" className="uy:grid uy:grid-cols-3">
|
|
51
|
+
* <Outlet />
|
|
52
|
+
* </TabPanel>
|
|
53
|
+
* <TabPanel id="analytics" className="uy:w-full uy:h-screen">
|
|
54
|
+
* <Outlet />
|
|
55
|
+
* </TabPanel>
|
|
56
|
+
* </Tabs>
|
|
57
|
+
* )
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
* @remarks
|
|
61
|
+
* - Automatically syncs selectedKey with current route using sophisticated route matching
|
|
62
|
+
* - Tab IDs are automatically resolved from route definitions (no manual IDs needed)
|
|
63
|
+
* - Handles nested routes properly (e.g., /settings/security matches /settings tab)
|
|
64
|
+
* - Supports both exact and fuzzy route matching via routeMatch prop
|
|
65
|
+
* - Integrates seamlessly with Tanstack Router's navigation system
|
|
66
|
+
* - Maintains all accessibility features from the base Tabs component
|
|
67
|
+
* - **TabPanel Pattern Constraint**: Choose ONE of two patterns:
|
|
68
|
+
* - Pattern 1 (Auto-sync): Single TabPanel without id prop - automatically shows active route content
|
|
69
|
+
* - Pattern 2 (Explicit): Multiple TabPanels with explicit id props - each Tab with explicit id MUST have matching TabPanel
|
|
70
|
+
* - Never mix auto-sync and explicit id patterns in the same Tabs component
|
|
71
|
+
* - When using explicit Tab IDs, provide corresponding TabPanel for each one
|
|
72
|
+
* - selectedKey and onSelectionChange can be overridden for custom behavior
|
|
73
|
+
* @see {@link TabsProps} for all available props
|
|
74
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/tabs GitHub}
|
|
75
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
76
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
77
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
|
|
78
|
+
*/
|
|
79
|
+
export declare function Tabs({ children, selectedKey: selectedKeyProp, onSelectionChange, routeMatch, ...tabsProps }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
export declare namespace Tabs {
|
|
81
|
+
var displayName: string;
|
|
82
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useLocation as f, useNavigate as I, useChildMatches as p } from "@tanstack/react-router";
|
|
3
|
+
import { RouterProvider as v } from "react-aria-components";
|
|
4
|
+
import { Tabs as R } from "../../../../components/tabs/Tabs.js";
|
|
5
|
+
function S({
|
|
6
|
+
children: i,
|
|
7
|
+
selectedKey: a,
|
|
8
|
+
onSelectionChange: u,
|
|
9
|
+
routeMatch: c = "fuzzy",
|
|
10
|
+
...d
|
|
11
|
+
}) {
|
|
12
|
+
const s = f(), g = I(), l = p({
|
|
13
|
+
select: (e) => {
|
|
14
|
+
if (e.length !== 0)
|
|
15
|
+
return c === "exact" ? e.reduce((t, o) => {
|
|
16
|
+
const n = String(t.routeId);
|
|
17
|
+
return String(o.routeId).length > n.length ? o : t;
|
|
18
|
+
}) : e.reduce((t, o) => {
|
|
19
|
+
const n = String(t.routeId);
|
|
20
|
+
return String(o.routeId).length < n.length ? o : t;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}), h = a ?? l?.id ?? s.pathname;
|
|
24
|
+
return /* @__PURE__ */ r(v, { navigate: (e) => {
|
|
25
|
+
g({ to: e });
|
|
26
|
+
}, children: /* @__PURE__ */ r(
|
|
27
|
+
R,
|
|
28
|
+
{
|
|
29
|
+
...d,
|
|
30
|
+
selectedKey: h,
|
|
31
|
+
onSelectionChange: (e) => {
|
|
32
|
+
u?.(e);
|
|
33
|
+
},
|
|
34
|
+
children: i
|
|
35
|
+
}
|
|
36
|
+
) });
|
|
37
|
+
}
|
|
38
|
+
S.displayName = "Tabs";
|
|
39
|
+
export {
|
|
40
|
+
S as Tabs
|
|
41
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { RegisteredRouter, ValidateLinkOptions } from '@tanstack/react-router';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { TabProps as RawTabProps } from '../../../../../components/tabs/parts/RawTab.js';
|
|
4
|
+
type TabProps<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown> = Omit<RawTabProps, 'onPress' | 'children' | 'suffix' | 'id'> & ValidateLinkOptions<TRouter, TOptions> & {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
suffixElement?: RawTabProps['suffix'];
|
|
7
|
+
id?: RawTabProps['id'];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A tab component that integrates with Tanstack Router for navigation.
|
|
11
|
+
* Provides seamless routing capabilities for tab-based navigation interfaces.
|
|
12
|
+
* @param props - Either router-based props (with 'to') or button-based props (with 'onPress')
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { Tab } from '@payfit/unity-components/integrations/tanstack-router'
|
|
16
|
+
*
|
|
17
|
+
* function NavigationTabs() {
|
|
18
|
+
* return (
|
|
19
|
+
* <Tabs>
|
|
20
|
+
* <TabList aria-label="Main navigation">
|
|
21
|
+
* <Tab to="/dashboard" id="dashboard">
|
|
22
|
+
* Dashboard
|
|
23
|
+
* </Tab>
|
|
24
|
+
* <Tab to="/employees" id="employees">
|
|
25
|
+
* Employees
|
|
26
|
+
* </Tab>
|
|
27
|
+
* <Tab onPress={() => alert('Action triggered')} id="action">
|
|
28
|
+
* Perform Action
|
|
29
|
+
* </Tab>
|
|
30
|
+
* </TabList>
|
|
31
|
+
* </Tabs>
|
|
32
|
+
* )
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
* @remarks
|
|
36
|
+
* - When 'to' prop is provided, the component renders as a router link
|
|
37
|
+
* - When 'onPress' prop is provided (without 'to'), it renders as a button
|
|
38
|
+
* - Supports all Tanstack Router link features like preloading, search params, and route params
|
|
39
|
+
* - Maintains accessibility features from the underlying RawTab component
|
|
40
|
+
* - Must be used within a TabsProvider context for proper styling and behavior
|
|
41
|
+
* @see {@link TabProps} for all available props
|
|
42
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/tabs GitHub}
|
|
43
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
44
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
45
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
|
|
46
|
+
*/
|
|
47
|
+
declare function Tab<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(props: TabProps<TRouter, TOptions>): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
declare namespace Tab {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
|
51
|
+
export { Tab };
|
|
52
|
+
export type { TabProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useLinkProps as f, createLink as a } from "@tanstack/react-router";
|
|
3
|
+
import { RawTab as m } from "../../../../../components/tabs/parts/RawTab.js";
|
|
4
|
+
const p = a(m);
|
|
5
|
+
function c(r) {
|
|
6
|
+
const { suffixElement: t, id: s, ...o } = r, e = f(o), i = s ?? e.href ?? o.to;
|
|
7
|
+
return (
|
|
8
|
+
// @ts-expect-error - Complex type intersection between router props and component props
|
|
9
|
+
/* @__PURE__ */ n(p, { ...o, suffix: t, id: i })
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
c.displayName = "Tab";
|
|
13
|
+
export {
|
|
14
|
+
c as Tab
|
|
15
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { TabPanelProps as BaseTabPanelProps } from '../../../../../components/tabs/parts/TabPanel.js';
|
|
3
|
+
export interface TabPanelProps extends Omit<BaseTabPanelProps, 'id'> {
|
|
4
|
+
/**
|
|
5
|
+
* The panel ID. When provided, this TabPanel will only render when its ID matches the selected tab.
|
|
6
|
+
* When omitted, automatically uses the selectedKey from the parent Tabs component.
|
|
7
|
+
* @default selectedKey from Tabs context
|
|
8
|
+
*/
|
|
9
|
+
id?: BaseTabPanelProps['id'];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A TabPanel component that integrates with Tanstack Router for automatic ID management.
|
|
13
|
+
* Uses the same sophisticated route matching logic as the Tabs component to determine the panel ID.
|
|
14
|
+
* @param {TabPanelProps} props - Standard TabPanel props with optional id and route matching options
|
|
15
|
+
* @param {ReactNode} props.children - The content to display in the tab panel
|
|
16
|
+
* @param {string} [props.id] - The panel ID. If not provided, uses matched route or current pathname
|
|
17
|
+
* @param {'exact' | 'fuzzy'} [props.routeMatch] - Route matching strategy for automatic ID detection
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { Tabs, Tab, TabList, TabPanel } from '@payfit/unity-components/integrations/tanstack-router'
|
|
21
|
+
* import { Outlet } from '@tanstack/react-router'
|
|
22
|
+
*
|
|
23
|
+
* // Single auto-updating TabPanel (recommended)
|
|
24
|
+
* function SinglePanelTabs() {
|
|
25
|
+
* return (
|
|
26
|
+
* <Tabs>
|
|
27
|
+
* <TabList aria-label="Main navigation">
|
|
28
|
+
* <Tab to="/dashboard">Dashboard</Tab>
|
|
29
|
+
* <Tab to="/employees">Employees</Tab>
|
|
30
|
+
* </TabList>
|
|
31
|
+
* <TabPanel>
|
|
32
|
+
* <Outlet />
|
|
33
|
+
* </TabPanel>
|
|
34
|
+
* </Tabs>
|
|
35
|
+
* )
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* // Multiple explicit TabPanels (for different layouts)
|
|
39
|
+
* function MultiPanelTabs() {
|
|
40
|
+
* return (
|
|
41
|
+
* <Tabs>
|
|
42
|
+
* <TabList aria-label="Custom layouts">
|
|
43
|
+
* <Tab to="/dashboard">Dashboard</Tab>
|
|
44
|
+
* <Tab to="/analytics">Analytics</Tab>
|
|
45
|
+
* </TabList>
|
|
46
|
+
* <TabPanel id="/dashboard" className="uy:grid uy:grid-cols-3">
|
|
47
|
+
* <Outlet />
|
|
48
|
+
* </TabPanel>
|
|
49
|
+
* <TabPanel id="/analytics" className="uy:w-full uy:h-screen">
|
|
50
|
+
* <Outlet />
|
|
51
|
+
* </TabPanel>
|
|
52
|
+
* </Tabs>
|
|
53
|
+
* )
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
* @remarks
|
|
57
|
+
* - Automatically syncs id with the same route matching logic as Tabs component
|
|
58
|
+
* - Handles nested routes properly (e.g., /settings/security matches /settings tab)
|
|
59
|
+
* - Supports both exact and fuzzy route matching via routeMatch prop
|
|
60
|
+
* - Maintains all accessibility features from the base TabPanel component
|
|
61
|
+
* - Must be used within a Tabs component from tanstack-router integration
|
|
62
|
+
* - **Pattern Constraint**: Choose ONE approach per Tabs component:
|
|
63
|
+
* - Single TabPanel without id prop (auto-syncs with active route)
|
|
64
|
+
* - Multiple TabPanels with explicit id props (one per tab)
|
|
65
|
+
* - Never mix auto-sync and explicit TabPanels in the same Tabs component
|
|
66
|
+
* - When using explicit ids, ensure count(Tab) equals count(TabPanel)
|
|
67
|
+
* - id and routeMatch can be overridden for custom behavior
|
|
68
|
+
* @see {@link TabPanelProps} for all available props
|
|
69
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/integrations/tanstack-router/tabs GitHub}
|
|
70
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
71
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
72
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/ unity-components.payfit.io}
|
|
73
|
+
*/
|
|
74
|
+
export declare function TabPanel({ children, id: idProp, ...tabPanelProps }: PropsWithChildren<TabPanelProps>): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export declare namespace TabPanel {
|
|
76
|
+
var displayName: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as s } from "react";
|
|
3
|
+
import { TabListStateContext as i } from "react-aria-components";
|
|
4
|
+
import { TabPanel as r } from "../../../../../components/tabs/parts/TabPanel.js";
|
|
5
|
+
function m({
|
|
6
|
+
children: t,
|
|
7
|
+
id: e,
|
|
8
|
+
...o
|
|
9
|
+
}) {
|
|
10
|
+
const a = s(i)?.selectedKey ?? void 0;
|
|
11
|
+
return /* @__PURE__ */ n(r, { ...o, id: e ?? a, children: t });
|
|
12
|
+
}
|
|
13
|
+
m.displayName = "TabPanel";
|
|
14
|
+
export {
|
|
15
|
+
m as TabPanel
|
|
16
|
+
};
|