dreamboard 0.1.21 → 0.1.22

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 (186) hide show
  1. package/dist/{chunk-EYYWGWTO.js → chunk-2RCUHMGL.js} +343 -1911
  2. package/dist/chunk-2RCUHMGL.js.map +1 -0
  3. package/dist/{chunk-MOVHYB6E.js → chunk-AQ5UUNJS.js} +1018 -692
  4. package/dist/chunk-AQ5UUNJS.js.map +1 -0
  5. package/dist/{chunk-BMYC6772.js → chunk-H3O43F5P.js} +9765 -3068
  6. package/dist/chunk-H3O43F5P.js.map +1 -0
  7. package/dist/dev-host/dev-api-proxy-plugin.ts +330 -0
  8. package/dist/dev-host/dev-diagnostics.ts +62 -0
  9. package/dist/dev-host/dev-fallback-stylesheet.ts +50 -0
  10. package/dist/dev-host/dev-host-controller.ts +686 -0
  11. package/dist/dev-host/dev-host-player-query.ts +17 -0
  12. package/dist/dev-host/dev-host-session-transport.ts +52 -0
  13. package/dist/dev-host/dev-host-storage.ts +56 -0
  14. package/dist/dev-host/dev-log-relay-plugin.ts +469 -0
  15. package/dist/dev-host/dev-runtime-config.ts +14 -0
  16. package/dist/dev-host/dev-runtime-platform.ts +419 -0
  17. package/dist/dev-host/dev-virtual-modules-plugin.ts +63 -0
  18. package/dist/dev-host/host-main.css +182 -0
  19. package/dist/dev-host/host-main.tsx +754 -0
  20. package/dist/dev-host/index.html +56 -0
  21. package/dist/dev-host/plugin-main.ts +55 -0
  22. package/dist/dev-host/plugin.html +24 -0
  23. package/dist/dev-host/start-dev-server.ts +138 -0
  24. package/dist/dev-host/virtual-modules.d.ts +27 -0
  25. package/dist/dist-FEPN3BDN.js +16543 -0
  26. package/dist/dist-FEPN3BDN.js.map +1 -0
  27. package/dist/{dist-WJRJNFLI.js → dist-FRURQI7Q.js} +4 -2
  28. package/dist/index.js +3 -3
  29. package/dist/internal.js +159 -124
  30. package/dist/internal.js.map +1 -1
  31. package/dist/runtime-packages/tailwind-config/shared-styles.css +146 -0
  32. package/dist/runtime-packages/ui/src/components/.gitkeep +0 -0
  33. package/dist/runtime-packages/ui/src/components/accordion.tsx +66 -0
  34. package/dist/runtime-packages/ui/src/components/ai-elements/actions.tsx +65 -0
  35. package/dist/runtime-packages/ui/src/components/ai-elements/artifact.tsx +147 -0
  36. package/dist/runtime-packages/ui/src/components/ai-elements/branch.tsx +215 -0
  37. package/dist/runtime-packages/ui/src/components/ai-elements/canvas.tsx +22 -0
  38. package/dist/runtime-packages/ui/src/components/ai-elements/chain-of-thought.tsx +228 -0
  39. package/dist/runtime-packages/ui/src/components/ai-elements/code-block.tsx +179 -0
  40. package/dist/runtime-packages/ui/src/components/ai-elements/confirmation.tsx +158 -0
  41. package/dist/runtime-packages/ui/src/components/ai-elements/connection.tsx +28 -0
  42. package/dist/runtime-packages/ui/src/components/ai-elements/context.tsx +408 -0
  43. package/dist/runtime-packages/ui/src/components/ai-elements/controls.tsx +18 -0
  44. package/dist/runtime-packages/ui/src/components/ai-elements/conversation.tsx +97 -0
  45. package/dist/runtime-packages/ui/src/components/ai-elements/edge.tsx +140 -0
  46. package/dist/runtime-packages/ui/src/components/ai-elements/image.tsx +24 -0
  47. package/dist/runtime-packages/ui/src/components/ai-elements/inline-citation.tsx +287 -0
  48. package/dist/runtime-packages/ui/src/components/ai-elements/loader.tsx +96 -0
  49. package/dist/runtime-packages/ui/src/components/ai-elements/message.tsx +463 -0
  50. package/dist/runtime-packages/ui/src/components/ai-elements/node.tsx +71 -0
  51. package/dist/runtime-packages/ui/src/components/ai-elements/open-in-chat.tsx +365 -0
  52. package/dist/runtime-packages/ui/src/components/ai-elements/panel.tsx +15 -0
  53. package/dist/runtime-packages/ui/src/components/ai-elements/plan.tsx +142 -0
  54. package/dist/runtime-packages/ui/src/components/ai-elements/prompt-input.tsx +1380 -0
  55. package/dist/runtime-packages/ui/src/components/ai-elements/queue.tsx +274 -0
  56. package/dist/runtime-packages/ui/src/components/ai-elements/reasoning.tsx +182 -0
  57. package/dist/runtime-packages/ui/src/components/ai-elements/response.tsx +22 -0
  58. package/dist/runtime-packages/ui/src/components/ai-elements/shimmer.tsx +64 -0
  59. package/dist/runtime-packages/ui/src/components/ai-elements/sources.tsx +77 -0
  60. package/dist/runtime-packages/ui/src/components/ai-elements/suggestion.tsx +53 -0
  61. package/dist/runtime-packages/ui/src/components/ai-elements/task.tsx +87 -0
  62. package/dist/runtime-packages/ui/src/components/ai-elements/tool.tsx +165 -0
  63. package/dist/runtime-packages/ui/src/components/ai-elements/toolbar.tsx +16 -0
  64. package/dist/runtime-packages/ui/src/components/ai-elements/web-preview.tsx +263 -0
  65. package/dist/runtime-packages/ui/src/components/alert-dialog.tsx +157 -0
  66. package/dist/runtime-packages/ui/src/components/alert.tsx +66 -0
  67. package/dist/runtime-packages/ui/src/components/avatar.tsx +53 -0
  68. package/dist/runtime-packages/ui/src/components/badge.tsx +46 -0
  69. package/dist/runtime-packages/ui/src/components/button-group.tsx +83 -0
  70. package/dist/runtime-packages/ui/src/components/button.tsx +65 -0
  71. package/dist/runtime-packages/ui/src/components/card.tsx +92 -0
  72. package/dist/runtime-packages/ui/src/components/carousel.tsx +241 -0
  73. package/dist/runtime-packages/ui/src/components/collapsible.tsx +33 -0
  74. package/dist/runtime-packages/ui/src/components/command.tsx +184 -0
  75. package/dist/runtime-packages/ui/src/components/context-menu.tsx +252 -0
  76. package/dist/runtime-packages/ui/src/components/counter.tsx +11 -0
  77. package/dist/runtime-packages/ui/src/components/dialog.tsx +146 -0
  78. package/dist/runtime-packages/ui/src/components/drawer.tsx +132 -0
  79. package/dist/runtime-packages/ui/src/components/dropdown-menu.tsx +257 -0
  80. package/dist/runtime-packages/ui/src/components/form.tsx +168 -0
  81. package/dist/runtime-packages/ui/src/components/header.tsx +13 -0
  82. package/dist/runtime-packages/ui/src/components/hover-card.tsx +44 -0
  83. package/dist/runtime-packages/ui/src/components/input-group.tsx +178 -0
  84. package/dist/runtime-packages/ui/src/components/input.tsx +21 -0
  85. package/dist/runtime-packages/ui/src/components/item.tsx +193 -0
  86. package/dist/runtime-packages/ui/src/components/label.tsx +24 -0
  87. package/dist/runtime-packages/ui/src/components/navigation-menu.tsx +168 -0
  88. package/dist/runtime-packages/ui/src/components/popover.tsx +55 -0
  89. package/dist/runtime-packages/ui/src/components/progress.tsx +31 -0
  90. package/dist/runtime-packages/ui/src/components/radio-group.tsx +45 -0
  91. package/dist/runtime-packages/ui/src/components/resizable.tsx +56 -0
  92. package/dist/runtime-packages/ui/src/components/scroll-area.tsx +58 -0
  93. package/dist/runtime-packages/ui/src/components/select.tsx +187 -0
  94. package/dist/runtime-packages/ui/src/components/separator.tsx +28 -0
  95. package/dist/runtime-packages/ui/src/components/skeleton.tsx +13 -0
  96. package/dist/runtime-packages/ui/src/components/sonner.tsx +25 -0
  97. package/dist/runtime-packages/ui/src/components/spinner.tsx +16 -0
  98. package/dist/runtime-packages/ui/src/components/switch.tsx +31 -0
  99. package/dist/runtime-packages/ui/src/components/table.tsx +137 -0
  100. package/dist/runtime-packages/ui/src/components/tabs.tsx +74 -0
  101. package/dist/runtime-packages/ui/src/components/textarea.tsx +23 -0
  102. package/dist/runtime-packages/ui/src/components/theme-provider.tsx +73 -0
  103. package/dist/runtime-packages/ui/src/components/tooltip.tsx +61 -0
  104. package/dist/runtime-packages/ui/src/components/ui/file-upload.tsx +195 -0
  105. package/dist/runtime-packages/ui/src/hooks/.gitkeep +0 -0
  106. package/dist/runtime-packages/ui/src/index.ts +68 -0
  107. package/dist/runtime-packages/ui/src/lib/utils.ts +6 -0
  108. package/dist/runtime-packages/ui-host-runtime/src/actor-principal.ts +68 -0
  109. package/dist/runtime-packages/ui-host-runtime/src/components/host-controls.tsx +359 -0
  110. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback-toaster.tsx +274 -0
  111. package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback.tsx +214 -0
  112. package/dist/runtime-packages/ui-host-runtime/src/components/host-session-metadata.tsx +135 -0
  113. package/dist/runtime-packages/ui-host-runtime/src/components/index.ts +5 -0
  114. package/dist/runtime-packages/ui-host-runtime/src/components/perf-overlay.tsx +194 -0
  115. package/dist/runtime-packages/ui-host-runtime/src/host-controls.tsx +1 -0
  116. package/dist/runtime-packages/ui-host-runtime/src/host-feedback.tsx +1 -0
  117. package/dist/runtime-packages/ui-host-runtime/src/host-session-transport.ts +162 -0
  118. package/dist/runtime-packages/ui-host-runtime/src/index.ts +2 -0
  119. package/dist/runtime-packages/ui-host-runtime/src/logger.ts +11 -0
  120. package/dist/runtime-packages/ui-host-runtime/src/perf.ts +253 -0
  121. package/dist/runtime-packages/ui-host-runtime/src/plugin-bridge.ts +195 -0
  122. package/dist/runtime-packages/ui-host-runtime/src/plugin-health-check.ts +138 -0
  123. package/dist/runtime-packages/ui-host-runtime/src/plugin-messages.ts +159 -0
  124. package/dist/runtime-packages/ui-host-runtime/src/plugin-session-gateway.ts +524 -0
  125. package/dist/runtime-packages/ui-host-runtime/src/runtime/index.ts +12 -0
  126. package/dist/runtime-packages/ui-host-runtime/src/screenshot/projection-to-snapshot.ts +122 -0
  127. package/dist/runtime-packages/ui-host-runtime/src/screenshot/static-store-api.ts +26 -0
  128. package/dist/runtime-packages/ui-host-runtime/src/session-ingress-controller.ts +477 -0
  129. package/dist/runtime-packages/ui-host-runtime/src/session-ingress.ts +209 -0
  130. package/dist/runtime-packages/ui-host-runtime/src/session-live-runtime.ts +112 -0
  131. package/dist/runtime-packages/ui-host-runtime/src/session-model.ts +318 -0
  132. package/dist/runtime-packages/ui-host-runtime/src/session-projection.ts +211 -0
  133. package/dist/runtime-packages/ui-host-runtime/src/session-state-reducer.ts +814 -0
  134. package/dist/runtime-packages/ui-host-runtime/src/sse-manager.ts +334 -0
  135. package/dist/runtime-packages/ui-host-runtime/src/unified-session-store.ts +180 -0
  136. package/dist/scaffold/assets/static/app/tsconfig.framework.json +3 -1
  137. package/dist/scaffold/assets/static/ui/tsconfig.framework.json +7 -19
  138. package/package.json +52 -17
  139. package/skills/dreamboard/SKILL.md +41 -75
  140. package/LICENSE +0 -89
  141. package/NOTICE +0 -1
  142. package/dist/chunk-BMYC6772.js.map +0 -1
  143. package/dist/chunk-EYYWGWTO.js.map +0 -1
  144. package/dist/chunk-MOVHYB6E.js.map +0 -1
  145. package/dist/scaffold/assets/static/ui/App.tsx +0 -22
  146. package/dist/src-CUL7EGGG.js +0 -634
  147. package/dist/src-CUL7EGGG.js.map +0 -1
  148. package/skills/dreamboard/references/authoring-lifecycle.md +0 -102
  149. package/skills/dreamboard/references/board-surfaces.md +0 -36
  150. package/skills/dreamboard/references/board-topology.md +0 -443
  151. package/skills/dreamboard/references/boards-and-topology.md +0 -100
  152. package/skills/dreamboard/references/card-actions.md +0 -107
  153. package/skills/dreamboard/references/cli.md +0 -120
  154. package/skills/dreamboard/references/core-concepts.md +0 -514
  155. package/skills/dreamboard/references/custom-renderers.md +0 -26
  156. package/skills/dreamboard/references/derived-values.md +0 -55
  157. package/skills/dreamboard/references/effects.md +0 -111
  158. package/skills/dreamboard/references/game-contract.md +0 -89
  159. package/skills/dreamboard/references/game-definition.md +0 -89
  160. package/skills/dreamboard/references/game-shell.md +0 -80
  161. package/skills/dreamboard/references/hand-surfaces.md +0 -33
  162. package/skills/dreamboard/references/index.md +0 -112
  163. package/skills/dreamboard/references/inputs-and-targets.md +0 -160
  164. package/skills/dreamboard/references/interactions.md +0 -158
  165. package/skills/dreamboard/references/manifest-fields.md +0 -137
  166. package/skills/dreamboard/references/manifest.md +0 -81
  167. package/skills/dreamboard/references/package-surfaces.md +0 -69
  168. package/skills/dreamboard/references/phases.md +0 -145
  169. package/skills/dreamboard/references/prompts-and-choices.md +0 -55
  170. package/skills/dreamboard/references/quickstart.md +0 -71
  171. package/skills/dreamboard/references/rule-authoring.md +0 -144
  172. package/skills/dreamboard/references/setup-bootstrap.md +0 -78
  173. package/skills/dreamboard/references/stages-and-zones.md +0 -59
  174. package/skills/dreamboard/references/static-views.md +0 -67
  175. package/skills/dreamboard/references/table-queries-and-ops.md +0 -103
  176. package/skills/dreamboard/references/testing-bases.md +0 -147
  177. package/skills/dreamboard/references/testing-generated-contracts.md +0 -142
  178. package/skills/dreamboard/references/testing-runtime-assertions.md +0 -124
  179. package/skills/dreamboard/references/testing-scenarios.md +0 -148
  180. package/skills/dreamboard/references/testing-ui-tests.md +0 -174
  181. package/skills/dreamboard/references/testing.md +0 -161
  182. package/skills/dreamboard/references/ui-architecture.md +0 -137
  183. package/skills/dreamboard/references/ui-components.md +0 -34
  184. package/skills/dreamboard/references/views.md +0 -72
  185. package/skills/dreamboard/references/workspace-layout.md +0 -136
  186. /package/dist/{dist-WJRJNFLI.js.map → dist-FRURQI7Q.js.map} +0 -0
