virtual-ui-lib 1.0.65 → 1.0.66

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.js CHANGED
@@ -31,6 +31,7 @@ var index_exports = {};
31
31
  __export(index_exports, {
32
32
  Avatar: () => Avatar,
33
33
  AvatarCard: () => AvatarCard,
34
+ BackgoundImageSlider: () => BackgoundImageSlider,
34
35
  Charts: () => Charts,
35
36
  CodeBlock: () => CodeBlock,
36
37
  CustomInputField: () => CustomInputField,
@@ -2265,10 +2266,274 @@ var ImageSlider = ({
2265
2266
  }
2266
2267
  ))));
2267
2268
  };
2269
+
2270
+ // src/components/BackgoundImageSlider/BackgoundImageSlider.jsx
2271
+ var import_react26 = __toESM(require("react"));
2272
+ var BackgoundImageSlider = ({
2273
+ images = [
2274
+ {
2275
+ src: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1400&q=80",
2276
+ tag: "Travel",
2277
+ title: "Hidden Peaks of the Himalayas",
2278
+ description: "A breathtaking journey through untouched landscapes and ancient monasteries."
2279
+ },
2280
+ {
2281
+ src: "https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=1400&q=80",
2282
+ tag: "Urban",
2283
+ title: "City Lights at Night",
2284
+ description: "Explore the vibrant energy of the world's most iconic skylines after dark."
2285
+ },
2286
+ {
2287
+ src: "https://images.unsplash.com/photo-1500534314209-a25ddb2bd429?w=1400&q=80",
2288
+ tag: "Nature",
2289
+ title: "Tropical Beach Paradise",
2290
+ description: "Crystal clear waters and white sand beaches that feel like the edge of the world."
2291
+ },
2292
+ {
2293
+ src: "https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1400&q=80",
2294
+ tag: "Adventure",
2295
+ title: "Starry Mountain Night",
2296
+ description: "Where silence meets the cosmos \u2014 a night sky like you've never seen before."
2297
+ }
2298
+ ],
2299
+ width = "100%",
2300
+ height = "520px",
2301
+ accent = "#6366f1",
2302
+ radius = "0px",
2303
+ showDots = true,
2304
+ autoPlay = false,
2305
+ autoPlayInterval = 4e3
2306
+ }) => {
2307
+ const [current, setCurrent] = (0, import_react26.useState)(0);
2308
+ const [animating, setAnimating] = (0, import_react26.useState)(false);
2309
+ const alpha = (hex, op) => {
2310
+ const r = parseInt(hex.slice(1, 3), 16);
2311
+ const g = parseInt(hex.slice(3, 5), 16);
2312
+ const b = parseInt(hex.slice(5, 7), 16);
2313
+ return `rgba(${r},${g},${b},${op})`;
2314
+ };
2315
+ const go = (0, import_react26.useCallback)((index) => {
2316
+ if (animating) return;
2317
+ setAnimating(true);
2318
+ setCurrent((index + images.length) % images.length);
2319
+ setTimeout(() => setAnimating(false), 400);
2320
+ }, [animating, images.length]);
2321
+ const prev = () => go(current - 1);
2322
+ const next = () => go(current + 1);
2323
+ (0, import_react26.useEffect)(() => {
2324
+ if (!autoPlay) return;
2325
+ const t = setInterval(() => go(current + 1), autoPlayInterval);
2326
+ return () => clearInterval(t);
2327
+ }, [autoPlay, autoPlayInterval, current, go]);
2328
+ const img = images[current];
2329
+ return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("style", null, `
2330
+ @keyframes hs-fade { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
2331
+ @keyframes hs-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
2332
+ .hs-prev:hover, .hs-next:hover { background: rgba(0,0,0,0.65) !important; border-color: rgba(255,255,255,0.35) !important; }
2333
+ `), /* @__PURE__ */ import_react26.default.createElement("div", { style: {
2334
+ position: "relative",
2335
+ width,
2336
+ height,
2337
+ borderRadius: radius,
2338
+ overflow: "hidden",
2339
+ fontFamily: "system-ui, -apple-system, sans-serif",
2340
+ userSelect: "none"
2341
+ } }, /* @__PURE__ */ import_react26.default.createElement(
2342
+ "img",
2343
+ {
2344
+ key: current,
2345
+ src: img.src,
2346
+ alt: img.title,
2347
+ style: {
2348
+ position: "absolute",
2349
+ inset: 0,
2350
+ width: "100%",
2351
+ height: "100%",
2352
+ objectFit: "cover",
2353
+ animation: "hs-fade 0.4s ease"
2354
+ }
2355
+ }
2356
+ ), /* @__PURE__ */ import_react26.default.createElement("div", { style: {
2357
+ position: "absolute",
2358
+ inset: 0,
2359
+ background: "linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.1) 100%)"
2360
+ } }), img.tag && /* @__PURE__ */ import_react26.default.createElement(
2361
+ "div",
2362
+ {
2363
+ key: current + "-tag",
2364
+ style: {
2365
+ position: "absolute",
2366
+ top: "24px",
2367
+ left: "28px",
2368
+ padding: "5px 14px",
2369
+ borderRadius: "20px",
2370
+ background: alpha(accent, 0.85),
2371
+ fontSize: "11px",
2372
+ fontWeight: "700",
2373
+ color: "#fff",
2374
+ letterSpacing: "0.6px",
2375
+ textTransform: "uppercase",
2376
+ animation: "hs-up 0.4s ease"
2377
+ }
2378
+ },
2379
+ img.tag
2380
+ ), /* @__PURE__ */ import_react26.default.createElement("div", { style: {
2381
+ position: "absolute",
2382
+ top: "24px",
2383
+ right: "28px",
2384
+ padding: "5px 12px",
2385
+ borderRadius: "20px",
2386
+ background: "rgba(0,0,0,0.45)",
2387
+ fontSize: "11px",
2388
+ fontWeight: "600",
2389
+ color: "rgba(255,255,255,0.7)"
2390
+ } }, current + 1, " / ", images.length), /* @__PURE__ */ import_react26.default.createElement(
2391
+ "button",
2392
+ {
2393
+ className: "hs-prev",
2394
+ onClick: prev,
2395
+ style: {
2396
+ position: "absolute",
2397
+ left: "20px",
2398
+ top: "50%",
2399
+ transform: "translateY(-50%)",
2400
+ width: "44px",
2401
+ height: "44px",
2402
+ borderRadius: "50%",
2403
+ background: "rgba(0,0,0,0.4)",
2404
+ border: "1px solid rgba(255,255,255,0.2)",
2405
+ color: "#fff",
2406
+ cursor: "pointer",
2407
+ display: "flex",
2408
+ alignItems: "center",
2409
+ justifyContent: "center",
2410
+ transition: "all 0.2s",
2411
+ padding: 0,
2412
+ zIndex: 10
2413
+ }
2414
+ },
2415
+ /* @__PURE__ */ import_react26.default.createElement(
2416
+ "svg",
2417
+ {
2418
+ width: "18",
2419
+ height: "18",
2420
+ viewBox: "0 0 24 24",
2421
+ fill: "none",
2422
+ stroke: "currentColor",
2423
+ strokeWidth: "2.5",
2424
+ strokeLinecap: "round",
2425
+ strokeLinejoin: "round"
2426
+ },
2427
+ /* @__PURE__ */ import_react26.default.createElement("polyline", { points: "15 18 9 12 15 6" })
2428
+ )
2429
+ ), /* @__PURE__ */ import_react26.default.createElement(
2430
+ "button",
2431
+ {
2432
+ className: "hs-next",
2433
+ onClick: next,
2434
+ style: {
2435
+ position: "absolute",
2436
+ right: "20px",
2437
+ top: "50%",
2438
+ transform: "translateY(-50%)",
2439
+ width: "44px",
2440
+ height: "44px",
2441
+ borderRadius: "50%",
2442
+ background: "rgba(0,0,0,0.4)",
2443
+ border: "1px solid rgba(255,255,255,0.2)",
2444
+ color: "#fff",
2445
+ cursor: "pointer",
2446
+ display: "flex",
2447
+ alignItems: "center",
2448
+ justifyContent: "center",
2449
+ transition: "all 0.2s",
2450
+ padding: 0,
2451
+ zIndex: 10
2452
+ }
2453
+ },
2454
+ /* @__PURE__ */ import_react26.default.createElement(
2455
+ "svg",
2456
+ {
2457
+ width: "18",
2458
+ height: "18",
2459
+ viewBox: "0 0 24 24",
2460
+ fill: "none",
2461
+ stroke: "currentColor",
2462
+ strokeWidth: "2.5",
2463
+ strokeLinecap: "round",
2464
+ strokeLinejoin: "round"
2465
+ },
2466
+ /* @__PURE__ */ import_react26.default.createElement("polyline", { points: "9 18 15 12 9 6" })
2467
+ )
2468
+ ), /* @__PURE__ */ import_react26.default.createElement("div", { style: {
2469
+ position: "absolute",
2470
+ bottom: showDots ? "56px" : "28px",
2471
+ left: "28px",
2472
+ right: "28px",
2473
+ zIndex: 5
2474
+ } }, /* @__PURE__ */ import_react26.default.createElement(
2475
+ "h2",
2476
+ {
2477
+ key: current + "-title",
2478
+ style: {
2479
+ fontSize: "clamp(20px, 4vw, 36px)",
2480
+ fontWeight: "800",
2481
+ color: "#fff",
2482
+ margin: "0 0 8px",
2483
+ lineHeight: 1.25,
2484
+ textShadow: "0 2px 12px rgba(0,0,0,0.4)",
2485
+ animation: "hs-up 0.45s ease",
2486
+ maxWidth: "600px"
2487
+ }
2488
+ },
2489
+ img.title
2490
+ ), /* @__PURE__ */ import_react26.default.createElement(
2491
+ "p",
2492
+ {
2493
+ key: current + "-desc",
2494
+ style: {
2495
+ fontSize: "clamp(13px, 2vw, 15px)",
2496
+ color: "rgba(255,255,255,0.7)",
2497
+ margin: 0,
2498
+ lineHeight: 1.6,
2499
+ textShadow: "0 1px 6px rgba(0,0,0,0.5)",
2500
+ animation: "hs-up 0.5s ease",
2501
+ maxWidth: "500px"
2502
+ }
2503
+ },
2504
+ img.description
2505
+ )), showDots && /* @__PURE__ */ import_react26.default.createElement("div", { style: {
2506
+ position: "absolute",
2507
+ bottom: "20px",
2508
+ left: 0,
2509
+ right: 0,
2510
+ display: "flex",
2511
+ justifyContent: "center",
2512
+ gap: "6px",
2513
+ zIndex: 5
2514
+ } }, images.map((_, i) => /* @__PURE__ */ import_react26.default.createElement(
2515
+ "button",
2516
+ {
2517
+ key: i,
2518
+ onClick: () => go(i),
2519
+ style: {
2520
+ width: i === current ? "24px" : "7px",
2521
+ height: "7px",
2522
+ borderRadius: "4px",
2523
+ border: "none",
2524
+ padding: 0,
2525
+ cursor: "pointer",
2526
+ background: i === current ? accent : "rgba(255,255,255,0.4)",
2527
+ transition: "all 0.3s ease"
2528
+ }
2529
+ }
2530
+ )))));
2531
+ };
2268
2532
  // Annotate the CommonJS export names for ESM import in node:
