@kapiuara/ui 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/KapiChatDivider.js +1 -2
- package/dist/components/chat/KapiChatList.js +15 -16
- package/dist/components/chat/KapiChatThread.js +21 -22
- package/dist/components/chat/KapiComposer.js +23 -24
- package/dist/components/chat/KapiMessageBubble.js +5 -6
- package/dist/components/chat/KapiTypingIndicator.js +5 -6
- package/dist/components/chat/chatLogic.js +1 -2
- package/dist/components/data/KapiBarChart.js +22 -23
- package/dist/components/data/KapiDataTable.js +92 -93
- package/dist/components/data/KapiEventCalendar.js +96 -97
- package/dist/components/data/KapiHeatmap.js +21 -22
- package/dist/components/data/KapiLineChart.js +23 -24
- package/dist/components/data/KapiPagination.js +1 -2
- package/dist/components/data/KapiPaginationFooter.js +5 -6
- package/dist/components/data/KapiScatterChart.js +18 -19
- package/dist/components/data/KapiSheet.js +2 -3
- package/dist/components/data/KapiSparkline.js +1 -2
- package/dist/components/data/KapiTable.js +107 -108
- package/dist/components/data/KapiTableFilter.js +13 -14
- package/dist/components/data/KapiTableFooter.js +21 -22
- package/dist/components/data/KapiTableRow.js +10 -11
- package/dist/components/data/KapiTableToolbar.js +95 -96
- package/dist/components/data/barChartLogic.js +1 -2
- package/dist/components/data/chartFrame.js +13 -14
- package/dist/components/data/datasetSelectionLogic.js +1 -2
- package/dist/components/data/eventCalendarLogic.js +2 -3
- package/dist/components/data/heatmapLogic.js +1 -2
- package/dist/components/data/lineChartLogic.js +1 -2
- package/dist/components/data/rowClickLogic.js +2 -17
- package/dist/components/data/scatterLogic.js +1 -2
- package/dist/components/data/sparklineLogic.js +1 -2
- package/dist/components/data/tableCells.js +14 -15
- package/dist/components/data/tableHeaderMenu.js +1 -2
- package/dist/components/data/tableLabels.js +1 -2
- package/dist/components/data/tableLogic.js +0 -1
- package/dist/components/data/tablePaginationLogic.js +1 -2
- package/dist/components/data/tableResizeLogic.js +1 -2
- package/dist/components/data/tableSlots.js +1 -2
- package/dist/components/data/tableSpanLogic.js +1 -2
- package/dist/components/data/useColumnResize.js +23 -24
- package/dist/components/data/useRowKeyWarning.js +1 -2
- package/dist/components/data/useTableEdges.js +1 -2
- package/dist/components/data/useTableSelection.js +25 -26
- package/dist/components/display/KapiAnchor.js +7 -8
- package/dist/components/display/KapiAnnotation.js +15 -16
- package/dist/components/display/KapiAvatar.js +6 -7
- package/dist/components/display/KapiAvatarGroup.js +15 -16
- package/dist/components/display/KapiBadge.js +1 -2
- package/dist/components/display/KapiCodeBlock.js +14 -15
- package/dist/components/display/KapiComment.js +10 -11
- package/dist/components/display/KapiCommentComposer.js +13 -14
- package/dist/components/display/KapiDescriptionList.js +1 -2
- package/dist/components/display/KapiDiff.js +23 -24
- package/dist/components/display/KapiFileItem.js +13 -14
- package/dist/components/display/KapiFileViewer.js +17 -18
- package/dist/components/display/KapiHighlight.js +2 -3
- package/dist/components/display/KapiIconTile.js +2 -3
- package/dist/components/display/KapiStat.js +8 -9
- package/dist/components/display/KapiTag.js +6 -7
- package/dist/components/display/KapiText.js +5 -6
- package/dist/components/display/KapiTimeline.js +2 -3
- package/dist/components/display/KapiTitle.js +1 -2
- package/dist/components/display/KapiTruncate.js +5 -6
- package/dist/components/display/annotationLogic.js +1 -2
- package/dist/components/display/avatarGroupLogic.js +1 -2
- package/dist/components/display/avatarGroupSlots.js +1 -2
- package/dist/components/display/avatarLogic.js +1 -2
- package/dist/components/display/codeBlockSlots.js +1 -2
- package/dist/components/display/commentLogic.js +1 -2
- package/dist/components/display/diffLogic.js +1 -2
- package/dist/components/display/diffSlots.js +1 -2
- package/dist/components/display/fileItemLogic.js +1 -2
- package/dist/components/display/highlightLogic.js +1 -2
- package/dist/components/display/highlightSlots.js +1 -2
- package/dist/components/display/iconTileLogic.js +1 -2
- package/dist/components/display/statLogic.js +1 -2
- package/dist/components/display/tagLogic.js +1 -2
- package/dist/components/display/textLogic.js +1 -2
- package/dist/components/display/timelineLogic.js +1 -2
- package/dist/components/display/truncateLogic.js +1 -2
- package/dist/components/feedback/KapiAlert.js +6 -7
- package/dist/components/feedback/KapiBulkBar.js +5 -6
- package/dist/components/feedback/KapiCountdown.js +16 -17
- package/dist/components/feedback/KapiEmpty.js +2 -3
- package/dist/components/feedback/KapiFab.js +96 -97
- package/dist/components/feedback/KapiOfflineBanner.js +4 -5
- package/dist/components/feedback/KapiProgress.js +1 -2
- package/dist/components/feedback/KapiSkeleton.js +1 -2
- package/dist/components/feedback/KapiSpinner.js +5 -6
- package/dist/components/feedback/KapiToastContainer.js +28 -29
- package/dist/components/feedback/KapiTour.js +24 -25
- package/dist/components/feedback/KapiUnsavedBar.js +5 -6
- package/dist/components/feedback/alertSlots.js +1 -2
- package/dist/components/feedback/bulkBarLogic.js +1 -2
- package/dist/components/feedback/countdownLogic.js +1 -2
- package/dist/components/feedback/countdownSlots.js +1 -2
- package/dist/components/feedback/emptySlots.js +1 -2
- package/dist/components/feedback/fabLogic.js +1 -2
- package/dist/components/feedback/offlineBannerLogic.js +1 -2
- package/dist/components/feedback/progressLogic.js +1 -2
- package/dist/components/feedback/toastLayer.js +1 -2
- package/dist/components/feedback/toastStore.js +2 -3
- package/dist/components/feedback/tourLogic.js +1 -2
- package/dist/components/feedback/unsavedBarLogic.js +1 -2
- package/dist/components/inputs/KapiAutocomplete.js +23 -24
- package/dist/components/inputs/KapiButton.js +1 -2
- package/dist/components/inputs/KapiCalendar.js +12 -13
- package/dist/components/inputs/KapiCalendarGrid.js +15 -16
- package/dist/components/inputs/KapiCheckCard.js +4 -5
- package/dist/components/inputs/KapiCheckbox.js +1 -2
- package/dist/components/inputs/KapiChecklist.js +62 -63
- package/dist/components/inputs/KapiCopyButton.js +6 -7
- package/dist/components/inputs/KapiDatePicker.js +33 -34
- package/dist/components/inputs/KapiDateRangePicker.js +145 -146
- package/dist/components/inputs/KapiFacetedSearch.js +55 -56
- package/dist/components/inputs/KapiField.js +5 -6
- package/dist/components/inputs/KapiFileUpload.js +26 -27
- package/dist/components/inputs/KapiIconButton.js +1 -2
- package/dist/components/inputs/KapiInput.js +46 -47
- package/dist/components/inputs/KapiInputGroup.js +1 -2
- package/dist/components/inputs/KapiMaskedInput.js +50 -51
- package/dist/components/inputs/KapiNumberStepper.js +49 -50
- package/dist/components/inputs/KapiPinInput.js +9 -10
- package/dist/components/inputs/KapiPropsForm.js +43 -44
- package/dist/components/inputs/KapiRadio.js +1 -2
- package/dist/components/inputs/KapiRating.js +38 -39
- package/dist/components/inputs/KapiSearchChip.js +10 -11
- package/dist/components/inputs/KapiSegmented.js +65 -66
- package/dist/components/inputs/KapiSelect.js +198 -199
- package/dist/components/inputs/KapiSelectMenu.js +1 -2
- package/dist/components/inputs/KapiSlider.js +11 -12
- package/dist/components/inputs/KapiSwitch.js +6 -7
- package/dist/components/inputs/KapiTagInput.js +32 -33
- package/dist/components/inputs/KapiTextarea.js +22 -23
- package/dist/components/inputs/asyncSelectLogic.js +22 -23
- package/dist/components/inputs/autocompleteLogic.js +1 -2
- package/dist/components/inputs/checkControl.js +4 -5
- package/dist/components/inputs/checklistLogic.js +1 -2
- package/dist/components/inputs/copyLogic.js +1 -2
- package/dist/components/inputs/datePickerLogic.js +1 -2
- package/dist/components/inputs/dateRangeLogic.js +1 -2
- package/dist/components/inputs/facetedSearchLogic.js +1 -2
- package/dist/components/inputs/fieldLogic.js +1 -2
- package/dist/components/inputs/fileUploadLogic.js +1 -2
- package/dist/components/inputs/formBridgeLogic.js +1 -2
- package/dist/components/inputs/inputGroupLogic.js +1 -2
- package/dist/components/inputs/inputLogic.js +1 -2
- package/dist/components/inputs/maskLogic.js +0 -1
- package/dist/components/inputs/misuseWarnings.js +1 -2
- package/dist/components/inputs/numberStepLogic.js +1 -2
- package/dist/components/inputs/ownField.js +9 -10
- package/dist/components/inputs/pinInputLogic.js +1 -2
- package/dist/components/inputs/propsFormLogic.js +1 -2
- package/dist/components/inputs/ratingLogic.js +1 -2
- package/dist/components/inputs/searchChipLogic.js +1 -2
- package/dist/components/inputs/segmentedLogic.js +1 -2
- package/dist/components/inputs/selectKeyLogic.js +1 -2
- package/dist/components/inputs/selectLogic.js +1 -2
- package/dist/components/inputs/selectSlots.js +1 -2
- package/dist/components/inputs/sliderLogic.js +1 -2
- package/dist/components/inputs/tagInputLogic.js +1 -2
- package/dist/components/inputs/textareaLogic.js +1 -2
- package/dist/components/inputs/useCalendarFocus.js +1 -2
- package/dist/components/inputs/useDatePopSide.js +1 -2
- package/dist/components/inputs/useSelectCreate.js +1 -2
- package/dist/components/inputs/useSelectSource.js +11 -12
- package/dist/components/labelsLogic.js +1 -2
- package/dist/components/layout/KapiAccessCard.js +10 -11
- package/dist/components/layout/KapiAccountMenu.js +24 -25
- package/dist/components/layout/KapiBox.js +5 -6
- package/dist/components/layout/KapiCard.js +18 -19
- package/dist/components/layout/KapiCenter.js +1 -2
- package/dist/components/layout/KapiCluster.js +1 -2
- package/dist/components/layout/KapiCol.js +1 -2
- package/dist/components/layout/KapiCollapse.js +1 -2
- package/dist/components/layout/KapiContextSlot.js +98 -99
- package/dist/components/layout/KapiDivider.js +1 -2
- package/dist/components/layout/KapiGrid.js +9 -10
- package/dist/components/layout/KapiMasonry.js +1 -2
- package/dist/components/layout/KapiNotificationBell.js +53 -54
- package/dist/components/layout/KapiPageHeader.js +42 -43
- package/dist/components/layout/KapiPanelParts.js +43 -44
- package/dist/components/layout/KapiRail.js +103 -104
- package/dist/components/layout/KapiRailAccount.js +11 -12
- package/dist/components/layout/KapiRoot.js +33 -34
- package/dist/components/layout/KapiScrollArea.js +7 -8
- package/dist/components/layout/KapiShell.js +8 -9
- package/dist/components/layout/KapiStack.js +1 -2
- package/dist/components/layout/KapiThemeScript.js +1 -2
- package/dist/components/layout/accessCardLogic.js +1 -2
- package/dist/components/layout/cardLogic.js +1 -2
- package/dist/components/layout/cardSlots.js +1 -2
- package/dist/components/layout/gridSpanLogic.js +1 -2
- package/dist/components/layout/layoutPrimitives.js +1 -2
- package/dist/components/layout/masonryLogic.js +1 -2
- package/dist/components/layout/notificationBellLogic.js +1 -2
- package/dist/components/layout/pageHeaderLogic.js +1 -2
- package/dist/components/layout/pageHeaderSlots.js +1 -2
- package/dist/components/layout/railContext.js +1 -2
- package/dist/components/layout/railLogic.js +1 -2
- package/dist/components/layout/railSlots.js +1 -2
- package/dist/components/layout/reopenBus.js +1 -2
- package/dist/components/layout/shellSlots.js +1 -2
- package/dist/components/layout/useGridBreakpoint.js +1 -2
- package/dist/components/layout/useMasonrySpans.js +6 -7
- package/dist/components/layout/useRailOverflow.js +7 -8
- package/dist/components/locale/KapiLocaleProvider.js +1 -2
- package/dist/components/locale/linkLabels.js +1 -2
- package/dist/components/locale/localeLogic.js +1 -2
- package/dist/components/navigation/CtxSlidingList.js +7 -8
- package/dist/components/navigation/KapiAccordion.js +11 -12
- package/dist/components/navigation/KapiBreadcrumb.js +11 -12
- package/dist/components/navigation/KapiCollapsiblePanel.js +13 -14
- package/dist/components/navigation/KapiContextPanel.js +138 -139
- package/dist/components/navigation/KapiFilterChips.js +25 -22
- package/dist/components/navigation/KapiNavBadge.js +6 -7
- package/dist/components/navigation/KapiPanelGroup.js +34 -35
- package/dist/components/navigation/KapiSteps.js +41 -36
- package/dist/components/navigation/KapiTabs.js +40 -41
- package/dist/components/navigation/KapiToc.js +15 -16
- package/dist/components/navigation/KapiTree.js +126 -124
- package/dist/components/navigation/KapiWizard.js +12 -13
- package/dist/components/navigation/MiniNavItem.js +11 -12
- package/dist/components/navigation/accordionLogic.js +1 -2
- package/dist/components/navigation/activeItemLogic.js +1 -2
- package/dist/components/navigation/breadcrumbLogic.js +1 -2
- package/dist/components/navigation/contextPanelLogic.js +1 -2
- package/dist/components/navigation/filterChipsLogic.d.ts +9 -1
- package/dist/components/navigation/filterChipsLogic.js +2 -3
- package/dist/components/navigation/navBadgeLogic.js +1 -2
- package/dist/components/navigation/navLink.js +1 -2
- package/dist/components/navigation/navLinkLogic.js +1 -2
- package/dist/components/navigation/panelGroupLogic.js +1 -2
- package/dist/components/navigation/panelMini.js +0 -1
- package/dist/components/navigation/panelMiniLogic.js +1 -2
- package/dist/components/navigation/stepsLogic.js +1 -2
- package/dist/components/navigation/tabsLogic.js +1 -2
- package/dist/components/navigation/tocLogic.js +1 -2
- package/dist/components/navigation/tocSlots.js +1 -2
- package/dist/components/navigation/treeLogic.js +1 -2
- package/dist/components/navigation/wizardLogic.js +1 -2
- package/dist/components/overlays/KapiCanvasForm.js +5 -6
- package/dist/components/overlays/KapiCommandPalette.js +45 -45
- package/dist/components/overlays/KapiConfirm.js +9 -10
- package/dist/components/overlays/KapiContextMenu.js +16 -17
- package/dist/components/overlays/KapiDialogHost.js +50 -51
- package/dist/components/overlays/KapiDropdown.js +2 -3
- package/dist/components/overlays/KapiImageViewer.js +8 -9
- package/dist/components/overlays/KapiLoading.js +7 -8
- package/dist/components/overlays/KapiMenuButton.js +19 -20
- package/dist/components/overlays/KapiModal.js +58 -59
- package/dist/components/overlays/KapiOffcanvas.js +146 -147
- package/dist/components/overlays/KapiOffcanvasStack.js +18 -19
- package/dist/components/overlays/KapiPhotoView.js +21 -22
- package/dist/components/overlays/KapiPopover.js +12 -13
- package/dist/components/overlays/KapiShapeSheet.js +11 -12
- package/dist/components/overlays/KapiShortcutsHelp.js +18 -19
- package/dist/components/overlays/KapiSplitModal.js +20 -21
- package/dist/components/overlays/KapiTooltip.js +46 -47
- package/dist/components/overlays/KapiViewport.js +17 -18
- package/dist/components/overlays/canvasFormLogic.js +1 -2
- package/dist/components/overlays/commandPaletteLogic.js +1 -2
- package/dist/components/overlays/dialogStore.js +3 -4
- package/dist/components/overlays/dialogUtils.js +1 -2
- package/dist/components/overlays/exitPresenceLogic.js +1 -2
- package/dist/components/overlays/menuButtonLogic.js +1 -2
- package/dist/components/overlays/menuKeyboardLogic.js +1 -2
- package/dist/components/overlays/menuList.js +94 -95
- package/dist/components/overlays/modalSlots.js +1 -2
- package/dist/components/overlays/modalStack.js +1 -2
- package/dist/components/overlays/offcanvasCompanion.js +1 -2
- package/dist/components/overlays/offcanvasResize.js +0 -1
- package/dist/components/overlays/offcanvasSide.js +1 -2
- package/dist/components/overlays/offcanvasStack.js +1 -2
- package/dist/components/overlays/overlayPortal.js +1 -2
- package/dist/components/overlays/popoverLogic.js +1 -2
- package/dist/components/overlays/shortcutsHelpSlots.js +1 -2
- package/dist/components/overlays/splitModalLayout.js +1 -2
- package/dist/components/overlays/useExitPresence.js +11 -12
- package/dist/components/overlays/useNativeDialog.js +21 -22
- package/dist/components/overlays/viewportLogic.js +1 -2
- package/dist/components/renderSlot.js +1 -2
- package/dist/components/rootProps.js +1 -2
- package/dist/components/slotCatalog.js +33 -34
- package/dist/components/slotsLogic.js +1 -2
- package/dist/components/tone.js +1 -2
- package/dist/css/components/overlays/KapiViewport.css +1 -1
- package/dist/hooks/asyncResourceLogic.js +1 -2
- package/dist/hooks/breakpointOpenLogic.js +1 -2
- package/dist/hooks/colorLogic.js +1 -2
- package/dist/hooks/dateFormat.js +1 -2
- package/dist/hooks/densityLogic.js +1 -2
- package/dist/hooks/directionLogic.js +1 -2
- package/dist/hooks/downloadLogic.js +1 -2
- package/dist/hooks/elementSizeLogic.js +1 -2
- package/dist/hooks/fieldErrorsLogic.js +1 -2
- package/dist/hooks/focusLogic.js +2 -11
- package/dist/hooks/growOriginLogic.js +1 -2
- package/dist/hooks/hotkeyLogic.js +1 -2
- package/dist/hooks/hotkeyRegistry.js +1 -2
- package/dist/hooks/kapiRoot.js +2 -3
- package/dist/hooks/mergeRefs.js +1 -2
- package/dist/hooks/numberFormatLogic.js +1 -2
- package/dist/hooks/onlineStatusLogic.js +1 -2
- package/dist/hooks/ownerDocument.js +1 -2
- package/dist/hooks/persistentStateLogic.js +1 -2
- package/dist/hooks/portalRoot.js +1 -2
- package/dist/hooks/rafThrottle.js +1 -2
- package/dist/hooks/rangeSelectLogic.js +1 -2
- package/dist/hooks/recentLogic.js +1 -2
- package/dist/hooks/reducedMotion.js +8 -9
- package/dist/hooks/rightClick.js +10 -11
- package/dist/hooks/scrollCollapseLogic.js +1 -2
- package/dist/hooks/scrollEdgesLogic.js +1 -2
- package/dist/hooks/shallowStable.js +1 -2
- package/dist/hooks/slidingIndicatorLogic.js +1 -2
- package/dist/hooks/storageLogic.js +1 -2
- package/dist/hooks/themeColorsLogic.js +1 -2
- package/dist/hooks/themeContrastLogic.js +1 -2
- package/dist/hooks/themeDeriveLogic.js +0 -1
- package/dist/hooks/themeRadiiLogic.js +1 -2
- package/dist/hooks/themeScript.js +1 -2
- package/dist/hooks/toneFamilyLogic.js +1 -2
- package/dist/hooks/unsavedGuardLogic.js +1 -2
- package/dist/hooks/useAsyncLoader.js +1 -2
- package/dist/hooks/useAsyncResource.js +5 -6
- package/dist/hooks/useAsyncTasks.js +1 -2
- package/dist/hooks/useBottomBarInset.js +9 -10
- package/dist/hooks/useControllableState.js +1 -2
- package/dist/hooks/useDebouncedValue.js +1 -2
- package/dist/hooks/useDisclosure.js +1 -2
- package/dist/hooks/useDismiss.js +10 -11
- package/dist/hooks/useDragScroll.js +12 -13
- package/dist/hooks/useElementSize.js +1 -2
- package/dist/hooks/useFieldErrors.js +1 -2
- package/dist/hooks/useFocusReturn.js +1 -2
- package/dist/hooks/useFormReset.js +1 -2
- package/dist/hooks/useGlobalRightClick.js +1 -2
- package/dist/hooks/useGrowOrigin.js +1 -2
- package/dist/hooks/useHotkey.js +1 -2
- package/dist/hooks/useHydrated.js +1 -2
- package/dist/hooks/useKapiTheme.js +55 -56
- package/dist/hooks/useMediaQuery.js +1 -2
- package/dist/hooks/useObjectUrl.js +1 -2
- package/dist/hooks/useOnlineStatus.js +1 -2
- package/dist/hooks/useOutsidePress.js +1 -2
- package/dist/hooks/usePersistentState.js +9 -10
- package/dist/hooks/usePlacement.js +15 -16
- package/dist/hooks/useRangeSelect.js +2 -3
- package/dist/hooks/useRecent.js +6 -7
- package/dist/hooks/useScrollCollapse.js +1 -2
- package/dist/hooks/useScrollEdges.js +25 -26
- package/dist/hooks/useSlidingIndicator.js +19 -20
- package/dist/hooks/useSubmitDraft.js +1 -2
- package/dist/hooks/useToneFamilies.js +0 -1
- package/dist/hooks/useTypeahead.js +1 -2
- package/dist/hooks/useUnsavedGuard.js +5 -6
- package/dist/hooks/useVirtualList.js +1 -2
- package/dist/hooks/useWheelZoom.js +1 -2
- package/dist/hooks/viewportInsetLogic.js +1 -2
- package/dist/hooks/virtualListLogic.js +0 -1
- package/dist/hooks/wheelZoomLogic.js +1 -2
- package/dist/kapi.css +1 -1
- package/dist/kapi.layered.css +1 -1
- package/dist/logic.js +45 -45
- package/package.json +16 -16
|
@@ -1,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 };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { exceedsDragThreshold as e, isDoubleRightClick as t, isInteractiveTarget as n, scrollableAxes as r } from "./rightClick.js";
|
|
3
|
+
import { winOf as i } from "./ownerDocument.js";
|
|
4
4
|
import { useEffect as a, useRef as o } from "react";
|
|
5
|
-
|
|
5
|
+
// src/hooks/useDragScroll.ts
|
|
6
6
|
var s = (s = {}) => {
|
|
7
7
|
let c = o(null), l = o(s);
|
|
8
8
|
return l.current = s, a(() => {
|
|
@@ -12,11 +12,11 @@ var s = (s = {}) => {
|
|
|
12
12
|
x: !1,
|
|
13
13
|
y: !1
|
|
14
14
|
}, h = 0, g = null, _ = (e) => {
|
|
15
|
-
e.button === 2 && (
|
|
16
|
-
}, v = (
|
|
15
|
+
e.button === 2 && (n(e.target) || (e.stopPropagation(), o = !0, s = !1, u = e.pageX, d = e.pageY, f = a.scrollLeft, p = a.scrollTop, m = r(a)));
|
|
16
|
+
}, v = (t) => {
|
|
17
17
|
if (!o) return;
|
|
18
|
-
let n =
|
|
19
|
-
!s &&
|
|
18
|
+
let n = t.pageX - u, r = t.pageY - d;
|
|
19
|
+
!s && e(n, r) && (s = !0, a.classList.add("kapi-grabbing")), s && (t.preventDefault(), m.x && (a.scrollLeft = f - n), m.y && (a.scrollTop = p - r));
|
|
20
20
|
}, y = () => {
|
|
21
21
|
let e = g;
|
|
22
22
|
g = null, e && !s && l.current.zoneMenu?.onMenu(e.zone, e.x, e.y), o = !1, a.classList.remove("kapi-grabbing");
|
|
@@ -25,22 +25,21 @@ var s = (s = {}) => {
|
|
|
25
25
|
s = !1, h = 0;
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
let
|
|
29
|
-
if (
|
|
28
|
+
let n = l.current.zoneMenu, r = n && e.target instanceof Element ? e.target.closest(n.selector) : null;
|
|
29
|
+
if (n && r && a.contains(r)) {
|
|
30
30
|
h = 0, o ? g = {
|
|
31
31
|
zone: r,
|
|
32
32
|
x: e.clientX,
|
|
33
33
|
y: e.clientY
|
|
34
|
-
} :
|
|
34
|
+
} : n.onMenu(r, e.clientX, e.clientY);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
let i = Date.now();
|
|
38
|
-
|
|
39
|
-
}, x =
|
|
38
|
+
t(i, h) ? (l.current.onMenu?.(e.clientX, e.clientY), h = 0) : h = i;
|
|
39
|
+
}, x = i(a) ?? window;
|
|
40
40
|
return a.addEventListener("mousedown", _), x.addEventListener("mousemove", v), x.addEventListener("mouseup", y), a.addEventListener("contextmenu", b), () => {
|
|
41
41
|
a.removeEventListener("mousedown", _), x.removeEventListener("mousemove", v), x.removeEventListener("mouseup", y), a.removeEventListener("contextmenu", b);
|
|
42
42
|
};
|
|
43
43
|
}, []), c;
|
|
44
44
|
};
|
|
45
|
-
//#endregion
|
|
46
45
|
export { s as useDragScroll };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { EMPTY_ELEMENT_SIZE as e, sameSize as t } from "./elementSizeLogic.js";
|
|
3
3
|
import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useElementSize.ts
|
|
5
5
|
var o = () => {
|
|
6
6
|
let [o, s] = a(e), c = i(null), l = n((e) => {
|
|
7
7
|
let { width: n, height: r } = e.getBoundingClientRect();
|
|
@@ -25,5 +25,4 @@ var o = () => {
|
|
|
25
25
|
height: o.height
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { o as useElementSize };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { blurLeavesField as e, fieldErrorProps as t, hasFieldErrors as n, touchField as r, visibleFieldError as i } from "./fieldErrorsLogic.js";
|
|
3
3
|
import { useCallback as a, useState as o } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useFieldErrors.ts
|
|
5
5
|
var s = (s) => {
|
|
6
6
|
let [c, l] = o({}), [u, d] = o(!1), f = a((e) => l((t) => r(t, e)), []), p = (e) => c[e] === !0, m = (e) => i(s[e], {
|
|
7
7
|
touched: p(e),
|
|
@@ -25,5 +25,4 @@ var s = (s) => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
//#endregion
|
|
29
28
|
export { s as useFieldErrors };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { activeElementOf as e, activeHTMLElementOf as t, docOf as n } from "./ownerDocument.js";
|
|
3
3
|
import { useLayoutEffect as r, useRef as i } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useFocusReturn.ts
|
|
5
5
|
var a = (a, { container: o, target: s, restoreOnDeactivate: c = !1 }) => {
|
|
6
6
|
let l = i(null), u = i({
|
|
7
7
|
target: s,
|
|
@@ -27,5 +27,4 @@ var a = (a, { container: o, target: s, restoreOnDeactivate: c = !1 }) => {
|
|
|
27
27
|
};
|
|
28
28
|
}, [a]), d.current;
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { a as useFocusReturn };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as e, useRef as t } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useFormReset.ts
|
|
4
4
|
var n = (n) => {
|
|
5
5
|
let r = t(n);
|
|
6
6
|
r.current = n;
|
|
@@ -13,5 +13,4 @@ var n = (n) => {
|
|
|
13
13
|
t.addEventListener("reset", n), i.current = () => t.removeEventListener("reset", n);
|
|
14
14
|
}, []);
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { n as useFormReset };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { exceedsDragThreshold as e, findScrollableAncestor as t, isDoubleRightClick as n, isInteractiveTarget as r, scrollableAxes as i, shouldInterceptContextMenu as a } from "./rightClick.js";
|
|
3
3
|
import { useEffect as o, useRef as s } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useGlobalRightClick.ts
|
|
5
5
|
var c = ({ onMenu: c, enabled: l = !0 } = {}) => {
|
|
6
6
|
let u = s(c);
|
|
7
7
|
u.current = c, o(() => {
|
|
@@ -34,5 +34,4 @@ var c = ({ onMenu: c, enabled: l = !0 } = {}) => {
|
|
|
34
34
|
};
|
|
35
35
|
}, [l]);
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { c as useGlobalRightClick };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { rectCenter as e } from "./growOriginLogic.js";
|
|
3
3
|
import { useCallback as t, useState as n } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useGrowOrigin.ts
|
|
5
5
|
var r = () => {
|
|
6
6
|
let [r, i] = n(null);
|
|
7
7
|
return {
|
|
@@ -12,5 +12,4 @@ var r = () => {
|
|
|
12
12
|
clear: t(() => i(null), [])
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
export { r as useGrowOrigin };
|
package/dist/hooks/useHotkey.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { matchesHotkey as e, parseHotkey as t } from "./hotkeyLogic.js";
|
|
3
3
|
import { hotkeyRegistry as n } from "./hotkeyRegistry.js";
|
|
4
4
|
import { useEffect as r, useRef as i } from "react";
|
|
5
|
-
|
|
5
|
+
// src/hooks/useHotkey.ts
|
|
6
6
|
var a = (a, o, s = {}) => {
|
|
7
7
|
let { enabled: c = !0, preventDefault: l = !0, allowInInputs: u, description: d, group: f } = s, p = i(o);
|
|
8
8
|
r(() => {
|
|
@@ -39,5 +39,4 @@ var a = (a, o, s = {}) => {
|
|
|
39
39
|
u
|
|
40
40
|
]);
|
|
41
41
|
};
|
|
42
|
-
//#endregion
|
|
43
42
|
export { a as useHotkey };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { useHydrated as e } from "./useHydrated.js";
|
|
3
|
+
import { useMediaQuery as t } from "./useMediaQuery.js";
|
|
4
|
+
import { defaultStorage as n, readWithLegacy as r, storageKey as i } from "./storageLogic.js";
|
|
5
|
+
import { parseColor as a } from "./colorLogic.js";
|
|
6
|
+
import { baseSurfaces as o, deriveTheme as s } from "./themeDeriveLogic.js";
|
|
7
|
+
import { resolveToneFamilies as c } from "./toneFamilyLogic.js";
|
|
8
8
|
import { NO_THEME_COLORS as l, mergeThemeColors as u, parseStoredThemeColors as d, resolveBrandRadii as f, resolveBrandTheme as p, sanitizeThemeColors as m, serializeThemeColors as h } from "./themeColorsLogic.js";
|
|
9
9
|
import { NO_THEME_RADII as g, mergeThemeRadii as _, parseStoredThemeRadii as v, sanitizeThemeRadii as y, serializeThemeRadii as b } from "./themeRadiiLogic.js";
|
|
10
10
|
import { createContext as x, useCallback as S, useContext as C, useEffect as w, useMemo as T, useState as E } from "react";
|
|
11
|
-
|
|
11
|
+
// src/hooks/useKapiTheme.ts
|
|
12
12
|
var D = "(prefers-color-scheme: dark)", O = (e) => ({
|
|
13
|
-
theme:
|
|
14
|
-
accent:
|
|
15
|
-
font:
|
|
16
|
-
motion:
|
|
17
|
-
customTheme:
|
|
18
|
-
radii:
|
|
13
|
+
theme: i(e, "theme"),
|
|
14
|
+
accent: i(e, "accent"),
|
|
15
|
+
font: i(e, "font"),
|
|
16
|
+
motion: i(e, "motion"),
|
|
17
|
+
customTheme: i(e, "customTheme"),
|
|
18
|
+
radii: i(e, "radii")
|
|
19
19
|
}), k = {
|
|
20
20
|
theme: "v2_theme",
|
|
21
21
|
accent: "v2_accent",
|
|
@@ -26,39 +26,39 @@ O().theme, O().accent, O().font, O().motion;
|
|
|
26
26
|
var A = {
|
|
27
27
|
roboto: "'Roboto Variable', 'Roboto', system-ui, sans-serif",
|
|
28
28
|
system: "system-ui, -apple-system, 'Segoe UI', sans-serif"
|
|
29
|
-
}, j = (e, t,
|
|
29
|
+
}, j = (e, t, i) => r(n(), O(e)[t], k[t]) || i, M = (e, t) => {
|
|
30
30
|
try {
|
|
31
31
|
localStorage.setItem(e, t);
|
|
32
32
|
} catch {}
|
|
33
33
|
}, N = (e) => e === "light" || e === "dark", P = (e) => N(e) || e === "system", F = (e, t) => e === "system" ? t ? "dark" : "light" : e, I = (e) => {
|
|
34
34
|
let t = j(e, "theme", "light");
|
|
35
35
|
return P(t) ? t : "light";
|
|
36
|
-
}, L = (e) => e === "dark" ? "light" : "dark", R = (e) => Object.hasOwn(A, e), z = (e) => e === "auto" || e === "reduced", B = (
|
|
37
|
-
if (!
|
|
38
|
-
let
|
|
36
|
+
}, L = (e) => e === "dark" ? "light" : "dark", R = (e) => Object.hasOwn(A, e), z = (e) => e === "auto" || e === "reduced", B = (e, t, n) => {
|
|
37
|
+
if (!e) return {};
|
|
38
|
+
let r = o(t), i = a(n["--kapi-card"] ?? r.card) ?? {
|
|
39
39
|
r: 255,
|
|
40
40
|
g: 255,
|
|
41
41
|
b: 255,
|
|
42
42
|
a: 1
|
|
43
|
-
},
|
|
44
|
-
return
|
|
45
|
-
}, V = (
|
|
46
|
-
let
|
|
47
|
-
...
|
|
43
|
+
}, s = a(n["--kapi-bg"] ?? r.bg) ?? i;
|
|
44
|
+
return c(e, t, i, s).tokens;
|
|
45
|
+
}, V = (e, t, n) => {
|
|
46
|
+
let r = p(t, e.theme ?? "light"), i = e.fontChosen && r ? {
|
|
47
|
+
...r,
|
|
48
48
|
font: void 0,
|
|
49
49
|
fontHeading: void 0
|
|
50
|
-
} :
|
|
51
|
-
c && delete
|
|
52
|
-
let l =
|
|
50
|
+
} : r, o = u(i, e.accent ? { primary: e.accent } : null, e.customTheme), c = o.primary && !a(o.primary) ? o.primary : void 0;
|
|
51
|
+
c && delete o.primary;
|
|
52
|
+
let l = e.theme ?? "light", d = s({
|
|
53
53
|
base: l,
|
|
54
|
-
colors:
|
|
55
|
-
radii: _(f(
|
|
54
|
+
colors: o,
|
|
55
|
+
radii: _(f(t), e.radii)
|
|
56
56
|
});
|
|
57
57
|
return {
|
|
58
|
-
"--kapi-font": A[
|
|
58
|
+
"--kapi-font": A[e.font] ?? A.roboto,
|
|
59
59
|
...d,
|
|
60
60
|
...c ? { "--kapi-primary": c } : {},
|
|
61
|
-
...B(
|
|
61
|
+
...B(n, l, d)
|
|
62
62
|
};
|
|
63
63
|
}, H = x({
|
|
64
64
|
theme: "light",
|
|
@@ -98,57 +98,57 @@ var A = {
|
|
|
98
98
|
fontChosen: R(t),
|
|
99
99
|
motion: z(n) ? n : "auto"
|
|
100
100
|
};
|
|
101
|
-
}, K = ({ namespace:
|
|
102
|
-
let
|
|
103
|
-
if (I !==
|
|
104
|
-
R(
|
|
105
|
-
let e = G(
|
|
101
|
+
}, K = ({ namespace: n, theme: r } = {}) => {
|
|
102
|
+
let i = T(() => O(n), [n]), a = e(), o = a ? n : U, [s] = E(() => G(o)), [c, l] = E(s.preference), u = t(D), d = r ?? F(c, u), [f, p] = E(s.accent), [g, _] = E(s.customTheme), [v, x] = E(s.radii), [C, k] = E(s.fontChosen), [A, j] = E(s.font), [N, P] = E(s.motion), [I, R] = E(o);
|
|
103
|
+
if (I !== o) {
|
|
104
|
+
R(o);
|
|
105
|
+
let e = G(o);
|
|
106
106
|
l(e.preference), p(e.accent), _(e.customTheme), x(e.radii), j(e.font), k(e.fontChosen), P(e.motion);
|
|
107
107
|
}
|
|
108
108
|
w(() => {
|
|
109
|
-
|
|
109
|
+
a && M(i.theme, c);
|
|
110
110
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
i,
|
|
112
|
+
c,
|
|
113
|
+
a
|
|
114
114
|
]), w(() => {
|
|
115
|
-
|
|
115
|
+
a && M(i.accent, f);
|
|
116
116
|
}, [
|
|
117
|
-
|
|
117
|
+
i,
|
|
118
118
|
f,
|
|
119
|
-
|
|
119
|
+
a
|
|
120
120
|
]), w(() => {
|
|
121
|
-
|
|
121
|
+
a && M(i.customTheme, h(g));
|
|
122
122
|
}, [
|
|
123
|
-
|
|
123
|
+
i,
|
|
124
124
|
g,
|
|
125
|
-
|
|
125
|
+
a
|
|
126
126
|
]), w(() => {
|
|
127
|
-
|
|
127
|
+
a && M(i.radii, b(v));
|
|
128
128
|
}, [
|
|
129
|
-
|
|
129
|
+
i,
|
|
130
130
|
v,
|
|
131
|
-
|
|
131
|
+
a
|
|
132
132
|
]), w(() => {
|
|
133
|
-
|
|
133
|
+
a && C && M(i.font, A);
|
|
134
134
|
}, [
|
|
135
|
-
|
|
135
|
+
i,
|
|
136
136
|
A,
|
|
137
137
|
C,
|
|
138
|
-
|
|
138
|
+
a
|
|
139
139
|
]), w(() => {
|
|
140
|
-
|
|
140
|
+
a && M(i.motion, N);
|
|
141
141
|
}, [
|
|
142
|
-
|
|
142
|
+
i,
|
|
143
143
|
N,
|
|
144
|
-
|
|
144
|
+
a
|
|
145
145
|
]);
|
|
146
146
|
let z = S(() => l(L(d)), [d]), B = S((e) => l(e), []), V = S((e) => p(e || ""), []), H = S((e) => _(m(e)), []), W = S((e) => x(y(e)), []), K = S((e) => {
|
|
147
147
|
j(e), k(!0);
|
|
148
148
|
}, []), q = S(() => P((e) => e === "reduced" ? "auto" : "reduced"), []);
|
|
149
149
|
return T(() => ({
|
|
150
150
|
theme: d,
|
|
151
|
-
preference:
|
|
151
|
+
preference: c,
|
|
152
152
|
accent: f,
|
|
153
153
|
customTheme: g,
|
|
154
154
|
radii: v,
|
|
@@ -166,7 +166,7 @@ var A = {
|
|
|
166
166
|
toggleMotion: q
|
|
167
167
|
}), [
|
|
168
168
|
d,
|
|
169
|
-
|
|
169
|
+
c,
|
|
170
170
|
f,
|
|
171
171
|
g,
|
|
172
172
|
v,
|
|
@@ -182,5 +182,4 @@ var A = {
|
|
|
182
182
|
q
|
|
183
183
|
]);
|
|
184
184
|
}, q = () => C(H);
|
|
185
|
-
//#endregion
|
|
186
185
|
export { D as DARK_SCHEME_QUERY, A as FONTS, H as KapiThemeContext, k as LEGACY_THEME_KEYS, R as isFontKey, z as isMotion, N as isTheme, P as isThemePreference, I as readThemePreference, F as resolveTheme, V as themeRootStyle, O as themeStorageKeys, L as toggledPreference, q as useKapiTheme, K as useKapiThemeState };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback as e, useMemo as t, useSyncExternalStore as n } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useMediaQuery.ts
|
|
4
4
|
var r = "(max-width: 768px)", i = "(max-width: 1024px)", a = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, o = () => !1, s = (r) => {
|
|
5
5
|
let i = t(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(r) : null, [r]), a = e((e) => i ? (i.addEventListener("change", e), () => i.removeEventListener("change", e)) : () => {}, [i]), s = e(() => i?.matches ?? !1, [i]);
|
|
6
6
|
return n(a, s, o);
|
|
7
7
|
};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { r as SHELL_MOBILE_QUERY, i as SHELL_NARROW_QUERY, a as matchesQuery, s as useMediaQuery };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useEffect as e, useState as t } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/useObjectUrl.ts
|
|
4
4
|
var n = (n) => {
|
|
5
5
|
let [r, i] = t(null);
|
|
6
6
|
return e(() => {
|
|
@@ -15,5 +15,4 @@ var n = (n) => {
|
|
|
15
15
|
}), () => URL.revokeObjectURL(e);
|
|
16
16
|
}, [n]), r && n && r.source === n ? r.url : null;
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { n as useObjectUrl };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { SERVER_ONLINE_STATUS as e, createOnlineStore as t } from "./onlineStatusLogic.js";
|
|
3
3
|
import { useSyncExternalStore as n } from "react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/useOnlineStatus.ts
|
|
5
5
|
var r = null, i = () => r ??= t(), a = (e) => i().subscribe(e), o = () => i().getSnapshot(), s = () => e, c = () => n(a, o, s);
|
|
6
|
-
//#endregion
|
|
7
6
|
export { c as useOnlineStatus };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useDismiss as e } from "./useDismiss.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/useOutsidePress.ts
|
|
3
3
|
var t = (t, n, r) => {
|
|
4
4
|
e(t, {
|
|
5
5
|
zones: n,
|
|
@@ -7,5 +7,4 @@ var t = (t, n, r) => {
|
|
|
7
7
|
onDismiss: (e, t) => r(t)
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
10
|
export { t as useOutsidePress };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { parseStored as e, serializeStored as t } from "./persistentStateLogic.js";
|
|
3
|
+
import { storageKey as n } from "./storageLogic.js";
|
|
4
|
+
import { useHydrated as r } from "./useHydrated.js";
|
|
5
5
|
import { useCallback as i, useEffect as a, useState as o } from "react";
|
|
6
|
-
|
|
7
|
-
var s = Symbol("server"), c = (
|
|
6
|
+
// src/hooks/usePersistentState.ts
|
|
7
|
+
var s = Symbol("server"), c = (t, n, r) => {
|
|
8
8
|
if (typeof window > "u") return r;
|
|
9
9
|
try {
|
|
10
|
-
return
|
|
10
|
+
return e(window.localStorage.getItem(t), n, r);
|
|
11
11
|
} catch {
|
|
12
12
|
return r;
|
|
13
13
|
}
|
|
14
|
-
}, l = (
|
|
15
|
-
let d = u?.version ?? 1, f = u?.namespace, p =
|
|
14
|
+
}, l = (e, l, u) => {
|
|
15
|
+
let d = u?.version ?? 1, f = u?.namespace, p = e === null || !f ? e : n(f, e), m = r(), h = m ? p : s, g = (e) => e === null || e === s ? l : c(e, d, l), [_, v] = o(() => g(h)), [y, b] = o(h);
|
|
16
16
|
return y !== h && (b(h), v(g(h))), a(() => {
|
|
17
17
|
if (p !== null && m && typeof window < "u") try {
|
|
18
|
-
window.localStorage.setItem(p,
|
|
18
|
+
window.localStorage.setItem(p, t(_, d));
|
|
19
19
|
} catch {}
|
|
20
20
|
}, [
|
|
21
21
|
p,
|
|
@@ -33,5 +33,4 @@ var s = Symbol("server"), c = (e, t, r) => {
|
|
|
33
33
|
}, [p]) }
|
|
34
34
|
];
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { l as usePersistentState };
|