@payfit/unity-components 2.0.0 → 2.2.0
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.context.d.ts +2 -1
- package/dist/esm/components/avatar/Avatar.context.js +13 -11
- package/dist/esm/components/avatar/Avatar.d.ts +126 -0
- package/dist/esm/components/avatar/Avatar.js +34 -20
- package/dist/esm/components/avatar/Avatar.variants.d.ts +39 -0
- package/dist/esm/components/avatar/Avatar.variants.js +23 -5
- package/dist/esm/components/avatar/parts/AvatarFallback.d.ts +52 -0
- package/dist/esm/components/avatar/parts/AvatarFallback.js +26 -27
- package/dist/esm/components/avatar/parts/AvatarIcon.d.ts +31 -0
- package/dist/esm/components/avatar/parts/AvatarIcon.js +40 -0
- 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 +12 -11
- 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/inline-field-group/InlineFieldGroup.context.d.ts +23 -0
- package/dist/esm/components/inline-field-group/InlineFieldGroup.context.js +6 -0
- package/dist/esm/components/inline-field-group/InlineFieldGroup.d.ts +119 -0
- package/dist/esm/components/inline-field-group/InlineFieldGroup.js +185 -0
- package/dist/esm/components/inline-field-group/hooks/useInlineFieldGroupMode.d.ts +46 -0
- package/dist/esm/components/inline-field-group/hooks/useInlineFieldGroupMode.js +27 -0
- package/dist/esm/components/inline-field-group/parts/InlineFieldGroupEditView.d.ts +64 -0
- package/dist/esm/components/inline-field-group/parts/InlineFieldGroupEditView.js +56 -0
- package/dist/esm/components/inline-field-group/parts/InlineFieldGroupHeader.d.ts +95 -0
- package/dist/esm/components/inline-field-group/parts/InlineFieldGroupHeader.js +106 -0
- package/dist/esm/components/inline-field-group/parts/InlineFieldGroupReadView.d.ts +56 -0
- package/dist/esm/components/inline-field-group/parts/InlineFieldGroupReadView.js +28 -0
- 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/side-panel/parts/SidePanelFooter.js +19 -10
- 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 +393 -0
- package/dist/esm/hooks/use-tanstack-form.js +232 -0
- package/dist/esm/index.d.ts +45 -20
- package/dist/esm/index.js +472 -407
- 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 +27 -8
- package/i18n/es-ES.json +29 -10
- package/i18n/fr-FR.json +30 -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,26 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const r =
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as s, useContext as v } from "react";
|
|
3
|
+
const r = s({
|
|
4
4
|
variant: "circle",
|
|
5
5
|
size: "md",
|
|
6
|
-
hasPair: !1
|
|
6
|
+
hasPair: !1,
|
|
7
|
+
color: void 0
|
|
7
8
|
});
|
|
8
|
-
function
|
|
9
|
+
function x({
|
|
9
10
|
variant: t,
|
|
10
11
|
size: e,
|
|
11
12
|
hasPair: o,
|
|
12
|
-
|
|
13
|
+
color: a,
|
|
14
|
+
children: n
|
|
13
15
|
}) {
|
|
14
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ i(r.Provider, { value: { variant: t, size: e, hasPair: o, color: a }, children: n });
|
|
15
17
|
}
|
|
16
|
-
function
|
|
17
|
-
const t =
|
|
18
|
+
function d() {
|
|
19
|
+
const t = v(r);
|
|
18
20
|
if (!t)
|
|
19
21
|
throw new Error("useAvatarContext must be used within an AvatarProvider");
|
|
20
22
|
return t;
|
|
21
23
|
}
|
|
22
24
|
export {
|
|
23
25
|
r as AvatarContext,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
x as AvatarProvider,
|
|
27
|
+
d as useAvatarContext
|
|
26
28
|
};
|
|
@@ -27,6 +27,41 @@ declare const avatarRoot: import('tailwind-variants').TVReturnType<{} | {
|
|
|
27
27
|
base?: import('tailwind-merge').ClassNameValue;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
+
color: {
|
|
31
|
+
teal: import('tailwind-merge').ClassNameValue | {
|
|
32
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
33
|
+
};
|
|
34
|
+
plum: import('tailwind-merge').ClassNameValue | {
|
|
35
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
36
|
+
};
|
|
37
|
+
purple: import('tailwind-merge').ClassNameValue | {
|
|
38
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
39
|
+
};
|
|
40
|
+
orange: import('tailwind-merge').ClassNameValue | {
|
|
41
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
42
|
+
};
|
|
43
|
+
neutral: import('tailwind-merge').ClassNameValue | {
|
|
44
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
45
|
+
};
|
|
46
|
+
warning: import('tailwind-merge').ClassNameValue | {
|
|
47
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
48
|
+
};
|
|
49
|
+
success: import('tailwind-merge').ClassNameValue | {
|
|
50
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
51
|
+
};
|
|
52
|
+
info: import('tailwind-merge').ClassNameValue | {
|
|
53
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
54
|
+
};
|
|
55
|
+
danger: import('tailwind-merge').ClassNameValue | {
|
|
56
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
57
|
+
};
|
|
58
|
+
promo: import('tailwind-merge').ClassNameValue | {
|
|
59
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
60
|
+
};
|
|
61
|
+
primary: import('tailwind-merge').ClassNameValue | {
|
|
62
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
30
65
|
}, undefined, "uy:inline-block uy:relative uy:shrink-0", {
|
|
31
66
|
size: {
|
|
32
67
|
xs: string;
|
|
@@ -39,6 +74,19 @@ declare const avatarRoot: import('tailwind-variants').TVReturnType<{} | {
|
|
|
39
74
|
circle: string;
|
|
40
75
|
square: string;
|
|
41
76
|
};
|
|
77
|
+
color: {
|
|
78
|
+
teal: string;
|
|
79
|
+
plum: string;
|
|
80
|
+
purple: string;
|
|
81
|
+
orange: string;
|
|
82
|
+
neutral: string;
|
|
83
|
+
warning: string;
|
|
84
|
+
success: string;
|
|
85
|
+
info: string;
|
|
86
|
+
danger: string;
|
|
87
|
+
promo: string;
|
|
88
|
+
primary: string;
|
|
89
|
+
};
|
|
42
90
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
43
91
|
size: {
|
|
44
92
|
xs: string;
|
|
@@ -51,6 +99,19 @@ declare const avatarRoot: import('tailwind-variants').TVReturnType<{} | {
|
|
|
51
99
|
circle: string;
|
|
52
100
|
square: string;
|
|
53
101
|
};
|
|
102
|
+
color: {
|
|
103
|
+
teal: string;
|
|
104
|
+
plum: string;
|
|
105
|
+
purple: string;
|
|
106
|
+
orange: string;
|
|
107
|
+
neutral: string;
|
|
108
|
+
warning: string;
|
|
109
|
+
success: string;
|
|
110
|
+
info: string;
|
|
111
|
+
danger: string;
|
|
112
|
+
promo: string;
|
|
113
|
+
primary: string;
|
|
114
|
+
};
|
|
54
115
|
}, undefined, undefined, {
|
|
55
116
|
size: {
|
|
56
117
|
xs: string;
|
|
@@ -63,6 +124,19 @@ declare const avatarRoot: import('tailwind-variants').TVReturnType<{} | {
|
|
|
63
124
|
circle: string;
|
|
64
125
|
square: string;
|
|
65
126
|
};
|
|
127
|
+
color: {
|
|
128
|
+
teal: string;
|
|
129
|
+
plum: string;
|
|
130
|
+
purple: string;
|
|
131
|
+
orange: string;
|
|
132
|
+
neutral: string;
|
|
133
|
+
warning: string;
|
|
134
|
+
success: string;
|
|
135
|
+
info: string;
|
|
136
|
+
danger: string;
|
|
137
|
+
promo: string;
|
|
138
|
+
primary: string;
|
|
139
|
+
};
|
|
66
140
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
67
141
|
size: {
|
|
68
142
|
xs: string;
|
|
@@ -75,6 +149,19 @@ declare const avatarRoot: import('tailwind-variants').TVReturnType<{} | {
|
|
|
75
149
|
circle: string;
|
|
76
150
|
square: string;
|
|
77
151
|
};
|
|
152
|
+
color: {
|
|
153
|
+
teal: string;
|
|
154
|
+
plum: string;
|
|
155
|
+
purple: string;
|
|
156
|
+
orange: string;
|
|
157
|
+
neutral: string;
|
|
158
|
+
warning: string;
|
|
159
|
+
success: string;
|
|
160
|
+
info: string;
|
|
161
|
+
danger: string;
|
|
162
|
+
promo: string;
|
|
163
|
+
primary: string;
|
|
164
|
+
};
|
|
78
165
|
}, undefined, undefined, unknown, unknown, undefined>>>;
|
|
79
166
|
export type AvatarProps = PropsWithChildren<{
|
|
80
167
|
/** Additional class names to apply to the avatar */
|
|
@@ -83,6 +170,8 @@ export type AvatarProps = PropsWithChildren<{
|
|
|
83
170
|
variant?: VariantProps<typeof avatarRoot>['variant'];
|
|
84
171
|
/** Size of the avatar. One of: xs, sm, md, lg, xl */
|
|
85
172
|
size?: VariantProps<typeof avatarRoot>['size'];
|
|
173
|
+
/** Color variant for icon avatars. One of: teal, plum, purple, orange, neutral, warning, success, info, danger, promo, primary */
|
|
174
|
+
color?: VariantProps<typeof avatarRoot>['color'];
|
|
86
175
|
/** Accessible label for the avatar */
|
|
87
176
|
'aria-label': string;
|
|
88
177
|
/** ID of the element that labels the avatar */
|
|
@@ -96,6 +185,41 @@ export type AvatarProps = PropsWithChildren<{
|
|
|
96
185
|
}>;
|
|
97
186
|
/**
|
|
98
187
|
* The Avatar component displays visual or text content for representing people or entities.
|
|
188
|
+
* It supports images, initials, placeholders, and icons with customizable colors and sizes.
|
|
189
|
+
* @param {AvatarProps} props - Props for the Avatar component
|
|
190
|
+
* @example
|
|
191
|
+
* ```tsx
|
|
192
|
+
* import { Avatar, AvatarImage, AvatarFallback, AvatarIcon } from '@payfit/unity-components'
|
|
193
|
+
*
|
|
194
|
+
* // Avatar with image and fallback
|
|
195
|
+
* function Example() {
|
|
196
|
+
* return (
|
|
197
|
+
* <Avatar size="lg" variant="circle" aria-label="John Doe">
|
|
198
|
+
* <AvatarImage src="/images/avatar.jpg" alt="John Doe" />
|
|
199
|
+
* <AvatarFallback variant="initials">JD</AvatarFallback>
|
|
200
|
+
* </Avatar>
|
|
201
|
+
* )
|
|
202
|
+
* }
|
|
203
|
+
*
|
|
204
|
+
* // Avatar with icon and color
|
|
205
|
+
* function IconExample() {
|
|
206
|
+
* return (
|
|
207
|
+
* <Avatar size="lg" color="teal" variant="circle" aria-label="Vacation">
|
|
208
|
+
* <AvatarIcon src="PalmFilled" alt="Palm tree" />
|
|
209
|
+
* </Avatar>
|
|
210
|
+
* )
|
|
211
|
+
* }
|
|
212
|
+
* ```
|
|
213
|
+
* @remarks
|
|
214
|
+
* - Use the `circle` variant for representing people
|
|
215
|
+
* - Use the `square` variant for representing companies or organizations
|
|
216
|
+
* - The `color` prop applies background and text color variants for icon avatars
|
|
217
|
+
* - Always provide an `aria-label` or `aria-labelledby` for accessibility
|
|
218
|
+
* @see {@link AvatarProps} for all available props
|
|
219
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/avatar GitHub}
|
|
220
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=19-3741 Figma}
|
|
221
|
+
* @see Design docs in {@link https://www.payfit.design/24f360409/p/69c10a-avatar Payfit.design}
|
|
222
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-avatar unity-components.payfit.io}
|
|
99
223
|
*/
|
|
100
224
|
declare const Avatar: React.ForwardRefExoticComponent<{
|
|
101
225
|
/** Additional class names to apply to the avatar */
|
|
@@ -104,6 +228,8 @@ declare const Avatar: React.ForwardRefExoticComponent<{
|
|
|
104
228
|
variant?: VariantProps<typeof avatarRoot>["variant"];
|
|
105
229
|
/** Size of the avatar. One of: xs, sm, md, lg, xl */
|
|
106
230
|
size?: VariantProps<typeof avatarRoot>["size"];
|
|
231
|
+
/** Color variant for icon avatars. One of: teal, plum, purple, orange, neutral, warning, success, info, danger, promo, primary */
|
|
232
|
+
color?: VariantProps<typeof avatarRoot>["color"];
|
|
107
233
|
/** Accessible label for the avatar */
|
|
108
234
|
'aria-label': string;
|
|
109
235
|
/** ID of the element that labels the avatar */
|
|
@@ -1,32 +1,46 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import * as
|
|
5
|
-
import { AvatarProvider as
|
|
6
|
-
import { avatarBase as
|
|
7
|
-
const
|
|
8
|
-
extend:
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { uyTv as d } from "@payfit/unity-themes";
|
|
4
|
+
import * as e from "@radix-ui/react-avatar";
|
|
5
|
+
import { AvatarProvider as f } from "./Avatar.context.js";
|
|
6
|
+
import { avatarBase as n } from "./Avatar.variants.js";
|
|
7
|
+
const p = d({
|
|
8
|
+
extend: n,
|
|
9
9
|
base: "uy:inline-block uy:relative uy:shrink-0",
|
|
10
10
|
defaultVariants: {
|
|
11
11
|
size: "md",
|
|
12
12
|
variant: "circle"
|
|
13
13
|
}
|
|
14
|
-
}),
|
|
15
|
-
({ size: a = "md", variant: r = "circle", className:
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
}), v = c.forwardRef(
|
|
15
|
+
({ size: a = "md", variant: r = "circle", color: t, className: i, ...m }, s) => {
|
|
16
|
+
const l = p({
|
|
17
|
+
variant: r,
|
|
18
|
+
size: a,
|
|
19
|
+
color: t,
|
|
20
|
+
className: i
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */ o(
|
|
23
|
+
f,
|
|
19
24
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
variant: r,
|
|
26
|
+
size: a,
|
|
27
|
+
hasPair: !1,
|
|
28
|
+
color: t,
|
|
29
|
+
children: /* @__PURE__ */ o(
|
|
30
|
+
e.Root,
|
|
31
|
+
{
|
|
32
|
+
ref: s,
|
|
33
|
+
role: "img",
|
|
34
|
+
className: l,
|
|
35
|
+
"data-dd-privacy": "allow",
|
|
36
|
+
...m
|
|
37
|
+
}
|
|
38
|
+
)
|
|
25
39
|
}
|
|
26
|
-
)
|
|
40
|
+
);
|
|
27
41
|
}
|
|
28
42
|
);
|
|
29
|
-
|
|
43
|
+
v.displayName = e.Root.displayName;
|
|
30
44
|
export {
|
|
31
|
-
|
|
45
|
+
v as Avatar
|
|
32
46
|
};
|
|
@@ -10,6 +10,19 @@ export declare const avatarBase: import('tailwind-variants').TVReturnType<{
|
|
|
10
10
|
circle: string;
|
|
11
11
|
square: string;
|
|
12
12
|
};
|
|
13
|
+
color: {
|
|
14
|
+
teal: string;
|
|
15
|
+
plum: string;
|
|
16
|
+
purple: string;
|
|
17
|
+
orange: string;
|
|
18
|
+
neutral: string;
|
|
19
|
+
warning: string;
|
|
20
|
+
success: string;
|
|
21
|
+
info: string;
|
|
22
|
+
danger: string;
|
|
23
|
+
promo: string;
|
|
24
|
+
primary: string;
|
|
25
|
+
};
|
|
13
26
|
}, undefined, undefined, {
|
|
14
27
|
size: {
|
|
15
28
|
xs: string;
|
|
@@ -22,6 +35,19 @@ export declare const avatarBase: import('tailwind-variants').TVReturnType<{
|
|
|
22
35
|
circle: string;
|
|
23
36
|
square: string;
|
|
24
37
|
};
|
|
38
|
+
color: {
|
|
39
|
+
teal: string;
|
|
40
|
+
plum: string;
|
|
41
|
+
purple: string;
|
|
42
|
+
orange: string;
|
|
43
|
+
neutral: string;
|
|
44
|
+
warning: string;
|
|
45
|
+
success: string;
|
|
46
|
+
info: string;
|
|
47
|
+
danger: string;
|
|
48
|
+
promo: string;
|
|
49
|
+
primary: string;
|
|
50
|
+
};
|
|
25
51
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
26
52
|
size: {
|
|
27
53
|
xs: string;
|
|
@@ -34,4 +60,17 @@ export declare const avatarBase: import('tailwind-variants').TVReturnType<{
|
|
|
34
60
|
circle: string;
|
|
35
61
|
square: string;
|
|
36
62
|
};
|
|
63
|
+
color: {
|
|
64
|
+
teal: string;
|
|
65
|
+
plum: string;
|
|
66
|
+
purple: string;
|
|
67
|
+
orange: string;
|
|
68
|
+
neutral: string;
|
|
69
|
+
warning: string;
|
|
70
|
+
success: string;
|
|
71
|
+
info: string;
|
|
72
|
+
danger: string;
|
|
73
|
+
promo: string;
|
|
74
|
+
primary: string;
|
|
75
|
+
};
|
|
37
76
|
}, undefined, undefined, unknown, unknown, undefined>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { uyTv as
|
|
2
|
-
const
|
|
1
|
+
import { uyTv as e } from "@payfit/unity-themes";
|
|
2
|
+
const t = e({
|
|
3
3
|
variants: {
|
|
4
4
|
size: {
|
|
5
5
|
xs: "uy:size-200",
|
|
@@ -10,7 +10,20 @@ const e = a({
|
|
|
10
10
|
},
|
|
11
11
|
variant: {
|
|
12
12
|
circle: "uy:rounded-circle",
|
|
13
|
-
square: ""
|
|
13
|
+
square: "uy:aspect-square"
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
teal: "uy:bg-surface-decorative-teal-lowest uy:text-content-decorative-teal-high",
|
|
17
|
+
plum: "uy:bg-surface-decorative-plum-lowest uy:text-content-decorative-plum",
|
|
18
|
+
purple: "uy:bg-surface-decorative-purple-lowest uy:text-content-decorative-purple",
|
|
19
|
+
orange: "uy:bg-surface-decorative-orange-lowest uy:text-content-decorative-orange",
|
|
20
|
+
neutral: "uy:bg-surface-neutral-lowest uy:text-content-neutral",
|
|
21
|
+
warning: "uy:bg-surface-warning-low uy:text-content-warning-high",
|
|
22
|
+
success: "uy:bg-surface-success-low uy:text-content-success-high",
|
|
23
|
+
info: "uy:bg-surface-info-low uy:text-content-info-high",
|
|
24
|
+
danger: "uy:bg-surface-danger-low uy:text-content-danger-high",
|
|
25
|
+
promo: "uy:bg-surface-promo-low uy:text-content-promo-high",
|
|
26
|
+
primary: "uy:bg-surface-primary-lowest uy:text-content-primary-high"
|
|
14
27
|
}
|
|
15
28
|
},
|
|
16
29
|
compoundVariants: [
|
|
@@ -39,8 +52,13 @@ const e = a({
|
|
|
39
52
|
variant: "square",
|
|
40
53
|
className: "uy:rounded-200"
|
|
41
54
|
}
|
|
42
|
-
]
|
|
55
|
+
],
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
size: "md",
|
|
58
|
+
variant: "circle",
|
|
59
|
+
color: "neutral"
|
|
60
|
+
}
|
|
43
61
|
});
|
|
44
62
|
export {
|
|
45
|
-
|
|
63
|
+
t as avatarBase
|
|
46
64
|
};
|
|
@@ -32,6 +32,19 @@ declare const avatarPlaceholder: import('tailwind-variants').TVReturnType<{
|
|
|
32
32
|
circle: string;
|
|
33
33
|
square: string;
|
|
34
34
|
};
|
|
35
|
+
color: {
|
|
36
|
+
teal: string;
|
|
37
|
+
plum: string;
|
|
38
|
+
purple: string;
|
|
39
|
+
orange: string;
|
|
40
|
+
neutral: string;
|
|
41
|
+
warning: string;
|
|
42
|
+
success: string;
|
|
43
|
+
info: string;
|
|
44
|
+
danger: string;
|
|
45
|
+
promo: string;
|
|
46
|
+
primary: string;
|
|
47
|
+
};
|
|
35
48
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
36
49
|
size: {
|
|
37
50
|
xs: string;
|
|
@@ -44,6 +57,19 @@ declare const avatarPlaceholder: import('tailwind-variants').TVReturnType<{
|
|
|
44
57
|
circle: string;
|
|
45
58
|
square: string;
|
|
46
59
|
};
|
|
60
|
+
color: {
|
|
61
|
+
teal: string;
|
|
62
|
+
plum: string;
|
|
63
|
+
purple: string;
|
|
64
|
+
orange: string;
|
|
65
|
+
neutral: string;
|
|
66
|
+
warning: string;
|
|
67
|
+
success: string;
|
|
68
|
+
info: string;
|
|
69
|
+
danger: string;
|
|
70
|
+
promo: string;
|
|
71
|
+
primary: string;
|
|
72
|
+
};
|
|
47
73
|
}, undefined, undefined, {
|
|
48
74
|
size: {
|
|
49
75
|
xs: string;
|
|
@@ -56,6 +82,19 @@ declare const avatarPlaceholder: import('tailwind-variants').TVReturnType<{
|
|
|
56
82
|
circle: string;
|
|
57
83
|
square: string;
|
|
58
84
|
};
|
|
85
|
+
color: {
|
|
86
|
+
teal: string;
|
|
87
|
+
plum: string;
|
|
88
|
+
purple: string;
|
|
89
|
+
orange: string;
|
|
90
|
+
neutral: string;
|
|
91
|
+
warning: string;
|
|
92
|
+
success: string;
|
|
93
|
+
info: string;
|
|
94
|
+
danger: string;
|
|
95
|
+
promo: string;
|
|
96
|
+
primary: string;
|
|
97
|
+
};
|
|
59
98
|
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
60
99
|
size: {
|
|
61
100
|
xs: string;
|
|
@@ -68,6 +107,19 @@ declare const avatarPlaceholder: import('tailwind-variants').TVReturnType<{
|
|
|
68
107
|
circle: string;
|
|
69
108
|
square: string;
|
|
70
109
|
};
|
|
110
|
+
color: {
|
|
111
|
+
teal: string;
|
|
112
|
+
plum: string;
|
|
113
|
+
purple: string;
|
|
114
|
+
orange: string;
|
|
115
|
+
neutral: string;
|
|
116
|
+
warning: string;
|
|
117
|
+
success: string;
|
|
118
|
+
info: string;
|
|
119
|
+
danger: string;
|
|
120
|
+
promo: string;
|
|
121
|
+
primary: string;
|
|
122
|
+
};
|
|
71
123
|
}, undefined, undefined, unknown, unknown, undefined>>>;
|
|
72
124
|
type AvatarFallbackBaseProps = Pick<React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>, 'delayMs'>;
|
|
73
125
|
type AvatarFallbackInitialsProps = AvatarFallbackBaseProps & {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import * as
|
|
5
|
-
import { useAvatarContext as
|
|
6
|
-
import { avatarBase as
|
|
7
|
-
import { getInitials as
|
|
8
|
-
const
|
|
9
|
-
extend:
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { uyTv as n, uyMerge as b } from "@payfit/unity-themes";
|
|
4
|
+
import * as e from "@radix-ui/react-avatar";
|
|
5
|
+
import { useAvatarContext as f } from "../Avatar.context.js";
|
|
6
|
+
import { avatarBase as s } from "../Avatar.variants.js";
|
|
7
|
+
import { getInitials as h } from "../utils.js";
|
|
8
|
+
const v = n({
|
|
9
|
+
extend: s,
|
|
10
10
|
slots: {
|
|
11
11
|
base: "uy:absolute uy:overflow-hidden",
|
|
12
12
|
background: "",
|
|
@@ -28,9 +28,9 @@ const h = t({
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
}), w =
|
|
32
|
-
extend:
|
|
33
|
-
base: "uy:absolute uy:flex uy:h-full uy:w-full uy:items-center uy:justify-center uy:text-content-neutral uy:bg-surface-neutral-
|
|
31
|
+
}), w = n({
|
|
32
|
+
extend: s,
|
|
33
|
+
base: "uy:absolute uy:flex uy:h-full uy:w-full uy:items-center uy:justify-center uy:text-content-neutral uy:bg-surface-neutral-lowest",
|
|
34
34
|
variants: {
|
|
35
35
|
size: {
|
|
36
36
|
xs: "uy:typography-body-small-strong",
|
|
@@ -40,47 +40,46 @@ const h = t({
|
|
|
40
40
|
xl: "uy:typography-h2"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
}), x =
|
|
44
|
-
const c =
|
|
43
|
+
}), x = m.forwardRef(({ variant: u, color: i, children: y, ...r }, o) => {
|
|
44
|
+
const c = f(), { size: t, variant: l } = c;
|
|
45
45
|
if (u === "placeholder") {
|
|
46
|
-
const { base: d, background: g, foreground:
|
|
47
|
-
color:
|
|
48
|
-
size:
|
|
49
|
-
variant:
|
|
46
|
+
const { base: d, background: g, foreground: p } = v({
|
|
47
|
+
color: i,
|
|
48
|
+
size: t,
|
|
49
|
+
variant: l
|
|
50
50
|
});
|
|
51
|
-
return /* @__PURE__ */ a(
|
|
51
|
+
return /* @__PURE__ */ a(e.Fallback, { ref: o, role: "presentation", ...r, children: /* @__PURE__ */ a(
|
|
52
52
|
"svg",
|
|
53
53
|
{
|
|
54
54
|
role: "img",
|
|
55
55
|
"aria-hidden": !0,
|
|
56
56
|
xmlns: "http://www.w3.org/2000/svg",
|
|
57
57
|
viewBox: "0 0 16 16",
|
|
58
|
-
className:
|
|
59
|
-
...r,
|
|
58
|
+
className: b(d(), g()),
|
|
60
59
|
children: /* @__PURE__ */ a(
|
|
61
60
|
"path",
|
|
62
61
|
{
|
|
63
|
-
className:
|
|
62
|
+
className: p(),
|
|
64
63
|
fillRule: "evenodd",
|
|
65
64
|
d: "M0 8.322c.245.06.49.117.732.17 2.113.455 3.727.487 4.79.12.478-.166.824-.405 1.09-.732.276-.336.567-.888.737-1.82.4-2.19.02-3.485-.47-4.283C6.407 1.012 5.665.432 4.732 0h6.861c.904 1.906 1.173 4.227.674 6.959-.29 1.587-.871 2.97-1.784 4.086-.921 1.126-2.08 1.86-3.328 2.292-2.283.789-4.872.574-7.156.11V8.322Z",
|
|
66
65
|
clipRule: "evenodd"
|
|
67
66
|
}
|
|
68
67
|
)
|
|
69
68
|
}
|
|
70
|
-
);
|
|
69
|
+
) });
|
|
71
70
|
}
|
|
72
71
|
return /* @__PURE__ */ a(
|
|
73
|
-
|
|
72
|
+
e.Fallback,
|
|
74
73
|
{
|
|
75
|
-
ref:
|
|
74
|
+
ref: o,
|
|
76
75
|
role: "presentation",
|
|
77
|
-
className: w({ size:
|
|
76
|
+
className: w({ size: t, variant: l }),
|
|
78
77
|
...r,
|
|
79
|
-
children:
|
|
78
|
+
children: h(y)
|
|
80
79
|
}
|
|
81
80
|
);
|
|
82
81
|
});
|
|
83
|
-
x.displayName =
|
|
82
|
+
x.displayName = e.Fallback.displayName;
|
|
84
83
|
export {
|
|
85
84
|
x as AvatarFallback
|
|
86
85
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IconProps } from '@payfit/unity-icons';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type AvatarIconProps = Omit<IconProps, 'size' | 'color'>;
|
|
4
|
+
/**
|
|
5
|
+
* The AvatarIcon component displays an icon within an Avatar component, using the Unity icon system.
|
|
6
|
+
* It automatically sizes the icon based on the parent Avatar's size and inherits the text color from the Avatar's color variant.
|
|
7
|
+
* @param {AvatarIconProps} props - Props for the AvatarIcon component
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { Avatar, AvatarIcon } from '@payfit/unity-components'
|
|
11
|
+
*
|
|
12
|
+
* function Example() {
|
|
13
|
+
* return (
|
|
14
|
+
* <Avatar size="lg" color="teal" variant="circle" aria-label="Vacation">
|
|
15
|
+
* <AvatarIcon src="PalmFilled" alt="Palm tree" />
|
|
16
|
+
* </Avatar>
|
|
17
|
+
* )
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
* @remarks
|
|
21
|
+
* - Must be used as a child of an Avatar component
|
|
22
|
+
* - Icons automatically scale: 20px for small to large avatars, 24px for extra-large avatars
|
|
23
|
+
* - The icon color is inherited from the parent Avatar's text color
|
|
24
|
+
* @see {@link AvatarIconProps} for all available props
|
|
25
|
+
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/avatar/parts GitHub}
|
|
26
|
+
* @see Design specs {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=19-3741 Figma}
|
|
27
|
+
* @see Design docs in {@link https://www.payfit.design/24f360409/p/69c10a-avatar Payfit.design}
|
|
28
|
+
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-avatar-avataricon unity-components.payfit.io}
|
|
29
|
+
*/
|
|
30
|
+
declare const AvatarIcon: React.ForwardRefExoticComponent<AvatarIconProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
export { AvatarIcon };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { IconSprite as p } from "@payfit/unity-icons";
|
|
4
|
+
import * as a from "@payfit/unity-themes/tokens/spacings.json";
|
|
5
|
+
import { useAvatarContext as u } from "../Avatar.context.js";
|
|
6
|
+
const r = (e) => parseInt(e.replace("px", "").trim(), 10), m = {
|
|
7
|
+
xl: r(a.spacing[500].$value),
|
|
8
|
+
lg: r(a.spacing[300].$value),
|
|
9
|
+
md: r(a.spacing[250].$value),
|
|
10
|
+
sm: r(a.spacing[200].$value),
|
|
11
|
+
xs: r(a.spacing[150].$value),
|
|
12
|
+
default: r(a.spacing[250].$value)
|
|
13
|
+
}, f = c.forwardRef(
|
|
14
|
+
({ src: e, alt: o = "", className: s }, l) => {
|
|
15
|
+
const { size: n } = u(), t = m[n];
|
|
16
|
+
return /* @__PURE__ */ i(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
"data-dd-privacy": "allow",
|
|
20
|
+
ref: l,
|
|
21
|
+
role: "img",
|
|
22
|
+
className: `uy:flex uy:items-center uy:justify-center uy:w-full uy:h-full ${s || ""}`,
|
|
23
|
+
"aria-label": o,
|
|
24
|
+
children: /* @__PURE__ */ i(
|
|
25
|
+
p,
|
|
26
|
+
{
|
|
27
|
+
src: e,
|
|
28
|
+
width: t,
|
|
29
|
+
height: t,
|
|
30
|
+
fill: "currentColor"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
f.displayName = "AvatarIcon";
|
|
38
|
+
export {
|
|
39
|
+
f as AvatarIcon
|
|
40
|
+
};
|
|
@@ -9,7 +9,7 @@ const g = y({
|
|
|
9
9
|
success: "uy:bg-surface-success-low uy:text-content-success-high",
|
|
10
10
|
warning: "uy:bg-surface-warning-low uy:text-content-warning-high",
|
|
11
11
|
danger: "uy:bg-surface-danger-low uy:text-content-danger-high",
|
|
12
|
-
neutral: "uy:bg-surface-neutral-
|
|
12
|
+
neutral: "uy:bg-surface-neutral-lowest uy:text-content-neutral",
|
|
13
13
|
promo: "uy:bg-surface-promo-low uy:text-content-promo-high",
|
|
14
14
|
attention: "uy:bg-surface-danger uy:text-content-inverted",
|
|
15
15
|
numeric: "uy:bg-surface-info-low uy:text-content-info-high",
|
|
@@ -2,7 +2,7 @@ import { uyTv as a } from "@payfit/unity-themes";
|
|
|
2
2
|
const r = a({
|
|
3
3
|
slots: {
|
|
4
4
|
base: "uy:flex uy:gap-50 uy:list-none uy:text-content-neutral-enabled uy:typography-action",
|
|
5
|
-
breadcrumb: "uy:flex uy:gap-50 uy:sm:leading-[1.75] uy:
|
|
5
|
+
breadcrumb: "uy:flex uy:gap-50 uy:sm:leading-[1.75] uy:items-center"
|
|
6
6
|
},
|
|
7
7
|
variants: {
|
|
8
8
|
wrap: {
|