@payfit/unity-components 2.0.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/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-menu/parts/AppMenuFooter.js +23 -23
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +1 -1
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +9 -9
- 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.variant.js +1 -1
- 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/parts/PaginationNavButton.js +1 -1
- package/dist/esm/components/client-side-pagination/parts/RawPaginationLink.js +10 -10
- 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.js +7 -7
- 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/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/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 +2 -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/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/RawLink.js +38 -31
- 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/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/RawNavItem.js +6 -6
- 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 +12 -11
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +22 -22
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +13 -13
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +10 -10
- 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 +53 -45
- 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-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/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 +93 -0
- package/dist/esm/components/table/Table.js +135 -107
- package/dist/esm/components/table/parts/TableBody.js +83 -21
- 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.js +1 -1
- package/dist/esm/components/table/parts/TableRow.js +1 -0
- 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/task-menu/parts/RawSubTask.js +26 -26
- package/dist/esm/components/task-menu/parts/RawTask.js +32 -28
- 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 +41 -31
- 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-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 +44 -20
- package/dist/esm/index.js +457 -394
- package/dist/esm/index.storybook-testing.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +6 -1
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/TanstackFormContextualLink.d.ts +43 -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/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/index.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +1 -1
- package/dist/esm/integrations/tanstack-router.js +32 -26
- package/dist/esm/mocks/employees.d.ts +1 -5
- package/dist/esm/storybook-testing.js +8 -2
- package/dist/esm/storybook-utilities/previewTransform.d.ts +1 -0
- 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 +21 -8
- package/i18n/es-ES.json +23 -10
- package/i18n/fr-FR.json +24 -11
- package/package.json +41 -42
- package/dist/esm/components/multi-select/Multiselect.types.d.ts +0 -109
- 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
|
@@ -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;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
3
|
+
import { Popover as c, Dialog as g, Separator as f } from "react-aria-components";
|
|
4
|
+
import { FormattedMessage as e } from "react-intl";
|
|
5
|
+
import { Button as r } from "../../button/Button.js";
|
|
6
|
+
const x = m({
|
|
7
|
+
slots: {
|
|
8
|
+
popover: [
|
|
9
|
+
"uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral uy:rounded-sm uy:shadow-floating uy:min-w-[320px] uy:max-w-[800px] uy:relative uy:isolate uy:overflow-hidden",
|
|
10
|
+
"uy:transition-all uy:duration-200 uy:linear uy:data-[entering]:opacity-100 uy:data-[exiting]:opacity-0",
|
|
11
|
+
'uy:data-[entering]:data-[placement="bottom"]:-translate-y-100 uy:data-[entering]:data-[placement="bottom"]:translate-x-0 uy:data-[exiting]:data-[placement="bottom"]:translate-y-0',
|
|
12
|
+
'uy:data-[entering]:data-[placement="top"]:translate-y-100 uy:data-[entering]:data-[placement="top"]:translate-x-0 uy:data-[exiting]:data-[placement="top"]:translate-y-0',
|
|
13
|
+
'uy:data-[entering]:data-[placement="left"]:translate-x-100 uy:data-[entering]:data-[placement="left"]:translate-y-0 uy:data-[exiting]:data-[placement="left"]:translate-x-0',
|
|
14
|
+
'uy:data-[entering]:data-[placement="right"]:-translate-x-100 uy:data-[entering]:data-[placement="right"]:translate-y-0 uy:data-[exiting]:data-[placement="right"]:translate-y-0'
|
|
15
|
+
],
|
|
16
|
+
dialog: ["uy:flex uy:flex-col uy:gap-0"],
|
|
17
|
+
content: ["uy:flex-1 uy:max-h-[500px] uy:overflow-y-auto"],
|
|
18
|
+
footer: [
|
|
19
|
+
"uy:mx-100 uy:mb-100",
|
|
20
|
+
"uy:sticky uy:bottom-0 uy:z-2",
|
|
21
|
+
"uy:flex-0",
|
|
22
|
+
"uy:bg-surface-neutral"
|
|
23
|
+
],
|
|
24
|
+
separator: ["uy:mb-100 uy:bg-border-neutral uy:h-px"],
|
|
25
|
+
actions: ["uy:flex uy:justify-between uy:gap-100"]
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
function P({
|
|
29
|
+
children: n,
|
|
30
|
+
onConfirm: o,
|
|
31
|
+
onClear: l
|
|
32
|
+
}) {
|
|
33
|
+
const { popover: i, dialog: u, content: y, footer: s, separator: d, actions: p } = x();
|
|
34
|
+
return /* @__PURE__ */ t(c, { className: i(), placement: "bottom left", children: /* @__PURE__ */ a(g, { className: u(), children: [
|
|
35
|
+
/* @__PURE__ */ t("div", { className: y(), children: n }),
|
|
36
|
+
/* @__PURE__ */ a("footer", { className: s(), children: [
|
|
37
|
+
/* @__PURE__ */ t(f, { className: d() }),
|
|
38
|
+
/* @__PURE__ */ a("div", { className: p(), children: [
|
|
39
|
+
/* @__PURE__ */ t(
|
|
40
|
+
r,
|
|
41
|
+
{
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
color: "danger",
|
|
44
|
+
size: "full",
|
|
45
|
+
prefixIcon: "TrashOutlined",
|
|
46
|
+
onPress: l,
|
|
47
|
+
children: /* @__PURE__ */ t(
|
|
48
|
+
e,
|
|
49
|
+
{
|
|
50
|
+
id: "unity:component:common:clear:title",
|
|
51
|
+
defaultMessage: "Clear"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ t(
|
|
57
|
+
r,
|
|
58
|
+
{
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
color: "primary",
|
|
61
|
+
size: "full",
|
|
62
|
+
onPress: o,
|
|
63
|
+
children: /* @__PURE__ */ t(
|
|
64
|
+
e,
|
|
65
|
+
{
|
|
66
|
+
id: "unity:component:filter:action:apply",
|
|
67
|
+
defaultMessage: "Apply"
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] })
|
|
73
|
+
] })
|
|
74
|
+
] }) });
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
P as FilterPopover,
|
|
78
|
+
x as filterPopover
|
|
79
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard to check if a value is a composite (non-null object).
|
|
3
|
+
* This utility determines whether a value is an object type that can contain
|
|
4
|
+
* properties or be iterable, excluding primitive types and null.
|
|
5
|
+
* @param value - The value to check
|
|
6
|
+
* @returns `true` if the value is a non-null object, `false` otherwise
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* isCompositeValue({}) // true
|
|
10
|
+
* isCompositeValue([]) // true
|
|
11
|
+
* isCompositeValue(null) // false
|
|
12
|
+
* isCompositeValue("string") // false
|
|
13
|
+
* isCompositeValue(123) // false
|
|
14
|
+
* ```
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function isCompositeValue<TType>(value: TType): value is TType & object;
|
|
18
|
+
/**
|
|
19
|
+
* Type guard to check if a value implements the Iterable protocol.
|
|
20
|
+
* This utility determines whether a value can be iterated over using
|
|
21
|
+
* `for...of` loops or spread operators. Common iterable types include
|
|
22
|
+
* arrays, Maps, Sets, and strings.
|
|
23
|
+
* @param value - The value to check
|
|
24
|
+
* @returns `true` if the value is iterable, `false` otherwise
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* isIterable([1, 2, 3]) // true
|
|
28
|
+
* isIterable(new Set([1, 2])) // true
|
|
29
|
+
* isIterable(new Map()) // true
|
|
30
|
+
* isIterable("hello") // true
|
|
31
|
+
* isIterable({}) // false
|
|
32
|
+
* isIterable(123) // false
|
|
33
|
+
* ```
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function isIterable<TType>(value: TType): value is TType & Iterable<unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Default renderer for filter values that converts any value to a string representation.
|
|
39
|
+
* This utility provides a sensible default for displaying filter values in the UI.
|
|
40
|
+
* For primitive values, it returns their string representation. For iterable values
|
|
41
|
+
* (arrays, Sets, Maps, etc.), it joins all items with a comma and space.
|
|
42
|
+
* @param value - The value to render as a string
|
|
43
|
+
* @returns A string representation of the value
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* // Primitive values
|
|
47
|
+
* defaultRenderLabel("active") // "active"
|
|
48
|
+
* defaultRenderLabel(42) // "42"
|
|
49
|
+
* defaultRenderLabel(true) // "true"
|
|
50
|
+
*
|
|
51
|
+
* // Iterable values
|
|
52
|
+
* defaultRenderLabel(["apple", "banana"]) // "apple, banana"
|
|
53
|
+
* defaultRenderLabel(new Set([1, 2, 3])) // "1, 2, 3"
|
|
54
|
+
*
|
|
55
|
+
* // Edge cases
|
|
56
|
+
* defaultRenderLabel(null) // "null"
|
|
57
|
+
* defaultRenderLabel(undefined) // "undefined"
|
|
58
|
+
* defaultRenderLabel([]) // ""
|
|
59
|
+
* ```
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare function defaultRenderLabel(value: unknown): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function t(r) {
|
|
2
|
+
return r !== null && typeof r == "object";
|
|
3
|
+
}
|
|
4
|
+
function n(r) {
|
|
5
|
+
return t(r) && Symbol.iterator in r;
|
|
6
|
+
}
|
|
7
|
+
function i(r) {
|
|
8
|
+
return !t(r) || !n(r) ? String(r) : Array.from(r).join(", ");
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
i as defaultRenderLabel,
|
|
12
|
+
t as isCompositeValue,
|
|
13
|
+
n as isIterable
|
|
14
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { FilterToolbarProps } from './FilterToolbar.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Tailwind variants for the FilterToolbar component styling.
|
|
4
|
+
* Defines layout slots for the toolbar container, filters area, and action buttons.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const filterToolbar: import('tailwind-variants').TVReturnType<{
|
|
8
|
+
[key: string]: {
|
|
9
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
10
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
11
|
+
actions?: import('tailwind-merge').ClassNameValue;
|
|
12
|
+
filters?: import('tailwind-merge').ClassNameValue;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
16
|
+
[x: string]: {
|
|
17
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
18
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
19
|
+
actions?: import('tailwind-merge').ClassNameValue;
|
|
20
|
+
filters?: import('tailwind-merge').ClassNameValue;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
} | {}, {
|
|
24
|
+
base: string[];
|
|
25
|
+
filters: string[];
|
|
26
|
+
actions: string[];
|
|
27
|
+
}, undefined, {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
30
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
31
|
+
actions?: import('tailwind-merge').ClassNameValue;
|
|
32
|
+
filters?: import('tailwind-merge').ClassNameValue;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
} | {}, {
|
|
36
|
+
base: string[];
|
|
37
|
+
filters: string[];
|
|
38
|
+
actions: string[];
|
|
39
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
40
|
+
base: string[];
|
|
41
|
+
filters: string[];
|
|
42
|
+
actions: string[];
|
|
43
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
44
|
+
/**
|
|
45
|
+
* The FilterToolbar component manages a dynamic collection of filters in a toolbar layout, enabling users to build complex filtering UIs.
|
|
46
|
+
* The FilterToolbar provides a data-driven approach to filter management where filters can be added, configured,
|
|
47
|
+
* and removed on demand. Each filter maintains its own state while the toolbar orchestrates the overall filtering experience.
|
|
48
|
+
* @param {FilterToolbarProps} props - Configuration for the filter toolbar including filter definitions and event handlers
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* import { FilterToolbar } from '@payfit/unity-components'
|
|
52
|
+
* import { useState } from 'react'
|
|
53
|
+
*
|
|
54
|
+
* function Example() {
|
|
55
|
+
* const [filters, setFilters] = useState([])
|
|
56
|
+
*
|
|
57
|
+
* const filterDefs = [
|
|
58
|
+
* {
|
|
59
|
+
* id: 'status',
|
|
60
|
+
* label: 'Status',
|
|
61
|
+
* renderControl: (value, onChange) => (
|
|
62
|
+
* <Select value={value} onChange={onChange}>
|
|
63
|
+
* <Option value="active">Active</Option>
|
|
64
|
+
* <Option value="inactive">Inactive</Option>
|
|
65
|
+
* </Select>
|
|
66
|
+
* ),
|
|
67
|
+
* renderLabel: (value) => value
|
|
68
|
+
* },
|
|
69
|
+
* {
|
|
70
|
+
* id: 'department',
|
|
71
|
+
* label: 'Department',
|
|
72
|
+
* renderControl: (value, onChange) => (
|
|
73
|
+
* <Select value={value} onChange={onChange}>
|
|
74
|
+
* <Option value="engineering">Engineering</Option>
|
|
75
|
+
* <Option value="sales">Sales</Option>
|
|
76
|
+
* </Select>
|
|
77
|
+
* ),
|
|
78
|
+
* renderLabel: (value) => value
|
|
79
|
+
* }
|
|
80
|
+
* ]
|
|
81
|
+
*
|
|
82
|
+
* return (
|
|
83
|
+
* <FilterToolbar
|
|
84
|
+
* filterDefs={filterDefs}
|
|
85
|
+
* onChange={(appliedFilters) => {
|
|
86
|
+
* setFilters(appliedFilters)
|
|
87
|
+
* }}
|
|
88
|
+
* />
|
|
89
|
+
* )
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
* @remarks
|
|
93
|
+
* - The toolbar manages filter state internally, providing serializable filter values through the `onChange` callback
|
|
94
|
+
* - Filters can be prepopulated using the `initialValue` prop with an array of `AppliedFilter` objects
|
|
95
|
+
* - Each filter definition must include a unique `id`, `label`, and `renderControl` function to render the filter UI
|
|
96
|
+
* - The `renderLabel` function customizes how selected values appear in the filter button
|
|
97
|
+
* - Newly added filters automatically open their popover to guide users through configuration
|
|
98
|
+
* - All filters can be cleared at once using the "Clear filters" button
|
|
99
|
+
* - The component is uncontrolled by default but notifies parent components of state changes via callbacks
|
|
100
|
+
* @see {@link FilterToolbarProps} for all available props
|
|
101
|
+
* @see {@link FilterDef} for filter definition structure
|
|
102
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/filter-toolbar GitHub}
|
|
103
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=8976-10418 Figma}
|
|
104
|
+
* @see Design docs in {@link https://www.payfit.design/24f360409/p/998c5f-filter Payfit.design}
|
|
105
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/data-filtertoolbar--docs unity-components.payfit.io}
|
|
106
|
+
*/
|
|
107
|
+
declare const FilterToolbar: import('react').ForwardRefExoticComponent<FilterToolbarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
108
|
+
export { FilterToolbar };
|
|
109
|
+
export * from './utils/filter-adapters.js';
|
|
110
|
+
export type * from './FilterToolbar.types.js';
|