@kapiuara/ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +16 -0
- 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 +87 -4
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { resolveSteps as n, stepsClasses as r } from "./stepsLogic.js";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { Check as o, X as s } from "lucide-react";
|
|
8
|
+
//#region src/components/navigation/KapiSteps.tsx
|
|
9
|
+
var c = {
|
|
10
|
+
complete: "Completado",
|
|
11
|
+
current: "En curso",
|
|
12
|
+
upcoming: "Pendiente",
|
|
13
|
+
error: "Con error"
|
|
14
|
+
}, l = {
|
|
15
|
+
size: 14,
|
|
16
|
+
strokeWidth: 3,
|
|
17
|
+
"aria-hidden": !0
|
|
18
|
+
};
|
|
19
|
+
function u({ steps: u, current: d, orientation: f = "vertical", size: p = "md", labels: m, className: h, ref: g, ..._ }) {
|
|
20
|
+
let v = e("steps", c, m), { statuses: y, currentIndex: b } = n(u, d);
|
|
21
|
+
return /* @__PURE__ */ i("ol", {
|
|
22
|
+
..._,
|
|
23
|
+
ref: g,
|
|
24
|
+
className: t(r(f, p), h),
|
|
25
|
+
children: u.map((e, t) => {
|
|
26
|
+
let n = y[t] ?? "upcoming";
|
|
27
|
+
return /* @__PURE__ */ a("li", {
|
|
28
|
+
className: `kapi-steps__item is-${n}`,
|
|
29
|
+
"aria-current": t === b ? "step" : void 0,
|
|
30
|
+
children: [/* @__PURE__ */ i("span", {
|
|
31
|
+
className: "kapi-steps__head",
|
|
32
|
+
children: /* @__PURE__ */ i("span", {
|
|
33
|
+
className: "kapi-steps__marker",
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: n === "complete" ? /* @__PURE__ */ i(o, { ...l }) : n === "error" ? /* @__PURE__ */ i(s, { ...l }) : t + 1
|
|
36
|
+
})
|
|
37
|
+
}), /* @__PURE__ */ a("span", {
|
|
38
|
+
className: "kapi-steps__body",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ i("span", {
|
|
41
|
+
className: "kapi-steps__label",
|
|
42
|
+
children: e.label
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ a("span", {
|
|
45
|
+
className: "kapi-steps__sr",
|
|
46
|
+
children: [
|
|
47
|
+
" (",
|
|
48
|
+
v[n],
|
|
49
|
+
")"
|
|
50
|
+
]
|
|
51
|
+
}),
|
|
52
|
+
e.description != null && /* @__PURE__ */ i("span", {
|
|
53
|
+
className: "kapi-steps__desc",
|
|
54
|
+
children: e.description
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
})]
|
|
58
|
+
}, e.id);
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { c as DEFAULT_STEPS_LABELS, u as KapiSteps };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import "./navigation.css";
|
|
2
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
3
|
+
/** Pestaña de `KapiTabs`. `Id` acota los ids (p. ej. una unión de literales). */
|
|
4
|
+
export type KapiTabItem<Id extends string = string> = {
|
|
5
|
+
/** Id único de la pestaña (es el `value` cuando está activa). */
|
|
6
|
+
id: Id;
|
|
7
|
+
/** Texto visible de la pestaña. */
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
/** Ícono (lucide-react) antes del label. */
|
|
10
|
+
icon?: ReactNode | undefined;
|
|
11
|
+
/** Contador en una píldora tras el label (p. ej. documentos adjuntos); `0` también se muestra. */
|
|
12
|
+
count?: number | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Atributos nativos (`id`, `style`, `aria-label`, `data-*`…) van al `role="tablist"`. `Id` se infiere de
|
|
16
|
+
* `tabs` (o del `onChange`), sin escribir el argumento de tipo.
|
|
17
|
+
*/
|
|
18
|
+
export type KapiTabsProps<Id extends string = string> = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "role" | "defaultValue"> & {
|
|
19
|
+
/** Pestañas, en orden; cada una con `id`, `label` e `icon` opcional. */
|
|
20
|
+
tabs: KapiTabItem<Id>[];
|
|
21
|
+
/** Id de la pestaña activa (controlado). */
|
|
22
|
+
value: Id;
|
|
23
|
+
/** Se llama con el `id` de la pestaña elegida (click o flechas). */
|
|
24
|
+
onChange: (id: Id) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Base de ids para vincular cada tab con su `KapiTabPanel` (misma `idBase`). Con ella, cada tab
|
|
27
|
+
* lleva `aria-controls`; sin ella, los tabs igual tienen id estable pero no apuntan a paneles
|
|
28
|
+
* (el consumidor que pinta el contenido por su cuenta no queda con referencias rotas).
|
|
29
|
+
*/
|
|
30
|
+
idBase?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Pestañas segmentadas (controladas), con navegación por teclado (activación automática).
|
|
34
|
+
* Para el vínculo tab ↔ panel del patrón WAI-ARIA, pasar `idBase` y renderizar `KapiTabPanel`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function KapiTabs<Id extends string = string>({ tabs, value, onChange, className, idBase, onKeyDown: onKeyDownProp, ...rest }: KapiTabsProps<Id>): import("react").JSX.Element;
|
|
37
|
+
export type KapiTabPanelProps = {
|
|
38
|
+
/** Misma base que el `idBase` del `KapiTabs` que lo controla. */
|
|
39
|
+
idBase: string;
|
|
40
|
+
/** Id de la pestaña dueña del panel. */
|
|
41
|
+
tabId: string;
|
|
42
|
+
/** Si es el panel de la pestaña activa. Los inactivos quedan `hidden`. */
|
|
43
|
+
active: boolean;
|
|
44
|
+
/** Mantener montado el contenido de los paneles inactivos (conserva su estado). */
|
|
45
|
+
keepMounted?: boolean;
|
|
46
|
+
/** Clase del panel (`role="tabpanel"`). */
|
|
47
|
+
className?: string;
|
|
48
|
+
/** Contenido del panel. */
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Panel de una pestaña (`role="tabpanel"`), nombrado por su tab vía `aria-labelledby` y enfocable
|
|
53
|
+
* (`tabIndex=0`) para llegar al contenido con Tab. Los inactivos se renderizan `hidden` para que las
|
|
54
|
+
* referencias `aria-controls` sigan siendo válidas.
|
|
55
|
+
*/
|
|
56
|
+
export declare function KapiTabPanel({ idBase, tabId: owner, active, keepMounted, className, children }: KapiTabPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { joinClasses as e } from "../rootProps.js";
|
|
3
|
+
import { useSlidingIndicator as t } from "../../hooks/useSlidingIndicator.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { useScrollEdges as n } from "../../hooks/useScrollEdges.js";
|
|
6
|
+
import { nextTabId as r, tabClasses as i, tabId as a, tabPanelId as o } from "./tabsLogic.js";
|
|
7
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import { useCallback as u, useId as d, useLayoutEffect as f, useRef as p } from "react";
|
|
9
|
+
//#region src/components/navigation/KapiTabs.tsx
|
|
10
|
+
function m({ tabs: m, value: h, onChange: g, className: _, idBase: v, onKeyDown: y, ...b }) {
|
|
11
|
+
let x = d(), S = v ?? x, C = p({}), { containerRef: w, indicatorRef: T } = t({
|
|
12
|
+
active: h,
|
|
13
|
+
deps: [m],
|
|
14
|
+
findActive: (e) => e.querySelector("[role=\"tab\"][aria-selected=\"true\"]")
|
|
15
|
+
}), { ref: E, edges: D, reveal: O } = n({ axis: "x" }), k = u((e) => {
|
|
16
|
+
w.current = e, E.current = e;
|
|
17
|
+
}, [w, E]), A = p(!1);
|
|
18
|
+
f(() => {
|
|
19
|
+
let e = w.current?.querySelector("[role=\"tab\"][aria-selected=\"true\"]");
|
|
20
|
+
e && O(e, { instant: !A.current }), A.current = !0;
|
|
21
|
+
}, [
|
|
22
|
+
h,
|
|
23
|
+
w,
|
|
24
|
+
O
|
|
25
|
+
]);
|
|
26
|
+
let j = (e) => {
|
|
27
|
+
if (y?.(e), e.defaultPrevented) return;
|
|
28
|
+
let t = r(m.map((e) => e.id), h, e.key);
|
|
29
|
+
t !== void 0 && (e.preventDefault(), g(t), C.current[t]?.focus());
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ l("div", {
|
|
32
|
+
...b,
|
|
33
|
+
ref: k,
|
|
34
|
+
className: e("kapi-tabs", "kapi-fade-x", _),
|
|
35
|
+
"data-edge-start": D.start ? "" : void 0,
|
|
36
|
+
"data-edge-end": D.end ? "" : void 0,
|
|
37
|
+
role: "tablist",
|
|
38
|
+
onKeyDown: j,
|
|
39
|
+
children: [/* @__PURE__ */ c("span", {
|
|
40
|
+
ref: T,
|
|
41
|
+
className: "kapi-tabs__indicator",
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
}), m.map((e) => {
|
|
44
|
+
let t = e.id === h;
|
|
45
|
+
return /* @__PURE__ */ l("button", {
|
|
46
|
+
ref: (t) => {
|
|
47
|
+
C.current[e.id] = t;
|
|
48
|
+
},
|
|
49
|
+
type: "button",
|
|
50
|
+
id: a(S, e.id),
|
|
51
|
+
role: "tab",
|
|
52
|
+
"aria-controls": v ? o(v, e.id) : void 0,
|
|
53
|
+
"aria-selected": t,
|
|
54
|
+
tabIndex: t ? 0 : -1,
|
|
55
|
+
className: i(t),
|
|
56
|
+
onClick: () => g(e.id),
|
|
57
|
+
children: [
|
|
58
|
+
e.icon,
|
|
59
|
+
e.label,
|
|
60
|
+
e.count !== void 0 && /* @__PURE__ */ l(s, { children: [" ", /* @__PURE__ */ c("span", {
|
|
61
|
+
className: "kapi-tabs__count",
|
|
62
|
+
children: e.count
|
|
63
|
+
})] })
|
|
64
|
+
]
|
|
65
|
+
}, e.id);
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function h({ idBase: e, tabId: t, active: n, keepMounted: r = !1, className: i, children: s }) {
|
|
70
|
+
return /* @__PURE__ */ c("div", {
|
|
71
|
+
id: o(e, t),
|
|
72
|
+
role: "tabpanel",
|
|
73
|
+
"aria-labelledby": a(e, t),
|
|
74
|
+
tabIndex: 0,
|
|
75
|
+
hidden: !n,
|
|
76
|
+
className: i,
|
|
77
|
+
children: n || r ? s : null
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { h as KapiTabPanel, m as KapiTabs };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type KapiTreeNode } from "./treeLogic";
|
|
3
|
+
import "./navigation.css";
|
|
4
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
5
|
+
export type KapiTreeLabels = {
|
|
6
|
+
/** Descripción de un nodo mientras carga sus hijos. */
|
|
7
|
+
loading: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const DEFAULT_TREE_LABELS: KapiTreeLabels;
|
|
10
|
+
/**
|
|
11
|
+
* Atributos nativos (`id`, `style`, `aria-label`, `data-*`…) van al `<ul role="tree">`. `T` (el `data` de los
|
|
12
|
+
* nodos) e `Id` se infieren de `nodes`, sin escribir los argumentos de tipo.
|
|
13
|
+
*/
|
|
14
|
+
export type KapiTreeProps<T = unknown, Id extends string = string> = Omit<HTMLAttributes<HTMLUListElement>, "children" | "onSelect" | "defaultValue" | "onChange"> & {
|
|
15
|
+
/** Nodos raíz del árbol, con sus hijos anidados (o cargados al expandir con `onExpand`). */
|
|
16
|
+
nodes: KapiTreeNode<T, Id>[];
|
|
17
|
+
/** Controlado: ids expandidos. */
|
|
18
|
+
expanded?: Id[];
|
|
19
|
+
/** Expandidos al inicio cuando no es controlado. */
|
|
20
|
+
defaultExpanded?: Id[];
|
|
21
|
+
/** Nueva lista de expandidos (controlado o no). */
|
|
22
|
+
onExpandedChange?: (expanded: Id[]) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Pide los hijos de un nodo diferido: se dispara al expandir un nodo con `hasChildren`, sin `children` y que
|
|
25
|
+
* no esté `loading`. No se repite para un nodo ya cargado (para seguir cada expansión, `onExpandedChange`).
|
|
26
|
+
* Si la carga falla, el consumidor tiene que volver a poner `loading: false` (sin `children`) para que el
|
|
27
|
+
* nodo pueda reintentar al expandirse de nuevo.
|
|
28
|
+
*/
|
|
29
|
+
onExpand?: (node: KapiTreeNode<T, Id>) => void;
|
|
30
|
+
/** Controlado: ids seleccionados. */
|
|
31
|
+
selected?: Id[];
|
|
32
|
+
/** Seleccionados al inicio cuando no es controlado. */
|
|
33
|
+
defaultSelected?: Id[];
|
|
34
|
+
/** Nueva selección (controlado o no) y el nodo que la cambió. */
|
|
35
|
+
onSelectedChange?: (selected: Id[], node: KapiTreeNode<T, Id>) => void;
|
|
36
|
+
/** Varios seleccionados a la vez (`aria-multiselectable`): Espacio/Enter/clic alternan. */
|
|
37
|
+
multiple?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Contenido rico del nodo (ícono, contador…). El nombre accesible sale de lo que renderiza. Si incluye
|
|
40
|
+
* controles (un botón, un enlace), Enter/Espacio y el type-ahead sobre ellos no los toma el árbol: se activan
|
|
41
|
+
* de forma nativa. Las flechas, Inicio/Fin y `*` siguen siendo del árbol (mueven el foco entre nodos), así que
|
|
42
|
+
* un control que las necesite (un input con cursor, un slider) debe frenar su propagación con `stopPropagation`.
|
|
43
|
+
* Un clic en ellos sí llega a la fila (que selecciona): usa `stopPropagation` para evitarlo.
|
|
44
|
+
*/
|
|
45
|
+
renderLabel?: (node: KapiTreeNode<T, Id>) => ReactNode;
|
|
46
|
+
/** Textos fijos (clave `tree`). */
|
|
47
|
+
labels?: KapiLabelsOverride<KapiTreeLabels> | undefined;
|
|
48
|
+
/** Ref al `<ul role="tree">`. */
|
|
49
|
+
ref?: Ref<HTMLUListElement>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Árbol (WAI-ARIA APG, Tree View): `tree` / `treeitem` / `group` con nivel, posición y tabindex itinerante.
|
|
53
|
+
* Flechas recorren y abren/cierran, Home/End, Enter/Espacio seleccionan, `*` expande los hermanos y escribir
|
|
54
|
+
* salta al nodo que empieza con ese texto. Los hijos diferidos se piden en `onExpand`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function KapiTree<T = unknown, Id extends string = string>({ nodes, expanded: expandedProp, defaultExpanded, onExpandedChange, onExpand, selected: selectedProp, defaultSelected, onSelectedChange, multiple, renderLabel, labels, className, onKeyDown, onFocus, ...rest }: KapiTreeProps<T, Id>): import("react").JSX.Element;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { TREE_KEYS as n, flattenVisible as r, isExpandable as i, matchTypeahead as a, needsChildren as o, resolveTabStop as s, toggleSelectedId as c, treeKeyAction as l } from "./treeLogic.js";
|
|
6
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { useId as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
8
|
+
import { ChevronRight as _ } from "lucide-react";
|
|
9
|
+
//#region src/components/navigation/KapiTree.tsx
|
|
10
|
+
var v = { loading: "Cargando…" }, y = 500, b = (e) => e.length === 1 && e.trim() !== "";
|
|
11
|
+
function x({ nodes: x, expanded: S, defaultExpanded: ee = [], onExpandedChange: C, onExpand: w, selected: T, defaultSelected: E = [], onSelectedChange: D, multiple: O = !1, renderLabel: k, labels: A, className: j, onKeyDown: M, onFocus: te, ...ne }) {
|
|
12
|
+
let re = e("tree", v, A), N = p(), [P, F] = g(ee), [I, L] = g(E), [R, z] = g(null), B = h(/* @__PURE__ */ new Map()), V = h({ text: "" }), H = S ?? P, U = T ?? I, W = m(() => r(x, H), [x, H]), G = s(x, W, R, U), K = m(() => new Map(W.map((e, t) => [e.node.id, {
|
|
13
|
+
...e,
|
|
14
|
+
node: e.node,
|
|
15
|
+
index: t
|
|
16
|
+
}])), [W]), q = (e, t) => {
|
|
17
|
+
S === void 0 && F(e), C?.(e), t.filter(o).forEach((e) => w?.(e));
|
|
18
|
+
}, J = (e) => !e.disabled && i(e), Y = (e) => {
|
|
19
|
+
J(e) && !H.includes(e.id) && q([...H, e.id], [e]);
|
|
20
|
+
}, X = (e) => {
|
|
21
|
+
J(e) && H.includes(e.id) && q(H.filter((t) => t !== e.id), []);
|
|
22
|
+
}, ie = (e) => {
|
|
23
|
+
H.includes(e.id) ? X(e) : Y(e);
|
|
24
|
+
}, Z = (e) => {
|
|
25
|
+
if (e.disabled) return;
|
|
26
|
+
let t = c(U, e.id, O);
|
|
27
|
+
T === void 0 && L(t), D?.(t, e);
|
|
28
|
+
}, Q = (e) => {
|
|
29
|
+
z(e), B.current.get(e)?.focus();
|
|
30
|
+
}, ae = (e) => {
|
|
31
|
+
if (M?.(e), e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
32
|
+
let t = G;
|
|
33
|
+
if (t === null) return;
|
|
34
|
+
let r = e.target.getAttribute("role") === "treeitem", i = e.key === "Enter" || e.key === " ";
|
|
35
|
+
if (!r && (i || b(e.key))) return;
|
|
36
|
+
if (n.has(e.key)) {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
let n = l({
|
|
39
|
+
key: e.key,
|
|
40
|
+
nodes: x,
|
|
41
|
+
visible: W,
|
|
42
|
+
focusId: t,
|
|
43
|
+
expanded: H
|
|
44
|
+
});
|
|
45
|
+
if (!n) return;
|
|
46
|
+
switch (n.type) {
|
|
47
|
+
case "focus":
|
|
48
|
+
Q(n.id);
|
|
49
|
+
break;
|
|
50
|
+
case "select": {
|
|
51
|
+
let e = K.get(n.id)?.node;
|
|
52
|
+
e && Z(e);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case "expand": {
|
|
56
|
+
let e = K.get(n.id)?.node;
|
|
57
|
+
e && Y(e);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
case "collapse": {
|
|
61
|
+
let e = K.get(n.id)?.node;
|
|
62
|
+
e && X(e);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "expandMany": {
|
|
66
|
+
let e = n.ids.filter((e) => !H.includes(e)), t = e.flatMap((e) => K.get(e)?.node ?? []);
|
|
67
|
+
q([...H, ...e], t);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!b(e.key)) return;
|
|
74
|
+
let o = K.get(t)?.index;
|
|
75
|
+
if (o === void 0) return;
|
|
76
|
+
let s = V.current;
|
|
77
|
+
clearTimeout(s.timer), s.text += e.key, s.timer = setTimeout(() => s.text = "", y);
|
|
78
|
+
let c = a(W, o, s.text);
|
|
79
|
+
c && (e.preventDefault(), Q(c));
|
|
80
|
+
}, oe = (e) => {
|
|
81
|
+
te?.(e);
|
|
82
|
+
let t = e.target.dataset.treeId;
|
|
83
|
+
t !== void 0 && z(t);
|
|
84
|
+
}, $ = (e) => e.map((e) => {
|
|
85
|
+
let n = K.get(e.id);
|
|
86
|
+
if (!n) return null;
|
|
87
|
+
let r = i(e), a = r && H.includes(e.id), o = U.includes(e.id), s = r && e.loading === !0, c = `${N}-l-${n.index}`, l = `${N}-w-${n.index}`;
|
|
88
|
+
return /* @__PURE__ */ f("li", {
|
|
89
|
+
ref: (t) => {
|
|
90
|
+
t ? B.current.set(e.id, t) : B.current.delete(e.id);
|
|
91
|
+
},
|
|
92
|
+
role: "treeitem",
|
|
93
|
+
"data-tree-id": e.id,
|
|
94
|
+
className: t("kapi-tree__item", o && "kapi-tree__item--selected", a && "kapi-tree__item--open"),
|
|
95
|
+
"aria-labelledby": c,
|
|
96
|
+
"aria-describedby": s ? l : void 0,
|
|
97
|
+
"aria-level": n.level,
|
|
98
|
+
"aria-setsize": n.setSize,
|
|
99
|
+
"aria-posinset": n.posInSet,
|
|
100
|
+
"aria-expanded": r ? a : void 0,
|
|
101
|
+
"aria-selected": o,
|
|
102
|
+
"aria-disabled": e.disabled || void 0,
|
|
103
|
+
"aria-busy": s || void 0,
|
|
104
|
+
tabIndex: G === e.id ? 0 : -1,
|
|
105
|
+
children: [/* @__PURE__ */ f("div", {
|
|
106
|
+
className: "kapi-tree__row",
|
|
107
|
+
style: { "--kapi-tree-level": n.level },
|
|
108
|
+
onClick: () => Z(e),
|
|
109
|
+
children: [
|
|
110
|
+
r ? /* @__PURE__ */ d("span", {
|
|
111
|
+
className: "kapi-tree__toggle",
|
|
112
|
+
"aria-hidden": "true",
|
|
113
|
+
onClick: (t) => {
|
|
114
|
+
t.stopPropagation(), ie(e);
|
|
115
|
+
},
|
|
116
|
+
children: /* @__PURE__ */ d(_, {
|
|
117
|
+
className: "kapi-tree__chevron",
|
|
118
|
+
size: 16,
|
|
119
|
+
strokeWidth: 2.2
|
|
120
|
+
})
|
|
121
|
+
}) : /* @__PURE__ */ d("span", {
|
|
122
|
+
className: "kapi-tree__toggle kapi-tree__toggle--leaf",
|
|
123
|
+
"aria-hidden": "true"
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ d("span", {
|
|
126
|
+
id: c,
|
|
127
|
+
className: "kapi-tree__label",
|
|
128
|
+
children: k ? k(e) : e.label
|
|
129
|
+
}),
|
|
130
|
+
s && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", {
|
|
131
|
+
className: "kapi-tree__spinner kapi-spinner kapi-spinner--sm",
|
|
132
|
+
"aria-hidden": "true"
|
|
133
|
+
}), /* @__PURE__ */ d("span", {
|
|
134
|
+
id: l,
|
|
135
|
+
className: "kapi-tree__sr",
|
|
136
|
+
children: re.loading
|
|
137
|
+
})] })
|
|
138
|
+
]
|
|
139
|
+
}), a && e.children?.length ? /* @__PURE__ */ d("ul", {
|
|
140
|
+
role: "group",
|
|
141
|
+
className: "kapi-tree__group",
|
|
142
|
+
children: $(e.children)
|
|
143
|
+
}) : null]
|
|
144
|
+
}, e.id);
|
|
145
|
+
});
|
|
146
|
+
return /* @__PURE__ */ d("ul", {
|
|
147
|
+
...ne,
|
|
148
|
+
role: "tree",
|
|
149
|
+
"aria-multiselectable": O || void 0,
|
|
150
|
+
className: t("kapi-tree", j),
|
|
151
|
+
onKeyDown: ae,
|
|
152
|
+
onFocus: oe,
|
|
153
|
+
children: $(x)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
export { v as DEFAULT_TREE_LABELS, x as KapiTree };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
3
|
+
export type KapiWizardStep = {
|
|
4
|
+
title: string;
|
|
5
|
+
desc?: ReactNode | undefined;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
/** Si devuelve false, "Siguiente"/"Finalizar" NO avanza (validación por paso). */
|
|
8
|
+
validate?: (() => boolean) | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type KapiWizardOrientation = "horizontal" | "vertical";
|
|
11
|
+
export type KapiWizardLabels = {
|
|
12
|
+
finish: string;
|
|
13
|
+
cancel: string;
|
|
14
|
+
back: string;
|
|
15
|
+
next: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const DEFAULT_WIZARD_LABELS: KapiWizardLabels;
|
|
18
|
+
/** Atributos nativos (`id`, `style`, `data-*`…) van al contenedor del wizard. */
|
|
19
|
+
export type KapiWizardProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
20
|
+
/** Pasos, en orden; cada uno con título, contenido y `validate` opcional. */
|
|
21
|
+
steps: KapiWizardStep[];
|
|
22
|
+
/** Disposición del indicador de pasos. */
|
|
23
|
+
orientation?: KapiWizardOrientation;
|
|
24
|
+
/** Se dispara con el botón del último paso (si su `validate` lo permite). */
|
|
25
|
+
onFinish?: () => void;
|
|
26
|
+
/** Se dispara con el botón del primer paso. */
|
|
27
|
+
onCancel?: () => void;
|
|
28
|
+
/** Contenido del botón final; gana sobre `labels.finish`. Lo mismo `cancelLabel`, `backLabel` y `nextLabel`. */
|
|
29
|
+
finishLabel?: ReactNode;
|
|
30
|
+
/** Contenido del botón de cancelar (primer paso); gana sobre `labels.cancel`. */
|
|
31
|
+
cancelLabel?: ReactNode;
|
|
32
|
+
/** Contenido del botón de volver; gana sobre `labels.back`. */
|
|
33
|
+
backLabel?: ReactNode;
|
|
34
|
+
/** Contenido del botón de avanzar; gana sobre `labels.next`. */
|
|
35
|
+
nextLabel?: ReactNode;
|
|
36
|
+
/** Textos fijos de los botones (clave `wizard`). */
|
|
37
|
+
labels?: KapiLabelsOverride<KapiWizardLabels> | undefined;
|
|
38
|
+
/** Paso actual (controlado). Si se omite, el wizard maneja su propio estado. */
|
|
39
|
+
step?: number;
|
|
40
|
+
/** Paso inicial no controlado. */
|
|
41
|
+
defaultStep?: number;
|
|
42
|
+
/** Se llama en cada cambio de paso (controlado o no). */
|
|
43
|
+
onStepChange?: (step: number) => void;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Form por pasos, inline (para modal, metelo dentro de un modal). Sólo se retrocede por click
|
|
47
|
+
* en un paso; "Siguiente" respeta `validate()`; el primer paso muestra "Cancelar".
|
|
48
|
+
*/
|
|
49
|
+
export declare const KapiWizard: ({ steps, orientation, onFinish, onCancel, finishLabel, cancelLabel, backLabel, nextLabel, labels, step, defaultStep, onStepChange, className, ...rest }: KapiWizardProps) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { KapiButton as e } from "../inputs/KapiButton.js";
|
|
3
|
+
import { useLabels as t } from "../locale/KapiLocaleProvider.js";
|
|
4
|
+
import { joinClasses as n } from "../rootProps.js";
|
|
5
|
+
import { canJumpTo as r, clampStep as i, resolveAdvance as a } from "./wizardLogic.js";
|
|
6
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { useState as l } from "react";
|
|
8
|
+
import { Check as u, ChevronLeft as d, ChevronRight as f } from "lucide-react";
|
|
9
|
+
//#region src/components/navigation/KapiWizard.tsx
|
|
10
|
+
var p = {
|
|
11
|
+
finish: "Finalizar",
|
|
12
|
+
cancel: "Cancelar",
|
|
13
|
+
back: "Atrás",
|
|
14
|
+
next: "Siguiente"
|
|
15
|
+
}, m = {
|
|
16
|
+
size: 15,
|
|
17
|
+
strokeWidth: 2.2
|
|
18
|
+
}, h = (e, t) => e === void 0 ? t : e, g = ({ steps: g, orientation: _ = "horizontal", onFinish: v, onCancel: y, finishLabel: b, cancelLabel: x, backLabel: S, nextLabel: C, labels: w, step: T, defaultStep: E = 0, onStepChange: D, className: O, ...k }) => {
|
|
19
|
+
let A = t("wizard", p, w), [j, M] = l(E), N = i(T ?? j, g.length), P = g[N];
|
|
20
|
+
if (!P) return null;
|
|
21
|
+
let F = N === g.length - 1, I = (e) => {
|
|
22
|
+
let t = i(e, g.length);
|
|
23
|
+
t !== N && (T === void 0 && M(t), D?.(t));
|
|
24
|
+
}, L = (e) => {
|
|
25
|
+
r(e, N) && I(e);
|
|
26
|
+
}, R = () => {
|
|
27
|
+
let e = a(g, N);
|
|
28
|
+
e === "next" ? I(N + 1) : e === "finish" && v?.();
|
|
29
|
+
}, z = /* @__PURE__ */ c("div", {
|
|
30
|
+
className: "kapi-wz__nav",
|
|
31
|
+
children: [/* @__PURE__ */ s(e, {
|
|
32
|
+
onClick: N === 0 ? y : () => I(N - 1),
|
|
33
|
+
children: N === 0 ? h(x, A.cancel) : /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(d, { ...m }), h(S, A.back)] })
|
|
34
|
+
}), /* @__PURE__ */ s(e, {
|
|
35
|
+
variant: "primary",
|
|
36
|
+
onClick: R,
|
|
37
|
+
children: F ? h(b, A.finish) : /* @__PURE__ */ c(o, { children: [h(C, A.next), /* @__PURE__ */ s(f, { ...m })] })
|
|
38
|
+
})]
|
|
39
|
+
}), B = /* @__PURE__ */ s("div", {
|
|
40
|
+
className: "kapi-wz__pane",
|
|
41
|
+
children: P.content
|
|
42
|
+
}, N);
|
|
43
|
+
return _ === "vertical" ? /* @__PURE__ */ c("div", {
|
|
44
|
+
...k,
|
|
45
|
+
className: n("kapi-wz kapi-wz--v", O),
|
|
46
|
+
children: [/* @__PURE__ */ s("div", {
|
|
47
|
+
className: "kapi-wz__rail",
|
|
48
|
+
children: g.map((e, t) => /* @__PURE__ */ c("button", {
|
|
49
|
+
type: "button",
|
|
50
|
+
className: `kapi-wz__vstep${t === N ? " is-on" : ""}`,
|
|
51
|
+
"aria-current": t === N ? "step" : void 0,
|
|
52
|
+
onClick: () => L(t),
|
|
53
|
+
children: [/* @__PURE__ */ s("span", {
|
|
54
|
+
className: `kapi-step__dot${t < N ? " kapi-step__dot--done" : ""}${t === N ? " kapi-step__dot--on" : ""}`,
|
|
55
|
+
children: t < N ? /* @__PURE__ */ s(u, {
|
|
56
|
+
size: 13,
|
|
57
|
+
strokeWidth: 3
|
|
58
|
+
}) : t + 1
|
|
59
|
+
}), /* @__PURE__ */ c("span", {
|
|
60
|
+
className: "kapi-wz__vlabel",
|
|
61
|
+
children: [/* @__PURE__ */ s("b", { children: e.title }), e.desc && /* @__PURE__ */ s("span", { children: e.desc })]
|
|
62
|
+
})]
|
|
63
|
+
}, `${t}-${e.title}`))
|
|
64
|
+
}), /* @__PURE__ */ c("div", {
|
|
65
|
+
className: "kapi-wz__main",
|
|
66
|
+
children: [B, z]
|
|
67
|
+
})]
|
|
68
|
+
}) : /* @__PURE__ */ c("div", {
|
|
69
|
+
...k,
|
|
70
|
+
className: n("kapi-wz", O),
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ s("div", {
|
|
73
|
+
className: "kapi-wz__steps",
|
|
74
|
+
children: g.map((e, t) => /* @__PURE__ */ c("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
className: `kapi-wz__step${t === N ? " is-on" : ""}${t < N ? " is-done" : ""}`,
|
|
77
|
+
"aria-current": t === N ? "step" : void 0,
|
|
78
|
+
onClick: () => L(t),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ s("span", {
|
|
81
|
+
className: "kapi-wz__num",
|
|
82
|
+
children: t < N ? /* @__PURE__ */ s(u, {
|
|
83
|
+
size: 16,
|
|
84
|
+
strokeWidth: 3
|
|
85
|
+
}) : t + 1
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ s("span", {
|
|
88
|
+
className: "kapi-wz__st",
|
|
89
|
+
children: e.title
|
|
90
|
+
}),
|
|
91
|
+
e.desc && /* @__PURE__ */ s("span", {
|
|
92
|
+
className: "kapi-wz__ss",
|
|
93
|
+
children: e.desc
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}, `${t}-${e.title}`))
|
|
97
|
+
}),
|
|
98
|
+
B,
|
|
99
|
+
z
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { p as DEFAULT_WIZARD_LABELS, g as KapiWizard };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import "./navigation.css";
|
|
3
|
+
import type { KapiBadgeVariant } from "../display/KapiBadge";
|
|
4
|
+
import { type KapiNavBadgeValue } from "./navBadgeLogic";
|
|
5
|
+
type MiniNavItemProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
6
|
+
/** Etiqueta del ítem: queda oculta a la vista pero es el nombre accesible y el texto del tooltip. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** Ícono; sin él se muestran las iniciales o la inicial de la etiqueta. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** Iniciales (ítems "recientes"). */
|
|
11
|
+
initials?: string | undefined;
|
|
12
|
+
/** Ítem actual. */
|
|
13
|
+
active?: boolean | undefined;
|
|
14
|
+
/** Aviso en la esquina del ícono. */
|
|
15
|
+
badge?: KapiNavBadgeValue | undefined;
|
|
16
|
+
/** Color del aviso. */
|
|
17
|
+
badgeTone?: KapiBadgeVariant | undefined;
|
|
18
|
+
/** Texto accesible del aviso. */
|
|
19
|
+
badgeLabel?: string | undefined;
|
|
20
|
+
/** Enlace real en vez de botón. */
|
|
21
|
+
href?: string | undefined;
|
|
22
|
+
/** Abre el enlace en una pestaña nueva. */
|
|
23
|
+
newTab?: boolean | undefined;
|
|
24
|
+
/** Aviso de pestaña nueva para lectores de pantalla. */
|
|
25
|
+
newTabLabel?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Con `href` se dibuja un `<a>` que navega solo: los atributos de botón (`onClick` incluido) no se le pasan,
|
|
29
|
+
* igual que un ítem enlace desplegado no llama a `onSelect`.
|
|
30
|
+
*
|
|
31
|
+
* Ítem de navegación del panel plegado en modo mini: sólo el ícono (o la inicial), el aviso en la esquina y
|
|
32
|
+
* un tooltip con el título y el aviso. La etiqueta sigue en el DOM (oculta a la vista) como nombre accesible.
|
|
33
|
+
*/
|
|
34
|
+
export declare const MiniNavItem: ({ label, icon, initials, active, badge, badgeTone, badgeLabel, href, newTab, newTabLabel, className, disabled, type, ...rest }: MiniNavItemProps) => import("react").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { joinClasses as e } from "../rootProps.js";
|
|
3
|
+
import { KapiTooltip as t } from "../overlays/KapiTooltip.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { navBadgeA11yText as n } from "./navBadgeLogic.js";
|
|
6
|
+
import { KapiNavBadge as r } from "./KapiNavBadge.js";
|
|
7
|
+
import { useKapiPanelMini as i } from "./panelMini.js";
|
|
8
|
+
import { miniInitial as a, miniTooltipLabel as o, nodeText as s } from "./panelMiniLogic.js";
|
|
9
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/navigation/MiniNavItem.tsx
|
|
11
|
+
var d = ({ label: d, icon: f, initials: p, active: m = !1, badge: h, badgeTone: g, badgeLabel: _, href: v, newTab: y, newTabLabel: b, className: x, disabled: S, type: C = "button", ...w }) => {
|
|
12
|
+
let { tooltipSide: T } = i(), E = s(d), D = o(E, n(h, _)), O = e("kapi-ctxitem", "kapi-ctxitem--mini", m && "kapi-ctxitem--on", x), k = f == null || f === !1 ? /* @__PURE__ */ l("span", {
|
|
13
|
+
className: "kapi-ctxitem__initial",
|
|
14
|
+
children: p ?? a(E)
|
|
15
|
+
}) : f, A = /* @__PURE__ */ u(c, { children: [
|
|
16
|
+
/* @__PURE__ */ l("span", {
|
|
17
|
+
className: "kapi-ctxitem__miniicon",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
children: k
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ l("span", {
|
|
22
|
+
className: "kapi-ctxitem__sr",
|
|
23
|
+
children: d
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ l(r, {
|
|
26
|
+
value: h,
|
|
27
|
+
tone: g,
|
|
28
|
+
label: _,
|
|
29
|
+
placement: "corner"
|
|
30
|
+
})
|
|
31
|
+
] });
|
|
32
|
+
return /* @__PURE__ */ l(t, {
|
|
33
|
+
label: D,
|
|
34
|
+
prefer: T,
|
|
35
|
+
children: v === void 0 ? /* @__PURE__ */ l("button", {
|
|
36
|
+
...w,
|
|
37
|
+
type: C,
|
|
38
|
+
className: O,
|
|
39
|
+
disabled: S,
|
|
40
|
+
"aria-current": m ? "page" : void 0,
|
|
41
|
+
children: A
|
|
42
|
+
}) : /* @__PURE__ */ u("a", {
|
|
43
|
+
className: e(O, "kapi-ctxitem--link"),
|
|
44
|
+
href: S ? void 0 : v,
|
|
45
|
+
rel: "noopener noreferrer",
|
|
46
|
+
target: y ? "_blank" : void 0,
|
|
47
|
+
"aria-current": m ? "page" : void 0,
|
|
48
|
+
"aria-disabled": S || void 0,
|
|
49
|
+
children: [A, y && /* @__PURE__ */ u(c, { children: [" ", /* @__PURE__ */ l("span", {
|
|
50
|
+
className: "kapi-ctxitem__sr",
|
|
51
|
+
children: b
|
|
52
|
+
})] })]
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { d as MiniNavItem };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Deja los ids válidos para el modo: `single` conserva sólo el primero; multi quita duplicados. */
|
|
2
|
+
export declare const normalizeOpenIds: <Id extends string>(ids: ReadonlyArray<Id>, single: boolean) => Id[];
|
|
3
|
+
/** Alterna un ítem sin mutar. En `single`, abrir uno cierra el resto. */
|
|
4
|
+
export declare const toggleOpenId: <Id extends string>(open: ReadonlyArray<Id>, id: Id, single: boolean) => Id[];
|