@foundrykit/primitives 1.0.11 → 1.0.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @foundrykit/primitives
2
2
 
3
+ ## 1.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updating wrapper and scroll functionality
8
+
3
9
  ## 1.0.11
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,62 @@
1
+ // src/components/scroll-area/index.tsx
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+ import { cn } from "@foundrykit/utils";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ function ScrollArea({
6
+ className,
7
+ children,
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsxs(
11
+ ScrollAreaPrimitive.Root,
12
+ {
13
+ "data-slot": "scroll-area",
14
+ className: cn("relative", className),
15
+ ...props,
16
+ children: [
17
+ /* @__PURE__ */ jsx(
18
+ ScrollAreaPrimitive.Viewport,
19
+ {
20
+ "data-slot": "scroll-area-viewport",
21
+ className: "focus-visible:ring-ring/50 size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px]",
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.ScrollAreaScrollbar,
38
+ {
39
+ "data-slot": "scroll-area-scrollbar",
40
+ orientation,
41
+ className: cn(
42
+ "flex touch-none select-none p-px transition-colors",
43
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
44
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
45
+ className
46
+ ),
47
+ ...props,
48
+ children: /* @__PURE__ */ jsx(
49
+ ScrollAreaPrimitive.ScrollAreaThumb,
50
+ {
51
+ "data-slot": "scroll-area-thumb",
52
+ className: "bg-border relative flex-1 rounded-full"
53
+ }
54
+ )
55
+ }
56
+ );
57
+ }
58
+
59
+ export {
60
+ ScrollArea,
61
+ ScrollBar
62
+ };
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/components/scroll-area/index.tsx
32
+ var scroll_area_exports = {};
33
+ __export(scroll_area_exports, {
34
+ ScrollArea: () => ScrollArea,
35
+ ScrollBar: () => ScrollBar
36
+ });
37
+ module.exports = __toCommonJS(scroll_area_exports);
38
+ var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
39
+ var import_utils = require("@foundrykit/utils");
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ function ScrollArea({
42
+ className,
43
+ children,
44
+ ...props
45
+ }) {
46
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
47
+ ScrollAreaPrimitive.Root,
48
+ {
49
+ "data-slot": "scroll-area",
50
+ className: (0, import_utils.cn)("relative", className),
51
+ ...props,
52
+ children: [
53
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
+ ScrollAreaPrimitive.Viewport,
55
+ {
56
+ "data-slot": "scroll-area-viewport",
57
+ className: "focus-visible:ring-ring/50 size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px]",
58
+ children
59
+ }
60
+ ),
61
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollBar, {}),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaPrimitive.Corner, {})
63
+ ]
64
+ }
65
+ );
66
+ }
67
+ function ScrollBar({
68
+ className,
69
+ orientation = "vertical",
70
+ ...props
71
+ }) {
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
74
+ {
75
+ "data-slot": "scroll-area-scrollbar",
76
+ orientation,
77
+ className: (0, import_utils.cn)(
78
+ "flex touch-none select-none p-px transition-colors",
79
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
80
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
81
+ className
82
+ ),
83
+ ...props,
84
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
85
+ ScrollAreaPrimitive.ScrollAreaThumb,
86
+ {
87
+ "data-slot": "scroll-area-thumb",
88
+ className: "bg-border relative flex-1 rounded-full"
89
+ }
90
+ )
91
+ }
92
+ );
93
+ }
94
+ // Annotate the CommonJS export names for ESM import in node:
95
+ 0 && (module.exports = {
96
+ ScrollArea,
97
+ ScrollBar
98
+ });
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
4
+
5
+ declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): react_jsx_runtime.JSX.Element;
6
+ declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): react_jsx_runtime.JSX.Element;
7
+
8
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
4
+
5
+ declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): react_jsx_runtime.JSX.Element;
6
+ declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): react_jsx_runtime.JSX.Element;
7
+
8
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import {
3
+ ScrollArea,
4
+ ScrollBar
5
+ } from "../../chunk-UQQKWW5Q.js";
6
+ export {
7
+ ScrollArea,
8
+ ScrollBar
9
+ };
package/dist/index.d.cts CHANGED
@@ -22,7 +22,7 @@ export { Skeleton } from './components/skeleton/index.cjs';
22
22
  export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './components/popover/index.cjs';
23
23
  import * as DialogPrimitive from '@radix-ui/react-dialog';
24
24
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
25
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
25
+ export { ScrollArea, ScrollBar } from './components/scroll-area/index.cjs';
26
26
  export { cn } from '@foundrykit/utils';
27
27
  import '@radix-ui/react-avatar';
28
28
  import '@radix-ui/react-checkbox';
@@ -34,6 +34,7 @@ import '@radix-ui/react-separator';
34
34
  import '@radix-ui/react-switch';
35
35
  import '@radix-ui/react-tabs';
36
36
  import '@radix-ui/react-popover';
37
+ import '@radix-ui/react-scroll-area';
37
38
 
38
39
  declare const toggleVariants: (props?: ({
39
40
  variant?: "default" | "outline" | null | undefined;
@@ -68,7 +69,4 @@ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimit
68
69
  declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
69
70
  declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime.JSX.Element;
70
71
 
71
- declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): react_jsx_runtime.JSX.Element;
72
- declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): react_jsx_runtime.JSX.Element;
73
-
74
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, ScrollArea, ScrollBar, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, toggleVariants };
72
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, toggleVariants };
package/dist/index.d.ts CHANGED
@@ -22,7 +22,7 @@ export { Skeleton } from './components/skeleton/index.js';
22
22
  export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './components/popover/index.js';
23
23
  import * as DialogPrimitive from '@radix-ui/react-dialog';
