@payfit/unity-components 1.2.0 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/action-bar/ActionBar.js +14 -14
- package/dist/esm/components/actionable/Actionable.js +31 -28
- package/dist/esm/components/alert/Alert.js +41 -29
- package/dist/esm/components/alert/parts/AlertTitle.js +8 -8
- package/dist/esm/components/app-layout/AppLayout.d.ts +2 -0
- package/dist/esm/components/app-layout/AppLayout.js +17 -17
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +23 -23
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +87 -5
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +0 -9
- package/dist/esm/components/autocomplete/Autocomplete.js +54 -57
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.js +8 -8
- package/dist/esm/components/avatar/Avatar.variants.js +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.js +26 -27
- package/dist/esm/components/badge/Badge.js +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.js +3 -3
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +1 -1
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
- package/dist/esm/components/button/Button.js +6 -6
- package/dist/esm/components/button/Button.variants.d.ts +1 -0
- package/dist/esm/components/button/Button.variants.js +22 -15
- package/dist/esm/components/card/Card.context.d.ts +5 -0
- package/dist/esm/components/card/Card.context.js +14 -0
- package/dist/esm/components/card/Card.d.ts +210 -0
- package/dist/esm/components/card/Card.js +93 -0
- package/dist/esm/components/card/parts/CardContent.d.ts +37 -0
- package/dist/esm/components/card/parts/CardContent.js +8 -0
- package/dist/esm/components/card/parts/CardTitle.d.ts +55 -0
- package/dist/esm/components/card/parts/CardTitle.js +33 -0
- package/dist/esm/components/checkbox/Checkbox.js +38 -30
- package/dist/esm/components/checkbox/Checkbox.variants.d.ts +9 -9
- package/dist/esm/components/checkbox/Checkbox.variants.js +23 -7
- package/dist/esm/components/checkbox/TanstackCheckbox.d.ts +28 -0
- package/dist/esm/components/checkbox/TanstackCheckbox.js +51 -0
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +7 -7
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.d.ts +14 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.js +40 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.d.ts +4 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.js +37 -0
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.d.ts +72 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.js +40 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.d.ts +103 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
- package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +1 -1
- package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
- package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +12 -12
- package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
- package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
- package/dist/esm/components/collapsible/parts/CollapsibleContent.js +5 -5
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +8 -8
- package/dist/esm/components/data-table/DataTable.d.ts +109 -16
- package/dist/esm/components/data-table/DataTable.js +107 -93
- package/dist/esm/components/data-table/mocks/employee-data.d.ts +1 -0
- package/dist/esm/components/date-calendar/DateCalendar.js +1 -1
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +1 -1
- package/dist/esm/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/esm/components/date-picker/DatePicker.js +59 -50
- package/dist/esm/components/date-picker/TanstackDatePicker.d.ts +22 -0
- package/dist/esm/components/date-picker/TanstackDatePicker.js +53 -0
- package/dist/esm/components/date-picker/parts/DateInput.js +4 -4
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.d.ts +71 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.js +41 -0
- package/dist/esm/components/definition-list/DefinitionList.context.d.ts +19 -0
- package/dist/esm/components/definition-list/DefinitionList.d.ts +24 -0
- package/dist/esm/components/definition-list/parts/DefinitionItem.d.ts +25 -0
- package/dist/esm/components/dialog/Dialog.d.ts +34 -22
- package/dist/esm/components/dialog/Dialog.js +90 -52
- package/dist/esm/components/dialog/parts/DialogActions.js +6 -6
- package/dist/esm/components/dialog/parts/DialogTitle.js +7 -4
- package/dist/esm/components/dialog/test-utils.d.ts +28 -0
- package/dist/esm/components/dialog/test-utils.js +78 -0
- package/dist/esm/components/error-state/ErrorState.d.ts +13 -1
- package/dist/esm/components/error-state/ErrorState.js +133 -92
- package/dist/esm/components/error-state/initConfig.js +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
- package/dist/esm/components/fieldset/Fieldset.js +32 -26
- package/dist/esm/components/filter/Filter.controls.d.ts +192 -0
- package/dist/esm/components/filter/Filter.controls.js +45 -0
- package/dist/esm/components/filter/Filter.d.ts +189 -0
- package/dist/esm/components/filter/Filter.js +147 -0
- package/dist/esm/components/filter/Filter.types.d.ts +121 -0
- package/dist/esm/components/filter/hooks/useFilterIds.d.ts +49 -0
- package/dist/esm/components/filter/hooks/useFilterIds.js +13 -0
- package/dist/esm/components/filter/hooks/useFilterState.d.ts +74 -0
- package/dist/esm/components/filter/hooks/useFilterState.js +23 -0
- package/dist/esm/components/filter/hooks/useFilterValue.d.ts +61 -0
- package/dist/esm/components/filter/hooks/useFilterValue.js +31 -0
- package/dist/esm/components/filter/parts/FilterButton.d.ts +75 -0
- package/dist/esm/components/filter/parts/FilterButton.js +55 -0
- package/dist/esm/components/filter/parts/FilterLabel.d.ts +96 -0
- package/dist/esm/components/filter/parts/FilterLabel.js +57 -0
- package/dist/esm/components/filter/parts/FilterPopover.d.ts +95 -0
- package/dist/esm/components/filter/parts/FilterPopover.js +79 -0
- package/dist/esm/components/filter/utils/value-formatters.d.ts +62 -0
- package/dist/esm/components/filter/utils/value-formatters.js +14 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.d.ts +110 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.js +172 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.types.d.ts +119 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.d.ts +96 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.js +132 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.d.ts +63 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.js +107 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.d.ts +18 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.js +18 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.d.ts +93 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.js +88 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.d.ts +24 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.js +19 -0
- package/dist/esm/components/flex/Flex.js +52 -37
- package/dist/esm/components/form/Form.d.ts +2 -0
- package/dist/esm/components/form/TanstackForm.d.ts +24 -0
- package/dist/esm/components/form/TanstackForm.js +29 -0
- package/dist/esm/components/form-field/FormField.d.ts +2 -0
- package/dist/esm/components/form-field/FormField.js +12 -12
- package/dist/esm/components/form-field/TanstackFormField.context.d.ts +10 -0
- package/dist/esm/components/form-field/TanstackFormField.context.js +14 -0
- package/dist/esm/components/form-field/TanstackFormField.d.ts +49 -0
- package/dist/esm/components/form-field/TanstackFormField.js +46 -0
- package/dist/esm/components/form-field/parts/FormControl.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormFeedbackText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormHelperText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormLabel.d.ts +2 -0
- package/dist/esm/components/form-field/parts/RawFormContextualLink.d.ts +22 -0
- package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.d.ts +12 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.js +32 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.d.ts +11 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.js +25 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.d.ts +8 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.js +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.d.ts +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.js +45 -0
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/icon/Icon.js +23 -19
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +9 -9
- package/dist/esm/components/icon-button/CircularIconButton.js +53 -36
- package/dist/esm/components/icon-button/IconButton.variants.d.ts +1 -0
- package/dist/esm/components/icon-button/IconButton.variants.js +44 -28
- package/dist/esm/components/input/Input.js +36 -35
- package/dist/esm/components/input/TanstackInput.d.ts +22 -0
- package/dist/esm/components/input/TanstackInput.js +38 -0
- package/dist/esm/components/label/Label.js +12 -12
- package/dist/esm/components/link/{Link.variants.d.ts → RawLink.d.ts} +92 -0
- package/dist/esm/components/link/{Link.variants.js → RawLink.js} +78 -5
- package/dist/esm/components/list-view/ListView.d.ts +56 -0
- package/dist/esm/components/list-view/ListView.fixtures.d.ts +20 -0
- package/dist/esm/components/list-view/ListView.js +44 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.d.ts +34 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.d.ts +33 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewSection.d.ts +14 -0
- package/dist/esm/components/list-view/parts/ListViewSection.js +21 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.d.ts +102 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.js +80 -0
- package/dist/esm/components/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
- package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
- package/dist/esm/components/multi-select/MultiSelect.d.ts +5 -7
- package/dist/esm/components/multi-select/MultiSelect.js +199 -176
- package/dist/esm/components/multi-select/MultiselectTypes.d.ts +114 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.d.ts +7 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.js +41 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.d.ts +2 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +62 -46
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +15 -15
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +45 -12
- package/dist/esm/components/multi-select-field/MultiSelectField.js +56 -66
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.d.ts +92 -0
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.js +48 -0
- package/dist/esm/components/multi-select-field/test-utils.d.ts +17 -0
- package/dist/esm/components/multi-select-field/test-utils.js +45 -0
- package/dist/esm/components/nav/parts/NavGroup.d.ts +3 -3
- package/dist/esm/components/nav/parts/NavGroup.js +62 -51
- package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
- package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
- package/dist/esm/components/navigation-card/NavigationCard.context.d.ts +31 -0
- package/dist/esm/components/navigation-card/NavigationCard.context.js +13 -0
- package/dist/esm/components/navigation-card/NavigationCard.d.ts +46 -0
- package/dist/esm/components/navigation-card/NavigationCard.js +62 -0
- package/dist/esm/components/navigation-card/NavigationCard.types.d.ts +37 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.d.ts +1147 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.js +164 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.d.ts +39 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.js +22 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.d.ts +146 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.js +93 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.d.ts +32 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.js +24 -0
- package/dist/esm/components/number-field/NumberField.d.ts +2 -0
- package/dist/esm/components/number-field/TanstackNumberField.d.ts +74 -0
- package/dist/esm/components/number-field/TanstackNumberField.js +44 -0
- package/dist/esm/components/number-input/NumberInput.js +31 -29
- package/dist/esm/components/number-input/TanstackNumberInput.d.ts +58 -0
- package/dist/esm/components/number-input/TanstackNumberInput.js +38 -0
- package/dist/esm/components/page/Page.js +13 -12
- package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
- package/dist/esm/components/page/parts/PageHeader.js +22 -20
- package/dist/esm/components/pagination/Pagination.d.ts +23 -44
- package/dist/esm/components/pagination/Pagination.js +89 -163
- package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
- package/dist/esm/components/pagination/PaginationContext.js +15 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
- package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
- package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
- package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
- package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
- package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
- package/dist/esm/components/payfit-brand/PayFitBrand.d.ts +4 -0
- package/dist/esm/components/payfit-brand/PayFitBrand.js +30 -22
- package/dist/esm/components/payfit-brand/PayFitPreprod.js +25 -25
- package/dist/esm/components/phone-number/PhoneNumberInput.d.ts +67 -0
- package/dist/esm/components/phone-number/PhoneNumberInput.js +322 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.d.ts +64 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.js +33 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.d.ts +42 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.js +68 -0
- package/dist/esm/components/phone-number/unknownFlag.svg.js +4 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.d.ts +15 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.js +32 -0
- package/dist/esm/components/pill/Pill.d.ts +2 -2
- package/dist/esm/components/pill/Pill.js +8 -8
- package/dist/esm/components/popover/Popover.js +6 -6
- package/dist/esm/components/promo-dialog/PromoDialog.d.ts +149 -0
- package/dist/esm/components/promo-dialog/PromoDialog.js +219 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.d.ts +44 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.js +29 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.d.ts +43 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.js +20 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.d.ts +47 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.js +25 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.d.ts +53 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.js +21 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.d.ts +6 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.js +18 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.d.ts +13 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.js +43 -0
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +29 -11
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +53 -51
- package/dist/esm/components/radio-button-group-field/RadioButtonGroupField.d.ts +2 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.d.ts +13 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.js +38 -0
- package/dist/esm/components/search/Search.js +46 -46
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +5 -5
- package/dist/esm/components/select/Select.d.ts +5 -4
- package/dist/esm/components/select/Select.js +79 -53
- package/dist/esm/components/select/TanstackSelect.d.ts +80 -0
- package/dist/esm/components/select/TanstackSelect.js +34 -0
- package/dist/esm/components/select/parts/SearchInput.d.ts +4 -1
- package/dist/esm/components/select/parts/SearchInput.js +49 -31
- package/dist/esm/components/select/parts/SelectButton.js +19 -17
- package/dist/esm/components/select/parts/SelectOption.js +9 -9
- package/dist/esm/components/select-field/SelectField.d.ts +2 -0
- package/dist/esm/components/select-field/SelectField.js +8 -9
- package/dist/esm/components/select-field/TanstackSelectField.d.ts +124 -0
- package/dist/esm/components/select-field/TanstackSelectField.js +44 -0
- package/dist/esm/components/select-list/SelectList.d.ts +95 -0
- package/dist/esm/components/select-list/SelectList.js +79 -0
- package/dist/esm/components/select-list/SelectList.types.d.ts +29 -0
- package/dist/esm/components/select-list/constants.d.ts +36 -0
- package/dist/esm/components/select-list/constants.js +29 -0
- package/dist/esm/components/select-list/helpers.d.ts +42 -0
- package/dist/esm/components/select-list/helpers.js +48 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.js +16 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.js +31 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.d.ts +8 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.js +25 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.d.ts +118 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.js +28 -0
- package/dist/esm/components/select-list/parts/SelectListOption.d.ts +24 -0
- package/dist/esm/components/select-list/parts/SelectListOption.js +72 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.d.ts +2 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.js +43 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.d.ts +54 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.js +35 -0
- package/dist/esm/components/select-list/utils/partition.d.ts +13 -0
- package/dist/esm/components/select-list/utils/partition.js +9 -0
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.context.d.ts +1 -5
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.ts +6 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +23 -23
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.d.ts +27 -0
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.js +34 -0
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.d.ts +1 -16
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +56 -57
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.d.ts +81 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.js +47 -0
- package/dist/esm/components/selectable-card/internals/Description.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/SelectableCardCheckboxGroup.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.d.ts +26 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/parts/SelectableCardCheckbox.js +24 -24
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.d.ts +2 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.js +12 -14
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.d.ts +28 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +14 -13
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.js +27 -25
- package/dist/esm/components/selectable-card/selectableCard.variant.js +5 -5
- package/dist/esm/components/selectable-card-checkbox-group-field/SelectableCardCheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.js +38 -0
- package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.js +38 -0
- package/dist/esm/components/skip-links/SkipLinks.js +1 -1
- package/dist/esm/components/table/Table.context.d.ts +5 -0
- package/dist/esm/components/table/Table.context.js +14 -13
- package/dist/esm/components/table/Table.d.ts +94 -0
- package/dist/esm/components/table/Table.js +145 -108
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
- package/dist/esm/components/table/parts/TableBody.js +83 -21
- package/dist/esm/components/table/parts/TableCell.js +29 -26
- package/dist/esm/components/table/parts/TableEmptyState.js +6 -6
- package/dist/esm/components/table/parts/TableHeader.js +1 -1
- package/dist/esm/components/table/parts/TablePagination.d.ts +5 -5
- package/dist/esm/components/table/parts/TablePagination.js +11 -11
- package/dist/esm/components/table/parts/TableRow.js +22 -18
- package/dist/esm/components/tabs/Tabs.variant.d.ts +0 -6
- package/dist/esm/components/tabs/Tabs.variant.js +11 -12
- package/dist/esm/components/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
- package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
- package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
- package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +43 -43
- package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +45 -41
- package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
- package/dist/esm/components/task-menu/parts/TaskGroup.js +30 -26
- package/dist/esm/components/task-menu/parts/task.variants.js +4 -2
- package/dist/esm/components/text/Text.d.ts +11 -1
- package/dist/esm/components/text/Text.js +43 -30
- package/dist/esm/components/text/Text.variants.d.ts +12 -0
- package/dist/esm/components/text/Text.variants.js +4 -0
- package/dist/esm/components/text-area/TanstackTextArea.d.ts +21 -0
- package/dist/esm/components/text-area/TanstackTextArea.js +35 -0
- package/dist/esm/components/text-area/TextArea.js +31 -29
- package/dist/esm/components/text-field/TanstackTextField.d.ts +79 -0
- package/dist/esm/components/text-field/TanstackTextField.js +60 -0
- package/dist/esm/components/text-field/TextField.d.ts +2 -0
- package/dist/esm/components/toast/UnityToast.js +5 -5
- package/dist/esm/components/toast/test-utils.d.ts +36 -0
- package/dist/esm/components/toast/test-utils.js +118 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.d.ts +46 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.js +25 -0
- package/dist/esm/components/toggle-switch/ToggleSwitch.d.ts +21 -9
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +71 -32
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.d.ts +11 -0
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.js +34 -0
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.d.ts +57 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.js +23 -0
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +1 -1
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.d.ts +19 -0
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.js +50 -0
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -0
- package/dist/esm/docs/{table → examples/data}/mocks/employee-columns.d.ts +1 -1
- package/dist/esm/hooks/tanstack-form-context.d.ts +1 -0
- package/dist/esm/hooks/tanstack-form-context.js +8 -0
- package/dist/esm/hooks/use-container-query-level.d.ts +42 -0
- package/dist/esm/hooks/use-container-query-level.js +33 -0
- package/dist/esm/hooks/use-form.d.ts +2 -0
- package/dist/esm/hooks/use-has-scroll.d.ts +71 -0
- package/dist/esm/hooks/use-has-scroll.js +75 -0
- package/dist/esm/hooks/use-tanstack-form.d.ts +369 -0
- package/dist/esm/hooks/use-tanstack-form.js +209 -0
- package/dist/esm/index.d.ts +64 -30
- package/dist/esm/index.js +482 -394
- package/dist/esm/index.storybook-testing.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +45 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/TanstackFormContextualLink.d.ts +43 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.d.ts +34 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.js +25 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.js +32 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.d.ts +49 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.d.ts +73 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.js +37 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.d.ts +54 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
- package/dist/esm/integrations/tanstack-router/index.d.ts +19 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router.js +40 -0
- package/dist/esm/mocks/employees.d.ts +1 -5
- package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
- package/dist/esm/providers/router/RouterProvider.js +14 -10
- package/dist/esm/storybook-testing.js +8 -2
- package/dist/esm/storybook-utilities/previewTransform.d.ts +1 -0
- package/dist/esm/types/DataAttributes.d.ts +1 -1
- package/dist/esm/utils/scroll-detection.d.ts +77 -0
- package/dist/esm/utils/scroll-detection.js +33 -0
- package/dist/esm/utils/spacing.d.ts +63 -0
- package/dist/esm/utils/spacing.js +15 -0
- package/i18n/en-GB.json +22 -8
- package/i18n/es-ES.json +24 -10
- package/i18n/fr-FR.json +25 -11
- package/package.json +66 -45
- package/dist/esm/components/form-field/parts/FormContextualLink.d.ts +0 -20
- package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
- package/dist/esm/components/link/Link.d.ts +0 -93
- package/dist/esm/components/link/Link.js +0 -68
- package/dist/esm/components/multi-select/Multiselect.types.d.ts +0 -109
- package/dist/esm/components/nav/parts/NavItem.js +0 -95
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.d.ts +0 -6
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.js +0 -28
- package/dist/esm/integrations/react-router/v5/index.d.ts +0 -1
- package/dist/esm/integrations/react-router/v5.js +0 -4
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
|
@@ -1,78 +1,104 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useFilter as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as B, useState as C } from "react";
|
|
3
|
+
import { uyTv as F } from "@payfit/unity-themes";
|
|
4
|
+
import { useFilter as I, Select as M, Popover as z, Autocomplete as A, Virtualizer as p, ListLayout as d, ListBox as y } from "react-aria-components";
|
|
5
|
+
import { useIntl as T } from "react-intl";
|
|
6
|
+
import { SearchInput as U } from "./parts/SearchInput.js";
|
|
7
|
+
import { SelectButton as V } from "./parts/SelectButton.js";
|
|
8
|
+
const $ = F({
|
|
8
9
|
slots: {
|
|
9
10
|
base: "uy:flex uy:flex-col uy:gap-100 uy:w-full",
|
|
10
|
-
popover: "uy:rounded-75 uy:border uy:border-solid uy:border-border-neutral uy:w-[var(--trigger-width)] uy:bg-surface-neutral",
|
|
11
|
-
listbox: "uy:overflow-y-auto uy:max-h-[296px] uy:pt-100 uy:pb-100
|
|
11
|
+
popover: "uy:rounded-100 uy:sm:rounded-75 uy:border uy:border-solid uy:border-border-neutral uy:w-[var(--trigger-width)] uy:bg-surface-neutral",
|
|
12
|
+
listbox: "uy:overflow-y-auto uy:max-h-[296px] uy:pt-100 uy:pb-100"
|
|
12
13
|
}
|
|
13
|
-
}),
|
|
14
|
+
}), k = ({
|
|
14
15
|
children: t,
|
|
15
16
|
items: o,
|
|
16
17
|
placeholder: r,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
onChange: u,
|
|
18
|
+
isDisabled: s,
|
|
19
|
+
isInvalid: l,
|
|
20
|
+
isReadOnly: n,
|
|
21
|
+
value: a,
|
|
22
|
+
defaultValue: m,
|
|
23
|
+
onChange: i,
|
|
24
24
|
isSearchable: f = !1,
|
|
25
|
-
onBlur:
|
|
26
|
-
placement:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
onBlur: b,
|
|
26
|
+
placement: h,
|
|
27
|
+
searchInputAriaLabel: x,
|
|
28
|
+
...S
|
|
29
|
+
}, g) => {
|
|
30
|
+
const v = T(), [w, N] = C(!1), { contains: O } = I({ sensitivity: "base" }), { base: L, popover: P, listbox: u } = $(), j = a !== void 0 || i !== void 0 ? {
|
|
31
|
+
value: a,
|
|
32
|
+
onChange: i
|
|
33
|
+
} : { defaultValue: m };
|
|
34
|
+
return /* @__PURE__ */ c(
|
|
35
|
+
M,
|
|
35
36
|
{
|
|
36
|
-
onOpenChange:
|
|
37
|
-
...
|
|
38
|
-
ref:
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
...C,
|
|
37
|
+
onOpenChange: N,
|
|
38
|
+
...S,
|
|
39
|
+
ref: g,
|
|
40
|
+
className: L(),
|
|
41
|
+
placeholder: s ? void 0 : r,
|
|
42
|
+
isDisabled: s || n,
|
|
43
|
+
isInvalid: l,
|
|
44
|
+
onBlur: b,
|
|
45
|
+
...j,
|
|
46
46
|
children: [
|
|
47
47
|
/* @__PURE__ */ e(
|
|
48
|
-
|
|
48
|
+
V,
|
|
49
49
|
{
|
|
50
|
-
isDisabled:
|
|
51
|
-
isInvalid:
|
|
52
|
-
isReadOnly:
|
|
53
|
-
isOpen:
|
|
50
|
+
isDisabled: s,
|
|
51
|
+
isInvalid: l,
|
|
52
|
+
isReadOnly: n,
|
|
53
|
+
isOpen: w
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
56
|
/* @__PURE__ */ e(
|
|
57
|
-
|
|
57
|
+
z,
|
|
58
58
|
{
|
|
59
59
|
offset: 1,
|
|
60
60
|
containerPadding: 8,
|
|
61
|
-
className:
|
|
62
|
-
placement:
|
|
63
|
-
children: f ? /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
className: P(),
|
|
62
|
+
placement: h,
|
|
63
|
+
children: f ? /* @__PURE__ */ c(A, { filter: O, children: [
|
|
64
|
+
/* @__PURE__ */ e(
|
|
65
|
+
U,
|
|
66
|
+
{
|
|
67
|
+
"aria-label": x ?? v.formatMessage({
|
|
68
|
+
id: "unity:component:select:search:label",
|
|
69
|
+
defaultMessage: "Search options"
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ e(
|
|
74
|
+
p,
|
|
75
|
+
{
|
|
76
|
+
layout: d,
|
|
77
|
+
layoutOptions: {
|
|
78
|
+
padding: 8
|
|
79
|
+
},
|
|
80
|
+
children: /* @__PURE__ */ e(y, { items: o, className: u(), children: t })
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }) : /* @__PURE__ */ e(
|
|
84
|
+
p,
|
|
85
|
+
{
|
|
86
|
+
layout: d,
|
|
87
|
+
layoutOptions: {
|
|
88
|
+
padding: 8
|
|
89
|
+
},
|
|
90
|
+
children: /* @__PURE__ */ e(y, { items: o, className: u(), children: t })
|
|
91
|
+
}
|
|
92
|
+
)
|
|
67
93
|
}
|
|
68
94
|
)
|
|
69
95
|
]
|
|
70
96
|
}
|
|
71
97
|
);
|
|
72
|
-
},
|
|
73
|
-
return
|
|
98
|
+
}, q = B(function(o, r) {
|
|
99
|
+
return k(o, r);
|
|
74
100
|
});
|
|
75
|
-
|
|
101
|
+
q.displayName = "Select";
|
|
76
102
|
export {
|
|
77
|
-
|
|
103
|
+
q as Select
|
|
78
104
|
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ForwardedRef, JSX } from 'react';
|
|
2
|
+
import { SelectProps } from './Select.js';
|
|
3
|
+
export type TanstackSelectProps<T extends object> = Omit<SelectProps<T>, 'value' | 'defaultValue' | 'onChange' | 'isInvalid' | 'name'>;
|
|
4
|
+
type TanstackSelectComponent = (<TItems extends object>(props: TanstackSelectProps<TItems> & {
|
|
5
|
+
ref?: ForwardedRef<HTMLDivElement>;
|
|
6
|
+
}) => JSX.Element) & {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* `TanstackSelect` is a controlled select component wired to the TanStack Form field context.
|
|
11
|
+
* It is based on the Unity `Select` component.
|
|
12
|
+
*
|
|
13
|
+
* The component supports both static and dynamic options, search functionality, and grouping.
|
|
14
|
+
* It manages field state via the TanStack Form context, including validation and accessibility.
|
|
15
|
+
*
|
|
16
|
+
* Example (static options):
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { useTanstackUnityForm } from '@payfit/unity-components'
|
|
19
|
+
* import { z } from 'zod'
|
|
20
|
+
*
|
|
21
|
+
* function ExampleField() {
|
|
22
|
+
* const schema = z.object({
|
|
23
|
+
* fruit: z.string().min(1, 'Please select a fruit'),
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* const form = useTanstackUnityForm({
|
|
27
|
+
* validators: { onBlur: schema },
|
|
28
|
+
* defaultValues: { fruit: '' }
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <form>
|
|
33
|
+
* <form.AppField name="fruit">
|
|
34
|
+
* {() => (
|
|
35
|
+
* <TanstackSelect placeholder="Choose a fruit">
|
|
36
|
+
* <SelectOption id="Apple">Apple</SelectOption>
|
|
37
|
+
* <SelectOption id="Banana">Banana</SelectOption>
|
|
38
|
+
* <SelectOption id="Orange">Orange</SelectOption>
|
|
39
|
+
* </TanstackSelect>
|
|
40
|
+
* )}
|
|
41
|
+
* </form.AppField>
|
|
42
|
+
* </form>
|
|
43
|
+
* )
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Example (dynamic items):
|
|
48
|
+
* ```tsx
|
|
49
|
+
* function ExampleWithDynamicItems() {
|
|
50
|
+
* const items = [
|
|
51
|
+
* { id: 'Apple', name: 'Apple' },
|
|
52
|
+
* { id: 'Banana', name: 'Banana' },
|
|
53
|
+
* { id: 'Orange', name: 'Orange' },
|
|
54
|
+
* ]
|
|
55
|
+
*
|
|
56
|
+
* const form = useTanstackUnityForm({
|
|
57
|
+
* validators: {},
|
|
58
|
+
* defaultValues: { fruit: '' }
|
|
59
|
+
* })
|
|
60
|
+
*
|
|
61
|
+
* return (
|
|
62
|
+
* <form>
|
|
63
|
+
* <form.AppField name="fruit">
|
|
64
|
+
* {() => (
|
|
65
|
+
* <form.Select items={items}>
|
|
66
|
+
* {item => <SelectOption id={item.id}>{item.name}</SelectOption>}
|
|
67
|
+
* </form.Select>
|
|
68
|
+
* )}
|
|
69
|
+
* </form.AppField>
|
|
70
|
+
* </form>
|
|
71
|
+
* )
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
* @remarks Migration from `Select` (non-TanStack):
|
|
75
|
+
* - Do not pass `value`, `defaultValue`, `onChange`, or `name` props: these are managed by the TanStack form context.
|
|
76
|
+
* - `isInvalid` is automatically derived from the field's validation state.
|
|
77
|
+
* - Use within `<form.AppField name="...">` to connect to the form state.
|
|
78
|
+
*/
|
|
79
|
+
declare const TanstackSelect: TanstackSelectComponent;
|
|
80
|
+
export { TanstackSelect };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { useFieldContext as f } from "../../hooks/tanstack-form-context.js";
|
|
4
|
+
import { useFieldA11yContext as u } from "../form-field/TanstackFormField.context.js";
|
|
5
|
+
import { Select as p } from "./Select.js";
|
|
6
|
+
const b = ({ onBlur: o, isReadOnly: a, isDisabled: l, ...r }, s) => {
|
|
7
|
+
const e = f(), t = u(), c = e.state.meta.isTouched && !e.state.meta.isValid, i = [t.helperTextId, t.feedbackTextId].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ d(
|
|
9
|
+
p,
|
|
10
|
+
{
|
|
11
|
+
...r,
|
|
12
|
+
ref: s,
|
|
13
|
+
value: e.state.value ?? "",
|
|
14
|
+
onChange: (n) => {
|
|
15
|
+
e.handleChange(n);
|
|
16
|
+
},
|
|
17
|
+
onBlur: (n) => {
|
|
18
|
+
e.handleBlur(), o?.(n);
|
|
19
|
+
},
|
|
20
|
+
isReadOnly: a,
|
|
21
|
+
isDisabled: l,
|
|
22
|
+
isInvalid: c,
|
|
23
|
+
"aria-labelledby": t.labelId,
|
|
24
|
+
"aria-describedby": i.length > 0 ? i : void 0,
|
|
25
|
+
"aria-details": t.contextualLinkId
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}, h = m(function(a, l) {
|
|
29
|
+
return b(a, l);
|
|
30
|
+
});
|
|
31
|
+
h.displayName = "TanstackSelect";
|
|
32
|
+
export {
|
|
33
|
+
h as TanstackSelect
|
|
34
|
+
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export interface SearchInputProps {
|
|
2
|
+
'aria-label': string;
|
|
3
|
+
}
|
|
4
|
+
declare const SearchInput: import('react').ForwardRefExoticComponent<SearchInputProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
2
5
|
export { SearchInput };
|
|
@@ -1,40 +1,58 @@
|
|
|
1
|
-
import { jsxs as e, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as e, Fragment as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
3
|
import { uyTv as m } from "@payfit/unity-themes";
|
|
4
|
-
import { SearchField as y, Input as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { CircularIconButton as
|
|
7
|
-
import { Icon as
|
|
8
|
-
const
|
|
4
|
+
import { SearchField as y, Input as d } from "react-aria-components";
|
|
5
|
+
import { useIntl as p } from "react-intl";
|
|
6
|
+
import { CircularIconButton as f } from "../../icon-button/CircularIconButton.js";
|
|
7
|
+
import { Icon as b } from "../../icon/Icon.js";
|
|
8
|
+
const h = m({
|
|
9
9
|
slots: {
|
|
10
|
-
base: "uy:flex uy:gap-100 uy:
|
|
11
|
-
input: "uy:flex-grow uy:outline-none uy:[&::-webkit-search-cancel-button]:hidden",
|
|
10
|
+
base: "uy:flex uy:gap-100 uy:transition-colors uy:py-125 uy:sm:py-100 uy:px-150 uy:rounded-100 uy:sm:rounded-75 uy:bg-surface-form-high-enabled uy:text-content-form-active uy:mt-100 uy:mb-100 uy:ml-100 uy:mr-100 uy:typography-body uy:focus-within:border uy:focus-within:border-solid uy:focus-within:border-border-form-active",
|
|
11
|
+
input: "uy:flex-grow uy:outline-none uy:[&::-webkit-search-cancel-button]:hidden uy:min-h-300",
|
|
12
12
|
button: "uy:text-content-neutral-enabled",
|
|
13
13
|
separator: "uy:h-[1px] uy:bg-surface-neutral-lowest uy:w-full uy:mt-100"
|
|
14
14
|
}
|
|
15
|
-
}),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/* @__PURE__ */ e(
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ t(
|
|
22
|
-
p,
|
|
15
|
+
}), g = c(
|
|
16
|
+
({ "aria-label": r }, o) => {
|
|
17
|
+
const a = p(), { base: u, input: n, button: i, separator: s } = h();
|
|
18
|
+
return /* @__PURE__ */ e(l, { children: [
|
|
19
|
+
/* @__PURE__ */ e(
|
|
20
|
+
y,
|
|
23
21
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
className: u(),
|
|
23
|
+
ref: o,
|
|
24
|
+
"data-dd-privacy": "mask",
|
|
25
|
+
"aria-label": r,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ t(
|
|
28
|
+
b,
|
|
29
|
+
{
|
|
30
|
+
src: "MagnifyingGlassOutlined",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
color: "content.neutral.lowest"
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ t(d, { className: n() }),
|
|
36
|
+
/* @__PURE__ */ t(
|
|
37
|
+
f,
|
|
38
|
+
{
|
|
39
|
+
title: a.formatMessage({
|
|
40
|
+
id: "unity:component:common:clear:title",
|
|
41
|
+
defaultMessage: "Clear"
|
|
42
|
+
}),
|
|
43
|
+
className: i(),
|
|
44
|
+
icon: "CloseOutlined",
|
|
45
|
+
asElement: "button"
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
31
49
|
}
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ t("div", { "aria-hidden": "true", className: s() })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
g.displayName = "SearchInput";
|
|
38
56
|
export {
|
|
39
|
-
|
|
57
|
+
g as SearchInput
|
|
40
58
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Button as
|
|
3
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
4
|
+
import { Button as b, SelectValue as p } from "react-aria-components";
|
|
5
5
|
import { useIntl as v } from "react-intl";
|
|
6
6
|
import { Icon as a } from "../../icon/Icon.js";
|
|
7
|
-
const x =
|
|
7
|
+
const x = m({
|
|
8
8
|
slots: {
|
|
9
|
-
base: "uy:flex uy:flex-row uy:gap-100 uy:
|
|
9
|
+
base: "uy:flex uy:flex-row uy:gap-100 uy:h-5.5 uy:sm:h-500 uy:py-125 uy:sm:py-100 uy:px-150 uy:rounded-100 uy:sm:rounded-75 uy:border-solid uy:focus-visible:ring-2 uy:focus-visible:ring-utility-focus-ring uy:focus-visible:ring-offset-2 uy:outline-none uy:border",
|
|
10
10
|
selectValue: [
|
|
11
11
|
"uy:whitespace-nowrap uy:text-ellipsis uy:typography-body uy:flex-grow uy:text-left uy:overflow-hidden",
|
|
12
12
|
"uy:data-[placeholder]:text-content-neutral-lowest"
|
|
@@ -18,7 +18,8 @@ const x = b({
|
|
|
18
18
|
isDisabled: {
|
|
19
19
|
true: {
|
|
20
20
|
base: "uy:border-border-form-disabled uy:bg-surface-form-disabled",
|
|
21
|
-
selectValue: "uy:text-content-form-disabled"
|
|
21
|
+
selectValue: "uy:text-content-form-disabled",
|
|
22
|
+
icon: "uy:text-content-form-disabled"
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
isInvalid: {
|
|
@@ -28,7 +29,7 @@ const x = b({
|
|
|
28
29
|
},
|
|
29
30
|
isReadOnly: {
|
|
30
31
|
true: {
|
|
31
|
-
base: "uy:border-border-form-disabled",
|
|
32
|
+
base: "uy:border-border-form-disabled uy:bg-surface-form-disabled",
|
|
32
33
|
selectValue: "uy:text-content-form-readonly",
|
|
33
34
|
icon: "uy:text-content-primary-disabled"
|
|
34
35
|
}
|
|
@@ -51,23 +52,24 @@ const x = b({
|
|
|
51
52
|
isInvalid: !1,
|
|
52
53
|
isReadOnly: !1
|
|
53
54
|
}
|
|
54
|
-
}),
|
|
55
|
-
({ isDisabled: r, isInvalid: o, isReadOnly:
|
|
56
|
-
const n = v(), { base: i, selectValue: d, iconWrapper:
|
|
55
|
+
}), h = f(
|
|
56
|
+
({ isDisabled: r, isInvalid: o, isReadOnly: s, isOpen: u }, l) => {
|
|
57
|
+
const n = v(), { base: i, selectValue: d, iconWrapper: y, icon: c } = x({
|
|
57
58
|
isDisabled: r,
|
|
58
59
|
isInvalid: o,
|
|
59
|
-
isReadOnly:
|
|
60
|
+
isReadOnly: s
|
|
60
61
|
});
|
|
61
62
|
return /* @__PURE__ */ t(
|
|
62
|
-
|
|
63
|
+
b,
|
|
63
64
|
{
|
|
64
65
|
"data-dd-privacy": "mask",
|
|
65
66
|
className: i(),
|
|
66
|
-
ref:
|
|
67
|
+
ref: l,
|
|
67
68
|
isDisabled: r,
|
|
69
|
+
"data-unity-slot": "select-button",
|
|
68
70
|
children: [
|
|
69
71
|
/* @__PURE__ */ e(p, { className: d() }),
|
|
70
|
-
/* @__PURE__ */ t("div", { className:
|
|
72
|
+
/* @__PURE__ */ t("div", { className: y(), children: [
|
|
71
73
|
o && /* @__PURE__ */ e(
|
|
72
74
|
a,
|
|
73
75
|
{
|
|
@@ -82,9 +84,9 @@ const x = b({
|
|
|
82
84
|
/* @__PURE__ */ e(
|
|
83
85
|
a,
|
|
84
86
|
{
|
|
85
|
-
className:
|
|
87
|
+
className: c(),
|
|
86
88
|
"aria-hidden": "true",
|
|
87
|
-
src:
|
|
89
|
+
src: u ? "CaretUpOutlined" : "CaretDownOutlined"
|
|
88
90
|
}
|
|
89
91
|
)
|
|
90
92
|
] })
|
|
@@ -93,7 +95,7 @@ const x = b({
|
|
|
93
95
|
);
|
|
94
96
|
}
|
|
95
97
|
);
|
|
96
|
-
|
|
98
|
+
h.displayName = "SelectButton";
|
|
97
99
|
export {
|
|
98
|
-
|
|
100
|
+
h as SelectButton
|
|
99
101
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as e, jsxs as y, Fragment as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
3
|
import { uyTv as f } from "@payfit/unity-themes";
|
|
4
|
-
import { ListBoxItem as
|
|
5
|
-
import { Icon as
|
|
4
|
+
import { ListBoxItem as p } from "react-aria-components";
|
|
5
|
+
import { Icon as m } from "../../icon/Icon.js";
|
|
6
6
|
import { SelectOptionProvider as b } from "./SelectOption.context.js";
|
|
7
7
|
const x = f({
|
|
8
|
-
base: "uy:flex uy:flex-col uy:typography-body uy:rounded-50 uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:outline-none",
|
|
8
|
+
base: "uy:flex uy:flex-col uy:typography-body uy:rounded-50 uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:outline-none uy:cursor-pointer",
|
|
9
9
|
variants: {
|
|
10
10
|
isFocusVisible: {
|
|
11
11
|
true: "uy:outline-offset-2 uy:outline-2 uy:outline-solid uy:outline-utility-focus-ring"
|
|
@@ -33,11 +33,11 @@ const x = f({
|
|
|
33
33
|
class: "uy:bg-surface-neutral-enabled uy:text-content-neutral-enabled"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
|
-
}), v =
|
|
36
|
+
}), v = d(
|
|
37
37
|
(s, l) => {
|
|
38
38
|
const { children: u, isDisabled: r, textValue: n } = s;
|
|
39
39
|
return /* @__PURE__ */ e(
|
|
40
|
-
|
|
40
|
+
p,
|
|
41
41
|
{
|
|
42
42
|
...s,
|
|
43
43
|
ref: l,
|
|
@@ -50,9 +50,9 @@ const x = f({
|
|
|
50
50
|
isSelected: c,
|
|
51
51
|
isDisabled: r
|
|
52
52
|
}),
|
|
53
|
-
children: ({ isSelected: t }) => /* @__PURE__ */ e(b, { isDisabled: r, children: t ? /* @__PURE__ */
|
|
53
|
+
children: ({ isSelected: t }) => /* @__PURE__ */ e(b, { isDisabled: r, children: t ? /* @__PURE__ */ y("div", { className: "uy:flex uy:justify-between", children: [
|
|
54
54
|
/* @__PURE__ */ e("div", { className: "uy:flex uy:flex-col", children: /* @__PURE__ */ e(i, { children: u }) }),
|
|
55
|
-
/* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ e(m, { src: "CheckOutlined" })
|
|
56
56
|
] }) : /* @__PURE__ */ e(i, { children: u }) })
|
|
57
57
|
}
|
|
58
58
|
);
|
|
@@ -45,6 +45,8 @@ type SelectFieldComponent = (<TItems extends object, TSchema extends Schema>(pro
|
|
|
45
45
|
* }
|
|
46
46
|
* ```
|
|
47
47
|
* @note The schema type parameter is needed to ensure type safety with the form's schema. If you omit it, the `name` prop will not be type-safe.
|
|
48
|
+
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
|
|
49
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
|
|
48
50
|
*/
|
|
49
51
|
declare const SelectField: SelectFieldComponent;
|
|
50
52
|
export { SelectField };
|
|
@@ -11,12 +11,12 @@ import { Select as k } from "../select/Select.js";
|
|
|
11
11
|
const v = h({
|
|
12
12
|
base: "uy:flex uy:flex-col uy:gap-100"
|
|
13
13
|
}), w = ({
|
|
14
|
-
children:
|
|
14
|
+
children: m,
|
|
15
15
|
feedbackText: e,
|
|
16
16
|
helperText: r,
|
|
17
|
-
isRequired:
|
|
18
|
-
label:
|
|
19
|
-
name:
|
|
17
|
+
isRequired: t,
|
|
18
|
+
label: l,
|
|
19
|
+
name: i,
|
|
20
20
|
requiredVariant: c,
|
|
21
21
|
isDisabled: n,
|
|
22
22
|
isInvalid: f,
|
|
@@ -26,7 +26,7 @@ const v = h({
|
|
|
26
26
|
...F
|
|
27
27
|
}, a) => {
|
|
28
28
|
const { control: u } = b(), x = {
|
|
29
|
-
isRequired:
|
|
29
|
+
isRequired: t,
|
|
30
30
|
isInvalid: f,
|
|
31
31
|
isDisabled: n,
|
|
32
32
|
isReadOnly: p
|
|
@@ -35,21 +35,20 @@ const v = h({
|
|
|
35
35
|
j,
|
|
36
36
|
{
|
|
37
37
|
control: u,
|
|
38
|
-
name:
|
|
38
|
+
name: i,
|
|
39
39
|
className: v(),
|
|
40
40
|
...x,
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */ o(g, { requiredVariant: c, children:
|
|
42
|
+
/* @__PURE__ */ o(g, { requiredVariant: c, children: l }),
|
|
43
43
|
r && /* @__PURE__ */ o(T, { children: r }),
|
|
44
44
|
/* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(
|
|
45
45
|
k,
|
|
46
46
|
{
|
|
47
47
|
ref: a,
|
|
48
|
-
name: m,
|
|
49
48
|
placeholder: s,
|
|
50
49
|
items: d,
|
|
51
50
|
...F,
|
|
52
|
-
children:
|
|
51
|
+
children: m
|
|
53
52
|
}
|
|
54
53
|
) }),
|
|
55
54
|
/* @__PURE__ */ o(N, { children: e })
|