@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
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Switch as
|
|
5
|
-
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h } from "react";
|
|
3
|
+
import { uyTv as v } from "@payfit/unity-themes";
|
|
4
|
+
import { Switch as b } from "react-aria-components";
|
|
5
|
+
import { useBreakpointListener as w } from "../../hooks/use-breakpoint-listener.js";
|
|
6
|
+
const x = v({
|
|
6
7
|
slots: {
|
|
7
|
-
container: ["uy:flex uy:gap-100 uy:group"],
|
|
8
|
+
container: ["uy:flex uy:flex-col uy:sm:flex-row uy:gap-100 uy:group"],
|
|
9
|
+
mobileContainer: [
|
|
10
|
+
"uy:flex uy:flex-1 uy:justify-between uy:sm:justify-start uy:gap-200 uy:sm:gap-100 uy:group uy:my-75 uy:sm:my-0"
|
|
11
|
+
],
|
|
8
12
|
textWrapper: ["uy:flex uy:flex-col uy:gap-50"],
|
|
9
|
-
label: [
|
|
13
|
+
label: [
|
|
14
|
+
"uy:typography-body uy:text-content-form-enabled uy:leading-4! uy:sm:leading-3!"
|
|
15
|
+
],
|
|
10
16
|
hintText: ["uy:typography-body-small uy:text-content-neutral-low"],
|
|
11
17
|
indicator: [
|
|
12
|
-
"uy:p-50 uy:w-500 uy:h-300 uy:flex uy:items-center",
|
|
18
|
+
"uy:p-50 uy:w-6.75 uy:h-4 uy:sm:w-500 uy:sm:h-300 uy:flex uy:items-center uy:shrink-0 uy:grow-0",
|
|
13
19
|
"uy:rounded-pill",
|
|
14
20
|
"uy:border uy:border-solid uy:border-border-form-disabled uy:bg-surface-form-disabled",
|
|
15
21
|
"uy:cursor-pointer uy:transition-colors uy:duration-200 uy:ease-in-out",
|
|
16
22
|
"uy:group-data-[pressed]:bg-surface-form-pressed uy:group-data-[pressed]:border-border-form-pressed",
|
|
17
23
|
"uy:group-data-[disabled]:bg-surface-form-disabled uy:group-data-[disabled]:border-border-form-disabled uy:group-data-[disabled]:cursor-not-allowed",
|
|
18
|
-
"uy:group-data-[focus-visible]:outline-2 uy:group-data-[focus-visible]:outline
|
|
24
|
+
"uy:group-data-[focus-visible]:outline-2 uy:group-data-[focus-visible]:outline-offset-2 uy:group-data-[focus-visible]:outline-utility-focus-ring"
|
|
19
25
|
],
|
|
20
26
|
knob: [
|
|
21
|
-
"uy:w-200 uy:h-200 uy:rounded-circle",
|
|
27
|
+
"uy:w-300 uy:h-300 uy:sm:w-200 uy:sm:h-200 uy:rounded-circle",
|
|
22
28
|
"uy:border uy:border-solid uy:border-border-form-disabled uy:bg-surface-form-enabled",
|
|
23
29
|
"uy:transition-all uy:duration-200 uy:ease-in-out",
|
|
24
30
|
'uy:group-data-[selected="true"]:translate-x-[90%]',
|
|
@@ -33,39 +39,72 @@ const v = g({
|
|
|
33
39
|
knob: 'uy:group-data-[selected="true"]:border-border-inverted-enabled uy:group-data-[selected="true"]:group-data-[pressed]:bg-surface-form-pressed uy:group-data-[selected="true"]:group-data-[pressed]:border-border-inverted-pressed'
|
|
34
40
|
},
|
|
35
41
|
true: {
|
|
42
|
+
label: "uy:text-content-form-disabled",
|
|
36
43
|
indicator: "",
|
|
37
44
|
knob: ""
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
|
-
}),
|
|
48
|
+
}), N = h(
|
|
42
49
|
({
|
|
43
|
-
label:
|
|
50
|
+
label: o,
|
|
44
51
|
helperText: r,
|
|
45
|
-
isLabelSrOnly:
|
|
46
|
-
isDisabled:
|
|
47
|
-
...
|
|
48
|
-
},
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
isLabelSrOnly: s = !1,
|
|
53
|
+
isDisabled: d,
|
|
54
|
+
...m
|
|
55
|
+
}, u) => {
|
|
56
|
+
const {
|
|
57
|
+
container: t,
|
|
58
|
+
indicator: i,
|
|
59
|
+
knob: l,
|
|
60
|
+
textWrapper: y,
|
|
61
|
+
label: c,
|
|
62
|
+
hintText: n,
|
|
63
|
+
mobileContainer: f
|
|
64
|
+
} = x({ isDisabled: d }), g = w() === "xs", p = { ...m, role: "switch" };
|
|
65
|
+
return g ? /* @__PURE__ */ e(
|
|
66
|
+
b,
|
|
67
|
+
{
|
|
68
|
+
...p,
|
|
69
|
+
ref: u,
|
|
70
|
+
className: t(),
|
|
71
|
+
isDisabled: d,
|
|
72
|
+
children: /* @__PURE__ */ a("div", { className: f(), children: [
|
|
73
|
+
/* @__PURE__ */ a(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: y({
|
|
77
|
+
className: s ? "uy:sr-only" : ""
|
|
78
|
+
}),
|
|
79
|
+
"data-dd-privacy": "allow",
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ e("span", { className: c(), children: o }),
|
|
82
|
+
r && /* @__PURE__ */ e("span", { className: n(), children: r })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ e("div", { className: i(), "data-dd-privacy": "mask", children: /* @__PURE__ */ e("div", { className: l() }) })
|
|
87
|
+
] })
|
|
88
|
+
}
|
|
89
|
+
) : /* @__PURE__ */ a(
|
|
90
|
+
b,
|
|
52
91
|
{
|
|
53
|
-
...
|
|
54
|
-
ref:
|
|
55
|
-
className:
|
|
56
|
-
isDisabled:
|
|
92
|
+
...p,
|
|
93
|
+
ref: u,
|
|
94
|
+
className: t(),
|
|
95
|
+
isDisabled: d,
|
|
57
96
|
children: [
|
|
58
|
-
/* @__PURE__ */ e("div", { className: i(), "data-dd-privacy": "mask", children: /* @__PURE__ */ e("div", { className:
|
|
59
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ e("div", { className: i(), "data-dd-privacy": "mask", children: /* @__PURE__ */ e("div", { className: l() }) }),
|
|
98
|
+
/* @__PURE__ */ a(
|
|
60
99
|
"div",
|
|
61
100
|
{
|
|
62
|
-
className:
|
|
63
|
-
className:
|
|
101
|
+
className: y({
|
|
102
|
+
className: s ? "uy:sr-only" : ""
|
|
64
103
|
}),
|
|
65
104
|
"data-dd-privacy": "allow",
|
|
66
105
|
children: [
|
|
67
|
-
/* @__PURE__ */ e("span", { className:
|
|
68
|
-
r && /* @__PURE__ */ e("span", { className:
|
|
106
|
+
/* @__PURE__ */ e("span", { className: c(), children: o }),
|
|
107
|
+
r && /* @__PURE__ */ e("span", { className: n(), children: r })
|
|
69
108
|
]
|
|
70
109
|
}
|
|
71
110
|
)
|
|
@@ -74,8 +113,8 @@ const v = g({
|
|
|
74
113
|
);
|
|
75
114
|
}
|
|
76
115
|
);
|
|
77
|
-
|
|
116
|
+
N.displayName = "ToggleSwitch";
|
|
78
117
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
118
|
+
N as ToggleSwitch,
|
|
119
|
+
x as toggleSwitch
|
|
81
120
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TanstackToggleSwitchProps } from '../toggle-switch/TanstackToggleSwitch.js';
|
|
2
|
+
export interface TanstackToggleSwitchFieldProps extends TanstackToggleSwitchProps {
|
|
3
|
+
/** The label for the toggle switch. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Helper text to display below the toggle switch label. */
|
|
6
|
+
switchHelperText?: string;
|
|
7
|
+
/** Whether the label is only visible to screen readers. */
|
|
8
|
+
isLabelSrOnly?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const TanstackToggleSwitchField: import('react').ForwardRefExoticComponent<Omit<TanstackToggleSwitchFieldProps, "ref"> & import('react').RefAttributes<HTMLLabelElement>>;
|
|
11
|
+
export { TanstackToggleSwitchField };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { TanstackFormFeedbackText as s } from "../form-field/parts/TanstackFormFeedbackText.js";
|
|
4
|
+
import { TanstackFormField as l } from "../form-field/TanstackFormField.js";
|
|
5
|
+
import { TanstackToggleSwitch as T } from "../toggle-switch/TanstackToggleSwitch.js";
|
|
6
|
+
function p({
|
|
7
|
+
label: t,
|
|
8
|
+
switchHelperText: r,
|
|
9
|
+
isDisabled: e,
|
|
10
|
+
isReadOnly: m,
|
|
11
|
+
isLabelSrOnly: c
|
|
12
|
+
}, a) {
|
|
13
|
+
return /* @__PURE__ */ i(l, { children: [
|
|
14
|
+
/* @__PURE__ */ o(
|
|
15
|
+
T,
|
|
16
|
+
{
|
|
17
|
+
ref: a,
|
|
18
|
+
label: t,
|
|
19
|
+
helperText: r,
|
|
20
|
+
isLabelSrOnly: c,
|
|
21
|
+
...{
|
|
22
|
+
isDisabled: e,
|
|
23
|
+
isReadOnly: m
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ o(s, {})
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
const d = n(p);
|
|
31
|
+
d.displayName = "TanstackToggleSwitchField";
|
|
32
|
+
export {
|
|
33
|
+
d as TanstackToggleSwitchField
|
|
34
|
+
};
|
|
@@ -63,6 +63,8 @@ type ToggleSwitchFieldComponent = (<TSchema extends Schema>(props: ToggleSwitchF
|
|
|
63
63
|
* [API](/?path=/docs/forms-toggleswitchfield--docs) • [Demo](/?path=/story/forms-toggleswitchfield--primary)
|
|
64
64
|
* @note The schema type parameter is needed to ensure type safety with the form's schema.
|
|
65
65
|
* If you omit it, the `name` prop will not be type-safe.
|
|
66
|
+
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
|
|
67
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
|
|
66
68
|
*/
|
|
67
69
|
declare const ToggleSwitchField: ToggleSwitchFieldComponent;
|
|
68
70
|
export { ToggleSwitchField };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ToggleSwitchGroupProps } from './ToggleSwitchGroup.js';
|
|
2
|
+
export type TanstackToggleSwitchGroupProps = Omit<ToggleSwitchGroupProps, 'value' | 'defaultValue' | 'isInvalid' | 'feedbackText'>;
|
|
3
|
+
/**
|
|
4
|
+
* TanStack‑controlled group component for multiple `ToggleSwitch` children.
|
|
5
|
+
*
|
|
6
|
+
* `TanstackToggleSwitchGroup` wraps `ToggleSwitchGroup` and binds its value
|
|
7
|
+
* (a `string[]`) to the TanStack field context via `useFieldContext`. The
|
|
8
|
+
* selection state is fully driven by the form — do not pass `value` or
|
|
9
|
+
* `defaultValue` directly.
|
|
10
|
+
*
|
|
11
|
+
* Behavior:
|
|
12
|
+
* - The value comes from `field.state.value` (string[]), defaulting to `[]`.
|
|
13
|
+
* - Changes are propagated via `field.handleChange` and forwarded to `onChange`.
|
|
14
|
+
* - The invalid state (`isInvalid`) is derived from `field.state.meta`
|
|
15
|
+
* (`isTouched` && `!isValid`).
|
|
16
|
+
*
|
|
17
|
+
* Accessibility:
|
|
18
|
+
* - The group handles its own label and `helperText`.
|
|
19
|
+
* - For error feedback coming from the form, use the dedicated Field variant
|
|
20
|
+
* (`TanstackToggleSwitchGroupField`).
|
|
21
|
+
*
|
|
22
|
+
* Usage constraints:
|
|
23
|
+
* - Must be rendered inside `<form.AppField name="…">`.
|
|
24
|
+
* - Pre‑fill via `useTanstackUnityForm({ defaultValues: { … } })`.
|
|
25
|
+
*
|
|
26
|
+
* Example:
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const form = useTanstackUnityForm({
|
|
29
|
+
* validators: { onBlur: z.object({ pref: z.array(z.string()).optional() }) },
|
|
30
|
+
* defaultValues: { pref: ['email'] },
|
|
31
|
+
* })
|
|
32
|
+
*
|
|
33
|
+
* return (
|
|
34
|
+
* <form.AppForm>
|
|
35
|
+
* <form.Form>
|
|
36
|
+
* <form.AppField name="pref">
|
|
37
|
+
* {() => (
|
|
38
|
+
* <TanstackToggleSwitchGroup label="Notifications">
|
|
39
|
+
* <ToggleSwitch value="email" label="Email" />
|
|
40
|
+
* <ToggleSwitch value="sms" label="SMS" />
|
|
41
|
+
* <ToggleSwitch value="push" label="Push" />
|
|
42
|
+
* </TanstackToggleSwitchGroup>
|
|
43
|
+
* )}
|
|
44
|
+
* </form.AppField>
|
|
45
|
+
* </form.Form>
|
|
46
|
+
* </form.AppForm>
|
|
47
|
+
* )
|
|
48
|
+
* ```
|
|
49
|
+
* @public
|
|
50
|
+
* @see ToggleSwitchGroup
|
|
51
|
+
* @see useFieldContext
|
|
52
|
+
* @remarks The `value`, `defaultValue`, `isInvalid`, and `feedbackText` props are handled by the TanStack integration and therefore omitted.
|
|
53
|
+
* @param props Group props (excluding `value`, `defaultValue`, `isInvalid`, `feedbackText`).
|
|
54
|
+
* @returns A form‑controlled `fieldset` containing the child switches.
|
|
55
|
+
*/
|
|
56
|
+
declare const TanstackToggleSwitchGroup: import('react').ForwardRefExoticComponent<TanstackToggleSwitchGroupProps & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
57
|
+
export { TanstackToggleSwitchGroup };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { useFieldContext as c } from "../../hooks/tanstack-form-context.js";
|
|
4
|
+
import { ToggleSwitchGroup as u } from "./ToggleSwitchGroup.js";
|
|
5
|
+
const m = n(function({ onChange: a, ...e }, r) {
|
|
6
|
+
const t = c(), i = Array.isArray(t.state.value) ? t.state.value : [], s = t.state.meta.isTouched && !t.state.meta.isValid;
|
|
7
|
+
return /* @__PURE__ */ l(
|
|
8
|
+
u,
|
|
9
|
+
{
|
|
10
|
+
...e,
|
|
11
|
+
ref: r,
|
|
12
|
+
value: i,
|
|
13
|
+
isInvalid: s,
|
|
14
|
+
onChange: (o) => {
|
|
15
|
+
t.handleChange(o), a?.(o);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
m.displayName = "TanstackToggleSwitchGroup";
|
|
21
|
+
export {
|
|
22
|
+
m as TanstackToggleSwitchGroup
|
|
23
|
+
};
|
|
@@ -69,7 +69,7 @@ const Y = q(
|
|
|
69
69
|
onFocus: x,
|
|
70
70
|
onBlur: D,
|
|
71
71
|
children: [
|
|
72
|
-
/* @__PURE__ */ t("legend", { className: "uy:mb-
|
|
72
|
+
/* @__PURE__ */ t("legend", { className: "uy:mb-25", children: /* @__PURE__ */ t(U, { isRequired: y, requiredVariant: R, children: i }) }),
|
|
73
73
|
o && /* @__PURE__ */ t(
|
|
74
74
|
j,
|
|
75
75
|
{
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TanstackToggleSwitchGroupProps } from '../toggle-switch-group/TanstackToggleSwitchGroup.js';
|
|
3
|
+
export interface TanstackToggleSwitchGroupFieldProps extends TanstackToggleSwitchGroupProps {
|
|
4
|
+
/** Helper text to display below the group. */
|
|
5
|
+
helperText?: ReactNode;
|
|
6
|
+
/** Optional content displayed under the whole field (not the group). */
|
|
7
|
+
contextualLink?: ReactNode;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Composite TanStack field for a group of toggle switches.
|
|
12
|
+
*
|
|
13
|
+
* `TanstackToggleSwitchGroupField` assembles a complete field using
|
|
14
|
+
* `TanstackFormField`, the TanStack‑controlled `TanstackToggleSwitchGroup`,
|
|
15
|
+
* and the feedback area. Render it inside `<form.AppField name="…">` to bind
|
|
16
|
+
* to the form state and validation.
|
|
17
|
+
*/
|
|
18
|
+
declare const TanstackToggleSwitchGroupField: import('react').ForwardRefExoticComponent<TanstackToggleSwitchGroupFieldProps & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
19
|
+
export { TanstackToggleSwitchGroupField };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as k } from "react";
|
|
3
|
+
import { TanstackFormFeedbackText as F } from "../form-field/parts/TanstackFormFeedbackText.js";
|
|
4
|
+
import { TanstackFormField as u } from "../form-field/TanstackFormField.js";
|
|
5
|
+
import { TanstackToggleSwitchGroup as h } from "../toggle-switch-group/TanstackToggleSwitchGroup.js";
|
|
6
|
+
function w({
|
|
7
|
+
label: r,
|
|
8
|
+
helperText: t,
|
|
9
|
+
isDisabled: m,
|
|
10
|
+
isReadOnly: c,
|
|
11
|
+
isRequired: a,
|
|
12
|
+
requiredVariant: e,
|
|
13
|
+
contextualLink: i,
|
|
14
|
+
children: n,
|
|
15
|
+
onFocus: p,
|
|
16
|
+
onBlur: s,
|
|
17
|
+
onFocusChange: l,
|
|
18
|
+
onChange: T,
|
|
19
|
+
...d
|
|
20
|
+
}, f) {
|
|
21
|
+
return /* @__PURE__ */ g(u, { children: [
|
|
22
|
+
/* @__PURE__ */ o(
|
|
23
|
+
h,
|
|
24
|
+
{
|
|
25
|
+
ref: f,
|
|
26
|
+
label: r,
|
|
27
|
+
helperText: t,
|
|
28
|
+
isRequired: a,
|
|
29
|
+
requiredVariant: e,
|
|
30
|
+
onFocus: p,
|
|
31
|
+
onBlur: s,
|
|
32
|
+
onFocusChange: l,
|
|
33
|
+
onChange: T,
|
|
34
|
+
...{
|
|
35
|
+
isDisabled: m,
|
|
36
|
+
isReadOnly: c
|
|
37
|
+
},
|
|
38
|
+
...d,
|
|
39
|
+
children: n
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ o(F, {}),
|
|
43
|
+
i
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
const x = k(w);
|
|
47
|
+
x.displayName = "TanstackToggleSwitchGroupField";
|
|
48
|
+
export {
|
|
49
|
+
x as TanstackToggleSwitchGroupField
|
|
50
|
+
};
|
|
@@ -77,6 +77,8 @@ type ToggleSwitchGroupFieldComponent = (<TSchema extends Schema>(props: ToggleSw
|
|
|
77
77
|
* [API](/?path=/docs/forms-toggleswitchgroupfield--docs) • [Demo](/?path=/story/forms-toggleswitchgroupfield--primary)
|
|
78
78
|
* @note The schema type parameter is needed to ensure type safety with the form's schema.
|
|
79
79
|
* If you omit it, the `name` prop will not be type-safe.
|
|
80
|
+
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
|
|
81
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
|
|
80
82
|
*/
|
|
81
83
|
declare const ToggleSwitchGroupField: ToggleSwitchGroupFieldComponent;
|
|
82
84
|
export { ToggleSwitchGroupField };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Employee } from '
|
|
1
|
+
import { Employee } from '../../../../mocks/employees.js';
|
|
2
2
|
export declare const employeeColumns: (import('@tanstack/table-core').AccessorKeyColumnDefBase<Employee, string> & Partial<import('@tanstack/table-core').IdIdentifier<Employee, string>>)[];
|
|
3
3
|
export declare const employeeColumnsWithCheckbox: ((import('@tanstack/table-core').AccessorKeyColumnDefBase<Employee, string> & Partial<import('@tanstack/table-core').IdIdentifier<Employee, string>>) | import('@tanstack/table-core').DisplayColumnDef<Employee, unknown>)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fieldContext: import('react').Context<import('@tanstack/react-form').AnyFieldApi>, formContext: import('react').Context<import('@tanstack/react-form').AnyFormApi>, useFieldContext: <TData>() => import('@tanstack/react-form').FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useFormContext: () => import('@tanstack/react-form').ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
@@ -44,5 +44,7 @@ export type UseUnityFormReturn<TSchema extends Schema> = {
|
|
|
44
44
|
* ```
|
|
45
45
|
* @remarks
|
|
46
46
|
* [API]() • [Demo]()
|
|
47
|
+
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
|
|
48
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
|
|
47
49
|
*/
|
|
48
50
|
export declare function useUnityForm<TSchema extends Schema>(schema: TSchema, options?: Omit<UseHookFormProps<StandardSchemaV1.InferInput<TSchema>, any, StandardSchemaV1.InferOutput<TSchema>>, 'resolver'>): UseUnityFormReturn<TSchema>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ScrollDetectionResult, ScrollDetectionStrategy } from '../utils/scroll-detection.js';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for the useHasScroll hook
|
|
5
|
+
*/
|
|
6
|
+
export interface UseHasScrollOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Detection strategy to use:
|
|
9
|
+
* - 'size': Compare scrollHeight/scrollWidth vs clientHeight/clientWidth (default)
|
|
10
|
+
* Use when you need to detect actual scrollable content
|
|
11
|
+
* - 'style': Check computed overflow styles (overflow, overflowX, overflowY)
|
|
12
|
+
* Use when you need to check if element is configured for scrolling
|
|
13
|
+
* - 'both': Element must satisfy both size and style conditions
|
|
14
|
+
* Use for strict validation that element both has overflow style AND exceeds bounds
|
|
15
|
+
* @default 'size'
|
|
16
|
+
*/
|
|
17
|
+
strategy?: ScrollDetectionStrategy;
|
|
18
|
+
/**
|
|
19
|
+
* Debounce delay in milliseconds for scroll detection updates
|
|
20
|
+
* Higher values improve performance but reduce responsiveness
|
|
21
|
+
* Set to 0 to disable debouncing
|
|
22
|
+
* @default 100
|
|
23
|
+
*/
|
|
24
|
+
debounceMs?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Watch for DOM mutations (content changes) in the element
|
|
27
|
+
* Disable for static content to improve performance
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
watchMutations?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Watch for element resize events
|
|
33
|
+
* Disable if element size is fixed to improve performance
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
watchResize?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* React hook to detect if an element has scrollable content
|
|
40
|
+
* This hook monitors a DOM element and determines whether it has scrollable content
|
|
41
|
+
* using configurable detection strategies. It automatically updates when the element's
|
|
42
|
+
* size changes or its content is modified.
|
|
43
|
+
* @param {RefObject<HTMLElement>} ref - React ref to the element to monitor
|
|
44
|
+
* @param {UseHasScrollOptions} options - Configuration options
|
|
45
|
+
* @returns {ScrollDetectionResult} Current scroll detection state
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* // Basic usage with default size-based detection
|
|
49
|
+
* const containerRef = useRef<HTMLDivElement>(null);
|
|
50
|
+
* const { hasVerticalScroll } = useHasScroll(containerRef);
|
|
51
|
+
* ```
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* // Style-based detection
|
|
55
|
+
* const { hasVerticalScroll } = useHasScroll(containerRef, { strategy: 'style' });
|
|
56
|
+
* ```
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* // Strict detection with both methods
|
|
60
|
+
* const { hasVerticalScroll } = useHasScroll(containerRef, { strategy: 'both' });
|
|
61
|
+
* ```
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* // Performance optimized for static content
|
|
65
|
+
* const scrollState = useHasScroll(containerRef, {
|
|
66
|
+
* watchMutations: false,
|
|
67
|
+
* debounceMs: 0
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function useHasScroll(ref: RefObject<HTMLElement>, options?: UseHasScrollOptions): ScrollDetectionResult;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useState as p, useCallback as z, useLayoutEffect as F, useEffect as y } from "react";
|
|
2
|
+
import { detectScroll as A } from "../utils/scroll-detection.js";
|
|
3
|
+
function E(r, b = {}) {
|
|
4
|
+
const {
|
|
5
|
+
strategy: a = "size",
|
|
6
|
+
debounceMs: u = 100,
|
|
7
|
+
watchMutations: i = !0,
|
|
8
|
+
watchResize: m = !0
|
|
9
|
+
} = b, [d, v] = p({
|
|
10
|
+
hasVerticalScroll: !1,
|
|
11
|
+
hasHorizontalScroll: !1,
|
|
12
|
+
hasAnyScroll: !1,
|
|
13
|
+
detectionMethod: {
|
|
14
|
+
size: { vertical: !1, horizontal: !1 },
|
|
15
|
+
style: { vertical: !1, horizontal: !1 }
|
|
16
|
+
}
|
|
17
|
+
}), e = z(() => {
|
|
18
|
+
const s = r.current;
|
|
19
|
+
if (!s)
|
|
20
|
+
return;
|
|
21
|
+
const o = A(s, a);
|
|
22
|
+
v(o);
|
|
23
|
+
}, [r, a]);
|
|
24
|
+
return F(() => {
|
|
25
|
+
if (!r.current) return;
|
|
26
|
+
e();
|
|
27
|
+
const o = requestAnimationFrame(() => {
|
|
28
|
+
e();
|
|
29
|
+
});
|
|
30
|
+
return () => {
|
|
31
|
+
cancelAnimationFrame(o);
|
|
32
|
+
};
|
|
33
|
+
}, [e]), y(() => {
|
|
34
|
+
let s = !0, o;
|
|
35
|
+
const S = () => {
|
|
36
|
+
const n = r.current;
|
|
37
|
+
if (!n) return;
|
|
38
|
+
let c;
|
|
39
|
+
const h = () => {
|
|
40
|
+
clearTimeout(c), c = setTimeout(e, u);
|
|
41
|
+
};
|
|
42
|
+
e(), requestAnimationFrame(() => {
|
|
43
|
+
e();
|
|
44
|
+
});
|
|
45
|
+
const l = [];
|
|
46
|
+
if (m) {
|
|
47
|
+
const t = new ResizeObserver(h);
|
|
48
|
+
t.observe(n), l.push(t);
|
|
49
|
+
}
|
|
50
|
+
if (i) {
|
|
51
|
+
const t = new MutationObserver(h);
|
|
52
|
+
t.observe(n, {
|
|
53
|
+
childList: !0,
|
|
54
|
+
subtree: !0,
|
|
55
|
+
characterData: !0,
|
|
56
|
+
attributes: !0,
|
|
57
|
+
attributeFilter: ["style", "class"]
|
|
58
|
+
}), l.push(t);
|
|
59
|
+
}
|
|
60
|
+
o = () => {
|
|
61
|
+
clearTimeout(c), l.forEach((t) => {
|
|
62
|
+
t.disconnect();
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
}, f = () => {
|
|
66
|
+
s && (r.current ? S() : requestAnimationFrame(f));
|
|
67
|
+
};
|
|
68
|
+
return f(), () => {
|
|
69
|
+
s = !1, o?.();
|
|
70
|
+
};
|
|
71
|
+
}, [r, e, u, m, i]), d;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
E as useHasScroll
|
|
75
|
+
};
|