@foundrykit/primitives 2.0.9 → 2.0.10

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.
Files changed (131) hide show
  1. package/dist/chunk-3NQR7JZR.js +128 -0
  2. package/dist/chunk-B5YCE3UP.js +57 -0
  3. package/dist/chunk-F2TEA6ER.js +138 -0
  4. package/dist/chunk-SIQHWNPH.js +45 -0
  5. package/dist/components/dialog/index.cjs +182 -0
  6. package/dist/components/dialog/index.d.cts +38 -0
  7. package/dist/components/dialog/index.d.ts +38 -0
  8. package/dist/components/dialog/index.js +25 -0
  9. package/dist/components/input-group/index.cjs +270 -0
  10. package/dist/components/input-group/index.d.cts +44 -0
  11. package/dist/components/input-group/index.d.ts +44 -0
  12. package/dist/components/input-group/index.js +153 -0
  13. package/dist/components/sheet/index.cjs +170 -0
  14. package/dist/components/sheet/index.d.cts +31 -0
  15. package/dist/components/sheet/index.d.ts +31 -0
  16. package/dist/components/sheet/index.js +21 -0
  17. package/dist/components/toggle/index.cjs +81 -0
  18. package/dist/components/toggle/index.d.cts +26 -0
  19. package/dist/components/toggle/index.d.ts +26 -0
  20. package/dist/components/toggle/index.js +9 -0
  21. package/dist/components/tooltip/index.cjs +95 -0
  22. package/dist/components/tooltip/index.d.cts +25 -0
  23. package/dist/components/tooltip/index.d.ts +25 -0
  24. package/dist/components/tooltip/index.js +13 -0
  25. package/dist/index.d.cts +11 -105
  26. package/dist/index.d.ts +11 -105
  27. package/dist/index.js +93 -399
  28. package/package.json +200 -8
  29. package/CHANGELOG.md +0 -230
  30. package/postcss.config.mjs +0 -6
  31. package/registry.json +0 -64
  32. package/src/components/accordion/config.ts +0 -28
  33. package/src/components/accordion/index.tsx +0 -80
  34. package/src/components/alert/config.ts +0 -40
  35. package/src/components/alert/index.tsx +0 -80
  36. package/src/components/alert-dialog/config.ts +0 -28
  37. package/src/components/alert-dialog/index.tsx +0 -188
  38. package/src/components/aspect-ratio/config.ts +0 -27
  39. package/src/components/aspect-ratio/index.tsx +0 -24
  40. package/src/components/avatar/config.ts +0 -46
  41. package/src/components/avatar/index.tsx +0 -67
  42. package/src/components/badge/config.ts +0 -56
  43. package/src/components/badge/index.tsx +0 -56
  44. package/src/components/breadcrumb/config.ts +0 -121
  45. package/src/components/breadcrumb/index.tsx +0 -127
  46. package/src/components/button/config.ts +0 -97
  47. package/src/components/button/index.tsx +0 -86
  48. package/src/components/button-group/config.ts +0 -39
  49. package/src/components/button-group/index.tsx +0 -99
  50. package/src/components/card/config.ts +0 -89
  51. package/src/components/card/index.tsx +0 -90
  52. package/src/components/checkbox/config.ts +0 -46
  53. package/src/components/checkbox/index.tsx +0 -41
  54. package/src/components/collapsible/config.ts +0 -27
  55. package/src/components/collapsible/index.tsx +0 -47
  56. package/src/components/context-menu/config.ts +0 -28
  57. package/src/components/context-menu/index.tsx +0 -271
  58. package/src/components/dialog/config.ts +0 -582
  59. package/src/components/dialog/index.tsx +0 -162
  60. package/src/components/direction/config.ts +0 -28
  61. package/src/components/direction/index.tsx +0 -27
  62. package/src/components/drawer/config.ts +0 -28
  63. package/src/components/drawer/index.tsx +0 -153
  64. package/src/components/dropdown/config.ts +0 -262
  65. package/src/components/dropdown/index.tsx +0 -280
  66. package/src/components/empty/config.ts +0 -38
  67. package/src/components/empty/index.tsx +0 -127
  68. package/src/components/field/config.ts +0 -40
  69. package/src/components/field/index.tsx +0 -252
  70. package/src/components/hover-card/config.ts +0 -27
  71. package/src/components/hover-card/index.tsx +0 -56
  72. package/src/components/input/config.ts +0 -64
  73. package/src/components/input/index.tsx +0 -32
  74. package/src/components/input-group/config.ts +0 -209
  75. package/src/components/input-group/index.tsx +0 -177
  76. package/src/components/item/config.ts +0 -52
  77. package/src/components/item/index.tsx +0 -215
  78. package/src/components/kbd/config.ts +0 -38
  79. package/src/components/kbd/index.tsx +0 -40
  80. package/src/components/label/config.ts +0 -72
  81. package/src/components/label/index.tsx +0 -32
  82. package/src/components/menubar/config.ts +0 -28
  83. package/src/components/menubar/index.tsx +0 -295
  84. package/src/components/native-select/config.ts +0 -40
  85. package/src/components/native-select/index.tsx +0 -40
  86. package/src/components/navigation-menu/config.ts +0 -32
  87. package/src/components/navigation-menu/index.tsx +0 -188
  88. package/src/components/popover/config.ts +0 -222
  89. package/src/components/popover/index.tsx +0 -60
  90. package/src/components/progress/config.ts +0 -42
  91. package/src/components/progress/index.tsx +0 -39
  92. package/src/components/radio-group/config.ts +0 -303
  93. package/src/components/radio-group/index.tsx +0 -58
  94. package/src/components/resizable/config.ts +0 -28
  95. package/src/components/resizable/index.tsx +0 -67
  96. package/src/components/scroll-area/config.ts +0 -17
  97. package/src/components/scroll-area/index.tsx +0 -70
  98. package/src/components/select/config.ts +0 -277
  99. package/src/components/select/index.tsx +0 -202
  100. package/src/components/separator/config.ts +0 -63
  101. package/src/components/separator/index.tsx +0 -38
  102. package/src/components/sheet/config.ts +0 -16
  103. package/src/components/sheet/index.tsx +0 -153
  104. package/src/components/skeleton/config.ts +0 -77
  105. package/src/components/skeleton/index.tsx +0 -22
  106. package/src/components/slider/config.ts +0 -46
  107. package/src/components/slider/index.tsx +0 -76
  108. package/src/components/sonner/config.ts +0 -27
  109. package/src/components/sonner/index.tsx +0 -37
  110. package/src/components/spinner/config.ts +0 -40
  111. package/src/components/spinner/index.tsx +0 -30
  112. package/src/components/switch/config.ts +0 -171
  113. package/src/components/switch/index.tsx +0 -40
  114. package/src/components/table/config.ts +0 -38
  115. package/src/components/table/index.tsx +0 -135
  116. package/src/components/tabs/config.ts +0 -335
  117. package/src/components/tabs/index.tsx +0 -82
  118. package/src/components/textarea/config.ts +0 -117
  119. package/src/components/textarea/index.tsx +0 -26
  120. package/src/components/toggle/config.ts +0 -67
  121. package/src/components/toggle/index.tsx +0 -59
  122. package/src/components/toggle-group/config.ts +0 -46
  123. package/src/components/toggle-group/index.tsx +0 -106
  124. package/src/components/tooltip/config.ts +0 -16
  125. package/src/components/tooltip/index.tsx +0 -75
  126. package/src/components/typography/config.ts +0 -38
  127. package/src/components/typography/index.tsx +0 -172
  128. package/src/index.ts +0 -291
  129. package/tsconfig.json +0 -9
  130. package/tsconfig.lint.json +0 -8
  131. package/tsup.config.ts +0 -55
