@constructive-io/ui 0.1.0

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 (176) hide show
  1. package/dist/components/alert-dialog.d.ts +31 -0
  2. package/dist/components/alert-dialog.js +314 -0
  3. package/dist/components/alert-dialog.js.map +1 -0
  4. package/dist/components/alert.d.ts +14 -0
  5. package/dist/components/alert.js +38 -0
  6. package/dist/components/alert.js.map +1 -0
  7. package/dist/components/autocomplete.d.ts +28 -0
  8. package/dist/components/autocomplete.js +395 -0
  9. package/dist/components/autocomplete.js.map +1 -0
  10. package/dist/components/avatar.d.ts +13 -0
  11. package/dist/components/avatar.js +37 -0
  12. package/dist/components/avatar.js.map +1 -0
  13. package/dist/components/badge.d.ts +15 -0
  14. package/dist/components/badge.js +43 -0
  15. package/dist/components/badge.js.map +1 -0
  16. package/dist/components/breadcrumb.d.ts +14 -0
  17. package/dist/components/breadcrumb.js +154 -0
  18. package/dist/components/breadcrumb.js.map +1 -0
  19. package/dist/components/button.d.ts +17 -0
  20. package/dist/components/button.js +62 -0
  21. package/dist/components/button.js.map +1 -0
  22. package/dist/components/calendar-rac.d.ts +13 -0
  23. package/dist/components/calendar-rac.js +82 -0
  24. package/dist/components/calendar-rac.js.map +1 -0
  25. package/dist/components/card.d.ts +19 -0
  26. package/dist/components/card.js +75 -0
  27. package/dist/components/card.js.map +1 -0
  28. package/dist/components/checkbox-group.d.ts +7 -0
  29. package/dist/components/checkbox-group.js +16 -0
  30. package/dist/components/checkbox-group.js.map +1 -0
  31. package/dist/components/checkbox.d.ts +8 -0
  32. package/dist/components/checkbox.js +67 -0
  33. package/dist/components/checkbox.js.map +1 -0
  34. package/dist/components/collapsible.d.ts +54 -0
  35. package/dist/components/collapsible.js +121 -0
  36. package/dist/components/collapsible.js.map +1 -0
  37. package/dist/components/combobox.d.ts +44 -0
  38. package/dist/components/combobox.js +486 -0
  39. package/dist/components/combobox.js.map +1 -0
  40. package/dist/components/command.d.ts +43 -0
  41. package/dist/components/command.js +690 -0
  42. package/dist/components/command.js.map +1 -0
  43. package/dist/components/dialog.d.ts +35 -0
  44. package/dist/components/dialog.js +440 -0
  45. package/dist/components/dialog.js.map +1 -0
  46. package/dist/components/dock.d.ts +31 -0
  47. package/dist/components/dock.js +111 -0
  48. package/dist/components/dock.js.map +1 -0
  49. package/dist/components/drawer.d.ts +16 -0
  50. package/dist/components/drawer.js +147 -0
  51. package/dist/components/drawer.js.map +1 -0
  52. package/dist/components/dropdown-menu.d.ts +50 -0
  53. package/dist/components/dropdown-menu.js +380 -0
  54. package/dist/components/dropdown-menu.js.map +1 -0
  55. package/dist/components/field.d.ts +51 -0
  56. package/dist/components/field.js +115 -0
  57. package/dist/components/field.js.map +1 -0
  58. package/dist/components/flickering-grid.d.ts +15 -0
  59. package/dist/components/flickering-grid.js +147 -0
  60. package/dist/components/flickering-grid.js.map +1 -0
  61. package/dist/components/form-control.d.ts +15 -0
  62. package/dist/components/form-control.js +173 -0
  63. package/dist/components/form-control.js.map +1 -0
  64. package/dist/components/form.d.ts +37 -0
  65. package/dist/components/form.js +179 -0
  66. package/dist/components/form.js.map +1 -0
  67. package/dist/components/input-group.d.ts +18 -0
  68. package/dist/components/input-group.js +177 -0
  69. package/dist/components/input-group.js.map +1 -0
  70. package/dist/components/input.d.ts +11 -0
  71. package/dist/components/input.js +60 -0
  72. package/dist/components/input.js.map +1 -0
  73. package/dist/components/json-input.d.ts +25 -0
  74. package/dist/components/json-input.js +351 -0
  75. package/dist/components/json-input.js.map +1 -0
  76. package/dist/components/label.d.ts +11 -0
  77. package/dist/components/label.js +27 -0
  78. package/dist/components/label.js.map +1 -0
  79. package/dist/components/motion-grid.d.ts +20 -0
  80. package/dist/components/motion-grid.js +81 -0
  81. package/dist/components/motion-grid.js.map +1 -0
  82. package/dist/components/multi-select.d.ts +198 -0
  83. package/dist/components/multi-select.js +882 -0
  84. package/dist/components/multi-select.js.map +1 -0
  85. package/dist/components/page-header.d.ts +17 -0
  86. package/dist/components/page-header.js +17 -0
  87. package/dist/components/page-header.js.map +1 -0
  88. package/dist/components/pagination.d.ts +19 -0
  89. package/dist/components/pagination.js +144 -0
  90. package/dist/components/pagination.js.map +1 -0
  91. package/dist/components/popover.d.ts +35 -0
  92. package/dist/components/popover.js +188 -0
  93. package/dist/components/popover.js.map +1 -0
  94. package/dist/components/portal.d.ts +108 -0
  95. package/dist/components/portal.js +75 -0
  96. package/dist/components/portal.js.map +1 -0
  97. package/dist/components/progress.d.ts +10 -0
  98. package/dist/components/progress.js +30 -0
  99. package/dist/components/progress.js.map +1 -0
  100. package/dist/components/progressive-blur-scroll-container.d.ts +25 -0
  101. package/dist/components/progressive-blur-scroll-container.js +142 -0
  102. package/dist/components/progressive-blur-scroll-container.js.map +1 -0
  103. package/dist/components/progressive-blur.d.ts +16 -0
  104. package/dist/components/progressive-blur.js +68 -0
  105. package/dist/components/progressive-blur.js.map +1 -0
  106. package/dist/components/radio-group.d.ts +10 -0
  107. package/dist/components/radio-group.js +37 -0
  108. package/dist/components/radio-group.js.map +1 -0
  109. package/dist/components/record-picker.d.ts +16 -0
  110. package/dist/components/record-picker.js +366 -0
  111. package/dist/components/record-picker.js.map +1 -0
  112. package/dist/components/resizable.d.ts +11 -0
  113. package/dist/components/resizable.js +52 -0
  114. package/dist/components/resizable.js.map +1 -0
  115. package/dist/components/responsive-diagram.d.ts +10 -0
  116. package/dist/components/responsive-diagram.js +63 -0
  117. package/dist/components/responsive-diagram.js.map +1 -0
  118. package/dist/components/scroll-area.d.ts +12 -0
  119. package/dist/components/scroll-area.js +69 -0
  120. package/dist/components/scroll-area.js.map +1 -0
  121. package/dist/components/select.d.ts +47 -0
  122. package/dist/components/select.js +287 -0
  123. package/dist/components/select.js.map +1 -0
  124. package/dist/components/separator.d.ts +11 -0
  125. package/dist/components/separator.js +24 -0
  126. package/dist/components/separator.js.map +1 -0
  127. package/dist/components/sheet.d.ts +112 -0
  128. package/dist/components/sheet.js +600 -0
  129. package/dist/components/sheet.js.map +1 -0
  130. package/dist/components/sidebar.d.ts +77 -0
  131. package/dist/components/sidebar.js +1217 -0
  132. package/dist/components/sidebar.js.map +1 -0
  133. package/dist/components/skeleton.d.ts +7 -0
  134. package/dist/components/skeleton.js +16 -0
  135. package/dist/components/skeleton.js.map +1 -0
  136. package/dist/components/sonner.d.ts +10 -0
  137. package/dist/components/sonner.js +23 -0
  138. package/dist/components/sonner.js.map +1 -0
  139. package/dist/components/stack/index.d.ts +663 -0
  140. package/dist/components/stack/index.js +1418 -0
  141. package/dist/components/stack/index.js.map +1 -0
  142. package/dist/components/stepper.d.ts +30 -0
  143. package/dist/components/stepper.js +280 -0
  144. package/dist/components/stepper.js.map +1 -0
  145. package/dist/components/switch.d.ts +8 -0
  146. package/dist/components/switch.js +40 -0
  147. package/dist/components/switch.js.map +1 -0
  148. package/dist/components/table.d.ts +15 -0
  149. package/dist/components/table.js +65 -0
  150. package/dist/components/table.js.map +1 -0
  151. package/dist/components/tabs.d.ts +10 -0
  152. package/dist/components/tabs.js +48 -0
  153. package/dist/components/tabs.js.map +1 -0
  154. package/dist/components/tags.d.ts +42 -0
  155. package/dist/components/tags.js +728 -0
  156. package/dist/components/tags.js.map +1 -0
  157. package/dist/components/textarea.d.ts +10 -0
  158. package/dist/components/textarea.js +54 -0
  159. package/dist/components/textarea.js.map +1 -0
  160. package/dist/components/toast/index.d.ts +52 -0
  161. package/dist/components/toast/index.js +221 -0
  162. package/dist/components/toast/index.js.map +1 -0
  163. package/dist/components/tooltip.d.ts +29 -0
  164. package/dist/components/tooltip.js +174 -0
  165. package/dist/components/tooltip.js.map +1 -0
  166. package/dist/components/unlink-button.d.ts +14 -0
  167. package/dist/components/unlink-button.js +91 -0
  168. package/dist/components/unlink-button.js.map +1 -0
  169. package/dist/index.cjs +7692 -0
  170. package/dist/index.cjs.map +1 -0
  171. package/dist/index.d.cts +2157 -0
  172. package/dist/index.d.ts +2157 -0
  173. package/dist/index.js +7375 -0
  174. package/dist/index.js.map +1 -0
  175. package/package.json +490 -0
  176. package/src/styles/globals.css +397 -0
