@povio/ui 2.3.3 → 3.0.0-rc.1
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/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +215 -64
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +40 -14
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +21 -18
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +35 -12
- package/dist/components/Menu/MenuMobile.js +103 -44
- package/dist/components/Menu/MenuPopover.js +110 -34
- package/dist/components/Menu/menu.cva.d.ts +35 -13
- package/dist/components/Menu/menu.cva.js +30 -24
- package/dist/components/buttons/Button/Button.js +7 -7
- package/dist/components/buttons/Button/button.cva.d.ts +95 -26
- package/dist/components/buttons/Button/button.cva.js +601 -589
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +59 -21
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +247 -239
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +83 -25
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +3 -5
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -8
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +203 -37
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +28 -14
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +26 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.js +47 -40
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +371 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +482 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +13 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +267 -47
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +611 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +338 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +286 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +13 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +387 -143
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +96 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +84 -30
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +214 -69
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +27 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +40 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +85 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +87 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +151 -37
- package/dist/components/inputs/File/shared/InputUploadFilled.js +51 -10
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +26 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.js +48 -40
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +23 -6
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +29 -20
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +27 -7
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +28 -8
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +46 -15
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldError.cva.js +11 -8
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +22 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +13 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -8
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +450 -100
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +575 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +12 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +4 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +309 -94
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +422 -93
- package/dist/components/inputs/Input/shared/InputContent.js +196 -63
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +356 -64
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +101 -6
- package/dist/components/inputs/RadioGroup/radio.cva.js +74 -24
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +214 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +104 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +173 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +225 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +396 -141
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +398 -119
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +88 -38
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +72 -19
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +73 -24
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +36 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +10 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +4 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -6
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +21 -18
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +82 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +548 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +450 -101
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +105 -33
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +217 -40
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +15 -6
- package/dist/components/inputs/Toggle/toggle.cva.js +25 -21
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +23 -13
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +137 -16
- package/dist/components/inputs/shared/input.cva.js +317 -273
- package/dist/components/inputs/shared/label.cva.d.ts +15 -6
- package/dist/components/inputs/shared/label.cva.js +28 -25
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +12 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +4 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
- package/dist/components/navigation/Accordion/Accordion.js +71 -24
- package/dist/components/navigation/Accordion/AccordionItem.js +97 -52
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +109 -44
- package/dist/components/navigation/Accordion/accordion.cva.js +114 -84
- package/dist/components/navigation/Stepper/Stepper.js +69 -24
- package/dist/components/navigation/Stepper/StepperItem.js +112 -39
- package/dist/components/navigation/Stepper/StepperSeparator.js +25 -7
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +86 -30
- package/dist/components/navigation/Stepper/stepper.cva.js +104 -83
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/Modal/Modal.js +5 -5
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -9
- package/dist/components/overlays/Modal/modal.cva.js +38 -27
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +86 -30
- package/dist/components/overlays/Tooltip/Tooltip.js +143 -34
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +45 -17
- package/dist/components/overlays/Tooltip/tooltip.cva.js +38 -26
- package/dist/components/segment/Segment.js +221 -60
- package/dist/components/segment/SegmentItem.js +70 -13
- package/dist/components/segment/segment.cva.d.ts +18 -7
- package/dist/components/segment/segment.cva.js +24 -21
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/popover.cva.d.ts +7 -3
- package/dist/components/shared/popover.cva.js +3 -3
- package/dist/components/status/Alert/Alert.js +103 -36
- package/dist/components/status/Alert/alert.cva.d.ts +18 -6
- package/dist/components/status/Alert/alert.cva.js +60 -57
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Loader/loader.cva.d.ts +23 -4
- package/dist/components/status/Loader/loader.cva.js +22 -13
- package/dist/components/status/Toast/Toast.js +27 -20
- package/dist/components/status/Toast/toast.cva.d.ts +61 -10
- package/dist/components/status/Toast/toast.cva.js +129 -64
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/status/shared/status.cva.d.ts +30 -8
- package/dist/components/status/shared/status.cva.js +56 -50
- package/dist/components/table/CellText.js +3 -3
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/HeaderText.js +3 -3
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +34 -33
- package/dist/components/table/table.cva.d.ts +52 -19
- package/dist/components/table/table.cva.js +44 -35
- package/dist/components/text/Link/Link.js +22 -10
- package/dist/components/text/Link/link.cva.d.ts +11 -5
- package/dist/components/text/Link/link.cva.js +8 -5
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/components/text/Tag/tag.cva.d.ts +15 -5
- package/dist/components/text/Tag/tag.cva.js +51 -48
- package/dist/components/text/Typography/Typography.js +25 -10
- package/dist/components/text/Typography/typography.cva.d.ts +93 -7
- package/dist/components/text/Typography/typography.cva.js +126 -122
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +192 -0
- package/dist/config/uiOverrides.context.js +113 -0
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +3 -0
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +57 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +37 -1
- package/dist/index.js +34 -3
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/style-merge.util.d.ts +43 -0
- package/dist/utils/style-merge.util.js +233 -0
- package/dist/utils/style-merge.util.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist/config/uiStyle.context.d.ts +0 -162
- package/dist/config/uiStyle.context.js +0 -30
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inputBaseDefinition } from "../../shared/input.cva.js";
|
|
4
4
|
import { FormField } from "../../FormField/FormField.js";
|
|
5
5
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
6
|
+
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
7
|
+
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
6
8
|
import { InputContent } from "../shared/InputContent.js";
|
|
9
|
+
import { c } from "react/compiler-runtime";
|
|
7
10
|
import { jsx } from "react/jsx-runtime";
|
|
8
11
|
import { clsx } from "clsx";
|
|
9
|
-
import { useRef } from "react";
|
|
12
|
+
import { useEffect, useRef, useState } from "react";
|
|
10
13
|
import { Input } from "react-aria-components";
|
|
11
14
|
import { useFocusVisible, useTextField } from "react-aria";
|
|
12
15
|
import { mergeRefs } from "@react-aria/utils";
|
|
13
16
|
import { Controller } from "react-hook-form";
|
|
14
17
|
//#region src/components/inputs/Input/TextInput/TextInput.tsx
|
|
15
18
|
var TextInputBase = (props) => {
|
|
19
|
+
const $ = c(84);
|
|
16
20
|
const ui = UIConfig.useConfig();
|
|
17
|
-
const inputBaseCva =
|
|
21
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
18
22
|
const inputRef = useRef(null);
|
|
19
|
-
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as
|
|
23
|
+
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, autoFocusOnMount, ...rest } = props;
|
|
24
|
+
const as = asProp ?? ui.input.as;
|
|
25
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
26
|
+
const variant = variantProp ?? ui.input.variant;
|
|
27
|
+
const size = sizeProp ?? ui.input.size;
|
|
28
|
+
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
20
29
|
const textFieldRef = useRef(null);
|
|
21
30
|
const { isFocusVisible } = useFocusVisible();
|
|
22
31
|
const inputValue = value ?? "";
|
|
@@ -30,102 +39,422 @@ var TextInputBase = (props) => {
|
|
|
30
39
|
onChange,
|
|
31
40
|
onBlur
|
|
32
41
|
}, textFieldRef);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
isDisabled
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
42
|
+
let t0;
|
|
43
|
+
let t1;
|
|
44
|
+
if ($[0] !== autoFocusOnMount || $[1] !== isDisabled) {
|
|
45
|
+
t0 = () => {
|
|
46
|
+
if (!autoFocusOnMount || isDisabled) return;
|
|
47
|
+
requestAnimationFrame(() => inputRef.current?.focus());
|
|
48
|
+
};
|
|
49
|
+
t1 = [autoFocusOnMount, isDisabled];
|
|
50
|
+
$[0] = autoFocusOnMount;
|
|
51
|
+
$[1] = isDisabled;
|
|
52
|
+
$[2] = t0;
|
|
53
|
+
$[3] = t1;
|
|
54
|
+
} else {
|
|
55
|
+
t0 = $[2];
|
|
56
|
+
t1 = $[3];
|
|
57
|
+
}
|
|
58
|
+
useEffect(t0, t1);
|
|
59
|
+
const t2 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
60
|
+
let t3;
|
|
61
|
+
if ($[4] !== error || $[5] !== errorClassName || $[6] !== headerClassName || $[7] !== helperText || $[8] !== hideLabel || $[9] !== isDisabled || $[10] !== isRequired || $[11] !== label || $[12] !== rightContent || $[13] !== t2 || $[14] !== tooltipText) {
|
|
62
|
+
t3 = {
|
|
63
|
+
error,
|
|
64
|
+
label,
|
|
65
|
+
tooltipText,
|
|
66
|
+
helperText,
|
|
67
|
+
isRequired,
|
|
68
|
+
rightContent,
|
|
69
|
+
isHeaderHidden: t2,
|
|
70
|
+
hideLabel,
|
|
71
|
+
isDisabled,
|
|
72
|
+
headerClassName,
|
|
73
|
+
errorClassName
|
|
74
|
+
};
|
|
75
|
+
$[4] = error;
|
|
76
|
+
$[5] = errorClassName;
|
|
77
|
+
$[6] = headerClassName;
|
|
78
|
+
$[7] = helperText;
|
|
79
|
+
$[8] = hideLabel;
|
|
80
|
+
$[9] = isDisabled;
|
|
81
|
+
$[10] = isRequired;
|
|
82
|
+
$[11] = label;
|
|
83
|
+
$[12] = rightContent;
|
|
84
|
+
$[13] = t2;
|
|
85
|
+
$[14] = tooltipText;
|
|
86
|
+
$[15] = t3;
|
|
87
|
+
} else t3 = $[15];
|
|
88
|
+
const formFieldProps = t3;
|
|
89
|
+
let t4;
|
|
90
|
+
if ($[16] !== action || $[17] !== inputValue || $[18] !== isClearable || $[19] !== isDisabled || $[20] !== isLoading || $[21] !== leadingIcon || $[22] !== onBlur || $[23] !== onChange || $[24] !== trailingIcon || $[25] !== unit) {
|
|
91
|
+
t4 = {
|
|
92
|
+
unit,
|
|
93
|
+
isLoading,
|
|
94
|
+
isDisabled,
|
|
95
|
+
action,
|
|
96
|
+
leadingIcon,
|
|
97
|
+
trailingIcon,
|
|
98
|
+
isClearable,
|
|
99
|
+
value: inputValue,
|
|
100
|
+
onChange,
|
|
101
|
+
onBlur
|
|
102
|
+
};
|
|
103
|
+
$[16] = action;
|
|
104
|
+
$[17] = inputValue;
|
|
105
|
+
$[18] = isClearable;
|
|
106
|
+
$[19] = isDisabled;
|
|
107
|
+
$[20] = isLoading;
|
|
108
|
+
$[21] = leadingIcon;
|
|
109
|
+
$[22] = onBlur;
|
|
110
|
+
$[23] = onChange;
|
|
111
|
+
$[24] = trailingIcon;
|
|
112
|
+
$[25] = unit;
|
|
113
|
+
$[26] = t4;
|
|
114
|
+
} else t4 = $[26];
|
|
115
|
+
const inputContentProps = t4;
|
|
116
|
+
const t5 = hideLabel || isHeaderHidden;
|
|
117
|
+
let t6;
|
|
118
|
+
if ($[27] !== headerClassName || $[28] !== helperText || $[29] !== isDisabled || $[30] !== isRequired || $[31] !== label || $[32] !== labelProps || $[33] !== rightContent || $[34] !== t5 || $[35] !== tooltipText) {
|
|
119
|
+
t6 = {
|
|
120
|
+
label,
|
|
121
|
+
tooltipText,
|
|
122
|
+
helperText,
|
|
123
|
+
isRequired,
|
|
124
|
+
rightContent,
|
|
125
|
+
isHeaderHidden: t5,
|
|
126
|
+
isDisabled,
|
|
127
|
+
className: headerClassName,
|
|
128
|
+
labelProps
|
|
129
|
+
};
|
|
130
|
+
$[27] = headerClassName;
|
|
131
|
+
$[28] = helperText;
|
|
132
|
+
$[29] = isDisabled;
|
|
133
|
+
$[30] = isRequired;
|
|
134
|
+
$[31] = label;
|
|
135
|
+
$[32] = labelProps;
|
|
136
|
+
$[33] = rightContent;
|
|
137
|
+
$[34] = t5;
|
|
138
|
+
$[35] = tooltipText;
|
|
139
|
+
$[36] = t6;
|
|
140
|
+
} else t6 = $[36];
|
|
141
|
+
const headerProps = t6;
|
|
142
|
+
const dataIsDisabled = isDisabled || void 0;
|
|
143
|
+
const T0 = TooltipWrapper;
|
|
144
|
+
const t7 = as === "inline" ? -1 : void 0;
|
|
145
|
+
const T1 = FormField;
|
|
146
|
+
const t8 = as === "inline" && "h-full";
|
|
147
|
+
let t9;
|
|
148
|
+
if ($[37] !== className || $[38] !== t8) {
|
|
149
|
+
t9 = clsx("group w-full", t8, className);
|
|
150
|
+
$[37] = className;
|
|
151
|
+
$[38] = t8;
|
|
152
|
+
$[39] = t9;
|
|
153
|
+
} else t9 = $[39];
|
|
154
|
+
const t10 = as === "inline" ? -1 : void 0;
|
|
155
|
+
const t11 = value === "" || value === null || value === void 0 || void 0;
|
|
156
|
+
const t12 = isRequired || void 0;
|
|
157
|
+
const t13 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
158
|
+
variant,
|
|
70
159
|
as,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
160
|
+
...rest
|
|
161
|
+
}), inputClassName);
|
|
162
|
+
let t14;
|
|
163
|
+
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
164
|
+
t14 = () => inputRef.current?.focus();
|
|
165
|
+
$[40] = t14;
|
|
166
|
+
} else t14 = $[40];
|
|
167
|
+
const t15 = value === "" || value === null || value === void 0 || void 0;
|
|
168
|
+
const t16 = isRequired || void 0;
|
|
169
|
+
let t17;
|
|
170
|
+
if ($[41] !== ref) {
|
|
171
|
+
t17 = mergeRefs(ref, inputRef);
|
|
172
|
+
$[41] = ref;
|
|
173
|
+
$[42] = t17;
|
|
174
|
+
} else t17 = $[42];
|
|
175
|
+
const t18 = value === "" || value === null || value === void 0 || void 0;
|
|
176
|
+
const t19 = !(value === "" || value === null || value === void 0) || void 0;
|
|
177
|
+
const t20 = isDirty || void 0;
|
|
178
|
+
const t21 = isRequired || void 0;
|
|
179
|
+
const t22 = as === "floating" ? "\xA0" : inputProps.placeholder;
|
|
180
|
+
let t23;
|
|
181
|
+
if ($[43] !== inputProps || $[44] !== isFocusVisible) {
|
|
182
|
+
t23 = (e) => {
|
|
183
|
+
inputProps.onFocus?.(e);
|
|
184
|
+
if (isFocusVisible) e.target.select();
|
|
185
|
+
};
|
|
186
|
+
$[43] = inputProps;
|
|
187
|
+
$[44] = isFocusVisible;
|
|
188
|
+
$[45] = t23;
|
|
189
|
+
} else t23 = $[45];
|
|
190
|
+
let t24;
|
|
191
|
+
if ($[46] !== dataIsDisabled || $[47] !== inputProps || $[48] !== t17 || $[49] !== t18 || $[50] !== t19 || $[51] !== t20 || $[52] !== t21 || $[53] !== t22 || $[54] !== t23) {
|
|
192
|
+
t24 = /* @__PURE__ */ jsx(Input, {
|
|
193
|
+
...inputProps,
|
|
194
|
+
ref: t17,
|
|
195
|
+
"data-is-empty": t18,
|
|
196
|
+
"data-is-filled": t19,
|
|
197
|
+
"data-is-dirty": t20,
|
|
198
|
+
"data-is-required": t21,
|
|
199
|
+
"data-is-disabled": dataIsDisabled,
|
|
200
|
+
placeholder: t22,
|
|
201
|
+
className: "w-full bg-transparent outline-none",
|
|
202
|
+
onFocus: t23
|
|
203
|
+
});
|
|
204
|
+
$[46] = dataIsDisabled;
|
|
205
|
+
$[47] = inputProps;
|
|
206
|
+
$[48] = t17;
|
|
207
|
+
$[49] = t18;
|
|
208
|
+
$[50] = t19;
|
|
209
|
+
$[51] = t20;
|
|
210
|
+
$[52] = t21;
|
|
211
|
+
$[53] = t22;
|
|
212
|
+
$[54] = t23;
|
|
213
|
+
$[55] = t24;
|
|
214
|
+
} else t24 = $[55];
|
|
215
|
+
let t25;
|
|
216
|
+
if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !== t24) {
|
|
217
|
+
t25 = /* @__PURE__ */ jsx(InputContent, {
|
|
218
|
+
...inputContentProps,
|
|
219
|
+
headerProps,
|
|
220
|
+
as,
|
|
221
|
+
size,
|
|
222
|
+
children: t24
|
|
223
|
+
});
|
|
224
|
+
$[56] = as;
|
|
225
|
+
$[57] = headerProps;
|
|
226
|
+
$[58] = inputContentProps;
|
|
227
|
+
$[59] = size;
|
|
228
|
+
$[60] = t24;
|
|
229
|
+
$[61] = t25;
|
|
230
|
+
} else t25 = $[61];
|
|
231
|
+
let t26;
|
|
232
|
+
if ($[62] !== dataIsDisabled || $[63] !== t13 || $[64] !== t15 || $[65] !== t16 || $[66] !== t25) {
|
|
233
|
+
t26 = /* @__PURE__ */ jsx("div", {
|
|
234
|
+
className: t13,
|
|
235
|
+
onClick: t14,
|
|
236
|
+
"data-is-empty": t15,
|
|
237
|
+
"data-is-required": t16,
|
|
238
|
+
"data-is-disabled": dataIsDisabled,
|
|
239
|
+
children: t25
|
|
240
|
+
});
|
|
241
|
+
$[62] = dataIsDisabled;
|
|
242
|
+
$[63] = t13;
|
|
243
|
+
$[64] = t15;
|
|
244
|
+
$[65] = t16;
|
|
245
|
+
$[66] = t25;
|
|
246
|
+
$[67] = t26;
|
|
247
|
+
} else t26 = $[67];
|
|
248
|
+
let t27;
|
|
249
|
+
if ($[68] !== T1 || $[69] !== as || $[70] !== formFieldProps || $[71] !== labelProps || $[72] !== t10 || $[73] !== t11 || $[74] !== t12 || $[75] !== t26 || $[76] !== t9) {
|
|
250
|
+
t27 = /* @__PURE__ */ jsx(T1, {
|
|
74
251
|
...formFieldProps,
|
|
75
252
|
as,
|
|
76
253
|
labelProps,
|
|
77
|
-
className:
|
|
78
|
-
tabIndex:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
254
|
+
className: t9,
|
|
255
|
+
tabIndex: t10,
|
|
256
|
+
"data-is-empty": t11,
|
|
257
|
+
"data-is-required": t12,
|
|
258
|
+
children: t26
|
|
259
|
+
});
|
|
260
|
+
$[68] = T1;
|
|
261
|
+
$[69] = as;
|
|
262
|
+
$[70] = formFieldProps;
|
|
263
|
+
$[71] = labelProps;
|
|
264
|
+
$[72] = t10;
|
|
265
|
+
$[73] = t11;
|
|
266
|
+
$[74] = t12;
|
|
267
|
+
$[75] = t26;
|
|
268
|
+
$[76] = t9;
|
|
269
|
+
$[77] = t27;
|
|
270
|
+
} else t27 = $[77];
|
|
271
|
+
let t28;
|
|
272
|
+
if ($[78] !== T0 || $[79] !== as || $[80] !== error || $[81] !== t27 || $[82] !== t7) {
|
|
273
|
+
t28 = /* @__PURE__ */ jsx(T0, {
|
|
274
|
+
as,
|
|
275
|
+
error,
|
|
276
|
+
triggerTabIndex: t7,
|
|
277
|
+
children: t27
|
|
278
|
+
});
|
|
279
|
+
$[78] = T0;
|
|
280
|
+
$[79] = as;
|
|
281
|
+
$[80] = error;
|
|
282
|
+
$[81] = t27;
|
|
283
|
+
$[82] = t7;
|
|
284
|
+
$[83] = t28;
|
|
285
|
+
} else t28 = $[83];
|
|
286
|
+
return t28;
|
|
109
287
|
};
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
288
|
+
var TextInputInner = (t0) => {
|
|
289
|
+
const $ = c(9);
|
|
290
|
+
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
291
|
+
const ui = UIConfig.useConfig();
|
|
292
|
+
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
293
|
+
const inputRef = useRef(null);
|
|
294
|
+
let t1;
|
|
295
|
+
if ($[0] !== renderInput) {
|
|
296
|
+
t1 = {
|
|
297
|
+
inputRef,
|
|
298
|
+
renderInput,
|
|
299
|
+
setRenderInput
|
|
300
|
+
};
|
|
301
|
+
$[0] = renderInput;
|
|
302
|
+
$[1] = t1;
|
|
303
|
+
} else t1 = $[1];
|
|
304
|
+
const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff(t1);
|
|
305
|
+
const staticValue = props.value ?? props.defaultValue ?? "";
|
|
306
|
+
const inputType = props.type;
|
|
307
|
+
if (!renderInput && inputType === "password" && `${staticValue}`.length > 0) setRenderInput(true);
|
|
308
|
+
if (!renderInput) {
|
|
309
|
+
const as = props.as ?? ui.input.as;
|
|
310
|
+
let isDisabled = !!props.isDisabled;
|
|
311
|
+
if (isFormControlDisabled) isDisabled = true;
|
|
312
|
+
const maskedPasswordValue = inputType === "password" && `${staticValue}`.length > 0 ? "•".repeat(`${staticValue}`.length) : staticValue;
|
|
313
|
+
const displayValue = maskedPasswordValue == null ? "" : `${maskedPasswordValue}`;
|
|
314
|
+
const hasValue = displayValue !== "";
|
|
315
|
+
const dataAttributes = {
|
|
316
|
+
dataIsEmpty: !hasValue,
|
|
317
|
+
dataIsFilled: hasValue,
|
|
318
|
+
dataIsDirty: props.isDirty,
|
|
319
|
+
dataIsRequired: props.isRequired,
|
|
320
|
+
dataIsDisabled: isDisabled,
|
|
321
|
+
dataDisabled: isDisabled,
|
|
322
|
+
dataInvalid: !!props.error,
|
|
323
|
+
dataHasSelection: hasValue
|
|
324
|
+
};
|
|
325
|
+
const t2 = isDisabled;
|
|
326
|
+
const t3 = clsx("group w-full", as === "inline" && "h-full", props.className);
|
|
327
|
+
const t4 = props.inputClassName;
|
|
328
|
+
const t5 = as === "inline" && "h-full";
|
|
329
|
+
let t6;
|
|
330
|
+
if ($[2] !== t5) {
|
|
331
|
+
t6 = clsx(t5, "pr-0!");
|
|
332
|
+
$[2] = t5;
|
|
333
|
+
$[3] = t6;
|
|
334
|
+
} else t6 = $[3];
|
|
335
|
+
return /* @__PURE__ */ jsx(InputFrame, {
|
|
336
|
+
...props,
|
|
337
|
+
isDisabled: t2,
|
|
338
|
+
className: t3,
|
|
339
|
+
dataAttributes,
|
|
340
|
+
renderStatic: true,
|
|
341
|
+
onStaticInteract: renderRealInput,
|
|
342
|
+
inputClassName: t4,
|
|
343
|
+
contentClassName: t6,
|
|
344
|
+
trailingClassName: "py-0! pl-0!",
|
|
345
|
+
wrapContentAndTrailing: true,
|
|
346
|
+
reserveTrailingContent: true,
|
|
347
|
+
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
348
|
+
ref: inputRef,
|
|
349
|
+
type: inputType === "hidden" ? "password" : inputType,
|
|
350
|
+
disabled: isDisabled,
|
|
351
|
+
tabIndex: -1,
|
|
352
|
+
value: displayValue,
|
|
353
|
+
placeholder: as === "floating" ? "" : props.placeholder,
|
|
354
|
+
className: "w-full bg-transparent outline-none",
|
|
355
|
+
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
356
|
+
...dataAttributeProps,
|
|
357
|
+
"data-rac": true
|
|
125
358
|
})
|
|
126
359
|
});
|
|
127
360
|
}
|
|
128
|
-
|
|
361
|
+
const T0 = TextInputBase;
|
|
362
|
+
const t2 = mergeRefs(props.ref, inputRef);
|
|
363
|
+
let t3;
|
|
364
|
+
if ($[4] !== T0 || $[5] !== props || $[6] !== shouldFocus || $[7] !== t2) {
|
|
365
|
+
t3 = /* @__PURE__ */ jsx(T0, {
|
|
366
|
+
...props,
|
|
367
|
+
ref: t2,
|
|
368
|
+
autoFocusOnMount: shouldFocus
|
|
369
|
+
});
|
|
370
|
+
$[4] = T0;
|
|
371
|
+
$[5] = props;
|
|
372
|
+
$[6] = shouldFocus;
|
|
373
|
+
$[7] = t2;
|
|
374
|
+
$[8] = t3;
|
|
375
|
+
} else t3 = $[8];
|
|
376
|
+
return t3;
|
|
377
|
+
};
|
|
378
|
+
var TextInput = (t0) => {
|
|
379
|
+
const $ = c(21);
|
|
380
|
+
let props;
|
|
381
|
+
let renderStaticInput;
|
|
382
|
+
if ($[0] !== t0) {
|
|
383
|
+
({renderStaticInput, ...props} = t0);
|
|
384
|
+
$[0] = t0;
|
|
385
|
+
$[1] = props;
|
|
386
|
+
$[2] = renderStaticInput;
|
|
387
|
+
} else {
|
|
388
|
+
props = $[1];
|
|
389
|
+
renderStaticInput = $[2];
|
|
390
|
+
}
|
|
391
|
+
if ("formControl" in props && props.formControl) {
|
|
392
|
+
let formControl;
|
|
393
|
+
let innerProps;
|
|
394
|
+
let ref;
|
|
395
|
+
if ($[3] !== props) {
|
|
396
|
+
({formControl, ref, ...innerProps} = props);
|
|
397
|
+
$[3] = props;
|
|
398
|
+
$[4] = formControl;
|
|
399
|
+
$[5] = innerProps;
|
|
400
|
+
$[6] = ref;
|
|
401
|
+
} else {
|
|
402
|
+
formControl = $[4];
|
|
403
|
+
innerProps = $[5];
|
|
404
|
+
ref = $[6];
|
|
405
|
+
}
|
|
406
|
+
const controlWithOptions = formControl.control;
|
|
407
|
+
let t1;
|
|
408
|
+
if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
|
|
409
|
+
t1 = (t2) => {
|
|
410
|
+
const { field, fieldState: t3 } = t2;
|
|
411
|
+
const { error, isDirty } = t3;
|
|
412
|
+
return /* @__PURE__ */ jsx(TextInputInner, {
|
|
413
|
+
...innerProps,
|
|
414
|
+
ref: mergeRefs(ref, field.ref),
|
|
415
|
+
value: field.value,
|
|
416
|
+
onChange: field.onChange,
|
|
417
|
+
onBlur: field.onBlur,
|
|
418
|
+
isDirty,
|
|
419
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
420
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
421
|
+
error: props.error ?? error?.message,
|
|
422
|
+
renderStaticInput
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
$[7] = controlWithOptions._options?.disabled;
|
|
426
|
+
$[8] = innerProps;
|
|
427
|
+
$[9] = props.error;
|
|
428
|
+
$[10] = props.isDisabled;
|
|
429
|
+
$[11] = ref;
|
|
430
|
+
$[12] = renderStaticInput;
|
|
431
|
+
$[13] = t1;
|
|
432
|
+
} else t1 = $[13];
|
|
433
|
+
let t2;
|
|
434
|
+
if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
|
|
435
|
+
t2 = /* @__PURE__ */ jsx(Controller, {
|
|
436
|
+
control: formControl.control,
|
|
437
|
+
name: formControl.name,
|
|
438
|
+
render: t1
|
|
439
|
+
});
|
|
440
|
+
$[14] = formControl.control;
|
|
441
|
+
$[15] = formControl.name;
|
|
442
|
+
$[16] = t1;
|
|
443
|
+
$[17] = t2;
|
|
444
|
+
} else t2 = $[17];
|
|
445
|
+
return t2;
|
|
446
|
+
}
|
|
447
|
+
let t1;
|
|
448
|
+
if ($[18] !== props || $[19] !== renderStaticInput) {
|
|
449
|
+
t1 = /* @__PURE__ */ jsx(TextInputInner, {
|
|
450
|
+
...props,
|
|
451
|
+
renderStaticInput
|
|
452
|
+
});
|
|
453
|
+
$[18] = props;
|
|
454
|
+
$[19] = renderStaticInput;
|
|
455
|
+
$[20] = t1;
|
|
456
|
+
} else t1 = $[20];
|
|
457
|
+
return t1;
|
|
129
458
|
};
|
|
130
459
|
//#endregion
|
|
131
460
|
export { TextInput };
|