@leavepulse/ui 0.22.4 → 0.22.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.
@@ -2,7 +2,7 @@ import { defineComponent, computed, watch, openBlock, createElementBlock, create
2
2
  import { _ as _sfc_main$2 } from "./LpButton-5VXXCjwF.js";
3
3
  import { _ as _sfc_main$3 } from "./LpIcon-CCnX5_2j.js";
4
4
  import { _ as _sfc_main$4 } from "./LpScrollArea-D8xyKXcF.js";
5
- import { _ as _sfc_main$1 } from "./LpSidebar-JvMaaYsy.js";
5
+ import { _ as _sfc_main$1 } from "./LpSidebar-D3GGLSE7.js";
6
6
  const _hoisted_1 = { class: "flex h-dvh overflow-hidden bg-surface text-ink" };
7
7
  const _hoisted_2 = { class: "flex min-w-0 flex-1 flex-col" };
8
8
  const _hoisted_3 = { class: "flex h-16 shrink-0 items-center gap-3 border-b border-line bg-surface px-4 md:px-6" };
@@ -19,6 +19,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  brand: "bg-brand-soft text-brand",
20
20
  action: "bg-action/15 text-action",
21
21
  success: "bg-action/15 text-action",
22
+ // Partial trouble, which every status surface eventually needs: without
23
+ // it a half-failed thing has to render as either fine or broken.
24
+ warning: "bg-accent/15 text-accent",
22
25
  danger: "bg-danger-soft text-danger",
23
26
  outline: "border border-line text-ink"
24
27
  }
@@ -21,29 +21,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  __name: "LpInfraNode",
22
22
  props: {
23
23
  data: {},
24
- selected: { type: Boolean }
24
+ selected: { type: Boolean },
25
+ roles: {}
25
26
  },
