@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
package/dist/esm/components/selectable-card/selectable-card-radio-group/SelectableCardRadioGroup.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { RadioGroup as
|
|
4
|
-
import { useBreakpointListener as
|
|
5
|
-
const
|
|
6
|
-
const o =
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { RadioGroup as s } from "react-aria-components";
|
|
4
|
+
import { useBreakpointListener as m } from "../../../hooks/use-breakpoint-listener.js";
|
|
5
|
+
const p = l(({ children: r, value: e, ...i }, t) => {
|
|
6
|
+
const o = m();
|
|
7
|
+
return /* @__PURE__ */ a(
|
|
8
|
+
s,
|
|
9
9
|
{
|
|
10
|
-
...
|
|
10
|
+
...i,
|
|
11
11
|
orientation: o === "xs" || o === "sm" ? "vertical" : "horizontal",
|
|
12
12
|
value: e,
|
|
13
|
-
onBlur: t,
|
|
14
|
-
onChange: i,
|
|
15
13
|
className: "uy:flex uy:md:flex-row uy:sm:flex-col uy:gap-150",
|
|
16
|
-
ref:
|
|
14
|
+
ref: t,
|
|
17
15
|
children: r
|
|
18
16
|
}
|
|
19
17
|
);
|
|
20
18
|
});
|
|
21
|
-
|
|
19
|
+
p.displayName = "SelectableCardRadioGroup";
|
|
22
20
|
export {
|
|
23
|
-
|
|
21
|
+
p as SelectableCardRadioGroup
|
|
24
22
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SelectableCardRadioGroupProps } from './SelectableCardRadioGroup.js';
|
|
2
|
+
export type TanstackSelectableCardRadioGroupProps = Omit<SelectableCardRadioGroupProps, 'value' | 'defaultValue' | 'isInvalid'>;
|
|
3
|
+
/**
|
|
4
|
+
* `TanstackSelectableCardRadioGroup` is a controlled radio group wired to the TanStack Form field context. It is based on the Unity `SelectableCardRadioGroup` component.
|
|
5
|
+
*
|
|
6
|
+
* The TanstackSelectableCardRadioGroup component adapts to smaller screen sizes, with cards stacking vertically to maintain usability on mobile devices.
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { useTanstackUnityForm } from '@payfit/unity-components'
|
|
10
|
+
* function ExampleField() {
|
|
11
|
+
* const form = useTanstackUnityForm({ validators: {} })
|
|
12
|
+
* return (
|
|
13
|
+
* <form.Form>
|
|
14
|
+
* <form.AppField name="option">
|
|
15
|
+
* {(field) => (
|
|
16
|
+
* <field.SelectableCardRadioGroup>
|
|
17
|
+
* <SelectableCardRadio value="option1" title="Option 1" />
|
|
18
|
+
* <SelectableCardRadio value="option2" title="Option 2" />
|
|
19
|
+
* </field.SelectableCardRadioGroup>
|
|
20
|
+
* )}
|
|
21
|
+
* </form.AppField>
|
|
22
|
+
* </form.Form>
|
|
23
|
+
* )
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const TanstackSelectableCardRadioGroup: import('react').ForwardRefExoticComponent<TanstackSelectableCardRadioGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export { TanstackSelectableCardRadioGroup };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { useFieldContext as p } from "../../../hooks/tanstack-form-context.js";
|
|
4
|
+
import { useFieldA11yContext as u } from "../../form-field/TanstackFormField.context.js";
|
|
5
|
+
import { SelectableCardRadioGroup as b } from "./SelectableCardRadioGroup.js";
|
|
6
|
+
const f = m(({ onBlur: i, onChange: r, children: d, ...l }, n) => {
|
|
7
|
+
const e = p(), a = u(), s = e.state.meta.isTouched && !e.state.meta.isValid, o = [a.helperTextId, a.feedbackTextId].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ c(
|
|
9
|
+
b,
|
|
10
|
+
{
|
|
11
|
+
...l,
|
|
12
|
+
ref: n,
|
|
13
|
+
id: a.inputId,
|
|
14
|
+
value: e.state.value || void 0,
|
|
15
|
+
onChange: (t) => {
|
|
16
|
+
e.handleChange(t), r?.(t);
|
|
17
|
+
},
|
|
18
|
+
onBlur: (t) => {
|
|
19
|
+
e.handleBlur(), i?.(t);
|
|
20
|
+
},
|
|
21
|
+
isInvalid: s,
|
|
22
|
+
"aria-labelledby": a.labelId,
|
|
23
|
+
"aria-describedby": o.length > 0 ? o : void 0,
|
|
24
|
+
"aria-details": a.contextualLinkId,
|
|
25
|
+
children: d
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
f.displayName = "TanstackSelectableCardRadioGroup";
|
|
30
|
+
export {
|
|
31
|
+
f as TanstackSelectableCardRadioGroup
|
|
32
|
+
};
|
package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/RadioIndicator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { uyTv as
|
|
3
|
-
const t =
|
|
1
|
+
import { jsx as r, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { uyTv as i } from "@payfit/unity-themes";
|
|
3
|
+
const t = i({
|
|
4
4
|
base: "",
|
|
5
5
|
variants: {
|
|
6
6
|
isSelected: {
|
|
@@ -8,10 +8,11 @@ const t = e({
|
|
|
8
8
|
"uy:stroke-border-form-enabled",
|
|
9
9
|
"uy:hover:stroke-border-form-hover",
|
|
10
10
|
"uy:focus-visible:stroke-border-form-focus"
|
|
11
|
-
]
|
|
11
|
+
],
|
|
12
|
+
true: ["uy:text-surface-form-active"]
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
}), d = ({ isSelected:
|
|
15
|
+
}), d = ({ isSelected: o }) => o ? /* @__PURE__ */ r(
|
|
15
16
|
"svg",
|
|
16
17
|
{
|
|
17
18
|
width: "20",
|
|
@@ -19,28 +20,28 @@ const t = e({
|
|
|
19
20
|
viewBox: "0 0 20 20",
|
|
20
21
|
fill: "none",
|
|
21
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ e("g", { id: "Radio input", className: t({ isSelected: o }), children: [
|
|
24
|
+
/* @__PURE__ */ r(
|
|
24
25
|
"path",
|
|
25
26
|
{
|
|
26
27
|
id: "Background",
|
|
27
28
|
d: "M2.625 10C2.625 5.9269 5.9269 2.625 10 2.625C14.0731 2.625 17.375 5.9269 17.375 10C17.375 14.0731 14.0731 17.375 10 17.375C5.9269 17.375 2.625 14.0731 2.625 10Z",
|
|
28
29
|
fill: "white",
|
|
29
|
-
stroke: "
|
|
30
|
+
stroke: "currentColor",
|
|
30
31
|
strokeWidth: "1.25"
|
|
31
32
|
}
|
|
32
33
|
),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ r(
|
|
34
35
|
"path",
|
|
35
36
|
{
|
|
36
37
|
id: "Foreground",
|
|
37
38
|
d: "M5 10C5 7.23858 7.23858 5 10 5C12.7614 5 15 7.23858 15 10C15 12.7614 12.7614 15 10 15C7.23858 15 5 12.7614 5 10Z",
|
|
38
|
-
fill: "
|
|
39
|
+
fill: "currentColor"
|
|
39
40
|
}
|
|
40
41
|
)
|
|
41
42
|
] })
|
|
42
43
|
}
|
|
43
|
-
) : /* @__PURE__ */
|
|
44
|
+
) : /* @__PURE__ */ r(
|
|
44
45
|
"svg",
|
|
45
46
|
{
|
|
46
47
|
width: "20",
|
|
@@ -48,10 +49,10 @@ const t = e({
|
|
|
48
49
|
viewBox: "0 0 20 20",
|
|
49
50
|
fill: "none",
|
|
50
51
|
xmlns: "http://www.w3.org/2000/svg",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ r("g", { id: "Radio input", children: /* @__PURE__ */ r(
|
|
52
53
|
"path",
|
|
53
54
|
{
|
|
54
|
-
className: t({ isSelected:
|
|
55
|
+
className: t({ isSelected: o }),
|
|
55
56
|
id: "Background",
|
|
56
57
|
d: "M2.625 10C2.625 5.9269 5.9269 2.625 10 2.625C14.0731 2.625 17.375 5.9269 17.375 10C17.375 14.0731 14.0731 17.375 10 17.375C5.9269 17.375 2.625 14.0731 2.625 10Z",
|
|
57
58
|
fill: "white",
|
package/dist/esm/components/selectable-card/selectable-card-radio-group/parts/SelectableCardRadio.js
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as r, jsxs as a, Fragment as n } from "react/jsx-runtime";
|
|
2
|
+
import { useId as s } from "react";
|
|
3
|
+
import { Radio as p } from "react-aria-components";
|
|
4
|
+
import { Text as f } from "../../../text/Text.js";
|
|
5
|
+
import { Content as b } from "../../internals/Content.js";
|
|
6
|
+
import { Description as h } from "../../internals/Description.js";
|
|
7
|
+
import { Illustration as I } from "../../internals/Illustration.js";
|
|
8
|
+
import { SelectedIndicator as x } from "../../internals/SelectedIndicator.js";
|
|
9
|
+
import { selectableCard as C } from "../../selectableCard.variant.js";
|
|
10
|
+
import R from "./RadioIndicator.js";
|
|
11
|
+
const S = ({
|
|
12
|
+
title: d,
|
|
13
|
+
description: o,
|
|
13
14
|
illustration: t,
|
|
14
|
-
...
|
|
15
|
+
...l
|
|
15
16
|
}) => {
|
|
16
|
-
const { base:
|
|
17
|
+
const m = s(), { base: c } = C(), i = `selectable-card-radio-${m}__title`;
|
|
17
18
|
return /* @__PURE__ */ r(
|
|
18
|
-
|
|
19
|
+
p,
|
|
19
20
|
{
|
|
20
|
-
className: ({ isFocusVisible:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
/* @__PURE__ */ r(
|
|
27
|
-
|
|
21
|
+
className: ({ isFocusVisible: e }) => c({ isFocusVisible: e }),
|
|
22
|
+
"aria-labelledby": i,
|
|
23
|
+
...l,
|
|
24
|
+
children: ({ isSelected: e }) => /* @__PURE__ */ a(n, { children: [
|
|
25
|
+
/* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(R, { isSelected: e }) }),
|
|
26
|
+
/* @__PURE__ */ a(b, { children: [
|
|
27
|
+
t && /* @__PURE__ */ r(I, { children: t }),
|
|
28
|
+
/* @__PURE__ */ r(f, { asElement: "h3", variant: "bodyLargeStrong", id: i, children: d }),
|
|
29
|
+
o && /* @__PURE__ */ r(h, { children: o })
|
|
28
30
|
] })
|
|
29
31
|
] })
|
|
30
32
|
}
|
|
31
33
|
);
|
|
32
34
|
};
|
|
33
|
-
|
|
35
|
+
S.displayName = "SelectableCardRadio";
|
|
34
36
|
export {
|
|
35
|
-
|
|
37
|
+
S as SelectableCardRadio
|
|
36
38
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { uyTv as
|
|
2
|
-
const
|
|
1
|
+
import { uyTv as e } from "@payfit/unity-themes";
|
|
2
|
+
const u = e({
|
|
3
3
|
slots: {
|
|
4
4
|
base: [
|
|
5
5
|
"uy:group",
|
|
6
6
|
"uy:flex uy:flex-row uy:items-start uy:basis-0 uy:grow uy:cursor-pointer",
|
|
7
|
-
"uy:border uy:border-solid uy:rounded-200 uy:border-border-form-enabled",
|
|
7
|
+
"uy:border uy:border-solid uy:rounded-200 uy:border-border-form-enabled uy:m-px",
|
|
8
8
|
"uy:text-content-form-enabled",
|
|
9
9
|
"uy:bg-surface-form-enabled",
|
|
10
10
|
"uy:hover:border-border-form-hover",
|
|
11
|
-
"uy:data-[selected]:border-border-form-active",
|
|
11
|
+
"uy:data-[selected=true]:border-border-form-active uy:data-[selected=true]:border-2 uy:data-[selected=true]:m-0",
|
|
12
12
|
"uy:data-[invalid]:border-border-form-error uy:data-[invalid]:bg-surface-form-error",
|
|
13
13
|
"uy:focus-visible:outline-2 uy:focus-visible:outline-solid uy:focus-visible:outline-offset-2 uy:focus-visible:outline-utility-focus-ring"
|
|
14
14
|
]
|
|
@@ -20,5 +20,5 @@ const o = r({
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
u as selectableCard
|
|
24
24
|
};
|
|
@@ -26,6 +26,8 @@ export interface SelectableCardCheckboxGroupFieldProps<TFieldValues extends Fiel
|
|
|
26
26
|
* ```
|
|
27
27
|
* @see {@link SelectableCardCheckboxGroupFieldProps} for all available props
|
|
28
28
|
* @remarks [API Docs](https://unity-components.payfit.io/?path=/docs/forms-selectablecard-selectablecardradiogroupfield--docs) • [Design Docs](https://www.payfit.design/24f360409/p/05fc26-selectable-card)
|
|
29
|
+
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
|
|
30
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
|
|
29
31
|
*/
|
|
30
32
|
declare const SelectableCardCheckboxGroupField: import('react').ForwardRefExoticComponent<SelectableCardCheckboxGroupFieldProps<FieldValues, string> & import('react').RefAttributes<HTMLDivElement>>;
|
|
31
33
|
export { SelectableCardCheckboxGroupField };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { LabelProps } from '../label/Label.js';
|
|
3
|
+
export interface TanstackSelectableCardCheckboxGroupFieldProps extends PropsWithChildren<Pick<LabelProps, 'isRequired' | 'requiredVariant'>> {
|
|
4
|
+
/** The label for the checkbox group. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Helper text to display below the checkbox group. */
|
|
7
|
+
helperText?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const TanstackSelectableCardCheckboxGroupField: import('react').ForwardRefExoticComponent<TanstackSelectableCardCheckboxGroupFieldProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { TanstackSelectableCardCheckboxGroupField };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { TanstackFormFeedbackText as n } from "../form-field/parts/TanstackFormFeedbackText.js";
|
|
4
|
+
import { TanstackFormHelperText as p } from "../form-field/parts/TanstackFormHelperText.js";
|
|
5
|
+
import { TanstackFormLabel as s } from "../form-field/parts/TanstackFormLabel.js";
|
|
6
|
+
import { TanstackFormField as k } from "../form-field/TanstackFormField.js";
|
|
7
|
+
import { TanstackSelectableCardCheckboxGroup as f } from "../selectable-card/selectable-card-checkbox-group/TanstackSelectableCardCheckboxGroup.js";
|
|
8
|
+
function b({
|
|
9
|
+
children: o,
|
|
10
|
+
isRequired: c,
|
|
11
|
+
requiredVariant: t,
|
|
12
|
+
label: l,
|
|
13
|
+
helperText: r,
|
|
14
|
+
...m
|
|
15
|
+
}, i) {
|
|
16
|
+
return /* @__PURE__ */ a(k, { children: [
|
|
17
|
+
/* @__PURE__ */ a("div", { className: "uy:flex uy:flex-col uy:gap-50", children: [
|
|
18
|
+
/* @__PURE__ */ e(
|
|
19
|
+
s,
|
|
20
|
+
{
|
|
21
|
+
requiredVariant: t,
|
|
22
|
+
isRequired: c,
|
|
23
|
+
children: l
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
r && /* @__PURE__ */ e(p, { children: r })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ e(f, { ref: i, ...m, children: o }),
|
|
29
|
+
/* @__PURE__ */ e(n, {})
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
const x = d(
|
|
33
|
+
b
|
|
34
|
+
);
|
|
35
|
+
x.displayName = "TanstackSelectableCardCheckboxGroupField";
|
|
36
|
+
export {
|
|
37
|
+
x as TanstackSelectableCardCheckboxGroupField
|
|
38
|
+
};
|
package/dist/esm/components/selectable-card-radio-group-field/SelectableCardRadioGroupField.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface SelectableCardRadioGroupFieldProps<TFieldValues extends FieldVa
|
|
|
26
26
|
* ```
|
|
27
27
|
* @see {@link SelectableCardRadioGroupFieldProps} for all available props
|
|
28
28
|
* @remarks [API Docs](https://unity-components.payfit.io/?path=/docs/forms-selectablecard-selectablecardcheckboxgroupfield--docs) • [Design Docs](https://www.payfit.design/24f360409/p/05fc26-selectable-card)
|
|
29
|
+
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
|
|
30
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
|
|
29
31
|
*/
|
|
30
32
|
declare const SelectableCardRadioGroupField: import('react').ForwardRefExoticComponent<SelectableCardRadioGroupFieldProps<FieldValues, string> & import('react').RefAttributes<HTMLDivElement>>;
|
|
31
33
|
export { SelectableCardRadioGroupField };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { LabelProps } from '../label/Label.js';
|
|
3
|
+
export interface TanstackSelectableCardRadioGroupFieldProps extends PropsWithChildren<Pick<LabelProps, 'isRequired' | 'requiredVariant'>> {
|
|
4
|
+
/** The label for the radio button group. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Helper text to display below the radio button group. */
|
|
7
|
+
helperText?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const TanstackSelectableCardRadioGroupField: import('react').ForwardRefExoticComponent<TanstackSelectableCardRadioGroupFieldProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { TanstackSelectableCardRadioGroupField };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as e, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { TanstackFormFeedbackText as n } from "../form-field/parts/TanstackFormFeedbackText.js";
|
|
4
|
+
import { TanstackFormHelperText as p } from "../form-field/parts/TanstackFormHelperText.js";
|
|
5
|
+
import { TanstackFormLabel as s } from "../form-field/parts/TanstackFormLabel.js";
|
|
6
|
+
import { TanstackFormField as f } from "../form-field/TanstackFormField.js";
|
|
7
|
+
import { TanstackSelectableCardRadioGroup as k } from "../selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.js";
|
|
8
|
+
function u({
|
|
9
|
+
children: o,
|
|
10
|
+
isRequired: t,
|
|
11
|
+
requiredVariant: l,
|
|
12
|
+
label: i,
|
|
13
|
+
helperText: r,
|
|
14
|
+
...c
|
|
15
|
+
}, m) {
|
|
16
|
+
return /* @__PURE__ */ e(f, { children: [
|
|
17
|
+
/* @__PURE__ */ e("div", { className: "uy:flex uy:flex-col uy:gap-50", children: [
|
|
18
|
+
/* @__PURE__ */ a(
|
|
19
|
+
s,
|
|
20
|
+
{
|
|
21
|
+
requiredVariant: l,
|
|
22
|
+
isRequired: t,
|
|
23
|
+
children: i
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
r && /* @__PURE__ */ a(p, { children: r })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ a(k, { ref: m, ...c, children: o }),
|
|
29
|
+
/* @__PURE__ */ a(n, {})
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
const F = d(
|
|
33
|
+
u
|
|
34
|
+
);
|
|
35
|
+
F.displayName = "TanstackSelectableCardRadioGroupField";
|
|
36
|
+
export {
|
|
37
|
+
F as TanstackSelectableCardRadioGroupField
|
|
38
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren } from 'react';
|
|
2
|
+
import { Virtualizer } from '@tanstack/react-virtual';
|
|
2
3
|
import { CellPosition } from './hooks/useTableKeyboardNavigation.js';
|
|
3
4
|
interface TableKeyboardNavigationContextValue {
|
|
4
5
|
/** The currently focused cell position */
|
|
@@ -27,6 +28,10 @@ interface TableContextValue {
|
|
|
27
28
|
columnCount: number;
|
|
28
29
|
/** Keyboard navigation functionality */
|
|
29
30
|
keyboardNavigation: TableKeyboardNavigationContextValue;
|
|
31
|
+
/** Virtualization functionality */
|
|
32
|
+
virtualizer?: Virtualizer<HTMLDivElement, Element>;
|
|
33
|
+
/** Enable virtualization */
|
|
34
|
+
enableVirtualization: boolean;
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
32
37
|
* React context for the table component.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useTableKeyboardNavigation as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as i, useContext as r } from "react";
|
|
3
|
+
import { useTableKeyboardNavigation as u } from "./hooks/useTableKeyboardNavigation.js";
|
|
4
|
+
const d = {
|
|
5
5
|
focusedCell: { rowIndex: 0, colIndex: 0 },
|
|
6
6
|
isCellFocused: () => !1,
|
|
7
7
|
handleCellKeyDown: () => {
|
|
@@ -20,23 +20,24 @@ const u = {
|
|
|
20
20
|
}, c = {
|
|
21
21
|
rowCount: 0,
|
|
22
22
|
columnCount: 0,
|
|
23
|
-
keyboardNavigation:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
keyboardNavigation: d,
|
|
24
|
+
enableVirtualization: !1
|
|
25
|
+
}, e = i(c);
|
|
26
|
+
function C() {
|
|
27
|
+
return r(e);
|
|
27
28
|
}
|
|
28
29
|
function b({
|
|
29
|
-
children:
|
|
30
|
+
children: o,
|
|
30
31
|
...t
|
|
31
32
|
}) {
|
|
32
|
-
const n =
|
|
33
|
+
const n = u(), a = {
|
|
33
34
|
...t,
|
|
34
35
|
keyboardNavigation: n
|
|
35
36
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ l(e.Provider, { value: a, children: o });
|
|
37
38
|
}
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
e as TableContext,
|
|
40
41
|
b as TableContextProvider,
|
|
41
|
-
|
|
42
|
+
C as useTableContext
|
|
42
43
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React, PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
3
|
export interface TableRootProps extends PropsWithChildren {
|
|
3
4
|
/**
|
|
4
5
|
* The minimum number of rows to display, affecting the minimum height
|
|
@@ -35,6 +36,73 @@ export interface TableRootProps extends PropsWithChildren {
|
|
|
35
36
|
* @see {@link TablePagination} for the pagination component
|
|
36
37
|
*/
|
|
37
38
|
declare const TableRoot: React.ForwardRefExoticComponent<TableRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
declare const tableVariant: import('tailwind-variants').TVReturnType<{
|
|
40
|
+
horizontalScroll: {
|
|
41
|
+
true: {
|
|
42
|
+
table: string;
|
|
43
|
+
};
|
|
44
|
+
false: {
|
|
45
|
+
wrapper: string;
|
|
46
|
+
table: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
layout: {
|
|
50
|
+
fixed: {
|
|
51
|
+
wrapper: string;
|
|
52
|
+
table: string;
|
|
53
|
+
};
|
|
54
|
+
auto: {
|
|
55
|
+
table: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
wrapper: string[];
|
|
60
|
+
table: string[];
|
|
61
|
+
}, undefined, {
|
|
62
|
+
horizontalScroll: {
|
|
63
|
+
true: {
|
|
64
|
+
table: string;
|
|
65
|
+
};
|
|
66
|
+
false: {
|
|
67
|
+
wrapper: string;
|
|
68
|
+
table: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
layout: {
|
|
72
|
+
fixed: {
|
|
73
|
+
wrapper: string;
|
|
74
|
+
table: string;
|
|
75
|
+
};
|
|
76
|
+
auto: {
|
|
77
|
+
table: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}, {
|
|
81
|
+
wrapper: string[];
|
|
82
|
+
table: string[];
|
|
83
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
84
|
+
horizontalScroll: {
|
|
85
|
+
true: {
|
|
86
|
+
table: string;
|
|
87
|
+
};
|
|
88
|
+
false: {
|
|
89
|
+
wrapper: string;
|
|
90
|
+
table: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
layout: {
|
|
94
|
+
fixed: {
|
|
95
|
+
wrapper: string;
|
|
96
|
+
table: string;
|
|
97
|
+
};
|
|
98
|
+
auto: {
|
|
99
|
+
table: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
}, {
|
|
103
|
+
wrapper: string[];
|
|
104
|
+
table: string[];
|
|
105
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
38
106
|
export interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
39
107
|
/**
|
|
40
108
|
* The label for the table. This is used for accessibility purposes.
|
|
@@ -49,6 +117,28 @@ export interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
|
|
|
49
117
|
* Enables horizontal scrolling if the table overflows its container. Enabled by default.
|
|
50
118
|
*/
|
|
51
119
|
isHorizontalScrollEnabled?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Enable internal scroll virtualization
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
enableVirtualization?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Estimated row height in pixels used by the virtualizer. Default ~40 (uy:h-500)
|
|
127
|
+
* @default 40
|
|
128
|
+
*/
|
|
129
|
+
estimatedRowHeight?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Number of extra rows rendered above/below the viewport
|
|
132
|
+
* @default 5
|
|
133
|
+
*/
|
|
134
|
+
overscan?: number;
|
|
135
|
+
/**
|
|
136
|
+
* Controls the table layout algorithm:
|
|
137
|
+
* - `'auto'` (default): Columns adapt to content. Enables horizontal scrolling. Best for flexible, content-driven tables.
|
|
138
|
+
* - `'fixed'`: Columns use explicit widths from headers. Disables horizontal scrolling. Best for predictable layouts that fit the container.
|
|
139
|
+
* @default 'auto'
|
|
140
|
+
*/
|
|
141
|
+
layout?: VariantProps<typeof tableVariant>['layout'];
|
|
52
142
|
}
|
|
53
143
|
export interface TableImperativeHandler {
|
|
54
144
|
/**
|
|
@@ -59,6 +149,9 @@ export interface TableImperativeHandler {
|
|
|
59
149
|
/**
|
|
60
150
|
* The `Table` component provides a fully accessible, keyboard-navigable data table with support for row and column headers,
|
|
61
151
|
* pagination, and empty states. It follows WAI-ARIA grid pattern for accessibility.
|
|
152
|
+
* The component supports two layout modes:
|
|
153
|
+
* - **Auto layout** (default): Columns adapt to content with horizontal scrolling enabled
|
|
154
|
+
* - **Fixed layout**: Explicit column widths that fit the container without horizontal scrolling
|
|
62
155
|
* @param {TableProps} props - The props for the `Table` component
|
|
63
156
|
* @example
|
|
64
157
|
* ```tsx
|