@kapiuara/ui 0.23.0 → 0.23.1
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/dist/components/chat/KapiChatDivider.js +1 -2
- package/dist/components/chat/KapiChatList.js +15 -16
- package/dist/components/chat/KapiChatThread.js +21 -22
- package/dist/components/chat/KapiComposer.js +23 -24
- package/dist/components/chat/KapiMessageBubble.js +5 -6
- package/dist/components/chat/KapiTypingIndicator.js +5 -6
- package/dist/components/chat/chatLogic.js +1 -2
- package/dist/components/data/KapiBarChart.js +22 -23
- package/dist/components/data/KapiDataTable.js +92 -93
- package/dist/components/data/KapiEventCalendar.js +96 -97
- package/dist/components/data/KapiHeatmap.js +21 -22
- package/dist/components/data/KapiLineChart.js +23 -24
- package/dist/components/data/KapiPagination.js +1 -2
- package/dist/components/data/KapiPaginationFooter.js +5 -6
- package/dist/components/data/KapiScatterChart.js +18 -19
- package/dist/components/data/KapiSheet.js +2 -3
- package/dist/components/data/KapiSparkline.js +1 -2
- package/dist/components/data/KapiTable.js +107 -108
- package/dist/components/data/KapiTableFilter.js +13 -14
- package/dist/components/data/KapiTableFooter.js +21 -22
- package/dist/components/data/KapiTableRow.js +10 -11
- package/dist/components/data/KapiTableToolbar.js +95 -96
- package/dist/components/data/barChartLogic.js +1 -2
- package/dist/components/data/chartFrame.js +13 -14
- package/dist/components/data/datasetSelectionLogic.js +1 -2
- package/dist/components/data/eventCalendarLogic.js +2 -3
- package/dist/components/data/heatmapLogic.js +1 -2
- package/dist/components/data/lineChartLogic.js +1 -2
- package/dist/components/data/rowClickLogic.js +2 -17
- package/dist/components/data/scatterLogic.js +1 -2
- package/dist/components/data/sparklineLogic.js +1 -2
- package/dist/components/data/tableCells.js +14 -15
- package/dist/components/data/tableHeaderMenu.js +1 -2
- package/dist/components/data/tableLabels.js +1 -2
- package/dist/components/data/tableLogic.js +0 -1
- package/dist/components/data/tablePaginationLogic.js +1 -2
- package/dist/components/data/tableResizeLogic.js +1 -2
- package/dist/components/data/tableSlots.js +1 -2
- package/dist/components/data/tableSpanLogic.js +1 -2
- package/dist/components/data/useColumnResize.js +23 -24
- package/dist/components/data/useRowKeyWarning.js +1 -2
- package/dist/components/data/useTableEdges.js +1 -2
- package/dist/components/data/useTableSelection.js +25 -26
- package/dist/components/display/KapiAnchor.js +7 -8
- package/dist/components/display/KapiAnnotation.js +15 -16
- package/dist/components/display/KapiAvatar.js +6 -7
- package/dist/components/display/KapiAvatarGroup.js +15 -16
- package/dist/components/display/KapiBadge.js +1 -2
- package/dist/components/display/KapiCodeBlock.js +14 -15
- package/dist/components/display/KapiComment.js +10 -11
- package/dist/components/display/KapiCommentComposer.js +13 -14
- package/dist/components/display/KapiDescriptionList.js +1 -2
- package/dist/components/display/KapiDiff.js +23 -24
- package/dist/components/display/KapiFileItem.js +13 -14
- package/dist/components/display/KapiFileViewer.js +17 -18
- package/dist/components/display/KapiHighlight.js +2 -3
- package/dist/components/display/KapiIconTile.js +2 -3
- package/dist/components/display/KapiStat.js +8 -9
- package/dist/components/display/KapiTag.js +6 -7
- package/dist/components/display/KapiText.js +5 -6
- package/dist/components/display/KapiTimeline.js +2 -3
- package/dist/components/display/KapiTitle.js +1 -2
- package/dist/components/display/KapiTruncate.js +5 -6
- package/dist/components/display/annotationLogic.js +1 -2
- package/dist/components/display/avatarGroupLogic.js +1 -2
- package/dist/components/display/avatarGroupSlots.js +1 -2
- package/dist/components/display/avatarLogic.js +1 -2
- package/dist/components/display/codeBlockSlots.js +1 -2
- package/dist/components/display/commentLogic.js +1 -2
- package/dist/components/display/diffLogic.js +1 -2
- package/dist/components/display/diffSlots.js +1 -2
- package/dist/components/display/fileItemLogic.js +1 -2
- package/dist/components/display/highlightLogic.js +1 -2
- package/dist/components/display/highlightSlots.js +1 -2
- package/dist/components/display/iconTileLogic.js +1 -2
- package/dist/components/display/statLogic.js +1 -2
- package/dist/components/display/tagLogic.js +1 -2
- package/dist/components/display/textLogic.js +1 -2
- package/dist/components/display/timelineLogic.js +1 -2
- package/dist/components/display/truncateLogic.js +1 -2
- package/dist/components/feedback/KapiAlert.js +6 -7
- package/dist/components/feedback/KapiBulkBar.js +5 -6
- package/dist/components/feedback/KapiCountdown.js +16 -17
- package/dist/components/feedback/KapiEmpty.js +2 -3
- package/dist/components/feedback/KapiFab.js +96 -97
- package/dist/components/feedback/KapiOfflineBanner.js +4 -5
- package/dist/components/feedback/KapiProgress.js +1 -2
- package/dist/components/feedback/KapiSkeleton.js +1 -2
- package/dist/components/feedback/KapiSpinner.js +5 -6
- package/dist/components/feedback/KapiToastContainer.js +28 -29
- package/dist/components/feedback/KapiTour.js +24 -25
- package/dist/components/feedback/KapiUnsavedBar.js +5 -6
- package/dist/components/feedback/alertSlots.js +1 -2
- package/dist/components/feedback/bulkBarLogic.js +1 -2
- package/dist/components/feedback/countdownLogic.js +1 -2
- package/dist/components/feedback/countdownSlots.js +1 -2
- package/dist/components/feedback/emptySlots.js +1 -2
- package/dist/components/feedback/fabLogic.js +1 -2
- package/dist/components/feedback/offlineBannerLogic.js +1 -2
- package/dist/components/feedback/progressLogic.js +1 -2
- package/dist/components/feedback/toastLayer.js +1 -2
- package/dist/components/feedback/toastStore.js +2 -3
- package/dist/components/feedback/tourLogic.js +1 -2
- package/dist/components/feedback/unsavedBarLogic.js +1 -2
- package/dist/components/inputs/KapiAutocomplete.js +23 -24
- package/dist/components/inputs/KapiButton.js +1 -2
- package/dist/components/inputs/KapiCalendar.js +12 -13
- package/dist/components/inputs/KapiCalendarGrid.js +15 -16
- package/dist/components/inputs/KapiCheckCard.js +4 -5
- package/dist/components/inputs/KapiCheckbox.js +1 -2
- package/dist/components/inputs/KapiChecklist.js +62 -63
- package/dist/components/inputs/KapiCopyButton.js +6 -7
- package/dist/components/inputs/KapiDatePicker.js +33 -34
- package/dist/components/inputs/KapiDateRangePicker.js +145 -146
- package/dist/components/inputs/KapiFacetedSearch.js +55 -56
- package/dist/components/inputs/KapiField.js +5 -6
- package/dist/components/inputs/KapiFileUpload.js +26 -27
- package/dist/components/inputs/KapiIconButton.js +1 -2
- package/dist/components/inputs/KapiInput.js +46 -47
- package/dist/components/inputs/KapiInputGroup.js +1 -2
- package/dist/components/inputs/KapiMaskedInput.js +50 -51
- package/dist/components/inputs/KapiNumberStepper.js +49 -50
- package/dist/components/inputs/KapiPinInput.js +9 -10
- package/dist/components/inputs/KapiPropsForm.js +43 -44
- package/dist/components/inputs/KapiRadio.js +1 -2
- package/dist/components/inputs/KapiRating.js +38 -39
- package/dist/components/inputs/KapiSearchChip.js +10 -11
- package/dist/components/inputs/KapiSegmented.js +65 -66
- package/dist/components/inputs/KapiSelect.js +198 -199
- package/dist/components/inputs/KapiSelectMenu.js +1 -2
- package/dist/components/inputs/KapiSlider.js +11 -12
- package/dist/components/inputs/KapiSwitch.js +6 -7
- package/dist/components/inputs/KapiTagInput.js +32 -33
- package/dist/components/inputs/KapiTextarea.js +22 -23
- package/dist/components/inputs/asyncSelectLogic.js +22 -23
- package/dist/components/inputs/autocompleteLogic.js +1 -2
- package/dist/components/inputs/checkControl.js +4 -5
- package/dist/components/inputs/checklistLogic.js +1 -2
- package/dist/components/inputs/copyLogic.js +1 -2
- package/dist/components/inputs/datePickerLogic.js +1 -2
- package/dist/components/inputs/dateRangeLogic.js +1 -2
- package/dist/components/inputs/facetedSearchLogic.js +1 -2
- package/dist/components/inputs/fieldLogic.js +1 -2
- package/dist/components/inputs/fileUploadLogic.js +1 -2
- package/dist/components/inputs/formBridgeLogic.js +1 -2
- package/dist/components/inputs/inputGroupLogic.js +1 -2
- package/dist/components/inputs/inputLogic.js +1 -2
- package/dist/components/inputs/maskLogic.js +0 -1
- package/dist/components/inputs/misuseWarnings.js +1 -2
- package/dist/components/inputs/numberStepLogic.js +1 -2
- package/dist/components/inputs/ownField.js +9 -10
- package/dist/components/inputs/pinInputLogic.js +1 -2
- package/dist/components/inputs/propsFormLogic.js +1 -2
- package/dist/components/inputs/ratingLogic.js +1 -2
- package/dist/components/inputs/searchChipLogic.js +1 -2
- package/dist/components/inputs/segmentedLogic.js +1 -2
- package/dist/components/inputs/selectKeyLogic.js +1 -2
- package/dist/components/inputs/selectLogic.js +1 -2
- package/dist/components/inputs/selectSlots.js +1 -2
- package/dist/components/inputs/sliderLogic.js +1 -2
- package/dist/components/inputs/tagInputLogic.js +1 -2
- package/dist/components/inputs/textareaLogic.js +1 -2
- package/dist/components/inputs/useCalendarFocus.js +1 -2
- package/dist/components/inputs/useDatePopSide.js +1 -2
- package/dist/components/inputs/useSelectCreate.js +1 -2
- package/dist/components/inputs/useSelectSource.js +11 -12
- package/dist/components/labelsLogic.js +1 -2
- package/dist/components/layout/KapiAccessCard.js +10 -11
- package/dist/components/layout/KapiAccountMenu.js +24 -25
- package/dist/components/layout/KapiBox.js +5 -6
- package/dist/components/layout/KapiCard.js +18 -19
- package/dist/components/layout/KapiCenter.js +1 -2
- package/dist/components/layout/KapiCluster.js +1 -2
- package/dist/components/layout/KapiCol.js +1 -2
- package/dist/components/layout/KapiCollapse.js +1 -2
- package/dist/components/layout/KapiContextSlot.js +98 -99
- package/dist/components/layout/KapiDivider.js +1 -2
- package/dist/components/layout/KapiGrid.js +9 -10
- package/dist/components/layout/KapiMasonry.js +1 -2
- package/dist/components/layout/KapiNotificationBell.js +53 -54
- package/dist/components/layout/KapiPageHeader.js +42 -43
- package/dist/components/layout/KapiPanelParts.js +43 -44
- package/dist/components/layout/KapiRail.js +103 -104
- package/dist/components/layout/KapiRailAccount.js +11 -12
- package/dist/components/layout/KapiRoot.js +33 -34
- package/dist/components/layout/KapiScrollArea.js +7 -8
- package/dist/components/layout/KapiShell.js +8 -9
- package/dist/components/layout/KapiStack.js +1 -2
- package/dist/components/layout/KapiThemeScript.js +1 -2
- package/dist/components/layout/accessCardLogic.js +1 -2
- package/dist/components/layout/cardLogic.js +1 -2
- package/dist/components/layout/cardSlots.js +1 -2
- package/dist/components/layout/gridSpanLogic.js +1 -2
- package/dist/components/layout/layoutPrimitives.js +1 -2
- package/dist/components/layout/masonryLogic.js +1 -2
- package/dist/components/layout/notificationBellLogic.js +1 -2
- package/dist/components/layout/pageHeaderLogic.js +1 -2
- package/dist/components/layout/pageHeaderSlots.js +1 -2
- package/dist/components/layout/railContext.js +1 -2
- package/dist/components/layout/railLogic.js +1 -2
- package/dist/components/layout/railSlots.js +1 -2
- package/dist/components/layout/reopenBus.js +1 -2
- package/dist/components/layout/shellSlots.js +1 -2
- package/dist/components/layout/useGridBreakpoint.js +1 -2
- package/dist/components/layout/useMasonrySpans.js +6 -7
- package/dist/components/layout/useRailOverflow.js +7 -8
- package/dist/components/locale/KapiLocaleProvider.js +1 -2
- package/dist/components/locale/linkLabels.js +1 -2
- package/dist/components/locale/localeLogic.js +1 -2
- package/dist/components/navigation/CtxSlidingList.js +7 -8
- package/dist/components/navigation/KapiAccordion.js +11 -12
- package/dist/components/navigation/KapiBreadcrumb.js +11 -12
- package/dist/components/navigation/KapiCollapsiblePanel.js +13 -14
- package/dist/components/navigation/KapiContextPanel.js +138 -139
- package/dist/components/navigation/KapiFilterChips.js +25 -22
- package/dist/components/navigation/KapiNavBadge.js +6 -7
- package/dist/components/navigation/KapiPanelGroup.js +34 -35
- package/dist/components/navigation/KapiSteps.js +41 -36
- package/dist/components/navigation/KapiTabs.js +40 -41
- package/dist/components/navigation/KapiToc.js +15 -16
- package/dist/components/navigation/KapiTree.js +126 -124
- package/dist/components/navigation/KapiWizard.js +12 -13
- package/dist/components/navigation/MiniNavItem.js +11 -12
- package/dist/components/navigation/accordionLogic.js +1 -2
- package/dist/components/navigation/activeItemLogic.js +1 -2
- package/dist/components/navigation/breadcrumbLogic.js +1 -2
- package/dist/components/navigation/contextPanelLogic.js +1 -2
- package/dist/components/navigation/filterChipsLogic.d.ts +9 -1
- package/dist/components/navigation/filterChipsLogic.js +2 -3
- package/dist/components/navigation/navBadgeLogic.js +1 -2
- package/dist/components/navigation/navLink.js +1 -2
- package/dist/components/navigation/navLinkLogic.js +1 -2
- package/dist/components/navigation/panelGroupLogic.js +1 -2
- package/dist/components/navigation/panelMini.js +0 -1
- package/dist/components/navigation/panelMiniLogic.js +1 -2
- package/dist/components/navigation/stepsLogic.js +1 -2
- package/dist/components/navigation/tabsLogic.js +1 -2
- package/dist/components/navigation/tocLogic.js +1 -2
- package/dist/components/navigation/tocSlots.js +1 -2
- package/dist/components/navigation/treeLogic.js +1 -2
- package/dist/components/navigation/wizardLogic.js +1 -2
- package/dist/components/overlays/KapiCanvasForm.js +5 -6
- package/dist/components/overlays/KapiCommandPalette.js +45 -45
- package/dist/components/overlays/KapiConfirm.js +9 -10
- package/dist/components/overlays/KapiContextMenu.js +16 -17
- package/dist/components/overlays/KapiDialogHost.js +50 -51
- package/dist/components/overlays/KapiDropdown.js +2 -3
- package/dist/components/overlays/KapiImageViewer.js +8 -9
- package/dist/components/overlays/KapiLoading.js +7 -8
- package/dist/components/overlays/KapiMenuButton.js +19 -20
- package/dist/components/overlays/KapiModal.js +58 -59
- package/dist/components/overlays/KapiOffcanvas.js +146 -147
- package/dist/components/overlays/KapiOffcanvasStack.js +18 -19
- package/dist/components/overlays/KapiPhotoView.js +21 -22
- package/dist/components/overlays/KapiPopover.js +12 -13
- package/dist/components/overlays/KapiShapeSheet.js +11 -12
- package/dist/components/overlays/KapiShortcutsHelp.js +18 -19
- package/dist/components/overlays/KapiSplitModal.js +20 -21
- package/dist/components/overlays/KapiTooltip.js +46 -47
- package/dist/components/overlays/KapiViewport.js +17 -18
- package/dist/components/overlays/canvasFormLogic.js +1 -2
- package/dist/components/overlays/commandPaletteLogic.js +1 -2
- package/dist/components/overlays/dialogStore.js +3 -4
- package/dist/components/overlays/dialogUtils.js +1 -2
- package/dist/components/overlays/exitPresenceLogic.js +1 -2
- package/dist/components/overlays/menuButtonLogic.js +1 -2
- package/dist/components/overlays/menuKeyboardLogic.js +1 -2
- package/dist/components/overlays/menuList.js +94 -95
- package/dist/components/overlays/modalSlots.js +1 -2
- package/dist/components/overlays/modalStack.js +1 -2
- package/dist/components/overlays/offcanvasCompanion.js +1 -2
- package/dist/components/overlays/offcanvasResize.js +0 -1
- package/dist/components/overlays/offcanvasSide.js +1 -2
- package/dist/components/overlays/offcanvasStack.js +1 -2
- package/dist/components/overlays/overlayPortal.js +1 -2
- package/dist/components/overlays/popoverLogic.js +1 -2
- package/dist/components/overlays/shortcutsHelpSlots.js +1 -2
- package/dist/components/overlays/splitModalLayout.js +1 -2
- package/dist/components/overlays/useExitPresence.js +11 -12
- package/dist/components/overlays/useNativeDialog.js +21 -22
- package/dist/components/overlays/viewportLogic.js +1 -2
- package/dist/components/renderSlot.js +1 -2
- package/dist/components/rootProps.js +1 -2
- package/dist/components/slotCatalog.js +33 -34
- package/dist/components/slotsLogic.js +1 -2
- package/dist/components/tone.js +1 -2
- package/dist/css/components/overlays/KapiViewport.css +1 -1
- package/dist/hooks/asyncResourceLogic.js +1 -2
- package/dist/hooks/breakpointOpenLogic.js +1 -2
- package/dist/hooks/colorLogic.js +1 -2
- package/dist/hooks/dateFormat.js +1 -2
- package/dist/hooks/densityLogic.js +1 -2
- package/dist/hooks/directionLogic.js +1 -2
- package/dist/hooks/downloadLogic.js +1 -2
- package/dist/hooks/elementSizeLogic.js +1 -2
- package/dist/hooks/fieldErrorsLogic.js +1 -2
- package/dist/hooks/focusLogic.js +2 -11
- package/dist/hooks/growOriginLogic.js +1 -2
- package/dist/hooks/hotkeyLogic.js +1 -2
- package/dist/hooks/hotkeyRegistry.js +1 -2
- package/dist/hooks/kapiRoot.js +2 -3
- package/dist/hooks/mergeRefs.js +1 -2
- package/dist/hooks/numberFormatLogic.js +1 -2
- package/dist/hooks/onlineStatusLogic.js +1 -2
- package/dist/hooks/ownerDocument.js +1 -2
- package/dist/hooks/persistentStateLogic.js +1 -2
- package/dist/hooks/portalRoot.js +1 -2
- package/dist/hooks/rafThrottle.js +1 -2
- package/dist/hooks/rangeSelectLogic.js +1 -2
- package/dist/hooks/recentLogic.js +1 -2
- package/dist/hooks/reducedMotion.js +8 -9
- package/dist/hooks/rightClick.js +10 -11
- package/dist/hooks/scrollCollapseLogic.js +1 -2
- package/dist/hooks/scrollEdgesLogic.js +1 -2
- package/dist/hooks/shallowStable.js +1 -2
- package/dist/hooks/slidingIndicatorLogic.js +1 -2
- package/dist/hooks/storageLogic.js +1 -2
- package/dist/hooks/themeColorsLogic.js +1 -2
- package/dist/hooks/themeContrastLogic.js +1 -2
- package/dist/hooks/themeDeriveLogic.js +0 -1
- package/dist/hooks/themeRadiiLogic.js +1 -2
- package/dist/hooks/themeScript.js +1 -2
- package/dist/hooks/toneFamilyLogic.js +1 -2
- package/dist/hooks/unsavedGuardLogic.js +1 -2
- package/dist/hooks/useAsyncLoader.js +1 -2
- package/dist/hooks/useAsyncResource.js +5 -6
- package/dist/hooks/useAsyncTasks.js +1 -2
- package/dist/hooks/useBottomBarInset.js +9 -10
- package/dist/hooks/useControllableState.js +1 -2
- package/dist/hooks/useDebouncedValue.js +1 -2
- package/dist/hooks/useDisclosure.js +1 -2
- package/dist/hooks/useDismiss.js +10 -11
- package/dist/hooks/useDragScroll.js +12 -13
- package/dist/hooks/useElementSize.js +1 -2
- package/dist/hooks/useFieldErrors.js +1 -2
- package/dist/hooks/useFocusReturn.js +1 -2
- package/dist/hooks/useFormReset.js +1 -2
- package/dist/hooks/useGlobalRightClick.js +1 -2
- package/dist/hooks/useGrowOrigin.js +1 -2
- package/dist/hooks/useHotkey.js +1 -2
- package/dist/hooks/useHydrated.js +1 -2
- package/dist/hooks/useKapiTheme.js +55 -56
- package/dist/hooks/useMediaQuery.js +1 -2
- package/dist/hooks/useObjectUrl.js +1 -2
- package/dist/hooks/useOnlineStatus.js +1 -2
- package/dist/hooks/useOutsidePress.js +1 -2
- package/dist/hooks/usePersistentState.js +9 -10
- package/dist/hooks/usePlacement.js +15 -16
- package/dist/hooks/useRangeSelect.js +2 -3
- package/dist/hooks/useRecent.js +6 -7
- package/dist/hooks/useScrollCollapse.js +1 -2
- package/dist/hooks/useScrollEdges.js +25 -26
- package/dist/hooks/useSlidingIndicator.js +19 -20
- package/dist/hooks/useSubmitDraft.js +1 -2
- package/dist/hooks/useToneFamilies.js +0 -1
- package/dist/hooks/useTypeahead.js +1 -2
- package/dist/hooks/useUnsavedGuard.js +5 -6
- package/dist/hooks/useVirtualList.js +1 -2
- package/dist/hooks/useWheelZoom.js +1 -2
- package/dist/hooks/viewportInsetLogic.js +1 -2
- package/dist/hooks/virtualListLogic.js +0 -1
- package/dist/hooks/wheelZoomLogic.js +1 -2
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/dist/logic.js +45 -45
- package/package.json +16 -16
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { usePlacement as e } from "../../hooks/usePlacement.js";
|
|
3
|
+
import { useTypeahead as t } from "../../hooks/useTypeahead.js";
|
|
4
|
+
import { DEFAULT_LINK_LABELS as n } from "../locale/linkLabels.js";
|
|
5
5
|
import { useLabels as r } from "../locale/KapiLocaleProvider.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { joinClasses as i } from "../rootProps.js";
|
|
7
|
+
import { renderSlot as a } from "../renderSlot.js";
|
|
8
|
+
import { resolveMenuItemTone as o } from "../tone.js";
|
|
9
|
+
import { actionableIndexes as s, isActionMenuItem as c, matchMenuTypeahead as l, menuItemRole as u, submenuKeyAction as d } from "./menuButtonLogic.js";
|
|
10
|
+
import { initialMenuFocus as f, isTypeaheadKey as p, menuKeyIntent as m, nextEnabledIndex as h } from "./menuKeyboardLogic.js";
|
|
11
|
+
import { logicalKeyOf as g } from "../../hooks/directionLogic.js";
|
|
12
|
+
import { activeElementOf as _ } from "../../hooks/ownerDocument.js";
|
|
13
13
|
import { useEffect as v, useId as y, useRef as b, useState as x } from "react";
|
|
14
14
|
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
15
15
|
import { Check as T, ChevronRight as E, Circle as D } from "lucide-react";
|
|
@@ -19,49 +19,49 @@ var O = {
|
|
|
19
19
|
offset: 4,
|
|
20
20
|
flip: "auto",
|
|
21
21
|
shift: !0
|
|
22
|
-
}, k = (
|
|
23
|
-
let t = b([]), n = b(null), r = b(void 0), [
|
|
22
|
+
}, k = (e) => i("kapi-ctxmenu__item", o(e.tone, e.danger) === "danger" && "is-danger", e.disabled && "is-disabled", e.current && "is-current"), A = (e) => {
|
|
23
|
+
let t = b([]), n = b(null), r = b(void 0), [i, a] = x(null);
|
|
24
24
|
v(() => () => clearTimeout(r.current), []);
|
|
25
|
-
let
|
|
25
|
+
let o = (e) => t.current[e]?.focus(), s = (e, t) => a((n) => ({
|
|
26
26
|
index: e,
|
|
27
27
|
focus: t ? (n?.focus ?? 0) + 1 : n?.index === e ? n.focus : 0
|
|
28
28
|
})), l = () => {
|
|
29
|
-
|
|
29
|
+
i !== null && (n.current?.contains(_(n.current)) && o(i.index), a(null));
|
|
30
30
|
}, u = (t) => {
|
|
31
31
|
let n = e[t];
|
|
32
|
-
return n !== void 0 &&
|
|
32
|
+
return n !== void 0 && c(n) && !n.disabled && (n.items?.length ?? 0) > 0;
|
|
33
33
|
}, d = (e) => {
|
|
34
|
-
clearTimeout(r.current),
|
|
35
|
-
u(e) ?
|
|
34
|
+
clearTimeout(r.current), i?.index !== e && (r.current = setTimeout(() => {
|
|
35
|
+
u(e) ? s(e, !1) : l();
|
|
36
36
|
}, 200));
|
|
37
37
|
}, f = () => clearTimeout(r.current);
|
|
38
38
|
return {
|
|
39
39
|
itemEls: t,
|
|
40
|
-
focusItem:
|
|
41
|
-
sub:
|
|
42
|
-
openSub:
|
|
40
|
+
focusItem: o,
|
|
41
|
+
sub: i,
|
|
42
|
+
openSub: s,
|
|
43
43
|
closeSub: l,
|
|
44
44
|
hasSubmenu: u,
|
|
45
45
|
entryProps: (e) => ({
|
|
46
46
|
itemRef: (n) => {
|
|
47
47
|
t.current[e] = n;
|
|
48
48
|
},
|
|
49
|
-
subOpen:
|
|
50
|
-
subFocus:
|
|
49
|
+
subOpen: i?.index === e && u(e),
|
|
50
|
+
subFocus: i?.index === e ? i.focus : 0,
|
|
51
51
|
subRef: n,
|
|
52
|
-
onToggleSub: () =>
|
|
52
|
+
onToggleSub: () => i?.index === e ? l() : s(e, !0),
|
|
53
53
|
onBackFromSub: () => {
|
|
54
|
-
|
|
54
|
+
a(null), o(e);
|
|
55
55
|
},
|
|
56
56
|
onEnter: () => d(e),
|
|
57
57
|
onLeave: f
|
|
58
58
|
})
|
|
59
59
|
};
|
|
60
|
-
}, j = ({ items: e, onActivate:
|
|
61
|
-
let E = r("link",
|
|
60
|
+
}, j = ({ items: e, onActivate: i, onClose: a, focusRequest: o, onBack: c, onKeyDown: u, ref: y, id: b, className: x, style: S, "aria-label": w, "aria-labelledby": T }) => {
|
|
61
|
+
let E = r("link", n), D = t(500), O = A(e), { itemEls: k, focusItem: j, openSub: N, hasSubmenu: P } = O, F = s(e), I = c !== void 0;
|
|
62
62
|
return v(() => {
|
|
63
|
-
|
|
64
|
-
}, [
|
|
63
|
+
o > 0 && j(f(F));
|
|
64
|
+
}, [o]), /* @__PURE__ */ C("div", {
|
|
65
65
|
ref: y,
|
|
66
66
|
id: b,
|
|
67
67
|
role: "menu",
|
|
@@ -70,72 +70,72 @@ var O = {
|
|
|
70
70
|
"aria-label": w,
|
|
71
71
|
"aria-labelledby": T,
|
|
72
72
|
onKeyDown: (t) => {
|
|
73
|
-
let
|
|
73
|
+
let n = _(t.currentTarget), r = k.current.findIndex((e) => e !== null && e === n), i = () => {
|
|
74
74
|
t.preventDefault(), I && t.stopPropagation();
|
|
75
|
-
},
|
|
76
|
-
if (
|
|
77
|
-
|
|
75
|
+
}, o = m(t.key);
|
|
76
|
+
if (o.kind === "move") {
|
|
77
|
+
i(), j(h(r, o.dir, F));
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
let
|
|
81
|
-
hasSubmenu:
|
|
80
|
+
let s = d(g(t), {
|
|
81
|
+
hasSubmenu: r >= 0 && P(r),
|
|
82
82
|
nested: I
|
|
83
83
|
});
|
|
84
|
-
if (
|
|
85
|
-
else if (
|
|
86
|
-
else if (
|
|
84
|
+
if (s === "open") i(), N(r, !0);
|
|
85
|
+
else if (s === "back") i(), c?.();
|
|
86
|
+
else if (o.kind === "close") {
|
|
87
87
|
if (I) return;
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
} else if (
|
|
91
|
-
let n =
|
|
92
|
-
n >= 0 && (
|
|
88
|
+
if (o.returnFocus) return u?.(t);
|
|
89
|
+
a(!1);
|
|
90
|
+
} else if (p(t.key) && !t.ctrlKey && !t.metaKey && !t.altKey) {
|
|
91
|
+
let n = l(e, r, D(t.key));
|
|
92
|
+
n >= 0 && (i(), j(n));
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
|
-
children: e.map((e,
|
|
95
|
+
children: e.map((e, t) => e.sep ? /* @__PURE__ */ C("div", {
|
|
96
96
|
role: "separator",
|
|
97
97
|
className: "kapi-ctxmenu__sep"
|
|
98
|
-
}, `s${
|
|
98
|
+
}, `s${t}`) : "header" in e ? /* @__PURE__ */ C("div", {
|
|
99
99
|
role: "presentation",
|
|
100
100
|
className: "kapi-ctxmenu__header",
|
|
101
101
|
children: e.header
|
|
102
|
-
}, `h${
|
|
103
|
-
...O.entryProps(
|
|
102
|
+
}, `h${t}`) : /* @__PURE__ */ C(M, {
|
|
103
|
+
...O.entryProps(t),
|
|
104
104
|
item: e,
|
|
105
|
-
index:
|
|
105
|
+
index: t,
|
|
106
106
|
newTabLabel: E.newTab,
|
|
107
|
-
onActivate:
|
|
108
|
-
onClose:
|
|
109
|
-
}, e.id ?? `m${
|
|
107
|
+
onActivate: i,
|
|
108
|
+
onClose: a
|
|
109
|
+
}, e.id ?? `m${t}`))
|
|
110
110
|
});
|
|
111
|
-
}, M = ({ item:
|
|
112
|
-
let g = y(), _ = y(), v = b(null), x =
|
|
113
|
-
v.current = e,
|
|
111
|
+
}, M = ({ item: e, index: t, newTabLabel: n, itemRef: r, subOpen: o, subFocus: s, subRef: c, onToggleSub: l, onBackFromSub: d, onActivate: f, onClose: p, onEnter: m, onLeave: h }) => {
|
|
112
|
+
let g = y(), _ = y(), v = b(null), x = u(e), O = x !== "menuitem", A = e.items !== void 0 && e.items.length > 0 ? e.items : null, j = e.href !== void 0 && e.target === "_blank", M = typeof e.label != "string" && e.textValue !== void 0 ? j ? `${e.textValue} ${n}` : e.textValue : void 0, P = (e) => {
|
|
113
|
+
v.current = e, r(e);
|
|
114
114
|
}, F = {
|
|
115
115
|
id: A ? g : void 0,
|
|
116
116
|
role: x,
|
|
117
117
|
tabIndex: -1,
|
|
118
|
-
"data-menu-index":
|
|
119
|
-
"data-menu-id":
|
|
120
|
-
"aria-disabled":
|
|
121
|
-
"aria-current":
|
|
122
|
-
"aria-checked": O ?
|
|
123
|
-
"aria-keyshortcuts":
|
|
124
|
-
"aria-describedby":
|
|
118
|
+
"data-menu-index": t,
|
|
119
|
+
"data-menu-id": e.id,
|
|
120
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
121
|
+
"aria-current": e.current ? "true" : void 0,
|
|
122
|
+
"aria-checked": O ? e.checked === !0 : void 0,
|
|
123
|
+
"aria-keyshortcuts": e.shortcut,
|
|
124
|
+
"aria-describedby": e.description === void 0 ? void 0 : _,
|
|
125
125
|
"aria-haspopup": A ? "menu" : void 0,
|
|
126
126
|
"aria-expanded": A ? o : void 0,
|
|
127
127
|
"aria-label": M,
|
|
128
|
-
className:
|
|
129
|
-
onClick: (
|
|
130
|
-
|
|
128
|
+
className: i(k(e), O && "is-checkable", o && "is-open"),
|
|
129
|
+
onClick: (t) => {
|
|
130
|
+
e.disabled ? t.preventDefault() : A ? (t.preventDefault(), l()) : f(e, t);
|
|
131
131
|
},
|
|
132
|
-
onMouseEnter:
|
|
133
|
-
onMouseLeave:
|
|
132
|
+
onMouseEnter: m,
|
|
133
|
+
onMouseLeave: h
|
|
134
134
|
}, I = /* @__PURE__ */ w(S, { children: [
|
|
135
135
|
O && /* @__PURE__ */ C("span", {
|
|
136
136
|
className: "kapi-ctxmenu__check",
|
|
137
137
|
"aria-hidden": "true",
|
|
138
|
-
children:
|
|
138
|
+
children: e.checked === !0 && (x === "menuitemradio" ? /* @__PURE__ */ C(D, {
|
|
139
139
|
size: 8,
|
|
140
140
|
fill: "currentColor",
|
|
141
141
|
strokeWidth: 0
|
|
@@ -144,27 +144,27 @@ var O = {
|
|
|
144
144
|
strokeWidth: 2.4
|
|
145
145
|
}))
|
|
146
146
|
}),
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
e.icon,
|
|
148
|
+
e.description === void 0 ? e.label : /* @__PURE__ */ w("span", {
|
|
149
149
|
className: "kapi-ctxmenu__text",
|
|
150
150
|
children: [/* @__PURE__ */ C("span", {
|
|
151
151
|
className: "kapi-ctxmenu__label",
|
|
152
|
-
children:
|
|
152
|
+
children: e.label
|
|
153
153
|
}), /* @__PURE__ */ C("span", {
|
|
154
154
|
id: _,
|
|
155
155
|
className: "kapi-ctxmenu__desc",
|
|
156
156
|
"aria-hidden": "true",
|
|
157
|
-
children:
|
|
157
|
+
children: e.description
|
|
158
158
|
})]
|
|
159
159
|
}),
|
|
160
160
|
j && M === void 0 && /* @__PURE__ */ w(S, { children: [" ", /* @__PURE__ */ C("span", {
|
|
161
161
|
className: "kapi-sr-only",
|
|
162
|
-
children:
|
|
162
|
+
children: n
|
|
163
163
|
})] }),
|
|
164
|
-
|
|
164
|
+
e.shortcut !== void 0 && /* @__PURE__ */ C("kbd", {
|
|
165
165
|
className: "kapi-ctxmenu__kbd",
|
|
166
166
|
"aria-hidden": "true",
|
|
167
|
-
children:
|
|
167
|
+
children: e.shortcut
|
|
168
168
|
}),
|
|
169
169
|
A && /* @__PURE__ */ C(E, {
|
|
170
170
|
className: "kapi-ctxmenu__chev kapi-flip-rtl",
|
|
@@ -172,7 +172,7 @@ var O = {
|
|
|
172
172
|
strokeWidth: 2.2,
|
|
173
173
|
"aria-hidden": "true"
|
|
174
174
|
})
|
|
175
|
-
] }), { className: L, onClick: R, onMouseEnter: z, onMouseLeave: B, ...V } = F, H =
|
|
175
|
+
] }), { className: L, onClick: R, onMouseEnter: z, onMouseLeave: B, ...V } = F, H = e.render !== void 0 && !A ? a(e.render, {
|
|
176
176
|
className: L,
|
|
177
177
|
onClick: R,
|
|
178
178
|
onMouseEnter: z,
|
|
@@ -181,13 +181,13 @@ var O = {
|
|
|
181
181
|
...V,
|
|
182
182
|
ref: P,
|
|
183
183
|
children: I
|
|
184
|
-
}, (e) => /* @__PURE__ */ C("a", { ...e })) :
|
|
184
|
+
}, (e) => /* @__PURE__ */ C("a", { ...e })) : e.href !== void 0 && !A ? /* @__PURE__ */ C("a", {
|
|
185
185
|
ref: P,
|
|
186
186
|
...F,
|
|
187
|
-
href:
|
|
188
|
-
target:
|
|
189
|
-
rel:
|
|
190
|
-
download:
|
|
187
|
+
href: e.disabled ? void 0 : e.href,
|
|
188
|
+
target: e.target,
|
|
189
|
+
rel: e.rel ?? (j ? "noopener noreferrer" : void 0),
|
|
190
|
+
download: e.download,
|
|
191
191
|
children: I
|
|
192
192
|
}) : /* @__PURE__ */ C("button", {
|
|
193
193
|
ref: P,
|
|
@@ -204,30 +204,29 @@ var O = {
|
|
|
204
204
|
menuRef: c,
|
|
205
205
|
labelledBy: g,
|
|
206
206
|
focusRequest: s,
|
|
207
|
-
onBack:
|
|
208
|
-
onActivate:
|
|
209
|
-
onClose:
|
|
207
|
+
onBack: d,
|
|
208
|
+
onActivate: f,
|
|
209
|
+
onClose: p
|
|
210
210
|
})]
|
|
211
211
|
}) : H;
|
|
212
|
-
}, N = ({ items:
|
|
213
|
-
let { style:
|
|
212
|
+
}, N = ({ items: t, anchorRef: n, menuRef: r, labelledBy: i, focusRequest: a, onBack: o, onActivate: s, onClose: c }) => {
|
|
213
|
+
let { style: l } = e({
|
|
214
214
|
open: !0,
|
|
215
|
-
anchor:
|
|
216
|
-
floatingRef:
|
|
215
|
+
anchor: n,
|
|
216
|
+
floatingRef: r,
|
|
217
217
|
...O,
|
|
218
218
|
hideUntilPlaced: !1
|
|
219
219
|
});
|
|
220
220
|
return /* @__PURE__ */ C(j, {
|
|
221
|
-
ref:
|
|
222
|
-
items:
|
|
221
|
+
ref: r,
|
|
222
|
+
items: t,
|
|
223
223
|
className: "kapi-ctxmenu kapi-ctxmenu--sub",
|
|
224
|
-
style:
|
|
225
|
-
"aria-labelledby":
|
|
226
|
-
focusRequest:
|
|
227
|
-
onBack:
|
|
228
|
-
onActivate:
|
|
229
|
-
onClose:
|
|
224
|
+
style: l,
|
|
225
|
+
"aria-labelledby": i,
|
|
226
|
+
focusRequest: a,
|
|
227
|
+
onBack: o,
|
|
228
|
+
onActivate: s,
|
|
229
|
+
onClose: c
|
|
230
230
|
});
|
|
231
231
|
};
|
|
232
|
-
//#endregion
|
|
233
232
|
export { M as MenuEntry, j as MenuList, k as menuItemClass, A as useMenuSubmenus };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSlots as e } from "../slotsLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/overlays/modalSlots.ts
|
|
3
3
|
var t = e("modal", {
|
|
4
4
|
overlay: "kapi-modal-overlay",
|
|
5
5
|
root: "kapi-modal",
|
|
@@ -10,5 +10,4 @@ var t = e("modal", {
|
|
|
10
10
|
body: "kapi-modal__body",
|
|
11
11
|
footer: "kapi-modal__foot"
|
|
12
12
|
});
|
|
13
|
-
//#endregion
|
|
14
13
|
export { t as MODAL_SLOTS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/overlays/modalStack.ts
|
|
2
2
|
var e = () => {
|
|
3
3
|
let e = [], t = /* @__PURE__ */ new Set(), n = () => t.forEach((e) => e()), r = (t) => e.filter((e) => e !== t);
|
|
4
4
|
return {
|
|
@@ -19,5 +19,4 @@ var e = () => {
|
|
|
19
19
|
})
|
|
20
20
|
};
|
|
21
21
|
}, t = e();
|
|
22
|
-
//#endregion
|
|
23
22
|
export { e as createModalStack, t as modalStack };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { toCssSize as e } from "./dialogUtils.js";
|
|
2
2
|
import { isHorizontalSide as t } from "./offcanvasSide.js";
|
|
3
|
-
|
|
3
|
+
// src/components/overlays/offcanvasCompanion.ts
|
|
4
4
|
var n = "400px", r = (e) => t(e), i = (e) => e === "left" ? ["main", "companion"] : ["companion", "main"], a = (t) => e(t, n), o = (e, t) => t?.open === !0 && r(e), s = (e) => e ? "kapi-offc__dock kapi-offc__dock--companion" : "kapi-offc__dock";
|
|
5
|
-
//#endregion
|
|
6
5
|
export { n as DEFAULT_COMPANION_WIDTH, s as companionDockClasses, o as isCompanionActive, i as resolveCompanionOrder, a as resolveCompanionWidth, r as supportsCompanion };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toCssSize as e } from "./dialogUtils.js";
|
|
2
|
-
|
|
2
|
+
// src/components/overlays/offcanvasSide.ts
|
|
3
3
|
var t = "right", n = "60vh", r = [
|
|
4
4
|
"right",
|
|
5
5
|
"left",
|
|
@@ -25,5 +25,4 @@ var t = "right", n = "60vh", r = [
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { n as DEFAULT_OFFCANVAS_HEIGHT, t as DEFAULT_OFFCANVAS_SIDE, o as isHorizontalSide, i as normalizeSide, l as pushForSide, a as resolveOffcanvasSide, s as sideDataAttr, c as sizeVar };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clamp as e } from "./dialogUtils.js";
|
|
2
|
-
|
|
2
|
+
// src/components/overlays/offcanvasStack.ts
|
|
3
3
|
var t = [], n = (e, t) => {
|
|
4
4
|
let n = e.findIndex((e) => e.id === t.id);
|
|
5
5
|
switch (t.type) {
|
|
@@ -68,5 +68,4 @@ var t = [], n = (e, t) => {
|
|
|
68
68
|
case "remove": return e.some((e) => e.id === t.id) ? e.filter((e) => e.id !== t.id) : e;
|
|
69
69
|
}
|
|
70
70
|
}, p = (e) => [...e].reverse().find((e) => e.open)?.id;
|
|
71
|
-
//#endregion
|
|
72
71
|
export { a as DEFAULT_PUSH_RATIO, t as EMPTY_STACK, s as MAX_PUSH_RATIO, o as MIN_PUSH_SCALE, l as createStackStore, r as depthOf, i as levelOf, u as offcanvasStackStore, f as panelsReducer, d as phaseReducer, c as pushTransform, n as stackReducer, p as topOpenId };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createPortal as e } from "react-dom";
|
|
3
|
-
|
|
3
|
+
// src/components/overlays/overlayPortal.tsx
|
|
4
4
|
var t = ({ root: t, children: n }) => t ? e(n, t) : null;
|
|
5
|
-
//#endregion
|
|
6
5
|
export { t as KapiOverlayPortal };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/overlays/popoverLogic.ts
|
|
2
2
|
var e = {
|
|
3
3
|
top: "bottom",
|
|
4
4
|
bottom: "top",
|
|
@@ -43,5 +43,4 @@ function l(t, l, u, { side: d = "bottom", align: f = "start", offset: p = 6, mar
|
|
|
43
43
|
return w !== void 0 && (I.width = w), T !== void 0 && (I.minWidth = T), I;
|
|
44
44
|
}
|
|
45
45
|
var u = (e, t) => e === t || !!e && !!t && e.top === t.top && e.left === t.left && e.side === t.side && e.align === t.align && e.width === t.width && e.minWidth === t.minWidth && e.centerX === t.centerX, d = (e, t) => e != null && !t.some((t) => t?.contains(e));
|
|
46
|
-
//#endregion
|
|
47
46
|
export { d as isOutsidePopover, l as placePopover, u as samePlacement, n as shiftIntoView };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSlots as e } from "../slotsLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/overlays/shortcutsHelpSlots.ts
|
|
3
3
|
var t = e("shortcutsHelp", {
|
|
4
4
|
group: "kapi-shortcuts__group",
|
|
5
5
|
groupTitle: "kapi-shortcuts__title",
|
|
@@ -8,5 +8,4 @@ var t = e("shortcutsHelp", {
|
|
|
8
8
|
keys: "kapi-shortcuts__keys",
|
|
9
9
|
description: "kapi-shortcuts__what"
|
|
10
10
|
});
|
|
11
|
-
//#endregion
|
|
12
11
|
export { t as SHORTCUTS_HELP_SLOTS };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { toCssSize as e } from "./dialogUtils.js";
|
|
2
|
-
|
|
2
|
+
// src/components/overlays/splitModalLayout.ts
|
|
3
3
|
var t = "380px", n = (e = "left") => e === "right" ? ["main", "aside"] : ["aside", "main"], r = (n) => e(n, t), i = (e = "left") => `kapi-splitmodal kapi-splitmodal--${e === "right" ? "right" : "left"}`;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { t as DEFAULT_ASIDE_WIDTH, r as resolveAsideWidth, n as resolvePanelOrder, i as splitModalClasses };
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { prefersReducedMotion as e } from "../../hooks/reducedMotion.js";
|
|
3
|
+
import { exitWaitMs as t, nextExitPhase as n } from "./exitPresenceLogic.js";
|
|
4
|
+
import { computedStyleOf as r } from "../../hooks/ownerDocument.js";
|
|
5
5
|
import { useLayoutEffect as i, useState as a } from "react";
|
|
6
|
-
|
|
6
|
+
// src/components/overlays/useExitPresence.ts
|
|
7
7
|
var o = (o, s) => {
|
|
8
|
-
let [c, l] = a(o ? "open" : "closed"), u =
|
|
8
|
+
let [c, l] = a(o ? "open" : "closed"), u = n(c, o);
|
|
9
9
|
return u !== c && l(u), i(() => {
|
|
10
10
|
if (c !== "closing") return;
|
|
11
|
-
let
|
|
12
|
-
if (!
|
|
11
|
+
let n = s.current;
|
|
12
|
+
if (!n || e(n)) {
|
|
13
13
|
l("closed");
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
let i =
|
|
16
|
+
let i = t(r(n));
|
|
17
17
|
if (i <= 0) {
|
|
18
18
|
l("closed");
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
let a = () => l("closed"), o = (e) => {
|
|
22
|
-
e.target ===
|
|
22
|
+
e.target === n && a();
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
n.addEventListener("animationend", o), n.addEventListener("transitionend", o);
|
|
25
25
|
let u = setTimeout(a, i + 100);
|
|
26
26
|
return () => {
|
|
27
|
-
|
|
27
|
+
n.removeEventListener("animationend", o), n.removeEventListener("transitionend", o), clearTimeout(u);
|
|
28
28
|
};
|
|
29
29
|
}, [c, s]), {
|
|
30
30
|
present: u !== "closed",
|
|
31
31
|
closing: u === "closing"
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
//#endregion
|
|
35
34
|
export { o as useExitPresence };
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { resolveKapiRoot as e } from "../../hooks/kapiRoot.js";
|
|
3
|
+
import { computedStyleOf as t } from "../../hooks/ownerDocument.js";
|
|
4
|
+
import { useFocusReturn as n } from "../../hooks/useFocusReturn.js";
|
|
5
|
+
import { usePortalRootOverride as r } from "../../hooks/portalRoot.js";
|
|
6
6
|
import { createScrollLock as i, isTrappedDialog as a } from "./dialogUtils.js";
|
|
7
|
-
import {
|
|
7
|
+
import { modalStack as o } from "./modalStack.js";
|
|
8
8
|
import { useCallback as s, useEffect as c, useLayoutEffect as l, useRef as u, useState as d } from "react";
|
|
9
|
-
|
|
10
|
-
var f = () =>
|
|
11
|
-
let n = m.get(
|
|
9
|
+
// src/components/overlays/useNativeDialog.ts
|
|
10
|
+
var f = () => e(), p = () => r() ?? f(), m = /* @__PURE__ */ new WeakMap(), h = (e) => {
|
|
11
|
+
let n = m.get(e);
|
|
12
12
|
return n || (n = i({
|
|
13
|
-
getTarget: () =>
|
|
13
|
+
getTarget: () => e.body,
|
|
14
14
|
measure: () => ({
|
|
15
|
-
scrollbar: Math.max(0, (
|
|
16
|
-
padding: parseFloat(e
|
|
15
|
+
scrollbar: Math.max(0, (e.defaultView?.innerWidth ?? 0) - e.documentElement.clientWidth),
|
|
16
|
+
padding: parseFloat(t(e.body).paddingRight) || 0
|
|
17
17
|
})
|
|
18
|
-
}), m.set(
|
|
18
|
+
}), m.set(e, n)), n;
|
|
19
19
|
}, g = (e) => {
|
|
20
20
|
e.open || e.isConnected && (typeof e.showModal == "function" ? e.showModal() : e.setAttribute("open", ""));
|
|
21
21
|
}, _ = (e) => {
|
|
22
22
|
typeof e.close == "function" ? e.open && e.close() : e.removeAttribute("open");
|
|
23
23
|
}, v = ({ onRequestClose: e, lockScroll: t = !0 } = {}) => {
|
|
24
|
-
let
|
|
24
|
+
let r = u(null), i = u(e);
|
|
25
25
|
l(() => {
|
|
26
26
|
i.current = e;
|
|
27
27
|
});
|
|
28
|
-
let { restore: a } =
|
|
28
|
+
let { restore: a } = n(!0, { container: r }), c = u(null), [f, p] = d(0);
|
|
29
29
|
return l(() => {
|
|
30
|
-
let e =
|
|
30
|
+
let e = r.current;
|
|
31
31
|
if (c.current = e, !e) return;
|
|
32
32
|
g(e);
|
|
33
|
-
let
|
|
33
|
+
let n = o.push(e), i = t ? h(e.ownerDocument).acquire() : void 0;
|
|
34
34
|
return e.querySelector("[data-autofocus]")?.focus(), () => {
|
|
35
|
-
|
|
35
|
+
n(), i?.(), _(e), a();
|
|
36
36
|
};
|
|
37
37
|
}, [
|
|
38
38
|
t,
|
|
39
39
|
a,
|
|
40
40
|
f
|
|
41
41
|
]), l(() => {
|
|
42
|
-
|
|
42
|
+
r.current !== c.current && p((e) => e + 1);
|
|
43
43
|
}), {
|
|
44
|
-
ref:
|
|
44
|
+
ref: r,
|
|
45
45
|
dialogProps: {
|
|
46
46
|
onCancel: s((e) => {
|
|
47
47
|
e.target === e.currentTarget && e.nativeEvent.cancelable && (e.preventDefault(), i.current?.());
|
|
48
48
|
}, []),
|
|
49
49
|
onClose: s((e) => {
|
|
50
|
-
let t =
|
|
50
|
+
let t = r.current;
|
|
51
51
|
t && e.target === e.currentTarget && (t.open || (i.current?.(), setTimeout(() => {
|
|
52
|
-
t.isConnected && !t.open && (g(t),
|
|
52
|
+
t.isConnected && !t.open && (g(t), o.raise(t));
|
|
53
53
|
}, 0)));
|
|
54
54
|
}, [])
|
|
55
55
|
}
|
|
@@ -71,5 +71,4 @@ var f = () => n(), p = () => t() ?? f(), m = /* @__PURE__ */ new WeakMap(), h =
|
|
|
71
71
|
r && process.env.NODE_ENV !== "production" && a(t, n.current) && console.warn(`${e}: sin X ni Escape y sin ningún botón adentro; el usuario no tiene cómo salir. Agrega un botón que llame a onClose (p. ej. en footer).`);
|
|
72
72
|
}, [r]);
|
|
73
73
|
};
|
|
74
|
-
//#endregion
|
|
75
74
|
export { f as getPortalRoot, g as openModal, y as useBackdropClose, v as useNativeDialog, p as usePortalRoot, b as useTrappedDialogWarning };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/overlays/viewportLogic.ts
|
|
2
2
|
var e = (e, t, n) => Math.min(n, Math.max(t, e)), t = (e, t) => Number.isFinite(e) ? e : t, n = {
|
|
3
3
|
scale: 1,
|
|
4
4
|
x: 0,
|
|
@@ -50,5 +50,4 @@ var e = (e, t, n) => Math.min(n, Math.max(t, e)), t = (e, t) => Number.isFinite(
|
|
|
50
50
|
y: (t(n.y, 0) + t(r.y, 0)) / 2
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
//#endregion
|
|
54
53
|
export { n as VIEWPORT_IDENTITY, a as clampViewport, c as doubleTapScale, r as fitScale, s as fitViewport, i as panBounds, u as pinchCenter, l as pinchDistance, o as zoomAt };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { joinClasses as e } from "./rootProps.js";
|
|
3
3
|
import { cloneElement as t, isValidElement as n } from "react";
|
|
4
|
-
|
|
4
|
+
// src/components/renderSlot.ts
|
|
5
5
|
var r = (e, t) => typeof t == "function" && /^on[A-Z]/.test(e), i = (e, t) => e ? t ? (n) => {
|
|
6
6
|
e(n), n?.defaultPrevented || t(n);
|
|
7
7
|
} : e : t, a = (t, n, a = {}) => {
|
|
@@ -19,5 +19,4 @@ var r = (e, t) => typeof t == "function" && /^on[A-Z]/.test(e), i = (e, t) => e
|
|
|
19
19
|
let s = (e) => a(r, e, i);
|
|
20
20
|
return e === void 0 ? o(s({})) : typeof e == "function" ? e(s({})) : n(e) ? t(e, s(e.props ?? {})) : o(s({}));
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { i as chainHandlers, a as mergeSlotProps, o as renderSlot };
|