@openconsole/shadcn 0.2.5 → 0.2.7

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 (113) hide show
  1. package/components/index.ts +1 -2
  2. package/components/ui/accordion.tsx +66 -66
  3. package/components/ui/alert-dialog.tsx +196 -196
  4. package/components/ui/alert.tsx +66 -66
  5. package/components/ui/aspect-ratio.tsx +11 -11
  6. package/components/ui/avatar.tsx +53 -53
  7. package/components/ui/badge.tsx +46 -46
  8. package/components/ui/breadcrumb.tsx +109 -109
  9. package/components/ui/button-group.tsx +83 -83
  10. package/components/ui/button.tsx +60 -60
  11. package/components/ui/calendar.tsx +219 -219
  12. package/components/ui/card.tsx +92 -92
  13. package/components/ui/carousel.tsx +241 -241
  14. package/components/ui/chart.tsx +374 -374
  15. package/components/ui/checkbox.tsx +32 -32
  16. package/components/ui/collapsible.tsx +33 -33
  17. package/components/ui/command.tsx +184 -184
  18. package/components/ui/context-menu.tsx +252 -252
  19. package/components/ui/dialog.tsx +143 -143
  20. package/components/ui/direction.tsx +22 -22
  21. package/components/ui/drawer.tsx +135 -135
  22. package/components/ui/dropdown-menu.tsx +257 -257
  23. package/components/ui/empty.tsx +104 -104
  24. package/components/ui/field.tsx +248 -248
  25. package/components/ui/form.tsx +167 -167
  26. package/components/ui/hover-card.tsx +44 -44
  27. package/components/ui/index.ts +59 -59
  28. package/components/ui/input-group.tsx +170 -170
  29. package/components/ui/input-otp.tsx +77 -77
  30. package/components/ui/input.tsx +21 -21
  31. package/components/ui/item.tsx +193 -193
  32. package/components/ui/kbd.tsx +28 -28
  33. package/components/ui/label.tsx +24 -24
  34. package/components/ui/menubar.tsx +276 -276
  35. package/components/ui/native-select.tsx +62 -62
  36. package/components/ui/navigation-menu.tsx +168 -168
  37. package/components/ui/pagination.tsx +127 -127
  38. package/components/ui/popover.tsx +89 -89
  39. package/components/ui/progress.tsx +31 -31
  40. package/components/ui/radio-group.tsx +45 -45
  41. package/components/ui/resizable.tsx +53 -53
  42. package/components/ui/scroll-area.tsx +58 -58
  43. package/components/ui/select.tsx +187 -187
  44. package/components/ui/separator.tsx +28 -28
  45. package/components/ui/sheet.tsx +139 -139
  46. package/components/ui/sidebar.tsx +724 -724
  47. package/components/ui/skeleton.tsx +13 -13
  48. package/components/ui/slider.tsx +63 -63
  49. package/components/ui/sonner.tsx +40 -40
  50. package/components/ui/spinner.tsx +16 -16
  51. package/components/ui/switch.tsx +35 -35
  52. package/components/ui/table.tsx +116 -116
  53. package/components/ui/tabs.tsx +66 -66
  54. package/components/ui/textarea.tsx +18 -18
  55. package/components/ui/toggle-group.tsx +83 -83
  56. package/components/ui/toggle.tsx +47 -47
  57. package/components/ui/tooltip.tsx +61 -61
  58. package/hooks/index.ts +1 -1
  59. package/hooks/use-mobile.ts +19 -19
  60. package/index.ts +3 -3
  61. package/lib/index.ts +1 -1
  62. package/lib/utils.ts +6 -6
  63. package/package.json +1 -1
  64. package/styles.css +124 -124
  65. package/components/ai-elements/agent.tsx +0 -141
  66. package/components/ai-elements/artifact.tsx +0 -148
  67. package/components/ai-elements/attachments.tsx +0 -426
  68. package/components/ai-elements/audio-player.tsx +0 -231
  69. package/components/ai-elements/canvas.tsx +0 -26
  70. package/components/ai-elements/chain-of-thought.tsx +0 -222
  71. package/components/ai-elements/checkpoint.tsx +0 -71
  72. package/components/ai-elements/code-block.tsx +0 -562
  73. package/components/ai-elements/commit.tsx +0 -458
  74. package/components/ai-elements/confirmation.tsx +0 -174
  75. package/components/ai-elements/connection.tsx +0 -28
  76. package/components/ai-elements/context.tsx +0 -409
  77. package/components/ai-elements/controls.tsx +0 -18
  78. package/components/ai-elements/conversation.tsx +0 -168
  79. package/components/ai-elements/edge.tsx +0 -143
  80. package/components/ai-elements/environment-variables.tsx +0 -324
  81. package/components/ai-elements/file-tree.tsx +0 -304
  82. package/components/ai-elements/image.tsx +0 -24
  83. package/components/ai-elements/index.ts +0 -51
  84. package/components/ai-elements/inline-citation.tsx +0 -296
  85. package/components/ai-elements/jsx-preview.tsx +0 -310
  86. package/components/ai-elements/message.tsx +0 -360
  87. package/components/ai-elements/mic-selector.tsx +0 -375
  88. package/components/ai-elements/model-selector.tsx +0 -213
  89. package/components/ai-elements/node.tsx +0 -71
  90. package/components/ai-elements/open-in-chat.tsx +0 -370
  91. package/components/ai-elements/package-info.tsx +0 -239
  92. package/components/ai-elements/panel.tsx +0 -15
  93. package/components/ai-elements/persona.tsx +0 -306
  94. package/components/ai-elements/plan.tsx +0 -147
  95. package/components/ai-elements/prompt-input.tsx +0 -1463
  96. package/components/ai-elements/queue.tsx +0 -274
  97. package/components/ai-elements/reasoning.tsx +0 -228
  98. package/components/ai-elements/sandbox.tsx +0 -132
  99. package/components/ai-elements/schema-display.tsx +0 -471
  100. package/components/ai-elements/shimmer.tsx +0 -77
  101. package/components/ai-elements/snippet.tsx +0 -145
  102. package/components/ai-elements/sources.tsx +0 -77
  103. package/components/ai-elements/speech-input.tsx +0 -323
  104. package/components/ai-elements/stack-trace.tsx +0 -528
  105. package/components/ai-elements/suggestion.tsx +0 -57
  106. package/components/ai-elements/task.tsx +0 -87
  107. package/components/ai-elements/terminal.tsx +0 -273
  108. package/components/ai-elements/test-results.tsx +0 -496
  109. package/components/ai-elements/tool.tsx +0 -173
  110. package/components/ai-elements/toolbar.tsx +0 -16
  111. package/components/ai-elements/transcription.tsx +0 -125
  112. package/components/ai-elements/voice-selector.tsx +0 -524
  113. package/components/ai-elements/web-preview.tsx +0 -281
