@me1a/ui 2.2.7 → 2.2.8

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.
package/dist/index.mjs CHANGED
@@ -13,6 +13,7 @@ export * from "./stack/index.mjs"
13
13
  export * from "./skeleton/index.mjs"
14
14
  export * from "./sheet/index.mjs"
15
15
  export * from "./separator/index.mjs"
16
+ export * from "./scroll-area/index.mjs"
16
17
  export * from "./resizable/index.mjs"
17
18
  export * from "./radio-group/index.mjs"
18
19
  export * from "./popover/index.mjs"
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
3
+
4
+ /**
5
+ * ScrollArea component that provides a custom scrollable area with a styled scrollbar.
6
+ * Built on top of Radix UI's ScrollArea primitive.
7
+ *
8
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-scroll-area--docs
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">
13
+ * <div className="space-y-4">
14
+ * <h4 className="text-sm font-medium leading-none">Scroll Area</h4>
15
+ * <p className="text-sm text-muted-foreground">
16
+ * Scrollable content goes here...
17
+ * </p>
18
+ * </div>
19
+ * </ScrollArea>
20
+ * ```
21
+ */
22
+ declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
+ declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
24
+ orientation?: "vertical" | "horizontal";
25
+ } & React.RefAttributes<HTMLDivElement>>;
26
+
27
+ type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>;
28
+ type ScrollBarProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar> & {
29
+ orientation?: "vertical" | "horizontal";
30
+ };
31
+
32
+ export { ScrollArea, type ScrollAreaProps, ScrollBar, type ScrollBarProps };
@@ -0,0 +1,2 @@
1
+ import*as c from"react";import*as r from"@radix-ui/react-scroll-area";import{clsx as s}from"clsx";import{twMerge as S}from"tailwind-merge";function a(...l){return S(s(l))}import{jsx as o,jsxs as f}from"react/jsx-runtime";var p=c.forwardRef(({className:l,children:e,...i},t)=>f(r.Root,{ref:t,className:a("relative overflow-hidden",l),...i,children:[o(r.Viewport,{className:"h-full w-full rounded-[inherit]",children:e}),o(m,{}),o(r.Corner,{})]}));p.displayName=r.Root.displayName;var m=c.forwardRef(({className:l,orientation:e="vertical",...i},t)=>o(r.ScrollAreaScrollbar,{ref:t,orientation:e,className:a("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",l),...i,children:o(r.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));m.displayName=r.ScrollAreaScrollbar.displayName;export{p as ScrollArea,m as ScrollBar};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/atoms/scroll-area/scroll-area.tsx","../../src/utils/cn.ts"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport * as React from \"react\"\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\"\n\nimport { cn } from \"@/utils/index\"\nimport { ScrollAreaProps, ScrollBarProps } from \"./scroll-area.types\"\n\n/**\n * ScrollArea component that provides a custom scrollable area with a styled scrollbar.\n * Built on top of Radix UI's ScrollArea primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-scroll-area--docs\n *\n * @example\n * ```tsx\n * <ScrollArea className=\"h-[200px] w-[350px] rounded-md border p-4\">\n * <div className=\"space-y-4\">\n * <h4 className=\"text-sm font-medium leading-none\">Scroll Area</h4>\n * <p className=\"text-sm text-muted-foreground\">\n * Scrollable content goes here...\n * </p>\n * </div>\n * </ScrollArea>\n * ```\n */\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n ScrollAreaProps\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n))\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n ScrollBarProps\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n))\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName\n\nexport { ScrollArea, ScrollBar }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"AACA,UAAYA,MAAW,QACvB,UAAYC,MAAyB,8BCFrC,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CDwBE,OAKE,OAAAC,EALF,QAAAC,MAAA,oBAJF,IAAMC,EAAmB,aAGvB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IACpCL,EAAqB,OAApB,CACC,IAAKK,EACL,UAAWC,EAAG,2BAA4BJ,CAAS,EAClD,GAAGE,EAEJ,UAAAL,EAAqB,WAApB,CAA6B,UAAU,kCACrC,SAAAI,EACH,EACAJ,EAACQ,EAAA,EAAU,EACXR,EAAqB,SAApB,EAA2B,GAC9B,CACD,EACDE,EAAW,YAAkC,OAAK,YAElD,IAAMM,EAAkB,aAGtB,CAAC,CAAE,UAAAL,EAAW,YAAAM,EAAc,WAAY,GAAGJ,CAAM,EAAGC,IACpDN,EAAqB,sBAApB,CACC,IAAKM,EACL,YAAaG,EACb,UAAWF,EACT,gDACAE,IAAgB,YAAc,qDAC9BA,IAAgB,cAAgB,uDAChCN,CACF,EACC,GAAGE,EAEJ,SAAAL,EAAqB,kBAApB,CAAoC,UAAU,yCAAyC,EAC1F,CACD,EACDQ,EAAU,YAAkC,sBAAoB","names":["React","ScrollAreaPrimitive","clsx","twMerge","cn","inputs","jsx","jsxs","ScrollArea","className","children","props","ref","cn","ScrollBar","orientation"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@me1a/ui",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "private": false,
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -77,6 +77,10 @@
77
77
  "types": "./dist/separator/index.d.mts",
78
78
  "import": "./dist/separator/index.mjs"
79
79
  },
80
+ "./scroll-area": {
81
+ "types": "./dist/scroll-area/index.d.mts",
82
+ "import": "./dist/scroll-area/index.mjs"
83
+ },
80
84
  "./resizable": {
81
85
  "types": "./dist/resizable/index.d.mts",
82
86
  "import": "./dist/resizable/index.mjs"
@@ -302,6 +306,7 @@
302
306
  "@radix-ui/react-navigation-menu": "^1.2.12",
303
307
  "@radix-ui/react-popover": "^1.1.14",
304
308
  "@radix-ui/react-radio-group": "^1.3.7",
309
+ "@radix-ui/react-scroll-area": "^1.2.9",
305
310
  "@radix-ui/react-select": "^2.2.5",
306
311
  "@radix-ui/react-separator": "^1.1.6",
307
312
  "@radix-ui/react-slot": "^1.2.3",