@leavepulse/ui 0.43.2 → 0.43.4

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.
Files changed (131) hide show
  1. package/dist/assets/{LpCommandPalette-DH7sPcKP.css → LpCommandPalette-B-0Est4Z.css} +21 -21
  2. package/dist/component-names.d.ts +1 -0
  3. package/dist/components/LayoutCanvas.vue.d.ts +28 -0
  4. package/dist/components/LayoutNode.vue.d.ts +40 -0
  5. package/dist/components/LpActionBar.vue.d.ts +84 -0
  6. package/dist/components/LpAddressInput.vue.d.ts +70 -0
  7. package/dist/components/LpAlert.vue.d.ts +44 -0
  8. package/dist/components/LpAppShell.vue.d.ts +123 -0
  9. package/dist/components/LpAutocomplete.vue.d.ts +50 -0
  10. package/dist/components/LpAvatar.vue.d.ts +34 -0
  11. package/dist/components/LpBadge.vue.d.ts +20 -0
  12. package/dist/components/LpBreadcrumbs.vue.d.ts +32 -0
  13. package/dist/components/LpButton.vue.d.ts +113 -0
  14. package/dist/components/LpCalendar.vue.d.ts +29 -0
  15. package/dist/components/LpCard.vue.d.ts +60 -0
  16. package/dist/components/LpChart.vue.d.ts +130 -0
  17. package/dist/components/LpCheckbox.vue.d.ts +32 -0
  18. package/dist/components/LpCodeBlock.vue.d.ts +58 -0
  19. package/dist/components/LpColorPicker.vue.d.ts +124 -0
  20. package/dist/components/LpCommandPalette.vue.d.ts +199 -0
  21. package/dist/components/LpCommandPalette.vue.js +4 -8
  22. package/dist/components/LpConfirmDialog.vue.d.ts +59 -0
  23. package/dist/components/LpContextMenu.vue.d.ts +44 -0
  24. package/dist/components/LpDatePicker.vue.d.ts +33 -0
  25. package/dist/components/LpDisclosure.vue.d.ts +47 -0
  26. package/dist/components/LpDivider.vue.d.ts +17 -0
  27. package/dist/components/LpDrawer.vue.d.ts +170 -0
  28. package/dist/components/LpDropdownMenu.vue.d.ts +23 -0
  29. package/dist/components/LpDropzone.vue.d.ts +90 -0
  30. package/dist/components/LpEmptyState.vue.d.ts +28 -0
  31. package/dist/components/LpFileTree.vue.d.ts +126 -0
  32. package/dist/components/LpFileTreeNode.vue.d.ts +62 -0
  33. package/dist/components/LpFormField.vue.d.ts +24 -0
  34. package/dist/components/LpIcon.vue.d.ts +9 -0
  35. package/dist/components/LpImageEditor.vue.d.ts +106 -0
  36. package/dist/components/LpInfraNode.vue.d.ts +65 -0
  37. package/dist/components/LpInput.vue.d.ts +80 -0
  38. package/dist/components/LpLaneNode.vue.d.ts +24 -0
  39. package/dist/components/LpLightbox.vue.d.ts +62 -0
  40. package/dist/components/LpLink.vue.d.ts +93 -0
  41. package/dist/components/LpLogViewer.vue.d.ts +153 -0
  42. package/dist/components/LpMapPicker.vue.d.ts +59 -0
  43. package/dist/components/LpMediaGallery.vue.d.ts +80 -0
  44. package/dist/components/LpModal.vue.d.ts +66 -0
  45. package/dist/components/LpModalNav.vue.d.ts +66 -0
  46. package/dist/components/LpNotificationBell.vue.d.ts +85 -0
  47. package/dist/components/LpNumberField.vue.d.ts +21 -0
  48. package/dist/components/LpNumberFlow.vue.d.ts +35 -0
  49. package/dist/components/LpOtpInput.vue.d.ts +39 -0
  50. package/dist/components/LpPagination.vue.d.ts +35 -0
  51. package/dist/components/LpPasswordInput.vue.d.ts +36 -0
  52. package/dist/components/LpPhoneInput.vue.d.ts +49 -0
  53. package/dist/components/LpPie.vue.d.ts +196 -0
  54. package/dist/components/LpPopover.vue.d.ts +34 -0
  55. package/dist/components/LpProgress.vue.d.ts +66 -0
  56. package/dist/components/LpRadio.vue.d.ts +18 -0
  57. package/dist/components/LpRadioGroup.vue.d.ts +26 -0
  58. package/dist/components/LpRollingText.vue.d.ts +33 -0
  59. package/dist/components/LpScrollArea.vue.d.ts +28 -0
  60. package/dist/components/LpSection.vue.d.ts +120 -0
  61. package/dist/components/LpSegmented.vue.d.ts +30 -0
  62. package/dist/components/LpSelect.vue.d.ts +47 -0
  63. package/dist/components/LpServiceNode.vue.d.ts +14 -0
  64. package/dist/components/LpShift.vue.d.ts +36 -0
  65. package/dist/components/LpShortcutsDialog.vue.d.ts +24 -0
  66. package/dist/components/LpSidebar.vue.d.ts +146 -0
  67. package/dist/components/LpSidebarNav.vue.d.ts +54 -0
  68. package/dist/components/LpSkeleton.vue.d.ts +16 -0
  69. package/dist/components/LpSlider.vue.d.ts +30 -0
  70. package/dist/components/LpSparkline.vue.d.ts +48 -0
  71. package/dist/components/LpStat.vue.d.ts +69 -0
  72. package/dist/components/LpStepper.vue.d.ts +36 -0
  73. package/dist/components/LpSwitch.vue.d.ts +42 -0
  74. package/dist/components/LpTable.vue.d.ts +124 -0
  75. package/dist/components/LpTableOfContents.vue.d.ts +19 -0
  76. package/dist/components/LpTabs.vue.d.ts +47 -0
  77. package/dist/components/LpTextarea.vue.d.ts +22 -0
  78. package/dist/components/LpThemeSwitcher.vue.d.ts +47 -0
  79. package/dist/components/LpTilt.vue.d.ts +31 -0
  80. package/dist/components/LpTimeField.vue.d.ts +24 -0
  81. package/dist/components/LpToaster.vue.d.ts +3 -0
  82. package/dist/components/LpTooltip.vue.d.ts +58 -0
  83. package/dist/components/LpTopologyCanvas.vue.d.ts +205 -0
  84. package/dist/components/LpUptimeBar.vue.d.ts +46 -0
  85. package/dist/components/LpWaypointEdge.vue.d.ts +33 -0
  86. package/dist/components/actionBar.d.ts +19 -0
  87. package/dist/components/address.d.ts +107 -0
  88. package/dist/components/chart.d.ts +180 -0
  89. package/dist/components/codeHighlight.d.ts +8 -0
  90. package/dist/components/color.d.ts +65 -0
  91. package/dist/components/commandSearch.d.ts +13 -0
  92. package/dist/components/commandSearch.js +1 -17
  93. package/dist/components/countries-data.d.ts +2 -0
  94. package/dist/components/countries.d.ts +20 -0
  95. package/dist/components/dropdown.d.ts +29 -0
  96. package/dist/components/fileTree.d.ts +79 -0
  97. package/dist/components/lightbox.d.ts +24 -0
  98. package/dist/components/modalDepth.d.ts +11 -0
  99. package/dist/components/sidebar.d.ts +42 -0
  100. package/dist/composables/easing.d.ts +46 -0
  101. package/dist/composables/useAsyncTask.d.ts +18 -0
  102. package/dist/composables/useClipboard.d.ts +46 -0
  103. package/dist/composables/useFormDraft.d.ts +67 -0
  104. package/dist/composables/useGlass.d.ts +9 -0
  105. package/dist/composables/useHotkeys.d.ts +101 -0
  106. package/dist/composables/useInputFilter.d.ts +14 -0
  107. package/dist/composables/useMergedClass.d.ts +42 -0
  108. package/dist/composables/usePillTransition.d.ts +21 -0
  109. package/dist/composables/useReveal.d.ts +26 -0
  110. package/dist/composables/useRovingFocus.d.ts +49 -0
  111. package/dist/composables/useSettled.d.ts +26 -0
  112. package/dist/composables/useShift.d.ts +35 -0
  113. package/dist/composables/useTilt.d.ts +23 -0
  114. package/dist/composables/useToast.d.ts +41 -0
  115. package/dist/composables/useZoomPan.d.ts +58 -0
  116. package/dist/icons.d.ts +1 -0
  117. package/dist/index.d.ts +162 -0
  118. package/dist/index.js +1 -2
  119. package/dist/layout/registry.d.ts +26 -0
  120. package/dist/layout/tree.d.ts +75 -0
  121. package/dist/layout/useLayout.d.ts +39 -0
  122. package/dist/theme/backdrop.d.ts +9 -0
  123. package/dist/theme/config.d.ts +16 -0
  124. package/dist/theme/define.d.ts +12 -0
  125. package/dist/theme/presets.d.ts +20 -0
  126. package/dist/theme/tokens.d.ts +75 -0
  127. package/dist/theme/useTheme.d.ts +46 -0
  128. package/package.json +2 -2
  129. package/src/components/LpCommandPalette.vue +2 -12
  130. package/src/components/commandSearch.ts +0 -17
  131. package/src/index.ts +1 -1