26
27
  setup(__props) {
27
28
  const props = __props;
28
- const roleVar = {
29
- hypervisor: "var(--color-accent)",
30
- game: "var(--color-action)",
31
- router: "var(--color-muted-strong)",
32
- edge: "var(--color-brand)"
29
+ const DEFAULT_ROLES = {
30
+ compute: { color: "var(--color-node-compute)", icon: "▣" },
31
+ host: { color: "var(--color-node-compute)", icon: "▣" },
32
+ worker: { color: "var(--color-node-compute)", icon: "◱" },
33
+ hypervisor: { color: "var(--color-node-compute)", icon: "▦" },
34
+ game: { color: "var(--color-node-compute)", icon: "◈" },
35
+ storage: { color: "var(--color-node-transit)", icon: "▤" },
36
+ database: { color: "var(--color-node-transit)", icon: "▤" },
37
+ router: { color: "var(--color-node-transit)", icon: "⇄" },
38
+ proxy: { color: "var(--color-node-transit)", icon: "⇅" },
39
+ edge: { color: "var(--color-node-edge)", icon: "☁" },
40
+ public: { color: "var(--color-node-edge)", icon: "◉" }
33
41
  };
34
- const accent = computed(() => roleVar[props.data.role] ?? "var(--color-line-strong)");
35
- const roleIcon = {
36
- hypervisor: "▣",
37
- game: "◈",
38
- router: "⇄",
39
- edge: "☁"
40
- };
41
- const icon = computed(() => roleIcon[props.data.role] ?? "●");
42
+ const UNKNOWN_ROLE = { color: "var(--color-node-unknown)", icon: "●" };
43
+ const role = computed(
44
+ () => ({ ...DEFAULT_ROLES, ...props.roles ?? {} })[props.data.role] ?? UNKNOWN_ROLE
45
+ );
46
+ const accent = computed(() => role.value.color);
47
+ const icon = computed(() => role.value.icon);
48
+ const accentLine = computed(
49
+ () => `color-mix(in srgb, ${accent.value} 35%, var(--color-line))`
50
+ );
42
51
  return (_ctx, _cache) => {
43
52
  return openBlock(), createElementBlock("div", {
44
- class: normalizeClass(["w-[168px] overflow-hidden rounded-card border bg-surface-raised shadow-panel transition-[border-color,box-shadow]", __props.selected ? "border-[var(--accent)]" : "border-line"]),
53
+ class: normalizeClass(["w-[168px] overflow-hidden rounded-card border bg-surface-raised shadow-panel transition-[border-color,box-shadow]", __props.selected ? "border-[var(--accent)]" : "border-[var(--accent-line)]"]),
45
54
  style: normalizeStyle({
46
55
  "--accent": accent.value,
56
+ "--accent-line": accentLine.value,
47
57
  opacity: __props.data.dimmed ? 0.3 : __props.data.online === false ? 0.5 : 1,
48
58
  ...__props.selected ? { boxShadow: "0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-panel)" } : {}
49
59
  })
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, useModel, openBlock, createBlock, withCtx, createElementVNode, toDisplayString, createElementBlock, createCommentVNode, Fragment, renderList, resolveDynamicComponent, normalizeClass, createVNode, createTextVNode, mergeModels } from "vue";
2
- import { _ as _sfc_main$7 } from "./LpBadge-CXzBPnwO.js";
2
+ import { _ as _sfc_main$7 } from "./LpBadge-BPodVcJa.js";
3
3
  import { _ as _sfc_main$6 } from "./LpButton-5VXXCjwF.js";
4
4
  import { _ as _sfc_main$4 } from "./LpContextMenu-D0mzXqA7.js";
5
5
  import { _ as _sfc_main$2 } from "./LpEmptyState-CrfyRJUG.js";
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, useId, openBlock, createElementBlock, Fragment, createElementVNode, mergeProps, normalizeClass, renderSlot, createCommentVNode, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps, createBlock } from "vue";
2
2
  import { _ as _sfc_main$2 } from "./LpDrawer-DAJN5rGK.js";
3
- import { _ as _sfc_main$1 } from "./LpSidebarNav-BIYzk7e_.js";
3
+ import { _ as _sfc_main$1 } from "./LpSidebarNav-X14xMdPa.js";
4
4
  const _hoisted_1 = {
5
5
  key: 1,
6
6
  class: "mt-2 flex shrink-0 flex-col gap-2"
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, Fragment, renderList, createBlock, withCtx, toDisplayString, resolveDynamicComponent, normalizeClass, unref, renderSlot, createTextVNode } from "vue";
2
2
  import { Motion } from "motion-v";
3
3
  import { usePillTransition } from "../composables/usePillTransition.js";
4
- import { _ as _sfc_main$4 } from "./LpBadge-CXzBPnwO.js";
4
+ import { _ as _sfc_main$4 } from "./LpBadge-BPodVcJa.js";
5
5
  import { _ as _sfc_main$2 } from "./LpContextMenu-D0mzXqA7.js";
6
6
  import { _ as _sfc_main$3 } from "./LpIcon-CCnX5_2j.js";
7
7
  import { _ as _sfc_main$1 } from "./LpScrollArea-D8xyKXcF.js";
@@ -3,7 +3,7 @@ import { Background } from "@vue-flow/background";
3
3
  import { Controls } from "@vue-flow/controls";
4
4
  import { MarkerType, useVueFlow, VueFlow, SelectionMode, Panel } from "@vue-flow/core";
5
5
  import { MiniMap } from "@vue-flow/minimap";
6
- import { _ as _sfc_main$3 } from "./LpInfraNode-C_4cyGl9.js";
6
+ import { _ as _sfc_main$3 } from "./LpInfraNode-qIL3l7IO.js";
7
7
  import { _ as _sfc_main$1 } from "./LpLaneNode-HtnQf2FF.js";
8
8
  import { _ as _sfc_main$2 } from "./LpServiceNode-Dc-Ut5RS.js";
9
9
  const _hoisted_1 = { class: "flex flex-col gap-1.5 rounded-card border border-line bg-surface-overlay/90 px-3 py-2 text-[11px] backdrop-blur" };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpAppShell-DGZv907S.js";
1
+ import { _ as _sfc_main } from "../chunks/LpAppShell-D8CAP9oF.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -5,6 +5,7 @@ declare const badge: import('tailwind-variants').TVReturnType<{
5
5
  brand: string;
6
6
  action: string;
7
7
  success: string;
8
+ warning: string;
8
9
  danger: string;
9
10
  outline: string;
10
11
  };
@@ -14,6 +15,7 @@ declare const badge: import('tailwind-variants').TVReturnType<{
14
15
  brand: string;
15
16
  action: string;
16
17
  success: string;
18
+ warning: string;
17
19
  danger: string;
18
20
  outline: string;
19
21
  };
@@ -23,6 +25,7 @@ declare const badge: import('tailwind-variants').TVReturnType<{
23
25
  brand: string;
24
26
  action: string;
25
27
  success: string;
28
+ warning: string;
26
29
  danger: string;
27
30
  outline: string;
28
31
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpBadge-CXzBPnwO.js";
1
+ import { _ as _sfc_main } from "../chunks/LpBadge-BPodVcJa.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -22,7 +22,14 @@ export interface InfraNodeData {
22
22
  type __VLS_Props = {
23
23
  data: InfraNodeData;
24
24
  selected?: boolean;
25
+ /** Extra/overriding role styles, merged over the defaults below. */
26
+ roles?: Record<string, InfraRoleStyle>;
25
27
  };
28
+ export interface InfraRoleStyle {
29
+ /** CSS colour — normally a var() reference, e.g. var(--color-node-edge). */
30
+ color: string;
31
+ icon: string;
32
+ }
26
33
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
27
34
  declare const _default: typeof __VLS_export;
28
35
  export default _default;
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpInfraNode-C_4cyGl9.js";
1
+ import { _ as _sfc_main } from "../chunks/LpInfraNode-qIL3l7IO.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpNotificationBell-HSGo1pcf.js";
1
+ import { _ as _sfc_main } from "../chunks/LpNotificationBell-DWDEkmdA.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpSidebar-JvMaaYsy.js";
1
+ import { _ as _sfc_main } from "../chunks/LpSidebar-D3GGLSE7.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpSidebarNav-BIYzk7e_.js";
1
+ import { _ as _sfc_main } from "../chunks/LpSidebarNav-X14xMdPa.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpTopologyCanvas-74i_pq4e.js";
1
+ import { _ as _sfc_main } from "../chunks/LpTopologyCanvas-BsJWyacK.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
package/dist/index.js CHANGED
@@ -3,10 +3,10 @@ import { _ as _2 } from "./chunks/LpAddressInput-BWuIOt_4.js";
3
3
  import { _ as _3 } from "./chunks/LpMapPicker-DFKrd1Ne.js";
4
4
  import { OSM_TILES, createNominatimProvider, emptyAddress, formatAddress, project, tileUrl, unproject } from "./components/address.js";
5
5
  import { _ as _4 } from "./chunks/LpAlert-BAYHDSS1.js";
6
- import { _ as _5 } from "./chunks/LpAppShell-DGZv907S.js";
6
+ import { _ as _5 } from "./chunks/LpAppShell-D8CAP9oF.js";
7
7
  import { _ as _6 } from "./chunks/LpAutocomplete-DIgXmtCA.js";
8
8
  import { _ as _7 } from "./chunks/LpAvatar-B1Ez0ZAx.js";
9
- import { _ as _8 } from "./chunks/LpBadge-CXzBPnwO.js";
9
+ import { _ as _8 } from "./chunks/LpBadge-BPodVcJa.js";
10
10
  import { _ as _9 } from "./chunks/LpBreadcrumbs-B7Aqatzw.js";
11
11
  import { _ as _10 } from "./chunks/LpButton-5VXXCjwF.js";
12
12
  import { _ as _11 } from "./chunks/LpCalendar-B7ZL0ty3.js";
@@ -26,14 +26,14 @@ import { _ as _23 } from "./chunks/LpFileTree-DWx77B1F.js";
26
26
  import { ancestorIds, checkStateOf, checkedCount, computeStats, fileIcon, formatModified, formatSize, sortNodes, subtreeIds, subtreeSize } from "./components/fileTree.js";
27
27
  import { _ as _24 } from "./chunks/LpFormField-Bn-ZwC6z.js";
28
28
  import { _ as _25 } from "./chunks/LpIcon-CCnX5_2j.js";
29
- import { _ as _26 } from "./chunks/LpInfraNode-C_4cyGl9.js";
29
+ import { _ as _26 } from "./chunks/LpInfraNode-qIL3l7IO.js";
30
30
  import { _ as _27 } from "./chunks/LpInput-BauZRyzm.js";
31
31
  import { _ as _28 } from "./chunks/LpLightbox-Ci35Y_xP.js";
32
32
  import { fileNameOf } from "./components/lightbox.js";
33
33
  import { _ as _29 } from "./chunks/LpLink-DHwOEp4e.js";
34
34
  import { _ as _30 } from "./chunks/LpLogViewer-B1aLUVdz.js";
35
35
  import { _ as _31 } from "./chunks/LpModal-CF7G_0D_.js";
36
- import { _ as _32 } from "./chunks/LpNotificationBell-HSGo1pcf.js";
36
+ import { _ as _32 } from "./chunks/LpNotificationBell-DWDEkmdA.js";
37
37
  import { _ as _33 } from "./chunks/LpNumberField-C5ar-OwE.js";
38
38
  import { _ as _34 } from "./chunks/LpOtpInput-DqaT0Z75.js";
39
39
  import { _ as _35 } from "./chunks/LpPagination-CeGuNe_q.js";
@@ -49,7 +49,7 @@ import { _ as _43 } from "./chunks/LpSegmented-BmpanyAo.js";
49
49
  import { _ as _44 } from "./chunks/LpSelect-D5mU4cZO.js";
50
50
  import { _ as _45 } from "./chunks/LpServiceNode-Dc-Ut5RS.js";
51
51
  import { default as default3 } from "./components/LpShortcutsDialog.vue.js";
52
- import { _ as _46 } from "./chunks/LpSidebar-JvMaaYsy.js";
52
+ import { _ as _46 } from "./chunks/LpSidebar-D3GGLSE7.js";
53
53
  import { _ as _47 } from "./chunks/LpSkeleton-eSFIo4kD.js";
54
54
  import { _ as _48 } from "./chunks/LpSlider-B1SF3pRV.js";
55
55
  import { _ as _49 } from "./chunks/LpStat-CdbEFOvn.js";
@@ -64,7 +64,7 @@ import { D, _ as _56, N, T, b, c, d, e, f, g, i, l, h, j, n, r, t, k, m, u, v }
64
64
  import { _ as _57 } from "./chunks/LpTilt-DuyKbpkA.js";
65
65
  import { _ as _58 } from "./chunks/LpToaster-gDB1EaU3.js";
66
66
  import { _ as _59 } from "./chunks/LpTooltip-D1hbjQWG.js";
67
- import { _ as _60 } from "./chunks/LpTopologyCanvas-74i_pq4e.js";
67
+ import { _ as _60 } from "./chunks/LpTopologyCanvas-BsJWyacK.js";
68
68
  import { _ as _61 } from "./chunks/LpUptimeBar-CB366k0O.js";
69
69
  import { deserializeLayout, serializeLayout } from "./layout/tree.js";
70
70
  import { addLeaf, addTab, countBlocks, countLeaves, makeLayout, moveLeaf, removeBlock, removeLeaf, reorderTab, resizeAt, setActiveTab } from "./layout/tree.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leavepulse/ui",
3
- "version": "0.22.4",
3
+ "version": "0.22.6",
4
4
  "type": "module",
5
5
  "description": "LeavePulse token-driven Vue component kit.",
6
6
  "repository": {
@@ -10,6 +10,9 @@ const badge = tv({
10
10
  brand: "bg-brand-soft text-brand",
11
11
  action: "bg-action/15 text-action",
12
12
  success: "bg-action/15 text-action",
13
+ // Partial trouble, which every status surface eventually needs: without
14
+ // it a half-failed thing has to render as either fine or broken.
15
+ warning: "bg-accent/15 text-accent",
13
16
  danger: "bg-danger-soft text-danger",
14
17
  outline: "border border-line text-ink",
15
18
  },
@@ -33,30 +33,59 @@ export interface InfraNodeData {
33
33
  dimmed?: boolean
34
34
  }
35
35
 
36
- const props = defineProps<{ data: InfraNodeData; selected?: boolean }>()
36
+ const props = defineProps<{
37
+ data: InfraNodeData
38
+ selected?: boolean
39
+ /** Extra/overriding role styles, merged over the defaults below. */
40
+ roles?: Record<string, InfraRoleStyle>
41
+ }>()
37
42
 
38
- const roleVar: Record<string, string> = {
39
- hypervisor: "var(--color-accent)",
40
- game: "var(--color-action)",
41
- router: "var(--color-muted-strong)",
42
- edge: "var(--color-brand)",
43
+ /*
44
+ * Role → look. Colours are token references, never literals, so a theme (or a
45
+ * consumer) restyles the graph without forking this component; the glyph keeps
46
+ * the encoding readable without colour. `roles` overrides or extends the table
47
+ * for a fleet whose vocabulary differs — anything unmapped stays neutral rather
48
+ * than silently borrowing another role's meaning.
49
+ */
50
+ export interface InfraRoleStyle {
51
+ /** CSS colour — normally a var() reference, e.g. var(--color-node-edge). */
52
+ color: string
53
+ icon: string
43
54
  }
44
- const accent = computed(() => roleVar[props.data.role] ?? "var(--color-line-strong)")
45
- const roleIcon: Record<string, string> = {
46
- hypervisor: "▣",
47
- game: "◈",
48
- router: "⇄",
49
- edge: "☁",
55
+ const DEFAULT_ROLES: Record<string, InfraRoleStyle> = {
56
+ compute: { color: "var(--color-node-compute)", icon: "▣" },
57
+ host: { color: "var(--color-node-compute)", icon: "▣" },
58
+ worker: { color: "var(--color-node-compute)", icon: "◱" },
59
+ hypervisor: { color: "var(--color-node-compute)", icon: "▦" },
60
+ game: { color: "var(--color-node-compute)", icon: "◈" },
61
+ storage: { color: "var(--color-node-transit)", icon: "▤" },
62
+ database: { color: "var(--color-node-transit)", icon: "▤" },
63
+ router: { color: "var(--color-node-transit)", icon: "⇄" },
64
+ proxy: { color: "var(--color-node-transit)", icon: "⇅" },
65
+ edge: { color: "var(--color-node-edge)", icon: "☁" },
66
+ public: { color: "var(--color-node-edge)", icon: "◉" },
50
67
  }
51
- const icon = computed(() => roleIcon[props.data.role] ?? "●")
68
+ const UNKNOWN_ROLE: InfraRoleStyle = { color: "var(--color-node-unknown)", icon: "●" }
69
+
70
+ const role = computed<InfraRoleStyle>(
71
+ () => ({ ...DEFAULT_ROLES, ...(props.roles ?? {}) })[props.data.role] ?? UNKNOWN_ROLE,
72
+ )
73
+ const accent = computed(() => role.value.color)
74
+ const icon = computed(() => role.value.icon)
75
+ // A tinted edge rather than a grey one: with only the top stripe carrying the
76
+ // role, a canvas of cards read as one undifferentiated grid.
77
+ const accentLine = computed(
78
+ () => `color-mix(in srgb, ${accent.value} 35%, var(--color-line))`,
79
+ )
52
80
  </script>
53
81
 
54
82
  <template>
55
83
  <div
56
84
  class="w-[168px] overflow-hidden rounded-card border bg-surface-raised shadow-panel transition-[border-color,box-shadow]"
57
- :class="selected ? 'border-[var(--accent)]' : 'border-line'"
85
+ :class="selected ? 'border-[var(--accent)]' : 'border-[var(--accent-line)]'"
58
86
  :style="{
59
87
  '--accent': accent,
88
+ '--accent-line': accentLine,
60
89
  opacity: data.dimmed ? 0.3 : data.online === false ? 0.5 : 1,
61
90
  ...(selected
62
91
  ? { boxShadow: '0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-panel)' }
@@ -46,6 +46,17 @@
46
46
  --color-line-strong: rgba(255, 255, 255, 0.18);
47
47
  --color-ring: rgba(0, 188, 255, 0.45);
48
48
 
49
+ /* ── color: infra roles ──────────────────────────
50
+ What a machine on a topology DOES, in three families: it runs work, it
51
+ carries traffic, or it is the way in from outside. Derived from the palette
52
+ above so a theme gets them for free, and named so a consumer whose fleet
53
+ doesn't split this way can repoint them without forking the component.
54
+ Anything unmapped falls back to --color-node-unknown. */
55
+ --color-node-compute: var(--color-action);
56
+ --color-node-transit: var(--color-accent);
57
+ --color-node-edge: var(--color-brand);
58
+ --color-node-unknown: var(--color-line-strong);
59
+
49
60
  /* ── shape ───────────────────────────────────── */
50
61
  --radius-control: 8px;
51
62
  --radius-card: 14px;