@leavepulse/ui 0.12.0 → 0.14.6

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 (162) hide show
  1. package/dist/assets/LpCommandPalette-D315B47-.css +16 -0
  2. package/dist/chunks/LayoutCanvas-Dd20boUG.js +50 -0
  3. package/dist/chunks/LayoutNode-DGpZA9LX.js +225 -0
  4. package/dist/chunks/LpAlert-BAYHDSS1.js +69 -0
  5. package/dist/chunks/LpAppShell-DBTsNQaM.js +170 -0
  6. package/dist/chunks/LpAutocomplete-B9uoCs4t.js +196 -0
  7. package/dist/chunks/LpAvatar-B1Ez0ZAx.js +88 -0
  8. package/dist/chunks/LpBadge-CXzBPnwO.js +42 -0
  9. package/dist/chunks/LpBreadcrumbs-B7Aqatzw.js +42 -0
  10. package/dist/chunks/LpButton-5VXXCjwF.js +101 -0
  11. package/dist/chunks/LpCalendar-B7ZL0ty3.js +150 -0
  12. package/dist/chunks/LpCard-1yvWT9fx.js +66 -0
  13. package/dist/chunks/LpCheckbox-BO0zuuPh.js +55 -0
  14. package/dist/chunks/LpCodeBlock-CSiOSPs8.js +253 -0
  15. package/dist/chunks/LpConfirmDialog-KLtTtCiT.js +62 -0
  16. package/dist/chunks/LpContextMenu-D0mzXqA7.js +151 -0
  17. package/dist/chunks/LpDatePicker-dY2q4dr4.js +122 -0
  18. package/dist/chunks/LpDisclosure-DP6yfgfM.js +76 -0
  19. package/dist/chunks/LpDivider-CUX46KR0.js +43 -0
  20. package/dist/chunks/LpDrawer-Ce6g9ZMr.js +310 -0
  21. package/dist/chunks/LpDropdownMenu-DJpoqRCb.js +65 -0
  22. package/dist/chunks/LpEmptyState-CrfyRJUG.js +47 -0
  23. package/dist/chunks/LpFormField-Bn-ZwC6z.js +47 -0
  24. package/dist/chunks/LpIcon-CCnX5_2j.js +41 -0
  25. package/dist/chunks/LpInfraNode-C_PHcthC.js +99 -0
  26. package/dist/chunks/LpInput-BauZRyzm.js +136 -0
  27. package/dist/chunks/LpLaneNode-HtnQf2FF.js +33 -0
  28. package/dist/chunks/LpLink-DHwOEp4e.js +36 -0
  29. package/dist/chunks/LpLogViewer-hC0OKkeE.js +482 -0
  30. package/dist/chunks/LpModal-CWoOExzT.js +128 -0
  31. package/dist/chunks/LpNotificationBell-BDy0tQwr.js +232 -0
  32. package/dist/chunks/LpNumberField-C5ar-OwE.js +55 -0
  33. package/dist/chunks/LpOtpInput-DqaT0Z75.js +65 -0
  34. package/dist/chunks/LpPagination-CeGuNe_q.js +132 -0
  35. package/dist/chunks/LpPasswordInput-DIHFw4u0.js +64 -0
  36. package/dist/chunks/LpPhoneInput-LQvVFGMw.js +199 -0
  37. package/dist/chunks/LpPopover-8268UmlC.js +54 -0
  38. package/dist/chunks/LpProgress-BhI0IbjC.js +37 -0
  39. package/dist/chunks/LpRadio-CL-pI0_O.js +39 -0
  40. package/dist/chunks/LpRadioGroup-B4yDTmi6.js +52 -0
  41. package/dist/chunks/LpScrollArea-K1x-azgY.js +67 -0
  42. package/dist/chunks/LpSegmented-BmpanyAo.js +74 -0
  43. package/dist/chunks/LpSelect-DznhPEWX.js +222 -0
  44. package/dist/chunks/LpServiceNode-Dc-Ut5RS.js +51 -0
  45. package/dist/chunks/LpSidebar-BPQabjae.js +152 -0
  46. package/dist/chunks/LpSidebarNav-CpF7rZxx.js +126 -0
  47. package/dist/chunks/LpSkeleton-eSFIo4kD.js +22 -0
  48. package/dist/chunks/LpSlider-B1SF3pRV.js +53 -0
  49. package/dist/chunks/LpStat-CdbEFOvn.js +88 -0
  50. package/dist/chunks/LpStepper-5dFTrW21.js +53 -0
  51. package/dist/chunks/LpSwitch-v6fnccSM.js +28 -0
  52. package/dist/chunks/LpTable-CJ4Zt1UH.js +229 -0
  53. package/dist/chunks/LpTableOfContents-CjvxPMpU.js +155 -0
  54. package/dist/chunks/LpTabs-D7aTVPOb.js +115 -0
  55. package/dist/chunks/LpTextarea-CRAkhemZ.js +44 -0
  56. package/dist/chunks/LpThemeSwitcher-BgWwfkxs.js +601 -0
  57. package/dist/chunks/LpTilt-DuyKbpkA.js +49 -0
  58. package/dist/chunks/LpToaster-gDB1EaU3.js +196 -0
  59. package/dist/chunks/LpTooltip-CIwoRCag.js +49 -0
  60. package/dist/chunks/LpTopologyCanvas-DVwyQfKa.js +237 -0
  61. package/dist/chunks/LpUptimeBar-CB366k0O.js +127 -0
  62. package/dist/component-names.d.ts +1 -1
  63. package/dist/components/LayoutCanvas.vue.js +4 -0
  64. package/dist/components/LayoutNode.vue.js +4 -0
  65. package/dist/components/LpAlert.vue.js +4 -0
  66. package/dist/components/LpAppShell.vue.js +4 -0
  67. package/dist/components/LpAutocomplete.vue.js +4 -0
  68. package/dist/components/LpAvatar.vue.js +4 -0
  69. package/dist/components/LpBadge.vue.js +4 -0
  70. package/dist/components/LpBreadcrumbs.vue.js +4 -0
  71. package/dist/components/LpButton.vue.js +4 -0
  72. package/dist/components/LpCalendar.vue.js +4 -0
  73. package/dist/components/LpCard.vue.js +4 -0
  74. package/dist/components/LpCheckbox.vue.js +4 -0
  75. package/dist/components/LpCodeBlock.vue.js +4 -0
  76. package/dist/components/LpCommandPalette.vue.js +310 -0
  77. package/dist/components/LpConfirmDialog.vue.js +4 -0
  78. package/dist/components/LpContextMenu.vue.d.ts +7 -0
  79. package/dist/components/LpContextMenu.vue.js +4 -0
  80. package/dist/components/LpDatePicker.vue.js +4 -0
  81. package/dist/components/LpDisclosure.vue.js +4 -0
  82. package/dist/components/LpDivider.vue.js +4 -0
  83. package/dist/components/LpDrawer.vue.d.ts +8 -0
  84. package/dist/components/LpDrawer.vue.js +4 -0
  85. package/dist/components/LpDropdownMenu.vue.js +4 -0
  86. package/dist/components/LpEmptyState.vue.js +4 -0
  87. package/dist/components/LpFormField.vue.js +4 -0
  88. package/dist/components/LpIcon.vue.js +4 -0
  89. package/dist/components/LpInfraNode.vue.js +4 -0
  90. package/dist/components/LpInput.vue.js +4 -0
  91. package/dist/components/LpLaneNode.vue.js +4 -0
  92. package/dist/components/LpLink.vue.js +4 -0
  93. package/dist/components/LpLogViewer.vue.js +4 -0
  94. package/dist/components/LpModal.vue.js +4 -0
  95. package/dist/components/LpNotificationBell.vue.js +4 -0
  96. package/dist/components/LpNumberField.vue.js +4 -0
  97. package/dist/components/LpOtpInput.vue.js +4 -0
  98. package/dist/components/LpPagination.vue.js +4 -0
  99. package/dist/components/LpPasswordInput.vue.js +4 -0
  100. package/dist/components/LpPhoneInput.vue.js +4 -0
  101. package/dist/components/LpPopover.vue.js +4 -0
  102. package/dist/components/LpProgress.vue.js +4 -0
  103. package/dist/components/LpRadio.vue.js +4 -0
  104. package/dist/components/LpRadioGroup.vue.js +4 -0
  105. package/dist/components/LpScrollArea.vue.d.ts +2 -2
  106. package/dist/components/LpScrollArea.vue.js +4 -0
  107. package/dist/components/LpSegmented.vue.js +4 -0
  108. package/dist/components/LpSelect.vue.d.ts +2 -0
  109. package/dist/components/LpSelect.vue.js +4 -0
  110. package/dist/components/LpServiceNode.vue.js +4 -0
  111. package/dist/components/LpSidebar.vue.js +4 -0
  112. package/dist/components/LpSidebarNav.vue.js +4 -0
  113. package/dist/components/LpSkeleton.vue.js +4 -0
  114. package/dist/components/LpSlider.vue.js +4 -0
  115. package/dist/components/LpStat.vue.js +4 -0
  116. package/dist/components/LpStepper.vue.js +4 -0
  117. package/dist/components/LpSwitch.vue.js +4 -0
  118. package/dist/components/LpTable.vue.js +4 -0
  119. package/dist/components/LpTableOfContents.vue.js +4 -0
  120. package/dist/components/LpTabs.vue.d.ts +4 -2
  121. package/dist/components/LpTabs.vue.js +4 -0
  122. package/dist/components/LpTextarea.vue.js +4 -0
  123. package/dist/components/LpThemeSwitcher.vue.js +4 -0
  124. package/dist/components/LpTilt.vue.d.ts +31 -0
  125. package/dist/components/LpTilt.vue.js +4 -0
  126. package/dist/components/LpToaster.vue.js +4 -0
  127. package/dist/components/LpTooltip.vue.js +4 -0
  128. package/dist/components/LpTopologyCanvas.vue.js +4 -0
  129. package/dist/components/LpUptimeBar.vue.js +4 -0
  130. package/dist/components/codeHighlight.js +230 -0
  131. package/dist/{countries-data-9rgqJWHo.js → components/countries-data.js} +2 -2
  132. package/dist/components/countries.js +38 -0
  133. package/dist/components/dropdown.js +14 -0
  134. package/dist/components/sidebar.js +1 -0
  135. package/dist/composables/useInputFilter.js +44 -0
  136. package/dist/composables/usePillTransition.js +11 -0
  137. package/dist/composables/useTilt.d.ts +23 -0
  138. package/dist/composables/useTilt.js +57 -0
  139. package/dist/composables/useToast.d.ts +2 -0
  140. package/dist/composables/useToast.js +49 -0
  141. package/dist/index.d.ts +3 -0
  142. package/dist/index.js +197 -17596
  143. package/dist/layout/registry.js +10 -0
  144. package/dist/layout/tree.js +192 -0
  145. package/dist/layout/useLayout.js +61 -0
  146. package/package.json +5 -3
  147. package/src/component-names.ts +1 -0
  148. package/src/components/LpContextMenu.vue +14 -4
  149. package/src/components/LpDrawer.vue +29 -1
  150. package/src/components/LpLogViewer.vue +180 -31
  151. package/src/components/LpScrollArea.vue +20 -15
  152. package/src/components/LpSelect.vue +0 -0
  153. package/src/components/LpSidebar.vue +5 -2
  154. package/src/components/LpTabs.vue +19 -6
  155. package/src/components/LpThemeSwitcher.vue +13 -2
  156. package/src/components/LpTilt.vue +61 -0
  157. package/src/components/LpToaster.vue +11 -4
  158. package/src/composables/useTilt.ts +103 -0
  159. package/src/composables/useToast.ts +2 -0
  160. package/src/index.ts +3 -0
  161. package/src/nuxt.ts +10 -1
  162. package/dist/index.css +0 -1