@@ -0,0 +1,690 @@
1
+ "use client";
2
+ import { Dialog } from '@base-ui/react/dialog';
3
+ import { SearchIcon, ChevronsUpDownIcon, XIcon } from 'lucide-react';
4
+ import * as React2 from 'react';
5
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
+ import { clsx } from 'clsx';
7
+ import { twMerge } from 'tailwind-merge';
8
+ import { Autocomplete as Autocomplete$1 } from '@base-ui/react/autocomplete';
9
+ import { Input as Input$1 } from '@base-ui/react/input';
10
+ import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
11
+
12
+ var PORTAL_ROOT_ID = "portal-root";
13
+ var PortalContext = React2.createContext({
14
+ layer: "base",
15
+ depth: 0,
16
+ floatingPortalStrategy: "root",
17
+ floatingZIndex: "default"
18
+ });
19
+ function ModalPortalScope({
20
+ children,
21
+ floatingPortalStrategy = "nested",
22
+ floatingZIndex = "default"
23
+ }) {
24
+ const parentContext = React2.useContext(PortalContext);
25
+ const depth = parentContext.layer === "modal" ? parentContext.depth + 1 : 0;
26
+ const value = React2.useMemo(
27
+ () => ({
28
+ layer: "modal",
29
+ depth,
30
+ floatingPortalStrategy,
31
+ floatingZIndex
32
+ }),
33
+ [depth, floatingPortalStrategy, floatingZIndex]
34
+ );
35
+ return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
36
+ }
37
+ function useRootPortalContainer() {
38
+ const [container, setContainer] = React2.useState(null);
39
+ React2.useLayoutEffect(() => {
40
+ const el = document.getElementById(PORTAL_ROOT_ID);
41
+ setContainer(el);
42
+ }, []);
43
+ return container;
44
+ }
45
+ function composeRefs(...refs) {
46
+ return (node) => {
47
+ refs.forEach((ref) => {
48
+ if (typeof ref === "function") {
49
+ ref(node);
50
+ } else if (ref != null) {
51
+ ref.current = node;
52
+ }
53
+ });
54
+ };
55
+ }
56
+ function mergeProps(slotProps, childProps) {
57
+ const overrideProps = { ...childProps };
58
+ for (const propName in childProps) {
59
+ if (propName === "ref") continue;
60
+ const slotPropValue = slotProps[propName];
61
+ const childPropValue = childProps[propName];
62
+ if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
63
+ overrideProps[propName] = (...args) => {
64
+ childPropValue(...args);
65
+ slotPropValue(...args);
66
+ };
67
+ } else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
68
+ overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
69
+ } else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
70
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
71
+ }
72
+ }
73
+ return { ...slotProps, ...overrideProps };
74
+ }
75
+ function mergePropsWithRef(parentProps, childElement) {
76
+ const childProps = childElement.props;
77
+ const parentRef = parentProps.ref;
78
+ const childRef = childProps.ref;
79
+ const mergedProps = mergeProps(parentProps, childProps);
80
+ if (parentRef || childRef) {
81
+ mergedProps.ref = composeRefs(parentRef, childRef);
82
+ }
83
+ return mergedProps;
84
+ }
85
+ function isSlottable(child) {
86
+ return React2.isValidElement(child);
87
+ }
88
+ var Slot = React2.forwardRef((props, forwardedRef) => {
89
+ const { children, ...slotProps } = props;
90
+ if (isSlottable(children)) {
91
+ const childProps = children.props;
92
+ const childRef = childProps.ref;
93
+ return React2.cloneElement(children, {
94
+ ...mergeProps(slotProps, childProps),
95
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
96
+ });
97
+ }
98
+ if (React2.Children.count(children) > 1) {
99
+ const childrenArray = React2.Children.toArray(children);
100
+ const slottableChild = childrenArray.find(
101
+ (child) => React2.isValidElement(child) && child.type === Slottable
102
+ );
103
+ if (slottableChild) {
104
+ const newElement = slottableChild.props.children;
105
+ if (isSlottable(newElement)) {
106
+ const newElementProps = newElement.props;
107
+ const newChildren = childrenArray.map((child) => {
108
+ if (child === slottableChild) {
109
+ return React2.Children.count(newElementProps.children) > 1 ? React2.Children.only(null) : newElementProps.children;
110
+ }
111
+ return child;
112
+ });
113
+ const childRef = newElementProps.ref;
114
+ return React2.cloneElement(newElement, {
115
+ ...mergeProps(slotProps, newElementProps),
116
+ ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
117
+ children: newChildren
118
+ });
119
+ }
120
+ }
121
+ }
122
+ return /* @__PURE__ */ jsx(Fragment, { children });
123
+ });
124
+ Slot.displayName = "Slot";
125
+ function Slottable({ children }) {
126
+ return /* @__PURE__ */ jsx(Fragment, { children });
127
+ }
128
+ function cn(...inputs) {
129
+ return twMerge(clsx(inputs));
130
+ }
131
+ function Input({ className, size = "default", unstyled = false, ...props }) {
132
+ const isFloating = props.placeholder === " ";
133
+ return /* @__PURE__ */ jsx(
134
+ "span",
135
+ {
136
+ className: cn(
137
+ !unstyled && [
138
+ // Base layout
139
+ "relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base shadow-xs transition-shadow",
140
+ // Inner shadow highlight
141
+ "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]",
142
+ "not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]",
143
+ // Focus state - use primary brand color
144
+ "has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35",
145
+ // Invalid state
146
+ "has-aria-invalid:border-destructive/36",
147
+ "has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16",
148
+ // Disabled state
149
+ "has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none",
150
+ // Dark mode
151
+ "sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border",
152
+ "dark:has-aria-invalid:ring-destructive/24",
153
+ "dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]"
154
+ ],
155
+ className
156
+ ) || void 0,
157
+ "data-size": size,
158
+ "data-slot": "input-control",
159
+ children: /* @__PURE__ */ jsx(
160
+ Input$1,
161
+ {
162
+ className: cn(
163
+ "w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none",
164
+ isFloating ? "h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10" : "h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5",
165
+ size === "sm" && (isFloating ? "h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9" : "h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5"),
166
+ size === "lg" && (isFloating ? "h-12 pt-5 pb-1.5 sm:h-11" : "h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5"),
167
+ props.type === "search" && "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
168
+ props.type === "file" && "text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm"
169
+ ),
170
+ "data-slot": "input",
171
+ size: typeof size === "number" ? size : void 0,
172
+ ...props
173
+ }
174
+ )
175
+ }
176
+ );
177
+ }
178
+ var ScrollArea = React2.forwardRef(
179
+ ({ className, children, scrollFade = false, scrollbarGutter = false, ...props }, ref) => {
180
+ return /* @__PURE__ */ jsxs(
181
+ ScrollArea$1.Root,
182
+ {
183
+ ref,
184
+ className: cn("size-full min-h-0", className),
185
+ ...props,
186
+ children: [
187
+ /* @__PURE__ */ jsx(
188
+ ScrollArea$1.Viewport,
189
+ {
190
+ className: cn(
191
+ "h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
192
+ scrollFade && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]",
193
+ scrollbarGutter && "data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"
194
+ ),
195
+ "data-slot": "scroll-area-viewport",
196
+ children
197
+ }
198
+ ),
199
+ /* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" }),
200
+ /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }),
201
+ /* @__PURE__ */ jsx(ScrollArea$1.Corner, { "data-slot": "scroll-area-corner" })
202
+ ]
203
+ }
204
+ );
205
+ }
206
+ );
207
+ ScrollArea.displayName = "ScrollArea";
208
+ function ScrollBar({
209
+ className,
210
+ orientation = "vertical",
211
+ ...props
212
+ }) {
213
+ return /* @__PURE__ */ jsx(
214
+ ScrollArea$1.Scrollbar,
215
+ {
216
+ className: cn(
217
+ "m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100",
218
+ className
219
+ ),
220
+ "data-slot": "scroll-area-scrollbar",
221
+ orientation,
222
+ ...props,
223
+ children: /* @__PURE__ */ jsx(
224
+ ScrollArea$1.Thumb,
225
+ {
226
+ className: "relative flex-1 rounded-full bg-foreground/20",
227
+ "data-slot": "scroll-area-thumb"
228
+ }
229
+ )
230
+ }
231
+ );
232
+ }
233
+ var Autocomplete = Autocomplete$1.Root;
234
+ function AutocompleteInput({
235
+ className,
236
+ showTrigger = false,
237
+ showClear = false,
238
+ startAddon,
239
+ size = "default",
240
+ ...props
241
+ }) {
242
+ const sizeValue = size;
243
+ return /* @__PURE__ */ jsxs("div", { className: "relative not-has-[>*.w-full]:w-fit w-full", children: [
244
+ startAddon && /* @__PURE__ */ jsx(
245
+ "div",
246
+ {
247
+ "aria-hidden": "true",
248
+ className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",
249
+ "data-slot": "autocomplete-start-addon",
250
+ children: startAddon
251
+ }
252
+ ),
253
+ /* @__PURE__ */ jsx(
254
+ Autocomplete$1.Input,
255
+ {
256
+ className: cn(
257
+ startAddon && "data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=autocomplete-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8)-1px)]",
258
+ sizeValue === "sm" ? "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5" : "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7",
259
+ className
260
+ ),
261
+ "data-slot": "autocomplete-input",
262
+ render: /* @__PURE__ */ jsx(Input, { size: sizeValue }),
263
+ ...props
264
+ }
265
+ ),
266
+ showTrigger && /* @__PURE__ */ jsx(
267
+ AutocompleteTrigger,
268
+ {
269
+ className: cn(
270
+ "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
271
+ sizeValue === "sm" ? "end-0" : "end-0.5"
272
+ ),
273
+ children: /* @__PURE__ */ jsx(ChevronsUpDownIcon, {})
274
+ }
275
+ ),
276
+ showClear && /* @__PURE__ */ jsx(
277
+ AutocompleteClear,
278
+ {
279
+ className: cn(
280
+ "-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
281
+ sizeValue === "sm" ? "end-0" : "end-0.5"
282
+ ),
283
+ children: /* @__PURE__ */ jsx(XIcon, {})
284
+ }
285
+ )
286
+ ] });
287
+ }
288
+ function AutocompleteItem({
289
+ className,
290
+ children,
291
+ ...props
292
+ }) {
293
+ return /* @__PURE__ */ jsx(
294
+ Autocomplete$1.Item,
295
+ {
296
+ className: cn(
297
+ "flex min-h-8 cursor-default select-none items-center rounded-sm px-2 py-1 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm",
298
+ className
299
+ ),
300
+ "data-slot": "autocomplete-item",
301
+ ...props,
302
+ children
303
+ }
304
+ );
305
+ }
306
+ function AutocompleteSeparator({
307
+ className,
308
+ ...props
309
+ }) {
310
+ return /* @__PURE__ */ jsx(
311
+ Autocomplete$1.Separator,
312
+ {
313
+ className: cn("mx-2 my-1 h-px bg-border last:hidden", className),
314
+ "data-slot": "autocomplete-separator",
315
+ ...props
316
+ }
317
+ );
318
+ }
319
+ function AutocompleteGroup({
320
+ className,
321
+ ...props
322
+ }) {
323
+ return /* @__PURE__ */ jsx(
324
+ Autocomplete$1.Group,
325
+ {
326
+ className: cn("[[role=group]+&]:mt-1.5", className),
327
+ "data-slot": "autocomplete-group",
328
+ ...props
329
+ }
330
+ );
331
+ }
332
+ function AutocompleteGroupLabel({
333
+ className,
334
+ ...props
335
+ }) {
336
+ return /* @__PURE__ */ jsx(
337
+ Autocomplete$1.GroupLabel,
338
+ {
339
+ className: cn(
340
+ "px-2 py-1.5 font-medium text-muted-foreground text-xs",
341
+ className
342
+ ),
343
+ "data-slot": "autocomplete-group-label",
344
+ ...props
345
+ }
346
+ );
347
+ }
348
+ function AutocompleteEmpty({
349
+ className,
350
+ ...props
351
+ }) {
352
+ return /* @__PURE__ */ jsx(
353
+ Autocomplete$1.Empty,
354
+ {
355
+ className: cn(
356
+ "not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm",
357
+ className
358
+ ),
359
+ "data-slot": "autocomplete-empty",
360
+ ...props
361
+ }
362
+ );
363
+ }
364
+ function AutocompleteList({
365
+ className,
366
+ ...props
367
+ }) {
368
+ return /* @__PURE__ */ jsx(ScrollArea, { scrollbarGutter: true, scrollFade: true, children: /* @__PURE__ */ jsx(
369
+ Autocomplete$1.List,
370
+ {
371
+ className: cn(
372
+ "not-empty:scroll-py-1 not-empty:p-1 in-data-has-overflow-y:pe-3",
373
+ className
374
+ ),
375
+ "data-slot": "autocomplete-list",
376
+ ...props
377
+ }
378
+ ) });
379
+ }
380
+ function AutocompleteClear({
381
+ className,
382
+ ...props
383
+ }) {
384
+ return /* @__PURE__ */ jsx(
385
+ Autocomplete$1.Clear,
386
+ {
387
+ className: cn(
388
+ "-translate-y-1/2 absolute end-0.5 top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
389
+ className
390
+ ),
391
+ "data-slot": "autocomplete-clear",
392
+ ...props,
393
+ children: /* @__PURE__ */ jsx(XIcon, {})
394
+ }
395
+ );
396
+ }
397
+ function AutocompleteCollection({
398
+ ...props
399
+ }) {
400
+ return /* @__PURE__ */ jsx(
401
+ Autocomplete$1.Collection,
402
+ {
403
+ "data-slot": "autocomplete-collection",
404
+ ...props
405
+ }
406
+ );
407
+ }
408
+ function AutocompleteTrigger({
409
+ className,
410
+ ...props
411
+ }) {
412
+ return /* @__PURE__ */ jsx(
413
+ Autocomplete$1.Trigger,
414
+ {
415
+ className,
416
+ "data-slot": "autocomplete-trigger",
417
+ ...props
418
+ }
419
+ );
420
+ }
421
+ var CommandInputContext = React2.createContext({
422
+ inputRef: null
423
+ });
424
+ var CommandDialog = Dialog.Root;
425
+ function CommandDialogPortal({ ...props }) {
426
+ const container = useRootPortalContainer();
427
+ const style = {
428
+ ...props.style ?? {},
429
+ ["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
430
+ };
431
+ return /* @__PURE__ */ jsx(Dialog.Portal, { container, ...props, style });
432
+ }
433
+ function CommandDialogTrigger({
434
+ asChild,
435
+ nativeButton,
436
+ children,
437
+ ...props
438
+ }) {
439
+ if (asChild && React2.isValidElement(children)) {
440
+ return /* @__PURE__ */ jsx(
441
+ Dialog.Trigger,
442
+ {
443
+ "data-slot": "command-dialog-trigger",
444
+ nativeButton: nativeButton ?? true,
445
+ ...props,
446
+ render: (triggerProps) => {
447
+ const { nativeButton: _, ...rest } = triggerProps;
448
+ return React2.cloneElement(
449
+ children,
450
+ mergePropsWithRef(rest, children)
451
+ );
452
+ }
453
+ }
454
+ );
455
+ }
456
+ return /* @__PURE__ */ jsx(
457
+ Dialog.Trigger,
458
+ {
459
+ "data-slot": "command-dialog-trigger",
460
+ nativeButton,
461
+ ...props,
462
+ children
463
+ }
464
+ );
465
+ }
466
+ function CommandDialogBackdrop({
467
+ className,
468
+ ...props
469
+ }) {
470
+ return /* @__PURE__ */ jsx(
471
+ Dialog.Backdrop,
472
+ {
473
+ className: cn(
474
+ "fixed inset-0 z-[var(--z-layer-toast)] bg-black/32 backdrop-blur-sm transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0",
475
+ className
476
+ ),
477
+ "data-slot": "command-dialog-backdrop",
478
+ ...props
479
+ }
480
+ );
481
+ }
482
+ function CommandDialogViewport({
483
+ className,
484
+ ...props
485
+ }) {
486
+ return /* @__PURE__ */ jsx(
487
+ Dialog.Viewport,
488
+ {
489
+ className: cn(
490
+ "fixed inset-0 z-[var(--z-layer-toast)] flex flex-col items-center px-4 py-[max(--spacing(4),4vh)] sm:py-[10vh]",
491
+ className
492
+ ),
493
+ "data-slot": "command-dialog-viewport",
494
+ ...props
495
+ }
496
+ );
497
+ }
498
+ function CommandDialogPopup({
499
+ className,
500
+ children,
501
+ ...props
502
+ }) {
503
+ const inputRef = React2.useRef(null);
504
+ return /* @__PURE__ */ jsxs(CommandDialogPortal, { children: [
505
+ /* @__PURE__ */ jsx(CommandDialogBackdrop, {}),
506
+ /* @__PURE__ */ jsx(CommandDialogViewport, { children: /* @__PURE__ */ jsx(
507
+ Dialog.Popup,
508
+ {
509
+ className: cn(
510
+ "-translate-y-[calc(1.25rem*var(--nested-dialogs))] relative row-start-2 flex max-h-100 min-h-0 w-full min-w-0 max-w-xl scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/50 before:shadow-[0_1px_--theme(--color-black/4%)] data-nested:data-ending-style:translate-y-8 data-nested:data-starting-style:translate-y-8 data-nested-dialog-open:origin-top data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 **:data-[slot=scroll-area-viewport]:data-has-overflow-y:pe-1 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
511
+ className
512
+ ),
513
+ "data-slot": "command-dialog-popup",
514
+ initialFocus: inputRef,
515
+ ...props,
516
+ children: /* @__PURE__ */ jsx(ModalPortalScope, { children: /* @__PURE__ */ jsx(CommandInputContext.Provider, { value: { inputRef }, children }) })
517
+ }
518
+ ) })
519
+ ] });
520
+ }
521
+ function Command({
522
+ autoHighlight = "always",
523
+ keepHighlight = true,
524
+ open = true,
525
+ ...props
526
+ }) {
527
+ const AutocompleteAny = Autocomplete;
528
+ return /* @__PURE__ */ jsx(
529
+ AutocompleteAny,
530
+ {
531
+ autoHighlight,
532
+ keepHighlight,
533
+ open,
534
+ ...props
535
+ }
536
+ );
537
+ }
538
+ function CommandInput({
539
+ className,
540
+ placeholder = void 0,
541
+ value,
542
+ onValueChange,
543
+ ...props
544
+ }) {
545
+ const { inputRef } = React2.useContext(CommandInputContext);
546
+ return /* @__PURE__ */ jsx("div", { className: "px-2.5 py-1.5", children: /* @__PURE__ */ jsx(
547
+ AutocompleteInput,
548
+ {
549
+ className: cn(
550
+ "border-transparent! bg-transparent! shadow-none before:hidden has-focus-visible:ring-0",
551
+ className
552
+ ),
553
+ placeholder,
554
+ ref: inputRef,
555
+ size: "lg",
556
+ startAddon: /* @__PURE__ */ jsx(SearchIcon, {}),
557
+ value,
558
+ onChange: onValueChange ? (e) => onValueChange(e.target.value) : void 0,
559
+ ...props
560
+ }
561
+ ) });
562
+ }
563
+ function CommandList({
564
+ className,
565
+ ...props
566
+ }) {
567
+ return /* @__PURE__ */ jsx(
568
+ AutocompleteList,
569
+ {
570
+ className: cn("not-empty:scroll-py-2 not-empty:p-2", className),
571
+ "data-slot": "command-list",
572
+ ...props
573
+ }
574
+ );
575
+ }
576
+ function CommandEmpty({
577
+ className,
578
+ ...props
579
+ }) {
580
+ return /* @__PURE__ */ jsx(
581
+ AutocompleteEmpty,
582
+ {
583
+ className: cn("not-empty:py-6", className),
584
+ "data-slot": "command-empty",
585
+ ...props
586
+ }
587
+ );
588
+ }
589
+ function CommandPanel({ className, ...props }) {
590
+ return /* @__PURE__ */ jsx(
591
+ "div",
592
+ {
593
+ className: "-mx-px relative min-h-0 rounded-t-xl border bg-popover bg-clip-padding shadow-xs [clip-path:inset(0_1px)] before:pointer-events-none before:absolute before:inset-0 before:rounded-t-[calc(var(--radius-xl)-1px)] **:data-[slot=scroll-area-scrollbar]:mt-2 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
594
+ ...props
595
+ }
596
+ );
597
+ }
598
+ function CommandGroup({
599
+ className,
600
+ heading,
601
+ children,
602
+ ...props
603
+ }) {
604
+ return /* @__PURE__ */ jsxs(
605
+ AutocompleteGroup,
606
+ {
607
+ className,
608
+ "data-slot": "command-group",
609
+ ...props,
610
+ children: [
611
+ heading && /* @__PURE__ */ jsx(CommandGroupLabel, { children: heading }),
612
+ children
613
+ ]
614
+ }
615
+ );
616
+ }
617
+ function CommandGroupLabel({
618
+ className,
619
+ ...props
620
+ }) {
621
+ return /* @__PURE__ */ jsx(
622
+ AutocompleteGroupLabel,
623
+ {
624
+ className,
625
+ "data-slot": "command-group-label",
626
+ ...props
627
+ }
628
+ );
629
+ }
630
+ function CommandCollection({
631
+ ...props
632
+ }) {
633
+ return /* @__PURE__ */ jsx(AutocompleteCollection, { "data-slot": "command-collection", ...props });
634
+ }
635
+ function CommandItem({
636
+ className,
637
+ ...props
638
+ }) {
639
+ return /* @__PURE__ */ jsx(
640
+ AutocompleteItem,
641
+ {
642
+ className: cn("py-1.5", className),
643
+ "data-slot": "command-item",
644
+ ...props
645
+ }
646
+ );
647
+ }
648
+ function CommandSeparator({
649
+ className,
650
+ ...props
651
+ }) {
652
+ return /* @__PURE__ */ jsx(
653
+ AutocompleteSeparator,
654
+ {
655
+ className: cn("my-2", className),
656
+ "data-slot": "command-separator",
657
+ ...props
658
+ }
659
+ );
660
+ }
661
+ function CommandShortcut({ className, ...props }) {
662
+ return /* @__PURE__ */ jsx(
663
+ "span",
664
+ {
665
+ className: cn(
666
+ "ms-auto font-medium text-muted-foreground/72 text-xs tracking-widest",
667
+ className
668
+ ),
669
+ "data-slot": "command-shortcut",
670
+ ...props
671
+ }
672
+ );
673
+ }
674
+ function CommandFooter({ className, ...props }) {
675
+ return /* @__PURE__ */ jsx(
676
+ "div",
677
+ {
678
+ className: cn(
679
+ "flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] px-5 py-3 text-muted-foreground text-xs",
680
+ className
681
+ ),
682
+ "data-slot": "command-footer",
683
+ ...props
684
+ }
685
+ );
686
+ }
687
+
688
+ export { Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut };
689
+ //# sourceMappingURL=command.js.map
690
+ //# sourceMappingURL=command.js.map