@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,231 +1,230 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/KapiOffcanvas.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useExitPresence as
|
|
10
|
-
import { useBackdropClose as l, useNativeDialog as u, usePortalRoot as d, useTrappedDialogWarning as f } from "./useNativeDialog.js";
|
|
11
|
-
import { DEFAULT_PUSH_RATIO as te, depthOf as ne, levelOf as re, offcanvasStackStore as p, phaseReducer as m, pushTransform as ie } from "./offcanvasStack.js";
|
|
12
|
-
import { normalizeSide as ae, pushForSide as oe, resolveOffcanvasSide as h, sideDataAttr as se, sizeVar as ce } from "./offcanvasSide.js";
|
|
13
|
-
import { companionDockClasses as le, isCompanionActive as ue, resolveCompanionOrder as de, resolveCompanionWidth as fe, supportsCompanion as pe } from "./offcanvasCompanion.js";
|
|
14
|
-
import { resolveInitialWidth as me, resolveMaxWidth as g, stepOffcanvasWidth as he, widthFromDrag as ge } from "./offcanvasResize.js";
|
|
3
|
+
import { maxTransitionMs as e, resolveDismiss as t } from "./dialogUtils.js";
|
|
4
|
+
import { DEFAULT_PUSH_RATIO as n, depthOf as r, levelOf as i, offcanvasStackStore as a, phaseReducer as o, pushTransform as s } from "./offcanvasStack.js";
|
|
5
|
+
import { companionDockClasses as c, isCompanionActive as l, resolveCompanionOrder as u, resolveCompanionWidth as d, supportsCompanion as f } from "./offcanvasCompanion.js";
|
|
6
|
+
import { resolveInitialWidth as ee, resolveMaxWidth as p, stepOffcanvasWidth as te, widthFromDrag as ne } from "./offcanvasResize.js";
|
|
7
|
+
import { normalizeSide as re, pushForSide as ie, resolveOffcanvasSide as m, sideDataAttr as ae, sizeVar as oe } from "./offcanvasSide.js";
|
|
8
|
+
import { useBackdropClose as se, useNativeDialog as ce, usePortalRoot as h, useTrappedDialogWarning as le } from "./useNativeDialog.js";
|
|
9
|
+
import { useExitPresence as ue } from "./useExitPresence.js";
|
|
15
10
|
/* empty css */
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
11
|
+
import { useKapiDir as g, useLabels as de } from "../locale/KapiLocaleProvider.js";
|
|
12
|
+
import { resolveDirection as _ } from "../../hooks/directionLogic.js";
|
|
13
|
+
import { joinClasses as fe } from "../rootProps.js";
|
|
14
|
+
import { useMergedRefs as pe } from "../../hooks/mergeRefs.js";
|
|
15
|
+
import { computedStyleOf as me, winOf as v } from "../../hooks/ownerDocument.js";
|
|
16
|
+
import { useEffect as he, useId as y, useLayoutEffect as b, useReducer as x, useRef as S, useState as ge, useSyncExternalStore as _e } from "react";
|
|
17
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
18
|
+
import { X as ve } from "lucide-react";
|
|
19
|
+
import { createPortal as T } from "react-dom";
|
|
20
|
+
var ye = 120, E = {
|
|
21
21
|
resize: "Redimensionar panel",
|
|
22
22
|
close: "Cerrar",
|
|
23
23
|
closePanel: "Cerrar panel"
|
|
24
|
-
},
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
},
|
|
24
|
+
}, D = ({ textDir: o, stackId: m, phase: h, onEntered: g, onExited: _, onClose: x, title: T, subtitle: D, children: O, footer: k, side: be, width: A = 520, height: xe, pushRatio: Se = n, pushOffset: Ce = 16, closeOnBackdrop: we, closeOnEscape: Te, closeButton: Ee, dismissible: De, closeLabel: Oe, labels: ke, className: Ae, style: je, id: Me, ref: Ne, companion: j, resizable: Pe = !1, minWidth: M = 320, maxWidth: N, onResize: Fe }) => {
|
|
25
|
+
let P = de("offcanvas", E, ke), Ie = Oe ?? P.close, F = y(), I = y(), L = re(be), R = S(null), z = _e(a.subscribe, a.getSnapshot, a.getServerSnapshot), B = r(z, m), Le = Math.max(0, i(z, m)), { scale: Re, translateX: ze } = ie(L, s(B, Se, Ce)), [V, Be] = ge(() => ee(A, 520)), [Ve, H] = ge(!1), U = S(null), W = S(Fe);
|
|
26
|
+
W.current = Fe;
|
|
27
|
+
let G = (e) => {
|
|
28
|
+
Be(e), e !== V && W.current?.(e);
|
|
29
|
+
}, He = (e) => {
|
|
30
30
|
if (e.button !== 0) return;
|
|
31
|
-
let t =
|
|
32
|
-
|
|
31
|
+
let t = R.current?.offsetWidth ?? V;
|
|
32
|
+
U.current = {
|
|
33
33
|
startX: e.clientX,
|
|
34
34
|
startWidth: t
|
|
35
|
-
}, e.currentTarget.setPointerCapture(e.pointerId),
|
|
36
|
-
},
|
|
37
|
-
let t =
|
|
35
|
+
}, e.currentTarget.setPointerCapture(e.pointerId), H(!0), e.preventDefault();
|
|
36
|
+
}, Ue = (e) => {
|
|
37
|
+
let t = U.current;
|
|
38
38
|
if (!t) return;
|
|
39
|
-
let n =
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
let t =
|
|
45
|
-
n !== null && (e.preventDefault(), e.stopPropagation(),
|
|
46
|
-
},
|
|
47
|
-
dismissible:
|
|
48
|
-
closeOnEscape:
|
|
49
|
-
closeOnBackdrop:
|
|
50
|
-
closeButton:
|
|
51
|
-
}), { closeOnEscape:
|
|
52
|
-
|
|
39
|
+
let n = p(N, (v(R.current) ?? window).innerWidth);
|
|
40
|
+
G(ne(L, t.startWidth, t.startX, e.clientX, M, n));
|
|
41
|
+
}, K = (e) => {
|
|
42
|
+
U.current = null, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), H(!1);
|
|
43
|
+
}, We = (e) => {
|
|
44
|
+
let t = p(N, (v(R.current) ?? window).innerWidth), n = te(L, V, e.key, M, t);
|
|
45
|
+
n !== null && (e.preventDefault(), e.stopPropagation(), G(n));
|
|
46
|
+
}, q = h === "open" ? x : void 0, J = t({
|
|
47
|
+
dismissible: De,
|
|
48
|
+
closeOnEscape: Te,
|
|
49
|
+
closeOnBackdrop: we,
|
|
50
|
+
closeButton: Ee
|
|
51
|
+
}), { closeOnEscape: Ge, closeOnBackdrop: Ke, closeButton: qe } = J, { ref: Y, dialogProps: Je } = ce({ onRequestClose: Ge ? () => q?.("escape") : void 0 }), Ye = pe(Y, Ne), Xe = se(Ke ? () => q?.("backdrop") : void 0);
|
|
52
|
+
le("KapiOffcanvas", J, Y), b(() => (a.dispatch({
|
|
53
53
|
type: "add",
|
|
54
|
-
id:
|
|
55
|
-
}), () =>
|
|
54
|
+
id: m
|
|
55
|
+
}), () => a.dispatch({
|
|
56
56
|
type: "remove",
|
|
57
|
-
id:
|
|
58
|
-
})), [
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
id: m
|
|
58
|
+
})), [m]);
|
|
59
|
+
let X = S(g);
|
|
60
|
+
X.current = g, b(() => {
|
|
61
|
+
R.current?.getBoundingClientRect(), X.current();
|
|
62
62
|
}, []);
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
let
|
|
67
|
-
if (!
|
|
68
|
-
|
|
63
|
+
let Z = S(_);
|
|
64
|
+
Z.current = _, he(() => {
|
|
65
|
+
if (h !== "exit") return;
|
|
66
|
+
let t = R.current;
|
|
67
|
+
if (!t) {
|
|
68
|
+
Z.current();
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
|
|
71
|
+
let n = me(t), r = e(n.transitionDuration, n.transitionDelay);
|
|
72
|
+
if (r <= 0) {
|
|
73
|
+
Z.current();
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
}, o = (
|
|
79
|
-
|
|
76
|
+
let i = !1, a = () => {
|
|
77
|
+
i || (i = !0, Z.current());
|
|
78
|
+
}, o = (e) => {
|
|
79
|
+
e.target === t && e.propertyName === "transform" && a();
|
|
80
80
|
};
|
|
81
|
-
|
|
82
|
-
let s = window.setTimeout(a,
|
|
81
|
+
t.addEventListener("transitionend", o);
|
|
82
|
+
let s = window.setTimeout(a, r + ye);
|
|
83
83
|
return () => {
|
|
84
|
-
|
|
84
|
+
i = !0, t.removeEventListener("transitionend", o), window.clearTimeout(s);
|
|
85
85
|
};
|
|
86
|
-
}, [
|
|
87
|
-
let
|
|
88
|
-
|
|
86
|
+
}, [h]);
|
|
87
|
+
let Ze = Pe && (L === "left" || L === "right"), Q = oe(L, A, xe, "520px");
|
|
88
|
+
Ze && (Q.value = `${V}px`);
|
|
89
89
|
let Qe = {
|
|
90
|
-
...
|
|
90
|
+
...je,
|
|
91
91
|
[Q.name]: Q.value,
|
|
92
|
-
"--kapi-offc-push-x": `${
|
|
93
|
-
"--kapi-offc-push-s":
|
|
94
|
-
}, $e =
|
|
95
|
-
|
|
96
|
-
let $ =
|
|
97
|
-
ref:
|
|
92
|
+
"--kapi-offc-push-x": `${ze}px`,
|
|
93
|
+
"--kapi-offc-push-s": Re
|
|
94
|
+
}, $e = l(L, j), et = S(null), { present: tt, closing: nt } = ue($e, et), rt = S(j);
|
|
95
|
+
j && (rt.current = j);
|
|
96
|
+
let $ = j ?? rt.current, it = tt && f(L) && $ !== void 0, at = o === "rtl", ot = at ? { dir: "rtl" } : {}, st = /* @__PURE__ */ w("div", {
|
|
97
|
+
ref: R,
|
|
98
98
|
className: "kapi-offc__panel",
|
|
99
99
|
...ot,
|
|
100
100
|
children: [
|
|
101
|
-
|
|
101
|
+
Ze && /* @__PURE__ */ C("div", {
|
|
102
102
|
className: "kapi-offc__resize",
|
|
103
103
|
role: "separator",
|
|
104
104
|
"aria-orientation": "vertical",
|
|
105
|
-
"aria-label":
|
|
106
|
-
"aria-valuemin":
|
|
107
|
-
"aria-valuemax":
|
|
108
|
-
"aria-valuenow":
|
|
105
|
+
"aria-label": P.resize,
|
|
106
|
+
"aria-valuemin": M,
|
|
107
|
+
"aria-valuemax": p(N, typeof window > "u" ? void 0 : window.innerWidth),
|
|
108
|
+
"aria-valuenow": V,
|
|
109
109
|
tabIndex: 0,
|
|
110
|
-
onPointerDown:
|
|
111
|
-
onPointerMove:
|
|
112
|
-
onPointerUp:
|
|
113
|
-
onPointerCancel:
|
|
114
|
-
onKeyDown:
|
|
110
|
+
onPointerDown: He,
|
|
111
|
+
onPointerMove: Ue,
|
|
112
|
+
onPointerUp: K,
|
|
113
|
+
onPointerCancel: K,
|
|
114
|
+
onKeyDown: We
|
|
115
115
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ w("div", {
|
|
117
117
|
className: "kapi-offc__head",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
119
|
-
id:
|
|
118
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("div", {
|
|
119
|
+
id: F,
|
|
120
120
|
className: "kapi-modal__title",
|
|
121
|
-
children:
|
|
122
|
-
}),
|
|
121
|
+
children: T
|
|
122
|
+
}), D && /* @__PURE__ */ C("div", {
|
|
123
123
|
className: "kapi-modal__sub",
|
|
124
|
-
children:
|
|
125
|
-
})] }),
|
|
124
|
+
children: D
|
|
125
|
+
})] }), qe && /* @__PURE__ */ C("button", {
|
|
126
126
|
type: "button",
|
|
127
127
|
className: "kapi-modal__x",
|
|
128
|
-
onClick: () =>
|
|
129
|
-
"aria-label":
|
|
130
|
-
children: /* @__PURE__ */
|
|
128
|
+
onClick: () => q?.("close-button"),
|
|
129
|
+
"aria-label": Ie,
|
|
130
|
+
children: /* @__PURE__ */ C(ve, {
|
|
131
131
|
size: 17,
|
|
132
132
|
strokeWidth: 2.2
|
|
133
133
|
})
|
|
134
134
|
})]
|
|
135
135
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ C("div", {
|
|
137
137
|
className: "kapi-offc__body",
|
|
138
|
-
children:
|
|
138
|
+
children: O
|
|
139
139
|
}),
|
|
140
|
-
|
|
140
|
+
k && /* @__PURE__ */ C("div", {
|
|
141
141
|
className: "kapi-offc__foot",
|
|
142
|
-
children:
|
|
142
|
+
children: k
|
|
143
143
|
})
|
|
144
144
|
]
|
|
145
|
-
}, "main"), ct = $ && it ? /* @__PURE__ */
|
|
145
|
+
}, "main"), ct = $ && it ? /* @__PURE__ */ w("div", {
|
|
146
146
|
ref: et,
|
|
147
147
|
"data-closing": nt || void 0,
|
|
148
148
|
inert: nt || void 0,
|
|
149
149
|
className: "kapi-offc__panel kapi-offc__companion",
|
|
150
150
|
...ot,
|
|
151
151
|
role: "complementary",
|
|
152
|
-
"aria-labelledby": $.title ?
|
|
153
|
-
style: { "--kapi-offc-companion-w":
|
|
152
|
+
"aria-labelledby": $.title ? I : void 0,
|
|
153
|
+
style: { "--kapi-offc-companion-w": d($.width) },
|
|
154
154
|
children: [
|
|
155
|
-
($.title || $.onClose) && /* @__PURE__ */
|
|
155
|
+
($.title || $.onClose) && /* @__PURE__ */ w("div", {
|
|
156
156
|
className: "kapi-offc__head",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
158
|
-
id:
|
|
157
|
+
children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("div", {
|
|
158
|
+
id: I,
|
|
159
159
|
className: "kapi-modal__title",
|
|
160
160
|
children: $.title
|
|
161
|
-
}), $.subtitle && /* @__PURE__ */
|
|
161
|
+
}), $.subtitle && /* @__PURE__ */ C("div", {
|
|
162
162
|
className: "kapi-modal__sub",
|
|
163
163
|
children: $.subtitle
|
|
164
|
-
})] }), $.onClose && /* @__PURE__ */
|
|
164
|
+
})] }), $.onClose && /* @__PURE__ */ C("button", {
|
|
165
165
|
type: "button",
|
|
166
166
|
className: "kapi-modal__x",
|
|
167
167
|
onClick: $.onClose,
|
|
168
|
-
"aria-label": $.closeLabel ??
|
|
169
|
-
children: /* @__PURE__ */
|
|
168
|
+
"aria-label": $.closeLabel ?? P.closePanel,
|
|
169
|
+
children: /* @__PURE__ */ C(ve, {
|
|
170
170
|
size: 17,
|
|
171
171
|
strokeWidth: 2.2
|
|
172
172
|
})
|
|
173
173
|
})]
|
|
174
174
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ C("div", {
|
|
176
176
|
className: "kapi-offc__body",
|
|
177
177
|
children: $.children
|
|
178
178
|
}),
|
|
179
|
-
$.footer && /* @__PURE__ */
|
|
179
|
+
$.footer && /* @__PURE__ */ C("div", {
|
|
180
180
|
className: "kapi-offc__foot",
|
|
181
181
|
children: $.footer
|
|
182
182
|
})
|
|
183
183
|
]
|
|
184
|
-
}, "companion") : null, lt =
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
ref:
|
|
187
|
-
id:
|
|
188
|
-
className:
|
|
189
|
-
"data-side":
|
|
190
|
-
"data-state":
|
|
191
|
-
"data-level":
|
|
192
|
-
"data-pushed":
|
|
184
|
+
}, "companion") : null, lt = u(L).map((e) => e === "main" ? st : ct).filter((e) => e !== null);
|
|
185
|
+
return /* @__PURE__ */ C("dialog", {
|
|
186
|
+
ref: Ye,
|
|
187
|
+
id: Me,
|
|
188
|
+
className: fe("kapi-offc", Ve && "is-resizing", Ae),
|
|
189
|
+
"data-side": ae(L),
|
|
190
|
+
"data-state": h === "open" ? "open" : "closed",
|
|
191
|
+
"data-level": Le,
|
|
192
|
+
"data-pushed": B > 0 ? "" : void 0,
|
|
193
193
|
...at ? { dir: "ltr" } : {},
|
|
194
194
|
"aria-modal": "true",
|
|
195
|
-
"aria-labelledby":
|
|
195
|
+
"aria-labelledby": F,
|
|
196
196
|
style: Qe,
|
|
197
|
-
...
|
|
198
|
-
...
|
|
199
|
-
children: /* @__PURE__ */
|
|
200
|
-
className:
|
|
197
|
+
...Je,
|
|
198
|
+
...Xe,
|
|
199
|
+
children: /* @__PURE__ */ C("div", {
|
|
200
|
+
className: c(it),
|
|
201
201
|
children: lt
|
|
202
202
|
})
|
|
203
203
|
});
|
|
204
|
-
},
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}, [e]),
|
|
209
|
-
(
|
|
204
|
+
}, O = ({ open: e, onExited: t, side: n, ...r }) => {
|
|
205
|
+
let i = y(), s = g(), [c, l] = x(o, "unmounted"), u = S(t);
|
|
206
|
+
u.current = t, b(() => {
|
|
207
|
+
l(e ? "open" : "close");
|
|
208
|
+
}, [e]), b(() => {
|
|
209
|
+
(c === "exit" || c === "open") && a.dispatch({
|
|
210
210
|
type: "mark",
|
|
211
|
-
id:
|
|
212
|
-
state:
|
|
211
|
+
id: i,
|
|
212
|
+
state: c === "exit" ? "closing" : "open"
|
|
213
213
|
});
|
|
214
|
-
}, [
|
|
215
|
-
let
|
|
216
|
-
if (
|
|
217
|
-
let f =
|
|
218
|
-
return
|
|
219
|
-
...
|
|
214
|
+
}, [c, i]);
|
|
215
|
+
let d = h();
|
|
216
|
+
if (c === "unmounted" || !d) return null;
|
|
217
|
+
let f = _(d, s);
|
|
218
|
+
return T(/* @__PURE__ */ C(D, {
|
|
219
|
+
...r,
|
|
220
220
|
textDir: f,
|
|
221
|
-
side:
|
|
222
|
-
stackId:
|
|
223
|
-
phase:
|
|
224
|
-
onEntered: () =>
|
|
221
|
+
side: m(n, f),
|
|
222
|
+
stackId: i,
|
|
223
|
+
phase: c,
|
|
224
|
+
onEntered: () => l("entered"),
|
|
225
225
|
onExited: () => {
|
|
226
|
-
|
|
226
|
+
l("exited"), u.current?.();
|
|
227
227
|
}
|
|
228
|
-
}),
|
|
228
|
+
}), d);
|
|
229
229
|
};
|
|
230
|
-
|
|
231
|
-
export { T as DEFAULT_OFFCANVAS_LABELS, D as KapiOffcanvas };
|
|
230
|
+
export { E as DEFAULT_OFFCANVAS_LABELS, O as KapiOffcanvas };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { KapiOffcanvas as e } from "./KapiOffcanvas.js";
|
|
3
|
+
import { panelsReducer as t, topOpenId as n } from "./offcanvasStack.js";
|
|
4
4
|
import { createContext as r, useCallback as i, useContext as a, useLayoutEffect as o, useMemo as s, useReducer as c, useRef as l } from "react";
|
|
5
5
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
var f = r(null), p = r(null), m = (
|
|
8
|
-
let { id: o } =
|
|
6
|
+
// src/components/overlays/KapiOffcanvasStack.tsx
|
|
7
|
+
var f = r(null), p = r(null), m = (e, n) => t(e, n), h = ({ entry: t, level: n, close: r, push: i, dispatch: a }) => {
|
|
8
|
+
let { id: o } = t, c = s(() => ({
|
|
9
9
|
id: o,
|
|
10
|
-
level:
|
|
10
|
+
level: n,
|
|
11
11
|
close: () => r(o),
|
|
12
12
|
push: i
|
|
13
13
|
}), [
|
|
14
14
|
o,
|
|
15
|
-
|
|
15
|
+
n,
|
|
16
16
|
r,
|
|
17
17
|
i
|
|
18
|
-
]), { content: l, beforeClose: d, onClose: f, onExited: m, ...h } =
|
|
18
|
+
]), { content: l, beforeClose: d, onClose: f, onExited: m, ...h } = t.config;
|
|
19
19
|
return /* @__PURE__ */ u(p.Provider, {
|
|
20
20
|
value: c,
|
|
21
|
-
children: /* @__PURE__ */ u(
|
|
21
|
+
children: /* @__PURE__ */ u(e, {
|
|
22
22
|
...h,
|
|
23
|
-
open:
|
|
23
|
+
open: t.open,
|
|
24
24
|
onClose: c.close,
|
|
25
25
|
onExited: () => {
|
|
26
26
|
a({
|
|
@@ -32,9 +32,9 @@ var f = r(null), p = r(null), m = (t, n) => e(t, n), h = ({ entry: e, level: t,
|
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
34
|
}, g = ({ children: e }) => {
|
|
35
|
-
let [
|
|
35
|
+
let [t, r] = c(m, []), a = l(t);
|
|
36
36
|
o(() => {
|
|
37
|
-
a.current =
|
|
37
|
+
a.current = t;
|
|
38
38
|
});
|
|
39
39
|
let p = l(0), g = i((e) => {
|
|
40
40
|
p.current += 1;
|
|
@@ -45,13 +45,13 @@ var f = r(null), p = r(null), m = (t, n) => e(t, n), h = ({ entry: e, level: t,
|
|
|
45
45
|
config: e
|
|
46
46
|
}), t;
|
|
47
47
|
}, []), _ = i((e) => {
|
|
48
|
-
let
|
|
49
|
-
if (o < 0 || !
|
|
50
|
-
let s =
|
|
48
|
+
let t = a.current, i = e ?? n(t), o = t.findIndex((e) => e.id === i);
|
|
49
|
+
if (o < 0 || !t[o]?.open) return;
|
|
50
|
+
let s = t.filter((e, t) => t >= o && e.open);
|
|
51
51
|
for (let e = s.length - 1; e >= 0; --e) if (s[e]?.config.beforeClose?.() === !1) return;
|
|
52
52
|
r({
|
|
53
53
|
type: "close",
|
|
54
|
-
id:
|
|
54
|
+
id: t[o].id
|
|
55
55
|
}), s.forEach((e) => e.config.onClose?.());
|
|
56
56
|
}, []), v = i(() => {
|
|
57
57
|
let e = a.current.filter((e) => e.open);
|
|
@@ -59,7 +59,7 @@ var f = r(null), p = r(null), m = (t, n) => e(t, n), h = ({ entry: e, level: t,
|
|
|
59
59
|
for (let t = e.length - 1; t >= 0; --t) if (e[t]?.config.beforeClose?.() === !1) return;
|
|
60
60
|
r({ type: "closeAll" }), e.forEach((e) => e.config.onClose?.());
|
|
61
61
|
}
|
|
62
|
-
}, []), y = i(() => _(), [_]), b =
|
|
62
|
+
}, []), y = i(() => _(), [_]), b = t.filter((e) => e.open).length, x = s(() => ({
|
|
63
63
|
push: g,
|
|
64
64
|
close: _,
|
|
65
65
|
pop: y,
|
|
@@ -74,7 +74,7 @@ var f = r(null), p = r(null), m = (t, n) => e(t, n), h = ({ entry: e, level: t,
|
|
|
74
74
|
]);
|
|
75
75
|
return /* @__PURE__ */ d(f.Provider, {
|
|
76
76
|
value: x,
|
|
77
|
-
children: [e,
|
|
77
|
+
children: [e, t.map((e, t) => /* @__PURE__ */ u(h, {
|
|
78
78
|
entry: e,
|
|
79
79
|
level: t,
|
|
80
80
|
close: _,
|
|
@@ -91,5 +91,4 @@ var f = r(null), p = r(null), m = (t, n) => e(t, n), h = ({ entry: e, level: t,
|
|
|
91
91
|
if (!e) throw Error("useKapiOffcanvasPanel: sólo se puede usar dentro del contenido de un panel del stack.");
|
|
92
92
|
return e;
|
|
93
93
|
};
|
|
94
|
-
//#endregion
|
|
95
94
|
export { g as KapiOffcanvasStack, v as useKapiOffcanvasPanel, _ as useKapiOffcanvasStack };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/overlays.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { prefersReducedMotion as e } from "../../hooks/reducedMotion.js";
|
|
4
|
+
import { onViewportChange as t } from "../../hooks/rafThrottle.js";
|
|
5
|
+
import { resolveKapiRoot as n } from "../../hooks/kapiRoot.js";
|
|
6
|
+
import { trapTabKey as r } from "../../hooks/focusLogic.js";
|
|
7
|
+
import { useLabels as i } from "../locale/KapiLocaleProvider.js";
|
|
8
|
+
import { KapiOverlayPortal as a } from "./overlayPortal.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { joinClasses as o } from "../rootProps.js";
|
|
11
|
+
import { useMergedRefs as s } from "../../hooks/mergeRefs.js";
|
|
12
|
+
import { computedStyleOf as c } from "../../hooks/ownerDocument.js";
|
|
13
13
|
import { useEffect as l, useLayoutEffect as u, useReducer as d, useRef as f, useState as p } from "react";
|
|
14
14
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
15
|
-
|
|
15
|
+
// src/components/overlays/KapiPhotoView.tsx
|
|
16
16
|
var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
17
17
|
switch (t) {
|
|
18
18
|
case "open": return e === "closed" ? "opening" : e;
|
|
@@ -44,14 +44,14 @@ var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
|
44
44
|
fontSize: t.height * b
|
|
45
45
|
} : {};
|
|
46
46
|
}, E = ({ children: v, content: y, bg: b = "var(--kapi-primary-soft)", ink: E = "var(--kapi-primary-ink)", label: D, labels: O, className: k, style: A, id: j, ref: M }) => {
|
|
47
|
-
let N =
|
|
47
|
+
let N = i("photoView", _, O), P = f(null), F = s(P, M), I = f(null), L = f(!1), [R, z] = d(x, "closed"), [B, V] = p(null), [H, U] = p(999), [W, G] = p(null), K = (e) => {
|
|
48
48
|
e.stopPropagation();
|
|
49
49
|
let t = P.current;
|
|
50
50
|
if (!t) return;
|
|
51
|
-
let
|
|
52
|
-
V(
|
|
53
|
-
let
|
|
54
|
-
U(C(
|
|
51
|
+
let r = t.getBoundingClientRect();
|
|
52
|
+
V(r);
|
|
53
|
+
let i = t.firstElementChild ?? t;
|
|
54
|
+
U(C(c(i).borderRadius, r)), G(n(t)), z("open");
|
|
55
55
|
}, q = (e) => {
|
|
56
56
|
e.stopPropagation(), z("close");
|
|
57
57
|
};
|
|
@@ -62,7 +62,7 @@ var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
|
62
62
|
}, [R]);
|
|
63
63
|
let J = R === "closed";
|
|
64
64
|
l(() => {
|
|
65
|
-
if (!J) return
|
|
65
|
+
if (!J) return t(() => {
|
|
66
66
|
let e = P.current;
|
|
67
67
|
if (!e) return;
|
|
68
68
|
let t = e.getBoundingClientRect();
|
|
@@ -70,8 +70,8 @@ var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
|
70
70
|
});
|
|
71
71
|
}, [J]), l(() => {
|
|
72
72
|
if (R !== "closing") return;
|
|
73
|
-
let
|
|
74
|
-
return () => window.clearTimeout(
|
|
73
|
+
let t = window.setTimeout(() => z("end"), S(e(P.current)));
|
|
74
|
+
return () => window.clearTimeout(t);
|
|
75
75
|
}, [R]), u(() => {
|
|
76
76
|
R === "closed" ? (V(null), G(null), L.current && P.current?.focus(), L.current = !1) : R === "opening" && (L.current = !0, I.current?.focus());
|
|
77
77
|
}, [R]);
|
|
@@ -87,12 +87,12 @@ var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
|
87
87
|
type: "button",
|
|
88
88
|
onClick: K,
|
|
89
89
|
id: j,
|
|
90
|
-
className:
|
|
90
|
+
className: o("kapi-photo-thumb", k),
|
|
91
91
|
style: A,
|
|
92
92
|
"aria-label": D,
|
|
93
93
|
"aria-haspopup": "dialog",
|
|
94
94
|
children: v
|
|
95
|
-
}), R !== "closed" && /* @__PURE__ */ h(
|
|
95
|
+
}), R !== "closed" && /* @__PURE__ */ h(a, {
|
|
96
96
|
root: W,
|
|
97
97
|
children: /* @__PURE__ */ h("div", {
|
|
98
98
|
ref: I,
|
|
@@ -103,7 +103,7 @@ var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
|
103
103
|
tabIndex: -1,
|
|
104
104
|
onClick: q,
|
|
105
105
|
onKeyDown: (e) => {
|
|
106
|
-
e.key === "Escape" ? (e.preventDefault(), q(e)) :
|
|
106
|
+
e.key === "Escape" ? (e.preventDefault(), q(e)) : r(e, I.current);
|
|
107
107
|
},
|
|
108
108
|
children: /* @__PURE__ */ h("div", {
|
|
109
109
|
className: "kapi-photo-fly",
|
|
@@ -121,5 +121,4 @@ var _ = { viewer: "Foto ampliada" }, v = 92, y = 24, b = .42, x = (e, t) => {
|
|
|
121
121
|
})
|
|
122
122
|
})] });
|
|
123
123
|
};
|
|
124
|
-
//#endregion
|
|
125
124
|
export { _ as DEFAULT_PHOTO_VIEW_LABELS, E as KapiPhotoView, C as parseThumbRadius, S as photoCloseFallbackDelay, T as photoFlyStyle, x as photoViewReducer, w as sameRect };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/KapiPopover.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { resolveKapiRoot as e } from "../../hooks/kapiRoot.js";
|
|
4
|
+
import { usePlacement as t } from "../../hooks/usePlacement.js";
|
|
5
|
+
import { KapiOverlayPortal as n } from "./overlayPortal.js";
|
|
6
|
+
import { useExitPresence as r } from "./useExitPresence.js";
|
|
7
|
+
import { useMergedRefs as i } from "../../hooks/mergeRefs.js";
|
|
8
|
+
import { useDismiss as a } from "../../hooks/useDismiss.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import { useLayoutEffect as o, useRef as s, useState as c } from "react";
|
|
11
11
|
import { jsx as l } from "react/jsx-runtime";
|
|
12
|
-
|
|
12
|
+
// src/components/overlays/KapiPopover.tsx
|
|
13
13
|
function u({ open: u, anchorRef: d, onClose: f, side: p = "bottom", align: m = "start", offset: h = 6, margin: g = 8, matchAnchorWidth: _ = !1, role: v = "dialog", "aria-label": y, id: b, className: x = "", style: S, ref: C, closeOnEscape: w = !0, closeOnOutside: T = !0, restoreFocus: E = !0, children: D }) {
|
|
14
|
-
let O = s(null), k =
|
|
14
|
+
let O = s(null), k = i(O, C), [A, j] = c(null), { present: M, closing: N } = r(u, O);
|
|
15
15
|
o(() => {
|
|
16
|
-
j(M ?
|
|
16
|
+
j(M ? e(d.current) : null);
|
|
17
17
|
}, [M, d]);
|
|
18
|
-
let { placement: P, style: F } =
|
|
18
|
+
let { placement: P, style: F } = t({
|
|
19
19
|
open: M,
|
|
20
20
|
enabled: !!A,
|
|
21
21
|
anchor: d,
|
|
@@ -25,7 +25,7 @@ function u({ open: u, anchorRef: d, onClose: f, side: p = "bottom", align: m = "
|
|
|
25
25
|
offset: h,
|
|
26
26
|
margin: g,
|
|
27
27
|
width: _ ? "min-anchor" : "content"
|
|
28
|
-
}), I =
|
|
28
|
+
}), I = a(u, {
|
|
29
29
|
zones: [O, d],
|
|
30
30
|
escape: w,
|
|
31
31
|
outside: T,
|
|
@@ -33,7 +33,7 @@ function u({ open: u, anchorRef: d, onClose: f, side: p = "bottom", align: m = "
|
|
|
33
33
|
f?.(e), e === "escape" && E && d.current?.focus();
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
return M ? /* @__PURE__ */ l(
|
|
36
|
+
return M ? /* @__PURE__ */ l(n, {
|
|
37
37
|
root: A,
|
|
38
38
|
children: /* @__PURE__ */ l("div", {
|
|
39
39
|
ref: k,
|
|
@@ -54,5 +54,4 @@ function u({ open: u, anchorRef: d, onClose: f, side: p = "bottom", align: m = "
|
|
|
54
54
|
})
|
|
55
55
|
}) : null;
|
|
56
56
|
}
|
|
57
|
-
//#endregion
|
|
58
57
|
export { u as KapiPopover };
|