notra-editor 0.6.0 → 0.8.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 (115) hide show
  1. package/dist/components/blockquote-button/blockquote-button.d.cts +2 -2
  2. package/dist/components/blockquote-button/blockquote-button.d.ts +2 -2
  3. package/dist/components/code-block-button/code-block-button.d.cts +2 -2
  4. package/dist/components/code-block-button/code-block-button.d.ts +2 -2
  5. package/dist/components/heading-dropdown-menu/heading-dropdown-menu.d.cts +2 -2
  6. package/dist/components/heading-dropdown-menu/heading-dropdown-menu.d.ts +2 -2
  7. package/dist/components/heading-dropdown-menu/heading-menu-item.d.cts +2 -2
  8. package/dist/components/heading-dropdown-menu/heading-menu-item.d.ts +2 -2
  9. package/dist/components/image-popover/image-popover.d.cts +2 -2
  10. package/dist/components/image-popover/image-popover.d.ts +2 -2
  11. package/dist/components/image-popover/use-image-popover.d.cts +3 -3
  12. package/dist/components/image-popover/use-image-popover.d.ts +3 -3
  13. package/dist/components/link-popover/link-popover.d.cts +2 -2
  14. package/dist/components/link-popover/link-popover.d.ts +2 -2
  15. package/dist/components/link-popover/use-link-popover.d.cts +2 -2
  16. package/dist/components/link-popover/use-link-popover.d.ts +2 -2
  17. package/dist/components/list-dropdown-menu/list-dropdown-menu.d.cts +2 -2
  18. package/dist/components/list-dropdown-menu/list-dropdown-menu.d.ts +2 -2
  19. package/dist/components/list-dropdown-menu/list-menu-item.d.cts +2 -2
  20. package/dist/components/list-dropdown-menu/list-menu-item.d.ts +2 -2
  21. package/dist/components/mark-button/mark-button.d.cts +2 -2
  22. package/dist/components/mark-button/mark-button.d.ts +2 -2
  23. package/dist/components/toolbar/toolbar.d.cts +2 -2
  24. package/dist/components/toolbar/toolbar.d.ts +2 -2
  25. package/dist/components/ui/button.d.cts +2 -2
  26. package/dist/components/ui/button.d.ts +2 -2
  27. package/dist/components/ui/command.cjs +92 -29
  28. package/dist/components/ui/command.cjs.map +1 -1
  29. package/dist/components/ui/command.d.cts +18 -8
  30. package/dist/components/ui/command.d.ts +18 -8
  31. package/dist/components/ui/command.mjs +95 -29
  32. package/dist/components/ui/command.mjs.map +1 -1
  33. package/dist/components/ui/dialog.cjs +188 -0
  34. package/dist/components/ui/dialog.cjs.map +1 -0
  35. package/dist/components/ui/dialog.d.cts +20 -0
  36. package/dist/components/ui/dialog.d.ts +20 -0
  37. package/dist/components/ui/dialog.mjs +155 -0
  38. package/dist/components/ui/dialog.mjs.map +1 -0
  39. package/dist/components/ui/dropdown-menu.cjs +3 -2
  40. package/dist/components/ui/dropdown-menu.cjs.map +1 -1
  41. package/dist/components/ui/dropdown-menu.d.cts +16 -16
  42. package/dist/components/ui/dropdown-menu.d.ts +16 -16
  43. package/dist/components/ui/dropdown-menu.mjs +3 -2
  44. package/dist/components/ui/dropdown-menu.mjs.map +1 -1
  45. package/dist/components/ui/input-group.cjs +175 -0
  46. package/dist/components/ui/input-group.cjs.map +1 -0
  47. package/dist/components/ui/input-group.d.cts +20 -0
  48. package/dist/components/ui/input-group.d.ts +20 -0
  49. package/dist/components/ui/input-group.mjs +146 -0
  50. package/dist/components/ui/input-group.mjs.map +1 -0
  51. package/dist/components/ui/input.cjs +1 -1
  52. package/dist/components/ui/input.cjs.map +1 -1
  53. package/dist/components/ui/input.d.cts +2 -2
  54. package/dist/components/ui/input.d.ts +2 -2
  55. package/dist/components/ui/input.mjs +1 -1
  56. package/dist/components/ui/input.mjs.map +1 -1
  57. package/dist/components/ui/popover.cjs +46 -6
  58. package/dist/components/ui/popover.cjs.map +1 -1
  59. package/dist/components/ui/popover.d.cts +9 -6
  60. package/dist/components/ui/popover.d.ts +9 -6
  61. package/dist/components/ui/popover.mjs +43 -6
  62. package/dist/components/ui/popover.mjs.map +1 -1
  63. package/dist/components/ui/separator.cjs +2 -1
  64. package/dist/components/ui/separator.cjs.map +1 -1
  65. package/dist/components/ui/separator.d.cts +2 -2
  66. package/dist/components/ui/separator.d.ts +2 -2
  67. package/dist/components/ui/separator.mjs +2 -1
  68. package/dist/components/ui/separator.mjs.map +1 -1
  69. package/dist/components/ui/textarea.cjs +43 -0
  70. package/dist/components/ui/textarea.cjs.map +1 -0
  71. package/dist/components/ui/textarea.d.cts +6 -0
  72. package/dist/components/ui/textarea.d.ts +6 -0
  73. package/dist/components/ui/textarea.mjs +19 -0
  74. package/dist/components/ui/textarea.mjs.map +1 -0
  75. package/dist/components/undo-redo-button/undo-redo-button.d.cts +2 -2
  76. package/dist/components/undo-redo-button/undo-redo-button.d.ts +2 -2
  77. package/dist/components/undo-redo-button/use-undo-redo.d.cts +2 -2
  78. package/dist/components/undo-redo-button/use-undo-redo.d.ts +2 -2
  79. package/dist/extensions/code-block.cjs.map +1 -1
  80. package/dist/extensions/code-block.mjs.map +1 -1
  81. package/dist/hooks/use-markdown-editor.cjs +9 -0
  82. package/dist/hooks/use-markdown-editor.cjs.map +1 -1
  83. package/dist/hooks/use-markdown-editor.d.cts +0 -1
  84. package/dist/hooks/use-markdown-editor.d.ts +0 -1
  85. package/dist/hooks/use-markdown-editor.mjs +9 -0
  86. package/dist/hooks/use-markdown-editor.mjs.map +1 -1
  87. package/dist/notra-editor.cjs +3 -12
  88. package/dist/notra-editor.cjs.map +1 -1
  89. package/dist/notra-editor.d.cts +1 -7
  90. package/dist/notra-editor.d.ts +1 -7
  91. package/dist/notra-editor.mjs +3 -12
  92. package/dist/notra-editor.mjs.map +1 -1
  93. package/dist/notra-reader.cjs +1 -3
  94. package/dist/notra-reader.cjs.map +1 -1
  95. package/dist/notra-reader.d.cts +1 -3
  96. package/dist/notra-reader.d.ts +1 -3
  97. package/dist/notra-reader.mjs +1 -3
  98. package/dist/notra-reader.mjs.map +1 -1
  99. package/dist/styles/globals.css +952 -205
  100. package/dist/themes/default/editor.css +3035 -245
  101. package/dist/themes/default/reader.css +965 -10
  102. package/package.json +5 -3
  103. package/dist/icons/redo-icon.cjs +0 -54
  104. package/dist/icons/redo-icon.cjs.map +0 -1
  105. package/dist/icons/redo-icon.d.cts +0 -7
  106. package/dist/icons/redo-icon.d.ts +0 -7
  107. package/dist/icons/redo-icon.mjs +0 -30
  108. package/dist/icons/redo-icon.mjs.map +0 -1
  109. package/dist/icons/undo-icon.cjs +0 -54
  110. package/dist/icons/undo-icon.cjs.map +0 -1
  111. package/dist/icons/undo-icon.d.cts +0 -7
  112. package/dist/icons/undo-icon.d.ts +0 -7
  113. package/dist/icons/undo-icon.mjs +0 -30
  114. package/dist/icons/undo-icon.mjs.map +0 -1
  115. package/dist/themes/default/shared.css +0 -576
