@payfit/unity-components 2.0.0 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/alert/Alert.js +41 -29
- package/dist/esm/components/alert/parts/AlertTitle.js +8 -8
- package/dist/esm/components/app-layout/AppLayout.d.ts +2 -0
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +23 -23
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +1 -1
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +9 -9
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +0 -9
- package/dist/esm/components/autocomplete/Autocomplete.js +54 -57
- package/dist/esm/components/autocomplete/parts/AutocompleteItem.js +8 -8
- package/dist/esm/components/avatar/Avatar.variants.js +1 -1
- package/dist/esm/components/avatar/parts/AvatarFallback.js +26 -27
- package/dist/esm/components/badge/Badge.js +1 -1
- package/dist/esm/components/breadcrumbs/Breadcrumbs.variant.js +1 -1
- package/dist/esm/components/button/Button.js +6 -6
- package/dist/esm/components/button/Button.variants.d.ts +1 -0
- package/dist/esm/components/button/Button.variants.js +22 -15
- package/dist/esm/components/card/Card.context.d.ts +5 -0
- package/dist/esm/components/card/Card.context.js +14 -0
- package/dist/esm/components/card/Card.d.ts +210 -0
- package/dist/esm/components/card/Card.js +93 -0
- package/dist/esm/components/card/parts/CardContent.d.ts +37 -0
- package/dist/esm/components/card/parts/CardContent.js +8 -0
- package/dist/esm/components/card/parts/CardTitle.d.ts +55 -0
- package/dist/esm/components/card/parts/CardTitle.js +33 -0
- package/dist/esm/components/checkbox/Checkbox.js +38 -30
- package/dist/esm/components/checkbox/Checkbox.variants.d.ts +9 -9
- package/dist/esm/components/checkbox/Checkbox.variants.js +23 -7
- package/dist/esm/components/checkbox/TanstackCheckbox.d.ts +28 -0
- package/dist/esm/components/checkbox/TanstackCheckbox.js +51 -0
- package/dist/esm/components/checkbox/parts/CheckboxIndicator.js +7 -7
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.d.ts +14 -0
- package/dist/esm/components/checkbox-field/TanstackCheckboxField.js +40 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.d.ts +4 -0
- package/dist/esm/components/checkbox-group/TanstackCheckboxGroup.js +37 -0
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.d.ts +72 -0
- package/dist/esm/components/checkbox-group-field/TanstackCheckGroupField.js +40 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationNavButton.js +1 -1
- package/dist/esm/components/client-side-pagination/parts/RawPaginationLink.js +10 -10
- package/dist/esm/components/collapsible/parts/CollapsibleContent.js +5 -5
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +8 -8
- package/dist/esm/components/data-table/DataTable.d.ts +109 -16
- package/dist/esm/components/data-table/DataTable.js +107 -93
- package/dist/esm/components/data-table/mocks/employee-data.d.ts +1 -0
- package/dist/esm/components/date-calendar/DateCalendar.js +1 -1
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +1 -1
- package/dist/esm/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/esm/components/date-picker/DatePicker.js +59 -50
- package/dist/esm/components/date-picker/TanstackDatePicker.d.ts +22 -0
- package/dist/esm/components/date-picker/TanstackDatePicker.js +53 -0
- package/dist/esm/components/date-picker/parts/DateInput.js +4 -4
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.d.ts +71 -0
- package/dist/esm/components/date-picker-field/TanstackDatePickerField.js +41 -0
- package/dist/esm/components/definition-list/DefinitionList.context.d.ts +19 -0
- package/dist/esm/components/definition-list/DefinitionList.d.ts +24 -0
- package/dist/esm/components/definition-list/parts/DefinitionItem.d.ts +25 -0
- package/dist/esm/components/dialog/Dialog.d.ts +34 -22
- package/dist/esm/components/dialog/Dialog.js +90 -52
- package/dist/esm/components/dialog/parts/DialogActions.js +6 -6
- package/dist/esm/components/dialog/parts/DialogTitle.js +7 -4
- package/dist/esm/components/dialog/test-utils.d.ts +28 -0
- package/dist/esm/components/dialog/test-utils.js +78 -0
- package/dist/esm/components/error-state/ErrorState.js +7 -7
- package/dist/esm/components/filter/Filter.controls.d.ts +192 -0
- package/dist/esm/components/filter/Filter.controls.js +45 -0
- package/dist/esm/components/filter/Filter.d.ts +189 -0
- package/dist/esm/components/filter/Filter.js +147 -0
- package/dist/esm/components/filter/Filter.types.d.ts +121 -0
- package/dist/esm/components/filter/hooks/useFilterIds.d.ts +49 -0
- package/dist/esm/components/filter/hooks/useFilterIds.js +13 -0
- package/dist/esm/components/filter/hooks/useFilterState.d.ts +74 -0
- package/dist/esm/components/filter/hooks/useFilterState.js +23 -0
- package/dist/esm/components/filter/hooks/useFilterValue.d.ts +61 -0
- package/dist/esm/components/filter/hooks/useFilterValue.js +31 -0
- package/dist/esm/components/filter/parts/FilterButton.d.ts +75 -0
- package/dist/esm/components/filter/parts/FilterButton.js +55 -0
- package/dist/esm/components/filter/parts/FilterLabel.d.ts +96 -0
- package/dist/esm/components/filter/parts/FilterLabel.js +57 -0
- package/dist/esm/components/filter/parts/FilterPopover.d.ts +95 -0
- package/dist/esm/components/filter/parts/FilterPopover.js +79 -0
- package/dist/esm/components/filter/utils/value-formatters.d.ts +62 -0
- package/dist/esm/components/filter/utils/value-formatters.js +14 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.d.ts +110 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.js +172 -0
- package/dist/esm/components/filter-toolbar/FilterToolbar.types.d.ts +119 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.d.ts +96 -0
- package/dist/esm/components/filter-toolbar/hooks/use-filter-toolbar-state.js +132 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.d.ts +63 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilter.js +107 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.d.ts +18 -0
- package/dist/esm/components/filter-toolbar/parts/AddFilterItem.js +18 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.d.ts +93 -0
- package/dist/esm/components/filter-toolbar/utils/filter-adapters.js +88 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.d.ts +24 -0
- package/dist/esm/components/filter-toolbar/utils/normalize-filter-value.js +19 -0
- package/dist/esm/components/form/Form.d.ts +2 -0
- package/dist/esm/components/form/TanstackForm.d.ts +24 -0
- package/dist/esm/components/form/TanstackForm.js +29 -0
- package/dist/esm/components/form-field/FormField.d.ts +2 -0
- package/dist/esm/components/form-field/TanstackFormField.context.d.ts +10 -0
- package/dist/esm/components/form-field/TanstackFormField.context.js +14 -0
- package/dist/esm/components/form-field/TanstackFormField.d.ts +49 -0
- package/dist/esm/components/form-field/TanstackFormField.js +46 -0
- package/dist/esm/components/form-field/parts/FormControl.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormFeedbackText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormHelperText.d.ts +2 -0
- package/dist/esm/components/form-field/parts/FormLabel.d.ts +2 -0
- package/dist/esm/components/form-field/parts/RawFormContextualLink.d.ts +2 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.d.ts +12 -0
- package/dist/esm/components/form-field/parts/TanstackFormFeedbackText.js +32 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.d.ts +11 -0
- package/dist/esm/components/form-field/parts/TanstackFormHelperText.js +25 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.d.ts +8 -0
- package/dist/esm/components/form-field/parts/TanstackFormLabel.js +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.d.ts +26 -0
- package/dist/esm/components/form-field/parts/TanstackRawFormContextualLink.js +45 -0
- package/dist/esm/components/icon-button/CircularIconButton.d.ts +9 -9
- package/dist/esm/components/icon-button/CircularIconButton.js +53 -36
- package/dist/esm/components/icon-button/IconButton.variants.d.ts +1 -0
- package/dist/esm/components/icon-button/IconButton.variants.js +44 -28
- package/dist/esm/components/input/Input.js +36 -35
- package/dist/esm/components/input/TanstackInput.d.ts +22 -0
- package/dist/esm/components/input/TanstackInput.js +38 -0
- package/dist/esm/components/label/Label.js +12 -12
- package/dist/esm/components/link/RawLink.js +38 -31
- package/dist/esm/components/list-view/ListView.d.ts +56 -0
- package/dist/esm/components/list-view/ListView.fixtures.d.ts +20 -0
- package/dist/esm/components/list-view/ListView.js +44 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.d.ts +34 -0
- package/dist/esm/components/list-view/parts/ListViewItemLabel.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.d.ts +33 -0
- package/dist/esm/components/list-view/parts/ListViewItemText.js +22 -0
- package/dist/esm/components/list-view/parts/ListViewSection.d.ts +14 -0
- package/dist/esm/components/list-view/parts/ListViewSection.js +21 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.d.ts +102 -0
- package/dist/esm/components/list-view/parts/RawListViewItem.js +80 -0
- package/dist/esm/components/multi-select/MultiSelect.d.ts +5 -7
- package/dist/esm/components/multi-select/MultiSelect.js +199 -176
- package/dist/esm/components/multi-select/MultiselectTypes.d.ts +114 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.d.ts +7 -0
- package/dist/esm/components/multi-select/TanstackMultiSelect.js +41 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.d.ts +2 -0
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +62 -46
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +15 -15
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +45 -12
- package/dist/esm/components/multi-select-field/MultiSelectField.js +56 -66
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.d.ts +92 -0
- package/dist/esm/components/multi-select-field/TanstackMultiSelectField.js +48 -0
- package/dist/esm/components/multi-select-field/test-utils.d.ts +17 -0
- package/dist/esm/components/multi-select-field/test-utils.js +45 -0
- package/dist/esm/components/nav/parts/RawNavItem.js +6 -6
- package/dist/esm/components/navigation-card/NavigationCard.context.d.ts +31 -0
- package/dist/esm/components/navigation-card/NavigationCard.context.js +13 -0
- package/dist/esm/components/navigation-card/NavigationCard.d.ts +46 -0
- package/dist/esm/components/navigation-card/NavigationCard.js +62 -0
- package/dist/esm/components/navigation-card/NavigationCard.types.d.ts +37 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.d.ts +1147 -0
- package/dist/esm/components/navigation-card/NavigationCard.variants.js +164 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.d.ts +39 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardDescription.js +22 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.d.ts +146 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardGroup.js +93 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.d.ts +32 -0
- package/dist/esm/components/navigation-card/parts/NavigationCardLabel.js +24 -0
- package/dist/esm/components/number-field/NumberField.d.ts +2 -0
- package/dist/esm/components/number-field/TanstackNumberField.d.ts +74 -0
- package/dist/esm/components/number-field/TanstackNumberField.js +44 -0
- package/dist/esm/components/number-input/NumberInput.js +31 -29
- package/dist/esm/components/number-input/TanstackNumberInput.d.ts +58 -0
- package/dist/esm/components/number-input/TanstackNumberInput.js +38 -0
- package/dist/esm/components/page/Page.js +12 -11
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +22 -22
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +13 -13
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +10 -10
- package/dist/esm/components/payfit-brand/PayFitBrand.d.ts +4 -0
- package/dist/esm/components/payfit-brand/PayFitBrand.js +30 -22
- package/dist/esm/components/payfit-brand/PayFitPreprod.js +25 -25
- package/dist/esm/components/phone-number/PhoneNumberInput.d.ts +67 -0
- package/dist/esm/components/phone-number/PhoneNumberInput.js +322 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.d.ts +64 -0
- package/dist/esm/components/phone-number/TanstackPhoneNumberInput.js +33 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.d.ts +42 -0
- package/dist/esm/components/phone-number/parts/PhoneNumberItem.js +68 -0
- package/dist/esm/components/phone-number/unknownFlag.svg.js +4 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.d.ts +15 -0
- package/dist/esm/components/phone-number-field/TanstackPhoneNumberField.js +32 -0
- package/dist/esm/components/pill/Pill.d.ts +2 -2
- package/dist/esm/components/pill/Pill.js +8 -8
- package/dist/esm/components/popover/Popover.js +6 -6
- package/dist/esm/components/promo-dialog/PromoDialog.d.ts +149 -0
- package/dist/esm/components/promo-dialog/PromoDialog.js +219 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.d.ts +44 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogActions.js +29 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.d.ts +43 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogContent.js +20 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.d.ts +47 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogHero.js +25 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.d.ts +53 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogSubtitle.js +21 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.d.ts +6 -0
- package/dist/esm/components/promo-dialog/parts/PromoDialogTitle.js +18 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.d.ts +13 -0
- package/dist/esm/components/radio-button-group/TanstackRadioButtonGroup.js +43 -0
- package/dist/esm/components/radio-button-group/parts/RadioButton.d.ts +29 -11
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +53 -51
- package/dist/esm/components/radio-button-group-field/RadioButtonGroupField.d.ts +2 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.d.ts +13 -0
- package/dist/esm/components/radio-button-group-field/TanstackRadioButtonGroupField.js +38 -0
- package/dist/esm/components/search/Search.js +46 -46
- package/dist/esm/components/segmented-button-group/parts/ToggleButton.js +5 -5
- package/dist/esm/components/select/Select.d.ts +5 -4
- package/dist/esm/components/select/Select.js +53 -45
- package/dist/esm/components/select/TanstackSelect.d.ts +80 -0
- package/dist/esm/components/select/TanstackSelect.js +34 -0
- package/dist/esm/components/select/parts/SearchInput.d.ts +4 -1
- package/dist/esm/components/select/parts/SearchInput.js +49 -31
- package/dist/esm/components/select/parts/SelectButton.js +19 -17
- package/dist/esm/components/select-field/SelectField.d.ts +2 -0
- package/dist/esm/components/select-field/SelectField.js +8 -9
- package/dist/esm/components/select-field/TanstackSelectField.d.ts +124 -0
- package/dist/esm/components/select-field/TanstackSelectField.js +44 -0
- package/dist/esm/components/select-list/SelectList.d.ts +95 -0
- package/dist/esm/components/select-list/SelectList.js +79 -0
- package/dist/esm/components/select-list/SelectList.types.d.ts +29 -0
- package/dist/esm/components/select-list/constants.d.ts +36 -0
- package/dist/esm/components/select-list/constants.js +29 -0
- package/dist/esm/components/select-list/helpers.d.ts +42 -0
- package/dist/esm/components/select-list/helpers.js +48 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useControlledSelection.js +16 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.d.ts +23 -0
- package/dist/esm/components/select-list/hooks/useSelectedFirstSorting.js +31 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.d.ts +8 -0
- package/dist/esm/components/select-list/parts/SelectListEmptyState.js +25 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.d.ts +118 -0
- package/dist/esm/components/select-list/parts/SelectListOptGroup.js +28 -0
- package/dist/esm/components/select-list/parts/SelectListOption.d.ts +24 -0
- package/dist/esm/components/select-list/parts/SelectListOption.js +72 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.d.ts +2 -0
- package/dist/esm/components/select-list/parts/SelectListSearchInput.js +43 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.d.ts +54 -0
- package/dist/esm/components/select-list/parts/SelectedItemsSection.js +35 -0
- package/dist/esm/components/select-list/utils/partition.d.ts +13 -0
- package/dist/esm/components/select-list/utils/partition.js +9 -0
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.context.d.ts +1 -5
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.d.ts +6 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +23 -23
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.d.ts +27 -0
- package/dist/esm/components/selectable-button-group/TanstackSelectableButtonGroup.js +34 -0
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.d.ts +1 -16
- package/dist/esm/components/selectable-button-group/parts/SelectableButton.js +56 -57
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.d.ts +81 -0
- package/dist/esm/components/selectable-button-group-field/TanstackSelectableButtonGroupField.js +47 -0
- package/dist/esm/components/selectable-card/internals/Description.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/SelectableCardCheckboxGroup.js +1 -1
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.d.ts +26 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-checkbox-group/parts/SelectableCardCheckbox.js +24 -24
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.d.ts +2 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.js +12 -14
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.d.ts +28 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.js +32 -0
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js +14 -13
- package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.js +27 -25
- package/dist/esm/components/selectable-card/selectableCard.variant.js +5 -5
- package/dist/esm/components/selectable-card-checkbox-group-field/SelectableCardCheckboxGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-checkbox-group-field/TanstackSelectableCardCheckboxGroupField.js +38 -0
- package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.d.ts +2 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.d.ts +10 -0
- package/dist/esm/components/selectable-card-radio-group-field/TanstackSelectableCardRadioGroupField.js +38 -0
- package/dist/esm/components/table/Table.context.d.ts +5 -0
- package/dist/esm/components/table/Table.context.js +14 -13
- package/dist/esm/components/table/Table.d.ts +93 -0
- package/dist/esm/components/table/Table.js +135 -107
- package/dist/esm/components/table/parts/TableBody.js +83 -21
- package/dist/esm/components/table/parts/TableEmptyState.js +6 -6
- package/dist/esm/components/table/parts/TableHeader.js +1 -1
- package/dist/esm/components/table/parts/TablePagination.js +1 -1
- package/dist/esm/components/table/parts/TableRow.js +1 -0
- package/dist/esm/components/tabs/Tabs.variant.d.ts +0 -6
- package/dist/esm/components/tabs/Tabs.variant.js +11 -12
- package/dist/esm/components/task-menu/parts/RawSubTask.js +26 -26
- package/dist/esm/components/task-menu/parts/RawTask.js +32 -28
- package/dist/esm/components/task-menu/parts/TaskGroup.js +30 -26
- package/dist/esm/components/task-menu/parts/task.variants.js +4 -2
- package/dist/esm/components/text/Text.d.ts +11 -1
- package/dist/esm/components/text/Text.js +41 -31
- package/dist/esm/components/text/Text.variants.d.ts +12 -0
- package/dist/esm/components/text/Text.variants.js +4 -0
- package/dist/esm/components/text-area/TanstackTextArea.d.ts +21 -0
- package/dist/esm/components/text-area/TanstackTextArea.js +35 -0
- package/dist/esm/components/text-area/TextArea.js +31 -29
- package/dist/esm/components/text-field/TanstackTextField.d.ts +79 -0
- package/dist/esm/components/text-field/TanstackTextField.js +60 -0
- package/dist/esm/components/text-field/TextField.d.ts +2 -0
- package/dist/esm/components/toast/UnityToast.js +5 -5
- package/dist/esm/components/toast/test-utils.d.ts +36 -0
- package/dist/esm/components/toast/test-utils.js +118 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.d.ts +46 -0
- package/dist/esm/components/toggle-switch/TanstackToggleSwitch.js +25 -0
- package/dist/esm/components/toggle-switch/ToggleSwitch.d.ts +21 -9
- package/dist/esm/components/toggle-switch/ToggleSwitch.js +71 -32
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.d.ts +11 -0
- package/dist/esm/components/toggle-switch-field/TanstackToggleSwitchField.js +34 -0
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.d.ts +57 -0
- package/dist/esm/components/toggle-switch-group/TanstackToggleSwitchGroup.js +23 -0
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +1 -1
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.d.ts +19 -0
- package/dist/esm/components/toggle-switch-group-field/TanstackToggleSwitchGroupField.js +50 -0
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -0
- package/dist/esm/docs/{table → examples/data}/mocks/employee-columns.d.ts +1 -1
- package/dist/esm/hooks/tanstack-form-context.d.ts +1 -0
- package/dist/esm/hooks/tanstack-form-context.js +8 -0
- package/dist/esm/hooks/use-form.d.ts +2 -0
- package/dist/esm/hooks/use-has-scroll.d.ts +71 -0
- package/dist/esm/hooks/use-has-scroll.js +75 -0
- package/dist/esm/hooks/use-tanstack-form.d.ts +369 -0
- package/dist/esm/hooks/use-tanstack-form.js +209 -0
- package/dist/esm/index.d.ts +44 -20
- package/dist/esm/index.js +457 -394
- package/dist/esm/index.storybook-testing.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +6 -1
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/TanstackFormContextualLink.d.ts +43 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.d.ts +34 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/ListView.js +25 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/list-view/parts/ListViewItem.js +32 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.d.ts +73 -0
- package/dist/esm/integrations/tanstack-router/components/navigation-card/NavigationCard.js +37 -0
- package/dist/esm/integrations/tanstack-router/index.d.ts +3 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +1 -1
- package/dist/esm/integrations/tanstack-router.js +32 -26
- package/dist/esm/mocks/employees.d.ts +1 -5
- package/dist/esm/storybook-testing.js +8 -2
- package/dist/esm/storybook-utilities/previewTransform.d.ts +1 -0
- package/dist/esm/utils/scroll-detection.d.ts +77 -0
- package/dist/esm/utils/scroll-detection.js +33 -0
- package/dist/esm/utils/spacing.d.ts +63 -0
- package/dist/esm/utils/spacing.js +15 -0
- package/i18n/en-GB.json +21 -8
- package/i18n/es-ES.json +23 -10
- package/i18n/fr-FR.json +24 -11
- package/package.json +41 -42
- package/dist/esm/components/multi-select/Multiselect.types.d.ts +0 -109
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.d.ts +0 -6
- package/dist/esm/integrations/react-router/v5/UnityReactRouterV5Provider.js +0 -28
- package/dist/esm/integrations/react-router/v5/index.d.ts +0 -1
- package/dist/esm/integrations/react-router/v5.js +0 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { useFieldContext as f } from "../../hooks/tanstack-form-context.js";
|
|
4
|
+
import { useFieldA11yContext as I } from "../form-field/TanstackFormField.context.js";
|
|
5
|
+
import { Input as b } from "./Input.js";
|
|
6
|
+
const h = p(
|
|
7
|
+
({ onClearButtonPress: r, onBlur: i, onChange: n, isReadOnly: l, isDisabled: d, ...s }, u) => {
|
|
8
|
+
const e = f(), t = I(), m = e.state.meta.isTouched && !e.state.meta.isValid, o = [t.helperTextId, t.feedbackTextId].filter(Boolean).join(" ");
|
|
9
|
+
return /* @__PURE__ */ c(
|
|
10
|
+
b,
|
|
11
|
+
{
|
|
12
|
+
...s,
|
|
13
|
+
ref: u,
|
|
14
|
+
id: t.inputId,
|
|
15
|
+
value: e.state.value ?? "",
|
|
16
|
+
onChange: (a) => {
|
|
17
|
+
e.handleChange(a.target.value), n?.(a);
|
|
18
|
+
},
|
|
19
|
+
onBlur: (a) => {
|
|
20
|
+
e.handleBlur(), i?.(a);
|
|
21
|
+
},
|
|
22
|
+
onClearButtonPress: () => {
|
|
23
|
+
e.setValue(""), r?.();
|
|
24
|
+
},
|
|
25
|
+
isReadOnly: l,
|
|
26
|
+
isDisabled: d,
|
|
27
|
+
isInvalid: m,
|
|
28
|
+
"aria-labelledby": t.labelId,
|
|
29
|
+
"aria-describedby": o.length > 0 ? o : void 0,
|
|
30
|
+
"aria-details": t.contextualLinkId
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
h.displayName = "TanstackInput";
|
|
36
|
+
export {
|
|
37
|
+
h as TanstackInput
|
|
38
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c } from "react";
|
|
3
3
|
import { uyTv as b } from "@payfit/unity-themes";
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import { useSlottedContext as
|
|
6
|
-
import { useIntl as
|
|
7
|
-
const
|
|
4
|
+
import { mergeProps as g } from "react-aria";
|
|
5
|
+
import { useSlottedContext as f, InputContext as h, Label as N } from "react-aria-components";
|
|
6
|
+
import { useIntl as q } from "react-intl";
|
|
7
|
+
const x = b({
|
|
8
8
|
slots: {
|
|
9
|
-
base: "uy:typography-body-strong uy:text-content-form-enabled uy:
|
|
10
|
-
asterisk: "uy:text-content-danger",
|
|
11
|
-
optionalTag: "uy:typography-body"
|
|
9
|
+
base: "uy:typography-body-strong uy:text-content-form-enabled uy:leading-[1lh]",
|
|
10
|
+
asterisk: "uy:text-content-danger uy:inline-block uy:ml-25",
|
|
11
|
+
optionalTag: "uy:typography-body uy:inline-block uy:ml-25"
|
|
12
12
|
},
|
|
13
13
|
variants: {
|
|
14
14
|
variant: {
|
|
@@ -25,21 +25,21 @@ const q = b({
|
|
|
25
25
|
}
|
|
26
26
|
}), v = c(
|
|
27
27
|
({ children: n, ...a }, l) => {
|
|
28
|
-
const e =
|
|
28
|
+
const e = q(), i = f(h), d = g(
|
|
29
29
|
{ isRequired: i?.["aria-required"] },
|
|
30
30
|
a
|
|
31
31
|
), {
|
|
32
32
|
isRequired: t = !1,
|
|
33
33
|
requiredVariant: o = "required",
|
|
34
|
-
...
|
|
35
|
-
} =
|
|
34
|
+
...y
|
|
35
|
+
} = d, { base: p, asterisk: m, optionalTag: u } = x();
|
|
36
36
|
return /* @__PURE__ */ s(
|
|
37
37
|
N,
|
|
38
38
|
{
|
|
39
39
|
"data-dd-privacy": "allow",
|
|
40
|
-
...
|
|
40
|
+
...y,
|
|
41
41
|
ref: l,
|
|
42
|
-
className:
|
|
42
|
+
className: p({ className: a.className }),
|
|
43
43
|
children: [
|
|
44
44
|
n,
|
|
45
45
|
o === "required" && t && /* @__PURE__ */ s("span", { className: m(), children: [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as h, jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as w } from "react";
|
|
3
3
|
import { IconSprite as k } from "@payfit/unity-icons";
|
|
4
4
|
import { uyTv as D } from "@payfit/unity-themes";
|
|
5
|
-
import { Link as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
import { isExternalUrl as
|
|
8
|
-
const
|
|
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({
|
|
9
9
|
slots: {
|
|
10
10
|
base: [
|
|
11
11
|
"uy:rounded-50 uy:underline uy:transition-colors uy:underline-offset-3",
|
|
@@ -21,7 +21,7 @@ const N = D({
|
|
|
21
21
|
icon: "uy:align-top"
|
|
22
22
|
},
|
|
23
23
|
standalone: {
|
|
24
|
-
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",
|
|
25
25
|
icon: "uy:self-center"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
@@ -68,6 +68,13 @@ const N = D({
|
|
|
68
68
|
class: {
|
|
69
69
|
base: "uy:data-[disabled]:text-content-neutral-lowest-disabled"
|
|
70
70
|
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
size: "inherit",
|
|
74
|
+
variant: "inline",
|
|
75
|
+
class: {
|
|
76
|
+
base: "uy:text-(length:inherit)"
|
|
77
|
+
}
|
|
71
78
|
}
|
|
72
79
|
],
|
|
73
80
|
defaultVariants: {
|
|
@@ -76,58 +83,58 @@ const N = D({
|
|
|
76
83
|
isDisabled: !1,
|
|
77
84
|
size: "inherit"
|
|
78
85
|
}
|
|
79
|
-
}),
|
|
86
|
+
}), N = w(
|
|
80
87
|
({
|
|
81
88
|
href: a,
|
|
82
89
|
children: s,
|
|
83
|
-
variant:
|
|
84
|
-
color:
|
|
90
|
+
variant: u = "inline",
|
|
91
|
+
color: l = "primary",
|
|
85
92
|
isDisabled: o = !1,
|
|
86
93
|
isExact: c = !1,
|
|
87
94
|
isCurrent: y = void 0,
|
|
88
95
|
isExternal: d,
|
|
89
|
-
maxCharactersTruncation:
|
|
90
|
-
size:
|
|
96
|
+
maxCharactersTruncation: i,
|
|
97
|
+
size: p = "inherit",
|
|
91
98
|
...e
|
|
92
|
-
},
|
|
93
|
-
const
|
|
94
|
-
variant:
|
|
95
|
-
color:
|
|
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,
|
|
96
103
|
isDisabled: o,
|
|
97
|
-
size:
|
|
98
|
-
isTruncated: !!
|
|
99
|
-
}),
|
|
104
|
+
size: p,
|
|
105
|
+
isTruncated: !!i
|
|
106
|
+
}), x = !!i, f = r && {
|
|
100
107
|
...n !== void 0 && {
|
|
101
108
|
"data-current": n,
|
|
102
109
|
"aria-current": n ? "page" : void 0
|
|
103
110
|
}
|
|
104
111
|
};
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
|
|
112
|
+
return /* @__PURE__ */ h(
|
|
113
|
+
z,
|
|
107
114
|
{
|
|
108
115
|
"data-dd-privacy": "allow",
|
|
109
116
|
...e,
|
|
110
117
|
href: a,
|
|
111
|
-
ref:
|
|
112
|
-
style:
|
|
113
|
-
"--uy-link-max-w": `${
|
|
118
|
+
ref: b,
|
|
119
|
+
style: x ? {
|
|
120
|
+
"--uy-link-max-w": `${i}ch`
|
|
114
121
|
} : {},
|
|
115
122
|
className: m(),
|
|
116
123
|
isDisabled: o,
|
|
117
124
|
target: t ? "_blank" : e.target,
|
|
118
125
|
rel: t && !e.rel ? "noopener noreferrer" : e.rel,
|
|
119
|
-
...
|
|
126
|
+
...f,
|
|
120
127
|
children: [
|
|
121
128
|
s,
|
|
122
|
-
t && /* @__PURE__ */
|
|
129
|
+
t && /* @__PURE__ */ g(
|
|
123
130
|
k,
|
|
124
131
|
{
|
|
125
132
|
src: "ArrowSquareOutOutlined",
|
|
126
133
|
color: "currentColor",
|
|
127
|
-
width: "1.
|
|
128
|
-
height: "1.
|
|
134
|
+
width: "1.25em",
|
|
135
|
+
height: "1.25em",
|
|
129
136
|
role: "presentation",
|
|
130
|
-
className:
|
|
137
|
+
className: v()
|
|
131
138
|
}
|
|
132
139
|
)
|
|
133
140
|
]
|
|
@@ -135,8 +142,8 @@ const N = D({
|
|
|
135
142
|
);
|
|
136
143
|
}
|
|
137
144
|
);
|
|
138
|
-
|
|
145
|
+
N.displayName = "Link";
|
|
139
146
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
N as RawLink,
|
|
148
|
+
L as link
|
|
142
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 };
|