2269
2533
  0 && (module.exports = {
2270
2534
  Avatar,
2271
2535
  AvatarCard,
2536
+ BackgoundImageSlider,
2272
2537
  Charts,
2273
2538
  CodeBlock,
2274
2539
  CustomInputField,
package/dist/index.mjs CHANGED
@@ -2206,9 +2206,273 @@ var ImageSlider = ({
2206
2206
  }
2207
2207
  ))));
2208
2208
  };
2209
+
2210
+ // src/components/BackgoundImageSlider/BackgoundImageSlider.jsx
2211
+ import React26, { useState as useState19, useEffect as useEffect7, useCallback } from "react";
2212
+ var BackgoundImageSlider = ({
2213
+ images = [
2214
+ {
2215
+ src: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1400&q=80",
2216
+ tag: "Travel",
2217
+ title: "Hidden Peaks of the Himalayas",
2218
+ description: "A breathtaking journey through untouched landscapes and ancient monasteries."
2219
+ },
2220
+ {
2221
+ src: "https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=1400&q=80",
2222
+ tag: "Urban",
2223
+ title: "City Lights at Night",
2224
+ description: "Explore the vibrant energy of the world's most iconic skylines after dark."
2225
+ },
2226
+ {
2227
+ src: "https://images.unsplash.com/photo-1500534314209-a25ddb2bd429?w=1400&q=80",
2228
+ tag: "Nature",
2229
+ title: "Tropical Beach Paradise",
2230
+ description: "Crystal clear waters and white sand beaches that feel like the edge of the world."
2231
+ },
2232
+ {
2233
+ src: "https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1400&q=80",
2234
+ tag: "Adventure",
2235
+ title: "Starry Mountain Night",
2236
+ description: "Where silence meets the cosmos \u2014 a night sky like you've never seen before."
2237
+ }
2238
+ ],
2239
+ width = "100%",
2240
+ height = "520px",
2241
+ accent = "#6366f1",
2242
+ radius = "0px",
2243
+ showDots = true,
2244
+ autoPlay = false,
2245
+ autoPlayInterval = 4e3
2246
+ }) => {
2247
+ const [current, setCurrent] = useState19(0);
2248
+ const [animating, setAnimating] = useState19(false);
2249
+ const alpha = (hex, op) => {
2250
+ const r = parseInt(hex.slice(1, 3), 16);
2251
+ const g = parseInt(hex.slice(3, 5), 16);
2252
+ const b = parseInt(hex.slice(5, 7), 16);
2253
+ return `rgba(${r},${g},${b},${op})`;
2254
+ };
2255
+ const go = useCallback((index) => {
2256
+ if (animating) return;
2257
+ setAnimating(true);
2258
+ setCurrent((index + images.length) % images.length);
2259
+ setTimeout(() => setAnimating(false), 400);
2260
+ }, [animating, images.length]);
2261
+ const prev = () => go(current - 1);
2262
+ const next = () => go(current + 1);
2263
+ useEffect7(() => {
2264
+ if (!autoPlay) return;
2265
+ const t = setInterval(() => go(current + 1), autoPlayInterval);
2266
+ return () => clearInterval(t);
2267
+ }, [autoPlay, autoPlayInterval, current, go]);
2268
+ const img = images[current];
2269
+ return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement("style", null, `
2270
+ @keyframes hs-fade { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
2271
+ @keyframes hs-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
2272
+ .hs-prev:hover, .hs-next:hover { background: rgba(0,0,0,0.65) !important; border-color: rgba(255,255,255,0.35) !important; }
2273
+ `), /* @__PURE__ */ React26.createElement("div", { style: {
2274
+ position: "relative",
2275
+ width,
2276
+ height,
2277
+ borderRadius: radius,
2278
+ overflow: "hidden",
2279
+ fontFamily: "system-ui, -apple-system, sans-serif",
2280
+ userSelect: "none"
2281
+ } }, /* @__PURE__ */ React26.createElement(
2282
+ "img",
2283
+ {
2284
+ key: current,
2285
+ src: img.src,
2286
+ alt: img.title,
2287
+ style: {
2288
+ position: "absolute",
2289
+ inset: 0,
2290
+ width: "100%",
2291
+ height: "100%",
2292
+ objectFit: "cover",
2293
+ animation: "hs-fade 0.4s ease"
2294
+ }
2295
+ }
2296
+ ), /* @__PURE__ */ React26.createElement("div", { style: {
2297
+ position: "absolute",
2298
+ inset: 0,
2299
+ background: "linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.1) 100%)"
2300
+ } }), img.tag && /* @__PURE__ */ React26.createElement(
2301
+ "div",
2302
+ {
2303
+ key: current + "-tag",
2304
+ style: {
2305
+ position: "absolute",
2306
+ top: "24px",
2307
+ left: "28px",
2308
+ padding: "5px 14px",
2309
+ borderRadius: "20px",
2310
+ background: alpha(accent, 0.85),
2311
+ fontSize: "11px",
2312
+ fontWeight: "700",
2313
+ color: "#fff",
2314
+ letterSpacing: "0.6px",
2315
+ textTransform: "uppercase",
2316
+ animation: "hs-up 0.4s ease"
2317
+ }
2318
+ },
2319
+ img.tag
2320
+ ), /* @__PURE__ */ React26.createElement("div", { style: {
2321
+ position: "absolute",
2322
+ top: "24px",
2323
+ right: "28px",
2324
+ padding: "5px 12px",
2325
+ borderRadius: "20px",
2326
+ background: "rgba(0,0,0,0.45)",
2327
+ fontSize: "11px",
2328
+ fontWeight: "600",
2329
+ color: "rgba(255,255,255,0.7)"
2330
+ } }, current + 1, " / ", images.length), /* @__PURE__ */ React26.createElement(
2331
+ "button",
2332
+ {
2333
+ className: "hs-prev",
2334
+ onClick: prev,
2335
+ style: {
2336
+ position: "absolute",
2337
+ left: "20px",
2338
+ top: "50%",
2339
+ transform: "translateY(-50%)",
2340
+ width: "44px",
2341
+ height: "44px",
2342
+ borderRadius: "50%",
2343
+ background: "rgba(0,0,0,0.4)",
2344
+ border: "1px solid rgba(255,255,255,0.2)",
2345
+ color: "#fff",
2346
+ cursor: "pointer",
2347
+ display: "flex",
2348
+ alignItems: "center",
2349
+ justifyContent: "center",
2350
+ transition: "all 0.2s",
2351
+ padding: 0,
2352
+ zIndex: 10
2353
+ }
2354
+ },
2355
+ /* @__PURE__ */ React26.createElement(
2356
+ "svg",
2357
+ {
2358
+ width: "18",
2359
+ height: "18",
2360
+ viewBox: "0 0 24 24",
2361
+ fill: "none",
2362
+ stroke: "currentColor",
2363
+ strokeWidth: "2.5",
2364
+ strokeLinecap: "round",
2365
+ strokeLinejoin: "round"
2366
+ },
2367
+ /* @__PURE__ */ React26.createElement("polyline", { points: "15 18 9 12 15 6" })
2368
+ )
2369
+ ), /* @__PURE__ */ React26.createElement(
2370
+ "button",
2371
+ {
2372
+ className: "hs-next",
2373
+ onClick: next,
2374
+ style: {
2375
+ position: "absolute",
2376
+ right: "20px",
2377
+ top: "50%",
2378
+ transform: "translateY(-50%)",
2379
+ width: "44px",
2380
+ height: "44px",
2381
+ borderRadius: "50%",
2382
+ background: "rgba(0,0,0,0.4)",
2383
+ border: "1px solid rgba(255,255,255,0.2)",
2384
+ color: "#fff",
2385
+ cursor: "pointer",
2386
+ display: "flex",
2387
+ alignItems: "center",
2388
+ justifyContent: "center",
2389
+ transition: "all 0.2s",
2390
+ padding: 0,
2391
+ zIndex: 10
2392
+ }
2393
+ },
2394
+ /* @__PURE__ */ React26.createElement(
2395
+ "svg",
2396
+ {
2397
+ width: "18",
2398
+ height: "18",
2399
+ viewBox: "0 0 24 24",
2400
+ fill: "none",
2401
+ stroke: "currentColor",
2402
+ strokeWidth: "2.5",
2403
+ strokeLinecap: "round",
2404
+ strokeLinejoin: "round"
2405
+ },
2406
+ /* @__PURE__ */ React26.createElement("polyline", { points: "9 18 15 12 9 6" })
2407
+ )
2408
+ ), /* @__PURE__ */ React26.createElement("div", { style: {
2409
+ position: "absolute",
2410
+ bottom: showDots ? "56px" : "28px",
2411
+ left: "28px",
2412
+ right: "28px",
2413
+ zIndex: 5
2414
+ } }, /* @__PURE__ */ React26.createElement(
2415
+ "h2",
2416
+ {
2417
+ key: current + "-title",
2418
+ style: {
2419
+ fontSize: "clamp(20px, 4vw, 36px)",
2420
+ fontWeight: "800",
2421
+ color: "#fff",
2422
+ margin: "0 0 8px",
2423
+ lineHeight: 1.25,
2424
+ textShadow: "0 2px 12px rgba(0,0,0,0.4)",
2425
+ animation: "hs-up 0.45s ease",
2426
+ maxWidth: "600px"
2427
+ }
2428
+ },
2429
+ img.title
2430
+ ), /* @__PURE__ */ React26.createElement(
2431
+ "p",
2432
+ {
2433
+ key: current + "-desc",
2434
+ style: {
2435
+ fontSize: "clamp(13px, 2vw, 15px)",
2436
+ color: "rgba(255,255,255,0.7)",
2437
+ margin: 0,
2438
+ lineHeight: 1.6,
2439
+ textShadow: "0 1px 6px rgba(0,0,0,0.5)",
2440
+ animation: "hs-up 0.5s ease",
2441
+ maxWidth: "500px"
2442
+ }
2443
+ },
2444
+ img.description
2445
+ )), showDots && /* @__PURE__ */ React26.createElement("div", { style: {
2446
+ position: "absolute",
2447
+ bottom: "20px",
2448
+ left: 0,
2449
+ right: 0,
2450
+ display: "flex",
2451
+ justifyContent: "center",
2452
+ gap: "6px",
2453
+ zIndex: 5
2454
+ } }, images.map((_, i) => /* @__PURE__ */ React26.createElement(
2455
+ "button",
2456
+ {
2457
+ key: i,
2458
+ onClick: () => go(i),
2459
+ style: {
2460
+ width: i === current ? "24px" : "7px",
2461
+ height: "7px",
2462
+ borderRadius: "4px",
2463
+ border: "none",
2464
+ padding: 0,
2465
+ cursor: "pointer",
2466
+ background: i === current ? accent : "rgba(255,255,255,0.4)",
2467
+ transition: "all 0.3s ease"
2468
+ }
2469
+ }
2470
+ )))));
2471
+ };
2209
2472
  export {
2210
2473
  Avatar,
2211
2474
  AvatarCard,
2475
+ BackgoundImageSlider,
2212
2476
  Charts,
2213
2477
  CodeBlock,
2214
2478
  CustomInputField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-ui-lib",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "Virtual UI React Component Library",
5
5
  "author": "Ankush",
6
6
  "license": "ISC",