scroll-system 1.2.0 → 1.3.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ControlledView.d.ts","sourceRoot":"","sources":["../../components/ControlledView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AAE1E,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,QAAQ,EACR,SAAc,EACd,eAAwB,EACxB,mBAA2B,EAC3B,UAAkB,EAClB,WAAkB,EAClB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,mBAAmB,2CAqErB;AAMD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM;;;;;eAc5B,MAAM,GAAG,MAAM;EAI/B"}
1
+ {"version":3,"file":"ControlledView.d.ts","sourceRoot":"","sources":["../../components/ControlledView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAwB,MAAM,UAAU,CAAC;AAE1E,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,QAAQ,EACR,SAAc,EACd,eAAwB,EACxB,mBAA2B,EAC3B,UAAkB,EAClB,WAAkB,EAClB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,mBAAmB,2CA+ErB;AAMD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM;;;;;eAc5B,MAAM,GAAG,MAAM;EAI/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"FullView.d.ts","sourceRoot":"","sources":["../../components/FullView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,QAAQ,EACR,SAAc,EACd,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,aAAa,2CAyCf"}
1
+ {"version":3,"file":"FullView.d.ts","sourceRoot":"","sources":["../../components/FullView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,QAAQ,EACR,SAAc,EACd,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,aAAa,2CAwCf"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollContainer.d.ts","sourceRoot":"","sources":["../../components/ScrollContainer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,OAAO,KAAK,EAAE,oBAAoB,EAAmC,MAAM,UAAU,CAAC;AAEtF,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAc,EACd,kBAAgD,EAChD,gBAA4C,EAC5C,YAAY,EACZ,aAAa,EAEb,cAAsB,EACtB,eAAuB,EACvB,UAAe,EAEf,oBAA2B,EAC3B,qBAA4B,EAE5B,iBAAyB,EAEzB,WAAwB,EAExB,oBAA4B,EAC5B,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAsB,EACtB,OAAc,GACf,EAAE,oBAAoB,2CA6KtB"}
1
+ {"version":3,"file":"ScrollContainer.d.ts","sourceRoot":"","sources":["../../components/ScrollContainer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,OAAO,KAAK,EAAE,oBAAoB,EAAmC,MAAM,UAAU,CAAC;AAEtF,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAc,EACd,kBAAgD,EAChD,gBAA4C,EAC5C,YAAY,EACZ,aAAa,EAEb,cAAsB,EACtB,eAAuB,EACvB,UAAe,EAEf,oBAA2B,EAC3B,qBAA4B,EAE5B,iBAAyB,EAEzB,WAAwB,EAExB,oBAA4B,EAC5B,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAsB,EACtB,OAAc,GACf,EAAE,oBAAoB,2CAuLtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollLockedView.d.ts","sourceRoot":"","sources":["../../components/ScrollLockedView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,qBAAqB,EAAuB,MAAM,UAAU,CAAC;AAE3E,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,QAAQ,EACR,SAAc,EACd,eAA4B,EAC5B,kBAAyB,EACzB,mBAAuC,EACvC,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,qBAAqB,2CAkGvB"}
1
+ {"version":3,"file":"ScrollLockedView.d.ts","sourceRoot":"","sources":["../../components/ScrollLockedView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,qBAAqB,EAAuB,MAAM,UAAU,CAAC;AAE3E,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,QAAQ,EACR,SAAc,EACd,eAA4B,EAC5B,kBAAyB,EACzB,mBAAuC,EACvC,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,qBAAqB,2CAiHvB"}
package/dist/index.js CHANGED
@@ -1183,10 +1183,20 @@ function ScrollContainer({
1183
1183
  "div",
1184
1184
  {
1185
1185
  ref: containerRef,
1186
- className: `scroll-container fixed inset-0 overflow-hidden w-screen h-screen ${className}`,
1186
+ className: `scroll-container ${className}`,
1187
1187
  role: "main",
1188
1188
  "aria-label": "Scroll container",
1189
1189
  "data-auto-scrolling": autoScrollState.isPlaying,
1190
+ style: {
1191
+ position: "fixed",
1192
+ top: 0,
1193
+ left: 0,
1194
+ right: 0,
1195
+ bottom: 0,
1196
+ overflow: "hidden",
1197
+ width: "100vw",
1198
+ height: "100vh"
1199
+ },
1190
1200
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "scroll-wrapper", style: wrapperStyle, children })
1191
1201
  }
1192
1202
  ) });
@@ -1302,14 +1312,13 @@ function FullView({
1302
1312
  "section",
1303
1313
  {
1304
1314
  id,
1305
- className: `
1306
- full-view
1307
- relative
1308
- w-full h-screen
1309
- overflow-hidden
1310
- ${isActive ? "is-active" : ""}
1311
- ${className}
1312
- `,
1315
+ className: `full-view ${isActive ? "is-active" : ""} ${className}`,
1316
+ style: {
1317
+ position: "relative",
1318
+ width: "100%",
1319
+ height: "100vh",
1320
+ overflow: "hidden"
1321
+ },
1313
1322
  "data-view-type": "full",
1314
1323
  "data-view-index": index,
1315
1324
  "data-view-active": isActive,
@@ -1442,20 +1451,35 @@ function ScrollLockedView({
1442
1451
  }
1443
1452
  wasActive.current = isActive;
1444
1453
  }, [isActive, lastNavigationDirection, scrollResetBehavior, scrollDirection]);
1445
- const scrollClasses = scrollDirection === "vertical" ? "overflow-y-auto overflow-x-hidden" : "overflow-x-auto overflow-y-hidden";
1454
+ const scrollStyles = scrollDirection === "vertical" ? { overflowY: "auto", overflowX: "hidden" } : { overflowX: "auto", overflowY: "hidden" };
1446
1455
  return /* @__PURE__ */ jsxRuntime.jsx(
1447
1456
  "section",
1448
1457
  {
1449
1458
  id,
1450
- className: `relative w-full h-screen ${className}`,
1459
+ className: `scroll-locked-view ${className}`,
1451
1460
  "data-view-type": "scroll-locked",
1452
1461
  "data-active": isActive ? "true" : "false",
1462
+ style: {
1463
+ position: "relative",
1464
+ width: "100%",
1465
+ height: "100vh",
1466
+ overflow: "hidden"
1467
+ },
1453
1468
  children: /* @__PURE__ */ jsxRuntime.jsx(
1454
1469
  "div",
1455
1470
  {
1456
1471
  ref: scrollRef,
1457
- className: `w-full h-full ${scrollClasses} no-scrollbar`,
1458
- style: { scrollbarWidth: "none" },
1472
+ className: "no-scrollbar",
1473
+ style: {
1474
+ position: "absolute",
1475
+ top: 0,
1476
+ left: 0,
1477
+ right: 0,
1478
+ bottom: 0,
1479
+ scrollbarWidth: "none",
1480
+ ...scrollStyles
1481
+ },
1482
+ "data-scrollable": "true",
1459
1483
  children
1460
1484
  }
1461
1485
  )
@@ -1506,29 +1530,39 @@ function ControlledView({
1506
1530
  const lockState = canProceed ? "unlocked" : "locked";
1507
1531
  setExplicitLock(id, lockState);
1508
1532
  }, [id, canProceed, setExplicitLock]);
1509
- const overflowClasses = react.useMemo(() => {
1510
- if (!allowInternalScroll) return "overflow-hidden";
1533
+ const overflowStyles = react.useMemo(() => {
1534
+ if (!allowInternalScroll) return { overflow: "hidden" };
1511
1535
  switch (scrollDirection) {
1512
1536
  case "vertical":
1513
- return "overflow-y-auto overflow-x-hidden";
1537
+ return { overflowY: "auto", overflowX: "hidden" };
1514
1538
  case "horizontal":
1515
- return "overflow-x-auto overflow-y-hidden";
1539
+ return { overflowX: "auto", overflowY: "hidden" };
1516
1540
  default:
1517
- return "overflow-auto";
1541
+ return { overflow: "auto" };
1518
1542
  }
1519
1543
  }, [allowInternalScroll, scrollDirection]);
1520
1544
  return /* @__PURE__ */ jsxRuntime.jsx(
1521
1545
  "section",
1522
1546
  {
1523
1547
  id,
1524
- className: `relative w-full h-screen ${isActive ? "z-10" : "z-0"} ${className}`,
1548
+ className: `controlled-view ${className}`,
1525
1549
  "data-view-type": "controlled",
1526
1550
  "data-active": isActive,
1551
+ style: {
1552
+ position: "relative",
1553
+ width: "100%",
1554
+ height: "100vh",
1555
+ zIndex: isActive ? 10 : 0
1556
+ },
1527
1557
  children: /* @__PURE__ */ jsxRuntime.jsx(
1528
1558
  "div",
1529
1559
  {
1530
1560
  ref: scrollRef,
1531
- className: `w-full h-full ${overflowClasses}`,
1561
+ style: {
1562
+ width: "100%",
1563
+ height: "100%",
1564
+ ...overflowStyles
1565
+ },
1532
1566
  children
1533
1567
  }
1534
1568
  )
package/dist/index.mjs CHANGED
@@ -1181,10 +1181,20 @@ function ScrollContainer({
1181
1181
  "div",
1182
1182
  {
1183
1183
  ref: containerRef,
1184
- className: `scroll-container fixed inset-0 overflow-hidden w-screen h-screen ${className}`,
1184
+ className: `scroll-container ${className}`,
1185
1185
  role: "main",
1186
1186
  "aria-label": "Scroll container",
1187
1187
  "data-auto-scrolling": autoScrollState.isPlaying,
1188
+ style: {
1189
+ position: "fixed",
1190
+ top: 0,
1191
+ left: 0,
1192
+ right: 0,
1193
+ bottom: 0,
1194
+ overflow: "hidden",
1195
+ width: "100vw",
1196
+ height: "100vh"
1197
+ },
1188
1198
  children: /* @__PURE__ */ jsx("div", { className: "scroll-wrapper", style: wrapperStyle, children })
1189
1199
  }
1190
1200
  ) });
@@ -1300,14 +1310,13 @@ function FullView({
1300
1310
  "section",
1301
1311
  {
1302
1312
  id,
1303
- className: `
1304
- full-view
1305
- relative
1306
- w-full h-screen
1307
- overflow-hidden
1308
- ${isActive ? "is-active" : ""}
1309
- ${className}
1310
- `,
1313
+ className: `full-view ${isActive ? "is-active" : ""} ${className}`,
1314
+ style: {
1315
+ position: "relative",
1316
+ width: "100%",
1317
+ height: "100vh",
1318
+ overflow: "hidden"
1319
+ },
1311
1320
  "data-view-type": "full",
1312
1321
  "data-view-index": index,
1313
1322
  "data-view-active": isActive,
@@ -1440,20 +1449,35 @@ function ScrollLockedView({
1440
1449
  }
1441
1450
  wasActive.current = isActive;
1442
1451
  }, [isActive, lastNavigationDirection, scrollResetBehavior, scrollDirection]);
1443
- const scrollClasses = scrollDirection === "vertical" ? "overflow-y-auto overflow-x-hidden" : "overflow-x-auto overflow-y-hidden";
1452
+ const scrollStyles = scrollDirection === "vertical" ? { overflowY: "auto", overflowX: "hidden" } : { overflowX: "auto", overflowY: "hidden" };
1444
1453
  return /* @__PURE__ */ jsx(
1445
1454
  "section",
1446
1455
  {
1447
1456
  id,
1448
- className: `relative w-full h-screen ${className}`,
1457
+ className: `scroll-locked-view ${className}`,
1449
1458
  "data-view-type": "scroll-locked",
1450
1459
  "data-active": isActive ? "true" : "false",
1460
+ style: {
1461
+ position: "relative",
1462
+ width: "100%",
1463
+ height: "100vh",
1464
+ overflow: "hidden"
1465
+ },
1451
1466
  children: /* @__PURE__ */ jsx(
1452
1467
  "div",
1453
1468
  {
1454
1469
  ref: scrollRef,
1455
- className: `w-full h-full ${scrollClasses} no-scrollbar`,
1456
- style: { scrollbarWidth: "none" },
1470
+ className: "no-scrollbar",
1471
+ style: {
1472
+ position: "absolute",
1473
+ top: 0,
1474
+ left: 0,
1475
+ right: 0,
1476
+ bottom: 0,
1477
+ scrollbarWidth: "none",
1478
+ ...scrollStyles
1479
+ },
1480
+ "data-scrollable": "true",
1457
1481
  children
1458
1482
  }
1459
1483
  )
@@ -1504,29 +1528,39 @@ function ControlledView({
1504
1528
  const lockState = canProceed ? "unlocked" : "locked";
1505
1529
  setExplicitLock(id, lockState);
1506
1530
  }, [id, canProceed, setExplicitLock]);
1507
- const overflowClasses = useMemo(() => {
1508
- if (!allowInternalScroll) return "overflow-hidden";
1531
+ const overflowStyles = useMemo(() => {
1532
+ if (!allowInternalScroll) return { overflow: "hidden" };
1509
1533
  switch (scrollDirection) {
1510
1534
  case "vertical":
1511
- return "overflow-y-auto overflow-x-hidden";
1535
+ return { overflowY: "auto", overflowX: "hidden" };
1512
1536
  case "horizontal":
1513
- return "overflow-x-auto overflow-y-hidden";
1537
+ return { overflowX: "auto", overflowY: "hidden" };
1514
1538
  default:
1515
- return "overflow-auto";
1539
+ return { overflow: "auto" };
1516
1540
  }
1517
1541
  }, [allowInternalScroll, scrollDirection]);
1518
1542
  return /* @__PURE__ */ jsx(
1519
1543
  "section",
1520
1544
  {
1521
1545
  id,
1522
- className: `relative w-full h-screen ${isActive ? "z-10" : "z-0"} ${className}`,
1546
+ className: `controlled-view ${className}`,
1523
1547
  "data-view-type": "controlled",
1524
1548
  "data-active": isActive,
1549
+ style: {
1550
+ position: "relative",
1551
+ width: "100%",
1552
+ height: "100vh",
1553
+ zIndex: isActive ? 10 : 0
1554
+ },
1525
1555
  children: /* @__PURE__ */ jsx(
1526
1556
  "div",
1527
1557
  {
1528
1558
  ref: scrollRef,
1529
- className: `w-full h-full ${overflowClasses}`,
1559
+ style: {
1560
+ width: "100%",
1561
+ height: "100%",
1562
+ ...overflowStyles
1563
+ },
1530
1564
  children
1531
1565
  }
1532
1566
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scroll-system",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "TikTok-style vertical scroll system with snap views, touch physics, and accessibility features",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",