@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,114 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { KapiConfirmVariant } from "./KapiConfirm";
|
|
3
|
+
/** Opciones de `kapiConfirm()`: las mismas de `KapiConfirm` sin el estado de apertura. */
|
|
4
|
+
export type KapiConfirmOptions = {
|
|
5
|
+
/** Pregunta principal (nombra al diálogo). */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Detalle bajo el título. */
|
|
8
|
+
message?: ReactNode;
|
|
9
|
+
/** danger (default) · warning · success · info · question. */
|
|
10
|
+
variant?: KapiConfirmVariant;
|
|
11
|
+
/** Texto del botón de confirmar (default según `variant`). */
|
|
12
|
+
confirmLabel?: string;
|
|
13
|
+
/** Texto del botón de cancelar (default `labels.cancel` de `confirm`). */
|
|
14
|
+
cancelLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Acción al confirmar. Mientras corre, el botón de confirmar muestra un spinner, los dos
|
|
17
|
+
* botones quedan deshabilitados y el diálogo no se cierra. Si resuelve, el diálogo se cierra y
|
|
18
|
+
* la promesa de `kapiConfirm` da `true`; si rechaza, el diálogo sigue abierto con el error
|
|
19
|
+
* adentro y se puede reintentar o cancelar. La promesa tiene que terminar: mientras corre no hay
|
|
20
|
+
* forma de cerrar el diálogo. `kapiCloseDialogs()` lo cierra igual y resuelve `false`, pero la
|
|
21
|
+
* acción ya iniciada sigue su curso.
|
|
22
|
+
*/
|
|
23
|
+
onConfirm?: () => unknown | Promise<unknown>;
|
|
24
|
+
};
|
|
25
|
+
export type KapiAlertDialogVariant = "success" | "error" | "info" | "warning";
|
|
26
|
+
/** Opciones de `kapiAlert()`: aviso con un solo botón. */
|
|
27
|
+
export type KapiAlertOptions = {
|
|
28
|
+
/** Título del aviso (nombra al diálogo). */
|
|
29
|
+
title: string;
|
|
30
|
+
/** Detalle bajo el título. */
|
|
31
|
+
message?: ReactNode;
|
|
32
|
+
/** success · error · info (default) · warning: define ícono y color. */
|
|
33
|
+
variant?: KapiAlertDialogVariant;
|
|
34
|
+
/** Texto del botón (default `labels.accept` de `dialog`: "Aceptar"). */
|
|
35
|
+
acceptLabel?: string;
|
|
36
|
+
};
|
|
37
|
+
/** Pedido en la cola del host: uno por llamada a `kapiConfirm`/`kapiAlert`. */
|
|
38
|
+
export type KapiDialogRequest = {
|
|
39
|
+
id: number;
|
|
40
|
+
kind: "confirm";
|
|
41
|
+
options: KapiConfirmOptions;
|
|
42
|
+
} | {
|
|
43
|
+
id: number;
|
|
44
|
+
kind: "alert";
|
|
45
|
+
options: KapiAlertOptions;
|
|
46
|
+
};
|
|
47
|
+
/** Estado de la capa de carga: el mensaje de la carga abierta más reciente. */
|
|
48
|
+
export type KapiLoadingState = {
|
|
49
|
+
message: string | undefined;
|
|
50
|
+
};
|
|
51
|
+
export type KapiDialogSnapshot = {
|
|
52
|
+
/** Cabeza de la cola (el diálogo visible) o `null`. */
|
|
53
|
+
dialog: KapiDialogRequest | null;
|
|
54
|
+
/** Capa de carga visible o `null` si no hay ninguna abierta. */
|
|
55
|
+
loading: KapiLoadingState | null;
|
|
56
|
+
};
|
|
57
|
+
/** Handle de una carga abierta con `kapiLoading()`. */
|
|
58
|
+
export type KapiLoadingHandle = {
|
|
59
|
+
/** Cambia el mensaje de esta carga. */
|
|
60
|
+
update: (message: string) => void;
|
|
61
|
+
/** Cierra esta carga; repetirlo no hace nada. */
|
|
62
|
+
close: () => void;
|
|
63
|
+
};
|
|
64
|
+
export type KapiLoadingTask<T> = Promise<T> | (() => Promise<T>);
|
|
65
|
+
export type KapiDialogStore = {
|
|
66
|
+
subscribe: (listener: () => void) => () => void;
|
|
67
|
+
getSnapshot: () => KapiDialogSnapshot;
|
|
68
|
+
/** Encola una confirmación: `true` al confirmar, `false` ante cualquier cierre. */
|
|
69
|
+
confirm: (options: KapiConfirmOptions) => Promise<boolean>;
|
|
70
|
+
/** Encola un aviso: se resuelve al cerrarse. */
|
|
71
|
+
alert: (options: KapiAlertOptions) => Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Resuelve la cabeza de la cola (si `id` coincide) y pasa al siguiente. `confirmed` es la
|
|
74
|
+
* respuesta de una confirmación; en un aviso se ignora (siempre resuelve `undefined`).
|
|
75
|
+
*/
|
|
76
|
+
settle: (id: number, confirmed: boolean) => void;
|
|
77
|
+
/** Resuelve toda la cola como cerrada (confirm `false`, alert `undefined`) y cierra las cargas. */
|
|
78
|
+
closeAll: () => void;
|
|
79
|
+
/** Abre una carga bloqueante. Encolar un diálogo la cierra (como SweetAlert). */
|
|
80
|
+
loading: (message?: string) => KapiLoadingHandle;
|
|
81
|
+
/**
|
|
82
|
+
* Abre una carga mientras corre `task` y la cierra al terminar (también si falla). Un diálogo
|
|
83
|
+
* encolado durante la tarea la oculta en vez de cerrarla: vuelve al cerrarse el diálogo.
|
|
84
|
+
*/
|
|
85
|
+
run: <T>(task: KapiLoadingTask<T>, message?: string) => Promise<T>;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Store imperativo para `useSyncExternalStore`: guarda estado mutable en un closure (cola de
|
|
89
|
+
* diálogos y cargas abiertas) y emite snapshots inmutables. Sin DOM ni React: testeable.
|
|
90
|
+
*/
|
|
91
|
+
export declare const createDialogStore: () => KapiDialogStore;
|
|
92
|
+
/** Store global que usan `kapiConfirm`/`kapiAlert`/`kapiLoading` y `KapiDialogHost`. */
|
|
93
|
+
export declare const dialogStore: KapiDialogStore;
|
|
94
|
+
/** Confirmación imperativa: `if (await kapiConfirm({ title: "¿Eliminar?" })) …`. */
|
|
95
|
+
export declare const kapiConfirm: (options: KapiConfirmOptions) => Promise<boolean>;
|
|
96
|
+
/** Aviso imperativo con un solo botón: `await kapiAlert({ title: "Guardado", variant: "success" })`. */
|
|
97
|
+
export declare const kapiAlert: (options: KapiAlertOptions) => Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Cierra todo: resuelve los diálogos en cola como cerrados (`kapiConfirm` → `false`,
|
|
100
|
+
* `kapiAlert` → `undefined`) y cierra todas las cargas abiertas.
|
|
101
|
+
*/
|
|
102
|
+
export declare const kapiCloseDialogs: () => void;
|
|
103
|
+
/**
|
|
104
|
+
* Texto a mostrar por el rechazo de un `onConfirm`: `error.message` o el string rechazado; `null`
|
|
105
|
+
* para cualquier otro valor o un texto vacío (el host usa el label `confirm.error`). Nunca lanza.
|
|
106
|
+
*/
|
|
107
|
+
export declare const confirmErrorMessage: (error: unknown) => string | null;
|
|
108
|
+
/**
|
|
109
|
+
* Carga bloqueante imperativa: `const h = kapiLoading("Guardando…"); … h.close()`, o
|
|
110
|
+
* `await kapiLoading.run(guardar(), "Guardando…")`, que cierra en el `finally`.
|
|
111
|
+
*/
|
|
112
|
+
export declare const kapiLoading: ((message?: string) => KapiLoadingHandle) & {
|
|
113
|
+
run: <T>(task: KapiLoadingTask<T>, message?: string) => Promise<T>;
|
|
114
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//#region src/components/overlays/dialogStore.ts
|
|
2
|
+
var e = () => {
|
|
3
|
+
let e = [], t = [], n = 0, r = {
|
|
4
|
+
dialog: null,
|
|
5
|
+
loading: null
|
|
6
|
+
}, i = /* @__PURE__ */ new Set(), a = !1, o = !1, s = () => {
|
|
7
|
+
let n = t[t.length - 1];
|
|
8
|
+
r = {
|
|
9
|
+
dialog: e[0]?.request ?? null,
|
|
10
|
+
loading: n ? { message: n.message } : null
|
|
11
|
+
}, i.forEach((e) => e());
|
|
12
|
+
}, c = (n, r) => {
|
|
13
|
+
e = [...e, {
|
|
14
|
+
request: n,
|
|
15
|
+
resolve: r
|
|
16
|
+
}], t = t.filter((e) => e.owned), s(), !(i.size > 0 || a) && (a = !0, setTimeout(() => {
|
|
17
|
+
a = !1, !(i.size > 0 || e.length === 0 || o) && (o = !0, console.warn("kapiConfirm/kapiAlert: no hay ningún KapiDialogHost montado. El diálogo queda en cola hasta que se monte uno."));
|
|
18
|
+
}, 0));
|
|
19
|
+
}, l = (t, n) => {
|
|
20
|
+
let r = e[0];
|
|
21
|
+
r && r.request.id === t && (e = e.slice(1), r.resolve(n), s());
|
|
22
|
+
}, u = () => {
|
|
23
|
+
if (e.length === 0 && t.length === 0) return;
|
|
24
|
+
let n = e;
|
|
25
|
+
e = [], t = [], n.forEach((e) => e.resolve(!1)), s();
|
|
26
|
+
}, d = (e, r) => {
|
|
27
|
+
let i = ++n;
|
|
28
|
+
return t = [...t, {
|
|
29
|
+
id: i,
|
|
30
|
+
message: e,
|
|
31
|
+
owned: r
|
|
32
|
+
}], s(), {
|
|
33
|
+
update: (e) => {
|
|
34
|
+
t.some((e) => e.id === i) && (t = t.map((t) => t.id === i ? {
|
|
35
|
+
...t,
|
|
36
|
+
message: e
|
|
37
|
+
} : t), s());
|
|
38
|
+
},
|
|
39
|
+
close: () => {
|
|
40
|
+
t.some((e) => e.id === i) && (t = t.filter((e) => e.id !== i), s());
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
subscribe: (e) => (i.add(e), o = !1, () => {
|
|
46
|
+
i.delete(e);
|
|
47
|
+
}),
|
|
48
|
+
getSnapshot: () => r,
|
|
49
|
+
confirm: (e) => new Promise((t) => c({
|
|
50
|
+
id: ++n,
|
|
51
|
+
kind: "confirm",
|
|
52
|
+
options: e
|
|
53
|
+
}, t)),
|
|
54
|
+
alert: (e) => new Promise((t) => c({
|
|
55
|
+
id: ++n,
|
|
56
|
+
kind: "alert",
|
|
57
|
+
options: e
|
|
58
|
+
}, () => t())),
|
|
59
|
+
settle: l,
|
|
60
|
+
closeAll: u,
|
|
61
|
+
loading: (e) => d(e, !1),
|
|
62
|
+
run: async (e, t) => {
|
|
63
|
+
let n = d(t, !0);
|
|
64
|
+
try {
|
|
65
|
+
return await (typeof e == "function" ? e() : e);
|
|
66
|
+
} finally {
|
|
67
|
+
n.close();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}, t = e(), n = (e) => t.confirm(e), r = (e) => t.alert(e), i = () => t.closeAll(), a = (e) => {
|
|
72
|
+
let t = e instanceof Error ? e.message : typeof e == "string" ? e : "";
|
|
73
|
+
return typeof t == "string" && t !== "" ? t : null;
|
|
74
|
+
}, o = Object.assign((e) => t.loading(e), { run: (e, n) => t.run(e, n) });
|
|
75
|
+
//#endregion
|
|
76
|
+
export { a as confirmErrorMessage, e as createDialogStore, t as dialogStore, r as kapiAlert, i as kapiCloseDialogs, n as kapiConfirm, o as kapiLoading };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
2
|
+
/**
|
|
3
|
+
* Normaliza un ancho: número → px, string numérico → px, otro string → tal cual
|
|
4
|
+
* (`"40rem"`, `"min(520px, 90vw)"`). Vacío / inválido → `fallback`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const toCssSize: (size: number | string | undefined, fallback: string) => string;
|
|
7
|
+
export type DialogNameInput = {
|
|
8
|
+
/** id del título visible del header. */
|
|
9
|
+
titleId: string;
|
|
10
|
+
/** Título del header; si es string sirve de nombre cuando no hay header. */
|
|
11
|
+
title: unknown;
|
|
12
|
+
/** Sin header visible. */
|
|
13
|
+
hideHeader: boolean;
|
|
14
|
+
"aria-label"?: string | undefined;
|
|
15
|
+
"aria-labelledby"?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Nombre accesible de un diálogo (KapiModal, KapiSplitModal). Precedencia: `aria-labelledby` del
|
|
19
|
+
* consumidor > `aria-label` del consumidor > título del header visible (por id) > título string
|
|
20
|
+
* (sin header). Nunca emite los dos atributos a la vez.
|
|
21
|
+
*/
|
|
22
|
+
export declare const dialogNameProps: ({ titleId, title, hideHeader, "aria-label": label, "aria-labelledby": labelledBy }: DialogNameInput) => {
|
|
23
|
+
"aria-labelledby": string | undefined;
|
|
24
|
+
"aria-label": string | undefined;
|
|
25
|
+
};
|
|
26
|
+
export type KapiModalSize = "sm" | "md" | "lg" | "full";
|
|
27
|
+
/** Clases de la tarjeta del modal (mismas del original). */
|
|
28
|
+
export declare const modalClasses: (size?: KapiModalSize, className?: string) => string;
|
|
29
|
+
/**
|
|
30
|
+
* transform-origin ("x y") a partir del rect de un botón disparador y el viewport:
|
|
31
|
+
* tercios izquierdo/centro/derecho y arriba/centro/abajo. Se pasa al modal vía
|
|
32
|
+
* `className="kapi-modal--origin"` + `style={{ transformOrigin }}` para que "crezca"
|
|
33
|
+
* desde el botón (misma heurística de la referencia).
|
|
34
|
+
*/
|
|
35
|
+
export declare const originFromRect: (rect: {
|
|
36
|
+
left: number;
|
|
37
|
+
top: number;
|
|
38
|
+
width: number;
|
|
39
|
+
}, viewport: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}) => string;
|
|
43
|
+
/** "0.28s" → 280, "150ms" → 150. Valor inválido → 0. */
|
|
44
|
+
export declare const parseCssTime: (token: string) => number;
|
|
45
|
+
/**
|
|
46
|
+
* Duración total más larga (delay + duration) de una lista de transiciones
|
|
47
|
+
* (`getComputedStyle().transitionDuration` / `.transitionDelay`). Las listas se
|
|
48
|
+
* repiten cíclicamente como define CSS. 0 = nada que esperar.
|
|
49
|
+
*/
|
|
50
|
+
export declare const maxTransitionMs: (durations: string, delays: string) => number;
|
|
51
|
+
export type ScrollLockTarget = {
|
|
52
|
+
style: {
|
|
53
|
+
overflow: string;
|
|
54
|
+
paddingRight: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type ScrollLockDeps = {
|
|
58
|
+
getTarget: () => ScrollLockTarget | null;
|
|
59
|
+
/** Ancho de la barra de scroll y padding-right actual (px) para evitar el salto de layout. */
|
|
60
|
+
measure: () => {
|
|
61
|
+
scrollbar: number;
|
|
62
|
+
padding: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Bloqueo de scroll con contador de referencias: varios diálogos apilados lo
|
|
67
|
+
* adquieren a la vez y sólo el último en soltarlo restaura el estilo original.
|
|
68
|
+
*/
|
|
69
|
+
export declare const createScrollLock: ({ getTarget, measure }: ScrollLockDeps) => {
|
|
70
|
+
acquire: () => (() => void);
|
|
71
|
+
getCount: () => number;
|
|
72
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//#region src/components/overlays/dialogUtils.ts
|
|
2
|
+
var e = (e, t, n) => Math.min(n, Math.max(t, e)), t = (e, t) => {
|
|
3
|
+
if (typeof e == "number") return Number.isFinite(e) && e > 0 ? `${e}px` : t;
|
|
4
|
+
let n = e?.trim();
|
|
5
|
+
return n ? /^\d+(\.\d+)?$/.test(n) ? `${n}px` : n : t;
|
|
6
|
+
}, n = ({ titleId: e, title: t, hideHeader: n, "aria-label": r, "aria-labelledby": i }) => i === void 0 ? r === void 0 ? n ? {
|
|
7
|
+
"aria-labelledby": void 0,
|
|
8
|
+
"aria-label": typeof t == "string" ? t : void 0
|
|
9
|
+
} : {
|
|
10
|
+
"aria-labelledby": e,
|
|
11
|
+
"aria-label": void 0
|
|
12
|
+
} : {
|
|
13
|
+
"aria-labelledby": void 0,
|
|
14
|
+
"aria-label": r
|
|
15
|
+
} : {
|
|
16
|
+
"aria-labelledby": i,
|
|
17
|
+
"aria-label": void 0
|
|
18
|
+
}, r = {
|
|
19
|
+
sm: " kapi-modal--sm",
|
|
20
|
+
md: "",
|
|
21
|
+
lg: " kapi-modal--lg",
|
|
22
|
+
full: " kapi-modal--full"
|
|
23
|
+
}, i = (e = "md", t = "") => `kapi-modal${r[e] ?? ""}${t ? ` ${t}` : ""}`, a = (e) => {
|
|
24
|
+
let t = /^\s*(-?\d*\.?\d+)(ms|s)\s*$/.exec(e);
|
|
25
|
+
if (!t) return 0;
|
|
26
|
+
let n = Number(t[1]);
|
|
27
|
+
return t[2] === "s" ? n * 1e3 : n;
|
|
28
|
+
}, o = (e, t) => {
|
|
29
|
+
let n = e.split(",").map(a), r = t.split(",").map(a), i = Math.max(n.length, r.length), o = 0;
|
|
30
|
+
for (let e = 0; e < i; e += 1) {
|
|
31
|
+
let t = (n[e % n.length] ?? 0) + (r[e % r.length] ?? 0);
|
|
32
|
+
t > o && (o = t);
|
|
33
|
+
}
|
|
34
|
+
return o;
|
|
35
|
+
}, s = ({ getTarget: e, measure: t }) => {
|
|
36
|
+
let n = 0, r = null;
|
|
37
|
+
return {
|
|
38
|
+
acquire: () => {
|
|
39
|
+
if (n += 1, n === 1) {
|
|
40
|
+
let n = e();
|
|
41
|
+
if (n) {
|
|
42
|
+
r = {
|
|
43
|
+
overflow: n.style.overflow,
|
|
44
|
+
paddingRight: n.style.paddingRight
|
|
45
|
+
};
|
|
46
|
+
let { scrollbar: e, padding: i } = t();
|
|
47
|
+
n.style.overflow = "hidden", e > 0 && (n.style.paddingRight = `${i + e}px`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
let i = !1;
|
|
51
|
+
return () => {
|
|
52
|
+
if (!i && (i = !0, n = Math.max(0, n - 1), n === 0 && r)) {
|
|
53
|
+
let t = e();
|
|
54
|
+
t && (t.style.overflow = r.overflow, t.style.paddingRight = r.paddingRight), r = null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
getCount: () => n
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { e as clamp, s as createScrollLock, n as dialogNameProps, o as maxTransitionMs, i as modalClasses, a as parseCssTime, t as toCssSize };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Red de seguridad de una salida (ms que se suman a la duración medida del CSS). El cierre termina en
|
|
3
|
+
* el `animationend`/`transitionend` del elemento; este margen solo cubre un evento que no llega
|
|
4
|
+
* (pestaña en segundo plano, animación cancelada). Mismo rol que `TOAST_LEAVE_MS` en el toast.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EXIT_SAFETY_MARGIN_MS = 100;
|
|
7
|
+
/** `open`: montado y visible · `closing`: `open` pasó a false, sigue montado animando la salida · `closed`: desmontado. */
|
|
8
|
+
export type ExitPhase = "open" | "closing" | "closed";
|
|
9
|
+
/** Fase siguiente según `open`. Abrir gana siempre (también reabriendo en pleno `closing`). */
|
|
10
|
+
export declare const nextExitPhase: (phase: ExitPhase, open: boolean) => ExitPhase;
|
|
11
|
+
/** Las cuatro propiedades de `getComputedStyle` que definen cuánto dura una salida. */
|
|
12
|
+
export type ExitTiming = Pick<CSSStyleDeclaration, "animationDuration" | "animationDelay" | "transitionDuration" | "transitionDelay">;
|
|
13
|
+
/** Espera de la salida (ms): la mayor entre las animaciones y las transiciones del elemento. 0 = nada que esperar. */
|
|
14
|
+
export declare const exitWaitMs: (t: ExitTiming) => number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { maxTransitionMs as e } from "./dialogUtils.js";
|
|
2
|
+
//#region src/components/overlays/exitPresenceLogic.ts
|
|
3
|
+
var t = (e, t) => t ? "open" : e === "open" ? "closing" : e, n = (t) => Math.max(e(t.animationDuration || "0s", t.animationDelay || "0s"), e(t.transitionDuration || "0s", t.transitionDelay || "0s"));
|
|
4
|
+
//#endregion
|
|
5
|
+
export { n as exitWaitMs, t as nextExitPhase };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export { KapiContextMenu } from "./KapiContextMenu";
|
|
2
|
+
export type { KapiMenuItem, KapiContextMenuProps } from "./KapiContextMenu";
|
|
3
|
+
export { KapiMenuButton } from "./KapiMenuButton";
|
|
4
|
+
export type { KapiMenuButtonProps } from "./KapiMenuButton";
|
|
5
|
+
export { KapiDropdown } from "./KapiDropdown";
|
|
6
|
+
export type { KapiDropdownDrop, KapiDropdownOption, KapiDropdownProps } from "./KapiDropdown";
|
|
7
|
+
export { KapiTooltip } from "./KapiTooltip";
|
|
8
|
+
export type { KapiTooltipProps, KapiTooltipSide } from "./KapiTooltip";
|
|
9
|
+
export { KapiPhotoView, DEFAULT_PHOTO_VIEW_LABELS } from "./KapiPhotoView";
|
|
10
|
+
export type { KapiPhotoViewLabels, KapiPhotoViewProps } from "./KapiPhotoView";
|
|
11
|
+
export { KapiShapeSheet, DEFAULT_SHAPE_SHEET_LABELS } from "./KapiShapeSheet";
|
|
12
|
+
export type { KapiShapeSheetProps, KapiShapeSheetLabels } from "./KapiShapeSheet";
|
|
13
|
+
export { KapiModal, DEFAULT_MODAL_LABELS } from "./KapiModal";
|
|
14
|
+
export type { KapiModalLabels, KapiModalProps, KapiModalSize } from "./KapiModal";
|
|
15
|
+
export { KapiSplitModal, DEFAULT_SPLIT_MODAL_LABELS } from "./KapiSplitModal";
|
|
16
|
+
export type { KapiSplitModalAside, KapiSplitModalProps, KapiSplitModalLabels } from "./KapiSplitModal";
|
|
17
|
+
export { KapiConfirm, DEFAULT_CONFIRM_LABELS } from "./KapiConfirm";
|
|
18
|
+
export type { KapiConfirmLabels, KapiConfirmProps, KapiConfirmVariant } from "./KapiConfirm";
|
|
19
|
+
export { KapiDialogHost, DEFAULT_DIALOG_LABELS } from "./KapiDialogHost";
|
|
20
|
+
export type { KapiDialogHostProps, KapiDialogLabels } from "./KapiDialogHost";
|
|
21
|
+
export { kapiAlert, kapiCloseDialogs, kapiConfirm, kapiLoading, createDialogStore } from "./dialogStore";
|
|
22
|
+
export type { KapiAlertOptions, KapiAlertDialogVariant, KapiConfirmOptions, KapiDialogRequest, KapiDialogSnapshot, KapiDialogStore, KapiLoadingHandle, KapiLoadingState, KapiLoadingTask } from "./dialogStore";
|
|
23
|
+
export { KapiLoading } from "./KapiLoading";
|
|
24
|
+
export type { KapiLoadingProps } from "./KapiLoading";
|
|
25
|
+
export { KapiOffcanvas, DEFAULT_OFFCANVAS_LABELS } from "./KapiOffcanvas";
|
|
26
|
+
export type { KapiOffcanvasProps, KapiOffcanvasCompanion, KapiOffcanvasLabels } from "./KapiOffcanvas";
|
|
27
|
+
export { KapiOffcanvasStack, useKapiOffcanvasPanel, useKapiOffcanvasStack } from "./KapiOffcanvasStack";
|
|
28
|
+
export type { KapiOffcanvasPanelApi, KapiOffcanvasPanelConfig, KapiOffcanvasStackControls } from "./KapiOffcanvasStack";
|
|
29
|
+
export { KapiOverlayPortal } from "./overlayPortal";
|
|
30
|
+
export type { KapiOverlayPortalProps } from "./overlayPortal";
|
|
31
|
+
export { KapiCanvasForm, DEFAULT_CANVAS_FORM_LABELS } from "./KapiCanvasForm";
|
|
32
|
+
export type { KapiCanvasFormLabels, KapiCanvasFormProps } from "./KapiCanvasForm";
|
|
33
|
+
export { KapiCommandPalette, DEFAULT_COMMAND_PALETTE_LABELS } from "./KapiCommandPalette";
|
|
34
|
+
export type { KapiCommand, KapiCommandGroup, KapiCommandPaletteLabels, KapiCommandPaletteProps } from "./KapiCommandPalette";
|
|
35
|
+
export { KapiPopover } from "./KapiPopover";
|
|
36
|
+
export type { KapiPopoverProps } from "./KapiPopover";
|
|
37
|
+
export { isOutsidePopover, placePopover, samePlacement, shiftIntoView } from "./popoverLogic";
|
|
38
|
+
export type { KapiPlacePopoverOptions, KapiPopoverAlign, KapiPopoverAnchor, KapiPopoverFlip, KapiPopoverPlacement, KapiPopoverPoint, KapiPopoverRect, KapiPopoverSide, KapiPopoverSize, KapiPopoverWidth } from "./popoverLogic";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { KapiMenuItem } from "./KapiContextMenu";
|
|
2
|
+
import { type MenuNavKey } from "./menuKeyboardLogic";
|
|
3
|
+
export type { MenuNavKey } from "./menuKeyboardLogic";
|
|
4
|
+
export type MenuButtonPlacement = {
|
|
5
|
+
top: number;
|
|
6
|
+
left: number;
|
|
7
|
+
placement: "bottom" | "top";
|
|
8
|
+
align?: "left" | "right";
|
|
9
|
+
};
|
|
10
|
+
/** True for non-interactive entries (separators and section headers). */
|
|
11
|
+
export declare const isStaticMenuItem: (item: KapiMenuItem) => boolean;
|
|
12
|
+
/** Indexes of the actionable (not separator / header / disabled) items, in visual order. */
|
|
13
|
+
export declare const actionableIndexes: (items: readonly KapiMenuItem[]) => number[];
|
|
14
|
+
/**
|
|
15
|
+
* Next focused index skipping separators, headers and disabled items, with wrap. `current` of -1 means nothing focused yet.
|
|
16
|
+
* Returns -1 when there is no actionable item.
|
|
17
|
+
*/
|
|
18
|
+
export declare const nextMenuIndex: (current: number, dir: MenuNavKey, items: readonly KapiMenuItem[]) => number;
|
|
19
|
+
/** Alto de un ítem accionable: padding `--kapi-space-4` × 2 + línea de `--kapi-fs-base` (overlays/kapi.css). */
|
|
20
|
+
export declare const MENU_ITEM_HEIGHT = 40;
|
|
21
|
+
/** Alto de un separador: 1px + margen `--kapi-space-2` × 2. */
|
|
22
|
+
export declare const MENU_SEP_HEIGHT = 9;
|
|
23
|
+
/** Alto de un encabezado: padding `--kapi-space-4` + `--kapi-space-2` + línea de `--kapi-fs-2xs` (~14px). */
|
|
24
|
+
export declare const MENU_HEADER_HEIGHT = 26;
|
|
25
|
+
/** Padding `--kapi-space-3` × 2 + borde de 1px × 2 del contenedor del menú. */
|
|
26
|
+
export declare const MENU_PADDING = 14;
|
|
27
|
+
/**
|
|
28
|
+
* Alto estimado de un menú según el tipo de cada ítem (separadores y encabezados no miden como una
|
|
29
|
+
* fila). Sólo es el valor provisorio de `usePlacement` hasta que hay medida real.
|
|
30
|
+
*/
|
|
31
|
+
export declare const estimateMenuHeight: (items: readonly KapiMenuItem[]) => number;
|
|
32
|
+
export type MenuAlign = "left" | "right";
|
|
33
|
+
/** Engine options the component uses: auto edge align, flip, and the horizontal clamp (`clampMenuLeft`). */
|
|
34
|
+
export declare const ACTION_MENU_PLACEMENT: {
|
|
35
|
+
readonly align: "auto";
|
|
36
|
+
readonly flip: "auto";
|
|
37
|
+
readonly shift: true;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Menu position (viewport coordinates). Horizontally the menu is anchored to the trigger edge that
|
|
41
|
+
* has room: left-aligned by default, right-aligned when left-align would overflow the viewport or the
|
|
42
|
+
* trigger sits in the right half. Vertically it opens in the preferred direction and flips when it
|
|
43
|
+
* does not fit and the opposite side has more room. Thin wrapper over `placePopover` (`align: "auto"`).
|
|
44
|
+
*/
|
|
45
|
+
export declare const placeActionMenu: (rect: {
|
|
46
|
+
top: number;
|
|
47
|
+
bottom: number;
|
|
48
|
+
left: number;
|
|
49
|
+
right: number;
|
|
50
|
+
}, menu: {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
}, viewport: {
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
}, gap?: number, prefer?: "down" | "up", margin?: number) => MenuButtonPlacement;
|
|
57
|
+
/** Last-resort safety net: keeps the menu inside the viewport horizontally. */
|
|
58
|
+
export declare const clampMenuLeft: (left: number, menuWidth: number, viewportWidth: number, margin?: number) => number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { nextEnabledIndex as e } from "./menuKeyboardLogic.js";
|
|
2
|
+
//#region src/components/overlays/menuButtonLogic.ts
|
|
3
|
+
var t = (e) => e.sep === !0 || "header" in e, n = (e) => t(e) || "label" in e && e.disabled === !0, r = (e) => e.flatMap((e, t) => n(e) ? [] : [t]), i = (t, n, i) => e(t, n, r(i)), a = (e) => e.reduce((e, t) => e + (t.sep === !0 ? 9 : "header" in t ? 26 : 40), 14), o = {
|
|
4
|
+
align: "auto",
|
|
5
|
+
flip: "auto",
|
|
6
|
+
shift: !0
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { o as ACTION_MENU_PLACEMENT, r as actionableIndexes, a as estimateMenuHeight, t as isStaticMenuItem, i as nextMenuIndex };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Keyboard model shared by every menu (MenuButton, Dropdown, ContextMenu). Pure. */
|
|
2
|
+
export type MenuNavKey = "next" | "prev" | "first" | "last";
|
|
3
|
+
export type MenuKeyIntent = {
|
|
4
|
+
kind: "move";
|
|
5
|
+
dir: MenuNavKey;
|
|
6
|
+
} | {
|
|
7
|
+
kind: "close";
|
|
8
|
+
returnFocus: boolean;
|
|
9
|
+
} | {
|
|
10
|
+
kind: "none";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* What a key does inside an open menu. Escape closes and returns focus to the trigger; Tab closes
|
|
14
|
+
* and lets focus move on. Enter/Space are left to the native `<button>` items.
|
|
15
|
+
*/
|
|
16
|
+
export declare const menuKeyIntent: (key: string) => MenuKeyIntent;
|
|
17
|
+
/**
|
|
18
|
+
* Next focused index among `enabled` (indexes in visual order), with wrap. `current` of -1 means
|
|
19
|
+
* nothing focused yet. Returns -1 when nothing is enabled.
|
|
20
|
+
*/
|
|
21
|
+
export declare const nextEnabledIndex: (current: number, dir: MenuNavKey, enabled: readonly number[]) => number;
|
|
22
|
+
/** Index to focus when the menu opens: `preferred` (e.g. the selected option) if enabled, else the first. */
|
|
23
|
+
export declare const initialMenuFocus: (enabled: readonly number[], preferred?: number) => number;
|
|
24
|
+
/** Reads the `data-menu-index` of the focused element (-1 when focus is outside the items). */
|
|
25
|
+
export declare const focusedMenuIndex: (el: Element | null) => number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/components/overlays/menuKeyboardLogic.ts
|
|
2
|
+
var e = {
|
|
3
|
+
ArrowDown: "next",
|
|
4
|
+
ArrowUp: "prev",
|
|
5
|
+
Home: "first",
|
|
6
|
+
End: "last"
|
|
7
|
+
}, t = (t) => {
|
|
8
|
+
let n = e[t];
|
|
9
|
+
return n ? {
|
|
10
|
+
kind: "move",
|
|
11
|
+
dir: n
|
|
12
|
+
} : t === "Escape" ? {
|
|
13
|
+
kind: "close",
|
|
14
|
+
returnFocus: !0
|
|
15
|
+
} : t === "Tab" ? {
|
|
16
|
+
kind: "close",
|
|
17
|
+
returnFocus: !1
|
|
18
|
+
} : { kind: "none" };
|
|
19
|
+
}, n = (e, t, n) => {
|
|
20
|
+
if (n.length === 0) return -1;
|
|
21
|
+
if (t === "first") return n[0];
|
|
22
|
+
if (t === "last") return n[n.length - 1];
|
|
23
|
+
let r = n.indexOf(e);
|
|
24
|
+
return t === "next" ? r < 0 ? n[0] : n[(r + 1) % n.length] : r < 0 ? n[n.length - 1] : n[(r - 1 + n.length) % n.length];
|
|
25
|
+
}, r = (e, t) => t !== void 0 && e.includes(t) ? t : e[0] ?? -1, i = (e) => {
|
|
26
|
+
let t = e?.getAttribute("data-menu-index");
|
|
27
|
+
return t == null ? -1 : Number(t);
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { i as focusedMenuIndex, r as initialMenuFocus, t as menuKeyIntent, n as nextEnabledIndex };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type OffcanvasSide } from "./offcanvasSide";
|
|
2
|
+
export declare const DEFAULT_COMPANION_WIDTH = "400px";
|
|
3
|
+
/** DOM order of the dock: a right drawer is [companion | main], a left drawer is [main | companion]. */
|
|
4
|
+
export type CompanionPanelOrder = ["companion", "main"] | ["main", "companion"];
|
|
5
|
+
/** Only left/right drawers can dock a companion; top/bottom ignore it. */
|
|
6
|
+
export declare const supportsCompanion: (side: OffcanvasSide) => boolean;
|
|
7
|
+
/** The companion sits on the INNER side: left of a right drawer, right of a left drawer. */
|
|
8
|
+
export declare const resolveCompanionOrder: (side: OffcanvasSide) => CompanionPanelOrder;
|
|
9
|
+
/** Companion width as a CSS length (number → px, numeric string → px, other strings untouched). */
|
|
10
|
+
export declare const resolveCompanionWidth: (width: number | string | undefined) => string;
|
|
11
|
+
/** True when the companion should actually render for this side/state. */
|
|
12
|
+
export declare const isCompanionActive: (side: OffcanvasSide, companion: {
|
|
13
|
+
open: boolean;
|
|
14
|
+
} | undefined) => boolean;
|
|
15
|
+
/** Class list of the dock wrapper (always present so the main panel never changes parent). */
|
|
16
|
+
export declare const companionDockClasses: (active: boolean) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { toCssSize as e } from "./dialogUtils.js";
|
|
2
|
+
import { isHorizontalSide as t } from "./offcanvasSide.js";
|
|
3
|
+
//#region src/components/overlays/offcanvasCompanion.ts
|
|
4
|
+
var n = "400px", r = (e) => t(e), i = (e) => e === "left" ? ["main", "companion"] : ["companion", "main"], a = (t) => e(t, n), o = (e, t) => t?.open === !0 && r(e), s = (e) => e ? "kapi-offc__dock kapi-offc__dock--companion" : "kapi-offc__dock";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { n as DEFAULT_COMPANION_WIDTH, s as companionDockClasses, o as isCompanionActive, i as resolveCompanionOrder, a as resolveCompanionWidth, r as supportsCompanion };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OffcanvasSide } from "./offcanvasSide";
|
|
2
|
+
export declare const DEFAULT_OFFCANVAS_MIN_WIDTH = 320;
|
|
3
|
+
/** Tope de respaldo cuando no hay viewport disponible (SSR). */
|
|
4
|
+
export declare const FALLBACK_OFFCANVAS_MAX_WIDTH = 960;
|
|
5
|
+
/** Paso de teclado en px. */
|
|
6
|
+
export declare const OFFCANVAS_RESIZE_STEP = 16;
|
|
7
|
+
/** Acota `width` a [min, max]. Si min > max gana min. */
|
|
8
|
+
export declare const clampOffcanvasWidth: (width: number, min: number, max: number) => number;
|
|
9
|
+
/** Máximo efectivo: el pedido, o el 90 % del viewport, o el respaldo. */
|
|
10
|
+
export declare const resolveMaxWidth: (maxWidth: number | undefined, viewportWidth?: number) => number;
|
|
11
|
+
/**
|
|
12
|
+
* Ancho resultante de arrastrar el borde interno. `right`: mover a la izquierda agranda;
|
|
13
|
+
* `left`: mover a la derecha agranda. top/bottom no redimensionan: devuelve el ancho inicial.
|
|
14
|
+
*/
|
|
15
|
+
export declare const widthFromDrag: (side: OffcanvasSide, startWidth: number, startClientX: number, currentClientX: number, min: number, max: number) => number;
|
|
16
|
+
/**
|
|
17
|
+
* Teclado sobre el separador. Flechas horizontales según el lado (en `right`, ArrowLeft agranda;
|
|
18
|
+
* en `left`, ArrowRight agranda); ArrowUp agranda y ArrowDown achica. Otra tecla: sin cambio (null).
|
|
19
|
+
*/
|
|
20
|
+
export declare const stepOffcanvasWidth: (side: OffcanvasSide, width: number, key: string, min: number, max: number, step?: number) => number | null;
|
|
21
|
+
/** Número inicial desde number | string | undefined; un string no numérico cae al respaldo. */
|
|
22
|
+
export declare const resolveInitialWidth: (width: number | string | undefined, fallback: number) => number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var e = (e, t, n) => Math.round(Math.max(t, Math.min(n, e))), t = (e, t) => typeof e == "number" && Number.isFinite(e) ? e : typeof t == "number" && t > 0 ? Math.round(t * .9) : 960, n = (t, n, r, i, a, o) => t === "right" ? e(n + (r - i), a, o) : t === "left" ? e(n + (i - r), a, o) : n, r = (t, n, r, i, a, o = 16) => t !== "left" && t !== "right" ? null : r === (t === "right" ? "ArrowLeft" : "ArrowRight") || r === "ArrowUp" ? e(n + o, i, a) : r === (t === "right" ? "ArrowRight" : "ArrowLeft") || r === "ArrowDown" ? e(n - o, i, a) : null, i = (e, t) => {
|
|
2
|
+
if (typeof e == "number") return Number.isFinite(e) ? e : t;
|
|
3
|
+
if (typeof e == "string") {
|
|
4
|
+
let n = e.trim(), r = /^(\d+(?:\.\d+)?)(px)?$/.exec(n);
|
|
5
|
+
return r ? Number(r[1]) : t;
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { e as clampOffcanvasWidth, i as resolveInitialWidth, t as resolveMaxWidth, r as stepOffcanvasWidth, n as widthFromDrag };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PushTransform } from "./offcanvasStack";
|
|
2
|
+
export type OffcanvasSide = "right" | "left" | "top" | "bottom";
|
|
3
|
+
export declare const DEFAULT_OFFCANVAS_SIDE: OffcanvasSide;
|
|
4
|
+
/** Cross-size of a top/bottom panel when `height` is omitted. */
|
|
5
|
+
export declare const DEFAULT_OFFCANVAS_HEIGHT = "60vh";
|
|
6
|
+
/** Unknown / missing values fall back to the default edge (right). */
|
|
7
|
+
export declare const normalizeSide: (side: unknown) => OffcanvasSide;
|
|
8
|
+
/** left/right panels slide on the X axis and are sized by `width`. */
|
|
9
|
+
export declare const isHorizontalSide: (side: OffcanvasSide) => boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Value for the `data-side` attribute. The default edge (right) emits NO attribute so
|
|
12
|
+
* its markup and CSS path stay exactly as they were before `side` existed.
|
|
13
|
+
*/
|
|
14
|
+
export declare const sideDataAttr: (side: OffcanvasSide) => OffcanvasSide | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Which CSS variable carries the panel's cross-size, and its value:
|
|
17
|
+
* left/right use `width` (`--kapi-offc-width`); top/bottom use `height` (`--kapi-offc-height`)
|
|
18
|
+
* and ignore `width` altogether.
|
|
19
|
+
*/
|
|
20
|
+
export declare const sizeVar: (side: OffcanvasSide, width: number | string | undefined, height: number | string | undefined, defaultWidth: string) => {
|
|
21
|
+
name: "--kapi-offc-width" | "--kapi-offc-height";
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Adapts the stack push (computed for the right edge: shrink + shift LEFT) per side.
|
|
26
|
+
* - right: unchanged.
|
|
27
|
+
* - left: mirrored X shift (panel peeks out to the right as it is pushed back).
|
|
28
|
+
* - top/bottom: no push (vertical stacking is out of scope); the panel stays put.
|
|
29
|
+
*/
|
|
30
|
+
export declare const pushForSide: (side: OffcanvasSide, push: PushTransform) => PushTransform;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { toCssSize as e } from "./dialogUtils.js";
|
|
2
|
+
//#region src/components/overlays/offcanvasSide.ts
|
|
3
|
+
var t = "right", n = "60vh", r = [
|
|
4
|
+
"right",
|
|
5
|
+
"left",
|
|
6
|
+
"top",
|
|
7
|
+
"bottom"
|
|
8
|
+
], i = (e) => r.includes(e) ? e : t, a = (e) => e === "left" || e === "right", o = (e) => e === "right" ? void 0 : e, s = (t, r, i, o) => a(t) ? {
|
|
9
|
+
name: "--kapi-offc-width",
|
|
10
|
+
value: e(r, o)
|
|
11
|
+
} : {
|
|
12
|
+
name: "--kapi-offc-height",
|
|
13
|
+
value: e(i, n)
|
|
14
|
+
}, c = (e, t) => {
|
|
15
|
+
switch (e) {
|
|
16
|
+
case "right": return t;
|
|
17
|
+
case "left": return {
|
|
18
|
+
scale: t.scale,
|
|
19
|
+
translateX: t.translateX === 0 ? 0 : -t.translateX
|
|
20
|
+
};
|
|
21
|
+
case "top":
|
|
22
|
+
case "bottom": return {
|
|
23
|
+
scale: 1,
|
|
24
|
+
translateX: 0
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { n as DEFAULT_OFFCANVAS_HEIGHT, t as DEFAULT_OFFCANVAS_SIDE, a as isHorizontalSide, i as normalizeSide, c as pushForSide, o as sideDataAttr, s as sizeVar };
|