@litelens/design-system 1.0.3

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.
@@ -0,0 +1,55 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+
3
+ interface UseQueryCallback<T = unknown> {
4
+ select?: (data?: T) => T;
5
+ }
6
+
7
+ interface NavItem<T> {
8
+ id: string;
9
+ label: string;
10
+ view?: T;
11
+ }
12
+ interface NavGroup<T> {
13
+ id: string;
14
+ label: string;
15
+ icon: ElementType;
16
+ items: NavItem<T>[];
17
+ }
18
+ type NavEntry<T> = {
19
+ kind: "item";
20
+ icon: ElementType;
21
+ item: NavItem<T>;
22
+ } | {
23
+ kind: "group";
24
+ group: NavGroup<T>;
25
+ };
26
+
27
+ interface SharedNamespaceContext {
28
+ Name: string;
29
+ }
30
+
31
+ type UnifiedTrayCoreFamily = "modification" | "pod";
32
+ type UnifiedTrayAllFamily = UnifiedTrayCoreFamily | (string & {});
33
+ interface SharedUnifiedTrayOpenParams {
34
+ label: string;
35
+ icon?: ReactNode;
36
+ dedupeKey: string;
37
+ [key: string]: unknown;
38
+ }
39
+ interface SharedUnifiedTrayTab {
40
+ family: string;
41
+ id: string;
42
+ label: string;
43
+ icon?: ReactNode;
44
+ params: Record<string, unknown>;
45
+ }
46
+ interface SharedUnifiedTrayContentProps {
47
+ tab: SharedUnifiedTrayTab;
48
+ collapsed: boolean;
49
+ onClose: () => void;
50
+ }
51
+ interface SharedUnifiedTrayContext {
52
+ openTab: (family: UnifiedTrayAllFamily, params: any) => void;
53
+ }
54
+
55
+ export type { NavEntry, NavGroup, NavItem, SharedNamespaceContext, SharedUnifiedTrayContentProps, SharedUnifiedTrayContext, SharedUnifiedTrayOpenParams, SharedUnifiedTrayTab, UnifiedTrayAllFamily, UnifiedTrayCoreFamily, UseQueryCallback };
@@ -0,0 +1 @@
1
+ import '../chunk-TLJXC46A.js';
@@ -0,0 +1,22 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+ declare function clamp(v: number, min: number, max: number): number;
5
+
6
+ /**
7
+ * Format an ISO 8601 datetime string as relative time with full timestamp.
8
+ * Returns a combined string like "4m33s ago (2026-07-12T17:15:18+07:00)".
9
+ *
10
+ * Time formatting rules:
11
+ * - < 1 minute: "45s ago"
12
+ * - 1 min to < 1 hour: "4m33s ago" if seconds > 0, else "5m ago"
13
+ * - 1 hour to < 1 day: "2h15m ago" if minutes > 0, else "3h ago"
14
+ * - >= 1 day: "33d ago" (days only)
15
+ *
16
+ * @param isoString - ISO 8601 datetime string (e.g., "2026-07-12T17:15:18+07:00")
17
+ * @returns Formatted relative time with full timestamp, or empty string if input is invalid
18
+ */
19
+ declare function formatRelativeTime(isoString: string): string;
20
+ declare function formatTs(unix: number): string;
21
+
22
+ export { clamp, cn, formatRelativeTime, formatTs };
@@ -0,0 +1,2 @@
1
+ export { formatRelativeTime, formatTs } from '../chunk-CPX26L4M.js';
2
+ export { clamp, cn } from '../chunk-QUNCRUSO.js';
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@litelens/design-system",
3
+ "version": "1.0.3",
4
+ "description": "Design system components, utilities, and hooks for litelens",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "type": "module",
10
+ "main": "./dist/index.js",
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./atoms": {
20
+ "import": "./dist/atoms/index.js"
21
+ },
22
+ "./components": {
23
+ "import": "./dist/components/index.js"
24
+ },
25
+ "./hooks": {
26
+ "import": "./dist/hooks/index.js"
27
+ },
28
+ "./types": {
29
+ "import": "./dist/types/index.js"
30
+ },
31
+ "./utils": {
32
+ "import": "./dist/utils/index.js"
33
+ },
34
+ "./libs": {
35
+ "import": "./dist/libs/index.js"
36
+ },
37
+ "./styles": {
38
+ "import": "./dist/styles.js"
39
+ },
40
+ "./styles.css": "./dist/style.css"
41
+ },
42
+ "sideEffects": [
43
+ "*.css",
44
+ "./dist/styles.js"
45
+ ],
46
+ "dependencies": {
47
+ "@base-ui/react": "^1.7.0",
48
+ "@fontsource-variable/geist": "^5.3.0",
49
+ "class-variance-authority": "^0.7.1",
50
+ "clsx": "^2.1.1",
51
+ "lucide-react": "^1.28.0",
52
+ "next-themes": "^0.4.6",
53
+ "react-markdown": "^10.1.0",
54
+ "remark-gfm": "^4.0.1",
55
+ "sonner": "^2.0.7",
56
+ "tailwind-merge": "^3.6.0",
57
+ "tw-animate-css": "^1.4.0"
58
+ },
59
+ "peerDependencies": {
60
+ "react": "^19.0.0",
61
+ "react-dom": "^19.0.0",
62
+ "tailwindcss": "^4.0.0"
63
+ },
64
+ "devDependencies": {
65
+ "@testing-library/jest-dom": "^6.9.1",
66
+ "@testing-library/react": "^16.3.2",
67
+ "@types/node": "^26.1.2",
68
+ "@types/react": "^19.2.18",
69
+ "@types/react-dom": "^19.2.4",
70
+ "@vitejs/plugin-react": "^6.0.5",
71
+ "@vitest/coverage-v8": "^4.1.10",
72
+ "cross-env": "^10.1.0",
73
+ "esbuild-visualizer": "^0.7.0",
74
+ "jsdom": "^29.1.1",
75
+ "shadcn": "^4.16.1",
76
+ "tsup": "^8.5.1",
77
+ "typescript": "^6.0.3",
78
+ "vitest": "^4.1.10"
79
+ },
80
+ "scripts": {
81
+ "build": "tsup",
82
+ "build:report": "cross-env ANALYZE=true tsup",
83
+ "test": "vitest run",
84
+ "test:watch": "vitest",
85
+ "test:coverage": "vitest run --coverage",
86
+ "ui:add": "shadcn add"
87
+ }
88
+ }