@@ -1,222 +0,0 @@
1
- "use client";
2
-
3
- import { useControllableState } from "@radix-ui/react-use-controllable-state";
4
- import { Badge } from "../ui/badge";
5
- import {
6
- Collapsible,
7
- CollapsibleContent,
8
- CollapsibleTrigger,
9
- } from "../ui/collapsible";
10
- import { cn } from "../../lib/utils";
11
- import type { LucideIcon } from "lucide-react";
12
- import { BrainIcon, ChevronDownIcon, DotIcon } from "lucide-react";
13
- import type { ComponentProps, ReactNode } from "react";
14
- import { createContext, memo, useContext, useMemo } from "react";
15
-
16
- interface ChainOfThoughtContextValue {
17
- isOpen: boolean;
18
- setIsOpen: (open: boolean) => void;
19
- }
20
-
21
- const ChainOfThoughtContext = createContext<ChainOfThoughtContextValue | null>(
22
- null
23
- );
24
-
25
- const useChainOfThought = () => {
26
- const context = useContext(ChainOfThoughtContext);
27
- if (!context) {
28
- throw new Error(
29
- "ChainOfThought components must be used within ChainOfThought"
30
- );
31
- }
32
- return context;
33
- };
34
-
35
- export type ChainOfThoughtProps = ComponentProps<"div"> & {
36
- open?: boolean;
37
- defaultOpen?: boolean;
38
- onOpenChange?: (open: boolean) => void;
39
- };
40
-
41
- export const ChainOfThought = memo(
42
- ({
43
- className,
44
- open,
45
- defaultOpen = false,
46
- onOpenChange,
47
- children,
48
- ...props
49
- }: ChainOfThoughtProps) => {
50
- const [isOpen, setIsOpen] = useControllableState({
51
- defaultProp: defaultOpen,
52
- onChange: onOpenChange,
53
- prop: open,
54
- });
55
-
56
- const chainOfThoughtContext = useMemo(
57
- () => ({ isOpen, setIsOpen }),
58
- [isOpen, setIsOpen]
59
- );
60
-
61
- return (
62
- <ChainOfThoughtContext.Provider value={chainOfThoughtContext}>
63
- <div className={cn("not-prose w-full space-y-4", className)} {...props}>
64
- {children}
65
- </div>
66
- </ChainOfThoughtContext.Provider>
67
- );
68
- }
69
- );
70
-
71
- export type ChainOfThoughtHeaderProps = ComponentProps<
72
- typeof CollapsibleTrigger
73
- >;
74
-
75
- export const ChainOfThoughtHeader = memo(
76
- ({ className, children, ...props }: ChainOfThoughtHeaderProps) => {
77
- const { isOpen, setIsOpen } = useChainOfThought();
78
-
79
- return (
80
- <Collapsible onOpenChange={setIsOpen} open={isOpen}>
81
- <CollapsibleTrigger
82
- className={cn(
83
- "flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",
84
- className
85
- )}
86
- {...props}
87
- >
88
- <BrainIcon className="size-4" />
89
- <span className="flex-1 text-left">
90
- {children ?? "Chain of Thought"}
91
- </span>
92
- <ChevronDownIcon
93
- className={cn(
94
- "size-4 transition-transform",
95
- isOpen ? "rotate-180" : "rotate-0"
96
- )}
97
- />
98
- </CollapsibleTrigger>
99
- </Collapsible>
100
- );
101
- }
102
- );
103
-
104
- export type ChainOfThoughtStepProps = ComponentProps<"div"> & {
105
- icon?: LucideIcon;
106
- label: ReactNode;
107
- description?: ReactNode;
108
- status?: "complete" | "active" | "pending";
109
- };
110
-
111
- const stepStatusStyles = {
112
- active: "text-foreground",
113
- complete: "text-muted-foreground",
114
- pending: "text-muted-foreground/50",
115
- };
116
-
117
- export const ChainOfThoughtStep = memo(
118
- ({
119
- className,
120
- icon: Icon = DotIcon,
121
- label,
122
- description,
123
- status = "complete",
124
- children,
125
- ...props
126
- }: ChainOfThoughtStepProps) => (
127
- <div
128
- className={cn(
129
- "flex gap-2 text-sm",
130
- stepStatusStyles[status],
131
- "fade-in-0 slide-in-from-top-2 animate-in",
132
- className
133
- )}
134
- {...props}
135
- >
136
- <div className="relative mt-0.5">
137
- <Icon className="size-4" />
138
- <div className="absolute top-7 bottom-0 left-1/2 -mx-px w-px bg-border" />
139
- </div>
140
- <div className="flex-1 space-y-2 overflow-hidden">
141
- <div>{label}</div>
142
- {description && (
143
- <div className="text-muted-foreground text-xs">{description}</div>
144
- )}
145
- {children}
146
- </div>
147
- </div>
148
- )
149
- );
150
-
151
- export type ChainOfThoughtSearchResultsProps = ComponentProps<"div">;
152
-
153
- export const ChainOfThoughtSearchResults = memo(
154
- ({ className, ...props }: ChainOfThoughtSearchResultsProps) => (
155
- <div
156
- className={cn("flex flex-wrap items-center gap-2", className)}
157
- {...props}
158
- />
159
- )
160
- );
161
-
162
- export type ChainOfThoughtSearchResultProps = ComponentProps<typeof Badge>;
163
-
164
- export const ChainOfThoughtSearchResult = memo(
165
- ({ className, children, ...props }: ChainOfThoughtSearchResultProps) => (
166
- <Badge
167
- className={cn("gap-1 px-2 py-0.5 font-normal text-xs", className)}
168
- variant="secondary"
169
- {...props}
170
- >
171
- {children}
172
- </Badge>
173
- )
174
- );
175
-
176
- export type ChainOfThoughtContentProps = ComponentProps<
177
- typeof CollapsibleContent
178
- >;
179
-
180
- export const ChainOfThoughtContent = memo(
181
- ({ className, children, ...props }: ChainOfThoughtContentProps) => {
182
- const { isOpen } = useChainOfThought();
183
-
184
- return (
185
- <Collapsible open={isOpen}>
186
- <CollapsibleContent
187
- className={cn(
188
- "mt-2 space-y-3",
189
- "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
190
- className
191
- )}
192
- {...props}
193
- >
194
- {children}
195
- </CollapsibleContent>
196
- </Collapsible>
197
- );
198
- }
199
- );
200
-
201
- export type ChainOfThoughtImageProps = ComponentProps<"div"> & {
202
- caption?: string;
203
- };
204
-
205
- export const ChainOfThoughtImage = memo(
206
- ({ className, children, caption, ...props }: ChainOfThoughtImageProps) => (
207
- <div className={cn("mt-2 space-y-2", className)} {...props}>
208
- <div className="relative flex max-h-[22rem] items-center justify-center overflow-hidden rounded-lg bg-muted p-3">
209
- {children}
210
- </div>
211
- {caption && <p className="text-muted-foreground text-xs">{caption}</p>}
212
- </div>
213
- )
214
- );
215
-
216
- ChainOfThought.displayName = "ChainOfThought";
217
- ChainOfThoughtHeader.displayName = "ChainOfThoughtHeader";
218
- ChainOfThoughtStep.displayName = "ChainOfThoughtStep";
219
- ChainOfThoughtSearchResults.displayName = "ChainOfThoughtSearchResults";
220
- ChainOfThoughtSearchResult.displayName = "ChainOfThoughtSearchResult";
221
- ChainOfThoughtContent.displayName = "ChainOfThoughtContent";
222
- ChainOfThoughtImage.displayName = "ChainOfThoughtImage";
@@ -1,71 +0,0 @@
1
- "use client";
2
-
3
- import { Button } from "../ui/button";
4
- import { Separator } from "../ui/separator";
5
- import {
6
- Tooltip,
7
- TooltipContent,
8
- TooltipTrigger,
9
- } from "../ui/tooltip";
10
- import { cn } from "../../lib/utils";
11
- import type { LucideProps } from "lucide-react";
12
- import { BookmarkIcon } from "lucide-react";
13
- import type { ComponentProps, HTMLAttributes } from "react";
14
-
15
- export type CheckpointProps = HTMLAttributes<HTMLDivElement>;
16
-
17
- export const Checkpoint = ({
18
- className,
19
- children,
20
- ...props
21
- }: CheckpointProps) => (
22
- <div
23
- className={cn(
24
- "flex items-center gap-0.5 overflow-hidden text-muted-foreground",
25
- className
26
- )}
27
- {...props}
28
- >
29
- {children}
30
- <Separator />
31
- </div>
32
- );
33
-
34
- export type CheckpointIconProps = LucideProps;
35
-
36
- export const CheckpointIcon = ({
37
- className,
38
- children,
39
- ...props
40
- }: CheckpointIconProps) =>
41
- children ?? (
42
- <BookmarkIcon className={cn("size-4 shrink-0", className)} {...props} />
43
- );
44
-
45
- export type CheckpointTriggerProps = ComponentProps<typeof Button> & {
46
- tooltip?: string;
47
- };
48
-
49
- export const CheckpointTrigger = ({
50
- children,
51
- variant = "ghost",
52
- size = "sm",
53
- tooltip,
54
- ...props
55
- }: CheckpointTriggerProps) =>
56
- tooltip ? (
57
- <Tooltip>
58
- <TooltipTrigger asChild>
59
- <Button size={size} type="button" variant={variant} {...props}>
60
- {children}
61
- </Button>
62
- </TooltipTrigger>
63
- <TooltipContent align="start" side="bottom">
64
- {tooltip}
65
- </TooltipContent>
66
- </Tooltip>
67
- ) : (
68
- <Button size={size} type="button" variant={variant} {...props}>
69
- {children}
70
- </Button>
71
- );