@@ -0,0 +1,58 @@
1
+ import { type ComputedRef, type CSSProperties, type Ref } from "vue";
2
+ export interface UseZoomPanOptions {
3
+ /** Smallest allowed scale. Default 1 (fit — never shrink past the viewport). */
4
+ min?: number;
5
+ /** Largest allowed scale. Default 8. */
6
+ max?: number;
7
+ /** Multiplier per wheel notch. Default 1.15. */
8
+ step?: number;
9
+ /** Scale that a double-click/tap toggles to, from `min`. Default 2. */
10
+ zoomedScale?: number;
11
+ }
12
+ export interface UseZoomPan {
13
+ scale: Ref<number>;
14
+ /**
15
+ * Pan offset in CONTENT pixels — what `style` puts inside `translate()`,
16
+ * before the scale magnifies it. Exposed because anything that has to know
17
+ * *which part* is visible needs the number, not the CSS string: an exporter
18
+ * writing the cropped region, a minimap drawing the viewport rectangle, a
19
+ * caller restoring a saved position. Parsing it back out of `transform` is
20
+ * the alternative, and that breaks the moment this composable changes how it
21
+ * composes the transform.
22
+ */
23
+ offset: ComputedRef<{
24
+ x: number;
25
+ y: number;
26
+ }>;
27
+ /**
28
+ * Put the view somewhere — restoring a saved position, or carrying one
29
+ * through a change that re-frames the content. Clamped like any other pan,
30
+ * so a caller cannot place the content off the viewport. Omitting `scale`
31
+ * keeps the current one.
32
+ */
33
+ setView: (view: {
34
+ x: number;
35
+ y: number;
36
+ scale?: number;
37
+ }) => void;
38
+ /** True once zoomed past the minimum — the point at which panning matters. */
39
+ zoomed: ComputedRef<boolean>;
40
+ /** True while a drag is in flight, so the caller can swap the cursor. */
41
+ panning: Ref<boolean>;
42
+ style: ComputedRef<CSSProperties>;
43
+ onWheel: (e: WheelEvent) => void;
44
+ onPointerDown: (e: PointerEvent) => void;
45
+ onPointerMove: (e: PointerEvent) => void;
46
+ onPointerUp: (e: PointerEvent) => void;
47
+ /** Zoom about the viewport centre (buttons, keyboard). */
48
+ zoomBy: (factor: number) => void;
49
+ /** Toggle between fit and `zoomedScale`, optionally about a point. */
50
+ toggleZoom: (origin?: {
51
+ x: number;
52
+ y: number;
53
+ }) => void;
54
+ reset: () => void;
55
+ /** Call with the viewport element so pointer coords can be made relative. */
56
+ setViewport: (el: HTMLElement | null) => void;
57
+ }
58
+ export declare function useZoomPan(options?: UseZoomPanOptions): UseZoomPan;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,162 @@
1
+ export { default as LayoutCanvas } from "./components/LayoutCanvas.vue";
2
+ export { default as LpAddressInput } from "./components/LpAddressInput.vue";
3
+ export { default as LpMapPicker } from "./components/LpMapPicker.vue";
4
+ export { OSM_TILES, createNominatimProvider, emptyAddress, formatAddress, project, tileUrl, unproject, } from "./components/address";
5
+ export type { AddressField, AddressLabels, AddressSuggestion, AddressValue, GeocodeProvider, GeocodeQuery, LatLon, NominatimOptions, TileSource, } from "./components/address";
6
+ export { default as LpActionBar } from "./components/LpActionBar.vue";
7
+ export type { ActionBarAction } from "./components/LpActionBar.vue";
8
+ export { default as LpAlert } from "./components/LpAlert.vue";
9
+ export { default as LpAppShell } from "./components/LpAppShell.vue";
10
+ export { default as LpAutocomplete } from "./components/LpAutocomplete.vue";
11
+ export type { AutocompleteOption } from "./components/LpAutocomplete.vue";
12
+ export { default as LpAvatar } from "./components/LpAvatar.vue";
13
+ export { default as LpBadge } from "./components/LpBadge.vue";
14
+ export { default as LpBreadcrumbs } from "./components/LpBreadcrumbs.vue";
15
+ export type { Crumb } from "./components/LpBreadcrumbs.vue";
16
+ export { default as LpButton } from "./components/LpButton.vue";
17
+ export { default as LpCalendar } from "./components/LpCalendar.vue";
18
+ export { default as LpCard } from "./components/LpCard.vue";
19
+ export { default as LpChart } from "./components/LpChart.vue";
20
+ export type { ChartPointEvent } from "./components/LpChart.vue";
21
+ export { CHART_PALETTE, axisTicks, formatTick, niceScale, } from "./components/chart";
22
+ export type { ChartAxis, ChartPoint, ChartSeries } from "./components/chart";
23
+ export { default as LpCheckbox } from "./components/LpCheckbox.vue";
24
+ export { default as LpCodeBlock } from "./components/LpCodeBlock.vue";
25
+ export type { CodeLang } from "./components/codeHighlight";
26
+ export { default as LpColorPicker } from "./components/LpColorPicker.vue";
27
+ export type { ColorPickerLabels } from "./components/LpColorPicker.vue";
28
+ export { clampHsv, DEFAULT_SWATCHES, formatColor, hsvToHsl, hsvToRgb, isLight, normalizeHue, opaqueCss, parseColor, parseHex, rgbToHex, rgbToHsv, } from "./components/color";
29
+ export type { ColorFormat, Hsv, Rgb } from "./components/color";
30
+ export { default as LpCommandPalette } from "./components/LpCommandPalette.vue";
31
+ export type { Command, PaletteLabels } from "./components/LpCommandPalette.vue";
32
+ export { parseCommandQuery, rankCommandItems } from "./components/commandSearch";
33
+ export type { CommandSearchTerms, SearchableCommand } from "./components/commandSearch";
34
+ export { default as LpConfirmDialog } from "./components/LpConfirmDialog.vue";
35
+ export { default as LpContextMenu } from "./components/LpContextMenu.vue";
36
+ export type { ContextMenuItemDef } from "./components/LpContextMenu.vue";
37
+ export { default as LpDatePicker } from "./components/LpDatePicker.vue";
38
+ export { default as LpDisclosure } from "./components/LpDisclosure.vue";
39
+ export { default as LpDivider } from "./components/LpDivider.vue";
40
+ export { default as LpDrawer } from "./components/LpDrawer.vue";
41
+ export { default as LpDropdownMenu } from "./components/LpDropdownMenu.vue";
42
+ export type { MenuItem } from "./components/LpDropdownMenu.vue";
43
+ export { default as LpDropzone } from "./components/LpDropzone.vue";
44
+ export { default as LpEmptyState } from "./components/LpEmptyState.vue";
45
+ export { default as LpFileTree } from "./components/LpFileTree.vue";
46
+ export type { FileTreeSummary } from "./components/LpFileTree.vue";
47
+ export type { CheckState, FileNode, NodeStats } from "./components/fileTree";
48
+ export { ancestorIds, checkedCount, checkStateOf, computeStats, fileIcon, formatModified, formatSize, sortNodes, subtreeIds, subtreeSize, } from "./components/fileTree";
49
+ export { default as LpFormField } from "./components/LpFormField.vue";
50
+ export { default as LpIcon } from "./components/LpIcon.vue";
51
+ export { default as LpImageEditor } from "./components/LpImageEditor.vue";
52
+ export { default as LpInfraNode } from "./components/LpInfraNode.vue";
53
+ export type { InfraNodeData } from "./components/LpInfraNode.vue";
54
+ export { default as LpInput } from "./components/LpInput.vue";
55
+ export { default as LpLightbox } from "./components/LpLightbox.vue";
56
+ export type { LightboxItem } from "./components/lightbox";
57
+ export { fileNameOf } from "./components/lightbox";
58
+ export { default as LpLink } from "./components/LpLink.vue";
59
+ export { default as LpLogViewer } from "./components/LpLogViewer.vue";
60
+ export type { LogLevel, LogLine } from "./components/LpLogViewer.vue";
61
+ export { default as LpMediaGallery } from "./components/LpMediaGallery.vue";
62
+ export { default as LpModal } from "./components/LpModal.vue";
63
+ export { default as LpModalNav } from "./components/LpModalNav.vue";
64
+ export { default as LpNotificationBell } from "./components/LpNotificationBell.vue";
65
+ export type { NotificationItem, NotificationLabels, } from "./components/LpNotificationBell.vue";
66
+ export { default as LpNumberField } from "./components/LpNumberField.vue";
67
+ export { default as LpTimeField } from "./components/LpTimeField.vue";
68
+ export { default as LpNumberFlow } from "./components/LpNumberFlow.vue";
69
+ export { default as LpOtpInput } from "./components/LpOtpInput.vue";
70
+ export { default as LpPagination } from "./components/LpPagination.vue";
71
+ export { default as LpPasswordInput } from "./components/LpPasswordInput.vue";
72
+ export { default as LpPie } from "./components/LpPie.vue";
73
+ export type { SliceEvent } from "./components/LpPie.vue";
74
+ export { resolveSlices } from "./components/chart";
75
+ export type { PieSlice, ResolvedSlice } from "./components/chart";
76
+ export { default as LpPhoneInput } from "./components/LpPhoneInput.vue";
77
+ export type { PhoneDetail } from "./components/LpPhoneInput.vue";
78
+ export { flagEmoji, loadCountries, matchCountryByValue } from "./components/countries";
79
+ export type { Country } from "./components/countries";
80
+ export { default as LpPopover } from "./components/LpPopover.vue";
81
+ export { default as LpProgress } from "./components/LpProgress.vue";
82
+ export { default as LpRadio } from "./components/LpRadio.vue";
83
+ export { default as LpRadioGroup } from "./components/LpRadioGroup.vue";
84
+ export type { RadioOption } from "./components/LpRadioGroup.vue";
85
+ export { default as LpRollingText } from "./components/LpRollingText.vue";
86
+ export { default as LpScrollArea } from "./components/LpScrollArea.vue";
87
+ export { default as LpSegmented } from "./components/LpSegmented.vue";
88
+ export type { SegmentedOption } from "./components/LpSegmented.vue";
89
+ export { default as LpSection } from "./components/LpSection.vue";
90
+ export { default as LpSelect } from "./components/LpSelect.vue";
91
+ export type { SelectOption, SelectValue } from "./components/LpSelect.vue";
92
+ export { default as LpServiceNode } from "./components/LpServiceNode.vue";
93
+ export type { ServiceNodeData } from "./components/LpServiceNode.vue";
94
+ export { default as LpShift } from "./components/LpShift.vue";
95
+ export { default as LpShortcutsDialog } from "./components/LpShortcutsDialog.vue";
96
+ export { default as LpSidebar } from "./components/LpSidebar.vue";
97
+ export type { SidebarItem, SidebarSection } from "./components/LpSidebar.vue";
98
+ export { default as LpSkeleton } from "./components/LpSkeleton.vue";
99
+ export { default as LpSlider } from "./components/LpSlider.vue";
100
+ export { default as LpSparkline } from "./components/LpSparkline.vue";
101
+ export { default as LpStat } from "./components/LpStat.vue";
102
+ export { default as LpStepper } from "./components/LpStepper.vue";
103
+ export type { Step } from "./components/LpStepper.vue";
104
+ export { default as LpSwitch } from "./components/LpSwitch.vue";
105
+ export { default as LpTable } from "./components/LpTable.vue";
106
+ export type { SortState, TableColumn, TablePage, TableQuery } from "./components/LpTable.vue";
107
+ export { default as LpTableOfContents } from "./components/LpTableOfContents.vue";
108
+ export type { TocLink } from "./components/LpTableOfContents.vue";
109
+ export { default as LpTabs } from "./components/LpTabs.vue";
110
+ export type { TabItem } from "./components/LpTabs.vue";
111
+ export { default as LpTextarea } from "./components/LpTextarea.vue";
112
+ export { default as LpThemeSwitcher } from "./components/LpThemeSwitcher.vue";
113
+ export { default as LpTilt } from "./components/LpTilt.vue";
114
+ export { default as LpToaster } from "./components/LpToaster.vue";
115
+ export { default as LpTooltip } from "./components/LpTooltip.vue";
116
+ export { default as LpTopologyCanvas } from "./components/LpTopologyCanvas.vue";
117
+ export type { CanvasViewport, EdgeCategory, EdgeObserved, TopologyEdge, TopologyLane, TopologyNode, } from "./components/LpTopologyCanvas.vue";
118
+ export { default as LpUptimeBar } from "./components/LpUptimeBar.vue";
119
+ export type { UptimeSegment, UptimeStatus } from "./components/LpUptimeBar.vue";
120
+ export { addLeaf, addTab, countBlocks, countLeaves, deserializeLayout, makeLayout, moveLeaf, removeBlock, removeLeaf, reorderTab, resizeAt, setActiveTab, serializeLayout, } from "./layout/tree";
121
+ export type { Dir, LayoutNode, Leaf, Side, Split } from "./layout/tree";
122
+ export { blockTitle, defineBlocks } from "./layout/registry";
123
+ export type { BlockDef, BlockRegistry } from "./layout/registry";
124
+ export { useLayout } from "./layout/useLayout";
125
+ export type { UseLayout, UseLayoutOptions } from "./layout/useLayout";
126
+ export { applyTheme, applyThemeWithTransition, bootstrapTheme, parseTheme, serializeTheme, THEME_COOKIE, themeFromCookie, themeToCssRule, themeToCssVars, useTheme, } from "./theme/useTheme";
127
+ export type { RevealOrigin } from "./theme/useTheme";
128
+ export { detectBackdropFilter, isBrokenBackdropEngine, NO_BACKDROP_ATTR } from "./theme/backdrop";
129
+ export { DEFAULT_SURFACE } from "./theme/tokens";
130
+ export { defineTheme } from "./theme/define";
131
+ export type { ThemeOverrides } from "./theme/define";
132
+ export type { ColorTokens, DensityTokens, FontTokens, ShapeTokens, SurfaceTokens, TokenSet, } from "./theme/tokens";
133
+ export { amber, dark, leavepulse, light, lime, nord, presets, rose, violet } from "./theme/presets";
134
+ export type { PresetName } from "./theme/presets";
135
+ export { parseConfig, serializeConfig, UI_CONFIG_VERSION } from "./theme/config";
136
+ export type { UiConfig } from "./theme/config";
137
+ export { useClipboard } from "./composables/useClipboard";
138
+ export type { CopyOptions, UseClipboard } from "./composables/useClipboard";
139
+ export { useHotkeys, isAppleKeyboard, appleModifierLabel, activeShortcuts, mergeShortcutGroups, } from "./composables/useHotkeys";
140
+ export type { HotkeyBinding, HotkeyHelp, ShortcutEntry, ShortcutGroup } from "./composables/useHotkeys";
141
+ export { provideGlass, useGlass } from "./composables/useGlass";
142
+ export { useMergedClass, useMergedAttrs, mergeClass } from "./composables/useMergedClass";
143
+ export { useInputFilter } from "./composables/useInputFilter";
144
+ export type { UseInputFilterOptions } from "./composables/useInputFilter";
145
+ export { easeOut, easeTravel, easingToken, prefersReducedMotion } from "./composables/easing";
146
+ export { useReveal } from "./composables/useReveal";
147
+ export type { UseReveal, UseRevealOptions } from "./composables/useReveal";
148
+ export { useAsyncTask } from "./composables/useAsyncTask";
149
+ export { useRovingFocus } from "./composables/useRovingFocus";
150
+ export type { RovingItem, UseRovingFocusOptions } from "./composables/useRovingFocus";
151
+ export { useFormDraft } from "./composables/useFormDraft";
152
+ export type { UseFormDraft, UseFormDraftOptions } from "./composables/useFormDraft";
153
+ export { useSettled } from "./composables/useSettled";
154
+ export type { UseSettledOptions } from "./composables/useSettled";
155
+ export { useShift } from "./composables/useShift";
156
+ export type { ShiftAxis, UseShift, UseShiftOptions } from "./composables/useShift";
157
+ export { useTilt } from "./composables/useTilt";
158
+ export type { UseTilt, UseTiltOptions } from "./composables/useTilt";
159
+ export { useZoomPan } from "./composables/useZoomPan";
160
+ export type { UseZoomPan, UseZoomPanOptions } from "./composables/useZoomPan";
161
+ export { useToast } from "./composables/useToast";
162
+ export type { ToastAction, ToastItem, ToastOptions, ToastVariant, } from "./composables/useToast";
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import { _ as _15 } from "./chunks/LpCodeBlock-Bo0B4TFR.js";
19
19
  import { _ as _16 } from "./chunks/LpColorPicker-BlXea7LM.js";
