startx 1.0.2 → 1.0.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.
- package/.dockerignore +4 -0
- package/apps/cli/src/commands/index.ts +1 -1
- package/apps/cli/src/commands/{common → test}/test.ts +4 -2
- package/apps/cli/tsconfig.json +0 -1
- package/apps/core-server/Dockerfile +5 -4
- package/apps/core-server/package.json +1 -1
- package/apps/core-server/tsconfig.json +1 -1
- package/apps/queue-worker/package.json +1 -1
- package/apps/queue-worker/tsconfig.json +1 -1
- package/apps/startx-cli/dist/index.mjs +68 -53
- package/apps/startx-cli/src/commands/package.ts +453 -0
- package/apps/startx-cli/src/configs/scripts.ts +18 -2
- package/apps/startx-cli/src/index.ts +2 -4
- package/apps/startx-cli/src/types.ts +2 -4
- package/apps/startx-cli/src/utils/inquirer.ts +8 -1
- package/apps/web-client/.dockerignore +4 -0
- package/apps/web-client/app/app.css +1 -0
- package/apps/web-client/app/components.json +23 -0
- package/apps/web-client/app/config/auth/auth-state.ts +59 -0
- package/apps/web-client/app/config/axios-client.ts +87 -0
- package/apps/web-client/app/config/env.ts +5 -0
- package/apps/web-client/app/entry.client.tsx +7 -0
- package/apps/web-client/app/eslint.config.ts +4 -0
- package/apps/web-client/app/root.tsx +77 -0
- package/apps/web-client/app/routes/home.tsx +12 -0
- package/apps/web-client/app/routes.ts +3 -0
- package/apps/web-client/eslint.config.ts +4 -0
- package/apps/web-client/package.json +55 -0
- package/apps/web-client/react-router.config.ts +7 -0
- package/apps/web-client/tsconfig.json +22 -0
- package/apps/web-client/vite-env.d.ts +8 -0
- package/apps/web-client/vite.config.ts +30 -0
- package/biome.json +5 -0
- package/configs/eslint-config/eslint.config.ts +1 -0
- package/configs/eslint-config/src/configs/base.ts +2 -1
- package/configs/eslint-config/src/configs/frontend.ts +1 -1
- package/configs/eslint-config/tsconfig.json +1 -1
- package/configs/typescript-config/tsconfig.frontend.json +1 -1
- package/configs/vitest-config/tsconfig.json +1 -1
- package/package.json +1 -1
- package/packages/@db/drizzle/tsconfig.json +1 -1
- package/packages/@db/sqlite/tsconfig.json +1 -1
- package/packages/@repo/env/package.json +1 -2
- package/packages/@repo/env/src/utils.ts +17 -11
- package/packages/@repo/env/tsconfig.json +1 -1
- package/packages/@repo/lib/package.json +3 -1
- package/packages/@repo/lib/src/session-module/i-session.ts +108 -0
- package/packages/@repo/lib/src/session-module/index.ts +8 -111
- package/packages/@repo/lib/src/session-module/redis-session.ts +44 -0
- package/packages/@repo/lib/tsconfig.json +0 -1
- package/packages/@repo/logger/package.json +0 -1
- package/packages/@repo/logger/tsconfig.json +1 -1
- package/packages/@repo/mail/tsconfig.json +1 -1
- package/packages/@repo/redis/tsconfig.json +1 -1
- package/packages/aix/package.json +2 -0
- package/packages/aix/src/providers/ai-interface.ts +4 -4
- package/packages/aix/src/providers/bedrock/bedrock.ts +261 -0
- package/packages/aix/src/providers/default-models.ts +65 -0
- package/packages/aix/src/providers/openai/openai.ts +2 -2
- package/packages/aix/src/providers/providers.ts +11 -0
- package/packages/aix/src/providers/types.ts +1 -1
- package/packages/{constants → common}/package.json +4 -2
- package/packages/{constants/src/index.ts → common/src/constants.ts} +0 -5
- package/packages/common/src/types/users.ts +10 -0
- package/packages/{constants → common}/tsconfig.json +0 -3
- package/packages/ui/components.json +15 -8
- package/packages/ui/package.json +24 -36
- package/packages/ui/src/api/axios/i-client.ts +40 -0
- package/packages/ui/src/api/index.ts +6 -0
- package/packages/ui/src/api/query-provider.tsx +34 -0
- package/packages/ui/src/api/use-api/api-builder.ts +139 -0
- package/packages/ui/src/api/use-api/api-helpers.ts +165 -0
- package/packages/ui/src/api/use-api/api-types.ts +138 -0
- package/packages/ui/src/api/use-api/query-factory.ts +66 -0
- package/packages/ui/src/api/use-api/react-query/types.ts +64 -0
- package/packages/ui/src/api/use-api/react-query/use-api-client.ts +56 -0
- package/packages/ui/src/api/use-api/react-query/use-api.ts +297 -0
- package/packages/ui/src/components/custom/form-wrapper.tsx +113 -160
- package/packages/ui/src/components/custom/grid-component.tsx +4 -4
- package/packages/ui/src/components/custom/hover-tool.tsx +1 -1
- package/packages/ui/src/components/custom/image-picker.tsx +18 -20
- package/packages/ui/src/components/custom/no-content.tsx +6 -16
- package/packages/ui/src/components/custom/page-section.tsx +14 -17
- package/packages/ui/src/components/custom/simple-popover.tsx +5 -9
- package/packages/ui/src/components/custom/theme-provider.tsx +117 -42
- package/packages/ui/src/components/custom/typography.tsx +20 -22
- package/packages/ui/src/components/extensions/timeline.tsx +100 -0
- package/packages/ui/src/components/ui/alert-dialog.tsx +46 -108
- package/packages/ui/src/components/ui/avatar.tsx +79 -42
- package/packages/ui/src/components/ui/badge.tsx +29 -34
- package/packages/ui/src/components/ui/breadcrumb.tsx +65 -81
- package/packages/ui/src/components/ui/button.tsx +80 -80
- package/packages/ui/src/components/ui/card.tsx +48 -69
- package/packages/ui/src/components/ui/carousel.tsx +184 -211
- package/packages/ui/src/components/ui/checkbox.tsx +21 -24
- package/packages/ui/src/components/ui/command.tsx +121 -102
- package/packages/ui/src/components/ui/dialog.tsx +45 -32
- package/packages/ui/src/components/ui/dropdown-menu.tsx +45 -33
- package/packages/ui/src/components/ui/field.tsx +218 -0
- package/packages/ui/src/components/ui/form.tsx +63 -76
- package/packages/ui/src/components/ui/input-group.tsx +137 -0
- package/packages/ui/src/components/ui/input-otp.tsx +60 -50
- package/packages/ui/src/components/ui/input.tsx +16 -15
- package/packages/ui/src/components/ui/label.tsx +14 -17
- package/packages/ui/src/components/ui/multiple-select.tsx +22 -33
- package/packages/ui/src/components/ui/popover.tsx +20 -8
- package/packages/ui/src/components/ui/select.tsx +33 -34
- package/packages/ui/src/components/ui/separator.tsx +8 -8
- package/packages/ui/src/components/ui/sheet.tsx +32 -59
- package/packages/ui/src/components/ui/sidebar.tsx +654 -0
- package/packages/ui/src/components/ui/skeleton.tsx +2 -8
- package/packages/ui/src/components/ui/sonner.tsx +39 -0
- package/packages/ui/src/components/ui/spinner.tsx +6 -13
- package/packages/ui/src/components/ui/switch.tsx +15 -10
- package/packages/ui/src/components/ui/table.tsx +48 -89
- package/packages/ui/src/components/ui/tabs.tsx +37 -15
- package/packages/ui/src/components/ui/textarea.tsx +13 -13
- package/packages/ui/src/components/ui/tooltip.tsx +37 -23
- package/packages/ui/src/{components/hooks → hooks}/event/use-click.tsx +6 -10
- package/packages/ui/src/hooks/time/use-timer.tsx +51 -0
- package/packages/ui/src/hooks/use-media-query.tsx +19 -0
- package/packages/ui/src/hooks/use-mobile.tsx +17 -0
- package/packages/ui/src/{components/hooks → hooks}/use-update-effect.tsx +2 -2
- package/packages/ui/src/lib/utils.ts +113 -0
- package/packages/ui/src/styles/globals.css +314 -0
- package/packages/ui/src/styles/tailwind.css +89 -0
- package/packages/ui/tsconfig.json +7 -9
- package/pnpm-workspace.yaml +74 -64
- package/packages/ui/postcss.config.mjs +0 -9
- package/packages/ui/src/components/extensions/carousel.tsx +0 -392
- package/packages/ui/src/components/hooks/time/useTimer.tsx +0 -51
- package/packages/ui/src/components/hooks/use-media-query.tsx +0 -19
- package/packages/ui/src/components/lib/utils.ts +0 -242
- package/packages/ui/src/components/ui/timeline.tsx +0 -118
- package/packages/ui/src/components/util/n-formattor.ts +0 -22
- package/packages/ui/src/components/util/storage.ts +0 -37
- package/packages/ui/src/globals.css +0 -87
- package/packages/ui/tailwind.config.ts +0 -94
- /package/packages/{constants → common}/eslint.config.ts +0 -0
- /package/packages/{constants → common}/src/api.ts +0 -0
- /package/packages/{constants → common}/src/time.ts +0 -0
- /package/packages/{constants → common}/vitest.config.ts +0 -0
- /package/packages/ui/src/{components/hooks/time/useDebounce.tsx → hooks/time/use-debounce.tsx} +0 -0
- /package/packages/ui/src/{components/hooks/time/useInterval.tsx → hooks/time/use-interval.tsx} +0 -0
- /package/packages/ui/src/{components/hooks/time/useTimeout.tsx → hooks/time/use-timeout.tsx} +0 -0
- /package/packages/ui/src/{components/hooks → hooks}/use-persistent-storage.tsx +0 -0
- /package/packages/ui/src/{components/hooks → hooks}/use-window-dimension.tsx +0 -0
- /package/packages/ui/src/{components/sonner.tsx → sonner.ts} +0 -0
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { type ClassValue, clsx } from "clsx";
|
|
3
|
-
import {
|
|
4
|
-
differenceInDays,
|
|
5
|
-
differenceInYears,
|
|
6
|
-
format,
|
|
7
|
-
formatDistance,
|
|
8
|
-
isThisWeek,
|
|
9
|
-
isToday,
|
|
10
|
-
isYesterday,
|
|
11
|
-
parseISO,
|
|
12
|
-
} from "date-fns";
|
|
13
|
-
import { twMerge } from "tailwind-merge";
|
|
14
|
-
|
|
15
|
-
import type { Store } from "../util/storage";
|
|
16
|
-
|
|
17
|
-
export function cn(...inputs: ClassValue[]) {
|
|
18
|
-
return twMerge(clsx(inputs));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// function isFileArray(value: any): value is File[] {
|
|
22
|
-
// return Array.isArray(value) && value.every(item => item instanceof File);
|
|
23
|
-
// }
|
|
24
|
-
|
|
25
|
-
export function getFormData(object: {
|
|
26
|
-
[key: string]: undefined | string | number | boolean | Blob | File | object | File[];
|
|
27
|
-
}): FormData {
|
|
28
|
-
const formData = new FormData();
|
|
29
|
-
Object.entries(object).forEach(([key, value]) => {
|
|
30
|
-
if (value instanceof Blob || value instanceof File) {
|
|
31
|
-
formData.append(key, value);
|
|
32
|
-
} else if (value instanceof FileList || (Array.isArray(value) && value[0] instanceof File)) {
|
|
33
|
-
Array.from(value).forEach((file: File) => {
|
|
34
|
-
formData.append(key, file);
|
|
35
|
-
});
|
|
36
|
-
} else {
|
|
37
|
-
if (!value) return;
|
|
38
|
-
formData.append(key, JSON.stringify(value));
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return formData;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function switchPath(pathname: string, tab: string) {
|
|
45
|
-
const fragments = pathname.split("/").filter(str => str);
|
|
46
|
-
fragments[2] = tab;
|
|
47
|
-
const path = `/${fragments.join("/")}`;
|
|
48
|
-
return path;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function getRelativeDate(date?: string | Date) {
|
|
52
|
-
const now = new Date();
|
|
53
|
-
if (!date) return "";
|
|
54
|
-
if (isToday(date)) {
|
|
55
|
-
return format(date, "h:mm a");
|
|
56
|
-
} else if (isYesterday(date)) {
|
|
57
|
-
return "yesterday";
|
|
58
|
-
} else if (isThisWeek(date) && differenceInDays(now, date) <= 7) {
|
|
59
|
-
return format(date, "EEEE"); // EEEE gives the full name of the day like Sunday, Monday
|
|
60
|
-
} else {
|
|
61
|
-
return format(date, "dd/MM/yy");
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function getRelativeDateWithTime(date?: string | Date) {
|
|
66
|
-
const now = new Date();
|
|
67
|
-
if (!date) return "";
|
|
68
|
-
return formatDistance(new Date(date), now, { addSuffix: true });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function getRelativeProDate(dateString: string) {
|
|
72
|
-
try {
|
|
73
|
-
const date = parseISO(dateString);
|
|
74
|
-
const now = new Date();
|
|
75
|
-
const yearsDifference = differenceInYears(now, date);
|
|
76
|
-
const dateFormat = yearsDifference >= 1 ? "dd MMM yyyy, h:mm a" : "dd MMM, h:mm a";
|
|
77
|
-
const formattedDate = format(date, dateFormat);
|
|
78
|
-
return formattedDate;
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.error("Error formatting date:", error);
|
|
81
|
-
return "";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export function isValidId(str: string) {
|
|
85
|
-
const regex = /^[a-f0-9]{24}$/i;
|
|
86
|
-
return regex.test(str);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function getRelativeDateOnly(date?: string | Date) {
|
|
90
|
-
const now = new Date();
|
|
91
|
-
if (!date) return "";
|
|
92
|
-
if (isToday(date)) {
|
|
93
|
-
return "today";
|
|
94
|
-
} else if (isYesterday(date)) {
|
|
95
|
-
return "yesterday";
|
|
96
|
-
} else if (isThisWeek(date) && differenceInDays(now, date) <= 7) {
|
|
97
|
-
return format(date, "EEEE"); // EEEE gives the full name of the day like Sunday, Monday
|
|
98
|
-
} else {
|
|
99
|
-
return format(date, "dd/MM/yy");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
export type SocialMediaUrlMetaData = {
|
|
103
|
-
platform: "youtube" | "x" | "instagram";
|
|
104
|
-
url: string;
|
|
105
|
-
contentId: string;
|
|
106
|
-
};
|
|
107
|
-
export function getUrlMetaData(urlString: string): SocialMediaUrlMetaData | null {
|
|
108
|
-
const url = new URL(urlString);
|
|
109
|
-
let contentId: string;
|
|
110
|
-
let platform: "youtube" | "x" | "instagram";
|
|
111
|
-
switch (url.origin) {
|
|
112
|
-
case "https://youtu.be":
|
|
113
|
-
platform = "youtube";
|
|
114
|
-
contentId = url.pathname.replace("/", "");
|
|
115
|
-
break;
|
|
116
|
-
case "https://www.youtube.com":
|
|
117
|
-
platform = "youtube";
|
|
118
|
-
contentId = url.searchParams.get("v") as string;
|
|
119
|
-
break;
|
|
120
|
-
case "https://x.com":
|
|
121
|
-
platform = "x";
|
|
122
|
-
contentId = url.pathname
|
|
123
|
-
.split("/")
|
|
124
|
-
.filter(str => str)
|
|
125
|
-
.at(-1) as string;
|
|
126
|
-
break;
|
|
127
|
-
case "https://www.instagram.com":
|
|
128
|
-
platform = "instagram";
|
|
129
|
-
contentId = url.pathname
|
|
130
|
-
.split("/")
|
|
131
|
-
.filter(str => str)
|
|
132
|
-
.at(-1) as string;
|
|
133
|
-
break;
|
|
134
|
-
case "https://instagram.com":
|
|
135
|
-
platform = "instagram";
|
|
136
|
-
contentId = url.pathname
|
|
137
|
-
.split("/")
|
|
138
|
-
.filter(str => str)
|
|
139
|
-
.at(-1) as string;
|
|
140
|
-
break;
|
|
141
|
-
default:
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
platform,
|
|
146
|
-
url: urlString,
|
|
147
|
-
contentId,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export function isValidUrl(url: string) {
|
|
152
|
-
try {
|
|
153
|
-
const origin = new URL(url).origin;
|
|
154
|
-
return true;
|
|
155
|
-
} catch (error) {
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function memoize<T extends (...args: any[]) => any>(fn: T): T {
|
|
161
|
-
const cache: { [key: string]: ReturnType<T> } = {};
|
|
162
|
-
|
|
163
|
-
return ((...args: Parameters<T>): ReturnType<T> => {
|
|
164
|
-
const key = JSON.stringify(args);
|
|
165
|
-
if (cache[key] !== undefined) {
|
|
166
|
-
return cache[key];
|
|
167
|
-
} else {
|
|
168
|
-
const result = fn(...args);
|
|
169
|
-
cache[key] = result;
|
|
170
|
-
return result;
|
|
171
|
-
}
|
|
172
|
-
}) as T;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export function memoizeAsync<T extends (...args: any[]) => Promise<any>>(fn: T): T {
|
|
176
|
-
const cache: { [key: string]: ReturnType<T> } = {};
|
|
177
|
-
|
|
178
|
-
return (async (...args: Parameters<T>): Promise<ReturnType<T>> => {
|
|
179
|
-
const key = JSON.stringify(args);
|
|
180
|
-
if (cache[key] !== undefined) {
|
|
181
|
-
return await cache[key];
|
|
182
|
-
} else {
|
|
183
|
-
const result = await fn(...args);
|
|
184
|
-
cache[key] = result;
|
|
185
|
-
return result;
|
|
186
|
-
}
|
|
187
|
-
}) as T;
|
|
188
|
-
}
|
|
189
|
-
export function memoizePersistentAsync<T extends (...args: any[]) => Promise<any>>(
|
|
190
|
-
fn: T,
|
|
191
|
-
store: Store
|
|
192
|
-
): T {
|
|
193
|
-
return (async (...args: Parameters<T>): Promise<ReturnType<T>> => {
|
|
194
|
-
const key = JSON.stringify(args);
|
|
195
|
-
const cachedValue = store.get(key);
|
|
196
|
-
if (cachedValue !== null) {
|
|
197
|
-
try {
|
|
198
|
-
return JSON.parse(cachedValue);
|
|
199
|
-
} catch (error) {
|
|
200
|
-
console.error("Error parsing cached value:", error);
|
|
201
|
-
return await fn(...args);
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
const result = await fn(...args);
|
|
205
|
-
store.set(key, JSON.stringify(result));
|
|
206
|
-
return result;
|
|
207
|
-
}
|
|
208
|
-
}) as T;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export function formatNumberWithKMB(num: number): string {
|
|
212
|
-
const formatter = new Intl.NumberFormat("en-US", {
|
|
213
|
-
notation: "compact",
|
|
214
|
-
minimumSignificantDigits: 1,
|
|
215
|
-
maximumSignificantDigits: 3,
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
return formatter.format(num);
|
|
219
|
-
}
|
|
220
|
-
export function currencyToNumber(formattedCurrency: string): number {
|
|
221
|
-
// Remove everything except digits, minus sign, and decimal point
|
|
222
|
-
const numericString = formattedCurrency.replace(/[^0-9.-]+/g, "");
|
|
223
|
-
|
|
224
|
-
// Convert the string back to a number
|
|
225
|
-
const parsedNumber = Number.parseFloat(numericString);
|
|
226
|
-
|
|
227
|
-
// Handle potential NaN if parsing fails
|
|
228
|
-
if (isNaN(parsedNumber)) {
|
|
229
|
-
throw new Error("Invalid currency format");
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
return parsedNumber;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
export function createLabels(e: string) {
|
|
236
|
-
return e
|
|
237
|
-
.replaceAll("_", " ")
|
|
238
|
-
.replace(/\b\w/g, char => char.toUpperCase())
|
|
239
|
-
.trim();
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export { cva, type VariantProps } from "class-variance-authority";
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
const Timeline = React.forwardRef<HTMLOListElement, React.HTMLAttributes<HTMLOListElement>>(
|
|
6
|
-
({ className, ...props }, ref) => (
|
|
7
|
-
<ol ref={ref} className={cn('flex flex-col', className)} {...props} />
|
|
8
|
-
),
|
|
9
|
-
);
|
|
10
|
-
Timeline.displayName = 'Timeline';
|
|
11
|
-
|
|
12
|
-
const TimelineItem = React.forwardRef<HTMLLIElement, React.LiHTMLAttributes<HTMLLIElement> & {className: string}>(
|
|
13
|
-
({ className, ...props }, ref) => (
|
|
14
|
-
<li
|
|
15
|
-
ref={ref}
|
|
16
|
-
className={cn('relative flex flex-col p-6 pl-3 pt-0 [&>*]:mb-2', className)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
),
|
|
20
|
-
);
|
|
21
|
-
TimelineItem.displayName = 'TimelineItem';
|
|
22
|
-
|
|
23
|
-
const TimelineTime = React.forwardRef<
|
|
24
|
-
HTMLParagraphElement,
|
|
25
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
26
|
-
>(({ className, ...props }, ref) => (
|
|
27
|
-
<p
|
|
28
|
-
ref={ref}
|
|
29
|
-
className={cn(
|
|
30
|
-
'absolute translate-x-36 md:-translate-x-24 text-sm font-semibold leading-none text-secondary-foreground',
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
));
|
|
36
|
-
TimelineTime.displayName = 'TimelineTime';
|
|
37
|
-
|
|
38
|
-
const TimelineConnector = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
39
|
-
({ className, ...props }, ref) => (
|
|
40
|
-
<div
|
|
41
|
-
ref={ref}
|
|
42
|
-
className={cn(
|
|
43
|
-
'absolute top-[5px] left-[30px] -translate-x-1/2 translate-y-2 h-full w-px bg-primary',
|
|
44
|
-
className,
|
|
45
|
-
)}
|
|
46
|
-
{...props}
|
|
47
|
-
/>
|
|
48
|
-
),
|
|
49
|
-
);
|
|
50
|
-
TimelineConnector.displayName = 'TimelineConnector';
|
|
51
|
-
|
|
52
|
-
const TimelineHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
53
|
-
({ className, ...props }, ref) => (
|
|
54
|
-
<div ref={ref} className={cn('flex items-center gap-4', className)} {...props} />
|
|
55
|
-
),
|
|
56
|
-
);
|
|
57
|
-
TimelineHeader.displayName = 'TimelineHeader';
|
|
58
|
-
|
|
59
|
-
const TimelineTitle = React.forwardRef<
|
|
60
|
-
HTMLHeadingElement,
|
|
61
|
-
React.HTMLAttributes<HTMLHeadingElement>
|
|
62
|
-
>(({ className, children, ...props }, ref) => (
|
|
63
|
-
<h3
|
|
64
|
-
ref={ref}
|
|
65
|
-
className={cn('font-semibold leading-none tracking-tight text-secondary-foreground', className)}
|
|
66
|
-
{...props}
|
|
67
|
-
>
|
|
68
|
-
{children}
|
|
69
|
-
</h3>
|
|
70
|
-
));
|
|
71
|
-
TimelineTitle.displayName = 'CardTitle';
|
|
72
|
-
|
|
73
|
-
const TimelineIcon = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
74
|
-
({ className, ...props }, ref) => (
|
|
75
|
-
<div
|
|
76
|
-
ref={ref}
|
|
77
|
-
className={cn(
|
|
78
|
-
'grid place-content-center flex-col text-center items-center size-7 justify-center relative left-1 bg-primary rounded-full',
|
|
79
|
-
className,
|
|
80
|
-
)}
|
|
81
|
-
{...props}
|
|
82
|
-
>
|
|
83
|
-
{props.children}
|
|
84
|
-
</div>
|
|
85
|
-
),
|
|
86
|
-
);
|
|
87
|
-
TimelineIcon.displayName = 'TimelineIcon';
|
|
88
|
-
|
|
89
|
-
const TimelineDescription = React.forwardRef<
|
|
90
|
-
HTMLParagraphElement,
|
|
91
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
92
|
-
>(({ className, ...props }, ref) => (
|
|
93
|
-
<p
|
|
94
|
-
ref={ref}
|
|
95
|
-
className={cn('text-sm text-muted-foreground max-w-sm ml-5', className)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
));
|
|
99
|
-
TimelineDescription.displayName = 'TimelineDescription';
|
|
100
|
-
|
|
101
|
-
const TimelineContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
102
|
-
({ className, ...props }, ref) => (
|
|
103
|
-
<div ref={ref} className={cn('flex flex-col items-start p-6 pt-0', className)} {...props} />
|
|
104
|
-
),
|
|
105
|
-
);
|
|
106
|
-
TimelineContent.displayName = 'TimelineContent';
|
|
107
|
-
|
|
108
|
-
export {
|
|
109
|
-
Timeline,
|
|
110
|
-
TimelineItem,
|
|
111
|
-
TimelineConnector,
|
|
112
|
-
TimelineHeader,
|
|
113
|
-
TimelineTitle,
|
|
114
|
-
TimelineIcon,
|
|
115
|
-
TimelineDescription,
|
|
116
|
-
TimelineContent,
|
|
117
|
-
TimelineTime,
|
|
118
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export function nFormatter(num: number, digits?: number) {
|
|
2
|
-
if (!num) return "0";
|
|
3
|
-
const lookup = [
|
|
4
|
-
{ value: 1, symbol: "" },
|
|
5
|
-
{ value: 1e3, symbol: "K" },
|
|
6
|
-
{ value: 1e6, symbol: "M" },
|
|
7
|
-
{ value: 1e9, symbol: "B" },
|
|
8
|
-
{ value: 1e12, symbol: "T" },
|
|
9
|
-
{ value: 1e15, symbol: "P" },
|
|
10
|
-
{ value: 1e18, symbol: "E" },
|
|
11
|
-
];
|
|
12
|
-
const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
|
13
|
-
const item = lookup
|
|
14
|
-
.slice()
|
|
15
|
-
.reverse()
|
|
16
|
-
.find(function (item) {
|
|
17
|
-
return num >= item.value;
|
|
18
|
-
});
|
|
19
|
-
return item
|
|
20
|
-
? (num / item.value).toFixed(digits ?? 1).replace(rx, "$1") + item.symbol
|
|
21
|
-
: "0";
|
|
22
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
export interface Store<T = Record<string, any>> {
|
|
4
|
-
_store: T;
|
|
5
|
-
get(key: string): string | null;
|
|
6
|
-
set(key: string, value: string): void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const InMemoryStorage: Store = {
|
|
10
|
-
_store: {},
|
|
11
|
-
get(key: string): string | null {
|
|
12
|
-
return this._store[key];
|
|
13
|
-
},
|
|
14
|
-
set(key: string, value: string): void {
|
|
15
|
-
this._store[key] = value;
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const SessionStorageStore: Store = {
|
|
20
|
-
_store: {},
|
|
21
|
-
get(key: string): string | null {
|
|
22
|
-
return sessionStorage.getItem(key);
|
|
23
|
-
},
|
|
24
|
-
set(key: string, value: string): void {
|
|
25
|
-
sessionStorage.setItem(key, value);
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const LocalStorageStore: Store = {
|
|
30
|
-
_store: {},
|
|
31
|
-
get(key: string): string | null {
|
|
32
|
-
return localStorage.getItem(key);
|
|
33
|
-
},
|
|
34
|
-
set(key: string, value: string): void {
|
|
35
|
-
localStorage.setItem(key, value);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
@config "../tailwind.config.ts";
|
|
3
|
-
@source "../**/*.{ts,tsx}";
|
|
4
|
-
|
|
5
|
-
@custom-variant dark (&:is(.dark *));
|
|
6
|
-
|
|
7
|
-
@layer base {
|
|
8
|
-
:root {
|
|
9
|
-
--background: 0 0% 100%;
|
|
10
|
-
--foreground: 224 71.4% 4.1%;
|
|
11
|
-
--card: 0 0% 100%;
|
|
12
|
-
--card-foreground: 224 71.4% 4.1%;
|
|
13
|
-
--popover: 0 0% 100%;
|
|
14
|
-
--popover-foreground: 224 71.4% 4.1%;
|
|
15
|
-
--primary: 262.1 83.3% 57.8%;
|
|
16
|
-
--primary-foreground: 210 20% 98%;
|
|
17
|
-
--secondary: 220 14.3% 95.9%;
|
|
18
|
-
--secondary-foreground: 220.9 39.3% 11%;
|
|
19
|
-
--muted: 220 14.3% 95.9%;
|
|
20
|
-
--muted-foreground: 220 8.9% 46.1%;
|
|
21
|
-
--accent: 220 14.3% 95.9%;
|
|
22
|
-
--accent-foreground: 220.9 39.3% 11%;
|
|
23
|
-
--destructive: 0 84.2% 60.2%;
|
|
24
|
-
--destructive-foreground: 210 20% 98%;
|
|
25
|
-
--border: 220 13% 91%;
|
|
26
|
-
--input: 220 13% 91%;
|
|
27
|
-
--ring: 262.1 83.3% 57.8%;
|
|
28
|
-
--radius: 0.75rem;
|
|
29
|
-
--chart-1: 173 58% 39%;
|
|
30
|
-
--chart-2: 12 76% 61%;
|
|
31
|
-
--chart-3: 197 37% 24%;
|
|
32
|
-
--chart-4: 43 74% 66%;
|
|
33
|
-
--chart-5: 27 87% 67%;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.dark {
|
|
37
|
-
--background: 224 71.4% 4.1%;
|
|
38
|
-
--foreground: 210 20% 98%;
|
|
39
|
-
--card: 224 71.4% 4.1%;
|
|
40
|
-
--card-foreground: 210 20% 98%;
|
|
41
|
-
--popover: 224 71.4% 4.1%;
|
|
42
|
-
--popover-foreground: 210 20% 98%;
|
|
43
|
-
--primary: 263.4 70% 50.4%;
|
|
44
|
-
--primary-foreground: 210 20% 98%;
|
|
45
|
-
--secondary: 215 27.9% 16.9%;
|
|
46
|
-
--secondary-foreground: 210 20% 98%;
|
|
47
|
-
--muted: 215 27.9% 16.9%;
|
|
48
|
-
--muted-foreground: 217.9 10.6% 64.9%;
|
|
49
|
-
--accent: 215 27.9% 16.9%;
|
|
50
|
-
--accent-foreground: 210 20% 98%;
|
|
51
|
-
--destructive: 0 62.8% 50.6%;
|
|
52
|
-
--destructive-foreground: 210 20% 98%;
|
|
53
|
-
--border: 215 27.9% 16.9%;
|
|
54
|
-
--input: 215 27.9% 16.9%;
|
|
55
|
-
--ring: 263.4 70% 50.4%;
|
|
56
|
-
--chart-1: 173 58% 39%;
|
|
57
|
-
--chart-2: 12 76% 61%;
|
|
58
|
-
--chart-3: 197 37% 24%;
|
|
59
|
-
--chart-4: 43 74% 66%;
|
|
60
|
-
--chart-5: 27 87% 67%;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
html {
|
|
65
|
-
background-color: var(--background);
|
|
66
|
-
}
|
|
67
|
-
@layer base {
|
|
68
|
-
* {
|
|
69
|
-
font-family: var(--font-openSans);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@layer utilities {
|
|
74
|
-
/* Chrome, Safari and Opera */
|
|
75
|
-
.no-scrollbar::-webkit-scrollbar {
|
|
76
|
-
display: none;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.no-scrollbar {
|
|
80
|
-
-ms-overflow-style: none; /* IE and Edge */
|
|
81
|
-
scrollbar-width: none; /* Firefox */
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
html {
|
|
86
|
-
scroll-behavior: smooth;
|
|
87
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import type { Config } from "tailwindcss";
|
|
3
|
-
import tailwindcssAnimate from "tailwindcss-animate";
|
|
4
|
-
|
|
5
|
-
const config = {
|
|
6
|
-
darkMode: ["class", "string"],
|
|
7
|
-
content: [
|
|
8
|
-
"./pages/**/*.{ts,tsx}",
|
|
9
|
-
"./components/**/*.{ts,tsx}",
|
|
10
|
-
"./src/**/*.{ts,tsx}",
|
|
11
|
-
"../../apps/**/*.{ts,tsx}",
|
|
12
|
-
"../../packages/ui/src/**/*.{ts,tsx}",
|
|
13
|
-
],
|
|
14
|
-
prefix: "",
|
|
15
|
-
theme: {
|
|
16
|
-
container: {
|
|
17
|
-
center: true,
|
|
18
|
-
padding: "2rem",
|
|
19
|
-
screens: {
|
|
20
|
-
"2xl": "1400px",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
extend: {
|
|
24
|
-
backgroundImage: {
|
|
25
|
-
"instagram-gradient": "linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)",
|
|
26
|
-
},
|
|
27
|
-
fontFamily: {
|
|
28
|
-
poppins: ["var(--font-poppins)", "sans-serif"],
|
|
29
|
-
alike: ["var(--font-alike)", "sans-serif"],
|
|
30
|
-
openSans: ["var(--font-openSans)", "sans-serif"],
|
|
31
|
-
alertaStencils: ["var(--font-alertaStencils)", "sans-serif"],
|
|
32
|
-
pacifico: ["var(--font-pacifico)", "sans-serif"],
|
|
33
|
-
},
|
|
34
|
-
colors: {
|
|
35
|
-
border: "hsl(var(--border))",
|
|
36
|
-
input: "hsl(var(--input))",
|
|
37
|
-
ring: "hsl(var(--ring))",
|
|
38
|
-
background: "hsl(var(--background))",
|
|
39
|
-
foreground: "hsl(var(--foreground))",
|
|
40
|
-
"white-smoke": "#f8f9fa",
|
|
41
|
-
primary: {
|
|
42
|
-
DEFAULT: "hsl(var(--primary))",
|
|
43
|
-
foreground: "hsl(var(--primary-foreground))",
|
|
44
|
-
},
|
|
45
|
-
secondary: {
|
|
46
|
-
DEFAULT: "hsl(var(--secondary))",
|
|
47
|
-
foreground: "hsl(var(--secondary-foreground))",
|
|
48
|
-
},
|
|
49
|
-
destructive: {
|
|
50
|
-
DEFAULT: "hsl(var(--destructive))",
|
|
51
|
-
foreground: "hsl(var(--destructive-foreground))",
|
|
52
|
-
},
|
|
53
|
-
muted: {
|
|
54
|
-
DEFAULT: "hsl(var(--muted))",
|
|
55
|
-
foreground: "hsl(var(--muted-foreground))",
|
|
56
|
-
},
|
|
57
|
-
accent: {
|
|
58
|
-
DEFAULT: "hsl(var(--accent))",
|
|
59
|
-
foreground: "hsl(var(--accent-foreground))",
|
|
60
|
-
},
|
|
61
|
-
popover: {
|
|
62
|
-
DEFAULT: "hsl(var(--popover))",
|
|
63
|
-
foreground: "hsl(var(--popover-foreground))",
|
|
64
|
-
},
|
|
65
|
-
card: {
|
|
66
|
-
DEFAULT: "hsl(var(--card))",
|
|
67
|
-
foreground: "hsl(var(--card-foreground))",
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
borderRadius: {
|
|
71
|
-
lg: "var(--radius)",
|
|
72
|
-
md: "calc(var(--radius) - 2px)",
|
|
73
|
-
sm: "calc(var(--radius) - 4px)",
|
|
74
|
-
},
|
|
75
|
-
keyframes: {
|
|
76
|
-
"accordion-down": {
|
|
77
|
-
from: { height: "0" },
|
|
78
|
-
to: { height: "var(--radix-accordion-content-height)" },
|
|
79
|
-
},
|
|
80
|
-
"accordion-up": {
|
|
81
|
-
from: { height: "var(--radix-accordion-content-height)" },
|
|
82
|
-
to: { height: "0" },
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
animation: {
|
|
86
|
-
"accordion-down": "accordion-down 0.2s ease-out",
|
|
87
|
-
"accordion-up": "accordion-up 0.2s ease-out",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
plugins: [tailwindcssAnimate],
|
|
92
|
-
} satisfies Config;
|
|
93
|
-
|
|
94
|
-
export { config };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/packages/ui/src/{components/hooks/time/useDebounce.tsx → hooks/time/use-debounce.tsx}
RENAMED
|
File without changes
|
/package/packages/ui/src/{components/hooks/time/useInterval.tsx → hooks/time/use-interval.tsx}
RENAMED
|
File without changes
|
/package/packages/ui/src/{components/hooks/time/useTimeout.tsx → hooks/time/use-timeout.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|