sunpeak 0.1.25 → 0.2.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 (44) hide show
  1. package/README.md +9 -76
  2. package/bin/sunpeak.js +87 -0
  3. package/dist/index.cjs +827 -1361
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +98 -589
  6. package/dist/index.d.ts +98 -589
  7. package/dist/index.js +795 -1337
  8. package/dist/index.js.map +1 -1
  9. package/dist/styles/chatgpt/index.css +146 -0
  10. package/dist/styles/globals.css +220 -0
  11. package/package.json +34 -36
  12. package/template/.prettierignore +4 -0
  13. package/template/.prettierrc +9 -0
  14. package/template/README.md +47 -0
  15. package/template/assets/favicon.ico +0 -0
  16. package/template/components.json +21 -0
  17. package/template/dev/main.tsx +65 -0
  18. package/template/dev/styles.css +5 -0
  19. package/template/eslint.config.cjs +49 -0
  20. package/template/index.html +13 -0
  21. package/template/package.json +56 -0
  22. package/template/src/App.tsx +45 -0
  23. package/template/src/components/index.ts +2 -0
  24. package/template/src/components/shadcn/button.tsx +60 -0
  25. package/template/src/components/shadcn/card.tsx +76 -0
  26. package/template/src/components/shadcn/carousel.tsx +260 -0
  27. package/template/src/components/shadcn/index.ts +5 -0
  28. package/template/src/components/shadcn/label.tsx +24 -0
  29. package/template/src/components/shadcn/select.tsx +157 -0
  30. package/template/src/components/sunpeak-card.test.tsx +76 -0
  31. package/template/src/components/sunpeak-card.tsx +140 -0
  32. package/template/src/components/sunpeak-carousel.test.tsx +42 -0
  33. package/template/src/components/sunpeak-carousel.tsx +126 -0
  34. package/template/src/index.ts +3 -0
  35. package/template/src/lib/index.ts +1 -0
  36. package/template/src/lib/utils.ts +6 -0
  37. package/template/src/styles/chatgpt.css +146 -0
  38. package/template/src/styles/globals.css +220 -0
  39. package/template/src/test/setup.ts +37 -0
  40. package/template/tsconfig.json +32 -0
  41. package/template/tsconfig.node.json +11 -0
  42. package/template/tsup.config.ts +23 -0
  43. package/template/vite.config.ts +35 -0
  44. package/template/vitest.config.ts +15 -0
package/dist/index.cjs CHANGED
@@ -1,1451 +1,917 @@
1
1
  'use strict';
2
2
 
3
- var material = require('@mui/material');
4
- var react = require('react');
3
+ var React3 = require('react');
5
4
  var jsxRuntime = require('react/jsx-runtime');
6
- var styles = require('@mui/material/styles');
7
- var CssBaseline = require('@mui/material/CssBaseline');
8
- var CloseIcon = require('@mui/icons-material/Close');
5
+ var reactSlot = require('@radix-ui/react-slot');
6
+ var classVarianceAuthority = require('class-variance-authority');
7
+ var lucideReact = require('lucide-react');
8
+ var clsx = require('clsx');
9
+ var tailwindMerge = require('tailwind-merge');
10
+ var SheetPrimitive = require('@radix-ui/react-dialog');
11
+ var TooltipPrimitive = require('@radix-ui/react-tooltip');
12
+ var SelectPrimitive = require('@radix-ui/react-select');
13
+ var LabelPrimitive = require('@radix-ui/react-label');
9
14
 
10
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
-
12
- var CssBaseline__default = /*#__PURE__*/_interopDefault(CssBaseline);
13
- var CloseIcon__default = /*#__PURE__*/_interopDefault(CloseIcon);
15
+ function _interopNamespace(e) {
16
+ if (e && e.__esModule) return e;
17
+ var n = Object.create(null);
18
+ if (e) {
19
+ Object.keys(e).forEach(function (k) {
20
+ if (k !== 'default') {
21
+ var d = Object.getOwnPropertyDescriptor(e, k);
22
+ Object.defineProperty(n, k, d.get ? d : {
23
+ enumerable: true,
24
+ get: function () { return e[k]; }
25
+ });
26
+ }
27
+ });
28
+ }
29
+ n.default = e;
30
+ return Object.freeze(n);
31
+ }
14
32
 
15
- // src/components/Card/Card.tsx
33
+ var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
34
+ var SheetPrimitive__namespace = /*#__PURE__*/_interopNamespace(SheetPrimitive);
35
+ var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitive);
36
+ var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
37
+ var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
16
38
 
17
- // src/types/chatgpt.ts
18
- var SET_GLOBALS_EVENT_TYPE = "chatgpt:set_globals";
39
+ var __defProp = Object.defineProperty;
40
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
41
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
42
+ var ThemeProviderContext = React3__namespace.createContext(
43
+ void 0
44
+ );
45
+ function ThemeProvider({
46
+ children,
47
+ defaultTheme = "light",
48
+ theme: controlledTheme,
49
+ ...props
50
+ }) {
51
+ const [internalTheme] = React3__namespace.useState(defaultTheme);
52
+ const theme = controlledTheme ?? internalTheme;
53
+ React3__namespace.useEffect(() => {
54
+ const root = window.document.documentElement;
55
+ root.classList.remove("light", "dark");
56
+ root.classList.add(theme);
57
+ }, [theme]);
58
+ const value = {
59
+ theme
60
+ };
61
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProviderContext.Provider, { ...props, value, children });
62
+ }
63
+ var useThemeContext = () => {
64
+ const context = React3__namespace.useContext(ThemeProviderContext);
65
+ if (context === void 0)
66
+ throw new Error("useThemeContext must be used within a ThemeProvider");
67
+ return context;
68
+ };
19
69
 
20
- // src/platforms/chatgpt.ts
21
- var ChatGPTPlatformAdapter = class {
70
+ // src/types/openai.ts
71
+ var SET_GLOBALS_EVENT_TYPE = "openai:set_globals";
72
+ var SetGlobalsEvent = class extends CustomEvent {
22
73
  constructor() {
23
- this.name = "chatgpt";
24
- }
25
- isAvailable() {
26
- return typeof window !== "undefined" && "openai" in window;
27
- }
28
- getGlobal(key) {
29
- if (!this.isAvailable()) {
30
- return null;
31
- }
32
- return window.openai?.[key] ?? null;
33
- }
34
- getGlobals() {
35
- if (!this.isAvailable()) {
36
- return null;
37
- }
38
- return window.openai ?? null;
39
- }
40
- subscribe(callback) {
41
- if (typeof window === "undefined") {
42
- return () => {
43
- };
44
- }
45
- const handleSetGlobal = (_event) => {
46
- callback();
47
- };
48
- window.addEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobal, {
49
- passive: true
50
- });
51
- return () => {
52
- window.removeEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobal);
53
- };
74
+ super(...arguments);
75
+ __publicField(this, "type", SET_GLOBALS_EVENT_TYPE);
54
76
  }
55
77
  };
56
- var chatgptPlatform = new ChatGPTPlatformAdapter();
57
78
 
58
- // src/platforms/registry.ts
59
- var DefaultPlatformRegistry = class {
60
- constructor() {
61
- this.adapters = /* @__PURE__ */ new Map();
62
- this.register(chatgptPlatform);
63
- }
64
- register(adapter) {
65
- this.adapters.set(adapter.name, adapter);
66
- }
67
- get(name) {
68
- return this.adapters.get(name) ?? null;
69
- }
70
- detect() {
71
- for (const adapter of this.adapters.values()) {
72
- if (adapter.isAvailable()) {
73
- return adapter;
74
- }
75
- }
76
- return null;
77
- }
78
- getAll() {
79
- return Array.from(this.adapters.values());
80
- }
79
+ // src/types/simulator.ts
80
+ var SCREEN_WIDTHS = {
81
+ "mobile-s": 375,
82
+ "mobile-l": 425,
83
+ tablet: 768,
84
+ full: 1024
81
85
  };
82
- function createPlatformRegistry() {
83
- return new DefaultPlatformRegistry();
84
- }
85
- var defaultPlatformRegistry = createPlatformRegistry();
86
- var PlatformContext = react.createContext(null);
87
- function PlatformProvider({ adapter, platform, children }) {
88
- const resolvedAdapter = adapter ?? (platform ? defaultPlatformRegistry.get(platform) : null) ?? defaultPlatformRegistry.detect();
89
- return /* @__PURE__ */ jsxRuntime.jsx(PlatformContext.Provider, { value: { adapter: resolvedAdapter }, children });
90
- }
91
- function usePlatformContext() {
92
- const context = react.useContext(PlatformContext);
93
- if (!context) {
94
- return {
95
- adapter: defaultPlatformRegistry.detect()
96
- };
97
- }
98
- return context;
99
- }
100
- function usePlatform() {
101
- const { adapter } = usePlatformContext();
102
- return adapter;
103
- }
104
86
 
105
- // src/hooks/usePlatformGlobal.ts
106
- function usePlatformGlobal(key) {
107
- const platform = usePlatform();
108
- return react.useSyncExternalStore(
87
+ // src/hooks/use-openai-global.ts
88
+ function useOpenAiGlobal(key) {
89
+ return React3.useSyncExternalStore(
109
90
  (onChange) => {
110
- if (!platform) {
91
+ if (typeof window === "undefined") {
111
92
  return () => {
112
93
  };
113
94
  }
114
- return platform.subscribe(onChange);
95
+ const handleSetGlobal = (event) => {
96
+ const value = event.detail.globals[key];
97
+ if (value === void 0) {
98
+ return;
99
+ }
100
+ onChange();
101
+ };
102
+ window.addEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobal, {
103
+ passive: true
104
+ });
105
+ return () => {
106
+ window.removeEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobal);
107
+ };
115
108
  },
116
- () => platform?.getGlobal(key) ?? null,
117
- () => platform?.getGlobal(key) ?? null
109
+ () => window.openai?.[key] ?? null,
110
+ () => window.openai?.[key] ?? null
118
111
  );
119
112
  }
120
113
 
121
- // src/hooks/useDisplayMode.ts
114
+ // src/hooks/use-display-mode.ts
122
115
  var useDisplayMode = () => {
123
- return usePlatformGlobal("displayMode");
116
+ return useOpenAiGlobal("displayMode");
124
117
  };
125
118
 
126
- // src/hooks/useMaxHeight.ts
119
+ // src/hooks/use-max-height.ts
127
120
  var useMaxHeight = () => {
128
- return usePlatformGlobal("maxHeight");
121
+ return useOpenAiGlobal("maxHeight");
129
122
  };
130
-
131
- // src/hooks/useRequestDisplayMode.ts
132
- function useRequestDisplayMode() {
133
- const platform = usePlatform();
134
- return async (args) => {
135
- const globals = platform?.getGlobals();
136
- if (globals?.requestDisplayMode) {
137
- return await globals.requestDisplayMode(args);
138
- }
139
- console.warn("requestDisplayMode is not available on this platform");
140
- return { mode: args.mode };
141
- };
123
+ var MOBILE_BREAKPOINT = 768;
124
+ function useIsMobile() {
125
+ const [isMobile, setIsMobile] = React3__namespace.useState(void 0);
126
+ React3__namespace.useEffect(() => {
127
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
128
+ const onChange = () => {
129
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
130
+ };
131
+ mql.addEventListener("change", onChange);
132
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
133
+ return () => mql.removeEventListener("change", onChange);
134
+ }, []);
135
+ return !!isMobile;
142
136
  }
143
137
 
144
- // src/hooks/useColorScheme.ts
145
- var useColorScheme = () => {
146
- return usePlatformGlobal("colorScheme");
138
+ // src/hooks/use-theme.ts
139
+ var useTheme = () => {
140
+ return useOpenAiGlobal("theme");
147
141
  };
148
-
149
- // src/hooks/useWidgetProps.ts
150
- function useWidgetProps(defaultState) {
151
- const props = usePlatformGlobal("toolOutput");
152
- const fallback = typeof defaultState === "function" ? defaultState() : defaultState ?? null;
153
- return props ?? fallback;
142
+ function useWidgetState() {
143
+ const widgetState = useOpenAiGlobal("widgetState");
144
+ const setWidgetState = useOpenAiGlobal("setWidgetState");
145
+ const setter = React3.useCallback(
146
+ async (state) => {
147
+ if (setWidgetState) {
148
+ await setWidgetState(state);
149
+ }
150
+ },
151
+ [setWidgetState]
152
+ );
153
+ return React3.useMemo(() => [widgetState, setter], [widgetState, setter]);
154
+ }
155
+ function cn(...inputs) {
156
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
157
+ }
158
+ function Sheet({ ...props }) {
159
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
154
160
  }
155
- function useWidgetState(defaultState) {
156
- const widgetStateFromWindow = usePlatformGlobal("widgetState");
157
- const platform = usePlatform();
158
- const [widgetState, _setWidgetState] = react.useState(() => {
159
- if (widgetStateFromWindow != null) {
160
- return widgetStateFromWindow;
161
+ function SheetPortal({
162
+ ...props
163
+ }) {
164
+ return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Portal, { "data-slot": "sheet-portal", ...props });
165
+ }
166
+ function SheetOverlay({
167
+ className,
168
+ ...props
169
+ }) {
170
+ return /* @__PURE__ */ jsxRuntime.jsx(
171
+ SheetPrimitive__namespace.Overlay,
172
+ {
173
+ "data-slot": "sheet-overlay",
174
+ className: cn(
175
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
176
+ className
177
+ ),
178
+ ...props
161
179
  }
162
- return typeof defaultState === "function" ? defaultState() : defaultState ?? null;
163
- });
164
- react.useEffect(() => {
165
- _setWidgetState(widgetStateFromWindow);
166
- }, [widgetStateFromWindow]);
167
- const setWidgetState = react.useCallback(
168
- (state) => {
169
- _setWidgetState((prevState) => {
170
- const newState = typeof state === "function" ? state(prevState) : state;
171
- if (newState != null && platform) {
172
- const globals = platform.getGlobals();
173
- if (globals?.setWidgetState) {
174
- globals.setWidgetState(newState);
175
- }
176
- }
177
- return newState;
178
- });
179
- },
180
- [platform]
181
180
  );
182
- return [widgetState, setWidgetState];
183
181
  }
184
- var Card = ({
185
- children,
186
- image,
187
- imageAlt,
188
- imageMaxWidth,
189
- imageMaxHeight,
190
- header,
191
- metadata,
192
- button1,
193
- button2,
194
- variant = "default",
182
+ function SheetContent({
195
183
  className,
196
- onClick,
197
- id,
184
+ children,
185
+ side = "right",
198
186
  ...props
199
- }) => {
200
- const requestDisplayMode = useRequestDisplayMode();
201
- const displayMode = useDisplayMode();
202
- const maxHeight = useMaxHeight();
203
- const theme = material.useTheme();
204
- const [widgetState, setWidgetState] = useWidgetState({});
205
- const isInline = displayMode !== "fullscreen" && displayMode !== "pip";
206
- const hasButtons = button1 || button2;
207
- const handleCardClick = async (e) => {
208
- onClick?.(e);
209
- if (isInline && !e.defaultPrevented) {
210
- try {
211
- if (id) {
212
- setWidgetState({ ...widgetState, selectedCardId: id });
213
- }
214
- await requestDisplayMode({ mode: "fullscreen" });
215
- } catch (error) {
216
- console.error("Failed to request fullscreen mode:", error);
187
+ }) {
188
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
189
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
190
+ /* @__PURE__ */ jsxRuntime.jsxs(
191
+ SheetPrimitive__namespace.Content,
192
+ {
193
+ "data-slot": "sheet-content",
194
+ className: cn(
195
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
196
+ side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
197
+ side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
198
+ side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
199
+ side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
200
+ className
201
+ ),
202
+ ...props,
203
+ children: [
204
+ children,
205
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetPrimitive__namespace.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
206
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" }),
207
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
208
+ ] })
209
+ ]
217
210
  }
211
+ )
212
+ ] });
213
+ }
214
+ function SheetHeader({ className, ...props }) {
215
+ return /* @__PURE__ */ jsxRuntime.jsx(
216
+ "div",
217
+ {
218
+ "data-slot": "sheet-header",
219
+ className: cn("flex flex-col gap-1.5 p-4", className),
220
+ ...props
218
221
  }
219
- };
220
- const renderButton = (buttonProps) => {
221
- const { isPrimary = false, onClick: buttonOnClick, children: children2, ...muiProps } = buttonProps;
222
- const handleClick = (e) => {
223
- e.stopPropagation();
224
- buttonOnClick();
222
+ );
223
+ }
224
+ function SheetTitle({
225
+ className,
226
+ ...props
227
+ }) {
228
+ return /* @__PURE__ */ jsxRuntime.jsx(
229
+ SheetPrimitive__namespace.Title,
230
+ {
231
+ "data-slot": "sheet-title",
232
+ className: cn("text-foreground font-semibold", className),
233
+ ...props
234
+ }
235
+ );
236
+ }
237
+ function SheetDescription({
238
+ className,
239
+ ...props
240
+ }) {
241
+ return /* @__PURE__ */ jsxRuntime.jsx(
242
+ SheetPrimitive__namespace.Description,
243
+ {
244
+ "data-slot": "sheet-description",
245
+ className: cn("text-muted-foreground text-sm", className),
246
+ ...props
247
+ }
248
+ );
249
+ }
250
+ function TooltipProvider({
251
+ delayDuration = 0,
252
+ ...props
253
+ }) {
254
+ return /* @__PURE__ */ jsxRuntime.jsx(
255
+ TooltipPrimitive__namespace.Provider,
256
+ {
257
+ "data-slot": "tooltip-provider",
258
+ delayDuration,
259
+ ...props
260
+ }
261
+ );
262
+ }
263
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
264
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
265
+ var SIDEBAR_WIDTH = "16rem";
266
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
267
+ var SIDEBAR_WIDTH_ICON = "3rem";
268
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
269
+ var SidebarContext = React3__namespace.createContext(null);
270
+ function useSidebar() {
271
+ const context = React3__namespace.useContext(SidebarContext);
272
+ if (!context) {
273
+ throw new Error("useSidebar must be used within a SidebarProvider.");
274
+ }
275
+ return context;
276
+ }
277
+ function SidebarProvider({
278
+ defaultOpen = true,
279
+ open: openProp,
280
+ onOpenChange: setOpenProp,
281
+ className,
282
+ style,
283
+ children,
284
+ ...props
285
+ }) {
286
+ const isMobile = useIsMobile();
287
+ const [openMobile, setOpenMobile] = React3__namespace.useState(false);
288
+ const [_open, _setOpen] = React3__namespace.useState(defaultOpen);
289
+ const open = openProp ?? _open;
290
+ const setOpen = React3__namespace.useCallback(
291
+ (value) => {
292
+ const openState = typeof value === "function" ? value(open) : value;
293
+ if (setOpenProp) {
294
+ setOpenProp(openState);
295
+ } else {
296
+ _setOpen(openState);
297
+ }
298
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
299
+ },
300
+ [setOpenProp, open]
301
+ );
302
+ const toggleSidebar = React3__namespace.useCallback(() => {
303
+ return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
304
+ }, [isMobile, setOpen, setOpenMobile]);
305
+ React3__namespace.useEffect(() => {
306
+ const handleKeyDown = (event) => {
307
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
308
+ event.preventDefault();
309
+ toggleSidebar();
310
+ }
225
311
  };
312
+ window.addEventListener("keydown", handleKeyDown);
313
+ return () => window.removeEventListener("keydown", handleKeyDown);
314
+ }, [toggleSidebar]);
315
+ const state = open ? "expanded" : "collapsed";
316
+ const contextValue = React3__namespace.useMemo(
317
+ () => ({
318
+ state,
319
+ open,
320
+ setOpen,
321
+ isMobile,
322
+ openMobile,
323
+ setOpenMobile,
324
+ toggleSidebar
325
+ }),
326
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
327
+ );
328
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsx(
329
+ "div",
330
+ {
331
+ "data-slot": "sidebar-wrapper",
332
+ style: {
333
+ "--sidebar-width": SIDEBAR_WIDTH,
334
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
335
+ ...style
336
+ },
337
+ className: cn(
338
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
339
+ className
340
+ ),
341
+ ...props,
342
+ children
343
+ }
344
+ ) }) });
345
+ }
346
+ function Sidebar({
347
+ side = "left",
348
+ variant = "sidebar",
349
+ collapsible = "offcanvas",
350
+ className,
351
+ children,
352
+ ...props
353
+ }) {
354
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
355
+ if (collapsible === "none") {
226
356
  return /* @__PURE__ */ jsxRuntime.jsx(
227
- material.Button,
357
+ "div",
228
358
  {
229
- ...muiProps,
230
- variant: isPrimary ? "contained" : "outlined",
231
- onClick: handleClick,
232
- children: children2
359
+ "data-slot": "sidebar",
360
+ className: cn(
361
+ "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
362
+ className
363
+ ),
364
+ ...props,
365
+ children
233
366
  }
234
367
  );
235
- };
368
+ }
369
+ if (isMobile) {
370
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
371
+ SheetContent,
372
+ {
373
+ "data-sidebar": "sidebar",
374
+ "data-slot": "sidebar",
375
+ "data-mobile": "true",
376
+ className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
377
+ style: {
378
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
379
+ },
380
+ side,
381
+ children: [
382
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { className: "sr-only", children: [
383
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: "Sidebar" }),
384
+ /* @__PURE__ */ jsxRuntime.jsx(SheetDescription, { children: "Displays the mobile sidebar." })
385
+ ] }),
386
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full flex-col", children })
387
+ ]
388
+ }
389
+ ) });
390
+ }
236
391
  return /* @__PURE__ */ jsxRuntime.jsxs(
237
- material.Box,
392
+ "div",
238
393
  {
239
- id,
240
- className,
241
- onClick: handleCardClick,
242
- sx: {
243
- backgroundColor: theme.palette.background.default,
244
- borderRadius: theme.spacing(3),
245
- overflow: "auto",
246
- display: "flex",
247
- flexDirection: "column",
248
- fontFamily: theme.typography.fontFamily,
249
- width: isInline ? "220px" : "100%",
250
- maxWidth: isInline ? "220px" : `${imageMaxWidth}px`,
251
- maxHeight: maxHeight ? `${maxHeight}px` : void 0,
252
- cursor: isInline ? "pointer" : "default",
253
- userSelect: "none",
254
- marginLeft: isInline ? void 0 : "auto",
255
- marginRight: isInline ? void 0 : "auto",
256
- ...variant === "bordered" && {
257
- border: `1px solid ${theme.palette.divider}`
258
- },
259
- ...variant === "elevated" && {
260
- boxShadow: theme.shadows[2],
261
- border: `1px solid ${theme.palette.divider}`
262
- }
263
- },
264
- ...props,
394
+ className: "group peer text-sidebar-foreground hidden md:block",
395
+ "data-state": state,
396
+ "data-collapsible": state === "collapsed" ? collapsible : "",
397
+ "data-variant": variant,
398
+ "data-side": side,
399
+ "data-slot": "sidebar",
265
400
  children: [
266
- image && /* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
267
- material.Box,
401
+ /* @__PURE__ */ jsxRuntime.jsx(
402
+ "div",
268
403
  {
269
- component: "img",
270
- src: image,
271
- alt: imageAlt,
272
- loading: "lazy",
273
- sx: {
274
- width: "100%",
275
- height: "auto",
276
- aspectRatio: "1",
277
- objectFit: "cover",
278
- borderRadius: theme.spacing(3),
279
- display: "block",
280
- maxWidth: `${imageMaxWidth}px`,
281
- maxHeight: `${imageMaxHeight}px`
282
- }
404
+ "data-slot": "sidebar-gap",
405
+ className: cn(
406
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
407
+ "group-data-[collapsible=offcanvas]:w-0",
408
+ "group-data-[side=right]:rotate-180",
409
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
410
+ )
283
411
  }
284
- ) }),
285
- /* @__PURE__ */ jsxRuntime.jsxs(
286
- material.Box,
412
+ ),
413
+ /* @__PURE__ */ jsxRuntime.jsx(
414
+ "div",
287
415
  {
288
- sx: {
289
- display: "flex",
290
- flexDirection: "column",
291
- flex: 1,
292
- gap: isInline ? theme.spacing(3) : theme.spacing(4),
293
- padding: isInline ? theme.spacing(4) : theme.spacing(6),
294
- ...image && {
295
- paddingTop: isInline ? theme.spacing(3) : theme.spacing(4)
416
+ "data-slot": "sidebar-container",
417
+ className: cn(
418
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
419
+ side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
420
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
421
+ className
422
+ ),
423
+ ...props,
424
+ children: /* @__PURE__ */ jsxRuntime.jsx(
425
+ "div",
426
+ {
427
+ "data-sidebar": "sidebar",
428
+ "data-slot": "sidebar-inner",
429
+ className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
430
+ children
296
431
  }
297
- },
298
- children: [
299
- /* @__PURE__ */ jsxRuntime.jsxs(
300
- material.Box,
301
- {
302
- sx: {
303
- display: "flex",
304
- flexDirection: "column",
305
- flex: 1,
306
- gap: isInline ? theme.spacing(1) : theme.spacing(2)
307
- },
308
- children: [
309
- header && /* @__PURE__ */ jsxRuntime.jsx(
310
- material.Box,
311
- {
312
- sx: {
313
- fontSize: theme.typography.body1.fontSize,
314
- fontWeight: theme.typography.fontWeightMedium,
315
- color: theme.palette.text.primary,
316
- lineHeight: 1.25,
317
- overflow: "hidden",
318
- textOverflow: "ellipsis",
319
- whiteSpace: "nowrap"
320
- },
321
- children: header
322
- }
323
- ),
324
- metadata && /* @__PURE__ */ jsxRuntime.jsx(
325
- material.Box,
326
- {
327
- sx: {
328
- fontSize: theme.typography.caption.fontSize,
329
- color: theme.palette.text.secondary,
330
- lineHeight: 1.5
331
- },
332
- children: metadata
333
- }
334
- ),
335
- children && /* @__PURE__ */ jsxRuntime.jsx(
336
- material.Box,
337
- {
338
- sx: {
339
- fontSize: theme.typography.body2.fontSize,
340
- color: theme.palette.text.primary,
341
- lineHeight: 1.5,
342
- display: "-webkit-box",
343
- WebkitBoxOrient: "vertical",
344
- overflow: "hidden",
345
- ...isInline && (metadata || header) && {
346
- marginTop: theme.spacing(1),
347
- WebkitLineClamp: 2
348
- },
349
- ...!isInline && (metadata || header) && {
350
- marginTop: theme.spacing(2),
351
- WebkitLineClamp: "unset"
352
- }
353
- },
354
- children
355
- }
356
- )
357
- ]
358
- }
359
- ),
360
- hasButtons && /* @__PURE__ */ jsxRuntime.jsxs(
361
- material.Box,
362
- {
363
- sx: {
364
- display: "flex",
365
- gap: theme.spacing(2),
366
- flexWrap: "wrap"
367
- },
368
- children: [
369
- button1 && renderButton(button1),
370
- button2 && renderButton(button2)
371
- ]
372
- }
373
- )
374
- ]
432
+ )
375
433
  }
376
434
  )
377
435
  ]
378
436
  }
379
437
  );
380
- };
381
- var ChevronLeftIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
382
- "path",
383
- {
384
- d: "M15 18L9 12L15 6",
385
- stroke: "currentColor",
386
- strokeWidth: "1.5",
387
- strokeLinecap: "round",
388
- strokeLinejoin: "round"
389
- }
390
- ) });
391
- var ChevronRightIcon = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
392
- "path",
393
- {
394
- d: "M9 18L15 12L9 6",
395
- stroke: "currentColor",
396
- strokeWidth: "1.5",
397
- strokeLinecap: "round",
398
- strokeLinejoin: "round"
399
- }
400
- ) });
401
- var Carousel = ({
402
- children,
403
- gap = 16,
404
- maxWidth = 800,
405
- showArrows = true,
406
- showEdgeGradients = true,
407
- cardWidth: cardWidthProp,
438
+ }
439
+ function SidebarInset({ className, ...props }) {
440
+ return /* @__PURE__ */ jsxRuntime.jsx(
441
+ "main",
442
+ {
443
+ "data-slot": "sidebar-inset",
444
+ className: cn(
445
+ "bg-background relative flex w-full flex-1 flex-col",
446
+ "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
447
+ className
448
+ ),
449
+ ...props
450
+ }
451
+ );
452
+ }
453
+ function SidebarContent({ className, ...props }) {
454
+ return /* @__PURE__ */ jsxRuntime.jsx(
455
+ "div",
456
+ {
457
+ "data-slot": "sidebar-content",
458
+ "data-sidebar": "content",
459
+ className: cn(
460
+ "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
461
+ className
462
+ ),
463
+ ...props
464
+ }
465
+ );
466
+ }
467
+ function SidebarGroup({ className, ...props }) {
468
+ return /* @__PURE__ */ jsxRuntime.jsx(
469
+ "div",
470
+ {
471
+ "data-slot": "sidebar-group",
472
+ "data-sidebar": "group",
473
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
474
+ ...props
475
+ }
476
+ );
477
+ }
478
+ function SidebarGroupLabel({
408
479
  className,
480
+ asChild = false,
409
481
  ...props
410
- }) => {
411
- const scrollRef = react.useRef(null);
412
- const [canScrollLeft, setCanScrollLeft] = react.useState(false);
413
- const [canScrollRight, setCanScrollRight] = react.useState(false);
414
- const [isDragging, setIsDragging] = react.useState(false);
415
- const [startX, setStartX] = react.useState(0);
416
- const [scrollLeft, setScrollLeft] = react.useState(0);
417
- const maxHeight = useMaxHeight();
418
- const displayMode = useDisplayMode();
419
- const theme = material.useTheme();
420
- const isFullscreen = displayMode === "fullscreen";
421
- const getCardWidth = () => {
422
- if (typeof cardWidthProp === "number") {
423
- return cardWidthProp;
424
- }
425
- if (typeof cardWidthProp === "object") {
426
- return isFullscreen ? cardWidthProp.fullscreen ?? 340 : cardWidthProp.inline ?? 220;
482
+ }) {
483
+ const Comp = asChild ? reactSlot.Slot : "div";
484
+ return /* @__PURE__ */ jsxRuntime.jsx(
485
+ Comp,
486
+ {
487
+ "data-slot": "sidebar-group-label",
488
+ "data-sidebar": "group-label",
489
+ className: cn(
490
+ "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
491
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
492
+ className
493
+ ),
494
+ ...props
427
495
  }
428
- return isFullscreen ? 340 : 220;
429
- };
430
- const cardWidth = getCardWidth();
431
- const checkScroll = () => {
432
- const el = scrollRef.current;
433
- if (!el) return;
434
- setCanScrollLeft(el.scrollLeft > 0);
435
- setCanScrollRight(el.scrollLeft < el.scrollWidth - el.clientWidth - 1);
436
- };
437
- react.useEffect(() => {
438
- checkScroll();
439
- const el = scrollRef.current;
440
- if (!el) return;
441
- el.addEventListener("scroll", checkScroll);
442
- window.addEventListener("resize", checkScroll);
443
- return () => {
444
- el.removeEventListener("scroll", checkScroll);
445
- window.removeEventListener("resize", checkScroll);
446
- };
447
- }, []);
448
- const scroll = (direction) => {
449
- const el = scrollRef.current;
450
- if (!el) return;
451
- const firstCard = el.children[0];
452
- if (!firstCard) return;
453
- const cardWidth2 = firstCard.offsetWidth;
454
- const scrollAmount = cardWidth2 + gap;
455
- const targetScroll = direction === "left" ? el.scrollLeft - scrollAmount : el.scrollLeft + scrollAmount;
456
- el.scrollTo({
457
- left: targetScroll,
458
- behavior: "smooth"
459
- });
460
- };
461
- const handleMouseDown = (e) => {
462
- const el = scrollRef.current;
463
- if (!el) return;
464
- setIsDragging(true);
465
- setStartX(e.pageX - el.offsetLeft);
466
- setScrollLeft(el.scrollLeft);
467
- };
468
- const handleMouseMove = (e) => {
469
- if (!isDragging) return;
470
- e.preventDefault();
471
- const el = scrollRef.current;
472
- if (!el) return;
473
- const x = e.pageX - el.offsetLeft;
474
- const walk = (x - startX) * 2;
475
- el.scrollLeft = scrollLeft - walk;
476
- };
477
- const handleMouseUpOrLeave = () => {
478
- setIsDragging(false);
479
- };
480
- return /* @__PURE__ */ jsxRuntime.jsxs(
481
- material.Box,
496
+ );
497
+ }
498
+ function SidebarGroupContent({
499
+ className,
500
+ ...props
501
+ }) {
502
+ return /* @__PURE__ */ jsxRuntime.jsx(
503
+ "div",
482
504
  {
483
- className,
484
- sx: {
485
- position: "relative",
486
- width: "100%",
487
- maxWidth: `${maxWidth}px`,
488
- maxHeight: maxHeight ? `${maxHeight}px` : void 0
489
- },
490
- ...props,
491
- children: [
492
- /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(
493
- material.Box,
494
- {
495
- ref: scrollRef,
496
- onMouseDown: handleMouseDown,
497
- onMouseMove: handleMouseMove,
498
- onMouseUp: handleMouseUpOrLeave,
499
- onMouseLeave: handleMouseUpOrLeave,
500
- sx: {
501
- display: "flex",
502
- gap: `${gap}px`,
503
- overflowX: "auto",
504
- overflowY: "hidden",
505
- scrollBehavior: isDragging ? "auto" : "smooth",
506
- scrollbarWidth: "none",
507
- msOverflowStyle: "none",
508
- userSelect: "none",
509
- cursor: isDragging ? "grabbing" : "grab",
510
- "&::-webkit-scrollbar": {
511
- display: "none"
512
- }
513
- },
514
- children: react.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsx(
515
- material.Box,
516
- {
517
- sx: {
518
- flexShrink: 0,
519
- width: `${cardWidth}px`,
520
- "& > *": {
521
- width: "100%",
522
- maxWidth: "100%"
523
- }
524
- },
525
- children: child
526
- }
527
- ))
528
- }
529
- ) }),
530
- showEdgeGradients && canScrollLeft && /* @__PURE__ */ jsxRuntime.jsx(
531
- material.Box,
532
- {
533
- "aria-hidden": "true",
534
- sx: {
535
- position: "absolute",
536
- top: 0,
537
- bottom: 0,
538
- left: 0,
539
- width: "80px",
540
- pointerEvents: "none",
541
- background: `linear-gradient(to right, ${theme.palette.background.default} 0%, transparent 100%)`,
542
- opacity: canScrollLeft ? 1 : 0,
543
- transition: "opacity 0.2s ease",
544
- zIndex: 1
545
- }
546
- }
547
- ),
548
- showEdgeGradients && canScrollRight && /* @__PURE__ */ jsxRuntime.jsx(
549
- material.Box,
550
- {
551
- "aria-hidden": "true",
552
- sx: {
553
- position: "absolute",
554
- top: 0,
555
- bottom: 0,
556
- right: 0,
557
- width: "80px",
558
- pointerEvents: "none",
559
- background: `linear-gradient(to left, ${theme.palette.background.default} 0%, transparent 100%)`,
560
- opacity: canScrollRight ? 1 : 0,
561
- transition: "opacity 0.2s ease",
562
- zIndex: 1
563
- }
564
- }
565
- ),
566
- showArrows && canScrollLeft && /* @__PURE__ */ jsxRuntime.jsx(
567
- material.IconButton,
568
- {
569
- "aria-label": "Previous",
570
- onClick: () => scroll("left"),
571
- sx: {
572
- position: "absolute",
573
- top: "50%",
574
- left: theme.spacing(0.5),
575
- transform: "translateY(-50%)",
576
- width: 32,
577
- height: 32,
578
- backgroundColor: theme.palette.background.default,
579
- boxShadow: theme.shadows[2],
580
- zIndex: 2,
581
- "&:hover": {
582
- boxShadow: theme.shadows[3],
583
- transform: "translateY(-50%) scale(1.05)"
584
- },
585
- "&:active": {
586
- transform: "translateY(-50%) scale(0.95)"
587
- },
588
- transition: "all 0.2s ease"
589
- },
590
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, {})
591
- }
592
- ),
593
- showArrows && canScrollRight && /* @__PURE__ */ jsxRuntime.jsx(
594
- material.IconButton,
595
- {
596
- "aria-label": "Next",
597
- onClick: () => scroll("right"),
598
- sx: {
599
- position: "absolute",
600
- top: "50%",
601
- right: theme.spacing(0.5),
602
- transform: "translateY(-50%)",
603
- width: 32,
604
- height: 32,
605
- backgroundColor: theme.palette.background.default,
606
- boxShadow: theme.shadows[2],
607
- zIndex: 2,
608
- "&:hover": {
609
- boxShadow: theme.shadows[3],
610
- transform: "translateY(-50%) scale(1.05)"
611
- },
612
- "&:active": {
613
- transform: "translateY(-50%) scale(0.95)"
614
- },
615
- transition: "all 0.2s ease"
616
- },
617
- children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, {})
618
- }
619
- )
620
- ]
505
+ "data-slot": "sidebar-group-content",
506
+ "data-sidebar": "group-content",
507
+ className: cn("w-full text-sm", className),
508
+ ...props
621
509
  }
622
510
  );
623
- };
624
- var baseThemeOptions = {
625
- spacing: 4,
626
- // 4px base unit
627
- shape: {
628
- borderRadius: 8
629
- // Default border radius in pixels
630
- },
631
- typography: {
632
- fontFamily: [
633
- "-apple-system",
634
- "BlinkMacSystemFont",
635
- '"Segoe UI"',
636
- "Roboto",
637
- '"Helvetica Neue"',
638
- "Arial",
639
- "sans-serif"
640
- ].join(",")
641
- },
642
- // Common breakpoints for responsive design
643
- breakpoints: {
644
- values: {
645
- xs: 0,
646
- sm: 600,
647
- md: 900,
648
- lg: 1200,
649
- xl: 1536
511
+ }
512
+ classVarianceAuthority.cva(
513
+ "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
514
+ {
515
+ variants: {
516
+ variant: {
517
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
518
+ outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
519
+ },
520
+ size: {
521
+ default: "h-8 text-sm",
522
+ sm: "h-7 text-xs",
523
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
524
+ }
525
+ },
526
+ defaultVariants: {
527
+ variant: "default",
528
+ size: "default"
650
529
  }
651
530
  }
652
- };
653
- var createBaseTheme = () => styles.createTheme(baseThemeOptions);
654
-
655
- // src/themes/chatgpt.ts
656
- var lightPalette = {
657
- mode: "light",
658
- primary: {
659
- main: "#f46c21",
660
- dark: "#d45e1c",
661
- light: "rgba(244, 108, 33, 0.9)",
662
- contrastText: "#ffffff"
663
- },
664
- secondary: {
665
- main: "#5d5d5d",
666
- contrastText: "#ffffff"
667
- },
668
- error: {
669
- main: "#e02e2a",
670
- contrastText: "#ffffff"
671
- },
672
- warning: {
673
- main: "#e25507",
674
- contrastText: "#ffffff"
675
- },
676
- info: {
677
- main: "#0285ff",
678
- contrastText: "#ffffff"
679
- },
680
- success: {
681
- main: "#008635",
682
- contrastText: "#ffffff"
683
- },
684
- background: {
685
- default: "#ffffff",
686
- paper: "#f3f3f3"
687
- },
688
- text: {
689
- primary: "#0d0d0d",
690
- secondary: "#5d5d5d",
691
- disabled: "#8f8f8f"
692
- },
693
- divider: "rgba(0, 0, 0, 0.15)",
694
- action: {
695
- hover: "rgba(0, 0, 0, 0.04)",
696
- selected: "rgba(0, 0, 0, 0.08)",
697
- disabled: "#8f8f8f",
698
- disabledBackground: "rgba(0, 0, 0, 0.12)"
699
- },
700
- grey: {
701
- 50: "#f3f3f3",
702
- 100: "#e8e8e8",
703
- 200: "rgba(0, 0, 0, 0.05)",
704
- 300: "rgba(0, 0, 0, 0.15)",
705
- 400: "#8f8f8f",
706
- 500: "#5d5d5d",
707
- 900: "#0d0d0d"
531
+ );
532
+ var Select = SelectPrimitive__namespace.Root;
533
+ var SelectValue = SelectPrimitive__namespace.Value;
534
+ var SelectTrigger = React3__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
535
+ SelectPrimitive__namespace.Trigger,
536
+ {
537
+ ref,
538
+ className: cn(
539
+ "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
540
+ className
541
+ ),
542
+ ...props,
543
+ children: [
544
+ children,
545
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
546
+ ]
708
547
  }
709
- };
710
- var darkPalette = {
711
- mode: "dark",
712
- primary: {
713
- main: "#f46c21",
714
- dark: "#d45e1c",
715
- light: "rgba(244, 108, 33, 0.9)",
716
- contrastText: "#ffffff"
717
- },
718
- secondary: {
719
- main: "#cdcdcd",
720
- contrastText: "#212121"
721
- },
722
- error: {
723
- main: "#ff8583",
724
- contrastText: "#212121"
725
- },
726
- warning: {
727
- main: "#ff9e6c",
728
- contrastText: "#212121"
729
- },
730
- info: {
731
- main: "#0285ff",
732
- contrastText: "#ffffff"
733
- },
734
- success: {
735
- main: "#40c977",
736
- contrastText: "#212121"
737
- },
738
- background: {
739
- default: "#212121",
740
- paper: "#414141"
741
- },
742
- text: {
743
- primary: "#ffffff",
744
- secondary: "#cdcdcd",
745
- disabled: "#afafaf"
746
- },
747
- divider: "rgba(0, 0, 0, 0.15)",
748
- action: {
749
- hover: "rgba(255, 255, 255, 0.08)",
750
- selected: "rgba(255, 255, 255, 0.16)",
751
- disabled: "#afafaf",
752
- disabledBackground: "rgba(255, 255, 255, 0.12)"
753
- },
754
- grey: {
755
- 50: "#414141",
756
- 100: "#303030",
757
- 200: "rgba(0, 0, 0, 0.05)",
758
- 300: "rgba(0, 0, 0, 0.15)",
759
- 400: "#afafaf",
760
- 500: "#cdcdcd",
761
- 900: "#ffffff",
762
- 800: "#212121"
548
+ ));
549
+ SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
550
+ var SelectScrollUpButton = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
551
+ SelectPrimitive__namespace.ScrollUpButton,
552
+ {
553
+ ref,
554
+ className: cn(
555
+ "flex cursor-default items-center justify-center py-1",
556
+ className
557
+ ),
558
+ ...props,
559
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "h-4 w-4" })
763
560
  }
764
- };
765
- var typography = {
766
- fontFamily: [
767
- "-apple-system",
768
- "BlinkMacSystemFont",
769
- '"Segoe UI"',
770
- "Roboto",
771
- '"Helvetica Neue"',
772
- "Arial",
773
- "sans-serif"
774
- ].join(","),
775
- fontSize: 16,
776
- fontWeightLight: 300,
777
- fontWeightRegular: 400,
778
- fontWeightMedium: 500,
779
- fontWeightBold: 600,
780
- h1: {
781
- fontSize: "1.25rem",
782
- fontWeight: 600,
783
- lineHeight: 1.25
784
- },
785
- h2: {
786
- fontSize: "1.125rem",
787
- fontWeight: 600,
788
- lineHeight: 1.25
789
- },
790
- h3: {
791
- fontSize: "1rem",
792
- fontWeight: 600,
793
- lineHeight: 1.25
794
- },
795
- h4: {
796
- fontSize: "1rem",
797
- fontWeight: 500,
798
- lineHeight: 1.25
799
- },
800
- h5: {
801
- fontSize: "0.875rem",
802
- fontWeight: 600,
803
- lineHeight: 1.25
804
- },
805
- h6: {
806
- fontSize: "0.75rem",
807
- fontWeight: 600,
808
- lineHeight: 1.25
809
- },
810
- body1: {
811
- fontSize: "1rem",
812
- lineHeight: 1.5
813
- },
814
- body2: {
815
- fontSize: "0.875rem",
816
- lineHeight: 1.5
817
- },
818
- button: {
819
- fontSize: "0.875rem",
820
- fontWeight: 500,
821
- lineHeight: 1.25,
822
- textTransform: "none"
823
- },
824
- caption: {
825
- fontSize: "0.75rem",
826
- lineHeight: 1.5
827
- },
828
- overline: {
829
- fontSize: "0.75rem",
830
- fontWeight: 500,
831
- lineHeight: 1.5,
832
- textTransform: "uppercase"
561
+ ));
562
+ SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
563
+ var SelectScrollDownButton = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
564
+ SelectPrimitive__namespace.ScrollDownButton,
565
+ {
566
+ ref,
567
+ className: cn(
568
+ "flex cursor-default items-center justify-center py-1",
569
+ className
570
+ ),
571
+ ...props,
572
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4" })
833
573
  }
834
- };
835
- var spacing = 4;
836
- var shape = {
837
- borderRadius: 8
838
- };
839
- var shadows = [
840
- "none",
841
- "0px 1px 2px rgba(0, 0, 0, 0.05)",
842
- "0px 2px 6px rgba(0, 0, 0, 0.06)",
843
- "0px 4px 12px rgba(0, 0, 0, 0.1)",
844
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
845
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
846
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
847
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
848
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
849
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
850
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
851
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
852
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
853
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
854
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
855
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
856
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
857
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
858
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
859
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
860
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
861
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
862
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
863
- "0px 8px 24px rgba(0, 0, 0, 0.12)",
864
- "0px 8px 24px rgba(0, 0, 0, 0.12)"
865
- ];
866
- var components = {
867
- MuiButton: {
868
- styleOverrides: {
869
- root: {
870
- borderRadius: "0.5rem",
871
- padding: "0.375rem 1rem",
872
- fontSize: "0.875rem",
873
- fontWeight: 500,
874
- textTransform: "none",
875
- transition: "all 0.2s ease"
876
- },
877
- contained: {
878
- boxShadow: "none",
879
- "&:hover": {
880
- boxShadow: "none"
574
+ ));
575
+ SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
576
+ var SelectContent = React3__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
577
+ SelectPrimitive__namespace.Content,
578
+ {
579
+ ref,
580
+ className: cn(
581
+ "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
582
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
583
+ className
584
+ ),
585
+ position,
586
+ ...props,
587
+ children: [
588
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
589
+ /* @__PURE__ */ jsxRuntime.jsx(
590
+ SelectPrimitive__namespace.Viewport,
591
+ {
592
+ className: cn(
593
+ "p-1",
594
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
595
+ ),
596
+ children
881
597
  }
598
+ ),
599
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
600
+ ]
601
+ }
602
+ ) }));
603
+ SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
604
+ var SelectLabel = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
605
+ SelectPrimitive__namespace.Label,
606
+ {
607
+ ref,
608
+ className: cn("px-2 py-1.5 text-sm font-semibold", className),
609
+ ...props
610
+ }
611
+ ));
612
+ SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
613
+ var SelectItem = React3__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
614
+ SelectPrimitive__namespace.Item,
615
+ {
616
+ ref,
617
+ className: cn(
618
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
619
+ className
620
+ ),
621
+ ...props,
622
+ children: [
623
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
624
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
625
+ ]
626
+ }
627
+ ));
628
+ SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
629
+ var SelectSeparator = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
630
+ SelectPrimitive__namespace.Separator,
631
+ {
632
+ ref,
633
+ className: cn("-mx-1 my-1 h-px bg-muted", className),
634
+ ...props
635
+ }
636
+ ));
637
+ SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
638
+ var labelVariants = classVarianceAuthority.cva(
639
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
640
+ );
641
+ var Label2 = React3__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
642
+ LabelPrimitive__namespace.Root,
643
+ {
644
+ ref,
645
+ className: cn(labelVariants(), className),
646
+ ...props
647
+ }
648
+ ));
649
+ Label2.displayName = LabelPrimitive__namespace.Root.displayName;
650
+ function Conversation({
651
+ children,
652
+ screenWidth,
653
+ displayMode,
654
+ appName = "ChatGPT",
655
+ appIcon,
656
+ userMessage = "Show me some interesting places to visit."
657
+ }) {
658
+ const containerWidth = screenWidth === "full" ? "100%" : `${SCREEN_WIDTHS[screenWidth]}px`;
659
+ if (displayMode === "fullscreen") {
660
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarInset, { className: "flex flex-col bg-background", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children }) });
661
+ }
662
+ return /* @__PURE__ */ jsxRuntime.jsxs(SidebarInset, { className: "flex flex-col bg-background", children: [
663
+ /* @__PURE__ */ jsxRuntime.jsx("header", { className: "h-12 border-b border-border bg-background flex items-center px-4 text-lg", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: "ChatGPT" }) }),
664
+ /* @__PURE__ */ jsxRuntime.jsxs(
665
+ "div",
666
+ {
667
+ className: "flex flex-col flex-1 mx-auto w-full transition-all duration-200 overflow-hidden",
668
+ style: { maxWidth: containerWidth },
669
+ children: [
670
+ /* @__PURE__ */ jsxRuntime.jsxs("main", { className: "flex-1 overflow-y-auto overflow-x-hidden", children: [
671
+ /* @__PURE__ */ jsxRuntime.jsxs(
672
+ "article",
673
+ {
674
+ className: "text-foreground w-full focus:outline-none",
675
+ dir: "auto",
676
+ "data-turn": "user",
677
+ children: [
678
+ /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "sr-only", children: "You said:" }),
679
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base my-auto mx-auto pt-12 px-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex max-w-full flex-col grow", children: /* @__PURE__ */ jsxRuntime.jsx(
680
+ "div",
681
+ {
682
+ "data-message-author-role": "user",
683
+ className: "min-h-8 relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal",
684
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full flex-col gap-1 empty:hidden items-end", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-secondary text-secondary-foreground relative rounded-[18px] px-4 py-3 max-w-[70%]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap", children: userMessage }) }) })
685
+ }
686
+ ) }) }) })
687
+ ]
688
+ }
689
+ ),
690
+ /* @__PURE__ */ jsxRuntime.jsxs(
691
+ "article",
692
+ {
693
+ className: "text-foreground w-full focus:outline-none",
694
+ dir: "auto",
695
+ "data-turn": "assistant",
696
+ children: [
697
+ /* @__PURE__ */ jsxRuntime.jsxs("h6", { className: "sr-only", children: [
698
+ appName,
699
+ " said:"
700
+ ] }),
701
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base my-auto mx-auto pb-10 px-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-full flex-col grow", children: [
702
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
703
+ appIcon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-6 flex items-center justify-center text-base", children: appIcon }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-6 rounded-full bg-primary flex items-center justify-center text-primary-foreground font-medium text-xs", children: "AI" }),
704
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm", children: appName })
705
+ ] }),
706
+ /* @__PURE__ */ jsxRuntime.jsx(
707
+ "div",
708
+ {
709
+ "data-message-author-role": "assistant",
710
+ className: "min-h-8 relative flex w-full flex-col items-start gap-2 text-start break-words whitespace-normal",
711
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full flex-col gap-1 empty:hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
712
+ "div",
713
+ {
714
+ className: cn(
715
+ "w-full overflow-x-auto",
716
+ displayMode === "pip" && "fixed bottom-20 right-6 z-50 w-80 rounded-xl shadow-xl border bg-card p-4 overflow-x-hidden"
717
+ ),
718
+ children
719
+ }
720
+ ) })
721
+ }
722
+ )
723
+ ] }) }) })
724
+ ]
725
+ }
726
+ )
727
+ ] }),
728
+ /* @__PURE__ */ jsxRuntime.jsx("footer", { className: "bg-background", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto px-4 py-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
729
+ "input",
730
+ {
731
+ type: "text",
732
+ disabled: true,
733
+ placeholder: "Message ChatGPT",
734
+ className: "w-full bg-secondary text-secondary-foreground placeholder:text-muted-foreground rounded-3xl px-5 py-3 pr-12 outline-none"
735
+ }
736
+ ) }) }) })
737
+ ]
882
738
  }
883
- }
884
- },
885
- MuiCard: {
886
- styleOverrides: {
887
- root: {
888
- borderRadius: "0.75rem",
889
- overflow: "hidden"
739
+ )
740
+ ] });
741
+ }
742
+
743
+ // src/components/simulator/mock-openai.ts
744
+ var MockOpenAI = class {
745
+ constructor() {
746
+ __publicField(this, "theme", "light");
747
+ __publicField(this, "userAgent", {
748
+ device: { type: "desktop" },
749
+ capabilities: {
750
+ hover: true,
751
+ touch: false
890
752
  }
891
- }
892
- },
893
- MuiPaper: {
894
- styleOverrides: {
895
- rounded: {
896
- borderRadius: "0.75rem"
753
+ });
754
+ __publicField(this, "locale", "en-US");
755
+ __publicField(this, "maxHeight", 600);
756
+ __publicField(this, "displayMode", "inline");
757
+ __publicField(this, "safeArea", {
758
+ insets: {
759
+ top: 0,
760
+ bottom: 0,
761
+ left: 0,
762
+ right: 0
897
763
  }
764
+ });
765
+ __publicField(this, "toolInput", {});
766
+ __publicField(this, "toolOutput", null);
767
+ __publicField(this, "toolResponseMetadata", null);
768
+ __publicField(this, "widgetState", null);
769
+ }
770
+ async callTool(name, args) {
771
+ console.log("Mock callTool:", name, args);
772
+ return { result: JSON.stringify({ success: true }) };
773
+ }
774
+ async sendFollowUpMessage(args) {
775
+ console.log("Mock sendFollowUpMessage:", args.prompt);
776
+ }
777
+ openExternal(payload) {
778
+ console.log("Mock openExternal:", payload.href);
779
+ window.open(payload.href, "_blank");
780
+ }
781
+ async requestDisplayMode(args) {
782
+ this.setDisplayMode(args.mode);
783
+ return { mode: args.mode };
784
+ }
785
+ async setWidgetState(state) {
786
+ this.widgetState = state;
787
+ this.emitUpdate({ widgetState: state });
788
+ }
789
+ setTheme(theme) {
790
+ this.theme = theme;
791
+ this.emitUpdate({ theme });
792
+ }
793
+ setDisplayMode(displayMode) {
794
+ this.displayMode = displayMode;
795
+ this.emitUpdate({ displayMode });
796
+ }
797
+ emitUpdate(globals) {
798
+ if (typeof window !== "undefined") {
799
+ const event = new CustomEvent(SET_GLOBALS_EVENT_TYPE, {
800
+ detail: { globals }
801
+ });
802
+ window.dispatchEvent(event);
898
803
  }
899
804
  }
900
805
  };
901
- var chatgptLightTheme = styles.createTheme({
902
- ...baseThemeOptions,
903
- palette: lightPalette,
904
- typography,
905
- spacing,
906
- shape,
907
- shadows,
908
- components
909
- });
910
- var chatgptDarkTheme = styles.createTheme({
911
- ...baseThemeOptions,
912
- palette: darkPalette,
913
- typography,
914
- spacing,
915
- shape,
916
- shadows,
917
- components
918
- });
919
- var getChatGPTTheme = (mode) => {
920
- return mode === "dark" ? chatgptDarkTheme : chatgptLightTheme;
921
- };
922
-
923
- // src/themes/index.ts
924
- var getCurrentPlatform = () => {
925
- return "chatgpt";
926
- };
927
- var platformThemes = {
928
- chatgpt: getChatGPTTheme
929
- // Add more platforms here:
930
- // gemini: getGeminiTheme,
931
- // claude: getClaudeTheme,
932
- };
933
- var getTheme = (mode) => {
934
- const platform = getCurrentPlatform();
935
- const themeGetter = platformThemes[platform];
936
- if (!themeGetter) {
937
- console.warn(`Unknown platform "${platform}", falling back to chatgpt theme`);
938
- return getChatGPTTheme(mode);
806
+ function initMockOpenAI() {
807
+ if (typeof window !== "undefined") {
808
+ const mock = new MockOpenAI();
809
+ window.openai = mock;
810
+ return mock;
939
811
  }
940
- return themeGetter(mode);
941
- };
942
- var getLightTheme = () => getTheme("light");
943
- var getDarkTheme = () => getTheme("dark");
944
- function GenAI(renderFn) {
945
- const GenAIComponent = (props = {}) => {
946
- const maxHeight = useMaxHeight();
947
- const detectedColorScheme = useColorScheme();
948
- const {
949
- className,
950
- maxWidth = 800,
951
- mode: overrideMode,
952
- enableCssBaseline = true,
953
- ...rest
954
- } = props;
955
- const colorScheme = overrideMode || detectedColorScheme || "light";
956
- const theme = getTheme(colorScheme);
957
- return /* @__PURE__ */ jsxRuntime.jsxs(styles.ThemeProvider, { theme, children: [
958
- enableCssBaseline && /* @__PURE__ */ jsxRuntime.jsx(CssBaseline__default.default, {}),
959
- /* @__PURE__ */ jsxRuntime.jsx(
960
- material.Box,
961
- {
962
- className,
963
- sx: {
964
- maxWidth: `${maxWidth}px`,
965
- maxHeight: maxHeight ? `${maxHeight}px` : void 0
966
- },
967
- ...rest,
968
- children: renderFn({ maxHeight, colorScheme })
969
- }
970
- )
971
- ] });
972
- };
973
- GenAIComponent.displayName = "GenAI";
974
- return GenAIComponent;
812
+ return new MockOpenAI();
975
813
  }
976
814
  function ChatGPTSimulator({
977
815
  children,
978
- displayMode: initialDisplayMode = "inline",
979
- colorScheme: initialColorScheme = "dark",
980
- toolInput = {},
981
- toolOutput = null,
982
- widgetState: initialWidgetState = null,
983
- userMessage = "Show me some recommendations",
984
- showControls = true,
985
- uiSimulations,
986
- initialUISimulation
816
+ appName,
817
+ appIcon,
818
+ userMessage
987
819
  }) {
988
- const [displayMode, setDisplayMode] = react.useState(initialDisplayMode);
989
- const [widgetState, setWidgetStateInternal] = react.useState(
990
- initialWidgetState
991
- );
992
- const [bodyWidth, setBodyWidth] = react.useState("100%");
993
- const [selectedUISimulation, setSelectedUISimulation] = react.useState(
994
- initialUISimulation || uiSimulations?.[0] || ""
995
- );
996
- const [viewportHeight, setViewportHeight] = react.useState(window.innerHeight);
997
- const [colorScheme, setColorScheme] = react.useState(initialColorScheme);
998
- const theme = getTheme(colorScheme);
999
- react.useEffect(() => {
1000
- const handleSetGlobals = (event) => {
1001
- const customEvent = event;
1002
- if (customEvent.detail?.globals?.colorScheme) {
1003
- setColorScheme(customEvent.detail.globals.colorScheme);
820
+ const [theme, setTheme] = React3.useState("dark");
821
+ const [displayMode, setDisplayMode] = React3.useState("inline");
822
+ const [screenWidth, setScreenWidth] = React3.useState("full");
823
+ const mock = React3.useMemo(() => initMockOpenAI(), []);
824
+ React3.useEffect(() => {
825
+ return () => {
826
+ if (typeof window !== "undefined") {
827
+ delete window.openai;
1004
828
  }
1005
829
  };
1006
- window.addEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobals);
1007
- return () => window.removeEventListener(SET_GLOBALS_EVENT_TYPE, handleSetGlobals);
1008
830
  }, []);
1009
- react.useEffect(() => {
1010
- const handleResize = () => {
1011
- setViewportHeight(window.innerHeight);
1012
- };
1013
- window.addEventListener("resize", handleResize);
1014
- return () => window.removeEventListener("resize", handleResize);
1015
- }, []);
1016
- react.useEffect(() => {
1017
- const inputBarHeight = 80;
1018
- const openaiGlobals = {
1019
- colorScheme,
1020
- displayMode,
1021
- locale: "en-US",
1022
- maxHeight: displayMode === "fullscreen" ? viewportHeight - inputBarHeight : 600,
1023
- userAgent: {
1024
- device: { type: "desktop" },
1025
- capabilities: { hover: true, touch: false }
1026
- },
1027
- safeArea: {
1028
- insets: { top: 0, bottom: 0, left: 0, right: 0 }
1029
- },
1030
- toolInput,
1031
- toolOutput,
1032
- toolResponseMetadata: null,
1033
- widgetState,
1034
- setWidgetState: async (state) => {
1035
- console.log("[ChatGPT Simulator] setWidgetState called:", state);
1036
- setWidgetStateInternal(state);
1037
- }
1038
- };
1039
- const openaiAPI = {
1040
- callTool: async (name, args) => {
1041
- console.log("[ChatGPT Simulator] callTool called:", name, args);
1042
- return { result: "Mock tool result" };
1043
- },
1044
- sendFollowUpMessage: async (args) => {
1045
- console.log("[ChatGPT Simulator] sendFollowUpMessage called:", args);
1046
- },
1047
- openExternal: (payload) => {
1048
- console.log("[ChatGPT Simulator] openExternal called:", payload);
1049
- window.open(payload.href, "_blank");
1050
- },
1051
- requestDisplayMode: async (args) => {
1052
- console.log("[ChatGPT Simulator] requestDisplayMode called:", args);
1053
- setDisplayMode(args.mode);
1054
- return { mode: args.mode };
1055
- }
1056
- };
1057
- window.openai = { ...openaiGlobals, ...openaiAPI };
1058
- window.dispatchEvent(
1059
- new CustomEvent(SET_GLOBALS_EVENT_TYPE, {
1060
- detail: { globals: openaiGlobals }
1061
- })
1062
- );
1063
- return () => {
1064
- delete window.openai;
1065
- };
1066
- }, [colorScheme, displayMode, toolInput, toolOutput, widgetState, viewportHeight]);
1067
- react.useEffect(() => {
1068
- if (window.openai) {
1069
- const inputBarHeight = 80;
1070
- const calculatedMaxHeight = displayMode === "fullscreen" ? viewportHeight - inputBarHeight : 600;
1071
- window.openai.colorScheme = colorScheme;
1072
- window.openai.displayMode = displayMode;
1073
- window.openai.widgetState = widgetState;
1074
- window.openai.maxHeight = calculatedMaxHeight;
1075
- window.dispatchEvent(
1076
- new CustomEvent(SET_GLOBALS_EVENT_TYPE, {
1077
- detail: {
1078
- globals: { colorScheme, displayMode, widgetState, maxHeight: calculatedMaxHeight }
1079
- }
1080
- })
1081
- );
831
+ React3.useEffect(() => {
832
+ if (mock) {
833
+ mock.setTheme(theme);
1082
834
  }
1083
- }, [colorScheme, displayMode, widgetState, viewportHeight]);
1084
- const isFullscreen = displayMode === "fullscreen";
1085
- const renderChildren = () => {
1086
- if (typeof children === "function") {
1087
- return children(selectedUISimulation);
835
+ }, [mock, theme]);
836
+ React3.useEffect(() => {
837
+ if (mock) {
838
+ mock.setDisplayMode(displayMode);
1088
839
  }
1089
- return children;
1090
- };
1091
- return /* @__PURE__ */ jsxRuntime.jsx(styles.ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsxs(
1092
- material.Box,
1093
- {
1094
- sx: {
1095
- minHeight: "100vh",
1096
- width: "100vw",
1097
- display: "flex",
1098
- fontFamily: theme.typography.fontFamily,
1099
- backgroundColor: theme.palette.background.default,
1100
- color: theme.palette.text.primary,
1101
- boxSizing: "border-box",
1102
- "@media (max-width: 768px)": {
1103
- flexDirection: "column"
1104
- }
1105
- },
1106
- children: [
1107
- showControls && /* @__PURE__ */ jsxRuntime.jsxs(
1108
- material.Box,
1109
- {
1110
- sx: {
1111
- width: "250px",
1112
- flexShrink: 0,
1113
- padding: theme.spacing(5),
1114
- display: "flex",
1115
- flexDirection: "column",
1116
- gap: theme.spacing(5),
1117
- overflowY: "auto",
1118
- backgroundColor: theme.palette.mode === "light" ? theme.palette.background.paper : theme.palette.background.default,
1119
- borderRight: `1px solid ${theme.palette.divider}`,
1120
- boxSizing: "border-box",
1121
- "@media (max-width: 768px)": {
1122
- width: "100%",
1123
- borderRight: "none",
1124
- borderBottom: `1px solid ${theme.palette.divider}`,
1125
- padding: theme.spacing(4)
1126
- }
1127
- },
1128
- children: [
1129
- /* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "h6", sx: { fontWeight: 600 }, children: "Controls" }) }),
1130
- /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", flexDirection: "column", gap: theme.spacing(3) }, children: [
1131
- uiSimulations && uiSimulations.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(material.FormControl, { fullWidth: true, size: "small", children: [
1132
- /* @__PURE__ */ jsxRuntime.jsx(material.InputLabel, { children: "App UI" }),
1133
- /* @__PURE__ */ jsxRuntime.jsx(
1134
- material.Select,
1135
- {
1136
- value: selectedUISimulation,
1137
- onChange: (e) => setSelectedUISimulation(e.target.value),
1138
- label: "App UI",
1139
- children: uiSimulations.map((simulation) => /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: simulation, children: simulation }, simulation))
1140
- }
1141
- )
1142
- ] }),
1143
- /* @__PURE__ */ jsxRuntime.jsxs(material.FormControl, { fullWidth: true, size: "small", children: [
1144
- /* @__PURE__ */ jsxRuntime.jsx(material.InputLabel, { children: "Color Scheme" }),
1145
- /* @__PURE__ */ jsxRuntime.jsxs(
1146
- material.Select,
1147
- {
1148
- value: colorScheme,
1149
- onChange: (e) => setColorScheme(e.target.value),
1150
- label: "Color Scheme",
1151
- children: [
1152
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "light", children: "Light" }),
1153
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "dark", children: "Dark" })
1154
- ]
1155
- }
1156
- )
1157
- ] }),
1158
- /* @__PURE__ */ jsxRuntime.jsxs(material.FormControl, { fullWidth: true, size: "small", children: [
1159
- /* @__PURE__ */ jsxRuntime.jsx(material.InputLabel, { children: "Display Mode" }),
1160
- /* @__PURE__ */ jsxRuntime.jsxs(
1161
- material.Select,
1162
- {
1163
- value: displayMode,
1164
- onChange: (e) => setDisplayMode(e.target.value),
1165
- label: "Display Mode",
1166
- children: [
1167
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "inline", children: "Inline" }),
1168
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "fullscreen", children: "Fullscreen" }),
1169
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "pip", children: "Picture-in-Picture" })
1170
- ]
1171
- }
1172
- )
1173
- ] }),
1174
- /* @__PURE__ */ jsxRuntime.jsxs(material.FormControl, { fullWidth: true, size: "small", children: [
1175
- /* @__PURE__ */ jsxRuntime.jsx(material.InputLabel, { children: "Body Width" }),
1176
- /* @__PURE__ */ jsxRuntime.jsxs(
1177
- material.Select,
1178
- {
1179
- value: bodyWidth,
1180
- onChange: (e) => setBodyWidth(e.target.value),
1181
- label: "Body Width",
1182
- children: [
1183
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "100%", children: "100% (Full)" }),
1184
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "1024px", children: "1024px (Laptop)" }),
1185
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "768px", children: "768px (Tablet)" }),
1186
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "425px", children: "425px (Mobile L)" }),
1187
- /* @__PURE__ */ jsxRuntime.jsx(material.MenuItem, { value: "320px", children: "320px (Mobile S)" })
1188
- ]
1189
- }
1190
- )
1191
- ] })
1192
- ] })
1193
- ]
1194
- }
1195
- ),
1196
- /* @__PURE__ */ jsxRuntime.jsxs(
1197
- material.Box,
1198
- {
1199
- sx: {
1200
- flex: 1,
1201
- minWidth: 0,
1202
- display: "flex",
1203
- flexDirection: "column",
1204
- overflowY: "auto",
1205
- padding: isFullscreen ? 0 : `${theme.spacing(4)} 0 ${theme.spacing(4)} ${theme.spacing(6)}`,
1206
- position: "relative",
1207
- height: isFullscreen ? "100vh" : "auto",
1208
- boxSizing: "border-box"
1209
- },
1210
- children: [
1211
- isFullscreen && /* @__PURE__ */ jsxRuntime.jsx(
1212
- material.IconButton,
1213
- {
1214
- onClick: () => setDisplayMode("inline"),
1215
- "aria-label": "Exit fullscreen",
1216
- sx: {
1217
- position: "absolute",
1218
- top: theme.spacing(4),
1219
- left: theme.spacing(4),
1220
- width: 40,
1221
- height: 40,
1222
- backgroundColor: theme.palette.background.paper,
1223
- zIndex: 10,
1224
- "&:hover": {
1225
- backgroundColor: theme.palette.mode === "light" ? theme.palette.grey[200] : theme.palette.grey[800]
1226
- }
1227
- },
1228
- children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon__default.default, {})
1229
- }
1230
- ),
1231
- !isFullscreen && /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { mb: theme.spacing(4) }, children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "h4", sx: { fontWeight: 600, margin: 0 }, children: "ChatGPT" }) }),
1232
- /* @__PURE__ */ jsxRuntime.jsxs(
1233
- material.Box,
1234
- {
1235
- sx: {
1236
- maxWidth: bodyWidth === "100%" ? "48rem" : bodyWidth,
1237
- mx: "auto",
1238
- flex: 1,
1239
- position: "relative",
1240
- display: "flex",
1241
- width: "100%",
1242
- minWidth: 0,
1243
- flexDirection: "column",
1244
- boxSizing: "border-box"
1245
- },
1246
- children: [
1247
- /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", maxWidth: "100%", flexDirection: "column", flexGrow: 1, minWidth: 0, boxSizing: "border-box" }, children: [
1248
- !isFullscreen && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1249
- /* @__PURE__ */ jsxRuntime.jsx(
1250
- material.Box,
1251
- {
1252
- sx: {
1253
- display: "flex",
1254
- alignItems: "flex-start",
1255
- justifyContent: "flex-end",
1256
- marginLeft: "auto",
1257
- marginRight: theme.spacing(6),
1258
- maxWidth: "70%",
1259
- "@media (max-width: 768px)": {
1260
- maxWidth: "85%"
1261
- }
1262
- },
1263
- children: /* @__PURE__ */ jsxRuntime.jsx(
1264
- material.Box,
1265
- {
1266
- sx: {
1267
- flex: "0 1 auto",
1268
- padding: `${theme.spacing(2)} ${theme.spacing(4)}`,
1269
- borderRadius: theme.spacing(3),
1270
- lineHeight: 1.5,
1271
- fontSize: theme.typography.body1.fontSize,
1272
- overflowWrap: "break-word",
1273
- wordBreak: "break-word",
1274
- minWidth: 0,
1275
- backgroundColor: theme.palette.grey[100],
1276
- color: theme.palette.text.primary,
1277
- boxSizing: "border-box"
1278
- },
1279
- children: userMessage
1280
- }
1281
- )
1282
- }
1283
- ),
1284
- /* @__PURE__ */ jsxRuntime.jsx(
1285
- material.Box,
1286
- {
1287
- sx: {
1288
- minHeight: "32px",
1289
- position: "relative",
1290
- display: "flex",
1291
- width: "100%",
1292
- minWidth: 0,
1293
- flexDirection: "column",
1294
- alignItems: "flex-end",
1295
- gap: theme.spacing(2),
1296
- textAlign: "start",
1297
- wordBreak: "break-word",
1298
- whiteSpace: "normal",
1299
- boxSizing: "border-box"
1300
- },
1301
- children: /* @__PURE__ */ jsxRuntime.jsx(
1302
- material.Box,
1303
- {
1304
- sx: {
1305
- display: "flex",
1306
- width: "100%",
1307
- minWidth: 0,
1308
- flexDirection: "column",
1309
- gap: theme.spacing(1),
1310
- "&:empty": { display: "none" },
1311
- "&:first-of-type": { pt: "1px" },
1312
- boxSizing: "border-box"
1313
- },
1314
- children: /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { width: "100%", minWidth: 0, wordBreak: "break-word", boxSizing: "border-box" }, children: [
1315
- /* @__PURE__ */ jsxRuntime.jsxs(
1316
- material.Box,
1317
- {
1318
- sx: {
1319
- color: theme.palette.text.secondary,
1320
- display: "flex",
1321
- alignItems: "center",
1322
- gap: theme.spacing(2),
1323
- margin: `${theme.spacing(4)} 0`,
1324
- fontSize: theme.typography.body2.fontSize,
1325
- fontWeight: 500,
1326
- opacity: 0.7
1327
- },
1328
- children: [
1329
- /* @__PURE__ */ jsxRuntime.jsx(material.Box, { component: "span", sx: { fontSize: theme.typography.body1.fontSize, lineHeight: 1 }, children: "\u2708\uFE0F" }),
1330
- /* @__PURE__ */ jsxRuntime.jsx(material.Box, { component: "span", sx: { lineHeight: 1 }, children: "Splorin" })
1331
- ]
1332
- }
1333
- ),
1334
- /* @__PURE__ */ jsxRuntime.jsx(
1335
- material.Box,
1336
- {
1337
- sx: {
1338
- overflow: "hidden",
1339
- width: "100%",
1340
- minWidth: 0,
1341
- boxSizing: "border-box"
1342
- },
1343
- children: renderChildren()
1344
- }
1345
- )
1346
- ] })
1347
- }
1348
- )
1349
- }
1350
- )
1351
- ] }),
1352
- isFullscreen && /* @__PURE__ */ jsxRuntime.jsx(
1353
- material.Box,
1354
- {
1355
- sx: {
1356
- flex: 1,
1357
- display: "flex",
1358
- flexDirection: "column",
1359
- width: "100%",
1360
- minWidth: 0,
1361
- height: "100%",
1362
- overflowY: "auto",
1363
- paddingBottom: "80px",
1364
- boxSizing: "border-box"
1365
- },
1366
- children: renderChildren()
1367
- }
1368
- )
1369
- ] }),
1370
- /* @__PURE__ */ jsxRuntime.jsx(
1371
- material.Box,
1372
- {
1373
- sx: {
1374
- position: "absolute",
1375
- bottom: 0,
1376
- left: 0,
1377
- right: 0,
1378
- margin: `${theme.spacing(4)} 0`,
1379
- padding: `0 ${theme.spacing(10)} 0 ${theme.spacing(4)}`,
1380
- display: "flex",
1381
- justifyContent: "center",
1382
- pointerEvents: "none",
1383
- boxSizing: "border-box"
1384
- },
1385
- children: /* @__PURE__ */ jsxRuntime.jsx(
1386
- material.TextField,
1387
- {
1388
- placeholder: "Message ChatGPT",
1389
- disabled: true,
1390
- sx: {
1391
- pointerEvents: "auto",
1392
- width: "100%",
1393
- maxWidth: "800px",
1394
- boxSizing: "border-box",
1395
- "& .MuiOutlinedInput-root": {
1396
- borderRadius: theme.spacing(8),
1397
- backgroundColor: theme.palette.grey[100],
1398
- "& fieldset": {
1399
- borderColor: theme.palette.mode === "light" ? theme.palette.grey[300] : theme.palette.grey[700]
1400
- },
1401
- "&.Mui-disabled": {
1402
- cursor: "not-allowed",
1403
- opacity: 0.6
1404
- }
1405
- },
1406
- "& .MuiInputBase-input::placeholder": {
1407
- color: theme.palette.text.secondary,
1408
- opacity: 0.7
1409
- }
1410
- }
1411
- }
1412
- )
1413
- }
1414
- )
1415
- ]
1416
- }
1417
- )
1418
- ]
1419
- }
1420
- )
1421
- ]
1422
- }
1423
- ) });
840
+ }, [mock, displayMode]);
841
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsxs(SidebarProvider, { defaultOpen: true, children: [
842
+ /* @__PURE__ */ jsxRuntime.jsx(Sidebar, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(SidebarGroup, { children: [
843
+ /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupLabel, { className: "text-md", children: "Controls" }),
844
+ /* @__PURE__ */ jsxRuntime.jsxs(SidebarGroupContent, { className: "space-y-4", children: [
845
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
846
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { htmlFor: "app-ui-select", className: "text-xs", children: "App UI" }),
847
+ /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: "carousel", onValueChange: () => {
848
+ }, children: [
849
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "app-ui-select", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
850
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "carousel", children: "Carousel" }) })
851
+ ] })
852
+ ] }),
853
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
854
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { htmlFor: "theme-select", className: "text-xs", children: "Color Scheme" }),
855
+ /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: theme, onValueChange: (value) => setTheme(value), children: [
856
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "theme-select", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
857
+ /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
858
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "light", children: "Light" }),
859
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "dark", children: "Dark" })
860
+ ] })
861
+ ] })
862
+ ] }),
863
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
864
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { htmlFor: "display-mode-select", className: "text-xs", children: "Display Mode" }),
865
+ /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: displayMode, onValueChange: (value) => setDisplayMode(value), children: [
866
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "display-mode-select", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
867
+ /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
868
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "inline", children: "Inline" }),
869
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "pip", children: "Picture in Picture" }),
870
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "fullscreen", children: "Fullscreen" })
871
+ ] })
872
+ ] })
873
+ ] }),
874
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
875
+ /* @__PURE__ */ jsxRuntime.jsx(Label2, { htmlFor: "screen-width-select", className: "text-xs", children: "Body Width" }),
876
+ /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: screenWidth, onValueChange: (value) => setScreenWidth(value), children: [
877
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { id: "screen-width-select", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
878
+ /* @__PURE__ */ jsxRuntime.jsxs(SelectContent, { children: [
879
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "mobile-s", children: "Mobile S (375px)" }),
880
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "mobile-l", children: "Mobile L (425px)" }),
881
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "tablet", children: "Tablet (768px)" }),
882
+ /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "full", children: "100% (Full)" })
883
+ ] })
884
+ ] })
885
+ ] })
886
+ ] })
887
+ ] }) }) }),
888
+ /* @__PURE__ */ jsxRuntime.jsx(
889
+ Conversation,
890
+ {
891
+ screenWidth,
892
+ displayMode,
893
+ appName,
894
+ appIcon,
895
+ userMessage,
896
+ children
897
+ }
898
+ )
899
+ ] }) });
1424
900
  }
1425
901
 
1426
- exports.Card = Card;
1427
- exports.Carousel = Carousel;
1428
902
  exports.ChatGPTSimulator = ChatGPTSimulator;
1429
- exports.GenAI = GenAI;
1430
- exports.PlatformProvider = PlatformProvider;
1431
- exports.baseThemeOptions = baseThemeOptions;
1432
- exports.chatgptDarkTheme = chatgptDarkTheme;
1433
- exports.chatgptLightTheme = chatgptLightTheme;
1434
- exports.chatgptPlatform = chatgptPlatform;
1435
- exports.createBaseTheme = createBaseTheme;
1436
- exports.createPlatformRegistry = createPlatformRegistry;
1437
- exports.getChatGPTTheme = getChatGPTTheme;
1438
- exports.getCurrentPlatform = getCurrentPlatform;
1439
- exports.getDarkTheme = getDarkTheme;
1440
- exports.getLightTheme = getLightTheme;
1441
- exports.getTheme = getTheme;
1442
- exports.useColorScheme = useColorScheme;
903
+ exports.SCREEN_WIDTHS = SCREEN_WIDTHS;
904
+ exports.SET_GLOBALS_EVENT_TYPE = SET_GLOBALS_EVENT_TYPE;
905
+ exports.SetGlobalsEvent = SetGlobalsEvent;
906
+ exports.ThemeProvider = ThemeProvider;
907
+ exports.cn = cn;
908
+ exports.initMockOpenAI = initMockOpenAI;
1443
909
  exports.useDisplayMode = useDisplayMode;
910
+ exports.useIsMobile = useIsMobile;
1444
911
  exports.useMaxHeight = useMaxHeight;
1445
- exports.usePlatform = usePlatform;
1446
- exports.usePlatformGlobal = usePlatformGlobal;
1447
- exports.useRequestDisplayMode = useRequestDisplayMode;
1448
- exports.useWidgetProps = useWidgetProps;
912
+ exports.useOpenAiGlobal = useOpenAiGlobal;
913
+ exports.useTheme = useTheme;
914
+ exports.useThemeContext = useThemeContext;
1449
915
  exports.useWidgetState = useWidgetState;
1450
916
  //# sourceMappingURL=index.cjs.map
1451
917
  //# sourceMappingURL=index.cjs.map