@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,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return value of the filter IDs hook.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export interface UseFilterIdsReturn {
|
|
6
|
+
/**
|
|
7
|
+
* ID for the filter's root container element.
|
|
8
|
+
*/
|
|
9
|
+
rootId: string;
|
|
10
|
+
/**
|
|
11
|
+
* ID for the filter's label element.
|
|
12
|
+
*/
|
|
13
|
+
labelId: string;
|
|
14
|
+
/**
|
|
15
|
+
* ID for the filter's value element.
|
|
16
|
+
*/
|
|
17
|
+
valueId: string;
|
|
18
|
+
/**
|
|
19
|
+
* ID for the dismiss button element.
|
|
20
|
+
*/
|
|
21
|
+
dismissButtonId: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Custom hook to generate consistent accessibility IDs for the filter component.
|
|
25
|
+
* This hook ensures that all filter elements have unique, properly associated IDs
|
|
26
|
+
* for accessibility purposes. If no ID is provided, it generates one using React
|
|
27
|
+
* Aria's `useId` hook. All generated IDs follow the pattern: `filter-{id}__{suffix}`.
|
|
28
|
+
* These IDs are used for ARIA attributes like `aria-labelledby`, `aria-describedby`,
|
|
29
|
+
* and `aria-controls` to create proper semantic relationships between elements.
|
|
30
|
+
* @param id - Optional custom ID for the filter. If not provided, a unique ID will be generated.
|
|
31
|
+
* @returns An object containing all necessary IDs for the filter component
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // With custom ID
|
|
35
|
+
* const { rootId, labelId, dismissButtonId } = useFilterIds('status-filter')
|
|
36
|
+
* // rootId: 'filter-status-filter'
|
|
37
|
+
* // labelId: 'filter-status-filter__label'
|
|
38
|
+
* // dismissButtonId: 'filter-status-filter__dismiss-button'
|
|
39
|
+
*
|
|
40
|
+
* // With auto-generated ID
|
|
41
|
+
* const ids = useFilterIds()
|
|
42
|
+
* // rootId: 'filter-react-aria-123'
|
|
43
|
+
* // labelId: 'filter-react-aria-123__label'
|
|
44
|
+
* // valueId: 'filter-react-aria-123__value'
|
|
45
|
+
* // dismissButtonId: 'filter-react-aria-123__dismiss-button'
|
|
46
|
+
* ```
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function useFilterIds(id?: string): UseFilterIdsReturn;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useId as i } from "react-aria";
|
|
2
|
+
function d(e) {
|
|
3
|
+
const r = i(), t = e ?? r;
|
|
4
|
+
return {
|
|
5
|
+
rootId: `filter-${t}`,
|
|
6
|
+
labelId: `filter-${t}__label`,
|
|
7
|
+
valueId: `filter-${t}__value`,
|
|
8
|
+
dismissButtonId: `filter-${t}__dismiss-button`
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
d as useFilterIds
|
|
13
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for the filter state hook.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export interface UseFilterStateOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the popover should be open by default when the component first mounts.
|
|
8
|
+
* This only affects the initial state on mount - the component manages its own state after that.
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
initialIsOpen?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the popover should close when the user confirms the selection.
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
shouldCloseOnConfirm?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the popover should close when the user clears the selection.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
shouldCloseOnClear?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Callback function invoked when the user confirms their selection.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
onConfirmSelection?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Callback function invoked when the user clears their selection.
|
|
29
|
+
* @default undefined
|
|
30
|
+
*/
|
|
31
|
+
onClearSelection?: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Return value of the filter state hook.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export interface UseFilterStateReturn {
|
|
38
|
+
/**
|
|
39
|
+
* Whether the filter popover is currently open.
|
|
40
|
+
*/
|
|
41
|
+
isOpen: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Function to control the open/close state of the popover.
|
|
44
|
+
*/
|
|
45
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Function to confirm the current selection. Invokes the `onConfirmSelection` callback
|
|
48
|
+
* and closes the popover if `shouldCloseOnConfirm` is true.
|
|
49
|
+
*/
|
|
50
|
+
confirm: () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Function to clear the current selection. Invokes the `onClearSelection` callback
|
|
53
|
+
* and closes the popover if `shouldCloseOnClear` is true.
|
|
54
|
+
*/
|
|
55
|
+
clear: () => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Custom hook to manage the filter popover state and user actions.
|
|
59
|
+
* This hook encapsulates the logic for opening/closing the filter popover
|
|
60
|
+
* and handling confirm and clear actions with their associated callbacks.
|
|
61
|
+
* @param options - Configuration options for the filter state
|
|
62
|
+
* @returns An object containing the popover state and action handlers
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* const { isOpen, setIsOpen, confirm, clear } = useFilterState({
|
|
66
|
+
* shouldCloseOnConfirm: true,
|
|
67
|
+
* shouldCloseOnClear: true,
|
|
68
|
+
* onConfirmSelection: () => console.log('Confirmed'),
|
|
69
|
+
* onClearSelection: () => console.log('Cleared'),
|
|
70
|
+
* })
|
|
71
|
+
* ```
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
export declare function useFilterState(options?: UseFilterStateOptions): UseFilterStateReturn;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useState as u, useCallback as l } from "react";
|
|
2
|
+
function m(i = {}) {
|
|
3
|
+
const {
|
|
4
|
+
initialIsOpen: r = !1,
|
|
5
|
+
shouldCloseOnConfirm: n = !0,
|
|
6
|
+
shouldCloseOnClear: o = !0,
|
|
7
|
+
onConfirmSelection: t,
|
|
8
|
+
onClearSelection: s
|
|
9
|
+
} = i, [a, e] = u(r), c = l(() => {
|
|
10
|
+
n && e(!1), t?.();
|
|
11
|
+
}, [n, t]), f = l(() => {
|
|
12
|
+
o && e(!1), s?.();
|
|
13
|
+
}, [o, s]);
|
|
14
|
+
return {
|
|
15
|
+
isOpen: a,
|
|
16
|
+
setIsOpen: e,
|
|
17
|
+
confirm: c,
|
|
18
|
+
clear: f
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
m as useFilterState
|
|
23
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return value of the filter value hook.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export interface UseFilterValueReturn {
|
|
6
|
+
/**
|
|
7
|
+
* The number of selected values in the filter.
|
|
8
|
+
* Returns 1 for non-iterable values, or the count of items for iterables.
|
|
9
|
+
*/
|
|
10
|
+
valuesCount: number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a badge should be displayed instead of the formatted value.
|
|
13
|
+
* True when the count exceeds maxVisibleValues.
|
|
14
|
+
*/
|
|
15
|
+
shouldShowBadge: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The formatted string representation of the value.
|
|
18
|
+
* Only populated when shouldShowBadge is false.
|
|
19
|
+
*/
|
|
20
|
+
formattedValue: string | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Custom hook to calculate display metadata for filter values.
|
|
24
|
+
* This hook determines how many values are selected, whether to show a badge
|
|
25
|
+
* indicating the count, and provides a formatted string representation of the
|
|
26
|
+
* value for display in the filter label.
|
|
27
|
+
* The hook uses memoization to prevent unnecessary recalculations when the
|
|
28
|
+
* value, maxVisibleValues, or renderLabel function haven't changed.
|
|
29
|
+
* @param value - The current filter value (can be single value or iterable)
|
|
30
|
+
* @param maxVisibleValues - Maximum number of values to display before showing a badge
|
|
31
|
+
* @param renderLabel - Function to format the value as a string
|
|
32
|
+
* @returns Metadata about the value for display purposes
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // Single value
|
|
36
|
+
* const { valuesCount, shouldShowBadge, formattedValue } = useFilterValue(
|
|
37
|
+
* 'active',
|
|
38
|
+
* 3,
|
|
39
|
+
* (v) => String(v)
|
|
40
|
+
* )
|
|
41
|
+
* // valuesCount: 1, shouldShowBadge: false, formattedValue: 'active'
|
|
42
|
+
*
|
|
43
|
+
* // Multiple values within threshold
|
|
44
|
+
* const result = useFilterValue(
|
|
45
|
+
* ['apple', 'banana'],
|
|
46
|
+
* 3,
|
|
47
|
+
* (v) => v.join(', ')
|
|
48
|
+
* )
|
|
49
|
+
* // valuesCount: 2, shouldShowBadge: false, formattedValue: 'apple, banana'
|
|
50
|
+
*
|
|
51
|
+
* // Multiple values exceeding threshold
|
|
52
|
+
* const result = useFilterValue(
|
|
53
|
+
* ['a', 'b', 'c', 'd'],
|
|
54
|
+
* 3,
|
|
55
|
+
* (v) => v.join(', ')
|
|
56
|
+
* )
|
|
57
|
+
* // valuesCount: 4, shouldShowBadge: true, formattedValue: null
|
|
58
|
+
* ```
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
export declare function useFilterValue<TType>(value: TType, maxVisibleValues: number, renderLabel: (value: TType) => string): UseFilterValueReturn;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useMemo as l } from "react";
|
|
2
|
+
import { isIterable as s } from "../utils/value-formatters.js";
|
|
3
|
+
function d(t, e, r) {
|
|
4
|
+
return l(() => {
|
|
5
|
+
if (t == null || t === "")
|
|
6
|
+
return {
|
|
7
|
+
valuesCount: 0,
|
|
8
|
+
shouldShowBadge: !1,
|
|
9
|
+
formattedValue: null
|
|
10
|
+
};
|
|
11
|
+
let o;
|
|
12
|
+
if (s(t)) {
|
|
13
|
+
if (o = Array.from(t).length, o === 0)
|
|
14
|
+
return {
|
|
15
|
+
valuesCount: 0,
|
|
16
|
+
shouldShowBadge: !1,
|
|
17
|
+
formattedValue: null
|
|
18
|
+
};
|
|
19
|
+
} else
|
|
20
|
+
o = 1;
|
|
21
|
+
const u = !isNaN(e) && o > e, n = u ? null : r(t);
|
|
22
|
+
return {
|
|
23
|
+
valuesCount: o,
|
|
24
|
+
shouldShowBadge: u,
|
|
25
|
+
formattedValue: n
|
|
26
|
+
};
|
|
27
|
+
}, [t, e, r]);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
d as useFilterValue
|
|
31
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { UnityIcon } from '@payfit/unity-icons';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Tailwind variants for the FilterButton component.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const filterButton: import('tailwind-variants').TVReturnType<{
|
|
8
|
+
[key: string]: {
|
|
9
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
10
|
+
prefix?: import('tailwind-merge').ClassNameValue;
|
|
11
|
+
button?: import('tailwind-merge').ClassNameValue;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
[x: string]: {
|
|
16
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
17
|
+
prefix?: import('tailwind-merge').ClassNameValue;
|
|
18
|
+
button?: import('tailwind-merge').ClassNameValue;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
} | {}, {
|
|
22
|
+
button: string[];
|
|
23
|
+
prefix: string[];
|
|
24
|
+
}, undefined, {
|
|
25
|
+
[key: string]: {
|
|
26
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
27
|
+
prefix?: import('tailwind-merge').ClassNameValue;
|
|
28
|
+
button?: import('tailwind-merge').ClassNameValue;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
} | {}, {
|
|
32
|
+
button: string[];
|
|
33
|
+
prefix: string[];
|
|
34
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
35
|
+
button: string[];
|
|
36
|
+
prefix: string[];
|
|
37
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
38
|
+
/**
|
|
39
|
+
* Props for the FilterButton component.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export interface FilterButtonProps {
|
|
43
|
+
/**
|
|
44
|
+
* The ID of the label element that labels this button.
|
|
45
|
+
*/
|
|
46
|
+
labelId: string;
|
|
47
|
+
/**
|
|
48
|
+
* Optional icon to display before the label.
|
|
49
|
+
*/
|
|
50
|
+
prefixIcon?: UnityIcon;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the button is disabled.
|
|
53
|
+
*/
|
|
54
|
+
isDisabled: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The label content to display inside the button.
|
|
57
|
+
*/
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Internal component that renders the main filter trigger button.
|
|
62
|
+
* This component wraps the filter label in an interactive button that opens
|
|
63
|
+
* the filter popover when pressed. It supports an optional prefix icon and
|
|
64
|
+
* maintains proper accessibility attributes.
|
|
65
|
+
* The button uses the Actionable component from Unity for consistent
|
|
66
|
+
* interaction states (hover, pressed, focus, disabled).
|
|
67
|
+
* @param props - The FilterButton props
|
|
68
|
+
* @param props.labelId - The ID of the label element that labels this button.
|
|
69
|
+
* @param props.prefixIcon - Optional icon to display before the label.
|
|
70
|
+
* @param props.isDisabled - Whether the button is disabled.
|
|
71
|
+
* @param props.children - The label content to display inside the button.
|
|
72
|
+
* @returns The rendered button element
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
export declare function FilterButton({ labelId, prefixIcon, isDisabled, children, }: FilterButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as l } from "@payfit/unity-icons";
|
|
3
|
+
import { uyTv as s } from "@payfit/unity-themes";
|
|
4
|
+
import { Actionable as p } from "../../actionable/Actionable.js";
|
|
5
|
+
const y = s({
|
|
6
|
+
slots: {
|
|
7
|
+
button: [
|
|
8
|
+
"uy:flex uy:gap-0.5 uy:items-center",
|
|
9
|
+
"uy:focus-visible:outline-none",
|
|
10
|
+
// spacing based on children
|
|
11
|
+
"uy:py-1",
|
|
12
|
+
"uy:pl-1.5 uy:has-data-[unity-slot=prefix]:pl-1",
|
|
13
|
+
"uy:pr-0"
|
|
14
|
+
],
|
|
15
|
+
prefix: [
|
|
16
|
+
"uy:p-0.25",
|
|
17
|
+
"uy:text-content-neutral-low",
|
|
18
|
+
"uy:group-data-[status=active]:text-content-primary-enabled",
|
|
19
|
+
"uy:group-aria-[disabled=true]:text-content-neutral-disabled"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function x({
|
|
24
|
+
labelId: o,
|
|
25
|
+
prefixIcon: t,
|
|
26
|
+
isDisabled: r,
|
|
27
|
+
children: a
|
|
28
|
+
}) {
|
|
29
|
+
const { button: i, prefix: n } = y();
|
|
30
|
+
return /* @__PURE__ */ u(
|
|
31
|
+
p,
|
|
32
|
+
{
|
|
33
|
+
className: i(),
|
|
34
|
+
"aria-labelledby": o,
|
|
35
|
+
isDisabled: r,
|
|
36
|
+
"aria-haspopup": "dialog",
|
|
37
|
+
children: [
|
|
38
|
+
t && /* @__PURE__ */ e("span", { "data-unity-slot": "prefix", className: n(), children: /* @__PURE__ */ e(
|
|
39
|
+
l,
|
|
40
|
+
{
|
|
41
|
+
src: t,
|
|
42
|
+
size: 20,
|
|
43
|
+
role: "presentation",
|
|
44
|
+
color: "inherit"
|
|
45
|
+
}
|
|
46
|
+
) }),
|
|
47
|
+
a
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
x as FilterButton,
|
|
54
|
+
y as filterButton
|
|
55
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tailwind variants for the FilterLabel component.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const filterLabel: import('tailwind-variants').TVReturnType<{
|
|
6
|
+
[key: string]: {
|
|
7
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
8
|
+
container?: import('tailwind-merge').ClassNameValue;
|
|
9
|
+
value?: import('tailwind-merge').ClassNameValue;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
[x: string]: {
|
|
14
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
15
|
+
container?: import('tailwind-merge').ClassNameValue;
|
|
16
|
+
value?: import('tailwind-merge').ClassNameValue;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} | {}, {
|
|
20
|
+
container: string[];
|
|
21
|
+
value: string[];
|
|
22
|
+
}, undefined, {
|
|
23
|
+
[key: string]: {
|
|
24
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
25
|
+
container?: import('tailwind-merge').ClassNameValue;
|
|
26
|
+
value?: import('tailwind-merge').ClassNameValue;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
} | {}, {
|
|
30
|
+
container: string[];
|
|
31
|
+
value: string[];
|
|
32
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
33
|
+
container: string[];
|
|
34
|
+
value: string[];
|
|
35
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
36
|
+
/**
|
|
37
|
+
* Props for the FilterLabel component.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export interface FilterLabelProps {
|
|
41
|
+
/**
|
|
42
|
+
* The ID for the label element (for accessibility).
|
|
43
|
+
*/
|
|
44
|
+
labelId: string;
|
|
45
|
+
/**
|
|
46
|
+
* The ID for the value element (for accessibility).
|
|
47
|
+
*/
|
|
48
|
+
valueId: string;
|
|
49
|
+
/**
|
|
50
|
+
* The label text to display.
|
|
51
|
+
*/
|
|
52
|
+
label: string;
|
|
53
|
+
/**
|
|
54
|
+
* The current filter value.
|
|
55
|
+
*/
|
|
56
|
+
value: unknown;
|
|
57
|
+
/**
|
|
58
|
+
* The number of selected values.
|
|
59
|
+
*/
|
|
60
|
+
valuesCount: number;
|
|
61
|
+
/**
|
|
62
|
+
* Whether to show a badge with the count instead of the formatted value.
|
|
63
|
+
*/
|
|
64
|
+
shouldShowBadge: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The formatted string representation of the value.
|
|
67
|
+
*/
|
|
68
|
+
formattedValue: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Maximum number of values to display before showing a badge.
|
|
71
|
+
*/
|
|
72
|
+
maxVisibleValues: number;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the filter is disabled.
|
|
75
|
+
*/
|
|
76
|
+
isDisabled: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Internal component that renders the filter's label and value display.
|
|
80
|
+
* This component handles the display logic for showing either:
|
|
81
|
+
* - The formatted value (when count is within threshold)
|
|
82
|
+
* - A badge with the count (when count exceeds threshold)
|
|
83
|
+
* The label text is always visible and marked with `data-dd-privacy="allow"`,
|
|
84
|
+
* while the value is masked with `data-dd-privacy="mask"` for data privacy.
|
|
85
|
+
* @param props - The FilterLabel props
|
|
86
|
+
* @param props.labelId - The ID for the label element (for accessibility).
|
|
87
|
+
* @param props.valueId - The ID for the value element (for accessibility).
|
|
88
|
+
* @param props.label - The label text to display.
|
|
89
|
+
* @param props.valuesCount - The number of selected values.
|
|
90
|
+
* @param props.formattedValue - The formatted string representation of the value.
|
|
91
|
+
* @param props.maxVisibleValues - Maximum number of values to display before showing a badge.
|
|
92
|
+
* @param props.isDisabled - Whether the filter is disabled.
|
|
93
|
+
* @returns The rendered label element
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
export declare function FilterLabel({ labelId, valueId, label, valuesCount, formattedValue, maxVisibleValues, isDisabled, }: FilterLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as a, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { uyTv as p } from "@payfit/unity-themes";
|
|
3
|
+
import { FormattedMessage as y } from "react-intl";
|
|
4
|
+
import { Badge as m } from "../../badge/Badge.js";
|
|
5
|
+
const h = p({
|
|
6
|
+
slots: {
|
|
7
|
+
container: [
|
|
8
|
+
"uy:typography-action",
|
|
9
|
+
"uy:flex uy:gap-0.25 uy:items-baseline"
|
|
10
|
+
],
|
|
11
|
+
value: [
|
|
12
|
+
"uy:whitespace-nowrap uy:overflow-hidden uy:max-w-[20ch] uy:text-ellipsis"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
function g({
|
|
17
|
+
labelId: n,
|
|
18
|
+
valueId: t,
|
|
19
|
+
label: o,
|
|
20
|
+
valuesCount: e,
|
|
21
|
+
formattedValue: l,
|
|
22
|
+
maxVisibleValues: r,
|
|
23
|
+
isDisabled: i
|
|
24
|
+
}) {
|
|
25
|
+
const { container: c, value: d } = h(), u = e > 0 && e <= r && l;
|
|
26
|
+
return /* @__PURE__ */ a("div", { id: n, className: c(), children: [
|
|
27
|
+
/* @__PURE__ */ a("span", { "data-dd-privacy": "allow", children: [
|
|
28
|
+
o,
|
|
29
|
+
u && /* @__PURE__ */ a("span", { "data-dd-privacy": "mask", className: d(), id: t, children: [
|
|
30
|
+
": ",
|
|
31
|
+
l
|
|
32
|
+
] })
|
|
33
|
+
] }),
|
|
34
|
+
!isNaN(r) && e > r && /* @__PURE__ */ a(
|
|
35
|
+
m,
|
|
36
|
+
{
|
|
37
|
+
variant: i ? "neutral" : "numeric",
|
|
38
|
+
className: "uy:h-300",
|
|
39
|
+
children: [
|
|
40
|
+
e,
|
|
41
|
+
/* @__PURE__ */ s("span", { className: "uy:sr-only", id: t, children: /* @__PURE__ */ s(
|
|
42
|
+
y,
|
|
43
|
+
{
|
|
44
|
+
id: "unity:component:filter:label:values-count",
|
|
45
|
+
defaultMessage: "{count, plural, =0 {no values} one {value} other {values}} selected",
|
|
46
|
+
values: { count: e }
|
|
47
|
+
}
|
|
48
|
+
) })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
g as FilterLabel,
|
|
56
|
+
h as filterLabel
|
|
57
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind variants for the FilterPopover component.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const filterPopover: import('tailwind-variants').TVReturnType<{
|
|
7
|
+
[key: string]: {
|
|
8
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
9
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
10
|
+
dialog?: import('tailwind-merge').ClassNameValue;
|
|
11
|
+
footer?: import('tailwind-merge').ClassNameValue;
|
|
12
|
+
separator?: import('tailwind-merge').ClassNameValue;
|
|
13
|
+
actions?: import('tailwind-merge').ClassNameValue;
|
|
14
|
+
popover?: import('tailwind-merge').ClassNameValue;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
[x: string]: {
|
|
19
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
20
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
21
|
+
dialog?: import('tailwind-merge').ClassNameValue;
|
|
22
|
+
footer?: import('tailwind-merge').ClassNameValue;
|
|
23
|
+
separator?: import('tailwind-merge').ClassNameValue;
|
|
24
|
+
actions?: import('tailwind-merge').ClassNameValue;
|
|
25
|
+
popover?: import('tailwind-merge').ClassNameValue;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
} | {}, {
|
|
29
|
+
popover: string[];
|
|
30
|
+
dialog: string[];
|
|
31
|
+
content: string[];
|
|
32
|
+
footer: string[];
|
|
33
|
+
separator: string[];
|
|
34
|
+
actions: string[];
|
|
35
|
+
}, undefined, {
|
|
36
|
+
[key: string]: {
|
|
37
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
38
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
39
|
+
dialog?: import('tailwind-merge').ClassNameValue;
|
|
40
|
+
footer?: import('tailwind-merge').ClassNameValue;
|
|
41
|
+
separator?: import('tailwind-merge').ClassNameValue;
|
|
42
|
+
actions?: import('tailwind-merge').ClassNameValue;
|
|
43
|
+
popover?: import('tailwind-merge').ClassNameValue;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
} | {}, {
|
|
47
|
+
popover: string[];
|
|
48
|
+
dialog: string[];
|
|
49
|
+
content: string[];
|
|
50
|
+
footer: string[];
|
|
51
|
+
separator: string[];
|
|
52
|
+
actions: string[];
|
|
53
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
54
|
+
popover: string[];
|
|
55
|
+
dialog: string[];
|
|
56
|
+
content: string[];
|
|
57
|
+
footer: string[];
|
|
58
|
+
separator: string[];
|
|
59
|
+
actions: string[];
|
|
60
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
61
|
+
/**
|
|
62
|
+
* Props for the FilterPopover component.
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export interface FilterPopoverProps {
|
|
66
|
+
/**
|
|
67
|
+
* The content to render inside the popover (the filter control).
|
|
68
|
+
*/
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
/**
|
|
71
|
+
* Callback invoked when the "Apply" button is pressed.
|
|
72
|
+
*/
|
|
73
|
+
onConfirm: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Callback invoked when the "Clear" button is pressed.
|
|
76
|
+
*/
|
|
77
|
+
onClear: () => void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Internal component that renders the filter's popover dialog.
|
|
81
|
+
* This component provides the popover container that appears when the filter
|
|
82
|
+
* button is clicked. It includes:
|
|
83
|
+
* - A content area for the custom filter control (passed as children)
|
|
84
|
+
* - A footer with two action buttons: "Clear" (danger) and "Apply" (primary)
|
|
85
|
+
* - Smooth animations for opening/closing
|
|
86
|
+
* - Proper positioning relative to the trigger
|
|
87
|
+
* The popover is controlled by React Aria's DialogTrigger in the parent component.
|
|
88
|
+
* @param props - The FilterPopover props
|
|
89
|
+
* @param props.children - The content to render inside the popover (the filter control).
|
|
90
|
+
* @param props.onConfirm - Callback invoked when the "Apply" button is pressed.
|
|
91
|
+
* @param props.onClear - Callback invoked when the "Clear" button is pressed.
|
|
92
|
+
* @returns The rendered popover element
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
export declare function FilterPopover({ children, onConfirm, onClear, }: FilterPopoverProps): import("react/jsx-runtime").JSX.Element;
|