@underverse-ui/underverse 1.0.30 → 1.0.32

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,6 +1,6 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "sourceEntry": "src/index.ts",
5
5
  "totalExports": 206,
6
6
  "exports": [
package/dist/index.cjs CHANGED
@@ -107,7 +107,7 @@ __export(index_exports, {
107
107
  NotificationModal: () => NotificationModal_default,
108
108
  NumberInput: () => NumberInput,
109
109
  OverlayControls: () => OverlayControls,
110
- OverlayScrollbarProvider: () => OverlayScrollbarProvider,
110
+ OverlayScrollbarProvider: () => OverlayScrollbarProvider_default,
111
111
  PageLoading: () => PageLoading,
112
112
  Pagination: () => Pagination,
113
113
  PasswordInput: () => PasswordInput,
@@ -5828,7 +5828,7 @@ var ScrollArea = (0, import_react14.forwardRef)(
5828
5828
  className
5829
5829
  ),
5830
5830
  ...props,
5831
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport", contentClassName), children })
5831
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport custom-scrollbar", contentClassName), "data-os-scrollbar": true, children })
5832
5832
  }
5833
5833
  );
5834
5834
  }
@@ -7098,7 +7098,6 @@ function WheelColumn({
7098
7098
  ref: scrollRef,
7099
7099
  className: cn(
7100
7100
  "h-full overflow-y-auto overscroll-contain snap-y snap-mandatory",
7101
- "scrollbar-none",
7102
7101
  "select-none cursor-grab active:cursor-grabbing",
7103
7102
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-xl"
7104
7103
  ),
@@ -8522,7 +8521,6 @@ function WheelColumn2({
8522
8521
  ref: scrollRef,
8523
8522
  className: cn(
8524
8523
  "h-full overflow-y-auto overscroll-contain snap-y snap-mandatory",
8525
- "scrollbar-none",
8526
8524
  "select-none cursor-grab active:cursor-grabbing",
8527
8525
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-xl"
8528
8526
  ),
@@ -10283,7 +10281,7 @@ function CalendarTimelineHeader(props) {
10283
10281
  ]
10284
10282
  }
10285
10283
  ) : null,
10286
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: headerRef, className: "flex-1 min-w-0 overflow-x-auto overflow-y-hidden scrollbar-none", children: slotHeaderNodes })
10284
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref: headerRef, className: "flex-1 min-w-0 overflow-x-auto overflow-y-hidden", children: slotHeaderNodes })
10287
10285
  ] })
10288
10286
  ] });
10289
10287
  }
