@pelatform/ui.components 0.1.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.
@@ -0,0 +1,12 @@
1
+ "use client";
2
+
3
+ // src/lib/cn.ts
4
+ import { clsx } from "clsx";
5
+ import { twMerge } from "tailwind-merge";
6
+ function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
8
+ }
9
+
10
+ export {
11
+ cn
12
+ };
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import {
3
+ cn
4
+ } from "./chunk-2TQSHVXA.js";
5
+
6
+ // src/ui/base/scroll-area.tsx
7
+ import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ function ScrollArea({ className, children, ...props }) {
10
+ return /* @__PURE__ */ jsxs(
11
+ ScrollAreaPrimitive.Root,
12
+ {
13
+ "data-slot": "scroll-area",
14
+ className: cn("cn-scroll-area relative", className),
15
+ ...props,
16
+ children: [
17
+ /* @__PURE__ */ jsx(
18
+ ScrollAreaPrimitive.Viewport,
19
+ {
20
+ "data-slot": "scroll-area-viewport",
21
+ className: "cn-scroll-area-viewport size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
22
+ children
23
+ }
24
+ ),
25
+ /* @__PURE__ */ jsx(ScrollBar, {}),
26
+ /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
27
+ ]
28
+ }
29
+ );
30
+ }
31
+ function ScrollBar({
32
+ className,
33
+ orientation = "vertical",
34
+ ...props
35
+ }) {
36
+ return /* @__PURE__ */ jsx(
37
+ ScrollAreaPrimitive.Scrollbar,
38
+ {
39
+ "data-slot": "scroll-area-scrollbar",
40
+ "data-orientation": orientation,
41
+ orientation,
42
+ className: cn(
43
+ "cn-scroll-area-scrollbar flex touch-none select-none p-px transition-colors",
44
+ className
45
+ ),
46
+ ...props,
47
+ children: /* @__PURE__ */ jsx(
48
+ ScrollAreaPrimitive.Thumb,
49
+ {
50
+ "data-slot": "scroll-area-thumb",
51
+ className: "cn-scroll-area-thumb relative flex-1 bg-border"
52
+ }
53
+ )
54
+ }
55
+ );
56
+ }
57
+
58
+ // src/hooks/use-is-mobile.ts
59
+ import * as React from "react";
60
+ var DEFAULT_MOBILE_BREAKPOINT = 1024;
61
+ function useIsMobile(breakpoint = DEFAULT_MOBILE_BREAKPOINT) {
62
+ const [isMobile, setIsMobile] = React.useState(void 0);
63
+ React.useEffect(() => {
64
+ const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
65
+ const onChange = () => {
66
+ setIsMobile(window.innerWidth < breakpoint);
67
+ };
68
+ mql.addEventListener("change", onChange);
69
+ setIsMobile(window.innerWidth < breakpoint);
70
+ return () => mql.removeEventListener("change", onChange);
71
+ }, [breakpoint]);
72
+ return !!isMobile;
73
+ }
74
+
75
+ export {
76
+ ScrollArea,
77
+ ScrollBar,
78
+ useIsMobile
79
+ };
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use client";