@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,46 @@
1
+ export type UptimeStatus = "operational" | "degraded" | "down" | "maintenance" | "empty";
2
+ export interface UptimeSegment {
3
+ /** Health of this slice. `empty` renders a faded placeholder (no data). */
4
+ status: UptimeStatus;
5
+ /** Optional rich tooltip body; falls back to a humanised status. */
6
+ label?: string;
7
+ }
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
10
+ declare const __VLS_export: import("vue").DefineComponent<{
11
+ /** Oldest → newest. Each entry is one slice of the timeline. */
12
+ segments: UptimeSegment[];
13
+ /** Caption shown under the left edge (oldest point). */
14
+ startLabel?: string;
15
+ /** Caption shown under the right edge (newest point). */
16
+ endLabel?: string;
17
+ /** Show the computed uptime % above the bar. */
18
+ showUptime?: boolean;
19
+ /** Override the headline shown next to the uptime %. */
20
+ title?: string;
21
+ /**
22
+ * Per-status colours. Any CSS colour (hex, rgb, `var(--token)`). Unset
23
+ * statuses fall back to the theme tokens below. Pass e.g.
24
+ * `{ degraded: '#ffb84d' }` to recolour just one state.
25
+ */
26
+ colors?: Partial<Record<UptimeStatus, string>>;
27
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
28
+ /** Oldest → newest. Each entry is one slice of the timeline. */
29
+ segments: UptimeSegment[];
30
+ /** Caption shown under the left edge (oldest point). */
31
+ startLabel?: string;
32
+ /** Caption shown under the right edge (newest point). */
33
+ endLabel?: string;
34
+ /** Show the computed uptime % above the bar. */
35
+ showUptime?: boolean;
36
+ /** Override the headline shown next to the uptime %. */
37
+ title?: string;
38
+ /**
39
+ * Per-status colours. Any CSS colour (hex, rgb, `var(--token)`). Unset
40
+ * statuses fall back to the theme tokens below. Pass e.g.
41
+ * `{ degraded: '#ffb84d' }` to recolour just one state.
42
+ */
43
+ colors?: Partial<Record<UptimeStatus, string>>;
44
+ }> & Readonly<{}>, {
45
+ showUptime: boolean;
46
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * An edge that curves THROUGH a list of waypoints.
3
+ *
4
+ * The built-in shapes each fail one way in a layered graph: a bezier bulges off
5
+ * the line between its ends and cuts through whatever stands between the
6
+ * columns, and orthogonal routing clears the cards but draws the graph as a
7
+ * grid of right angles. Given the gaps a layout already knows about, a curve
8
+ * threaded through them is both — clear of the cards and still a curve.
9
+ *
10
+ * Waypoints ride on the edge's `data.waypoints`; with none, this is a plain
11
+ * bezier, so the type is safe to use for every edge in a graph.
12
+ */
13
+ import { Position } from "@vue-flow/core";
14
+ type __VLS_Props = {
15
+ id: string;
16
+ sourceX: number;
17
+ sourceY: number;
18
+ targetX: number;
19
+ targetY: number;
20
+ sourcePosition?: Position;
21
+ targetPosition?: Position;
22
+ data?: {
23
+ waypoints?: {
24
+ x: number;
25
+ y: number;
26
+ }[];
27
+ };
28
+ markerEnd?: string;
29
+ style?: Record<string, unknown>;
30
+ };
31
+ 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>;
32
+ declare const _default: typeof __VLS_export;
33
+ export default _default;
@@ -0,0 +1,19 @@
1
+ export interface BarEntry {
2
+ id: number;
3
+ /** Measured height in px, reported by the bar once it is on screen. */
4
+ height: number;
5
+ }
6
+ /** Gap between stacked bars, matching the padding the bar sits in. */
7
+ export declare const STACK_GAP = 8;
8
+ /**
9
+ * Registers a bar for as long as the calling scope lives. `setHeight` reports
10
+ * the measured height; `offset()` returns how far up this bar should sit —
11
+ * the total height of every bar that opened before it.
12
+ */
13
+ export declare function useBarStack(): {
14
+ register: () => void;
15
+ unregister: () => void;
16
+ setHeight: (height: number) => void;
17
+ offset: () => number;
18
+ bars: import("vue").Ref<BarEntry[] | undefined, BarEntry[] | undefined>;
19
+ };
@@ -0,0 +1,107 @@
1
+ export interface LatLon {
2
+ lat: number;
3
+ lon: number;
4
+ }
5
+ export interface AddressValue {
6
+ /** Street and house number, e.g. "Baker Street 221B". */
7
+ line: string;
8
+ /** Apartment, suite, floor — only shown when LpAddressInput asks for it. */
9
+ line2?: string;
10
+ city: string;
11
+ postalCode: string;
12
+ /** ISO 3166-1 alpha-2, uppercase — same shape LpPhoneInput uses. */
13
+ country: string;
14
+ /** Set once a point is picked on the map or a suggestion carries one. */
15
+ lat?: number;
16
+ lon?: number;
17
+ }
18
+ export declare function emptyAddress(): AddressValue;
19
+ export interface AddressSuggestion {
20
+ /** Text to put in the field that asked for it. */
21
+ value: string;
22
+ label: string;
23
+ /** Fuller context — the whole formatted address, shown under the label. */
24
+ description?: string;
25
+ /** Parsed parts, as much as the provider resolved. */
26
+ address: Partial<AddressValue>;
27
+ lat?: number;
28
+ lon?: number;
29
+ }
30
+ /** Which field is being completed — providers can bias results accordingly. */
31
+ export type AddressField = "line" | "city" | "postalCode";
32
+ export interface GeocodeQuery {
33
+ /** Restrict to a country (ISO2) when the form already has one. */
34
+ country?: string;
35
+ /** Preferred result language, as an Accept-Language value. */
36
+ language?: string;
37
+ limit?: number;
38
+ signal?: AbortSignal;
39
+ }
40
+ export interface GeocodeProvider {
41
+ search(term: string, field: AddressField, query?: GeocodeQuery): Promise<AddressSuggestion[]>;
42
+ /** Point → address. Undefined when the point resolves to nothing. */
43
+ reverse(lat: number, lon: number, query?: GeocodeQuery): Promise<AddressSuggestion | undefined>;
44
+ }
45
+ export interface NominatimOptions {
46
+ /** Base URL of a Nominatim instance, no trailing slash. */
47
+ endpoint?: string;
48
+ language?: string;
49
+ /**
50
+ * Public Nominatim asks for an identifying UA and rate-limits hard; browsers
51
+ * won't let us set User-Agent, so this rides along as `email` instead, which
52
+ * their usage policy accepts. Point `endpoint` at your own instance for
53
+ * anything busier than a settings form.
54
+ */
55
+ email?: string;
56
+ }
57
+ export declare function createNominatimProvider(options?: NominatimOptions): GeocodeProvider;
58
+ /**
59
+ * Every user-facing string in LpAddressInput, so an app can translate it
60
+ * without the kit taking an i18n dependency. Pass a partial — anything absent
61
+ * keeps the English default.
62
+ */
63
+ export interface AddressLabels {
64
+ line: string;
65
+ linePlaceholder: string;
66
+ secondLine: string;
67
+ secondLinePlaceholder: string;
68
+ city: string;
69
+ cityPlaceholder: string;
70
+ postalCode: string;
71
+ postalCodePlaceholder: string;
72
+ country: string;
73
+ countryPlaceholder: string;
74
+ countrySearch: string;
75
+ pickOnMap: string;
76
+ mapTitle: string;
77
+ mapHint: string;
78
+ use: string;
79
+ cancel: string;
80
+ searching: string;
81
+ noSuggestions: string;
82
+ nothingHere: string;
83
+ }
84
+ /** Formats an address the way a shipping label would read. */
85
+ export declare function formatAddress(value: AddressValue, countryName?: string): string;
86
+ export interface TileSource {
87
+ /** Template with {z}/{x}/{y}, plus optional {s} for a subdomain. */
88
+ url: string;
89
+ /** Rendered under the map — most tile terms require crediting the source. */
90
+ attribution?: string;
91
+ subdomains?: string[];
92
+ minZoom?: number;
93
+ maxZoom?: number;
94
+ /** Edge length of one tile in CSS pixels. Default 256. */
95
+ tileSize?: number;
96
+ }
97
+ export declare const OSM_TILES: TileSource;
98
+ export declare function tileUrl(source: TileSource, z: number, x: number, y: number): string;
99
+ export declare const MAX_LATITUDE = 85.05112878;
100
+ export declare function project(lat: number, lon: number, zoom: number, tileSize?: number): {
101
+ x: number;
102
+ y: number;
103
+ };
104
+ export declare function unproject(x: number, y: number, zoom: number, tileSize?: number): {
105
+ lat: number;
106
+ lon: number;
107
+ };
@@ -0,0 +1,180 @@
1
+ export interface ChartPoint {
2
+ /** Numeric value. `null` breaks the line — a real gap, not a zero. */
3
+ y: number | null;
4
+ /** Optional label for this point; falls back to the shared `labels` prop. */
5
+ x?: string;
6
+ }
7
+ export interface ChartSeries {
8
+ name: string;
9
+ /** Bare numbers are accepted and normalised to points. */
10
+ data: (number | null | ChartPoint)[];
11
+ /** Any CSS colour. Unset series cycle through the palette. */
12
+ color?: string;
13
+ /** Draw this series as a dashed line (targets, budgets, forecasts). */
14
+ dashed?: boolean;
15
+ /**
16
+ * Which y-axis this series is measured against. A series in different units
17
+ * or of a wildly different magnitude (errors beside requests, a rate beside a
18
+ * count) flattens against a shared axis; putting it on `"right"` gives it its
19
+ * own scale and its own ticks.
20
+ */
21
+ axis?: "left" | "right";
22
+ }
23
+ export type ChartAxis = "left" | "right";
24
+ export interface NormalSeries {
25
+ name: string;
26
+ color: string;
27
+ dashed: boolean;
28
+ axis: ChartAxis;
29
+ values: (number | null)[];
30
+ }
31
+ export interface Box {
32
+ width: number;
33
+ height: number;
34
+ left: number;
35
+ right: number;
36
+ top: number;
37
+ bottom: number;
38
+ }
39
+ /** Plot area inside the padding — where marks may actually be drawn. */
40
+ export declare const plotWidth: (b: Box) => number;
41
+ export declare const plotHeight: (b: Box) => number;
42
+ /** Series colours cycle through the theme's semantic palette. */
43
+ export declare const CHART_PALETTE: string[];
44
+ export declare const normalise: (series: ChartSeries[]) => NormalSeries[];
45
+ /** Point labels win over the shared axis labels; index is the last resort. */
46
+ export declare const resolveLabels: (series: ChartSeries[], labels: string[] | undefined, count: number) => string[];
47
+ /** Longest series wins; shorter ones simply stop early. */
48
+ export declare const pointCount: (series: NormalSeries[]) => number;
49
+ /**
50
+ * "Nice" axis bounds: round the extent out to a human step (1/2/5 × 10ⁿ) so
51
+ * ticks land on readable numbers instead of 0.37, 1.24, 2.11.
52
+ */
53
+ export declare const niceScale: (min: number, max: number, ticks: number) => {
54
+ min: number;
55
+ max: number;
56
+ step: number;
57
+ };
58
+ export declare const axisTicks: (min: number, max: number, step: number) => number[];
59
+ /** Extent across every visible series, with zero pulled in when asked. */
60
+ export declare const extent: (series: NormalSeries[], includeZero: boolean) => {
61
+ min: number;
62
+ max: number;
63
+ };
64
+ /** x pixel for point i. Bars sit at band centres, lines span edge to edge. */
65
+ export declare const xAt: (i: number, count: number, box: Box, banded: boolean) => number;
66
+ export declare const yAt: (v: number, min: number, max: number, box: Box) => number;
67
+ interface Scale {
68
+ min: number;
69
+ max: number;
70
+ box: Box;
71
+ count: number;
72
+ banded: boolean;
73
+ }
74
+ export declare const linePath: (values: (number | null)[], s: Scale, smooth: number) => string;
75
+ /** The line closed down to the baseline — one filled shape per unbroken run. */
76
+ export declare const areaPath: (values: (number | null)[], s: Scale, smooth: number) => string;
77
+ /** Nearest point index for a pixel x — what the hover crosshair snaps to. */
78
+ export declare const nearestIndex: (px: number, s: Scale) => number;
79
+ /**
80
+ * A bar as a path, rounded only on the corners named. A stack is one shape cut
81
+ * into segments: rounding every segment would bevel the internal joins and read
82
+ * as separate tiles rather than as one bar, so only the outermost segment of a
83
+ * stack rounds, and only on the end it actually terminates.
84
+ *
85
+ * `r` is clamped to half the box so a short segment degrades to a slab instead
86
+ * of inverting its own corners.
87
+ */
88
+ export declare const barPath: (x: number, y: number, w: number, h: number, r: number, round: {
89
+ top: boolean;
90
+ bottom: boolean;
91
+ }) => string;
92
+ export interface PieSlice {
93
+ label: string;
94
+ value: number;
95
+ /** Any CSS colour. Unset slices cycle through the palette. */
96
+ color?: string;
97
+ }
98
+ export interface ResolvedSlice {
99
+ label: string;
100
+ value: number;
101
+ color: string;
102
+ /** 0–1 of the total. */
103
+ fraction: number;
104
+ /** True for the synthesised remainder slice. */
105
+ isOther: boolean;
106
+ /** How many input slices this one stands for (1, or N when collapsed). */
107
+ count: number;
108
+ }
109
+ /**
110
+ * Fold an arbitrary number of slices down to something a circle can actually
111
+ * show, WITHOUT dropping data.
112
+ *
113
+ * A pie is only legible while its slices are distinguishable by angle; past a
114
+ * handful they become slivers no one can compare or click. But a shared kit
115
+ * can't know how many categories a caller has, so refusing to draw twenty is
116
+ * not an option either. So: keep the largest `max - 1` and sum the rest into a
117
+ * single "Other" slice that keeps its own total, its own share, and a count of
118
+ * what it stands for — the tail stays visible and addressable instead of being
119
+ * silently truncated.
120
+ *
121
+ * Negative values are dropped: a share of a whole has no meaning below zero,
122
+ * and letting one in makes every other slice's fraction wrong.
123
+ */
124
+ export declare const resolveSlices: (slices: PieSlice[], max: number | undefined, otherLabel: string,
125
+ /**
126
+ * Keep the caller's ordering for the slices that survive. Ranking decides
127
+ * WHICH slices are kept; it needn't decide the order they're shown in, and a
128
+ * caller that ordered its data deliberately ("Free" last, states worst-first)
129
+ * would see that shuffled for no reason. "Other" always sorts last.
130
+ */
131
+ preserveOrder?: boolean) => {
132
+ slices: ResolvedSlice[];
133
+ total: number;
134
+ };
135
+ /**
136
+ * One slice as a path. `inner > 0` makes it a donut segment (an annulus) rather
137
+ * than a wedge from the centre.
138
+ *
139
+ * A slice covering the whole circle is drawn as two half-arcs: a single arc
140
+ * whose start and end coincide is a zero-length path, so "100% of one category"
141
+ * would render as nothing at all.
142
+ */
143
+ export declare const arcPath: (cx: number, cy: number, outer: number, inner: number, startAngle: number, endAngle: number,
144
+ /** Corner radius in px, clamped to what the slice can actually carry. */
145
+ corner?: number) => string;
146
+ export interface CalloutLabel {
147
+ index: number;
148
+ /** Which side of the circle the label sits on. */
149
+ side: "left" | "right";
150
+ /** Elbow polyline: leader out of the slice, a bend, then a run to the text. */
151
+ points: string;
152
+ /** Where the text is anchored. */
153
+ x: number;
154
+ y: number;
155
+ }
156
+ /**
157
+ * Lay out callout labels around a circle: a leader line leaves each slice along
158
+ * its own bisector, bends, and runs horizontally to text stacked down the side.
159
+ *
160
+ * The whole difficulty is collision. Slices cluster — twenty versions of a
161
+ * server jar are mostly slivers packed into one arc — so labels placed at their
162
+ * natural angles would land on top of each other. Each side is therefore
163
+ * relaxed independently: labels keep their order around the circle, then get
164
+ * pushed apart to a minimum spacing and shifted back inside the box. That's why
165
+ * a leader can end well away from its slice's angle and still be unambiguous —
166
+ * the line, not the position, is what identifies it.
167
+ */
168
+ export declare const calloutLabels: (angles: {
169
+ index: number;
170
+ mid: number;
171
+ }[], cx: number, cy: number, radius: number,
172
+ /** How far past the radius the elbow sits. */
173
+ elbow: number,
174
+ /** Horizontal run from the elbow to the text. */
175
+ run: number,
176
+ /** Minimum vertical gap between two labels on the same side. */
177
+ spacing: number, height: number) => CalloutLabel[];
178
+ /** Compact default tick formatting: 1.2k, 3.4M — never 1200.0000001. */
179
+ export declare const formatTick: (v: number) => string;
180
+ export {};
@@ -0,0 +1,8 @@
1
+ export type CodeLang = "ts" | "js" | "json" | "bash" | "html" | "python" | "rust" | "yaml" | "toml" | "kotlin" | "java" | "groovy" | "plain";
2
+ export interface Token {
3
+ text: string;
4
+ /** CSS class for this token, or "" for plain text. */
5
+ cls: string;
6
+ }
7
+ /** Tokenize one line into coloured spans. JSON keys get the property colour. */
8
+ export declare function tokenizeLine(line: string, lang: CodeLang): Token[];
@@ -0,0 +1,65 @@
1
+ /** Hue 0..360, saturation/value 0..1, alpha 0..1. */
2
+ export interface Hsv {
3
+ h: number;
4
+ s: number;
5
+ v: number;
6
+ a: number;
7
+ }
8
+ /** Channels 0..255, alpha 0..1. */
9
+ export interface Rgb {
10
+ r: number;
11
+ g: number;
12
+ b: number;
13
+ a: number;
14
+ }
15
+ /** The string shapes a caller can hand the picker, and ask back out of it. */
16
+ export type ColorFormat = "hex" | "rgb" | "hsl";
17
+ /** Wraps rather than clamps: hue is a circle, and 370° is 10°, not 360°. */
18
+ export declare function normalizeHue(h: number): number;
19
+ export declare function clampHsv(c: Hsv): Hsv;
20
+ export declare function hsvToRgb({ h, s, v, a }: Hsv): Rgb;
21
+ export declare function rgbToHsv({ r, g, b, a }: Rgb): Hsv;
22
+ /** "#rrggbb", or "#rrggbbaa" when the colour is not fully opaque. */
23
+ export declare function rgbToHex({ r, g, b, a }: Rgb): string;
24
+ /**
25
+ * Parses #rgb / #rgba / #rrggbb / #rrggbbaa, with or without the leading `#`.
26
+ * Returns null for anything it doesn't recognise, so a half-typed value in the
27
+ * hex field can be left alone instead of snapping the picker to black.
28
+ */
29
+ export declare function parseHex(input: string): Rgb | null;
30
+ /**
31
+ * Parses a colour a person might paste: hex (3/4/6/8 digits, `#` optional),
32
+ * rgb()/rgba() and hsl()/hsla() in both the comma and the space/slash forms,
33
+ * percentages, hue in deg/turn/rad/grad, brackets optional, and a bare triple
34
+ * of numbers read as rgb. A round-trip through a caller's storage therefore
35
+ * comes back the colour it went in as, whatever shape it was stored in.
36
+ *
37
+ * Named colours ("rebeccapurple") and the newer spaces (lab, oklch, color())
38
+ * are out of scope: resolving those needs the browser's own parser, and a
39
+ * component that silently handled some and not others would be worse than one
40
+ * that is clear about what it takes.
41
+ */
42
+ export declare function parseColor(input: string): Rgb | null;
43
+ /** HSV→HSL, for the hsl() output format. Saturation/lightness come back 0..1. */
44
+ export declare function hsvToHsl({ h, s, v }: Hsv): {
45
+ h: number;
46
+ s: number;
47
+ l: number;
48
+ };
49
+ /** The colour as a CSS string in the requested format. */
50
+ export declare function formatColor(c: Hsv, format: ColorFormat): string;
51
+ /** Always opaque — for the swatch behind an alpha checkerboard, and for rails. */
52
+ export declare function opaqueCss(c: Hsv): string;
53
+ /**
54
+ * Whether dark ink reads better than light on this colour, by WCAG relative
55
+ * luminance. The picker uses it for the check mark on a selected swatch, which
56
+ * otherwise disappears into a pale preset.
57
+ */
58
+ export declare function isLight(c: Hsv): boolean;
59
+ /**
60
+ * A neutral starting palette. Kit tokens are deliberately NOT used here: these
61
+ * are values a user picks *for their own data* (a tag, a calendar category),
62
+ * which must stay put when the app's theme changes — a preset that shifted with
63
+ * the theme would silently restyle everything already saved with it.
64
+ */
65
+ export declare const DEFAULT_SWATCHES: readonly ["#ef4444", "#f97316", "#f59e0b", "#22c55e", "#10b981", "#06b6d4", "#3b82f6", "#6366f1", "#8b5cf6", "#ec4899", "#64748b", "#111827"];
@@ -0,0 +1,13 @@
1
+ export interface SearchableCommand {
2
+ label: string;
3
+ description?: string;
4
+ keywords?: string[];
5
+ group?: string;
6
+ }
7
+ export interface CommandSearchTerms {
8
+ include: string[];
9
+ exclude: string[];
10
+ groups: string[];
11
+ }
12
+ export declare function parseCommandQuery(value: string): CommandSearchTerms;
13
+ export declare function rankCommandItems<T extends SearchableCommand>(items: T[], terms: CommandSearchTerms): T[];
@@ -1,11 +1,4 @@
1
1
  const QUERY_TOKEN = /(-?)(?:(in):)?(?:"([^"]*)"|(\S+))/giu;
