@stackshift-ui/scroll-area 1.0.0-beta.1 → 1.0.0-beta.4

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,70 @@
1
+ // src/scroll-area.tsx
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+ import { cn, DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ var displayName = "ScrollArea";
6
+ var displayNameScrollbar = "ScrollAreaScrollbar";
7
+ function ScrollArea({
8
+ className,
9
+ children,
10
+ ...props
11
+ }) {
12
+ const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
13
+ return /* @__PURE__ */ jsxs(
14
+ Component,
15
+ {
16
+ as: ScrollAreaPrimitive.Root,
17
+ "data-slot": "scroll-area",
18
+ className: cn("relative", className),
19
+ ...props,
20
+ children: [
21
+ /* @__PURE__ */ jsx(
22
+ ScrollAreaPrimitive.Viewport,
23
+ {
24
+ "data-slot": "scroll-area-viewport",
25
+ className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
26
+ children
27
+ }
28
+ ),
29
+ /* @__PURE__ */ jsx(ScrollBar, {}),
30
+ /* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
31
+ ]
32
+ }
33
+ );
34
+ }
35
+ ScrollArea.displayName = displayName;
36
+ function ScrollBar({
37
+ className,
38
+ orientation = "vertical",
39
+ ...props
40
+ }) {
41
+ const { [displayNameScrollbar]: Component = DefaultComponent } = useStackShiftUIComponents();
42
+ return /* @__PURE__ */ jsx(
43
+ Component,
44
+ {
45
+ as: ScrollAreaPrimitive.ScrollAreaScrollbar,
46
+ "data-slot": "scroll-area-scrollbar",
47
+ orientation,
48
+ className: cn(
49
+ "flex touch-none p-px transition-colors select-none",
50
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
51
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
52
+ className
53
+ ),
54
+ ...props,
55
+ children: /* @__PURE__ */ jsx(
56
+ ScrollAreaPrimitive.ScrollAreaThumb,
57
+ {
58
+ "data-slot": "scroll-area-thumb",
59
+ className: "bg-border relative flex-1 rounded-full"
60
+ }
61
+ )
62
+ }
63
+ );
64
+ }
65
+ ScrollBar.displayName = displayNameScrollbar;
66
+
67
+ export {
68
+ ScrollArea,
69
+ ScrollBar
70
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stackshift-ui/scroll-area",
3
3
  "description": "Augments native scroll functionality for custom, cross-browser styling.",
4
- "version": "1.0.0-beta.1",
4
+ "version": "1.0.0-beta.4",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -35,11 +35,11 @@
35
35
  "dependencies": {
36
36
  "@radix-ui/react-scroll-area": "^1.2.9",
37
37
  "classnames": "^2.5.1",
38
- "@stackshift-ui/system": "6.1.0-beta.0",
39
- "@stackshift-ui/scripts": "6.1.0-beta.0"
38
+ "@stackshift-ui/scripts": "6.1.0-beta.2",
39
+ "@stackshift-ui/system": "6.1.0-beta.3"
40
40
  },
41
41
  "peerDependencies": {
42
- "@stackshift-ui/system": ">=6.1.0-beta.0",
42
+ "@stackshift-ui/system": ">=6.1.0-beta.3",
43
43
  "@types/react": "16.8 - 19",
44
44
  "next": "10 - 14",
45
45
  "react": "16.8 - 19",