@kapiuara/ui 0.12.0 → 0.14.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 +1202 -49
- package/dist/components/chat/KapiChatDivider.d.ts +8 -5
- package/dist/components/chat/KapiChatDivider.js +7 -6
- 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 +124 -100
- package/dist/components/inputs/KapiDateRangePicker.d.ts +44 -10
- package/dist/components/inputs/KapiDateRangePicker.js +138 -108
- 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 +22 -17
- package/dist/components/inputs/KapiMaskedInput.js +71 -55
- 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 +82 -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 +82 -51
- package/dist/components/inputs/KapiSelect.d.ts +120 -39
- package/dist/components/inputs/KapiSelect.js +311 -371
- 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 +86 -73
- 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/misuseWarnings.d.ts +37 -0
- package/dist/components/inputs/misuseWarnings.js +36 -0
- package/dist/components/inputs/numberStepLogic.d.ts +10 -0
- package/dist/components/inputs/numberStepLogic.js +16 -7
- 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 +16 -15
- 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 +65 -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 +25 -0
- package/dist/hooks/useControllableState.js +20 -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/useFormReset.d.ts +22 -0
- package/dist/hooks/useFormReset.js +17 -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 +18 -7
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/overlays/overlays.css";
|
|
2
3
|
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { computedStyleOf as n } from "../../hooks/ownerDocument.js";
|
|
6
|
+
import { resolveKapiRoot as r } from "../../hooks/kapiRoot.js";
|
|
7
|
+
import { onViewportChange as i } from "../../hooks/rafThrottle.js";
|
|
8
|
+
import { useMergedRefs as a } from "../../hooks/mergeRefs.js";
|
|
6
9
|
/* empty css */
|
|
7
|
-
import { KapiOverlayPortal as
|
|
8
|
-
import { prefersReducedMotion as
|
|
9
|
-
import { trapTabKey as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { useEffect as
|
|
10
|
+
import { KapiOverlayPortal as o } from "./overlayPortal.js";
|
|
11
|
+
import { prefersReducedMotion as s } from "../../hooks/reducedMotion.js";
|
|
12
|
+
import { trapTabKey as c } from "../../hooks/focusLogic.js";
|
|
13
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
14
|
+
import { useEffect as f, useLayoutEffect as p, useReducer as m, useRef as h, useState as g } from "react";
|
|
12
15
|
//#region src/components/overlays/KapiPhotoView.tsx
|
|
13
|
-
var
|
|
16
|
+
var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
14
17
|
switch (t) {
|
|
15
18
|
case "open": return e === "closed" ? "opening" : e;
|
|
16
19
|
case "ready": return e === "opening" ? "open" : e;
|
|
17
20
|
case "close": return e === "opening" || e === "open" ? "closing" : e;
|
|
18
21
|
case "end": return e === "closing" ? "closed" : e;
|
|
19
22
|
}
|
|
20
|
-
},
|
|
23
|
+
}, S = (e) => e ? 0 : 450, C = (e, t, n = 999) => {
|
|
21
24
|
let r = e.trim().split(/[\s/]+/)[0] ?? "", i = Number.parseFloat(r);
|
|
22
25
|
return !Number.isFinite(i) || i < 0 ? n : r.endsWith("%") ? i / 100 * Math.min(t.width, t.height) : r.endsWith("px") || r === String(i) ? i : n;
|
|
23
|
-
},
|
|
26
|
+
}, w = (e, t) => e === t || !!e && !!t && e.top === t.top && e.left === t.left && e.width === t.width && e.height === t.height, T = (e, t, n, r = 999) => {
|
|
24
27
|
if (e === "open") {
|
|
25
28
|
let e = Math.max(0, Math.min(280, n.width - 32, n.height - 32));
|
|
26
29
|
return {
|
|
@@ -28,8 +31,8 @@ var h = { viewer: "Foto ampliada" }, g = 92, _ = 24, v = .42, y = (e, t) => {
|
|
|
28
31
|
left: (n.width - e) / 2,
|
|
29
32
|
width: e,
|
|
30
33
|
height: e,
|
|
31
|
-
borderRadius:
|
|
32
|
-
fontSize: e *
|
|
34
|
+
borderRadius: y,
|
|
35
|
+
fontSize: e * v / 280
|
|
33
36
|
};
|
|
34
37
|
}
|
|
35
38
|
return t ? {
|
|
@@ -38,85 +41,85 @@ var h = { viewer: "Foto ampliada" }, g = 92, _ = 24, v = .42, y = (e, t) => {
|
|
|
38
41
|
width: t.width,
|
|
39
42
|
height: t.height,
|
|
40
43
|
borderRadius: r,
|
|
41
|
-
fontSize: t.height *
|
|
44
|
+
fontSize: t.height * b
|
|
42
45
|
} : {};
|
|
43
|
-
},
|
|
44
|
-
let
|
|
46
|
+
}, E = ({ children: v, content: y, bg: b = "var(--kapi-primary-soft)", ink: E = "var(--kapi-primary-ink)", label: D, labels: O, className: k, style: A, id: j, ref: M }) => {
|
|
47
|
+
let N = e("photoView", _, O), P = h(null), F = a(P, M), I = h(null), L = h(!1), [R, z] = m(x, "closed"), [B, V] = g(null), [H, U] = g(999), [W, G] = g(null), K = (e) => {
|
|
45
48
|
e.stopPropagation();
|
|
46
|
-
let
|
|
47
|
-
if (!
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
e.stopPropagation(),
|
|
49
|
+
let t = P.current;
|
|
50
|
+
if (!t) return;
|
|
51
|
+
let i = t.getBoundingClientRect();
|
|
52
|
+
V(i);
|
|
53
|
+
let a = t.firstElementChild ?? t;
|
|
54
|
+
U(C(n(a).borderRadius, i)), G(r(t)), z("open");
|
|
55
|
+
}, q = (e) => {
|
|
56
|
+
e.stopPropagation(), z("close");
|
|
54
57
|
};
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
let e = requestAnimationFrame(() =>
|
|
58
|
+
p(() => {
|
|
59
|
+
if (R !== "opening") return;
|
|
60
|
+
let e = requestAnimationFrame(() => z("ready"));
|
|
58
61
|
return () => cancelAnimationFrame(e);
|
|
59
|
-
}, [
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
if (!
|
|
63
|
-
let e =
|
|
62
|
+
}, [R]);
|
|
63
|
+
let J = R === "closed";
|
|
64
|
+
f(() => {
|
|
65
|
+
if (!J) return i(() => {
|
|
66
|
+
let e = P.current;
|
|
64
67
|
if (!e) return;
|
|
65
68
|
let t = e.getBoundingClientRect();
|
|
66
|
-
|
|
69
|
+
V((e) => w(e, t) ? e : t);
|
|
67
70
|
});
|
|
68
|
-
}, [
|
|
69
|
-
if (
|
|
70
|
-
let e = window.setTimeout(() =>
|
|
71
|
+
}, [J]), f(() => {
|
|
72
|
+
if (R !== "closing") return;
|
|
73
|
+
let e = window.setTimeout(() => z("end"), S(s(P.current)));
|
|
71
74
|
return () => window.clearTimeout(e);
|
|
72
|
-
}, [
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
let
|
|
75
|
+
}, [R]), p(() => {
|
|
76
|
+
R === "closed" ? (V(null), G(null), L.current && P.current?.focus(), L.current = !1) : R === "opening" && (L.current = !0, I.current?.focus());
|
|
77
|
+
}, [R]);
|
|
78
|
+
let Y = T(R, B, typeof window > "u" ? {
|
|
76
79
|
width: 1200,
|
|
77
80
|
height: 800
|
|
78
81
|
} : {
|
|
79
82
|
width: window.innerWidth,
|
|
80
83
|
height: window.innerHeight
|
|
81
|
-
},
|
|
82
|
-
return /* @__PURE__ */ l
|
|
83
|
-
ref:
|
|
84
|
+
}, H);
|
|
85
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("button", {
|
|
86
|
+
ref: F,
|
|
84
87
|
type: "button",
|
|
85
|
-
onClick:
|
|
86
|
-
id:
|
|
87
|
-
className:
|
|
88
|
-
style:
|
|
89
|
-
"aria-label":
|
|
88
|
+
onClick: K,
|
|
89
|
+
id: j,
|
|
90
|
+
className: t("kapi-photo-thumb", k),
|
|
91
|
+
style: A,
|
|
92
|
+
"aria-label": D,
|
|
90
93
|
"aria-haspopup": "dialog",
|
|
91
|
-
children:
|
|
92
|
-
}),
|
|
93
|
-
root:
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
ref:
|
|
96
|
-
className: `kapi-photo-overlay${
|
|
94
|
+
children: v
|
|
95
|
+
}), R !== "closed" && /* @__PURE__ */ u(o, {
|
|
96
|
+
root: W,
|
|
97
|
+
children: /* @__PURE__ */ u("div", {
|
|
98
|
+
ref: I,
|
|
99
|
+
className: `kapi-photo-overlay${R === "open" ? " is-open" : ""}`,
|
|
97
100
|
role: "dialog",
|
|
98
101
|
"aria-modal": "true",
|
|
99
|
-
"aria-label":
|
|
102
|
+
"aria-label": D ?? N.viewer,
|
|
100
103
|
tabIndex: -1,
|
|
101
|
-
onClick:
|
|
104
|
+
onClick: q,
|
|
102
105
|
onKeyDown: (e) => {
|
|
103
|
-
e.key === "Escape" ? (e.preventDefault(),
|
|
106
|
+
e.key === "Escape" ? (e.preventDefault(), q(e)) : c(e, I.current);
|
|
104
107
|
},
|
|
105
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ u("div", {
|
|
106
109
|
className: "kapi-photo-fly",
|
|
107
110
|
style: {
|
|
108
|
-
...
|
|
109
|
-
background:
|
|
110
|
-
color:
|
|
111
|
+
...Y,
|
|
112
|
+
background: b,
|
|
113
|
+
color: E
|
|
111
114
|
},
|
|
112
115
|
onTransitionEnd: (e) => {
|
|
113
|
-
e.target === e.currentTarget &&
|
|
116
|
+
e.target === e.currentTarget && z("end");
|
|
114
117
|
},
|
|
115
118
|
onClick: (e) => e.stopPropagation(),
|
|
116
|
-
children:
|
|
119
|
+
children: y
|
|
117
120
|
})
|
|
118
121
|
})
|
|
119
122
|
})] });
|
|
120
123
|
};
|
|
121
124
|
//#endregion
|
|
122
|
-
export {
|
|
125
|
+
export { _ as DEFAULT_PHOTO_VIEW_LABELS, E as KapiPhotoView, C as parseThumbRadius, S as photoCloseFallbackDelay, T as photoFlyStyle, x as photoViewReducer, w as sameRect };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import "./KapiPopover.css";
|
|
1
|
+
import { type CSSProperties, type ReactNode, type Ref, type RefObject } from "react";
|
|
2
|
+
import type { KapiPopoverAlign, KapiPopoverSide } from "./popoverLogic.js";
|
|
4
3
|
export type KapiPopoverProps = {
|
|
5
4
|
/** Muestra u oculta el popover (controlado). */
|
|
6
5
|
open: boolean;
|
|
@@ -9,31 +8,33 @@ export type KapiPopoverProps = {
|
|
|
9
8
|
/** Pedido de cierre: Escape o click afuera (si están habilitados). El padre pone `open={false}`. */
|
|
10
9
|
onClose: () => void;
|
|
11
10
|
/** Lado preferido; da vuelta solo si no entra. Default `"bottom"`. */
|
|
12
|
-
side?: KapiPopoverSide;
|
|
11
|
+
side?: KapiPopoverSide | undefined;
|
|
13
12
|
/** Default `"start"`. */
|
|
14
|
-
align?: KapiPopoverAlign;
|
|
13
|
+
align?: KapiPopoverAlign | undefined;
|
|
15
14
|
/** Separación con el ancla (px). Default `6`. */
|
|
16
|
-
offset?: number;
|
|
15
|
+
offset?: number | undefined;
|
|
17
16
|
/** Margen mínimo al borde del viewport (px). Default `8`. */
|
|
18
|
-
margin?: number;
|
|
17
|
+
margin?: number | undefined;
|
|
19
18
|
/** Mismo ancho mínimo que el ancla (útil para listas desplegables). */
|
|
20
|
-
matchAnchorWidth?: boolean;
|
|
19
|
+
matchAnchorWidth?: boolean | undefined;
|
|
21
20
|
/** Default `"dialog"`. */
|
|
22
|
-
role?: string;
|
|
21
|
+
role?: string | undefined;
|
|
23
22
|
/** Nombre accesible de la superficie. */
|
|
24
|
-
"aria-label"?: string;
|
|
23
|
+
"aria-label"?: string | undefined;
|
|
25
24
|
/** `id` de la superficie (p. ej. para el `aria-controls` del ancla). */
|
|
26
|
-
id?: string;
|
|
25
|
+
id?: string | undefined;
|
|
27
26
|
/** Clase de la superficie. */
|
|
28
|
-
className?: string;
|
|
27
|
+
className?: string | undefined;
|
|
29
28
|
/** Estilo de la superficie; la posición calculada (`top`/`left`/ancho) gana sobre él. */
|
|
30
|
-
style?: CSSProperties;
|
|
29
|
+
style?: CSSProperties | undefined;
|
|
30
|
+
/** Ref al `<div>` de la superficie (el que recibe `className`). */
|
|
31
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
31
32
|
/** Default `true`. */
|
|
32
|
-
closeOnEscape?: boolean;
|
|
33
|
+
closeOnEscape?: boolean | undefined;
|
|
33
34
|
/** Pointerdown fuera del popover y del ancla. Default `true`. */
|
|
34
|
-
closeOnOutside?: boolean;
|
|
35
|
+
closeOnOutside?: boolean | undefined;
|
|
35
36
|
/** Al cerrar con Escape devuelve el foco al ancla. Default `true`. */
|
|
36
|
-
restoreFocus?: boolean;
|
|
37
|
+
restoreFocus?: boolean | undefined;
|
|
37
38
|
/** Contenido del popover. */
|
|
38
39
|
children: ReactNode;
|
|
39
40
|
};
|
|
@@ -43,4 +44,4 @@ export type KapiPopoverProps = {
|
|
|
43
44
|
* cambios de tamaño.
|
|
44
45
|
* No maneja el foco al abrir: el contenido decide (un input lo conserva, un menú lo toma).
|
|
45
46
|
*/
|
|
46
|
-
export declare function KapiPopover({ open, anchorRef, onClose, side, align, offset, margin, matchAnchorWidth, role, "aria-label": ariaLabel, id, className, style: styleProp, closeOnEscape, closeOnOutside, restoreFocus, children }: KapiPopoverProps): import("react").JSX.Element | null;
|
|
47
|
+
export declare function KapiPopover({ open, anchorRef, onClose, side, align, offset, margin, matchAnchorWidth, role, "aria-label": ariaLabel, id, className, style: styleProp, ref, closeOnEscape, closeOnOutside, restoreFocus, children }: KapiPopoverProps): import("react").JSX.Element | null;
|
|
@@ -1,66 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/overlays/KapiPopover.css";
|
|
2
3
|
import { resolveKapiRoot as e } from "../../hooks/kapiRoot.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { usePlacement as t } from "../../hooks/usePlacement.js";
|
|
5
|
+
import { useMergedRefs as n } from "../../hooks/mergeRefs.js";
|
|
6
|
+
import { useDismiss as r } from "../../hooks/useDismiss.js";
|
|
7
|
+
import { KapiOverlayPortal as i } from "./overlayPortal.js";
|
|
8
|
+
import { useExitPresence as a } from "./useExitPresence.js";
|
|
7
9
|
/* empty css */
|
|
8
|
-
import { jsx as
|
|
9
|
-
import {
|
|
10
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
11
|
+
import { useLayoutEffect as s, useRef as c, useState as l } from "react";
|
|
10
12
|
//#region src/components/overlays/KapiPopover.tsx
|
|
11
|
-
function u({ open: u, anchorRef: d, onClose: f, side: p = "bottom", align: m = "start", offset: h = 6, margin: g = 8, matchAnchorWidth: _ = !1, role: v = "dialog", "aria-label": y, id: b, className: x = "", style: S,
|
|
12
|
-
let
|
|
13
|
-
o(() => {
|
|
14
|
-
A.current = f;
|
|
15
|
-
});
|
|
16
|
-
let { present: j, closing: M } = i(u, D);
|
|
13
|
+
function u({ open: u, anchorRef: d, onClose: f, side: p = "bottom", align: m = "start", offset: h = 6, margin: g = 8, matchAnchorWidth: _ = !1, role: v = "dialog", "aria-label": y, id: b, className: x = "", style: S, ref: C, closeOnEscape: w = !0, closeOnOutside: T = !0, restoreFocus: E = !0, children: D }) {
|
|
14
|
+
let O = c(null), k = n(O, C), [A, j] = l(null), { present: M, closing: N } = a(u, O);
|
|
17
15
|
s(() => {
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
let { placement:
|
|
21
|
-
open:
|
|
22
|
-
enabled: !!
|
|
16
|
+
j(M ? e(d.current) : null);
|
|
17
|
+
}, [M, d]);
|
|
18
|
+
let { placement: P, style: F } = t({
|
|
19
|
+
open: M,
|
|
20
|
+
enabled: !!A,
|
|
23
21
|
anchor: d,
|
|
24
|
-
floatingRef:
|
|
22
|
+
floatingRef: O,
|
|
25
23
|
side: p,
|
|
26
24
|
align: m,
|
|
27
25
|
offset: h,
|
|
28
26
|
margin: g,
|
|
29
27
|
width: _ ? "min-anchor" : "content"
|
|
28
|
+
}), I = r(u, {
|
|
29
|
+
zones: [O, d],
|
|
30
|
+
escape: w,
|
|
31
|
+
outside: T,
|
|
32
|
+
onDismiss: (e) => {
|
|
33
|
+
f?.(), e === "escape" && E && d.current?.focus();
|
|
34
|
+
}
|
|
30
35
|
});
|
|
31
|
-
return o(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, n = (e) => {
|
|
36
|
-
w && t(e.target, [D.current, d.current]) && A.current?.();
|
|
37
|
-
};
|
|
38
|
-
return document.addEventListener("keydown", e), document.addEventListener("pointerdown", n, !0), () => {
|
|
39
|
-
document.removeEventListener("keydown", e), document.removeEventListener("pointerdown", n, !0);
|
|
40
|
-
};
|
|
41
|
-
}, [
|
|
42
|
-
u,
|
|
43
|
-
C,
|
|
44
|
-
w,
|
|
45
|
-
T,
|
|
46
|
-
d
|
|
47
|
-
]), j ? /* @__PURE__ */ a(r, {
|
|
48
|
-
root: O,
|
|
49
|
-
children: /* @__PURE__ */ a("div", {
|
|
50
|
-
ref: D,
|
|
36
|
+
return M ? /* @__PURE__ */ o(i, {
|
|
37
|
+
root: A,
|
|
38
|
+
children: /* @__PURE__ */ o("div", {
|
|
39
|
+
ref: k,
|
|
51
40
|
id: b,
|
|
52
41
|
role: v,
|
|
53
42
|
"aria-label": y,
|
|
54
43
|
tabIndex: -1,
|
|
55
44
|
className: `kapi-popover${x ? ` ${x}` : ""}`,
|
|
56
|
-
"data-side":
|
|
45
|
+
"data-side": P?.side ?? p,
|
|
57
46
|
"data-align": m,
|
|
58
|
-
"data-closing":
|
|
47
|
+
"data-closing": N || void 0,
|
|
59
48
|
style: {
|
|
60
49
|
...S,
|
|
61
|
-
...
|
|
50
|
+
...F
|
|
62
51
|
},
|
|
63
|
-
|
|
52
|
+
onKeyDown: I,
|
|
53
|
+
children: D
|
|
64
54
|
})
|
|
65
55
|
}) : null;
|
|
66
56
|
}
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import "
|
|
3
|
-
import {
|
|
4
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
2
|
+
import { type KapiRootProps } from "../rootProps.js";
|
|
3
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
5
4
|
/** `className`/`style`/`id` van al contenedor que se transforma; abierto, `width`/`height` ganan sobre `style`. */
|
|
6
|
-
export type KapiShapeSheetProps = KapiRootProps & {
|
|
5
|
+
export type KapiShapeSheetProps = KapiRootProps<HTMLDivElement> & {
|
|
7
6
|
/** Título del panel abierto. */
|
|
8
7
|
title: string;
|
|
9
8
|
/** Contenido del panel. */
|
|
10
9
|
children: ReactNode;
|
|
11
10
|
/** Ancho del panel abierto (px). */
|
|
12
|
-
width?: number;
|
|
11
|
+
width?: number | undefined;
|
|
13
12
|
/** Alto del panel abierto (px). */
|
|
14
|
-
height?: number;
|
|
13
|
+
height?: number | undefined;
|
|
15
14
|
/** aria-label del FAB. Gana sobre `labels.open` ("Abrir"). */
|
|
16
|
-
label?: string;
|
|
15
|
+
label?: string | undefined;
|
|
17
16
|
/** Textos fijos (botón cerrar). */
|
|
18
17
|
labels?: KapiLabelsOverride<KapiShapeSheetLabels> | undefined;
|
|
18
|
+
/** Panel abierto. Controlado (mismos nombres que `KapiFab`). */
|
|
19
|
+
open?: boolean | undefined;
|
|
20
|
+
/** Abierto al montar (no controlado). @default false */
|
|
21
|
+
defaultOpen?: boolean | undefined;
|
|
22
|
+
/** Se llama al abrir o cerrar (FAB, botón cerrar, Escape, click afuera). */
|
|
23
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
19
24
|
};
|
|
20
|
-
/** ¿La tecla cierra el panel? */
|
|
21
|
-
export declare const isDismissKey: (key: string) => boolean;
|
|
22
|
-
/** ¿El target del evento cae fuera de `root`? (sin root o sin target no hay nada que cerrar). */
|
|
23
|
-
export declare const isOutsideTarget: (root: Node | null, target: EventTarget | null) => boolean;
|
|
24
25
|
/**
|
|
25
26
|
* "Container transform": el FAB circular se TRANSFORMA en panel (tamaño + radio + color).
|
|
26
27
|
* Cierra con el botón, con click fuera y con Escape. El panel es un diálogo no modal: al abrir el foco
|
|
27
28
|
* va al primer enfocable del contenido (o al panel) y al cerrar con el botón o Escape vuelve al FAB.
|
|
29
|
+
* El estado abierto usa los nombres de `KapiFab` (`open` / `defaultOpen` / `onOpenChange`).
|
|
30
|
+
*
|
|
31
|
+
* No se fusiona con el `panel` de `KapiFab` a propósito: el Fab vive portaleado y fijo en un rincón
|
|
32
|
+
* del viewport (y se arrastra), mientras que la hoja va EN el flujo de la página y es el propio
|
|
33
|
+
* contenedor el que crece; meter la transformación en el Fab cambiaría dónde se dibuja la hoja.
|
|
28
34
|
*/
|
|
29
35
|
export type KapiShapeSheetLabels = {
|
|
30
36
|
close: string;
|
|
31
37
|
open: string;
|
|
32
38
|
};
|
|
33
39
|
export declare const DEFAULT_SHAPE_SHEET_LABELS: KapiShapeSheetLabels;
|
|
34
|
-
export declare const KapiShapeSheet: ({ title, children, width, height, label, labels, className, style, id }: KapiShapeSheetProps) => import("react").JSX.Element;
|
|
40
|
+
export declare const KapiShapeSheet: ({ title, children, width, height, label, labels, className, style, id, ref, open: openProp, defaultOpen, onOpenChange }: KapiShapeSheetProps) => import("react").JSX.Element;
|
|
@@ -1,82 +1,88 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/overlays/overlays.css";
|
|
2
3
|
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
4
|
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { useControllableState as n } from "../../hooks/useControllableState.js";
|
|
6
|
+
import { useMergedRefs as r } from "../../hooks/mergeRefs.js";
|
|
7
|
+
import { useDismiss as i } from "../../hooks/useDismiss.js";
|
|
4
8
|
/* empty css */
|
|
5
|
-
import { focusableWithin as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Minus as
|
|
9
|
+
import { focusableWithin as a } from "../../hooks/focusLogic.js";
|
|
10
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
11
|
+
import { useEffect as c, useId as l, useRef as u } from "react";
|
|
12
|
+
import { Minus as d, Plus as f } from "lucide-react";
|
|
9
13
|
//#region src/components/overlays/KapiShapeSheet.tsx
|
|
10
|
-
var
|
|
14
|
+
var p = {
|
|
11
15
|
close: "Cerrar",
|
|
12
16
|
open: "Abrir"
|
|
13
|
-
}, m = ({ title: m, children: h, width: g = 300, height: _ = 250, label: v, labels: y, className: b, style: x, id: S }) => {
|
|
14
|
-
let
|
|
15
|
-
|
|
17
|
+
}, m = ({ title: m, children: h, width: g = 300, height: _ = 250, label: v, labels: y, className: b, style: x, id: S, ref: C, open: w, defaultOpen: T = !1, onOpenChange: E }) => {
|
|
18
|
+
let D = e("shapeSheet", p, y), O = u(null), k = r(O, C), A = u(null), j = u(null), M = u(null), N = l(), [P, F] = n(w, T, E), I = u(P);
|
|
19
|
+
I.current = P;
|
|
20
|
+
let L = (e) => {
|
|
21
|
+
e !== I.current && F(e);
|
|
22
|
+
}, R = u(!1), z = () => {
|
|
23
|
+
R.current = !0, L(!1);
|
|
16
24
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
}, [k]), /* @__PURE__ */ i("div", {
|
|
30
|
-
ref: w,
|
|
25
|
+
c(() => {
|
|
26
|
+
P ? (a(M.current)[0] ?? j.current)?.focus() : R.current && (R.current = !1, A.current?.focus());
|
|
27
|
+
}, [P]);
|
|
28
|
+
let B = i(P, {
|
|
29
|
+
zones: [O],
|
|
30
|
+
onDismiss: (e) => {
|
|
31
|
+
e === "escape" && (R.current = !0), L(!1);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return /* @__PURE__ */ s("div", {
|
|
35
|
+
ref: k,
|
|
31
36
|
id: S,
|
|
32
|
-
className: t("kapi-shape",
|
|
33
|
-
style:
|
|
37
|
+
className: t("kapi-shape", P && "kapi-shape--open", b),
|
|
38
|
+
style: P ? {
|
|
34
39
|
...x,
|
|
35
40
|
width: g,
|
|
36
41
|
height: _
|
|
37
42
|
} : x,
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
onKeyDown: B,
|
|
44
|
+
children: [/* @__PURE__ */ o("button", {
|
|
45
|
+
ref: A,
|
|
40
46
|
type: "button",
|
|
41
47
|
className: "kapi-shape__fab",
|
|
42
|
-
inert:
|
|
43
|
-
onClick: () =>
|
|
44
|
-
"aria-expanded":
|
|
45
|
-
"aria-label": v ??
|
|
46
|
-
children: /* @__PURE__ */
|
|
48
|
+
inert: P,
|
|
49
|
+
onClick: () => L(!0),
|
|
50
|
+
"aria-expanded": P,
|
|
51
|
+
"aria-label": v ?? D.open,
|
|
52
|
+
children: /* @__PURE__ */ o(f, {
|
|
47
53
|
size: 22,
|
|
48
54
|
strokeWidth: 2.4
|
|
49
55
|
})
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
-
ref:
|
|
56
|
+
}), /* @__PURE__ */ s("div", {
|
|
57
|
+
ref: j,
|
|
52
58
|
className: "kapi-shape__sheet",
|
|
53
|
-
inert: !
|
|
59
|
+
inert: !P,
|
|
54
60
|
role: "dialog",
|
|
55
|
-
"aria-labelledby":
|
|
61
|
+
"aria-labelledby": N,
|
|
56
62
|
tabIndex: -1,
|
|
57
|
-
children: [/* @__PURE__ */
|
|
63
|
+
children: [/* @__PURE__ */ s("div", {
|
|
58
64
|
className: "kapi-shape__head",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ o("span", {
|
|
60
66
|
className: "kapi-shape__title",
|
|
61
|
-
id:
|
|
67
|
+
id: N,
|
|
62
68
|
children: m
|
|
63
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ o("button", {
|
|
64
70
|
type: "button",
|
|
65
71
|
className: "kapi-shape__close",
|
|
66
|
-
onClick:
|
|
67
|
-
"aria-label":
|
|
68
|
-
children: /* @__PURE__ */
|
|
72
|
+
onClick: z,
|
|
73
|
+
"aria-label": D.close,
|
|
74
|
+
children: /* @__PURE__ */ o(d, {
|
|
69
75
|
size: 16,
|
|
70
76
|
strokeWidth: 2.4
|
|
71
77
|
})
|
|
72
78
|
})]
|
|
73
|
-
}), /* @__PURE__ */
|
|
79
|
+
}), /* @__PURE__ */ o("div", {
|
|
74
80
|
className: "kapi-shape__body",
|
|
75
|
-
ref:
|
|
81
|
+
ref: M,
|
|
76
82
|
children: h
|
|
77
83
|
})]
|
|
78
84
|
})]
|
|
79
85
|
});
|
|
80
86
|
};
|
|
81
87
|
//#endregion
|
|
82
|
-
export { p as DEFAULT_SHAPE_SHEET_LABELS, m as KapiShapeSheet
|
|
88
|
+
export { p as DEFAULT_SHAPE_SHEET_LABELS, m as KapiShapeSheet };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { KapiModalProps } from "./KapiModal";
|
|
3
|
-
import { type KapiSplitModalSide } from "./splitModalLayout";
|
|
4
|
-
import "
|
|
5
|
-
import "./KapiSplitModal.css";
|
|
6
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
2
|
+
import type { KapiModalProps } from "./KapiModal.js";
|
|
3
|
+
import { type KapiSplitModalSide } from "./splitModalLayout.js";
|
|
4
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
7
5
|
export type KapiSplitModalAside = {
|
|
8
6
|
/** Controlled visibility of the aside. */
|
|
9
7
|
open: boolean;
|
|
@@ -11,12 +9,15 @@ export type KapiSplitModalAside = {
|
|
|
11
9
|
title?: ReactNode;
|
|
12
10
|
footer?: ReactNode;
|
|
13
11
|
/** Which side of the main card the aside docks to. Default "left". */
|
|
14
|
-
side?: KapiSplitModalSide;
|
|
12
|
+
side?: KapiSplitModalSide | undefined;
|
|
15
13
|
/** Aside width (number → px, string → any CSS length). Default 380. */
|
|
16
|
-
width?: number | string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
width?: number | string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* X on the aside header: closes just the aside (the parent flips `open`). `closeButton` and
|
|
17
|
+
* `dismissible` of the modal do not hide it: closing the aside never closes the modal.
|
|
18
|
+
*/
|
|
19
|
+
onClose?: (() => void) | undefined;
|
|
20
|
+
closeLabel?: string | undefined;
|
|
20
21
|
};
|
|
21
22
|
/** `close` es la X de la tarjeta principal; `closePanel`, la del panel lateral sin `closeLabel`. */
|
|
22
23
|
export type KapiSplitModalLabels = {
|
|
@@ -26,7 +27,7 @@ export type KapiSplitModalLabels = {
|
|
|
26
27
|
export declare const DEFAULT_SPLIT_MODAL_LABELS: KapiSplitModalLabels;
|
|
27
28
|
export type KapiSplitModalProps = Omit<KapiModalProps, "labels"> & {
|
|
28
29
|
/** Panel lateral acoplado a la tarjeta principal (visibilidad, contenido, lado y ancho). */
|
|
29
|
-
aside?: KapiSplitModalAside;
|
|
30
|
+
aside?: KapiSplitModalAside | undefined;
|
|
30
31
|
/** Textos fijos (clave `splitModal`): la X principal (sin `closeLabel`) y la del panel lateral. */
|
|
31
32
|
labels?: KapiLabelsOverride<KapiSplitModalLabels> | undefined;
|
|
32
33
|
};
|