@@ -0,0 +1,128 @@
1
+ // src/components/sheet/index.tsx
2
+ import { cn } from "@foundrykit/utils";
3
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
4
+ import { XIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function Sheet({ ...props }) {
7
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
8
+ }
9
+ function SheetTrigger({
10
+ ...props
11
+ }) {
12
+ return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
13
+ }
14
+ function SheetClose({
15
+ ...props
16
+ }) {
17
+ return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
18
+ }
19
+ function SheetPortal({
20
+ ...props
21
+ }) {
22
+ return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
23
+ }
24
+ function SheetOverlay({
25
+ className,
26
+ ...props
27
+ }) {
28
+ return /* @__PURE__ */ jsx(
29
+ SheetPrimitive.Overlay,
30
+ {
31
+ "data-slot": "sheet-overlay",
32
+ className: cn(
33
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
34
+ className
35
+ ),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ function SheetContent({
41
+ className,
42
+ children,
43
+ side = "right",
44
+ ...props
45
+ }) {
46
+ return /* @__PURE__ */ jsxs(SheetPortal, { children: [
47
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
48
+ /* @__PURE__ */ jsxs(
49
+ SheetPrimitive.Content,
50
+ {
51
+ "data-slot": "sheet-content",
52
+ className: cn(
53
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
54
+ side === "right" && "motion-safe:data-[state=closed]:slide-out-to-right motion-safe:data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
55
+ side === "left" && "motion-safe:data-[state=closed]:slide-out-to-left motion-safe:data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
56
+ side === "top" && "motion-safe:data-[state=closed]:slide-out-to-top motion-safe:data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
57
+ side === "bottom" && "motion-safe:data-[state=closed]:slide-out-to-bottom motion-safe:data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
58
+ className
59
+ ),
60
+ ...props,
61
+ children: [
62
+ children,
63
+ /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
64
+ /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
65
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
66
+ ] })
67
+ ]
68
+ }
69
+ )
70
+ ] });
71
+ }
72
+ function SheetHeader({ className, ...props }) {
73
+ return /* @__PURE__ */ jsx(
74
+ "div",
75
+ {
76
+ "data-slot": "sheet-header",
77
+ className: cn("flex flex-col gap-1.5 p-4", className),
78
+ ...props
79
+ }
80
+ );
81
+ }
82
+ function SheetFooter({ className, ...props }) {
83
+ return /* @__PURE__ */ jsx(
84
+ "div",
85
+ {
86
+ "data-slot": "sheet-footer",
87
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
88
+ ...props
89
+ }
90
+ );
91
+ }
92
+ function SheetTitle({
93
+ className,
94
+ ...props
95
+ }) {
96
+ return /* @__PURE__ */ jsx(
97
+ SheetPrimitive.Title,
98
+ {
99
+ "data-slot": "sheet-title",
100
+ className: cn("text-foreground font-semibold", className),
101
+ ...props
102
+ }
103
+ );
104
+ }
105
+ function SheetDescription({
106
+ className,
107
+ ...props
108
+ }) {
109
+ return /* @__PURE__ */ jsx(
110
+ SheetPrimitive.Description,
111
+ {
112
+ "data-slot": "sheet-description",
113
+ className: cn("text-muted-foreground text-sm", className),
114
+ ...props
115
+ }
116
+ );
117
+ }
118
+
119
+ export {
120
+ Sheet,
121
+ SheetTrigger,
122
+ SheetClose,
123
+ SheetContent,
124
+ SheetHeader,
125
+ SheetFooter,
126
+ SheetTitle,
127
+ SheetDescription
128
+ };
@@ -0,0 +1,57 @@
1
+ // src/components/tooltip/index.tsx
2
+ import { cn } from "@foundrykit/utils";
3
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ function TooltipProvider({
6
+ delayDuration = 0,
7
+ ...props
8
+ }) {
9
+ return /* @__PURE__ */ jsx(
10
+ TooltipPrimitive.Provider,
11
+ {
12
+ "data-slot": "tooltip-provider",
13
+ delayDuration,
14
+ ...props
15
+ }
16
+ );
17
+ }
18
+ function Tooltip({
19
+ ...props
20
+ }) {
21
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
22
+ }
23
+ function TooltipTrigger({
24
+ ...props
25
+ }) {
26
+ return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
27
+ }
28
+ function TooltipContent({
29
+ className,
30
+ sideOffset = 0,
31
+ children,
32
+ ...props
33
+ }) {
34
+ return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
35
+ TooltipPrimitive.Content,
36
+ {
37
+ "data-slot": "tooltip-content",
38
+ sideOffset,
39
+ className: cn(
40
+ "bg-primary text-primary-foreground animate-in fade-in-0 motion-safe:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
41
+ className
42
+ ),
43
+ ...props,
44
+ children: [
45
+ children,
46
+ /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
47
+ ]
48
+ }
49
+ ) });
50
+ }
51
+
52
+ export {
53
+ TooltipProvider,
54
+ Tooltip,
55
+ TooltipTrigger,
56
+ TooltipContent
57
+ };
@@ -0,0 +1,138 @@
1
+ // src/components/dialog/index.tsx
2
+ import { cn } from "@foundrykit/utils";
3
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
4
+ import { XIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function Dialog({
7
+ ...props
8
+ }) {
9
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
10
+ }
11
+ function DialogTrigger({
12
+ ...props
13
+ }) {
14
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
15
+ }
16
+ function DialogPortal({
17
+ ...props
18
+ }) {
19
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
20
+ }
21
+ function DialogClose({
22
+ ...props
23
+ }) {
24
+ return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
25
+ }
26
+ function DialogOverlay({
27
+ className,
28
+ ...props
29
+ }) {
30
+ return /* @__PURE__ */ jsx(
31
+ DialogPrimitive.Overlay,
32
+ {
33
+ "data-slot": "dialog-overlay",
34
+ className: cn(
35
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
36
+ className
37
+ ),
38
+ ...props
39
+ }
40
+ );
41
+ }
42
+ function DialogContent({
43
+ className,
44
+ children,
45
+ showCloseButton = true,
46
+ ...props
47
+ }) {
48
+ return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
49
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
50
+ /* @__PURE__ */ jsxs(
51
+ DialogPrimitive.Content,
52
+ {
53
+ "data-slot": "dialog-content",
54
+ className: cn(
55
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
56
+ className
57
+ ),
58
+ ...props,
59
+ children: [
60
+ children,
61
+ showCloseButton && /* @__PURE__ */ jsxs(
62
+ DialogPrimitive.Close,
63
+ {
64
+ "data-slot": "dialog-close",
65
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
66
+ children: [
67
+ /* @__PURE__ */ jsx(XIcon, {}),
68
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
69
+ ]
70
+ }
71
+ )
72
+ ]
73
+ }
74
+ )
75
+ ] });
76
+ }
77
+ function DialogHeader({ className, ...props }) {
78
+ return /* @__PURE__ */ jsx(
79
+ "div",
80
+ {
81
+ "data-slot": "dialog-header",
82
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
83
+ ...props
84
+ }
85
+ );
86
+ }
87
+ function DialogFooter({ className, ...props }) {
88
+ return /* @__PURE__ */ jsx(
89
+ "div",
90
+ {
91
+ "data-slot": "dialog-footer",
92
+ className: cn(
93
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
94
+ className
95
+ ),
96
+ ...props
97
+ }
98
+ );
99
+ }
100
+ function DialogTitle({
101
+ className,
102
+ ...props
103
+ }) {
104
+ return /* @__PURE__ */ jsx(
105
+ DialogPrimitive.Title,
106
+ {
107
+ "data-slot": "dialog-title",
108
+ className: cn("text-lg leading-none font-semibold", className),
109
+ ...props
110
+ }
111
+ );
112
+ }
113
+ function DialogDescription({
114
+ className,
115
+ ...props
116
+ }) {
117
+ return /* @__PURE__ */ jsx(
118
+ DialogPrimitive.Description,
119
+ {
120
+ "data-slot": "dialog-description",
121
+ className: cn("text-muted-foreground text-sm", className),
122
+ ...props
123
+ }
124
+ );
125
+ }
126
+
127
+ export {
128
+ Dialog,
129
+ DialogTrigger,
130
+ DialogPortal,
131
+ DialogClose,
132
+ DialogOverlay,
133
+ DialogContent,
134
+ DialogHeader,
135
+ DialogFooter,
136
+ DialogTitle,
137
+ DialogDescription
138
+ };
@@ -0,0 +1,45 @@
1
+ // src/components/toggle/index.tsx
2
+ import { cn } from "@foundrykit/utils";
3
+ import * as TogglePrimitive from "@radix-ui/react-toggle";
4
+ import { cva } from "class-variance-authority";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var toggleVariants = cva(
7
+ "hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-transparent",
12
+ outline: "border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-xs"
13
+ },
14
+ size: {
15
+ default: "h-9 min-w-9 px-2",
16
+ sm: "h-8 min-w-8 px-1.5",
17
+ lg: "h-10 min-w-10 px-2.5"
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ size: "default"
23
+ }
24
+ }
25
+ );
26
+ function Toggle({
27
+ className,
28
+ variant,
29
+ size,
30
+ ...props
31
+ }) {
32
+ return /* @__PURE__ */ jsx(
33
+ TogglePrimitive.Root,
34
+ {
35
+ "data-slot": "toggle",
36
+ className: cn(toggleVariants({ variant, size, className })),
37
+ ...props
38
+ }
39
+ );
40
+ }
41
+
42
+ export {
43
+ toggleVariants,
44
+ Toggle
45
+ };
@@ -0,0 +1,182 @@
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/dialog/index.tsx
32
+ var dialog_exports = {};
33
+ __export(dialog_exports, {
34
+ Dialog: () => Dialog,
35
+ DialogClose: () => DialogClose,
36
+ DialogContent: () => DialogContent,
37
+ DialogDescription: () => DialogDescription,
38
+ DialogFooter: () => DialogFooter,
39
+ DialogHeader: () => DialogHeader,
40
+ DialogOverlay: () => DialogOverlay,
41
+ DialogPortal: () => DialogPortal,
42
+ DialogTitle: () => DialogTitle,
43
+ DialogTrigger: () => DialogTrigger
44
+ });
45
+ module.exports = __toCommonJS(dialog_exports);
46
+ var import_utils = require("@foundrykit/utils");
47
+ var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
48
+ var import_lucide_react = require("lucide-react");
49
+ var import_jsx_runtime = require("react/jsx-runtime");
50
+ function Dialog({
51
+ ...props
52
+ }) {
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
54
+ }
55
+ function DialogTrigger({
56
+ ...props
57
+ }) {
58
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
59
+ }
60
+ function DialogPortal({
61
+ ...props
62
+ }) {
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
64
+ }
65
+ function DialogClose({
66
+ ...props
67
+ }) {
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
69
+ }
70
+ function DialogOverlay({
71
+ className,
72
+ ...props
73
+ }) {
74
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
+ DialogPrimitive.Overlay,
76
+ {
77
+ "data-slot": "dialog-overlay",
78
+ className: (0, import_utils.cn)(
79
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
80
+ className
81
+ ),
82
+ ...props
83
+ }
84
+ );
85
+ }
86
+ function DialogContent({
87
+ className,
88
+ children,
89
+ showCloseButton = true,
90
+ ...props
91
+ }) {
92
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlay, {}),
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
95
+ DialogPrimitive.Content,
96
+ {
97
+ "data-slot": "dialog-content",
98
+ className: (0, import_utils.cn)(
99
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
100
+ className
101
+ ),
102
+ ...props,
103
+ children: [
104
+ children,
105
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
106
+ DialogPrimitive.Close,
107
+ {
108
+ "data-slot": "dialog-close",
109
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
110
+ children: [
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.XIcon, {}),
112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Close" })
113
+ ]
114
+ }
115
+ )
116
+ ]
117
+ }
118
+ )
119
+ ] });
120
+ }
121
+ function DialogHeader({ className, ...props }) {
122
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
+ "div",
124
+ {
125
+ "data-slot": "dialog-header",
126
+ className: (0, import_utils.cn)("flex flex-col gap-2 text-center sm:text-left", className),
127
+ ...props
128
+ }
129
+ );
130
+ }
131
+ function DialogFooter({ className, ...props }) {
132
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
133
+ "div",
134
+ {
135
+ "data-slot": "dialog-footer",
136
+ className: (0, import_utils.cn)(
137
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
138
+ className
139
+ ),
140
+ ...props
141
+ }
142
+ );
143
+ }
144
+ function DialogTitle({
145
+ className,
146
+ ...props
147
+ }) {
148
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ DialogPrimitive.Title,
150
+ {
151
+ "data-slot": "dialog-title",
152
+ className: (0, import_utils.cn)("text-lg leading-none font-semibold", className),
153
+ ...props
154
+ }
155
+ );
156
+ }
157
+ function DialogDescription({
158
+ className,
159
+ ...props
160
+ }) {
161
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
162
+ DialogPrimitive.Description,
163
+ {
164
+ "data-slot": "dialog-description",
165
+ className: (0, import_utils.cn)("text-muted-foreground text-sm", className),
166
+ ...props
167
+ }
168
+ );
169
+ }
170
+ // Annotate the CommonJS export names for ESM import in node:
171
+ 0 && (module.exports = {
172
+ Dialog,
173
+ DialogClose,
174
+ DialogContent,
175
+ DialogDescription,
176
+ DialogFooter,
177
+ DialogHeader,
178
+ DialogOverlay,
179
+ DialogPortal,
180
+ DialogTitle,
181
+ DialogTrigger
182
+ });
@@ -0,0 +1,38 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ import * as React from 'react';
4
+
5
+ /**
6
+ * Modal dialog root built on Radix `Dialog.Root`. Compose with
7
+ * {@link DialogTrigger}, {@link DialogContent} (which renders the overlay and an
8
+ * optional close button), {@link DialogHeader}, {@link DialogTitle},
9
+ * {@link DialogDescription} and {@link DialogFooter}.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Dialog>
14
+ * <DialogTrigger>Open</DialogTrigger>
15
+ * <DialogContent>
16
+ * <DialogHeader><DialogTitle>Title</DialogTitle></DialogHeader>
17
+ * </DialogContent>
18
+ * </Dialog>
19
+ * ```
20
+ */
21
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
22
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
23
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): react_jsx_runtime.JSX.Element;
24
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
25
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): react_jsx_runtime.JSX.Element;
26
+ /**
27
+ * Centered, animated dialog panel rendered in a portal over a dark overlay.
28
+ * Set `showCloseButton={false}` to hide the built-in top-right close button.
29
+ */
30
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
31
+ showCloseButton?: boolean;
32
+ }): react_jsx_runtime.JSX.Element;
33
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
34
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
35
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
36
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
37
+
38
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1,38 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ import * as React from 'react';
4
+
5
+ /**
6
+ * Modal dialog root built on Radix `Dialog.Root`. Compose with
7
+ * {@link DialogTrigger}, {@link DialogContent} (which renders the overlay and an
8
+ * optional close button), {@link DialogHeader}, {@link DialogTitle},
9
+ * {@link DialogDescription} and {@link DialogFooter}.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Dialog>
14
+ * <DialogTrigger>Open</DialogTrigger>
15
+ * <DialogContent>
16
+ * <DialogHeader><DialogTitle>Title</DialogTitle></DialogHeader>
17
+ * </DialogContent>
18
+ * </Dialog>
19
+ * ```
20
+ */
21
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
22
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
23
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): react_jsx_runtime.JSX.Element;
24
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
25
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): react_jsx_runtime.JSX.Element;
26
+ /**
27
+ * Centered, animated dialog panel rendered in a portal over a dark overlay.
28
+ * Set `showCloseButton={false}` to hide the built-in top-right close button.
29
+ */
30
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
31
+ showCloseButton?: boolean;
32
+ }): react_jsx_runtime.JSX.Element;
33
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
34
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
35
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
36
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
37
+
38
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import {
3
+ Dialog,
4
+ DialogClose,
5
+ DialogContent,
6
+ DialogDescription,
7
+ DialogFooter,
8
+ DialogHeader,
9
+ DialogOverlay,
10
+ DialogPortal,
11
+ DialogTitle,
12
+ DialogTrigger
13
+ } from "../../chunk-F2TEA6ER.js";
14
+ export {
15
+ Dialog,
16
+ DialogClose,
17
+ DialogContent,
18
+ DialogDescription,
19
+ DialogFooter,
20
+ DialogHeader,
21
+ DialogOverlay,
22
+ DialogPortal,
23
+ DialogTitle,
24
+ DialogTrigger
25
+ };