@@ -0,0 +1,103 @@
1
+ import { useReducedMotion } from "motion-v"
2
+ import { computed, ref, type ComputedRef, type CSSProperties, type Ref } from "vue"
3
+
4
+ /*
5
+ * useTilt — pointer-reactive 3D tilt for a "tactile" surface (a card, a tile, a
6
+ * floating island). The element rotates toward the cursor and lifts on hover,
7
+ * giving physical, hand-held depth without any per-component motion wiring.
8
+ *
9
+ * Bind the returned handlers to the element and the returned `style` to it (it
10
+ * needs a shared `perspective` on an ANCESTOR — see LpTilt, which supplies one).
11
+ * Rotation eases to rest via CSS transition; the handlers only write the target
12
+ * transform, so there's no rAF loop. SSR-safe (no window access at setup) and
13
+ * collapses to a flat, no-tilt style when the OS prefers reduced motion.
14
+ */
15
+ export interface UseTiltOptions {
16
+ /** Max rotation toward the pointer, in degrees (per axis). Default 10. */
17
+ max?: number
18
+ /** Upward lift on hover, in px. Default 8. */
19
+ lift?: number
20
+ /** Scale on hover. Default 1.03. */
21
+ scale?: number
22
+ /** Glare highlight following the pointer. Default false. */
23
+ glare?: boolean
24
+ }
25
+
26
+ export interface UseTilt {
27
+ /** Bind to the tilting element's style. */
28
+ style: ComputedRef<CSSProperties>
29
+ /** Radial-gradient background for an optional glare overlay (0 when idle). */
30
+ glareStyle: ComputedRef<CSSProperties>
31
+ onPointerMove: (e: PointerEvent) => void
32
+ onPointerEnter: () => void
33
+ onPointerLeave: () => void
34
+ /** True while the pointer is over the element (drives lift/scale). */
35
+ active: Ref<boolean>
36
+ }
37
+
38
+ export function useTilt(options: UseTiltOptions = {}): UseTilt {
39
+ const max = options.max ?? 10
40
+ const lift = options.lift ?? 8
41
+ const scale = options.scale ?? 1.03
42
+ const reduceMotion = useReducedMotion()
43
+
44
+ const active = ref(false)
45
+ // Pointer position within the element, normalized to [-1, 1] from center.
46
+ const nx = ref(0)
47
+ const ny = ref(0)
48
+
49
+ function onPointerMove(e: PointerEvent): void {
50
+ if (reduceMotion.value) return
51
+ const el = e.currentTarget as HTMLElement | null
52
+ if (!el) return
53
+ const r = el.getBoundingClientRect()
54
+ nx.value = ((e.clientX - r.left) / r.width) * 2 - 1
55
+ ny.value = ((e.clientY - r.top) / r.height) * 2 - 1
56
+ }
57
+
58
+ function onPointerEnter(): void {
59
+ active.value = true
60
+ }
61
+
62
+ function onPointerLeave(): void {
63
+ active.value = false
64
+ nx.value = 0
65
+ ny.value = 0
66
+ }
67
+
68
+ const style = computed<CSSProperties>(() => {
69
+ if (reduceMotion.value) {
70
+ return { transition: "transform 0.2s ease" }
71
+ }
72
+ // rotateX tips away from the pointer's vertical position; rotateY toward its
73
+ // horizontal one. Only tilt while active so it rests flat when the pointer
74
+ // leaves (nx/ny are already zeroed on leave).
75
+ const rx = active.value ? -ny.value * max : 0
76
+ const ry = active.value ? nx.value * max : 0
77
+ const z = active.value ? lift : 0
78
+ const s = active.value ? scale : 1
79
+ return {
80
+ transform: `translate3d(0, ${-z}px, 0) rotateX(${rx}deg) rotateY(${ry}deg) scale(${s})`,
81
+ transformStyle: "preserve-3d",
82
+ transition: active.value
83
+ ? "transform 0.12s ease-out"
84
+ : "transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)",
85
+ }
86
+ })
87
+
88
+ const glareStyle = computed<CSSProperties>(() => {
89
+ if (!options.glare || reduceMotion.value || !active.value) {
90
+ return { opacity: 0 }
91
+ }
92
+ // Bright spot tracks the pointer; map [-1,1] → [0%,100%].
93
+ const px = (nx.value + 1) * 50
94
+ const py = (ny.value + 1) * 50
95
+ return {
96
+ opacity: 1,
97
+ background: `radial-gradient(circle at ${px}% ${py}%, rgba(255,255,255,0.35), transparent 55%)`,
98
+ transition: "opacity 0.2s ease",
99
+ }
100
+ })
101
+
102
+ return { style, glareStyle, onPointerMove, onPointerEnter, onPointerLeave, active }
103
+ }
@@ -4,6 +4,8 @@ export type ToastVariant = "info" | "success" | "warning" | "error"
4
4
 