@@ -0,0 +1,287 @@
1
+ "use client";
2
+
3
+ import { Badge } from "@dreamboard/ui/components/badge";
4
+ import {
5
+ Carousel,
6
+ type CarouselApi,
7
+ CarouselContent,
8
+ CarouselItem,
9
+ } from "@dreamboard/ui/components/carousel";
10
+ import {
11
+ HoverCard,
12
+ HoverCardContent,
13
+ HoverCardTrigger,
14
+ } from "@dreamboard/ui/components/hover-card";
15
+ import { cn } from "@dreamboard/ui/lib/utils";
16
+ import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
17
+ import {
18
+ type ComponentProps,
19
+ createContext,
20
+ useCallback,
21
+ useContext,
22
+ useEffect,
23
+ useState,
24
+ } from "react";
25
+
26
+ export type InlineCitationProps = ComponentProps<"span">;
27
+
28
+ export const InlineCitation = ({
29
+ className,
30
+ ...props
31
+ }: InlineCitationProps) => (
32
+ <span
33
+ className={cn("group inline items-center gap-1", className)}
34
+ {...props}
35
+ />
36
+ );
37
+
38
+ export type InlineCitationTextProps = ComponentProps<"span">;
39
+
40
+ export const InlineCitationText = ({
41
+ className,
42
+ ...props
43
+ }: InlineCitationTextProps) => (
44
+ <span
45
+ className={cn("transition-colors group-hover:bg-accent", className)}
46
+ {...props}
47
+ />
48
+ );
49
+
50
+ export type InlineCitationCardProps = ComponentProps<typeof HoverCard>;
51
+
52
+ export const InlineCitationCard = (props: InlineCitationCardProps) => (
53
+ <HoverCard closeDelay={0} openDelay={0} {...props} />
54
+ );
55
+
56
+ export type InlineCitationCardTriggerProps = ComponentProps<typeof Badge> & {
57
+ sources: string[];
58
+ };
59
+
60
+ export const InlineCitationCardTrigger = ({
61
+ sources,
62
+ className,
63
+ ...props
64
+ }: InlineCitationCardTriggerProps) => (
65
+ <HoverCardTrigger asChild>
66
+ <Badge
67
+ className={cn("ml-1 rounded-full", className)}
68
+ variant="secondary"
69
+ {...props}
70
+ >
71
+ {sources[0] ? (
72
+ <>
73
+ {new URL(sources[0]).hostname}{" "}
74
+ {sources.length > 1 && `+${sources.length - 1}`}
75
+ </>
76
+ ) : (
77
+ "unknown"
78
+ )}
79
+ </Badge>
80
+ </HoverCardTrigger>
81
+ );
82
+
83
+ export type InlineCitationCardBodyProps = ComponentProps<"div">;
84
+
85
+ export const InlineCitationCardBody = ({
86
+ className,
87
+ ...props
88
+ }: InlineCitationCardBodyProps) => (
89
+ <HoverCardContent className={cn("relative w-80 p-0", className)} {...props} />
90
+ );
91
+
92
+ const CarouselApiContext = createContext<CarouselApi | undefined>(undefined);
93
+
94
+ const useCarouselApi = () => {
95
+ const context = useContext(CarouselApiContext);
96
+ return context;
97
+ };
98
+
99
+ export type InlineCitationCarouselProps = ComponentProps<typeof Carousel>;
100
+
101
+ export const InlineCitationCarousel = ({
102
+ className,
103
+ children,
104
+ ...props
105
+ }: InlineCitationCarouselProps) => {
106
+ const [api, setApi] = useState<CarouselApi>();
107
+
108
+ return (
109
+ <CarouselApiContext.Provider value={api}>
110
+ <Carousel className={cn("w-full", className)} setApi={setApi} {...props}>
111
+ {children}
112
+ </Carousel>
113
+ </CarouselApiContext.Provider>
114
+ );
115
+ };
116
+
117
+ export type InlineCitationCarouselContentProps = ComponentProps<"div">;
118
+
119
+ export const InlineCitationCarouselContent = (
120
+ props: InlineCitationCarouselContentProps,
121
+ ) => <CarouselContent {...props} />;
122
+
123
+ export type InlineCitationCarouselItemProps = ComponentProps<"div">;
124
+
125
+ export const InlineCitationCarouselItem = ({
126
+ className,
127
+ ...props
128
+ }: InlineCitationCarouselItemProps) => (
129
+ <CarouselItem
130
+ className={cn("w-full space-y-2 p-4 pl-8", className)}
131
+ {...props}
132
+ />
133
+ );
134
+
135
+ export type InlineCitationCarouselHeaderProps = ComponentProps<"div">;
136
+
137
+ export const InlineCitationCarouselHeader = ({
138
+ className,
139
+ ...props
140
+ }: InlineCitationCarouselHeaderProps) => (
141
+ <div
142
+ className={cn(
143
+ "flex items-center justify-between gap-2 rounded-t-md bg-secondary p-2",
144
+ className,
145
+ )}
146
+ {...props}
147
+ />
148
+ );
149
+
150
+ export type InlineCitationCarouselIndexProps = ComponentProps<"div">;
151
+
152
+ export const InlineCitationCarouselIndex = ({
153
+ children,
154
+ className,
155
+ ...props
156
+ }: InlineCitationCarouselIndexProps) => {
157
+ const api = useCarouselApi();
158
+ const [current, setCurrent] = useState(0);
159
+ const [count, setCount] = useState(0);
160
+
161
+ useEffect(() => {
162
+ if (!api) {
163
+ return;
164
+ }
165
+
166
+ setCount(api.scrollSnapList().length);
167
+ setCurrent(api.selectedScrollSnap() + 1);
168
+
169
+ api.on("select", () => {
170
+ setCurrent(api.selectedScrollSnap() + 1);
171
+ });
172
+ }, [api]);
173
+
174
+ return (
175
+ <div
176
+ className={cn(
177
+ "flex flex-1 items-center justify-end px-3 py-1 text-muted-foreground text-xs",
178
+ className,
179
+ )}
180
+ {...props}
181
+ >
182
+ {children ?? `${current}/${count}`}
183
+ </div>
184
+ );
185
+ };
186
+
187
+ export type InlineCitationCarouselPrevProps = ComponentProps<"button">;
188
+
189
+ export const InlineCitationCarouselPrev = ({
190
+ className,
191
+ ...props
192
+ }: InlineCitationCarouselPrevProps) => {
193
+ const api = useCarouselApi();
194
+
195
+ const handleClick = useCallback(() => {
196
+ if (api) {
197
+ api.scrollPrev();
198
+ }
199
+ }, [api]);
200
+
201
+ return (
202
+ <button
203
+ aria-label="Previous"
204
+ className={cn("shrink-0", className)}
205
+ onClick={handleClick}
206
+ type="button"
207
+ {...props}
208
+ >
209
+ <ArrowLeftIcon className="size-4 text-muted-foreground" />
210
+ </button>
211
+ );
212
+ };
213
+
214
+ export type InlineCitationCarouselNextProps = ComponentProps<"button">;
215
+
216
+ export const InlineCitationCarouselNext = ({
217
+ className,
218
+ ...props
219
+ }: InlineCitationCarouselNextProps) => {
220
+ const api = useCarouselApi();
221
+
222
+ const handleClick = useCallback(() => {
223
+ if (api) {
224
+ api.scrollNext();
225
+ }
226
+ }, [api]);
227
+
228
+ return (
229
+ <button
230
+ aria-label="Next"
231
+ className={cn("shrink-0", className)}
232
+ onClick={handleClick}
233
+ type="button"
234
+ {...props}
235
+ >
236
+ <ArrowRightIcon className="size-4 text-muted-foreground" />
237
+ </button>
238
+ );
239
+ };
240
+
241
+ export type InlineCitationSourceProps = ComponentProps<"div"> & {
242
+ title?: string;
243
+ url?: string;
244
+ description?: string;
245
+ };
246
+
247
+ export const InlineCitationSource = ({
248
+ title,
249
+ url,
250
+ description,
251
+ className,
252
+ children,
253
+ ...props
254
+ }: InlineCitationSourceProps) => (
255
+ <div className={cn("space-y-1", className)} {...props}>
256
+ {title && (
257
+ <h4 className="truncate font-medium text-sm leading-tight">{title}</h4>
258
+ )}
259
+ {url && (
260
+ <p className="truncate break-all text-muted-foreground text-xs">{url}</p>
261
+ )}
262
+ {description && (
263
+ <p className="line-clamp-3 text-muted-foreground text-sm leading-relaxed">
264
+ {description}
265
+ </p>
266
+ )}
267
+ {children}
268
+ </div>
269
+ );
270
+
271
+ export type InlineCitationQuoteProps = ComponentProps<"blockquote">;
272
+
273
+ export const InlineCitationQuote = ({
274
+ children,
275
+ className,
276
+ ...props
277
+ }: InlineCitationQuoteProps) => (
278
+ <blockquote
279
+ className={cn(
280
+ "border-muted border-l-2 pl-3 text-muted-foreground text-sm italic",
281
+ className,
282
+ )}
283
+ {...props}
284
+ >
285
+ {children}
286
+ </blockquote>
287
+ );
@@ -0,0 +1,96 @@
1
+ import { cn } from "@dreamboard/ui/lib/utils";
2
+ import type { HTMLAttributes } from "react";
3
+
4
+ interface LoaderIconProps {
5
+ size?: number;
6
+ }
7
+
8
+ const LoaderIcon = ({ size = 16 }: LoaderIconProps) => (
9
+ <svg
10
+ height={size}
11
+ strokeLinejoin="round"
12
+ style={{ color: "currentcolor" }}
13
+ viewBox="0 0 16 16"
14
+ width={size}
15
+ >
16
+ <title>Loader</title>
17
+ <g clipPath="url(#clip0_2393_1490)">
18
+ <path d="M8 0V4" stroke="currentColor" strokeWidth="1.5" />
19
+ <path
20
+ d="M8 16V12"
21
+ opacity="0.5"
22
+ stroke="currentColor"
23
+ strokeWidth="1.5"
24
+ />
25
+ <path
26
+ d="M3.29773 1.52783L5.64887 4.7639"
27
+ opacity="0.9"
28
+ stroke="currentColor"
29
+ strokeWidth="1.5"
30
+ />
31
+ <path
32
+ d="M12.7023 1.52783L10.3511 4.7639"
33
+ opacity="0.1"
34
+ stroke="currentColor"
35
+ strokeWidth="1.5"
36
+ />
37
+ <path
38
+ d="M12.7023 14.472L10.3511 11.236"
39
+ opacity="0.4"
40
+ stroke="currentColor"
41
+ strokeWidth="1.5"
42
+ />
43
+ <path
44
+ d="M3.29773 14.472L5.64887 11.236"
45
+ opacity="0.6"
46
+ stroke="currentColor"
47
+ strokeWidth="1.5"
48
+ />
49
+ <path
50
+ d="M15.6085 5.52783L11.8043 6.7639"
51
+ opacity="0.2"
52
+ stroke="currentColor"
53
+ strokeWidth="1.5"
54
+ />
55
+ <path
56
+ d="M0.391602 10.472L4.19583 9.23598"
57
+ opacity="0.7"
58
+ stroke="currentColor"
59
+ strokeWidth="1.5"
60
+ />
61
+ <path
62
+ d="M15.6085 10.4722L11.8043 9.2361"
63
+ opacity="0.3"
64
+ stroke="currentColor"
65
+ strokeWidth="1.5"
66
+ />
67
+ <path
68
+ d="M0.391602 5.52783L4.19583 6.7639"
69
+ opacity="0.8"
70
+ stroke="currentColor"
71
+ strokeWidth="1.5"
72
+ />
73
+ </g>
74
+ <defs>
75
+ <clipPath id="clip0_2393_1490">
76
+ <rect fill="white" height="16" width="16" />
77
+ </clipPath>
78
+ </defs>
79
+ </svg>
80
+ );
81
+
82
+ export type LoaderProps = HTMLAttributes<HTMLDivElement> & {
83
+ size?: number;
84
+ };
85
+
86
+ export const Loader = ({ className, size = 16, ...props }: LoaderProps) => (
87
+ <div
88
+ className={cn(
89
+ "inline-flex animate-spin items-center justify-center",
90
+ className,
91
+ )}
92
+ {...props}
93
+ >
94
+ <LoaderIcon size={size} />
95
+ </div>
96
+ );