@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,28 +1,28 @@
|
|
|
1
1
|
import { jsxs as f, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as U } from "react";
|
|
3
3
|
import { uyTv as b } from "@payfit/unity-themes";
|
|
4
|
-
import { DatePicker as
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { DateCalendar as
|
|
7
|
-
import { Icon as
|
|
8
|
-
import { DateInput as
|
|
9
|
-
const
|
|
4
|
+
import { DatePicker as B, Group as j, Button as E, Popover as M, Dialog as R } from "react-aria-components";
|
|
5
|
+
import { useIntl as G } from "react-intl";
|
|
6
|
+
import { DateCalendar as T } from "../date-calendar/DateCalendar.js";
|
|
7
|
+
import { Icon as $ } from "../icon/Icon.js";
|
|
8
|
+
import { DateInput as q } from "./parts/DateInput.js";
|
|
9
|
+
const z = b({
|
|
10
10
|
slots: {
|
|
11
11
|
base: [
|
|
12
|
-
"uy:group uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-75",
|
|
13
|
-
"uy:active:border-border-form-active uy:data-[focus-visible]:border-border-form-active"
|
|
12
|
+
"uy:group uy:flex uy:h-5.5 uy:sm:h-500 uy:border uy:border-solid uy:rounded-100 uy:sm:rounded-75",
|
|
13
|
+
"uy:active:border-border-form-active uy:data-[focus-visible=true]:border-border-form-active"
|
|
14
14
|
],
|
|
15
15
|
inputWrapper: [
|
|
16
|
-
"uy:flex uy:grow uy:rounded-75 uy:outline-none",
|
|
16
|
+
"uy:flex uy:grow uy:rounded-100 uy:sm:rounded-75 uy:outline-none",
|
|
17
17
|
// Show focus styles when input wrapper is focused AND button is not focused
|
|
18
|
-
"uy:focus-within:outline-2 uy:focus-within:outline-solid uy:focus-within:outline-utility-focus-ring uy:focus-within:outline-offset-
|
|
18
|
+
"uy:focus-within:outline-2 uy:focus-within:outline-solid uy:focus-within:outline-utility-focus-ring uy:focus-within:outline-offset-3",
|
|
19
19
|
// Hide focus styles when button is focused
|
|
20
20
|
"uy:group-[:has(button:focus)]:data-[focus-within]:outline-none uy:group-[:has(button:focus)]:data-[focus-within]:outline-offset-0 uy:group-[:has(button:focus)]:data-[focus-within]:outline-transparent"
|
|
21
21
|
],
|
|
22
22
|
suffix: [
|
|
23
|
-
"uy:flex-grow-0 uy:content-center uy:
|
|
24
|
-
"uy:hover:bg-surface-neutral-hover uy:active:bg-surface-neutral-pressed uy:active:border-border-form-active uy:data-[pressed]:bg-surface-neutral-pressed uy:data-[pressed]:border-border-form-active",
|
|
25
|
-
"uy:focus-visible:outline-2 uy:focus-visible:outline-utility-focus-ring uy:focus-visible:outline-offset-
|
|
23
|
+
"uy:flex-grow-0 uy:content-center uy:p-125 uy:border-l uy:border-solid uy:rounded-r-100 uy:sm:rounded-r-75 uy:text-content-neutral-low",
|
|
24
|
+
"uy:hover:bg-surface-neutral-hover uy:active:bg-surface-neutral-pressed uy:active:border-border-form-active uy:data-[pressed=true]:bg-surface-neutral-pressed uy:data-[pressed=true]:not-group-data-[open=true]:border-border-form-active",
|
|
25
|
+
"uy:focus-visible:outline-2 uy:focus-visible:outline-utility-focus-ring uy:focus-visible:outline-offset-3"
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
variants: {
|
|
@@ -58,8 +58,8 @@ const R = b({
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
]
|
|
61
|
-
}),
|
|
62
|
-
base: "uy:overflow-auto uy:shadow-floating uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral uy:rounded-75",
|
|
61
|
+
}), A = b({
|
|
62
|
+
base: "uy:overflow-auto uy:shadow-floating uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral uy:rounded-md uy:sm:rounded-75",
|
|
63
63
|
variants: {
|
|
64
64
|
isEntering: {
|
|
65
65
|
true: "uy:animate-in uy:fade-in uy:data-[placement-bottom]:slide-in-from-top-1 uy:data-[placement-top]:slide-in-from-bottom-1 uy:duration-200 uy:ease-out"
|
|
@@ -68,68 +68,77 @@ const R = b({
|
|
|
68
68
|
true: "uy:animate-out uy:fade-out uy:data-[placement-bottom]:slide-out-to-top-1 uy:data-[placement-top]:slide-out-to-bottom-1 uy:duration-150 uy:ease-in"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
71
|
+
}), H = U(
|
|
72
72
|
({
|
|
73
|
-
value:
|
|
73
|
+
value: t,
|
|
74
74
|
defaultValue: i,
|
|
75
|
-
isInvalid:
|
|
75
|
+
isInvalid: d,
|
|
76
76
|
isLoading: y,
|
|
77
77
|
isDisabled: o,
|
|
78
|
-
isReadOnly:
|
|
78
|
+
isReadOnly: u,
|
|
79
79
|
onClearButtonPress: c,
|
|
80
80
|
onBlur: s,
|
|
81
|
-
onFocus:
|
|
81
|
+
onFocus: n,
|
|
82
82
|
onChange: m,
|
|
83
83
|
onOpenChange: p,
|
|
84
84
|
id: g,
|
|
85
|
+
"aria-label": h,
|
|
86
|
+
"aria-labelledby": v,
|
|
87
|
+
"aria-describedby": x,
|
|
88
|
+
"aria-details": D,
|
|
85
89
|
...e
|
|
86
|
-
},
|
|
87
|
-
const
|
|
88
|
-
isInvalid: !!
|
|
89
|
-
isReadOnly: !!
|
|
90
|
+
}, w) => {
|
|
91
|
+
const k = G(), { base: C, inputWrapper: P, suffix: V } = z({
|
|
92
|
+
isInvalid: !!d,
|
|
93
|
+
isReadOnly: !!u,
|
|
90
94
|
isDisabled: !!o
|
|
91
95
|
}), l = (r) => {
|
|
92
96
|
m?.(r);
|
|
93
|
-
},
|
|
94
|
-
p?.(r), r ?
|
|
95
|
-
},
|
|
97
|
+
}, N = (r) => {
|
|
98
|
+
p?.(r), r ? n?.() : s?.();
|
|
99
|
+
}, O = (r) => e.isDateUnavailable ? e.isDateUnavailable(r) : !1, W = () => {
|
|
96
100
|
c?.();
|
|
97
101
|
};
|
|
98
102
|
return /* @__PURE__ */ f(
|
|
99
|
-
|
|
103
|
+
B,
|
|
100
104
|
{
|
|
105
|
+
ref: w,
|
|
101
106
|
"data-dd-privacy": "mask",
|
|
102
107
|
...e,
|
|
103
|
-
className:
|
|
104
|
-
value:
|
|
108
|
+
className: C(),
|
|
109
|
+
value: t,
|
|
105
110
|
defaultValue: i,
|
|
106
111
|
minValue: e.minValue,
|
|
107
112
|
maxValue: e.maxValue,
|
|
108
|
-
isReadOnly: !!
|
|
113
|
+
isReadOnly: !!u,
|
|
109
114
|
isDisabled: !!o,
|
|
110
115
|
onChange: l,
|
|
111
|
-
onFocus:
|
|
116
|
+
onFocus: n,
|
|
112
117
|
onBlur: s,
|
|
113
|
-
onOpenChange:
|
|
114
|
-
isDateUnavailable:
|
|
118
|
+
onOpenChange: N,
|
|
119
|
+
isDateUnavailable: O,
|
|
120
|
+
"aria-label": h,
|
|
121
|
+
"aria-labelledby": v,
|
|
122
|
+
"aria-describedby": x,
|
|
123
|
+
"aria-details": D,
|
|
115
124
|
children: [
|
|
116
|
-
/* @__PURE__ */ f(
|
|
125
|
+
/* @__PURE__ */ f(j, { className: P(), id: g, children: [
|
|
117
126
|
/* @__PURE__ */ a(
|
|
118
|
-
|
|
127
|
+
q,
|
|
119
128
|
{
|
|
120
129
|
isLoading: y,
|
|
121
130
|
isDisabled: o,
|
|
122
|
-
isReadOnly:
|
|
123
|
-
isInvalid:
|
|
124
|
-
onClearButtonPress:
|
|
131
|
+
isReadOnly: u,
|
|
132
|
+
isInvalid: d,
|
|
133
|
+
onClearButtonPress: W
|
|
125
134
|
}
|
|
126
135
|
),
|
|
127
|
-
/* @__PURE__ */ a(
|
|
128
|
-
|
|
136
|
+
/* @__PURE__ */ a(E, { className: V(), isDisabled: u || o, children: /* @__PURE__ */ a(
|
|
137
|
+
$,
|
|
129
138
|
{
|
|
130
139
|
src: "CalendarBlankOutlined",
|
|
131
140
|
color: "inherit",
|
|
132
|
-
alt:
|
|
141
|
+
alt: k.formatMessage({
|
|
133
142
|
id: "unity:component:form-field:date-picker:calendar-button",
|
|
134
143
|
defaultMessage: "Open Calendar"
|
|
135
144
|
})
|
|
@@ -137,13 +146,13 @@ const R = b({
|
|
|
137
146
|
) })
|
|
138
147
|
] }),
|
|
139
148
|
/* @__PURE__ */ a(
|
|
140
|
-
|
|
149
|
+
M,
|
|
141
150
|
{
|
|
142
|
-
className: ({ isEntering: r, isExiting:
|
|
143
|
-
children: /* @__PURE__ */ a(
|
|
144
|
-
|
|
151
|
+
className: ({ isEntering: r, isExiting: I }) => A({ isEntering: r, isExiting: I }),
|
|
152
|
+
children: /* @__PURE__ */ a(R, { className: "uy:p-150", "data-dd-privacy": "mask", children: /* @__PURE__ */ a(
|
|
153
|
+
T,
|
|
145
154
|
{
|
|
146
|
-
value:
|
|
155
|
+
value: t,
|
|
147
156
|
defaultValue: i,
|
|
148
157
|
minValue: e.minValue,
|
|
149
158
|
maxValue: e.maxValue,
|
|
@@ -158,7 +167,7 @@ const R = b({
|
|
|
158
167
|
);
|
|
159
168
|
}
|
|
160
169
|
);
|
|
161
|
-
|
|
170
|
+
H.displayName = "DatePicker";
|
|
162
171
|
export {
|
|
163
|
-
|
|
172
|
+
H as DatePicker
|
|
164
173
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DatePickerProps } from './DatePicker.js';
|
|
2
|
+
export type TanstackDatePickerProps = Omit<DatePickerProps, 'value' | 'defaultValue' | 'isInvalid'>;
|
|
3
|
+
/**
|
|
4
|
+
* `TanstackDatePicker` is a controlled date picker wired to the TanStack Form field context.
|
|
5
|
+
* It is based on the Unity `DatePicker` component.
|
|
6
|
+
*
|
|
7
|
+
* Example:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* function ExampleField() {
|
|
10
|
+
* const form = useTanstackUnityForm<{ birthDate: CalendarDate | null }>({ validators: {} })
|
|
11
|
+
* return (
|
|
12
|
+
* <form>
|
|
13
|
+
* <form.AppField name="birthDate">
|
|
14
|
+
* {() => <TanstackDatePicker />}
|
|
15
|
+
* </form.AppField>
|
|
16
|
+
* </form>
|
|
17
|
+
* )
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const TanstackDatePicker: import('react').ForwardRefExoticComponent<TanstackDatePickerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export { TanstackDatePicker };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h } from "react";
|
|
3
|
+
import { useFieldContext as b } from "../../hooks/tanstack-form-context.js";
|
|
4
|
+
import { useFieldA11yContext as k } from "../form-field/TanstackFormField.context.js";
|
|
5
|
+
import { DatePicker as x } from "./DatePicker.js";
|
|
6
|
+
const y = h(
|
|
7
|
+
({
|
|
8
|
+
onClearButtonPress: i,
|
|
9
|
+
onBlur: n,
|
|
10
|
+
onFocus: r,
|
|
11
|
+
onChange: l,
|
|
12
|
+
onOpenChange: s,
|
|
13
|
+
isReadOnly: d,
|
|
14
|
+
isDisabled: c,
|
|
15
|
+
...m
|
|
16
|
+
}, u) => {
|
|
17
|
+
const e = b(), a = k(), f = e.state.meta.isTouched && !e.state.meta.isValid, o = [a.helperTextId, a.feedbackTextId].filter(Boolean).join(" ");
|
|
18
|
+
return /* @__PURE__ */ p(
|
|
19
|
+
x,
|
|
20
|
+
{
|
|
21
|
+
...m,
|
|
22
|
+
ref: u,
|
|
23
|
+
id: a.inputId,
|
|
24
|
+
value: e.state.value,
|
|
25
|
+
onChange: (t) => {
|
|
26
|
+
e.handleChange(t), l?.(t);
|
|
27
|
+
},
|
|
28
|
+
onBlur: () => {
|
|
29
|
+
e.handleBlur(), n?.();
|
|
30
|
+
},
|
|
31
|
+
onFocus: () => {
|
|
32
|
+
r?.();
|
|
33
|
+
},
|
|
34
|
+
onOpenChange: (t) => {
|
|
35
|
+
s?.(t);
|
|
36
|
+
},
|
|
37
|
+
onClearButtonPress: () => {
|
|
38
|
+
e.setValue(null), i?.();
|
|
39
|
+
},
|
|
40
|
+
isReadOnly: d,
|
|
41
|
+
isDisabled: c,
|
|
42
|
+
isInvalid: f,
|
|
43
|
+
"aria-labelledby": a.labelId,
|
|
44
|
+
"aria-describedby": o.length > 0 ? o : void 0,
|
|
45
|
+
"aria-details": a.contextualLinkId
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
y.displayName = "TanstackDatePicker";
|
|
51
|
+
export {
|
|
52
|
+
y as TanstackDatePicker
|
|
53
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useContext as b } from "react";
|
|
3
3
|
import { uyTv as i } from "@payfit/unity-themes";
|
|
4
|
-
import { DatePickerStateContext as
|
|
4
|
+
import { DatePickerStateContext as x, DateInput as g, DateSegment as v } from "react-aria-components";
|
|
5
5
|
import { useIntl as I } from "react-intl";
|
|
6
6
|
import { CircularIconButton as h } from "../../icon-button/CircularIconButton.js";
|
|
7
7
|
import { Icon as D } from "../../icon/Icon.js";
|
|
@@ -20,7 +20,7 @@ const M = i({
|
|
|
20
20
|
}
|
|
21
21
|
}), N = i({
|
|
22
22
|
slots: {
|
|
23
|
-
base: "uy:flex uy:gap-50 uy:flex-grow uy:
|
|
23
|
+
base: "uy:flex uy:gap-50 uy:flex-grow uy:py-125 uy:sm:py-100 uy:px-150 uy:rounded-100 uy:sm:rounded-75",
|
|
24
24
|
input: "uy:flex uy:gap-25 uy:w-fit uy:grow",
|
|
25
25
|
state: "uy:flex uy:gap-50 uy:items-center"
|
|
26
26
|
},
|
|
@@ -61,13 +61,13 @@ function P({
|
|
|
61
61
|
isDisabled: s,
|
|
62
62
|
onClearButtonPress: d
|
|
63
63
|
}) {
|
|
64
|
-
const t = I(), u = b(
|
|
64
|
+
const t = I(), u = b(x), { dateValue: c } = u, { base: m, input: y, state: f } = N({
|
|
65
65
|
isInvalid: !!o,
|
|
66
66
|
isReadOnly: !!n,
|
|
67
67
|
isDisabled: !!s
|
|
68
68
|
}), p = c && !r && !n && !s;
|
|
69
69
|
return /* @__PURE__ */ l("div", { className: m(), children: [
|
|
70
|
-
/* @__PURE__ */ e(
|
|
70
|
+
/* @__PURE__ */ e(g, { className: y(), children: (a) => /* @__PURE__ */ e(
|
|
71
71
|
v,
|
|
72
72
|
{
|
|
73
73
|
segment: a,
|
|
@@ -78,6 +78,8 @@ type DatePickerFieldComponent = {
|
|
|
78
78
|
* @note The schema type parameter is needed to ensure type safety with the form's schema. If you omit it, the `name` prop will not be type-safe.
|
|
79
79
|
* @note
|
|
80
80
|
* This component requires `@internationalized/date` as a peer dependency. Make sure to install it in your project: `yarn add @internationalized/date`
|
|
81
|
+
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
|
|
82
|
+
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
|
|
81
83
|
*/
|
|
82
84
|
declare const DatePickerField: DatePickerFieldComponent;
|
|
83
85
|
export { DatePickerField };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TanstackDatePickerProps } from '../date-picker/TanstackDatePicker.js';
|
|
3
|
+
import { LabelProps } from '../label/Label.js';
|
|
4
|
+
export type TanstackDatePickerFieldProps = TanstackDatePickerProps & Pick<LabelProps, 'isRequired' | 'requiredVariant'> & {
|
|
5
|
+
/** The label for the date picker field. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Helper text to display below the date picker field. */
|
|
8
|
+
helperText?: ReactNode;
|
|
9
|
+
/** A contextual link to display below the date picker field. */
|
|
10
|
+
contextualLink?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The `TanstackDatePickerField` component renders a full field (label, date picker)
|
|
14
|
+
* wired to the TanStack Form context. It manages state and accessibility via the
|
|
15
|
+
* context provided by `useTanstackUnityForm` and `<form.AppField name="…">`.
|
|
16
|
+
*
|
|
17
|
+
* Behavior:
|
|
18
|
+
* - Renders `TanstackDatePicker` with calendar overlay for date selection.
|
|
19
|
+
* - Displays the label (`TanstackFormLabel`), helper text (`TanstackFormHelperText`),
|
|
20
|
+
* feedback messages (`TanstackFormFeedbackText`), and an optional contextual link.
|
|
21
|
+
*
|
|
22
|
+
* Accessibility:
|
|
23
|
+
* - Automatically wires `aria-labelledby`, `aria-describedby` (helper/feedback), and
|
|
24
|
+
* `aria-details` using identifiers from the `a11y` context.
|
|
25
|
+
*
|
|
26
|
+
* Key props:
|
|
27
|
+
* - `label: string` — label text.
|
|
28
|
+
* - `helperText?: ReactNode` — helper text displayed below the field.
|
|
29
|
+
* - `contextualLink?: ReactNode` — optional contextual link, referenced via `aria-details`.
|
|
30
|
+
* - Inherits props from `TanstackDatePicker`.
|
|
31
|
+
* - `isRequired?`, `requiredVariant?` — control the required indicator in the label.
|
|
32
|
+
*
|
|
33
|
+
* Example:
|
|
34
|
+
* ```tsx
|
|
35
|
+
* import { TanstackDatePickerField } from "@/components/date-picker-field/TanstackDatePickerField"
|
|
36
|
+
* import { useTanstackUnityForm } from "@/hooks/use-tanstack-form"
|
|
37
|
+
* import { parseDate } from '@internationalized/date'
|
|
38
|
+
*
|
|
39
|
+
* function Example() {
|
|
40
|
+
* const schema = z.object({
|
|
41
|
+
* birthDate: z.custom<CalendarDate | null>()
|
|
42
|
+
* .refine(date => date !== null, 'Birth date is required'),
|
|
43
|
+
* })
|
|
44
|
+
*
|
|
45
|
+
* const form = useTanstackUnityForm({ validators: {
|
|
46
|
+
* onBlur: schema,
|
|
47
|
+
* } })
|
|
48
|
+
* return (
|
|
49
|
+
* <form>
|
|
50
|
+
* <form.AppField name="birthDate">
|
|
51
|
+
* {() => (
|
|
52
|
+
* <TanstackDatePickerField
|
|
53
|
+
* label="Birth Date"
|
|
54
|
+
* helperText="Select your date of birth"
|
|
55
|
+
* />
|
|
56
|
+
* )}
|
|
57
|
+
* </form.AppField>
|
|
58
|
+
* </form>
|
|
59
|
+
* )
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const TanstackDatePickerField: import('react').ForwardRefExoticComponent<TanstackDatePickerProps & Pick<LabelProps, "isRequired" | "requiredVariant"> & {
|
|
64
|
+
/** The label for the date picker field. */
|
|
65
|
+
label: string;
|
|
66
|
+
/** Helper text to display below the date picker field. */
|
|
67
|
+
helperText?: ReactNode;
|
|
68
|
+
/** A contextual link to display below the date picker field. */
|
|
69
|
+
contextualLink?: ReactNode;
|
|
70
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
71
|
+
export { TanstackDatePickerField };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { TanstackDatePicker as f } from "../date-picker/TanstackDatePicker.js";
|
|
4
|
+
import { TanstackFormFeedbackText as l } from "../form-field/parts/TanstackFormFeedbackText.js";
|
|
5
|
+
import { TanstackFormHelperText as F } from "../form-field/parts/TanstackFormHelperText.js";
|
|
6
|
+
import { TanstackFormLabel as T } from "../form-field/parts/TanstackFormLabel.js";
|
|
7
|
+
import { TanstackFormField as P } from "../form-field/TanstackFormField.js";
|
|
8
|
+
const x = d(
|
|
9
|
+
({
|
|
10
|
+
label: m,
|
|
11
|
+
helperText: o,
|
|
12
|
+
contextualLink: a,
|
|
13
|
+
isRequired: t,
|
|
14
|
+
isLoading: e,
|
|
15
|
+
isDisabled: c,
|
|
16
|
+
isReadOnly: i,
|
|
17
|
+
requiredVariant: n,
|
|
18
|
+
...s
|
|
19
|
+
}, k) => /* @__PURE__ */ p(P, { children: [
|
|
20
|
+
/* @__PURE__ */ r(
|
|
21
|
+
T,
|
|
22
|
+
{
|
|
23
|
+
requiredVariant: n,
|
|
24
|
+
isRequired: t,
|
|
25
|
+
children: m
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
o && /* @__PURE__ */ r(F, { children: o }),
|
|
29
|
+
/* @__PURE__ */ r(f, { ref: k, ...{
|
|
30
|
+
isLoading: e,
|
|
31
|
+
isDisabled: c,
|
|
32
|
+
isReadOnly: i
|
|
33
|
+
}, ...s }),
|
|
34
|
+
/* @__PURE__ */ r(l, {}),
|
|
35
|
+
a
|
|
36
|
+
] })
|
|
37
|
+
);
|
|
38
|
+
x.displayName = "TanstackDatePickerField";
|
|
39
|
+
export {
|
|
40
|
+
x as TanstackDatePickerField
|
|
41
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Valeurs du contexte de la DefinitionList.
|
|
4
|
+
*/
|
|
5
|
+
export interface DefinitionListContextValue {
|
|
6
|
+
/**
|
|
7
|
+
* La disposition des éléments de la liste.
|
|
8
|
+
*/
|
|
9
|
+
layout: 'horizontal' | 'vertical';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fournisseur de contexte pour la DefinitionList.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DefinitionListContextProvider: ({ children, layout, }: PropsWithChildren<DefinitionListContextValue>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Hook pour accéder au contexte de la DefinitionList.
|
|
17
|
+
* Doit être utilisé à l'intérieur d'un composant DefinitionList.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useDefinitionListContext: () => DefinitionListContextValue;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DefinitionListContextValue } from './DefinitionList.context.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export interface DefinitionListProps {
|
|
5
|
+
/**
|
|
6
|
+
* The layout of the definition list.
|
|
7
|
+
* @default 'horizontal'
|
|
8
|
+
*/
|
|
9
|
+
layout?: DefinitionListContextValue['layout'];
|
|
10
|
+
/**
|
|
11
|
+
* The content of the definition list, typically DefinitionItem components.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* DefinitionList provides a semantic HTML structure for displaying key-value pairs.
|
|
17
|
+
* It uses a `<dl>` tag and manages the layout for its `DefinitionItem` children.
|
|
18
|
+
* @example
|
|
19
|
+
* <DefinitionList layout="horizontal">
|
|
20
|
+
* <DefinitionItem term="Last name" description="Doe" />
|
|
21
|
+
* <DefinitionItem term="First name" description="John" />
|
|
22
|
+
* </DefinitionList>
|
|
23
|
+
*/
|
|
24
|
+
export declare const DefinitionList: React.ForwardRefExoticComponent<DefinitionListProps & React.RefAttributes<HTMLDListElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface DefinitionItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* The term of the definition (label).
|
|
6
|
+
*/
|
|
7
|
+
term: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional content displayed next to the term (e.g., an action button).
|
|
10
|
+
*/
|
|
11
|
+
termSuffix?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The description content associated with the term.
|
|
14
|
+
*/
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Children of the component.
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* DefinitionItem displays a term (`dt`) and its description (`dd`) within a `DefinitionList`.
|
|
23
|
+
* It adapts its layout based on the context provided by `DefinitionList`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DefinitionItem: React.ForwardRefExoticComponent<Omit<DefinitionItemProps, "children"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2,43 +2,49 @@ import { VariantProps } from '@payfit/unity-themes';
|
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { DialogTrigger } from 'react-aria-components';
|
|
4
4
|
export declare const dialog: import('tailwind-variants').TVReturnType<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
overlay?: import('tailwind-merge').ClassNameValue;
|
|
9
|
-
wrapper?: import('tailwind-merge').ClassNameValue;
|
|
5
|
+
size: {
|
|
6
|
+
sm: {
|
|
7
|
+
wrapper: string;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[x: string]: {
|
|
14
|
-
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
15
|
-
content?: import('tailwind-merge').ClassNameValue;
|
|
16
|
-
overlay?: import('tailwind-merge').ClassNameValue;
|
|
17
|
-
wrapper?: import('tailwind-merge').ClassNameValue;
|
|
9
|
+
md: {
|
|
10
|
+
wrapper: string;
|
|
18
11
|
};
|
|
19
12
|
};
|
|
20
|
-
}
|
|
13
|
+
}, {
|
|
21
14
|
overlay: string[];
|
|
22
15
|
wrapper: string[];
|
|
23
16
|
content: string[];
|
|
17
|
+
dismissIcon: string[];
|
|
24
18
|
}, undefined, {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
size: {
|
|
20
|
+
sm: {
|
|
21
|
+
wrapper: string;
|
|
22
|
+
};
|
|
23
|
+
md: {
|
|
24
|
+
wrapper: string;
|
|
30
25
|
};
|
|
31
26
|
};
|
|
32
|
-
}
|
|
27
|
+
}, {
|
|
33
28
|
overlay: string[];
|
|
34
29
|
wrapper: string[];
|
|
35
30
|
content: string[];
|
|
36
|
-
|
|
31
|
+
dismissIcon: string[];
|
|
32
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
33
|
+
size: {
|
|
34
|
+
sm: {
|
|
35
|
+
wrapper: string;
|
|
36
|
+
};
|
|
37
|
+
md: {
|
|
38
|
+
wrapper: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
37
42
|
overlay: string[];
|
|
38
43
|
wrapper: string[];
|
|
39
44
|
content: string[];
|
|
45
|
+
dismissIcon: string[];
|
|
40
46
|
}, undefined, unknown, unknown, undefined>>;
|
|
41
|
-
interface DialogProps extends PropsWithChildren<VariantProps<typeof dialog>> {
|
|
47
|
+
export interface DialogProps extends PropsWithChildren<VariantProps<typeof dialog>> {
|
|
42
48
|
/** aria-label has to be defined if the dialog does not have a visible label*/
|
|
43
49
|
'aria-label'?: string;
|
|
44
50
|
/** (optional) modal opened by default or not **If it is set to true, the closing should be handled from outside** /*/
|
|
@@ -61,6 +67,12 @@ interface DialogProps extends PropsWithChildren<VariantProps<typeof dialog>> {
|
|
|
61
67
|
* - `DialogActions`: Contains action buttons for user interaction
|
|
62
68
|
* - `DialogButton`: Handles specific actions (close, confirm, or danger)
|
|
63
69
|
* @param props - The props for the Dialog component
|
|
70
|
+
* @param props.children - The dialog content including title, content, and actions
|
|
71
|
+
* @param props.isOpen - Controls the open state in controlled mode
|
|
72
|
+
* @param props.onOpenChange - Callback fired when open state changes
|
|
73
|
+
* @param props.isDismissable - Whether the dialog can be dismissed by clicking outside or pressing Escape
|
|
74
|
+
* @param props.size - The size variant of the dialog (sm, md)
|
|
75
|
+
* @param props.aria-label - Accessible label when DialogTitle is not provided
|
|
64
76
|
* @see {@link DialogProps} for all available props
|
|
65
77
|
* @example
|
|
66
78
|
* ```tsx
|
|
@@ -94,7 +106,7 @@ interface DialogProps extends PropsWithChildren<VariantProps<typeof dialog>> {
|
|
|
94
106
|
* @remarks
|
|
95
107
|
* [API Docs](https://unity-components.payfit.io/?path=/docs/feedback-dialog--docs) • [Design Docs](https://www.payfit.design/24f360409/p/01f5dc-dialog)
|
|
96
108
|
*/
|
|
97
|
-
export declare function Dialog({ children, isOpen, onOpenChange, isDismissable, ...rest }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
export declare function Dialog({ children, isOpen, onOpenChange, isDismissable, size, ...rest }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
98
110
|
export declare namespace Dialog {
|
|
99
111
|
var displayName: string;
|
|
100
112
|
}
|