@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,265 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
4
|
+
import { canCollapse as n, clampCtxPanelWidth as r, ctxPanelClasses as i, ctxPanelWidthFromDrag as a, resolveCollapsed as o, stepCtxPanelWidth as s } from "./contextPanelLogic.js";
|
|
5
|
+
import { activeIdIn as c } from "./activeItemLogic.js";
|
|
6
|
+
import { CtxSlidingList as l } from "./CtxSlidingList.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { DEFAULT_LINK_LABELS as u } from "../locale/linkLabels.js";
|
|
9
|
+
import "./navBadgeLogic.js";
|
|
10
|
+
import { KapiNavBadge as d } from "./KapiNavBadge.js";
|
|
11
|
+
import { KapiPanelMiniContext as f, useKapiPanelMini as p } from "./panelMini.js";
|
|
12
|
+
import { MiniNavItem as m } from "./MiniNavItem.js";
|
|
13
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
import { useLayoutEffect as ee, useRef as v, useState as y } from "react";
|
|
15
|
+
import { ChevronsLeft as b, ChevronsRight as x, ExternalLink as S } from "lucide-react";
|
|
16
|
+
//#region src/components/navigation/KapiContextPanel.tsx
|
|
17
|
+
var C = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
18
|
+
let { mini: i } = p(), a = e.detail !== void 0 || e.initials !== void 0, o = () => n?.(e.id);
|
|
19
|
+
return i ? /* @__PURE__ */ g(m, {
|
|
20
|
+
label: e.label,
|
|
21
|
+
icon: e.icon,
|
|
22
|
+
initials: e.initials,
|
|
23
|
+
active: t,
|
|
24
|
+
badge: e.badge,
|
|
25
|
+
badgeTone: e.badgeTone,
|
|
26
|
+
badgeLabel: e.badgeLabel,
|
|
27
|
+
disabled: e.disabled,
|
|
28
|
+
...!a && e.href !== void 0 ? {
|
|
29
|
+
href: e.href,
|
|
30
|
+
newTab: e.newTab,
|
|
31
|
+
newTabLabel: r
|
|
32
|
+
} : { onClick: o }
|
|
33
|
+
}) : a ? /* @__PURE__ */ _("button", {
|
|
34
|
+
type: "button",
|
|
35
|
+
className: `kapi-ctxrec${t ? " kapi-ctxrec--on" : ""}`,
|
|
36
|
+
"aria-current": t ? "page" : void 0,
|
|
37
|
+
disabled: e.disabled,
|
|
38
|
+
onClick: o,
|
|
39
|
+
children: [
|
|
40
|
+
e.initials !== void 0 && /* @__PURE__ */ g("span", {
|
|
41
|
+
className: "kapi-ctxrec__av kapi-ctxrec__av--tone",
|
|
42
|
+
children: e.initials
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ _("span", {
|
|
45
|
+
className: "kapi-ctxrec__txt",
|
|
46
|
+
children: [/* @__PURE__ */ g("span", {
|
|
47
|
+
className: "kapi-ctxrec__name",
|
|
48
|
+
children: e.label
|
|
49
|
+
}), e.detail !== void 0 && /* @__PURE__ */ g("span", {
|
|
50
|
+
className: "kapi-ctxrec__sub",
|
|
51
|
+
children: e.detail
|
|
52
|
+
})]
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ g(d, {
|
|
55
|
+
value: e.badge,
|
|
56
|
+
tone: e.badgeTone,
|
|
57
|
+
label: e.badgeLabel,
|
|
58
|
+
max: 999
|
|
59
|
+
}),
|
|
60
|
+
e.trailing
|
|
61
|
+
]
|
|
62
|
+
}) : e.href === void 0 ? /* @__PURE__ */ _("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
className: `kapi-ctxitem${t ? " kapi-ctxitem--on" : ""}`,
|
|
65
|
+
"aria-current": t ? "page" : void 0,
|
|
66
|
+
disabled: e.disabled,
|
|
67
|
+
onClick: o,
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ _("span", {
|
|
70
|
+
className: "kapi-ctxitem__main",
|
|
71
|
+
children: [e.icon, e.label]
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ g(d, {
|
|
74
|
+
value: e.badge,
|
|
75
|
+
tone: e.badgeTone,
|
|
76
|
+
label: e.badgeLabel,
|
|
77
|
+
max: 999
|
|
78
|
+
}),
|
|
79
|
+
e.trailing
|
|
80
|
+
]
|
|
81
|
+
}) : /* @__PURE__ */ _("a", {
|
|
82
|
+
className: `kapi-ctxitem kapi-ctxitem--link${t ? " kapi-ctxitem--on" : ""}`,
|
|
83
|
+
href: e.disabled ? void 0 : e.href,
|
|
84
|
+
rel: "noopener noreferrer",
|
|
85
|
+
target: e.newTab ? "_blank" : void 0,
|
|
86
|
+
"aria-current": t ? "page" : void 0,
|
|
87
|
+
"aria-disabled": e.disabled || void 0,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ _("span", {
|
|
90
|
+
className: "kapi-ctxitem__main",
|
|
91
|
+
children: [e.icon, e.label]
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ g(d, {
|
|
94
|
+
value: e.badge,
|
|
95
|
+
tone: e.badgeTone,
|
|
96
|
+
label: e.badgeLabel,
|
|
97
|
+
max: 999
|
|
98
|
+
}),
|
|
99
|
+
e.trailing,
|
|
100
|
+
e.external && /* @__PURE__ */ g(S, {
|
|
101
|
+
className: "kapi-ctxitem__ext",
|
|
102
|
+
size: 14,
|
|
103
|
+
"aria-hidden": "true"
|
|
104
|
+
}),
|
|
105
|
+
e.newTab && /* @__PURE__ */ g("span", {
|
|
106
|
+
className: "kapi-ctxitem__sr",
|
|
107
|
+
children: r
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}, w = ({ sections: t, activeId: n, onSelect: r, search: i, hint: a, labels: o }) => {
|
|
112
|
+
let s = e("link", u, o);
|
|
113
|
+
return /* @__PURE__ */ _(h, { children: [
|
|
114
|
+
i && /* @__PURE__ */ g("input", {
|
|
115
|
+
type: "search",
|
|
116
|
+
className: "kapi-ctxsearch kapi-ctxsearch--input",
|
|
117
|
+
placeholder: i.placeholder,
|
|
118
|
+
value: i.value,
|
|
119
|
+
"aria-label": i["aria-label"] ?? i.placeholder,
|
|
120
|
+
onChange: (e) => i.onChange?.(e.target.value)
|
|
121
|
+
}),
|
|
122
|
+
t.map((e, t) => /* @__PURE__ */ _("div", {
|
|
123
|
+
className: "kapi-ctxsection",
|
|
124
|
+
children: [
|
|
125
|
+
t > 0 && /* @__PURE__ */ g("div", { className: "kapi-ctxdivider" }),
|
|
126
|
+
e.label && /* @__PURE__ */ g("div", {
|
|
127
|
+
className: "kapi-ct",
|
|
128
|
+
children: e.label
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ g(l, {
|
|
131
|
+
active: c(e.items, n),
|
|
132
|
+
children: e.items.map((e) => /* @__PURE__ */ g(C, {
|
|
133
|
+
item: e,
|
|
134
|
+
active: e.id === n,
|
|
135
|
+
onSelect: r,
|
|
136
|
+
newTabLabel: s.newTab
|
|
137
|
+
}, e.id))
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
}, e.id)),
|
|
141
|
+
a && /* @__PURE__ */ g("div", {
|
|
142
|
+
className: "kapi-hint",
|
|
143
|
+
children: a
|
|
144
|
+
})
|
|
145
|
+
] });
|
|
146
|
+
}, T = {
|
|
147
|
+
resize: "Redimensionar panel",
|
|
148
|
+
collapse: "Plegar panel",
|
|
149
|
+
expand: "Desplegar panel",
|
|
150
|
+
region: "Panel contextual"
|
|
151
|
+
}, E = ({ title: c, actions: l, collapsed: u, defaultCollapsed: d, onCollapsedChange: p, collapseLabel: m, expandLabel: h, side: S = "left", collapsedMode: C = "hidden", resizable: E = !1, minWidth: D = 200, maxWidth: O = 420, "aria-label": k, labels: A, className: j, style: M, id: N, ...P }) => {
|
|
152
|
+
let F = e("contextPanel", T, A), I = m ?? F.collapse, L = h ?? F.expand, R = k ?? F.region, [z, B] = y(d ?? !1), [V, H] = y(null), [U, W] = y(!1), G = v(null), K = v(null), q = o(u, z), J = v(null), [Y, X] = y(null);
|
|
153
|
+
ee(() => {
|
|
154
|
+
Y && (q === Y.next && J.current?.focus(), X(null));
|
|
155
|
+
}, [Y, q]);
|
|
156
|
+
let Z = (e) => {
|
|
157
|
+
X({ next: e }), u === void 0 && B(e), p?.(e);
|
|
158
|
+
}, te = S === "right" ? x : b, ne = S === "right" ? b : x, Q = () => V ?? K.current?.offsetWidth ?? 258, re = (e) => {
|
|
159
|
+
e.button === 0 && (G.current = {
|
|
160
|
+
startX: e.clientX,
|
|
161
|
+
startWidth: Q()
|
|
162
|
+
}, e.currentTarget.setPointerCapture(e.pointerId), W(!0), e.preventDefault());
|
|
163
|
+
}, ie = (e) => {
|
|
164
|
+
let t = G.current;
|
|
165
|
+
t && H(a(S, t.startWidth, t.startX, e.clientX, D, O));
|
|
166
|
+
}, $ = (e) => {
|
|
167
|
+
G.current = null, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), W(!1);
|
|
168
|
+
}, ae = (e) => {
|
|
169
|
+
let t = s(S, Q(), e.key, D, O);
|
|
170
|
+
t !== null && (e.preventDefault(), H(t));
|
|
171
|
+
};
|
|
172
|
+
if (q) {
|
|
173
|
+
let e = C === "mini";
|
|
174
|
+
return /* @__PURE__ */ _("aside", {
|
|
175
|
+
id: N,
|
|
176
|
+
className: t(i({
|
|
177
|
+
side: S,
|
|
178
|
+
collapsed: !0
|
|
179
|
+
}), e && "is-mini kapi-navmini", j),
|
|
180
|
+
style: M,
|
|
181
|
+
"aria-label": R,
|
|
182
|
+
children: [/* @__PURE__ */ g("button", {
|
|
183
|
+
ref: J,
|
|
184
|
+
type: "button",
|
|
185
|
+
className: "kapi-paneltoggle",
|
|
186
|
+
onClick: () => Z(!1),
|
|
187
|
+
"aria-label": L,
|
|
188
|
+
children: /* @__PURE__ */ g(ne, {
|
|
189
|
+
size: 16,
|
|
190
|
+
strokeWidth: 2,
|
|
191
|
+
"aria-hidden": "true"
|
|
192
|
+
})
|
|
193
|
+
}), e && /* @__PURE__ */ g(f.Provider, {
|
|
194
|
+
value: {
|
|
195
|
+
mini: !0,
|
|
196
|
+
expand: () => Z(!1),
|
|
197
|
+
tooltipSide: S === "right" ? "left" : "right"
|
|
198
|
+
},
|
|
199
|
+
children: /* @__PURE__ */ g(w, {
|
|
200
|
+
...P,
|
|
201
|
+
labels: A
|
|
202
|
+
})
|
|
203
|
+
})]
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return /* @__PURE__ */ _("aside", {
|
|
207
|
+
ref: K,
|
|
208
|
+
id: N,
|
|
209
|
+
className: t(i({
|
|
210
|
+
side: S,
|
|
211
|
+
resizing: U
|
|
212
|
+
}), j),
|
|
213
|
+
"aria-label": R,
|
|
214
|
+
"data-resizable": E || void 0,
|
|
215
|
+
style: E && V !== null ? {
|
|
216
|
+
...M,
|
|
217
|
+
width: V
|
|
218
|
+
} : M,
|
|
219
|
+
children: [
|
|
220
|
+
E && /* @__PURE__ */ g("div", {
|
|
221
|
+
className: "kapi-ctxpanel__resize",
|
|
222
|
+
role: "separator",
|
|
223
|
+
"aria-orientation": "vertical",
|
|
224
|
+
"aria-label": F.resize,
|
|
225
|
+
"aria-valuemin": D,
|
|
226
|
+
"aria-valuemax": O,
|
|
227
|
+
"aria-valuenow": r(V ?? 258, D, O),
|
|
228
|
+
tabIndex: 0,
|
|
229
|
+
onPointerDown: re,
|
|
230
|
+
onPointerMove: ie,
|
|
231
|
+
onPointerUp: $,
|
|
232
|
+
onPointerCancel: $,
|
|
233
|
+
onKeyDown: ae
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ _("div", {
|
|
236
|
+
className: "kapi-ctxpanel__head",
|
|
237
|
+
children: [/* @__PURE__ */ g("span", { children: c }), /* @__PURE__ */ _("div", {
|
|
238
|
+
className: "kapi-ctxpanel__actions",
|
|
239
|
+
children: [l, n({
|
|
240
|
+
collapsed: u,
|
|
241
|
+
defaultCollapsed: d,
|
|
242
|
+
onCollapsedChange: p
|
|
243
|
+
}) && /* @__PURE__ */ g("button", {
|
|
244
|
+
ref: J,
|
|
245
|
+
type: "button",
|
|
246
|
+
className: "kapi-paneltoggle",
|
|
247
|
+
onClick: () => Z(!0),
|
|
248
|
+
"aria-label": I,
|
|
249
|
+
children: /* @__PURE__ */ g(te, {
|
|
250
|
+
size: 16,
|
|
251
|
+
strokeWidth: 2,
|
|
252
|
+
"aria-hidden": "true"
|
|
253
|
+
})
|
|
254
|
+
})]
|
|
255
|
+
})]
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ g(w, {
|
|
258
|
+
...P,
|
|
259
|
+
labels: A
|
|
260
|
+
})
|
|
261
|
+
]
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
//#endregion
|
|
265
|
+
export { T as DEFAULT_CONTEXT_PANEL_LABELS, E as KapiContextPanel, w as KapiContextSections };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import { type KapiFilterChipItem } from "./filterChipsLogic";
|
|
3
|
+
import "./KapiFilterChips.css";
|
|
4
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
5
|
+
export type KapiFilterChipsLabels = {
|
|
6
|
+
/** Nombre accesible del grupo. */
|
|
7
|
+
group: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const DEFAULT_FILTER_CHIPS_LABELS: KapiFilterChipsLabels;
|
|
10
|
+
/**
|
|
11
|
+
* Atributos nativos (`id`, `style`, `data-*`…) van al `role="group"`; `aria-label` gana sobre `labels.group`.
|
|
12
|
+
* `Id` se infiere de `items` (o del `onChange`).
|
|
13
|
+
*/
|
|
14
|
+
export type KapiFilterChipsProps<Id extends string = string> = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "role" | "defaultValue"> & {
|
|
15
|
+
/** Chips, en orden; cada uno con `id`, texto y contador opcional. */
|
|
16
|
+
items: KapiFilterChipItem<Id>[];
|
|
17
|
+
/** Id del chip activo. */
|
|
18
|
+
value: Id;
|
|
19
|
+
/** Se llama con el `id` del chip elegido. */
|
|
20
|
+
onChange: (id: Id) => void;
|
|
21
|
+
/** Tamaño de los chips. */
|
|
22
|
+
size?: "sm" | "md";
|
|
23
|
+
/** Textos fijos (clave `filterChips`). */
|
|
24
|
+
labels?: KapiLabelsOverride<KapiFilterChipsLabels> | undefined;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Fila de chips-filtro con contador opcional. Cada chip es un toggle (`aria-pressed`);
|
|
28
|
+
* flechas Izq/Der (y Home/End) mueven el foco con roving tabindex.
|
|
29
|
+
*/
|
|
30
|
+
export declare function KapiFilterChips<Id extends string = string>({ items, value, onChange, size, labels, className, "aria-label": ariaLabelAttr, ...rest }: KapiFilterChipsProps<Id>): import("react").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
4
|
+
import { activeChipIndex as n, chipAriaLabel as r, filterChipClasses as i, nextChipIndex as a } from "./filterChipsLogic.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { useRef as c } from "react";
|
|
8
|
+
//#region src/components/navigation/KapiFilterChips.tsx
|
|
9
|
+
var l = { group: "Filtros" };
|
|
10
|
+
function u({ items: u, value: d, onChange: f, size: p = "md", labels: m, className: h, "aria-label": g, ..._ }) {
|
|
11
|
+
let v = e("filterChips", l, m), y = c([]), b = n(u, d), x = (e, t) => {
|
|
12
|
+
let n = a(t, u.length, e.key);
|
|
13
|
+
n != null && (e.preventDefault(), y.current[n]?.focus());
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ o("div", {
|
|
16
|
+
..._,
|
|
17
|
+
role: "group",
|
|
18
|
+
"aria-label": g ?? v.group,
|
|
19
|
+
className: t("kapi-filterchips", h),
|
|
20
|
+
children: u.map((e, t) => /* @__PURE__ */ s("button", {
|
|
21
|
+
ref: (e) => {
|
|
22
|
+
y.current[t] = e;
|
|
23
|
+
},
|
|
24
|
+
type: "button",
|
|
25
|
+
className: i(e, e.id === d, p),
|
|
26
|
+
"aria-pressed": e.id === d,
|
|
27
|
+
"aria-label": r(e),
|
|
28
|
+
tabIndex: t === b ? 0 : -1,
|
|
29
|
+
onClick: () => f(e.id),
|
|
30
|
+
onKeyDown: (e) => x(e, t),
|
|
31
|
+
children: [/* @__PURE__ */ o("span", { children: e.label }), e.count != null && /* @__PURE__ */ o("span", {
|
|
32
|
+
className: "kapi-filterchip__count",
|
|
33
|
+
"aria-hidden": !0,
|
|
34
|
+
children: e.count
|
|
35
|
+
})]
|
|
36
|
+
}, e.id))
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { l as DEFAULT_FILTER_CHIPS_LABELS, u as KapiFilterChips };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type KapiBadgeVariant } from "../display/KapiBadge";
|
|
2
|
+
import { type KapiNavBadgeValue } from "./navBadgeLogic";
|
|
3
|
+
import "./KapiNavBadge.css";
|
|
4
|
+
export type KapiNavBadgeProps = {
|
|
5
|
+
/** Contador o `"dot"` (aviso sin número). Sin valor o 0 no dibuja nada. */
|
|
6
|
+
value?: KapiNavBadgeValue | undefined;
|
|
7
|
+
/** Color por rol, igual que `KapiBadge` (`danger` para vencidos, `warning` para por vencer…). @default "primary" */
|
|
8
|
+
tone?: KapiBadgeVariant | undefined;
|
|
9
|
+
/** Texto accesible (p. ej. "3 trámites vencidos"); sin él se lee el número. */
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
/** `inline`: al final de un ítem de lista. `corner`: burbuja sobre la esquina del ícono (rail). @default "inline" */
|
|
12
|
+
placement?: "inline" | "corner" | undefined;
|
|
13
|
+
/** Tope visual del contador (por encima, "N+"). @default 99 */
|
|
14
|
+
max?: number | undefined;
|
|
15
|
+
/** Muestra el 0 en vez de ocultar el badge. */
|
|
16
|
+
showZero?: boolean | undefined;
|
|
17
|
+
/** `false` omite el texto accesible (cuando el contenedor ya lo incluye en su `aria-label`). @default true */
|
|
18
|
+
announce?: boolean | undefined;
|
|
19
|
+
/** Clase extra. */
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Badge de atención para navegación (rail, ítems de panel, grupos). Lo visible es `aria-hidden` y el texto
|
|
24
|
+
* accesible va aparte, así el nombre del ítem que lo contiene queda "Trámites 3 trámites vencidos".
|
|
25
|
+
*/
|
|
26
|
+
export declare const KapiNavBadge: ({ value, tone, label, placement, max, showZero, announce, className }: KapiNavBadgeProps) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { joinClasses as e } from "../rootProps.js";
|
|
3
|
+
import { badgeClasses as t } from "../display/KapiBadge.js";
|
|
4
|
+
import { navBadgeA11yText as n, navBadgeView as r } from "./navBadgeLogic.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/navigation/KapiNavBadge.tsx
|
|
8
|
+
var s = ({ value: s, tone: c = "primary", label: l, placement: u = "inline", max: d, showZero: f, announce: p = !0, className: m }) => {
|
|
9
|
+
let h = r(s, {
|
|
10
|
+
max: d,
|
|
11
|
+
showZero: f
|
|
12
|
+
});
|
|
13
|
+
if (h === null) return null;
|
|
14
|
+
let g = p ? n(s, l, { showZero: f }) : null, _ = h.kind === "dot";
|
|
15
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("span", {
|
|
16
|
+
className: e(t({
|
|
17
|
+
variant: c,
|
|
18
|
+
tone: u === "corner" || _ ? "solid" : "subtle",
|
|
19
|
+
size: "sm"
|
|
20
|
+
}), "kapi-navbadge", `kapi-navbadge--${u}`, _ && "kapi-navbadge--dot", m),
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
children: _ ? null : h.text
|
|
23
|
+
}), g !== null && /* @__PURE__ */ o(i, { children: [
|
|
24
|
+
" ",
|
|
25
|
+
/* @__PURE__ */ a("span", {
|
|
26
|
+
className: "kapi-navbadge__sr",
|
|
27
|
+
children: g
|
|
28
|
+
}),
|
|
29
|
+
" "
|
|
30
|
+
] })] });
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { s as KapiNavBadge };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type KapiLinkLabels } from "../locale/linkLabels";
|
|
3
|
+
import { type KapiNavBadgeValue } from "./navBadgeLogic";
|
|
4
|
+
import type { KapiBadgeVariant } from "../display/KapiBadge";
|
|
5
|
+
import "./navigation.css";
|
|
6
|
+
import type { KapiRootProps } from "../rootProps";
|
|
7
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
8
|
+
/** Subítem de `KapiPanelGroup`. `Id` acota los ids (p. ej. una unión de literales). */
|
|
9
|
+
export type KapiPanelGroupItem<Id extends string = string> = {
|
|
10
|
+
id: Id;
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/** Contador al final del subítem (total neutro; el 0 se muestra). */
|
|
13
|
+
count?: number;
|
|
14
|
+
/** Aviso de atención al final: contador (0 no dibuja nada; tope "999+") o `"dot"` sin número. */
|
|
15
|
+
badge?: KapiNavBadgeValue | undefined;
|
|
16
|
+
/** Color del aviso, como `KapiBadge` (`danger` para vencidos…). @default "primary" */
|
|
17
|
+
badgeTone?: KapiBadgeVariant | undefined;
|
|
18
|
+
/** Texto accesible del aviso (p. ej. "3 trámites vencidos"); sin él se lee el número. */
|
|
19
|
+
badgeLabel?: string | undefined;
|
|
20
|
+
/** Ícono (lucide-react) a la izquierda de la etiqueta. */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** No se puede elegir (botón deshabilitado o enlace `aria-disabled`). */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Si se pasa, se dibuja un enlace real `<a>` en vez de un botón. */
|
|
25
|
+
href?: string;
|
|
26
|
+
/** Destino en otro sistema: agrega el ícono ↗ (sólo con `href`). */
|
|
27
|
+
external?: boolean;
|
|
28
|
+
/** Abrir el enlace en una pestaña nueva (sólo con `href`). */
|
|
29
|
+
newTab?: boolean;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* `className`/`style`/`id` van al contenedor del grupo; `aria-label` nombra la región de los subítems.
|
|
33
|
+
* `Id` se infiere de `items`.
|
|
34
|
+
*/
|
|
35
|
+
export type KapiPanelGroupProps<Id extends string = string> = KapiRootProps & {
|
|
36
|
+
/** Etiqueta de la cabecera del grupo. */
|
|
37
|
+
label: ReactNode;
|
|
38
|
+
/** Contador de la cabecera (p. ej. 92; total neutro, el 0 se muestra). */
|
|
39
|
+
count?: number;
|
|
40
|
+
/** Aviso de atención en la cabecera (convive con `count`): contador (0 no dibuja nada; tope "999+") o `"dot"` sin número. */
|
|
41
|
+
badge?: KapiNavBadgeValue | undefined;
|
|
42
|
+
/** Color del aviso, como `KapiBadge` (`danger` para vencidos…). @default "primary" */
|
|
43
|
+
badgeTone?: KapiBadgeVariant | undefined;
|
|
44
|
+
/** Texto accesible del aviso (p. ej. "3 trámites vencidos"); sin él se lee el número. */
|
|
45
|
+
badgeLabel?: string | undefined;
|
|
46
|
+
/** Ícono opcional de la cabecera. */
|
|
47
|
+
icon?: ReactNode;
|
|
48
|
+
/** Subítems que se muestran al abrir el grupo. */
|
|
49
|
+
items: KapiPanelGroupItem<Id>[];
|
|
50
|
+
/** Id del subítem activo (`aria-current="page"`); lo decide la app, normalmente desde el router. */
|
|
51
|
+
activeId?: Id;
|
|
52
|
+
/** Se llama con el `id` del subítem clickeado (no aplica a los enlaces con `href`). */
|
|
53
|
+
onSelect?: (id: Id) => void;
|
|
54
|
+
/** Controlado. */
|
|
55
|
+
open?: boolean;
|
|
56
|
+
/** Inicial cuando no es controlado. Por defecto `false`. */
|
|
57
|
+
defaultOpen?: boolean;
|
|
58
|
+
/** Se llama con el estado nuevo al abrir o cerrar el grupo. */
|
|
59
|
+
onOpenChange?: (open: boolean) => void;
|
|
60
|
+
/** Nombre accesible de la región de subítems; sin él la nombra la cabecera. */
|
|
61
|
+
"aria-label"?: string;
|
|
62
|
+
/** Textos fijos (aviso de pestaña nueva; clave compartida `link`). */
|
|
63
|
+
labels?: KapiLabelsOverride<KapiLinkLabels> | undefined;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Grupo plegable para el panel contextual: cabecera (ícono + etiqueta + contador + chevron)
|
|
67
|
+
* que muestra u oculta subítems. Abierto interno o controlado.
|
|
68
|
+
*/
|
|
69
|
+
export declare function KapiPanelGroup<Id extends string = string>({ label, count, badge, badgeTone, badgeLabel, icon, items, activeId, onSelect, open, defaultOpen, onOpenChange, className, style, id, "aria-label": ariaLabel, labels }: KapiPanelGroupProps<Id>): import("react").JSX.Element;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
+
import { activeIdIn as t } from "./activeItemLogic.js";
|
|
4
|
+
import { CtxSlidingList as n } from "./CtxSlidingList.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { DEFAULT_LINK_LABELS as r } from "../locale/linkLabels.js";
|
|
7
|
+
import "./navBadgeLogic.js";
|
|
8
|
+
import { KapiNavBadge as i } from "./KapiNavBadge.js";
|
|
9
|
+
import { useKapiPanelMini as a } from "./panelMini.js";
|
|
10
|
+
import { MiniNavItem as o } from "./MiniNavItem.js";
|
|
11
|
+
import { formatCount as s, panelGroupClasses as c, resolveOpen as l } from "./panelGroupLogic.js";
|
|
12
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
import { useId as f, useState as p } from "react";
|
|
14
|
+
import { ChevronRight as m, ExternalLink as h } from "lucide-react";
|
|
15
|
+
//#region src/components/navigation/KapiPanelGroup.tsx
|
|
16
|
+
var g = ({ value: e }) => {
|
|
17
|
+
let t = s(e);
|
|
18
|
+
return t === null ? null : /* @__PURE__ */ u("span", {
|
|
19
|
+
className: "kapi-panelgroup__count",
|
|
20
|
+
children: t
|
|
21
|
+
});
|
|
22
|
+
}, _ = ({ item: e, active: t, onSelect: n, newTabLabel: r }) => {
|
|
23
|
+
let a = `kapi-ctxitem${t ? " kapi-ctxitem--on" : ""}`, o = /* @__PURE__ */ d("span", {
|
|
24
|
+
className: "kapi-ctxitem__main",
|
|
25
|
+
children: [e.icon, e.label]
|
|
26
|
+
});
|
|
27
|
+
return e.href === void 0 ? /* @__PURE__ */ d("button", {
|
|
28
|
+
type: "button",
|
|
29
|
+
className: a,
|
|
30
|
+
"aria-current": t ? "page" : void 0,
|
|
31
|
+
disabled: e.disabled,
|
|
32
|
+
onClick: () => n?.(e.id),
|
|
33
|
+
children: [
|
|
34
|
+
o,
|
|
35
|
+
/* @__PURE__ */ u(i, {
|
|
36
|
+
value: e.badge,
|
|
37
|
+
tone: e.badgeTone,
|
|
38
|
+
label: e.badgeLabel,
|
|
39
|
+
max: 999
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ u(g, { value: e.count })
|
|
42
|
+
]
|
|
43
|
+
}) : /* @__PURE__ */ d("a", {
|
|
44
|
+
className: `${a} kapi-ctxitem--link`,
|
|
45
|
+
href: e.disabled ? void 0 : e.href,
|
|
46
|
+
rel: "noopener noreferrer",
|
|
47
|
+
target: e.newTab ? "_blank" : void 0,
|
|
48
|
+
"aria-current": t ? "page" : void 0,
|
|
49
|
+
"aria-disabled": e.disabled || void 0,
|
|
50
|
+
children: [
|
|
51
|
+
o,
|
|
52
|
+
/* @__PURE__ */ u(i, {
|
|
53
|
+
value: e.badge,
|
|
54
|
+
tone: e.badgeTone,
|
|
55
|
+
label: e.badgeLabel,
|
|
56
|
+
max: 999
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ u(g, { value: e.count }),
|
|
59
|
+
e.external && /* @__PURE__ */ u(h, {
|
|
60
|
+
className: "kapi-ctxitem__ext",
|
|
61
|
+
size: 14,
|
|
62
|
+
"aria-hidden": "true"
|
|
63
|
+
}),
|
|
64
|
+
e.newTab && /* @__PURE__ */ u("span", {
|
|
65
|
+
className: "kapi-ctxitem__sr",
|
|
66
|
+
children: r
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
function v({ label: s, count: h, badge: v, badgeTone: y, badgeLabel: b, icon: x, items: S, activeId: C, onSelect: w, open: T, defaultOpen: E = !1, onOpenChange: D, className: O, style: k, id: A, "aria-label": j, labels: M }) {
|
|
72
|
+
let N = e("link", r, M), P = f(), F = `${P}-body`, I = `${P}-head`, [L, R] = p(E), z = l(T, L), B = (e) => {
|
|
73
|
+
T === void 0 && R(e), D?.(e);
|
|
74
|
+
}, V = () => B(!z), { mini: H, expand: U } = a();
|
|
75
|
+
return H ? /* @__PURE__ */ u("div", {
|
|
76
|
+
className: c({
|
|
77
|
+
open: !1,
|
|
78
|
+
className: O
|
|
79
|
+
}),
|
|
80
|
+
style: k,
|
|
81
|
+
id: A,
|
|
82
|
+
children: /* @__PURE__ */ u(o, {
|
|
83
|
+
label: s,
|
|
84
|
+
icon: x,
|
|
85
|
+
active: t(S, C) !== null,
|
|
86
|
+
badge: v,
|
|
87
|
+
badgeTone: y,
|
|
88
|
+
badgeLabel: b,
|
|
89
|
+
onClick: () => {
|
|
90
|
+
U(), z || B(!0);
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}) : /* @__PURE__ */ d("div", {
|
|
94
|
+
className: c({
|
|
95
|
+
open: z,
|
|
96
|
+
className: O
|
|
97
|
+
}),
|
|
98
|
+
style: k,
|
|
99
|
+
id: A,
|
|
100
|
+
children: [/* @__PURE__ */ d("button", {
|
|
101
|
+
type: "button",
|
|
102
|
+
id: I,
|
|
103
|
+
className: "kapi-panelgroup__head",
|
|
104
|
+
"aria-expanded": z,
|
|
105
|
+
"aria-controls": F,
|
|
106
|
+
onClick: V,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ d("span", {
|
|
109
|
+
className: "kapi-panelgroup__label",
|
|
110
|
+
children: [x, s]
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ u(i, {
|
|
113
|
+
value: v,
|
|
114
|
+
tone: y,
|
|
115
|
+
label: b,
|
|
116
|
+
max: 999
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ u(g, { value: h }),
|
|
119
|
+
/* @__PURE__ */ u(m, {
|
|
120
|
+
className: "kapi-panelgroup__chevron",
|
|
121
|
+
size: 16,
|
|
122
|
+
strokeWidth: 2,
|
|
123
|
+
"aria-hidden": "true"
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
}), /* @__PURE__ */ u("div", {
|
|
127
|
+
id: F,
|
|
128
|
+
role: "region",
|
|
129
|
+
"aria-label": j,
|
|
130
|
+
"aria-labelledby": j ? void 0 : I,
|
|
131
|
+
className: "kapi-panelgroup__body",
|
|
132
|
+
inert: !z,
|
|
133
|
+
children: /* @__PURE__ */ u("div", {
|
|
134
|
+
className: "kapi-panelgroup__clip",
|
|
135
|
+
children: /* @__PURE__ */ u(n, {
|
|
136
|
+
active: t(S, C),
|
|
137
|
+
children: S.map((e) => /* @__PURE__ */ u(_, {
|
|
138
|
+
item: e,
|
|
139
|
+
active: e.id === C,
|
|
140
|
+
onSelect: w,
|
|
141
|
+
newTabLabel: N.newTab
|
|
142
|
+
}, e.id))
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
})]
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
export { v as KapiPanelGroup };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "./KapiSteps.css";
|
|
2
|
+
import type { OlHTMLAttributes, ReactNode, Ref } from "react";
|
|
3
|
+
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
4
|
+
import { type KapiStepStatus, type KapiStepsOrientation, type KapiStepsSize } from "./stepsLogic";
|
|
5
|
+
export type { KapiStepStatus, KapiStepsOrientation, KapiStepsSize } from "./stepsLogic";
|
|
6
|
+
/** Paso de `KapiSteps`. `Id` acota los ids (p. ej. una unión de literales). */
|
|
7
|
+
export type KapiStep<Id extends string = string> = {
|
|
8
|
+
/** Id único del paso (el que se compara con `current`). */
|
|
9
|
+
id: Id;
|
|
10
|
+
/** Nombre visible del paso. */
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/** Texto secundario bajo el label (responsable, fecha…). */
|
|
13
|
+
description?: ReactNode | undefined;
|
|
14
|
+
/** Estado explícito; gana sobre el derivado de `current`. */
|
|
15
|
+
status?: KapiStepStatus | undefined;
|
|
16
|
+
};
|
|
17
|
+
/** Texto oculto que anuncia el estado de cada paso a lectores de pantalla. */
|
|
18
|
+
export type KapiStepsLabels = Record<KapiStepStatus, string>;
|
|
19
|
+
export declare const DEFAULT_STEPS_LABELS: KapiStepsLabels;
|
|
20
|
+
/**
|
|
21
|
+
* Atributos nativos (`id`, `style`, `aria-label`, `data-*`…) van al `<ol>`. `Id` se infiere de `steps`,
|
|
22
|
+
* sin escribir el argumento de tipo.
|
|
23
|
+
*/
|
|
24
|
+
export type KapiStepsProps<Id extends string = string> = Omit<OlHTMLAttributes<HTMLOListElement>, "children"> & {
|
|
25
|
+
/** Pasos del circuito, en orden. */
|
|
26
|
+
steps: KapiStep<Id>[];
|
|
27
|
+
/** Id del paso actual: los anteriores quedan completos y los siguientes pendientes (salvo `status` explícito). */
|
|
28
|
+
current?: NoInfer<Id> | undefined;
|
|
29
|
+
/** Disposición: columna (default) o fila que se acomoda en varias líneas si no entra. */
|
|
30
|
+
orientation?: KapiStepsOrientation | undefined;
|
|
31
|
+
/** Tamaño del marcador y del texto. */
|
|
32
|
+
size?: KapiStepsSize | undefined;
|
|
33
|
+
/** Textos de estado para lectores de pantalla (clave `steps`). */
|
|
34
|
+
labels?: KapiLabelsOverride<KapiStepsLabels> | undefined;
|
|
35
|
+
/** Ref al `<ol>`. */
|
|
36
|
+
ref?: Ref<HTMLOListElement> | undefined;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Pasos de un circuito, de solo lectura (p. ej. los estados de un trámite). No navega: para un
|
|
40
|
+
* formulario por pasos usar `KapiWizard`. Es un `<ol>` con `aria-current="step"` en el paso actual y
|
|
41
|
+
* el estado de cada paso como texto oculto.
|
|
42
|
+
*/
|
|
43
|
+
export declare function KapiSteps<Id extends string = string>({ steps, current, orientation, size, labels, className, ref, ...rest }: KapiStepsProps<Id>): import("react").JSX.Element;
|