@tirth_jasoliya/ui 1.0.4 → 1.0.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/dist/index.cjs CHANGED
@@ -31,7 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  AppMetaProvider: () => AppMetaProvider,
34
- Checkmark: () => Checkmark,
34
+ CurrencyTransfer: () => CurrencyTransfer,
35
35
  DataTable: () => DataTable,
36
36
  DataTableActionBar: () => DataTableActionBar,
37
37
  DataTableActionBarAction: () => DataTableActionBarAction,
@@ -40,7 +40,12 @@ __export(index_exports, {
40
40
  DataTemplateActionBar: () => DataTemplateActionBar,
41
41
  DataTemplateActionBarAction: () => DataTemplateActionBarAction,
42
42
  DataTemplateActionBarSelection: () => DataTemplateActionBarSelection,
43
+ ErrorComponent: () => ErrorComponent,
43
44
  GeneralHelper: () => GeneralHelper,
45
+ Loader: () => Loader4,
46
+ NotFound: () => NotFound,
47
+ OfflineUI: () => OfflineUI,
48
+ Unauthorized: () => Unauthorized,
44
49
  createLayoutComponents: () => createLayoutComponents,
45
50
  createPageTemplateHook: () => createPageTemplateHook,
46
51
  createTypedAppMetaContext: () => createTypedAppMetaContext
@@ -3155,6 +3160,42 @@ var GeneralHelper = class {
3155
3160
  var import_lucide_react19 = require("lucide-react");
3156
3161
  var import_react_router2 = require("react-router");
3157
3162
  var import_jsx_runtime34 = require("react/jsx-runtime");
3163
+ var ErrorComponent = () => {
3164
+ const error = (0, import_react_router2.useRouteError)();
3165
+ const navigate = (0, import_react_router2.useNavigate)();
3166
+ const renderErrorDetails = () => {
3167
+ if ((0, import_react_router2.isRouteErrorResponse)(error)) {
3168
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
3169
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("h2", { className: "text-3xl font-semibold text-destructive", children: [
3170
+ "Error ",
3171
+ error.status,
3172
+ ": ",
3173
+ error.statusText
3174
+ ] }),
3175
+ typeof error.data === "string" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("pre", { className: "text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left", children: error.data }) : error.data?.message && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("pre", { className: "text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left", children: error.data.message })
3176
+ ] });
3177
+ }
3178
+ if (error instanceof Error) {
3179
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
3180
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h2", { className: "text-3xl font-semibold text-destructive", children: "Unexpected Error" }),
3181
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("pre", { className: "text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left", children: error.message }),
3182
+ error.stack && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("details", { className: "mt-2 text-sm text-muted-foreground max-w-4xl text-left", children: [
3183
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("summary", { className: "cursor-pointer underline", children: "Stack Trace" }),
3184
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("pre", { className: "whitespace-pre-wrap", children: error.stack })
3185
+ ] })
3186
+ ] });
3187
+ }
3188
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
3189
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h2", { className: "text-3xl font-semibold text-destructive", children: "Unknown Error" }),
3190
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("pre", { className: "text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left", children: typeof error === "string" ? error : JSON.stringify(error, null, 2) })
3191
+ ] });
3192
+ };
3193
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "rounded-2xl flex justify-center items-center h-full bg-sidebar px-4", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col items-center space-y-4 text-center", children: [
3194
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react19.AlertTriangleIcon, { className: "h-16 w-16 text-destructive" }),
3195
+ renderErrorDetails(),
3196
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Button, { variant: "outline", onClick: () => navigate(-1), children: "Go Back" })
3197
+ ] }) });
3198
+ };
3158
3199
 
3159
3200
  // src/components/core/event-success.tsx
3160
3201
  var import_framer_motion3 = require("framer-motion");
@@ -3204,28 +3245,231 @@ function Checkmark({ size = 100, strokeWidth = 2, color = "currentColor", classN
3204
3245
  }
3205
3246
  );
3206
3247
  }
