@povio/ui 3.4.0-rc.15 → 3.4.0-rc.17
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/README.md +1 -1
- package/dist/assets/locales/en/{translation.json.js → translation.js} +1 -0
- package/dist/assets/locales/sl/{translation.json.js → translation.js} +1 -0
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +39 -40
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +5 -5
- package/dist/components/Menu/MenuDesktop.js +2 -2
- package/dist/components/Menu/MenuItem.d.ts +6 -3
- package/dist/components/Menu/MenuItem.js +2 -2
- package/dist/components/Menu/MenuMobile.js +3 -3
- package/dist/components/Menu/MenuPopover.d.ts +7 -5
- package/dist/components/Menu/MenuPopover.js +2 -2
- package/dist/components/Menu/menu.cva.d.ts +35 -35
- package/dist/components/Menu/menu.cva.js +4 -4
- package/dist/components/accordion.d.ts +5 -0
- package/dist/components/accordion.js +81 -0
- package/dist/components/action-modal.d.ts +26 -0
- package/dist/components/action-modal.js +188 -0
- package/dist/components/alert.d.ts +14 -0
- package/dist/components/alert.js +114 -0
- package/dist/components/autocomplete.d.ts +16 -0
- package/dist/components/{inputs/Selection/Autocomplete/Autocomplete.js → autocomplete.js} +34 -64
- package/dist/components/bottom-sheet.d.ts +34 -0
- package/dist/components/{overlays/BottomSheet/BottomSheet.js → bottom-sheet.js} +17 -14
- package/dist/components/breadcrumbs.d.ts +19 -0
- package/dist/components/breadcrumbs.js +263 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +2 -0
- package/dist/components/buttons/Button/Button.d.ts +25 -23
- package/dist/components/buttons/Button/Button.js +1 -1
- package/dist/components/buttons/Button/button.cva.d.ts +89 -95
- package/dist/components/buttons/Button/button.cva.js +8 -44
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -38
- package/dist/components/buttons/PillButton/pillButton.cva.js +5 -5
- package/dist/components/buttons/shared/ButtonContent.js +81 -23
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +6 -8
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -1
- package/dist/components/checkbox-group.d.ts +28 -0
- package/dist/components/checkbox-group.js +163 -0
- package/dist/components/checkbox.d.ts +24 -0
- package/dist/components/checkbox.js +80 -0
- package/dist/components/date-picker.d.ts +2 -0
- package/dist/components/date-picker.js +2 -0
- package/dist/components/date-range-picker.d.ts +2 -0
- package/dist/components/date-range-picker.js +2 -0
- package/dist/components/date-time-picker.d.ts +2 -0
- package/dist/components/date-time-picker.js +2 -0
- package/dist/components/drawer.d.ts +18 -0
- package/dist/components/{overlays/Drawer/Drawer.js → drawer.js} +4 -4
- package/dist/components/file-upload-container.d.ts +5 -0
- package/dist/components/file-upload-container.js +15 -0
- package/dist/components/file-upload.d.ts +7 -0
- package/dist/components/{inputs/File/FileUpload.js → file-upload.js} +59 -98
- package/dist/components/form-field.d.ts +24 -0
- package/dist/components/form-field.js +47 -0
- package/dist/components/icon-button.d.ts +14 -0
- package/dist/components/{buttons/IconButton/IconButton.js → icon-button.js} +3 -3
- package/dist/components/inline-icon-button.d.ts +16 -0
- package/dist/components/inline-icon-button.js +40 -0
- package/dist/components/input-upload.d.ts +7 -0
- package/dist/components/input-upload.js +118 -0
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +1 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +73 -89
- package/dist/components/inputs/Checkbox/checkbox.cva.js +8 -8
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +40 -37
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +44 -36
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +46 -43
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +174 -170
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +41 -38
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -20
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +29 -26
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +166 -542
- package/dist/components/inputs/DateTime/shared/Calendar.js +17 -14
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +18 -18
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +6 -5
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +9 -8
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +45 -45
- package/dist/components/inputs/DateTime/shared/DateField.js +19 -20
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +11 -45
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +3 -3
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +26 -102
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +29 -84
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +3 -3
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +59 -104
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +113 -283
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +73 -216
- package/dist/components/inputs/DateTime/shared/YearPicker.js +69 -120
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +8 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -15
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +1 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +13 -52
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.js +1 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +13 -12
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +12 -26
- package/dist/components/inputs/File/fileUpload.types.d.ts +87 -84
- package/dist/components/inputs/File/inputUpload.types.d.ts +34 -32
- package/dist/components/inputs/File/inputUpload.types.js +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +47 -110
- package/dist/components/inputs/File/shared/FileCardList.js +16 -54
- package/dist/components/inputs/File/shared/FileUploadContent.js +47 -188
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +3 -3
- package/dist/components/inputs/File/shared/FileUploadContentError.js +6 -6
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +6 -6
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +3 -3
- package/dist/components/inputs/File/shared/InputUploadContent.js +38 -151
- package/dist/components/inputs/File/shared/InputUploadFilled.js +10 -50
- package/dist/components/inputs/File/shared/ProgressBar.d.ts +6 -4
- package/dist/components/inputs/File/shared/ProgressBar.js +2 -2
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +17 -16
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +24 -25
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +5 -5
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +34 -33
- package/dist/components/inputs/File/shared/progressBar.cva.js +5 -5
- package/dist/components/inputs/FormField/FormFieldError.d.ts +9 -6
- package/dist/components/inputs/FormField/FormFieldError.js +6 -24
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +15 -13
- package/dist/components/inputs/FormField/FormFieldHeader.js +24 -80
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +7 -25
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldError.cva.js +1 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +1 -1
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +13 -12
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +1 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +11 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +121 -554
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -7
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +1 -1
- package/dist/components/inputs/Input/shared/InputContent.d.ts +25 -27
- package/dist/components/inputs/Input/shared/InputContent.js +61 -195
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +1 -1
- package/dist/components/inputs/Inputs/Form.d.ts +19 -19
- package/dist/components/inputs/Inputs/Form.js +23 -51
- package/dist/components/inputs/Inputs/InputItem.d.ts +77 -58
- package/dist/components/inputs/Inputs/InputItem.js +29 -78
- package/dist/components/inputs/Inputs/Inputs.d.ts +12 -9
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +49 -59
- package/dist/components/inputs/RadioGroup/radio.cva.js +6 -6
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +25 -38
- package/dist/components/inputs/Selection/Select/Select.d.ts +15 -11
- package/dist/components/inputs/Selection/Select/Select.js +36 -112
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +39 -37
- package/dist/components/inputs/Selection/shared/SelectBase.js +26 -70
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +145 -393
- package/dist/components/inputs/Selection/shared/SelectInput.js +162 -429
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +27 -101
- package/dist/components/inputs/Selection/shared/SelectListBox.js +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +24 -72
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +10 -59
- package/dist/components/inputs/Selection/shared/SelectMobile.js +4 -4
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +14 -39
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +8 -15
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +6 -6
- package/dist/components/inputs/Selection/shared/select.context.js +52 -52
- package/dist/components/inputs/Selection/shared/select.types.d.ts +60 -62
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +8 -5
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -11
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -15
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +1 -1
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +3 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +12 -12
- package/dist/components/inputs/Skeleton/InputFrame.js +30 -30
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +24 -20
- package/dist/components/inputs/TextEditor/TextEditor.js +22 -63
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +31 -103
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +48 -197
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +33 -93
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +55 -127
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +39 -142
- package/dist/components/inputs/TextEditor/textEditor.types.js +1 -1
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +15 -18
- package/dist/components/inputs/Toggle/toggle.cva.js +3 -3
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.js +31 -103
- package/dist/components/inputs/shared/TooltipWrapper.js +14 -49
- package/dist/components/inputs/shared/form.binding.d.ts +7 -27
- package/dist/components/inputs/shared/form.binding.js +8 -37
- package/dist/components/inputs/shared/form.types.d.ts +11 -11
- package/dist/components/inputs/shared/form.types.js +1 -1
- package/dist/components/inputs/shared/input.cva.d.ts +76 -85
- package/dist/components/inputs/shared/input.cva.js +9 -19
- package/dist/components/inputs/shared/label.cva.d.ts +18 -18
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +10 -7
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +1 -1
- package/dist/components/inputs/shared/useFieldAccessibility.js +19 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +50 -105
- package/dist/components/link.d.ts +11 -0
- package/dist/components/{text/Link/Link.js → link.js} +7 -7
- package/dist/components/loader.d.ts +7 -0
- package/dist/components/{status/Loader/Loader.js → loader.js} +2 -2
- package/dist/components/menu.d.ts +23 -0
- package/dist/components/{Menu/Menu.js → menu.js} +4 -4
- package/dist/components/modal.d.ts +2 -0
- package/dist/components/modal.js +2 -0
- package/dist/components/navigation/Accordion/AccordionItem.js +87 -42
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +76 -100
- package/dist/components/navigation/Accordion/accordion.cva.js +10 -10
- package/dist/components/navigation/Accordion/accordion.types.d.ts +52 -49
- package/dist/components/navigation/Stepper/StepperItem.js +3 -3
- package/dist/components/navigation/Stepper/StepperSeparator.js +1 -1
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +73 -86
- package/dist/components/navigation/Stepper/stepper.cva.js +7 -7
- package/dist/components/navigation/Stepper/stepper.types.d.ts +29 -37
- package/dist/components/number-input.d.ts +27 -0
- package/dist/components/number-input.js +245 -0
- package/dist/components/number-range-input.d.ts +39 -0
- package/dist/components/number-range-input.js +267 -0
- package/dist/components/outline.clsx.d.ts +4 -2
- package/dist/components/outline.clsx.js +2 -2
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +3 -3
- package/dist/components/overlays/Modal/Modal.d.ts +18 -14
- package/dist/components/overlays/Modal/Modal.js +4 -2
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -34
- package/dist/components/overlays/Modal/modal.cva.js +4 -4
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +39 -45
- package/dist/components/overlays/Tooltip/tooltip.cva.js +4 -4
- package/dist/components/pagination.d.ts +12 -0
- package/dist/components/pagination.js +131 -0
- package/dist/components/password-input.d.ts +10 -0
- package/dist/components/password-input.js +23 -0
- package/dist/components/pill-button.d.ts +15 -0
- package/dist/components/{buttons/PillButton/PillButton.js → pill-button.js} +5 -5
- package/dist/components/pill.d.ts +18 -0
- package/dist/components/{text/Pill/Pill.js → pill.js} +6 -6
- package/dist/components/query-autocomplete.d.ts +8 -0
- package/dist/components/query-autocomplete.js +105 -0
- package/dist/components/query-select.d.ts +19 -0
- package/dist/components/query-select.js +115 -0
- package/dist/components/radio-group.d.ts +24 -0
- package/dist/components/radio-group.js +165 -0
- package/dist/components/responsive-popover.d.ts +19 -0
- package/dist/components/responsive-popover.js +126 -0
- package/dist/components/segment/SegmentItem.js +3 -3
- package/dist/components/segment/segment.cva.d.ts +20 -18
- package/dist/components/segment/segment.cva.js +2 -2
- package/dist/components/segment/segment.types.d.ts +33 -30
- package/dist/components/segment.d.ts +7 -0
- package/dist/components/{segment/Segment.js → segment.js} +8 -8
- package/dist/components/select.d.ts +4 -0
- package/dist/components/select.js +2 -0
- package/dist/components/shared/pagination/PaginationList.d.ts +17 -14
- package/dist/components/shared/pagination/PaginationList.js +2 -2
- package/dist/components/shared/pagination/minWidth.cva.js +1 -1
- package/dist/components/shared/popover.cva.d.ts +8 -7
- package/dist/components/shared/popover.cva.js +1 -1
- package/dist/components/slider.d.ts +22 -0
- package/dist/components/slider.js +103 -0
- package/dist/components/split-button.d.ts +15 -0
- package/dist/components/{buttons/SplitButton/SplitButton.js → split-button.js} +5 -5
- package/dist/components/status/Alert/alert.cva.d.ts +21 -18
- package/dist/components/status/Alert/alert.cva.js +1 -1
- package/dist/components/status/Loader/loader.cva.d.ts +23 -26
- package/dist/components/status/Loader/loader.cva.js +4 -4
- package/dist/components/status/Toast/toast.cva.d.ts +58 -77
- package/dist/components/status/Toast/toast.cva.js +6 -6
- package/dist/components/status/Toast/useToast.d.ts +14 -11
- package/dist/components/status/Toast/useToast.js +2 -2
- package/dist/components/status/shared/status.cva.d.ts +32 -28
- package/dist/components/status/shared/status.cva.js +2 -2
- package/dist/components/stepper.d.ts +5 -0
- package/dist/components/stepper.js +79 -0
- package/dist/components/table/CellText.d.ts +10 -7
- package/dist/components/table/CellText.js +4 -3
- package/dist/components/table/ColumnConfig.d.ts +12 -9
- package/dist/components/table/ColumnConfig.js +8 -7
- package/dist/components/table/HeaderText.d.ts +10 -7
- package/dist/components/table/HeaderText.js +4 -3
- package/dist/components/table/InfiniteTable.d.ts +10 -8
- package/dist/components/table/InfiniteTable.js +68 -17
- package/dist/components/table/PaginatedTable.d.ts +12 -10
- package/dist/components/table/PaginatedTable.js +2 -2
- package/dist/components/table/Table.d.ts +34 -35
- package/dist/components/table/Table.js +19 -17
- package/dist/components/table/table.cva.d.ts +40 -59
- package/dist/components/table/table.cva.js +7 -7
- package/dist/components/tag.d.ts +18 -0
- package/dist/components/{text/Tag/Tag.js → tag.js} +6 -6
- package/dist/components/text/Link/link.cva.d.ts +14 -11
- package/dist/components/text/Link/link.cva.js +1 -1
- package/dist/components/text/Tag/tag.cva.d.ts +18 -15
- package/dist/components/text/Tag/tag.cva.js +1 -1
- package/dist/components/text/Typography/typography.cva.d.ts +51 -48
- package/dist/components/text/Typography/typography.cva.js +1 -1
- package/dist/components/text-area.d.ts +21 -0
- package/dist/components/text-area.js +138 -0
- package/dist/components/text-button.d.ts +15 -0
- package/dist/components/{buttons/TextButton/TextButton.js → text-button.js} +2 -2
- package/dist/components/text-input.d.ts +27 -0
- package/dist/components/text-input.js +241 -0
- package/dist/components/time-picker.d.ts +2 -0
- package/dist/components/time-picker.js +2 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/{status/Toast/Toast.js → toast.js} +11 -11
- package/dist/components/toggle-button.d.ts +12 -0
- package/dist/components/{buttons/ToggleButton/ToggleButton.js → toggle-button.js} +2 -2
- package/dist/components/toggle.d.ts +19 -0
- package/dist/components/toggle.js +74 -0
- package/dist/components/tooltip-ellipsis.d.ts +11 -0
- package/dist/components/{overlays/Tooltip/TooltipEllipsis.js → tooltip-ellipsis.js} +3 -3
- package/dist/components/tooltip.d.ts +16 -0
- package/dist/components/{overlays/Tooltip/Tooltip.js → tooltip.js} +9 -9
- package/dist/components/typography.d.ts +12 -0
- package/dist/components/typography.js +31 -0
- package/dist/config/confirmation.context.d.ts +22 -19
- package/dist/config/confirmation.context.js +3 -3
- package/dist/config/i18n.d.ts +311 -308
- package/dist/config/i18n.js +4 -4
- package/dist/config/link.context.d.ts +9 -7
- package/dist/config/link.context.js +2 -2
- package/dist/config/router.context.d.ts +11 -9
- package/dist/config/router.context.js +2 -2
- package/dist/config/theme.context.d.ts +19 -16
- package/dist/config/theme.context.js +99 -46
- package/dist/config/uiConfig.context.d.ts +80 -75
- package/dist/config/uiConfig.context.js +46 -9
- package/dist/config/uiOverrides.context.d.ts +205 -204
- package/dist/config/uiOverrides.context.js +2 -2
- package/dist/helpers/dynamicColumns.d.ts +27 -28
- package/dist/helpers/dynamicColumns.js +32 -31
- package/dist/helpers/dynamicInputs.d.ts +66 -74
- package/dist/helpers/dynamicInputs.js +21 -20
- package/dist/hooks/useAutosave.d.ts +12 -9
- package/dist/hooks/useAutosave.js +1 -1
- package/dist/hooks/useBreakpoint.d.ts +4 -2
- package/dist/hooks/useBreakpoint.js +37 -10
- package/dist/hooks/useDebounceCallback.d.ts +7 -4
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useDeepCompare.d.ts +7 -4
- package/dist/hooks/useDeepCompare.js +4 -4
- package/dist/hooks/useFilters.d.ts +10 -7
- package/dist/hooks/useFilters.js +8 -6
- package/dist/hooks/useForm.d.ts +35 -35
- package/dist/hooks/useForm.js +6 -6
- package/dist/hooks/useFormAutosave.d.ts +16 -13
- package/dist/hooks/useFormAutosave.js +18 -17
- package/dist/hooks/useIntersectionObserver.d.ts +7 -5
- package/dist/hooks/useIntersectionObserver.js +2 -2
- package/dist/hooks/useKeyInteractions.d.ts +19 -16
- package/dist/hooks/useKeyInteractions.js +5 -5
- package/dist/hooks/useLocalStorage.d.ts +10 -8
- package/dist/hooks/useLocalStorage.js +3 -3
- package/dist/hooks/useLongPressRepeat.d.ts +10 -7
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.d.ts +9 -6
- package/dist/hooks/usePagination.js +2 -2
- package/dist/hooks/useQueryAutocomplete.js +2 -2
- package/dist/hooks/useScrollableListBox.d.ts +5 -2
- package/dist/hooks/useScrollableListBox.js +1 -1
- package/dist/hooks/useSorting.d.ts +8 -5
- package/dist/hooks/useSorting.js +1 -1
- package/dist/hooks/useStateAndRef.d.ts +5 -3
- package/dist/hooks/useStateAndRef.js +2 -2
- package/dist/hooks/useTableColumnConfig.d.ts +15 -13
- package/dist/hooks/useTableColumnConfig.js +1 -1
- package/dist/hooks/useTableNav.d.ts +79 -77
- package/dist/hooks/useTableNav.js +19 -37
- package/dist/hooks/useTranslationMemo.d.ts +5 -3
- package/dist/index.d.ts +145 -1
- package/dist/index.js +29 -29
- package/dist/rhf/Inputs.d.ts +55 -54
- package/dist/rhf/Inputs.js +62 -17
- package/dist/rhf/autocomplete.d.ts +3 -0
- package/dist/rhf/autocomplete.js +2 -0
- package/dist/rhf/checkbox-group.d.ts +3 -0
- package/dist/rhf/checkbox-group.js +2 -0
- package/dist/rhf/checkbox.d.ts +3 -0
- package/dist/rhf/checkbox.js +2 -0
- package/dist/rhf/components.d.ts +77 -75
- package/dist/rhf/components.js +43 -43
- package/dist/rhf/date-picker.d.ts +3 -0
- package/dist/rhf/date-picker.js +2 -0
- package/dist/rhf/date-range-picker.d.ts +3 -0
- package/dist/rhf/date-range-picker.js +2 -0
- package/dist/rhf/date-time-picker.d.ts +3 -0
- package/dist/rhf/date-time-picker.js +2 -0
- package/dist/rhf/dynamicInputs.d.ts +16 -14
- package/dist/rhf/dynamicInputs.js +1 -1
- package/dist/rhf/entry.utils.js +5 -0
- package/dist/rhf/fieldAdapter.d.ts +8 -6
- package/dist/rhf/form.types.d.ts +11 -10
- package/dist/rhf/number-input.d.ts +8 -0
- package/dist/rhf/number-input.js +7 -0
- package/dist/rhf/number-range-input.d.ts +8 -0
- package/dist/rhf/number-range-input.js +7 -0
- package/dist/rhf/password-input.d.ts +8 -0
- package/dist/rhf/password-input.js +7 -0
- package/dist/rhf/query-autocomplete.d.ts +2 -0
- package/dist/rhf/query-autocomplete.js +2 -0
- package/dist/rhf/query-select.d.ts +2 -0
- package/dist/rhf/query-select.js +2 -0
- package/dist/rhf/radio-group.d.ts +3 -0
- package/dist/rhf/radio-group.js +2 -0
- package/dist/rhf/segment.d.ts +3 -0
- package/dist/rhf/segment.js +2 -0
- package/dist/rhf/select.d.ts +3 -0
- package/dist/rhf/select.js +2 -0
- package/dist/rhf/slider.d.ts +3 -0
- package/dist/rhf/slider.js +2 -0
- package/dist/rhf/text-area.d.ts +8 -0
- package/dist/rhf/text-area.js +7 -0
- package/dist/rhf/text-input.d.ts +8 -0
- package/dist/rhf/text-input.js +7 -0
- package/dist/rhf/time-picker.d.ts +3 -0
- package/dist/rhf/time-picker.js +2 -0
- package/dist/rhf/toggle.d.ts +3 -0
- package/dist/rhf/toggle.js +2 -0
- package/dist/rhf/useAutosave.d.ts +12 -9
- package/dist/rhf/useForm.d.ts +13 -13
- package/dist/rhf/useFormAutosave.d.ts +17 -14
- package/dist/rhf/useFormAutosave.js +121 -34
- package/dist/rhf.d.ts +146 -225
- package/dist/rhf.js +120 -0
- package/dist/tanstack/autocomplete.d.ts +2 -0
- package/dist/tanstack/autocomplete.js +2 -0
- package/dist/tanstack/checkbox-group.d.ts +2 -0
- package/dist/tanstack/checkbox-group.js +2 -0
- package/dist/tanstack/checkbox.d.ts +2 -0
- package/dist/tanstack/checkbox.js +2 -0
- package/dist/tanstack/date-picker.d.ts +2 -0
- package/dist/tanstack/date-picker.js +2 -0
- package/dist/tanstack/date-range-picker.d.ts +2 -0
- package/dist/tanstack/date-range-picker.js +2 -0
- package/dist/tanstack/date-time-picker.d.ts +2 -0
- package/dist/tanstack/date-time-picker.js +2 -0
- package/dist/tanstack/form.d.ts +3 -0
- package/dist/tanstack/form.js +3 -0
- package/dist/tanstack/number-input.d.ts +2 -0
- package/dist/tanstack/number-input.js +2 -0
- package/dist/tanstack/number-range-input.d.ts +3 -0
- package/dist/tanstack/number-range-input.js +2 -0
- package/dist/tanstack/password-input.d.ts +2 -0
- package/dist/tanstack/password-input.js +2 -0
- package/dist/tanstack/query-autocomplete.d.ts +2 -0
- package/dist/tanstack/query-autocomplete.js +2 -0
- package/dist/tanstack/query-select.d.ts +2 -0
- package/dist/tanstack/query-select.js +2 -0
- package/dist/tanstack/radio-group.d.ts +2 -0
- package/dist/tanstack/radio-group.js +2 -0
- package/dist/tanstack/segment.d.ts +3 -0
- package/dist/tanstack/segment.js +2 -0
- package/dist/tanstack/select.d.ts +2 -0
- package/dist/tanstack/select.js +2 -0
- package/dist/tanstack/slider.d.ts +2 -0
- package/dist/tanstack/slider.js +2 -0
- package/dist/tanstack/table.d.ts +12 -0
- package/dist/tanstack/table.js +11 -0
- package/dist/tanstack/text-area.d.ts +2 -0
- package/dist/tanstack/text-area.js +2 -0
- package/dist/tanstack/text-input.d.ts +2 -0
- package/dist/tanstack/text-input.js +2 -0
- package/dist/tanstack/time-picker.d.ts +2 -0
- package/dist/tanstack/time-picker.js +2 -0
- package/dist/tanstack/toggle.d.ts +2 -0
- package/dist/tanstack/toggle.js +2 -0
- package/dist/tanstack.d.ts +151 -224
- package/dist/tanstack.js +45 -45
- package/dist/text-editor.d.ts +2 -2
- package/dist/tw-ui-plugin.d.ts +4 -2
- package/dist/tw-ui-plugin.js +1 -1
- package/dist/types/common.d.ts +11 -12
- package/dist/types/error-handling.d.ts +8 -5
- package/dist/utils/array.utils.d.ts +5 -2
- package/dist/utils/array.utils.js +1 -1
- package/dist/utils/compoundMapper.d.ts +12 -14
- package/dist/utils/compoundMapper.js +1 -1
- package/dist/utils/date-time.utils.d.ts +44 -41
- package/dist/utils/date-time.utils.js +7 -9
- package/dist/utils/date.utils.d.ts +6 -4
- package/dist/utils/date.utils.js +29 -6
- package/dist/utils/dom.utils.d.ts +7 -4
- package/dist/utils/dom.utils.js +2 -2
- package/dist/utils/file.utils.d.ts +20 -12
- package/dist/utils/file.utils.js +19 -8
- package/dist/utils/intl.utils.d.ts +7 -5
- package/dist/utils/intl.utils.js +2 -2
- package/dist/utils/isEqual.d.ts +4 -1
- package/dist/utils/isEqual.js +3 -3
- package/dist/utils/logger.d.ts +9 -6
- package/dist/utils/logger.js +1 -1
- package/dist/utils/object.utils.d.ts +12 -9
- package/dist/utils/object.utils.js +1 -1
- package/dist/utils/queries.utils.d.ts +6 -3
- package/dist/utils/queries.utils.js +1 -1
- package/dist/utils/query.utils.js +1 -1
- package/dist/utils/routing.utils.d.ts +6 -3
- package/dist/utils/routing.utils.js +1 -1
- package/dist/utils/string.utils.d.ts +6 -3
- package/dist/utils/string.utils.js +1 -1
- package/dist/utils/style-merge.util.d.ts +38 -41
- package/dist/utils/style-merge.util.js +7 -4
- package/dist/utils/zod.utils.d.ts +22 -19
- package/dist/utils/zod.utils.js +1 -1
- package/package.json +475 -8
- package/dist/assets/locales/en/translation.json.d.ts +0 -158
- package/dist/assets/locales/sl/translation.json.d.ts +0 -154
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -16
- package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -112
- package/dist/components/Menu/Menu.d.ts +0 -21
- package/dist/components/Menu/MenuDesktop.d.ts +0 -2
- package/dist/components/Menu/MenuMobile.d.ts +0 -2
- package/dist/components/buttons/IconButton/IconButton.d.ts +0 -11
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +0 -13
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -15
- package/dist/components/buttons/PillButton/PillButton.d.ts +0 -12
- package/dist/components/buttons/SplitButton/SplitButton.d.ts +0 -12
- package/dist/components/buttons/TextButton/TextButton.d.ts +0 -12
- package/dist/components/buttons/ToggleButton/ToggleButton.d.ts +0 -9
- package/dist/components/buttons/shared/ButtonContent.d.ts +0 -14
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -20
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -236
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +0 -9
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +0 -26
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +0 -392
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +0 -29
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +0 -22
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +0 -27
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +0 -18
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.d.ts +0 -17
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +0 -21
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +0 -18
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +0 -8
- package/dist/components/inputs/DateTime/shared/MonthPicker.d.ts +0 -11
- package/dist/components/inputs/DateTime/shared/RangeCalendar.d.ts +0 -26
- package/dist/components/inputs/DateTime/shared/TimeField.d.ts +0 -12
- package/dist/components/inputs/DateTime/shared/TimePickerForm.d.ts +0 -10
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +0 -25
- package/dist/components/inputs/DateTime/shared/YearPicker.d.ts +0 -12
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -41
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +0 -2
- package/dist/components/inputs/File/FileUpload.d.ts +0 -4
- package/dist/components/inputs/File/FileUploadContainer.d.ts +0 -3
- package/dist/components/inputs/File/FileUploadContainer.js +0 -22
- package/dist/components/inputs/File/InputUpload.d.ts +0 -4
- package/dist/components/inputs/File/InputUpload.js +0 -157
- package/dist/components/inputs/File/index.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileCard.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileCardList.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileUploadContent.d.ts +0 -10
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.d.ts +0 -9
- package/dist/components/inputs/File/shared/FileUploadContentError.d.ts +0 -11
- package/dist/components/inputs/File/shared/FileUploadContentFilled.d.ts +0 -11
- package/dist/components/inputs/File/shared/FileUploadContentLoading.d.ts +0 -9
- package/dist/components/inputs/File/shared/InputUploadContent.d.ts +0 -9
- package/dist/components/inputs/File/shared/InputUploadFilled.d.ts +0 -8
- package/dist/components/inputs/FormField/FormField.d.ts +0 -20
- package/dist/components/inputs/FormField/FormField.js +0 -127
- package/dist/components/inputs/FormField/FormFieldHeaderClose.d.ts +0 -5
- package/dist/components/inputs/FormField/FormFieldHelper.d.ts +0 -8
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +0 -13
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +0 -23
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -494
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -36
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -338
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +0 -7
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -61
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +0 -19
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -346
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +0 -23
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -470
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +0 -22
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -371
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +0 -12
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +0 -4
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -176
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -15
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -172
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +0 -15
- package/dist/components/inputs/Selection/shared/SelectInputTags.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.d.ts +0 -7
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.d.ts +0 -4
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +0 -32
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/useSelectItems.d.ts +0 -23
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -84
- package/dist/components/inputs/Slider/Slider.d.ts +0 -19
- package/dist/components/inputs/Slider/Slider.js +0 -285
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.d.ts +0 -7
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.d.ts +0 -10
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.d.ts +0 -6
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.d.ts +0 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.d.ts +0 -2
- package/dist/components/inputs/TextEditor/textEditor.types.d.ts +0 -5
- package/dist/components/inputs/Toggle/Toggle.d.ts +0 -16
- package/dist/components/inputs/Toggle/Toggle.js +0 -234
- package/dist/components/inputs/shared/CheckContent.d.ts +0 -9
- package/dist/components/inputs/shared/InputClear.d.ts +0 -10
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +0 -10
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -15
- package/dist/components/navigation/Accordion/Accordion.d.ts +0 -3
- package/dist/components/navigation/Accordion/Accordion.js +0 -34
- package/dist/components/navigation/Accordion/AccordionItem.d.ts +0 -2
- package/dist/components/navigation/Stepper/Stepper.d.ts +0 -2
- package/dist/components/navigation/Stepper/Stepper.js +0 -34
- package/dist/components/navigation/Stepper/StepperItem.d.ts +0 -2
- package/dist/components/navigation/Stepper/StepperSeparator.d.ts +0 -5
- package/dist/components/overlays/ActionModal/ActionModal.d.ts +0 -24
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -54
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +0 -32
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +0 -13
- package/dist/components/overlays/Drawer/Drawer.d.ts +0 -15
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +0 -17
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -45
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +0 -13
- package/dist/components/overlays/Tooltip/TooltipEllipsis.d.ts +0 -8
- package/dist/components/segment/Segment.d.ts +0 -4
- package/dist/components/segment/SegmentItem.d.ts +0 -2
- package/dist/components/shared/pagination/Pagination.d.ts +0 -9
- package/dist/components/shared/pagination/Pagination.js +0 -45
- package/dist/components/shared/pagination/minWidth.cva.d.ts +0 -3
- package/dist/components/status/Alert/Alert.d.ts +0 -11
- package/dist/components/status/Alert/Alert.js +0 -47
- package/dist/components/status/Loader/Loader.d.ts +0 -5
- package/dist/components/status/Toast/Toast.d.ts +0 -14
- package/dist/components/text/Link/Link.d.ts +0 -9
- package/dist/components/text/Pill/Pill.d.ts +0 -15
- package/dist/components/text/Tag/Tag.d.ts +0 -15
- package/dist/components/text/Typography/Typography.d.ts +0 -11
- package/dist/components/text/Typography/Typography.js +0 -16
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -13
- package/dist/rhf/entrypoints.type-test.d.ts +0 -1
- package/dist/types/react-query.d.ts +0 -6
- package/dist/utils/array.utils.spec.d.ts +0 -1
- package/dist/utils/compoundMapper.spec.d.ts +0 -1
- package/dist/utils/date-time.utils.spec.d.ts +0 -1
- package/dist/utils/date.utils.spec.d.ts +0 -1
- package/dist/utils/intl.utils.spec.d.ts +0 -1
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/rest.utils.d.ts +0 -10
- package/dist/utils/rest.utils.js +0 -33
- package/dist/utils/style-merge.util.spec.d.ts +0 -1
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
import { StepperItemVariantProps, StepperVariantProps } from
|
|
1
|
+
import { StepperItemVariantProps, StepperVariantProps } from "./stepper.cva.js";
|
|
2
|
+
//#region src/components/navigation/Stepper/stepper.types.d.ts
|
|
2
3
|
/** A single step definition passed by the consumer. */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
interface StepItem {
|
|
5
|
+
/** Unique key for React rendering. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Step title text. Rendered unless iconsOnly is true. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Optional subtext beneath the title. Only rendered in default (full) mode. */
|
|
10
|
+
subtext?: string;
|
|
10
11
|
}
|
|
11
|
-
/** Derived step status, computed from currentStep index. */
|
|
12
|
-
export type StepStatus = "completed" | "active" | "todo";
|
|
13
12
|
/** Public props for the Stepper component. */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
/** Internal props for StepperItem sub-component. */
|
|
34
|
-
export interface StepperItemProps extends StepperItemVariantProps {
|
|
35
|
-
step: StepItem;
|
|
36
|
-
stepNumber: number;
|
|
37
|
-
status: StepStatus;
|
|
38
|
-
iconsOnly?: boolean;
|
|
39
|
-
titlesOnly?: boolean;
|
|
40
|
-
onPress?: () => void;
|
|
13
|
+
interface StepperProps extends StepperVariantProps, StepperItemVariantProps {
|
|
14
|
+
/** Array of step definitions. Order determines step numbering (1-based). */
|
|
15
|
+
steps: StepItem[];
|
|
16
|
+
/**
|
|
17
|
+
* The current active step index (0-based).
|
|
18
|
+
* - Steps at index < currentStep are "completed"
|
|
19
|
+
* - Step at index === currentStep is "active"
|
|
20
|
+
* - Steps at index > currentStep are "todo"
|
|
21
|
+
*/
|
|
22
|
+
currentStep: number;
|
|
23
|
+
/** When true, only step indicator icons are rendered (no title or subtext). */
|
|
24
|
+
iconsOnly?: boolean;
|
|
25
|
+
/** When true, step indicator icons and titles are rendered (no subtext). Takes no effect if iconsOnly is true. */
|
|
26
|
+
titlesOnly?: boolean;
|
|
27
|
+
/** Callback when a completed step is clicked. Receives the 0-based step index. */
|
|
28
|
+
onStepClick?: (stepIndex: number) => void;
|
|
29
|
+
/** Optional className for the root container. */
|
|
30
|
+
className?: string;
|
|
41
31
|
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { StepItem, StepperProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FieldValues } from "./inputs/shared/form.binding.js";
|
|
2
|
+
import { ControlProps } from "./inputs/shared/form.types.js";
|
|
3
|
+
import { InputVariantProps } from "./inputs/shared/input.cva.js";
|
|
4
|
+
import { InputContentProps } from "./inputs/Input/shared/InputContent.js";
|
|
5
|
+
import { FormFieldProps } from "./form-field.js";
|
|
6
|
+
import { FocusEvent, Ref } from "react";
|
|
7
|
+
import { NumberFieldProps } from "react-aria-components";
|
|
8
|
+
//#region src/components/inputs/Input/NumberInput/NumberInput.d.ts
|
|
9
|
+
interface NumberInputBaseProps extends FormFieldProps, InputVariantProps, Omit<InputContentProps, "ref" | "value" | "onChange" | "onBlur">, Omit<NumberFieldProps, "value" | "onChange" | "className" | "onBlur"> {
|
|
10
|
+
ref?: Ref<HTMLInputElement>;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
inputClassName?: string;
|
|
13
|
+
isDirty?: boolean;
|
|
14
|
+
value?: number | null;
|
|
15
|
+
onChange?: (value: number | null) => void;
|
|
16
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
17
|
+
autoFocusOnMount?: boolean;
|
|
18
|
+
}
|
|
19
|
+
type NumberInputProps = NumberInputBaseProps & {
|
|
20
|
+
renderStaticInput?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type ControlledNumberInputProps<TFieldValues extends FieldValues> = ControlProps<NumberInputProps, TFieldValues>;
|
|
23
|
+
/** @internal Exported for production render benchmarks. */
|
|
24
|
+
declare const NumberInputComponent: <TFieldValues extends FieldValues>({ renderStaticInput, ...props }: ControlledNumberInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const NumberInput: typeof NumberInputComponent;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ControlledNumberInputProps, NumberInput, NumberInputComponent, NumberInputProps };
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { UIOverrides } from "../config/uiOverrides.context.js";
|
|
2
|
+
import { UIConfig } from "../config/uiConfig.context.js";
|
|
3
|
+
import { FieldController } from "./inputs/shared/form.binding.js";
|
|
4
|
+
import { FormField } from "./form-field.js";
|
|
5
|
+
import { inputBaseDefinition } from "./inputs/shared/input.cva.js";
|
|
6
|
+
import { IntlUtils } from "../utils/intl.utils.js";
|
|
7
|
+
import { TooltipWrapper } from "./inputs/shared/TooltipWrapper.js";
|
|
8
|
+
import { InputFrame } from "./inputs/Skeleton/InputFrame.js";
|
|
9
|
+
import { useStaticInputHandoff } from "./inputs/shared/useStaticInputHandoff.js";
|
|
10
|
+
import { InputContent } from "./inputs/Input/shared/InputContent.js";
|
|
11
|
+
import { useFieldAccessibility } from "./inputs/shared/useFieldAccessibility.js";
|
|
12
|
+
import { getStaticNumberDisplayValue } from "./inputs/Input/shared/numberStatic.utils.js";
|
|
13
|
+
import { clsx } from "clsx";
|
|
14
|
+
import { memo, useCallback, useEffect, useRef, useState } from "react";
|
|
15
|
+
import { Input, useLocale } from "react-aria-components";
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
import { useFocusVisible, useNumberField } from "react-aria";
|
|
18
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
19
|
+
import { useNumberFieldState } from "react-stately";
|
|
20
|
+
//#region src/components/inputs/Input/NumberInput/NumberInput.tsx
|
|
21
|
+
const NumberInputBase = (props) => {
|
|
22
|
+
"use no memo";
|
|
23
|
+
const ui = UIConfig.useConfig();
|
|
24
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
25
|
+
const hasControlledValue = "value" in props;
|
|
26
|
+
const inputRef = useRef(null);
|
|
27
|
+
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, formatOptions: formatOptionsProp, variant: variantProp, as: asProp, size: sizeProp, hideLabel: hideLabelProp, isClearable: isClearableProp, isClearableIfDisabled, autoFocusOnMount, ...rest } = props;
|
|
28
|
+
const formatOptions = formatOptionsProp ?? ui.numberInput.formatOptions;
|
|
29
|
+
const variant = variantProp ?? ui.input.variant;
|
|
30
|
+
const as = asProp ?? ui.input.as;
|
|
31
|
+
const size = sizeProp ?? ui.input.size;
|
|
32
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
33
|
+
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
34
|
+
const numberFieldRef = useRef(null);
|
|
35
|
+
const { isFocusVisible } = useFocusVisible();
|
|
36
|
+
const { locale } = useLocale();
|
|
37
|
+
const numberProps = {
|
|
38
|
+
...rest,
|
|
39
|
+
value: hasControlledValue ? value ?? NaN : void 0,
|
|
40
|
+
label,
|
|
41
|
+
isDisabled,
|
|
42
|
+
isInvalid: !!error,
|
|
43
|
+
isRequired,
|
|
44
|
+
onChange: (nextValue) => onChange?.(Number.isNaN(nextValue) ? null : nextValue),
|
|
45
|
+
onBlur: (e) => onBlur?.({ target: e.target }),
|
|
46
|
+
locale,
|
|
47
|
+
formatOptions
|
|
48
|
+
};
|
|
49
|
+
const state = useNumberFieldState(numberProps);
|
|
50
|
+
const { labelProps, inputProps } = useNumberField(numberProps, state, numberFieldRef);
|
|
51
|
+
const { describedBy, errorMessageId, helperTextId } = useFieldAccessibility({
|
|
52
|
+
describedBy: inputProps["aria-describedby"],
|
|
53
|
+
error,
|
|
54
|
+
helperText
|
|
55
|
+
});
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!autoFocusOnMount || isDisabled) return;
|
|
58
|
+
requestAnimationFrame(() => inputRef.current?.focus());
|
|
59
|
+
}, [autoFocusOnMount, isDisabled]);
|
|
60
|
+
const formFieldProps = {
|
|
61
|
+
errorMessageId,
|
|
62
|
+
error,
|
|
63
|
+
label,
|
|
64
|
+
tooltipText,
|
|
65
|
+
helperText,
|
|
66
|
+
helperTextId,
|
|
67
|
+
isRequired,
|
|
68
|
+
rightContent,
|
|
69
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
70
|
+
hideLabel,
|
|
71
|
+
isDisabled,
|
|
72
|
+
headerClassName,
|
|
73
|
+
errorClassName
|
|
74
|
+
};
|
|
75
|
+
const handleInputBlur = useCallback((e) => {
|
|
76
|
+
const target = numberFieldRef.current ?? e?.target;
|
|
77
|
+
onBlur?.({ target });
|
|
78
|
+
}, [onBlur]);
|
|
79
|
+
const inputContentProps = {
|
|
80
|
+
unit,
|
|
81
|
+
isLoading,
|
|
82
|
+
isDisabled,
|
|
83
|
+
action,
|
|
84
|
+
leadingIcon,
|
|
85
|
+
trailingIcon,
|
|
86
|
+
isClearable,
|
|
87
|
+
isClearableIfDisabled,
|
|
88
|
+
onChange: (nextValue) => {
|
|
89
|
+
if (nextValue === "") state.setInputValue("");
|
|
90
|
+
onChange?.(nextValue === "" ? null : Number(nextValue));
|
|
91
|
+
},
|
|
92
|
+
value: state.inputValue,
|
|
93
|
+
onBlur: handleInputBlur
|
|
94
|
+
};
|
|
95
|
+
const headerProps = {
|
|
96
|
+
label,
|
|
97
|
+
tooltipText,
|
|
98
|
+
helperText,
|
|
99
|
+
isRequired,
|
|
100
|
+
rightContent,
|
|
101
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
102
|
+
isDisabled,
|
|
103
|
+
className: headerClassName,
|
|
104
|
+
labelProps
|
|
105
|
+
};
|
|
106
|
+
const dataIsDisabled = isDisabled || void 0;
|
|
107
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
108
|
+
as,
|
|
109
|
+
error,
|
|
110
|
+
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
111
|
+
children: /* @__PURE__ */ jsx(FormField, {
|
|
112
|
+
...formFieldProps,
|
|
113
|
+
as,
|
|
114
|
+
labelProps,
|
|
115
|
+
className: clsx("group w-full", className),
|
|
116
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
117
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
118
|
+
className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
119
|
+
variant,
|
|
120
|
+
as,
|
|
121
|
+
...rest
|
|
122
|
+
}), inputClassName),
|
|
123
|
+
onClick: () => inputRef.current?.focus(),
|
|
124
|
+
"data-is-empty": value === null || value === void 0 || void 0,
|
|
125
|
+
"data-is-required": isRequired || void 0,
|
|
126
|
+
"data-is-disabled": dataIsDisabled,
|
|
127
|
+
children: /* @__PURE__ */ jsx(InputContent, {
|
|
128
|
+
...inputContentProps,
|
|
129
|
+
headerProps,
|
|
130
|
+
as,
|
|
131
|
+
size,
|
|
132
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
133
|
+
...inputProps,
|
|
134
|
+
"aria-describedby": describedBy,
|
|
135
|
+
"aria-errormessage": errorMessageId,
|
|
136
|
+
ref: mergeRefs(ref, inputRef, numberFieldRef),
|
|
137
|
+
"data-is-dirty": isDirty || void 0,
|
|
138
|
+
"data-is-required": isRequired || void 0,
|
|
139
|
+
"data-is-empty": state.inputValue === "" || state.inputValue === void 0 || state.inputValue === null || void 0,
|
|
140
|
+
"data-is-filled": !("" + value === "" || value === null || value === void 0) || void 0,
|
|
141
|
+
"data-is-disabled": dataIsDisabled,
|
|
142
|
+
placeholder: as === "floating" ? "\xA0" : inputProps.placeholder,
|
|
143
|
+
className: "w-full bg-transparent outline-none",
|
|
144
|
+
onFocus: (e) => {
|
|
145
|
+
inputProps.onFocus?.(e);
|
|
146
|
+
if (isFocusVisible) e.target.select();
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
const NumberInputInner = ({ renderStaticInput, isFormControlDisabled, ...props }) => {
|
|
155
|
+
"use no memo";
|
|
156
|
+
const ui = UIConfig.useConfig();
|
|
157
|
+
const { locale } = useLocale();
|
|
158
|
+
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
159
|
+
const inputRef = useRef(null);
|
|
160
|
+
const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
|
|
161
|
+
inputRef,
|
|
162
|
+
renderInput,
|
|
163
|
+
setRenderInput
|
|
164
|
+
});
|
|
165
|
+
if (!renderInput) {
|
|
166
|
+
const staticValue = props.value ?? props.defaultValue;
|
|
167
|
+
const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
|
|
168
|
+
const displayValue = getStaticNumberDisplayValue(staticValue, IntlUtils.getNumberFormatter(locale, formatOptions)) ?? "";
|
|
169
|
+
const hasValue = displayValue !== "";
|
|
170
|
+
const as = props.as ?? ui.input.as;
|
|
171
|
+
let isDisabled = !!props.isDisabled;
|
|
172
|
+
if (isFormControlDisabled) isDisabled = true;
|
|
173
|
+
const dataAttributes = {
|
|
174
|
+
dataIsEmpty: !hasValue,
|
|
175
|
+
dataIsFilled: hasValue,
|
|
176
|
+
dataIsDirty: props.isDirty,
|
|
177
|
+
dataIsRequired: props.isRequired,
|
|
178
|
+
dataIsDisabled: isDisabled,
|
|
179
|
+
dataDisabled: isDisabled,
|
|
180
|
+
dataInvalid: !!props.error,
|
|
181
|
+
dataHasSelection: hasValue
|
|
182
|
+
};
|
|
183
|
+
return /* @__PURE__ */ jsx(InputFrame, {
|
|
184
|
+
...props,
|
|
185
|
+
isDisabled,
|
|
186
|
+
className: clsx("group w-full", as === "inline" && "h-full", props.className),
|
|
187
|
+
dataAttributes,
|
|
188
|
+
onStaticInteract: renderRealInput,
|
|
189
|
+
inputClassName: props.inputClassName,
|
|
190
|
+
contentClassName: clsx(as === "inline" && "h-full", "pr-0!"),
|
|
191
|
+
trailingClassName: "py-0! pl-0!",
|
|
192
|
+
wrapContentAndTrailing: true,
|
|
193
|
+
reserveTrailingContent: true,
|
|
194
|
+
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
195
|
+
type: "text",
|
|
196
|
+
ref: inputRef,
|
|
197
|
+
disabled: isDisabled,
|
|
198
|
+
inputMode: "numeric",
|
|
199
|
+
tabIndex: -1,
|
|
200
|
+
value: displayValue,
|
|
201
|
+
placeholder: as === "floating" ? "" : props.placeholder,
|
|
202
|
+
className: "w-full bg-transparent outline-none",
|
|
203
|
+
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
204
|
+
...dataAttributeProps,
|
|
205
|
+
"data-rac": true
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return /* @__PURE__ */ jsx(NumberInputBase, {
|
|
210
|
+
...props,
|
|
211
|
+
ref: mergeRefs(props.ref, inputRef),
|
|
212
|
+
autoFocusOnMount: shouldFocus
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
/** @internal Exported for production render benchmarks. */
|
|
216
|
+
const NumberInputComponent = ({ renderStaticInput, ...props }) => {
|
|
217
|
+
"use no memo";
|
|
218
|
+
if ("field" in props && props.field) {
|
|
219
|
+
const { field, ref, ...innerProps } = props;
|
|
220
|
+
const controlWithOptions = field.form;
|
|
221
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
222
|
+
control: field.form,
|
|
223
|
+
name: field.name,
|
|
224
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(NumberInputInner, {
|
|
225
|
+
...innerProps,
|
|
226
|
+
ref: mergeRefs(ref, field.ref),
|
|
227
|
+
value: field.value,
|
|
228
|
+
onChange: field.onChange,
|
|
229
|
+
onBlur: field.onBlur,
|
|
230
|
+
isDirty,
|
|
231
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
232
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
233
|
+
error: props.error ?? error?.message,
|
|
234
|
+
renderStaticInput
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
return /* @__PURE__ */ jsx(NumberInputInner, {
|
|
239
|
+
...props,
|
|
240
|
+
renderStaticInput
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
const NumberInput = memo(NumberInputComponent);
|
|
244
|
+
//#endregion
|
|
245
|
+
export { NumberInput, NumberInputComponent };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FieldValues } from "./inputs/shared/form.binding.js";
|
|
2
|
+
import { ControlProps } from "./inputs/shared/form.types.js";
|
|
3
|
+
import { InputVariantProps } from "./inputs/shared/input.cva.js";
|
|
4
|
+
import { FormFieldProps } from "./form-field.js";
|
|
5
|
+
import { NumberRangeValue } from "./inputs/Input/NumberRangeInput/NumberRangeField.js";
|
|
6
|
+
import { FocusEvent, Ref } from "react";
|
|
7
|
+
import { NumberFieldProps } from "react-aria-components";
|
|
8
|
+
//#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts
|
|
9
|
+
interface NumberRangeInputBaseProps extends FormFieldProps, InputVariantProps, Omit<NumberFieldProps, "className" | "defaultValue" | "label" | "maxValue" | "minValue" | "onBlur" | "onChange" | "value"> {
|
|
10
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
|
+
value?: NumberRangeValue | null;
|
|
12
|
+
minValue?: number | null;
|
|
13
|
+
maxValue?: number | null;
|
|
14
|
+
minPlaceholder?: string;
|
|
15
|
+
maxPlaceholder?: string;
|
|
16
|
+
minLabel?: string;
|
|
17
|
+
maxLabel?: string;
|
|
18
|
+
invalidRangeError?: string;
|
|
19
|
+
inputClassName?: string;
|
|
20
|
+
minInputClassName?: string;
|
|
21
|
+
maxInputClassName?: string;
|
|
22
|
+
hideInnerLabels?: boolean;
|
|
23
|
+
isDirty?: boolean;
|
|
24
|
+
isClearable?: boolean;
|
|
25
|
+
isClearableIfDisabled?: boolean;
|
|
26
|
+
autoFocusOnMount?: boolean;
|
|
27
|
+
onChange?: (value: NumberRangeValue) => void;
|
|
28
|
+
onMinChange?: (value: number | null) => void;
|
|
29
|
+
onMaxChange?: (value: number | null) => void;
|
|
30
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
31
|
+
}
|
|
32
|
+
type NumberRangeInputProps = NumberRangeInputBaseProps & {
|
|
33
|
+
renderStaticInput?: boolean;
|
|
34
|
+
};
|
|
35
|
+
type ControlledNumberRangeInputProps<TFieldValues extends FieldValues> = ControlProps<NumberRangeInputProps, TFieldValues>;
|
|
36
|
+
declare const NumberRangeInputComponent: <TFieldValues extends FieldValues>({ renderStaticInput, ...props }: ControlledNumberRangeInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare const NumberRangeInput: typeof NumberRangeInputComponent;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ControlledNumberRangeInputProps, NumberRangeInput, NumberRangeInputProps, type NumberRangeValue };
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { UIOverrides } from "../config/uiOverrides.context.js";
|
|
2
|
+
import { UIConfig } from "../config/uiConfig.context.js";
|
|
3
|
+
import { FieldController } from "./inputs/shared/form.binding.js";
|
|
4
|
+
import { FormFieldLabel } from "./inputs/FormField/FormFieldLabel.js";
|
|
5
|
+
import { inputBaseDefinition, inputSizeDefinition } from "./inputs/shared/input.cva.js";
|
|
6
|
+
import { IntlUtils } from "../utils/intl.utils.js";
|
|
7
|
+
import { InputClear } from "./inputs/shared/InputClear.js";
|
|
8
|
+
import { InputFrame } from "./inputs/Skeleton/InputFrame.js";
|
|
9
|
+
import { useStaticInputHandoff } from "./inputs/shared/useStaticInputHandoff.js";
|
|
10
|
+
import { getStaticNumberDisplayValue } from "./inputs/Input/shared/numberStatic.utils.js";
|
|
11
|
+
import { NumberRangeField } from "./inputs/Input/NumberRangeInput/NumberRangeField.js";
|
|
12
|
+
import { clsx } from "clsx";
|
|
13
|
+
import { memo, useRef, useState } from "react";
|
|
14
|
+
import { useLocale } from "react-aria-components";
|
|
15
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
17
|
+
//#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.tsx
|
|
18
|
+
const EMPTY_RANGE = {
|
|
19
|
+
min: null,
|
|
20
|
+
max: null
|
|
21
|
+
};
|
|
22
|
+
const normalizeRangeValue = (value, minValue, maxValue) => {
|
|
23
|
+
if (value) return value;
|
|
24
|
+
return {
|
|
25
|
+
min: minValue ?? null,
|
|
26
|
+
max: maxValue ?? null
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const NumberRangeInputBase = (props) => {
|
|
30
|
+
const ui = UIConfig.useConfig();
|
|
31
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
32
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
33
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder = "Min", maxPlaceholder = "Max", minLabel = "Minimum", maxLabel = "Maximum", invalidRangeError = "Minimum cannot be greater than maximum", hideInnerLabels = true, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, isClearableIfDisabled, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest } = props;
|
|
34
|
+
const isClearable = isClearableProps ?? ui.input.isClearable;
|
|
35
|
+
const as = asProp ?? ui.input.as;
|
|
36
|
+
const variant = variantProps ?? ui.input.variant;
|
|
37
|
+
const size = sizeProps ?? ui.input.size;
|
|
38
|
+
const hideLabel = hideLabelProps ?? ui.input.hideLabel;
|
|
39
|
+
const rangeValue = normalizeRangeValue(value, minValue, maxValue);
|
|
40
|
+
const isEmpty = rangeValue.min === null && rangeValue.max === null;
|
|
41
|
+
const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
|
|
42
|
+
const effectiveError = error || rangeError;
|
|
43
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
44
|
+
const { isFocusVisible } = useFocusVisible();
|
|
45
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
46
|
+
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
47
|
+
const formFieldProps = {
|
|
48
|
+
error: effectiveError,
|
|
49
|
+
label,
|
|
50
|
+
tooltipText,
|
|
51
|
+
helperText,
|
|
52
|
+
isRequired,
|
|
53
|
+
rightContent,
|
|
54
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
55
|
+
hideLabel,
|
|
56
|
+
isDisabled,
|
|
57
|
+
headerClassName,
|
|
58
|
+
errorClassName
|
|
59
|
+
};
|
|
60
|
+
const headerProps = {
|
|
61
|
+
label,
|
|
62
|
+
tooltipText,
|
|
63
|
+
helperText,
|
|
64
|
+
isRequired,
|
|
65
|
+
rightContent,
|
|
66
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
67
|
+
isDisabled,
|
|
68
|
+
className: headerClassName
|
|
69
|
+
};
|
|
70
|
+
const updateRange = (side, nextValue) => {
|
|
71
|
+
const nextRange = {
|
|
72
|
+
...rangeValue,
|
|
73
|
+
[side]: nextValue
|
|
74
|
+
};
|
|
75
|
+
onChange?.(nextRange);
|
|
76
|
+
if (side === "min") onMinChange?.(nextValue);
|
|
77
|
+
else onMaxChange?.(nextValue);
|
|
78
|
+
};
|
|
79
|
+
const clearRangeSide = (side) => {
|
|
80
|
+
updateRange(side, null);
|
|
81
|
+
onBlur?.({ target: { value: "" } });
|
|
82
|
+
};
|
|
83
|
+
return /* @__PURE__ */ jsx(NumberRangeField, {
|
|
84
|
+
...rest,
|
|
85
|
+
ref,
|
|
86
|
+
as,
|
|
87
|
+
className,
|
|
88
|
+
inputClassName,
|
|
89
|
+
minInputClassName,
|
|
90
|
+
maxInputClassName,
|
|
91
|
+
inputBaseClassName: inputBaseCva({
|
|
92
|
+
variant,
|
|
93
|
+
as
|
|
94
|
+
}),
|
|
95
|
+
inputSizeClassName: inputSizeCva({
|
|
96
|
+
size,
|
|
97
|
+
as
|
|
98
|
+
}),
|
|
99
|
+
formFieldProps,
|
|
100
|
+
headerProps,
|
|
101
|
+
rangeValue,
|
|
102
|
+
effectiveError,
|
|
103
|
+
minPlaceholder,
|
|
104
|
+
maxPlaceholder,
|
|
105
|
+
minLabel,
|
|
106
|
+
maxLabel,
|
|
107
|
+
hideInnerLabels,
|
|
108
|
+
isDirty,
|
|
109
|
+
isClearable,
|
|
110
|
+
isClearableIfDisabled,
|
|
111
|
+
autoFocusOnMount,
|
|
112
|
+
isDisabled,
|
|
113
|
+
isRequired,
|
|
114
|
+
isEmpty,
|
|
115
|
+
isHovered,
|
|
116
|
+
isFocused,
|
|
117
|
+
isFocusVisible,
|
|
118
|
+
focusWithinProps,
|
|
119
|
+
hoverProps,
|
|
120
|
+
onRangeSideChange: updateRange,
|
|
121
|
+
onRangeSideClear: clearRangeSide,
|
|
122
|
+
onBlur
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
const NumberRangeInputInner = ({ renderStaticInput, isFormControlDisabled, ...props }) => {
|
|
126
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
127
|
+
const ui = UIConfig.useConfig();
|
|
128
|
+
const { locale } = useLocale();
|
|
129
|
+
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
130
|
+
const inputRef = useRef(null);
|
|
131
|
+
const { shouldFocus, renderRealInput } = useStaticInputHandoff({
|
|
132
|
+
inputRef,
|
|
133
|
+
renderInput,
|
|
134
|
+
setRenderInput
|
|
135
|
+
});
|
|
136
|
+
if (!renderInput) {
|
|
137
|
+
const staticValue = normalizeRangeValue(props.value, props.minValue, props.maxValue);
|
|
138
|
+
const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
|
|
139
|
+
const formatter = IntlUtils.getNumberFormatter(locale, formatOptions);
|
|
140
|
+
const minDisplay = getStaticNumberDisplayValue(staticValue.min, formatter);
|
|
141
|
+
const maxDisplay = getStaticNumberDisplayValue(staticValue.max, formatter);
|
|
142
|
+
const hasValue = minDisplay !== null || maxDisplay !== null;
|
|
143
|
+
const rangeError = staticValue.min !== null && staticValue.max !== null && staticValue.min > staticValue.max ? props.invalidRangeError ?? "Minimum cannot be greater than maximum" : void 0;
|
|
144
|
+
const effectiveError = props.error || rangeError;
|
|
145
|
+
const as = props.as ?? ui.input.as;
|
|
146
|
+
const size = props.size ?? ui.input.size;
|
|
147
|
+
let isDisabled = !!props.isDisabled;
|
|
148
|
+
if (isFormControlDisabled) isDisabled = true;
|
|
149
|
+
const isClearable = props.isClearable ?? ui.input.isClearable;
|
|
150
|
+
const dataAttributes = {
|
|
151
|
+
dataIsEmpty: !hasValue,
|
|
152
|
+
dataIsFilled: hasValue,
|
|
153
|
+
dataIsDirty: props.isDirty,
|
|
154
|
+
dataIsRequired: props.isRequired,
|
|
155
|
+
dataIsDisabled: isDisabled,
|
|
156
|
+
dataDisabled: isDisabled,
|
|
157
|
+
dataInvalid: !!effectiveError,
|
|
158
|
+
dataHasSelection: hasValue
|
|
159
|
+
};
|
|
160
|
+
return /* @__PURE__ */ jsx(InputFrame, {
|
|
161
|
+
...props,
|
|
162
|
+
error: effectiveError,
|
|
163
|
+
isDisabled,
|
|
164
|
+
className: clsx("group w-full", as === "inline" && "h-full", props.className),
|
|
165
|
+
inputClassName: props.inputClassName,
|
|
166
|
+
contentClassName: "pr-0!",
|
|
167
|
+
trailingClassName: "py-0! pl-0!",
|
|
168
|
+
contentWrapperClassName: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0! py-0! px-0!", inputSizeCva({
|
|
169
|
+
size,
|
|
170
|
+
as
|
|
171
|
+
})),
|
|
172
|
+
dataAttributes,
|
|
173
|
+
onStaticInteract: renderRealInput,
|
|
174
|
+
isClearable: false,
|
|
175
|
+
labelPlacement: "content-wrapper",
|
|
176
|
+
children: ({ id, ...dataAttributeProps }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
177
|
+
/* @__PURE__ */ jsxs("div", {
|
|
178
|
+
className: "min-w-0 flex-1",
|
|
179
|
+
children: [/* @__PURE__ */ jsx(FormFieldLabel, {
|
|
180
|
+
label: props.minLabel ?? "Minimum",
|
|
181
|
+
isRequired: props.isRequired,
|
|
182
|
+
isDisabled,
|
|
183
|
+
className: clsx((props.hideInnerLabels ?? true) && "sr-only")
|
|
184
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
185
|
+
className: "flex items-center gap-input-gap-trailing-elements",
|
|
186
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
187
|
+
id,
|
|
188
|
+
readOnly: true,
|
|
189
|
+
disabled: isDisabled,
|
|
190
|
+
tabIndex: -1,
|
|
191
|
+
value: minDisplay ?? "",
|
|
192
|
+
placeholder: props.minPlaceholder ?? "Min",
|
|
193
|
+
className: clsx("w-full min-w-0 bg-transparent outline-none", props.minInputClassName),
|
|
194
|
+
...dataAttributeProps,
|
|
195
|
+
"data-rac": true
|
|
196
|
+
}), isClearable && (!isDisabled || props.isClearableIfDisabled === true) && /* @__PURE__ */ jsx(InputClear, {
|
|
197
|
+
onClear: () => {},
|
|
198
|
+
show: staticValue.min !== null,
|
|
199
|
+
renderStatic: true
|
|
200
|
+
})]
|
|
201
|
+
})]
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ jsx("span", {
|
|
204
|
+
className: "pointer-events-none shrink-0 select-none text-label-2 text-text-default-3",
|
|
205
|
+
children: "-"
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ jsxs("div", {
|
|
208
|
+
className: "min-w-0 flex-1",
|
|
209
|
+
children: [/* @__PURE__ */ jsx(FormFieldLabel, {
|
|
210
|
+
label: props.maxLabel ?? "Maximum",
|
|
211
|
+
isRequired: props.isRequired,
|
|
212
|
+
isDisabled,
|
|
213
|
+
className: clsx((props.hideInnerLabels ?? true) && "sr-only")
|
|
214
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
215
|
+
className: "flex items-center gap-input-gap-trailing-elements",
|
|
216
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
217
|
+
id: `${id}-max`,
|
|
218
|
+
readOnly: true,
|
|
219
|
+
disabled: isDisabled,
|
|
220
|
+
tabIndex: -1,
|
|
221
|
+
value: maxDisplay ?? "",
|
|
222
|
+
placeholder: props.maxPlaceholder ?? "Max",
|
|
223
|
+
className: clsx("w-full min-w-0 bg-transparent outline-none", props.maxInputClassName),
|
|
224
|
+
...dataAttributeProps,
|
|
225
|
+
"data-rac": true
|
|
226
|
+
}), isClearable && (!isDisabled || props.isClearableIfDisabled === true) && /* @__PURE__ */ jsx(InputClear, {
|
|
227
|
+
onClear: () => {},
|
|
228
|
+
show: staticValue.max !== null,
|
|
229
|
+
renderStatic: true
|
|
230
|
+
})]
|
|
231
|
+
})]
|
|
232
|
+
})
|
|
233
|
+
] })
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return /* @__PURE__ */ jsx(NumberRangeInputBase, {
|
|
237
|
+
...props,
|
|
238
|
+
autoFocusOnMount: shouldFocus
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
const NumberRangeInputComponent = ({ renderStaticInput, ...props }) => {
|
|
242
|
+
if ("field" in props && props.field) {
|
|
243
|
+
const { field, ...innerProps } = props;
|
|
244
|
+
const controlWithOptions = field.form;
|
|
245
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
246
|
+
control: field.form,
|
|
247
|
+
name: field.name,
|
|
248
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(NumberRangeInputInner, {
|
|
249
|
+
...innerProps,
|
|
250
|
+
value: field.value ?? EMPTY_RANGE,
|
|
251
|
+
onChange: field.onChange,
|
|
252
|
+
onBlur: field.onBlur,
|
|
253
|
+
isDisabled: field.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
|
|
254
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
255
|
+
error: props.error ?? error?.message,
|
|
256
|
+
renderStaticInput
|
|
257
|
+
})
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return /* @__PURE__ */ jsx(NumberRangeInputInner, {
|
|
261
|
+
...props,
|
|
262
|
+
renderStaticInput
|
|
263
|
+
});
|
|
264
|
+
};
|
|
265
|
+
const NumberRangeInput = memo(NumberRangeInputComponent);
|
|
266
|
+
//#endregion
|
|
267
|
+
export { NumberRangeInput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clsx } from "clsx";
|
|
2
2
|
//#region src/components/outline.clsx.ts
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const uiOutlineClass = clsx("focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2", "has-focus-visible:outline has-focus-visible:outline-2 has-focus-visible:outline-solid has-focus-visible:outline-offset-2");
|
|
4
|
+
const uiGroupOutlineClass = clsx("group-focus:outline-none group-focus-visible:outline group-focus-visible:outline-2 group-focus-visible:outline-solid group-focus-visible:outline-offset-2");
|
|
5
5
|
//#endregion
|
|
6
6
|
export { uiGroupOutlineClass, uiOutlineClass };
|