@kapiuara/ui 0.12.0 → 0.13.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 +1197 -49
- package/dist/components/chat/KapiChatDivider.d.ts +1 -2
- package/dist/components/chat/KapiChatDivider.js +1 -0
- package/dist/components/chat/KapiChatList.d.ts +10 -6
- package/dist/components/chat/KapiChatList.js +12 -11
- package/dist/components/chat/KapiChatThread.d.ts +2 -3
- package/dist/components/chat/KapiChatThread.js +73 -52
- package/dist/components/chat/KapiComposer.d.ts +3 -4
- package/dist/components/chat/KapiComposer.js +2 -1
- package/dist/components/chat/KapiMessageBubble.d.ts +3 -4
- package/dist/components/chat/KapiMessageBubble.js +1 -0
- package/dist/components/chat/KapiTypingIndicator.d.ts +2 -3
- package/dist/components/chat/KapiTypingIndicator.js +1 -0
- package/dist/components/chat/chatLogic.d.ts +6 -0
- package/dist/components/chat/chatLogic.js +2 -2
- package/dist/components/chat/index.d.ts +18 -14
- package/dist/components/data/KapiBarChart.d.ts +13 -14
- package/dist/components/data/KapiBarChart.js +54 -52
- package/dist/components/data/KapiDataTable.d.ts +56 -0
- package/dist/components/data/KapiDataTable.js +143 -0
- package/dist/components/data/KapiEventCalendar.d.ts +9 -4
- package/dist/components/data/KapiEventCalendar.js +100 -96
- package/dist/components/data/KapiHeatmap.d.ts +8 -9
- package/dist/components/data/KapiHeatmap.js +64 -63
- package/dist/components/data/KapiLineChart.d.ts +9 -10
- package/dist/components/data/KapiLineChart.js +59 -56
- package/dist/components/data/KapiPagination.d.ts +6 -4
- package/dist/components/data/KapiPagination.js +2 -1
- package/dist/components/data/KapiPaginationFooter.d.ts +2 -3
- package/dist/components/data/KapiPaginationFooter.js +7 -4
- package/dist/components/data/KapiSparkline.d.ts +8 -9
- package/dist/components/data/KapiSparkline.js +1 -0
- package/dist/components/data/KapiTable.d.ts +7 -360
- package/dist/components/data/KapiTable.js +417 -692
- package/dist/components/data/KapiTableFilter.d.ts +16 -10
- package/dist/components/data/KapiTableFilter.js +50 -48
- package/dist/components/data/KapiTableRow.d.ts +55 -0
- package/dist/components/data/KapiTableRow.js +103 -0
- package/dist/components/data/KapiTableToolbar.d.ts +37 -0
- package/dist/components/data/KapiTableToolbar.js +237 -0
- package/dist/components/data/chartFrame.d.ts +1 -1
- package/dist/components/data/chartFrame.js +54 -55
- package/dist/components/data/datasetSelectionLogic.d.ts +7 -4
- package/dist/components/data/datasetSelectionLogic.js +3 -2
- package/dist/components/data/eventCalendarLogic.d.ts +7 -3
- package/dist/components/data/eventCalendarLogic.js +5 -4
- package/dist/components/data/index.d.ts +108 -30
- package/dist/components/data/rowClickLogic.d.ts +51 -0
- package/dist/components/data/rowClickLogic.js +56 -0
- package/dist/components/data/tableCells.d.ts +38 -0
- package/dist/components/data/tableCells.js +121 -0
- package/dist/components/data/tableHeaderMenu.d.ts +21 -0
- package/dist/components/data/tableHeaderMenu.js +45 -0
- package/dist/components/data/tableLabels.d.ts +76 -0
- package/dist/components/data/tableLabels.js +48 -0
- package/dist/components/data/tableLogic.d.ts +119 -21
- package/dist/components/data/tableLogic.js +121 -84
- package/dist/components/data/tablePaginationLogic.d.ts +15 -0
- package/dist/components/data/tablePaginationLogic.js +15 -0
- package/dist/components/data/tableResizeLogic.d.ts +12 -4
- package/dist/components/data/tableResizeLogic.js +14 -10
- package/dist/components/data/tableTypes.d.ts +509 -0
- package/dist/components/data/useColumnResize.d.ts +28 -0
- package/dist/components/data/useColumnResize.js +116 -0
- package/dist/components/data/useRowKeyWarning.d.ts +10 -0
- package/dist/components/data/useRowKeyWarning.js +29 -0
- package/dist/components/data/useTableEdges.d.ts +15 -0
- package/dist/components/data/useTableEdges.js +26 -0
- package/dist/components/data/useTableSelection.d.ts +51 -0
- package/dist/components/data/useTableSelection.js +80 -0
- package/dist/components/display/KapiAnnotation.d.ts +10 -9
- package/dist/components/display/KapiAnnotation.js +98 -101
- package/dist/components/display/KapiAvatar.d.ts +19 -13
- package/dist/components/display/KapiAvatar.js +26 -24
- package/dist/components/display/KapiAvatarGroup.d.ts +26 -10
- package/dist/components/display/KapiAvatarGroup.js +26 -24
- package/dist/components/display/KapiBadge.d.ts +23 -12
- package/dist/components/display/KapiBadge.js +20 -15
- package/dist/components/display/KapiComment.d.ts +1 -2
- package/dist/components/display/KapiComment.js +3 -2
- package/dist/components/display/KapiCommentComposer.d.ts +2 -3
- package/dist/components/display/KapiCommentComposer.js +3 -2
- package/dist/components/display/KapiDescriptionList.d.ts +6 -5
- package/dist/components/display/KapiDescriptionList.js +1 -0
- package/dist/components/display/KapiFileItem.d.ts +2 -3
- package/dist/components/display/KapiFileItem.js +3 -2
- package/dist/components/display/KapiFileViewer.d.ts +8 -9
- package/dist/components/display/KapiFileViewer.js +1 -0
- package/dist/components/display/KapiIconTile.d.ts +7 -6
- package/dist/components/display/KapiIconTile.js +1 -0
- package/dist/components/display/KapiStat.d.ts +9 -8
- package/dist/components/display/KapiStat.js +1 -0
- package/dist/components/display/KapiTag.d.ts +5 -4
- package/dist/components/display/KapiTag.js +1 -0
- package/dist/components/display/KapiTimeline.d.ts +6 -5
- package/dist/components/display/KapiTimeline.js +1 -0
- package/dist/components/display/KapiTruncate.d.ts +1 -2
- package/dist/components/display/KapiTruncate.js +1 -0
- package/dist/components/display/fileItemLogic.d.ts +1 -1
- package/dist/components/display/iconTileLogic.d.ts +2 -2
- package/dist/components/display/index.d.ts +86 -44
- package/dist/components/display/statLogic.d.ts +1 -1
- package/dist/components/feedback/KapiAlert.d.ts +30 -7
- package/dist/components/feedback/KapiAlert.js +47 -23
- package/dist/components/feedback/KapiBulkBar.d.ts +11 -6
- package/dist/components/feedback/KapiBulkBar.js +6 -3
- package/dist/components/feedback/KapiCountdown.d.ts +15 -12
- package/dist/components/feedback/KapiCountdown.js +17 -16
- package/dist/components/feedback/KapiEmpty.d.ts +3 -2
- package/dist/components/feedback/KapiEmpty.js +1 -0
- package/dist/components/feedback/KapiFab.d.ts +39 -9
- package/dist/components/feedback/KapiFab.js +172 -91
- package/dist/components/feedback/KapiOfflineBanner.d.ts +7 -6
- package/dist/components/feedback/KapiOfflineBanner.js +1 -0
- package/dist/components/feedback/KapiProgress.d.ts +8 -7
- package/dist/components/feedback/KapiProgress.js +1 -0
- package/dist/components/feedback/KapiSkeleton.d.ts +6 -4
- package/dist/components/feedback/KapiToastContainer.d.ts +16 -8
- package/dist/components/feedback/KapiToastContainer.js +118 -63
- package/dist/components/feedback/KapiTour.d.ts +6 -7
- package/dist/components/feedback/KapiTour.js +91 -86
- package/dist/components/feedback/KapiUnsavedBar.d.ts +15 -8
- package/dist/components/feedback/KapiUnsavedBar.js +8 -4
- package/dist/components/feedback/bulkBarLogic.d.ts +6 -1
- package/dist/components/feedback/bulkBarLogic.js +7 -4
- package/dist/components/feedback/countdownLogic.d.ts +19 -11
- package/dist/components/feedback/fabLogic.d.ts +28 -0
- package/dist/components/feedback/fabLogic.js +18 -2
- package/dist/components/feedback/index.d.ts +65 -33
- package/dist/components/feedback/toastLayer.d.ts +18 -0
- package/dist/components/feedback/toastLayer.js +22 -0
- package/dist/components/feedback/toastStore.d.ts +97 -9
- package/dist/components/feedback/toastStore.js +132 -29
- package/dist/components/feedback/tourLogic.d.ts +4 -16
- package/dist/components/feedback/unsavedBarLogic.d.ts +7 -1
- package/dist/components/feedback/unsavedBarLogic.js +9 -5
- package/dist/components/inputs/KapiAutocomplete.d.ts +73 -48
- package/dist/components/inputs/KapiAutocomplete.js +128 -146
- package/dist/components/inputs/KapiButton.d.ts +30 -11
- package/dist/components/inputs/KapiButton.js +34 -27
- package/dist/components/inputs/KapiCalendar.d.ts +14 -8
- package/dist/components/inputs/KapiCalendar.js +36 -34
- package/dist/components/inputs/KapiCalendarGrid.d.ts +11 -6
- package/dist/components/inputs/KapiCalendarGrid.js +44 -38
- package/dist/components/inputs/KapiCheckCard.d.ts +2 -3
- package/dist/components/inputs/KapiCheckCard.js +1 -0
- package/dist/components/inputs/KapiCheckbox.d.ts +1 -1
- package/dist/components/inputs/KapiChecklist.d.ts +77 -0
- package/dist/components/inputs/KapiChecklist.js +175 -0
- package/dist/components/inputs/KapiDatePicker.d.ts +60 -22
- package/dist/components/inputs/KapiDatePicker.js +122 -100
- package/dist/components/inputs/KapiDateRangePicker.d.ts +44 -10
- package/dist/components/inputs/KapiDateRangePicker.js +148 -120
- package/dist/components/inputs/KapiFacetedSearch.d.ts +7 -6
- package/dist/components/inputs/KapiFacetedSearch.js +130 -167
- package/dist/components/inputs/KapiField.d.ts +16 -8
- package/dist/components/inputs/KapiField.js +44 -43
- package/dist/components/inputs/KapiFileUpload.d.ts +15 -16
- package/dist/components/inputs/KapiFileUpload.js +1 -0
- package/dist/components/inputs/KapiIconButton.d.ts +1 -1
- package/dist/components/inputs/KapiInput.d.ts +13 -12
- package/dist/components/inputs/KapiInput.js +70 -70
- package/dist/components/inputs/KapiInputGroup.d.ts +13 -10
- package/dist/components/inputs/KapiInputGroup.js +21 -19
- package/dist/components/inputs/KapiMaskedInput.d.ts +15 -15
- package/dist/components/inputs/KapiMaskedInput.js +51 -48
- package/dist/components/inputs/KapiNumberStepper.d.ts +30 -18
- package/dist/components/inputs/KapiNumberStepper.js +80 -65
- package/dist/components/inputs/KapiRadio.d.ts +1 -1
- package/dist/components/inputs/KapiRating.d.ts +40 -23
- package/dist/components/inputs/KapiRating.js +80 -65
- package/dist/components/inputs/KapiSearchChip.d.ts +9 -8
- package/dist/components/inputs/KapiSearchChip.js +46 -42
- package/dist/components/inputs/KapiSegmented.d.ts +49 -16
- package/dist/components/inputs/KapiSegmented.js +72 -51
- package/dist/components/inputs/KapiSelect.d.ts +120 -39
- package/dist/components/inputs/KapiSelect.js +309 -379
- package/dist/components/inputs/KapiSelectMenu.d.ts +38 -0
- package/dist/components/inputs/KapiSelectMenu.js +173 -0
- package/dist/components/inputs/KapiSlider.d.ts +37 -19
- package/dist/components/inputs/KapiSlider.js +67 -54
- package/dist/components/inputs/KapiSwitch.d.ts +13 -7
- package/dist/components/inputs/KapiSwitch.js +30 -21
- package/dist/components/inputs/KapiTagInput.d.ts +35 -24
- package/dist/components/inputs/KapiTagInput.js +77 -66
- package/dist/components/inputs/KapiTextarea.d.ts +12 -11
- package/dist/components/inputs/KapiTextarea.js +71 -49
- package/dist/components/inputs/asyncSelectLogic.d.ts +8 -4
- package/dist/components/inputs/asyncSelectLogic.js +13 -12
- package/dist/components/inputs/autocompleteLogic.d.ts +2 -29
- package/dist/components/inputs/autocompleteLogic.js +6 -6
- package/dist/components/inputs/checkControl.d.ts +3 -3
- package/dist/components/inputs/checkControl.js +2 -0
- package/dist/components/inputs/checklistLogic.d.ts +33 -0
- package/dist/components/inputs/checklistLogic.js +16 -0
- package/dist/components/inputs/datePickerLogic.d.ts +63 -13
- package/dist/components/inputs/datePickerLogic.js +119 -50
- package/dist/components/inputs/dateRangeLogic.d.ts +8 -3
- package/dist/components/inputs/dateRangeLogic.js +49 -43
- package/dist/components/inputs/facetedSearchLogic.d.ts +1 -3
- package/dist/components/inputs/facetedSearchLogic.js +4 -5
- package/dist/components/inputs/fieldLogic.d.ts +37 -1
- package/dist/components/inputs/fieldLogic.js +36 -19
- package/dist/components/inputs/index.d.ts +118 -57
- package/dist/components/inputs/inputGroupLogic.d.ts +1 -1
- package/dist/components/inputs/inputLogic.d.ts +1 -1
- package/dist/components/inputs/maskLogic.d.ts +3 -2
- package/dist/components/inputs/maskLogic.js +12 -10
- package/dist/components/inputs/ownField.d.ts +37 -0
- package/dist/components/inputs/ownField.js +37 -0
- package/dist/components/inputs/segmentedLogic.d.ts +4 -3
- package/dist/components/inputs/segmentedLogic.js +7 -11
- package/dist/components/inputs/selectKeyLogic.d.ts +45 -0
- package/dist/components/inputs/selectKeyLogic.js +52 -0
- package/dist/components/inputs/selectLogic.d.ts +79 -22
- package/dist/components/inputs/selectLogic.js +87 -51
- package/dist/components/inputs/useCalendarFocus.js +13 -12
- package/dist/components/inputs/useSelectCreate.d.ts +22 -0
- package/dist/components/inputs/useSelectCreate.js +35 -0
- package/dist/components/inputs/useSelectSource.d.ts +39 -0
- package/dist/components/inputs/useSelectSource.js +42 -0
- package/dist/components/layout/KapiAccessCard.d.ts +11 -12
- package/dist/components/layout/KapiAccessCard.js +41 -37
- package/dist/components/layout/KapiAccountMenu.d.ts +23 -8
- package/dist/components/layout/KapiAccountMenu.js +124 -104
- package/dist/components/layout/KapiCard.d.ts +14 -7
- package/dist/components/layout/KapiCard.js +1 -0
- package/dist/components/layout/KapiCluster.d.ts +8 -7
- package/dist/components/layout/KapiCluster.js +1 -0
- package/dist/components/layout/KapiContextSlot.d.ts +10 -11
- package/dist/components/layout/KapiContextSlot.js +97 -92
- package/dist/components/layout/KapiDivider.d.ts +3 -2
- package/dist/components/layout/KapiDivider.js +1 -0
- package/dist/components/layout/KapiGrid.d.ts +8 -7
- package/dist/components/layout/KapiGrid.js +1 -0
- package/dist/components/layout/KapiMasonry.d.ts +1 -2
- package/dist/components/layout/KapiMasonry.js +1 -0
- package/dist/components/layout/KapiNotificationBell.d.ts +14 -15
- package/dist/components/layout/KapiNotificationBell.js +113 -116
- package/dist/components/layout/KapiPageHeader.d.ts +14 -6
- package/dist/components/layout/KapiPageHeader.js +99 -87
- package/dist/components/layout/KapiPanelParts.d.ts +11 -7
- package/dist/components/layout/KapiPanelParts.js +1 -0
- package/dist/components/layout/KapiRail.d.ts +17 -11
- package/dist/components/layout/KapiRail.js +96 -83
- package/dist/components/layout/KapiRailAccount.d.ts +26 -0
- package/dist/components/layout/KapiRailAccount.js +37 -0
- package/dist/components/layout/KapiRoot.d.ts +85 -0
- package/dist/components/layout/KapiRoot.js +58 -0
- package/dist/components/layout/KapiScrollArea.d.ts +2 -3
- package/dist/components/layout/KapiScrollArea.js +1 -0
- package/dist/components/layout/KapiShell.d.ts +15 -10
- package/dist/components/layout/KapiShell.js +51 -46
- package/dist/components/layout/KapiStack.d.ts +6 -5
- package/dist/components/layout/KapiStack.js +1 -0
- package/dist/components/layout/KapiThemeScript.d.ts +23 -0
- package/dist/components/layout/KapiThemeScript.js +13 -0
- package/dist/components/layout/accessCardLogic.d.ts +2 -2
- package/dist/components/layout/index.d.ts +55 -35
- package/dist/components/layout/notificationBellLogic.d.ts +1 -1
- package/dist/components/layout/railContext.d.ts +6 -0
- package/dist/components/layout/railContext.js +6 -0
- package/dist/components/layout/railLogic.d.ts +14 -14
- package/dist/components/layout/useMasonrySpans.js +31 -30
- package/dist/components/layout/useRailOverflow.js +30 -29
- package/dist/components/locale/KapiLocaleProvider.d.ts +33 -4
- package/dist/components/locale/KapiLocaleProvider.js +28 -17
- package/dist/components/locale/index.d.ts +7 -5
- package/dist/components/locale/labelRegistry.d.ts +67 -59
- package/dist/components/locale/localeLogic.d.ts +20 -0
- package/dist/components/locale/localeLogic.js +30 -0
- package/dist/components/navigation/CtxSlidingList.d.ts +5 -3
- package/dist/components/navigation/CtxSlidingList.js +15 -14
- package/dist/components/navigation/KapiAccordion.d.ts +9 -8
- package/dist/components/navigation/KapiAccordion.js +29 -29
- package/dist/components/navigation/KapiBreadcrumb.d.ts +4 -5
- package/dist/components/navigation/KapiBreadcrumb.js +1 -0
- package/dist/components/navigation/KapiCollapsiblePanel.d.ts +22 -16
- package/dist/components/navigation/KapiCollapsiblePanel.js +46 -43
- package/dist/components/navigation/KapiContextPanel.d.ts +31 -32
- package/dist/components/navigation/KapiContextPanel.js +119 -108
- package/dist/components/navigation/KapiFilterChips.d.ts +15 -10
- package/dist/components/navigation/KapiFilterChips.js +27 -22
- package/dist/components/navigation/KapiNavBadge.d.ts +7 -5
- package/dist/components/navigation/KapiNavBadge.js +12 -10
- package/dist/components/navigation/KapiPanelGroup.d.ts +22 -23
- package/dist/components/navigation/KapiPanelGroup.js +62 -60
- package/dist/components/navigation/KapiSteps.d.ts +4 -5
- package/dist/components/navigation/KapiSteps.js +1 -0
- package/dist/components/navigation/KapiTabs.d.ts +34 -16
- package/dist/components/navigation/KapiTabs.js +58 -49
- package/dist/components/navigation/KapiTree.d.ts +58 -18
- package/dist/components/navigation/KapiTree.js +135 -83
- package/dist/components/navigation/KapiWizard.d.ts +21 -11
- package/dist/components/navigation/KapiWizard.js +79 -72
- package/dist/components/navigation/MiniNavItem.d.ts +3 -4
- package/dist/components/navigation/MiniNavItem.js +1 -0
- package/dist/components/navigation/breadcrumbLogic.d.ts +1 -1
- package/dist/components/navigation/contextPanelLogic.d.ts +9 -5
- package/dist/components/navigation/filterChipsLogic.d.ts +13 -7
- package/dist/components/navigation/filterChipsLogic.js +12 -14
- package/dist/components/navigation/index.d.ts +75 -39
- package/dist/components/navigation/panelGroupLogic.d.ts +5 -1
- package/dist/components/navigation/panelMini.d.ts +1 -1
- package/dist/components/navigation/panelMini.js +1 -1
- package/dist/components/navigation/tabsLogic.d.ts +3 -2
- package/dist/components/navigation/tabsLogic.js +8 -12
- package/dist/components/navigation/treeLogic.d.ts +5 -5
- package/dist/components/navigation/treeLogic.js +3 -9
- package/dist/components/overlays/KapiCanvasForm.d.ts +8 -8
- package/dist/components/overlays/KapiCanvasForm.js +1 -1
- package/dist/components/overlays/KapiCommandPalette.d.ts +14 -10
- package/dist/components/overlays/KapiCommandPalette.js +70 -67
- package/dist/components/overlays/KapiConfirm.d.ts +16 -11
- package/dist/components/overlays/KapiConfirm.js +47 -44
- package/dist/components/overlays/KapiContextMenu.d.ts +77 -16
- package/dist/components/overlays/KapiContextMenu.js +55 -70
- package/dist/components/overlays/KapiDialogHost.d.ts +5 -7
- package/dist/components/overlays/KapiDialogHost.js +67 -64
- package/dist/components/overlays/KapiDropdown.d.ts +43 -21
- package/dist/components/overlays/KapiDropdown.js +31 -80
- package/dist/components/overlays/KapiLoading.d.ts +10 -5
- package/dist/components/overlays/KapiLoading.js +28 -25
- package/dist/components/overlays/KapiMenuButton.d.ts +48 -17
- package/dist/components/overlays/KapiMenuButton.js +73 -95
- package/dist/components/overlays/KapiModal.d.ts +16 -8
- package/dist/components/overlays/KapiModal.js +72 -65
- package/dist/components/overlays/KapiOffcanvas.d.ts +23 -13
- package/dist/components/overlays/KapiOffcanvas.js +159 -143
- package/dist/components/overlays/KapiOffcanvasStack.d.ts +4 -4
- package/dist/components/overlays/KapiOffcanvasStack.js +63 -52
- package/dist/components/overlays/KapiPhotoView.d.ts +7 -8
- package/dist/components/overlays/KapiPhotoView.js +67 -64
- package/dist/components/overlays/KapiPopover.d.ts +18 -17
- package/dist/components/overlays/KapiPopover.js +32 -42
- package/dist/components/overlays/KapiShapeSheet.d.ts +18 -12
- package/dist/components/overlays/KapiShapeSheet.js +51 -45
- package/dist/components/overlays/KapiSplitModal.d.ts +12 -11
- package/dist/components/overlays/KapiSplitModal.js +78 -68
- package/dist/components/overlays/KapiTooltip.d.ts +20 -10
- package/dist/components/overlays/KapiTooltip.js +91 -68
- package/dist/components/overlays/commandPaletteLogic.d.ts +2 -4
- package/dist/components/overlays/commandPaletteLogic.js +2 -2
- package/dist/components/overlays/dialogStore.d.ts +41 -20
- package/dist/components/overlays/dialogStore.js +4 -4
- package/dist/components/overlays/dialogUtils.d.ts +22 -0
- package/dist/components/overlays/dialogUtils.js +6 -2
- package/dist/components/overlays/index.d.ts +48 -38
- package/dist/components/overlays/menuButtonLogic.d.ts +33 -31
- package/dist/components/overlays/menuButtonLogic.js +9 -3
- package/dist/components/overlays/menuKeyboardLogic.d.ts +42 -8
- package/dist/components/overlays/menuKeyboardLogic.js +46 -15
- package/dist/components/overlays/menuList.d.ts +91 -0
- package/dist/components/overlays/menuList.js +223 -0
- package/dist/components/overlays/modalStack.d.ts +21 -0
- package/dist/components/overlays/modalStack.js +23 -0
- package/dist/components/overlays/offcanvasCompanion.d.ts +1 -1
- package/dist/components/overlays/offcanvasResize.d.ts +1 -1
- package/dist/components/overlays/offcanvasSide.d.ts +12 -1
- package/dist/components/overlays/offcanvasSide.js +4 -4
- package/dist/components/overlays/popoverLogic.d.ts +12 -12
- package/dist/components/overlays/useExitPresence.js +23 -22
- package/dist/components/overlays/useNativeDialog.d.ts +15 -4
- package/dist/components/overlays/useNativeDialog.js +52 -33
- package/dist/components/rootProps.d.ts +6 -4
- package/dist/components/tone.d.ts +55 -0
- package/dist/components/tone.js +92 -0
- package/dist/css/base.css +1 -0
- package/dist/css/components/chat/chat.css +1 -0
- package/dist/css/components/data/KapiBarChart.css +1 -0
- package/dist/css/components/data/KapiEventCalendar.css +1 -0
- package/dist/css/components/data/KapiHeatmap.css +1 -0
- package/dist/css/components/data/KapiLineChart.css +1 -0
- package/dist/css/components/data/KapiSparkline.css +1 -0
- package/dist/css/components/data/KapiTable.css +1 -0
- package/dist/css/components/data/KapiTableFilter.css +1 -0
- package/dist/css/components/display/KapiAnnotation.css +1 -0
- package/dist/css/components/display/KapiComment.css +1 -0
- package/dist/css/components/display/KapiFileItem.css +1 -0
- package/dist/css/components/display/KapiFileViewer.css +1 -0
- package/dist/css/components/display/KapiTruncate.css +1 -0
- package/dist/css/components/display/display.css +1 -0
- package/dist/css/components/feedback/KapiBulkBar.css +1 -0
- package/dist/css/components/feedback/KapiOfflineBanner.css +1 -0
- package/dist/css/components/feedback/KapiUnsavedBar.css +1 -0
- package/dist/css/components/feedback/feedback.css +1 -0
- package/dist/css/components/inputs/KapiAutocomplete.css +1 -0
- package/dist/css/components/inputs/KapiButton.css +1 -0
- package/dist/css/components/inputs/KapiChecklist.css +1 -0
- package/dist/css/components/inputs/KapiDatePicker.css +1 -0
- package/dist/css/components/inputs/KapiFacetedSearch.css +1 -0
- package/dist/css/components/inputs/KapiFileUpload.css +1 -0
- package/dist/css/components/inputs/KapiInputGroup.css +1 -0
- package/dist/css/components/inputs/KapiSearchChip.css +1 -0
- package/dist/css/components/inputs/KapiSelect.css +1 -0
- package/dist/css/components/inputs/KapiTagInput.css +1 -0
- package/dist/css/components/inputs/checkControl.css +1 -0
- package/dist/css/components/inputs/inputsExtra.css +1 -0
- package/dist/css/components/layout/KapiAccessCard.css +1 -0
- package/dist/css/components/layout/KapiAccountMenu.css +1 -0
- package/dist/css/components/layout/KapiCard.css +1 -0
- package/dist/css/components/layout/KapiDivider.css +1 -0
- package/dist/css/components/layout/KapiMasonry.css +1 -0
- package/dist/css/components/layout/KapiNotificationBell.css +1 -0
- package/dist/css/components/layout/KapiPageHeader.css +1 -0
- package/dist/css/components/layout/KapiPanelParts.css +1 -0
- package/dist/css/components/layout/KapiRail.css +1 -0
- package/dist/css/components/layout/KapiRoot.css +1 -0
- package/dist/css/components/layout/KapiScrollArea.css +1 -0
- package/dist/css/components/layout/layout-primitives.css +1 -0
- package/dist/css/components/navigation/KapiFilterChips.css +1 -0
- package/dist/css/components/navigation/KapiNavBadge.css +1 -0
- package/dist/css/components/navigation/KapiSteps.css +1 -0
- package/dist/css/components/navigation/navigation.css +1 -0
- package/dist/css/components/overlays/KapiCommandPalette.css +1 -0
- package/dist/css/components/overlays/KapiConfirm.css +1 -0
- package/dist/css/components/overlays/KapiModal.css +1 -0
- package/dist/css/components/overlays/KapiOffcanvas.css +1 -0
- package/dist/css/components/overlays/KapiPopover.css +1 -0
- package/dist/css/components/overlays/KapiSplitModal.css +1 -0
- package/dist/css/components/overlays/overlays.css +1 -0
- package/dist/css/none.js +1 -0
- package/dist/hooks/dataColorLogic.d.ts +1 -1
- package/dist/hooks/dateFormat.js +13 -13
- package/dist/hooks/directionLogic.d.ts +32 -0
- package/dist/hooks/directionLogic.js +7 -0
- package/dist/hooks/fieldErrorsLogic.d.ts +35 -0
- package/dist/hooks/fieldErrorsLogic.js +13 -0
- package/dist/hooks/focusLogic.js +8 -7
- package/dist/hooks/hotkeyLogic.d.ts +5 -1
- package/dist/hooks/hotkeyLogic.js +2 -2
- package/dist/hooks/index.d.ts +122 -57
- package/dist/hooks/kapiRoot.d.ts +11 -4
- package/dist/hooks/kapiRoot.js +18 -5
- package/dist/hooks/mergeRefs.d.ts +9 -0
- package/dist/hooks/mergeRefs.js +15 -0
- package/dist/hooks/onlineStatusLogic.d.ts +4 -4
- package/dist/hooks/ownerDocument.d.ts +26 -0
- package/dist/hooks/ownerDocument.js +24 -0
- package/dist/hooks/portalRoot.d.ts +19 -0
- package/dist/hooks/portalRoot.js +10 -0
- package/dist/hooks/rafThrottle.d.ts +12 -4
- package/dist/hooks/rafThrottle.js +43 -10
- package/dist/hooks/rangeSelectLogic.d.ts +47 -0
- package/dist/hooks/rangeSelectLogic.js +29 -0
- package/dist/hooks/recentLogic.d.ts +3 -3
- package/dist/hooks/reducedMotion.js +11 -3
- package/dist/hooks/rightClick.d.ts +5 -1
- package/dist/hooks/rightClick.js +16 -15
- package/dist/hooks/scrollCollapseLogic.d.ts +2 -2
- package/dist/hooks/seriesPaletteLogic.d.ts +1 -1
- package/dist/hooks/shallowStable.d.ts +12 -0
- package/dist/hooks/shallowStable.js +17 -0
- package/dist/hooks/slidingIndicatorLogic.d.ts +4 -0
- package/dist/hooks/themeColorsLogic.d.ts +1 -1
- package/dist/hooks/themeDeriveLogic.d.ts +1 -2
- package/dist/hooks/themeRadiiLogic.d.ts +1 -1
- package/dist/hooks/themeScript.d.ts +10 -0
- package/dist/hooks/themeScript.js +5 -0
- package/dist/hooks/useAsyncLoader.d.ts +51 -0
- package/dist/hooks/useAsyncLoader.js +77 -0
- package/dist/hooks/useAsyncTasks.d.ts +19 -0
- package/dist/hooks/useAsyncTasks.js +37 -0
- package/dist/hooks/useBottomBarInset.d.ts +7 -0
- package/dist/hooks/useBottomBarInset.js +25 -0
- package/dist/hooks/useControllableState.d.ts +21 -0
- package/dist/hooks/useControllableState.js +17 -0
- package/dist/hooks/useDismiss.d.ts +40 -0
- package/dist/hooks/useDismiss.js +42 -0
- package/dist/hooks/useDragScroll.d.ts +10 -0
- package/dist/hooks/useDragScroll.js +36 -25
- package/dist/hooks/useFieldErrors.d.ts +39 -0
- package/dist/hooks/useFieldErrors.js +29 -0
- package/dist/hooks/useFocusReturn.d.ts +25 -0
- package/dist/hooks/useFocusReturn.js +31 -0
- package/dist/hooks/useGrowOrigin.d.ts +2 -2
- package/dist/hooks/useHotkey.d.ts +3 -3
- package/dist/hooks/useHydrated.d.ts +2 -0
- package/dist/hooks/useHydrated.js +6 -0
- package/dist/hooks/useKapiTheme.d.ts +3 -2
- package/dist/hooks/useKapiTheme.js +111 -68
- package/dist/hooks/useMediaQuery.d.ts +5 -1
- package/dist/hooks/useMediaQuery.js +5 -9
- package/dist/hooks/useOnlineStatus.d.ts +1 -1
- package/dist/hooks/useOutsidePress.d.ts +9 -0
- package/dist/hooks/useOutsidePress.js +11 -0
- package/dist/hooks/usePersistentState.d.ts +2 -2
- package/dist/hooks/usePersistentState.js +21 -21
- package/dist/hooks/usePlacement.d.ts +6 -5
- package/dist/hooks/usePlacement.js +68 -65
- package/dist/hooks/useRangeSelect.d.ts +24 -0
- package/dist/hooks/useRangeSelect.js +26 -0
- package/dist/hooks/useRecent.d.ts +3 -3
- package/dist/hooks/useScrollCollapse.d.ts +1 -1
- package/dist/hooks/useScrollEdges.d.ts +9 -8
- package/dist/hooks/useScrollEdges.js +62 -57
- package/dist/hooks/useSlidingIndicator.d.ts +1 -1
- package/dist/hooks/useSlidingIndicator.js +38 -33
- package/dist/hooks/useSubmitDraft.js +18 -19
- package/dist/hooks/useTypeahead.d.ts +9 -0
- package/dist/hooks/useTypeahead.js +20 -0
- package/dist/hooks/useUnsavedGuard.d.ts +7 -4
- package/dist/hooks/useUnsavedGuard.js +1 -0
- package/dist/hooks/useVirtualList.d.ts +36 -0
- package/dist/hooks/useVirtualList.js +126 -0
- package/dist/hooks/viewportInsetLogic.d.ts +37 -0
- package/dist/hooks/viewportInsetLogic.js +20 -0
- package/dist/hooks/virtualListLogic.d.ts +88 -0
- package/dist/hooks/virtualListLogic.js +80 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +196 -179
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/package.json +14 -6
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/layout/KapiNotificationBell.css";
|
|
2
3
|
import { assignRef as e, focusLeaves as t } from "../inputs/fieldLogic.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
4
|
+
import { useKapiFormatLocale as n, useLabels as r } from "../locale/KapiLocaleProvider.js";
|
|
5
|
+
import { joinClasses as i } from "../rootProps.js";
|
|
6
|
+
import { focusedMenuIndex as a, menuKeyIntent as o, nextEnabledIndex as ee } from "../overlays/menuKeyboardLogic.js";
|
|
7
|
+
import { useControllableState as s } from "../../hooks/useControllableState.js";
|
|
8
|
+
import { activeElementOf as te } from "../../hooks/ownerDocument.js";
|
|
9
|
+
import { resolveKapiRoot as c } from "../../hooks/kapiRoot.js";
|
|
10
|
+
import { usePlacement as l } from "../../hooks/usePlacement.js";
|
|
11
|
+
import { useDismiss as u } from "../../hooks/useDismiss.js";
|
|
12
|
+
import { KapiOverlayPortal as ne } from "../overlays/overlayPortal.js";
|
|
13
|
+
import { formatRelativeTime as re } from "../../hooks/dateFormat.js";
|
|
14
|
+
import { NOTIFICATION_BELL_PLACEMENT as ie, badgeText as ae, bellTriggerLabel as d, notificationDateTime as f, unreadCount as p } from "./notificationBellLogic.js";
|
|
12
15
|
/* empty css */
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import {
|
|
15
|
-
import { Bell as
|
|
16
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
17
|
+
import { useEffect as oe, useId as _, useLayoutEffect as v, useRef as y, useState as b } from "react";
|
|
18
|
+
import { Bell as x } from "lucide-react";
|
|
16
19
|
//#region src/components/layout/KapiNotificationBell.tsx
|
|
17
|
-
var
|
|
20
|
+
var S = {
|
|
18
21
|
title: "Notificaciones",
|
|
19
22
|
unread: "sin leer",
|
|
20
23
|
unreadItem: "Sin leer",
|
|
@@ -22,170 +25,164 @@ var y = {
|
|
|
22
25
|
viewAll: "Ver todas",
|
|
23
26
|
empty: "No tienes notificaciones",
|
|
24
27
|
loading: "Cargando notificaciones…"
|
|
25
|
-
},
|
|
26
|
-
function
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
open: H,
|
|
37
|
-
enabled: !!q,
|
|
38
|
-
anchor: G,
|
|
39
|
-
floatingRef: K,
|
|
28
|
+
}, C = "[data-menu-index]", w = (e) => (e?.querySelector(C) ?? e)?.focus();
|
|
29
|
+
function T({ items: T, onItemSelect: se, onMarkAllRead: E, onViewAll: D, loading: O = !1, emptyMessage: k, max: A = 9, open: j, defaultOpen: M = !1, onOpenChange: N, labels: P, now: F, ref: I, className: L, onClick: R, "aria-label": z, ...B }) {
|
|
30
|
+
let V = r("notificationBell", S, P), H = n(), [U, W] = s(j, M, N), G = _(), K = _(), q = y(null), J = y(null), [Y, ce] = b(null);
|
|
31
|
+
v(() => {
|
|
32
|
+
ce(U ? c(q.current) : null);
|
|
33
|
+
}, [U]);
|
|
34
|
+
let { style: le } = l({
|
|
35
|
+
open: U,
|
|
36
|
+
enabled: !!Y,
|
|
37
|
+
anchor: q,
|
|
38
|
+
floatingRef: J,
|
|
40
39
|
hideUntilPlaced: !1,
|
|
41
|
-
...
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
40
|
+
...ie
|
|
41
|
+
}), ue = () => Array.from(J.current?.querySelectorAll(C) ?? []), de = () => w(J.current);
|
|
42
|
+
oe(() => {
|
|
43
|
+
U && Y && w(J.current);
|
|
44
|
+
}, [U, Y]);
|
|
45
|
+
let X = u(U, {
|
|
46
|
+
zones: [J, q],
|
|
47
|
+
onDismiss: (e) => {
|
|
48
|
+
W(!1), e === "escape" && q.current?.focus();
|
|
49
|
+
}
|
|
50
|
+
}), Z = () => {
|
|
51
|
+
W(!1), q.current?.focus();
|
|
52
|
+
}, Q = p(T), $ = ae(Q, A), fe = (e) => {
|
|
53
|
+
R?.(e), !e.defaultPrevented && W(!U);
|
|
54
|
+
}, pe = (e) => {
|
|
55
|
+
let t = o(e.key);
|
|
56
|
+
if (t.kind !== "move") return X(e);
|
|
57
|
+
let n = ue();
|
|
58
|
+
n.length !== 0 && (e.preventDefault(), n[ee(a(te(e.currentTarget)), t.dir, n.map((e, t) => t))]?.focus());
|
|
60
59
|
}, me = (e) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, ge = () => {
|
|
68
|
-
C?.(), pe();
|
|
69
|
-
}, _e = M ?? /* @__PURE__ */ new Date();
|
|
70
|
-
return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("button", {
|
|
71
|
-
...L,
|
|
60
|
+
t(e.relatedTarget, J.current, q.current) && e.relatedTarget && W(!1);
|
|
61
|
+
}, he = () => {
|
|
62
|
+
E?.(), de();
|
|
63
|
+
}, ge = F ?? /* @__PURE__ */ new Date();
|
|
64
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("button", {
|
|
65
|
+
...B,
|
|
72
66
|
ref: (t) => {
|
|
73
|
-
|
|
67
|
+
q.current = t, e(I, t);
|
|
74
68
|
},
|
|
75
69
|
type: "button",
|
|
76
|
-
className:
|
|
77
|
-
"aria-label":
|
|
70
|
+
className: i("kapi-bell", L),
|
|
71
|
+
"aria-label": z ?? d(V.title, Q, V.unread),
|
|
78
72
|
"aria-haspopup": "dialog",
|
|
79
|
-
"aria-expanded":
|
|
80
|
-
"aria-controls":
|
|
81
|
-
onClick:
|
|
82
|
-
|
|
73
|
+
"aria-expanded": U,
|
|
74
|
+
"aria-controls": U ? G : void 0,
|
|
75
|
+
onClick: fe,
|
|
76
|
+
onKeyDown: (e) => {
|
|
77
|
+
B.onKeyDown?.(e), X(e);
|
|
78
|
+
},
|
|
79
|
+
children: [/* @__PURE__ */ h(x, {
|
|
83
80
|
size: 20,
|
|
84
81
|
strokeWidth: 1.8,
|
|
85
82
|
"aria-hidden": "true"
|
|
86
|
-
}),
|
|
83
|
+
}), $ && /* @__PURE__ */ h("span", {
|
|
87
84
|
className: "kapi-bell__badge",
|
|
88
85
|
"aria-hidden": "true",
|
|
89
|
-
children:
|
|
86
|
+
children: $
|
|
90
87
|
})]
|
|
91
|
-
}),
|
|
92
|
-
root:
|
|
93
|
-
children: /* @__PURE__ */
|
|
94
|
-
ref:
|
|
95
|
-
id:
|
|
88
|
+
}), U && /* @__PURE__ */ h(ne, {
|
|
89
|
+
root: Y,
|
|
90
|
+
children: /* @__PURE__ */ g("div", {
|
|
91
|
+
ref: J,
|
|
92
|
+
id: G,
|
|
96
93
|
role: "dialog",
|
|
97
|
-
"aria-labelledby":
|
|
94
|
+
"aria-labelledby": K,
|
|
98
95
|
tabIndex: -1,
|
|
99
96
|
className: "kapi-bell__panel",
|
|
100
|
-
style:
|
|
101
|
-
onKeyDown:
|
|
102
|
-
onBlur:
|
|
97
|
+
style: le,
|
|
98
|
+
onKeyDown: pe,
|
|
99
|
+
onBlur: me,
|
|
103
100
|
children: [
|
|
104
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ g("div", {
|
|
105
102
|
className: "kapi-bell__head",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
-
id:
|
|
103
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
104
|
+
id: K,
|
|
108
105
|
className: "kapi-bell__title",
|
|
109
|
-
children:
|
|
110
|
-
}),
|
|
106
|
+
children: V.title
|
|
107
|
+
}), E && Q > 0 && !O && /* @__PURE__ */ h("button", {
|
|
111
108
|
type: "button",
|
|
112
109
|
className: "kapi-bell__link",
|
|
113
|
-
onClick:
|
|
114
|
-
children:
|
|
110
|
+
onClick: he,
|
|
111
|
+
children: V.markAllRead
|
|
115
112
|
})]
|
|
116
113
|
}),
|
|
117
|
-
|
|
114
|
+
O ? /* @__PURE__ */ g("div", {
|
|
118
115
|
className: "kapi-bell__state",
|
|
119
116
|
role: "status",
|
|
120
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ h("span", {
|
|
121
118
|
className: "kapi-spinner kapi-spinner--sm",
|
|
122
119
|
"aria-hidden": "true"
|
|
123
|
-
}),
|
|
124
|
-
}) :
|
|
120
|
+
}), V.loading]
|
|
121
|
+
}) : T.length === 0 ? /* @__PURE__ */ h("div", {
|
|
125
122
|
className: "kapi-bell__state",
|
|
126
|
-
children:
|
|
127
|
-
}) : /* @__PURE__ */
|
|
123
|
+
children: k ?? V.empty
|
|
124
|
+
}) : /* @__PURE__ */ h("ul", {
|
|
128
125
|
className: "kapi-bell__list",
|
|
129
|
-
"aria-labelledby":
|
|
130
|
-
children:
|
|
131
|
-
let n = e.date === void 0 ? null :
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
e.icon && /* @__PURE__ */
|
|
126
|
+
"aria-labelledby": K,
|
|
127
|
+
children: T.map((e, t) => {
|
|
128
|
+
let n = e.date === void 0 ? null : f(e.date), r = (t) => {
|
|
129
|
+
se?.(e, t), Z();
|
|
130
|
+
}, a = /* @__PURE__ */ g(m, { children: [
|
|
131
|
+
e.icon && /* @__PURE__ */ h("span", {
|
|
135
132
|
className: "kapi-bell__icon",
|
|
136
133
|
"aria-hidden": "true",
|
|
137
134
|
children: e.icon
|
|
138
135
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ g("span", {
|
|
140
137
|
className: "kapi-bell__body",
|
|
141
138
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ h("span", {
|
|
143
140
|
className: "kapi-bell__itemtitle",
|
|
144
141
|
children: e.title
|
|
145
142
|
}),
|
|
146
|
-
e.description && /* @__PURE__ */
|
|
143
|
+
e.description && /* @__PURE__ */ h("span", {
|
|
147
144
|
className: "kapi-bell__desc",
|
|
148
145
|
children: e.description
|
|
149
146
|
}),
|
|
150
|
-
n !== null && /* @__PURE__ */
|
|
147
|
+
n !== null && /* @__PURE__ */ h("time", {
|
|
151
148
|
className: "kapi-bell__date",
|
|
152
149
|
dateTime: n,
|
|
153
|
-
children:
|
|
150
|
+
children: re(e.date, ge, H)
|
|
154
151
|
})
|
|
155
152
|
]
|
|
156
153
|
}),
|
|
157
|
-
!e.read && /* @__PURE__ */
|
|
154
|
+
!e.read && /* @__PURE__ */ h("span", {
|
|
158
155
|
className: "kapi-bell__dot",
|
|
159
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ h("span", {
|
|
160
157
|
className: "kapi-bell__sr",
|
|
161
|
-
children:
|
|
158
|
+
children: V.unreadItem
|
|
162
159
|
})
|
|
163
160
|
})
|
|
164
|
-
] }),
|
|
165
|
-
className:
|
|
161
|
+
] }), o = {
|
|
162
|
+
className: i("kapi-bell__item", !e.read && "is-unread"),
|
|
166
163
|
"data-menu-index": t,
|
|
167
164
|
onClick: r
|
|
168
165
|
};
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
...
|
|
166
|
+
return /* @__PURE__ */ h("li", { children: e.href ? /* @__PURE__ */ h("a", {
|
|
167
|
+
...o,
|
|
171
168
|
href: e.href,
|
|
172
|
-
children:
|
|
173
|
-
}) : /* @__PURE__ */
|
|
174
|
-
...
|
|
169
|
+
children: a
|
|
170
|
+
}) : /* @__PURE__ */ h("button", {
|
|
171
|
+
...o,
|
|
175
172
|
type: "button",
|
|
176
|
-
children:
|
|
173
|
+
children: a
|
|
177
174
|
}) }, e.id);
|
|
178
175
|
})
|
|
179
176
|
}),
|
|
180
|
-
|
|
177
|
+
D && /* @__PURE__ */ h("div", {
|
|
181
178
|
className: "kapi-bell__foot",
|
|
182
|
-
children: /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ h("button", {
|
|
183
180
|
type: "button",
|
|
184
181
|
className: "kapi-bell__link",
|
|
185
182
|
onClick: () => {
|
|
186
|
-
|
|
183
|
+
D(), Z();
|
|
187
184
|
},
|
|
188
|
-
children:
|
|
185
|
+
children: V.viewAll
|
|
189
186
|
})
|
|
190
187
|
})
|
|
191
188
|
]
|
|
@@ -193,4 +190,4 @@ function S({ items: S, onItemSelect: le, onMarkAllRead: C, onViewAll: w, loading
|
|
|
193
190
|
})] });
|
|
194
191
|
}
|
|
195
192
|
//#endregion
|
|
196
|
-
export {
|
|
193
|
+
export { S as DEFAULT_NOTIFICATION_BELL_LABELS, T as KapiNotificationBell };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
1
2
|
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import "
|
|
3
|
+
import { type KapiBreadcrumbItem } from "../navigation/KapiBreadcrumb.js";
|
|
3
4
|
/** Atributos nativos (`id`, `style`, `data-*`…) van al `<header>` (no al centinela de scroll). */
|
|
4
5
|
export type KapiPageHeaderProps = Omit<HTMLAttributes<HTMLElement>, "title" | "children"> & {
|
|
6
|
+
/** Ref al `<header>` raíz. */
|
|
7
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
5
8
|
/** Título de la página (`<h1>`). */
|
|
6
9
|
title: ReactNode;
|
|
7
10
|
/** Texto secundario bajo el título. */
|
|
@@ -12,17 +15,22 @@ export type KapiPageHeaderProps = Omit<HTMLAttributes<HTMLElement>, "title" | "c
|
|
|
12
15
|
actions?: ReactNode;
|
|
13
16
|
/** Etiqueta/estado inline junto al título. */
|
|
14
17
|
chip?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Migas de pan arriba del título, dibujadas con `KapiBreadcrumb` (el último ítem es la página
|
|
20
|
+
* actual). Vacío u omitido: no se dibuja nada. Se ocultan con la cabecera colapsada.
|
|
21
|
+
*/
|
|
22
|
+
breadcrumbs?: readonly KapiBreadcrumbItem[] | undefined;
|
|
15
23
|
/** Se reduce a una barra compacta al scrollear. */
|
|
16
|
-
collapseOnScroll?: boolean;
|
|
24
|
+
collapseOnScroll?: boolean | undefined;
|
|
17
25
|
/** `position: sticky; top: 0`. */
|
|
18
|
-
sticky?: boolean;
|
|
26
|
+
sticky?: boolean | undefined;
|
|
19
27
|
/** Contenedor con scroll (default: viewport). */
|
|
20
|
-
scrollRoot?: Element | null;
|
|
28
|
+
scrollRoot?: Element | null | undefined;
|
|
21
29
|
/**
|
|
22
30
|
* Se adapta al ancho de su contenedor (container queries, `container: kapi-pageheader`): bajo
|
|
23
31
|
* 560px las acciones pasan debajo del título y el título se achica. Default `true`.
|
|
24
32
|
*/
|
|
25
|
-
responsive?: boolean;
|
|
33
|
+
responsive?: boolean | undefined;
|
|
26
34
|
};
|
|
27
35
|
/** Cabecera de página que colapsa a barra sticky compacta al hacer scroll. */
|
|
28
|
-
export declare function KapiPageHeader({ title, subtitle, meta, actions, chip, collapseOnScroll, sticky, scrollRoot, responsive, className, ...rest }: KapiPageHeaderProps): import("react").JSX.Element;
|
|
36
|
+
export declare function KapiPageHeader({ title, subtitle, meta, actions, chip, breadcrumbs, collapseOnScroll, sticky, scrollRoot, responsive, className, ref, ...rest }: KapiPageHeaderProps): import("react").JSX.Element;
|
|
@@ -1,150 +1,162 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import "#kapi-css/components/layout/KapiPageHeader.css";
|
|
3
|
+
import "#kapi-css/components/navigation/navigation.css";
|
|
4
|
+
import { computedStyleOf as e, docOf as t } from "../../hooks/ownerDocument.js";
|
|
5
|
+
import { useMergedRefs as n } from "../../hooks/mergeRefs.js";
|
|
6
|
+
import { prefersReducedMotion as r } from "../../hooks/reducedMotion.js";
|
|
7
|
+
import { maxTransitionMs as i } from "../overlays/dialogUtils.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
import { KapiBreadcrumb as a } from "../navigation/KapiBreadcrumb.js";
|
|
10
|
+
import { useReopenBus as o } from "./reopenBus.js";
|
|
11
|
+
import { useScrollCollapse as s } from "../../hooks/useScrollCollapse.js";
|
|
12
|
+
import { pageHeaderBox as c } from "./pageHeaderLogic.js";
|
|
7
13
|
/* empty css */
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { ChevronsLeft as
|
|
14
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
15
|
+
import { useEffect as f, useLayoutEffect as p, useRef as m } from "react";
|
|
16
|
+
import { ChevronsLeft as h, ChevronsRight as g } from "lucide-react";
|
|
11
17
|
//#region src/components/layout/KapiPageHeader.tsx
|
|
12
|
-
var
|
|
18
|
+
var _ = "kapi-pageheader--collapsed", v = "kapi-pageheader--animating", y = "kapi-pageheader--measuring", b = 80, x = (e, t) => {
|
|
13
19
|
let n = e.style.height;
|
|
14
|
-
e.classList.add(
|
|
20
|
+
e.classList.add(y), e.style.height = "", e.classList.toggle(_, !1);
|
|
15
21
|
let r = e.getBoundingClientRect().height;
|
|
16
|
-
e.classList.toggle(
|
|
22
|
+
e.classList.toggle(_, !0);
|
|
17
23
|
let i = e.getBoundingClientRect().height;
|
|
18
|
-
return e.classList.toggle(
|
|
24
|
+
return e.classList.toggle(_, t), e.style.height = n, e.getBoundingClientRect(), e.classList.remove(y), {
|
|
19
25
|
expanded: r,
|
|
20
26
|
collapsed: i
|
|
21
27
|
};
|
|
22
|
-
},
|
|
23
|
-
let n =
|
|
28
|
+
}, S = (e, t) => {
|
|
29
|
+
let n = c(e, t);
|
|
24
30
|
return t ? n : {
|
|
25
31
|
height: null,
|
|
26
32
|
reserve: n.reserve
|
|
27
33
|
};
|
|
28
|
-
},
|
|
34
|
+
}, C = (e, t, n) => {
|
|
29
35
|
let r = () => {
|
|
30
36
|
t.height === null ? e.style.removeProperty("height") : e.style.height = `${t.height}px`, e.style.setProperty("--kapi-pageheader-reserve", `${t.reserve}px`);
|
|
31
37
|
};
|
|
32
38
|
n ? r() : (e.style.transition = "none", r(), e.getBoundingClientRect(), e.style.transition = "");
|
|
33
39
|
};
|
|
34
|
-
function
|
|
35
|
-
let { collapsed:
|
|
40
|
+
function w({ title: _, subtitle: y, meta: w, actions: T, chip: E, breadcrumbs: D, collapseOnScroll: O = !0, sticky: k = !0, scrollRoot: A = null, responsive: j = !0, className: M, ref: N, ...P }) {
|
|
41
|
+
let { collapsed: F, sentinelRef: I } = s({ root: A }), L = O && F, R = m(null), z = n(R, N), B = m({
|
|
36
42
|
expanded: 0,
|
|
37
43
|
collapsed: 0
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
let e =
|
|
44
|
+
}), V = m(L);
|
|
45
|
+
V.current = L;
|
|
46
|
+
let H = m(!1), U = m(!1);
|
|
47
|
+
p(() => {
|
|
48
|
+
let e = R.current;
|
|
43
49
|
if (!e) return;
|
|
44
|
-
let
|
|
45
|
-
|
|
50
|
+
let n = () => {
|
|
51
|
+
U.current || (B.current = x(e, V.current), C(e, S(B.current, V.current), !1));
|
|
46
52
|
};
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
if (
|
|
50
|
-
|
|
53
|
+
n();
|
|
54
|
+
let r = !0;
|
|
55
|
+
if (t(e)?.fonts?.ready.then(() => {
|
|
56
|
+
r && n();
|
|
51
57
|
}), typeof ResizeObserver > "u") return () => {
|
|
52
|
-
|
|
58
|
+
r = !1;
|
|
53
59
|
};
|
|
54
|
-
let
|
|
55
|
-
let
|
|
56
|
-
if (!
|
|
57
|
-
let
|
|
58
|
-
|
|
60
|
+
let i = e.getBoundingClientRect().width, a = new ResizeObserver((e) => {
|
|
61
|
+
let t = e[e.length - 1];
|
|
62
|
+
if (!t) return;
|
|
63
|
+
let r = t.borderBoxSize?.[0]?.inlineSize ?? t.contentRect.width;
|
|
64
|
+
r !== i && (i = r, n());
|
|
59
65
|
});
|
|
60
|
-
return
|
|
61
|
-
|
|
66
|
+
return a.observe(e), () => {
|
|
67
|
+
r = !1, a.disconnect();
|
|
62
68
|
};
|
|
63
69
|
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
_,
|
|
71
|
+
y,
|
|
72
|
+
w,
|
|
73
|
+
T,
|
|
74
|
+
E,
|
|
75
|
+
D,
|
|
76
|
+
O,
|
|
77
|
+
j
|
|
78
|
+
]), p(() => {
|
|
79
|
+
let t = R.current;
|
|
80
|
+
if (!t) return;
|
|
81
|
+
let { expanded: n } = B.current, a = c(B.current, L), o = H.current && !r(t);
|
|
82
|
+
H.current = !0;
|
|
76
83
|
let s = () => {
|
|
77
|
-
|
|
84
|
+
U.current = !1, t.classList.remove(v), L || t.style.removeProperty("height");
|
|
78
85
|
};
|
|
79
86
|
if (!o) {
|
|
80
|
-
|
|
87
|
+
C(t, S(B.current, L), !1);
|
|
81
88
|
return;
|
|
82
89
|
}
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
e.target ===
|
|
90
|
+
t.style.height === "" && n > 0 && (t.style.height = `${n}px`, t.getBoundingClientRect()), U.current = !0, t.classList.add(v), C(t, a, !0);
|
|
91
|
+
let l = (e) => {
|
|
92
|
+
e.target === t && e.propertyName === "height" && s();
|
|
86
93
|
};
|
|
87
|
-
|
|
88
|
-
let
|
|
94
|
+
t.addEventListener("transitionend", l);
|
|
95
|
+
let u = e(t), d = window.setTimeout(s, i(u.transitionDuration, u.transitionDelay) + b);
|
|
89
96
|
return () => {
|
|
90
|
-
|
|
97
|
+
t.removeEventListener("transitionend", l), window.clearTimeout(d);
|
|
91
98
|
};
|
|
92
|
-
}, [
|
|
93
|
-
let
|
|
99
|
+
}, [L]);
|
|
100
|
+
let W = [
|
|
94
101
|
"kapi-pageheader",
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
].filter(Boolean).join(" "),
|
|
100
|
-
|
|
101
|
-
let
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
-
ref:
|
|
102
|
+
k && "kapi-pageheader--sticky",
|
|
103
|
+
j && "kapi-pageheader--cq",
|
|
104
|
+
L && "kapi-pageheader--collapsed",
|
|
105
|
+
M
|
|
106
|
+
].filter(Boolean).join(" "), G = o(), K = G?.addHost;
|
|
107
|
+
f(() => K?.(), [K]);
|
|
108
|
+
let q = G?.info ?? null, J = q?.side === "right" ? h : g;
|
|
109
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
110
|
+
ref: I,
|
|
104
111
|
className: "kapi-pageheader__sentinel",
|
|
105
112
|
"aria-hidden": !0
|
|
106
|
-
}), /* @__PURE__ */
|
|
107
|
-
...
|
|
108
|
-
ref:
|
|
109
|
-
className:
|
|
113
|
+
}), /* @__PURE__ */ d("header", {
|
|
114
|
+
...P,
|
|
115
|
+
ref: z,
|
|
116
|
+
className: W,
|
|
110
117
|
children: [
|
|
111
|
-
|
|
118
|
+
q && /* @__PURE__ */ u("button", {
|
|
112
119
|
type: "button",
|
|
113
120
|
className: "kapi-paneltoggle kapi-pageheader__reopen",
|
|
114
|
-
onClick:
|
|
115
|
-
"aria-label":
|
|
116
|
-
children: /* @__PURE__ */
|
|
121
|
+
onClick: q.expand,
|
|
122
|
+
"aria-label": q.label,
|
|
123
|
+
children: /* @__PURE__ */ u(J, {
|
|
124
|
+
className: "kapi-flip-rtl",
|
|
117
125
|
size: 16,
|
|
118
126
|
strokeWidth: 2,
|
|
119
127
|
"aria-hidden": "true"
|
|
120
128
|
})
|
|
121
129
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ d("div", {
|
|
123
131
|
className: "kapi-pageheader__main",
|
|
124
132
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
133
|
+
D && D.length > 0 && /* @__PURE__ */ u(a, {
|
|
134
|
+
className: "kapi-pageheader__breadcrumb",
|
|
135
|
+
items: D
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ d("div", {
|
|
126
138
|
className: "kapi-pageheader__titlerow",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ u("h1", {
|
|
128
140
|
className: "kapi-pageheader__title",
|
|
129
|
-
children:
|
|
130
|
-
}),
|
|
141
|
+
children: _
|
|
142
|
+
}), E]
|
|
131
143
|
}),
|
|
132
|
-
|
|
144
|
+
y && /* @__PURE__ */ u("div", {
|
|
133
145
|
className: "kapi-pageheader__subtitle",
|
|
134
|
-
children:
|
|
146
|
+
children: y
|
|
135
147
|
}),
|
|
136
|
-
|
|
148
|
+
w && /* @__PURE__ */ u("div", {
|
|
137
149
|
className: "kapi-pageheader__meta",
|
|
138
|
-
children:
|
|
150
|
+
children: w
|
|
139
151
|
})
|
|
140
152
|
]
|
|
141
153
|
}),
|
|
142
|
-
|
|
154
|
+
T && /* @__PURE__ */ u("div", {
|
|
143
155
|
className: "kapi-pageheader__actions",
|
|
144
|
-
children:
|
|
156
|
+
children: T
|
|
145
157
|
})
|
|
146
158
|
]
|
|
147
159
|
})] });
|
|
148
160
|
}
|
|
149
161
|
//#endregion
|
|
150
|
-
export {
|
|
162
|
+
export { w as KapiPageHeader };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { type KapiNavBadgeValue } from "../navigation/navBadgeLogic";
|
|
2
|
-
import type {
|
|
3
|
-
import type { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from "react";
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { type KapiNavBadgeValue } from "../navigation/navBadgeLogic.js";
|
|
2
|
+
import type { KapiTone } from "../tone.js";
|
|
3
|
+
import type { ButtonHTMLAttributes, HTMLAttributes, ReactNode, Ref } from "react";
|
|
4
|
+
type DivProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
/** Ref al `<div>` raíz. */
|
|
6
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
7
|
+
};
|
|
6
8
|
/** Etiqueta de sección dentro del panel (mayúsculas chicas). Atributos nativos al `<div>`. */
|
|
7
9
|
export declare const KapiPanelLabel: ({ className, ...rest }: DivProps) => import("react").JSX.Element;
|
|
8
10
|
/** Separador del panel. Atributos nativos al `<div>`. */
|
|
@@ -15,14 +17,16 @@ export declare const KapiPanelList: ({ children, ...rest }: Omit<DivProps, "chil
|
|
|
15
17
|
children: ReactNode;
|
|
16
18
|
}) => import("react").JSX.Element;
|
|
17
19
|
export type KapiPanelItemProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
20
|
+
/** Ref al `<button>` del ítem. */
|
|
21
|
+
ref?: Ref<HTMLButtonElement> | undefined;
|
|
18
22
|
/** Marca el ítem actual (resaltado y `aria-current="page"`). */
|
|
19
|
-
active?: boolean;
|
|
23
|
+
active?: boolean | undefined;
|
|
20
24
|
/** Contenido a la derecha (badge, contador…). */
|
|
21
25
|
trailing?: ReactNode;
|
|
22
26
|
/** Aviso de atención al final: contador (0 no dibuja nada; tope "999+") o `"dot"` sin número. */
|
|
23
27
|
badge?: KapiNavBadgeValue | undefined;
|
|
24
28
|
/** Color del aviso, como `KapiBadge` (`danger` para vencidos…). @default "primary" */
|
|
25
|
-
badgeTone?:
|
|
29
|
+
badgeTone?: KapiTone | undefined;
|
|
26
30
|
/** Texto accesible del aviso (p. ej. "3 trámites vencidos"); sin él se lee el número. */
|
|
27
31
|
badgeLabel?: string | undefined;
|
|
28
32
|
/** Ícono decorativo antes del texto (va en un contenedor `aria-hidden`). */
|