@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,43 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsx as m, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import s, { forwardRef as E, useRef as k, useMemo as H, useImperativeHandle as D, useCallback as K } from "react";
|
|
3
|
+
import { uyTv as N, uyMerge as z } from "@payfit/unity-themes";
|
|
4
|
+
import { useVirtualizer as U } from "@tanstack/react-virtual";
|
|
5
|
+
import { useResizeObserver as $ } from "usehooks-ts";
|
|
6
|
+
import { TableContextProvider as M, useTableContext as P } from "./Table.context.js";
|
|
7
|
+
const j = N({
|
|
7
8
|
base: [
|
|
8
9
|
"uy:w-full uy:border uy:border-solid uy:border-border-neutral uy:rounded-100",
|
|
9
|
-
"uy:relative uy:flex uy:flex-col",
|
|
10
|
-
"uy:min-h-
|
|
11
|
-
"uy:overflow-y-auto",
|
|
12
|
-
// Handle vertical scrolling
|
|
13
|
-
"uy:overflow-x-auto"
|
|
14
|
-
// Handle horizontal scrolling too
|
|
10
|
+
"uy:relative uy:flex uy:flex-col uy:overflow-hidden",
|
|
11
|
+
"uy:min-h-(--uy-table-min-rows) uy:max-h-(--uy-table-max-rows)"
|
|
15
12
|
]
|
|
16
|
-
}),
|
|
17
|
-
({ minRows:
|
|
13
|
+
}), A = E(
|
|
14
|
+
({ minRows: c = 10, maxRows: y = 50, children: r }, n) => /* @__PURE__ */ m(
|
|
18
15
|
"div",
|
|
19
16
|
{
|
|
20
|
-
ref:
|
|
21
|
-
className:
|
|
17
|
+
ref: n,
|
|
18
|
+
className: j(),
|
|
22
19
|
"data-unity-slot": "table-root",
|
|
23
20
|
style: {
|
|
24
|
-
"--uy-table-min-rows": `calc(var(--uy-spacing-600) * ${
|
|
25
|
-
"--uy-table-max-rows": `calc(var(--uy-spacing-600) * ${
|
|
21
|
+
"--uy-table-min-rows": `calc(var(--uy-spacing-600) * ${c})`,
|
|
22
|
+
"--uy-table-max-rows": `calc(var(--uy-spacing-600) * ${y})`
|
|
26
23
|
},
|
|
27
|
-
children:
|
|
24
|
+
children: r
|
|
28
25
|
}
|
|
29
26
|
)
|
|
30
27
|
);
|
|
31
|
-
|
|
32
|
-
const
|
|
28
|
+
A.displayName = "TableRoot";
|
|
29
|
+
const _ = N({
|
|
33
30
|
slots: {
|
|
34
31
|
wrapper: [
|
|
35
32
|
"uy:flex-1 uy:bg-surface-neutral",
|
|
36
|
-
"uy:w-full"
|
|
37
|
-
// No overflow handling - parent TableRoot handles all scrolling
|
|
33
|
+
"uy:w-full uy:overflow-x-auto uy:overflow-y-auto"
|
|
38
34
|
],
|
|
39
35
|
table: [
|
|
40
|
-
"uy:
|
|
36
|
+
"uy:relative",
|
|
41
37
|
"uy:text-left uy:typography-body uy:text-content-neutral uy:border-collapse",
|
|
42
38
|
"uy:focus:outline-2 uy:focus:outline-utility-focus-ring uy:focus:outline-offset-[-2px]"
|
|
43
39
|
]
|
|
@@ -45,133 +41,174 @@ const $ = R({
|
|
|
45
41
|
variants: {
|
|
46
42
|
horizontalScroll: {
|
|
47
43
|
true: {
|
|
48
|
-
//
|
|
44
|
+
// Enable horizontal scrolling and allow table to exceed container width
|
|
49
45
|
table: "uy:w-max"
|
|
50
46
|
},
|
|
51
47
|
false: {
|
|
48
|
+
// Disable horizontal scrolling
|
|
49
|
+
wrapper: "uy:overflow-x-hidden",
|
|
52
50
|
table: "uy:w-fit"
|
|
53
51
|
}
|
|
52
|
+
},
|
|
53
|
+
layout: {
|
|
54
|
+
fixed: {
|
|
55
|
+
wrapper: "uy:overflow-x-hidden",
|
|
56
|
+
table: "uy:w-full uy:table-fixed"
|
|
57
|
+
},
|
|
58
|
+
auto: {
|
|
59
|
+
table: "uy:min-w-full uy:table-auto"
|
|
60
|
+
}
|
|
54
61
|
}
|
|
55
62
|
},
|
|
56
63
|
defaultVariants: {
|
|
57
|
-
horizontalScroll: !0
|
|
64
|
+
horizontalScroll: !0,
|
|
65
|
+
layout: "auto"
|
|
58
66
|
}
|
|
59
|
-
}),
|
|
67
|
+
}), I = E((c, y) => {
|
|
60
68
|
const {
|
|
61
|
-
children:
|
|
62
|
-
label:
|
|
63
|
-
description:
|
|
64
|
-
isHorizontalScrollEnabled:
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
children: r,
|
|
70
|
+
label: n,
|
|
71
|
+
description: h,
|
|
72
|
+
isHorizontalScrollEnabled: w = !0,
|
|
73
|
+
enableVirtualization: i = !1,
|
|
74
|
+
estimatedRowHeight: v = 40,
|
|
75
|
+
overscan: p = 5,
|
|
76
|
+
layout: g = "auto",
|
|
77
|
+
...x
|
|
78
|
+
} = c, u = k(null), { height: T = 0 } = $({
|
|
67
79
|
ref: u,
|
|
68
80
|
box: "border-box"
|
|
69
|
-
}), { rowCount:
|
|
70
|
-
let
|
|
71
|
-
return
|
|
72
|
-
if (!
|
|
73
|
-
const a =
|
|
74
|
-
|
|
75
|
-
).filter((
|
|
76
|
-
|
|
77
|
-
if (!
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
).filter((
|
|
81
|
-
|
|
81
|
+
}), { rowCount: d, columnCount: l } = H(() => {
|
|
82
|
+
let t = 0, o = 0;
|
|
83
|
+
return s.Children.forEach(r, (e) => {
|
|
84
|
+
if (!s.isValidElement(e)) return;
|
|
85
|
+
const a = s.Children.toArray(
|
|
86
|
+
e.props.children
|
|
87
|
+
).filter((f) => s.isValidElement(f));
|
|
88
|
+
o += a.length, a.forEach((f) => {
|
|
89
|
+
if (!s.isValidElement(f)) return;
|
|
90
|
+
const C = s.Children.toArray(
|
|
91
|
+
f.props.children
|
|
92
|
+
).filter((V) => s.isValidElement(V));
|
|
93
|
+
t = Math.max(t, C.length);
|
|
82
94
|
});
|
|
83
|
-
}), { rowCount:
|
|
84
|
-
}, [
|
|
85
|
-
|
|
95
|
+
}), { rowCount: o, columnCount: t };
|
|
96
|
+
}, [r]);
|
|
97
|
+
D(y, () => ({
|
|
86
98
|
scrollToTop: () => {
|
|
87
|
-
const
|
|
99
|
+
const t = u.current, o = t?.closest(
|
|
88
100
|
'[data-unity-slot="table-root"]'
|
|
89
101
|
);
|
|
90
|
-
|
|
102
|
+
let e;
|
|
103
|
+
if (o ? e = o : t && (e = t), !!e) {
|
|
104
|
+
if (typeof e.scrollTo == "function") {
|
|
105
|
+
e.scrollTo({ top: 0, behavior: "smooth" });
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
e.scrollTop = 0;
|
|
109
|
+
}
|
|
91
110
|
}
|
|
92
|
-
}))
|
|
93
|
-
|
|
111
|
+
}));
|
|
112
|
+
const b = U({
|
|
113
|
+
count: i ? d : 0,
|
|
114
|
+
getScrollElement: () => u.current,
|
|
115
|
+
estimateSize: () => v,
|
|
116
|
+
overscan: p
|
|
117
|
+
});
|
|
118
|
+
return /* @__PURE__ */ m(
|
|
119
|
+
M,
|
|
94
120
|
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
121
|
+
rowCount: d,
|
|
122
|
+
columnCount: l,
|
|
123
|
+
virtualizer: b,
|
|
124
|
+
enableVirtualization: i,
|
|
125
|
+
children: /* @__PURE__ */ m(
|
|
126
|
+
S,
|
|
127
|
+
{
|
|
128
|
+
scrollContainerRef: u,
|
|
129
|
+
containerHeight: i ? b.getTotalSize() : T,
|
|
130
|
+
rowCount: d,
|
|
131
|
+
columnCount: l,
|
|
132
|
+
label: n,
|
|
133
|
+
description: h,
|
|
134
|
+
isHorizontalScrollEnabled: w,
|
|
135
|
+
layout: g,
|
|
136
|
+
...x,
|
|
137
|
+
children: r
|
|
138
|
+
}
|
|
139
|
+
)
|
|
104
140
|
}
|
|
105
|
-
)
|
|
141
|
+
);
|
|
106
142
|
});
|
|
107
|
-
|
|
108
|
-
const
|
|
143
|
+
I.displayName = "Table";
|
|
144
|
+
const S = (c) => {
|
|
109
145
|
const {
|
|
110
|
-
children:
|
|
111
|
-
label:
|
|
112
|
-
description:
|
|
113
|
-
scrollContainerRef:
|
|
114
|
-
|
|
115
|
-
rowCount:
|
|
116
|
-
columnCount:
|
|
117
|
-
onKeyDown:
|
|
118
|
-
isHorizontalScrollEnabled:
|
|
119
|
-
...
|
|
120
|
-
} =
|
|
121
|
-
horizontalScroll:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
146
|
+
children: y,
|
|
147
|
+
label: r,
|
|
148
|
+
description: n,
|
|
149
|
+
scrollContainerRef: h,
|
|
150
|
+
layout: w,
|
|
151
|
+
rowCount: i,
|
|
152
|
+
columnCount: v,
|
|
153
|
+
onKeyDown: p,
|
|
154
|
+
isHorizontalScrollEnabled: g = !0,
|
|
155
|
+
...x
|
|
156
|
+
} = c, { wrapper: u, table: T } = _({
|
|
157
|
+
horizontalScroll: g,
|
|
158
|
+
layout: w
|
|
159
|
+
}), { keyboardNavigation: d } = P(), { tableRef: l, handleTableKeyDown: b } = d, t = K(
|
|
160
|
+
(a) => {
|
|
161
|
+
a.key !== "Tab" && (b(a), p?.(a));
|
|
125
162
|
},
|
|
126
|
-
[
|
|
127
|
-
),
|
|
163
|
+
[b, p]
|
|
164
|
+
), o = h.current?.closest(
|
|
128
165
|
'[data-unity-slot="table-root"]'
|
|
129
|
-
),
|
|
130
|
-
if (!
|
|
131
|
-
const
|
|
132
|
-
return (
|
|
133
|
-
}, [
|
|
134
|
-
return /* @__PURE__ */
|
|
166
|
+
), e = H(() => {
|
|
167
|
+
if (!o || i === 0) return !1;
|
|
168
|
+
const a = o.clientHeight;
|
|
169
|
+
return (l.current?.clientHeight ?? 0) / a < 0.9;
|
|
170
|
+
}, [o, i, l]);
|
|
171
|
+
return /* @__PURE__ */ R(
|
|
135
172
|
"div",
|
|
136
173
|
{
|
|
137
|
-
className:
|
|
138
|
-
ref:
|
|
174
|
+
className: z(u()),
|
|
175
|
+
ref: h,
|
|
139
176
|
style: {
|
|
140
|
-
"--uy-table-has-remaining-space":
|
|
177
|
+
"--uy-table-has-remaining-space": e ? "1" : "0"
|
|
141
178
|
},
|
|
142
179
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ R(
|
|
144
181
|
"table",
|
|
145
182
|
{
|
|
146
|
-
ref:
|
|
147
|
-
className:
|
|
183
|
+
ref: l,
|
|
184
|
+
className: z(T()),
|
|
148
185
|
role: "grid",
|
|
149
|
-
"aria-rowcount":
|
|
150
|
-
"aria-colcount":
|
|
151
|
-
"aria-label":
|
|
152
|
-
"aria-describedby":
|
|
153
|
-
onKeyDown:
|
|
154
|
-
...
|
|
186
|
+
"aria-rowcount": i,
|
|
187
|
+
"aria-colcount": v,
|
|
188
|
+
"aria-label": r,
|
|
189
|
+
"aria-describedby": n ? `table-desc-${l.current?.id}` : void 0,
|
|
190
|
+
onKeyDown: t,
|
|
191
|
+
...x,
|
|
155
192
|
children: [
|
|
156
|
-
|
|
157
|
-
|
|
193
|
+
y,
|
|
194
|
+
n && /* @__PURE__ */ m(
|
|
158
195
|
"caption",
|
|
159
196
|
{
|
|
160
|
-
id: `table-desc-${
|
|
197
|
+
id: `table-desc-${l.current?.id}`,
|
|
161
198
|
className: "uy:sr-only",
|
|
162
|
-
children:
|
|
199
|
+
children: n
|
|
163
200
|
}
|
|
164
201
|
)
|
|
165
202
|
]
|
|
166
203
|
}
|
|
167
204
|
),
|
|
168
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ m("div", { className: "uy:sr-only", "aria-live": "polite", children: "Table navigation: Use arrow keys to move between cells. Tab key exits the table. Home and End keys navigate to the first and last cell in a row. Page Up and Page Down move between rows." })
|
|
169
206
|
]
|
|
170
207
|
}
|
|
171
208
|
);
|
|
172
209
|
};
|
|
173
|
-
|
|
210
|
+
S.displayName = "TableContent";
|
|
174
211
|
export {
|
|
175
|
-
|
|
176
|
-
|
|
212
|
+
I as Table,
|
|
213
|
+
A as TableRoot
|
|
177
214
|
};
|
|
@@ -126,7 +126,7 @@ function O() {
|
|
|
126
126
|
[l]
|
|
127
127
|
), x = i(
|
|
128
128
|
(e) => {
|
|
129
|
-
if (e.key === "
|
|
129
|
+
if (e.key === "RawTab" || !a.current) return;
|
|
130
130
|
let t = e.currentTarget;
|
|
131
131
|
const s = e.target;
|
|
132
132
|
if (s !== t) {
|
|
@@ -173,19 +173,19 @@ function O() {
|
|
|
173
173
|
break;
|
|
174
174
|
case "PageUp":
|
|
175
175
|
e.preventDefault();
|
|
176
|
-
const f = Math.max(0, r - 5),
|
|
177
|
-
if (!
|
|
178
|
-
const R = Array.from(
|
|
176
|
+
const f = Math.max(0, r - 5), w = n[f];
|
|
177
|
+
if (!w) break;
|
|
178
|
+
const R = Array.from(w.querySelectorAll("td, th")), E = Math.min(u, R.length - 1);
|
|
179
179
|
l(f, E);
|
|
180
180
|
break;
|
|
181
181
|
case "PageDown":
|
|
182
182
|
e.preventDefault();
|
|
183
|
-
const
|
|
183
|
+
const p = Math.min(n.length - 1, r + 5), C = n[p];
|
|
184
184
|
if (!C) break;
|
|
185
185
|
const T = Array.from(
|
|
186
186
|
C.querySelectorAll("td, th")
|
|
187
187
|
), F = Math.min(u, T.length - 1);
|
|
188
|
-
l(
|
|
188
|
+
l(p, F);
|
|
189
189
|
break;
|
|
190
190
|
}
|
|
191
191
|
},
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { uyTv as
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import y, { forwardRef as b, Children as f, cloneElement as g } from "react";
|
|
3
|
+
import { uyTv as _ } from "@payfit/unity-themes";
|
|
4
|
+
import { useTableContext as x } from "../Table.context.js";
|
|
5
|
+
const C = _({
|
|
6
|
+
base: ["uy:transition-all uy:duration-200 uy:ease-in-out uy:relative"],
|
|
6
7
|
variants: {
|
|
7
8
|
isEmpty: {
|
|
8
9
|
true: ["uy:h-[var(--uy-table-min-rows)]"],
|
|
@@ -12,31 +13,92 @@ const C = v({
|
|
|
12
13
|
]
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
}),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
16
|
+
}), E = ({
|
|
17
|
+
children: c,
|
|
18
|
+
hasDataStateContent: p,
|
|
19
|
+
enableVirtualization: u,
|
|
20
|
+
virtualizer: a
|
|
21
|
+
}) => {
|
|
22
|
+
if (p)
|
|
23
|
+
return [];
|
|
24
|
+
if (u && a) {
|
|
25
|
+
const t = a.getVirtualItems(), d = a.getTotalSize(), m = t[0], l = t[t.length - 1], o = m ? m.start : 0, s = l ? d - l.end : 0, e = [];
|
|
26
|
+
return o > 0 && e.push(
|
|
27
|
+
/* @__PURE__ */ r(
|
|
28
|
+
"tr",
|
|
29
|
+
{
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
style: { border: 0, borderBottom: 0 },
|
|
32
|
+
children: /* @__PURE__ */ r(
|
|
33
|
+
"td",
|
|
34
|
+
{
|
|
35
|
+
colSpan: 1e3,
|
|
36
|
+
style: { height: o, padding: 0, border: 0 }
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
},
|
|
40
|
+
"__spacer-top__"
|
|
41
|
+
)
|
|
42
|
+
), t.forEach((i) => {
|
|
43
|
+
const n = y.Children.toArray(c)[i.index];
|
|
44
|
+
y.isValidElement(n) && e.push(
|
|
45
|
+
y.cloneElement(n, {
|
|
46
|
+
key: i.index,
|
|
47
|
+
rowIndex: i.index,
|
|
48
|
+
ref: (h) => {
|
|
49
|
+
h && a.measureElement(h);
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
}), s > 0 && e.push(
|
|
54
|
+
/* @__PURE__ */ r(
|
|
55
|
+
"tr",
|
|
56
|
+
{
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
style: { border: 0, borderBottom: 0 },
|
|
59
|
+
children: /* @__PURE__ */ r(
|
|
60
|
+
"td",
|
|
61
|
+
{
|
|
62
|
+
colSpan: 1e3,
|
|
63
|
+
style: { height: s, padding: 0, border: 0 }
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
},
|
|
67
|
+
"__spacer-bottom__"
|
|
68
|
+
)
|
|
69
|
+
), e;
|
|
70
|
+
}
|
|
71
|
+
return f.map(c, (t, d) => y.isValidElement(t) ? g(
|
|
72
|
+
t,
|
|
73
|
+
{
|
|
74
|
+
rowIndex: d,
|
|
75
|
+
...t.props
|
|
76
|
+
}
|
|
77
|
+
) : t);
|
|
78
|
+
}, T = b(
|
|
79
|
+
({ children: c, renderEmptyState: p, renderDataState: u, ...a }, t) => {
|
|
80
|
+
const { virtualizer: d, enableVirtualization: m } = x(), l = u ? u() : void 0, o = l !== void 0, s = E({
|
|
81
|
+
children: c,
|
|
82
|
+
hasDataStateContent: o,
|
|
83
|
+
enableVirtualization: m,
|
|
84
|
+
virtualizer: d
|
|
85
|
+
}), e = !s || s.length === 0 || o, i = e && p ? p() : null;
|
|
86
|
+
let n = null;
|
|
87
|
+
return o ? n = l : e && i && (n = i), /* @__PURE__ */ r(
|
|
26
88
|
"tbody",
|
|
27
89
|
{
|
|
28
|
-
ref:
|
|
90
|
+
ref: t,
|
|
29
91
|
className: C({ isEmpty: e }),
|
|
30
92
|
"data-dd-privacy": "mask",
|
|
31
|
-
"data-empty": e ||
|
|
32
|
-
...
|
|
33
|
-
children:
|
|
93
|
+
"data-empty": e || o || void 0,
|
|
94
|
+
...a,
|
|
95
|
+
children: n ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: 1e3, className: "uy:p-0", children: n }) }) : s
|
|
34
96
|
}
|
|
35
97
|
);
|
|
36
98
|
}
|
|
37
99
|
);
|
|
38
|
-
|
|
100
|
+
T.displayName = "TableBody";
|
|
39
101
|
export {
|
|
40
|
-
|
|
102
|
+
T as TableBody,
|
|
41
103
|
C as tableBody
|
|
42
104
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as v, forwardRef as g } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useTableContext as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { memo as v, forwardRef as g, useMemo as T } from "react";
|
|
3
|
+
import { uyTv as w } from "@payfit/unity-themes";
|
|
4
|
+
import { useTableContext as k } from "../Table.context.js";
|
|
5
|
+
const D = w({
|
|
6
6
|
base: [
|
|
7
7
|
"uy:px-200 uy:py-150 uy:text-content-neutral uy:typography-body",
|
|
8
8
|
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-offset-[-2px] uy:focus-visible:outline-utility-focus-ring"
|
|
@@ -14,46 +14,49 @@ const w = C({
|
|
|
14
14
|
right: "uy:text-right"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
}),
|
|
17
|
+
}), K = v(
|
|
18
18
|
g(
|
|
19
19
|
({
|
|
20
|
-
children:
|
|
20
|
+
children: s,
|
|
21
21
|
colIndex: t = 0,
|
|
22
|
-
rowIndex:
|
|
23
|
-
align:
|
|
24
|
-
onKeyDown:
|
|
22
|
+
rowIndex: u = 0,
|
|
23
|
+
align: o,
|
|
24
|
+
onKeyDown: i,
|
|
25
25
|
onFocus: r,
|
|
26
|
-
className:
|
|
27
|
-
isRowHeader:
|
|
28
|
-
isFocusable:
|
|
26
|
+
className: l,
|
|
27
|
+
isRowHeader: a = !1,
|
|
28
|
+
isFocusable: n = !0,
|
|
29
29
|
...y
|
|
30
30
|
}, c) => {
|
|
31
|
-
const { keyboardNavigation: f } =
|
|
32
|
-
|
|
31
|
+
const { keyboardNavigation: f } = k(), { isCellFocused: b, handleCellKeyDown: d, handleCellFocus: m } = f, p = T(
|
|
32
|
+
() => D({ align: o, className: l }),
|
|
33
|
+
[o, l]
|
|
34
|
+
), x = n && b(u, t), h = (e) => {
|
|
35
|
+
e.key !== "Tab" && (d(e), i?.(e));
|
|
33
36
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
37
|
+
return /* @__PURE__ */ C(
|
|
38
|
+
a ? "th" : "td",
|
|
36
39
|
{
|
|
37
40
|
ref: c,
|
|
38
|
-
role:
|
|
41
|
+
role: a ? "rowheader" : "gridcell",
|
|
39
42
|
"aria-colindex": t + 1,
|
|
40
|
-
tabIndex:
|
|
41
|
-
"data-focusable":
|
|
42
|
-
className:
|
|
43
|
-
onKeyDown:
|
|
43
|
+
tabIndex: x ? 0 : -1,
|
|
44
|
+
"data-focusable": n,
|
|
45
|
+
className: p,
|
|
46
|
+
onKeyDown: h,
|
|
44
47
|
onFocus: (e) => {
|
|
45
48
|
m(e), r?.(e);
|
|
46
49
|
},
|
|
47
50
|
"data-dd-privacy": "mask",
|
|
48
51
|
...y,
|
|
49
|
-
children:
|
|
52
|
+
children: s
|
|
50
53
|
}
|
|
51
54
|
);
|
|
52
55
|
}
|
|
53
56
|
)
|
|
54
57
|
);
|
|
55
|
-
|
|
58
|
+
K.displayName = "TableCell";
|
|
56
59
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
K as TableCell,
|
|
61
|
+
D as tableCell
|
|
59
62
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
2
|
+
import { forwardRef as y, useMemo as c } from "react";
|
|
3
|
+
import { uyTv as d } from "@payfit/unity-themes";
|
|
4
4
|
import { useIntl as m } from "react-intl";
|
|
5
5
|
import { Spinner as u } from "../../spinner/Spinner.js";
|
|
6
6
|
import { Text as f } from "../../text/Text.js";
|
|
7
7
|
import b from "../assets/EmptyStateError.svg.js";
|
|
8
8
|
import x from "../assets/EmptyStateNoData.svg.js";
|
|
9
|
-
const E =
|
|
9
|
+
const E = d({
|
|
10
10
|
slots: {
|
|
11
11
|
base: "uy:flex uy:flex-col uy:items-center uy:justify-center",
|
|
12
|
-
wrapper: "uy:max-w-[300px] uy:flex uy:flex-col uy:items-center"
|
|
12
|
+
wrapper: "uy:max-w-[300px] uy:flex uy:flex-col uy:items-center uy:py-800"
|
|
13
13
|
}
|
|
14
|
-
}), r =
|
|
14
|
+
}), r = y(
|
|
15
15
|
(t, i) => {
|
|
16
16
|
const { variant: a, children: o } = t, s = c(() => {
|
|
17
17
|
switch (a) {
|
|
@@ -43,7 +43,7 @@ const E = y({
|
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
r.displayName = "TableEmptyStateText";
|
|
46
|
-
const n =
|
|
46
|
+
const n = y(
|
|
47
47
|
({ children: t, className: i, ...a }, o) => {
|
|
48
48
|
const { base: s, wrapper: l } = E();
|
|
49
49
|
return /* @__PURE__ */ e("div", { "data-dd-privacy": "allow", ...a, ref: o, className: s(), children: /* @__PURE__ */ e("div", { className: l({ className: i }), children: t }) });
|
|
@@ -3,7 +3,7 @@ import r, { memo as l, forwardRef as s, useMemo as y } from "react";
|
|
|
3
3
|
import { uyTv as m } from "@payfit/unity-themes";
|
|
4
4
|
const b = m({
|
|
5
5
|
base: [
|
|
6
|
-
"uy:h-500 uy:bg-surface-neutral-
|
|
6
|
+
"uy:h-500 uy:bg-surface-neutral-low uy:rounded-tl-100 uy:rounded-tr-100 uy:overflow-hidden",
|
|
7
7
|
"uy:sticky uy:top-0 uy:z-[1]",
|
|
8
8
|
"uy:[&_tr]:border-b uy:[&_tr]:border-solid uy:[&_tr]:border-b-border-neutral-enabled"
|
|
9
9
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from '@payfit/unity-themes';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ClientSidePaginationProps } from '../../client-side-pagination/ClientSidePagination.js';
|
|
4
4
|
export declare const tablePagination: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
|
|
5
5
|
type PageSizeOption = {
|
|
6
6
|
value: string;
|
|
@@ -44,22 +44,22 @@ export interface TablePaginationProps extends PropsWithChildren<VariantProps<typ
|
|
|
44
44
|
* This function is intended for handling hover events on individual pagination controls or elements.
|
|
45
45
|
* It is derived from the `onPageHover` property in the `Pagination` component.
|
|
46
46
|
*/
|
|
47
|
-
onPageHover?:
|
|
47
|
+
onPageHover?: ClientSidePaginationProps['onPageHover'];
|
|
48
48
|
/**
|
|
49
49
|
* Callback fired when the page changes
|
|
50
50
|
* @param page - The new page number
|
|
51
51
|
* @param previous - The previous page number
|
|
52
52
|
* @param direction - The direction of navigation (1 for forward, -1 for backward)
|
|
53
53
|
*/
|
|
54
|
-
onPageChange?:
|
|
54
|
+
onPageChange?: ClientSidePaginationProps['onPageChange'];
|
|
55
55
|
/**
|
|
56
56
|
* Optional callback for next button press
|
|
57
57
|
*/
|
|
58
|
-
onNextPress?:
|
|
58
|
+
onNextPress?: ClientSidePaginationProps['onNextPress'];
|
|
59
59
|
/**
|
|
60
60
|
* Optional callback for previous button press
|
|
61
61
|
*/
|
|
62
|
-
onPreviousPress?:
|
|
62
|
+
onPreviousPress?: ClientSidePaginationProps['onPreviousPress'];
|
|
63
63
|
/**
|
|
64
64
|
* The options for the number of rows per page selection dropdown.
|
|
65
65
|
* If not provided, the default options will be used.
|