@@ -11874,7 +11872,7 @@ function CalendarTimeline({
11874
11872
  "div",
11875
11873
  {
11876
11874
  ref: leftRef,
11877
- className: "shrink-0 overflow-y-auto overflow-x-hidden scrollbar-none",
11875
+ className: "shrink-0 overflow-y-auto overflow-x-hidden",
11878
11876
  style: { width: effectiveResourceColumnWidth, minWidth: effectiveResourceColumnWidth },
11879
11877
  children: [
11880
11878
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { style: { height: topSpacer } }),
@@ -11904,7 +11902,8 @@ function CalendarTimeline({
11904
11902
  "div",
11905
11903
  {
11906
11904
  ref: bodyRef,
11907
- className: "relative flex-1 overflow-auto scrollbar-thin scrollbar-thumb-muted scrollbar-track-transparent",
11905
+ className: "relative flex-1 overflow-auto custom-scrollbar",
11906
+ "data-os-scrollbar": true,
11908
11907
  onPointerMove,
11909
11908
  onPointerUp,
11910
11909
  onPointerLeave: () => setHoverCell(null),
@@ -14117,12 +14116,13 @@ function CategoryTreeSelect(props) {
14117
14116
  "div",
14118
14117
  {
14119
14118
  className: cn(
14120
- "absolute z-20 mt-2 w-full max-h-80 overflow-auto",
14119
+ "absolute z-20 mt-2 w-full max-h-80 overflow-auto custom-scrollbar",
14121
14120
  "rounded-2xl md:rounded-3xl border border-border/40 bg-popover/95 text-popover-foreground",
14122
14121
  "shadow-2xl backdrop-blur-xl",
14123
14122
  "p-2",
14124
14123
  "animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
14125
14124
  ),
14125
+ "data-os-scrollbar": true,
14126
14126
  children: [
14127
14127
  renderSearch(),
14128
14128
  renderTreeContent()
@@ -19018,16 +19018,14 @@ var LoadingBar = ({
19018
19018
  // ../../components/ui/OverlayScrollbarProvider.tsx
19019
19019
  var import_react33 = require("react");
19020
19020
  var import_overlayscrollbars = require("overlayscrollbars");
19021
- var EXPLICIT_SCROLLABLE_SELECTOR = [".thin-scrollbar", ".scrollbar-thin", ".custom-scrollbar", "[data-os-scrollbar]"].join(", ");
19022
- var GENERIC_SCROLLABLE_SELECTOR = [
19023
- ".overflow-auto",
19024
- ".overflow-x-auto",
19025
- ".overflow-y-auto",
19026
- ".overflow-scroll",
19027
- ".overflow-x-scroll",
19028
- ".overflow-y-scroll"
19021
+ var EXPLICIT_SELECTOR = [".thin-scrollbar", ".scrollbar-thin", ".custom-scrollbar", "[data-os-scrollbar]"].join(", ");
19022
+ var PORTAL_EXCLUDE_SELECTOR = [
19023
+ "[data-radix-portal]",
19024
+ "[role='dialog']",
19025
+ "[aria-modal='true']",
19026
+ "[data-sonner-toaster]"
19029
19027
  ].join(", ");
19030
- var SCROLLBAR_OPTIONS = {
19028
+ var OPTIONS = {
19031
19029
  scrollbars: {
19032
19030
  theme: "os-theme-underverse",
19033
19031
  visibility: "auto",
@@ -19037,42 +19035,27 @@ var SCROLLBAR_OPTIONS = {
19037
19035
  clickScroll: false
19038
19036
  }
19039
19037
  };
19038
+ function shouldSkip(element) {
19039
+ if (element === document.body || element === document.documentElement) return true;
19040
+ if (element.hasAttribute("data-os-ignore")) return true;
19041
+ if (element.hasAttribute("data-overlayscrollbars")) return true;
19042
+ if (element.closest(PORTAL_EXCLUDE_SELECTOR)) return true;
19043
+ return false;
19044
+ }
19040
19045
  function OverlayScrollbarProvider() {
19041
19046
  (0, import_react33.useEffect)(() => {
19042
- const bodyInstance = (0, import_overlayscrollbars.OverlayScrollbars)(document.body, SCROLLBAR_OPTIONS);
19043
19047
  const instances = /* @__PURE__ */ new Map();
19044
- const shouldSkip = (element) => {
19045
- if (element === document.body) return true;
19046
- if (element.classList.contains("scrollbar-none")) return true;
19047
- if (element.hasAttribute("data-overlayscrollbars")) return true;
19048
- return false;
19049
- };
19050
- const initElement = (element) => {
19048
+ let rafId = 0;
19049
+ const init = (element) => {
19051
19050
  if (shouldSkip(element)) return;
19052
19051
  if (instances.has(element)) return;
19053
- instances.set(element, (0, import_overlayscrollbars.OverlayScrollbars)(element, SCROLLBAR_OPTIONS));
19054
- };
19055
- const collectCandidates = (root, selector) => {
19056
- const candidates = [];
19057
- if (root instanceof HTMLElement && root.matches(selector)) {
19058
- candidates.push(root);
19059
- }
19060
- if ("querySelectorAll" in root) {
19061
- root.querySelectorAll(selector).forEach((element) => {
19062
- candidates.push(element);
19063
- });
19064
- }
19065
- return candidates.filter((element, index) => candidates.indexOf(element) === index);
19052
+ instances.set(element, (0, import_overlayscrollbars.OverlayScrollbars)(element, OPTIONS));
19066
19053
  };
19067
19054
  const scan = (root) => {
19068
- const explicitCandidates = collectCandidates(root, EXPLICIT_SCROLLABLE_SELECTOR).filter((element) => !shouldSkip(element));
19069
- explicitCandidates.forEach(initElement);
19070
- const genericCandidates = collectCandidates(root, GENERIC_SCROLLABLE_SELECTOR).filter((element) => !shouldSkip(element));
19071
- const filteredGeneric = genericCandidates.filter(
19072
- (element) => !explicitCandidates.some((explicit) => explicit === element || explicit.contains(element) || element.contains(explicit))
19073
- );
19074
- const leafGeneric = filteredGeneric.filter((element) => !filteredGeneric.some((other) => other !== element && element.contains(other)));
19075
- leafGeneric.forEach(initElement);
19055
+ if (root instanceof HTMLElement && root.matches(EXPLICIT_SELECTOR)) {
19056
+ init(root);
19057
+ }
19058
+ root.querySelectorAll(EXPLICIT_SELECTOR).forEach(init);
19076
19059
  };
19077
19060
  const cleanup = () => {
19078
19061
  instances.forEach((instance, element) => {
@@ -19083,14 +19066,13 @@ function OverlayScrollbarProvider() {
19083
19066
  });
19084
19067
  };
19085
19068
  scan(document.body);
19086
- let rafId = 0;
19087
19069
  const observer = new MutationObserver((mutations) => {
19088
19070
  if (rafId) return;
19089
- rafId = window.requestAnimationFrame(() => {
19071
+ rafId = requestAnimationFrame(() => {
19090
19072
  rafId = 0;
19091
19073
  const scanRoots = /* @__PURE__ */ new Set();
19092
19074
  mutations.forEach((mutation) => {
19093
- if (mutation.target instanceof Element || mutation.target instanceof Document || mutation.target instanceof DocumentFragment) {
19075
+ if (mutation.target instanceof HTMLElement || mutation.target instanceof Document || mutation.target instanceof DocumentFragment) {
19094
19076
  scanRoots.add(mutation.target);
19095
19077
  }
19096
19078
  mutation.addedNodes.forEach((node) => {
@@ -19103,16 +19085,17 @@ function OverlayScrollbarProvider() {
19103
19085
  cleanup();
19104
19086
  });
19105
19087
  });
19106
- observer.observe(document.body, { childList: true, subtree: true });
19088
+ observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["class"] });
19107
19089
  return () => {
19108
- if (rafId) window.cancelAnimationFrame(rafId);
19090
+ if (rafId) cancelAnimationFrame(rafId);
19109
19091
  observer.disconnect();
19110
19092
  instances.forEach((instance) => instance.destroy());
19111
- bodyInstance.destroy();
19093
+ instances.clear();
19112
19094
  };
19113
19095
  }, []);
19114
19096
  return null;
19115
19097
  }
19098
+ var OverlayScrollbarProvider_default = OverlayScrollbarProvider;
19116
19099
 
19117
19100
  // ../../components/ui/Table.tsx
19118
19101
  var import_react34 = __toESM(require("react"), 1);
@@ -19125,12 +19108,13 @@ var Table = import_react34.default.forwardRef(({ className, containerClassName,
19125
19108
  "div",
19126
19109
  {
19127
19110
  className: cn(
19128
- "relative w-full overflow-auto",
19111
+ "relative w-full overflow-auto custom-scrollbar",
19129
19112
  "rounded-2xl md:rounded-3xl border border-border",
19130
19113
  "bg-card text-card-foreground shadow-sm",
19131
19114
  "backdrop-blur-sm transition-all duration-300",
19132
19115
  containerClassName
19133
19116
  ),
19117
+ "data-os-scrollbar": true,
19134
19118
  children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props })
19135
19119
  }
19136
19120
  );
@@ -20062,7 +20046,7 @@ function DataTable({
20062
20046
  children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
20063
20047
  "div",
20064
20048
  {
20065
- className: "thin-scrollbar custom-scrollbar w-full",
20049
+ className: "custom-scrollbar w-full",
20066
20050
  "data-os-scrollbar": true,
20067
20051
  style: stickyHeader ? {
20068
20052
  maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight,