@copilotkit/react-textarea 0.35.0-function-calling-fixes.1 → 0.35.0-function-calling-fixes.2

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 (104) hide show
  1. package/.turbo/turbo-build.log +308 -304
  2. package/CHANGELOG.md +12 -0
  3. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +1752 -36
  4. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
  5. package/dist/components/base-copilot-textarea/render-element.mjs +48 -4
  6. package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
  7. package/dist/components/base-copilot-textarea/render-placeholder.mjs +46 -4
  8. package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +1 -1
  9. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +83 -5
  10. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +1 -1
  11. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +54 -4
  12. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
  13. package/dist/components/copilot-textarea/copilot-textarea.mjs +2196 -45
  14. package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
  15. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +13 -5
  16. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
  17. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +130 -8
  18. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
  19. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +876 -19
  20. package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
  21. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +569 -14
  22. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
  23. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +592 -15
  24. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -1
  25. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +98 -7
  26. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs.map +1 -1
  27. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +592 -16
  28. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
  29. package/dist/components/index.mjs +2196 -48
  30. package/dist/components/index.mjs.map +1 -1
  31. package/dist/components/manual-ui/chip-with-icon.mjs +0 -2
  32. package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
  33. package/dist/components/source-search-box/source-search-box.mjs +207 -8
  34. package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
  35. package/dist/components/ui/button.mjs +81 -6
  36. package/dist/components/ui/button.mjs.map +1 -1
  37. package/dist/components/ui/card.mjs +42 -7
  38. package/dist/components/ui/card.mjs.map +1 -1
  39. package/dist/components/ui/command.mjs +232 -14
  40. package/dist/components/ui/command.mjs.map +1 -1
  41. package/dist/components/ui/dialog.mjs +134 -11
  42. package/dist/components/ui/dialog.mjs.map +1 -1
  43. package/dist/components/ui/label.mjs +56 -5
  44. package/dist/components/ui/label.mjs.map +1 -1
  45. package/dist/components/ui/separator.mjs +42 -7
  46. package/dist/components/ui/separator.mjs.map +1 -1
  47. package/dist/components/ui/textarea.mjs +42 -7
  48. package/dist/components/ui/textarea.mjs.map +1 -1
  49. package/dist/context/index.mjs +0 -1
  50. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +155 -7
  51. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
  52. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +165 -5
  53. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -1
  54. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +145 -6
  55. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
  56. package/dist/hooks/index.mjs +0 -1
  57. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +111 -5
  58. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -1
  59. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +160 -5
  60. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
  61. package/dist/hooks/misc/use-autosize-textarea.mjs +12 -4
  62. package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
  63. package/dist/index.mjs +2196 -56
  64. package/dist/index.mjs.map +1 -1
  65. package/dist/lib/debouncer.mjs +48 -4
  66. package/dist/lib/debouncer.mjs.map +1 -1
  67. package/dist/lib/editor-to-text.mjs +40 -4
  68. package/dist/lib/editor-to-text.mjs.map +1 -1
  69. package/dist/lib/get-text-around-cursor.mjs +96 -7
  70. package/dist/lib/get-text-around-cursor.mjs.map +1 -1
  71. package/dist/lib/retry.mjs +14 -4
  72. package/dist/lib/retry.mjs.map +1 -1
  73. package/dist/lib/slatejs-edits/add-autocompletions.mjs +22 -4
  74. package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
  75. package/dist/lib/slatejs-edits/clear-autocompletions.mjs +17 -4
  76. package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
  77. package/dist/lib/slatejs-edits/replace-text.mjs +24 -4
  78. package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
  79. package/dist/lib/slatejs-edits/with-partial-history.mjs +102 -5
  80. package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
  81. package/dist/lib/stream-promise-flatten.mjs +44 -4
  82. package/dist/lib/stream-promise-flatten.mjs.map +1 -1
  83. package/dist/lib/utils.mjs +63 -9
  84. package/dist/lib/utils.mjs.map +1 -1
  85. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +271 -9
  86. package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
  87. package/dist/types/autosuggestions-config/editing-api-config.mjs +82 -6
  88. package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
  89. package/dist/types/autosuggestions-config/index.mjs +271 -10
  90. package/dist/types/autosuggestions-config/index.mjs.map +1 -1
  91. package/dist/types/autosuggestions-config/insertions-api-config.mjs +73 -6
  92. package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
  93. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +59 -6
  94. package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
  95. package/dist/types/base/base-autosuggestions-config.mjs +23 -4
  96. package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
  97. package/dist/types/base/editor-autocomplete-state.mjs +14 -5
  98. package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
  99. package/dist/types/base/index.mjs +23 -5
  100. package/dist/types/base/index.mjs.map +1 -1
  101. package/dist/types/html-copilot-textarea-element.mjs +0 -1
  102. package/dist/types/index.mjs +271 -14
  103. package/dist/types/index.mjs.map +1 -1
  104. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/components/source-search-box/source-search-box.tsx","../../../src/components/ui/command.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { useState } from \"react\";\nimport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n} from \"../ui/command\";\n\nimport { Calculator, Calendar, CreditCard, Settings, Smile, User } from \"lucide-react\";\n\nimport { DocumentPointer } from \"@copilotkit/react-core\";\n\nexport interface SourceSearchBoxProps {\n searchTerm: string;\n suggestedFiles: DocumentPointer[];\n onSelectedFile: (filePointer: DocumentPointer) => void;\n}\n\nexport function SourceSearchBox(props: SourceSearchBoxProps) {\n const [selectedValue, setSelectedValue] = useState<string>(\"\");\n\n return (\n <Command\n className=\"rounded-lg border shadow-md\"\n value={selectedValue}\n onValueChange={(value) => {\n setSelectedValue(value);\n }}\n filter={(value, search) => {\n // if the search term is empty, show all commands\n if (props.searchTerm === \"\") return 1;\n\n // if the search term is a prefix of the command, show it\n if (value.startsWith(props.searchTerm)) return 1;\n\n // otherwise, don't show it\n return 0;\n }}\n >\n <CommandInput\n value={props.searchTerm}\n className=\"rounded-t-lg hidden\"\n placeholder=\"Search for a command...\"\n />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n\n <CommandGroup heading=\"Available resources\">\n {props.suggestedFiles.map((filePointer) => {\n return (\n <CommandItem\n key={`word-${filePointer.sourceApplication}.${filePointer.name}`}\n value={filePointer.name}\n onSelect={(value) => {\n props.onSelectedFile(filePointer);\n }}\n >\n <div className=\" px-3 flex flex-row gap-1 items-center\">\n <Logo width=\"20px\" height=\"20px\">\n <img\n src={filePointer.iconImageUri}\n alt={filePointer.sourceApplication}\n className=\"w-full h-full\"\n />\n </Logo>\n {filePointer.name}\n </div>\n </CommandItem>\n );\n })}\n </CommandGroup>\n\n {/* <CommandGroup heading=\"Suggestions\">\n <CommandItem\n onSelect={(value) => {\n console.log(value);\n console.log(value);\n }}\n >\n <Calendar className=\"mr-2 h-4 w-4\" />\n <span>Calendar</span>\n </CommandItem>\n <CommandItem>\n <Smile className=\"mr-2 h-4 w-4\" />\n <span>Search Emoji</span>\n </CommandItem>\n <CommandItem>\n <Calculator className=\"mr-2 h-4 w-4\" />\n <span>Calculator</span>\n </CommandItem>\n </CommandGroup> */}\n <CommandSeparator />\n </CommandList>\n </Command>\n );\n}\n\nexport function Logo({\n children,\n width,\n height,\n}: {\n children: React.ReactNode;\n width: string;\n height: string;\n}) {\n return (\n <div className=\"flex items-center justify-center\" style={{ width: width, height: height }}>\n {children}\n </div>\n );\n}\n","import * as React from \"react\";\nimport { DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps extends DialogProps {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n {/* <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" /> */}\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden pb-2\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\nexport const arraysAreEqual = (arr1: number[], arr2: number[]): boolean =>\n arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);\n\nexport function nullableCompatibleEqualityCheck<T>(\n naiveEqualityCheck: (a: T, b: T) => boolean,\n a: T | null | undefined,\n b: T | null | undefined,\n): boolean {\n if (a === null || a === undefined || b === null || b === undefined) {\n return a === b;\n }\n\n return naiveEqualityCheck(a, b);\n}\n"],"mappings":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CXM.mjs";
6
- import "../../chunk-MRXNTQOX.mjs";
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
29
+
30
+ // src/components/ui/button.tsx
31
+ import * as React from "react";
32
+ import { Slot } from "@radix-ui/react-slot";
33
+ import { cva } from "class-variance-authority";
34
+
35
+ // src/lib/utils.ts
36
+ import { clsx } from "clsx";
37
+ import { customAlphabet } from "nanoid";
38
+ import { twMerge } from "tailwind-merge";
39
+ function cn(...inputs) {
40
+ return twMerge(clsx(inputs));
41
+ }
42
+ var nanoid = customAlphabet(
43
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
44
+ 7
45
+ );
46
+
47
+ // src/components/ui/button.tsx
48
+ import { jsx } from "react/jsx-runtime";
49
+ var buttonVariants = cva(
50
+ "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
51
+ {
52
+ variants: {
53
+ variant: {
54
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
55
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
56
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
57
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
58
+ ghost: "hover:bg-accent hover:text-accent-foreground",
59
+ link: "text-primary underline-offset-4 hover:underline"
60
+ },
61
+ size: {
62
+ default: "h-10 px-4 py-2",
63
+ sm: "h-9 rounded-md px-3",
64
+ lg: "h-11 rounded-md px-8",
65
+ icon: "h-10 w-10"
66
+ }
67
+ },
68
+ defaultVariants: {
69
+ variant: "default",
70
+ size: "default"
71
+ }
72
+ }
73
+ );
74
+ var Button = React.forwardRef(
75
+ (_a, ref) => {
76
+ var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
77
+ const Comp = asChild ? Slot : "button";
78
+ return /* @__PURE__ */ jsx(Comp, __spreadValues({ className: cn(buttonVariants({ variant, size, className })), ref }, props));
79
+ }
80
+ );
81
+ Button.displayName = "Button";
7
82
  export {
8
83
  Button,
9
84
  buttonVariants
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/button.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\nexport const arraysAreEqual = (arr1: number[], arr2: number[]): boolean =>\n arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);\n\nexport function nullableCompatibleEqualityCheck<T>(\n naiveEqualityCheck: (a: T, b: T) => boolean,\n a: T | null | undefined,\n b: T | null | undefined,\n): boolean {\n if (a === null || a === undefined || b === null || b === undefined) {\n return a === b;\n }\n\n return naiveEqualityCheck(a, b);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;;;ACFvC,SAAS,YAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAEO,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AACF;;;AD+BM;AApCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,SAAe;AAAA,EACnB,CAAC,IAAyD,QAAQ;AAAjE,iBAAE,aAAW,SAAS,MAAM,UAAU,MAvCzC,IAuCG,IAAgD,kBAAhD,IAAgD,CAA9C,aAAW,WAAS,QAAM;AAC3B,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,oBAAC,uBAAK,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC,GAAG,OAAc,MAAO;AAAA,EAE5F;AACF;AACA,OAAO,cAAc;","names":[]}
@@ -1,13 +1,48 @@
1
- import {
2
- cn
3
- } from "../../chunk-7SUZ6CXM.mjs";
4
- import {
5
- __objRest,
6
- __spreadValues
7
- } from "../../chunk-MRXNTQOX.mjs";
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
8
29
 
9
30
  // src/components/ui/card.tsx
10
31
  import * as React from "react";
32
+
33
+ // src/lib/utils.ts
34
+ import { clsx } from "clsx";
35
+ import { customAlphabet } from "nanoid";
36
+ import { twMerge } from "tailwind-merge";
37
+ function cn(...inputs) {
38
+ return twMerge(clsx(inputs));
39
+ }
40
+ var nanoid = customAlphabet(
41
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
42
+ 7
43
+ );
44
+
45
+ // src/components/ui/card.tsx
11
46
  import { jsx } from "react/jsx-runtime";
12
47
  var Card = React.forwardRef(
13
48
  (_a, ref) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n ),\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex flex-col space-y-1.5 p-6\", className)} {...props} />\n ),\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n ),\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n ),\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center p-6 pt-0\", className)} {...props} />\n ),\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n"],"mappings":";;;;;;;;;A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AAG,8BAA8B,SAAS,KAAO,MAAO;AAAA;AAEtF;AACA,WAAW,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/card.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n ),\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex flex-col space-y-1.5 p-6\", className)} {...props} />\n ),\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n ),\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n ),\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center p-6 pt-0\", className)} {...props} />\n ),\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\nexport const arraysAreEqual = (arr1: number[], arr2: number[]): boolean =>\n arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);\n\nexport function nullableCompatibleEqualityCheck<T>(\n naiveEqualityCheck: (a: T, b: T) => boolean,\n a: T | null | undefined,\n b: T | null | undefined,\n): boolean {\n if (a === null || a === undefined || b === null || b === undefined) {\n return a === b;\n }\n\n return naiveEqualityCheck(a, b);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAY,WAAW;;;ACAvB,SAAS,YAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAEO,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AACF;;;ADLI;AAFJ,IAAM,OAAa;AAAA,EACjB,CAAC,IAAyB,QAAK;AAA9B,iBAAE,YALL,IAKG,IAAgB,kBAAhB,IAAgB,CAAd;AACD;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,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CommandList,
