@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,84 +1,87 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { winOf as e } from "./ownerDocument.js";
|
|
3
|
+
import { placePopover as t, samePlacement as n } from "../components/overlays/popoverLogic.js";
|
|
4
|
+
import { onViewportChange as r } from "./rafThrottle.js";
|
|
5
|
+
import { placementViewport as i } from "./viewportInsetLogic.js";
|
|
6
|
+
import { directionOf as a } from "./directionLogic.js";
|
|
7
|
+
import { useCallback as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
|
|
5
8
|
//#region src/hooks/usePlacement.ts
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let [
|
|
9
|
-
anchor:
|
|
10
|
-
floatingRef:
|
|
11
|
-
estimate:
|
|
12
|
-
measure:
|
|
13
|
-
place:
|
|
9
|
+
var u = (e) => typeof e == "object" ? `max:${e.max}` : String(e);
|
|
10
|
+
function d({ open: d, enabled: f = !0, anchor: p, floatingRef: m, estimate: h, measure: g = !0, hideUntilPlaced: _ = !0, ...v }) {
|
|
11
|
+
let [y, b] = l(null), x = c({
|
|
12
|
+
anchor: p,
|
|
13
|
+
floatingRef: m,
|
|
14
|
+
estimate: h,
|
|
15
|
+
measure: g,
|
|
16
|
+
place: v
|
|
14
17
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
anchor:
|
|
18
|
-
floatingRef:
|
|
19
|
-
estimate:
|
|
20
|
-
measure:
|
|
21
|
-
place:
|
|
18
|
+
s(() => {
|
|
19
|
+
x.current = {
|
|
20
|
+
anchor: p,
|
|
21
|
+
floatingRef: m,
|
|
22
|
+
estimate: h,
|
|
23
|
+
measure: g,
|
|
24
|
+
place: v
|
|
22
25
|
};
|
|
23
26
|
});
|
|
24
|
-
let
|
|
25
|
-
let { anchor:
|
|
26
|
-
if (typeof
|
|
27
|
-
else if (
|
|
27
|
+
let S = o(() => {
|
|
28
|
+
let { anchor: e, floatingRef: r, estimate: o, measure: s, place: c } = x.current, l;
|
|
29
|
+
if (typeof e == "function") l = e();
|
|
30
|
+
else if (e.current) l = e.current.getBoundingClientRect();
|
|
28
31
|
else return;
|
|
29
|
-
let
|
|
30
|
-
width:
|
|
31
|
-
height:
|
|
32
|
-
} : null,
|
|
32
|
+
let u = r.current, d = s && u ? {
|
|
33
|
+
width: u.offsetWidth,
|
|
34
|
+
height: u.offsetHeight
|
|
35
|
+
} : null, f = d && (d.width > 0 || d.height > 0 || !o) ? d : o ?? {
|
|
33
36
|
width: 0,
|
|
34
37
|
height: 0
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
}, []),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
String(
|
|
46
|
-
String(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
}, p = c.dir ?? a(typeof e == "function" ? u : e.current), m = typeof e == "function" ? u : e.current, h = t(l, f, i(m), {
|
|
39
|
+
...c,
|
|
40
|
+
dir: p
|
|
41
|
+
});
|
|
42
|
+
b((e) => n(e, h) ? e : h);
|
|
43
|
+
}, []), C = [
|
|
44
|
+
v.side,
|
|
45
|
+
v.align,
|
|
46
|
+
v.offset,
|
|
47
|
+
v.margin,
|
|
48
|
+
String(v.flip),
|
|
49
|
+
String(v.shift),
|
|
50
|
+
v.mainMin,
|
|
51
|
+
u(v.width),
|
|
52
|
+
v.dir,
|
|
53
|
+
v.fallback?.x,
|
|
54
|
+
v.fallback?.y,
|
|
55
|
+
h?.width,
|
|
56
|
+
h?.height,
|
|
57
|
+
g
|
|
55
58
|
].join("|");
|
|
56
|
-
return
|
|
57
|
-
if (!
|
|
58
|
-
|
|
59
|
+
return s(() => {
|
|
60
|
+
if (!d || !f) {
|
|
61
|
+
b(null);
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
61
|
-
|
|
62
|
-
let e =
|
|
63
|
-
return
|
|
64
|
-
|
|
64
|
+
S();
|
|
65
|
+
let { anchor: t, floatingRef: n } = x.current, i = e(typeof t == "function" ? n.current : t.current), a = r(S, i ? { target: i } : {}), o = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => S());
|
|
66
|
+
return n.current && o?.observe(n.current), typeof t != "function" && t.current && o?.observe(t.current), () => {
|
|
67
|
+
a(), o?.disconnect();
|
|
65
68
|
};
|
|
66
69
|
}, [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
d,
|
|
71
|
+
f,
|
|
72
|
+
C,
|
|
73
|
+
S
|
|
71
74
|
]), {
|
|
72
|
-
placement:
|
|
75
|
+
placement: y,
|
|
73
76
|
style: {
|
|
74
|
-
top:
|
|
75
|
-
left:
|
|
76
|
-
width:
|
|
77
|
-
minWidth:
|
|
78
|
-
visibility:
|
|
77
|
+
top: y?.top ?? 0,
|
|
78
|
+
left: y?.left ?? 0,
|
|
79
|
+
width: y?.width,
|
|
80
|
+
minWidth: y?.minWidth,
|
|
81
|
+
visibility: y || !_ ? void 0 : "hidden"
|
|
79
82
|
},
|
|
80
|
-
update:
|
|
83
|
+
update: S
|
|
81
84
|
};
|
|
82
85
|
}
|
|
83
86
|
//#endregion
|
|
84
|
-
export {
|
|
87
|
+
export { d as usePlacement };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type KapiRangeToggleInput } from "./rangeSelectLogic.js";
|
|
2
|
+
/** Lo que devuelve `useRangeSelect`. */
|
|
3
|
+
export type UseRangeSelectResult<K> = {
|
|
4
|
+
/** Alterna `target` (con `shift`, el tramo desde el ancla) y devuelve la selección nueva. */
|
|
5
|
+
toggle: (input: Omit<KapiRangeToggleInput<K>, "anchor">) => Set<K>;
|
|
6
|
+
/** Marca el tramo ancla → `target` (Shift + flechas). Sin ancla, el ancla pasa a ser `from`. */
|
|
7
|
+
extend: (input: Omit<KapiRangeToggleInput<K>, "anchor" | "shift"> & {
|
|
8
|
+
/** Elemento activo antes de moverse; ancla si todavía no había. */
|
|
9
|
+
from: K;
|
|
10
|
+
}) => Set<K>;
|
|
11
|
+
/** Ancla actual (`null` si no hay). */
|
|
12
|
+
anchor: () => K | null;
|
|
13
|
+
/** Fija o borra el ancla (al cambiar los datos, al limpiar la selección…). */
|
|
14
|
+
setAnchor: (anchor: K | null) => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Recuerda el ancla de una lista tildable para que Shift + click y Shift + flechas marquen un tramo.
|
|
18
|
+
* La lógica es la de `toggleWithRange` / `extendRange`; el hook solo guarda el ancla entre eventos.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const range = useRangeSelect<string>();
|
|
22
|
+
* onClick={(e) => setSelected(range.toggle({ selected, ids, target: id, shift: e.shiftKey }))}
|
|
23
|
+
*/
|
|
24
|
+
export declare const useRangeSelect: <K>() => UseRangeSelectResult<K>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { extendRange as e, toggleWithRange as t } from "./rangeSelectLogic.js";
|
|
3
|
+
import { useMemo as n, useRef as r } from "react";
|
|
4
|
+
//#region src/hooks/useRangeSelect.ts
|
|
5
|
+
var i = () => {
|
|
6
|
+
let i = r(null);
|
|
7
|
+
return n(() => ({
|
|
8
|
+
toggle: (e) => {
|
|
9
|
+
let n = t({
|
|
10
|
+
...e,
|
|
11
|
+
anchor: i.current
|
|
12
|
+
});
|
|
13
|
+
return i.current = n.anchor, n.selected;
|
|
14
|
+
},
|
|
15
|
+
extend: ({ from: t, ...n }) => ((i.current === null || !n.ids.includes(i.current)) && (i.current = t), e({
|
|
16
|
+
...n,
|
|
17
|
+
anchor: i.current
|
|
18
|
+
})),
|
|
19
|
+
anchor: () => i.current,
|
|
20
|
+
setAnchor: (e) => {
|
|
21
|
+
i.current = e;
|
|
22
|
+
}
|
|
23
|
+
}), []);
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { i as useRangeSelect };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type RecentEntry } from "./recentLogic";
|
|
2
|
-
export type { RecentEntry } from "./recentLogic";
|
|
1
|
+
import { type RecentEntry } from "./recentLogic.js";
|
|
2
|
+
export type { RecentEntry } from "./recentLogic.js";
|
|
3
3
|
export type UseRecentOptions = {
|
|
4
4
|
/** Máximo de entradas guardadas. Default 8. */
|
|
5
|
-
max?: number;
|
|
5
|
+
max?: number | undefined;
|
|
6
6
|
};
|
|
7
7
|
export type UseRecentResult = {
|
|
8
8
|
recents: RecentEntry[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import { type KapiScrollAxis, type ScrollEdges } from "./scrollEdgesLogic";
|
|
2
|
+
import { type KapiScrollAxis, type ScrollEdges } from "./scrollEdgesLogic.js";
|
|
3
3
|
export type UseScrollEdgesOptions = {
|
|
4
4
|
/** Eje que scrollea. Default `"x"`. */
|
|
5
|
-
axis?: KapiScrollAxis;
|
|
5
|
+
axis?: KapiScrollAxis | undefined;
|
|
6
6
|
/** Tolerancia (px) para decidir si un borde "tiene más". Default 1. */
|
|
7
|
-
tolerance?: number;
|
|
7
|
+
tolerance?: number | undefined;
|
|
8
8
|
/** Fracción de la zona visible que avanza un page. Default 0.85. */
|
|
9
|
-
pageFraction?: number;
|
|
9
|
+
pageFraction?: number | undefined;
|
|
10
10
|
};
|
|
11
11
|
export type UseScrollEdgesResult<E extends HTMLElement = HTMLElement> = {
|
|
12
12
|
/** Ref del elemento que scrollea (el que tiene `overflow`). */
|
|
@@ -17,8 +17,8 @@ export type UseScrollEdgesResult<E extends HTMLElement = HTMLElement> = {
|
|
|
17
17
|
scrollByPage: (direction: -1 | 1) => void;
|
|
18
18
|
/** Deja `el` visible con un margen en px (default 0), moviendo lo mínimo. */
|
|
19
19
|
reveal: (el: HTMLElement, options?: {
|
|
20
|
-
padding?: number;
|
|
21
|
-
instant?: boolean;
|
|
20
|
+
padding?: number | undefined;
|
|
21
|
+
instant?: boolean | undefined;
|
|
22
22
|
}) => void;
|
|
23
23
|
/** Recalcula los bordes ya. */
|
|
24
24
|
update: () => void;
|
|
@@ -26,7 +26,8 @@ export type UseScrollEdgesResult<E extends HTMLElement = HTMLElement> = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Detecta qué bordes de un scroller tienen más contenido (para el fade de `KapiScrollArea`) y
|
|
28
28
|
* ofrece paginar y revelar un ítem. Recalcula con scroll/resize vía `onViewportChange` (uno por
|
|
29
|
-
* frame
|
|
30
|
-
*
|
|
29
|
+
* frame, con los listeners de ventana compartidos entre todas las instancias) y con cambios de
|
|
30
|
+
* tamaño del contenedor y de sus hijos vía `ResizeObserver`; la primera
|
|
31
|
+
* medición es sincrónica en el layout effect. En RTL la posición se lee desde el inicio (derecha).
|
|
31
32
|
*/
|
|
32
33
|
export declare function useScrollEdges<E extends HTMLElement = HTMLElement>({ axis, tolerance, pageFraction }?: UseScrollEdgesOptions): UseScrollEdgesResult<E>;
|
|
@@ -1,91 +1,96 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { winOf as e } from "./ownerDocument.js";
|
|
3
|
+
import { onViewportChange as t } from "./rafThrottle.js";
|
|
4
|
+
import { directionOf as n } from "./directionLogic.js";
|
|
5
|
+
import { prefersReducedMotion as r } from "./reducedMotion.js";
|
|
6
|
+
import { DEFAULT_PAGE_FRACTION as i, pageTarget as a, revealTarget as o, sameScrollEdges as s, scrollEdges as c } from "./scrollEdgesLogic.js";
|
|
7
|
+
import { useCallback as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
6
8
|
//#region src/hooks/useScrollEdges.ts
|
|
7
|
-
var
|
|
8
|
-
position: e
|
|
9
|
+
var p = (e) => n(e) === "rtl" ? -e.scrollLeft : e.scrollLeft, m = (e, t) => t === "x" ? {
|
|
10
|
+
position: p(e),
|
|
9
11
|
clientSize: e.clientWidth,
|
|
10
12
|
scrollSize: e.scrollWidth
|
|
11
13
|
} : {
|
|
12
14
|
position: e.scrollTop,
|
|
13
15
|
clientSize: e.clientHeight,
|
|
14
16
|
scrollSize: e.scrollHeight
|
|
15
|
-
},
|
|
17
|
+
}, h = {
|
|
16
18
|
start: !1,
|
|
17
19
|
end: !1
|
|
18
20
|
};
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
+
function g({ axis: p = "x", tolerance: g = 1, pageFraction: _ = i } = {}) {
|
|
22
|
+
let v = d(null), [y, b] = f(h), x = d({
|
|
21
23
|
axis: p,
|
|
22
|
-
tolerance:
|
|
23
|
-
pageFraction:
|
|
24
|
+
tolerance: g,
|
|
25
|
+
pageFraction: _
|
|
24
26
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
u(() => {
|
|
28
|
+
x.current = {
|
|
27
29
|
axis: p,
|
|
28
|
-
tolerance:
|
|
29
|
-
pageFraction:
|
|
30
|
+
tolerance: g,
|
|
31
|
+
pageFraction: _
|
|
30
32
|
};
|
|
31
33
|
});
|
|
32
|
-
let
|
|
33
|
-
let e =
|
|
34
|
+
let S = l(() => {
|
|
35
|
+
let e = v.current;
|
|
34
36
|
if (!e) return;
|
|
35
|
-
let { axis: t, tolerance: n } =
|
|
36
|
-
|
|
37
|
-
}, []),
|
|
38
|
-
let e =
|
|
37
|
+
let { axis: t, tolerance: n } = x.current, r = c(m(e, t), n);
|
|
38
|
+
b((e) => s(e, r) ? e : r);
|
|
39
|
+
}, []), C = d(null), w = d(/* @__PURE__ */ new Set()), T = l(() => {
|
|
40
|
+
let e = C.current, t = v.current;
|
|
39
41
|
if (!e || !t) return;
|
|
40
42
|
let n = /* @__PURE__ */ new Set([t, ...Array.from(t.children)]);
|
|
41
|
-
|
|
43
|
+
w.current.forEach((t) => {
|
|
42
44
|
n.has(t) || e.unobserve(t);
|
|
43
45
|
}), n.forEach((t) => {
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
+
w.current.has(t) || e.observe(t);
|
|
47
|
+
}), w.current = n;
|
|
46
48
|
}, []);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
let
|
|
50
|
-
return typeof ResizeObserver < "u" && (
|
|
51
|
-
|
|
49
|
+
u(() => {
|
|
50
|
+
S();
|
|
51
|
+
let n = e(v.current), r = t(S, n ? { target: n } : {});
|
|
52
|
+
return typeof ResizeObserver < "u" && (C.current = new ResizeObserver(() => S()), T()), () => {
|
|
53
|
+
r(), C.current?.disconnect(), C.current = null, w.current = /* @__PURE__ */ new Set();
|
|
52
54
|
};
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
+
}, [S, T]), u(() => {
|
|
56
|
+
T(), S();
|
|
55
57
|
});
|
|
56
|
-
let
|
|
57
|
-
let
|
|
58
|
-
left:
|
|
59
|
-
behavior:
|
|
58
|
+
let E = l((e, t, i) => {
|
|
59
|
+
let a = x.current.axis, o = i || r(e) ? "auto" : "smooth", s = n(e) === "rtl" ? -t : t, c = a === "x" ? {
|
|
60
|
+
left: s,
|
|
61
|
+
behavior: o
|
|
60
62
|
} : {
|
|
61
|
-
top:
|
|
62
|
-
behavior:
|
|
63
|
+
top: t,
|
|
64
|
+
behavior: o
|
|
63
65
|
};
|
|
64
|
-
typeof e.scrollTo == "function" ? e.scrollTo(
|
|
66
|
+
typeof e.scrollTo == "function" ? e.scrollTo(c) : a === "x" ? e.scrollLeft = s : e.scrollTop = t;
|
|
65
67
|
}, []);
|
|
66
68
|
return {
|
|
67
|
-
ref:
|
|
68
|
-
edges:
|
|
69
|
-
scrollByPage:
|
|
70
|
-
let t =
|
|
69
|
+
ref: v,
|
|
70
|
+
edges: y,
|
|
71
|
+
scrollByPage: l((e) => {
|
|
72
|
+
let t = v.current;
|
|
71
73
|
if (!t) return;
|
|
72
|
-
let { axis: n, pageFraction:
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
reveal:
|
|
76
|
-
let
|
|
77
|
-
if (!
|
|
78
|
-
let a =
|
|
79
|
-
start:
|
|
80
|
-
end:
|
|
74
|
+
let { axis: n, pageFraction: r } = x.current;
|
|
75
|
+
E(t, a(m(t, n), e, r), !1);
|
|
76
|
+
}, [E]),
|
|
77
|
+
reveal: l((e, { padding: t = 0, instant: r = !1 } = {}) => {
|
|
78
|
+
let i = v.current;
|
|
79
|
+
if (!i) return;
|
|
80
|
+
let a = x.current.axis, s = i.getBoundingClientRect(), c = e.getBoundingClientRect(), l = a === "x" ? i.clientLeft : i.clientTop, u = (a === "x" ? s.left : s.top) + l, d = m(i, a), f = a === "x" && n(i) === "rtl" ? u + i.clientWidth : null, p = o(d, f === null ? a === "x" ? {
|
|
81
|
+
start: c.left - u,
|
|
82
|
+
end: c.right - u
|
|
81
83
|
} : {
|
|
82
|
-
start:
|
|
83
|
-
end:
|
|
84
|
+
start: c.top - u,
|
|
85
|
+
end: c.bottom - u
|
|
86
|
+
} : {
|
|
87
|
+
start: f - c.right,
|
|
88
|
+
end: f - c.left
|
|
84
89
|
}, t);
|
|
85
|
-
Math.abs(
|
|
86
|
-
}, [
|
|
87
|
-
update:
|
|
90
|
+
Math.abs(p - d.position) < .5 || E(i, p, r);
|
|
91
|
+
}, [E]),
|
|
92
|
+
update: S
|
|
88
93
|
};
|
|
89
94
|
}
|
|
90
95
|
//#endregion
|
|
91
|
-
export {
|
|
96
|
+
export { g as useScrollEdges };
|
|
@@ -3,7 +3,7 @@ export type UseSlidingIndicatorOptions = {
|
|
|
3
3
|
/** Clave del ítem activo; `null` oculta el indicador. */
|
|
4
4
|
active: string | number | null;
|
|
5
5
|
/** Dependencias extra que fuerzan re-medir (ítems, variante, pestañas…). */
|
|
6
|
-
deps?: DependencyList;
|
|
6
|
+
deps?: DependencyList | undefined;
|
|
7
7
|
/** Devuelve el elemento activo dentro del contenedor (o `null` si no hay). */
|
|
8
8
|
findActive: (container: HTMLElement) => HTMLElement | null;
|
|
9
9
|
};
|
|
@@ -1,51 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { computedStyleOf as e, docOf as t, winOf as n } from "./ownerDocument.js";
|
|
3
|
+
import { onViewportChange as r } from "./rafThrottle.js";
|
|
4
|
+
import { slidingIndicatorBox as i } from "./slidingIndicatorLogic.js";
|
|
5
|
+
import { useCallback as a, useEffect as o, useLayoutEffect as s, useRef as c } from "react";
|
|
4
6
|
//#region src/hooks/useSlidingIndicator.ts
|
|
5
|
-
function
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
function l({ active: l, deps: u, findActive: d }) {
|
|
8
|
+
let f = c(null), p = c(null), m = c(null), h = c(d);
|
|
9
|
+
s(() => {
|
|
10
|
+
h.current = d;
|
|
9
11
|
});
|
|
10
|
-
let
|
|
11
|
-
let t =
|
|
12
|
+
let g = a(() => {
|
|
13
|
+
let t = f.current, n = p.current;
|
|
12
14
|
if (!t || !n) return;
|
|
13
|
-
let r =
|
|
15
|
+
let r = h.current(t);
|
|
14
16
|
if (!r) {
|
|
15
|
-
n.classList.remove("is-visible"), n.classList.remove("is-ready"),
|
|
17
|
+
n.classList.remove("is-visible"), n.classList.remove("is-ready"), m.current = null;
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
let
|
|
20
|
+
let a = m.current;
|
|
21
|
+
a && a !== r && !a.isConnected && n.classList.remove("is-ready");
|
|
22
|
+
let o = e(t), s = i(r.getBoundingClientRect(), t.getBoundingClientRect(), {
|
|
21
23
|
left: t.scrollLeft,
|
|
22
24
|
top: t.scrollTop
|
|
23
25
|
}, {
|
|
24
|
-
left: parseFloat(
|
|
25
|
-
top: parseFloat(
|
|
26
|
+
left: parseFloat(o.borderLeftWidth) || 0,
|
|
27
|
+
top: parseFloat(o.borderTopWidth) || 0
|
|
26
28
|
});
|
|
27
|
-
n.style.transform = `translate(${
|
|
29
|
+
n.style.transform = `translate(${s.x}px, ${s.y}px)`, n.style.width = `${s.width}px`, n.style.height = `${s.height}px`, n.classList.add("is-visible"), n.classList.contains("is-ready") || requestAnimationFrame(() => n.classList.add("is-ready")), m.current = r;
|
|
28
30
|
}, []);
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...
|
|
33
|
-
]),
|
|
34
|
-
let e =
|
|
31
|
+
return s(g, [
|
|
32
|
+
g,
|
|
33
|
+
l,
|
|
34
|
+
...u ?? []
|
|
35
|
+
]), o(() => {
|
|
36
|
+
let e = f.current;
|
|
35
37
|
if (!e) return;
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
let i = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(g);
|
|
39
|
+
i?.observe(e);
|
|
40
|
+
let a = n(e), o = r(g, {
|
|
41
|
+
...a ? { target: a } : {},
|
|
42
|
+
events: "resize"
|
|
43
|
+
}), s = t(e)?.fonts, c = !0;
|
|
44
|
+
return s?.addEventListener?.("loadingdone", g), s?.ready?.then(() => {
|
|
45
|
+
c && g();
|
|
41
46
|
}), () => {
|
|
42
|
-
|
|
47
|
+
c = !1, i?.disconnect(), o(), s?.removeEventListener?.("loadingdone", g);
|
|
43
48
|
};
|
|
44
|
-
}, [
|
|
45
|
-
containerRef:
|
|
46
|
-
indicatorRef:
|
|
47
|
-
remeasure:
|
|
49
|
+
}, [g]), {
|
|
50
|
+
containerRef: f,
|
|
51
|
+
indicatorRef: p,
|
|
52
|
+
remeasure: g
|
|
48
53
|
};
|
|
49
54
|
}
|
|
50
55
|
//#endregion
|
|
51
|
-
export {
|
|
56
|
+
export { l as useSlidingIndicator };
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useControllableState as e } from "./useControllableState.js";
|
|
3
|
+
import { canSubmitComment as t, draftAfterSubmit as n } from "../components/display/commentLogic.js";
|
|
4
|
+
import { useRef as r, useState as i } from "react";
|
|
4
5
|
//#region src/hooks/useSubmitDraft.ts
|
|
5
|
-
var
|
|
6
|
-
let [
|
|
7
|
-
disabled:
|
|
8
|
-
loading:
|
|
6
|
+
var a = (e) => typeof e?.then == "function", o = ({ value: o, defaultValue: s, onChange: c, onSubmit: l, disabled: u, loading: d = !1 }) => {
|
|
7
|
+
let [f, p, m] = e(o, s ?? "", c), h = r(null), [g, _] = i(!1), v = d || g, y = t(f, {
|
|
8
|
+
disabled: u,
|
|
9
|
+
loading: v
|
|
9
10
|
});
|
|
10
11
|
return {
|
|
11
|
-
text:
|
|
12
|
-
setText:
|
|
13
|
-
a === void 0 && f(e), s?.(e);
|
|
14
|
-
},
|
|
12
|
+
text: f,
|
|
13
|
+
setText: p,
|
|
15
14
|
submit: () => {
|
|
16
|
-
if (!
|
|
17
|
-
let e =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, (e) => console.error(e)).finally(() =>
|
|
15
|
+
if (!y) return;
|
|
16
|
+
let e = f.trim(), t = l(e);
|
|
17
|
+
h.current?.focus(), a(t) ? (_(!0), Promise.resolve(t).then(() => {
|
|
18
|
+
m((t) => n(t, e));
|
|
19
|
+
}, (e) => console.error(e)).finally(() => _(!1))) : m("");
|
|
21
20
|
},
|
|
22
|
-
busy:
|
|
23
|
-
canSubmit:
|
|
24
|
-
boxRef:
|
|
21
|
+
busy: v,
|
|
22
|
+
canSubmit: y,
|
|
23
|
+
boxRef: h
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
//#endregion
|
|
28
|
-
export {
|
|
27
|
+
export { o as useSubmitDraft };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Buffer del typeahead de una lista (WAI-ARIA): las teclas que llegan dentro de `windowMs` desde la
|
|
3
|
+
* anterior se suman ("me" → "Medicina"); pasado ese tiempo, la próxima tecla empieza de nuevo.
|
|
4
|
+
* Devuelve una función estable que suma la tecla y devuelve el texto acumulado; qué elemento
|
|
5
|
+
* coincide lo decide cada componente con su propia lógica pura.
|
|
6
|
+
*
|
|
7
|
+
* Interno: no se exporta del paquete.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useTypeahead: (windowMs: number) => ((key: string) => string);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
3
|
+
//#region src/hooks/useTypeahead.ts
|
|
4
|
+
var r = (r) => {
|
|
5
|
+
let i = n({
|
|
6
|
+
text: "",
|
|
7
|
+
timer: void 0
|
|
8
|
+
});
|
|
9
|
+
return t(() => {
|
|
10
|
+
let e = i.current;
|
|
11
|
+
return () => clearTimeout(e.timer);
|
|
12
|
+
}, []), e((e) => {
|
|
13
|
+
let t = i.current;
|
|
14
|
+
return clearTimeout(t.timer), t.text += e, t.timer = setTimeout(() => {
|
|
15
|
+
t.text = "", t.timer = void 0;
|
|
16
|
+
}, r), t.text;
|
|
17
|
+
}, [r]);
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as useTypeahead };
|
|
@@ -16,6 +16,9 @@ export declare const unsavedGuardHandler: (e: BeforeUnloadLike) => string;
|
|
|
16
16
|
/** Props listas para esparcir sobre `KapiConfirm` (`<KapiConfirm {...guard.dialogProps} />`). */
|
|
17
17
|
export type UnsavedGuardDialogProps = {
|
|
18
18
|
open: boolean;
|
|
19
|
+
/** Tono del `KapiConfirm`: siempre `warning`. */
|
|
20
|
+
tone: "warning";
|
|
21
|
+
/** Nombre anterior de `tone`, deprecado. @deprecated Usar `tone`; se conserva para quien lo leía. */
|
|
19
22
|
variant: "warning";
|
|
20
23
|
title: string;
|
|
21
24
|
message: string;
|
|
@@ -42,10 +45,10 @@ export type UnsavedGuard = {
|
|
|
42
45
|
dialogProps: UnsavedGuardDialogProps;
|
|
43
46
|
};
|
|
44
47
|
export type UnsavedGuardOptions = {
|
|
45
|
-
title?: string;
|
|
46
|
-
message?: string;
|
|
47
|
-
stayLabel?: string;
|
|
48
|
-
leaveLabel?: string;
|
|
48
|
+
title?: string | undefined;
|
|
49
|
+
message?: string | undefined;
|
|
50
|
+
stayLabel?: string | undefined;
|
|
51
|
+
leaveLabel?: string | undefined;
|
|
49
52
|
};
|
|
50
53
|
/**
|
|
51
54
|
* Guard de "cambios sin guardar".
|