3248
+ function CurrencyTransfer() {
3249
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Card, { className: "w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(CardContent, { className: "space-y-4 flex flex-col items-center justify-center", children: [
3250
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3251
+ import_framer_motion3.motion.div,
3252
+ {
3253
+ className: "flex justify-center",
3254
+ initial: { opacity: 0, scale: 0.8 },
3255
+ animate: { opacity: 1, scale: 1 },
3256
+ transition: {
3257
+ duration: 0.4,
3258
+ ease: [0.4, 0, 0.2, 1],
3259
+ scale: {
3260
+ type: "spring",
3261
+ damping: 15,
3262
+ stiffness: 200
3263
+ }
3264
+ },
3265
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "relative", children: [
3266
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3267
+ import_framer_motion3.motion.div,
3268
+ {
3269
+ className: "absolute inset-0 bg-primary/5 rounded-full",
3270
+ initial: { opacity: 0, scale: 0.8 },
3271
+ animate: { opacity: 1, scale: 1 },
3272
+ transition: {
3273
+ delay: 0.2,
3274
+ duration: 0.8,
3275
+ ease: "circOut"
3276
+ }
3277
+ }
3278
+ ),
3279
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3280
+ Checkmark,
3281
+ {
3282
+ size: 80,
3283
+ strokeWidth: 4,
3284
+ color: "rgb(16 185 129)",
3285
+ className: "relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"
3286
+ }
3287
+ )
3288
+ ] })
3289
+ }
3290
+ ),
3291
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3292
+ import_framer_motion3.motion.div,
3293
+ {
3294
+ className: "space-y-2 text-center w-full",
3295
+ initial: { opacity: 0, y: 10 },
3296
+ animate: { opacity: 1, y: 0 },
3297
+ transition: {
3298
+ delay: 0.2,
3299
+ duration: 0.6,
3300
+ ease: [0.4, 0, 0.2, 1]
3301
+ },
3302
+ children: [
3303
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3304
+ import_framer_motion3.motion.h2,
3305
+ {
3306
+ className: "text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",
3307
+ initial: { opacity: 0, y: 5 },
3308
+ animate: { opacity: 1, y: 0 },
3309
+ transition: { delay: 1, duration: 0.4 },
3310
+ children: "Transfer Successful"
3311
+ }
3312
+ ),
3313
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3314
+ import_framer_motion3.motion.div,
3315
+ {
3316
+ className: "flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",
3317
+ initial: { opacity: 0, scale: 0.95 },
3318
+ animate: { opacity: 1, scale: 1 },
3319
+ transition: {
3320
+ delay: 1.2,
3321
+ duration: 0.4,
3322
+ ease: [0.4, 0, 0.2, 1]
3323
+ },
3324
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col items-start gap-2", children: [
3325
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-1.5", children: [
3326
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-xs font-medium text-secondary-foreground flex items-center gap-1.5", children: [
3327
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3328
+ "svg",
3329
+ {
3330
+ className: "w-3 h-3",
3331
+ xmlns: "http://www.w3.org/2000/svg",
3332
+ viewBox: "0 0 24 24",
3333
+ fill: "none",
3334
+ stroke: "currentColor",
3335
+ strokeWidth: "2",
3336
+ strokeLinecap: "round",
3337
+ strokeLinejoin: "round",
3338
+ children: [
3339
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("title", { children: "From" }),
3340
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M12 19V5M5 12l7-7 7 7" })
3341
+ ]
3342
+ }
3343
+ ),
3344
+ "From"
3345
+ ] }),
3346
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-2.5 group transition-all", children: [
3347
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform", children: "$" }),
3348
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "font-medium text-zinc-100 dark:text-zinc-900 tracking-tight", children: "500.00 USD" })
3349
+ ] })
3350
+ ] }),
3351
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent" }),
3352
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-1.5", children: [
3353
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-xs font-medium text-secondary-foreground flex items-center gap-1.5", children: [
3354
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
3355
+ "svg",
3356
+ {
3357
+ className: "w-3 h-3",
3358
+ xmlns: "http://www.w3.org/2000/svg",
3359
+ viewBox: "0 0 24 24",
3360
+ fill: "none",
3361
+ stroke: "currentColor",
3362
+ strokeWidth: "2",
3363
+ strokeLinecap: "round",
3364
+ strokeLinejoin: "round",
3365
+ children: [
3366
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("title", { children: "To" }),
3367
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M12 5v14M5 12l7 7 7-7" })
3368
+ ]
3369
+ }
3370
+ ),
3371
+ "To"
3372
+ ] }),
3373
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center gap-2.5 group transition-all", children: [
3374
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform", children: "\u20AC" }),
3375
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "font-medium text-zinc-100 dark:text-zinc-900 tracking-tight", children: "460.00 EUR" })
3376
+ ] })
3377
+ ] })
3378
+ ] })
3379
+ }
3380
+ ) }),
3381
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3382
+ import_framer_motion3.motion.div,
3383
+ {
3384
+ className: "w-full text-xs text-secondary-foreground mt-2 text-center",
3385
+ initial: { opacity: 0 },
3386
+ animate: { opacity: 1 },
3387
+ transition: { delay: 1.4, duration: 0.4 },
3388
+ children: "Exchange Rate: 1 USD = 0.92 EUR"
3389
+ }
3390
+ )
3391
+ ]
3392
+ }
3393
+ )
3394
+ ] }) });
3395
+ }
3207
3396
 