2
- const LATIN = "qwertyuiop[]asdfghjkl;'zxcvbnm,.`";
3
- const CYRILLIC = "йцукенгшщзхъфывапролджэячсмитьбюё";
4
- const SWAP = /* @__PURE__ */ new Map();
5
- for (let i = 0; i < LATIN.length; i++) {
6
- SWAP.set(LATIN[i], CYRILLIC[i]);
7
- SWAP.set(CYRILLIC[i], LATIN[i]);
8
- }
9
2
  function parseCommandQuery(value) {
10
3
  const out = { include: [], exclude: [], groups: [] };
11
4
  QUERY_TOKEN.lastIndex = 0;
@@ -18,14 +11,6 @@ function parseCommandQuery(value) {
18
11
  }
19
12
  return out;
20
13
  }
21
- function swapCommandTerms(terms) {
22
- const swap = (term) => [...term].map((ch) => SWAP.get(ch) ?? ch).join("");
23
- return {
24
- include: terms.include.map(swap),
25
- exclude: terms.exclude.map(swap),
26
- groups: terms.groups.map(swap)
27
- };
28
- }
29
14
  function matches(command, term) {
30
15
  return command.label.toLowerCase().includes(term) || (command.keywords ?? []).some((keyword) => keyword.toLowerCase().includes(term)) || (command.description?.toLowerCase().includes(term) ?? false);
31
16
  }
