@kapiuara/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +764 -2
- package/dist/components/data/KapiPagination.d.ts +36 -0
- package/dist/components/data/KapiPagination.js +102 -0
- package/dist/components/data/KapiTable.d.ts +245 -0
- package/dist/components/data/KapiTable.js +748 -0
- package/dist/components/data/KapiTableFilter.d.ts +48 -0
- package/dist/components/data/KapiTableFilter.js +81 -0
- package/dist/components/data/index.d.ts +10 -0
- package/dist/components/data/tableLogic.d.ts +197 -0
- package/dist/components/data/tableLogic.js +145 -0
- package/dist/components/data/tableResizeLogic.d.ts +28 -0
- package/dist/components/data/tableResizeLogic.js +20 -0
- package/dist/components/display/KapiAnnotation.d.ts +32 -0
- package/dist/components/display/KapiAnnotation.js +130 -0
- package/dist/components/display/KapiAvatar.d.ts +27 -0
- package/dist/components/display/KapiAvatar.js +43 -0
- package/dist/components/display/KapiAvatarGroup.d.ts +19 -0
- package/dist/components/display/KapiAvatarGroup.js +38 -0
- package/dist/components/display/KapiBadge.d.ts +21 -0
- package/dist/components/display/KapiBadge.js +28 -0
- package/dist/components/display/KapiComment.d.ts +27 -0
- package/dist/components/display/KapiComment.js +66 -0
- package/dist/components/display/KapiCommentComposer.d.ts +49 -0
- package/dist/components/display/KapiCommentComposer.js +76 -0
- package/dist/components/display/KapiDescriptionList.d.ts +19 -0
- package/dist/components/display/KapiDescriptionList.js +35 -0
- package/dist/components/display/KapiFileItem.d.ts +39 -0
- package/dist/components/display/KapiFileItem.js +74 -0
- package/dist/components/display/KapiFileViewer.d.ts +51 -0
- package/dist/components/display/KapiFileViewer.js +107 -0
- package/dist/components/display/KapiIconTile.d.ts +16 -0
- package/dist/components/display/KapiIconTile.js +29 -0
- package/dist/components/display/KapiStat.d.ts +24 -0
- package/dist/components/display/KapiStat.js +41 -0
- package/dist/components/display/KapiTag.d.ts +27 -0
- package/dist/components/display/KapiTag.js +44 -0
- package/dist/components/display/KapiTimeline.d.ts +15 -0
- package/dist/components/display/KapiTimeline.js +30 -0
- package/dist/components/display/annotationLogic.d.ts +26 -0
- package/dist/components/display/annotationLogic.js +17 -0
- package/dist/components/display/avatarGroupLogic.d.ts +14 -0
- package/dist/components/display/avatarGroupLogic.js +13 -0
- package/dist/components/display/avatarLogic.d.ts +5 -0
- package/dist/components/display/avatarLogic.js +9 -0
- package/dist/components/display/commentLogic.d.ts +18 -0
- package/dist/components/display/commentLogic.js +7 -0
- package/dist/components/display/fileItemLogic.d.ts +9 -0
- package/dist/components/display/fileItemLogic.js +12 -0
- package/dist/components/display/iconTileLogic.d.ts +13 -0
- package/dist/components/display/iconTileLogic.js +13 -0
- package/dist/components/display/index.d.ts +40 -0
- package/dist/components/display/statLogic.d.ts +10 -0
- package/dist/components/display/statLogic.js +10 -0
- package/dist/components/display/tagLogic.d.ts +11 -0
- package/dist/components/display/tagLogic.js +10 -0
- package/dist/components/display/timelineLogic.d.ts +5 -0
- package/dist/components/display/timelineLogic.js +4 -0
- package/dist/components/feedback/KapiAlert.d.ts +28 -0
- package/dist/components/feedback/KapiAlert.js +53 -0
- package/dist/components/feedback/KapiBulkBar.d.ts +30 -0
- package/dist/components/feedback/KapiBulkBar.js +34 -0
- package/dist/components/feedback/KapiCountdown.d.ts +26 -0
- package/dist/components/feedback/KapiCountdown.js +43 -0
- package/dist/components/feedback/KapiEmpty.d.ts +14 -0
- package/dist/components/feedback/KapiEmpty.js +31 -0
- package/dist/components/feedback/KapiFab.d.ts +34 -0
- package/dist/components/feedback/KapiFab.js +116 -0
- package/dist/components/feedback/KapiOfflineBanner.d.ts +25 -0
- package/dist/components/feedback/KapiOfflineBanner.js +40 -0
- package/dist/components/feedback/KapiProgress.d.ts +24 -0
- package/dist/components/feedback/KapiProgress.js +94 -0
- package/dist/components/feedback/KapiSkeleton.d.ts +12 -0
- package/dist/components/feedback/KapiSkeleton.js +16 -0
- package/dist/components/feedback/KapiToastContainer.d.ts +16 -0
- package/dist/components/feedback/KapiToastContainer.js +81 -0
- package/dist/components/feedback/KapiTour.d.ts +40 -0
- package/dist/components/feedback/KapiTour.js +157 -0
- package/dist/components/feedback/KapiUnsavedBar.d.ts +35 -0
- package/dist/components/feedback/KapiUnsavedBar.js +47 -0
- package/dist/components/feedback/bulkBarLogic.d.ts +2 -0
- package/dist/components/feedback/bulkBarLogic.js +7 -0
- package/dist/components/feedback/countdownLogic.d.ts +74 -0
- package/dist/components/feedback/countdownLogic.js +70 -0
- package/dist/components/feedback/fabLogic.d.ts +17 -0
- package/dist/components/feedback/fabLogic.js +10 -0
- package/dist/components/feedback/index.d.ts +33 -0
- package/dist/components/feedback/offlineBannerLogic.d.ts +10 -0
- package/dist/components/feedback/offlineBannerLogic.js +8 -0
- package/dist/components/feedback/progressLogic.d.ts +17 -0
- package/dist/components/feedback/progressLogic.js +16 -0
- package/dist/components/feedback/toastStore.d.ts +62 -0
- package/dist/components/feedback/toastStore.js +38 -0
- package/dist/components/feedback/tourLogic.d.ts +64 -0
- package/dist/components/feedback/tourLogic.js +31 -0
- package/dist/components/feedback/unsavedBarLogic.d.ts +2 -0
- package/dist/components/feedback/unsavedBarLogic.js +8 -0
- package/dist/components/inputs/KapiAutocomplete.d.ts +81 -0
- package/dist/components/inputs/KapiAutocomplete.js +205 -0
- package/dist/components/inputs/KapiButton.d.ts +23 -0
- package/dist/components/inputs/KapiButton.js +25 -0
- package/dist/components/inputs/KapiCalendar.d.ts +35 -0
- package/dist/components/inputs/KapiCalendar.js +60 -0
- package/dist/components/inputs/KapiCalendarGrid.d.ts +29 -0
- package/dist/components/inputs/KapiCalendarGrid.js +65 -0
- package/dist/components/inputs/KapiCheckCard.d.ts +28 -0
- package/dist/components/inputs/KapiCheckCard.js +41 -0
- package/dist/components/inputs/KapiCheckbox.d.ts +7 -0
- package/dist/components/inputs/KapiCheckbox.js +5 -0
- package/dist/components/inputs/KapiDatePicker.d.ts +46 -0
- package/dist/components/inputs/KapiDatePicker.js +189 -0
- package/dist/components/inputs/KapiDateRangePicker.d.ts +49 -0
- package/dist/components/inputs/KapiDateRangePicker.js +179 -0
- package/dist/components/inputs/KapiFacetedSearch.d.ts +45 -0
- package/dist/components/inputs/KapiFacetedSearch.js +188 -0
- package/dist/components/inputs/KapiField.d.ts +33 -0
- package/dist/components/inputs/KapiField.js +60 -0
- package/dist/components/inputs/KapiFileUpload.d.ts +58 -0
- package/dist/components/inputs/KapiFileUpload.js +134 -0
- package/dist/components/inputs/KapiIconButton.d.ts +13 -0
- package/dist/components/inputs/KapiIconButton.js +16 -0
- package/dist/components/inputs/KapiInput.d.ts +92 -0
- package/dist/components/inputs/KapiInput.js +123 -0
- package/dist/components/inputs/KapiInputGroup.d.ts +37 -0
- package/dist/components/inputs/KapiInputGroup.js +29 -0
- package/dist/components/inputs/KapiMaskedInput.d.ts +52 -0
- package/dist/components/inputs/KapiMaskedInput.js +78 -0
- package/dist/components/inputs/KapiNumberStepper.d.ts +44 -0
- package/dist/components/inputs/KapiNumberStepper.js +100 -0
- package/dist/components/inputs/KapiRadio.d.ts +7 -0
- package/dist/components/inputs/KapiRadio.js +5 -0
- package/dist/components/inputs/KapiRating.d.ts +55 -0
- package/dist/components/inputs/KapiRating.js +99 -0
- package/dist/components/inputs/KapiSegmented.d.ts +41 -0
- package/dist/components/inputs/KapiSegmented.js +83 -0
- package/dist/components/inputs/KapiSelect.d.ts +109 -0
- package/dist/components/inputs/KapiSelect.js +443 -0
- package/dist/components/inputs/KapiSlider.d.ts +42 -0
- package/dist/components/inputs/KapiSlider.js +70 -0
- package/dist/components/inputs/KapiSwitch.d.ts +13 -0
- package/dist/components/inputs/KapiSwitch.js +28 -0
- package/dist/components/inputs/KapiTagInput.d.ts +79 -0
- package/dist/components/inputs/KapiTagInput.js +115 -0
- package/dist/components/inputs/KapiTextarea.d.ts +32 -0
- package/dist/components/inputs/KapiTextarea.js +67 -0
- package/dist/components/inputs/asyncSelectLogic.d.ts +42 -0
- package/dist/components/inputs/asyncSelectLogic.js +46 -0
- package/dist/components/inputs/autocompleteLogic.d.ts +73 -0
- package/dist/components/inputs/autocompleteLogic.js +67 -0
- package/dist/components/inputs/checkControl.d.ts +20 -0
- package/dist/components/inputs/checkControl.js +31 -0
- package/dist/components/inputs/datePickerLogic.d.ts +92 -0
- package/dist/components/inputs/datePickerLogic.js +174 -0
- package/dist/components/inputs/dateRangeLogic.d.ts +31 -0
- package/dist/components/inputs/dateRangeLogic.js +44 -0
- package/dist/components/inputs/facetedSearchLogic.d.ts +69 -0
- package/dist/components/inputs/facetedSearchLogic.js +39 -0
- package/dist/components/inputs/fieldLogic.d.ts +67 -0
- package/dist/components/inputs/fieldLogic.js +35 -0
- package/dist/components/inputs/fileUploadLogic.d.ts +13 -0
- package/dist/components/inputs/fileUploadLogic.js +9 -0
- package/dist/components/inputs/index.d.ts +55 -0
- package/dist/components/inputs/inputGroupLogic.d.ts +22 -0
- package/dist/components/inputs/inputGroupLogic.js +9 -0
- package/dist/components/inputs/inputLogic.d.ts +25 -0
- package/dist/components/inputs/inputLogic.js +10 -0
- package/dist/components/inputs/maskLogic.d.ts +34 -0
- package/dist/components/inputs/maskLogic.js +57 -0
- package/dist/components/inputs/numberStepLogic.d.ts +14 -0
- package/dist/components/inputs/numberStepLogic.js +21 -0
- package/dist/components/inputs/ratingLogic.d.ts +9 -0
- package/dist/components/inputs/ratingLogic.js +22 -0
- package/dist/components/inputs/segmentedLogic.d.ts +6 -0
- package/dist/components/inputs/segmentedLogic.js +14 -0
- package/dist/components/inputs/selectLogic.d.ts +89 -0
- package/dist/components/inputs/selectLogic.js +82 -0
- package/dist/components/inputs/sliderLogic.d.ts +9 -0
- package/dist/components/inputs/sliderLogic.js +17 -0
- package/dist/components/inputs/tagInputLogic.d.ts +40 -0
- package/dist/components/inputs/tagInputLogic.js +40 -0
- package/dist/components/inputs/textareaLogic.d.ts +17 -0
- package/dist/components/inputs/textareaLogic.js +13 -0
- package/dist/components/inputs/useCalendarFocus.d.ts +13 -0
- package/dist/components/inputs/useCalendarFocus.js +25 -0
- package/dist/components/inputs/useDatePopSide.d.ts +15 -0
- package/dist/components/inputs/useDatePopSide.js +20 -0
- package/dist/components/labelsLogic.d.ts +6 -0
- package/dist/components/labelsLogic.js +11 -0
- package/dist/components/layout/KapiAccessCard.d.ts +40 -0
- package/dist/components/layout/KapiAccessCard.js +66 -0
- package/dist/components/layout/KapiAccountMenu.d.ts +61 -0
- package/dist/components/layout/KapiAccountMenu.js +212 -0
- package/dist/components/layout/KapiCard.d.ts +43 -0
- package/dist/components/layout/KapiCard.js +53 -0
- package/dist/components/layout/KapiCluster.d.ts +15 -0
- package/dist/components/layout/KapiCluster.js +21 -0
- package/dist/components/layout/KapiContextSlot.d.ts +45 -0
- package/dist/components/layout/KapiContextSlot.js +92 -0
- package/dist/components/layout/KapiDivider.d.ts +16 -0
- package/dist/components/layout/KapiDivider.js +41 -0
- package/dist/components/layout/KapiGrid.d.ts +19 -0
- package/dist/components/layout/KapiGrid.js +25 -0
- package/dist/components/layout/KapiNotificationBell.d.ts +75 -0
- package/dist/components/layout/KapiNotificationBell.js +196 -0
- package/dist/components/layout/KapiPageHeader.d.ts +28 -0
- package/dist/components/layout/KapiPageHeader.js +47 -0
- package/dist/components/layout/KapiPanelParts.d.ts +35 -0
- package/dist/components/layout/KapiPanelParts.js +63 -0
- package/dist/components/layout/KapiRail.d.ts +40 -0
- package/dist/components/layout/KapiRail.js +102 -0
- package/dist/components/layout/KapiScrollArea.d.ts +40 -0
- package/dist/components/layout/KapiScrollArea.js +49 -0
- package/dist/components/layout/KapiShell.d.ts +40 -0
- package/dist/components/layout/KapiShell.js +48 -0
- package/dist/components/layout/KapiStack.d.ts +11 -0
- package/dist/components/layout/KapiStack.js +19 -0
- package/dist/components/layout/accessCardLogic.d.ts +18 -0
- package/dist/components/layout/accessCardLogic.js +11 -0
- package/dist/components/layout/cardLogic.d.ts +9 -0
- package/dist/components/layout/cardLogic.js +11 -0
- package/dist/components/layout/index.d.ts +33 -0
- package/dist/components/layout/layoutPrimitives.d.ts +51 -0
- package/dist/components/layout/layoutPrimitives.js +58 -0
- package/dist/components/layout/notificationBellLogic.d.ts +20 -0
- package/dist/components/layout/notificationBellLogic.js +14 -0
- package/dist/components/layout/railLogic.d.ts +52 -0
- package/dist/components/layout/railLogic.js +16 -0
- package/dist/components/locale/KapiLocaleProvider.d.ts +29 -0
- package/dist/components/locale/KapiLocaleProvider.js +27 -0
- package/dist/components/locale/index.d.ts +5 -0
- package/dist/components/locale/labelRegistry.d.ts +110 -0
- package/dist/components/locale/linkLabels.d.ts +6 -0
- package/dist/components/locale/linkLabels.js +4 -0
- package/dist/components/navigation/CtxSlidingList.d.ts +11 -0
- package/dist/components/navigation/CtxSlidingList.js +24 -0
- package/dist/components/navigation/KapiAccordion.d.ts +24 -0
- package/dist/components/navigation/KapiAccordion.js +68 -0
- package/dist/components/navigation/KapiBreadcrumb.d.ts +23 -0
- package/dist/components/navigation/KapiBreadcrumb.js +32 -0
- package/dist/components/navigation/KapiCollapsiblePanel.d.ts +63 -0
- package/dist/components/navigation/KapiCollapsiblePanel.js +83 -0
- package/dist/components/navigation/KapiContextPanel.d.ts +117 -0
- package/dist/components/navigation/KapiContextPanel.js +265 -0
- package/dist/components/navigation/KapiFilterChips.d.ts +30 -0
- package/dist/components/navigation/KapiFilterChips.js +40 -0
- package/dist/components/navigation/KapiNavBadge.d.ts +26 -0
- package/dist/components/navigation/KapiNavBadge.js +33 -0
- package/dist/components/navigation/KapiPanelGroup.d.ts +69 -0
- package/dist/components/navigation/KapiPanelGroup.js +149 -0
- package/dist/components/navigation/KapiSteps.d.ts +43 -0
- package/dist/components/navigation/KapiSteps.js +63 -0
- package/dist/components/navigation/KapiTabs.d.ts +56 -0
- package/dist/components/navigation/KapiTabs.js +81 -0
- package/dist/components/navigation/KapiTree.d.ts +56 -0
- package/dist/components/navigation/KapiTree.js +157 -0
- package/dist/components/navigation/KapiWizard.d.ts +49 -0
- package/dist/components/navigation/KapiWizard.js +104 -0
- package/dist/components/navigation/MiniNavItem.d.ts +35 -0
- package/dist/components/navigation/MiniNavItem.js +57 -0
- package/dist/components/navigation/accordionLogic.d.ts +4 -0
- package/dist/components/navigation/accordionLogic.js +4 -0
- package/dist/components/navigation/activeItemLogic.d.ts +7 -0
- package/dist/components/navigation/activeItemLogic.js +4 -0
- package/dist/components/navigation/breadcrumbLogic.d.ts +8 -0
- package/dist/components/navigation/breadcrumbLogic.js +4 -0
- package/dist/components/navigation/contextPanelLogic.d.ts +27 -0
- package/dist/components/navigation/contextPanelLogic.js +11 -0
- package/dist/components/navigation/filterChipsLogic.d.ts +23 -0
- package/dist/components/navigation/filterChipsLogic.js +20 -0
- package/dist/components/navigation/index.d.ts +39 -0
- package/dist/components/navigation/navBadgeLogic.d.ts +26 -0
- package/dist/components/navigation/navBadgeLogic.js +16 -0
- package/dist/components/navigation/panelGroupLogic.d.ts +15 -0
- package/dist/components/navigation/panelGroupLogic.js +13 -0
- package/dist/components/navigation/panelMini.d.ts +13 -0
- package/dist/components/navigation/panelMini.js +9 -0
- package/dist/components/navigation/panelMiniLogic.d.ts +19 -0
- package/dist/components/navigation/panelMiniLogic.js +6 -0
- package/dist/components/navigation/stepsLogic.d.ts +25 -0
- package/dist/components/navigation/stepsLogic.js +10 -0
- package/dist/components/navigation/tabsLogic.d.ts +12 -0
- package/dist/components/navigation/tabsLogic.js +14 -0
- package/dist/components/navigation/treeLogic.d.ts +80 -0
- package/dist/components/navigation/treeLogic.js +91 -0
- package/dist/components/navigation/wizardLogic.d.ts +11 -0
- package/dist/components/navigation/wizardLogic.js +7 -0
- package/dist/components/overlays/KapiCanvasForm.d.ts +42 -0
- package/dist/components/overlays/KapiCanvasForm.js +60 -0
- package/dist/components/overlays/KapiCommandPalette.d.ts +58 -0
- package/dist/components/overlays/KapiCommandPalette.js +152 -0
- package/dist/components/overlays/KapiConfirm.d.ts +48 -0
- package/dist/components/overlays/KapiConfirm.js +94 -0
- package/dist/components/overlays/KapiContextMenu.d.ts +51 -0
- package/dist/components/overlays/KapiContextMenu.js +90 -0
- package/dist/components/overlays/KapiDialogHost.d.ts +23 -0
- package/dist/components/overlays/KapiDialogHost.js +129 -0
- package/dist/components/overlays/KapiDropdown.d.ts +30 -0
- package/dist/components/overlays/KapiDropdown.js +84 -0
- package/dist/components/overlays/KapiLoading.d.ts +14 -0
- package/dist/components/overlays/KapiLoading.js +43 -0
- package/dist/components/overlays/KapiMenuButton.d.ts +25 -0
- package/dist/components/overlays/KapiMenuButton.js +109 -0
- package/dist/components/overlays/KapiModal.d.ts +61 -0
- package/dist/components/overlays/KapiModal.js +106 -0
- package/dist/components/overlays/KapiOffcanvas.d.ts +96 -0
- package/dist/components/overlays/KapiOffcanvas.js +209 -0
- package/dist/components/overlays/KapiOffcanvasStack.d.ts +58 -0
- package/dist/components/overlays/KapiOffcanvasStack.js +84 -0
- package/dist/components/overlays/KapiPhotoView.d.ts +60 -0
- package/dist/components/overlays/KapiPhotoView.js +122 -0
- package/dist/components/overlays/KapiPopover.d.ts +46 -0
- package/dist/components/overlays/KapiPopover.js +68 -0
- package/dist/components/overlays/KapiShapeSheet.d.ts +34 -0
- package/dist/components/overlays/KapiShapeSheet.js +82 -0
- package/dist/components/overlays/KapiSplitModal.d.ts +41 -0
- package/dist/components/overlays/KapiSplitModal.js +125 -0
- package/dist/components/overlays/KapiTooltip.d.ts +38 -0
- package/dist/components/overlays/KapiTooltip.js +105 -0
- package/dist/components/overlays/canvasFormLogic.d.ts +18 -0
- package/dist/components/overlays/canvasFormLogic.js +16 -0
- package/dist/components/overlays/commandPaletteLogic.d.ts +29 -0
- package/dist/components/overlays/commandPaletteLogic.js +19 -0
- package/dist/components/overlays/dialogStore.d.ts +114 -0
- package/dist/components/overlays/dialogStore.js +76 -0
- package/dist/components/overlays/dialogUtils.d.ts +72 -0
- package/dist/components/overlays/dialogUtils.js +62 -0
- package/dist/components/overlays/exitPresenceLogic.d.ts +14 -0
- package/dist/components/overlays/exitPresenceLogic.js +5 -0
- package/dist/components/overlays/index.d.ts +38 -0
- package/dist/components/overlays/menuButtonLogic.d.ts +58 -0
- package/dist/components/overlays/menuButtonLogic.js +9 -0
- package/dist/components/overlays/menuKeyboardLogic.d.ts +25 -0
- package/dist/components/overlays/menuKeyboardLogic.js +30 -0
- package/dist/components/overlays/offcanvasCompanion.d.ts +16 -0
- package/dist/components/overlays/offcanvasCompanion.js +6 -0
- package/dist/components/overlays/offcanvasResize.d.ts +22 -0
- package/dist/components/overlays/offcanvasResize.js +10 -0
- package/dist/components/overlays/offcanvasSide.d.ts +30 -0
- package/dist/components/overlays/offcanvasSide.js +29 -0
- package/dist/components/overlays/offcanvasStack.d.ts +76 -0
- package/dist/components/overlays/offcanvasStack.js +72 -0
- package/dist/components/overlays/overlayPortal.d.ts +9 -0
- package/dist/components/overlays/overlayPortal.js +6 -0
- package/dist/components/overlays/popoverLogic.d.ts +94 -0
- package/dist/components/overlays/popoverLogic.js +47 -0
- package/dist/components/overlays/splitModalLayout.d.ts +8 -0
- package/dist/components/overlays/splitModalLayout.js +5 -0
- package/dist/components/overlays/useExitPresence.d.ts +14 -0
- package/dist/components/overlays/useExitPresence.js +34 -0
- package/dist/components/overlays/useNativeDialog.d.ts +30 -0
- package/dist/components/overlays/useNativeDialog.js +56 -0
- package/dist/components/rootProps.d.ts +17 -0
- package/dist/components/rootProps.js +4 -0
- package/dist/hooks/breakpointOpenLogic.d.ts +7 -0
- package/dist/hooks/breakpointOpenLogic.js +4 -0
- package/dist/hooks/dateFormat.d.ts +12 -0
- package/dist/hooks/dateFormat.js +15 -0
- package/dist/hooks/downloadLogic.d.ts +31 -0
- package/dist/hooks/downloadLogic.js +85 -0
- package/dist/hooks/focusLogic.d.ts +18 -0
- package/dist/hooks/focusLogic.js +17 -0
- package/dist/hooks/growOriginLogic.d.ts +22 -0
- package/dist/hooks/growOriginLogic.js +10 -0
- package/dist/hooks/hotkeyLogic.d.ts +22 -0
- package/dist/hooks/hotkeyLogic.js +32 -0
- package/dist/hooks/index.d.ts +49 -0
- package/dist/hooks/kapiRoot.d.ts +16 -0
- package/dist/hooks/kapiRoot.js +9 -0
- package/dist/hooks/onlineStatusLogic.d.ts +31 -0
- package/dist/hooks/onlineStatusLogic.js +28 -0
- package/dist/hooks/persistentStateLogic.d.ts +12 -0
- package/dist/hooks/persistentStateLogic.js +17 -0
- package/dist/hooks/rafThrottle.d.ts +33 -0
- package/dist/hooks/rafThrottle.js +33 -0
- package/dist/hooks/recentLogic.d.ts +9 -0
- package/dist/hooks/recentLogic.js +10 -0
- package/dist/hooks/reducedMotion.d.ts +13 -0
- package/dist/hooks/reducedMotion.js +5 -0
- package/dist/hooks/rightClick.d.ts +37 -0
- package/dist/hooks/rightClick.js +30 -0
- package/dist/hooks/scrollCollapseLogic.d.ts +12 -0
- package/dist/hooks/scrollCollapseLogic.js +4 -0
- package/dist/hooks/scrollEdgesLogic.d.ts +49 -0
- package/dist/hooks/scrollEdgesLogic.js +19 -0
- package/dist/hooks/slidingIndicatorLogic.d.ts +25 -0
- package/dist/hooks/slidingIndicatorLogic.js +15 -0
- package/dist/hooks/storageLogic.d.ts +15 -0
- package/dist/hooks/storageLogic.js +24 -0
- package/dist/hooks/unsavedGuardLogic.d.ts +17 -0
- package/dist/hooks/unsavedGuardLogic.js +17 -0
- package/dist/hooks/useDragScroll.d.ts +12 -0
- package/dist/hooks/useDragScroll.js +32 -0
- package/dist/hooks/useGlobalRightClick.d.ts +14 -0
- package/dist/hooks/useGlobalRightClick.js +35 -0
- package/dist/hooks/useGrowOrigin.d.ts +13 -0
- package/dist/hooks/useGrowOrigin.js +16 -0
- package/dist/hooks/useHotkey.d.ts +15 -0
- package/dist/hooks/useHotkey.js +31 -0
- package/dist/hooks/useKapiTheme.d.ts +69 -0
- package/dist/hooks/useKapiTheme.js +88 -0
- package/dist/hooks/useMediaQuery.d.ts +6 -0
- package/dist/hooks/useMediaQuery.js +13 -0
- package/dist/hooks/useObjectUrl.d.ts +6 -0
- package/dist/hooks/useObjectUrl.js +19 -0
- package/dist/hooks/useOnlineStatus.d.ts +7 -0
- package/dist/hooks/useOnlineStatus.js +7 -0
- package/dist/hooks/usePersistentState.d.ts +19 -0
- package/dist/hooks/usePersistentState.js +37 -0
- package/dist/hooks/usePlacement.d.ts +36 -0
- package/dist/hooks/usePlacement.js +84 -0
- package/dist/hooks/useRecent.d.ts +17 -0
- package/dist/hooks/useRecent.js +16 -0
- package/dist/hooks/useScrollCollapse.d.ts +10 -0
- package/dist/hooks/useScrollCollapse.js +27 -0
- package/dist/hooks/useScrollEdges.d.ts +32 -0
- package/dist/hooks/useScrollEdges.js +91 -0
- package/dist/hooks/useSlidingIndicator.d.ts +23 -0
- package/dist/hooks/useSlidingIndicator.js +51 -0
- package/dist/hooks/useUnsavedGuard.d.ts +70 -0
- package/dist/hooks/useUnsavedGuard.js +47 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +162 -0
- package/dist/kapi.css +2 -0
- package/dist/kapi.layered.css +4 -0
- package/package.json +86 -4
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { fieldControlProps as e, joinIds as t } from "./fieldLogic.js";
|
|
3
|
+
import { useKapiField as n } from "./KapiField.js";
|
|
4
|
+
import { useLabels as r } from "../locale/KapiLocaleProvider.js";
|
|
5
|
+
import { joinClasses as i } from "../rootProps.js";
|
|
6
|
+
import { formatFileSize as a, isActivationKey as o, matchesAccept as s, mergeFiles as c, removeFileAt as l } from "./fileUploadLogic.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
+
import { useEffect as f, useId as p, useRef as m, useState as h } from "react";
|
|
10
|
+
import { FileText as g, UploadCloud as _, X as v } from "lucide-react";
|
|
11
|
+
//#region src/components/inputs/KapiFileUpload.tsx
|
|
12
|
+
var y = {
|
|
13
|
+
drop: "Arrastra archivos o",
|
|
14
|
+
choose: "elige",
|
|
15
|
+
remove: "Quitar",
|
|
16
|
+
hint: "PDF, JPG, PNG · hasta 10MB"
|
|
17
|
+
}, b = ({ multiple: b = !0, accept: x, hint: S, onChange: C, disabled: w = !1, className: T, style: E, labels: D, name: O, id: k, onBlur: A, invalid: j, "aria-describedby": M, ref: N }) => {
|
|
18
|
+
let P = r("fileUpload", y, D), F = S ?? P.hint, I = n(), [L, R] = h([]), [z, B] = h(!1), V = m(null), H = p(), U = `${H}-title`, W = `${H}-hint`, G = !!I?.labelId, K = e(I, {
|
|
19
|
+
id: k,
|
|
20
|
+
describedBy: t(G && W, M),
|
|
21
|
+
invalid: j
|
|
22
|
+
});
|
|
23
|
+
f(() => {
|
|
24
|
+
let e = V.current;
|
|
25
|
+
if (!O || !e || typeof DataTransfer > "u" || L.length === 0 && !e.files?.length) return;
|
|
26
|
+
let t = new DataTransfer();
|
|
27
|
+
L.forEach((e) => t.items.add(e)), e.files = t.files;
|
|
28
|
+
}, [L, O]);
|
|
29
|
+
let q = (e) => {
|
|
30
|
+
R(e), C?.(e);
|
|
31
|
+
}, J = (e) => {
|
|
32
|
+
let t = Array.from(e ?? []);
|
|
33
|
+
t.length !== 0 && q(c(L, t, b));
|
|
34
|
+
}, Y = () => V.current?.click();
|
|
35
|
+
return /* @__PURE__ */ d("div", {
|
|
36
|
+
className: i("kapi-upload-wrap", T),
|
|
37
|
+
style: E,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ d("div", {
|
|
40
|
+
ref: N,
|
|
41
|
+
id: K.id,
|
|
42
|
+
"aria-describedby": K["aria-describedby"],
|
|
43
|
+
"aria-invalid": K["aria-invalid"],
|
|
44
|
+
"aria-labelledby": G ? t(I?.labelId, U) : void 0,
|
|
45
|
+
onBlur: A,
|
|
46
|
+
className: `kapi-upload${z ? " is-over" : ""}`,
|
|
47
|
+
onClick: Y,
|
|
48
|
+
onKeyDown: (e) => {
|
|
49
|
+
o(e.key) && (e.preventDefault(), Y());
|
|
50
|
+
},
|
|
51
|
+
onDragOver: (e) => {
|
|
52
|
+
e.preventDefault(), w || B(!0);
|
|
53
|
+
},
|
|
54
|
+
onDragLeave: () => B(!1),
|
|
55
|
+
onDrop: (e) => {
|
|
56
|
+
if (e.preventDefault(), B(!1), w) return;
|
|
57
|
+
let t = Array.from(e.dataTransfer.files).filter((e) => s(e, x));
|
|
58
|
+
t.length !== 0 && q(c(L, t, b));
|
|
59
|
+
},
|
|
60
|
+
role: "button",
|
|
61
|
+
tabIndex: w ? -1 : 0,
|
|
62
|
+
"aria-disabled": w || void 0,
|
|
63
|
+
children: [/* @__PURE__ */ u("span", {
|
|
64
|
+
className: "kapi-upload__ico",
|
|
65
|
+
children: /* @__PURE__ */ u(_, {
|
|
66
|
+
size: 22,
|
|
67
|
+
strokeWidth: 1.9
|
|
68
|
+
})
|
|
69
|
+
}), /* @__PURE__ */ d("div", {
|
|
70
|
+
className: "kapi-upload__body",
|
|
71
|
+
children: [/* @__PURE__ */ d("div", {
|
|
72
|
+
id: U,
|
|
73
|
+
className: "kapi-upload__t",
|
|
74
|
+
children: [
|
|
75
|
+
P.drop,
|
|
76
|
+
" ",
|
|
77
|
+
/* @__PURE__ */ u("b", { children: P.choose })
|
|
78
|
+
]
|
|
79
|
+
}), /* @__PURE__ */ u("div", {
|
|
80
|
+
id: W,
|
|
81
|
+
className: "kapi-upload__s",
|
|
82
|
+
children: F
|
|
83
|
+
})]
|
|
84
|
+
})]
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ u("input", {
|
|
87
|
+
ref: V,
|
|
88
|
+
className: "kapi-upload__input",
|
|
89
|
+
type: "file",
|
|
90
|
+
hidden: !0,
|
|
91
|
+
name: O,
|
|
92
|
+
multiple: b,
|
|
93
|
+
accept: x,
|
|
94
|
+
disabled: w,
|
|
95
|
+
tabIndex: -1,
|
|
96
|
+
onChange: (e) => {
|
|
97
|
+
J(e.target.files), e.target.value = "";
|
|
98
|
+
}
|
|
99
|
+
}),
|
|
100
|
+
L.length > 0 && /* @__PURE__ */ u("div", {
|
|
101
|
+
className: "kapi-upload__list",
|
|
102
|
+
children: L.map((e, t) => /* @__PURE__ */ d("div", {
|
|
103
|
+
className: "kapi-upload__file",
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ u(g, {
|
|
106
|
+
className: "kapi-upload__fileico",
|
|
107
|
+
size: 16,
|
|
108
|
+
strokeWidth: 1.9
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ u("span", {
|
|
111
|
+
className: "kapi-upload__name",
|
|
112
|
+
children: e.name
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ u("span", {
|
|
115
|
+
className: "kapi-upload__size",
|
|
116
|
+
children: a(e.size)
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ u("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
"aria-label": `${P.remove} ${e.name}`,
|
|
121
|
+
onClick: () => q(l(L, t)),
|
|
122
|
+
children: /* @__PURE__ */ u(v, {
|
|
123
|
+
size: 15,
|
|
124
|
+
strokeWidth: 2.2
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}, `${e.name}-${t}`))
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
export { y as DEFAULT_FILE_UPLOAD_LABELS, b as KapiFileUpload };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
+
export type KapiIconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "aria-label"> & {
|
|
3
|
+
/** Nombre accesible (el botón no tiene texto visible). */
|
|
4
|
+
"aria-label": string;
|
|
5
|
+
/** Ícono (lucide-react). Si falta, muestra el glifo `⋯` (acciones de fila). */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/** Ref al `<button>` nativo. */
|
|
8
|
+
ref?: Ref<HTMLButtonElement>;
|
|
9
|
+
};
|
|
10
|
+
/** Clases del botón. Pura y exportada para testear. */
|
|
11
|
+
export declare const iconButtonClasses: (className?: string) => string;
|
|
12
|
+
/** Botón cuadrado de ícono (`.kapi-btn--icon`), p. ej. el `⋯` de acciones de una fila. */
|
|
13
|
+
export declare const KapiIconButton: ({ icon, className, type, ref, ...rest }: KapiIconButtonProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/inputs/KapiIconButton.tsx
|
|
4
|
+
var t = (e = "") => [
|
|
5
|
+
"kapi-btn",
|
|
6
|
+
"kapi-btn--icon",
|
|
7
|
+
e
|
|
8
|
+
].filter(Boolean).join(" "), n = ({ icon: n, className: r, type: i = "button", ref: a, ...o }) => /* @__PURE__ */ e("button", {
|
|
9
|
+
ref: a,
|
|
10
|
+
type: i,
|
|
11
|
+
className: t(r),
|
|
12
|
+
...o,
|
|
13
|
+
children: n ?? "⋯"
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as KapiIconButton, t as iconButtonClasses };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactElement, type ReactNode, type Ref, type TextareaHTMLAttributes } from "react";
|
|
2
|
+
import { type KapiFieldStatus } from "./KapiField";
|
|
3
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
4
|
+
import "./inputsExtra.css";
|
|
5
|
+
export type KapiInputSize = "sm" | "md" | "lg";
|
|
6
|
+
/** Props propias del design system, comunes a input y textarea. */
|
|
7
|
+
type KapiInputOwnProps = {
|
|
8
|
+
/** Escala de control compartida con botones y selects. */
|
|
9
|
+
size?: KapiInputSize | undefined;
|
|
10
|
+
/** Validación: borde verde (`ok`) o rojo (`err`). */
|
|
11
|
+
status?: KapiFieldStatus | undefined;
|
|
12
|
+
/** Angosto y centrado (notas, cantidades en celdas). */
|
|
13
|
+
num?: boolean | undefined;
|
|
14
|
+
/** Etiqueta. Si hay `label` o `help`, el control se envuelve en un `KapiField`. */
|
|
15
|
+
label?: ReactNode | undefined;
|
|
16
|
+
/** Agrega el asterisco de obligatorio a la etiqueta. */
|
|
17
|
+
required?: boolean | undefined;
|
|
18
|
+
/** Ayuda / mensaje de error bajo el control (toma el color de `status`). */
|
|
19
|
+
help?: ReactNode | undefined;
|
|
20
|
+
/** Clase del `KapiField` contenedor (si lo hay). `className` va al control. */
|
|
21
|
+
fieldClassName?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** Textos fijos del input (prop `labels`). */
|
|
24
|
+
export type KapiInputLabels = {
|
|
25
|
+
/** `aria-label` del botón de limpiar. */
|
|
26
|
+
clear: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const DEFAULT_INPUT_LABELS: KapiInputLabels;
|
|
29
|
+
/**
|
|
30
|
+
* Adornos del input (sólo `<input>`, no `multiline`). Con alguno, el input se envuelve en una caja
|
|
31
|
+
* (`.kapi-inputbox`) que lleva el borde, el fondo y el anillo de foco; sin ninguno el markup es el de siempre.
|
|
32
|
+
*/
|
|
33
|
+
type KapiInputAdornmentProps = {
|
|
34
|
+
/** Ícono al inicio. Decorativo (`aria-hidden`). */
|
|
35
|
+
startIcon?: ReactNode;
|
|
36
|
+
/** Ícono al final. Decorativo (`aria-hidden`). */
|
|
37
|
+
endIcon?: ReactNode;
|
|
38
|
+
/** Texto corto antes del valor (`$`, `+54`). Lo leen los lectores (se suma a `aria-describedby`). */
|
|
39
|
+
prefix?: ReactNode;
|
|
40
|
+
/** Texto corto después del valor (`kg`, `ARS`). Lo leen los lectores (se suma a `aria-describedby`). */
|
|
41
|
+
suffix?: ReactNode;
|
|
42
|
+
/** Botón para vaciar el campo; aparece sólo con valor. Dispara `onChange` con `""` y deja el foco en el input. */
|
|
43
|
+
clearable?: boolean;
|
|
44
|
+
/** Avisa que se limpió (además del `onChange`). */
|
|
45
|
+
onClear?: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Atajo de teclado que enfoca el campo (`"/"`, `"Control+K"`), dibujado como `<kbd>` al final mientras el
|
|
48
|
+
* campo está vacío y anunciado con `aria-keyshortcuts`. Sólo presentación: la app registra la tecla
|
|
49
|
+
* (p. ej. con `useHotkey`).
|
|
50
|
+
*/
|
|
51
|
+
shortcut?: string | undefined;
|
|
52
|
+
/** Textos fijos (botón de limpiar). */
|
|
53
|
+
labels?: KapiLabelsOverride<KapiInputLabels> | undefined;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* `prefix` se omite de los atributos HTML: el global `prefix` (RDFa) choca con el adorno del mismo nombre.
|
|
57
|
+
* Con adornos, `className` va a la caja (es la que se ve y ocupa el lugar); sin adornos, al `<input>`.
|
|
58
|
+
*/
|
|
59
|
+
export type KapiInputProps = KapiInputOwnProps & KapiInputAdornmentProps & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> & {
|
|
60
|
+
multiline?: false;
|
|
61
|
+
/** Ref al `<input>`. */
|
|
62
|
+
ref?: Ref<HTMLInputElement>;
|
|
63
|
+
};
|
|
64
|
+
/** El textarea no lleva adornos. */
|
|
65
|
+
export type KapiTextareaProps = KapiInputOwnProps & {
|
|
66
|
+
[K in keyof KapiInputAdornmentProps]?: never;
|
|
67
|
+
} & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "prefix"> & {
|
|
68
|
+
/** Renderiza un `<textarea>` en vez de un `<input>`. */
|
|
69
|
+
multiline: true;
|
|
70
|
+
/** Ref al `<textarea>`. */
|
|
71
|
+
ref?: Ref<HTMLTextAreaElement>;
|
|
72
|
+
};
|
|
73
|
+
/** Clases del control. Pura y exportada: es lo que se testea (no el markup). */
|
|
74
|
+
export declare const inputClasses: ({ size, status, num, className }?: {
|
|
75
|
+
size?: KapiInputSize | undefined;
|
|
76
|
+
status?: KapiFieldStatus | undefined;
|
|
77
|
+
num?: boolean | undefined;
|
|
78
|
+
className?: string | undefined;
|
|
79
|
+
}) => string;
|
|
80
|
+
type KapiInputComponent = {
|
|
81
|
+
(props: KapiInputProps): ReactElement | null;
|
|
82
|
+
(props: KapiTextareaProps): ReactElement | null;
|
|
83
|
+
displayName?: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Campo de texto (`.kapi-input`). `<input>` por defecto; con `multiline` es un `<textarea>`.
|
|
87
|
+
* Con `label` / `help` se envuelve en un `KapiField` y conecta label, ayuda y `aria-invalid`.
|
|
88
|
+
* Adornos opcionales (`startIcon`, `endIcon`, `prefix`, `suffix`, `clearable`, `shortcut`): ver
|
|
89
|
+
* `KapiInputAdornmentProps`.
|
|
90
|
+
*/
|
|
91
|
+
export declare const KapiInput: KapiInputComponent;
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { fieldControlProps as e, joinIds as t } from "./fieldLogic.js";
|
|
3
|
+
import { KapiField as n, useKapiField as r } from "./KapiField.js";
|
|
4
|
+
import { resolveGroupSize as i } from "./inputGroupLogic.js";
|
|
5
|
+
import { useKapiInputGroup as a } from "./KapiInputGroup.js";
|
|
6
|
+
import { hasAdornments as ee, hasValue as o, inputBoxClasses as te, present as s } from "./inputLogic.js";
|
|
7
|
+
import { useLabels as c } from "../locale/KapiLocaleProvider.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { jsx as l, jsxs as ne } from "react/jsx-runtime";
|
|
10
|
+
import { useId as u, useRef as re, useState as d } from "react";
|
|
11
|
+
import { X as f } from "lucide-react";
|
|
12
|
+
//#region src/components/inputs/KapiInput.tsx
|
|
13
|
+
var p = { clear: "Limpiar" }, m = (e) => {
|
|
14
|
+
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
15
|
+
}, h = ({ size: e = "md", status: t, num: n = !1, className: r = "" } = {}) => [
|
|
16
|
+
"kapi-input",
|
|
17
|
+
e !== "md" && `kapi-input--${e}`,
|
|
18
|
+
n && "kapi-input--num",
|
|
19
|
+
t && `kapi-input--${t}`,
|
|
20
|
+
r
|
|
21
|
+
].filter(Boolean).join(" "), g = (g) => {
|
|
22
|
+
let { size: _, status: v, num: y, label: b, required: x, help: S, fieldClassName: C, className: w, multiline: T, id: E, startIcon: D, endIcon: O, prefix: k, suffix: A, clearable: j, onClear: M, shortcut: N, labels: ie, ref: ae, ...P } = g, F = ae, I = r(), L = c("input", p, ie), R = i(_, a()?.size), z = !T && ee({
|
|
23
|
+
startIcon: D,
|
|
24
|
+
endIcon: O,
|
|
25
|
+
prefix: k,
|
|
26
|
+
suffix: A,
|
|
27
|
+
clearable: j,
|
|
28
|
+
shortcut: N
|
|
29
|
+
}), B = re(null), V = P, [H, U] = d(() => o(V.defaultValue)), W = b != null || !!S, G = u(), K = E ?? (W ? G : I?.controlId), q = S ? `${K}-help` : void 0, J = u(), Y = z && s(k) ? `${J}-prefix` : void 0, X = z && s(A) ? `${J}-suffix` : void 0, Z = {
|
|
30
|
+
...e(W ? null : I, {
|
|
31
|
+
id: K,
|
|
32
|
+
describedBy: t(q, P["aria-describedby"], Y, X),
|
|
33
|
+
invalid: v ? v === "err" : void 0
|
|
34
|
+
}),
|
|
35
|
+
required: x,
|
|
36
|
+
className: z ? "kapi-inputbox__control" : h({
|
|
37
|
+
size: R,
|
|
38
|
+
status: v,
|
|
39
|
+
num: y,
|
|
40
|
+
className: w
|
|
41
|
+
})
|
|
42
|
+
}, oe = (e) => {
|
|
43
|
+
B.current = e, typeof F == "function" ? F(e) : F && (F.current = e);
|
|
44
|
+
}, Q = V.value === void 0 ? H : o(V.value), se = () => {
|
|
45
|
+
let e = B.current;
|
|
46
|
+
e && (m(e), U(!1), e.focus(), M?.());
|
|
47
|
+
}, $ = T ? /* @__PURE__ */ l("textarea", {
|
|
48
|
+
ref: F,
|
|
49
|
+
...P,
|
|
50
|
+
...Z
|
|
51
|
+
}) : z ? /* @__PURE__ */ ne("div", {
|
|
52
|
+
className: te({
|
|
53
|
+
size: R,
|
|
54
|
+
status: v,
|
|
55
|
+
disabled: V.disabled,
|
|
56
|
+
className: w
|
|
57
|
+
}),
|
|
58
|
+
onMouseDown: (e) => {
|
|
59
|
+
e.target === B.current || V.disabled || (e.preventDefault(), B.current?.focus());
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
s(D) && /* @__PURE__ */ l("span", {
|
|
63
|
+
className: "kapi-inputbox__icon",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
children: D
|
|
66
|
+
}),
|
|
67
|
+
s(k) && /* @__PURE__ */ l("span", {
|
|
68
|
+
id: Y,
|
|
69
|
+
className: "kapi-inputbox__affix",
|
|
70
|
+
children: k
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ l("input", {
|
|
73
|
+
ref: oe,
|
|
74
|
+
...V,
|
|
75
|
+
...Z,
|
|
76
|
+
"aria-keyshortcuts": V["aria-keyshortcuts"] ?? (N || void 0),
|
|
77
|
+
onChange: (e) => {
|
|
78
|
+
U(o(e.target.value)), V.onChange?.(e);
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
s(A) && /* @__PURE__ */ l("span", {
|
|
82
|
+
id: X,
|
|
83
|
+
className: "kapi-inputbox__affix",
|
|
84
|
+
children: A
|
|
85
|
+
}),
|
|
86
|
+
j && Q && !V.disabled && !V.readOnly && /* @__PURE__ */ l("button", {
|
|
87
|
+
type: "button",
|
|
88
|
+
tabIndex: -1,
|
|
89
|
+
className: "kapi-inputbox__clear",
|
|
90
|
+
"aria-label": L.clear,
|
|
91
|
+
onClick: se,
|
|
92
|
+
children: /* @__PURE__ */ l(f, { "aria-hidden": "true" })
|
|
93
|
+
}),
|
|
94
|
+
N && !Q && /* @__PURE__ */ l("kbd", {
|
|
95
|
+
className: "kapi-inputbox__kbd",
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
children: N
|
|
98
|
+
}),
|
|
99
|
+
s(O) && /* @__PURE__ */ l("span", {
|
|
100
|
+
className: "kapi-inputbox__icon",
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
children: O
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
}) : /* @__PURE__ */ l("input", {
|
|
106
|
+
ref: F,
|
|
107
|
+
...V,
|
|
108
|
+
...Z
|
|
109
|
+
});
|
|
110
|
+
return W ? /* @__PURE__ */ l(n, {
|
|
111
|
+
label: b,
|
|
112
|
+
htmlFor: K,
|
|
113
|
+
required: x,
|
|
114
|
+
help: S,
|
|
115
|
+
helpId: q,
|
|
116
|
+
status: v,
|
|
117
|
+
className: C,
|
|
118
|
+
children: $
|
|
119
|
+
}) : $;
|
|
120
|
+
};
|
|
121
|
+
g.displayName = "KapiInput";
|
|
122
|
+
//#endregion
|
|
123
|
+
export { p as DEFAULT_INPUT_LABELS, g as KapiInput, h as inputClasses };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import type { KapiFieldStatus } from "./KapiField";
|
|
3
|
+
import { type KapiInputGroupSize } from "./inputGroupLogic";
|
|
4
|
+
import "./KapiInputGroup.css";
|
|
5
|
+
export type { KapiInputGroupSize };
|
|
6
|
+
/** Atributos nativos (`id`, `style`, `data-*`…) van a la caja `role="group"` (el rol es propio). */
|
|
7
|
+
export type KapiInputGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "role"> & {
|
|
8
|
+
/** Escala compartida: los `KapiInput` y `KapiSelect` de adentro la toman si no traen `size` propio. */
|
|
9
|
+
size?: KapiInputGroupSize;
|
|
10
|
+
/** Borde de validación del grupo entero (también se pinta solo si un input de adentro tiene `status`). */
|
|
11
|
+
status?: KapiFieldStatus;
|
|
12
|
+
/** Controles y adornos del grupo (`KapiInput`, `KapiSelect`, `KapiInputGroupAddon`…), en orden. */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export type KapiInputGroupAddonProps = {
|
|
16
|
+
/** Sólo decorativo (un ícono suelto): se oculta a lectores. Un texto como "https://" se deja visible. */
|
|
17
|
+
decorative?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
type KapiInputGroupContextValue = {
|
|
22
|
+
size?: KapiInputGroupSize | undefined;
|
|
23
|
+
};
|
|
24
|
+
/** Lo que el grupo le pasa a los controles de adentro (el tamaño); `null` fuera de un grupo. */
|
|
25
|
+
export declare const useKapiInputGroup: () => KapiInputGroupContextValue | null;
|
|
26
|
+
/**
|
|
27
|
+
* Junta varios controles en UNA caja: borde y radio por fuera (sólo las esquinas externas), separadores
|
|
28
|
+
* entre segmentos y un solo anillo de foco cuando cualquiera tiene el foco. Segmentos soportados:
|
|
29
|
+
* `KapiInput` (con o sin adornos), `KapiSelect` (el control cerrado), `KapiButton` y `KapiInputGroup.Addon`.
|
|
30
|
+
* Sólo estiliza: cada control conserva su comportamiento. Un `KapiInput` con `label`/`help` no va adentro:
|
|
31
|
+
* envuelve el grupo entero en un `KapiField`. Ahí la etiqueta apunta al input de texto; el `KapiSelect`
|
|
32
|
+
* usa su propio id (dale `aria-label`). Con varios inputs de texto, pasales `id` explícitos.
|
|
33
|
+
*/
|
|
34
|
+
export declare const KapiInputGroup: {
|
|
35
|
+
({ size, status, className, children, ...rest }: KapiInputGroupProps): import("react").JSX.Element;
|
|
36
|
+
Addon: ({ decorative, className, children }: KapiInputGroupAddonProps) => import("react").JSX.Element;
|
|
37
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { inputGroupAddonClasses as e, inputGroupClasses as t } from "./inputGroupLogic.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as r, useContext as i, useMemo as a } from "react";
|
|
6
|
+
//#region src/components/inputs/KapiInputGroup.tsx
|
|
7
|
+
var o = r(null), s = () => i(o), c = ({ decorative: t = !1, className: r, children: i }) => /* @__PURE__ */ n("span", {
|
|
8
|
+
className: e(r),
|
|
9
|
+
"aria-hidden": t || void 0,
|
|
10
|
+
children: i
|
|
11
|
+
}), l = ({ size: e, status: r, className: i, children: s, ...c }) => {
|
|
12
|
+
let l = a(() => ({ size: e }), [e]);
|
|
13
|
+
return /* @__PURE__ */ n(o.Provider, {
|
|
14
|
+
value: l,
|
|
15
|
+
children: /* @__PURE__ */ n("div", {
|
|
16
|
+
...c,
|
|
17
|
+
role: "group",
|
|
18
|
+
className: t({
|
|
19
|
+
size: e,
|
|
20
|
+
status: r,
|
|
21
|
+
className: i
|
|
22
|
+
}),
|
|
23
|
+
children: s
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
l.Addon = c;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { l as KapiInputGroup, s as useKapiInputGroup };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
import { type KapiInputProps } from "./KapiInput";
|
|
3
|
+
/** Props comunes: las de `KapiInput` (label, help, status, size…) salvo el valor, que cada máscara tipa. */
|
|
4
|
+
type MaskedBaseProps = Omit<KapiInputProps, "value" | "defaultValue" | "multiline" | "type"> & {
|
|
5
|
+
/** Ref al `<input>`. */
|
|
6
|
+
ref?: Ref<HTMLInputElement>;
|
|
7
|
+
};
|
|
8
|
+
export type KapiDniInputProps = MaskedBaseProps & {
|
|
9
|
+
/** Dígitos del DNI (sin puntos). Controlado si viene definido. */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** Dígitos iniciales en modo no controlado (sin `value`). */
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
/** Se llama con los dígitos (sin puntos) en cada cambio. */
|
|
14
|
+
onValueChange?: (digits: string) => void;
|
|
15
|
+
};
|
|
16
|
+
/** DNI argentino con máscara `12.345.678` (7 u 8 dígitos). El valor son sólo los dígitos. */
|
|
17
|
+
export declare const KapiDniInput: ({ value, defaultValue, onValueChange, onChange, ref, placeholder, ...rest }: KapiDniInputProps) => import("react").JSX.Element;
|
|
18
|
+
export type KapiCuitInputProps = MaskedBaseProps & {
|
|
19
|
+
/** Dígitos del CUIT/CUIL (sin guiones). Controlado si viene definido. */
|
|
20
|
+
value?: string;
|
|
21
|
+
/** Dígitos iniciales en modo no controlado (sin `value`). */
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
/** Se llama con los dígitos y si el CUIT está completo y con dígito verificador correcto. */
|
|
24
|
+
onValueChange?: (digits: string, valid: boolean) => void;
|
|
25
|
+
/** Ayuda que se muestra cuando el CUIT está completo pero el dígito verificador no cierra. Gana sobre `invalid` de la clave `cuitInput`. */
|
|
26
|
+
invalidMessage?: string;
|
|
27
|
+
};
|
|
28
|
+
/** Textos del CUIT (clave `cuitInput` del provider; por instancia se pisa con `invalidMessage`, porque `labels` es el de `KapiInput`). */
|
|
29
|
+
export type KapiCuitInputLabels = {
|
|
30
|
+
invalid: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const DEFAULT_CUIT_INPUT_LABELS: KapiCuitInputLabels;
|
|
33
|
+
/**
|
|
34
|
+
* CUIT/CUIL con máscara `20-12345678-9` y validación del dígito verificador. Completo e inválido → borde
|
|
35
|
+
* rojo y `aria-invalid` (salvo que `status` venga de afuera); si el campo tiene label o ayuda, muestra
|
|
36
|
+
* `invalidMessage`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const KapiCuitInput: ({ value, defaultValue, onValueChange, onChange, invalidMessage, status, help, label, ref, placeholder, ...rest }: KapiCuitInputProps) => import("react").JSX.Element;
|
|
39
|
+
export type KapiCurrencyInputProps = MaskedBaseProps & {
|
|
40
|
+
/** Importe. Controlado si viene definido (`null` = vacío). */
|
|
41
|
+
value?: number | null;
|
|
42
|
+
/** Importe inicial en modo no controlado (sin `value`); `null` = vacío. */
|
|
43
|
+
defaultValue?: number | null;
|
|
44
|
+
/** Se llama con el importe (`null` si está vacío) cada vez que cambia. */
|
|
45
|
+
onValueChange?: (value: number | null) => void;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Importe en pesos con formato es-AR (`$ 1.234,56`): puntos de miles automáticos y coma decimal
|
|
49
|
+
* mientras se tipea; al salir del campo completa los dos decimales. El valor es un `number`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const KapiCurrencyInput: ({ value, defaultValue, onValueChange, onChange, onBlur, ref, placeholder, ...rest }: KapiCurrencyInputProps) => import("react").JSX.Element;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { assignRef as e } from "./fieldLogic.js";
|
|
3
|
+
import { useLabels as t } from "../locale/KapiLocaleProvider.js";
|
|
4
|
+
import { KapiInput as n } from "./KapiInput.js";
|
|
5
|
+
import { caretForSignificant as r, countSignificant as i, formatCuit as a, formatCurrency as o, formatDni as s, isValidCuit as c, maskCurrencyInput as l, onlyDigits as u, parseCurrency as d } from "./maskLogic.js";
|
|
6
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback as p, useRef as m, useState as h } from "react";
|
|
8
|
+
//#region src/components/inputs/KapiMaskedInput.tsx
|
|
9
|
+
var g = (t, n, a) => ({
|
|
10
|
+
setRef: p((t) => e(n, t), [n]),
|
|
11
|
+
apply: (e, n) => {
|
|
12
|
+
let o = e.target, s = o.selectionStart ?? o.value.length;
|
|
13
|
+
if (a !== void 0 && u(o.value).length > a) {
|
|
14
|
+
let e = Math.max(0, s - (o.value.length - n.length));
|
|
15
|
+
return o.value = n, o.setSelectionRange(e, e), n;
|
|
16
|
+
}
|
|
17
|
+
let c = i(o.value, s), l = t(o.value);
|
|
18
|
+
if (o.value = l, document.activeElement === o) {
|
|
19
|
+
let e = r(l, c);
|
|
20
|
+
o.setSelectionRange(e, e);
|
|
21
|
+
}
|
|
22
|
+
return l;
|
|
23
|
+
}
|
|
24
|
+
}), _ = ({ value: e, defaultValue: t = "", onValueChange: r, onChange: i, ref: a, placeholder: o = "12.345.678", ...c }) => {
|
|
25
|
+
let [l, d] = h(() => u(t, 8)), p = e === void 0 ? l : u(e, 8), { setRef: m, apply: _ } = g(s, a, 8);
|
|
26
|
+
return /* @__PURE__ */ f(n, {
|
|
27
|
+
...c,
|
|
28
|
+
ref: m,
|
|
29
|
+
value: s(p),
|
|
30
|
+
placeholder: o,
|
|
31
|
+
inputMode: "numeric",
|
|
32
|
+
autoComplete: "off",
|
|
33
|
+
onChange: (t) => {
|
|
34
|
+
let n = u(_(t, s(p)));
|
|
35
|
+
n !== p && (e === void 0 && d(n), r?.(n)), i?.(t);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}, v = { invalid: "CUIT inválido: revisa el dígito verificador" }, y = ({ value: e, defaultValue: r = "", onValueChange: i, onChange: o, invalidMessage: s, status: l, help: d, label: p, ref: m, placeholder: _ = "20-12345678-9", ...y }) => {
|
|
39
|
+
let b = t("cuitInput", v), [x, S] = h(() => u(r, 11)), C = e === void 0 ? x : u(e, 11), w = C.length === 11 && !c(C), T = p != null || !!d, { setRef: E, apply: D } = g(a, m, 11);
|
|
40
|
+
return /* @__PURE__ */ f(n, {
|
|
41
|
+
...y,
|
|
42
|
+
ref: E,
|
|
43
|
+
label: p,
|
|
44
|
+
help: T && w ? s ?? b.invalid : d,
|
|
45
|
+
status: l ?? (w ? "err" : void 0),
|
|
46
|
+
value: a(C),
|
|
47
|
+
placeholder: _,
|
|
48
|
+
inputMode: "numeric",
|
|
49
|
+
autoComplete: "off",
|
|
50
|
+
onChange: (t) => {
|
|
51
|
+
let n = u(D(t, a(C)));
|
|
52
|
+
n !== C && (e === void 0 && S(n), i?.(n, c(n))), o?.(t);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}, b = ({ value: e, defaultValue: t = null, onValueChange: r, onChange: i, onBlur: a, ref: s, placeholder: c = "$ 0,00", ...u }) => {
|
|
56
|
+
let [p, _] = h(() => o(e === void 0 ? t : e)), v = m(d(p)), [y, b] = h(e);
|
|
57
|
+
e !== void 0 && e !== y && (b(e), e !== d(p) && (_(o(e)), v.current = e));
|
|
58
|
+
let { setRef: x, apply: S } = g(l, s);
|
|
59
|
+
return /* @__PURE__ */ f(n, {
|
|
60
|
+
...u,
|
|
61
|
+
ref: x,
|
|
62
|
+
value: p,
|
|
63
|
+
placeholder: c,
|
|
64
|
+
inputMode: "decimal",
|
|
65
|
+
autoComplete: "off",
|
|
66
|
+
onChange: (e) => {
|
|
67
|
+
let t = S(e, p);
|
|
68
|
+
_(t);
|
|
69
|
+
let n = d(t);
|
|
70
|
+
n !== v.current && (v.current = n, r?.(n)), i?.(e);
|
|
71
|
+
},
|
|
72
|
+
onBlur: (e) => {
|
|
73
|
+
_(o(d(p))), a?.(e);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { v as DEFAULT_CUIT_INPUT_LABELS, y as KapiCuitInput, b as KapiCurrencyInput, _ as KapiDniInput };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import "./inputsExtra.css";
|
|
3
|
+
import type { KapiFieldStatus } from "./KapiField";
|
|
4
|
+
import { type KapiInputSize } from "./KapiInput";
|
|
5
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
6
|
+
export type KapiNumberStepperProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step"> & {
|
|
7
|
+
/** Valor actual (controlado). */
|
|
8
|
+
value: number;
|
|
9
|
+
/** Se llama con el número nuevo, ya acotado a `min`/`max`. */
|
|
10
|
+
onChange: (value: number) => void;
|
|
11
|
+
/** Mínimo permitido; en el tope el botón − se deshabilita. */
|
|
12
|
+
min?: number;
|
|
13
|
+
/** Máximo permitido; en el tope el botón + se deshabilita. */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** Cuánto suman o restan los botones − y +. */
|
|
16
|
+
step?: number;
|
|
17
|
+
/** Tamaño del control: `sm` · `md` · `lg`. */
|
|
18
|
+
size?: KapiInputSize;
|
|
19
|
+
/** Estado de validación (borde y ayuda). */
|
|
20
|
+
status?: KapiFieldStatus;
|
|
21
|
+
/** Etiqueta visible; con ella (o `help`) el control se envuelve en un `KapiField`. */
|
|
22
|
+
label?: ReactNode;
|
|
23
|
+
/** Texto de ayuda o error bajo el control. */
|
|
24
|
+
help?: ReactNode;
|
|
25
|
+
/** Class of the group wrapper. `className` goes to the `<input>`. */
|
|
26
|
+
wrapperClassName?: string;
|
|
27
|
+
/** Textos de los botones − y +. */
|
|
28
|
+
labels?: KapiLabelsOverride<KapiNumberStepperLabels> | undefined;
|
|
29
|
+
};
|
|
30
|
+
/** Wrapper classes. Pure and exported. */
|
|
31
|
+
export declare const stepperClasses: ({ size, className }?: {
|
|
32
|
+
size?: KapiInputSize | undefined;
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
}) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Numeric field with − / + buttons. Controlled. Typing is free while focused and is
|
|
37
|
+
* committed (clamped to bounds) on blur / Enter; the buttons and arrow keys step immediately.
|
|
38
|
+
*/
|
|
39
|
+
export type KapiNumberStepperLabels = {
|
|
40
|
+
decrease: string;
|
|
41
|
+
increase: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const DEFAULT_NUMBER_STEPPER_LABELS: KapiNumberStepperLabels;
|
|
44
|
+
export declare const KapiNumberStepper: ({ value, onChange, min, max, step, size, status, label, help, wrapperClassName, labels, className, disabled, id, ...rest }: KapiNumberStepperProps) => import("react").JSX.Element;
|