3208
3397
  // src/components/core/loader.tsx
3209
3398
  var import_jsx_runtime36 = require("react/jsx-runtime");
3399
+ var Loader4 = () => {
3400
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "rounded-2xl flex justify-center items-center h-full bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col items-center space-y-4", children: [
3401
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4" }),
3402
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { className: "text-xl font-semibold text-muted-foreground", children: "Loading, please wait..." }),
3403
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm text-muted-foreground", children: "Your content is on its way." })
3404
+ ] }) });
3405
+ };
3210
3406
 
3211
3407
  // src/components/core/notfound.tsx
3212
3408
  var import_react_router3 = require("react-router");
3213
3409
  var import_lucide_react20 = require("lucide-react");
3214
3410
  var import_react_router4 = require("react-router");
3215
3411
  var import_jsx_runtime37 = require("react/jsx-runtime");
3412
+ var NotFound = () => {
3413
+ const location = (0, import_react_router3.useLocation)();
3414
+ const navigate = (0, import_react_router4.useNavigate)();
3415
+ const goBack = () => {
3416
+ if (window.history.length > 2) {
3417
+ navigate(-1);
3418
+ } else {
3419
+ navigate("/");
3420
+ }
3421
+ };
3422
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none", children: [
3423
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react20.GhostIcon, { className: "h-15 w-15 text-destructive mb-4" }),
3424
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h1", { className: "text-2xl font-bold text-destructive mb-2", children: "Page Not Found" }),
3425
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "text-xl mb-4", children: [
3426
+ "The page ",
3427
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("code", { className: "px-1 py-0.5 rounded bg-muted text-foreground", children: location.pathname }),
3428
+ " doesn't exist or has been moved."
3429
+ ] }),
3430
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex space-x-4", children: [
3431
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "outline", onClick: goBack, children: "Go Back" }),
3432
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_router4.NavLink, { to: "/", children: "Return Home" }) })
3433
+ ] })
3434
+ ] });
3435
+ };
3216
3436
 
3217
3437
  // src/components/core/offline-content.tsx
3218
3438
  var import_lucide_react21 = require("lucide-react");
3219
3439
  var import_jsx_runtime38 = require("react/jsx-runtime");
3440
+ var OfflineUI = () => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none", children: [
3441
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react21.WifiOffIcon, { className: "h-15 w-15 text-destructive mb-4" }),
3442
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "text-3xl font-bold text-destructive mb-2", children: "You're offline" }),
3443
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-xl max-w-md", children: "We couldn't connect to the server." })
3444
+ ] });
3220
3445
 
3221
3446
  // src/components/core/unauthorized.tsx
3222
3447
  var import_lucide_react22 = require("lucide-react");
3223
3448
  var import_react_router5 = require("react-router");
3224
3449
  var import_jsx_runtime39 = require("react/jsx-runtime");
3450
+ var Unauthorized = () => {
3451
+ const navigate = (0, import_react_router5.useNavigate)();
3452
+ const goBack = () => {
3453
+ if (window.history.length > 2) {
3454
+ navigate(-1);
3455
+ } else {
3456
+ navigate("/");
3457
+ }
3458
+ };
3459
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none", children: [
3460
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react22.ShieldOffIcon, { className: "h-15 w-15 text-destructive mb-4" }),
3461
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h1", { className: "text-2xl font-bold text-destructive mb-2", children: "Access Denied" }),
3462
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-xl mb-4", children: "You don't have permission to view this page. Please sign in with an authorized account or contact your administrator." }),
3463
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex space-x-4", children: [
3464
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { variant: "outline", onClick: goBack, children: "Go Back" }),
3465
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router5.NavLink, { to: "/", children: "Go to Home" }) })
3466
+ ] })
3467
+ ] });
3468
+ };
3225
3469
  // Annotate the CommonJS export names for ESM import in node:
3226
3470
  0 && (module.exports = {
3227
3471
  AppMetaProvider,
3228
- Checkmark,
3472
+ CurrencyTransfer,
3229
3473
  DataTable,
3230
3474
  DataTableActionBar,
3231
3475
  DataTableActionBarAction,
@@ -3234,7 +3478,12 @@ var import_jsx_runtime39 = require("react/jsx-runtime");
3234
3478
  DataTemplateActionBar,
3235
3479
  DataTemplateActionBarAction,
3236
3480
  DataTemplateActionBarSelection,
3481
+ ErrorComponent,
3237
3482
  GeneralHelper,
3483
+ Loader,
3484
+ NotFound,
3485
+ OfflineUI,
3486
+ Unauthorized,
3238
3487
  createLayoutComponents,
3239
3488
  createPageTemplateHook,
3240
3489
  createTypedAppMetaContext