@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/hooks/downloadLogic.ts
|
|
2
2
|
var e = (e) => e.split(/[\\/]/).pop() ?? "", t = (e) => {
|
|
3
3
|
let t = /* @__PURE__ */ new Map();
|
|
4
4
|
for (let n of `;${e}`.matchAll(/;\s*([^\s=;]+)\s*=\s*("(?:[^"\\]|\\.)*"|[^;]*)/g)) {
|
|
@@ -81,5 +81,4 @@ var e = (e) => e.split(/[\\/]/).pop() ?? "", t = (e) => {
|
|
|
81
81
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
82
82
|
r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), r.remove(), setTimeout(() => URL.revokeObjectURL(n), 0);
|
|
83
83
|
};
|
|
84
|
-
//#endregion
|
|
85
84
|
export { g as downloadBlob, l as fileKind, r as fileNameFromContentDisposition, i as fileNameFromUrl, p as formatFileSize, h as isSafeFileUrl };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/fieldErrorsLogic.ts
|
|
2
2
|
var e = (e) => e != null && e !== !1 && e !== "", t = (t) => Object.values(t).some(e), n = (t, n) => e(t) && (n.touched || n.submitted) ? t : void 0, r = (e, t) => e[t] ? e : {
|
|
3
3
|
...e,
|
|
4
4
|
[t]: !0
|
|
@@ -9,5 +9,4 @@ var e = (e) => e != null && e !== !1 && e !== "", t = (t) => Object.values(t).so
|
|
|
9
9
|
invalid: !1,
|
|
10
10
|
help: n
|
|
11
11
|
}, a = (e, t) => t === null || typeof t.nodeType != "number" || !e.contains(t);
|
|
12
|
-
//#endregion
|
|
13
12
|
export { a as blurLeavesField, i as fieldErrorProps, e as hasFieldError, t as hasFieldErrors, r as touchField, n as visibleFieldError };
|
package/dist/hooks/focusLogic.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { activeElementOf as e } from "./ownerDocument.js";
|
|
2
|
-
|
|
3
|
-
var t = [
|
|
4
|
-
"a[href]",
|
|
5
|
-
"button:not([disabled])",
|
|
6
|
-
"input:not([disabled]):not([type='hidden'])",
|
|
7
|
-
"select:not([disabled])",
|
|
8
|
-
"textarea:not([disabled])",
|
|
9
|
-
"[tabindex]:not([tabindex='-1'])",
|
|
10
|
-
"[contenteditable='true']"
|
|
11
|
-
].join(","), n = (e) => e ? Array.from(e.querySelectorAll(t)).filter((e) => !e.closest("[inert]") && e.tabIndex >= 0) : [], r = (e, t, n) => e === 0 ? -1 : t < 0 ? n ? e - 1 : 0 : n ? (t - 1 + e) % e : (t + 1) % e, i = (t, i) => {
|
|
2
|
+
// src/hooks/focusLogic.ts
|
|
3
|
+
var t = "a[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex='-1']),[contenteditable='true']", n = (e) => e ? Array.from(e.querySelectorAll(t)).filter((e) => !e.closest("[inert]") && e.tabIndex >= 0) : [], r = (e, t, n) => e === 0 ? -1 : t < 0 ? n ? e - 1 : 0 : n ? (t - 1 + e) % e : (t + 1) % e, i = (t, i) => {
|
|
12
4
|
if (t.key !== "Tab" || !i) return !1;
|
|
13
5
|
t.preventDefault();
|
|
14
6
|
let a = n(i), o = a.indexOf(e(i)), s = r(a.length, o, t.shiftKey);
|
|
15
7
|
return (s < 0 ? i : a[s])?.focus(), !0;
|
|
16
8
|
};
|
|
17
|
-
//#endregion
|
|
18
9
|
export { t as FOCUSABLE_SELECTOR, n as focusableWithin, r as nextTrapIndex, i as trapTabKey };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/growOriginLogic.ts
|
|
2
2
|
var e = (e) => ({
|
|
3
3
|
x: e.left + e.width / 2,
|
|
4
4
|
y: e.top + e.height / 2
|
|
@@ -6,5 +6,4 @@ var e = (e) => ({
|
|
|
6
6
|
x: t(e.x - n.left, n.width),
|
|
7
7
|
y: t(e.y - n.top, n.height)
|
|
8
8
|
});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as originWithinCard, e as rectCenter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/hotkeyLogic.ts
|
|
2
2
|
var e = {
|
|
3
3
|
esc: "escape",
|
|
4
4
|
space: " ",
|
|
@@ -29,5 +29,4 @@ var e = {
|
|
|
29
29
|
else return null;
|
|
30
30
|
return a;
|
|
31
31
|
}, r = (e) => e.length === 1 && e !== " " && e.toLowerCase() === e.toUpperCase(), i = (e, t) => e.key.toLowerCase() !== t.key || e.altKey !== t.alt || (t.shift || !r(t.key)) && e.shiftKey !== t.shift ? !1 : t.mod ? e.ctrlKey !== e.metaKey : e.ctrlKey === t.ctrl && e.metaKey === t.meta;
|
|
32
|
-
//#endregion
|
|
33
32
|
export { t as hotkeyTokens, i as matchesHotkey, n as parseHotkey };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hotkeyTokens as e } from "./hotkeyLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/hotkeyRegistry.ts
|
|
3
3
|
var t = /* @__PURE__ */ new Set(), n = [], r = {
|
|
4
4
|
subscribe(e) {
|
|
5
5
|
return t.add(e), () => void t.delete(e);
|
|
@@ -28,5 +28,4 @@ var t = /* @__PURE__ */ new Set(), n = [], r = {
|
|
|
28
28
|
items: r.get(e)
|
|
29
29
|
}));
|
|
30
30
|
}, a = (t, n) => e(t).map((e) => e.toLowerCase()).filter(Boolean).map((e) => e === "mod" ? n ? "⌘" : "Ctrl" : e === "meta" || e === "cmd" ? n ? "⌘" : "Win" : e === "ctrl" ? "Ctrl" : e === "alt" ? n ? "⌥" : "Alt" : e === "shift" ? n ? "⇧" : "Shift" : e === "escape" || e === "esc" ? "Esc" : e === "arrowup" ? "↑" : e === "arrowdown" ? "↓" : e === "arrowleft" ? "←" : e === "arrowright" ? "→" : e === "enter" ? "Enter" : e === "space" ? "Espacio" : e.length === 1 ? e.toUpperCase() : e.charAt(0).toUpperCase() + e.slice(1));
|
|
31
|
-
//#endregion
|
|
32
31
|
export { i as groupHotkeys, a as hotkeyKeys, r as hotkeyRegistry };
|
package/dist/hooks/kapiRoot.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { docOf as e, rootNodeOf as t } from "./ownerDocument.js";
|
|
3
3
|
import { usePortalRootOverride as n } from "./portalRoot.js";
|
|
4
4
|
import { useEffect as r, useState as i } from "react";
|
|
5
|
-
|
|
5
|
+
// src/hooks/kapiRoot.ts
|
|
6
6
|
var a = ".kapi", o = "resolveKapiRoot: no hay ninguna raíz .kapi en el documento, así que los overlays (menús, diálogos, toasts) se montan en <body> sin los tokens del tema. Envuelve la app en <KapiShell> o <KapiRoot>.", s = !1, c = !1, l = (e) => {
|
|
7
7
|
s || c || (s = !0, setTimeout(() => {
|
|
8
|
-
s = !1,
|
|
8
|
+
s = !1, c || e.querySelector(".kapi") || (c = !0, console.warn(o));
|
|
9
9
|
}, 0));
|
|
10
10
|
}, u = (n) => {
|
|
11
11
|
let r = e(n);
|
|
@@ -18,5 +18,4 @@ var a = ".kapi", o = "resolveKapiRoot: no hay ninguna raíz .kapi en el document
|
|
|
18
18
|
let [t, a] = i(null), o = n();
|
|
19
19
|
return r(() => a(u(e?.current)), [e]), e ? t : o ?? t;
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { a as KAPI_ROOT_SELECTOR, u as resolveKapiRoot, d as useKapiRoot };
|
package/dist/hooks/mergeRefs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useMemo as e } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/mergeRefs.ts
|
|
4
4
|
var t = (...e) => (t) => {
|
|
5
5
|
let n = e.map((e) => {
|
|
6
6
|
if (typeof e == "function") {
|
|
@@ -11,5 +11,4 @@ var t = (...e) => (t) => {
|
|
|
11
11
|
});
|
|
12
12
|
return () => n.forEach((e) => e?.());
|
|
13
13
|
}, n = (...n) => e(() => t(...n), n);
|
|
14
|
-
//#endregion
|
|
15
14
|
export { t as mergeRefs, n as useMergedRefs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/numberFormatLogic.ts
|
|
2
2
|
var e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
3
3
|
let n = e.get(t);
|
|
4
4
|
return n || (n = new Intl.NumberFormat(t, { maximumFractionDigits: 0 }), e.set(t, n)), n;
|
|
@@ -6,5 +6,4 @@ var e = /* @__PURE__ */ new Map(), t = (t) => {
|
|
|
6
6
|
let t = r.get(e);
|
|
7
7
|
return t || (t = new Intl.NumberFormat(e, { maximumFractionDigits: 3 }), r.set(e, t)), t;
|
|
8
8
|
}, a = (e, t = "es") => Number.isFinite(e) ? i(t).format(e) : "";
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as formatCount, a as formatDataValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/onlineStatusLogic.ts
|
|
2
2
|
var e = Object.freeze({
|
|
3
3
|
online: !0,
|
|
4
4
|
since: null
|
|
@@ -24,5 +24,4 @@ var r = ({ target: e = typeof window > "u" ? null : window, read: n = () => t(),
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { e as SERVER_ONLINE_STATUS, r as createOnlineStore, t as readOnline };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/ownerDocument.ts
|
|
2
2
|
var e = (e) => e ? e.nodeType === 9 ? e : e.ownerDocument : typeof document > "u" ? null : document, t = (t) => {
|
|
3
3
|
let n = t ? e(t) : null;
|
|
4
4
|
return n ? n.defaultView : typeof window > "u" ? null : window;
|
|
@@ -20,5 +20,4 @@ var e = (e) => e ? e.nodeType === 9 ? e : e.ownerDocument : typeof document > "u
|
|
|
20
20
|
let r = e.target;
|
|
21
21
|
return !!r && typeof r.nodeType == "number" && t.contains(r);
|
|
22
22
|
}, o = (e) => (t(e) ?? window).getComputedStyle(e);
|
|
23
|
-
//#endregion
|
|
24
23
|
export { r as activeElementOf, i as activeHTMLElementOf, o as computedStyleOf, e as docOf, a as eventWithin, n as rootNodeOf, t as winOf };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/persistentStateLogic.ts
|
|
2
2
|
var e = (e, t) => JSON.stringify({
|
|
3
3
|
v: t,
|
|
4
4
|
data: e
|
|
@@ -13,5 +13,4 @@ var e = (e, t) => JSON.stringify({
|
|
|
13
13
|
return n;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { t as parseStored, e as serializeStored };
|
package/dist/hooks/portalRoot.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext as e, useContext as t } from "react";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/hooks/portalRoot.tsx
|
|
5
5
|
var r = e(null), i = ({ root: e, children: t }) => /* @__PURE__ */ n(r.Provider, {
|
|
6
6
|
value: e,
|
|
7
7
|
children: t
|
|
8
8
|
}), a = () => t(r);
|
|
9
|
-
//#endregion
|
|
10
9
|
export { i as KapiPortalRootProvider, a as usePortalRootOverride };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/rafThrottle.ts
|
|
2
2
|
var e = () => typeof requestAnimationFrame == "function" ? {
|
|
3
3
|
request: (e) => requestAnimationFrame(e),
|
|
4
4
|
cancel: (e) => cancelAnimationFrame(e)
|
|
@@ -62,5 +62,4 @@ var e = () => typeof requestAnimationFrame == "function" ? {
|
|
|
62
62
|
e !== -1 && u.splice(e, 1);
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
//#endregion
|
|
66
65
|
export { o as onViewportChange, t as rafThrottle };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/rangeSelectLogic.ts
|
|
2
2
|
var e = (e, t, n) => {
|
|
3
3
|
let r = e.indexOf(t), i = e.indexOf(n);
|
|
4
4
|
return r === -1 || i === -1 ? [] : e.slice(Math.min(r, i), Math.max(r, i) + 1);
|
|
@@ -25,5 +25,4 @@ var e = (e, t, n) => {
|
|
|
25
25
|
let s = e(r, i, a);
|
|
26
26
|
return t(n, o ? s.filter(o) : s, !0);
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { t as applyRangeSelection, r as extendRange, e as rangeBetween, n as toggleWithRange };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/recentLogic.ts
|
|
2
2
|
var e = (e, t, n, r) => {
|
|
3
3
|
let i = e.filter((e) => e.id !== t.id);
|
|
4
4
|
return [{
|
|
@@ -6,5 +6,4 @@ var e = (e, t, n, r) => {
|
|
|
6
6
|
at: r
|
|
7
7
|
}, ...i].slice(0, Math.max(0, n));
|
|
8
8
|
}, t = (e, t) => e.filter((e) => e.id !== t);
|
|
9
|
-
//#endregion
|
|
10
9
|
export { e as addRecentEntry, t as removeRecentEntry };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { KAPI_ROOT_SELECTOR as e } from "./kapiRoot.js";
|
|
2
|
+
import { docOf as t, winOf as n } from "./ownerDocument.js";
|
|
3
|
+
// src/hooks/reducedMotion.ts
|
|
4
4
|
var r = "(prefers-reduced-motion: reduce)", i = (e) => {
|
|
5
|
-
let
|
|
6
|
-
return
|
|
7
|
-
}, a = (
|
|
5
|
+
let t = n(e);
|
|
6
|
+
return t && typeof t.matchMedia == "function" ? (e) => t.matchMedia(e) : null;
|
|
7
|
+
}, a = (n, r = i(n)) => {
|
|
8
8
|
if (r?.("(prefers-reduced-motion: reduce)").matches) return !0;
|
|
9
|
-
let a =
|
|
10
|
-
return a ? (
|
|
9
|
+
let a = t(n);
|
|
10
|
+
return a ? (n ? n.closest(e) : a.querySelector(e))?.getAttribute("data-motion") === "reduced" : !1;
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { r as REDUCED_MOTION_QUERY, a as prefersReducedMotion };
|
package/dist/hooks/rightClick.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { placePopover as e } from "../components/overlays/popoverLogic.js";
|
|
2
|
+
import { computedStyleOf as t } from "./ownerDocument.js";
|
|
3
|
+
// src/hooks/rightClick.ts
|
|
4
4
|
var n = "button, a, input, select, textarea, label, [role=button], [data-no-drag]", r = (e, t) => Math.abs(e) + Math.abs(t) > 4, i = (e, t) => t > 0 && e - t < 450, a = {
|
|
5
5
|
side: "bottom",
|
|
6
6
|
align: "start",
|
|
7
7
|
offset: 0,
|
|
8
8
|
flip: !1,
|
|
9
9
|
shift: "both"
|
|
10
|
-
}, o = (
|
|
11
|
-
let { left: s, top: c } =
|
|
12
|
-
x:
|
|
10
|
+
}, o = (t, n, r, i, o = 8) => {
|
|
11
|
+
let { left: s, top: c } = e({
|
|
12
|
+
x: t,
|
|
13
13
|
y: n
|
|
14
14
|
}, r, i, {
|
|
15
15
|
...a,
|
|
@@ -19,11 +19,11 @@ var n = "button, a, input, select, textarea, label, [role=button], [data-no-drag
|
|
|
19
19
|
left: s,
|
|
20
20
|
top: c
|
|
21
21
|
};
|
|
22
|
-
}, s = (
|
|
23
|
-
let n = e
|
|
22
|
+
}, s = (e) => {
|
|
23
|
+
let n = t(e);
|
|
24
24
|
return {
|
|
25
|
-
x: /(auto|scroll)/.test(n.overflowX) &&
|
|
26
|
-
y: /(auto|scroll)/.test(n.overflowY) &&
|
|
25
|
+
x: /(auto|scroll)/.test(n.overflowX) && e.scrollWidth > e.clientWidth,
|
|
26
|
+
y: /(auto|scroll)/.test(n.overflowY) && e.scrollHeight > e.clientHeight
|
|
27
27
|
};
|
|
28
28
|
}, c = (e) => {
|
|
29
29
|
for (let t = e; t && t !== document.body; t = t.parentElement) {
|
|
@@ -33,5 +33,4 @@ var n = "button, a, input, select, textarea, label, [role=button], [data-no-drag
|
|
|
33
33
|
}
|
|
34
34
|
return null;
|
|
35
35
|
}, l = (e) => e instanceof Element && e.closest("button, a, input, select, textarea, label, [role=button], [data-no-drag]") !== null, u = (e, t) => (e || t) !== "touch";
|
|
36
|
-
//#endregion
|
|
37
36
|
export { n as INTERACTIVE_SELECTOR, a as POINT_MENU_PLACEMENT, o as clampMenuPosition, r as exceedsDragThreshold, c as findScrollableAncestor, i as isDoubleRightClick, l as isInteractiveTarget, s as scrollableAxes, u as shouldInterceptContextMenu };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/scrollEdgesLogic.ts
|
|
2
2
|
var e = 1, t = .85, n = ({ clientSize: e, scrollSize: t }) => Math.max(0, t - e), r = (e, t = 1) => {
|
|
3
3
|
let r = n(e);
|
|
4
4
|
return r <= t ? {
|
|
@@ -15,5 +15,4 @@ var e = 1, t = .85, n = ({ clientSize: e, scrollSize: t }) => Math.max(0, t - e)
|
|
|
15
15
|
let i = n(e), a = 0;
|
|
16
16
|
return t.start < r ? a = t.start - r : t.end > e.clientSize - r && (a = Math.min(t.end - (e.clientSize - r), t.start - r)), Math.min(i, Math.max(0, e.position + a));
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { t as DEFAULT_PAGE_FRACTION, e as DEFAULT_SCROLL_EDGE_TOLERANCE, n as maxScroll, a as pageSize, o as pageTarget, s as revealTarget, i as sameScrollEdges, r as scrollEdges };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRef as e } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/shallowStable.ts
|
|
4
4
|
var t = (e, t) => {
|
|
5
5
|
if (Object.is(e, t)) return !0;
|
|
6
6
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
@@ -13,5 +13,4 @@ var t = (e, t) => {
|
|
|
13
13
|
let r = e(n);
|
|
14
14
|
return t(r.current, n) || (r.current = n), r.current;
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { t as shallowEqual, n as useShallowStable };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/slidingIndicatorLogic.ts
|
|
2
2
|
var e = (e, t, n = {
|
|
3
3
|
left: 0,
|
|
4
4
|
top: 0
|
|
@@ -11,5 +11,4 @@ var e = (e, t, n = {
|
|
|
11
11
|
width: Math.round(e.width),
|
|
12
12
|
height: Math.round(e.height)
|
|
13
13
|
});
|
|
14
|
-
//#endregion
|
|
15
14
|
export { e as slidingIndicatorBox };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/storageLogic.ts
|
|
2
2
|
var e = "kapi", t = (e, t) => `${e || "kapi"}:${t}`, n = () => {
|
|
3
3
|
try {
|
|
4
4
|
return typeof localStorage > "u" ? null : localStorage;
|
|
@@ -20,5 +20,4 @@ var e = "kapi", t = (e, t) => `${e || "kapi"}:${t}`, n = () => {
|
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { e as DEFAULT_STORAGE_NAMESPACE, n as defaultStorage, r as migrateLegacy, i as readWithLegacy, t as storageKey };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/themeColorsLogic.ts
|
|
2
2
|
var e = [
|
|
3
3
|
"bg",
|
|
4
4
|
"card",
|
|
@@ -36,5 +36,4 @@ var e = [
|
|
|
36
36
|
}
|
|
37
37
|
return n;
|
|
38
38
|
};
|
|
39
|
-
//#endregion
|
|
40
39
|
export { t as NO_THEME_COLORS, s as mergeThemeColors, r as parseStoredThemeColors, a as resolveBrandRadii, o as resolveBrandTheme, n as sanitizeThemeColors, i as serializeThemeColors };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { contrastRatio as e, parseColor as t } from "./colorLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/themeContrastLogic.ts
|
|
3
3
|
var n = 4.5, r = [
|
|
4
4
|
"--kapi-bg",
|
|
5
5
|
"--kapi-card",
|
|
@@ -43,5 +43,4 @@ var n = 4.5, r = [
|
|
|
43
43
|
}
|
|
44
44
|
return s.sort((e, t) => e.ratio - t.ratio);
|
|
45
45
|
};
|
|
46
|
-
//#endregion
|
|
47
46
|
export { s as checkThemeContrast };
|
|
@@ -142,5 +142,4 @@ var a = /^\d+(\.\d+)?px$/, o = /^\d+(\.\d+)?(px|%)$/, s = {
|
|
|
142
142
|
i && (s[`--kapi-series-${n + 1}`] = t(i));
|
|
143
143
|
}), s;
|
|
144
144
|
};
|
|
145
|
-
//#endregion
|
|
146
145
|
export { a as RADIUS_PX_PATTERN, o as RADIUS_SHAPE_PATTERN, x as baseSurfaces, S as deriveStateRamp, T as deriveTheme };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RADIUS_PX_PATTERN as e, RADIUS_SHAPE_PATTERN as t } from "./themeDeriveLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/themeRadiiLogic.ts
|
|
3
3
|
var n = {
|
|
4
4
|
control: e,
|
|
5
5
|
box: e,
|
|
@@ -28,5 +28,4 @@ var n = {
|
|
|
28
28
|
}
|
|
29
29
|
return t;
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { r as NO_THEME_RADII, s as mergeThemeRadii, a as parseStoredThemeRadii, i as sanitizeThemeRadii, o as serializeThemeRadii };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "./storageLogic.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/themeScript.ts
|
|
3
3
|
var e = (e) => JSON.stringify(e).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"), t = ({ namespace: t } = {}) => "(function(){try{var d=document,s=window.localStorage,n=" + e(t || "kapi") + ",q=\".kapi[data-theme]\",g=function(k,l){var v=s.getItem(n+\":\"+k);return v===null?s.getItem(l):v},p=g(\"theme\",\"v2_theme\"),m=g(\"motion\",\"v2_motion\"),t=p===\"dark\"||(p===\"system\"&&window.matchMedia&&matchMedia(\"(prefers-color-scheme: dark)\").matches)?\"dark\":\"light\",a=function(e){e.setAttribute(\"data-theme\",t);if(m===\"reduced\")e.setAttribute(\"data-motion\",\"reduced\")},w=function(e){if(e.nodeType!==1)return;if(e.matches(q))a(e);var r=e.querySelectorAll(q);for(var i=0;i<r.length;i++)a(r[i])};w(d.documentElement);if(d.readyState!==\"loading\"||!window.MutationObserver)return;var o=new MutationObserver(function(l){for(var i=0;i<l.length;i++)for(var j=0;j<l[i].addedNodes.length;j++)w(l[i].addedNodes[j])});o.observe(d.documentElement,{childList:true,subtree:true});d.addEventListener(\"DOMContentLoaded\",function(){o.disconnect()})}catch(e){}})();";
|
|
4
|
-
//#endregion
|
|
5
4
|
export { t as kapiThemeScript };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { contrastRatio as e, formatHex as t, mixColors as n, parseColor as r } from "./colorLogic.js";
|
|
2
2
|
import { checkThemeContrast as i } from "./themeContrastLogic.js";
|
|
3
3
|
import { baseSurfaces as a, deriveStateRamp as o } from "./themeDeriveLogic.js";
|
|
4
|
-
|
|
4
|
+
// src/hooks/toneFamilyLogic.ts
|
|
5
5
|
var s = (e) => e, c = /* @__PURE__ */ new Set([
|
|
6
6
|
"neutral",
|
|
7
7
|
"primary",
|
|
@@ -160,5 +160,4 @@ var s = (e) => e, c = /* @__PURE__ */ new Set([
|
|
|
160
160
|
}
|
|
161
161
|
return s.sort((e, t) => e.ratio - t.ratio);
|
|
162
162
|
};
|
|
163
|
-
//#endregion
|
|
164
163
|
export { c as RESERVED_TONE_NAMES, l as TONE_FAMILY_NAME_PATTERN, m as TONE_FAMILY_PREFIX, E as checkToneFamilyContrast, s as defineToneFamilies, x as resolveToneFamilies, C as resolveToneLook, S as toneFamilyStyle };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/unsavedGuardLogic.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
let t = null, n = null;
|
|
4
4
|
return {
|
|
@@ -13,5 +13,4 @@ var e = (e) => {
|
|
|
13
13
|
isPending: () => t !== null
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { e as createLeaveGate };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createLoadSequencer as e } from "../components/inputs/asyncSelectLogic.js";
|
|
3
3
|
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useAsyncLoader.ts
|
|
5
5
|
var a = ({ query: a, key: o = a, enabled: s, load: c, delay: l, reloadKey: u, cache: d = !1, revalidate: f = !1, initial: p = null, onLoaded: m }) => {
|
|
6
6
|
let [h] = i(p), [g, _] = i(h), [v, y] = i(() => /* @__PURE__ */ new Map()), [b, x] = i(0), [S] = i(e), C = r({
|
|
7
7
|
load: c,
|
|
@@ -73,5 +73,4 @@ var a = ({ query: a, key: o = a, enabled: s, load: c, delay: l, reloadKey: u, ca
|
|
|
73
73
|
reload: w
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
//#endregion
|
|
77
76
|
export { a as useAsyncLoader };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { depsChanged as e } from "./asyncResourceLogic.js";
|
|
3
|
+
import { useAsyncLoader as t } from "./useAsyncLoader.js";
|
|
4
4
|
import { useRef as n } from "react";
|
|
5
|
-
|
|
5
|
+
// src/hooks/useAsyncResource.ts
|
|
6
6
|
var r = (r, i, { enabled: a = !0, keepPreviousData: o = !1 } = {}) => {
|
|
7
7
|
let s = n(0), c = n(null);
|
|
8
|
-
|
|
9
|
-
let { result: l, last: u, loading: d, reload: f } =
|
|
8
|
+
e(c.current, i) && (c.current = i, s.current += 1);
|
|
9
|
+
let { result: l, last: u, loading: d, reload: f } = t({
|
|
10
10
|
query: String(s.current),
|
|
11
11
|
enabled: a,
|
|
12
12
|
load: r === void 0 ? void 0 : (e, t) => r(t),
|
|
@@ -20,5 +20,4 @@ var r = (r, i, { enabled: a = !0, keepPreviousData: o = !1 } = {}) => {
|
|
|
20
20
|
reload: f
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { r as useAsyncResource };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useAsyncTasks.ts
|
|
4
4
|
var a = (e) => e instanceof DOMException && e.name === "AbortError", o = () => {
|
|
5
5
|
let [o, s] = i(() => /* @__PURE__ */ new Set()), c = r(/* @__PURE__ */ new Map()), l = r(!0);
|
|
6
6
|
t(() => {
|
|
@@ -33,5 +33,4 @@ var a = (e) => e instanceof DOMException && e.name === "AbortError", o = () => {
|
|
|
33
33
|
isPending: (e) => o.has(e)
|
|
34
34
|
}), [d, o]);
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { o as useAsyncTasks };
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { rafThrottle as e } from "./rafThrottle.js";
|
|
3
|
+
import { VIEWPORT_INSET_BOTTOM_VAR as t, bottomBarInset as n } from "./viewportInsetLogic.js";
|
|
4
|
+
import { winOf as r } from "./ownerDocument.js";
|
|
5
5
|
import { useEffect as i } from "react";
|
|
6
|
-
|
|
6
|
+
// src/hooks/useBottomBarInset.ts
|
|
7
7
|
var a = (a, o) => {
|
|
8
8
|
i(() => {
|
|
9
9
|
if (!a || !o) return;
|
|
10
|
-
let i = a.ownerDocument.documentElement, s =
|
|
11
|
-
let e =
|
|
10
|
+
let i = a.ownerDocument.documentElement, s = r(a) ?? window, c = () => {
|
|
11
|
+
let e = n(a.getBoundingClientRect(), {
|
|
12
12
|
width: s.innerWidth,
|
|
13
13
|
height: s.innerHeight
|
|
14
14
|
});
|
|
15
|
-
e > 0 ? i.style.setProperty(
|
|
15
|
+
e > 0 ? i.style.setProperty(t, `${e}px`) : i.style.removeProperty(t);
|
|
16
16
|
};
|
|
17
17
|
c();
|
|
18
|
-
let l =
|
|
18
|
+
let l = e(c), u = typeof ResizeObserver > "u" ? null : new ResizeObserver(l);
|
|
19
19
|
return u?.observe(a), s.addEventListener("resize", l, { passive: !0 }), () => {
|
|
20
|
-
u?.disconnect(), s.removeEventListener("resize", l), l.cancel(), i.style.removeProperty(
|
|
20
|
+
u?.disconnect(), s.removeEventListener("resize", l), l.cancel(), i.style.removeProperty(t);
|
|
21
21
|
};
|
|
22
22
|
}, [a, o]);
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { a as useBottomBarInset };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as e, useRef as t, useState as n } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useControllableState.ts
|
|
4
4
|
var r = (r, i, a) => {
|
|
5
5
|
let o = r !== void 0, [s, c] = n(i), l = t(s), u = e((e) => {
|
|
6
6
|
o || c(e), a?.(e);
|
|
@@ -16,5 +16,4 @@ var r = (r, i, a) => {
|
|
|
16
16
|
f
|
|
17
17
|
];
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { r as useControllableState };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useDebouncedValue.ts
|
|
4
4
|
var i = (i, a, { leading: o = !1 } = {}) => {
|
|
5
5
|
let [s, c] = r(i), l = n(null), u = n(!1), d = e(() => {
|
|
6
6
|
l.current !== null && clearTimeout(l.current), l.current = null, u.current = !1;
|
|
@@ -22,5 +22,4 @@ var i = (i, a, { leading: o = !1 } = {}) => {
|
|
|
22
22
|
o
|
|
23
23
|
]), t(() => d, [d]), [s, d];
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { i as useDebouncedValue };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as e, useMemo as t, useRef as n, useState as r } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useDisclosure.ts
|
|
4
4
|
var i = (i = !1, { onOpen: a, onClose: o } = {}) => {
|
|
5
5
|
let [s, c] = r(i), l = n({
|
|
6
6
|
onOpen: a,
|
|
@@ -31,5 +31,4 @@ var i = (i = !1, { onOpen: a, onClose: o } = {}) => {
|
|
|
31
31
|
m
|
|
32
32
|
])];
|
|
33
33
|
};
|
|
34
|
-
//#endregion
|
|
35
34
|
export { i as useDisclosure };
|
package/dist/hooks/useDismiss.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { modalStack as e } from "../components/overlays/modalStack.js";
|
|
3
|
+
import { docOf as t, eventWithin as n } from "./ownerDocument.js";
|
|
4
4
|
import { useCallback as r, useEffect as i, useRef as a } from "react";
|
|
5
|
-
|
|
6
|
-
var o = /* @__PURE__ */ new Map(), s = (e,
|
|
5
|
+
// src/hooks/useDismiss.ts
|
|
6
|
+
var o = /* @__PURE__ */ new Map(), s = (e, t) => e.some((e) => n(t, e.current)), c = (e) => {
|
|
7
7
|
let t = o.get(e.currentTarget);
|
|
8
8
|
if (t) for (let n of [...t]) {
|
|
9
9
|
let t = n.current;
|
|
10
10
|
t.outside !== !1 && !s(t.zones, e) && t.onDismiss("outside", e);
|
|
11
11
|
}
|
|
12
|
-
}, l = (
|
|
13
|
-
let
|
|
14
|
-
for (let e =
|
|
15
|
-
let
|
|
16
|
-
if (i.escape !== !1) return r && !i.zones.some((e) => e.current && r.contains(e.current)) ? null :
|
|
12
|
+
}, l = (t) => {
|
|
13
|
+
let n = o.get(t) ?? [], r = e.topOf(t);
|
|
14
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
15
|
+
let t = n[e], i = t.current;
|
|
16
|
+
if (i.escape !== !1) return r && !i.zones.some((e) => e.current && r.contains(e.current)) ? null : t;
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
19
19
|
}, u = (e) => {
|
|
20
20
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
21
21
|
let t = l(e.currentTarget);
|
|
22
22
|
t && (e.preventDefault(), t.current.onDismiss("escape", e));
|
|
23
|
-
}, d = (
|
|
23
|
+
}, d = (e) => t(e.current.zones.find((e) => e.current)?.current), f = (e) => {
|
|
24
24
|
let t = d(e);
|
|
25
25
|
if (!t) return () => {};
|
|
26
26
|
let n = o.get(t);
|
|
@@ -38,5 +38,4 @@ var o = /* @__PURE__ */ new Map(), s = (e, n) => e.some((e) => t(n, e.current)),
|
|
|
38
38
|
e.key !== "Escape" || e.defaultPrevented || l(e.currentTarget.ownerDocument) === n && (e.preventDefault(), e.stopPropagation(), n.current.onDismiss("escape", e.nativeEvent));
|
|
39
39
|
}, []);
|
|
40
40
|
};
|
|
41
|
-
//#endregion
|
|
42
41
|
export { p as useDismiss };
|