@@ -61,6 +46,5 @@ function rankCommandItems(items, terms) {
61
46
  }
62
47
  export {
63
48
  parseCommandQuery,
64
- rankCommandItems,
65
- swapCommandTerms
49
+ rankCommandItems
66
50
  };
@@ -0,0 +1,2 @@
1
+ import type { Country } from "./countries";
2
+ export declare const COUNTRIES: Country[];
@@ -0,0 +1,20 @@
1
+ export interface Country {
2
+ /** ISO 3166-1 alpha-2, uppercase (e.g. "US"). Drives the flag. */
3
+ iso2: string;
4
+ name: string;
5
+ /** Calling code without "+", e.g. "1", "44", "380". */
6
+ dial: string;
7
+ }
8
+ /** Turn an ISO2 code into its flag emoji (two regional-indicator symbols). */
9
+ export declare function flagEmoji(iso2: string): string;
10
+ /**
11
+ * Load the country table (code-split chunk). Cached after first call, so repeat
12
+ * calls are synchronous-ish (resolved promise) with no re-import cost.
13
+ */
14
+ export declare function loadCountries(): Promise<Country[]>;
15
+ /**
16
+ * Best-effort: pick the country whose dial code prefixes the given E.164-ish
17
+ * value (longest match wins, so "1868" beats "1"). For shared codes the primary
18
+ * country is preferred. Pass the list (from loadCountries). Undefined if none.
19
+ */
20
+ export declare function matchCountryByValue(value: string, list: Country[]): Country | undefined;
@@ -0,0 +1,29 @@
1
+ /** Enter/exit animation for state-open panels (Select, Popover, Dropdown, …). */
2
+ export declare const POPOVER_ANIM: string;
3
+ /** Tooltip variant: faster, and reka uses `delayed-open` instead of `open`. */
4
+ export declare const TOOLTIP_ANIM: string;
5
+ /**
6
+ * The bare floating surface (border, raised overlay fill, blur, shadow) without
7
+ * any animation — pair with POPOVER_ANIM or TOOLTIP_ANIM. `group` lets option
8
+ * rows read the panel's data-side for the cascade direction.
9
+ */
10
+ export declare const PANEL_SURFACE = "group rounded-control border border-line bg-surface-overlay shadow-panel backdrop-blur";
11
+ /**
12
+ * Surface + the state-open animation. Add width/padding/overflow and the z-layer
13
+ * at the call-site (z-layer omitted so tooltips can use z-(--z-tooltip) while the
14
+ * rest use z-(--z-popover)).
15
+ */
16
+ export declare const POPOVER_PANEL: string;
17
+ /**
18
+ * A selectable option row: layout, highlight state, and the staggered cascade.
19
+ * Cascades downward by default and upward when the panel is flipped above the
20
+ * trigger (group-data-[side=top]). Pair with an inline animationDelay for the
21
+ * stagger. `flex` + gap are included; add justify/extra layout if needed.
22
+ */
23
+ export declare const OPTION_ITEM: string;
24
+ /**
25
+ * Micro-animation for a close / clear "✕" icon: a quarter-turn on hover and a
26
+ * dip on press. Put on the <LpIcon>, with `group` on its button. Shared by
27
+ * Modal, Drawer, Toaster and the Autocomplete clear button.
28
+ */
29
+ export declare const CLOSE_ICON: string;
@@ -0,0 +1,79 @@
1
+ import type { ContextMenuItemDef } from "./LpContextMenu.vue";
2
+ export interface FileNode {
3
+ /** Stable identity — use the full path when you have one. */
4
+ id: string;
5
+ name: string;
6
+ /** Directories can hold `children`; files are leaves. */
7
+ kind: "file" | "dir";
8
+ /** Size in bytes. Shown right-aligned when `showSize` is on. */
9
+ size?: number;
10
+ /** Last-modified time — Date, epoch ms, or a pre-formatted string. */
11
+ modified?: Date | number | string;
12
+ /** Extra right-aligned text (badge-ish), e.g. "read-only". */
13
+ meta?: string;
14
+ /**
15
+ * Omit on a directory to mark its children as not-yet-loaded: the row shows a
16
+ * chevron and emits `expand` on first open so the caller can fetch them.
17
+ * An empty array means "loaded, and genuinely empty".
18
+ */
19
+ children?: FileNode[];
20
+ /** Override the type-derived icon. */
21
+ icon?: string;
22
+ /** Dimmed row (e.g. a git-ignored or unreadable entry). Still expandable. */
23
+ disabled?: boolean;
24
+ /** Right-click menu for this entry. */
25
+ menu?: ContextMenuItemDef[];
26
+ }
27
+ /** Icon for a node: explicit override → dir state → name → extension → generic. */
28
+ export declare function fileIcon(node: FileNode, expanded?: boolean): string;
29
+ /** Directories first, then case-insensitive by name — the file-manager order. */
30
+ export declare function sortNodes(nodes: FileNode[]): FileNode[];
31
+ /** Human-readable byte size — binary units, matching what file managers show. */
32
+ export declare function formatSize(bytes: number): string;
33
+ /** Short local date-time for the modified column; passes strings through. */
34
+ export declare function formatModified(value: Date | number | string): string;
35
+ /**
36
+ * Total size of a subtree: a directory's own `size` when the caller computed one
37
+ * (the common case for a server-side listing), otherwise the sum of its loaded
38
+ * descendants. Returns undefined when nothing along the way carries a size.
39
+ */
40
+ export declare function subtreeSize(node: FileNode): number | undefined;
41
+ /** Every id in a subtree including the root — the unit a checkbox toggles. */
42
+ export declare function subtreeIds(node: FileNode): string[];
43
+ export type CheckState = "checked" | "unchecked" | "indeterminate";
44
+ /**
45
+ * A node's checkbox state derived from the checked-id set.
46
+ *
47
+ * A directory reflects its loaded children: all checked → checked, some →
48
+ * indeterminate. A directory whose children aren't loaded yet (or which has
49
+ * none) falls back to its own membership, so an unexpanded folder can still be
50
+ * ticked as a whole — which is exactly what a backup picker needs.
51
+ */
52
+ export declare function checkStateOf(node: FileNode, checked: ReadonlySet<string>): CheckState;
53
+ /**
54
+ * How much of a directory's subtree is ticked, counting FILES only (folders are
55
+ * containers, not payload). Lets a row say "3 / 12" so a half-filled checkbox
56
+ * isn't the only clue that a folder is partially selected.
57
+ */
58
+ export declare function checkedCount(node: FileNode, checked: ReadonlySet<string>): {
59
+ checked: number;
60
+ total: number;
61
+ };
62
+ /** Everything a row needs to render, precomputed once per node. */
63
+ export interface NodeStats {
64
+ state: CheckState;
65
+ /** Ticked files in the subtree, and how many there are in total. */
66
+ checked: number;
67
+ total: number;
68
+ /** Rolled-up subtree size, or undefined when nothing carries one. */
69
+ size?: number;
70
+ }
71
+ /**
72
+ * Derive every row's state in ONE post-order pass over the tree, keyed by node
73
+ * id. Calling `checkStateOf`/`subtreeSize`/`checkedCount` per row instead makes
74
+ * each row walk its own subtree, which is quadratic on a deep tree and shows up
75
+ * as a stutter the moment a directory holds a few thousand files.
76
+ */
77
+ export declare function computeStats(nodes: FileNode[], checked: ReadonlySet<string>): Map<string, NodeStats>;
78
+ /** Ids of every ancestor directory of `id`, so callers can reveal a deep node. */
79
+ export declare function ancestorIds(nodes: FileNode[], id: string): string[];
@@ -0,0 +1,24 @@
1
+ export interface LightboxItem {
2
+ /** Full-size source. */
3
+ src: string;
4
+ /** Smaller source for the filmstrip; falls back to `src`. */
5
+ thumb?: string;
6
+ /** Caption under the image, and the img alt text. */
7
+ title?: string;
8
+ /** Secondary line under the title (size, date, resolution…). */
9
+ description?: string;
10
+ /** Filename used when downloading; derived from `src` when absent. */
11
+ filename?: string;
12
+ /**
13
+ * Hide this image behind a cover until someone asks for it — a spoiler, a
14
+ * screenshot of something not everyone in the channel has reached yet, a
15
+ * picture that should not appear in a scroll past.
16
+ *
17
+ * A property of the ITEM rather than of the grid showing it: which images are
18
+ * spoilers is a fact about the images, and the usual set is a mixed one, with
19
+ * a marked picture sitting beside plain ones.
20
+ */
21
+ spoiler?: boolean;
22
+ }
23
+ /** Last path segment of a URL, or a fallback — used to name a download. */
24
+ export declare function fileNameOf(item: LightboxItem, fallback?: string): string;