@foundrykit/primitives 2.0.9 → 2.1.1

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 (146) hide show
  1. package/dist/{chunk-HS46TIMU.js → chunk-2UG6OCGA.js} +1 -1
  2. package/dist/chunk-3NQR7JZR.js +128 -0
  3. package/dist/{chunk-XCPGTXEJ.js → chunk-5RFGKG4K.js} +1 -1
  4. package/dist/chunk-B5YCE3UP.js +57 -0
  5. package/dist/chunk-F2TEA6ER.js +138 -0
  6. package/dist/{chunk-46UI3AUE.js → chunk-SEDTBIZW.js} +3 -3
  7. package/dist/chunk-SIQHWNPH.js +45 -0
  8. package/dist/chunk-STRBREHN.js +17 -0
  9. package/dist/components/button/index.cjs +3 -3
  10. package/dist/components/button/index.js +1 -1
  11. package/dist/components/card/index.cjs +1 -1
  12. package/dist/components/card/index.js +1 -1
  13. package/dist/components/dialog/index.cjs +182 -0
  14. package/dist/components/dialog/index.d.cts +38 -0
  15. package/dist/components/dialog/index.d.ts +38 -0
  16. package/dist/components/dialog/index.js +25 -0
  17. package/dist/components/input/index.cjs +1 -1
  18. package/dist/components/input/index.js +1 -1
  19. package/dist/components/input-group/index.cjs +270 -0
  20. package/dist/components/input-group/index.d.cts +44 -0
  21. package/dist/components/input-group/index.d.ts +44 -0
  22. package/dist/components/input-group/index.js +153 -0
  23. package/dist/components/section/index.cjs +41 -0
  24. package/dist/components/section/index.d.cts +27 -0
  25. package/dist/components/section/index.d.ts +27 -0
  26. package/dist/components/section/index.js +6 -0
  27. package/dist/components/sheet/index.cjs +170 -0
  28. package/dist/components/sheet/index.d.cts +31 -0
  29. package/dist/components/sheet/index.d.ts +31 -0
  30. package/dist/components/sheet/index.js +21 -0
  31. package/dist/components/toggle/index.cjs +81 -0
  32. package/dist/components/toggle/index.d.cts +26 -0
  33. package/dist/components/toggle/index.d.ts +26 -0
  34. package/dist/components/toggle/index.js +9 -0
  35. package/dist/components/tooltip/index.cjs +95 -0
  36. package/dist/components/tooltip/index.d.cts +25 -0
  37. package/dist/components/tooltip/index.d.ts +25 -0
  38. package/dist/components/tooltip/index.js +13 -0
  39. package/dist/index.cjs +112 -96
  40. package/dist/index.d.cts +12 -105
  41. package/dist/index.d.ts +12 -105
  42. package/dist/index.js +104 -406
  43. package/package.json +206 -10
  44. package/CHANGELOG.md +0 -230
  45. package/postcss.config.mjs +0 -6
  46. package/registry.json +0 -64
  47. package/src/components/accordion/config.ts +0 -28
  48. package/src/components/accordion/index.tsx +0 -80
  49. package/src/components/alert/config.ts +0 -40
  50. package/src/components/alert/index.tsx +0 -80
  51. package/src/components/alert-dialog/config.ts +0 -28
  52. package/src/components/alert-dialog/index.tsx +0 -188
  53. package/src/components/aspect-ratio/config.ts +0 -27
  54. package/src/components/aspect-ratio/index.tsx +0 -24
  55. package/src/components/avatar/config.ts +0 -46
  56. package/src/components/avatar/index.tsx +0 -67
  57. package/src/components/badge/config.ts +0 -56
  58. package/src/components/badge/index.tsx +0 -56
  59. package/src/components/breadcrumb/config.ts +0 -121
  60. package/src/components/breadcrumb/index.tsx +0 -127
  61. package/src/components/button/config.ts +0 -97
  62. package/src/components/button/index.tsx +0 -86
  63. package/src/components/button-group/config.ts +0 -39
  64. package/src/components/button-group/index.tsx +0 -99
  65. package/src/components/card/config.ts +0 -89
  66. package/src/components/card/index.tsx +0 -90
  67. package/src/components/checkbox/config.ts +0 -46
  68. package/src/components/checkbox/index.tsx +0 -41
  69. package/src/components/collapsible/config.ts +0 -27
  70. package/src/components/collapsible/index.tsx +0 -47
  71. package/src/components/context-menu/config.ts +0 -28
  72. package/src/components/context-menu/index.tsx +0 -271
  73. package/src/components/dialog/config.ts +0 -582
  74. package/src/components/dialog/index.tsx +0 -162
  75. package/src/components/direction/config.ts +0 -28
  76. package/src/components/direction/index.tsx +0 -27
  77. package/src/components/drawer/config.ts +0 -28
  78. package/src/components/drawer/index.tsx +0 -153
  79. package/src/components/dropdown/config.ts +0 -262
  80. package/src/components/dropdown/index.tsx +0 -280
  81. package/src/components/empty/config.ts +0 -38
  82. package/src/components/empty/index.tsx +0 -127
  83. package/src/components/field/config.ts +0 -40
  84. package/src/components/field/index.tsx +0 -252
  85. package/src/components/hover-card/config.ts +0 -27
  86. package/src/components/hover-card/index.tsx +0 -56
  87. package/src/components/input/config.ts +0 -64
  88. package/src/components/input/index.tsx +0 -32
  89. package/src/components/input-group/config.ts +0 -209
  90. package/src/components/input-group/index.tsx +0 -177
  91. package/src/components/item/config.ts +0 -52
  92. package/src/components/item/index.tsx +0 -215
  93. package/src/components/kbd/config.ts +0 -38
  94. package/src/components/kbd/index.tsx +0 -40
  95. package/src/components/label/config.ts +0 -72
  96. package/src/components/label/index.tsx +0 -32
  97. package/src/components/menubar/config.ts +0 -28
  98. package/src/components/menubar/index.tsx +0 -295
  99. package/src/components/native-select/config.ts +0 -40
  100. package/src/components/native-select/index.tsx +0 -40
  101. package/src/components/navigation-menu/config.ts +0 -32
  102. package/src/components/navigation-menu/index.tsx +0 -188
  103. package/src/components/popover/config.ts +0 -222
  104. package/src/components/popover/index.tsx +0 -60
  105. package/src/components/progress/config.ts +0 -42
  106. package/src/components/progress/index.tsx +0 -39
  107. package/src/components/radio-group/config.ts +0 -303
  108. package/src/components/radio-group/index.tsx +0 -58
  109. package/src/components/resizable/config.ts +0 -28
  110. package/src/components/resizable/index.tsx +0 -67
  111. package/src/components/scroll-area/config.ts +0 -17
  112. package/src/components/scroll-area/index.tsx +0 -70
  113. package/src/components/select/config.ts +0 -277
  114. package/src/components/select/index.tsx +0 -202
  115. package/src/components/separator/config.ts +0 -63
  116. package/src/components/separator/index.tsx +0 -38
  117. package/src/components/sheet/config.ts +0 -16
  118. package/src/components/sheet/index.tsx +0 -153
  119. package/src/components/skeleton/config.ts +0 -77
  120. package/src/components/skeleton/index.tsx +0 -22
  121. package/src/components/slider/config.ts +0 -46
  122. package/src/components/slider/index.tsx +0 -76
  123. package/src/components/sonner/config.ts +0 -27
  124. package/src/components/sonner/index.tsx +0 -37
  125. package/src/components/spinner/config.ts +0 -40
  126. package/src/components/spinner/index.tsx +0 -30
  127. package/src/components/switch/config.ts +0 -171
  128. package/src/components/switch/index.tsx +0 -40
  129. package/src/components/table/config.ts +0 -38
  130. package/src/components/table/index.tsx +0 -135
  131. package/src/components/tabs/config.ts +0 -335
  132. package/src/components/tabs/index.tsx +0 -82
  133. package/src/components/textarea/config.ts +0 -117
  134. package/src/components/textarea/index.tsx +0 -26
  135. package/src/components/toggle/config.ts +0 -67
  136. package/src/components/toggle/index.tsx +0 -59
  137. package/src/components/toggle-group/config.ts +0 -46
  138. package/src/components/toggle-group/index.tsx +0 -106
  139. package/src/components/tooltip/config.ts +0 -16
  140. package/src/components/tooltip/index.tsx +0 -75
  141. package/src/components/typography/config.ts +0 -38
  142. package/src/components/typography/index.tsx +0 -172
  143. package/src/index.ts +0 -291
  144. package/tsconfig.json +0 -9
  145. package/tsconfig.lint.json +0 -8
  146. package/tsup.config.ts +0 -55
