mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
🛠️ Update `WithoutChild` type import + format scroll-area.ts file
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
+1
-12
@@ -2,16 +2,5 @@ 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;
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user