5
5
  export interface ToastAction {
6
6
  label: string
7
+ /** Optional leading icon (any name LpIcon accepts, e.g. "lucide:copy"). */
8
+ icon?: string
7
9
  onClick: () => void | Promise<void>
8
10
  }
9
11
 
package/src/index.ts CHANGED
@@ -72,6 +72,7 @@ export { default as LpTabs } from "./components/LpTabs.vue"
72
72
  export type { TabItem } from "./components/LpTabs.vue"
73
73
  export { default as LpTextarea } from "./components/LpTextarea.vue"
74
74
  export { default as LpThemeSwitcher } from "./components/LpThemeSwitcher.vue"
75
+ export { default as LpTilt } from "./components/LpTilt.vue"
75
76
  export { default as LpToaster } from "./components/LpToaster.vue"
76
77
  export { default as LpTooltip } from "./components/LpTooltip.vue"
77
78
  export { default as LpTopologyCanvas } from "./components/LpTopologyCanvas.vue"
@@ -137,6 +138,8 @@ export type { UiConfig } from "./theme/config"
137
138
 
138
139
  export { useInputFilter } from "./composables/useInputFilter"
139
140
  export type { UseInputFilterOptions } from "./composables/useInputFilter"
141
+ export { useTilt } from "./composables/useTilt"
142
+ export type { UseTilt, UseTiltOptions } from "./composables/useTilt"
140
143
  export { useToast } from "./composables/useToast"
