@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,43 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import "#kapi-css/components/overlays/KapiModal.css";
|
|
3
|
+
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { useNativeDialog as n, usePortalRoot as r } from "./useNativeDialog.js";
|
|
4
6
|
/* empty css */
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useId as
|
|
7
|
-
import { createPortal as
|
|
7
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
8
|
+
import { useId as o } from "react";
|
|
9
|
+
import { createPortal as s } from "react-dom";
|
|
8
10
|
//#region src/components/overlays/KapiLoading.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
return
|
|
12
|
-
ref:
|
|
11
|
+
var c = { message: "Cargando…" }, l = ({ message: e, root: r, className: c, style: l, id: u, ref: d }) => {
|
|
12
|
+
let f = o(), { ref: p, dialogProps: m } = n();
|
|
13
|
+
return s(/* @__PURE__ */ i("dialog", {
|
|
14
|
+
ref: p,
|
|
13
15
|
className: "kapi-loading-overlay kapi-loading-dialog",
|
|
14
16
|
role: "alertdialog",
|
|
15
17
|
"aria-modal": "true",
|
|
16
18
|
"aria-busy": "true",
|
|
17
|
-
"aria-labelledby":
|
|
19
|
+
"aria-labelledby": f,
|
|
18
20
|
tabIndex: -1,
|
|
19
|
-
...
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
+
...m,
|
|
22
|
+
children: /* @__PURE__ */ a("div", {
|
|
23
|
+
ref: d,
|
|
21
24
|
id: u,
|
|
22
|
-
className:
|
|
25
|
+
className: t("kapi-loading", c),
|
|
23
26
|
style: l,
|
|
24
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ i("span", {
|
|
25
28
|
className: "kapi-spinner",
|
|
26
29
|
"aria-hidden": "true"
|
|
27
|
-
}), /* @__PURE__ */
|
|
28
|
-
id:
|
|
30
|
+
}), /* @__PURE__ */ i("span", {
|
|
31
|
+
id: f,
|
|
29
32
|
className: "kapi-loading__msg",
|
|
30
|
-
children:
|
|
33
|
+
children: e
|
|
31
34
|
})]
|
|
32
35
|
})
|
|
33
|
-
}),
|
|
34
|
-
},
|
|
35
|
-
let
|
|
36
|
-
return
|
|
37
|
-
...
|
|
38
|
-
message: n,
|
|
39
|
-
root:
|
|
36
|
+
}), r);
|
|
37
|
+
}, u = ({ open: t, message: n, ...a }) => {
|
|
38
|
+
let o = e("loading", c), s = r(), u = t ? s : null;
|
|
39
|
+
return u ? /* @__PURE__ */ i(l, {
|
|
40
|
+
...a,
|
|
41
|
+
message: n ?? o.message,
|
|
42
|
+
root: u
|
|
40
43
|
}) : null;
|
|
41
44
|
};
|
|
42
45
|
//#endregion
|
|
43
|
-
export { c as KapiLoading };
|
|
46
|
+
export { c as DEFAULT_LOADING_LABELS, u as KapiLoading };
|
|
@@ -1,25 +1,56 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import { type KapiRootProps } from "../rootProps";
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/** Texto del botón disparador. */
|
|
9
|
-
label: ReactNode;
|
|
2
|
+
import { type KapiButtonAppearance, type KapiButtonSize, type KapiButtonTone } from "../inputs/KapiButton.js";
|
|
3
|
+
import type { KapiLegacyButtonVariant } from "../tone.js";
|
|
4
|
+
import type { KapiMenuItem } from "./KapiContextMenu.js";
|
|
5
|
+
import { type KapiRootProps } from "../rootProps.js";
|
|
6
|
+
/** Props comunes de `KapiMenuButton` (con o sin texto visible). */
|
|
7
|
+
type KapiMenuButtonBaseProps = KapiRootProps<HTMLSpanElement> & {
|
|
10
8
|
/** Ítems del menú que se abre al hacer click, en orden. */
|
|
11
|
-
items: KapiMenuItem[];
|
|
12
|
-
/**
|
|
9
|
+
items: readonly KapiMenuItem[];
|
|
10
|
+
/** Ícono (lucide-react) antes del texto; sin `label`, es todo el contenido del botón. */
|
|
13
11
|
icon?: ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
/** Color del botón disparador (el `tone` de `KapiButton`). @default "neutral" */
|
|
13
|
+
tone?: KapiButtonTone | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Forma del botón disparador (el `variant` de `KapiButton`): `solid` · `outline` · `tonal` ·
|
|
16
|
+
* `ghost`. Los valores viejos que mezclan color y forma (`tonal-primary`…) están deprecados: el
|
|
17
|
+
* color va en `tone`.
|
|
18
|
+
* @default "solid"
|
|
19
|
+
*/
|
|
20
|
+
variant?: KapiButtonAppearance | KapiLegacyButtonVariant | undefined;
|
|
21
|
+
/** Tamaño del disparador, la misma escala que `KapiButton`. @default "md" */
|
|
22
|
+
size?: KapiButtonSize | undefined;
|
|
23
|
+
/** Deshabilita el disparador; el menú no se abre (y se cierra si estaba abierto). */
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
/** Menú abierto (controlado). Sin la prop, el estado es interno. */
|
|
26
|
+
open?: boolean | undefined;
|
|
27
|
+
/** Estado inicial sin controlar. @default false */
|
|
28
|
+
defaultOpen?: boolean | undefined;
|
|
29
|
+
/** Pide abrir o cerrar (click, flechas, Escape, click afuera o tras elegir un ítem). */
|
|
30
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
31
|
+
/** Muestra el chevron después del texto. @default false cuando es solo ícono (`label` omitido y con `icon`), true en otro caso */
|
|
32
|
+
chevron?: boolean | undefined;
|
|
33
|
+
/** `up` prefiere abrir hacia arriba; igual da vuelta si no entra. @default "down" */
|
|
34
|
+
drop?: "down" | "up" | undefined;
|
|
20
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* `className`/`style`/`id` van al `<span>` que envuelve al disparador (el menú se portalea). Con `label`
|
|
38
|
+
* el botón muestra texto; sin `label` es un botón cuadrado de solo ícono y `aria-label` es obligatorio.
|
|
39
|
+
*/
|
|
40
|
+
export type KapiMenuButtonProps = KapiMenuButtonBaseProps & ({
|
|
41
|
+
/** Texto del botón disparador. Sin él, el botón es solo ícono (`icon` + `aria-label`). */
|
|
42
|
+
label: ReactNode;
|
|
43
|
+
/** Nombre accesible del botón disparador (p. ej. si `label` no es texto). */
|
|
44
|
+
"aria-label"?: string | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
/** Texto del botón disparador. Sin él, el botón es solo ícono (`icon` + `aria-label`). */
|
|
47
|
+
label?: undefined;
|
|
48
|
+
/** Nombre accesible del botón disparador (obligatorio sin `label`). */
|
|
49
|
+
"aria-label": string;
|
|
50
|
+
});
|
|
21
51
|
/**
|
|
22
52
|
* Button that opens an action menu anchored to its left or right edge (whichever has room). The menu is portaled to `.kapi`
|
|
23
53
|
* (escapes overflow), positioned `fixed` and flips up/down when it does not fit.
|
|
24
54
|
*/
|
|
25
|
-
export declare const KapiMenuButton: ({ label, items, icon, variant, "aria-label": ariaLabel, drop, className, style: wrapStyle, id }: KapiMenuButtonProps) => import("react").JSX.Element;
|
|
55
|
+
export declare const KapiMenuButton: ({ label, items, icon, tone, variant, size, disabled, open: openProp, defaultOpen, onOpenChange, chevron, "aria-label": ariaLabel, drop, className, style: wrapStyle, id, ref }: KapiMenuButtonProps) => import("react").JSX.Element;
|
|
56
|
+
export {};
|
|
@@ -1,110 +1,88 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/overlays/overlays.css";
|
|
2
3
|
import { KapiButton as e } from "../inputs/KapiButton.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { useControllableState as n } from "../../hooks/useControllableState.js";
|
|
6
|
+
import { resolveKapiRoot as r } from "../../hooks/kapiRoot.js";
|
|
7
|
+
import { usePlacement as i } from "../../hooks/usePlacement.js";
|
|
8
|
+
import { useMergedRefs as a } from "../../hooks/mergeRefs.js";
|
|
9
|
+
import { useDismiss as o } from "../../hooks/useDismiss.js";
|
|
6
10
|
/* empty css */
|
|
7
|
-
import { ACTION_MENU_PLACEMENT as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { ACTION_MENU_PLACEMENT as s } from "./menuButtonLogic.js";
|
|
12
|
+
import { MenuList as c } from "./menuList.js";
|
|
13
|
+
import { useFocusReturn as l } from "../../hooks/useFocusReturn.js";
|
|
14
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
15
|
+
import { useCallback as f, useId as p, useLayoutEffect as m, useRef as h } from "react";
|
|
16
|
+
import { ChevronDown as g } from "lucide-react";
|
|
17
|
+
import { createPortal as _ } from "react-dom";
|
|
13
18
|
//#region src/components/overlays/KapiMenuButton.tsx
|
|
14
|
-
var
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
var v = 6, y = ({ label: y, items: b, icon: x, tone: S, variant: C, size: w, disabled: T = !1, open: E, defaultOpen: D = !1, onOpenChange: O, chevron: k, "aria-label": A, drop: j = "down", className: M, style: N, id: P, ref: F }) => {
|
|
20
|
+
let I = p(), [L, R] = n(E, D, O), z = L && !T, B = y === void 0 && x != null, V = k ?? !B, H = h(null), U = a(H, F), W = h(null), G = h(null), { restore: K } = l(z, {
|
|
21
|
+
container: G,
|
|
22
|
+
target: W
|
|
23
|
+
}), q = f((e) => {
|
|
24
|
+
R(!1), e && K();
|
|
25
|
+
}, [R, K]), { placement: J, style: Y, update: X } = i({
|
|
26
|
+
open: z,
|
|
27
|
+
anchor: W,
|
|
28
|
+
floatingRef: G,
|
|
29
|
+
...s,
|
|
30
|
+
side: j === "up" ? "top" : "bottom",
|
|
31
|
+
offset: v,
|
|
26
32
|
hideUntilPlaced: !1
|
|
27
33
|
});
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
m(() => {
|
|
35
|
+
z && X();
|
|
30
36
|
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
])
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, z = (e) => {
|
|
57
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), k(!0)) : e.key === "Escape" && O && (e.stopPropagation(), N(!0));
|
|
58
|
-
}, B = O ? t(A.current) : null;
|
|
59
|
-
return /* @__PURE__ */ c("span", {
|
|
60
|
-
ref: A,
|
|
61
|
-
id: E,
|
|
62
|
-
className: r("kapi-menubtn", w),
|
|
63
|
-
style: T,
|
|
64
|
-
children: [/* @__PURE__ */ c(e, {
|
|
65
|
-
ref: j,
|
|
66
|
-
variant: x,
|
|
67
|
-
icon: b,
|
|
68
|
-
"aria-label": S,
|
|
37
|
+
z,
|
|
38
|
+
b.length,
|
|
39
|
+
X
|
|
40
|
+
]);
|
|
41
|
+
let Z = o(z, {
|
|
42
|
+
zones: [H, G],
|
|
43
|
+
onDismiss: (e) => q(e === "escape")
|
|
44
|
+
}), Q = (e) => {
|
|
45
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), R(!0));
|
|
46
|
+
}, $ = z ? r(H.current) : null;
|
|
47
|
+
return /* @__PURE__ */ d("span", {
|
|
48
|
+
ref: U,
|
|
49
|
+
id: P,
|
|
50
|
+
className: t("kapi-menubtn", M),
|
|
51
|
+
style: N,
|
|
52
|
+
onKeyDown: Z,
|
|
53
|
+
children: [/* @__PURE__ */ d(e, {
|
|
54
|
+
ref: W,
|
|
55
|
+
...S !== void 0 && { tone: S },
|
|
56
|
+
...C !== void 0 && { variant: C },
|
|
57
|
+
...w !== void 0 && { size: w },
|
|
58
|
+
iconOnly: B,
|
|
59
|
+
disabled: T,
|
|
60
|
+
icon: x,
|
|
61
|
+
"aria-label": A,
|
|
69
62
|
"aria-haspopup": "menu",
|
|
70
|
-
"aria-expanded":
|
|
71
|
-
"aria-controls":
|
|
72
|
-
onClick: () =>
|
|
73
|
-
onKeyDown:
|
|
74
|
-
children: [
|
|
63
|
+
"aria-expanded": z,
|
|
64
|
+
"aria-controls": z ? I : void 0,
|
|
65
|
+
onClick: () => R(!z),
|
|
66
|
+
onKeyDown: Q,
|
|
67
|
+
children: [y, V && /* @__PURE__ */ u(g, {
|
|
68
|
+
className: "kapi-menubtn__chevron",
|
|
75
69
|
size: 15,
|
|
76
70
|
strokeWidth: 2.2,
|
|
77
71
|
"aria-hidden": "true"
|
|
78
72
|
})]
|
|
79
|
-
}),
|
|
80
|
-
ref:
|
|
81
|
-
id:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
className: "kapi-ctxmenu__header",
|
|
92
|
-
children: e.header
|
|
93
|
-
}, `h${t}`) : /* @__PURE__ */ c("button", {
|
|
94
|
-
type: "button",
|
|
95
|
-
role: "menuitem",
|
|
96
|
-
tabIndex: -1,
|
|
97
|
-
"data-menu-index": t,
|
|
98
|
-
"aria-disabled": e.disabled ? "true" : void 0,
|
|
99
|
-
"aria-current": e.current ? "true" : void 0,
|
|
100
|
-
className: o(e),
|
|
101
|
-
onClick: () => {
|
|
102
|
-
e.disabled || (N(!0), e.onClick?.());
|
|
103
|
-
},
|
|
104
|
-
children: [e.icon, e.label]
|
|
105
|
-
}, `${e.label}-${t}`))
|
|
106
|
-
}), B)]
|
|
73
|
+
}), $ && _(/* @__PURE__ */ u(c, {
|
|
74
|
+
ref: G,
|
|
75
|
+
id: I,
|
|
76
|
+
className: `kapi-ctxmenu kapi-menubtn__menu kapi-menubtn__menu--${J?.side === "top" ? "top" : "bottom"} kapi-menubtn__menu--${J?.align === "end" ? "right" : "left"}`,
|
|
77
|
+
style: Y,
|
|
78
|
+
items: b,
|
|
79
|
+
focusRequest: 1,
|
|
80
|
+
onClose: q,
|
|
81
|
+
onActivate: (e, t) => {
|
|
82
|
+
e.keepOpen || q(!0), e.onClick?.(t);
|
|
83
|
+
}
|
|
84
|
+
}), $)]
|
|
107
85
|
});
|
|
108
86
|
};
|
|
109
87
|
//#endregion
|
|
110
|
-
export {
|
|
88
|
+
export { y as KapiMenuButton };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
-
import { type GrowOrigin } from "../../hooks/growOriginLogic";
|
|
3
|
-
import { type KapiModalSize } from "./dialogUtils";
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
export type { KapiModalSize } from "./dialogUtils";
|
|
1
|
+
import { type CSSProperties, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type GrowOrigin } from "../../hooks/growOriginLogic.js";
|
|
3
|
+
import { type KapiModalSize } from "./dialogUtils.js";
|
|
4
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
5
|
+
export type { KapiModalSize } from "./dialogUtils.js";
|
|
7
6
|
export type KapiModalLabels = {
|
|
8
7
|
close: string;
|
|
9
8
|
};
|
|
@@ -31,10 +30,19 @@ export type KapiModalProps = {
|
|
|
31
30
|
style?: CSSProperties | undefined;
|
|
32
31
|
/** id de la tarjeta del modal. */
|
|
33
32
|
id?: string | undefined;
|
|
34
|
-
/**
|
|
33
|
+
/** Ref a la tarjeta del modal (el `<div>` que recibe `className`), no al `<dialog>`. */
|
|
34
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
35
|
+
/** Click en el fondo cierra. Default true (o el de `dismissible`). */
|
|
35
36
|
closeOnBackdrop?: boolean | undefined;
|
|
36
|
-
/** Escape cierra. Default true. */
|
|
37
|
+
/** Escape cierra. Default true (o el de `dismissible`). */
|
|
37
38
|
closeOnEscape?: boolean | undefined;
|
|
39
|
+
/** Muestra la X de cerrar. Con `false`, junto con `closeOnEscape={false}` y `closeOnBackdrop={false}`, solo cierran los botones propios. Default true. */
|
|
40
|
+
closeButton?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* `false` = bloqueante: apaga Escape, el click en el fondo y la X de una vez. Cada prop explícita
|
|
43
|
+
* (`closeOnEscape`, `closeOnBackdrop`, `closeButton`) gana. Default true.
|
|
44
|
+
*/
|
|
45
|
+
dismissible?: boolean | undefined;
|
|
38
46
|
/** Nombre accesible de la X. Gana sobre `labels.close` ("Cerrar"). */
|
|
39
47
|
closeLabel?: string | undefined;
|
|
40
48
|
/** Textos fijos (clave `modal`). */
|
|
@@ -1,106 +1,113 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/overlays/KapiModal.css";
|
|
2
3
|
import { useLabels as e } from "../locale/KapiLocaleProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useMergedRefs as t } from "../../hooks/mergeRefs.js";
|
|
5
|
+
import { prefersReducedMotion as n } from "../../hooks/reducedMotion.js";
|
|
6
|
+
import { dialogNameProps as r, modalClasses as i, resolveDismiss as a } from "./dialogUtils.js";
|
|
7
|
+
import { useExitPresence as o } from "./useExitPresence.js";
|
|
8
|
+
import { originWithinCard as s } from "../../hooks/growOriginLogic.js";
|
|
9
|
+
import { useBackdropClose as c, useNativeDialog as l, usePortalRoot as u, useTrappedDialogWarning as d } from "./useNativeDialog.js";
|
|
8
10
|
/* empty css */
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { useId as
|
|
11
|
-
import { X as
|
|
12
|
-
import { createPortal as
|
|
11
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
|
+
import { useId as m, useLayoutEffect as h, useRef as g, useState as _ } from "react";
|
|
13
|
+
import { X as v } from "lucide-react";
|
|
14
|
+
import { createPortal as y } from "react-dom";
|
|
13
15
|
//#region src/components/overlays/KapiModal.tsx
|
|
14
|
-
var
|
|
15
|
-
let n =
|
|
16
|
-
return r ? /* @__PURE__ */
|
|
16
|
+
var b = { close: "Cerrar" }, x = ({ open: e, ...t }) => {
|
|
17
|
+
let n = g(null), { present: r, closing: i } = o(e, n);
|
|
18
|
+
return r ? /* @__PURE__ */ f(S, {
|
|
17
19
|
...t,
|
|
18
20
|
dialogRef: n,
|
|
19
|
-
closing:
|
|
21
|
+
closing: i
|
|
20
22
|
}) : null;
|
|
21
|
-
},
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
}, ee = () => {}, S = ({ title: o, subtitle: x, onClose: S, children: C, footer: w, size: T = "md", hideHeader: E = !1, className: te = "", style: D, id: O, ref: k, closeOnBackdrop: A, closeOnEscape: j, closeButton: M, dismissible: N, closeLabel: P, labels: F, "aria-label": I, "aria-labelledby": L, growFrom: R, dialogRef: z, closing: B }) => {
|
|
24
|
+
let V = B ? ee : S, H = m(), U = e("modal", b, F), W = P ?? U.close, G = g(null), K = t(G, k), [q, J] = _(null), Y = a({
|
|
25
|
+
dismissible: N,
|
|
26
|
+
closeOnEscape: j,
|
|
27
|
+
closeOnBackdrop: A,
|
|
28
|
+
closeButton: M
|
|
29
|
+
}), { closeOnEscape: X, closeOnBackdrop: Z, closeButton: Q } = Y, { ref: ne, dialogProps: re } = l({ onRequestClose: X ? V : void 0 }), ie = c(Z ? V : void 0);
|
|
30
|
+
d("KapiModal", Y, G), h(() => {
|
|
31
|
+
let e = G.current;
|
|
32
|
+
if (!R || !e || n(e)) {
|
|
33
|
+
J(null);
|
|
27
34
|
return;
|
|
28
35
|
}
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
left:
|
|
32
|
-
top:
|
|
36
|
+
let t = e.getBoundingClientRect(), r = e.offsetWidth, i = e.offsetHeight, a = t.left + t.width / 2, o = t.top + t.height / 2;
|
|
37
|
+
J(s(R, {
|
|
38
|
+
left: a - r / 2,
|
|
39
|
+
top: o - i / 2,
|
|
33
40
|
width: r,
|
|
34
41
|
height: i
|
|
35
42
|
}));
|
|
36
|
-
}, [
|
|
37
|
-
let
|
|
38
|
-
return
|
|
43
|
+
}, [R]);
|
|
44
|
+
let $ = u();
|
|
45
|
+
return $ ? y(/* @__PURE__ */ f("dialog", {
|
|
39
46
|
ref: (e) => {
|
|
40
|
-
|
|
47
|
+
ne.current = e, z.current = e;
|
|
41
48
|
},
|
|
42
49
|
className: "kapi-modal-overlay kapi-modal-dialog",
|
|
43
|
-
"data-closing":
|
|
50
|
+
"data-closing": B || void 0,
|
|
44
51
|
"aria-modal": "true",
|
|
45
|
-
...
|
|
46
|
-
titleId:
|
|
47
|
-
title:
|
|
48
|
-
hideHeader:
|
|
49
|
-
"aria-label":
|
|
50
|
-
"aria-labelledby":
|
|
52
|
+
...r({
|
|
53
|
+
titleId: H,
|
|
54
|
+
title: o,
|
|
55
|
+
hideHeader: E,
|
|
56
|
+
"aria-label": I,
|
|
57
|
+
"aria-labelledby": L
|
|
51
58
|
}),
|
|
52
|
-
...
|
|
53
|
-
...
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
ref:
|
|
56
|
-
id:
|
|
57
|
-
className: `${
|
|
58
|
-
style:
|
|
59
|
-
...
|
|
60
|
-
"--kapi-grow-x": `${
|
|
61
|
-
"--kapi-grow-y": `${
|
|
62
|
-
} :
|
|
59
|
+
...re,
|
|
60
|
+
...ie,
|
|
61
|
+
children: /* @__PURE__ */ p("div", {
|
|
62
|
+
ref: K,
|
|
63
|
+
id: O,
|
|
64
|
+
className: `${i(T, te)}${q ? " kapi-modal--grow" : ""}`,
|
|
65
|
+
style: q ? {
|
|
66
|
+
...D,
|
|
67
|
+
"--kapi-grow-x": `${q.x}px`,
|
|
68
|
+
"--kapi-grow-y": `${q.y}px`
|
|
69
|
+
} : D,
|
|
63
70
|
children: [
|
|
64
|
-
|
|
71
|
+
E ? Q && /* @__PURE__ */ f("button", {
|
|
65
72
|
type: "button",
|
|
66
73
|
className: "kapi-modal__x kapi-modal__x--float",
|
|
67
|
-
onClick:
|
|
68
|
-
"aria-label":
|
|
69
|
-
children: /* @__PURE__ */
|
|
74
|
+
onClick: V,
|
|
75
|
+
"aria-label": W,
|
|
76
|
+
children: /* @__PURE__ */ f(v, {
|
|
70
77
|
size: 17,
|
|
71
78
|
strokeWidth: 2.2
|
|
72
79
|
})
|
|
73
|
-
}) : /* @__PURE__ */
|
|
80
|
+
}) : /* @__PURE__ */ p("div", {
|
|
74
81
|
className: "kapi-modal__head",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
76
|
-
id:
|
|
82
|
+
children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("div", {
|
|
83
|
+
id: H,
|
|
77
84
|
className: "kapi-modal__title",
|
|
78
|
-
children:
|
|
79
|
-
}),
|
|
85
|
+
children: o
|
|
86
|
+
}), x && /* @__PURE__ */ f("div", {
|
|
80
87
|
className: "kapi-modal__sub",
|
|
81
|
-
children:
|
|
82
|
-
})] }), /* @__PURE__ */
|
|
88
|
+
children: x
|
|
89
|
+
})] }), Q && /* @__PURE__ */ f("button", {
|
|
83
90
|
type: "button",
|
|
84
91
|
className: "kapi-modal__x",
|
|
85
|
-
onClick:
|
|
86
|
-
"aria-label":
|
|
87
|
-
children: /* @__PURE__ */
|
|
92
|
+
onClick: V,
|
|
93
|
+
"aria-label": W,
|
|
94
|
+
children: /* @__PURE__ */ f(v, {
|
|
88
95
|
size: 17,
|
|
89
96
|
strokeWidth: 2.2
|
|
90
97
|
})
|
|
91
98
|
})]
|
|
92
99
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ f("div", {
|
|
94
101
|
className: "kapi-modal__body",
|
|
95
|
-
children:
|
|
102
|
+
children: C
|
|
96
103
|
}),
|
|
97
|
-
|
|
104
|
+
w && /* @__PURE__ */ f("div", {
|
|
98
105
|
className: "kapi-modal__foot",
|
|
99
|
-
children:
|
|
106
|
+
children: w
|
|
100
107
|
})
|
|
101
108
|
]
|
|
102
109
|
})
|
|
103
|
-
}),
|
|
110
|
+
}), $) : null;
|
|
104
111
|
};
|
|
105
112
|
//#endregion
|
|
106
|
-
export {
|
|
113
|
+
export { b as DEFAULT_MODAL_LABELS, x as KapiModal };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
2
|
+
import { type KapiOffcanvasSide } from "./offcanvasSide.js";
|
|
3
|
+
import { type KapiRootProps } from "../rootProps.js";
|
|
4
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
6
5
|
export declare const DEFAULT_OFFCANVAS_WIDTH = 520;
|
|
7
6
|
export type KapiOffcanvasCompanion = {
|
|
8
7
|
/** Controlado. Con true el panel se acopla junto al drawer, en el mismo borde. */
|
|
@@ -11,12 +10,12 @@ export type KapiOffcanvasCompanion = {
|
|
|
11
10
|
title?: ReactNode;
|
|
12
11
|
subtitle?: ReactNode;
|
|
13
12
|
/** Ancho: number (px) o string CSS. Default 400. */
|
|
14
|
-
width?: number | string;
|
|
13
|
+
width?: number | string | undefined;
|
|
15
14
|
/** Zona fija inferior del panel acompañante. */
|
|
16
15
|
footer?: ReactNode;
|
|
17
16
|
/** X del encabezado: cierra sólo el acompañante (el padre pone `open: false`). */
|
|
18
|
-
onClose?: () => void;
|
|
19
|
-
closeLabel?: string;
|
|
17
|
+
onClose?: (() => void) | undefined;
|
|
18
|
+
closeLabel?: string | undefined;
|
|
20
19
|
};
|
|
21
20
|
/** `close` es la X del panel (sin `closeLabel`); `closePanel`, la del acompañante. */
|
|
22
21
|
export type KapiOffcanvasLabels = {
|
|
@@ -29,7 +28,7 @@ export declare const DEFAULT_OFFCANVAS_LABELS: KapiOffcanvasLabels;
|
|
|
29
28
|
* `className`/`style`/`id` (`KapiRootProps`) van al `<dialog>` (`.kapi-offc`, el contenedor que
|
|
30
29
|
* ubica las tarjetas); las variables calculadas (tamaño, empuje) ganan sobre `style`.
|
|
31
30
|
*/
|
|
32
|
-
export type KapiOffcanvasProps = KapiRootProps & {
|
|
31
|
+
export type KapiOffcanvasProps = KapiRootProps<HTMLDialogElement> & {
|
|
33
32
|
/** Controlado. Al pasar a false corre la animación de salida y recién después se desmonta. */
|
|
34
33
|
open: boolean;
|
|
35
34
|
/** Pedido de cierre (X, click en el fondo, Escape). El padre pone `open={false}`. */
|
|
@@ -42,8 +41,12 @@ export type KapiOffcanvasProps = KapiRootProps & {
|
|
|
42
41
|
children?: ReactNode | undefined;
|
|
43
42
|
/** Zona fija inferior (botones). */
|
|
44
43
|
footer?: ReactNode | undefined;
|
|
45
|
-
/**
|
|
46
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Borde desde el que se abre. Default `"right"`. `"start"`/`"end"` siguen la dirección del texto
|
|
46
|
+
* (el `dir` de la raíz `.kapi` o el del `KapiLocaleProvider`): `"end"` es la derecha en LTR y la
|
|
47
|
+
* izquierda en RTL.
|
|
48
|
+
*/
|
|
49
|
+
side?: KapiOffcanvasSide | undefined;
|
|
47
50
|
/**
|
|
48
51
|
* Ancho de la tarjeta (sólo `left` / `right`): number (px) o string CSS. Default 520.
|
|
49
52
|
* En mobile ocupa `calc(100% - 20px)`. Se ignora en `top` / `bottom` (ocupan todo el ancho).
|
|
@@ -55,10 +58,17 @@ export type KapiOffcanvasProps = KapiRootProps & {
|
|
|
55
58
|
pushRatio?: number | undefined;
|
|
56
59
|
/** Cuánto se corre a la izquierda (px) por nivel, para asomar como carta detrás. Default 16. */
|
|
57
60
|
pushOffset?: number | undefined;
|
|
58
|
-
/** Click en el fondo cierra. Default true. */
|
|
61
|
+
/** Click en el fondo cierra. Default true (o el de `dismissible`). */
|
|
59
62
|
closeOnBackdrop?: boolean | undefined;
|
|
60
|
-
/** Escape cierra. Default true. */
|
|
63
|
+
/** Escape cierra. Default true (o el de `dismissible`). */
|
|
61
64
|
closeOnEscape?: boolean | undefined;
|
|
65
|
+
/** Muestra la X de cerrar. Con `false`, junto con `closeOnEscape={false}` y `closeOnBackdrop={false}`, solo cierran los botones propios. Default true. No toca la X del acompañante. */
|
|
66
|
+
closeButton?: boolean | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* `false` = bloqueante: apaga Escape, el click en el fondo y la X de una vez. Cada prop explícita
|
|
69
|
+
* (`closeOnEscape`, `closeOnBackdrop`, `closeButton`) gana. Default true.
|
|
70
|
+
*/
|
|
71
|
+
dismissible?: boolean | undefined;
|
|
62
72
|
/** Textos fijos (handle de redimensionar, la X del panel y la del acompañante sin `closeLabel`). */
|
|
63
73
|
labels?: KapiLabelsOverride<KapiOffcanvasLabels> | undefined;
|
|
64
74
|
/** Nombre accesible de la X. Gana sobre `labels.close` ("Cerrar"). */
|
|
@@ -93,4 +103,4 @@ export type KapiOffcanvasProps = KapiRootProps & {
|
|
|
93
103
|
* El empuje aplica a `right` y `left` (espejado); en `top` / `bottom` los paneles
|
|
94
104
|
* apilados no se empujan entre sí (el apilado vertical queda fuera de alcance).
|
|
95
105
|
*/
|
|
96
|
-
export declare const KapiOffcanvas: ({ open, onExited, ...props }: KapiOffcanvasProps) => import("react").ReactPortal | null;
|
|
106
|
+
export declare const KapiOffcanvas: ({ open, onExited, side, ...props }: KapiOffcanvasProps) => import("react").ReactPortal | null;
|