@payfit/unity-components 1.2.0 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/action-bar/ActionBar.js +14 -14
- package/dist/esm/components/actionable/Actionable.js +31 -28
- package/dist/esm/components/alert/Alert.js +41 -29
- package/dist/esm/components/alert/parts/AlertTitle.js +8 -8
- package/dist/esm/components/app-layout/AppLayout.d.ts +2 -0
- package/dist/esm/components/app-layout/AppLayout.js +17 -17
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +23 -23
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +87 -5
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +0 -9
- package/dist/esm/components/autocomplete/Autocomplete.js +54 -57
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.js +8 -8
- package/dist/esm/components/avatar/Avatar.variants.js +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.js +26 -27
- package/dist/esm/components/badge/Badge.js +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.js +3 -3
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +1 -1
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
- package/dist/esm/components/button/Button.js +6 -6
- package/dist/esm/components/button/Button.variants.d.ts +1 -0
- package/dist/esm/components/button/Button.variants.js +22 -15
- package/dist/esm/components/card/Card.context.d.ts +5 -0
- package/dist/esm/components/card/Card.context.js +14 -0
- package/dist/esm/components/card/Card.d.ts +210 -0
- package/dist/esm/components/card/Card.js +93 -0
- package/dist/esm/components/card/parts/CardContent.d.ts +37 -0
- package/dist/esm/components/card/parts/CardContent.js +8 -0
- package/dist/esm/components/card/parts/CardTitle.d.ts +55 -0
- package/dist/esm/components/card/parts/CardTitle.js +33 -0
- package/dist/esm/components/checkbox/Checkbox.js +38 -30
- package/dist/esm/components/checkbox/Checkbox.variants.d.ts +9 -9
- package/dist/esm/components/checkbox/Checkbox.variants.js +23 -7
- package/dist/esm/components/checkbox/TanstackCheckbox.d.ts +28 -0
- package/dist/esm/components/checkbox/TanstackCheckbox.js +51 -0
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +7 -7
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.d.ts +14 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.js +40 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.d.ts +4 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.js +37 -0
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.d.ts +72 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.js +40 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.d.ts +103 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
- package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +1 -1
- package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
- package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +12 -12
- package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
- package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
- package/dist/esm/components/collapsible/parts/CollapsibleContent.js +5 -5
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +8 -8
- package/dist/esm/components/data-table/DataTable.d.ts +109 -16
- package/dist/esm/components/data-table/DataTable.js +107 -93
- package/dist/esm/components/data-table/mocks/employee-data.d.ts +1 -0
- package/dist/esm/components/date-calendar/DateCalendar.js +1 -1
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +1 -1
- package/dist/esm/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/esm/components/date-picker/DatePicker.js +59 -50
- package/dist/esm/components/date-picker/TanstackDatePicker.d.ts +22 -0
- package/dist/esm/components/date-picker/TanstackDatePicker.js +53 -0
- package/dist/esm/components/date-picker/parts/DateInput.js +4 -4
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.d.ts +71 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.js +41 -0
- package/dist/esm/components/definition-list/DefinitionList.context.d.ts +19 -0
- package/dist/esm/components/definition-list/DefinitionList.d.ts +24 -0
- package/dist/esm/components/definition-list/parts/DefinitionItem.d.ts +25 -0
- package/dist/esm/components/dialog/Dialog.d.ts +34 -22
- package/dist/esm/components/dialog/Dialog.js +90 -52
- package/dist/esm/components/dialog/parts/DialogActions.js +6 -6
- package/dist/esm/components/dialog/parts/DialogTitle.js +7 -4
- package/dist/esm/components/dialog/test-utils.d.ts +28 -0
- package/dist/esm/components/dialog/test-utils.js +78 -0
- package/dist/esm/components/error-state/ErrorState.d.ts +13 -1
- package/dist/esm/components/error-state/ErrorState.js +133 -92
- package/dist/esm/components/error-state/initConfig.js +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
- package/dist/esm/components/fieldset/Fieldset.js +32 -26
- package/dist/esm/components/filter/Filter.controls.d.ts +192 -0
- package/dist/esm/components/filter/Filter.controls.js +45 -0
- package/dist/esm/components/filter/Filter.d.ts +189 -0
- package/dist/esm/components/filter/Filter.js +147 -0
- package/dist/esm/components/filter/Filter.types.d.ts +121 -0
- package/dist/esm/components/filter/hooks/useFilterIds.d.ts +49 -0
- package/dist/esm/components/filter/hooks/useFilterIds.js +13 -0
- package/dist/esm/components/filter/hooks/useFilterState.d.ts +74 -0
- package/dist/esm/components/filter/hooks/useFilterState.js +23 -0
- package/dist/esm/components/filter/hooks/useFilterValue.d.ts +61 -0
- package/dist/esm/components/filter/hooks/useFilterValue.js +31 -0
- package/dist/esm/components/filter/parts/FilterButton.d.ts +75 -0
- package/dist/esm/components/filter/parts/FilterButton.js +55 -0
- package/dist/esm/components/filter/parts/FilterLabel.d.ts +96 -0
- package/dist/esm/components/filter/parts/FilterLabel.js +57 -0
- package/dist/esm/components/filter/parts/FilterPopover.d.ts +95 -0
- package/dist/esm/components/filter/parts/FilterPopover.js +79 -0
- package/dist/esm/components/filter/utils/value-formatters.d.ts +62 -0
- package/dist/esm/components/filter/utils/value-formatters.js +14 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.d.ts +110 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.js +172 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.types.d.ts +119 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.d.ts +96 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.js +132 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.d.ts +63 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.js +107 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.d.ts +18 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.js +18 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.d.ts +93 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.js +88 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.d.ts +24 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.js +19 -0
- package/dist/esm/components/flex/Flex.js +52 -37
- package/dist/esm/components/form/Form.d.ts +2 -0
- package/dist/esm/components/form/TanstackForm.d.ts +24 -0
- package/dist/esm/components/form/TanstackForm.js +29 -0
- package/dist/esm/components/form-field/FormField.d.ts +2 -0
- package/dist/esm/components/form-field/FormField.js +12 -12
- package/dist/esm/components/form-field/TanstackFormField.context.d.ts +10 -0
- package/dist/esm/components/form-field/TanstackFormField.context.js +14 -0
- package/dist/esm/components/form-field/TanstackFormField.d.ts +49 -0
- package/dist/esm/components/form-field/TanstackFormField.js +46 -0
- package/dist/esm/components/form-field/parts/FormControl.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormFeedbackText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormHelperText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormLabel.d.ts +2 -0
- package/dist/esm/components/form-field/parts/RawFormContextualLink.d.ts +22 -0
- package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.d.ts +12 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.js +32 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.d.ts +11 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.js +25 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.d.ts +8 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.js +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.d.ts +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.js +45 -0
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/icon/Icon.js +23 -19
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +9 -9
- package/dist/esm/components/icon-button/CircularIconButton.js +53 -36
- package/dist/esm/components/icon-button/IconButton.variants.d.ts +1 -0
- package/dist/esm/components/icon-button/IconButton.variants.js +44 -28
- package/dist/esm/components/input/Input.js +36 -35
- package/dist/esm/components/input/TanstackInput.d.ts +22 -0
- package/dist/esm/components/input/TanstackInput.js +38 -0
- package/dist/esm/components/label/Label.js +12 -12
- package/dist/esm/components/link/{Link.variants.d.ts → RawLink.d.ts} +92 -0
- package/dist/esm/components/link/{Link.variants.js → RawLink.js} +78 -5
- package/dist/esm/components/list-view/ListView.d.ts +56 -0
- package/dist/esm/components/list-view/ListView.fixtures.d.ts +20 -0
- package/dist/esm/components/list-view/ListView.js +44 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.d.ts +34 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.d.ts +33 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewSection.d.ts +14 -0
- package/dist/esm/components/list-view/parts/ListViewSection.js +21 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.d.ts +102 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.js +80 -0
- package/dist/esm/components/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
- package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
- package/dist/esm/components/multi-select/MultiSelect.d.ts +5 -7
- package/dist/esm/components/multi-select/MultiSelect.js +199 -176
- package/dist/esm/components/multi-select/MultiselectTypes.d.ts +114 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.d.ts +7 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.js +41 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.d.ts +2 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +62 -46
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +15 -15
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +45 -12
- package/dist/esm/components/multi-select-field/MultiSelectField.js +56 -66
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.d.ts +92 -0
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.js +48 -0
- package/dist/esm/components/multi-select-field/test-utils.d.ts +17 -0
- package/dist/esm/components/multi-select-field/test-utils.js +45 -0
- package/dist/esm/components/nav/parts/NavGroup.d.ts +3 -3
- package/dist/esm/components/nav/parts/NavGroup.js +62 -51
- package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
- package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
- package/dist/esm/components/navigation-card/NavigationCard.context.d.ts +31 -0
- package/dist/esm/components/navigation-card/NavigationCard.context.js +13 -0
- package/dist/esm/components/navigation-card/NavigationCard.d.ts +46 -0
- package/dist/esm/components/navigation-card/NavigationCard.js +62 -0
- package/dist/esm/components/navigation-card/NavigationCard.types.d.ts +37 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.d.ts +1147 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.js +164 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.d.ts +39 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.js +22 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.d.ts +146 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.js +93 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.d.ts +32 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.js +24 -0
- package/dist/esm/components/number-field/NumberField.d.ts +2 -0
- package/dist/esm/components/number-field/TanstackNumberField.d.ts +74 -0
- package/dist/esm/components/number-field/TanstackNumberField.js +44 -0
- package/dist/esm/components/number-input/NumberInput.js +31 -29
- package/dist/esm/components/number-input/TanstackNumberInput.d.ts +58 -0
- package/dist/esm/components/number-input/TanstackNumberInput.js +38 -0
- package/dist/esm/components/page/Page.js +13 -12
- package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
- package/dist/esm/components/page/parts/PageHeader.js +22 -20
- package/dist/esm/components/pagination/Pagination.d.ts +23 -44
- package/dist/esm/components/pagination/Pagination.js +89 -163
- package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
- package/dist/esm/components/pagination/PaginationContext.js +15 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
- package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
- package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
- package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
- package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
- package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
- package/dist/esm/components/payfit-brand/PayFitBrand.d.ts +4 -0
- package/dist/esm/components/payfit-brand/PayFitBrand.js +30 -22
- package/dist/esm/components/payfit-brand/PayFitPreprod.js +25 -25
- package/dist/esm/components/phone-number/PhoneNumberInput.d.ts +67 -0
- package/dist/esm/components/phone-number/PhoneNumberInput.js +322 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.d.ts +64 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.js +33 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.d.ts +42 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.js +68 -0
- package/dist/esm/components/phone-number/unknownFlag.svg.js +4 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.d.ts +15 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.js +32 -0
- package/dist/esm/components/pill/Pill.d.ts +2 -2
- package/dist/esm/components/pill/Pill.js +8 -8
- package/dist/esm/components/popover/Popover.js +6 -6
- package/dist/esm/components/promo-dialog/PromoDialog.d.ts +149 -0
- package/dist/esm/components/promo-dialog/PromoDialog.js +219 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.d.ts +44 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.js +29 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.d.ts +43 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.js +20 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.d.ts +47 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.js +25 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.d.ts +53 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.js +21 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.d.ts +6 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.js +18 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.d.ts +13 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.js +43 -0
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +29 -11
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +53 -51
- package/dist/esm/components/radio-button-group-field/RadioButtonGroupField.d.ts +2 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.d.ts +13 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.js +38 -0
- package/dist/esm/components/search/Search.js +46 -46
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +5 -5
- package/dist/esm/components/select/Select.d.ts +5 -4
- package/dist/esm/components/select/Select.js +79 -53
- package/dist/esm/components/select/TanstackSelect.d.ts +80 -0
- package/dist/esm/components/select/TanstackSelect.js +34 -0
- package/dist/esm/components/select/parts/SearchInput.d.ts +4 -1
- package/dist/esm/components/select/parts/SearchInput.js +49 -31
- package/dist/esm/components/select/parts/SelectButton.js +19 -17
- package/dist/esm/components/select/parts/SelectOption.js +9 -9
- package/dist/esm/components/select-field/SelectField.d.ts +2 -0
- package/dist/esm/components/select-field/SelectField.js +8 -9
- package/dist/esm/components/select-field/TanstackSelectField.d.ts +124 -0
- package/dist/esm/components/select-field/TanstackSelectField.js +44 -0
- package/dist/esm/components/select-list/SelectList.d.ts +95 -0
- package/dist/esm/components/select-list/SelectList.js +79 -0
- package/dist/esm/components/select-list/SelectList.types.d.ts +29 -0
- package/dist/esm/components/select-list/constants.d.ts +36 -0
- package/dist/esm/components/select-list/constants.js +29 -0
- package/dist/esm/components/select-list/helpers.d.ts +42 -0
- package/dist/esm/components/select-list/helpers.js +48 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.js +16 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.js +31 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.d.ts +8 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.js +25 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.d.ts +118 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.js +28 -0
- package/dist/esm/components/select-list/parts/SelectListOption.d.ts +24 -0
- package/dist/esm/components/select-list/parts/SelectListOption.js +72 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.d.ts +2 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.js +43 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.d.ts +54 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.js +35 -0
- package/dist/esm/components/select-list/utils/partition.d.ts +13 -0
- package/dist/esm/components/select-list/utils/partition.js +9 -0
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.context.d.ts +1 -5
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.ts +6 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +23 -23
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.d.ts +27 -0
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.js +34 -0
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.d.ts +1 -16
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +56 -57
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.d.ts +81 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.js +47 -0
- package/dist/esm/components/selectable-card/internals/Description.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/SelectableCardCheckboxGroup.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.d.ts +26 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/parts/SelectableCardCheckbox.js +24 -24
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.d.ts +2 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.js +12 -14
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.d.ts +28 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +14 -13
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.js +27 -25
- package/dist/esm/components/selectable-card/selectableCard.variant.js +5 -5
- package/dist/esm/components/selectable-card-checkbox-group-field/SelectableCardCheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.js +38 -0
- package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.js +38 -0
- package/dist/esm/components/skip-links/SkipLinks.js +1 -1
- package/dist/esm/components/table/Table.context.d.ts +5 -0
- package/dist/esm/components/table/Table.context.js +14 -13
- package/dist/esm/components/table/Table.d.ts +94 -0
- package/dist/esm/components/table/Table.js +145 -108
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
- package/dist/esm/components/table/parts/TableBody.js +83 -21
- package/dist/esm/components/table/parts/TableCell.js +29 -26
- package/dist/esm/components/table/parts/TableEmptyState.js +6 -6
- package/dist/esm/components/table/parts/TableHeader.js +1 -1
- package/dist/esm/components/table/parts/TablePagination.d.ts +5 -5
- package/dist/esm/components/table/parts/TablePagination.js +11 -11
- package/dist/esm/components/table/parts/TableRow.js +22 -18
- package/dist/esm/components/tabs/Tabs.variant.d.ts +0 -6
- package/dist/esm/components/tabs/Tabs.variant.js +11 -12
- package/dist/esm/components/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
- package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
- package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
- package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +43 -43
- package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +45 -41
- package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
- package/dist/esm/components/task-menu/parts/TaskGroup.js +30 -26
- package/dist/esm/components/task-menu/parts/task.variants.js +4 -2
- package/dist/esm/components/text/Text.d.ts +11 -1
- package/dist/esm/components/text/Text.js +43 -30
- package/dist/esm/components/text/Text.variants.d.ts +12 -0
- package/dist/esm/components/text/Text.variants.js +4 -0
- package/dist/esm/components/text-area/TanstackTextArea.d.ts +21 -0
- package/dist/esm/components/text-area/TanstackTextArea.js +35 -0
- package/dist/esm/components/text-area/TextArea.js +31 -29
- package/dist/esm/components/text-field/TanstackTextField.d.ts +79 -0
- package/dist/esm/components/text-field/TanstackTextField.js +60 -0
- package/dist/esm/components/text-field/TextField.d.ts +2 -0
- package/dist/esm/components/toast/UnityToast.js +5 -5
- package/dist/esm/components/toast/test-utils.d.ts +36 -0
- package/dist/esm/components/toast/test-utils.js +118 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.d.ts +46 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.js +25 -0
- package/dist/esm/components/toggle-switch/ToggleSwitch.d.ts +21 -9
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +71 -32
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.d.ts +11 -0
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.js +34 -0
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.d.ts +57 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.js +23 -0
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +1 -1
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.d.ts +19 -0
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.js +50 -0
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -0
- package/dist/esm/docs/{table → examples/data}/mocks/employee-columns.d.ts +1 -1
- package/dist/esm/hooks/tanstack-form-context.d.ts +1 -0
- package/dist/esm/hooks/tanstack-form-context.js +8 -0
- package/dist/esm/hooks/use-container-query-level.d.ts +42 -0
- package/dist/esm/hooks/use-container-query-level.js +33 -0
- package/dist/esm/hooks/use-form.d.ts +2 -0
- package/dist/esm/hooks/use-has-scroll.d.ts +71 -0
- package/dist/esm/hooks/use-has-scroll.js +75 -0
- package/dist/esm/hooks/use-tanstack-form.d.ts +369 -0
- package/dist/esm/hooks/use-tanstack-form.js +209 -0
- package/dist/esm/index.d.ts +64 -30
- package/dist/esm/index.js +482 -394
- package/dist/esm/index.storybook-testing.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +45 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/TanstackFormContextualLink.d.ts +43 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.d.ts +34 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.js +25 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.js +32 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.d.ts +49 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.d.ts +73 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.js +37 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.d.ts +54 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
- package/dist/esm/integrations/tanstack-router/index.d.ts +19 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router.js +40 -0
- package/dist/esm/mocks/employees.d.ts +1 -5
- package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
- package/dist/esm/providers/router/RouterProvider.js +14 -10
- package/dist/esm/storybook-testing.js +8 -2
- package/dist/esm/storybook-utilities/previewTransform.d.ts +1 -0
- package/dist/esm/types/DataAttributes.d.ts +1 -1
- package/dist/esm/utils/scroll-detection.d.ts +77 -0
- package/dist/esm/utils/scroll-detection.js +33 -0
- package/dist/esm/utils/spacing.d.ts +63 -0
- package/dist/esm/utils/spacing.js +15 -0
- package/i18n/en-GB.json +22 -8
- package/i18n/es-ES.json +24 -10
- package/i18n/fr-FR.json +25 -11
- package/package.json +66 -45
- package/dist/esm/components/form-field/parts/FormContextualLink.d.ts +0 -20
- package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
- package/dist/esm/components/link/Link.d.ts +0 -93
- package/dist/esm/components/link/Link.js +0 -68
- package/dist/esm/components/multi-select/Multiselect.types.d.ts +0 -109
- package/dist/esm/components/nav/parts/NavItem.js +0 -95
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.d.ts +0 -6
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.js +0 -28
- package/dist/esm/integrations/react-router/v5/index.d.ts +0 -1
- package/dist/esm/integrations/react-router/v5.js +0 -4
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { TanstackFormFeedbackText as d } from "../form-field/parts/TanstackFormFeedbackText.js";
|
|
4
|
+
import { TanstackFormHelperText as f } from "../form-field/parts/TanstackFormHelperText.js";
|
|
5
|
+
import { TanstackFormLabel as k } from "../form-field/parts/TanstackFormLabel.js";
|
|
6
|
+
import { TanstackFormField as F } from "../form-field/TanstackFormField.js";
|
|
7
|
+
import { TanstackMultiSelect as T } from "../multi-select/TanstackMultiSelect.js";
|
|
8
|
+
const u = ({
|
|
9
|
+
label: r,
|
|
10
|
+
helperText: t,
|
|
11
|
+
contextualLink: m,
|
|
12
|
+
isRequired: a,
|
|
13
|
+
isDisabled: e,
|
|
14
|
+
isReadOnly: c,
|
|
15
|
+
requiredVariant: i,
|
|
16
|
+
...l
|
|
17
|
+
}, n) => /* @__PURE__ */ s(F, { children: [
|
|
18
|
+
/* @__PURE__ */ o(
|
|
19
|
+
k,
|
|
20
|
+
{
|
|
21
|
+
requiredVariant: i,
|
|
22
|
+
isRequired: a,
|
|
23
|
+
children: r
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
t && /* @__PURE__ */ o(f, { children: t }),
|
|
27
|
+
/* @__PURE__ */ o(
|
|
28
|
+
T,
|
|
29
|
+
{
|
|
30
|
+
ref: n,
|
|
31
|
+
...{
|
|
32
|
+
isDisabled: e,
|
|
33
|
+
isReadOnly: c
|
|
34
|
+
},
|
|
35
|
+
"aria-label": r,
|
|
36
|
+
...l
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ o(d, {}),
|
|
40
|
+
m
|
|
41
|
+
] }), x = p(
|
|
42
|
+
// @ts-expect-error - forwardRef struggles with generic components
|
|
43
|
+
u
|
|
44
|
+
);
|
|
45
|
+
x.displayName = "TanstackMultiSelectField";
|
|
46
|
+
export {
|
|
47
|
+
x as TanstackMultiSelectField
|
|
48
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PlayCtx } from '../../types/testing.js';
|
|
2
|
+
/**
|
|
3
|
+
* Factory to get multi-select testing utils
|
|
4
|
+
* @param context the story context
|
|
5
|
+
*/
|
|
6
|
+
export declare const getTestingUtilsMultiSelect: (context: PlayCtx) => {
|
|
7
|
+
selectOption: ({ labelText, optionNames, container, }: {
|
|
8
|
+
labelText: string;
|
|
9
|
+
optionNames: string[];
|
|
10
|
+
container?: HTMLElement;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
assertSelectedOptions: ({ labelText, expectedDisplayValue, container, }: {
|
|
13
|
+
labelText: string;
|
|
14
|
+
expectedDisplayValue: string;
|
|
15
|
+
container?: HTMLElement;
|
|
16
|
+
}) => Promise<void>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { within as i, expect as l, userEvent as a, screen as r } from "storybook/test";
|
|
2
|
+
const y = (s) => ({ selectOption: async ({
|
|
3
|
+
labelText: t,
|
|
4
|
+
optionNames: e,
|
|
5
|
+
container: o = s.canvasElement
|
|
6
|
+
}) => {
|
|
7
|
+
await s.step(
|
|
8
|
+
`Select options "${e.join(", ")}" in "${t}"`,
|
|
9
|
+
async () => {
|
|
10
|
+
const n = i(o).getByLabelText(t, {
|
|
11
|
+
exact: !1
|
|
12
|
+
});
|
|
13
|
+
if (!n)
|
|
14
|
+
throw new Error(`Multi-select not found for label ${t}`);
|
|
15
|
+
await a.click(n, { delay: 100 });
|
|
16
|
+
for (const c of e)
|
|
17
|
+
await a.click(
|
|
18
|
+
r.getByRole("option", { name: c }),
|
|
19
|
+
{
|
|
20
|
+
delay: 100
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
await a.keyboard("{Escape}", { delay: 100 });
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}, assertSelectedOptions: async ({
|
|
27
|
+
labelText: t,
|
|
28
|
+
expectedDisplayValue: e,
|
|
29
|
+
container: o = s.canvasElement
|
|
30
|
+
}) => {
|
|
31
|
+
await s.step(
|
|
32
|
+
`Assert selected options "${e}" in "${t}"`,
|
|
33
|
+
async () => {
|
|
34
|
+
const n = i(o).getByLabelText(t, {
|
|
35
|
+
exact: !1
|
|
36
|
+
});
|
|
37
|
+
if (!n)
|
|
38
|
+
throw new Error(`Multi-select not found for label ${t}`);
|
|
39
|
+
await l(n).toHaveTextContent(e);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
} });
|
|
43
|
+
export {
|
|
44
|
+
y as getTestingUtilsMultiSelect
|
|
45
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { DataAttributes } from '../../../types/DataAttributes.js';
|
|
3
|
-
import {
|
|
4
|
-
type NavGroupChildren = React.ReactElement<NavItemProps, typeof
|
|
3
|
+
import { NavItemProps, RawNavItem } from './RawNavItem.js';
|
|
4
|
+
type NavGroupChildren = React.ReactElement<NavItemProps, typeof RawNavItem>;
|
|
5
5
|
type NavGroupProps = {
|
|
6
|
-
/** The child elements to be rendered inside the NavGroup. They must be `<
|
|
6
|
+
/** The child elements to be rendered inside the NavGroup. They must be `<RawNavItem>` components. */
|
|
7
7
|
children: NavGroupChildren | NavGroupChildren[];
|
|
8
8
|
/** The label to show for the NavGroup. */
|
|
9
9
|
label: string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Button as
|
|
5
|
-
import
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { navItemBase as
|
|
8
|
-
const
|
|
9
|
-
extend:
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import o, { useState as j, useCallback as B, useMemo as D } from "react";
|
|
3
|
+
import { uyTv as S } from "@payfit/unity-themes";
|
|
4
|
+
import { Button as _ } from "react-aria-components";
|
|
5
|
+
import $ from "../../../hooks/use-id.js";
|
|
6
|
+
import { Icon as k } from "../../icon/Icon.js";
|
|
7
|
+
import { navItemBase as z } from "./RawNavItem.js";
|
|
8
|
+
const H = S({
|
|
9
|
+
extend: z,
|
|
10
10
|
slots: {
|
|
11
11
|
caret: "uy:transition-transform uy:duration-150 uy:delay-25 uy:ease-linear motion-reduce:transition-none",
|
|
12
12
|
contentWrapper: "uy:transition-[max-height] uy:duration-200 uy:ease-linear motion-reduce:transition-none",
|
|
@@ -29,49 +29,60 @@ const z = B({
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
function
|
|
33
|
-
children:
|
|
32
|
+
function M({
|
|
33
|
+
children: d,
|
|
34
34
|
label: p,
|
|
35
|
-
prefix:
|
|
36
|
-
suffix:
|
|
35
|
+
prefix: l,
|
|
36
|
+
suffix: y,
|
|
37
37
|
defaultExpanded: f = !1,
|
|
38
|
-
isExpanded:
|
|
38
|
+
isExpanded: r,
|
|
39
39
|
onToggle: i,
|
|
40
|
-
...
|
|
40
|
+
...N
|
|
41
41
|
}) {
|
|
42
|
-
const u =
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
const u = $(), [x, b] = j(f), n = r !== void 0, a = n ? r : x, C = B(() => {
|
|
43
|
+
n || b((e) => !e), i?.(!a);
|
|
44
|
+
}, [n, a, i]), h = o.Children.map(d, (e) => o.isValidElement(e) ? o.cloneElement(e, { isDisabled: !a, level: 1 }) : e), c = `${u}-toggle`, m = `${u}-content`, {
|
|
45
|
+
baseClassName: v,
|
|
46
|
+
prefixClassName: g,
|
|
47
|
+
labelClassName: I,
|
|
48
|
+
suffixClassName: W,
|
|
49
|
+
contentClassName: E,
|
|
50
|
+
contentWrapperClassName: w,
|
|
51
|
+
caretClassName: G
|
|
52
|
+
} = D(() => {
|
|
53
|
+
const e = H({ level: 0, expanded: a });
|
|
54
|
+
return {
|
|
55
|
+
baseClassName: e.base({ className: "uy:w-full" }),
|
|
56
|
+
prefixClassName: e.prefix(),
|
|
57
|
+
suffixClassName: e.suffix(),
|
|
58
|
+
labelClassName: e.label(),
|
|
59
|
+
contentWrapperClassName: e.contentWrapper(),
|
|
60
|
+
contentClassName: e.content(),
|
|
61
|
+
caretClassName: e.caret()
|
|
62
|
+
};
|
|
63
|
+
}, [a]);
|
|
64
|
+
return /* @__PURE__ */ s("li", { className: "uy:flex uy:flex-col uy:gap-50", children: [
|
|
65
|
+
/* @__PURE__ */ s(
|
|
66
|
+
_,
|
|
56
67
|
{
|
|
57
68
|
id: c,
|
|
58
|
-
className:
|
|
59
|
-
onPress:
|
|
60
|
-
"aria-expanded":
|
|
61
|
-
"aria-controls":
|
|
62
|
-
...
|
|
69
|
+
className: v,
|
|
70
|
+
onPress: C,
|
|
71
|
+
"aria-expanded": a,
|
|
72
|
+
"aria-controls": m,
|
|
73
|
+
...N,
|
|
63
74
|
children: [
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
75
|
+
l && /* @__PURE__ */ t("span", { className: g, children: l({ isExpanded: a }) }),
|
|
76
|
+
/* @__PURE__ */ t("span", { className: I, children: p }),
|
|
77
|
+
/* @__PURE__ */ s("span", { className: W, role: "presentation", children: [
|
|
78
|
+
y,
|
|
79
|
+
/* @__PURE__ */ t(
|
|
80
|
+
k,
|
|
70
81
|
{
|
|
71
82
|
src: "CaretDownOutlined",
|
|
72
83
|
alt: "expand group",
|
|
73
84
|
size: 20,
|
|
74
|
-
className:
|
|
85
|
+
className: G,
|
|
75
86
|
color: "inherit"
|
|
76
87
|
}
|
|
77
88
|
)
|
|
@@ -79,26 +90,26 @@ function H({
|
|
|
79
90
|
]
|
|
80
91
|
}
|
|
81
92
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ t(
|
|
83
94
|
"div",
|
|
84
95
|
{
|
|
85
|
-
className:
|
|
86
|
-
style: { maxHeight:
|
|
87
|
-
children: /* @__PURE__ */
|
|
96
|
+
className: w,
|
|
97
|
+
style: { maxHeight: a ? 1e3 : 0 },
|
|
98
|
+
children: /* @__PURE__ */ t(
|
|
88
99
|
"ul",
|
|
89
100
|
{
|
|
90
|
-
id:
|
|
91
|
-
className:
|
|
101
|
+
id: m,
|
|
102
|
+
className: E,
|
|
92
103
|
"aria-labelledby": c,
|
|
93
|
-
"aria-hidden": !
|
|
94
|
-
children:
|
|
104
|
+
"aria-hidden": !a,
|
|
105
|
+
children: h
|
|
95
106
|
}
|
|
96
107
|
)
|
|
97
108
|
}
|
|
98
109
|
)
|
|
99
110
|
] });
|
|
100
111
|
}
|
|
101
|
-
|
|
112
|
+
M.displayName = "NavGroup";
|
|
102
113
|
export {
|
|
103
|
-
|
|
114
|
+
M as NavGroup
|
|
104
115
|
};
|
|
@@ -155,10 +155,107 @@ export type NavItemProps = Pick<VariantProps<typeof navItem>, 'level'> & PropsWi
|
|
|
155
155
|
isExact?: boolean;
|
|
156
156
|
}> & DataAttributes;
|
|
157
157
|
/**
|
|
158
|
-
* The `
|
|
158
|
+
* The `RawNavItem` component represents a single, fully accessible navigation item in a `Nav` component, with support for custom elements at the start or the end of the element. It can render a link or a button depending on the provided properties.
|
|
159
159
|
*/
|
|
160
|
-
export declare
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
export declare const RawNavItem: import('react').ForwardRefExoticComponent<Pick<VariantProps<import('tailwind-variants').TVReturnType<{
|
|
161
|
+
isActive: {
|
|
162
|
+
true: {
|
|
163
|
+
base: string;
|
|
164
|
+
prefix: string;
|
|
165
|
+
label: string;
|
|
166
|
+
};
|
|
167
|
+
false: {
|
|
168
|
+
base: string;
|
|
169
|
+
prefix: string;
|
|
170
|
+
label: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
}, undefined, undefined, {
|
|
174
|
+
level: {
|
|
175
|
+
0: string;
|
|
176
|
+
1: string;
|
|
177
|
+
};
|
|
178
|
+
isDisabled: {
|
|
179
|
+
true: {
|
|
180
|
+
base: string;
|
|
181
|
+
label: string;
|
|
182
|
+
};
|
|
183
|
+
false: string;
|
|
184
|
+
};
|
|
185
|
+
}, {
|
|
186
|
+
base: string[];
|
|
187
|
+
prefix: string;
|
|
188
|
+
suffix: string;
|
|
189
|
+
label: string[];
|
|
190
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
191
|
+
level: {
|
|
192
|
+
0: string;
|
|
193
|
+
1: string;
|
|
194
|
+
};
|
|
195
|
+
isDisabled: {
|
|
196
|
+
true: {
|
|
197
|
+
base: string;
|
|
198
|
+
label: string;
|
|
199
|
+
};
|
|
200
|
+
false: string;
|
|
201
|
+
};
|
|
202
|
+
}, {
|
|
203
|
+
base: string[];
|
|
204
|
+
prefix: string;
|
|
205
|
+
suffix: string;
|
|
206
|
+
label: string[];
|
|
207
|
+
}, undefined, {
|
|
208
|
+
level: {
|
|
209
|
+
0: string;
|
|
210
|
+
1: string;
|
|
211
|
+
};
|
|
212
|
+
isDisabled: {
|
|
213
|
+
true: {
|
|
214
|
+
base: string;
|
|
215
|
+
label: string;
|
|
216
|
+
};
|
|
217
|
+
false: string;
|
|
218
|
+
};
|
|
219
|
+
}, {
|
|
220
|
+
base: string[];
|
|
221
|
+
prefix: string;
|
|
222
|
+
suffix: string;
|
|
223
|
+
label: string[];
|
|
224
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
225
|
+
level: {
|
|
226
|
+
0: string;
|
|
227
|
+
1: string;
|
|
228
|
+
};
|
|
229
|
+
isDisabled: {
|
|
230
|
+
true: {
|
|
231
|
+
base: string;
|
|
232
|
+
label: string;
|
|
233
|
+
};
|
|
234
|
+
false: string;
|
|
235
|
+
};
|
|
236
|
+
}, {
|
|
237
|
+
base: string[];
|
|
238
|
+
prefix: string;
|
|
239
|
+
suffix: string;
|
|
240
|
+
label: string[];
|
|
241
|
+
}, undefined, unknown, unknown, undefined>>>>, "level"> & {
|
|
242
|
+
/** The prefix element to be displayed before the label. */
|
|
243
|
+
prefix?: ({ isCurrent }: {
|
|
244
|
+
isCurrent: boolean;
|
|
245
|
+
}) => ReactNode;
|
|
246
|
+
/** The suffix element to be displayed after the label. */
|
|
247
|
+
suffix?: ReactNode;
|
|
248
|
+
/** The click event handler for the nav item. Use it when the item executes an action that does not redirect to another page */
|
|
249
|
+
onPress?: AriaButtonProps["onPress"];
|
|
250
|
+
/** The URL to navigate to when the nav item is clicked. Use it when the item should trigger a navigation to another page */
|
|
251
|
+
href?: string;
|
|
252
|
+
/** Whether the nav item is currently active. */
|
|
253
|
+
isCurrent?: boolean;
|
|
254
|
+
/** Whether the nav item is disabled. */
|
|
255
|
+
isDisabled?: boolean;
|
|
256
|
+
/** Whether the nav item should exactly match the route's path. */
|
|
257
|
+
isExact?: boolean;
|
|
258
|
+
} & {
|
|
259
|
+
children?: ReactNode | undefined;
|
|
260
|
+
} & DataAttributes & import('react').RefAttributes<HTMLElement>>;
|
|
164
261
|
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as u, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as C, useMemo as I } from "react";
|
|
3
|
+
import { uyTv as i, uyMerge as j } from "@payfit/unity-themes";
|
|
4
|
+
import { Link as R, Button as A } from "react-aria-components";
|
|
5
|
+
import { useRouter as k } from "../../../providers/router/RouterProvider.js";
|
|
6
|
+
const B = i({
|
|
7
|
+
slots: {
|
|
8
|
+
base: [
|
|
9
|
+
"uy:group uy:cursor-pointer uy:grid uy:w-full uy:grid-cols-[auto_1fr_auto] uy:items-center uy:py-100 uy:px-150 uy:gap-100 uy:rounded-75 uy:outline-0 uy:transition-all",
|
|
10
|
+
"uy:hover:bg-surface-neutral-low-hover uy:active:bg-surface-neutral-low-active uy:data-[pressed]:bg-surface-neutral-low-pressed",
|
|
11
|
+
"uy:focus:outline-0 uy:data-[focus-visible]:outline-none uy:data-[focus-visible]:ring-2 uy:data-[focus-visible]:ring-utility-focus-ring uy:data-[focus-visible]:ring-offset-2"
|
|
12
|
+
],
|
|
13
|
+
prefix: "uy:p-25 uy:empty:hidden uy:text-content-neutral-low",
|
|
14
|
+
suffix: "uy:flex uy:gap-100 uy:items-center uy:text-content-neutral-low uy:justify-self-end uy:text-right uy:empty:hidden",
|
|
15
|
+
label: [
|
|
16
|
+
"uy:flex-1 uy:basis-full uy:text-left uy:truncate uy:overflow-hidden uy:whitespace-break-spaces uy:typography-body uy:text-content-neutral"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
level: {
|
|
21
|
+
0: "uy:pl-150",
|
|
22
|
+
1: "uy:pl-600"
|
|
23
|
+
},
|
|
24
|
+
isDisabled: {
|
|
25
|
+
true: {
|
|
26
|
+
base: "uy:pointer-events-none",
|
|
27
|
+
label: "uy:text-content-neutral-disabled"
|
|
28
|
+
},
|
|
29
|
+
false: ""
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}), M = i({
|
|
33
|
+
extend: B,
|
|
34
|
+
variants: {
|
|
35
|
+
isActive: {
|
|
36
|
+
true: {
|
|
37
|
+
base: "uy:bg-surface-neutral-low-active",
|
|
38
|
+
prefix: "uy:text-content-neutral",
|
|
39
|
+
label: "uy:typography-body-strong"
|
|
40
|
+
},
|
|
41
|
+
false: {
|
|
42
|
+
base: "",
|
|
43
|
+
prefix: "uy:text-content-neutral-low",
|
|
44
|
+
label: "uy:typography-body"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}), _ = C(
|
|
49
|
+
({
|
|
50
|
+
children: y,
|
|
51
|
+
level: r = 0,
|
|
52
|
+
prefix: l,
|
|
53
|
+
suffix: n,
|
|
54
|
+
onPress: c,
|
|
55
|
+
href: t,
|
|
56
|
+
isCurrent: f,
|
|
57
|
+
isDisabled: s = !1,
|
|
58
|
+
isExact: p = !1,
|
|
59
|
+
...m
|
|
60
|
+
}, d) => {
|
|
61
|
+
const o = k(), b = t ? R : A, e = o && t ? o.isActive(t, p) : f, {
|
|
62
|
+
rawNavItemClassName: v,
|
|
63
|
+
labelClassName: x,
|
|
64
|
+
prefixClassName: g,
|
|
65
|
+
suffixClassName: N
|
|
66
|
+
} = I(() => {
|
|
67
|
+
const a = M({ level: r, isActive: e, isDisabled: s });
|
|
68
|
+
return {
|
|
69
|
+
rawNavItemClassName: j(a.base(), a.label()),
|
|
70
|
+
prefixClassName: a.prefix(),
|
|
71
|
+
suffixClassName: a.suffix(),
|
|
72
|
+
labelClassName: a.label()
|
|
73
|
+
};
|
|
74
|
+
}, [e, s, r]), w = Object.assign(
|
|
75
|
+
{},
|
|
76
|
+
e !== void 0 && {
|
|
77
|
+
"data-current": e,
|
|
78
|
+
"aria-current": e ? "page" : void 0
|
|
79
|
+
},
|
|
80
|
+
!t && { tabIndex: s ? -1 : void 0 }
|
|
81
|
+
);
|
|
82
|
+
return /* @__PURE__ */ u("li", { children: /* @__PURE__ */ h(
|
|
83
|
+
b,
|
|
84
|
+
{
|
|
85
|
+
...w,
|
|
86
|
+
...m,
|
|
87
|
+
ref: d,
|
|
88
|
+
className: v,
|
|
89
|
+
href: t,
|
|
90
|
+
onPress: c,
|
|
91
|
+
isDisabled: s,
|
|
92
|
+
"data-level": r,
|
|
93
|
+
children: [
|
|
94
|
+
l && /* @__PURE__ */ u("span", { className: g, children: l({ isCurrent: e ?? !1 }) }),
|
|
95
|
+
/* @__PURE__ */ u("span", { className: x, children: y }),
|
|
96
|
+
n && /* @__PURE__ */ u("span", { className: N, children: n })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
) });
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
_.displayName = "RawNavItem";
|
|
103
|
+
export {
|
|
104
|
+
_ as RawNavItem,
|
|
105
|
+
B as navItemBase
|
|
106
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface NavigationCardContextValue {
|
|
2
|
+
id: string;
|
|
3
|
+
labelId: string;
|
|
4
|
+
descriptionId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const NavigationCardContext: import('react').Context<NavigationCardContextValue>;
|
|
7
|
+
/**
|
|
8
|
+
* Accesses the NavigationCard context to retrieve accessibility IDs for proper ARIA relationships.
|
|
9
|
+
* Use this hook when building custom subcomponents that need to connect to the parent NavigationCard's accessibility structure.
|
|
10
|
+
* @returns {NavigationCardContextValue} An object containing id, labelId, and descriptionId for ARIA attributes
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { useNavigationCardContext } from '@payfit/unity-components'
|
|
14
|
+
*
|
|
15
|
+
* function CustomNavigationCardContent() {
|
|
16
|
+
* const { labelId, descriptionId } = useNavigationCardContext()
|
|
17
|
+
* return (
|
|
18
|
+
* <div>
|
|
19
|
+
* <span id={labelId}>Custom Label</span>
|
|
20
|
+
* <span id={descriptionId}>Custom Description</span>
|
|
21
|
+
* </div>
|
|
22
|
+
* )
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
* @remarks
|
|
26
|
+
* - This hook must be called within a NavigationCard component
|
|
27
|
+
* - The context provides unique IDs for accessibility attributes
|
|
28
|
+
* - Use the provided IDs to maintain proper ARIA labeling relationships
|
|
29
|
+
* @see {@link NavigationCardContextValue} for the returned value structure
|
|
30
|
+
*/
|
|
31
|
+
export declare function useNavigationCardContext(): NavigationCardContextValue;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NavigationCardProps } from './NavigationCard.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The NavigationCard is a clickable card component for navigating between sections or pages in your application.
|
|
4
|
+
* Use navigation cards to create intuitive and appealing navigation patterns that guide users through different areas of your app.
|
|
5
|
+
* The component supports both link and button behaviors, and can be customized with flexible spacing options.
|
|
6
|
+
* @param {NavigationCardProps} props - Props including standard link/button props, padding, gap, prefix, and suffix
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import {
|
|
10
|
+
* RawNavigationCard,
|
|
11
|
+
* NavigationCardLabel,
|
|
12
|
+
* NavigationCardDescription
|
|
13
|
+
* } from '@payfit/unity-components'
|
|
14
|
+
* import { Icon } from '@payfit/unity-icons'
|
|
15
|
+
*
|
|
16
|
+
* function Example() {
|
|
17
|
+
* return (
|
|
18
|
+
* <RawNavigationCard
|
|
19
|
+
* href="/dashboard"
|
|
20
|
+
* prefix={<Icon name="dashboard" />}
|
|
21
|
+
* >
|
|
22
|
+
* <NavigationCardLabel>Dashboard</NavigationCardLabel>
|
|
23
|
+
* <NavigationCardDescription>
|
|
24
|
+
* View your company overview
|
|
25
|
+
* </NavigationCardDescription>
|
|
26
|
+
* </RawNavigationCard>
|
|
27
|
+
* )
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
* @remarks
|
|
31
|
+
* - Use `asElement="a"` (default) for navigation links or `asElement="button"` for actions
|
|
32
|
+
* - Control spacing with `padding` (all sides), `paddingBlock` (vertical), `paddingInline` (horizontal), or individual sides via object notation
|
|
33
|
+
* - Adjust gap between prefix, body, and suffix with the `gap` prop
|
|
34
|
+
* - Default spacing values: `padding="$300"` (24px) and `gap="$150"` (12px)
|
|
35
|
+
* - Compose with `NavigationCardLabel` and `NavigationCardDescription` for proper accessibility
|
|
36
|
+
* - The component automatically handles focus states, hover effects, and disabled styling
|
|
37
|
+
* - For Tanstack Router integration, use the `NavigationCard` from `@payfit/unity-components/integrations/tanstack-router`
|
|
38
|
+
* @see {@link NavigationCardProps} for all available props
|
|
39
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/navigation-card GitHub}
|
|
40
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=14505-64292 Figma}
|
|
41
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
42
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/navigation-navigationcard--docs unity-components.payfit.io}
|
|
43
|
+
*/
|
|
44
|
+
declare const RawNavigationCard: import('react').ForwardRefExoticComponent<NavigationCardProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
45
|
+
export { RawNavigationCard };
|
|
46
|
+
export type { NavigationCardProps } from './NavigationCard.types.js';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as C, useMemo as P } from "react";
|
|
3
|
+
import { useId as $ } from "react-aria";
|
|
4
|
+
import { Link as w, Button as I } from "react-aria-components";
|
|
5
|
+
import { processPaddingProp as R } from "../../utils/spacing.js";
|
|
6
|
+
import { NavigationCardContext as j } from "./NavigationCard.context.js";
|
|
7
|
+
import { navigationCard as L } from "./NavigationCard.variants.js";
|
|
8
|
+
const k = C(
|
|
9
|
+
({
|
|
10
|
+
children: m,
|
|
11
|
+
asElement: f = "a",
|
|
12
|
+
prefix: t,
|
|
13
|
+
suffix: d,
|
|
14
|
+
padding: o = "$300",
|
|
15
|
+
paddingBlock: n,
|
|
16
|
+
paddingInline: s,
|
|
17
|
+
gap: c = "$150",
|
|
18
|
+
...i
|
|
19
|
+
}, b) => {
|
|
20
|
+
const e = $(), l = f === "a" || "href" in i, v = i, a = {
|
|
21
|
+
id: `unity-navigation-card-${e}`,
|
|
22
|
+
labelId: i["aria-labelledby"] ?? `unity-navigation-card-label-${e}`,
|
|
23
|
+
descriptionId: i["aria-describedby"] ?? `unity-navigation-card-description-${e}`
|
|
24
|
+
}, {
|
|
25
|
+
base: y,
|
|
26
|
+
prefix: u,
|
|
27
|
+
body: p,
|
|
28
|
+
suffix: x
|
|
29
|
+
} = P(() => {
|
|
30
|
+
const g = R(
|
|
31
|
+
o,
|
|
32
|
+
n,
|
|
33
|
+
s
|
|
34
|
+
);
|
|
35
|
+
return L({
|
|
36
|
+
...g,
|
|
37
|
+
gap: c
|
|
38
|
+
});
|
|
39
|
+
}, [o, n, s, c]), N = l ? w : I;
|
|
40
|
+
return /* @__PURE__ */ r(j.Provider, { value: a, children: /* @__PURE__ */ h(
|
|
41
|
+
N,
|
|
42
|
+
{
|
|
43
|
+
"data-dd-privacy": "allow",
|
|
44
|
+
id: a.id,
|
|
45
|
+
"aria-labelledby": a.labelId,
|
|
46
|
+
"aria-describedby": a.descriptionId,
|
|
47
|
+
...v,
|
|
48
|
+
ref: b,
|
|
49
|
+
className: y(),
|
|
50
|
+
children: [
|
|
51
|
+
t && /* @__PURE__ */ r("div", { className: u(), children: t }),
|
|
52
|
+
/* @__PURE__ */ r("div", { className: p(), children: m }),
|
|
53
|
+
d && /* @__PURE__ */ r("div", { className: x(), children: d })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
) });
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
k.displayName = "RawNavigationCard";
|
|
60
|
+
export {
|
|
61
|
+
k as RawNavigationCard
|
|
62
|
+
};
|