@kapiuara/ui 0.22.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/base.css +1 -1
- package/dist/css/components/navigation/navigation.css +1 -1
- 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 +35 -36
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/navigation/tocLogic.ts
|
|
2
2
|
var e = (e, t) => e.filter((e) => (e.level ?? 2) <= t), t = (e, t, n = 0, r = !1) => {
|
|
3
3
|
if (e.length === 0) return null;
|
|
4
4
|
if (r) return e[e.length - 1]?.id ?? null;
|
|
@@ -7,5 +7,4 @@ var e = (e, t) => e.filter((e) => (e.level ?? 2) <= t), t = (e, t, n = 0, r = !1
|
|
|
7
7
|
else break;
|
|
8
8
|
return a;
|
|
9
9
|
}, n = (e, t, n, r = 2) => e + t >= n - r;
|
|
10
|
-
//#endregion
|
|
11
10
|
export { t as activeTocId, n as isAtBottom, e as visibleTocItems };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSlots as e } from "../slotsLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/navigation/tocSlots.ts
|
|
3
3
|
var t = e("toc", {
|
|
4
4
|
root: null,
|
|
5
5
|
heading: "kapi-toc__heading",
|
|
@@ -7,5 +7,4 @@ var t = e("toc", {
|
|
|
7
7
|
item: "kapi-toc__item",
|
|
8
8
|
link: "kapi-toc__link"
|
|
9
9
|
});
|
|
10
|
-
//#endregion
|
|
11
10
|
export { t as TOC_SLOTS };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findTypeaheadMatch as e } from "../overlays/menuKeyboardLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/components/navigation/treeLogic.ts
|
|
3
3
|
var t = (e) => (e.children?.length ?? 0) > 0 || e.hasChildren === !0, n = (e) => e.hasChildren === !0 && e.children === void 0 && e.loading !== !0, r = (e, t) => {
|
|
4
4
|
let n = new Set(t), r = [], i = (e, t, a) => {
|
|
5
5
|
e.forEach((o, s) => {
|
|
@@ -81,5 +81,4 @@ var t = (e) => (e.children?.length ?? 0) > 0 || e.hasChildren === !0, n = (e) =>
|
|
|
81
81
|
default: return null;
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
|
-
//#endregion
|
|
85
84
|
export { c as TREE_KEYS, i as findAncestors, r as flattenVisible, t as isExpandable, s as matchTypeahead, n as needsChildren, a as resolveTabStop, o as toggleSelectedId, l as treeKeyAction };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/navigation/wizardLogic.ts
|
|
2
2
|
var e = (e, t) => t <= 0 ? 0 : Math.min(Math.max(Math.trunc(e) || 0, 0), t - 1), t = (e, t) => e < t, n = (e) => typeof e?.then == "function", r = (e, t, n) => !e[t] || !n ? "blocked" : t >= e.length - 1 ? "finish" : "next";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { t as canJumpTo, e as clampStep, n as isThenable, r as resolveAdvance };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { KapiButton as e } from "../inputs/KapiButton.js";
|
|
3
|
-
import {
|
|
3
|
+
import { runSubmit as t } from "./canvasFormLogic.js";
|
|
4
4
|
import { KapiOffcanvas as n } from "./KapiOffcanvas.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useLabels as r } from "../locale/KapiLocaleProvider.js";
|
|
6
6
|
import { useCallback as i, useEffect as a, useId as o, useRef as s, useState as c } from "react";
|
|
7
7
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/components/overlays/KapiCanvasForm.tsx
|
|
9
9
|
var f = {
|
|
10
10
|
submit: "Guardar",
|
|
11
11
|
cancel: "Cancelar"
|
|
12
12
|
}, p = ({ onClose: p, children: m, onSubmit: h, onError: g, submitLabel: _, cancelLabel: v, submitDisabled: y = !1, formId: b, closeOnBackdrop: x, closeOnEscape: S, ...C }) => {
|
|
13
|
-
let w =
|
|
13
|
+
let w = r("canvasForm", f), T = o(), E = b ?? `canvas-form-${T}`, [D, O] = c(!1), k = s(!1), A = s(!0);
|
|
14
14
|
a(() => (A.current = !0, () => {
|
|
15
15
|
A.current = !1;
|
|
16
16
|
}), []);
|
|
17
17
|
let j = i((e) => {
|
|
18
|
-
e.preventDefault(),
|
|
18
|
+
e.preventDefault(), k.current || t(() => h(e), {
|
|
19
19
|
onStart: () => {
|
|
20
20
|
k.current = !0, O(!0);
|
|
21
21
|
},
|
|
@@ -52,5 +52,4 @@ var f = {
|
|
|
52
52
|
})
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
//#endregion
|
|
56
55
|
export { f as DEFAULT_CANVAS_FORM_LABELS, p as KapiCanvasForm };
|
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/KapiCommandPalette.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { enabledIndexes as r, nextEnabledIndex as i } from "./menuKeyboardLogic.js";
|
|
7
|
-
import { useBackdropClose as a, useNativeDialog as o, usePortalRoot as s } from "./useNativeDialog.js";
|
|
8
|
-
import { clampActiveIndex as c, filterGroups as ee, flattenNavigable as l, nodeText as u } from "./commandPaletteLogic.js";
|
|
3
|
+
import { clampActiveIndex as e, filterGroups as t, flattenNavigable as n, nodeText as r } from "./commandPaletteLogic.js";
|
|
4
|
+
import { enabledIndexes as i, nextEnabledIndex as a } from "./menuKeyboardLogic.js";
|
|
5
|
+
import { useBackdropClose as o, useNativeDialog as s, usePortalRoot as c } from "./useNativeDialog.js";
|
|
9
6
|
/* empty css */
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import { joinClasses as l } from "../rootProps.js";
|
|
8
|
+
import { useLabels as u } from "../locale/KapiLocaleProvider.js";
|
|
9
|
+
import { useMergedRefs as d } from "../../hooks/mergeRefs.js";
|
|
10
|
+
import { useEffect as f, useId as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
11
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
|
+
import { Search as y } from "lucide-react";
|
|
13
|
+
import { createPortal as b } from "react-dom";
|
|
14
|
+
// src/components/overlays/KapiCommandPalette.tsx
|
|
15
|
+
var x = "↑↓ para moverte · Enter para ir · Esc para cerrar", S = {
|
|
16
16
|
placeholder: "Buscar o ir a…",
|
|
17
17
|
empty: "Sin resultados",
|
|
18
|
-
footerHint:
|
|
19
|
-
},
|
|
20
|
-
let M =
|
|
21
|
-
let e =
|
|
18
|
+
footerHint: x
|
|
19
|
+
}, C = ({ onClose: x, groups: C, placeholder: w, emptyMessage: T, emptyLabel: E, footerHint: D, labels: O, className: ee, style: k, id: A, ref: j }) => {
|
|
20
|
+
let M = u("commandPalette", S, O), N = w ?? M.placeholder, P = T ?? E ?? M.empty, F = D === void 0 ? M.footerHint : D, I = p(), L = `${I}-listbox`, R = (e) => `${I}-opt-${e}`, z = h(null), [B, V] = g(""), [H, U] = g(0), { ref: W, dialogProps: G } = s({ onRequestClose: () => x("escape") }), K = d(W, j), q = o(() => x("backdrop")), J = m(() => {
|
|
21
|
+
let e = C.map((e) => ({
|
|
22
22
|
...e,
|
|
23
23
|
commands: e.commands.map((e) => ({
|
|
24
24
|
...e,
|
|
25
|
-
text:
|
|
25
|
+
text: r(e.label)
|
|
26
26
|
}))
|
|
27
27
|
}));
|
|
28
|
-
return
|
|
29
|
-
}, [
|
|
30
|
-
|
|
28
|
+
return t(e, B);
|
|
29
|
+
}, [C, B]), Y = m(() => n(J), [J]), X = e(H, Y.length), Z = X >= 0 ? Y[X] : void 0;
|
|
30
|
+
f(() => {
|
|
31
31
|
if (!Z) return;
|
|
32
32
|
let e = z.current?.querySelector(`[data-cmd-id="${CSS.escape(Z.id)}"]`);
|
|
33
33
|
e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
|
|
34
34
|
}, [Z]);
|
|
35
35
|
let Q = (e) => {
|
|
36
|
-
e.disabled || (e.onSelect(),
|
|
36
|
+
e.disabled || (e.onSelect(), x("item-selected"));
|
|
37
37
|
}, te = (e) => {
|
|
38
38
|
switch (e.key) {
|
|
39
39
|
case "ArrowDown":
|
|
40
40
|
case "ArrowUp":
|
|
41
|
-
e.preventDefault(), U(
|
|
41
|
+
e.preventDefault(), U(a(X, e.key === "ArrowDown" ? "next" : "prev", i(Y.length)));
|
|
42
42
|
break;
|
|
43
43
|
case "Home":
|
|
44
44
|
case "End":
|
|
45
|
-
Y.length > 0 && (e.preventDefault(), U(
|
|
45
|
+
Y.length > 0 && (e.preventDefault(), U(a(X, e.key === "Home" ? "first" : "last", i(Y.length))));
|
|
46
46
|
break;
|
|
47
47
|
case "Enter": Z && !e.nativeEvent.isComposing && (e.preventDefault(), Q(Z));
|
|
48
48
|
}
|
|
49
|
-
}, $ =
|
|
50
|
-
return $ ?
|
|
49
|
+
}, $ = c();
|
|
50
|
+
return $ ? b(/* @__PURE__ */ v("dialog", {
|
|
51
51
|
ref: K,
|
|
52
52
|
id: A,
|
|
53
53
|
style: k,
|
|
54
|
-
className:
|
|
54
|
+
className: l("kapi-cmdk", ee),
|
|
55
55
|
"aria-modal": "true",
|
|
56
56
|
"aria-label": N,
|
|
57
57
|
...G,
|
|
58
58
|
...q,
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ v("div", {
|
|
61
61
|
className: "kapi-cmdk__search",
|
|
62
|
-
children: [/* @__PURE__ */
|
|
62
|
+
children: [/* @__PURE__ */ _(y, {
|
|
63
63
|
size: 17,
|
|
64
64
|
strokeWidth: 2.2,
|
|
65
65
|
"aria-hidden": "true",
|
|
66
66
|
className: "kapi-cmdk__search-icon"
|
|
67
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ _("input", {
|
|
68
68
|
"data-autofocus": !0,
|
|
69
69
|
type: "text",
|
|
70
70
|
className: "kapi-cmdk__input",
|
|
@@ -90,20 +90,20 @@ var b = "↑↓ para moverte · Enter para ir · Esc para cerrar", x = {
|
|
|
90
90
|
role: "listbox",
|
|
91
91
|
"aria-label": N,
|
|
92
92
|
className: "kapi-cmdk__list",
|
|
93
|
-
children:
|
|
93
|
+
children: J.map((e) => {
|
|
94
94
|
let t = `${I}-grp-${e.id}`;
|
|
95
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ v("div", {
|
|
96
96
|
role: "group",
|
|
97
97
|
className: "kapi-cmdk__group",
|
|
98
98
|
"aria-labelledby": e.label == null ? void 0 : t,
|
|
99
|
-
children: [e.label != null && /* @__PURE__ */
|
|
99
|
+
children: [e.label != null && /* @__PURE__ */ _("div", {
|
|
100
100
|
id: t,
|
|
101
101
|
className: "kapi-cmdk__group-label",
|
|
102
102
|
role: "presentation",
|
|
103
103
|
children: e.label
|
|
104
104
|
}), e.commands.map((e) => {
|
|
105
105
|
let t = Z?.id === e.id;
|
|
106
|
-
return /* @__PURE__ */
|
|
106
|
+
return /* @__PURE__ */ v("div", {
|
|
107
107
|
id: R(e.id),
|
|
108
108
|
"data-cmd-id": e.id,
|
|
109
109
|
role: "option",
|
|
@@ -121,16 +121,16 @@ var b = "↑↓ para moverte · Enter para ir · Esc para cerrar", x = {
|
|
|
121
121
|
},
|
|
122
122
|
onClick: () => Q(e),
|
|
123
123
|
children: [
|
|
124
|
-
e.icon && /* @__PURE__ */
|
|
124
|
+
e.icon && /* @__PURE__ */ _("span", {
|
|
125
125
|
className: "kapi-cmdk__icon",
|
|
126
126
|
"aria-hidden": "true",
|
|
127
127
|
children: e.icon
|
|
128
128
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ _("span", {
|
|
130
130
|
className: "kapi-cmdk__label",
|
|
131
131
|
children: e.label
|
|
132
132
|
}),
|
|
133
|
-
e.trailing && /* @__PURE__ */
|
|
133
|
+
e.trailing && /* @__PURE__ */ _("span", {
|
|
134
134
|
className: "kapi-cmdk__trailing",
|
|
135
135
|
children: e.trailing
|
|
136
136
|
})
|
|
@@ -138,18 +138,18 @@ var b = "↑↓ para moverte · Enter para ir · Esc para cerrar", x = {
|
|
|
138
138
|
}, e.id);
|
|
139
139
|
})]
|
|
140
140
|
}, e.id);
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
})
|
|
142
|
+
}),
|
|
143
|
+
J.length === 0 && /* @__PURE__ */ _("div", {
|
|
144
|
+
className: "kapi-cmdk__empty",
|
|
145
|
+
role: "status",
|
|
146
|
+
children: P
|
|
146
147
|
}),
|
|
147
|
-
F && /* @__PURE__ */
|
|
148
|
+
F && /* @__PURE__ */ _("div", {
|
|
148
149
|
className: "kapi-cmdk__foot",
|
|
149
150
|
children: F
|
|
150
151
|
})
|
|
151
152
|
]
|
|
152
153
|
}), $) : null;
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
export { x as DEFAULT_COMMAND_PALETTE_LABELS, b as DEFAULT_FOOTER_HINT, C as KapiCommandPalette };
|
|
154
|
+
}, w = ({ open: e, ...t }) => e ? /* @__PURE__ */ _(C, { ...t }) : null;
|
|
155
|
+
export { S as DEFAULT_COMMAND_PALETTE_LABELS, x as DEFAULT_FOOTER_HINT, w as KapiCommandPalette };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/KapiConfirm.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useLabels as n } from "../locale/KapiLocaleProvider.js";
|
|
6
|
-
import { KapiModal as r } from "./KapiModal.js";
|
|
3
|
+
import { KapiButton as e } from "../inputs/KapiButton.js";
|
|
4
|
+
import { KapiModal as t } from "./KapiModal.js";
|
|
7
5
|
/* empty css */
|
|
6
|
+
import { useLabels as n } from "../locale/KapiLocaleProvider.js";
|
|
7
|
+
import { resolveTone as r } from "../tone.js";
|
|
8
8
|
import { useId as i } from "react";
|
|
9
9
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
10
10
|
import { AlertTriangle as c, CheckCircle2 as l, CircleHelp as u, Info as d, Trash2 as f } from "lucide-react";
|
|
11
|
-
|
|
11
|
+
// src/components/overlays/KapiConfirm.tsx
|
|
12
12
|
var p = {
|
|
13
13
|
danger: {
|
|
14
14
|
Icon: f,
|
|
@@ -39,8 +39,8 @@ var p = {
|
|
|
39
39
|
question: "Sí",
|
|
40
40
|
error: "No se pudo completar la acción"
|
|
41
41
|
}, h = ({ open: c, tone: l, variant: u, title: d, message: f, confirmLabel: h, cancelLabel: g, labels: _, loading: v = !1, error: y, onConfirm: b, onClose: x, className: S, style: C, id: w, ref: T }) => {
|
|
42
|
-
let E = i(), D = n("confirm", m, _), O =
|
|
43
|
-
return /* @__PURE__ */ s(
|
|
42
|
+
let E = i(), D = n("confirm", m, _), O = r(l, u, "question"), k = O in p ? O : "question", { Icon: A, button: j } = p[k];
|
|
43
|
+
return /* @__PURE__ */ s(t, {
|
|
44
44
|
ref: T,
|
|
45
45
|
className: S,
|
|
46
46
|
style: C,
|
|
@@ -52,12 +52,12 @@ var p = {
|
|
|
52
52
|
onClose: v ? () => {} : x,
|
|
53
53
|
closeOnEscape: !v,
|
|
54
54
|
closeOnBackdrop: !v,
|
|
55
|
-
footer: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(
|
|
55
|
+
footer: /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, {
|
|
56
56
|
"data-autofocus": !0,
|
|
57
57
|
disabled: v,
|
|
58
58
|
onClick: () => x("cancel"),
|
|
59
59
|
children: g ?? D.cancel
|
|
60
|
-
}), /* @__PURE__ */ o(
|
|
60
|
+
}), /* @__PURE__ */ o(e, {
|
|
61
61
|
tone: j,
|
|
62
62
|
loading: v,
|
|
63
63
|
onClick: b,
|
|
@@ -88,5 +88,4 @@ var p = {
|
|
|
88
88
|
]
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
|
-
//#endregion
|
|
92
91
|
export { m as DEFAULT_CONFIRM_LABELS, h as KapiConfirm };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/overlays.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { POINT_MENU_PLACEMENT as e } from "../../hooks/rightClick.js";
|
|
4
|
+
import { usePlacement as t } from "../../hooks/usePlacement.js";
|
|
5
|
+
import { estimateMenuHeight as n } from "./menuButtonLogic.js";
|
|
6
|
+
import { MenuList as r } from "./menuList.js";
|
|
7
|
+
import { useLabels as i } from "../locale/KapiLocaleProvider.js";
|
|
8
|
+
import { joinClasses as a } from "../rootProps.js";
|
|
8
9
|
/* empty css */
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { MenuList as s } from "./menuList.js";
|
|
10
|
+
import { useMergedRefs as o } from "../../hooks/mergeRefs.js";
|
|
11
|
+
import { useDismiss as s } from "../../hooks/useDismiss.js";
|
|
12
12
|
import { useFocusReturn as c } from "../../hooks/useFocusReturn.js";
|
|
13
13
|
import { useLayoutEffect as l, useRef as u } from "react";
|
|
14
14
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
15
|
-
|
|
15
|
+
// src/components/overlays/KapiContextMenu.tsx
|
|
16
16
|
var m = { menu: "Menú contextual" }, h = 210, g = ({ open: e, ...t }) => e ? /* @__PURE__ */ f(_, { ...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 =
|
|
17
|
+
let E = i("contextMenu", m, w), D = u(null), O = o(D, C);
|
|
18
18
|
c(!0, {
|
|
19
19
|
container: D,
|
|
20
20
|
restoreOnDeactivate: "if-lost"
|
|
21
21
|
});
|
|
22
|
-
let k =
|
|
22
|
+
let k = s(!0, {
|
|
23
23
|
zones: [D],
|
|
24
24
|
outside: !1,
|
|
25
25
|
onDismiss: (e) => y(e)
|
|
26
|
-
}), { placement: A, update: j } =
|
|
26
|
+
}), { placement: A, update: j } = t({
|
|
27
27
|
open: !0,
|
|
28
28
|
anchor: () => ({
|
|
29
29
|
x: g,
|
|
@@ -32,9 +32,9 @@ var m = { menu: "Menú contextual" }, h = 210, g = ({ open: e, ...t }) => e ? /*
|
|
|
32
32
|
floatingRef: D,
|
|
33
33
|
estimate: {
|
|
34
34
|
width: h,
|
|
35
|
-
height:
|
|
35
|
+
height: n(v)
|
|
36
36
|
},
|
|
37
|
-
...
|
|
37
|
+
...e,
|
|
38
38
|
hideUntilPlaced: !1
|
|
39
39
|
});
|
|
40
40
|
l(() => {
|
|
@@ -52,10 +52,10 @@ var m = { menu: "Menú contextual" }, h = 210, g = ({ open: e, ...t }) => e ? /*
|
|
|
52
52
|
onContextMenu: (e) => {
|
|
53
53
|
e.preventDefault(), y("outside");
|
|
54
54
|
}
|
|
55
|
-
}), /* @__PURE__ */ f(
|
|
55
|
+
}), /* @__PURE__ */ f(r, {
|
|
56
56
|
ref: O,
|
|
57
57
|
id: S,
|
|
58
|
-
className:
|
|
58
|
+
className: a("kapi-ctxmenu", b),
|
|
59
59
|
style: {
|
|
60
60
|
...x,
|
|
61
61
|
left: M,
|
|
@@ -72,5 +72,4 @@ var m = { menu: "Menú contextual" }, h = 210, g = ({ open: e, ...t }) => e ? /*
|
|
|
72
72
|
}
|
|
73
73
|
})] });
|
|
74
74
|
};
|
|
75
|
-
//#endregion
|
|
76
75
|
export { m as DEFAULT_CONTEXT_MENU_LABELS, g as KapiContextMenu };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/KapiConfirm.css";
|
|
3
3
|
import "#kapi-css/components/overlays/KapiModal.css";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useNativeDialog as
|
|
8
|
-
/* empty css */
|
|
9
|
-
import { KapiModal as a } from "./KapiModal.js";
|
|
4
|
+
import { KapiButton as e } from "../inputs/KapiButton.js";
|
|
5
|
+
import { DEFAULT_CONFIRM_LABELS as t, KapiConfirm as n } from "./KapiConfirm.js";
|
|
6
|
+
import { KapiModal as r } from "./KapiModal.js";
|
|
7
|
+
import { useNativeDialog as i, usePortalRoot as a } from "./useNativeDialog.js";
|
|
10
8
|
/* empty css */
|
|
11
|
-
|
|
12
|
-
import {
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { useLabels as o } from "../locale/KapiLocaleProvider.js";
|
|
11
|
+
import { confirmErrorMessage as s, dialogStore as c } from "./dialogStore.js";
|
|
12
|
+
import { resolveTone as l } from "../tone.js";
|
|
13
13
|
import { useId as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
|
|
14
14
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
15
15
|
import { AlertTriangle as _, CheckCircle2 as v, Info as y, XCircle as b } from "lucide-react";
|
|
16
16
|
import { createPortal as x } from "react-dom";
|
|
17
|
-
|
|
17
|
+
// src/components/overlays/KapiDialogHost.tsx
|
|
18
18
|
var S = {
|
|
19
19
|
accept: "Aceptar",
|
|
20
20
|
loading: "Cargando…"
|
|
@@ -23,74 +23,74 @@ var S = {
|
|
|
23
23
|
danger: b,
|
|
24
24
|
info: y,
|
|
25
25
|
warning: _
|
|
26
|
-
}, w = ({ options:
|
|
27
|
-
let
|
|
28
|
-
return /* @__PURE__ */ g(
|
|
26
|
+
}, w = ({ options: t, acceptLabel: n, onClose: i }) => {
|
|
27
|
+
let a = u(), o = l(t.tone, t.variant, "info"), s = o in C ? o : "info", c = C[s];
|
|
28
|
+
return /* @__PURE__ */ g(r, {
|
|
29
29
|
size: "sm",
|
|
30
30
|
hideHeader: !0,
|
|
31
|
-
"aria-labelledby":
|
|
31
|
+
"aria-labelledby": a,
|
|
32
32
|
open: !0,
|
|
33
33
|
onClose: i,
|
|
34
|
-
footer: /* @__PURE__ */ h(
|
|
34
|
+
footer: /* @__PURE__ */ h(e, {
|
|
35
35
|
"data-autofocus": !0,
|
|
36
36
|
tone: "primary",
|
|
37
37
|
onClick: i,
|
|
38
|
-
children:
|
|
38
|
+
children: t.acceptLabel ?? n
|
|
39
39
|
}),
|
|
40
40
|
children: [
|
|
41
41
|
/* @__PURE__ */ h("div", {
|
|
42
|
-
className: `kapi-confirm__icon kapi-confirm__icon--${
|
|
43
|
-
children: /* @__PURE__ */ h(
|
|
42
|
+
className: `kapi-confirm__icon kapi-confirm__icon--${s}`,
|
|
43
|
+
children: /* @__PURE__ */ h(c, {
|
|
44
44
|
size: 28,
|
|
45
45
|
strokeWidth: 2
|
|
46
46
|
})
|
|
47
47
|
}),
|
|
48
48
|
/* @__PURE__ */ h("div", {
|
|
49
|
-
id:
|
|
49
|
+
id: a,
|
|
50
50
|
className: "kapi-confirm__title",
|
|
51
|
-
children:
|
|
51
|
+
children: t.title
|
|
52
52
|
}),
|
|
53
|
-
|
|
53
|
+
t.message && /* @__PURE__ */ h("div", {
|
|
54
54
|
className: "kapi-confirm__msg",
|
|
55
|
-
children:
|
|
55
|
+
children: t.message
|
|
56
56
|
})
|
|
57
57
|
]
|
|
58
58
|
});
|
|
59
|
-
}, T = ({ options: e, onSettle:
|
|
60
|
-
let
|
|
59
|
+
}, T = ({ options: e, onSettle: r }) => {
|
|
60
|
+
let i = o("confirm", t), [a, c] = f({
|
|
61
61
|
busy: !1,
|
|
62
62
|
error: null
|
|
63
63
|
}), l = d(!1);
|
|
64
|
-
return /* @__PURE__ */ h(
|
|
64
|
+
return /* @__PURE__ */ h(n, {
|
|
65
65
|
open: !0,
|
|
66
66
|
title: e.title,
|
|
67
67
|
message: e.message,
|
|
68
68
|
tone: e.tone ?? e.variant,
|
|
69
69
|
confirmLabel: e.confirmLabel,
|
|
70
70
|
cancelLabel: e.cancelLabel,
|
|
71
|
-
loading:
|
|
72
|
-
error:
|
|
71
|
+
loading: a.busy,
|
|
72
|
+
error: a.error ?? void 0,
|
|
73
73
|
onConfirm: () => {
|
|
74
|
-
let
|
|
75
|
-
if (!
|
|
76
|
-
l.current || (l.current = !0,
|
|
74
|
+
let t = e.onConfirm;
|
|
75
|
+
if (!t) return r(!0);
|
|
76
|
+
l.current || (l.current = !0, c({
|
|
77
77
|
busy: !0,
|
|
78
78
|
error: null
|
|
79
|
-
}), new Promise((e) => e(
|
|
80
|
-
l.current = !1,
|
|
79
|
+
}), new Promise((e) => e(t())).then(() => {
|
|
80
|
+
l.current = !1, r(!0);
|
|
81
81
|
}, (e) => {
|
|
82
|
-
l.current = !1,
|
|
82
|
+
l.current = !1, c({
|
|
83
83
|
busy: !1,
|
|
84
|
-
error:
|
|
84
|
+
error: s(e) ?? i.error
|
|
85
85
|
});
|
|
86
86
|
}));
|
|
87
87
|
},
|
|
88
|
-
onClose: () =>
|
|
88
|
+
onClose: () => r(!1)
|
|
89
89
|
});
|
|
90
90
|
}, E = ({ message: e, root: t }) => {
|
|
91
|
-
let n = u(), { ref:
|
|
91
|
+
let n = u(), { ref: r, dialogProps: a } = i();
|
|
92
92
|
return x(/* @__PURE__ */ h("dialog", {
|
|
93
|
-
ref:
|
|
93
|
+
ref: r,
|
|
94
94
|
className: "kapi-loading-overlay kapi-loading-dialog",
|
|
95
95
|
"aria-modal": "true",
|
|
96
96
|
"aria-busy": "true",
|
|
@@ -110,23 +110,22 @@ var S = {
|
|
|
110
110
|
})]
|
|
111
111
|
})
|
|
112
112
|
}), t);
|
|
113
|
-
}, D = ({ labels: e, store: t =
|
|
114
|
-
let
|
|
113
|
+
}, D = ({ labels: e, store: t = c }) => {
|
|
114
|
+
let n = o("dialog", S, e), { dialog: r, loading: i } = p(t.subscribe, t.getSnapshot, t.getSnapshot), s = a(), l = i && !r ? s : null;
|
|
115
115
|
return /* @__PURE__ */ g(m, { children: [
|
|
116
|
-
|
|
117
|
-
options:
|
|
118
|
-
onSettle: (e) => t.settle(
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
options:
|
|
122
|
-
acceptLabel:
|
|
123
|
-
onClose: () => t.settle(
|
|
124
|
-
},
|
|
125
|
-
!
|
|
126
|
-
message:
|
|
127
|
-
root:
|
|
116
|
+
r?.kind === "confirm" && /* @__PURE__ */ h(T, {
|
|
117
|
+
options: r.options,
|
|
118
|
+
onSettle: (e) => t.settle(r.id, e)
|
|
119
|
+
}, r.id),
|
|
120
|
+
r?.kind === "alert" && /* @__PURE__ */ h(w, {
|
|
121
|
+
options: r.options,
|
|
122
|
+
acceptLabel: n.accept,
|
|
123
|
+
onClose: () => t.settle(r.id, !1)
|
|
124
|
+
}, r.id),
|
|
125
|
+
!r && i && l && /* @__PURE__ */ h(E, {
|
|
126
|
+
message: i.message ?? n.loading,
|
|
127
|
+
root: l
|
|
128
128
|
})
|
|
129
129
|
] });
|
|
130
130
|
};
|
|
131
|
-
//#endregion
|
|
132
131
|
export { S as DEFAULT_DIALOG_LABELS, D as KapiDialogHost };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/overlays.css";
|
|
3
|
+
/* empty css */
|
|
3
4
|
import { joinClasses as e } from "../rootProps.js";
|
|
4
5
|
import { KapiSelect as t } from "../inputs/KapiSelect.js";
|
|
5
|
-
/* empty css */
|
|
6
6
|
import { jsx as n } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/overlays/KapiDropdown.tsx
|
|
8
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
9
|
let x = a.map((e) => ({
|
|
10
10
|
value: String(e),
|
|
@@ -34,5 +34,4 @@ var r = ({ value: r, defaultValue: i, options: a, onChange: o, icon: s, label: c
|
|
|
34
34
|
})
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { r as KapiDropdown };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "#kapi-css/components/overlays/KapiViewport.css";
|
|
3
|
-
import {
|
|
3
|
+
import { KapiIconButton as e } from "../inputs/KapiIconButton.js";
|
|
4
4
|
import { useLabels as t } from "../locale/KapiLocaleProvider.js";
|
|
5
|
-
import {
|
|
5
|
+
import { joinClasses as n } from "../rootProps.js";
|
|
6
6
|
import { useControllableState as r } from "../../hooks/useControllableState.js";
|
|
7
7
|
import { useDismiss as i } from "../../hooks/useDismiss.js";
|
|
8
|
-
/* empty css */
|
|
9
8
|
import { KapiViewport as a } from "./KapiViewport.js";
|
|
9
|
+
/* empty css */
|
|
10
10
|
import { useCallback as o, useId as s, useRef as c, useState as l } from "react";
|
|
11
11
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
12
|
import { ChevronLeft as p, ChevronRight as m, X as h } from "lucide-react";
|
|
13
|
-
|
|
13
|
+
// src/components/overlays/KapiImageViewer.tsx
|
|
14
14
|
var g = {
|
|
15
15
|
close: "Cerrar el visor",
|
|
16
16
|
previous: "Imagen anterior",
|
|
@@ -34,7 +34,7 @@ var g = {
|
|
|
34
34
|
k.current = e, typeof _ == "function" ? _(e) : _ && (_.current = e);
|
|
35
35
|
},
|
|
36
36
|
id: E,
|
|
37
|
-
className:
|
|
37
|
+
className: n("kapi-imgviewer", w),
|
|
38
38
|
style: T,
|
|
39
39
|
role: "dialog",
|
|
40
40
|
"aria-modal": "true",
|
|
@@ -52,7 +52,7 @@ var g = {
|
|
|
52
52
|
className: "kapi-imgviewer__count",
|
|
53
53
|
children: H
|
|
54
54
|
}),
|
|
55
|
-
/* @__PURE__ */ d(
|
|
55
|
+
/* @__PURE__ */ d(e, {
|
|
56
56
|
"aria-label": O.close,
|
|
57
57
|
icon: /* @__PURE__ */ d(h, {
|
|
58
58
|
size: 18,
|
|
@@ -78,7 +78,7 @@ var g = {
|
|
|
78
78
|
})
|
|
79
79
|
})
|
|
80
80
|
}, L.src),
|
|
81
|
-
F > 1 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
81
|
+
F > 1 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(e, {
|
|
82
82
|
className: "kapi-imgviewer__prev",
|
|
83
83
|
"aria-label": O.previous,
|
|
84
84
|
icon: /* @__PURE__ */ d(p, {
|
|
@@ -86,7 +86,7 @@ var g = {
|
|
|
86
86
|
strokeWidth: 2.2
|
|
87
87
|
}),
|
|
88
88
|
onClick: () => R(-1)
|
|
89
|
-
}), /* @__PURE__ */ d(
|
|
89
|
+
}), /* @__PURE__ */ d(e, {
|
|
90
90
|
className: "kapi-imgviewer__next",
|
|
91
91
|
"aria-label": O.next,
|
|
92
92
|
icon: /* @__PURE__ */ d(m, {
|
|
@@ -102,5 +102,4 @@ var g = {
|
|
|
102
102
|
]
|
|
103
103
|
});
|
|
104
104
|
};
|
|
105
|
-
//#endregion
|
|
106
105
|
export { g as DEFAULT_IMAGE_VIEWER_LABELS, _ as KapiImageViewer };
|