🛠️ Update `WithoutChild` type import + format scroll-area.ts file
🚀 Deploy / ☁️ API (push) Has been cancelled
📦 Build / 🛠️ Build app (push) Has been cancelled
🧑‍🚀 Check / ⚙️ Linting (push) Has been cancelled
🧑‍🚀 Check / 📦 SVGs Size (push) Has been cancelled

This commit is contained in:
pheralb
2025-09-26 16:10:15 +01:00
parent 0eaf2ab125
commit 2af89d3578
4 changed files with 18 additions and 25 deletions
+7 -8
View File
@@ -1,13 +1,12 @@
import Scrollbar from "./scroll-area-scrollbar.svelte";
import Root from "./scroll-area.svelte"; import Root from "./scroll-area.svelte";
import Mask from "./scroll-area-mask.svelte"; import Mask from "./scroll-area-mask.svelte";
import Scrollbar from "./scroll-area-scrollbar.svelte";
export { export {
Root, Root,
Scrollbar, Scrollbar,
Mask, Mask,
// Root as ScrollArea,
Root as ScrollArea, Scrollbar as ScrollAreaScrollbar,
Scrollbar as ScrollAreaScrollbar, Mask as ScrollAreaMask,
Mask as ScrollAreaMask,
}; };
@@ -1,6 +1,8 @@
<script lang="ts"> <script lang="ts">
import type { WithoutChild } from "@/types/components";
import { cn } from "@/utils/cn";
import { ScrollArea as ScrollAreaPrimitive } from "bits-ui"; import { ScrollArea as ScrollAreaPrimitive } from "bits-ui";
import { cn, type WithoutChild } from "@/utils/cn";
import { useHasPrimaryTouch } from "@/hooks/use-has-primary-touch"; import { useHasPrimaryTouch } from "@/hooks/use-has-primary-touch";
let { let {
@@ -1,9 +1,12 @@
<script lang="ts"> <script lang="ts">
import { cn, type WithoutChild } from "@/utils/cn"; import type { WithoutChild } from "@/types/components";
import { ScrollArea as ScrollAreaPrimitive } from "bits-ui";
import { cn } from "@/utils/cn";
import { useHasPrimaryTouch } from "@/hooks/use-has-primary-touch";
import { Scrollbar } from "./index.js"; import { Scrollbar } from "./index.js";
import ScrollAreaMask from "./scroll-area-mask.svelte"; import ScrollAreaMask from "./scroll-area-mask.svelte";
import { useHasPrimaryTouch } from "@/hooks/use-has-primary-touch"; import { ScrollArea as ScrollAreaPrimitive } from "bits-ui";
type Mask = { type Mask = {
top: boolean; top: boolean;
+2 -13
View File
@@ -1,17 +1,6 @@
import { type ClassValue, clsx } from "clsx"; import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)); return twMerge(clsx(inputs));
} }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type WithoutChild<T> = T extends { child?: any } ? Omit<T, "child"> : T;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type WithoutChildren<T> = T extends { children?: any }
? Omit<T, "children">
: T;
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
ref?: U | null;
};