20
20
  import { DEFAULT_SWATCHES, clampHsv, formatColor, hsvToHsl, hsvToRgb, isLight, normalizeHue, opaqueCss, parseColor, parseHex, rgbToHex, rgbToHsv } from "./components/color.js";
21
21
  import { default as default3 } from "./components/LpCommandPalette.vue.js";
22
- import { parseCommandQuery, rankCommandItems, swapCommandTerms } from "./components/commandSearch.js";
22
+ import { parseCommandQuery, rankCommandItems } from "./components/commandSearch.js";
23
23
  import { _ as _17 } from "./chunks/LpConfirmDialog-Q-bxff8z.js";
24
24
  import { _ as _18 } from "./chunks/LpContextMenu-CwW1QXe_.js";
25
25
  import { _ as _19 } from "./chunks/LpDatePicker-CwOToxGq.js";
@@ -295,7 +295,6 @@ export {
295
295
  sortNodes,
296
296
  subtreeIds,
297
297
  subtreeSize,
298
- swapCommandTerms,
299
298
  t as themeFromCookie,
300
299
  k as themeToCssRule,
301
300
  m as themeToCssVars,
@@ -0,0 +1,26 @@
1
+ import type { Component } from "vue";
2
+ export interface BlockDef {
3
+ /**
4
+ * Content component for this block. Optional: when the consumer renders block
5
+ * content via the canvas's #block slot (keyed by id), the registry is used
6
+ * only for tab chrome (title/icon) and no component is needed here.
7
+ */
8
+ component?: Component;
9
+ /** Human label shown on the tab / cell header. Defaults to the id. */
10
+ title?: string;
11
+ /** Optional iconify name (e.g. "lucide:activity") for the tab. */
12
+ icon?: string;
13
+ /** Whether the user may close this block. Defaults to true. */
14
+ closable?: boolean;
15
+ /** Props passed to the component. */
16
+ props?: Record<string, unknown>;
17
+ }
18
+ export type BlockRegistry = Record<string, BlockDef>;
19
+ /**
20
+ * Identity helper that pins the key type so callers get autocomplete on block
21
+ * ids elsewhere (e.g. when seeding a layout). Purely for inference — it returns
22
+ * the object unchanged.
23
+ */
24
+ export declare function defineBlocks<const T extends BlockRegistry>(blocks: T): T;
25
+ /** Resolve a block's display title, falling back to its id. */
26
+ export declare function blockTitle(registry: BlockRegistry, id: string): string;
@@ -0,0 +1,75 @@
1
+ export type Dir = "row" | "col";
2
+ export type Side = "left" | "right" | "top" | "bottom" | "center";
3
+ export interface Leaf {
4
+ kind: "leaf";
5
+ id: string;
6
+ /**
7
+ * Block ids stacked as tabs in this cell. A plain cell is a single-element
8
+ * stack; dropping onto a cell's center adds another tab. The consumer maps
9
+ * each id to content via the canvas slot.
10
+ */
11
+ blocks: string[];
12
+ /** Index into `blocks` of the visible tab. */
13
+ active: number;
14
+ /** Flex fraction among siblings. */
15
+ size: number;
16
+ }
17
+ export interface Split {
18
+ kind: "split";
19
+ id: string;
20
+ dir: Dir;
21
+ size: number;
22
+ children: LayoutNode[];
23
+ }
24
+ export type LayoutNode = Leaf | Split;
25
+ /** Build a single-row layout from a flat list of block ids (one cell each). */
26
+ export declare function makeLayout(blocks: string[]): Split;
27
+ export declare function findParent(node: Split, childId: string): Split | null;
28
+ export declare function findLeaf(node: LayoutNode, id: string): Leaf | null;
29
+ export declare function countLeaves(node: LayoutNode): number;
30
+ /** Total blocks across all cells (a tabbed cell counts each of its tabs). */
31
+ export declare function countBlocks(node: LayoutNode): number;
32
+ /** Remove an entire cell (with all its tabs). */
33
+ export declare function removeLeaf(root: Split, id: string): void;
34
+ /**
35
+ * Remove one tab from a cell. Removing the last tab removes the cell itself
36
+ * (unless it's the only block left in the whole layout, which is kept).
37
+ */
38
+ export declare function removeBlock(root: Split, leafId: string, index: number): void;
39
+ export declare function addLeaf(root: Split, block: string, side?: Side): void;
40
+ /** Append a block as a new tab in the target cell and focus it. */
41
+ export declare function addTab(root: Split, leafId: string, block: string): void;
42
+ /** Switch the visible tab of a cell. */
43
+ export declare function setActiveTab(root: Split, leafId: string, index: number): void;
44
+ /**
45
+ * Reorder a tab within its cell, moving the block at `from` to `to`. The same
46
+ * block stays visible afterwards (active follows the moved block by identity,
47
+ * not by index). Always available — not gated by edit mode.
48
+ */
49
+ export declare function reorderTab(root: Split, leafId: string, from: number, to: number): void;
50
+ /**
51
+ * Move an existing cell to a target. An edge side splits beside the target;
52
+ * `center` merges the moving cell's tabs into the target cell (and focuses
53
+ * the first moved tab).
54
+ */
55
+ export declare function moveLeaf(root: Split, movingId: string, targetId: string, side: Side): void;
56
+ /** Splitter drag: redistribute size between two adjacent siblings. */
57
+ export declare function resizeAt(parent: Split, index: number, deltaFraction: number): void;
58
+ interface SerializedLeaf {
59
+ kind: "leaf";
60
+ blocks: string[];
61
+ active: number;
62
+ size: number;
63
+ /** Legacy single-block form (pre-tabs); hydrated into `blocks`. */
64
+ block?: string;
65
+ }
66
+ interface SerializedSplit {
67
+ kind: "split";
68
+ dir: Dir;
69
+ size: number;
70
+ children: SerializedNode[];
71
+ }
72
+ type SerializedNode = SerializedLeaf | SerializedSplit;
73
+ export declare function serializeLayout(root: Split): SerializedNode;
74
+ export declare function deserializeLayout(data: SerializedNode): Split;
75
+ export {};
@@ -0,0 +1,39 @@
1
+ import { type Ref } from "vue";
2
+ import { type Side, type Split } from "./tree";
3
+ export interface UseLayoutOptions {
4
+ /** Initial block ids, left-to-right, when no saved layout is loaded. */
5
+ initial: string[];
6
+ /** Max undo depth. */
7
+ historyLimit?: number;
8
+ }
9
+ export interface UseLayout {
10
+ /** The live reactive tree to hand to <LayoutCanvas v-model>. */
11
+ layout: Ref<Split>;
12
+ /** Block count across all tabs, handy for "N blocks" labels and guards. */
13
+ count: Ref<number>;
14
+ canUndo: Ref<boolean>;
15
+ canRedo: Ref<boolean>;
16
+ /** Add a block: a new cell on an edge, or a tab on the last cell (center). */
17
+ add: (block: string, side?: Side) => void;
18
+ /** Add a block as a tab in a specific cell. */
19
+ addTab: (leafId: string, block: string) => void;
20
+ /** Switch the visible tab of a cell. */
21
+ setActive: (leafId: string, index: number) => void;
22
+ /** Reorder a tab within its cell (always available, not edit-gated). */
23
+ reorderTab: (leafId: string, from: number, to: number) => void;
24
+ /** Remove one tab (drops the cell when it was the last tab). */
25
+ removeBlock: (leafId: string, index: number) => void;
26
+ /** Remove an entire cell with all its tabs. */
27
+ remove: (leafId: string) => void;
28
+ move: (movingId: string, targetId: string, side: Side) => void;
29
+ resize: (parent: Split, index: number, deltaFraction: number) => void;
30
+ undo: () => void;
31
+ redo: () => void;
32
+ /** Replace the whole layout from a flat block list. */
33
+ reset: (blocks?: string[]) => void;
34
+ /** Serialize to JSON-safe data for persistence. */
35
+ serialize: () => unknown;
36
+ /** Replace the layout from previously serialized data. */
37
+ hydrate: (data: unknown) => void;
38
+ }
39
+ export declare function useLayout(options: UseLayoutOptions): UseLayout;
@@ -0,0 +1,9 @@
1
+ /** Set on <html> when backdrop-filter resolves but does not composite. */
2
+ export declare const NO_BACKDROP_ATTR = "data-lp-no-backdrop";
3
+ export declare function isBrokenBackdropEngine(nav?: Navigator): boolean;
4
+ /**
5
+ * Flag the document when backdrop-filter cannot be trusted, so the fallback
6
+ * rules in tokens.css can trade blur for opacity. Safe to call more than once
7
+ * and a no-op outside the browser.
8
+ */
9
+ export declare function detectBackdropFilter(root?: HTMLElement): boolean;
@@ -0,0 +1,16 @@
1
+ import type { Split } from "../layout/tree";
2
+ import type { TokenSet } from "./tokens";
3
+ export declare const UI_CONFIG_VERSION = 1;
4
+ export interface UiConfig {
5
+ version: number;
6
+ theme: TokenSet;
7
+ /** Optional — apps without a composable layout omit it. */
8
+ layout?: Split;
9
+ }
10
+ export interface SerializedUiConfig {
11
+ version: number;
12
+ theme: TokenSet;
13
+ layout?: unknown;
14
+ }
15
+ export declare function serializeConfig(config: UiConfig): string;
16
+ export declare function parseConfig(json: string): UiConfig;
@@ -0,0 +1,12 @@
1
+ import { presets } from "./presets";
2
+ import type { ColorTokens, DensityTokens, FontTokens, ShapeTokens, SurfaceTokens, TokenSet } from "./tokens";
3
+ export interface ThemeOverrides {
4
+ name?: string;
5
+ mode?: "dark" | "light";
6
+ colors?: Partial<ColorTokens>;
7
+ shape?: Partial<ShapeTokens>;
8
+ density?: Partial<DensityTokens>;
9
+ font?: Partial<FontTokens>;
10
+ surface?: Partial<SurfaceTokens>;
11
+ }
12
+ export declare function defineTheme(base: TokenSet | keyof typeof presets, overrides?: ThemeOverrides): TokenSet;
@@ -0,0 +1,20 @@
1
+ import type { TokenSet } from "./tokens";
2
+ export declare const dark: TokenSet;
3
+ export declare const light: TokenSet;
4
+ export declare const lime: TokenSet;
5
+ export declare const leavepulse: TokenSet;
6
+ export declare const rose: TokenSet;
7
+ export declare const amber: TokenSet;
8
+ export declare const violet: TokenSet;
9
+ export declare const nord: TokenSet;
10
+ export declare const presets: {
11
+ readonly dark: TokenSet;
12
+ readonly light: TokenSet;
13
+ readonly lime: TokenSet;
14
+ readonly leavepulse: TokenSet;
15
+ readonly rose: TokenSet;
16
+ readonly amber: TokenSet;
17
+ readonly violet: TokenSet;
18
+ readonly nord: TokenSet;
19
+ };
20
+ export type PresetName = keyof typeof presets;
@@ -0,0 +1,75 @@
1
+ export interface ColorTokens {
2
+ surface: string;
3
+ surfaceRaised: string;
4
+ surfaceSoft: string;
5
+ ink: string;
6
+ inkInverse: string;
7
+ muted: string;
8
+ mutedStrong: string;
9
+ brand: string;
10
+ brandHover: string;
11
+ brandSoft: string;
12
+ action: string;
13
+ actionHover: string;
14
+ actionSoft: string;
15
+ accent: string;
16
+ accentHover: string;
17
+ accentSoft: string;
18
+ danger: string;
19
+ dangerHover: string;
20
+ dangerSoft: string;
21
+ line: string;
22
+ lineStrong: string;
23
+ ring: string;
24
+ }
25
+ export interface ShapeTokens {
26
+ radiusControl: number;
27
+ radiusCard: number;
28
+ radiusPill: number;
29
+ }
30
+ export interface DensityTokens {
31
+ /** base spacing unit in px */
32
+ spacingUnit: number;
33
+ controlSm: number;
34
+ controlMd: number;
35
+ controlLg: number;
36
+ }
37
+ export interface FontTokens {
38
+ /** CSS font-family stack for UI text */
39
+ sans: string;
40
+ /** CSS font-family stack for numerals / code */
41
+ mono: string;
42
+ }
43
+ export interface SurfaceTokens {
44
+ /** Border width for panels/cards/controls (CSS length, e.g. "1px"). */
45
+ borderWidth: string;
46
+ /** backdrop-filter blur radius (CSS length; "0" disables glass blur). */
47
+ panelBlur: string;
48
+ /** backdrop-filter saturate (unitless or %, e.g. "100%" / "180%"). */
49
+ panelSaturate: string;
50
+ /** Overlay painted over a panel's base color ("none" or a gradient). */
51
+ panelOverlay: string;
52
+ /** Box-shadow for a raised panel (may be multi-layer for glass). */
53
+ panelShadow: string;
54
+ /** Inset highlight line for a panel ("none" or an inset box-shadow). */
55
+ panelInset: string;
56
+ }
57
+ export interface TokenSet {
58
+ /** human label, e.g. "Lime" */
59
+ name: string;
60
+ /** "dark" | "light" — drives `color-scheme` and the data-theme-mode hint */
61
+ mode: "dark" | "light";
62
+ colors: ColorTokens;
63
+ shape: ShapeTokens;
64
+ density: DensityTokens;
65
+ font: FontTokens;
66
+ /** Optional skin axis; older themes without it fall back to a flat default. */
67
+ surface?: SurfaceTokens;
68
+ }
69
+ /** camelCase token key → CSS custom property name. */
70
+ export declare const COLOR_VARS: Record<keyof ColorTokens, string>;
71
+ export declare const SHAPE_VARS: Record<keyof ShapeTokens, string>;
72
+ export declare const DENSITY_VARS: Record<keyof DensityTokens, string>;
73
+ export declare const FONT_VARS: Record<keyof FontTokens, string>;
74
+ export declare const SURFACE_VARS: Record<keyof SurfaceTokens, string>;
75
+ export declare const DEFAULT_SURFACE: SurfaceTokens;
@@ -0,0 +1,46 @@
1
+ import { type ComputedRef, type DeepReadonly, type Ref } from "vue";
2
+ import { type TokenSet } from "./tokens";
3
+ export declare function applyTheme(theme: TokenSet, root?: HTMLElement): void;
4
+ /** Point a circular theme reveal expands from (viewport px). */
5
+ export interface RevealOrigin {
6
+ x: number;
7
+ y: number;
8
+ }
9
+ export declare function applyThemeWithTransition(theme: TokenSet, origin?: RevealOrigin, root?: HTMLElement, durationMs?: number): void;
10
+ export declare function serializeTheme(theme: TokenSet): string;
11
+ export declare function themeToCssVars(theme: TokenSet): string;
12
+ /** Render a theme as a complete CSS rule (default selector `:root`). */
13
+ export declare function themeToCssRule(theme: TokenSet, selector?: string): string;
14
+ /** Parse + shallow-validate a theme JSON; throws on a malformed shape. */
15
+ export declare function parseTheme(json: string): TokenSet;
16
+ export declare function bootstrapTheme(fallback: TokenSet): TokenSet;
17
+ export declare function cacheTheme(theme: TokenSet): void;
18
+ export declare const THEME_COOKIE = "lp-theme";
19
+ /**
20
+ * Resolve a theme name (as read from the `lp-theme` cookie) against a set of
21
+ * known themes. Returns `null` when the name is absent or unknown, so the caller
22
+ * can fall back to its own default.
23
+ *
24
+ * Server-side counterpart to `cacheTheme`: pair it with `themeToCssRule` to
25
+ * inline the right variables into `<head>` during SSR.
26
+ */
27
+ export declare function themeFromCookie(cookieValue: string | null | undefined, themes: readonly TokenSet[]): TokenSet | null;
28
+ export interface UseTheme {
29
+ /** The active theme, kept in sync by the kit. Null until hydrated (SSR/first
30
+ * paint) — reactive, so a switcher binds straight to it. */
31
+ current: DeepReadonly<Ref<TokenSet | null>>;
32
+ /** The active theme's name (""="not yet hydrated"). */
33
+ currentName: ComputedRef<string>;
34
+ /** Set + persist a theme (with the circular reveal if `origin`/transition).
35
+ * This is the one call a switcher needs — it updates `current` too. */
36
+ setTheme: (theme: TokenSet, origin?: RevealOrigin) => void;
37
+ /** Seed the fallback (used when nothing is cached) and hydrate now. Call once
38
+ * at app start (client) — optional; the first useTheme() hydrates anyway. */
39
+ init: (fallback: TokenSet) => TokenSet;
40
+ apply: (theme: TokenSet) => void;
41
+ applyWithTransition: (theme: TokenSet, origin?: RevealOrigin) => void;
42
+ serialize: typeof serializeTheme;
43
+ parse: typeof parseTheme;
44
+ bootstrap: typeof bootstrapTheme;
45
+ }
46
+ export declare function useTheme(): UseTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leavepulse/ui",
3
- "version": "0.43.2",
3
+ "version": "0.43.4",
4
4
  "type": "module",
5
5
  "description": "LeavePulse token-driven Vue component kit.",
6
6
  "repository": {
@@ -47,7 +47,7 @@
47
47
  "gen:names": "node scripts/gen-component-names.mjs",
48
48
  "build": "node scripts/gen-component-names.mjs && vue-tsc --noEmit -p tsconfig.build.json && vite build --config vite.lib.config.ts && vue-tsc --declaration --emitDeclarationOnly --noEmit false -p tsconfig.build.json --outDir dist",
49
49
  "dev:dist": "vite build --watch --config vite.lib.config.ts",
50
- "prepublishOnly": "node scripts/gen-component-names.mjs && vue-tsc --noEmit -p tsconfig.build.json && vite build --config vite.lib.config.ts",
50
+ "prepublishOnly": "npm run build",
51
51
  "typecheck": "vue-tsc --noEmit",
52
52
  "test": "bun test",
53
53
  "release": "npm version patch -m \"chore: release v%s\" && git push --follow-tags",
@@ -44,7 +44,7 @@ import { useGlass } from "../composables/useGlass"
44
44
  import { useClipboard } from "../composables/useClipboard"
45
45
  import { useHotkeys } from "../composables/useHotkeys"
46
46
  import { useModalLayer } from "./modalDepth"
47
- import { parseCommandQuery, rankCommandItems, swapCommandTerms } from "./commandSearch"
47
+ import { parseCommandQuery, rankCommandItems } from "./commandSearch"
48
48
 
49
49
  export interface Command {
50
50
  id: string
@@ -190,12 +190,6 @@ const props = withDefaults(
190
190
  * other group off the screen. 0 shows everything.
191
191
  */
192
192
  groupLimit?: number
193
- /**
194
- * When the query matches nothing, retry it as if typed in the other
195
- * keyboard layout (QWERTY ↔ Cyrillic). Off for an app whose commands are
196
- * meant to be typed in one layout only.
197
- */
198
- layoutFallback?: boolean
199
193
  /**
200
194
  * A pane beside the list showing the highlighted result in full — its
201
195
  * `preview` text, or the `preview` slot. For palettes that search
@@ -229,7 +223,6 @@ const props = withDefaults(
229
223
  resultsLabel: "Results",
230
224
  excerptLines: 4,
231
225
  groupLimit: 0,
232
- layoutFallback: true,
233
226
  previewPane: false,
234
227
  glass: undefined,
235
228
  },
@@ -469,10 +462,7 @@ const local = computed<{ items: Command[]; terms: string[] }>(() => {
469
462
  // typed). With a query, hidden commands rank like any other.
470
463
  if (!terms.include.length && !terms.exclude.length && !terms.groups.length) return { items: filtered, terms: [] }
471
464
  const items = rankCommandItems(filtered, terms)
472
- if (items.length || !props.layoutFallback) return { items, terms: terms.include }
473
- const swapped = swapCommandTerms(terms)
474
- const other = rankCommandItems(filtered, swapped)
475
- return other.length ? { items: other, terms: swapped.include } : { items, terms: terms.include }
465
+ return { items, terms: terms.include }
476
466
  })
477
467
 
478
468
  const ranked = computed<Command[]>(() => local.value.items)