9
- CommandSeparator,
10
- CommandShortcut
11
- } from "../../chunk-FFSICDS5.mjs";
12
- import "../../chunk-4HBKWUCT.mjs";
13
- import "../../chunk-7SUZ6CXM.mjs";
14
- import "../../chunk-MRXNTQOX.mjs";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/components/ui/command.tsx
34
+ import * as React2 from "react";
35
+ import { Command as CommandPrimitive } from "cmdk";
36
+
37
+ // src/lib/utils.ts
38
+ import { clsx } from "clsx";
39
+ import { customAlphabet } from "nanoid";
40
+ import { twMerge } from "tailwind-merge";
41
+ function cn(...inputs) {
42
+ return twMerge(clsx(inputs));
43
+ }
44
+ var nanoid = customAlphabet(
45
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
46
+ 7
47
+ );
48
+
49
+ // src/components/ui/dialog.tsx
50
+ import * as React from "react";
51
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
52
+ import { X } from "lucide-react";
53
+ import { jsx, jsxs } from "react/jsx-runtime";
54
+ var Dialog = DialogPrimitive.Root;
55
+ var DialogPortal = (_a) => {
56
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
57
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, __spreadValues({ className: cn(className) }, props));
58
+ };
59
+ DialogPortal.displayName = DialogPrimitive.Portal.displayName;
60
+ var DialogOverlay = React.forwardRef((_a, ref) => {
61
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
62
+ return /* @__PURE__ */ jsx(
63
+ DialogPrimitive.Overlay,
64
+ __spreadValues({
65
+ ref,
66
+ className: cn(
67
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
68
+ className
69
+ )
70
+ }, props)
71
+ );
72
+ });
73
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
74
+ var DialogContent = React.forwardRef((_a, ref) => {
75
+ var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
76
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [
77
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
78
+ /* @__PURE__ */ jsxs(
79
+ DialogPrimitive.Content,
80
+ __spreadProps(__spreadValues({
81
+ ref,
82
+ className: cn(
83
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
84
+ className
85
+ )
86
+ }, props), {
87
+ children: [
88
+ children,
89
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
90
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
91
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
92
+ ] })
93
+ ]
94
+ })
95
+ )
96
+ ] });
97
+ });
98
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
99
+ var DialogHeader = (_a) => {
100
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
101
+ return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className) }, props));
102
+ };
103
+ DialogHeader.displayName = "DialogHeader";
104
+ var DialogFooter = (_a) => {
105
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
106
+ return /* @__PURE__ */ jsx(
107
+ "div",
108
+ __spreadValues({
109
+ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
110
+ }, props)
111
+ );
112
+ };
113
+ DialogFooter.displayName = "DialogFooter";
114
+ var DialogTitle = React.forwardRef((_a, ref) => {
115
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
116
+ return /* @__PURE__ */ jsx(
117
+ DialogPrimitive.Title,
118
+ __spreadValues({
119
+ ref,
120
+ className: cn("text-lg font-semibold leading-none tracking-tight", className)
121
+ }, props)
122
+ );
123
+ });
124
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
125
+ var DialogDescription = React.forwardRef((_a, ref) => {
126
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
127
+ return /* @__PURE__ */ jsx(
128
+ DialogPrimitive.Description,
129
+ __spreadValues({
130
+ ref,
131
+ className: cn("text-sm text-muted-foreground", className)
132
+ }, props)
133
+ );
134
+ });
135
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
136
+
137
+ // src/components/ui/command.tsx
138
+ import { jsx as jsx2 } from "react/jsx-runtime";
139
+ var Command = React2.forwardRef((_a, ref) => {
140
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
141
+ return /* @__PURE__ */ jsx2(
142
+ CommandPrimitive,
143
+ __spreadValues({
144
+ ref,
145
+ className: cn(
146
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
147
+ className
148
+ )
149
+ }, props)
150
+ );
151
+ });
152
+ Command.displayName = CommandPrimitive.displayName;
153
+ var CommandDialog = (_a) => {
154
+ var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
155
+ return /* @__PURE__ */ jsx2(Dialog, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx2(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ jsx2(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) }));
156
+ };
157
+ var CommandInput = React2.forwardRef((_a, ref) => {
158
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
159
+ return /* @__PURE__ */ jsx2("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: /* @__PURE__ */ jsx2(
160
+ CommandPrimitive.Input,
161
+ __spreadValues({
162
+ ref,
163
+ className: cn(
164
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
165
+ className
166
+ )
167
+ }, props)
168
+ ) });
169
+ });
170
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
171
+ var CommandList = React2.forwardRef((_a, ref) => {
172
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
173
+ return /* @__PURE__ */ jsx2(
174
+ CommandPrimitive.List,
175
+ __spreadValues({
176
+ ref,
177
+ className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden pb-2", className)
178
+ }, props)
179
+ );
180
+ });
181
+ CommandList.displayName = CommandPrimitive.List.displayName;
182
+ var CommandEmpty = React2.forwardRef((props, ref) => /* @__PURE__ */ jsx2(CommandPrimitive.Empty, __spreadValues({ ref, className: "py-6 text-center text-sm" }, props)));
183
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
184
+ var CommandGroup = React2.forwardRef((_a, ref) => {
185
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
186
+ return /* @__PURE__ */ jsx2(
187
+ CommandPrimitive.Group,
188
+ __spreadValues({
189
+ ref,
190
+ className: cn(
191
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
192
+ className
193
+ )
194
+ }, props)
195
+ );
196
+ });
197
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
198
+ var CommandSeparator = React2.forwardRef((_a, ref) => {
199
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
200
+ return /* @__PURE__ */ jsx2(
201
+ CommandPrimitive.Separator,
202
+ __spreadValues({
203
+ ref,
204
+ className: cn("-mx-1 h-px bg-border", className)
205
+ }, props)
206
+ );
207
+ });
208
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
209
+ var CommandItem = React2.forwardRef((_a, ref) => {
210
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
211
+ return /* @__PURE__ */ jsx2(
212
+ CommandPrimitive.Item,
213
+ __spreadValues({
214
+ ref,
215
+ className: cn(
216
+ "relative flex cursor-default select-none items-center rounded-sm text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
217
+ className
218
+ )
219
+ }, props)
220
+ );
221
+ });
222
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
223
+ var CommandShortcut = (_a) => {
224
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
225
+ return /* @__PURE__ */ jsx2(
226
+ "span",
227
+ __spreadValues({
228
+ className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className)
229
+ }, props)
230
+ );
231
+ };
232
+ CommandShortcut.displayName = "CommandShortcut";
15
233
  export {
16
234
  Command,
17
235
  CommandDialog,
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/command.tsx","../../../src/lib/utils.ts","../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps extends DialogProps {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n {/* <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" /> */}\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden pb-2\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\nexport const arraysAreEqual = (arr1: number[], arr2: number[]): boolean =>\n arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);\n\nexport function nullableCompatibleEqualityCheck<T>(\n naiveEqualityCheck: (a: T, b: T) => boolean,\n a: T | null | undefined,\n b: T | null | undefined,\n): boolean {\n if (a === null || a === undefined || b === null || b === undefined) {\n return a === b;\n }\n\n return naiveEqualityCheck(a, b);\n}\n","import * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = ({ className, ...props }: DialogPrimitive.DialogPortalProps) => (\n <DialogPrimitive.Portal className={cn(className)} {...props} />\n);\nDialogPortal.displayName = DialogPrimitive.Portal.displayName;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAYA,YAAW;AAEvB,SAAS,WAAW,wBAAwB;;;ACF5C,SAAS,YAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAEO,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AACF;;;ACXA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,SAAS;AAShB,cAkCI,YAlCJ;AALF,IAAM,SAAyB;AAI/B,IAAM,eAAe,CAAC,OAA4D;AAA5D,eAAE,YAVxB,IAUsB,IAAgB,kBAAhB,IAAgB,CAAd;AACtB,6BAAiB,wBAAhB,iBAAuB,WAAW,GAAG,SAAS,KAAO,MAAO;AAAA;AAE/D,aAAa,cAA8B,uBAAO;AAElD,IAAM,gBAAsB,iBAG1B,CAAC,IAAyB,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,IAAgB,kBAAhB,IAAgB,CAAd;AACzB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,yDAAyD,SAAS;AAAA,OAC5E;AAAA,EACN;AAEJ;AACA,gBAAgB,cAAc;","names":["React","jsx"]}
@@ -1,14 +1,137 @@
1
- import {
2
- Dialog,
3
- DialogContent,
4
- DialogDescription,
5
- DialogFooter,
6
- DialogHeader,
7
- DialogTitle,
8
- DialogTrigger
9
- } from "../../chunk-4HBKWUCT.mjs";
10
- import "../../chunk-7SUZ6CXM.mjs";
11
- import "../../chunk-MRXNTQOX.mjs";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/components/ui/dialog.tsx
34
+ import * as React from "react";
35
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
36
+ import { X } from "lucide-react";
37
+
38
+ // src/lib/utils.ts
39
+ import { clsx } from "clsx";
40
+ import { customAlphabet } from "nanoid";
41
+ import { twMerge } from "tailwind-merge";
42
+ function cn(...inputs) {
43
+ return twMerge(clsx(inputs));
44
+ }
45
+ var nanoid = customAlphabet(
46
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
47
+ 7
48
+ );
49
+
50
+ // src/components/ui/dialog.tsx
51
+ import { jsx, jsxs } from "react/jsx-runtime";
52
+ var Dialog = DialogPrimitive.Root;
53
+ var DialogTrigger = DialogPrimitive.Trigger;
54
+ var DialogPortal = (_a) => {
55
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
56
+ return /* @__PURE__ */ jsx(DialogPrimitive.Portal, __spreadValues({ className: cn(className) }, props));
57
+ };
58
+ DialogPortal.displayName = DialogPrimitive.Portal.displayName;
59
+ var DialogOverlay = React.forwardRef((_a, ref) => {
60
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
61
+ return /* @__PURE__ */ jsx(
62
+ DialogPrimitive.Overlay,
63
+ __spreadValues({
64
+ ref,
65
+ className: cn(
66
+ "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
67
+ className
68
+ )
69
+ }, props)
70
+ );
71
+ });
72
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
73
+ var DialogContent = React.forwardRef((_a, ref) => {
74
+ var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
75
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [
76
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
77
+ /* @__PURE__ */ jsxs(
78
+ DialogPrimitive.Content,
79
+ __spreadProps(__spreadValues({
80
+ ref,
81
+ className: cn(
82
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
83
+ className
84
+ )
85
+ }, props), {
86
+ children: [
87
+ children,
88
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
89
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
90
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
91
+ ] })
92
+ ]
93
+ })
94
+ )
95
+ ] });
96
+ });
97
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
98
+ var DialogHeader = (_a) => {
99
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
100
+ return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className) }, props));
101
+ };
102
+ DialogHeader.displayName = "DialogHeader";
103
+ var DialogFooter = (_a) => {
104
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
105
+ return /* @__PURE__ */ jsx(
106
+ "div",
107
+ __spreadValues({
108
+ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)
109
+ }, props)
110
+ );
111
+ };
112
+ DialogFooter.displayName = "DialogFooter";
113
+ var DialogTitle = React.forwardRef((_a, ref) => {
114
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
115
+ return /* @__PURE__ */ jsx(
116
+ DialogPrimitive.Title,
117
+ __spreadValues({
118
+ ref,
119
+ className: cn("text-lg font-semibold leading-none tracking-tight", className)
120
+ }, props)
121
+ );
122
+ });
123
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
124
+ var DialogDescription = React.forwardRef((_a, ref) => {
125
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
126
+ return /* @__PURE__ */ jsx(
127
+ DialogPrimitive.Description,
128
+ __spreadValues({
129
+ ref,
130
+ className: cn("text-sm text-muted-foreground", className)
131
+ }, props)
132
+ );
133
+ });
134
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
12
135
  export {
13
136
  Dialog,
14
137
  DialogContent,