24
24
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
25
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
25
+ export { ScrollArea, ScrollBar } from './components/scroll-area/index.js';
26
26
  export { cn } from '@foundrykit/utils';
27
27
  import '@radix-ui/react-avatar';
28
28
  import '@radix-ui/react-checkbox';
@@ -34,6 +34,7 @@ import '@radix-ui/react-separator';
34
34
  import '@radix-ui/react-switch';
35
35
  import '@radix-ui/react-tabs';
36
36
  import '@radix-ui/react-popover';
37
+ import '@radix-ui/react-scroll-area';
37
38
 
38
39
  declare const toggleVariants: (props?: ({
39
40
  variant?: "default" | "outline" | null | undefined;
@@ -68,7 +69,4 @@ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimit
68
69
  declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
69
70
  declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime.JSX.Element;
70
71
 
71
- declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): react_jsx_runtime.JSX.Element;
72
- declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): react_jsx_runtime.JSX.Element;
73
-
74
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, ScrollArea, ScrollBar, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, toggleVariants };
72
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, toggleVariants };
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ import {
2
+ Switch
3
+ } from "./chunk-U2EIVYWP.js";
1
4
  import {
2
5
  Tabs,
3
6
  TabsContent,
@@ -23,6 +26,10 @@ import {
23
26
  RadioGroup,
24
27
  RadioGroupItem
25
28
  } from "./chunk-XQAJQKO7.js";
29
+ import {
30
+ ScrollArea,
31
+ ScrollBar
32
+ } from "./chunk-UQQKWW5Q.js";
26
33
  import {
27
34
  Select,
28
35
  SelectContent,
@@ -41,9 +48,6 @@ import {
41
48
  import {
42
49
  Skeleton
43
50
  } from "./chunk-SKR3J46C.js";
44
- import {
45
- Switch
46
- } from "./chunk-U2EIVYWP.js";
47
51
  import {
48
52
  Avatar,
49
53
  AvatarFallback,
@@ -66,9 +70,6 @@ import {
66
70
  Button,
67
71
  buttonVariants
68
72
  } from "./chunk-YTUI6MCB.js";
69
- import {
70
- Checkbox
71
- } from "./chunk-A3U73FA7.js";
72
73
  import {
73
74
  Card,
74
75
  CardContent,
@@ -77,6 +78,9 @@ import {
77
78
  CardHeader,
78
79
  CardTitle
79
80
  } from "./chunk-UZIMC7AQ.js";
81
+ import {
82
+ Checkbox
83
+ } from "./chunk-A3U73FA7.js";
80
84
  import {
81
85
  DropdownMenu,
82
86
  DropdownMenuCheckboxItem,
@@ -431,66 +435,8 @@ function TooltipContent({
431
435
  ) });
432
436
  }
433
437
 
434
- // src/components/scroll-area/index.tsx
435
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
436
- import { cn as cn5 } from "@foundrykit/utils";
437
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
438
- function ScrollArea({
439
- className,
440
- children,
441
- ...props
442
- }) {
443
- return /* @__PURE__ */ jsxs4(
444
- ScrollAreaPrimitive.Root,
445
- {
446
- "data-slot": "scroll-area",
447
- className: cn5("relative", className),
448
- ...props,
449
- children: [
450
- /* @__PURE__ */ jsx5(
451
- ScrollAreaPrimitive.Viewport,
452
- {
453
- "data-slot": "scroll-area-viewport",
454
- className: "focus-visible:ring-ring/50 size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px]",
455
- children
456
- }
457
- ),
458
- /* @__PURE__ */ jsx5(ScrollBar, {}),
459
- /* @__PURE__ */ jsx5(ScrollAreaPrimitive.Corner, {})
460
- ]
461
- }
462
- );
463
- }
464
- function ScrollBar({
465
- className,
466
- orientation = "vertical",
467
- ...props
468
- }) {
469
- return /* @__PURE__ */ jsx5(
470
- ScrollAreaPrimitive.ScrollAreaScrollbar,
471
- {
472
- "data-slot": "scroll-area-scrollbar",
473
- orientation,
474
- className: cn5(
475
- "flex touch-none select-none p-px transition-colors",
476
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
477
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
478
- className
479
- ),
480
- ...props,
481
- children: /* @__PURE__ */ jsx5(
482
- ScrollAreaPrimitive.ScrollAreaThumb,
483
- {
484
- "data-slot": "scroll-area-thumb",
485
- className: "bg-border relative flex-1 rounded-full"
486
- }
487
- )
488
- }
489
- );
490
- }
491
-
492
438
  // src/index.ts
493
- import { cn as cn6 } from "@foundrykit/utils";
439
+ import { cn as cn5 } from "@foundrykit/utils";
494
440
  export {
495
441
  Avatar,
496
442
  AvatarFallback,
@@ -577,6 +523,6 @@ export {
577
523
  TooltipTrigger,
578
524
  badgeVariants,
579
525
  buttonVariants,
580
- cn6 as cn,
526
+ cn5 as cn,
581
527
  toggleVariants
582
528
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foundrykit/primitives",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
@@ -1,7 +1,7 @@
1
1
  import type { ComponentConfig } from '@foundrykit/types';
2
2
 
3
3
  export const scrollAreaConfig: ComponentConfig = {
4
- name: 'ScrollArea',
4
+ name: 'Scroll Area',
5
5
  description:
6
6
  'ScrollArea component for displaying content in a scrollable area',
7
7
  category: 'primitives',
package/tsup.config.ts CHANGED
@@ -20,6 +20,7 @@ export default defineConfig({
20
20
  'src/components/textarea/index.tsx',
21
21
  'src/components/skeleton/index.tsx',
22
22
  'src/components/popover/index.tsx',
23
+ 'src/components/scroll-area/index.tsx',
23
24
  ],
24
25
  format: ['esm'],
25
26
  dts: true,