@kapiuara/ui 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1197 -49
- package/dist/components/chat/KapiChatDivider.d.ts +1 -2
- package/dist/components/chat/KapiChatDivider.js +1 -0
- package/dist/components/chat/KapiChatList.d.ts +10 -6
- package/dist/components/chat/KapiChatList.js +12 -11
- package/dist/components/chat/KapiChatThread.d.ts +2 -3
- package/dist/components/chat/KapiChatThread.js +73 -52
- package/dist/components/chat/KapiComposer.d.ts +3 -4
- package/dist/components/chat/KapiComposer.js +2 -1
- package/dist/components/chat/KapiMessageBubble.d.ts +3 -4
- package/dist/components/chat/KapiMessageBubble.js +1 -0
- package/dist/components/chat/KapiTypingIndicator.d.ts +2 -3
- package/dist/components/chat/KapiTypingIndicator.js +1 -0
- package/dist/components/chat/chatLogic.d.ts +6 -0
- package/dist/components/chat/chatLogic.js +2 -2
- package/dist/components/chat/index.d.ts +18 -14
- package/dist/components/data/KapiBarChart.d.ts +23 -15
- package/dist/components/data/KapiBarChart.js +54 -51
- 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 +19 -11
- package/dist/components/data/KapiLineChart.js +59 -55
- 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 -337
- 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 +18 -2
- package/dist/components/data/chartFrame.js +54 -55
- package/dist/components/data/datasetSelectionLogic.d.ts +7 -4
- package/dist/components/data/datasetSelectionLogic.js +3 -2
- package/dist/components/data/eventCalendarLogic.d.ts +7 -3
- package/dist/components/data/eventCalendarLogic.js +5 -4
- package/dist/components/data/index.d.ts +108 -30
- package/dist/components/data/rowClickLogic.d.ts +51 -0
- package/dist/components/data/rowClickLogic.js +56 -0
- package/dist/components/data/tableCells.d.ts +38 -0
- package/dist/components/data/tableCells.js +121 -0
- package/dist/components/data/tableHeaderMenu.d.ts +21 -0
- package/dist/components/data/tableHeaderMenu.js +45 -0
- package/dist/components/data/tableLabels.d.ts +76 -0
- package/dist/components/data/tableLabels.js +48 -0
- package/dist/components/data/tableLogic.d.ts +119 -21
- package/dist/components/data/tableLogic.js +121 -84
- package/dist/components/data/tablePaginationLogic.d.ts +15 -0
- package/dist/components/data/tablePaginationLogic.js +15 -0
- package/dist/components/data/tableResizeLogic.d.ts +12 -4
- package/dist/components/data/tableResizeLogic.js +14 -10
- package/dist/components/data/tableTypes.d.ts +509 -0
- package/dist/components/data/useColumnResize.d.ts +28 -0
- package/dist/components/data/useColumnResize.js +116 -0
- package/dist/components/data/useRowKeyWarning.d.ts +10 -0
- package/dist/components/data/useRowKeyWarning.js +29 -0
- package/dist/components/data/useTableEdges.d.ts +15 -0
- package/dist/components/data/useTableEdges.js +26 -0
- package/dist/components/data/useTableSelection.d.ts +51 -0
- package/dist/components/data/useTableSelection.js +80 -0
- package/dist/components/display/KapiAnnotation.d.ts +10 -9
- package/dist/components/display/KapiAnnotation.js +98 -101
- package/dist/components/display/KapiAvatar.d.ts +19 -13
- package/dist/components/display/KapiAvatar.js +26 -24
- package/dist/components/display/KapiAvatarGroup.d.ts +26 -10
- package/dist/components/display/KapiAvatarGroup.js +26 -24
- package/dist/components/display/KapiBadge.d.ts +23 -12
- package/dist/components/display/KapiBadge.js +20 -15
- package/dist/components/display/KapiComment.d.ts +1 -2
- package/dist/components/display/KapiComment.js +3 -2
- package/dist/components/display/KapiCommentComposer.d.ts +2 -3
- package/dist/components/display/KapiCommentComposer.js +3 -2
- package/dist/components/display/KapiDescriptionList.d.ts +6 -5
- package/dist/components/display/KapiDescriptionList.js +1 -0
- package/dist/components/display/KapiFileItem.d.ts +2 -3
- package/dist/components/display/KapiFileItem.js +3 -2
- package/dist/components/display/KapiFileViewer.d.ts +8 -9
- package/dist/components/display/KapiFileViewer.js +1 -0
- package/dist/components/display/KapiIconTile.d.ts +7 -6
- package/dist/components/display/KapiIconTile.js +1 -0
- package/dist/components/display/KapiStat.d.ts +9 -8
- package/dist/components/display/KapiStat.js +1 -0
- package/dist/components/display/KapiTag.d.ts +5 -4
- package/dist/components/display/KapiTag.js +1 -0
- package/dist/components/display/KapiTimeline.d.ts +6 -5
- package/dist/components/display/KapiTimeline.js +1 -0
- package/dist/components/display/KapiTruncate.d.ts +1 -2
- package/dist/components/display/KapiTruncate.js +1 -0
- package/dist/components/display/fileItemLogic.d.ts +1 -1
- package/dist/components/display/iconTileLogic.d.ts +2 -2
- package/dist/components/display/index.d.ts +86 -44
- package/dist/components/display/statLogic.d.ts +1 -1
- package/dist/components/feedback/KapiAlert.d.ts +30 -7
- package/dist/components/feedback/KapiAlert.js +47 -23
- package/dist/components/feedback/KapiBulkBar.d.ts +11 -6
- package/dist/components/feedback/KapiBulkBar.js +6 -3
- package/dist/components/feedback/KapiCountdown.d.ts +15 -12
- package/dist/components/feedback/KapiCountdown.js +17 -16
- package/dist/components/feedback/KapiEmpty.d.ts +3 -2
- package/dist/components/feedback/KapiEmpty.js +1 -0
- package/dist/components/feedback/KapiFab.d.ts +39 -9
- package/dist/components/feedback/KapiFab.js +172 -91
- package/dist/components/feedback/KapiOfflineBanner.d.ts +7 -6
- package/dist/components/feedback/KapiOfflineBanner.js +1 -0
- package/dist/components/feedback/KapiProgress.d.ts +8 -7
- package/dist/components/feedback/KapiProgress.js +1 -0
- package/dist/components/feedback/KapiSkeleton.d.ts +6 -4
- package/dist/components/feedback/KapiToastContainer.d.ts +16 -8
- package/dist/components/feedback/KapiToastContainer.js +118 -63
- package/dist/components/feedback/KapiTour.d.ts +6 -7
- package/dist/components/feedback/KapiTour.js +91 -86
- package/dist/components/feedback/KapiUnsavedBar.d.ts +15 -8
- package/dist/components/feedback/KapiUnsavedBar.js +8 -4
- package/dist/components/feedback/bulkBarLogic.d.ts +6 -1
- package/dist/components/feedback/bulkBarLogic.js +7 -4
- package/dist/components/feedback/countdownLogic.d.ts +19 -11
- package/dist/components/feedback/fabLogic.d.ts +28 -0
- package/dist/components/feedback/fabLogic.js +18 -2
- package/dist/components/feedback/index.d.ts +65 -33
- package/dist/components/feedback/toastLayer.d.ts +18 -0
- package/dist/components/feedback/toastLayer.js +22 -0
- package/dist/components/feedback/toastStore.d.ts +97 -9
- package/dist/components/feedback/toastStore.js +132 -29
- package/dist/components/feedback/tourLogic.d.ts +4 -16
- package/dist/components/feedback/unsavedBarLogic.d.ts +7 -1
- package/dist/components/feedback/unsavedBarLogic.js +9 -5
- package/dist/components/inputs/KapiAutocomplete.d.ts +73 -48
- package/dist/components/inputs/KapiAutocomplete.js +128 -146
- package/dist/components/inputs/KapiButton.d.ts +30 -11
- package/dist/components/inputs/KapiButton.js +34 -27
- package/dist/components/inputs/KapiCalendar.d.ts +14 -8
- package/dist/components/inputs/KapiCalendar.js +36 -34
- package/dist/components/inputs/KapiCalendarGrid.d.ts +11 -6
- package/dist/components/inputs/KapiCalendarGrid.js +44 -38
- package/dist/components/inputs/KapiCheckCard.d.ts +2 -3
- package/dist/components/inputs/KapiCheckCard.js +1 -0
- package/dist/components/inputs/KapiCheckbox.d.ts +1 -1
- package/dist/components/inputs/KapiChecklist.d.ts +77 -0
- package/dist/components/inputs/KapiChecklist.js +175 -0
- package/dist/components/inputs/KapiDatePicker.d.ts +60 -22
- package/dist/components/inputs/KapiDatePicker.js +122 -100
- package/dist/components/inputs/KapiDateRangePicker.d.ts +44 -10
- package/dist/components/inputs/KapiDateRangePicker.js +148 -120
- package/dist/components/inputs/KapiFacetedSearch.d.ts +16 -8
- package/dist/components/inputs/KapiFacetedSearch.js +131 -168
- package/dist/components/inputs/KapiField.d.ts +16 -8
- package/dist/components/inputs/KapiField.js +44 -43
- package/dist/components/inputs/KapiFileUpload.d.ts +15 -16
- package/dist/components/inputs/KapiFileUpload.js +1 -0
- package/dist/components/inputs/KapiIconButton.d.ts +1 -1
- package/dist/components/inputs/KapiInput.d.ts +13 -12
- package/dist/components/inputs/KapiInput.js +70 -70
- package/dist/components/inputs/KapiInputGroup.d.ts +13 -10
- package/dist/components/inputs/KapiInputGroup.js +21 -19
- package/dist/components/inputs/KapiMaskedInput.d.ts +15 -15
- package/dist/components/inputs/KapiMaskedInput.js +51 -48
- package/dist/components/inputs/KapiNumberStepper.d.ts +30 -18
- package/dist/components/inputs/KapiNumberStepper.js +80 -65
- package/dist/components/inputs/KapiRadio.d.ts +1 -1
- package/dist/components/inputs/KapiRating.d.ts +40 -23
- package/dist/components/inputs/KapiRating.js +80 -65
- package/dist/components/inputs/KapiSearchChip.d.ts +80 -0
- package/dist/components/inputs/KapiSearchChip.js +77 -0
- package/dist/components/inputs/KapiSegmented.d.ts +49 -16
- package/dist/components/inputs/KapiSegmented.js +72 -51
- package/dist/components/inputs/KapiSelect.d.ts +120 -39
- package/dist/components/inputs/KapiSelect.js +309 -379
- package/dist/components/inputs/KapiSelectMenu.d.ts +38 -0
- package/dist/components/inputs/KapiSelectMenu.js +173 -0
- package/dist/components/inputs/KapiSlider.d.ts +37 -19
- package/dist/components/inputs/KapiSlider.js +67 -54
- package/dist/components/inputs/KapiSwitch.d.ts +13 -7
- package/dist/components/inputs/KapiSwitch.js +30 -21
- package/dist/components/inputs/KapiTagInput.d.ts +35 -24
- package/dist/components/inputs/KapiTagInput.js +77 -66
- package/dist/components/inputs/KapiTextarea.d.ts +12 -11
- package/dist/components/inputs/KapiTextarea.js +71 -49
- package/dist/components/inputs/asyncSelectLogic.d.ts +8 -4
- package/dist/components/inputs/asyncSelectLogic.js +13 -12
- package/dist/components/inputs/autocompleteLogic.d.ts +2 -29
- package/dist/components/inputs/autocompleteLogic.js +6 -6
- package/dist/components/inputs/checkControl.d.ts +3 -3
- package/dist/components/inputs/checkControl.js +2 -0
- package/dist/components/inputs/checklistLogic.d.ts +33 -0
- package/dist/components/inputs/checklistLogic.js +16 -0
- package/dist/components/inputs/datePickerLogic.d.ts +63 -13
- package/dist/components/inputs/datePickerLogic.js +119 -50
- package/dist/components/inputs/dateRangeLogic.d.ts +8 -3
- package/dist/components/inputs/dateRangeLogic.js +49 -43
- package/dist/components/inputs/facetedSearchLogic.d.ts +1 -3
- package/dist/components/inputs/facetedSearchLogic.js +4 -5
- package/dist/components/inputs/fieldLogic.d.ts +37 -1
- package/dist/components/inputs/fieldLogic.js +36 -19
- package/dist/components/inputs/index.d.ts +118 -55
- package/dist/components/inputs/inputGroupLogic.d.ts +1 -1
- package/dist/components/inputs/inputLogic.d.ts +1 -1
- package/dist/components/inputs/maskLogic.d.ts +3 -2
- package/dist/components/inputs/maskLogic.js +12 -10
- package/dist/components/inputs/ownField.d.ts +37 -0
- package/dist/components/inputs/ownField.js +37 -0
- package/dist/components/inputs/searchChipLogic.d.ts +33 -0
- package/dist/components/inputs/searchChipLogic.js +13 -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/labelsLogic.d.ts +11 -1
- 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 +68 -58
- package/dist/components/locale/localeLogic.d.ts +20 -0
- package/dist/components/locale/localeLogic.js +30 -0
- package/dist/components/navigation/CtxSlidingList.d.ts +5 -3
- package/dist/components/navigation/CtxSlidingList.js +15 -14
- package/dist/components/navigation/KapiAccordion.d.ts +9 -8
- package/dist/components/navigation/KapiAccordion.js +29 -29
- package/dist/components/navigation/KapiBreadcrumb.d.ts +4 -5
- package/dist/components/navigation/KapiBreadcrumb.js +1 -0
- package/dist/components/navigation/KapiCollapsiblePanel.d.ts +22 -16
- package/dist/components/navigation/KapiCollapsiblePanel.js +46 -43
- package/dist/components/navigation/KapiContextPanel.d.ts +31 -32
- package/dist/components/navigation/KapiContextPanel.js +119 -108
- package/dist/components/navigation/KapiFilterChips.d.ts +15 -10
- package/dist/components/navigation/KapiFilterChips.js +27 -22
- package/dist/components/navigation/KapiNavBadge.d.ts +7 -5
- package/dist/components/navigation/KapiNavBadge.js +12 -10
- package/dist/components/navigation/KapiPanelGroup.d.ts +22 -23
- package/dist/components/navigation/KapiPanelGroup.js +62 -60
- package/dist/components/navigation/KapiSteps.d.ts +4 -5
- package/dist/components/navigation/KapiSteps.js +1 -0
- package/dist/components/navigation/KapiTabs.d.ts +34 -16
- package/dist/components/navigation/KapiTabs.js +58 -49
- package/dist/components/navigation/KapiTree.d.ts +58 -18
- package/dist/components/navigation/KapiTree.js +135 -83
- package/dist/components/navigation/KapiWizard.d.ts +21 -11
- package/dist/components/navigation/KapiWizard.js +79 -72
- package/dist/components/navigation/MiniNavItem.d.ts +3 -4
- package/dist/components/navigation/MiniNavItem.js +1 -0
- package/dist/components/navigation/breadcrumbLogic.d.ts +1 -1
- package/dist/components/navigation/contextPanelLogic.d.ts +9 -5
- package/dist/components/navigation/filterChipsLogic.d.ts +13 -7
- package/dist/components/navigation/filterChipsLogic.js +12 -14
- package/dist/components/navigation/index.d.ts +75 -39
- package/dist/components/navigation/panelGroupLogic.d.ts +5 -1
- package/dist/components/navigation/panelMini.d.ts +1 -1
- package/dist/components/navigation/panelMini.js +1 -1
- package/dist/components/navigation/tabsLogic.d.ts +3 -2
- package/dist/components/navigation/tabsLogic.js +8 -12
- package/dist/components/navigation/treeLogic.d.ts +5 -5
- package/dist/components/navigation/treeLogic.js +3 -9
- package/dist/components/overlays/KapiCanvasForm.d.ts +8 -8
- package/dist/components/overlays/KapiCanvasForm.js +1 -1
- package/dist/components/overlays/KapiCommandPalette.d.ts +14 -10
- package/dist/components/overlays/KapiCommandPalette.js +70 -67
- package/dist/components/overlays/KapiConfirm.d.ts +28 -11
- package/dist/components/overlays/KapiConfirm.js +47 -44
- package/dist/components/overlays/KapiContextMenu.d.ts +77 -16
- package/dist/components/overlays/KapiContextMenu.js +55 -70
- package/dist/components/overlays/KapiDialogHost.d.ts +5 -7
- package/dist/components/overlays/KapiDialogHost.js +67 -64
- package/dist/components/overlays/KapiDropdown.d.ts +43 -21
- package/dist/components/overlays/KapiDropdown.js +31 -80
- package/dist/components/overlays/KapiLoading.d.ts +10 -5
- package/dist/components/overlays/KapiLoading.js +28 -25
- package/dist/components/overlays/KapiMenuButton.d.ts +48 -17
- package/dist/components/overlays/KapiMenuButton.js +73 -95
- package/dist/components/overlays/KapiModal.d.ts +16 -8
- package/dist/components/overlays/KapiModal.js +72 -65
- package/dist/components/overlays/KapiOffcanvas.d.ts +23 -13
- package/dist/components/overlays/KapiOffcanvas.js +159 -143
- package/dist/components/overlays/KapiOffcanvasStack.d.ts +4 -4
- package/dist/components/overlays/KapiOffcanvasStack.js +63 -52
- package/dist/components/overlays/KapiPhotoView.d.ts +7 -8
- package/dist/components/overlays/KapiPhotoView.js +67 -64
- package/dist/components/overlays/KapiPopover.d.ts +18 -17
- package/dist/components/overlays/KapiPopover.js +32 -42
- package/dist/components/overlays/KapiShapeSheet.d.ts +18 -12
- package/dist/components/overlays/KapiShapeSheet.js +51 -45
- package/dist/components/overlays/KapiSplitModal.d.ts +12 -11
- package/dist/components/overlays/KapiSplitModal.js +78 -68
- package/dist/components/overlays/KapiTooltip.d.ts +20 -10
- package/dist/components/overlays/KapiTooltip.js +91 -68
- package/dist/components/overlays/commandPaletteLogic.d.ts +2 -4
- package/dist/components/overlays/commandPaletteLogic.js +2 -2
- package/dist/components/overlays/dialogStore.d.ts +41 -20
- package/dist/components/overlays/dialogStore.js +4 -4
- package/dist/components/overlays/dialogUtils.d.ts +22 -0
- package/dist/components/overlays/dialogUtils.js +6 -2
- package/dist/components/overlays/index.d.ts +48 -38
- package/dist/components/overlays/menuButtonLogic.d.ts +33 -31
- package/dist/components/overlays/menuButtonLogic.js +9 -3
- package/dist/components/overlays/menuKeyboardLogic.d.ts +42 -8
- package/dist/components/overlays/menuKeyboardLogic.js +46 -15
- package/dist/components/overlays/menuList.d.ts +91 -0
- package/dist/components/overlays/menuList.js +223 -0
- package/dist/components/overlays/modalStack.d.ts +21 -0
- package/dist/components/overlays/modalStack.js +23 -0
- package/dist/components/overlays/offcanvasCompanion.d.ts +1 -1
- package/dist/components/overlays/offcanvasResize.d.ts +1 -1
- package/dist/components/overlays/offcanvasSide.d.ts +12 -1
- package/dist/components/overlays/offcanvasSide.js +4 -4
- package/dist/components/overlays/popoverLogic.d.ts +12 -12
- package/dist/components/overlays/useExitPresence.js +23 -22
- package/dist/components/overlays/useNativeDialog.d.ts +15 -4
- package/dist/components/overlays/useNativeDialog.js +52 -33
- package/dist/components/rootProps.d.ts +6 -4
- package/dist/components/tone.d.ts +55 -0
- package/dist/components/tone.js +92 -0
- package/dist/css/base.css +1 -0
- package/dist/css/components/chat/chat.css +1 -0
- package/dist/css/components/data/KapiBarChart.css +1 -0
- package/dist/css/components/data/KapiEventCalendar.css +1 -0
- package/dist/css/components/data/KapiHeatmap.css +1 -0
- package/dist/css/components/data/KapiLineChart.css +1 -0
- package/dist/css/components/data/KapiSparkline.css +1 -0
- package/dist/css/components/data/KapiTable.css +1 -0
- package/dist/css/components/data/KapiTableFilter.css +1 -0
- package/dist/css/components/display/KapiAnnotation.css +1 -0
- package/dist/css/components/display/KapiComment.css +1 -0
- package/dist/css/components/display/KapiFileItem.css +1 -0
- package/dist/css/components/display/KapiFileViewer.css +1 -0
- package/dist/css/components/display/KapiTruncate.css +1 -0
- package/dist/css/components/display/display.css +1 -0
- package/dist/css/components/feedback/KapiBulkBar.css +1 -0
- package/dist/css/components/feedback/KapiOfflineBanner.css +1 -0
- package/dist/css/components/feedback/KapiUnsavedBar.css +1 -0
- package/dist/css/components/feedback/feedback.css +1 -0
- package/dist/css/components/inputs/KapiAutocomplete.css +1 -0
- package/dist/css/components/inputs/KapiButton.css +1 -0
- package/dist/css/components/inputs/KapiChecklist.css +1 -0
- package/dist/css/components/inputs/KapiDatePicker.css +1 -0
- package/dist/css/components/inputs/KapiFacetedSearch.css +1 -0
- package/dist/css/components/inputs/KapiFileUpload.css +1 -0
- package/dist/css/components/inputs/KapiInputGroup.css +1 -0
- package/dist/css/components/inputs/KapiSearchChip.css +1 -0
- package/dist/css/components/inputs/KapiSelect.css +1 -0
- package/dist/css/components/inputs/KapiTagInput.css +1 -0
- package/dist/css/components/inputs/checkControl.css +1 -0
- package/dist/css/components/inputs/inputsExtra.css +1 -0
- package/dist/css/components/layout/KapiAccessCard.css +1 -0
- package/dist/css/components/layout/KapiAccountMenu.css +1 -0
- package/dist/css/components/layout/KapiCard.css +1 -0
- package/dist/css/components/layout/KapiDivider.css +1 -0
- package/dist/css/components/layout/KapiMasonry.css +1 -0
- package/dist/css/components/layout/KapiNotificationBell.css +1 -0
- package/dist/css/components/layout/KapiPageHeader.css +1 -0
- package/dist/css/components/layout/KapiPanelParts.css +1 -0
- package/dist/css/components/layout/KapiRail.css +1 -0
- package/dist/css/components/layout/KapiRoot.css +1 -0
- package/dist/css/components/layout/KapiScrollArea.css +1 -0
- package/dist/css/components/layout/layout-primitives.css +1 -0
- package/dist/css/components/navigation/KapiFilterChips.css +1 -0
- package/dist/css/components/navigation/KapiNavBadge.css +1 -0
- package/dist/css/components/navigation/KapiSteps.css +1 -0
- package/dist/css/components/navigation/navigation.css +1 -0
- package/dist/css/components/overlays/KapiCommandPalette.css +1 -0
- package/dist/css/components/overlays/KapiConfirm.css +1 -0
- package/dist/css/components/overlays/KapiModal.css +1 -0
- package/dist/css/components/overlays/KapiOffcanvas.css +1 -0
- package/dist/css/components/overlays/KapiPopover.css +1 -0
- package/dist/css/components/overlays/KapiSplitModal.css +1 -0
- package/dist/css/components/overlays/overlays.css +1 -0
- package/dist/css/none.js +1 -0
- package/dist/hooks/dataColorLogic.d.ts +1 -1
- package/dist/hooks/dateFormat.js +13 -13
- package/dist/hooks/directionLogic.d.ts +32 -0
- package/dist/hooks/directionLogic.js +7 -0
- package/dist/hooks/fieldErrorsLogic.d.ts +35 -0
- package/dist/hooks/fieldErrorsLogic.js +13 -0
- package/dist/hooks/focusLogic.js +8 -7
- package/dist/hooks/hotkeyLogic.d.ts +5 -1
- package/dist/hooks/hotkeyLogic.js +2 -2
- package/dist/hooks/index.d.ts +122 -57
- package/dist/hooks/kapiRoot.d.ts +11 -4
- package/dist/hooks/kapiRoot.js +18 -5
- package/dist/hooks/mergeRefs.d.ts +9 -0
- package/dist/hooks/mergeRefs.js +15 -0
- package/dist/hooks/onlineStatusLogic.d.ts +4 -4
- package/dist/hooks/ownerDocument.d.ts +26 -0
- package/dist/hooks/ownerDocument.js +24 -0
- package/dist/hooks/portalRoot.d.ts +19 -0
- package/dist/hooks/portalRoot.js +10 -0
- package/dist/hooks/rafThrottle.d.ts +12 -4
- package/dist/hooks/rafThrottle.js +43 -10
- package/dist/hooks/rangeSelectLogic.d.ts +47 -0
- package/dist/hooks/rangeSelectLogic.js +29 -0
- package/dist/hooks/recentLogic.d.ts +3 -3
- package/dist/hooks/reducedMotion.js +11 -3
- package/dist/hooks/rightClick.d.ts +5 -1
- package/dist/hooks/rightClick.js +16 -15
- package/dist/hooks/scrollCollapseLogic.d.ts +2 -2
- package/dist/hooks/seriesPaletteLogic.d.ts +1 -1
- package/dist/hooks/shallowStable.d.ts +12 -0
- package/dist/hooks/shallowStable.js +17 -0
- package/dist/hooks/slidingIndicatorLogic.d.ts +4 -0
- package/dist/hooks/themeColorsLogic.d.ts +1 -1
- package/dist/hooks/themeDeriveLogic.d.ts +1 -2
- package/dist/hooks/themeRadiiLogic.d.ts +1 -1
- package/dist/hooks/themeScript.d.ts +10 -0
- package/dist/hooks/themeScript.js +5 -0
- package/dist/hooks/useAsyncLoader.d.ts +51 -0
- package/dist/hooks/useAsyncLoader.js +77 -0
- package/dist/hooks/useAsyncTasks.d.ts +19 -0
- package/dist/hooks/useAsyncTasks.js +37 -0
- package/dist/hooks/useBottomBarInset.d.ts +7 -0
- package/dist/hooks/useBottomBarInset.js +25 -0
- package/dist/hooks/useControllableState.d.ts +21 -0
- package/dist/hooks/useControllableState.js +17 -0
- package/dist/hooks/useDismiss.d.ts +40 -0
- package/dist/hooks/useDismiss.js +42 -0
- package/dist/hooks/useDragScroll.d.ts +10 -0
- package/dist/hooks/useDragScroll.js +36 -25
- package/dist/hooks/useFieldErrors.d.ts +39 -0
- package/dist/hooks/useFieldErrors.js +29 -0
- package/dist/hooks/useFocusReturn.d.ts +25 -0
- package/dist/hooks/useFocusReturn.js +31 -0
- package/dist/hooks/useGrowOrigin.d.ts +2 -2
- package/dist/hooks/useHotkey.d.ts +3 -3
- package/dist/hooks/useHydrated.d.ts +2 -0
- package/dist/hooks/useHydrated.js +6 -0
- package/dist/hooks/useKapiTheme.d.ts +3 -2
- package/dist/hooks/useKapiTheme.js +111 -68
- package/dist/hooks/useMediaQuery.d.ts +5 -1
- package/dist/hooks/useMediaQuery.js +5 -9
- package/dist/hooks/useOnlineStatus.d.ts +1 -1
- package/dist/hooks/useOutsidePress.d.ts +9 -0
- package/dist/hooks/useOutsidePress.js +11 -0
- package/dist/hooks/usePersistentState.d.ts +2 -2
- package/dist/hooks/usePersistentState.js +21 -21
- package/dist/hooks/usePlacement.d.ts +6 -5
- package/dist/hooks/usePlacement.js +68 -65
- package/dist/hooks/useRangeSelect.d.ts +24 -0
- package/dist/hooks/useRangeSelect.js +26 -0
- package/dist/hooks/useRecent.d.ts +3 -3
- package/dist/hooks/useScrollCollapse.d.ts +1 -1
- package/dist/hooks/useScrollEdges.d.ts +9 -8
- package/dist/hooks/useScrollEdges.js +62 -57
- package/dist/hooks/useSlidingIndicator.d.ts +1 -1
- package/dist/hooks/useSlidingIndicator.js +38 -33
- package/dist/hooks/useSubmitDraft.js +18 -19
- package/dist/hooks/useTypeahead.d.ts +9 -0
- package/dist/hooks/useTypeahead.js +20 -0
- package/dist/hooks/useUnsavedGuard.d.ts +7 -4
- package/dist/hooks/useUnsavedGuard.js +1 -0
- package/dist/hooks/useVirtualList.d.ts +36 -0
- package/dist/hooks/useVirtualList.js +126 -0
- package/dist/hooks/viewportInsetLogic.d.ts +37 -0
- package/dist/hooks/viewportInsetLogic.js +20 -0
- package/dist/hooks/virtualListLogic.d.ts +88 -0
- package/dist/hooks/virtualListLogic.js +80 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +196 -178
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/package.json +14 -6
|
@@ -1,91 +1,76 @@
|
|
|
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 {
|
|
4
|
+
import { joinClasses as t } from "../rootProps.js";
|
|
5
|
+
import { usePlacement as n } from "../../hooks/usePlacement.js";
|
|
6
|
+
import { useDismiss as r } from "../../hooks/useDismiss.js";
|
|
5
7
|
/* empty css */
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { useMergedRefs as i } from "../../hooks/mergeRefs.js";
|
|
9
|
+
import { POINT_MENU_PLACEMENT as a } from "../../hooks/rightClick.js";
|
|
10
|
+
import { estimateMenuHeight as o } from "./menuButtonLogic.js";
|
|
11
|
+
import { MenuList as s } from "./menuList.js";
|
|
12
|
+
import { useFocusReturn as c } from "../../hooks/useFocusReturn.js";
|
|
13
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
14
|
+
import { useLayoutEffect as f, useRef as p } from "react";
|
|
11
15
|
//#region src/components/overlays/KapiContextMenu.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
let M = (e) => {
|
|
24
|
-
let t = o(e.key);
|
|
25
|
-
t.kind === "move" ? (e.preventDefault(), j(s(i(document.activeElement), t.dir, A))) : t.kind === "close" && (t.returnFocus && (e.preventDefault(), e.stopPropagation()), S());
|
|
26
|
-
}, { placement: N, update: P } = t({
|
|
16
|
+
var m = { menu: "Menú contextual" }, h = 210, g = ({ open: e, ...t }) => e ? /* @__PURE__ */ u(_, { ...t }) : null, _ = ({ x: g, y: _, items: v, onClose: y, className: b, style: x, id: S, ref: C, labels: w, "aria-label": T }) => {
|
|
17
|
+
let E = e("contextMenu", m, w), D = p(null), O = i(D, C);
|
|
18
|
+
c(!0, {
|
|
19
|
+
container: D,
|
|
20
|
+
restoreOnDeactivate: "if-lost"
|
|
21
|
+
});
|
|
22
|
+
let k = r(!0, {
|
|
23
|
+
zones: [D],
|
|
24
|
+
outside: !1,
|
|
25
|
+
onDismiss: () => y()
|
|
26
|
+
}), { placement: A, update: j } = n({
|
|
27
27
|
open: !0,
|
|
28
28
|
anchor: () => ({
|
|
29
|
-
x:
|
|
30
|
-
y:
|
|
29
|
+
x: g,
|
|
30
|
+
y: _
|
|
31
31
|
}),
|
|
32
|
-
floatingRef:
|
|
32
|
+
floatingRef: D,
|
|
33
33
|
estimate: {
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
34
|
+
width: h,
|
|
35
|
+
height: o(v)
|
|
36
36
|
},
|
|
37
|
-
...
|
|
37
|
+
...a,
|
|
38
38
|
hideUntilPlaced: !1
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
f(() => {
|
|
41
|
+
j();
|
|
42
42
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
g,
|
|
44
|
+
_,
|
|
45
|
+
v.length,
|
|
46
|
+
j
|
|
47
47
|
]);
|
|
48
|
-
let
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
let M = A?.left ?? g, N = A?.top ?? _;
|
|
49
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
|
|
50
50
|
className: "kapi-ctxmenu__backdrop",
|
|
51
|
-
onMouseDown:
|
|
51
|
+
onMouseDown: y,
|
|
52
52
|
onContextMenu: (e) => {
|
|
53
|
-
e.preventDefault(),
|
|
53
|
+
e.preventDefault(), y();
|
|
54
54
|
}
|
|
55
|
-
}), /* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
}), /* @__PURE__ */ u(s, {
|
|
56
|
+
ref: O,
|
|
57
|
+
id: S,
|
|
58
|
+
className: t("kapi-ctxmenu", b),
|
|
58
59
|
style: {
|
|
59
|
-
...
|
|
60
|
-
left:
|
|
61
|
-
top:
|
|
62
|
-
width:
|
|
60
|
+
...x,
|
|
61
|
+
left: M,
|
|
62
|
+
top: N,
|
|
63
|
+
width: h
|
|
63
64
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onKeyDown:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
role: "presentation",
|
|
73
|
-
className: "kapi-ctxmenu__header",
|
|
74
|
-
children: e.header
|
|
75
|
-
}, `h${t}`) : /* @__PURE__ */ f("button", {
|
|
76
|
-
type: "button",
|
|
77
|
-
role: "menuitem",
|
|
78
|
-
tabIndex: -1,
|
|
79
|
-
"data-menu-index": t,
|
|
80
|
-
"aria-disabled": e.disabled ? "true" : void 0,
|
|
81
|
-
"aria-current": e.current ? "true" : void 0,
|
|
82
|
-
className: _(e),
|
|
83
|
-
onClick: () => {
|
|
84
|
-
e.disabled || (e.onClick?.(), S());
|
|
85
|
-
},
|
|
86
|
-
children: [e.icon, e.label]
|
|
87
|
-
}, `m${t}`))
|
|
65
|
+
"aria-label": T ?? E.menu,
|
|
66
|
+
items: v,
|
|
67
|
+
focusRequest: 1,
|
|
68
|
+
onKeyDown: k,
|
|
69
|
+
onClose: () => y(),
|
|
70
|
+
onActivate: (e, t) => {
|
|
71
|
+
e.onClick?.(t), e.keepOpen || y();
|
|
72
|
+
}
|
|
88
73
|
})] });
|
|
89
74
|
};
|
|
90
75
|
//#endregion
|
|
91
|
-
export {
|
|
76
|
+
export { m as DEFAULT_CONTEXT_MENU_LABELS, g as KapiContextMenu };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "
|
|
3
|
-
import { type KapiDialogStore } from "./dialogStore";
|
|
4
|
-
import type { KapiLabelsOverride } from "../labelsLogic";
|
|
1
|
+
import { type KapiDialogStore } from "./dialogStore.js";
|
|
2
|
+
import type { KapiLabelsOverride } from "../labelsLogic.js";
|
|
5
3
|
/** Textos fijos del host: botón de los avisos y mensaje de carga por defecto. */
|
|
6
4
|
export type KapiDialogLabels = {
|
|
7
5
|
accept: string;
|
|
@@ -11,11 +9,11 @@ export declare const DEFAULT_DIALOG_LABELS: KapiDialogLabels;
|
|
|
11
9
|
export type KapiDialogHostProps = {
|
|
12
10
|
/** Textos fijos (clave `dialog`). Las confirmaciones usan la clave `confirm`. */
|
|
13
11
|
labels?: KapiLabelsOverride<KapiDialogLabels> | undefined;
|
|
14
|
-
/** Store que atiende (default: el global de `kapiConfirm`/`
|
|
15
|
-
store?: KapiDialogStore;
|
|
12
|
+
/** Store que atiende (default: el global de `kapiConfirm`/`kapiAlertDialog`/`kapiLoading`). */
|
|
13
|
+
store?: KapiDialogStore | undefined;
|
|
16
14
|
};
|
|
17
15
|
/**
|
|
18
|
-
* Montalo una vez en la app: muestra los diálogos imperativos (`kapiConfirm`, `
|
|
16
|
+
* Montalo una vez en la app: muestra los diálogos imperativos (`kapiConfirm`, `kapiAlertDialog`) de a
|
|
19
17
|
* uno, en orden de llegada, y la capa de carga de `kapiLoading` mientras quede alguna abierta.
|
|
20
18
|
* Abrir un diálogo cierra las cargas de `kapiLoading()`; las de `kapiLoading.run` se ocultan hasta
|
|
21
19
|
* que se vacía la cola. Los pedidos hechos antes de montarlo esperan en la cola.
|
|
@@ -1,92 +1,95 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import "#kapi-css/components/overlays/KapiConfirm.css";
|
|
3
|
+
import "#kapi-css/components/overlays/KapiModal.css";
|
|
4
|
+
import { resolveTone as e } from "../tone.js";
|
|
5
|
+
import { KapiButton as t } from "../inputs/KapiButton.js";
|
|
6
|
+
import { useLabels as n } from "../locale/KapiLocaleProvider.js";
|
|
7
|
+
import { useNativeDialog as r, usePortalRoot as i } from "./useNativeDialog.js";
|
|
5
8
|
/* empty css */
|
|
6
|
-
import { KapiModal as
|
|
9
|
+
import { KapiModal as a } from "./KapiModal.js";
|
|
7
10
|
/* empty css */
|
|
8
|
-
import { DEFAULT_CONFIRM_LABELS as
|
|
9
|
-
import { confirmErrorMessage as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { useId as
|
|
12
|
-
import { AlertTriangle as
|
|
13
|
-
import { createPortal as
|
|
11
|
+
import { DEFAULT_CONFIRM_LABELS as o, KapiConfirm as s } from "./KapiConfirm.js";
|
|
12
|
+
import { confirmErrorMessage as c, dialogStore as l } from "./dialogStore.js";
|
|
13
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
14
|
+
import { useId as p, useRef as m, useState as h, useSyncExternalStore as g } from "react";
|
|
15
|
+
import { AlertTriangle as _, CheckCircle2 as v, Info as y, XCircle as b } from "lucide-react";
|
|
16
|
+
import { createPortal as x } from "react-dom";
|
|
14
17
|
//#region src/components/overlays/KapiDialogHost.tsx
|
|
15
|
-
var
|
|
18
|
+
var S = {
|
|
16
19
|
accept: "Aceptar",
|
|
17
20
|
loading: "Cargando…"
|
|
18
|
-
},
|
|
19
|
-
success:
|
|
20
|
-
|
|
21
|
-
info:
|
|
22
|
-
warning:
|
|
23
|
-
},
|
|
24
|
-
let
|
|
25
|
-
return /* @__PURE__ */
|
|
21
|
+
}, C = {
|
|
22
|
+
success: v,
|
|
23
|
+
danger: b,
|
|
24
|
+
info: y,
|
|
25
|
+
warning: _
|
|
26
|
+
}, w = ({ options: n, acceptLabel: r, onClose: i }) => {
|
|
27
|
+
let o = p(), s = e(n.tone, n.variant, "info"), c = s in C ? s : "info", l = C[c];
|
|
28
|
+
return /* @__PURE__ */ f(a, {
|
|
26
29
|
size: "sm",
|
|
27
30
|
hideHeader: !0,
|
|
28
|
-
"aria-labelledby":
|
|
31
|
+
"aria-labelledby": o,
|
|
29
32
|
open: !0,
|
|
30
|
-
onClose:
|
|
31
|
-
footer: /* @__PURE__ */
|
|
33
|
+
onClose: i,
|
|
34
|
+
footer: /* @__PURE__ */ d(t, {
|
|
32
35
|
"data-autofocus": !0,
|
|
33
|
-
|
|
34
|
-
onClick:
|
|
35
|
-
children:
|
|
36
|
+
tone: "primary",
|
|
37
|
+
onClick: i,
|
|
38
|
+
children: n.acceptLabel ?? r
|
|
36
39
|
}),
|
|
37
40
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
className: `kapi-confirm__icon kapi-confirm__icon--${
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ d("div", {
|
|
42
|
+
className: `kapi-confirm__icon kapi-confirm__icon--${c}`,
|
|
43
|
+
children: /* @__PURE__ */ d(l, {
|
|
41
44
|
size: 28,
|
|
42
45
|
strokeWidth: 2
|
|
43
46
|
})
|
|
44
47
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
id:
|
|
48
|
+
/* @__PURE__ */ d("div", {
|
|
49
|
+
id: o,
|
|
47
50
|
className: "kapi-confirm__title",
|
|
48
|
-
children:
|
|
51
|
+
children: n.title
|
|
49
52
|
}),
|
|
50
|
-
|
|
53
|
+
n.message && /* @__PURE__ */ d("div", {
|
|
51
54
|
className: "kapi-confirm__msg",
|
|
52
|
-
children:
|
|
55
|
+
children: n.message
|
|
53
56
|
})
|
|
54
57
|
]
|
|
55
58
|
});
|
|
56
|
-
},
|
|
57
|
-
let r =
|
|
59
|
+
}, T = ({ options: e, onSettle: t }) => {
|
|
60
|
+
let r = n("confirm", o), [i, a] = h({
|
|
58
61
|
busy: !1,
|
|
59
62
|
error: null
|
|
60
|
-
}), l =
|
|
61
|
-
return /* @__PURE__ */
|
|
63
|
+
}), l = m(!1);
|
|
64
|
+
return /* @__PURE__ */ d(s, {
|
|
62
65
|
open: !0,
|
|
63
66
|
title: e.title,
|
|
64
67
|
message: e.message,
|
|
65
|
-
|
|
68
|
+
tone: e.tone ?? e.variant,
|
|
66
69
|
confirmLabel: e.confirmLabel,
|
|
67
70
|
cancelLabel: e.cancelLabel,
|
|
68
71
|
loading: i.busy,
|
|
69
72
|
error: i.error ?? void 0,
|
|
70
73
|
onConfirm: () => {
|
|
71
|
-
let
|
|
72
|
-
if (!
|
|
73
|
-
l.current || (l.current = !0,
|
|
74
|
+
let n = e.onConfirm;
|
|
75
|
+
if (!n) return t(!0);
|
|
76
|
+
l.current || (l.current = !0, a({
|
|
74
77
|
busy: !0,
|
|
75
78
|
error: null
|
|
76
|
-
}), new Promise((e) => e(
|
|
77
|
-
l.current = !1,
|
|
79
|
+
}), new Promise((e) => e(n())).then(() => {
|
|
80
|
+
l.current = !1, t(!0);
|
|
78
81
|
}, (e) => {
|
|
79
|
-
l.current = !1,
|
|
82
|
+
l.current = !1, a({
|
|
80
83
|
busy: !1,
|
|
81
|
-
error:
|
|
84
|
+
error: c(e) ?? r.error
|
|
82
85
|
});
|
|
83
86
|
}));
|
|
84
87
|
},
|
|
85
|
-
onClose: () =>
|
|
88
|
+
onClose: () => t(!1)
|
|
86
89
|
});
|
|
87
|
-
},
|
|
88
|
-
let n =
|
|
89
|
-
return
|
|
90
|
+
}, E = ({ message: e, root: t }) => {
|
|
91
|
+
let n = p(), { ref: i, dialogProps: a } = r();
|
|
92
|
+
return x(/* @__PURE__ */ d("dialog", {
|
|
90
93
|
ref: i,
|
|
91
94
|
className: "kapi-loading-overlay kapi-loading-dialog",
|
|
92
95
|
"aria-modal": "true",
|
|
@@ -94,12 +97,12 @@ var x = {
|
|
|
94
97
|
"aria-labelledby": n,
|
|
95
98
|
tabIndex: -1,
|
|
96
99
|
...a,
|
|
97
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ f("div", {
|
|
98
101
|
className: "kapi-loading",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ d("span", {
|
|
100
103
|
className: "kapi-spinner",
|
|
101
104
|
"aria-hidden": "true"
|
|
102
|
-
}), /* @__PURE__ */
|
|
105
|
+
}), /* @__PURE__ */ d("span", {
|
|
103
106
|
id: n,
|
|
104
107
|
className: "kapi-loading__msg",
|
|
105
108
|
role: "status",
|
|
@@ -107,23 +110,23 @@ var x = {
|
|
|
107
110
|
})]
|
|
108
111
|
})
|
|
109
112
|
}), t);
|
|
110
|
-
},
|
|
111
|
-
let
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
a?.kind === "confirm" && /* @__PURE__ */
|
|
113
|
+
}, D = ({ labels: e, store: t = l }) => {
|
|
114
|
+
let r = n("dialog", S, e), { dialog: a, loading: o } = g(t.subscribe, t.getSnapshot, t.getSnapshot), s = i(), c = o && !a ? s : null;
|
|
115
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
116
|
+
a?.kind === "confirm" && /* @__PURE__ */ d(T, {
|
|
114
117
|
options: a.options,
|
|
115
|
-
onSettle: (e) =>
|
|
118
|
+
onSettle: (e) => t.settle(a.id, e)
|
|
116
119
|
}, a.id),
|
|
117
|
-
a?.kind === "alert" && /* @__PURE__ */
|
|
120
|
+
a?.kind === "alert" && /* @__PURE__ */ d(w, {
|
|
118
121
|
options: a.options,
|
|
119
|
-
acceptLabel:
|
|
120
|
-
onClose: () =>
|
|
122
|
+
acceptLabel: r.accept,
|
|
123
|
+
onClose: () => t.settle(a.id, !1)
|
|
121
124
|
}, a.id),
|
|
122
|
-
!a && o &&
|
|
123
|
-
message: o.message ??
|
|
124
|
-
root:
|
|
125
|
+
!a && o && c && /* @__PURE__ */ d(E, {
|
|
126
|
+
message: o.message ?? r.loading,
|
|
127
|
+
root: c
|
|
125
128
|
})
|
|
126
129
|
] });
|
|
127
130
|
};
|
|
128
131
|
//#endregion
|
|
129
|
-
export {
|
|
132
|
+
export { S as DEFAULT_DIALOG_LABELS, D as KapiDialogHost };
|
|
@@ -1,32 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./overlays.css";
|
|
1
|
+
import type { FocusEvent, HTMLAttributes, ReactNode, Ref } from "react";
|
|
3
2
|
export type KapiDropdownOption = string | number;
|
|
4
3
|
export type KapiDropdownDrop = "down" | "up";
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Atributos nativos (`style`, `data-*`…) van al contenedor `.kapi-dropdown`; `id` y `ref` van al
|
|
6
|
+
* combobox enfocable (contrato de campo).
|
|
7
|
+
* @deprecated Usa `<KapiSelect variant="chip">` con opciones `{ value, label }`. Se mantiene hasta 1.0.
|
|
8
|
+
*/
|
|
9
|
+
export type KapiDropdownProps<T extends KapiDropdownOption = KapiDropdownOption> = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "defaultValue" | "onBlur"> & {
|
|
10
|
+
/** Ref al combobox enfocable (`<div role="combobox">`). */
|
|
11
|
+
ref?: Ref<HTMLDivElement> | undefined;
|
|
12
|
+
/** Opción seleccionada (se muestra en el chip); con ella, el control es controlado. */
|
|
13
|
+
value?: T | undefined;
|
|
14
|
+
/** Valor inicial sin controlar (sin `value`): el control guarda la elección. Sin ninguno de los dos arranca en la primera opción. */
|
|
15
|
+
defaultValue?: T | undefined;
|
|
9
16
|
/** Opciones primitivas; también son la etiqueta visible. */
|
|
10
|
-
options: T[];
|
|
11
|
-
/** Se llama con la opción elegida. */
|
|
12
|
-
onChange
|
|
17
|
+
options: readonly T[];
|
|
18
|
+
/** Se llama con la opción elegida (con su tipo original: un número sigue siendo número). */
|
|
19
|
+
onChange?: ((value: T) => void) | undefined;
|
|
13
20
|
/** Ícono (lucide-react) a la izquierda del chip. */
|
|
14
21
|
icon?: ReactNode;
|
|
15
|
-
/** Prefijo del chip ("Estado: Activo")
|
|
16
|
-
label?: string;
|
|
17
|
-
/**
|
|
18
|
-
drop?: KapiDropdownDrop;
|
|
19
|
-
/** Ancho mínimo del menú en px. */
|
|
20
|
-
minWidth?: number;
|
|
22
|
+
/** Prefijo del chip ("Estado: Activo"); también nombra al control si no hay `aria-label` ni `KapiField`. */
|
|
23
|
+
label?: string | undefined;
|
|
24
|
+
/** Hacia dónde abría el menú. Sin efecto: se da vuelta solo si abajo no entra. @deprecated Lo decide el motor de `KapiSelect`. */
|
|
25
|
+
drop?: KapiDropdownDrop | undefined;
|
|
26
|
+
/** Ancho mínimo del menú en px. Sin efecto: el menú crece al ancho de sus opciones. @deprecated Ya no hace falta. */
|
|
27
|
+
minWidth?: number | undefined;
|
|
21
28
|
/** Deshabilita el control: el chip queda apagado, fuera del orden de tabulación, y el menú no abre. */
|
|
22
|
-
disabled?: boolean;
|
|
29
|
+
disabled?: boolean | undefined;
|
|
30
|
+
/** Nombre del campo: el valor viaja en el `<form>` en un input oculto. */
|
|
31
|
+
name?: string | undefined;
|
|
32
|
+
/** Marca el control inválido (`aria-invalid`). Sin la prop, lo toma del `KapiField`. */
|
|
33
|
+
invalid?: boolean | undefined;
|
|
34
|
+
/** Marca el control obligatorio (`aria-required`). Sin la prop, lo toma del `KapiField`. */
|
|
35
|
+
required?: boolean | undefined;
|
|
36
|
+
/** Se dispara cuando el foco sale del control. */
|
|
37
|
+
onBlur?: ((event: FocusEvent<HTMLElement>) => void) | undefined;
|
|
23
38
|
};
|
|
24
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Clases del menú según hacia dónde abre. Pura y exportada para testear.
|
|
41
|
+
* @deprecated KapiDropdown ya no dibuja su propio menú (usa el de `KapiSelect`).
|
|
42
|
+
*/
|
|
25
43
|
export declare const dropdownMenuClass: (drop?: KapiDropdownDrop) => string;
|
|
26
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Clases de una opción del menú.
|
|
46
|
+
* @deprecated KapiDropdown ya no dibuja su propio menú (usa el de `KapiSelect`).
|
|
47
|
+
*/
|
|
27
48
|
export declare const dropdownItemClass: (selected: boolean) => string;
|
|
28
49
|
/**
|
|
29
|
-
* Select liviano
|
|
30
|
-
*
|
|
50
|
+
* Select liviano tipo chip para filtros, con opciones primitivas.
|
|
51
|
+
* @deprecated Usa `<KapiSelect variant="chip">`: es un envoltorio que convierte las opciones a
|
|
52
|
+
* `{ value, label }` y devuelve en `onChange` la opción con su tipo original. Se mantiene hasta 1.0.
|
|
31
53
|
*/
|
|
32
|
-
export declare const KapiDropdown: <T extends KapiDropdownOption = KapiDropdownOption>({ value, options, onChange, icon, label, drop, minWidth, disabled, className, ...rest }: KapiDropdownProps<T>) => import("react").JSX.Element;
|
|
54
|
+
export declare const KapiDropdown: <T extends KapiDropdownOption = KapiDropdownOption>({ value, defaultValue, options, onChange, icon, label, drop: _drop, minWidth: _minWidth, disabled, name, invalid, required, onBlur, id, ref, className, "aria-label": ariaLabel, ...rest }: KapiDropdownProps<T>) => import("react").JSX.Element;
|
|
@@ -1,87 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import "#kapi-css/components/overlays/overlays.css";
|
|
2
3
|
import { joinClasses as e } from "../rootProps.js";
|
|
4
|
+
import { KapiSelect as t } from "../inputs/KapiSelect.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
import {
|
|
5
|
-
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
-
import { useEffect as c, useId as l, useRef as u, useState as d } from "react";
|
|
7
|
-
import { Check as f, ChevronDown as p } from "lucide-react";
|
|
6
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
8
7
|
//#region src/components/overlays/KapiDropdown.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onKeyDown: R,
|
|
37
|
-
"aria-haspopup": "listbox",
|
|
38
|
-
"aria-expanded": P,
|
|
39
|
-
"aria-controls": P ? A : void 0,
|
|
40
|
-
children: [
|
|
41
|
-
y,
|
|
42
|
-
b && /* @__PURE__ */ s("span", {
|
|
43
|
-
className: "kapi-dropdown__label",
|
|
44
|
-
children: [b, ":"]
|
|
45
|
-
}),
|
|
46
|
-
/* @__PURE__ */ o("span", {
|
|
47
|
-
className: "kapi-strong kapi-dropdown__value",
|
|
48
|
-
children: g
|
|
49
|
-
}),
|
|
50
|
-
/* @__PURE__ */ o(p, {
|
|
51
|
-
size: 14,
|
|
52
|
-
strokeWidth: 2.2,
|
|
53
|
-
color: "var(--kapi-muted-2)"
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
}), P && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("div", {
|
|
57
|
-
className: "kapi-dropdown__backdrop",
|
|
58
|
-
onClick: () => D(!1)
|
|
59
|
-
}), /* @__PURE__ */ o("div", {
|
|
60
|
-
className: m(x),
|
|
61
|
-
style: { minWidth: S },
|
|
62
|
-
role: "listbox",
|
|
63
|
-
id: A,
|
|
64
|
-
"aria-labelledby": k,
|
|
65
|
-
ref: M,
|
|
66
|
-
onKeyDown: L,
|
|
67
|
-
children: _.map((e, t) => /* @__PURE__ */ s("button", {
|
|
68
|
-
type: "button",
|
|
69
|
-
role: "option",
|
|
70
|
-
"aria-selected": e === g,
|
|
71
|
-
tabIndex: -1,
|
|
72
|
-
"data-menu-index": t,
|
|
73
|
-
className: h(e === g),
|
|
74
|
-
onClick: () => {
|
|
75
|
-
v(e), I(!0);
|
|
76
|
-
},
|
|
77
|
-
children: [e, e === g && /* @__PURE__ */ o(f, {
|
|
78
|
-
size: 14,
|
|
79
|
-
strokeWidth: 2.6,
|
|
80
|
-
color: "var(--kapi-primary)"
|
|
81
|
-
})]
|
|
82
|
-
}, e))
|
|
83
|
-
})] })]
|
|
8
|
+
var r = ({ value: r, defaultValue: i, options: a, onChange: o, icon: s, label: c, drop: l, minWidth: u, disabled: d = !1, name: f, invalid: p, required: m, onBlur: h, id: g, ref: _, className: v, "aria-label": y, ...b }) => {
|
|
9
|
+
let x = a.map((e) => ({
|
|
10
|
+
value: String(e),
|
|
11
|
+
label: String(e)
|
|
12
|
+
})), S = i ?? a[0];
|
|
13
|
+
return /* @__PURE__ */ n("div", {
|
|
14
|
+
...b,
|
|
15
|
+
className: e("kapi-dropdown", v),
|
|
16
|
+
children: /* @__PURE__ */ n(t, {
|
|
17
|
+
variant: "chip",
|
|
18
|
+
options: x,
|
|
19
|
+
...r === void 0 ? { defaultValue: S === void 0 ? null : String(S) } : { value: String(r) },
|
|
20
|
+
onChange: (e) => {
|
|
21
|
+
let t = a.find((t) => String(t) === e);
|
|
22
|
+
t !== void 0 && o?.(t);
|
|
23
|
+
},
|
|
24
|
+
icon: s,
|
|
25
|
+
chipLabel: c,
|
|
26
|
+
disabled: d,
|
|
27
|
+
...f === void 0 ? {} : { name: f },
|
|
28
|
+
invalid: p,
|
|
29
|
+
required: m,
|
|
30
|
+
...h ? { onBlur: h } : {},
|
|
31
|
+
...g === void 0 ? {} : { id: g },
|
|
32
|
+
...y === void 0 ? {} : { "aria-label": y },
|
|
33
|
+
..._ ? { ref: _ } : {}
|
|
34
|
+
})
|
|
84
35
|
});
|
|
85
36
|
};
|
|
86
37
|
//#endregion
|
|
87
|
-
export {
|
|
38
|
+
export { r as KapiDropdown };
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
1
|
+
import { type KapiRootProps } from "../rootProps.js";
|
|
2
|
+
/** Textos de `KapiLoading`; se pisan con el `KapiLocaleProvider` (la prop `message` les gana). */
|
|
3
|
+
export type KapiLoadingLabels = {
|
|
4
|
+
/** Texto bajo el spinner cuando no hay `message`. */
|
|
5
|
+
message: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const DEFAULT_LOADING_LABELS: KapiLoadingLabels;
|
|
3
8
|
/** `className`/`style`/`id` van a la tarjeta del spinner (la capa del `<dialog>` cubre la pantalla). */
|
|
4
|
-
export type KapiLoadingProps = KapiRootProps & {
|
|
9
|
+
export type KapiLoadingProps = KapiRootProps<HTMLDivElement> & {
|
|
5
10
|
/** Muestra u oculta la capa de carga (controlado). */
|
|
6
11
|
open: boolean;
|
|
7
|
-
/** Texto bajo el spinner; también nombra al diálogo. */
|
|
8
|
-
message?: string;
|
|
12
|
+
/** Texto bajo el spinner; también nombra al diálogo. Sin valor, `labels.message` ("Cargando…"). */
|
|
13
|
+
message?: string | undefined;
|
|
9
14
|
};
|
|
10
15
|
/**
|
|
11
16
|
* Overlay bloqueante con spinner + mensaje. Controlado por `open`.
|