@@ -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
+ };
@@ -32,7 +32,7 @@ function Input({ className, type, ...props }) {
32
32
  type,
33
33
  "data-slot": "input",
34
34
  className: (0, import_utils.cn)(
35
- "border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
35
+ "border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 flex h-[var(--input-height,2.25rem)] w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
36
36
  "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
37
37
  "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
38
38
  className
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Input
3
- } from "../../chunk-XCPGTXEJ.js";
3
+ } from "../../chunk-5RFGKG4K.js";
4
4
  export {
5
5
  Input
6
6
  };
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/components/input-group/index.tsx
22
+ var input_group_exports = {};
23
+ __export(input_group_exports, {
24
+ InputGroup: () => InputGroup,
25
+ InputGroupAddon: () => InputGroupAddon,
26
+ InputGroupButton: () => InputGroupButton,
27
+ InputGroupInput: () => InputGroupInput,
28
+ InputGroupText: () => InputGroupText,
29
+ InputGroupTextarea: () => InputGroupTextarea
30
+ });
31
+ module.exports = __toCommonJS(input_group_exports);
32
+ var import_utils4 = require("@foundrykit/utils");
33
+ var import_class_variance_authority2 = require("class-variance-authority");
34
+
35
+ // src/components/button/index.tsx
36
+ var import_utils = require("@foundrykit/utils");
37
+ var import_react_slot = require("@radix-ui/react-slot");
38
+ var import_class_variance_authority = require("class-variance-authority");
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+ var buttonVariants = (0, import_class_variance_authority.cva)(
41
+ "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 shrink-0 items-center justify-center gap-2 rounded-[var(--button-radius,calc(var(--radius)-2px))] font-[var(--button-weight,500)] text-sm whitespace-nowrap [text-transform:var(--button-case,none)] transition-all outline-none focus-visible:ring-[3px] active:not-disabled:scale-[var(--motion-press-scale,0.97)] disabled:pointer-events-none disabled:opacity-50 motion-reduce:active:not-disabled:scale-100 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
42
+ {
43
+ variants: {
44
+ variant: {
45
+ default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",
46
+ destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",
47
+ outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
48
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",
49
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
50
+ link: "text-primary underline-offset-4 hover:underline",
51
+ "inline-link": "inline align-baseline text-inherit underline underline-offset-4 hover:text-inherit",
52
+ navlink: "text-foreground hover:text-accent-foreground underline-offset-4 hover:underline"
53
+ },
54
+ size: {
55
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
56
+ sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
57
+ lg: "h-10 px-6 has-[>svg]:px-4",
58
+ icon: "size-9"
59
+ }
60
+ },
61
+ // The link-style variants read as inline text, not a button box: strip the
62
+ // height/padding/radius that `size` would otherwise apply, across all sizes.
63
+ compoundVariants: [
64
+ {
65
+ variant: ["inline-link", "navlink"],
66
+ className: "h-auto rounded-none p-0 has-[>svg]:px-0"
67
+ }
68
+ ],
69
+ defaultVariants: {
70
+ variant: "default",
71
+ size: "default"
72
+ }
73
+ }
74
+ );
75
+ function Button({
76
+ className,
77
+ variant,
78
+ size,
79
+ asChild = false,
80
+ ...props
81
+ }) {
82
+ const Comp = asChild ? import_react_slot.Slot : "button";
83
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
+ Comp,
85
+ {
86
+ "data-slot": "button",
87
+ className: (0, import_utils.cn)(buttonVariants({ variant, size, className })),
88
+ ...props
89
+ }
90
+ );
91
+ }
92
+
93
+ // src/components/input/index.tsx
94
+ var import_utils2 = require("@foundrykit/utils");
95
+ var import_jsx_runtime2 = require("react/jsx-runtime");
96
+ function Input({ className, type, ...props }) {
97
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
98
+ "input",
99
+ {
100
+ type,
101
+ "data-slot": "input",
102
+ className: (0, import_utils2.cn)(
103
+ "border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 flex h-[var(--input-height,2.25rem)] w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
104
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
105
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
106
+ className
107
+ ),
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+
113
+ // src/components/textarea/index.tsx
114
+ var import_utils3 = require("@foundrykit/utils");
115
+ var import_jsx_runtime3 = require("react/jsx-runtime");
116
+ function Textarea({ className, ...props }) {
117
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
118
+ "textarea",
119
+ {
120
+ "data-slot": "textarea",
121
+ className: (0, import_utils3.cn)(
122
+ "border-input placeholder:text-muted-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 dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
123
+ className
124
+ ),
125
+ ...props
126
+ }
127
+ );
128
+ }
129
+
130
+ // src/components/input-group/index.tsx
131
+ var import_jsx_runtime4 = require("react/jsx-runtime");
132
+ function InputGroup({ className, ...props }) {
133
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
134
+ "div",
135
+ {
136
+ "data-slot": "input-group",
137
+ role: "group",
138
+ className: (0, import_utils4.cn)(
139
+ "group/input-group border-input has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-lg border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
140
+ className
141
+ ),
142
+ ...props
143
+ }
144
+ );
145
+ }
146
+ var inputGroupAddonVariants = (0, import_class_variance_authority2.cva)(
147
+ "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
148
+ {
149
+ variants: {
150
+ align: {
151
+ "inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
152
+ "inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
153
+ "block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
154
+ "block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
155
+ }
156
+ },
157
+ defaultVariants: {
158
+ align: "inline-start"
159
+ }
160
+ }
161
+ );
162
+ function InputGroupAddon({
163
+ className,
164
+ align = "inline-start",
165
+ ...props
166
+ }) {
167
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
168
+ "div",
169
+ {
170
+ role: "group",
171
+ "data-slot": "input-group-addon",
172
+ "data-align": align,
173
+ className: (0, import_utils4.cn)(inputGroupAddonVariants({ align }), className),
174
+ onClick: (e) => {
175
+ if (e.target.closest("button")) {
176
+ return;
177
+ }
178
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
179
+ },
180
+ ...props
181
+ }
182
+ );
183
+ }
184
+ var inputGroupButtonVariants = (0, import_class_variance_authority2.cva)(
185
+ "flex items-center gap-2 text-sm shadow-none",
186
+ {
187
+ variants: {
188
+ size: {
189
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
190
+ sm: "",
191
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
192
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
193
+ }
194
+ },
195
+ defaultVariants: {
196
+ size: "xs"
197
+ }
198
+ }
199
+ );
200
+ function InputGroupButton({
201
+ className,
202
+ type = "button",
203
+ variant = "ghost",
204
+ size = "xs",
205
+ ...props
206
+ }) {
207
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
208
+ Button,
209
+ {
210
+ type,
211
+ "data-size": size,
212
+ variant,
213
+ className: (0, import_utils4.cn)(inputGroupButtonVariants({ size }), className),
214
+ ...props
215
+ }
216
+ );
217
+ }
218
+ function InputGroupText({ className, ...props }) {
219
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
220
+ "span",
221
+ {
222
+ className: (0, import_utils4.cn)(
223
+ "text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
224
+ className
225
+ ),
226
+ ...props
227
+ }
228
+ );
229
+ }
230
+ function InputGroupInput({
231
+ className,
232
+ ...props
233
+ }) {
234
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
235
+ Input,
236
+ {
237
+ "data-slot": "input-group-control",
238
+ className: (0, import_utils4.cn)(
239
+ "flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
240
+ className
241
+ ),
242
+ ...props
243
+ }
244
+ );
245
+ }
246
+ function InputGroupTextarea({
247
+ className,
248
+ ...props
249
+ }) {
250
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
251
+ Textarea,
252
+ {
253
+ "data-slot": "input-group-control",
254
+ className: (0, import_utils4.cn)(
255
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
256
+ className
257
+ ),
258
+ ...props
259
+ }
260
+ );
261
+ }
262
+ // Annotate the CommonJS export names for ESM import in node:
263
+ 0 && (module.exports = {
264
+ InputGroup,
265
+ InputGroupAddon,
266
+ InputGroupButton,
267
+ InputGroupInput,
268
+ InputGroupText,
269
+ InputGroupTextarea
270
+ });
@@ -0,0 +1,44 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import * as React from 'react';
5
+ import { Button } from '../button/index.cjs';
6
+
7
+ /**
8
+ * Container that groups a control with addons in a single bordered field,
9
+ * managing shared focus/invalid/disabled styling. Compose with
10
+ * {@link InputGroupInput} or {@link InputGroupTextarea} as the control and
11
+ * {@link InputGroupAddon} (holding {@link InputGroupText} or
12
+ * {@link InputGroupButton}) for leading/trailing content.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <InputGroup>
17
+ * <InputGroupAddon><SearchIcon /></InputGroupAddon>
18
+ * <InputGroupInput placeholder="Search" />
19
+ * </InputGroup>
20
+ * ```
21
+ */
22
+ declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
23
+ declare const inputGroupAddonVariants: (props?: ({
24
+ align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
25
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
26
+ /**
27
+ * Slot for icons, text or buttons alongside the control. The `align` variant
28
+ * (`inline-start`/`inline-end`/`block-start`/`block-end`) positions it; clicking
29
+ * empty addon space focuses the group's input.
30
+ */
31
+ declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
32
+ declare const inputGroupButtonVariants: (props?: ({
33
+ size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
34
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
35
+ /**
36
+ * {@link Button} preset for use inside an addon: defaults to `type="button"`,
37
+ * `variant="ghost"` and a compact `size` (`xs`, `sm`, `icon-xs`, `icon-sm`).
38
+ */
39
+ declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, 'size'> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
40
+ declare function InputGroupText({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
41
+ declare function InputGroupInput({ className, ...props }: React.ComponentProps<'input'>): react_jsx_runtime.JSX.Element;
42
+ declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<'textarea'>): react_jsx_runtime.JSX.Element;
43
+
44
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -0,0 +1,44 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import * as React from 'react';
5
+ import { Button } from '../button/index.js';
6
+
7
+ /**
8
+ * Container that groups a control with addons in a single bordered field,
9
+ * managing shared focus/invalid/disabled styling. Compose with
10
+ * {@link InputGroupInput} or {@link InputGroupTextarea} as the control and
11
+ * {@link InputGroupAddon} (holding {@link InputGroupText} or
12
+ * {@link InputGroupButton}) for leading/trailing content.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <InputGroup>
17
+ * <InputGroupAddon><SearchIcon /></InputGroupAddon>
18
+ * <InputGroupInput placeholder="Search" />
19
+ * </InputGroup>
20
+ * ```
21
+ */
22
+ declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
23
+ declare const inputGroupAddonVariants: (props?: ({
24
+ align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
25
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
26
+ /**
27
+ * Slot for icons, text or buttons alongside the control. The `align` variant
28
+ * (`inline-start`/`inline-end`/`block-start`/`block-end`) positions it; clicking
29
+ * empty addon space focuses the group's input.
30
+ */
31
+ declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
32
+ declare const inputGroupButtonVariants: (props?: ({
33
+ size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
34
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
35
+ /**
36
+ * {@link Button} preset for use inside an addon: defaults to `type="button"`,
37
+ * `variant="ghost"` and a compact `size` (`xs`, `sm`, `icon-xs`, `icon-sm`).
38
+ */
39
+ declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, 'size'> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
40
+ declare function InputGroupText({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
41
+ declare function InputGroupInput({ className, ...props }: React.ComponentProps<'input'>): react_jsx_runtime.JSX.Element;
42
+ declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<'textarea'>): react_jsx_runtime.JSX.Element;
43
+
44
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
@@ -0,0 +1,153 @@
1
+ "use client";
2
+ import {
3
+ Textarea
4
+ } from "../../chunk-XVIHRZGJ.js";
5
+ import {
6
+ Input
7
+ } from "../../chunk-5RFGKG4K.js";
8
+ import {
9
+ Button
10
+ } from "../../chunk-SEDTBIZW.js";
11
+
12
+ // src/components/input-group/index.tsx
13
+ import { cn } from "@foundrykit/utils";
14
+ import { cva } from "class-variance-authority";
15
+ import { jsx } from "react/jsx-runtime";
16
+ function InputGroup({ className, ...props }) {
17
+ return /* @__PURE__ */ jsx(
18
+ "div",
19
+ {
20
+ "data-slot": "input-group",
21
+ role: "group",
22
+ className: cn(
23
+ "group/input-group border-input has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-lg border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
24
+ className
25
+ ),
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+ var inputGroupAddonVariants = cva(
31
+ "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
32
+ {
33
+ variants: {
34
+ align: {
35
+ "inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
36
+ "inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
37
+ "block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
38
+ "block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
39
+ }
40
+ },
41
+ defaultVariants: {
42
+ align: "inline-start"
43
+ }
44
+ }
45
+ );
46
+ function InputGroupAddon({
47
+ className,
48
+ align = "inline-start",
49
+ ...props
50
+ }) {
51
+ return /* @__PURE__ */ jsx(
52
+ "div",
53
+ {
54
+ role: "group",
55
+ "data-slot": "input-group-addon",
56
+ "data-align": align,
57
+ className: cn(inputGroupAddonVariants({ align }), className),
58
+ onClick: (e) => {
59
+ if (e.target.closest("button")) {
60
+ return;
61
+ }
62
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
63
+ },
64
+ ...props
65
+ }
66
+ );
67
+ }
68
+ var inputGroupButtonVariants = cva(
69
+ "flex items-center gap-2 text-sm shadow-none",
70
+ {
71
+ variants: {
72
+ size: {
73
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
74
+ sm: "",
75
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
76
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
77
+ }
78
+ },
79
+ defaultVariants: {
80
+ size: "xs"
81
+ }
82
+ }
83
+ );
84
+ function InputGroupButton({
85
+ className,
86
+ type = "button",
87
+ variant = "ghost",
88
+ size = "xs",
89
+ ...props
90
+ }) {
91
+ return /* @__PURE__ */ jsx(
92
+ Button,
93
+ {
94
+ type,
95
+ "data-size": size,
96
+ variant,
97
+ className: cn(inputGroupButtonVariants({ size }), className),
98
+ ...props
99
+ }
100
+ );
101
+ }
102
+ function InputGroupText({ className, ...props }) {
103
+ return /* @__PURE__ */ jsx(
104
+ "span",
105
+ {
106
+ className: cn(
107
+ "text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
108
+ className
109
+ ),
110
+ ...props
111
+ }
112
+ );
113
+ }
114
+ function InputGroupInput({
115
+ className,
116
+ ...props
117
+ }) {
118
+ return /* @__PURE__ */ jsx(
119
+ Input,
120
+ {
121
+ "data-slot": "input-group-control",
122
+ className: cn(
123
+ "flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
124
+ className
125
+ ),
126
+ ...props
127
+ }
128
+ );
129
+ }
130
+ function InputGroupTextarea({
131
+ className,
132
+ ...props
133
+ }) {
134
+ return /* @__PURE__ */ jsx(
135
+ Textarea,
136
+ {
137
+ "data-slot": "input-group-control",
138
+ className: cn(
139
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
140
+ className
141
+ ),
142
+ ...props
143
+ }
144
+ );
145
+ }
146
+ export {
147
+ InputGroup,
148
+ InputGroupAddon,
149
+ InputGroupButton,
150
+ InputGroupInput,
151
+ InputGroupText,
152
+ InputGroupTextarea
153
+ };