@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,3 +1,6 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { LinkProps as AriaLinkProps } from 'react-aria-components';
|
|
1
4
|
export declare const link: import('tailwind-variants').TVReturnType<{
|
|
2
5
|
variant: {
|
|
3
6
|
inline: {
|
|
@@ -164,3 +167,92 @@ export declare const link: import('tailwind-variants').TVReturnType<{
|
|
|
164
167
|
base: string[];
|
|
165
168
|
icon: string[];
|
|
166
169
|
}, undefined, unknown, unknown, undefined>>;
|
|
170
|
+
type LinkVariantProps = VariantProps<typeof link>;
|
|
171
|
+
export type RawLinkProps = Omit<AriaLinkProps, 'style' | 'className'> & {
|
|
172
|
+
/**
|
|
173
|
+
* The URL the link navigates to.
|
|
174
|
+
*/
|
|
175
|
+
href: HTMLAnchorElement['href'];
|
|
176
|
+
/**
|
|
177
|
+
* The link id
|
|
178
|
+
*/
|
|
179
|
+
id?: HTMLAttributes<HTMLAnchorElement>['id'];
|
|
180
|
+
/**
|
|
181
|
+
* The link's size.
|
|
182
|
+
* @default 'inherit'
|
|
183
|
+
*/
|
|
184
|
+
size?: LinkVariantProps['size'];
|
|
185
|
+
/**
|
|
186
|
+
* The link's display variant. Links can be inline with text or standalone (block).
|
|
187
|
+
* @default 'inline'
|
|
188
|
+
*/
|
|
189
|
+
variant?: LinkVariantProps['variant'];
|
|
190
|
+
/**
|
|
191
|
+
* The link's color.
|
|
192
|
+
* @default 'primary'
|
|
193
|
+
*/
|
|
194
|
+
color?: LinkVariantProps['color'];
|
|
195
|
+
/**
|
|
196
|
+
* Whether the link navigates to an external page. If true, the link will open in a new tab and display an indicator icon.
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
isExternal?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Whether the link marks the current section or page.
|
|
202
|
+
* @default false
|
|
203
|
+
*/
|
|
204
|
+
isCurrent?: Pick<HTMLAttributes<HTMLAnchorElement>, 'aria-current'> | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* When true, the active state will only be applied if the location is matched exactly.
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
isExact?: boolean;
|
|
210
|
+
maxCharactersTruncation?: number;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Links allow users to navigate to different pages or sections.
|
|
214
|
+
*/
|
|
215
|
+
declare const RawLink: import('react').ForwardRefExoticComponent<Omit<AriaLinkProps, "className" | "style"> & {
|
|
216
|
+
/**
|
|
217
|
+
* The URL the link navigates to.
|
|
218
|
+
*/
|
|
219
|
+
href: HTMLAnchorElement["href"];
|
|
220
|
+
/**
|
|
221
|
+
* The link id
|
|
222
|
+
*/
|
|
223
|
+
id?: HTMLAttributes<HTMLAnchorElement>["id"];
|
|
224
|
+
/**
|
|
225
|
+
* The link's size.
|
|
226
|
+
* @default 'inherit'
|
|
227
|
+
*/
|
|
228
|
+
size?: LinkVariantProps["size"];
|
|
229
|
+
/**
|
|
230
|
+
* The link's display variant. Links can be inline with text or standalone (block).
|
|
231
|
+
* @default 'inline'
|
|
232
|
+
*/
|
|
233
|
+
variant?: LinkVariantProps["variant"];
|
|
234
|
+
/**
|
|
235
|
+
* The link's color.
|
|
236
|
+
* @default 'primary'
|
|
237
|
+
*/
|
|
238
|
+
color?: LinkVariantProps["color"];
|
|
239
|
+
/**
|
|
240
|
+
* Whether the link navigates to an external page. If true, the link will open in a new tab and display an indicator icon.
|
|
241
|
+
* @default false
|
|
242
|
+
*/
|
|
243
|
+
isExternal?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Whether the link marks the current section or page.
|
|
246
|
+
* @default false
|
|
247
|
+
*/
|
|
248
|
+
isCurrent?: Pick<HTMLAttributes<HTMLAnchorElement>, "aria-current"> | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* When true, the active state will only be applied if the location is matched exactly.
|
|
251
|
+
* @default false
|
|
252
|
+
*/
|
|
253
|
+
isExact?: boolean;
|
|
254
|
+
maxCharactersTruncation?: number;
|
|
255
|
+
} & {
|
|
256
|
+
children?: import('react').ReactNode | undefined;
|
|
257
|
+
} & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
258
|
+
export { RawLink };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { jsxs as h, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as w } from "react";
|
|
3
|
+
import { IconSprite as k } from "@payfit/unity-icons";
|
|
4
|
+
import { uyTv as D } from "@payfit/unity-themes";
|
|
5
|
+
import { Link as z } from "react-aria-components";
|
|
6
|
+
import { useRouter as A } from "../../providers/router/RouterProvider.js";
|
|
7
|
+
import { isExternalUrl as E } from "./utils.js";
|
|
8
|
+
const L = D({
|
|
3
9
|
slots: {
|
|
4
10
|
base: [
|
|
5
11
|
"uy:rounded-50 uy:underline uy:transition-colors uy:underline-offset-3",
|
|
@@ -15,7 +21,7 @@ const a = e({
|
|
|
15
21
|
icon: "uy:align-top"
|
|
16
22
|
},
|
|
17
23
|
standalone: {
|
|
18
|
-
base: "uy:flex uy:gap-x-25 uy:items-end",
|
|
24
|
+
base: "uy:typography-action uy:flex uy:gap-x-25 uy:items-end uy:py-50 uy:sm:p-0",
|
|
19
25
|
icon: "uy:self-center"
|
|
20
26
|
}
|
|
21
27
|
},
|
|
@@ -62,6 +68,13 @@ const a = e({
|
|
|
62
68
|
class: {
|
|
63
69
|
base: "uy:data-[disabled]:text-content-neutral-lowest-disabled"
|
|
64
70
|
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
size: "inherit",
|
|
74
|
+
variant: "inline",
|
|
75
|
+
class: {
|
|
76
|
+
base: "uy:text-(length:inherit)"
|
|
77
|
+
}
|
|
65
78
|
}
|
|
66
79
|
],
|
|
67
80
|
defaultVariants: {
|
|
@@ -70,7 +83,67 @@ const a = e({
|
|
|
70
83
|
isDisabled: !1,
|
|
71
84
|
size: "inherit"
|
|
72
85
|
}
|
|
73
|
-
})
|
|
86
|
+
}), N = w(
|
|
87
|
+
({
|
|
88
|
+
href: a,
|
|
89
|
+
children: s,
|
|
90
|
+
variant: u = "inline",
|
|
91
|
+
color: l = "primary",
|
|
92
|
+
isDisabled: o = !1,
|
|
93
|
+
isExact: c = !1,
|
|
94
|
+
isCurrent: y = void 0,
|
|
95
|
+
isExternal: d,
|
|
96
|
+
maxCharactersTruncation: i,
|
|
97
|
+
size: p = "inherit",
|
|
98
|
+
...e
|
|
99
|
+
}, b) => {
|
|
100
|
+
const r = A(), t = d ?? E(a), n = !t && r ? r.isActive(a.toString(), c) : y, { base: m, icon: v } = L({
|
|
101
|
+
variant: u,
|
|
102
|
+
color: l,
|
|
103
|
+
isDisabled: o,
|
|
104
|
+
size: p,
|
|
105
|
+
isTruncated: !!i
|
|
106
|
+
}), x = !!i, f = r && {
|
|
107
|
+
...n !== void 0 && {
|
|
108
|
+
"data-current": n,
|
|
109
|
+
"aria-current": n ? "page" : void 0
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
return /* @__PURE__ */ h(
|
|
113
|
+
z,
|
|
114
|
+
{
|
|
115
|
+
"data-dd-privacy": "allow",
|
|
116
|
+
...e,
|
|
117
|
+
href: a,
|
|
118
|
+
ref: b,
|
|
119
|
+
style: x ? {
|
|
120
|
+
"--uy-link-max-w": `${i}ch`
|
|
121
|
+
} : {},
|
|
122
|
+
className: m(),
|
|
123
|
+
isDisabled: o,
|
|
124
|
+
target: t ? "_blank" : e.target,
|
|
125
|
+
rel: t && !e.rel ? "noopener noreferrer" : e.rel,
|
|
126
|
+
...f,
|
|
127
|
+
children: [
|
|
128
|
+
s,
|
|
129
|
+
t && /* @__PURE__ */ g(
|
|
130
|
+
k,
|
|
131
|
+
{
|
|
132
|
+
src: "ArrowSquareOutOutlined",
|
|
133
|
+
color: "currentColor",
|
|
134
|
+
width: "1.25em",
|
|
135
|
+
height: "1.25em",
|
|
136
|
+
role: "presentation",
|
|
137
|
+
className: v()
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
N.displayName = "Link";
|
|
74
146
|
export {
|
|
75
|
-
|
|
147
|
+
N as RawLink,
|
|
148
|
+
L as link
|
|
76
149
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { JSX, Ref } from 'react';
|
|
2
|
+
import { ListBoxProps } from 'react-aria-components';
|
|
3
|
+
export type ListViewProps<TItem extends object> = Omit<ListBoxProps<TItem>, 'layout' | 'selectionBehavior' | 'selectionMode' | 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange' | 'shouldSelectOnPressUp' | 'disallowEmptySelection' | 'escapeKeyBehavior' | 'className'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Controls whether to enable virtualization for the list.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
enableVirtualization?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Additional CSS classes to apply to the list container. Use this to customize height or other container styles.
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
type ListViewComponentType = {
|
|
15
|
+
<TItem extends object>(props: ListViewProps<TItem> & {
|
|
16
|
+
ref?: Ref<HTMLDivElement>;
|
|
17
|
+
}): JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The ListView component displays a vertically scrollable list of interactive items, allowing users to browse and navigate content in an organized manner.
|
|
22
|
+
*
|
|
23
|
+
* ListView supports both static and dynamic content rendering, sectioned layouts, keyboard navigation, disabled items, custom empty states, and virtualization for optimal performance with large datasets. Primarily designed for navigation-first mobile experiences like iOS mail apps and settings lists.
|
|
24
|
+
* @param {ListViewProps} props - The props for the ListView component, including all ListBox props from React Aria Components plus `enableVirtualization`
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* import { ListView, RawListViewItem, ListViewItemLabel } from '@payfit/unity-components'
|
|
28
|
+
*
|
|
29
|
+
* function Example() {
|
|
30
|
+
* return (
|
|
31
|
+
* <ListView aria-label="My list">
|
|
32
|
+
* <RawListViewItem id="1" href="/items/1">
|
|
33
|
+
* <ListViewItemLabel>Item 1</ListViewItemLabel>
|
|
34
|
+
* </RawListViewItem>
|
|
35
|
+
* <RawListViewItem id="2" href="/items/2">
|
|
36
|
+
* <ListViewItemLabel>Item 2</ListViewItemLabel>
|
|
37
|
+
* </RawListViewItem>
|
|
38
|
+
* </ListView>
|
|
39
|
+
* )
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
* @remarks
|
|
43
|
+
* - Items can include an `href` prop to render as semantic links for navigation
|
|
44
|
+
* - Set `enableVirtualization` to `true` when working with large datasets (hundreds or thousands of items)
|
|
45
|
+
* - Combine with `ListViewSection` to organize items into labeled groups
|
|
46
|
+
* - Use `disabledKeys` to disable specific items by their ID
|
|
47
|
+
* - Provide `renderEmptyState` to display custom content when the list is empty
|
|
48
|
+
* - Always provide an accessible label using `aria-label` or `aria-labelledby`
|
|
49
|
+
* @see {@link ListViewProps} for all available props
|
|
50
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/list-view GitHub}
|
|
51
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=15306-115&m=dev Figma}
|
|
52
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
53
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-listview--docs unity-components.payfit.io}
|
|
54
|
+
*/
|
|
55
|
+
declare const ListView: ListViewComponentType;
|
|
56
|
+
export { ListView };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const flatItems: {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const groupedItems: {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
children: {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
content: React.ReactNode;
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
export declare const virtualizedItems: {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
content: React.ReactNode;
|
|
20
|
+
}[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { uyTv as c } from "@payfit/unity-themes";
|
|
4
|
+
import { Virtualizer as m, ListLayout as p, ListBox as o } from "react-aria-components";
|
|
5
|
+
const u = c({
|
|
6
|
+
base: [
|
|
7
|
+
"uy:pb-500 uy:data-[empty=true]:pb-0",
|
|
8
|
+
'uy:[&_[data-unity-slot="ListViewSection"]]:pb-300',
|
|
9
|
+
'uy:[&_[data-unity-slot="ListViewSection"]:last-child]:pb-0'
|
|
10
|
+
]
|
|
11
|
+
}), y = {
|
|
12
|
+
layout: p,
|
|
13
|
+
layoutOptions: {
|
|
14
|
+
estimatedRowHeight: 56,
|
|
15
|
+
estimatedHeadingHeight: 24,
|
|
16
|
+
gap: 0,
|
|
17
|
+
padding: 0
|
|
18
|
+
}
|
|
19
|
+
}, w = (r, i) => {
|
|
20
|
+
const { children: a, enableVirtualization: n, className: d, ...e } = r, s = u({ className: d });
|
|
21
|
+
return n ? /* @__PURE__ */ t(m, { ...y, children: /* @__PURE__ */ t(
|
|
22
|
+
o,
|
|
23
|
+
{
|
|
24
|
+
...e,
|
|
25
|
+
ref: i,
|
|
26
|
+
"data-dd-privacy": "show",
|
|
27
|
+
className: s,
|
|
28
|
+
children: a
|
|
29
|
+
}
|
|
30
|
+
) }) : /* @__PURE__ */ t(
|
|
31
|
+
o,
|
|
32
|
+
{
|
|
33
|
+
...e,
|
|
34
|
+
ref: i,
|
|
35
|
+
"data-dd-privacy": "show",
|
|
36
|
+
className: s,
|
|
37
|
+
children: a
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}, V = l(w);
|
|
41
|
+
V.displayName = "ListView";
|
|
42
|
+
export {
|
|
43
|
+
V as ListView
|
|
44
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextProps } from '../../text/Text.js';
|
|
2
|
+
export type ListViewItemLabelProps = Omit<TextProps, 'variant' | 'color'>;
|
|
3
|
+
/**
|
|
4
|
+
* The ListViewItemLabel component displays the primary text label for a list item, providing accessible identification and consistent typography.
|
|
5
|
+
* ListViewItemLabel applies action-style typography with automatic text truncation after three lines, ensuring labels remain scannable while accommodating varying content lengths. This component is required for proper accessibility within list items, as it helps screen readers identify each item's purpose.
|
|
6
|
+
* @param {ListViewItemLabelProps} props - The props for the ListViewItemLabel component, inheriting all Text props except `variant` and `color` (which are preset)
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { ListView, RawListViewItem, ListViewItemLabel } from '@payfit/unity-components'
|
|
10
|
+
*
|
|
11
|
+
* function Example() {
|
|
12
|
+
* return (
|
|
13
|
+
* <ListView selectionMode="single">
|
|
14
|
+
* <RawListViewItem>
|
|
15
|
+
* <ListViewItemLabel>Employee Name</ListViewItemLabel>
|
|
16
|
+
* </RawListViewItem>
|
|
17
|
+
* </ListView>
|
|
18
|
+
* )
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
* @remarks
|
|
22
|
+
* - This component is required for accessibility - always include it in your RawListViewItem or provide `aria-label`/`textValue`
|
|
23
|
+
* - Text automatically truncates after 3 lines using `lineClamp` to maintain consistent item heights
|
|
24
|
+
* - Uses action-style typography (medium weight) to emphasize the label as the primary identifier
|
|
25
|
+
* - Content is automatically masked for privacy in Datadog recordings via `data-dd-privacy="mask"`
|
|
26
|
+
* - Inherits the disabled state styling from its parent RawListViewItem
|
|
27
|
+
* @see {@link ListViewItemLabelProps} for all available props
|
|
28
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/list-view/parts GitHub}
|
|
29
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=15306-942&m=dev Figma}
|
|
30
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
31
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-listview-listviewitemlabel--docs unity-components.payfit.io}
|
|
32
|
+
*/
|
|
33
|
+
declare const ListViewItemLabel: import('react').ForwardRefExoticComponent<ListViewItemLabelProps & import('react').RefAttributes<HTMLElement>>;
|
|
34
|
+
export { ListViewItemLabel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { Text as o } from "../../text/Text.js";
|
|
4
|
+
const m = r(
|
|
5
|
+
({ children: t, ...i }, a) => /* @__PURE__ */ e(
|
|
6
|
+
o,
|
|
7
|
+
{
|
|
8
|
+
...i,
|
|
9
|
+
ref: a,
|
|
10
|
+
color: "inherit",
|
|
11
|
+
variant: "action",
|
|
12
|
+
"data-dd-privacy": "mask",
|
|
13
|
+
"data-unity-slot": "ListViewItemLabel",
|
|
14
|
+
lineClamp: 3,
|
|
15
|
+
children: t
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
m.displayName = "ListViewItemLabel";
|
|
20
|
+
export {
|
|
21
|
+
m as ListViewItemLabel
|
|
22
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TextProps } from '../../text/Text.js';
|
|
2
|
+
export type ListViewItemTextProps = Omit<TextProps, 'variant' | 'color'>;
|
|
3
|
+
/**
|
|
4
|
+
* The ListViewItemText component displays the primary text label for a list item, providing accessible identification and consistent typography.
|
|
5
|
+
* @param {ListViewItemTextProps} props - The props for the ListViewItemText component, inheriting all Text props except `variant` and `color` (which are preset)
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { ListView, RawListViewItem, ListViewItemText } from '@payfit/unity-components'
|
|
9
|
+
*
|
|
10
|
+
* function Example() {
|
|
11
|
+
* return (
|
|
12
|
+
* <ListView>
|
|
13
|
+
* <RawListViewItem>
|
|
14
|
+
* <ListViewItemLabel>Employee Name</ListViewItemLabel>
|
|
15
|
+
* <ListViewItemText>Employee Name</ListViewItemText>
|
|
16
|
+
* </RawListViewItem>
|
|
17
|
+
* </ListView>
|
|
18
|
+
* )
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
* @remarks
|
|
22
|
+
* - This component is used to display the text content of a list item
|
|
23
|
+
* - It inherits the disabled state styling from its parent RawListViewItem
|
|
24
|
+
* - It uses the bodySmall variant with the neutral.low color
|
|
25
|
+
* - It is automatically masked for privacy in Datadog recordings via the data-dd-privacy="mask" attribute
|
|
26
|
+
* @see {@link ListViewItemTextProps} for all available props
|
|
27
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/list-view/parts GitHub}
|
|
28
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=15306-942&m=dev Figma}
|
|
29
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
30
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-listview-listviewitemtext--docs unity-components.payfit.io}
|
|
31
|
+
*/
|
|
32
|
+
declare const ListViewItemText: import('react').ForwardRefExoticComponent<ListViewItemTextProps & import('react').RefAttributes<HTMLElement>>;
|
|
33
|
+
export { ListViewItemText };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as a } from "react";
|
|
3
|
+
import { Text as i } from "../../text/Text.js";
|
|
4
|
+
const m = a(
|
|
5
|
+
({ children: t, ...e }, o) => /* @__PURE__ */ r(
|
|
6
|
+
i,
|
|
7
|
+
{
|
|
8
|
+
...e,
|
|
9
|
+
ref: o,
|
|
10
|
+
color: "content.neutral.low",
|
|
11
|
+
variant: "bodySmall",
|
|
12
|
+
"data-dd-privacy": "mask",
|
|
13
|
+
"data-unity-slot": "ListViewItemText",
|
|
14
|
+
lineClamp: 3,
|
|
15
|
+
children: t
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
m.displayName = "ListViewItemText";
|
|
20
|
+
export {
|
|
21
|
+
m as ListViewItemText
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSX, Ref } from 'react';
|
|
2
|
+
import { ListBoxSectionProps } from 'react-aria-components';
|
|
3
|
+
export declare const listViewSection: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "", unknown, unknown, undefined>>;
|
|
4
|
+
export type ListViewSectionProps<TItem extends object> = ListBoxSectionProps<TItem> & {
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
type ListViewSectionComponentType = {
|
|
8
|
+
<TItem extends object>(props: ListViewSectionProps<TItem> & {
|
|
9
|
+
ref?: Ref<HTMLElement>;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const ListViewSection: ListViewSectionComponentType;
|
|
14
|
+
export { ListViewSection };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
4
|
+
import { ListBoxSection as a, Header as l, Collection as p } from "react-aria-components";
|
|
5
|
+
const S = m({
|
|
6
|
+
// add the component styles
|
|
7
|
+
base: ""
|
|
8
|
+
}), y = (i, o) => {
|
|
9
|
+
const { children: n, title: r, ...t } = i;
|
|
10
|
+
return /* @__PURE__ */ s(a, { ...t, ref: o, "data-unity-slot": "ListViewSection", children: [
|
|
11
|
+
/* @__PURE__ */ e(l, { className: "uy:typography-action uy:text-content-neutral-low uy:px-200 uy:mb-50", children: r }),
|
|
12
|
+
/* @__PURE__ */ e(p, { children: n, items: t.items })
|
|
13
|
+
] });
|
|
14
|
+
}, u = c(
|
|
15
|
+
y
|
|
16
|
+
);
|
|
17
|
+
u.displayName = "ListViewSection";
|
|
18
|
+
export {
|
|
19
|
+
u as ListViewSection,
|
|
20
|
+
S as listViewSection
|
|
21
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { JSX, ReactNode, Ref } from 'react';
|
|
2
|
+
import { ListBoxItemProps } from 'react-aria-components';
|
|
3
|
+
export declare const listViewItem: import('tailwind-variants').TVReturnType<{
|
|
4
|
+
[key: string]: {
|
|
5
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
6
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
7
|
+
prefix?: import('tailwind-merge').ClassNameValue;
|
|
8
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
9
|
+
wrapper?: import('tailwind-merge').ClassNameValue;
|
|
10
|
+
suffix?: import('tailwind-merge').ClassNameValue;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
[x: string]: {
|
|
15
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
16
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
17
|
+
prefix?: import('tailwind-merge').ClassNameValue;
|
|
18
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
19
|
+
wrapper?: import('tailwind-merge').ClassNameValue;
|
|
20
|
+
suffix?: import('tailwind-merge').ClassNameValue;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
} | {}, {
|
|
24
|
+
root: string[];
|
|
25
|
+
wrapper: string[];
|
|
26
|
+
prefix: string[];
|
|
27
|
+
content: string[];
|
|
28
|
+
suffix: string[];
|
|
29
|
+
}, undefined, {
|
|
30
|
+
[key: string]: {
|
|
31
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
32
|
+
content?: import('tailwind-merge').ClassNameValue;
|
|
33
|
+
prefix?: import('tailwind-merge').ClassNameValue;
|
|
34
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
35
|
+
wrapper?: import('tailwind-merge').ClassNameValue;
|
|
36
|
+
suffix?: import('tailwind-merge').ClassNameValue;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
} | {}, {
|
|
40
|
+
root: string[];
|
|
41
|
+
wrapper: string[];
|
|
42
|
+
prefix: string[];
|
|
43
|
+
content: string[];
|
|
44
|
+
suffix: string[];
|
|
45
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
46
|
+
root: string[];
|
|
47
|
+
wrapper: string[];
|
|
48
|
+
prefix: string[];
|
|
49
|
+
content: string[];
|
|
50
|
+
suffix: string[];
|
|
51
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
52
|
+
export type RawListViewItemProps<TItem extends object> = Omit<ListBoxItemProps<TItem>, 'ref' | 'children' | 'className' | 'style'> & {
|
|
53
|
+
prefix?: JSX.Element;
|
|
54
|
+
suffix?: JSX.Element;
|
|
55
|
+
hideDisclosureIndicator?: boolean;
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
};
|
|
58
|
+
type RawListViewItemComponentType = {
|
|
59
|
+
<TItem extends object>(props: RawListViewItemProps<TItem> & {
|
|
60
|
+
ref?: Ref<HTMLDivElement>;
|
|
61
|
+
}): JSX.Element;
|
|
62
|
+
displayName: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The RawListViewItem component represents an individual item within a ListView, providing a flexible layout structure with prefix, content, and suffix slots.
|
|
66
|
+
*
|
|
67
|
+
* RawListViewItem handles interactive states (hover, focus, pressed, disabled) and automatically displays a disclosure indicator for navigation affordance unless explicitly hidden. When an `href` prop is provided, the item renders as a semantic link element. This component serves as the building block for all list item content within ListView, managing the layout and interaction patterns consistently.
|
|
68
|
+
* @param {RawListViewItemProps} props - The props for the RawListViewItem component, including all ListBoxItem props plus `prefix`, `suffix`, and `hideDisclosureIndicator`
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* import { ListView, RawListViewItem, ListViewItemLabel } from '@payfit/unity-components'
|
|
72
|
+
*
|
|
73
|
+
* function Example() {
|
|
74
|
+
* return (
|
|
75
|
+
* <ListView aria-label="Users">
|
|
76
|
+
* <RawListViewItem
|
|
77
|
+
* href="/users/1"
|
|
78
|
+
* prefix={<Icon src="UserFilled" />}
|
|
79
|
+
* suffix={<Badge>New</Badge>}
|
|
80
|
+
* >
|
|
81
|
+
* <ListViewItemLabel>John Doe</ListViewItemLabel>
|
|
82
|
+
* </RawListViewItem>
|
|
83
|
+
* </ListView>
|
|
84
|
+
* )
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
* @remarks
|
|
88
|
+
* - Always include a `ListViewItemLabel`, `aria-label`, or `textValue` prop for accessibility
|
|
89
|
+
* - Use the `prefix` prop for leading icons, avatars, or indicators
|
|
90
|
+
* - Use the `suffix` prop for trailing metadata, badges, or values
|
|
91
|
+
* - Set `hideDisclosureIndicator` to `true` when the item doesn't navigate to additional content
|
|
92
|
+
* - Set `isDisabled` to `true` to prevent interaction with the item
|
|
93
|
+
* - Provide an `href` prop to render the item as a semantic link for navigation
|
|
94
|
+
* - The component automatically manages hover, focus, and pressed states
|
|
95
|
+
* @see {@link RawListViewItemProps} for all available props
|
|
96
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/list-view/parts GitHub}
|
|
97
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library Figma}
|
|
98
|
+
* @see Design docs in {@link https://www.payfit.design/ Payfit.design}
|
|
99
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-listview-rawlistviewitem--docs unity-components.payfit.io}
|
|
100
|
+
*/
|
|
101
|
+
declare const RawListViewItem: RawListViewItemComponentType;
|
|
102
|
+
export { RawListViewItem };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g, useRef as w, useLayoutEffect as x } from "react";
|
|
3
|
+
import { Icon as v } from "@payfit/unity-icons";
|
|
4
|
+
import { uyTv as h } from "@payfit/unity-themes";
|
|
5
|
+
import { ListBoxItem as I } from "react-aria-components";
|
|
6
|
+
const L = h({
|
|
7
|
+
// add the component styles
|
|
8
|
+
slots: {
|
|
9
|
+
root: ["uy:group uy:focus-visible:outline-0"],
|
|
10
|
+
wrapper: [
|
|
11
|
+
"uy:p-200",
|
|
12
|
+
"uy:flex uy:gap-150",
|
|
13
|
+
"uy:transition-colors",
|
|
14
|
+
"uy:bg-surface-neutral",
|
|
15
|
+
"uy:border-b uy:border-b-solid uy:border-b-border-neutral",
|
|
16
|
+
// Hover when list is static
|
|
17
|
+
"uy:group-hover:bg-surface-neutral-hover uy:group-hover:cursor-pointer",
|
|
18
|
+
// Hover when list is interactive
|
|
19
|
+
"uy:group-data-[hovered=true]:bg-surface-neutral-hover uy:group-data-[hovered=true]:cursor-pointer",
|
|
20
|
+
// Press styles when list is interactive
|
|
21
|
+
"uy:group-data-[pressed=true]:bg-surface-neutral-pressed",
|
|
22
|
+
// Focus styles when list is interactive
|
|
23
|
+
"uy:group-data-[focus-visible=true]:bg-surface-neutral-focus uy:group-data-[focus-visible=true]:outline uy:group-data-[focus-visible=true]:-outline-offset-4 uy:group-data-[focus-visible=true]:outline-utility-focus-ring",
|
|
24
|
+
// disabled Styles when list is interactive
|
|
25
|
+
"uy:group-data-[disabled=true]:bg-surface-neutral-disabled uy:group-data-[disabled=true]:text-content-neutral-disabled uy:group-data-[disabled=true]:cursor-not-allowed",
|
|
26
|
+
// current page styles
|
|
27
|
+
'uy:group-data-[status="active"]:bg-surface-neutral-selected'
|
|
28
|
+
],
|
|
29
|
+
prefix: ["uy:grow-0"],
|
|
30
|
+
content: ["uy:flex-1 uy:typography-body-small"],
|
|
31
|
+
suffix: ["uy:grow-0 uy:flex uy:gap-100"]
|
|
32
|
+
}
|
|
33
|
+
}), V = (n, r) => {
|
|
34
|
+
const o = w(), { children: c, prefix: u, suffix: a, hideDisclosureIndicator: s, ...e } = n, {
|
|
35
|
+
root: d,
|
|
36
|
+
wrapper: f,
|
|
37
|
+
prefix: y,
|
|
38
|
+
suffix: p,
|
|
39
|
+
content: b
|
|
40
|
+
} = L(), m = !!a || !s;
|
|
41
|
+
return x(() => {
|
|
42
|
+
const t = o.current;
|
|
43
|
+
if (!t) return;
|
|
44
|
+
t.querySelector('[data-unity-slot="ListViewItemLabel"]') || !("aria-label" in e) && !("aria-labelledby" in e) && !("textValue" in e) && console.error(
|
|
45
|
+
"ListViewItem: Either a ListViewItemLabel component, an aria-label, aria-labelledby, or textValue prop is required for accessibility. Provide one to ensure screen reader users can identify the item."
|
|
46
|
+
);
|
|
47
|
+
}, [e, o]), /* @__PURE__ */ i(I, { ...e, className: d(), "data-dd-privacy": "mask", children: /* @__PURE__ */ l(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref: (t) => {
|
|
51
|
+
o.current = t, typeof r == "function" ? r(t) : r && (r.current = t);
|
|
52
|
+
},
|
|
53
|
+
"data-unity-slot": "ListViewItem",
|
|
54
|
+
className: f(),
|
|
55
|
+
children: [
|
|
56
|
+
u && /* @__PURE__ */ i("div", { "data-unity-slot": "ListViewItem.prefix", className: y(), children: u }),
|
|
57
|
+
/* @__PURE__ */ i("div", { "data-unity-slot": "ListViewItem.content", className: b(), children: c }),
|
|
58
|
+
m && /* @__PURE__ */ l("div", { "data-unity-slot": "ListViewItem.suffix", className: p(), children: [
|
|
59
|
+
a,
|
|
60
|
+
!s && /* @__PURE__ */ i(
|
|
61
|
+
v,
|
|
62
|
+
{
|
|
63
|
+
src: "CaretRightOutlined",
|
|
64
|
+
role: "presentation",
|
|
65
|
+
size: 20,
|
|
66
|
+
color: e.isDisabled ? "content.neutral.disabled" : "content.neutral.low"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
) });
|
|
73
|
+
}, R = g(
|
|
74
|
+
V
|
|
75
|
+
);
|
|
76
|
+
R.displayName = "RawListViewItem";
|
|
77
|
+
export {
|
|
78
|
+
R as RawListViewItem,
|
|
79
|
+
L as listViewItem
|
|
80
|
+
};
|