@refraction-ui/react 0.3.0 → 0.3.1

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.
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as React41 from 'react';
2
- import { forwardRef, useRef, useState, useEffect } from 'react';
3
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
3
  import * as ReactDOM from 'react-dom';
5
4
  import { createPortal } from 'react-dom';
@@ -43,23 +42,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
43
42
 
44
43
  // ../react-file-tree/dist/index.js
45
44
  var require_dist = __commonJS({
46
- "../react-file-tree/dist/index.js"(exports) {
45
+ "../react-file-tree/dist/index.js"(exports$1) {
47
46
  var jsxRuntime = __require("react/jsx-runtime");
48
47
  var FileTree = () => {
49
48
  return /* @__PURE__ */ jsxRuntime.jsx("div", {});
50
49
  };
51
- exports.FileTree = FileTree;
50
+ exports$1.FileTree = FileTree;
52
51
  }
53
52
  });
54
53
 
55
54
  // ../react-icon-system/dist/index.js
56
55
  var require_dist2 = __commonJS({
57
- "../react-icon-system/dist/index.js"(exports) {
56
+ "../react-icon-system/dist/index.js"(exports$1) {
58
57
  var jsxRuntime = __require("react/jsx-runtime");
59
58
  var IconSystem = () => {
60
59
  return /* @__PURE__ */ jsxRuntime.jsx("div", {});
61
60
  };
62
- exports.IconSystem = IconSystem;
61
+ exports$1.IconSystem = IconSystem;
63
62
  }
64
63
  });
65
64
 
@@ -107,6 +106,7 @@ __export(index_exports, {
107
106
  Command: () => Command,
108
107
  CommandEmpty: () => CommandEmpty,
109
108
  CommandGroup: () => CommandGroup,
109
+ CommandInput: () => CommandInput,
110
110
  CommandItem: () => CommandItem,
111
111
  CommandList: () => CommandList,
112
112
  CommandSeparator: () => CommandSeparator,
@@ -123,7 +123,6 @@ __export(index_exports, {
123
123
  DialogOverlay: () => DialogOverlay,
124
124
  DialogTitle: () => DialogTitle,
125
125
  DialogTrigger: () => DialogTrigger,
126
- DiffViewer: () => DiffViewer,
127
126
  DropdownMenu: () => DropdownMenu,
128
127
  DropdownMenuContent: () => DropdownMenuContent,
129
128
  DropdownMenuItem: () => DropdownMenuItem,
@@ -246,12 +245,9 @@ __export(index_exports, {
246
245
  commandVariants: () => commandVariants,
247
246
  contentProtectionVariants: () => contentProtectionVariants,
248
247
  controlsVariants: () => controlsVariants,
249
- createDiffViewer: () => createDiffViewer,
250
248
  dayVariants: () => dayVariants,
251
249
  deviceFrameVariants: () => deviceFrameVariants,
252
250
  dialogContentVariants: () => dialogContentVariants,
253
- diffViewerTokens: () => diffViewerTokens,
254
- diffViewerVariants: () => diffViewerVariants,
255
251
  editorVariants: () => editorVariants,
256
252
  emojiPickerContainerStyles: () => emojiPickerContainerStyles,
257
253
  emojiPickerEmojiButtonStyles: () => emojiPickerEmojiButtonStyles,
@@ -324,6 +320,8 @@ __export(index_exports, {
324
320
  shortcutBadgeStyles: () => shortcutBadgeStyles,
325
321
  shortcutKeyStyles: () => shortcutKeyStyles,
326
322
  shortcutSeparatorStyles: () => shortcutSeparatorStyles,
323
+ sidebarItemVariants: () => sidebarItemVariants,
324
+ sidebarVariants: () => sidebarVariants,
327
325
  skeletonVariants: () => skeletonVariants,
328
326
  slideTypeBadgeVariants: () => slideTypeBadgeVariants,
329
327
  slideViewerProgressBarVariants: () => progressBarVariants2,
@@ -331,7 +329,6 @@ __export(index_exports, {
331
329
  slideViewerVariants: () => slideViewerVariants,
332
330
  statCardVariants: () => statCardVariants,
333
331
  statsGridVariants: () => statsGridVariants,
334
- statusBarVariants: () => statusBarVariants,
335
332
  statusContainerStyles: () => statusContainerStyles,
336
333
  statusDotVariants: () => statusDotVariants,
337
334
  statusLabelStyles: () => statusLabelStyles,
@@ -339,8 +336,6 @@ __export(index_exports, {
339
336
  switchThumbVariants: () => switchThumbVariants,
340
337
  switchTokens: () => switchTokens,
341
338
  switchVariants: () => switchVariants,
342
- tabBarVariants: () => tabBarVariants,
343
- tabVariants: () => tabVariants,
344
339
  tableVariants: () => tableVariants,
345
340
  tabsListVariants: () => tabsListVariants,
346
341
  tabsTriggerVariants: () => tabsTriggerVariants,
@@ -869,7 +864,7 @@ AccordionContent.displayName = "AccordionContent";
869
864
 
870
865
  // ../animated-text/dist/index.js
871
866
  function createAnimatedText(props) {
872
- const { words} = props;
867
+ const { words } = props;
873
868
  const state = {
874
869
  currentIndex: 0
875
870
  };
@@ -888,7 +883,7 @@ function createAnimatedText(props) {
888
883
  };
889
884
  }
890
885
  function createTypewriter(props) {
891
- const { text} = props;
886
+ const { text } = props;
892
887
  const state = {
893
888
  currentIndex: 0
894
889
  };
@@ -1145,7 +1140,7 @@ var AuthContext = React41.createContext(null);
1145
1140
  function AuthProvider({ children, ...config }) {
1146
1141
  const authRef = React41.useRef(null);
1147
1142
  if (!authRef.current) {
1148
- if (!config.adapter) {
1143
+ if (!config.adapter && !config.testMode) {
1149
1144
  throw new Error("[refraction-ui/react-auth] You must provide an `adapter` to AuthProvider.");
1150
1145
  }
1151
1146
  authRef.current = createAuth(config.adapter, config);
@@ -1398,7 +1393,7 @@ Breadcrumbs.displayName = "Breadcrumbs";
1398
1393
 
1399
1394
  // ../button/dist/index.js
1400
1395
  function createButton(props = {}) {
1401
- const { disabled = false, loading = false, type = "button" } = props;
1396
+ const { disabled = false, loading = false } = props;
1402
1397
  const isInteractive = !disabled && !loading;
1403
1398
  const ariaProps = {};
1404
1399
  if (disabled) {
@@ -4519,13 +4514,13 @@ function extractComponents(content, components) {
4519
4514
  if (!components) return [];
4520
4515
  const extracted = [];
4521
4516
  for (const [name, def] of Object.entries(components)) {
4522
- const matches = content.matchAll(def.pattern);
4523
- for (const _match of matches) {
4517
+ const matches = Array.from(content.matchAll(def.pattern));
4518
+ matches.forEach(() => {
4524
4519
  extracted.push({
4525
4520
  name,
4526
4521
  props: { ...def.props }
4527
4522
  });
4528
- }
4523
+ });
4529
4524
  }
4530
4525
  return extracted;
4531
4526
  }
@@ -4789,7 +4784,7 @@ MobileNavLink.displayName = "MobileNavLink";
4789
4784
 
4790
4785
  // ../navbar/dist/index.js
4791
4786
  function createNavbar(props = {}) {
4792
- const { links = [], currentPath = "/" } = props;
4787
+ const { currentPath = "/" } = props;
4793
4788
  function isActive(href) {
4794
4789
  if (href === "/") return currentPath === "/";
4795
4790
  return currentPath.startsWith(href);
@@ -4840,7 +4835,7 @@ var Navbar = React41.forwardRef(
4840
4835
  className,
4841
4836
  ...props
4842
4837
  }, ref) => {
4843
- const api = createNavbar({ links, currentPath});
4838
+ const api = createNavbar({ currentPath});
4844
4839
  const classes = cn(navbarVariants({ variant }), className);
4845
4840
  return /* @__PURE__ */ jsx("header", { ref, className: classes, ...props, children: /* @__PURE__ */ jsxs(
4846
4841
  "nav",
@@ -7335,7 +7330,7 @@ function createResizableLayout(props = {}) {
7335
7330
  maxSizes = [],
7336
7331
  persistKey
7337
7332
  } = props;
7338
- let sizes = loadSizes(persistKey) ?? [...defaultSizes];
7333
+ const sizes = loadSizes(persistKey) ?? [...defaultSizes];
7339
7334
  let resizingIndex = null;
7340
7335
  let sizesBeforeResize = [];
7341
7336
  function loadSizes(key) {
@@ -9188,464 +9183,6 @@ function DatePicker({
9188
9183
  }
9189
9184
  DatePicker.displayName = "DatePicker";
9190
9185
 
9191
- // ../diff-viewer/dist/index.js
9192
- var extToLanguage = {
9193
- ts: "typescript",
9194
- tsx: "typescript",
9195
- js: "javascript",
9196
- jsx: "javascript",
9197
- py: "python",
9198
- go: "go",
9199
- rs: "rust",
9200
- rb: "ruby",
9201
- java: "java",
9202
- swift: "swift",
9203
- kt: "kotlin",
9204
- dart: "dart",
9205
- php: "php",
9206
- lua: "lua",
9207
- r: "r",
9208
- scala: "scala",
9209
- json: "json",
9210
- yaml: "yaml",
9211
- yml: "yaml",
9212
- md: "markdown",
9213
- html: "html",
9214
- css: "css",
9215
- scss: "scss",
9216
- sql: "sql",
9217
- sh: "shell",
9218
- bash: "shell",
9219
- zsh: "shell",
9220
- xml: "xml",
9221
- toml: "toml",
9222
- proto: "protobuf",
9223
- dockerfile: "dockerfile",
9224
- cpp: "cpp",
9225
- c: "c"
9226
- };
9227
- function getLanguageForFile(filePath) {
9228
- const ext = filePath.split(".").pop()?.toLowerCase() || "";
9229
- const basename = filePath.split("/").pop()?.toLowerCase() || "";
9230
- if (basename === "dockerfile") return "dockerfile";
9231
- return extToLanguage[ext] || "plaintext";
9232
- }
9233
- var statusIcons = {
9234
- added: "\u{1F7E2}",
9235
- // green circle
9236
- modified: "\u{1F7E1}",
9237
- // yellow circle
9238
- deleted: "\u{1F534}",
9239
- // red circle
9240
- renamed: "\u{1F535}"
9241
- // blue circle
9242
- };
9243
- function createDiffViewer(props = {}) {
9244
- const {
9245
- files = [],
9246
- activeFileIndex = 0,
9247
- viewMode = "side-by-side",
9248
- theme = "dark",
9249
- language,
9250
- sidebarOpen = true,
9251
- onFileSelect,
9252
- onViewModeChange,
9253
- onSidebarToggle
9254
- } = props;
9255
- let currentIndex = Math.min(activeFileIndex, Math.max(0, files.length - 1));
9256
- let currentViewMode = viewMode;
9257
- let currentSidebarOpen = sidebarOpen;
9258
- const state = {
9259
- activeFileIndex: currentIndex,
9260
- viewMode: currentViewMode,
9261
- theme,
9262
- language: language || (files[currentIndex] ? getLanguageForFile(files[currentIndex].path) : "plaintext"),
9263
- sidebarOpen: currentSidebarOpen,
9264
- files
9265
- };
9266
- const ariaProps = {
9267
- role: "region",
9268
- "aria-label": "Diff viewer"
9269
- };
9270
- const dataAttributes = {
9271
- "data-view-mode": currentViewMode,
9272
- "data-theme": theme,
9273
- "data-file-count": String(files.length)
9274
- };
9275
- if (!currentSidebarOpen) {
9276
- dataAttributes["data-sidebar-collapsed"] = "";
9277
- }
9278
- function selectFile(index) {
9279
- if (index >= 0 && index < files.length) {
9280
- currentIndex = index;
9281
- state.activeFileIndex = index;
9282
- state.language = language || getLanguageForFile(files[index].path);
9283
- onFileSelect?.(index);
9284
- }
9285
- }
9286
- function nextFile() {
9287
- if (currentIndex < files.length - 1) {
9288
- selectFile(currentIndex + 1);
9289
- }
9290
- }
9291
- function prevFile() {
9292
- if (currentIndex > 0) {
9293
- selectFile(currentIndex - 1);
9294
- }
9295
- }
9296
- function toggleViewMode() {
9297
- currentViewMode = currentViewMode === "side-by-side" ? "inline" : "side-by-side";
9298
- state.viewMode = currentViewMode;
9299
- dataAttributes["data-view-mode"] = currentViewMode;
9300
- onViewModeChange?.(currentViewMode);
9301
- }
9302
- function toggleSidebar() {
9303
- currentSidebarOpen = !currentSidebarOpen;
9304
- state.sidebarOpen = currentSidebarOpen;
9305
- if (currentSidebarOpen) {
9306
- delete dataAttributes["data-sidebar-collapsed"];
9307
- } else {
9308
- dataAttributes["data-sidebar-collapsed"] = "";
9309
- }
9310
- onSidebarToggle?.();
9311
- }
9312
- function totalAdditions() {
9313
- return files.reduce((sum, f) => sum + f.additions, 0);
9314
- }
9315
- function totalDeletions() {
9316
- return files.reduce((sum, f) => sum + f.deletions, 0);
9317
- }
9318
- return {
9319
- state,
9320
- ariaProps,
9321
- dataAttributes,
9322
- selectFile,
9323
- nextFile,
9324
- prevFile,
9325
- toggleViewMode,
9326
- toggleSidebar,
9327
- getLanguageForFile,
9328
- getFileStatusIcon: (status) => statusIcons[status] || "\u26AA",
9329
- totalAdditions,
9330
- totalDeletions
9331
- };
9332
- }
9333
- var diffViewerTokens = {
9334
- name: "diff-viewer",
9335
- tokens: {
9336
- bg: { variable: "--rfr-diff-bg", fallback: "hsl(var(--background))" },
9337
- fg: { variable: "--rfr-diff-fg", fallback: "hsl(var(--foreground))" },
9338
- sidebarBg: { variable: "--rfr-diff-sidebar-bg", fallback: "hsl(var(--muted))" },
9339
- headerBg: { variable: "--rfr-diff-header-bg", fallback: "hsl(var(--muted))" },
9340
- border: { variable: "--rfr-diff-border", fallback: "hsl(var(--border))" },
9341
- addBg: { variable: "--rfr-diff-add-bg", fallback: "rgba(46, 160, 67, 0.15)" },
9342
- delBg: { variable: "--rfr-diff-del-bg", fallback: "rgba(248, 81, 73, 0.15)" },
9343
- addFg: { variable: "--rfr-diff-add-fg", fallback: "#3fb950" },
9344
- delFg: { variable: "--rfr-diff-del-fg", fallback: "#f85149" },
9345
- statusbar: { variable: "--rfr-diff-statusbar", fallback: "hsl(var(--primary))" },
9346
- statusbarFg: { variable: "--rfr-diff-statusbar-fg", fallback: "hsl(var(--primary-foreground))" }
9347
- }
9348
- };
9349
- var diffViewerVariants = cva({
9350
- base: "flex flex-col overflow-hidden font-sans text-sm",
9351
- variants: {
9352
- theme: {
9353
- light: "bg-white text-gray-900",
9354
- dark: "bg-gray-950 text-gray-100"
9355
- },
9356
- fullscreen: {
9357
- "true": "h-screen",
9358
- "false": ""
9359
- }
9360
- },
9361
- defaultVariants: {
9362
- theme: "dark",
9363
- fullscreen: "true"
9364
- }
9365
- });
9366
- var sidebarVariants2 = cva({
9367
- base: "border-r overflow-auto flex-shrink-0",
9368
- variants: {
9369
- theme: {
9370
- light: "bg-gray-50 border-gray-200",
9371
- dark: "bg-gray-900 border-gray-800"
9372
- }
9373
- },
9374
- defaultVariants: {
9375
- theme: "dark"
9376
- }
9377
- });
9378
- var sidebarItemVariants2 = cva({
9379
- base: "px-2.5 py-1 cursor-pointer text-xs font-mono transition-colors",
9380
- variants: {
9381
- active: {
9382
- "true": "border-l-2 border-blue-500",
9383
- "false": "border-l-2 border-transparent"
9384
- },
9385
- theme: {
9386
- light: "",
9387
- dark: ""
9388
- }
9389
- },
9390
- compoundVariants: [
9391
- { active: "true", theme: "dark", class: "bg-gray-800 text-gray-100" },
9392
- { active: "false", theme: "dark", class: "text-gray-400 hover:bg-gray-800/50" },
9393
- { active: "true", theme: "light", class: "bg-blue-50 text-gray-900" },
9394
- { active: "false", theme: "light", class: "text-gray-600 hover:bg-gray-100" }
9395
- ],
9396
- defaultVariants: {
9397
- active: "false",
9398
- theme: "dark"
9399
- }
9400
- });
9401
- var tabBarVariants = cva({
9402
- base: "flex items-center border-b overflow-auto flex-shrink-0",
9403
- variants: {
9404
- theme: {
9405
- light: "bg-gray-50 border-gray-200",
9406
- dark: "bg-gray-900 border-gray-800"
9407
- }
9408
- },
9409
- defaultVariants: {
9410
- theme: "dark"
9411
- }
9412
- });
9413
- var tabVariants = cva({
9414
- base: "px-3 h-[35px] flex items-center gap-1 cursor-pointer text-xs font-mono border-r shrink-0",
9415
- variants: {
9416
- active: {
9417
- "true": "",
9418
- "false": ""
9419
- },
9420
- theme: {
9421
- light: "border-gray-200",
9422
- dark: "border-gray-800"
9423
- }
9424
- },
9425
- compoundVariants: [
9426
- { active: "true", theme: "dark", class: "bg-gray-950 text-gray-100 border-b-gray-950 -mb-px" },
9427
- { active: "false", theme: "dark", class: "text-gray-400" },
9428
- { active: "true", theme: "light", class: "bg-white text-gray-900 border-b-white -mb-px" },
9429
- { active: "false", theme: "light", class: "text-gray-500" }
9430
- ],
9431
- defaultVariants: {
9432
- active: "false",
9433
- theme: "dark"
9434
- }
9435
- });
9436
- var statusBarVariants = cva({
9437
- base: "h-[22px] flex items-center px-2.5 gap-3 text-[11px] font-mono flex-shrink-0",
9438
- variants: {
9439
- theme: {
9440
- light: "bg-blue-600 text-white",
9441
- dark: "bg-blue-700 text-white"
9442
- }
9443
- },
9444
- defaultVariants: {
9445
- theme: "dark"
9446
- }
9447
- });
9448
- var MonacoDiffEditor = React41.lazy(
9449
- () => import('@monaco-editor/react').then((m) => ({ default: m.DiffEditor }))
9450
- );
9451
- var DiffViewer = React41.forwardRef(
9452
- ({
9453
- files,
9454
- original = "",
9455
- modified = "",
9456
- language,
9457
- monacoTheme = "vs-dark",
9458
- theme = "dark",
9459
- viewMode: controlledViewMode = "side-by-side",
9460
- showSidebar = true,
9461
- showTabs = true,
9462
- showStatusBar = true,
9463
- sidebarWidth = 220,
9464
- activeFileIndex: controlledIndex = 0,
9465
- onFileSelect,
9466
- onViewModeChange,
9467
- statusBarTitle,
9468
- statusBarStatus,
9469
- className,
9470
- editorOptions
9471
- }, ref) => {
9472
- const [activeIdx, setActiveIdx] = React41.useState(controlledIndex);
9473
- const [sidebarOpen, setSidebarOpen] = React41.useState(showSidebar);
9474
- const [viewMode, setViewMode] = React41.useState(controlledViewMode);
9475
- React41.useEffect(() => setActiveIdx(controlledIndex), [controlledIndex]);
9476
- React41.useEffect(() => setViewMode(controlledViewMode), [controlledViewMode]);
9477
- const api = React41.useMemo(
9478
- () => createDiffViewer({
9479
- files,
9480
- activeFileIndex: activeIdx,
9481
- viewMode,
9482
- theme,
9483
- language,
9484
- sidebarOpen,
9485
- onFileSelect: (i) => {
9486
- setActiveIdx(i);
9487
- onFileSelect?.(i);
9488
- },
9489
- onViewModeChange: (m) => {
9490
- setViewMode(m);
9491
- onViewModeChange?.(m);
9492
- },
9493
- onSidebarToggle: () => setSidebarOpen((s) => !s)
9494
- }),
9495
- [files, activeIdx, viewMode, theme, language, sidebarOpen, onFileSelect, onViewModeChange]
9496
- );
9497
- const activeFile = files[activeIdx];
9498
- const detectedLang = language || (activeFile ? api.getLanguageForFile(activeFile.path) : "plaintext");
9499
- React41.useEffect(() => {
9500
- function onKey(e) {
9501
- if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
9502
- if (e.key === "j") {
9503
- setActiveIdx((i) => {
9504
- const next = Math.min(i + 1, files.length - 1);
9505
- onFileSelect?.(next);
9506
- return next;
9507
- });
9508
- } else if (e.key === "k") {
9509
- setActiveIdx((i) => {
9510
- const prev = Math.max(i - 1, 0);
9511
- onFileSelect?.(prev);
9512
- return prev;
9513
- });
9514
- } else if (e.key === "b") {
9515
- setSidebarOpen((s) => !s);
9516
- }
9517
- }
9518
- window.addEventListener("keydown", onKey);
9519
- return () => window.removeEventListener("keydown", onKey);
9520
- }, [files.length, onFileSelect]);
9521
- return /* @__PURE__ */ jsxs(
9522
- "div",
9523
- {
9524
- ref,
9525
- className: cn(diffViewerVariants({ theme, fullscreen: "true" }), className),
9526
- ...api.ariaProps,
9527
- ...api.dataAttributes,
9528
- children: [
9529
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
9530
- sidebarOpen && /* @__PURE__ */ jsxs("div", { className: sidebarVariants2({ theme }), style: { width: sidebarWidth }, children: [
9531
- /* @__PURE__ */ jsxs("div", { className: "px-2.5 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: [
9532
- "Files (",
9533
- files.length,
9534
- ")"
9535
- ] }),
9536
- files.map((f, i) => {
9537
- const active = i === activeIdx;
9538
- const fname = f.path.split("/").pop() || f.path;
9539
- const dir = f.path.split("/").slice(0, -1).join("/");
9540
- return /* @__PURE__ */ jsxs(
9541
- "div",
9542
- {
9543
- onClick: () => {
9544
- setActiveIdx(i);
9545
- onFileSelect?.(i);
9546
- },
9547
- className: sidebarItemVariants2({ active: active ? "true" : "false", theme }),
9548
- children: [
9549
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
9550
- /* @__PURE__ */ jsx("span", { className: "text-[10px]", children: api.getFileStatusIcon(f.status) }),
9551
- /* @__PURE__ */ jsx("span", { className: active ? "" : "opacity-70", children: fname }),
9552
- /* @__PURE__ */ jsxs("span", { className: "ml-auto text-[10px]", children: [
9553
- /* @__PURE__ */ jsxs("span", { className: "text-green-500", children: [
9554
- "+",
9555
- f.additions
9556
- ] }),
9557
- f.deletions > 0 && /* @__PURE__ */ jsxs("span", { className: "text-red-500", children: [
9558
- "-",
9559
- f.deletions
9560
- ] })
9561
- ] })
9562
- ] }),
9563
- dir && /* @__PURE__ */ jsx("div", { className: "text-[10px] opacity-50 mt-0.5 pl-4", children: dir })
9564
- ]
9565
- },
9566
- f.path
9567
- );
9568
- })
9569
- ] }),
9570
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
9571
- showTabs && activeFile && /* @__PURE__ */ jsx("div", { className: tabBarVariants({ theme }), children: files.map((f, i) => {
9572
- const active = i === activeIdx;
9573
- const fname = f.path.split("/").pop() || f.path;
9574
- return /* @__PURE__ */ jsxs(
9575
- "div",
9576
- {
9577
- onClick: () => {
9578
- setActiveIdx(i);
9579
- onFileSelect?.(i);
9580
- },
9581
- className: tabVariants({ active: active ? "true" : "false", theme }),
9582
- children: [
9583
- /* @__PURE__ */ jsx("span", { className: "text-[9px]", children: api.getFileStatusIcon(f.status) }),
9584
- fname
9585
- ]
9586
- },
9587
- f.path
9588
- );
9589
- }) }),
9590
- /* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsx(
9591
- React41.Suspense,
9592
- {
9593
- fallback: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full text-xs opacity-50", children: "Loading editor..." }),
9594
- children: /* @__PURE__ */ jsx(
9595
- MonacoDiffEditor,
9596
- {
9597
- original,
9598
- modified,
9599
- language: detectedLang,
9600
- theme: monacoTheme,
9601
- options: {
9602
- readOnly: true,
9603
- renderSideBySide: viewMode === "side-by-side",
9604
- minimap: { enabled: true, scale: 1, showSlider: "mouseover" },
9605
- fontSize: 13,
9606
- lineHeight: 20,
9607
- fontFamily: "'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",
9608
- fontLigatures: true,
9609
- scrollBeyondLastLine: false,
9610
- renderOverviewRuler: true,
9611
- scrollbar: { verticalScrollbarSize: 10, horizontalScrollbarSize: 10 },
9612
- padding: { top: 8, bottom: 8 },
9613
- renderWhitespace: "selection",
9614
- bracketPairColorization: { enabled: true },
9615
- guides: { indentation: true },
9616
- smoothScrolling: true,
9617
- cursorBlinking: "smooth",
9618
- ...editorOptions
9619
- }
9620
- }
9621
- )
9622
- }
9623
- ) })
9624
- ] })
9625
- ] }),
9626
- showStatusBar && /* @__PURE__ */ jsxs("div", { className: statusBarVariants({ theme }), children: [
9627
- statusBarTitle && /* @__PURE__ */ jsx("span", { children: statusBarTitle }),
9628
- activeFile && /* @__PURE__ */ jsx("span", { children: activeFile.path }),
9629
- /* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto" }, children: [
9630
- "+",
9631
- api.totalAdditions(),
9632
- " -",
9633
- api.totalDeletions()
9634
- ] }),
9635
- statusBarStatus && /* @__PURE__ */ jsx("span", { children: statusBarStatus }),
9636
- /* @__PURE__ */ jsxs("span", { children: [
9637
- files.length,
9638
- " ",
9639
- files.length === 1 ? "file" : "files"
9640
- ] })
9641
- ] })
9642
- ]
9643
- }
9644
- );
9645
- }
9646
- );
9647
- DiffViewer.displayName = "DiffViewer";
9648
-
9649
9186
  // ../emoji-picker/dist/index.js
9650
9187
  var EMOJI_DATA = {
9651
9188
  smileys: [
@@ -11854,7 +11391,7 @@ function createThreadView(props) {
11854
11391
  "aria-label": `Message from ${message.author.name}${isOwn ? " (you)" : ""} at ${formatTimestamp(message.timestamp)}`
11855
11392
  };
11856
11393
  }
11857
- function getReplyButtonAriaProps(messageId) {
11394
+ function getReplyButtonAriaProps(_messageId) {
11858
11395
  return {
11859
11396
  role: "button",
11860
11397
  "aria-label": `Reply to message`
@@ -12194,7 +11731,7 @@ var CodeBlock = () => {
12194
11731
  };
12195
11732
 
12196
11733
  // ../link-card/dist/index.js
12197
- function createLinkCard(props = {}) {
11734
+ function createLinkCard(_props = {}) {
12198
11735
  return {
12199
11736
  dataAttributes: { "data-slot": "link-card" }
12200
11737
  };
@@ -12216,7 +11753,7 @@ var LinkCard = React41.forwardRef(
12216
11753
  LinkCard.displayName = "LinkCard";
12217
11754
 
12218
11755
  // ../card-grid/dist/index.js
12219
- function createCardGrid(props = {}) {
11756
+ function createCardGrid(_props = {}) {
12220
11757
  return {
12221
11758
  dataAttributes: { "data-slot": "card-grid" }
12222
11759
  };
@@ -12300,196 +11837,6 @@ var PaymentButton = React41.forwardRef(
12300
11837
  );
12301
11838
  PaymentButton.displayName = "PaymentButton";
12302
11839
 
12303
- // ../command-input/dist/index.js
12304
- var CommandInput2 = class {
12305
- state = {
12306
- nodes: [],
12307
- rawText: "",
12308
- cursorPosition: 0,
12309
- activeTrigger: null,
12310
- activeCommandText: null
12311
- };
12312
- options;
12313
- constructor(options) {
12314
- this.options = { ...options };
12315
- }
12316
- handleInput(text, cursorPosition) {
12317
- this.state.rawText = text;
12318
- this.state.cursorPosition = cursorPosition;
12319
- this.parseInput();
12320
- this.notifyStateChange();
12321
- }
12322
- handleKeyDown(key, event) {
12323
- if (this.state.activeTrigger) {
12324
- if (key === "Escape") {
12325
- if (event) event.preventDefault();
12326
- this.state.activeTrigger = null;
12327
- this.state.activeCommandText = null;
12328
- if (this.options.onCommandCancel) {
12329
- this.options.onCommandCancel();
12330
- }
12331
- this.notifyStateChange();
12332
- } else if (key === "Enter") {
12333
- if (event) event.preventDefault();
12334
- const trigger = this.state.activeTrigger;
12335
- const text = this.state.activeCommandText || "";
12336
- this.state.activeTrigger = null;
12337
- this.state.activeCommandText = null;
12338
- if (this.options.onCommandCommit) {
12339
- this.options.onCommandCommit(trigger, text);
12340
- }
12341
- this.notifyStateChange();
12342
- }
12343
- }
12344
- }
12345
- get value() {
12346
- return this.state.nodes;
12347
- }
12348
- getState() {
12349
- return { ...this.state };
12350
- }
12351
- parseInput() {
12352
- const { rawText, cursorPosition } = this.state;
12353
- this.state.activeTrigger = null;
12354
- this.state.activeCommandText = null;
12355
- for (let i = cursorPosition - 1; i >= 0; i--) {
12356
- const char = rawText[i];
12357
- const matchedTrigger = this.options.triggers.find((t) => t.char === char);
12358
- if (matchedTrigger) {
12359
- const isStartOfWord = i === 0 || /\\s/.test(rawText[i - 1]);
12360
- if (isStartOfWord) {
12361
- const commandText = rawText.slice(i + 1, cursorPosition);
12362
- if (!/\\s/.test(commandText)) {
12363
- let isValid = true;
12364
- if (matchedTrigger.pattern) {
12365
- isValid = matchedTrigger.pattern.test(commandText);
12366
- }
12367
- if (isValid) {
12368
- this.state.activeTrigger = matchedTrigger;
12369
- this.state.activeCommandText = commandText;
12370
- if (this.options.onCommandTriggered) {
12371
- this.options.onCommandTriggered(matchedTrigger, commandText);
12372
- }
12373
- }
12374
- }
12375
- }
12376
- break;
12377
- }
12378
- if (/\\s/.test(char)) {
12379
- break;
12380
- }
12381
- }
12382
- const nodes = [];
12383
- if (this.options.triggers.length === 0) {
12384
- nodes.push({ type: "text", text: rawText });
12385
- this.state.nodes = nodes;
12386
- return;
12387
- }
12388
- const triggerChars = this.options.triggers.map((t) => t.char.replace(/[.*+?^\${}()|[\\]\\\\]/g, "\\\\$&"));
12389
- const patternStr = `(^|\\\\s)(${triggerChars.join("|")})([^\\\\s]*)`;
12390
- const regex = new RegExp(patternStr, "g");
12391
- let currentIndex = 0;
12392
- let match;
12393
- while ((match = regex.exec(rawText)) !== null) {
12394
- const precedingWhitespace = match[1];
12395
- const triggerChar = match[2];
12396
- const commandText = match[3];
12397
- const matchStart = match.index;
12398
- const triggerStart = matchStart + precedingWhitespace.length;
12399
- const triggerConfig = this.options.triggers.find((t) => t.char === triggerChar);
12400
- let isValid = true;
12401
- if (triggerConfig?.pattern && commandText.length > 0) {
12402
- isValid = triggerConfig.pattern.test(commandText);
12403
- }
12404
- if (isValid) {
12405
- if (triggerStart > currentIndex) {
12406
- nodes.push({ type: "text", text: rawText.slice(currentIndex, triggerStart) });
12407
- }
12408
- nodes.push({ type: "command", trigger: triggerChar, text: commandText });
12409
- currentIndex = regex.lastIndex;
12410
- }
12411
- }
12412
- if (currentIndex < rawText.length) {
12413
- nodes.push({ type: "text", text: rawText.slice(currentIndex) });
12414
- }
12415
- this.state.nodes = nodes;
12416
- }
12417
- notifyStateChange() {
12418
- if (this.options.onStateChange) {
12419
- this.options.onStateChange({ ...this.state });
12420
- }
12421
- }
12422
- };
12423
- var CommandInput3 = forwardRef(
12424
- ({
12425
- value = "",
12426
- onChange,
12427
- triggers = [],
12428
- renderPopover,
12429
- className,
12430
- ...props
12431
- }, ref) => {
12432
- const localRef = useRef(null);
12433
- const containerRef = ref || localRef;
12434
- const [popoverState, setPopoverState] = useState({
12435
- isOpen: false,
12436
- trigger: "",
12437
- search: "",
12438
- position: { top: 0, left: 0 }
12439
- });
12440
- const coreRef = useRef(null);
12441
- useEffect(() => {
12442
- if (containerRef.current && !coreRef.current) {
12443
- coreRef.current = new CommandInput2({
12444
- triggers,
12445
- onCommandTriggered: (trigger, search) => {
12446
- setPopoverState({
12447
- isOpen: true,
12448
- trigger: trigger.char,
12449
- search,
12450
- position: { top: 0, left: 0 }
12451
- });
12452
- },
12453
- onCommandCancel: () => {
12454
- setPopoverState((prev) => ({ ...prev, isOpen: false }));
12455
- },
12456
- onStateChange: (state) => {
12457
- onChange?.(state.rawText);
12458
- }
12459
- });
12460
- }
12461
- }, [triggers, onChange]);
12462
- useEffect(() => {
12463
- if (containerRef.current && containerRef.current.innerHTML !== value && coreRef.current) {
12464
- containerRef.current.innerHTML = value;
12465
- }
12466
- }, [value]);
12467
- return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full", className), children: [
12468
- /* @__PURE__ */ jsx(
12469
- "div",
12470
- {
12471
- ref: containerRef,
12472
- contentEditable: true,
12473
- suppressContentEditableWarning: true,
12474
- className: "w-full min-h-[40px] p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500",
12475
- onInput: (e) => {
12476
- coreRef.current?.handleInput(e.currentTarget.textContent || "", 0);
12477
- },
12478
- onKeyDown: (e) => {
12479
- coreRef.current?.handleKeyDown(e.key, e);
12480
- },
12481
- ...props
12482
- }
12483
- ),
12484
- renderPopover && renderPopover({
12485
- ...popoverState,
12486
- close: () => setPopoverState((prev) => ({ ...prev, isOpen: false }))
12487
- })
12488
- ] });
12489
- }
12490
- );
12491
- CommandInput3.displayName = "CommandInput";
12492
-
12493
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedText, AppShell, AuthGuard, AuthProvider, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BadgeDisplay, BottomNav, Breadcrumbs, Button, CATEGORY_LABELS, Calendar, CalendarHeader, Callout, Card2 as Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselTrigger, Checkbox, CodeBlock, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandEmpty, CommandGroup, CommandItem, CommandList, CommandSeparator, ContentProtection, DataTable, DatePicker, DeviceFrame, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, DiffViewer, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EMOJI_CATEGORIES, EMOJI_DATA, EmojiPicker, FeedbackButton, FeedbackDialog, FileUpload, Footer, InlineEditor, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InstallPrompt, KeyboardShortcut, LanguageSelector, LinkCard, MarkdownRenderer, MobileNav, MobileNavContent, MobileNavLink, MobileNavTrigger, Navbar, OtpInput, STATUS_COLORS as PRESENCE_STATUS_COLORS, STATUS_LABELS as PRESENCE_STATUS_LABELS, Pagination, Payment, Popover, PopoverClose, PopoverContent, PopoverTrigger, PresenceIndicator, ProgressBar, RadioGroup, RadioItem, ReactionBar, ResizableDivider, ResizableLayout, ResizablePane, STATUS_COLORS2 as STATUS_COLORS, STATUS_LABELS2 as STATUS_LABELS, SearchBar, SearchResultItem, SearchResults, Select, SelectContent, SelectItem, SelectTrigger, ShortcutBadge, Sidebar, Skeleton, SkeletonText, SkipToContent, SlideViewer, StatsGrid, StatusIndicator, Steps, Switch, TableOfContents, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeScript, ThemeToggle, ThreadView, Toast, ToastProvider, Toaster, Tooltip, TooltipContent, TooltipTrigger, TypewriterText, VersionSelector, VideoPlayer, animatedTextVariants, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, badgeGridVariants, badgeItemVariants, badgeVariants, bottomNavTabVariants, bottomNavVariants, breadcrumbItemVariants, breadcrumbSeparatorStyles, breadcrumbsVariants, buttonTokens, buttonVariants, calendarVariants, canAccessAdmin, canAccessReviewer, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants, cellVariants, checkIconPath, checkboxTokens, checkboxVariants, codeEditorTokens, codeEditorVariants, collapsibleContentVariants, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants, contentProtectionVariants, controlsVariants, createDiffViewer, dayVariants, deviceFrameVariants, dialogContentVariants, diffViewerTokens, diffViewerVariants, editorVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, feedbackDialogVariants, fileUploadDropZoneVariants, fileUploadFileItemStyles, fileUploadFileListStyles, footerVariants, formatFileSize, formatRelativeTime, formatShortcut, formatTimestamp, getAssignableRoles, getDefaultPortal, getInitials, hasAllRoles, hasAnyRole, hasRole, headerVariants, indeterminateIconPath, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupTokens, inputGroupVariants, inputVariants, installPromptVariants, latestBadgeVariants, markdownRendererTokens, menuContentVariants, menuItemVariants, mobileNavContentVariants, mobileNavLinkVariants, mobileNavTokens, mobileNavTriggerVariants, mobileNavVariants, navLinkVariants, navbarVariants, optionVariants, otpInputContainerVariants, otpInputSlotVariants, otpInputTokens, overlayStyles, overlayVariants, playerVariants, popoverContentVariants, previewVariants, progressBarVariants, proseVariants, radioCircleVariants, radioGroupVariants, radioItemVariants, reactionAddButtonStyles, reactionBarStyles, reactionCountStyles, reactionEmojiStyles, reactionPillVariants, resizableDividerVariants, resizableLayoutTokens, resizableLayoutVariants, resizablePaneVariants, rowVariants, searchBarVariants, searchResultVariants, selectContentVariants, selectItemVariants, selectTokens, selectTriggerVariants, selectorVariants, shortcutBadgeStyles, shortcutKeyStyles, shortcutSeparatorStyles, skeletonVariants, slideTypeBadgeVariants, progressBarVariants2 as slideViewerProgressBarVariants, slideViewerTokens, slideViewerVariants, statCardVariants, statsGridVariants, statusBarVariants, statusContainerStyles, statusDotVariants, statusLabelStyles, statusPulseVariants, switchThumbVariants, switchTokens, switchVariants, tabBarVariants, tabVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, threadAuthorStyles, threadAvatarStyles, threadBodyStyles, threadContainerStyles, threadContentStyles, threadMessageStyles, threadReactionsStyles, threadTimestampStyles, toastVariants, toolbarVariants, tooltipContentVariants, typewriterVariants, useAuth, useTheme, useToast, optionVariants2 as versionSelectorOptionVariants, versionSelectorVariants, watermarkVariants };
11840
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedText, AppShell, AuthGuard, AuthProvider, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BadgeDisplay, BottomNav, Breadcrumbs, Button, CATEGORY_LABELS, Calendar, CalendarHeader, Callout, Card2 as Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselTrigger, Checkbox, CodeBlock, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, ContentProtection, DataTable, DatePicker, DeviceFrame, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EMOJI_CATEGORIES, EMOJI_DATA, EmojiPicker, FeedbackButton, FeedbackDialog, FileUpload, Footer, InlineEditor, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InstallPrompt, KeyboardShortcut, LanguageSelector, LinkCard, MarkdownRenderer, MobileNav, MobileNavContent, MobileNavLink, MobileNavTrigger, Navbar, OtpInput, STATUS_COLORS as PRESENCE_STATUS_COLORS, STATUS_LABELS as PRESENCE_STATUS_LABELS, Pagination, Payment, Popover, PopoverClose, PopoverContent, PopoverTrigger, PresenceIndicator, ProgressBar, RadioGroup, RadioItem, ReactionBar, ResizableDivider, ResizableLayout, ResizablePane, STATUS_COLORS2 as STATUS_COLORS, STATUS_LABELS2 as STATUS_LABELS, SearchBar, SearchResultItem, SearchResults, Select, SelectContent, SelectItem, SelectTrigger, ShortcutBadge, Sidebar, Skeleton, SkeletonText, SkipToContent, SlideViewer, StatsGrid, StatusIndicator, Steps, Switch, TableOfContents, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeScript, ThemeToggle, ThreadView, Toast, ToastProvider, Toaster, Tooltip, TooltipContent, TooltipTrigger, TypewriterText, VersionSelector, VideoPlayer, animatedTextVariants, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, badgeGridVariants, badgeItemVariants, badgeVariants, bottomNavTabVariants, bottomNavVariants, breadcrumbItemVariants, breadcrumbSeparatorStyles, breadcrumbsVariants, buttonTokens, buttonVariants, calendarVariants, canAccessAdmin, canAccessReviewer, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants, cellVariants, checkIconPath, checkboxTokens, checkboxVariants, codeEditorTokens, codeEditorVariants, collapsibleContentVariants, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants, contentProtectionVariants, controlsVariants, dayVariants, deviceFrameVariants, dialogContentVariants, editorVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, feedbackDialogVariants, fileUploadDropZoneVariants, fileUploadFileItemStyles, fileUploadFileListStyles, footerVariants, formatFileSize, formatRelativeTime, formatShortcut, formatTimestamp, getAssignableRoles, getDefaultPortal, getInitials, hasAllRoles, hasAnyRole, hasRole, headerVariants, indeterminateIconPath, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupTokens, inputGroupVariants, inputVariants, installPromptVariants, latestBadgeVariants, markdownRendererTokens, menuContentVariants, menuItemVariants, mobileNavContentVariants, mobileNavLinkVariants, mobileNavTokens, mobileNavTriggerVariants, mobileNavVariants, navLinkVariants, navbarVariants, optionVariants, otpInputContainerVariants, otpInputSlotVariants, otpInputTokens, overlayStyles, overlayVariants, playerVariants, popoverContentVariants, previewVariants, progressBarVariants, proseVariants, radioCircleVariants, radioGroupVariants, radioItemVariants, reactionAddButtonStyles, reactionBarStyles, reactionCountStyles, reactionEmojiStyles, reactionPillVariants, resizableDividerVariants, resizableLayoutTokens, resizableLayoutVariants, resizablePaneVariants, rowVariants, searchBarVariants, searchResultVariants, selectContentVariants, selectItemVariants, selectTokens, selectTriggerVariants, selectorVariants, shortcutBadgeStyles, shortcutKeyStyles, shortcutSeparatorStyles, sidebarItemVariants, sidebarVariants, skeletonVariants, slideTypeBadgeVariants, progressBarVariants2 as slideViewerProgressBarVariants, slideViewerTokens, slideViewerVariants, statCardVariants, statsGridVariants, statusContainerStyles, statusDotVariants, statusLabelStyles, statusPulseVariants, switchThumbVariants, switchTokens, switchVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, threadAuthorStyles, threadAvatarStyles, threadBodyStyles, threadContainerStyles, threadContentStyles, threadMessageStyles, threadReactionsStyles, threadTimestampStyles, toastVariants, toolbarVariants, tooltipContentVariants, typewriterVariants, useAuth, useTheme, useToast, optionVariants2 as versionSelectorOptionVariants, versionSelectorVariants, watermarkVariants };
12494
11841
  //# sourceMappingURL=index.js.map
12495
11842
  //# sourceMappingURL=index.js.map