@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,57 @@
|
|
|
1
|
+
var e = [
|
|
2
|
+
5,
|
|
3
|
+
4,
|
|
4
|
+
3,
|
|
5
|
+
2,
|
|
6
|
+
7,
|
|
7
|
+
6,
|
|
8
|
+
5,
|
|
9
|
+
4,
|
|
10
|
+
3,
|
|
11
|
+
2
|
|
12
|
+
], t = (e, t = Infinity) => (e || "").replace(/\D/g, "").slice(0, t), n = (e) => e.replace(/\B(?=(\d{3})+(?!\d))/g, "."), r = (e) => n(t(e, 8)), i = (e) => {
|
|
13
|
+
let n = t(e, 11);
|
|
14
|
+
return [
|
|
15
|
+
n.slice(0, 2),
|
|
16
|
+
n.slice(2, 10),
|
|
17
|
+
n.slice(10)
|
|
18
|
+
].filter(Boolean).join("-");
|
|
19
|
+
}, a = (n) => {
|
|
20
|
+
let r = t(n);
|
|
21
|
+
if (r.length !== 10) return null;
|
|
22
|
+
let i = 11 - e.reduce((e, t, n) => e + t * Number(r[n]), 0) % 11;
|
|
23
|
+
return i === 11 ? 0 : i === 10 ? null : i;
|
|
24
|
+
}, o = (e) => {
|
|
25
|
+
let n = t(e);
|
|
26
|
+
if (n.length !== 11) return !1;
|
|
27
|
+
let r = a(n.slice(0, 10));
|
|
28
|
+
return r !== null && r === Number(n[10]);
|
|
29
|
+
}, s = (e) => {
|
|
30
|
+
let t = "", n = "", r = !1;
|
|
31
|
+
for (let i of e || "") i === "," ? r = !0 : i >= "0" && i <= "9" && (r ? n += i : t += i);
|
|
32
|
+
return {
|
|
33
|
+
int: t,
|
|
34
|
+
dec: n,
|
|
35
|
+
comma: r
|
|
36
|
+
};
|
|
37
|
+
}, c = (e) => {
|
|
38
|
+
let { int: t, dec: r, comma: i } = s(e);
|
|
39
|
+
return !t && !i ? "" : `\$ ${n((t.replace(/^0+(?=\d)/, "") || "0").slice(0, 13))}${i ? `,${r.slice(0, 2)}` : ""}`;
|
|
40
|
+
}, l = (e) => {
|
|
41
|
+
let { int: t, dec: n } = s(e);
|
|
42
|
+
return !t && !n ? null : Number(`${t.slice(0, 13) || "0"}.${n.slice(0, 2) || "0"}`);
|
|
43
|
+
}, u = (e) => {
|
|
44
|
+
if (e == null || !Number.isFinite(e)) return "";
|
|
45
|
+
let t = Math.abs(e), r = Number(`${t}e2`), i = Math.round(Number.isFinite(r) ? r : t * 100), a = String(Math.floor(i / 100)), o = String(i % 100).padStart(2, "0");
|
|
46
|
+
return `${e < 0 && i > 0 ? "-" : ""}\$ ${n(a)},${o}`;
|
|
47
|
+
}, d = (e) => e === "," || e >= "0" && e <= "9", f = (e, t) => [...e.slice(0, Math.max(0, t))].filter(d).length, p = (e, t) => {
|
|
48
|
+
if (t <= 0) {
|
|
49
|
+
let t = [...e].findIndex(d);
|
|
50
|
+
return t === -1 ? e.length : t;
|
|
51
|
+
}
|
|
52
|
+
let n = 0;
|
|
53
|
+
for (let r = 0; r < e.length; r += 1) if (d(e[r]) && (n += 1, n === t)) return r + 1;
|
|
54
|
+
return e.length;
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { p as caretForSignificant, f as countSignificant, a as cuitCheckDigit, i as formatCuit, u as formatCurrency, r as formatDni, o as isValidCuit, c as maskCurrencyInput, t as onlyDigits, l as parseCurrency };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type StepBounds = {
|
|
2
|
+
min?: number | undefined;
|
|
3
|
+
max?: number | undefined;
|
|
4
|
+
step?: number | undefined;
|
|
5
|
+
};
|
|
6
|
+
/** Clamp to optional bounds. */
|
|
7
|
+
export declare const clampNumber: (value: number, { min, max }?: StepBounds) => number;
|
|
8
|
+
/**
|
|
9
|
+
* Move `value` by `delta` steps (-1 / +1, or any multiple) and clamp to bounds.
|
|
10
|
+
* Rounds to the step's precision so 0.1 + 0.2 style noise never reaches the UI.
|
|
11
|
+
*/
|
|
12
|
+
export declare const stepValue: (value: number, delta: number, { min, max, step }?: StepBounds) => number;
|
|
13
|
+
export declare const canDecrement: (value: number, { min }?: StepBounds) => boolean;
|
|
14
|
+
export declare const canIncrement: (value: number, { max }?: StepBounds) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/components/inputs/numberStepLogic.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let t = String(e), n = /e-(\d+)$/i.exec(t);
|
|
4
|
+
if (n) {
|
|
5
|
+
let e = t.slice(0, n.index), r = e.indexOf(".");
|
|
6
|
+
return (r === -1 ? 0 : e.length - r - 1) + Number(n[1]);
|
|
7
|
+
}
|
|
8
|
+
let r = t.indexOf(".");
|
|
9
|
+
return r === -1 ? 0 : t.length - r - 1;
|
|
10
|
+
}, t = (e, { min: t, max: n } = {}) => {
|
|
11
|
+
let r = e;
|
|
12
|
+
return t !== void 0 && r < t && (r = t), n !== void 0 && r > n && (r = n), r;
|
|
13
|
+
}, n = (n, r, { min: i, max: a, step: o = 1 } = {}) => {
|
|
14
|
+
let s = Number.isFinite(n) ? n : i ?? 0, c = s + r * o, l = Math.max(e(o), e(s));
|
|
15
|
+
return t(Number(c.toFixed(l)), {
|
|
16
|
+
min: i,
|
|
17
|
+
max: a
|
|
18
|
+
});
|
|
19
|
+
}, r = (e, { min: t } = {}) => t === void 0 || e > t, i = (e, { max: t } = {}) => t === void 0 || e < t;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as canDecrement, i as canIncrement, t as clampNumber, n as stepValue };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type StarFill = "full" | "half" | "empty";
|
|
2
|
+
/** Snap a rating to 1 (or 0.5 with `allowHalf`) and clamp to 0..max. */
|
|
3
|
+
export declare const normalizeRating: (value: number, max: number, allowHalf?: boolean) => number;
|
|
4
|
+
/** Fill state of each of the `max` stars for a given value. */
|
|
5
|
+
export declare const starFills: (value: number, max: number, allowHalf?: boolean) => StarFill[];
|
|
6
|
+
/** Rating for a pointer at `ratio` (0..1) across star `index`; left half = half star when allowed. */
|
|
7
|
+
export declare const ratingFromPointer: (index: number, ratio: number, allowHalf?: boolean) => number;
|
|
8
|
+
/** Keyboard handling: returns the next value, or null when the key is not handled. */
|
|
9
|
+
export declare const ratingFromKey: (key: string, value: number, max: number, allowHalf?: boolean) => number | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/components/inputs/ratingLogic.ts
|
|
2
|
+
var e = (e, t, n = !1) => {
|
|
3
|
+
if (!Number.isFinite(e)) return 0;
|
|
4
|
+
let r = n ? .5 : 1, i = Math.round(e / r) * r;
|
|
5
|
+
return Math.min(t, Math.max(0, i));
|
|
6
|
+
}, t = (t, n, r = !1) => {
|
|
7
|
+
let i = e(t, n, r);
|
|
8
|
+
return Array.from({ length: n }, (e, t) => i >= t + 1 ? "full" : r && i >= t + .5 ? "half" : "empty");
|
|
9
|
+
}, n = (e, t, n = !1) => n && t < .5 ? e + .5 : e + 1, r = (t, n, r, i = !1) => {
|
|
10
|
+
let a = i ? .5 : 1;
|
|
11
|
+
switch (t) {
|
|
12
|
+
case "ArrowRight":
|
|
13
|
+
case "ArrowUp": return e(n + a, r, i);
|
|
14
|
+
case "ArrowLeft":
|
|
15
|
+
case "ArrowDown": return e(n - a, r, i);
|
|
16
|
+
case "Home": return 0;
|
|
17
|
+
case "End": return r;
|
|
18
|
+
default: return null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { e as normalizeRating, r as ratingFromKey, n as ratingFromPointer, t as starFills };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Índice del radio a marcar/enfocar tras una tecla (patrón WAI-ARIA radio group, con vuelta).
|
|
3
|
+
* Derecha/Abajo avanzan, Izquierda/Arriba retroceden, Home/End van a los extremos.
|
|
4
|
+
* `current` puede ser -1 (ninguno marcado). Devuelve `undefined` si la tecla no navega.
|
|
5
|
+
*/
|
|
6
|
+
export declare const nextRadioIndex: (count: number, current: number, key: string) => number | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/components/inputs/segmentedLogic.ts
|
|
2
|
+
var e = (e, t, n) => {
|
|
3
|
+
if (e !== 0) switch (n) {
|
|
4
|
+
case "ArrowRight":
|
|
5
|
+
case "ArrowDown": return (t + 1) % e;
|
|
6
|
+
case "ArrowLeft":
|
|
7
|
+
case "ArrowUp": return (t <= 0 ? e : t) - 1;
|
|
8
|
+
case "Home": return 0;
|
|
9
|
+
case "End": return e - 1;
|
|
10
|
+
default: return;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as nextRadioIndex };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export type KapiSelectOption<T = unknown> = {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
data?: T;
|
|
6
|
+
};
|
|
7
|
+
export type KapiSelectGroup<T = unknown> = {
|
|
8
|
+
label: string;
|
|
9
|
+
options: KapiSelectOption<T>[];
|
|
10
|
+
};
|
|
11
|
+
export type KapiSelectEntry<T = unknown> = KapiSelectOption<T> | KapiSelectGroup<T>;
|
|
12
|
+
/** Valor público del select: `string` (simple), `string[]` (múltiple) o `null` (vacío). */
|
|
13
|
+
export type KapiSelectValue = string | string[] | null;
|
|
14
|
+
export declare const isGroup: <T>(entry: KapiSelectEntry<T>) => entry is KapiSelectGroup<T>;
|
|
15
|
+
/** Minúsculas + sin diacríticos: "jose" matchea "José". */
|
|
16
|
+
export declare const normalizeText: (text: string) => string;
|
|
17
|
+
/** Aplana grupos en una lista de opciones (orden visual = orden de navegación por teclado). */
|
|
18
|
+
export declare const flattenOptions: <T>(entries: readonly KapiSelectEntry<T>[]) => KapiSelectOption<T>[];
|
|
19
|
+
/**
|
|
20
|
+
* Filtra por label (sin distinguir mayúsculas ni acentos). Los grupos conservan solo las opciones que
|
|
21
|
+
* matchean y se descartan si quedan vacíos. Query vacía = sin filtro.
|
|
22
|
+
*/
|
|
23
|
+
export declare const filterOptions: <T>(entries: readonly KapiSelectEntry<T>[], query: string) => KapiSelectEntry<T>[];
|
|
24
|
+
export type ActiveDirection = "next" | "prev" | "first" | "last";
|
|
25
|
+
type Navigable = {
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Próximo índice activo saltando deshabilitadas, con wrap. `first`/`last` = Home/End.
|
|
30
|
+
* Devuelve -1 si no hay ninguna opción habilitada.
|
|
31
|
+
*/
|
|
32
|
+
export declare const nextActiveIndex: (current: number, dir: ActiveDirection, items: readonly Navigable[]) => number;
|
|
33
|
+
/** Normaliza el valor al modo del select: múltiple → `string[]`, simple → `string | null`. */
|
|
34
|
+
export declare const normalizeValue: (value: KapiSelectValue | undefined, multiple: boolean) => KapiSelectValue;
|
|
35
|
+
/** Valor resultante de elegir una opción: simple → la opción; múltiple → la agrega o la quita. */
|
|
36
|
+
export declare const toggleValue: (value: KapiSelectValue | undefined, optionValue: string, multiple: boolean) => KapiSelectValue;
|
|
37
|
+
/** Opciones seleccionadas, en el orden del valor (así los chips respetan el orden de selección). */
|
|
38
|
+
export declare const selectedOptions: <T>(entries: readonly KapiSelectEntry<T>[], value: KapiSelectValue | undefined) => KapiSelectOption<T>[];
|
|
39
|
+
/** Texto del valor para lectores de pantalla / vista simple: labels unidos o el placeholder. */
|
|
40
|
+
export declare const displayLabel: (selected: readonly {
|
|
41
|
+
label: string;
|
|
42
|
+
}[], placeholder: string) => string;
|
|
43
|
+
/** Índice activo al abrir el menú: la primera seleccionada habilitada, o el borde pedido. */
|
|
44
|
+
export declare const initialActiveIndex: (items: readonly KapiSelectOption<unknown>[], selectedValues: readonly string[], edge?: "selected" | "first" | "last") => number;
|
|
45
|
+
/**
|
|
46
|
+
* Typeahead (select sin búsqueda): índice de la próxima opción cuyo label empieza con el buffer.
|
|
47
|
+
* Con un solo carácter cicla desde la siguiente a `from`; con más, extiende el prefijo desde la actual.
|
|
48
|
+
*/
|
|
49
|
+
export declare const findTypeaheadIndex: (items: readonly KapiSelectOption<unknown>[], buffer: string, from: number) => number;
|
|
50
|
+
export type IndexedOption<T> = {
|
|
51
|
+
option: KapiSelectOption<T>;
|
|
52
|
+
index: number;
|
|
53
|
+
};
|
|
54
|
+
export type IndexedRow<T> = {
|
|
55
|
+
kind: "option";
|
|
56
|
+
key: string;
|
|
57
|
+
item: IndexedOption<T>;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "group";
|
|
60
|
+
key: string;
|
|
61
|
+
label: string;
|
|
62
|
+
items: IndexedOption<T>[];
|
|
63
|
+
};
|
|
64
|
+
/** Asigna a cada opción su índice en la lista aplanada, conservando la estructura de grupos para renderizar. */
|
|
65
|
+
export declare const indexEntries: <T>(entries: readonly KapiSelectEntry<T>[]) => IndexedRow<T>[];
|
|
66
|
+
export type MenuPlacement = {
|
|
67
|
+
top: number;
|
|
68
|
+
left: number;
|
|
69
|
+
width: number;
|
|
70
|
+
placement: "bottom" | "top";
|
|
71
|
+
};
|
|
72
|
+
/** Opciones del motor para el menú del select: abajo, ancho del control, sin acotar en horizontal. */
|
|
73
|
+
export declare const SELECT_MENU_PLACEMENT: {
|
|
74
|
+
readonly side: "bottom";
|
|
75
|
+
readonly align: "start";
|
|
76
|
+
readonly shift: false;
|
|
77
|
+
readonly width: "anchor";
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Posición del menú (coordenadas de viewport): debajo del control; si no entra y arriba hay más lugar,
|
|
81
|
+
* se abre hacia arriba. Wrapper de `placePopover`.
|
|
82
|
+
*/
|
|
83
|
+
export declare const placeMenu: (rect: {
|
|
84
|
+
top: number;
|
|
85
|
+
bottom: number;
|
|
86
|
+
left: number;
|
|
87
|
+
width: number;
|
|
88
|
+
}, menuHeight: number, viewportHeight: number, gap?: number) => MenuPlacement;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//#region src/components/inputs/selectLogic.ts
|
|
2
|
+
var e = (e) => "options" in e && Array.isArray(e.options), t = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), n = (t) => t.flatMap((t) => e(t) ? t.options : [t]), r = (n, r) => {
|
|
3
|
+
let i = t(r.trim());
|
|
4
|
+
if (!i) return [...n];
|
|
5
|
+
let a = (e) => t(e.label).includes(i), o = [];
|
|
6
|
+
for (let t of n) if (e(t)) {
|
|
7
|
+
let e = t.options.filter(a);
|
|
8
|
+
e.length > 0 && o.push({
|
|
9
|
+
...t,
|
|
10
|
+
options: e
|
|
11
|
+
});
|
|
12
|
+
} else a(t) && o.push(t);
|
|
13
|
+
return o;
|
|
14
|
+
}, i = (e, t, n) => {
|
|
15
|
+
let r = n.length;
|
|
16
|
+
if (!n.some((e) => !e.disabled)) return -1;
|
|
17
|
+
if (t === "first") return n.findIndex((e) => !e.disabled);
|
|
18
|
+
if (t === "last") {
|
|
19
|
+
for (let e = r - 1; e >= 0; e--) if (!n[e]?.disabled) return e;
|
|
20
|
+
return -1;
|
|
21
|
+
}
|
|
22
|
+
let i = t === "next" ? 1 : -1, a = e < 0 || e >= r ? i === 1 ? -1 : r : e;
|
|
23
|
+
for (let e = 0; e < r; e++) if (a = (a + i + r) % r, !n[a]?.disabled) return a;
|
|
24
|
+
return -1;
|
|
25
|
+
}, a = (e, t) => t ? Array.isArray(e) ? e : e == null ? [] : [e] : Array.isArray(e) ? e[0] ?? null : e ?? null, o = (e, t, n) => {
|
|
26
|
+
if (!n) return t;
|
|
27
|
+
let r = a(e, !0);
|
|
28
|
+
return r.includes(t) ? r.filter((e) => e !== t) : [...r, t];
|
|
29
|
+
}, s = (e, t) => {
|
|
30
|
+
let r = a(t, !0), i = n(e), o = [];
|
|
31
|
+
for (let e of r) {
|
|
32
|
+
let t = i.find((t) => t.value === e);
|
|
33
|
+
t && o.push(t);
|
|
34
|
+
}
|
|
35
|
+
return o;
|
|
36
|
+
}, c = (e, t) => e.length > 0 ? e.map((e) => e.label).join(", ") : t, l = (e, t, n = "selected") => {
|
|
37
|
+
if (n === "selected") {
|
|
38
|
+
let n = e.findIndex((e) => !e.disabled && t.includes(e.value));
|
|
39
|
+
if (n >= 0) return n;
|
|
40
|
+
}
|
|
41
|
+
return i(-1, n === "last" ? "last" : "first", e);
|
|
42
|
+
}, u = (e, n, r) => {
|
|
43
|
+
let i = t(n), a = e.length;
|
|
44
|
+
if (!i || a === 0) return -1;
|
|
45
|
+
let o = i.length === 1 ? r + 1 : Math.max(r, 0);
|
|
46
|
+
for (let n = 0; n < a; n++) {
|
|
47
|
+
let r = ((o + n) % a + a) % a, s = e[r];
|
|
48
|
+
if (s && !s.disabled && t(s.label).startsWith(i)) return r;
|
|
49
|
+
}
|
|
50
|
+
return -1;
|
|
51
|
+
}, d = (t) => {
|
|
52
|
+
let n = 0;
|
|
53
|
+
return t.map((t, r) => {
|
|
54
|
+
if (e(t)) {
|
|
55
|
+
let e = t.options.map((e) => ({
|
|
56
|
+
option: e,
|
|
57
|
+
index: n++
|
|
58
|
+
}));
|
|
59
|
+
return {
|
|
60
|
+
kind: "group",
|
|
61
|
+
key: `g${r}-${t.label}`,
|
|
62
|
+
label: t.label,
|
|
63
|
+
items: e
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
kind: "option",
|
|
68
|
+
key: `o${r}-${t.value}`,
|
|
69
|
+
item: {
|
|
70
|
+
option: t,
|
|
71
|
+
index: n++
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
}, f = {
|
|
76
|
+
side: "bottom",
|
|
77
|
+
align: "start",
|
|
78
|
+
shift: !1,
|
|
79
|
+
width: "anchor"
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
export { f as SELECT_MENU_PLACEMENT, c as displayLabel, r as filterOptions, u as findTypeaheadIndex, n as flattenOptions, d as indexEntries, l as initialActiveIndex, e as isGroup, i as nextActiveIndex, t as normalizeText, a as normalizeValue, s as selectedOptions, o as toggleValue };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SliderRange = {
|
|
2
|
+
min: number;
|
|
3
|
+
max: number;
|
|
4
|
+
step: number;
|
|
5
|
+
};
|
|
6
|
+
/** Snap `value` to the nearest step from `min`, clamped to [min, max]. */
|
|
7
|
+
export declare const clampToStep: (value: number, { min, max, step }: SliderRange) => number;
|
|
8
|
+
/** Position of `value` within [min, max] as a 0..100 percentage (drives the track fill). */
|
|
9
|
+
export declare const percentOf: (value: number, min: number, max: number) => number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/components/inputs/sliderLogic.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let t = String(e), n = t.indexOf(".");
|
|
4
|
+
return n === -1 ? 0 : t.length - n - 1;
|
|
5
|
+
}, t = (t, { min: n, max: r, step: i }) => {
|
|
6
|
+
if (Number.isNaN(t)) return n;
|
|
7
|
+
let a = Math.min(Math.max(t, n), r);
|
|
8
|
+
if (i <= 0) return a;
|
|
9
|
+
let o = n + Math.round((a - n) / i) * i, s = Math.max(e(i), e(n)), c = Number(o.toFixed(s));
|
|
10
|
+
return Math.min(c, r);
|
|
11
|
+
}, n = (e, t, n) => {
|
|
12
|
+
if (n <= t) return 0;
|
|
13
|
+
let r = (e - t) / (n - t) * 100;
|
|
14
|
+
return Math.min(100, Math.max(0, r));
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { t as clampToStep, n as percentOf };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type TagRejection = {
|
|
2
|
+
tag: string;
|
|
3
|
+
reason: "invalid";
|
|
4
|
+
message: string;
|
|
5
|
+
} | {
|
|
6
|
+
tag: string;
|
|
7
|
+
reason: "duplicate" | "max";
|
|
8
|
+
};
|
|
9
|
+
export type AddTagsOptions = {
|
|
10
|
+
/** Mensaje de error si el texto no es válido; `null` (o `""`) si lo es: sólo un mensaje no vacío rechaza. */
|
|
11
|
+
validate?: ((tag: string) => string | null) | undefined;
|
|
12
|
+
/** Tope de etiquetas. */
|
|
13
|
+
maxTags?: number | undefined;
|
|
14
|
+
/** Deja repetir etiquetas. Default `false`. */
|
|
15
|
+
allowDuplicates?: boolean | undefined;
|
|
16
|
+
/** Al comparar duplicados, distingue mayúsculas. Default `false`. */
|
|
17
|
+
caseSensitive?: boolean | undefined;
|
|
18
|
+
};
|
|
19
|
+
/** ¿El texto tiene una coma o un salto de línea? */
|
|
20
|
+
export declare const hasSeparator: (text: string) => boolean;
|
|
21
|
+
/** Parte un texto en etiquetas: corta en comas y saltos de línea, recorta y descarta las vacías. */
|
|
22
|
+
export declare const splitTags: (text: string) => string[];
|
|
23
|
+
/** Lo escrito hasta el último separador son etiquetas terminadas; lo que sigue queda como borrador. */
|
|
24
|
+
export declare const splitDraft: (text: string) => {
|
|
25
|
+
complete: string[];
|
|
26
|
+
tail: string;
|
|
27
|
+
};
|
|
28
|
+
/** Reemplaza el rango `[start, end)` de `text` por `insert` (lo que hace un pegado sobre una selección). */
|
|
29
|
+
export declare const spliceText: (text: string, start: number, end: number, insert: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Suma candidatos a la lista sin mutarla. Cada uno se recorta; los vacíos se ignoran y los demás se
|
|
32
|
+
* rechazan por duplicado (sin distinguir mayúsculas salvo `caseSensitive`), inválido (`validate`) o tope
|
|
33
|
+
* (`maxTags`), en ese orden de chequeo: tope, duplicado, validación.
|
|
34
|
+
*/
|
|
35
|
+
export declare const addTags: (values: ReadonlyArray<string>, candidates: ReadonlyArray<string>, { validate, maxTags, allowDuplicates, caseSensitive }?: AddTagsOptions) => {
|
|
36
|
+
values: string[];
|
|
37
|
+
rejected: TagRejection[];
|
|
38
|
+
};
|
|
39
|
+
/** Quita la etiqueta en `index` sin mutar (fuera de rango devuelve una copia igual). */
|
|
40
|
+
export declare const removeTagAt: (values: ReadonlyArray<string>, index: number) => string[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/components/inputs/tagInputLogic.ts
|
|
2
|
+
var e = /[,\r\n]/, t = /[,\r\n]+/, n = (t) => e.test(t), r = (e) => e.split(t).map((e) => e.trim()).filter(Boolean), i = (t) => {
|
|
3
|
+
let n = t.split(e), r = (n.pop() ?? "").trimStart();
|
|
4
|
+
return {
|
|
5
|
+
complete: n.map((e) => e.trim()).filter(Boolean),
|
|
6
|
+
tail: r
|
|
7
|
+
};
|
|
8
|
+
}, a = (e, t, n, r) => e.slice(0, t) + r + e.slice(n), o = (e, t, { validate: n, maxTags: r, allowDuplicates: i = !1, caseSensitive: a = !1 } = {}) => {
|
|
9
|
+
let o = (e) => a ? e : e.toLocaleLowerCase(), s = [...e], c = new Set(s.map(o)), l = [];
|
|
10
|
+
for (let e of t) {
|
|
11
|
+
let t = e.trim();
|
|
12
|
+
if (!t) continue;
|
|
13
|
+
if (r !== void 0 && s.length >= r) {
|
|
14
|
+
l.push({
|
|
15
|
+
tag: t,
|
|
16
|
+
reason: "max"
|
|
17
|
+
});
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
if (!i && c.has(o(t))) {
|
|
21
|
+
l.push({
|
|
22
|
+
tag: t,
|
|
23
|
+
reason: "duplicate"
|
|
24
|
+
});
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
let a = n?.(t) || null;
|
|
28
|
+
a === null ? (s.push(t), c.add(o(t))) : l.push({
|
|
29
|
+
tag: t,
|
|
30
|
+
reason: "invalid",
|
|
31
|
+
message: a
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
values: s,
|
|
36
|
+
rejected: l
|
|
37
|
+
};
|
|
38
|
+
}, s = (e, t) => e.filter((e, n) => n !== t);
|
|
39
|
+
//#endregion
|
|
40
|
+
export { o as addTags, n as hasSeparator, s as removeTagAt, a as spliceText, i as splitDraft, r as splitTags };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type AutosizeBounds = {
|
|
2
|
+
/** Minimum height in px (usually `rows` worth of text). */
|
|
3
|
+
minHeight: number;
|
|
4
|
+
/** Optional maximum height in px; beyond it the textarea scrolls. */
|
|
5
|
+
maxHeight?: number | undefined;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Height a textarea should take for its content. Pure: callers pass the measured
|
|
9
|
+
* `scrollHeight` (content + padding) and get back the clamped height plus whether
|
|
10
|
+
* the content overflows the maximum (so the caller can enable scrolling).
|
|
11
|
+
*/
|
|
12
|
+
export declare const autosizeHeight: (scrollHeight: number, { minHeight, maxHeight }: AutosizeBounds) => {
|
|
13
|
+
height: number;
|
|
14
|
+
overflowing: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** Min/max heights in px from row counts, given line height and vertical padding + borders. */
|
|
17
|
+
export declare const rowsToHeight: (rows: number, lineHeight: number, chrome: number) => number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/components/inputs/textareaLogic.ts
|
|
2
|
+
var e = (e, { minHeight: t, maxHeight: n }) => {
|
|
3
|
+
let r = Math.max(e, t);
|
|
4
|
+
return n !== void 0 && r > n ? {
|
|
5
|
+
height: Math.max(n, t),
|
|
6
|
+
overflowing: !0
|
|
7
|
+
} : {
|
|
8
|
+
height: r,
|
|
9
|
+
overflowing: !1
|
|
10
|
+
};
|
|
11
|
+
}, t = (e, t, n) => Math.round(e * t + n);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as autosizeHeight, t as rowsToHeight };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Foco de los date pickers (patrón WAI-ARIA date picker dialog):
|
|
3
|
+
* - abrir por foco/click en el campo deja el foco ahí (se puede tipear);
|
|
4
|
+
* - abrir con el botón o con Flecha abajo pide enfocar la grilla (`focusRequest` crece);
|
|
5
|
+
* - `returnFocus` cierra y devuelve el foco al campo sin que su `onFocus` vuelva a abrir.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useCalendarFocus: (setOpen: (open: boolean) => void) => {
|
|
8
|
+
inputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
9
|
+
focusRequest: number;
|
|
10
|
+
openFromKeyboard: () => void;
|
|
11
|
+
openFromFocus: () => void;
|
|
12
|
+
returnFocus: () => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as e, useState as t } from "react";
|
|
3
|
+
//#region src/components/inputs/useCalendarFocus.ts
|
|
4
|
+
var n = (n) => {
|
|
5
|
+
let r = e(null), i = e(!1), [a, o] = t(0);
|
|
6
|
+
return {
|
|
7
|
+
inputRef: r,
|
|
8
|
+
focusRequest: a,
|
|
9
|
+
openFromKeyboard: () => {
|
|
10
|
+
o((e) => e + 1), n(!0);
|
|
11
|
+
},
|
|
12
|
+
openFromFocus: () => {
|
|
13
|
+
i.current ? i.current = !1 : (o(0), n(!0));
|
|
14
|
+
},
|
|
15
|
+
returnFocus: () => {
|
|
16
|
+
n(!1);
|
|
17
|
+
let e = r.current;
|
|
18
|
+
e && (i.current = !0, e.focus(), document.activeElement !== e && (i.current = !1), queueMicrotask(() => {
|
|
19
|
+
i.current = !1;
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as useCalendarFocus };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
/** Opciones del motor para el popover (inline) de los date pickers: abajo; arriba si no entra. */
|
|
3
|
+
export declare const DATE_POP_PLACEMENT: {
|
|
4
|
+
readonly side: "bottom";
|
|
5
|
+
readonly align: "start";
|
|
6
|
+
readonly offset: 6;
|
|
7
|
+
readonly flip: "auto";
|
|
8
|
+
readonly shift: false;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Lado del popover inline de KapiDatePicker / KapiDateRangePicker según el motor único: mide el campo
|
|
12
|
+
* y el popover, se reubica con scroll/resize/tamaño. Sólo decide el lado (el CSS posiciona con
|
|
13
|
+
* `kapi-dp__pop--up`); no lo oculta mientras mide porque el foco entra al calendario al abrir.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useDatePopSide: (open: boolean, fieldRef: RefObject<HTMLElement | null>, popRef: RefObject<HTMLElement | null>) => "top" | "bottom";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { usePlacement as e } from "../../hooks/usePlacement.js";
|
|
2
|
+
//#region src/components/inputs/useDatePopSide.ts
|
|
3
|
+
var t = {
|
|
4
|
+
side: "bottom",
|
|
5
|
+
align: "start",
|
|
6
|
+
offset: 6,
|
|
7
|
+
flip: "auto",
|
|
8
|
+
shift: !1
|
|
9
|
+
}, n = (n, r, i) => {
|
|
10
|
+
let { placement: a } = e({
|
|
11
|
+
open: n,
|
|
12
|
+
anchor: r,
|
|
13
|
+
floatingRef: i,
|
|
14
|
+
...t,
|
|
15
|
+
hideUntilPlaced: !1
|
|
16
|
+
});
|
|
17
|
+
return a?.side === "top" ? "top" : "bottom";
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { t as DATE_POP_PLACEMENT, n as useDatePopSide };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Overrides de textos por clave (prop `labels`): cada clave puede faltar o venir en `undefined`. */
|
|
2
|
+
export type KapiLabelsOverride<L> = {
|
|
3
|
+
[K in keyof L]?: L[K] | undefined;
|
|
4
|
+
};
|
|
5
|
+
/** Defaults + overrides por clave. Una clave en `undefined` no borra el default. No muta. */
|
|
6
|
+
export declare const withLabels: <L extends object>(defaults: L, overrides?: KapiLabelsOverride<L>) => L;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type KapiAccessCardTone } from "./accessCardLogic";
|
|
3
|
+
import "./KapiAccessCard.css";
|
|
4
|
+
import type { KapiRootProps } from "../rootProps";
|
|
5
|
+
import { type KapiLinkLabels } from "../locale/linkLabels";
|
|
6
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
7
|
+
/** `className`/`style`/`id` van al enlace o al botón de la card. */
|
|
8
|
+
type CommonProps = KapiRootProps & {
|
|
9
|
+
/** Ícono (lucide-react) dentro del recuadro de color. */
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
/** Rol semántico que define el color del recuadro del ícono. */
|
|
12
|
+
tone?: KapiAccessCardTone;
|
|
13
|
+
/** Título de la card (nombre del sistema o sección). */
|
|
14
|
+
title: ReactNode;
|
|
15
|
+
/** Texto secundario bajo el título. */
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
/** Abre otro sistema / otra pestaña: cambia el chevron por el ícono de enlace externo. */
|
|
18
|
+
external?: boolean;
|
|
19
|
+
/** Textos fijos (aviso de pestaña nueva; clave compartida `link`). */
|
|
20
|
+
labels?: KapiLabelsOverride<KapiLinkLabels> | undefined;
|
|
21
|
+
};
|
|
22
|
+
export type KapiAccessCardProps = CommonProps & ({
|
|
23
|
+
/** Destino como enlace real (`<a>`). */
|
|
24
|
+
href: string;
|
|
25
|
+
/** Abrir en pestaña nueva. */
|
|
26
|
+
newTab?: boolean;
|
|
27
|
+
onClick?: never;
|
|
28
|
+
} | {
|
|
29
|
+
href?: never;
|
|
30
|
+
newTab?: never;
|
|
31
|
+
/** Destino con lógica previa: se dibuja como `role="button"`. */
|
|
32
|
+
onClick: () => void;
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Card de acceso directo: ícono + título + bajada y, a la derecha, un indicador de destino
|
|
36
|
+
* (chevron = navega dentro de la app, flecha ↗ = abre otro sistema). Con `href` es un enlace
|
|
37
|
+
* real; con `onClick`, un botón accesible por teclado (Enter / Espacio).
|
|
38
|
+
*/
|
|
39
|
+
export declare const KapiAccessCard: ({ icon, tone, title, description, external, href, newTab, onClick, className, style, id, labels }: KapiAccessCardProps) => import("react").JSX.Element;
|
|
40
|
+
export {};
|