141
144
  export type {
142
145
  ToastAction,
package/src/nuxt.ts CHANGED
@@ -16,7 +16,16 @@ export default defineNuxtModule({
16
16
  meta: { name: "@leavepulse/ui", configKey: "leavepulseUi" },
17
17
  setup() {
18
18
  for (const name of COMPONENT_NAMES) {
19
- addComponent({ name, export: name, filePath: "@leavepulse/ui" })
19
+ // Point each component at its own dist chunk rather than the barrel
20
+ // ("@leavepulse/ui"). Importing through the barrel makes the bundler pull
21
+ // the whole kit; a per-component path lets it ship only the components an
22
+ // app actually uses (plus their real deps — e.g. @vue-flow only when a
23
+ // canvas component is used).
24
+ addComponent({
25
+ name,
26
+ export: "default",
27
+ filePath: `@leavepulse/ui/dist/components/${name}.vue.js`,
28
+ })
20
29
  }
21
30
  },
22
31
  })
package/dist/index.css DELETED
@@ -1 +0,0 @@
1
- .lp-cmd-item[data-v-d845063e]{animation:lp-cmd-in-d845063e .14s ease-out both}@keyframes lp-cmd-in-d845063e{0%{opacity:0;transform:translateY(3px)}}@media(prefers-reduced-motion:reduce){.lp-cmd-item[data-v-d845063e]{animation:none}}