@startsimpli/ui 0.1.4 → 0.1.5
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.
- package/package.json +10 -32
- package/dist/chunk-6SXB6YDH.mjs +0 -62
- package/dist/chunk-6SXB6YDH.mjs.map +0 -1
- package/dist/chunk-FAPOEVMI.mjs +0 -3954
- package/dist/chunk-FAPOEVMI.mjs.map +0 -1
- package/dist/chunk-HDLZZ7IW.mjs +0 -210
- package/dist/chunk-HDLZZ7IW.mjs.map +0 -1
- package/dist/chunk-KKNZP334.mjs +0 -1026
- package/dist/chunk-KKNZP334.mjs.map +0 -1
- package/dist/chunk-NIL3JVRZ.mjs +0 -35
- package/dist/chunk-NIL3JVRZ.mjs.map +0 -1
- package/dist/components/index.d.mts +0 -472
- package/dist/components/index.d.ts +0 -472
- package/dist/components/index.js +0 -5148
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs +0 -6
- package/dist/components/index.mjs.map +0 -1
- package/dist/components/unified-table/index.d.mts +0 -725
- package/dist/components/unified-table/index.d.ts +0 -725
- package/dist/components/unified-table/index.js +0 -3999
- package/dist/components/unified-table/index.js.map +0 -1
- package/dist/components/unified-table/index.mjs +0 -5
- package/dist/components/unified-table/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -26
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -5448
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -12
- package/dist/index.mjs.map +0 -1
- package/dist/theme/index.d.mts +0 -20
- package/dist/theme/index.d.ts +0 -20
- package/dist/theme/index.js +0 -245
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs +0 -9
- package/dist/theme/index.mjs.map +0 -1
- package/dist/utils/index.d.mts +0 -38
- package/dist/utils/index.d.ts +0 -38
- package/dist/utils/index.js +0 -71
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs +0 -4
- package/dist/utils/index.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,43 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startsimpli/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Shared UI components package for StartSimpli applications",
|
|
5
|
-
"main": "./
|
|
6
|
-
"types": "./
|
|
5
|
+
"main": "./src/index.ts",
|
|
6
|
+
"types": "./src/index.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
".":
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"./table": {
|
|
14
|
-
"types": "./dist/components/unified-table/index.d.ts",
|
|
15
|
-
"import": "./dist/components/unified-table/index.mjs",
|
|
16
|
-
"require": "./dist/components/unified-table/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./components": {
|
|
19
|
-
"types": "./dist/components/index.d.ts",
|
|
20
|
-
"import": "./dist/components/index.mjs",
|
|
21
|
-
"require": "./dist/components/index.js"
|
|
22
|
-
},
|
|
23
|
-
"./utils": {
|
|
24
|
-
"types": "./dist/utils/index.d.ts",
|
|
25
|
-
"import": "./dist/utils/index.mjs",
|
|
26
|
-
"require": "./dist/utils/index.js"
|
|
27
|
-
},
|
|
28
|
-
"./theme": {
|
|
29
|
-
"types": "./dist/theme/index.d.ts",
|
|
30
|
-
"import": "./dist/theme/index.mjs",
|
|
31
|
-
"require": "./dist/theme/index.js"
|
|
32
|
-
},
|
|
8
|
+
".": "./src/index.ts",
|
|
9
|
+
"./table": "./src/components/unified-table/index.ts",
|
|
10
|
+
"./components": "./src/components/index.ts",
|
|
11
|
+
"./utils": "./src/utils/index.ts",
|
|
12
|
+
"./theme": "./src/theme/index.ts",
|
|
33
13
|
"./theme/contract": "./theme/contract.css",
|
|
34
14
|
"./tailwind": "./tailwind.preset.js"
|
|
35
15
|
},
|
|
36
16
|
"files": [
|
|
37
17
|
"src",
|
|
38
18
|
"tailwind.preset.js",
|
|
39
|
-
"README.md"
|
|
40
|
-
"dist"
|
|
19
|
+
"README.md"
|
|
41
20
|
],
|
|
42
21
|
"publishConfig": {
|
|
43
22
|
"access": "public"
|
|
@@ -116,6 +95,5 @@
|
|
|
116
95
|
"react",
|
|
117
96
|
"nextjs",
|
|
118
97
|
"startsimpli"
|
|
119
|
-
]
|
|
120
|
-
"module": "./dist/index.mjs"
|
|
98
|
+
]
|
|
121
99
|
}
|
package/dist/chunk-6SXB6YDH.mjs
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
|
|
4
|
-
function cn(...inputs) {
|
|
5
|
-
return twMerge(clsx(inputs));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// src/utils/index.ts
|
|
9
|
-
function generateId(prefix = "") {
|
|
10
|
-
const random = Math.random().toString(36).substring(2, 9);
|
|
11
|
-
return prefix ? `${prefix}_${random}` : random;
|
|
12
|
-
}
|
|
13
|
-
function sleep(ms) {
|
|
14
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
15
|
-
}
|
|
16
|
-
function formatDate(date) {
|
|
17
|
-
const d = typeof date === "string" ? new Date(date) : date;
|
|
18
|
-
return new Intl.DateTimeFormat("en-US", {
|
|
19
|
-
month: "short",
|
|
20
|
-
day: "numeric",
|
|
21
|
-
year: "numeric"
|
|
22
|
-
}).format(d);
|
|
23
|
-
}
|
|
24
|
-
function formatRelativeTime(date) {
|
|
25
|
-
const d = typeof date === "string" ? new Date(date) : date;
|
|
26
|
-
const now = /* @__PURE__ */ new Date();
|
|
27
|
-
const diffMs = now.getTime() - d.getTime();
|
|
28
|
-
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
29
|
-
if (diffDays === 0) return "Today";
|
|
30
|
-
if (diffDays === 1) return "Yesterday";
|
|
31
|
-
if (diffDays < 7) return `${diffDays} days ago`;
|
|
32
|
-
if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`;
|
|
33
|
-
return formatDate(d);
|
|
34
|
-
}
|
|
35
|
-
function formatRelativeDate(date) {
|
|
36
|
-
const now = /* @__PURE__ */ new Date();
|
|
37
|
-
const diffMs = now.getTime() - date.getTime();
|
|
38
|
-
const diffSecs = Math.floor(diffMs / 1e3);
|
|
39
|
-
const diffMins = Math.floor(diffSecs / 60);
|
|
40
|
-
const diffHours = Math.floor(diffMins / 60);
|
|
41
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
42
|
-
if (diffSecs < 60) return "just now";
|
|
43
|
-
if (diffMins < 60) return `${diffMins}m ago`;
|
|
44
|
-
if (diffHours < 24) return `${diffHours}h ago`;
|
|
45
|
-
if (diffDays < 7) return `${diffDays}d ago`;
|
|
46
|
-
return date.toLocaleDateString();
|
|
47
|
-
}
|
|
48
|
-
function formatCurrency(amount) {
|
|
49
|
-
return new Intl.NumberFormat("en-US", {
|
|
50
|
-
style: "currency",
|
|
51
|
-
currency: "USD",
|
|
52
|
-
minimumFractionDigits: 0,
|
|
53
|
-
maximumFractionDigits: 0
|
|
54
|
-
}).format(amount);
|
|
55
|
-
}
|
|
56
|
-
function getInitials(name) {
|
|
57
|
-
return name.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { cn, formatCurrency, formatDate, formatRelativeDate, formatRelativeTime, generateId, getInitials, sleep };
|
|
61
|
-
//# sourceMappingURL=chunk-6SXB6YDH.mjs.map
|
|
62
|
-
//# sourceMappingURL=chunk-6SXB6YDH.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/cn.ts","../src/utils/index.ts"],"names":[],"mappings":";;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;;;ACAO,SAAS,UAAA,CAAW,SAAS,EAAA,EAAY;AAC9C,EAAA,MAAM,MAAA,GAAS,KAAK,MAAA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AAM,GAAG,EACT,GAAA,CAAI,CAAC,SAAS,IAAA,CAAK,CAAC,CAAC,CAAA,CACrB,KAAK,EAAE,CAAA,CACP,aAAY,CACZ,KAAA,CAAM,GAAG,CAAC,CAAA;AACf","file":"chunk-6SXB6YDH.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","export { cn } from './cn'\n\n/**\n * Generate a random ID with optional prefix\n */\nexport function generateId(prefix = ''): string {\n const random = Math.random().toString(36).substring(2, 9)\n return prefix ? `${prefix}_${random}` : random\n}\n\n/**\n * Sleep for a given number of milliseconds\n */\nexport function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\n/**\n * Format a date as a short human-readable string (e.g. \"Jan 5, 2024\").\n * Accepts a Date object or an ISO date string.\n */\nexport function formatDate(date: Date | string): string {\n const d = typeof date === 'string' ? new Date(date) : date\n return new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n }).format(d)\n}\n\n/**\n * Format a date relative to now using coarse buckets\n * (Today / Yesterday / N days ago / N weeks ago / formatted date).\n * Accepts a Date object or an ISO date string.\n */\nexport function formatRelativeTime(date: Date | string): string {\n const d = typeof date === 'string' ? new Date(date) : date\n const now = new Date()\n const diffMs = now.getTime() - d.getTime()\n const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24))\n\n if (diffDays === 0) return 'Today'\n if (diffDays === 1) return 'Yesterday'\n if (diffDays < 7) return `${diffDays} days ago`\n if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`\n return formatDate(d)\n}\n\n/**\n * Format a date relative to now using fine-grained buckets\n * (just now / Xm ago / Xh ago / Xd ago / formatted date).\n */\nexport function formatRelativeDate(date: Date): string {\n const now = new Date()\n const diffMs = now.getTime() - date.getTime()\n const diffSecs = Math.floor(diffMs / 1000)\n const diffMins = Math.floor(diffSecs / 60)\n const diffHours = Math.floor(diffMins / 60)\n const diffDays = Math.floor(diffHours / 24)\n\n if (diffSecs < 60) return 'just now'\n if (diffMins < 60) return `${diffMins}m ago`\n if (diffHours < 24) return `${diffHours}h ago`\n if (diffDays < 7) return `${diffDays}d ago`\n\n return date.toLocaleDateString()\n}\n\n/**\n * Format a number as USD currency (no cents, e.g. \"$1,000,000\")\n */\nexport function formatCurrency(amount: number): string {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(amount)\n}\n\n/**\n * Get initials from a display name (up to 2 characters)\n */\nexport function getInitials(name: string): string {\n return name\n .split(' ')\n .map((word) => word[0])\n .join('')\n .toUpperCase()\n .slice(0, 2)\n}\n"]}
|