@@ -1,12 +1,22 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Command as Command$1 } from 'cmdk';
3
- import * as react from 'react';
3
+ import * as React from 'react';
4
+ import { Dialog } from './dialog.cjs';
5
+ import 'radix-ui';
4
6
 
5
- declare function Command({ className, ...props }: react.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
6
- declare function CommandInput({ className, ...props }: react.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
7
- declare function CommandList({ className, ...props }: react.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
8
- declare function CommandEmpty({ ...props }: react.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
9
- declare function CommandGroup({ className, ...props }: react.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
10
- declare function CommandItem({ className, ...props }: react.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
7
+ declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
8
+ declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
9
+ title?: string;
10
+ description?: string;
11
+ className?: string;
12
+ showCloseButton?: boolean;
13
+ }): react_jsx_runtime.JSX.Element;
14
+ declare function CommandInput({ className, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
15
+ declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
16
+ declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
17
+ declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
18
+ declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
19
+ declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
20
+ declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
11
21
 
12
- export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList };
22
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -1,12 +1,22 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Command as Command$1 } from 'cmdk';
3
- import * as react from 'react';
3
+ import * as React from 'react';
4
+ import { Dialog } from './dialog.js';
5
+ import 'radix-ui';
4
6
 
5
- declare function Command({ className, ...props }: react.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
6
- declare function CommandInput({ className, ...props }: react.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
7
- declare function CommandList({ className, ...props }: react.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
8
- declare function CommandEmpty({ ...props }: react.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
9
- declare function CommandGroup({ className, ...props }: react.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
10
- declare function CommandItem({ className, ...props }: react.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
7
+ declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
8
+ declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
9
+ title?: string;
10
+ description?: string;
11
+ className?: string;
12
+ showCloseButton?: boolean;
13
+ }): react_jsx_runtime.JSX.Element;
14
+ declare function CommandInput({ className, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
15
+ declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
16
+ declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
17
+ declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof Command$1.Group>): react_jsx_runtime.JSX.Element;
18
+ declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
19
+ declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
20
+ declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
11
21
 
12
- export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList };
22
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -1,6 +1,15 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { Command as CommandPrimitive } from "cmdk";
3
- import { SearchIcon } from "lucide-react";
4
+ import { SearchIcon, CheckIcon } from "lucide-react";
5
+ import {
6
+ Dialog,
7
+ DialogContent,
8
+ DialogDescription,
9
+ DialogHeader,
10
+ DialogTitle
11
+ } from "./dialog";
12
+ import { InputGroup, InputGroupAddon } from "./input-group";
4
13
  import { cn } from "../../lib/utils";
5
14
  function Command({
6
15
  className,
@@ -10,7 +19,7 @@ function Command({
10
19
  CommandPrimitive,
11
20
  {
12
21
  className: cn(
13
- "nt:flex nt:h-full nt:w-full nt:flex-col nt:overflow-hidden nt:rounded-lg nt:bg-popover nt:text-popover-foreground",
22
+ "nt:flex nt:size-full nt:flex-col nt:overflow-hidden nt:rounded-xl! nt:bg-popover nt:p-1 nt:text-popover-foreground",
14
23
  className
15
24
  ),
16
25
  "data-slot": "command",
@@ -18,31 +27,50 @@ function Command({
18
27
  }
19
28
  );
20
29
  }
30
+ function CommandDialog({
31
+ title = "Command Palette",
32
+ description = "Search for a command to run...",
33
+ children,
34
+ className,
35
+ showCloseButton = false,
36
+ ...props
37
+ }) {
38
+ return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
39
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "nt:sr-only", children: [
40
+ /* @__PURE__ */ jsx(DialogTitle, { children: title }),
41
+ /* @__PURE__ */ jsx(DialogDescription, { children: description })
42
+ ] }),
43
+ /* @__PURE__ */ jsx(
44
+ DialogContent,
45
+ {
46
+ className: cn(
47
+ "nt:top-1/3 nt:translate-y-0 nt:overflow-hidden nt:rounded-xl! nt:p-0",
48
+ className
49
+ ),
50
+ showCloseButton,
51
+ children
52
+ }
53
+ )
54
+ ] });
55
+ }
21
56
  function CommandInput({
22
57
  className,
23
58
  ...props
24
59
  }) {
25
- return /* @__PURE__ */ jsxs(
26
- "div",
27
- {
28
- className: "nt:flex nt:items-center nt:gap-2 nt:border-b nt:border-foreground/10 nt:px-3",
29
- "data-slot": "command-input-wrapper",
30
- children: [
31
- /* @__PURE__ */ jsx(SearchIcon, { className: "nt:size-4 nt:shrink-0 nt:opacity-50" }),
32
- /* @__PURE__ */ jsx(
33
- CommandPrimitive.Input,
34
- {
35
- className: cn(
36
- "nt:flex nt:h-9 nt:w-full nt:rounded-md nt:bg-transparent nt:py-3 nt:text-sm nt:outline-hidden nt:placeholder:text-muted-foreground nt:disabled:cursor-not-allowed nt:disabled:opacity-50",
37
- className
38
- ),
39
- "data-slot": "command-input",
40
- ...props
41
- }
42
- )
43
- ]
44
- }
45
- );
60
+ return /* @__PURE__ */ jsx("div", { className: "nt:p-1 nt:pb-0", "data-slot": "command-input-wrapper", children: /* @__PURE__ */ jsxs(InputGroup, { className: "nt:h-8! nt:rounded-lg! nt:border-input/30 nt:bg-input/30 nt:shadow-none! nt:*:data-[slot=input-group-addon]:pl-2!", children: [
61
+ /* @__PURE__ */ jsx(
62
+ CommandPrimitive.Input,
63
+ {
64
+ className: cn(
65
+ "nt:w-full nt:text-sm nt:outline-hidden nt:disabled:cursor-not-allowed nt:disabled:opacity-50",
66
+ className
67
+ ),
68
+ "data-slot": "command-input",
69
+ ...props
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(SearchIcon, { className: "nt:size-4 nt:shrink-0 nt:opacity-50" }) })
73
+ ] }) });
46
74
  }
47
75
  function CommandList({
48
76
  className,
@@ -52,7 +80,7 @@ function CommandList({
52
80
  CommandPrimitive.List,
53
81
  {
54
82
  className: cn(
55
- "nt:max-h-[300px] nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto",
83
+ "nt:no-scrollbar nt:max-h-72 nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto nt:outline-none",
56
84
  className
57
85
  ),
58
86
  "data-slot": "command-list",
@@ -61,12 +89,13 @@ function CommandList({
61
89
  );
62
90
  }
63
91
  function CommandEmpty({
92
+ className,
64
93
  ...props
65
94
  }) {
66
95
  return /* @__PURE__ */ jsx(
67
96
  CommandPrimitive.Empty,
68
97
  {
69
- className: "nt:py-6 nt:text-center nt:text-sm",
98
+ className: cn("nt:py-6 nt:text-center nt:text-sm", className),
70
99
  "data-slot": "command-empty",
71
100
  ...props
72
101
  }
@@ -80,7 +109,7 @@ function CommandGroup({
80
109
  CommandPrimitive.Group,
81
110
  {
82
111
  className: cn(
83
- "nt:overflow-hidden nt:p-1 nt:text-foreground nt:[&_[cmdk-group-heading]]:px-2 nt:[&_[cmdk-group-heading]]:py-1.5 nt:[&_[cmdk-group-heading]]:text-xs nt:[&_[cmdk-group-heading]]:font-medium nt:[&_[cmdk-group-heading]]:text-muted-foreground",
112
+ "nt:overflow-hidden nt:p-1 nt:text-foreground nt:**:[[cmdk-group-heading]]:px-2 nt:**:[[cmdk-group-heading]]:py-1.5 nt:**:[[cmdk-group-heading]]:text-xs nt:**:[[cmdk-group-heading]]:font-medium nt:**:[[cmdk-group-heading]]:text-muted-foreground",
84
113
  className
85
114
  ),
86
115
  "data-slot": "command-group",
@@ -88,28 +117,65 @@ function CommandGroup({
88
117
  }
89
118
  );
90
119
  }
91
- function CommandItem({
120
+ function CommandSeparator({
92
121
  className,
93
122
  ...props
94
123
  }) {
95
124
  return /* @__PURE__ */ jsx(
125
+ CommandPrimitive.Separator,
126
+ {
127
+ className: cn("nt:-mx-1 nt:h-px nt:bg-border", className),
128
+ "data-slot": "command-separator",
129
+ ...props
130
+ }
131
+ );
132
+ }
133
+ function CommandItem({
134
+ className,
135
+ children,
136
+ ...props
137
+ }) {
138
+ return /* @__PURE__ */ jsxs(
96
139
  CommandPrimitive.Item,
97
140
  {
98
141
  className: cn(
99
- "nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-md nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:data-[selected=true]:bg-accent nt:data-[selected=true]:text-accent-foreground nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50",
142
+ "nt:group/command-item nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-sm nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:in-data-[slot=dialog-content]:rounded-lg! nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50 nt:data-selected:bg-muted nt:data-selected:text-foreground nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4 nt:data-selected:*:[svg]:text-foreground",
100
143
  className
101
144
  ),
102
145
  "data-slot": "command-item",
146
+ ...props,
147
+ children: [
148
+ children,
149
+ /* @__PURE__ */ jsx(CheckIcon, { className: "nt:ml-auto nt:opacity-0 nt:group-has-data-[slot=command-shortcut]/command-item:hidden nt:group-data-[checked=true]/command-item:opacity-100" })
150
+ ]
151
+ }
152
+ );
153
+ }
154
+ function CommandShortcut({
155
+ className,
156
+ ...props
157
+ }) {
158
+ return /* @__PURE__ */ jsx(
159
+ "span",
160
+ {
161
+ className: cn(
162
+ "nt:ml-auto nt:text-xs nt:tracking-widest nt:text-muted-foreground nt:group-data-selected/command-item:text-foreground",
163
+ className
164
+ ),
165
+ "data-slot": "command-shortcut",
103
166
  ...props
104
167
  }
105
168
  );
106
169
  }
107
170
  export {
108
171
  Command,
172
+ CommandDialog,
109
173
  CommandEmpty,
110
174
  CommandGroup,
111
175
  CommandInput,
112
176
  CommandItem,
113
- CommandList
177
+ CommandList,
178
+ CommandSeparator,
179
+ CommandShortcut
114
180
  };
115
181
  //# sourceMappingURL=command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t'nt:flex nt:h-full nt:w-full nt:flex-col nt:overflow-hidden nt:rounded-lg nt:bg-popover nt:text-popover-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"nt:flex nt:items-center nt:gap-2 nt:border-b nt:border-foreground/10 nt:px-3\"\n\t\t\tdata-slot=\"command-input-wrapper\"\n\t\t>\n\t\t\t<SearchIcon className=\"nt:size-4 nt:shrink-0 nt:opacity-50\" />\n\t\t\t<CommandPrimitive.Input\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:flex nt:h-9 nt:w-full nt:rounded-md nt:bg-transparent nt:py-3 nt:text-sm nt:outline-hidden nt:placeholder:text-muted-foreground nt:disabled:cursor-not-allowed nt:disabled:opacity-50',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tclassName={cn(\n\t\t\t\t'nt:max-h-[300px] nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-list\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tclassName=\"nt:py-6 nt:text-center nt:text-sm\"\n\t\t\tdata-slot=\"command-empty\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tclassName={cn(\n\t\t\t\t'nt:overflow-hidden nt:p-1 nt:text-foreground nt:[&_[cmdk-group-heading]]:px-2 nt:[&_[cmdk-group-heading]]:py-1.5 nt:[&_[cmdk-group-heading]]:text-xs nt:[&_[cmdk-group-heading]]:font-medium nt:[&_[cmdk-group-heading]]:text-muted-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tclassName={cn(\n\t\t\t\t'nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-md nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:data-[selected=true]:bg-accent nt:data-[selected=true]:text-accent-foreground nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-item\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList\n};\n"],"mappings":"AAWE,cAgBA,YAhBA;AAXF,SAAS,WAAW,wBAAwB;AAC5C,SAAS,kBAAkB;AAG3B,SAAS,UAAU;AAEnB,SAAS,QAAQ;AAAA,EAChB;AAAA,EACA,GAAG;AACJ,GAAkD;AACjD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,aAAU;AAAA,MAEV;AAAA,4BAAC,cAAW,WAAU,uCAAsC;AAAA,QAC5D;AAAA,UAAC,iBAAiB;AAAA,UAAjB;AAAA,YACA,WAAW;AAAA,cACV;AAAA,cACA;AAAA,YACD;AAAA,YACA,aAAU;AAAA,YACT,GAAG;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA,GAAG;AACJ,GAAuD;AACtD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAU;AAAA,MACV,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,aAAa;AAAA,EACrB;AAAA,EACA,GAAG;AACJ,GAAwD;AACvD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA,GAAG;AACJ,GAAuD;AACtD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/ui/command.tsx"],"sourcesContent":["'use client';\n\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon, CheckIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogHeader,\n\tDialogTitle\n} from './dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\nimport { cn } from '../../lib/utils';\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tclassName={cn(\n\t\t\t\t'nt:flex nt:size-full nt:flex-col nt:overflow-hidden nt:rounded-xl! nt:bg-popover nt:p-1 nt:text-popover-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandDialog({\n\ttitle = 'Command Palette',\n\tdescription = 'Search for a command to run...',\n\tchildren,\n\tclassName,\n\tshowCloseButton = false,\n\t...props\n}: React.ComponentProps<typeof Dialog> & {\n\ttitle?: string;\n\tdescription?: string;\n\tclassName?: string;\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<Dialog {...props}>\n\t\t\t<DialogHeader className=\"nt:sr-only\">\n\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t</DialogHeader>\n\t\t\t<DialogContent\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:top-1/3 nt:translate-y-0 nt:overflow-hidden nt:rounded-xl! nt:p-0',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tshowCloseButton={showCloseButton}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div className=\"nt:p-1 nt:pb-0\" data-slot=\"command-input-wrapper\">\n\t\t\t<InputGroup className=\"nt:h-8! nt:rounded-lg! nt:border-input/30 nt:bg-input/30 nt:shadow-none! nt:*:data-[slot=input-group-addon]:pl-2!\">\n\t\t\t\t<CommandPrimitive.Input\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'nt:w-full nt:text-sm nt:outline-hidden nt:disabled:cursor-not-allowed nt:disabled:opacity-50',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t\t<InputGroupAddon>\n\t\t\t\t\t<SearchIcon className=\"nt:size-4 nt:shrink-0 nt:opacity-50\" />\n\t\t\t\t</InputGroupAddon>\n\t\t\t</InputGroup>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tclassName={cn(\n\t\t\t\t'nt:no-scrollbar nt:max-h-72 nt:scroll-py-1 nt:overflow-x-hidden nt:overflow-y-auto nt:outline-none',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-list\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tclassName={cn('nt:py-6 nt:text-center nt:text-sm', className)}\n\t\t\tdata-slot=\"command-empty\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tclassName={cn(\n\t\t\t\t'nt:overflow-hidden nt:p-1 nt:text-foreground nt:**:[[cmdk-group-heading]]:px-2 nt:**:[[cmdk-group-heading]]:py-1.5 nt:**:[[cmdk-group-heading]]:text-xs nt:**:[[cmdk-group-heading]]:font-medium nt:**:[[cmdk-group-heading]]:text-muted-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n\treturn (\n\t\t<CommandPrimitive.Separator\n\t\t\tclassName={cn('nt:-mx-1 nt:h-px nt:bg-border', className)}\n\t\t\tdata-slot=\"command-separator\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tclassName={cn(\n\t\t\t\t'nt:group/command-item nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-2 nt:rounded-sm nt:px-2 nt:py-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:in-data-[slot=dialog-content]:rounded-lg! nt:data-[disabled=true]:pointer-events-none nt:data-[disabled=true]:opacity-50 nt:data-selected:bg-muted nt:data-selected:text-foreground nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4 nt:data-selected:*:[svg]:text-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-item\"\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<CheckIcon className=\"nt:ml-auto nt:opacity-0 nt:group-has-data-[slot=command-shortcut]/command-item:hidden nt:group-data-[checked=true]/command-item:opacity-100\" />\n\t\t</CommandPrimitive.Item>\n\t);\n}\n\nfunction CommandShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<'span'>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\n\t\t\t\t'nt:ml-auto nt:text-xs nt:tracking-widest nt:text-muted-foreground nt:group-data-selected/command-item:text-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"command-shortcut\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandDialog,\n\tCommandInput,\n\tCommandList,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandItem,\n\tCommandShortcut,\n\tCommandSeparator\n};\n"],"mappings":";AAqBE,cA0BC,YA1BD;AAnBF,SAAS,WAAW,wBAAwB;AAC5C,SAAS,YAAY,iBAAiB;AAGtC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,YAAY,uBAAuB;AAC5C,SAAS,UAAU;AAEnB,SAAS,QAAQ;AAAA,EAChB;AAAA,EACA,GAAG;AACJ,GAAkD;AACjD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AA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D;AACvD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,iBAAiB;AAAA,EACzB;AAAA,EACA,GAAG;AACJ,GAA4D;AAC3D,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACxD,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;AAEA,SAAS,YAAY;AAAA,EACpB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAuD;AACtD,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA;AAAA,QACD,oBAAC,aAAU,WAAU,+IAA8I;AAAA;AAAA;AAAA,EACpK;AAEF;AAEA,SAAS,gBAAgB;AAAA,EACxB;AAAA,EACA,GAAG;AACJ,GAAiC;AAChC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;","names":[]}
@@ -0,0 +1,188 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var dialog_exports = {};
21
+ __export(dialog_exports, {
22
+ Dialog: () => Dialog,
23
+ DialogClose: () => DialogClose,
24
+ DialogContent: () => DialogContent,
25
+ DialogDescription: () => DialogDescription,
26
+ DialogFooter: () => DialogFooter,
27
+ DialogHeader: () => DialogHeader,
28
+ DialogOverlay: () => DialogOverlay,
29
+ DialogPortal: () => DialogPortal,
30
+ DialogTitle: () => DialogTitle,
31
+ DialogTrigger: () => DialogTrigger
32
+ });
33
+ module.exports = __toCommonJS(dialog_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_lucide_react = require("lucide-react");
36
+ var import_radix_ui = require("radix-ui");
37
+ var import_button = require("./button");
38
+ var import_utils = require("../../lib/utils");
39
+ function Dialog({
40
+ ...props
41
+ }) {
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Dialog.Root, { "data-slot": "dialog", ...props });
43
+ }
44
+ function DialogTrigger({
45
+ ...props
46
+ }) {
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Dialog.Trigger, { "data-slot": "dialog-trigger", ...props });
48
+ }
49
+ function DialogPortal({
50
+ ...props
51
+ }) {
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Dialog.Portal, { "data-slot": "dialog-portal", ...props });
53
+ }
54
+ function DialogClose({
55
+ ...props
56
+ }) {
57
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Dialog.Close, { "data-slot": "dialog-close", ...props });
58
+ }
59
+ function DialogOverlay({
60
+ className,
61
+ ...props
62
+ }) {
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
64
+ import_radix_ui.Dialog.Overlay,
65
+ {
66
+ className: (0, import_utils.cn)(
67
+ "nt:fixed nt:inset-0 nt:isolate nt:z-50 nt:bg-black/10 nt:duration-100 nt:supports-backdrop-filter:backdrop-blur-xs nt:data-open:animate-in nt:data-open:fade-in-0 nt:data-closed:animate-out nt:data-closed:fade-out-0",
68
+ className
69
+ ),
70
+ "data-slot": "dialog-overlay",
71
+ ...props
72
+ }
73
+ );
74
+ }
75
+ function DialogContent({
76
+ className,
77
+ children,
78
+ showCloseButton = true,
79
+ ...props
80
+ }) {
81
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogPortal, { children: [
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlay, {}),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
84
+ import_radix_ui.Dialog.Content,
85
+ {
86
+ className: (0, import_utils.cn)(
87
+ "nt:fixed nt:top-1/2 nt:left-1/2 nt:z-50 nt:grid nt:w-full nt:max-w-[calc(100%-2rem)] nt:-translate-x-1/2 nt:-translate-y-1/2 nt:gap-4 nt:rounded-xl nt:bg-popover nt:p-4 nt:text-sm nt:text-popover-foreground nt:ring-1 nt:ring-foreground/10 nt:duration-100 nt:outline-none nt:sm:max-w-sm nt:data-open:animate-in nt:data-open:fade-in-0 nt:data-open:zoom-in-95 nt:data-closed:animate-out nt:data-closed:fade-out-0 nt:data-closed:zoom-out-95",
88
+ className
89
+ ),
90
+ "data-slot": "dialog-content",
91
+ ...props,
92
+ children: [
93
+ children,
94
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Dialog.Close, { asChild: true, "data-slot": "dialog-close", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
95
+ import_button.Button,
96
+ {
97
+ className: "nt:absolute nt:top-2 nt:right-2",
98
+ size: "icon-sm",
99
+ variant: "ghost",
100
+ children: [
101
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.XIcon, {}),
102
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "nt:sr-only", children: "Close" })
103
+ ]
104
+ }
105
+ ) })
106
+ ]
107
+ }
108
+ )
109
+ ] });
110
+ }
111
+ function DialogHeader({ className, ...props }) {
112
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
113
+ "div",
114
+ {
115
+ className: (0, import_utils.cn)("nt:flex nt:flex-col nt:gap-2", className),
116
+ "data-slot": "dialog-header",
117
+ ...props
118
+ }
119
+ );
120
+ }
121
+ function DialogFooter({
122
+ className,
123
+ showCloseButton = false,
124
+ children,
125
+ ...props
126
+ }) {
127
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
128
+ "div",
129
+ {
130
+ className: (0, import_utils.cn)(
131
+ "nt:-mx-4 nt:-mb-4 nt:flex nt:flex-col-reverse nt:gap-2 nt:rounded-b-xl nt:border-t nt:bg-muted/50 nt:p-4 nt:sm:flex-row nt:sm:justify-end",
132
+ className
133
+ ),
134
+ "data-slot": "dialog-footer",
135
+ ...props,
136
+ children: [
137
+ children,
138
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", children: "Close" }) })
139
+ ]
140
+ }
141
+ );
142
+ }
143
+ function DialogTitle({
144
+ className,
145
+ ...props
146
+ }) {
147
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
148
+ import_radix_ui.Dialog.Title,
149
+ {
150
+ className: (0, import_utils.cn)(
151
+ "nt:font-heading nt:text-base nt:leading-none nt:font-medium",
152
+ className
153
+ ),
154
+ "data-slot": "dialog-title",
155
+ ...props
156
+ }
157
+ );
158
+ }
159
+ function DialogDescription({
160
+ className,
161
+ ...props
162
+ }) {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
164
+ import_radix_ui.Dialog.Description,
165
+ {
166
+ className: (0, import_utils.cn)(
167
+ "nt:text-sm nt:text-muted-foreground nt:*:[a]:underline nt:*:[a]:underline-offset-3 nt:*:[a]:hover:text-foreground",
168
+ className
169
+ ),
170
+ "data-slot": "dialog-description",
171
+ ...props
172
+ }
173
+ );
174
+ }
175
+ // Annotate the CommonJS export names for ESM import in node:
176
+ 0 && (module.exports = {
177
+ Dialog,
178
+ DialogClose,
179
+ DialogContent,
180
+ DialogDescription,
181
+ DialogFooter,
182
+ DialogHeader,
183
+ DialogOverlay,
184
+ DialogPortal,
185
+ DialogTitle,
186
+ DialogTrigger
187
+ });
188
+ //# sourceMappingURL=dialog.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["'use client';\n\nimport { XIcon } from 'lucide-react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { Button } from './button';\nimport { cn } from '../../lib/utils';\n\nfunction Dialog({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n\treturn <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n\treturn <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n\treturn <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n\treturn <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n\treturn (\n\t\t<DialogPrimitive.Overlay\n\t\t\tclassName={cn(\n\t\t\t\t'nt:fixed nt:inset-0 nt:isolate nt:z-50 nt:bg-black/10 nt:duration-100 nt:supports-backdrop-filter:backdrop-blur-xs nt:data-open:animate-in nt:data-open:fade-in-0 nt:data-closed:animate-out nt:data-closed:fade-out-0',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"dialog-overlay\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogContent({\n\tclassName,\n\tchildren,\n\tshowCloseButton = true,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<DialogPrimitive.Content\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:fixed nt:top-1/2 nt:left-1/2 nt:z-50 nt:grid nt:w-full nt:max-w-[calc(100%-2rem)] nt:-translate-x-1/2 nt:-translate-y-1/2 nt:gap-4 nt:rounded-xl nt:bg-popover nt:p-4 nt:text-sm nt:text-popover-foreground nt:ring-1 nt:ring-foreground/10 nt:duration-100 nt:outline-none nt:sm:max-w-sm nt:data-open:animate-in nt:data-open:fade-in-0 nt:data-open:zoom-in-95 nt:data-closed:animate-out nt:data-closed:fade-out-0 nt:data-closed:zoom-out-95',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"dialog-content\"\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t{showCloseButton && (\n\t\t\t\t\t<DialogPrimitive.Close asChild data-slot=\"dialog-close\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"nt:absolute nt:top-2 nt:right-2\"\n\t\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t\t\t<span className=\"nt:sr-only\">Close</span>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t)}\n\t\t\t</DialogPrimitive.Content>\n\t\t</DialogPortal>\n\t);\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn('nt:flex nt:flex-col nt:gap-2', className)}\n\t\t\tdata-slot=\"dialog-header\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogFooter({\n\tclassName,\n\tshowCloseButton = false,\n\tchildren,\n\t...props\n}: React.ComponentProps<'div'> & {\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'nt:-mx-4 nt:-mb-4 nt:flex nt:flex-col-reverse nt:gap-2 nt:rounded-b-xl nt:border-t nt:bg-muted/50 nt:p-4 nt:sm:flex-row nt:sm:justify-end',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"dialog-footer\"\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{showCloseButton && (\n\t\t\t\t<DialogPrimitive.Close asChild>\n\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t</DialogPrimitive.Close>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction DialogTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n\treturn (\n\t\t<DialogPrimitive.Title\n\t\t\tclassName={cn(\n\t\t\t\t'nt:font-heading nt:text-base nt:leading-none nt:font-medium',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"dialog-title\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n\treturn (\n\t\t<DialogPrimitive.Description\n\t\t\tclassName={cn(\n\t\t\t\t'nt:text-sm nt:text-muted-foreground nt:*:[a]:underline nt:*:[a]:underline-offset-3 nt:*:[a]:hover:text-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"dialog-description\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDialog,\n\tDialogClose,\n\tDialogContent,\n\t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B;AAAA,MACA,eAAW;AAAA,QACV;AAAA,QACA;AAAA,MACD;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA;AAAA,EACL;AAEF;","names":["DialogPrimitive"]}
@@ -0,0 +1,20 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Dialog as Dialog$1 } from 'radix-ui';
3
+ import * as React from 'react';
4
+
5
+ declare function Dialog({ ...props }: React.ComponentProps<typeof Dialog$1.Root>): react_jsx_runtime.JSX.Element;
6
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof Dialog$1.Trigger>): react_jsx_runtime.JSX.Element;
7
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof Dialog$1.Portal>): react_jsx_runtime.JSX.Element;
8
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof Dialog$1.Close>): react_jsx_runtime.JSX.Element;
9
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof Dialog$1.Overlay>): react_jsx_runtime.JSX.Element;
10
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof Dialog$1.Content> & {
11
+ showCloseButton?: boolean;
12
+ }): react_jsx_runtime.JSX.Element;
13
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
14
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<'div'> & {
15
+ showCloseButton?: boolean;
16
+ }): react_jsx_runtime.JSX.Element;
17
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof Dialog$1.Title>): react_jsx_runtime.JSX.Element;
18
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof Dialog$1.Description>): react_jsx_runtime.JSX.Element;
19
+
20
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1,20 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Dialog as Dialog$1 } from 'radix-ui';
3
+ import * as React from 'react';
4
+
5
+ declare function Dialog({ ...props }: React.ComponentProps<typeof Dialog$1.Root>): react_jsx_runtime.JSX.Element;
6
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof Dialog$1.Trigger>): react_jsx_runtime.JSX.Element;
7
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof Dialog$1.Portal>): react_jsx_runtime.JSX.Element;
8
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof Dialog$1.Close>): react_jsx_runtime.JSX.Element;
9
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof Dialog$1.Overlay>): react_jsx_runtime.JSX.Element;
10
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof Dialog$1.Content> & {
11
+ showCloseButton?: boolean;
12
+ }): react_jsx_runtime.JSX.Element;
13
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
14
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<'div'> & {
15
+ showCloseButton?: boolean;
16
+ }): react_jsx_runtime.JSX.Element;
17
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof Dialog$1.Title>): react_jsx_runtime.JSX.Element;
18
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof Dialog$1.Description>): react_jsx_runtime.JSX.Element;
19
+
20
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };