@refraction-ui/react 0.3.0 → 0.3.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.
package/dist/index.cjs CHANGED
@@ -64,23 +64,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
64
64
 
65
65
  // ../react-file-tree/dist/index.js
66
66
  var require_dist = __commonJS({
67
- "../react-file-tree/dist/index.js"(exports) {
67
+ "../react-file-tree/dist/index.js"(exports$1) {
68
68
  var jsxRuntime = __require("react/jsx-runtime");
69
69
  var FileTree = () => {
70
70
  return /* @__PURE__ */ jsxRuntime.jsx("div", {});
71
71
  };
72
- exports.FileTree = FileTree;
72
+ exports$1.FileTree = FileTree;
73
73
  }
74
74
  });
75
75
 
76
76
  // ../react-icon-system/dist/index.js
77
77
  var require_dist2 = __commonJS({
78
- "../react-icon-system/dist/index.js"(exports) {
78
+ "../react-icon-system/dist/index.js"(exports$1) {
79
79
  var jsxRuntime = __require("react/jsx-runtime");
80
80
  var IconSystem = () => {
81
81
  return /* @__PURE__ */ jsxRuntime.jsx("div", {});
82
82
  };
83
- exports.IconSystem = IconSystem;
83
+ exports$1.IconSystem = IconSystem;
84
84
  }
85
85
  });
86
86
 
@@ -128,6 +128,7 @@ __export(index_exports, {
128
128
  Command: () => Command,
129
129
  CommandEmpty: () => CommandEmpty,
130
130
  CommandGroup: () => CommandGroup,
131
+ CommandInput: () => CommandInput,
131
132
  CommandItem: () => CommandItem,
132
133
  CommandList: () => CommandList,
133
134
  CommandSeparator: () => CommandSeparator,
@@ -144,7 +145,6 @@ __export(index_exports, {
144
145
  DialogOverlay: () => DialogOverlay,
145
146
  DialogTitle: () => DialogTitle,
146
147
  DialogTrigger: () => DialogTrigger,
147
- DiffViewer: () => DiffViewer,
148
148
  DropdownMenu: () => DropdownMenu,
149
149
  DropdownMenuContent: () => DropdownMenuContent,
150
150
  DropdownMenuItem: () => DropdownMenuItem,
@@ -267,12 +267,9 @@ __export(index_exports, {
267
267
  commandVariants: () => commandVariants,
268
268
  contentProtectionVariants: () => contentProtectionVariants,
269
269
  controlsVariants: () => controlsVariants,
270
- createDiffViewer: () => createDiffViewer,
271
270
  dayVariants: () => dayVariants,
272
271
  deviceFrameVariants: () => deviceFrameVariants,
273
272
  dialogContentVariants: () => dialogContentVariants,
274
- diffViewerTokens: () => diffViewerTokens,
275
- diffViewerVariants: () => diffViewerVariants,
276
273
  editorVariants: () => editorVariants,
277
274
  emojiPickerContainerStyles: () => emojiPickerContainerStyles,
278
275
  emojiPickerEmojiButtonStyles: () => emojiPickerEmojiButtonStyles,
@@ -345,6 +342,8 @@ __export(index_exports, {
345
342
  shortcutBadgeStyles: () => shortcutBadgeStyles,
346
343
  shortcutKeyStyles: () => shortcutKeyStyles,
347
344
  shortcutSeparatorStyles: () => shortcutSeparatorStyles,
345
+ sidebarItemVariants: () => sidebarItemVariants,
346
+ sidebarVariants: () => sidebarVariants,
348
347
  skeletonVariants: () => skeletonVariants,
349
348
  slideTypeBadgeVariants: () => slideTypeBadgeVariants,
350
349
  slideViewerProgressBarVariants: () => progressBarVariants2,
@@ -352,7 +351,6 @@ __export(index_exports, {
352
351
  slideViewerVariants: () => slideViewerVariants,
353
352
  statCardVariants: () => statCardVariants,
354
353
  statsGridVariants: () => statsGridVariants,
355
- statusBarVariants: () => statusBarVariants,
356
354
  statusContainerStyles: () => statusContainerStyles,
357
355
  statusDotVariants: () => statusDotVariants,
358
356
  statusLabelStyles: () => statusLabelStyles,
@@ -360,8 +358,6 @@ __export(index_exports, {
360
358
  switchThumbVariants: () => switchThumbVariants,
361
359
  switchTokens: () => switchTokens,
362
360
  switchVariants: () => switchVariants,
363
- tabBarVariants: () => tabBarVariants,
364
- tabVariants: () => tabVariants,
365
361
  tableVariants: () => tableVariants,
366
362
  tabsListVariants: () => tabsListVariants,
367
363
  tabsTriggerVariants: () => tabsTriggerVariants,
@@ -890,7 +886,7 @@ AccordionContent.displayName = "AccordionContent";
890
886
 
891
887
  // ../animated-text/dist/index.js
892
888
  function createAnimatedText(props) {
893
- const { words} = props;
889
+ const { words } = props;
894
890
  const state = {
895
891
  currentIndex: 0
896
892
  };
@@ -909,7 +905,7 @@ function createAnimatedText(props) {
909
905
  };
910
906
  }
911
907
  function createTypewriter(props) {
912
- const { text} = props;
908
+ const { text } = props;
913
909
  const state = {
914
910
  currentIndex: 0
915
911
  };
@@ -1166,7 +1162,7 @@ var AuthContext = React41__namespace.createContext(null);
1166
1162
  function AuthProvider({ children, ...config }) {
1167
1163
  const authRef = React41__namespace.useRef(null);
1168
1164
  if (!authRef.current) {
1169
- if (!config.adapter) {
1165
+ if (!config.adapter && !config.testMode) {
1170
1166
  throw new Error("[refraction-ui/react-auth] You must provide an `adapter` to AuthProvider.");
1171
1167
  }
1172
1168
  authRef.current = createAuth(config.adapter, config);
@@ -1419,7 +1415,7 @@ Breadcrumbs.displayName = "Breadcrumbs";
1419
1415
 
1420
1416
  // ../button/dist/index.js
1421
1417
  function createButton(props = {}) {
1422
- const { disabled = false, loading = false, type = "button" } = props;
1418
+ const { disabled = false, loading = false } = props;
1423
1419
  const isInteractive = !disabled && !loading;
1424
1420
  const ariaProps = {};
1425
1421
  if (disabled) {
@@ -4540,13 +4536,13 @@ function extractComponents(content, components) {
4540
4536
  if (!components) return [];
4541
4537
  const extracted = [];
4542
4538
  for (const [name, def] of Object.entries(components)) {
4543
- const matches = content.matchAll(def.pattern);
4544
- for (const _match of matches) {
4539
+ const matches = Array.from(content.matchAll(def.pattern));
4540
+ matches.forEach(() => {
4545
4541
  extracted.push({
4546
4542
  name,
4547
4543
  props: { ...def.props }
4548
4544
  });
4549
- }
4545
+ });
4550
4546
  }
4551
4547
  return extracted;
4552
4548
  }
@@ -4810,7 +4806,7 @@ MobileNavLink.displayName = "MobileNavLink";
4810
4806
 
4811
4807
  // ../navbar/dist/index.js
4812
4808
  function createNavbar(props = {}) {
4813
- const { links = [], currentPath = "/" } = props;
4809
+ const { currentPath = "/" } = props;
4814
4810
  function isActive(href) {
4815
4811
  if (href === "/") return currentPath === "/";
4816
4812
  return currentPath.startsWith(href);
@@ -4861,7 +4857,7 @@ var Navbar = React41__namespace.forwardRef(
4861
4857
  className,
4862
4858
  ...props
4863
4859
  }, ref) => {
4864
- const api = createNavbar({ links, currentPath});
4860
+ const api = createNavbar({ currentPath});
4865
4861
  const classes = cn(navbarVariants({ variant }), className);
4866
4862
  return /* @__PURE__ */ jsxRuntime.jsx("header", { ref, className: classes, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
4867
4863
  "nav",
@@ -7356,7 +7352,7 @@ function createResizableLayout(props = {}) {
7356
7352
  maxSizes = [],
7357
7353
  persistKey
7358
7354
  } = props;
7359
- let sizes = loadSizes(persistKey) ?? [...defaultSizes];
7355
+ const sizes = loadSizes(persistKey) ?? [...defaultSizes];
7360
7356
  let resizingIndex = null;
7361
7357
  let sizesBeforeResize = [];
7362
7358
  function loadSizes(key) {
@@ -9209,464 +9205,6 @@ function DatePicker({
9209
9205
  }
9210
9206
  DatePicker.displayName = "DatePicker";
9211
9207
 
9212
- // ../diff-viewer/dist/index.js
9213
- var extToLanguage = {
9214
- ts: "typescript",
9215
- tsx: "typescript",
9216
- js: "javascript",
9217
- jsx: "javascript",
9218
- py: "python",
9219
- go: "go",
9220
- rs: "rust",
9221
- rb: "ruby",
9222
- java: "java",
9223
- swift: "swift",
9224
- kt: "kotlin",
9225
- dart: "dart",
9226
- php: "php",
9227
- lua: "lua",
9228
- r: "r",
9229
- scala: "scala",
9230
- json: "json",
9231
- yaml: "yaml",
9232
- yml: "yaml",
9233
- md: "markdown",
9234
- html: "html",
9235
- css: "css",
9236
- scss: "scss",
9237
- sql: "sql",
9238
- sh: "shell",
9239
- bash: "shell",
9240
- zsh: "shell",
9241
- xml: "xml",
9242
- toml: "toml",
9243
- proto: "protobuf",
9244
- dockerfile: "dockerfile",
9245
- cpp: "cpp",
9246
- c: "c"
9247
- };
9248
- function getLanguageForFile(filePath) {
9249
- const ext = filePath.split(".").pop()?.toLowerCase() || "";
9250
- const basename = filePath.split("/").pop()?.toLowerCase() || "";
9251
- if (basename === "dockerfile") return "dockerfile";
9252
- return extToLanguage[ext] || "plaintext";
9253
- }
9254
- var statusIcons = {
9255
- added: "\u{1F7E2}",
9256
- // green circle
9257
- modified: "\u{1F7E1}",
9258
- // yellow circle
9259
- deleted: "\u{1F534}",
9260
- // red circle
9261
- renamed: "\u{1F535}"
9262
- // blue circle
9263
- };
9264
- function createDiffViewer(props = {}) {
9265
- const {
9266
- files = [],
9267
- activeFileIndex = 0,
9268
- viewMode = "side-by-side",
9269
- theme = "dark",
9270
- language,
9271
- sidebarOpen = true,
9272
- onFileSelect,
9273
- onViewModeChange,
9274
- onSidebarToggle
9275
- } = props;
9276
- let currentIndex = Math.min(activeFileIndex, Math.max(0, files.length - 1));
9277
- let currentViewMode = viewMode;
9278
- let currentSidebarOpen = sidebarOpen;
9279
- const state = {
9280
- activeFileIndex: currentIndex,
9281
- viewMode: currentViewMode,
9282
- theme,
9283
- language: language || (files[currentIndex] ? getLanguageForFile(files[currentIndex].path) : "plaintext"),
9284
- sidebarOpen: currentSidebarOpen,
9285
- files
9286
- };
9287
- const ariaProps = {
9288
- role: "region",
9289
- "aria-label": "Diff viewer"
9290
- };
9291
- const dataAttributes = {
9292
- "data-view-mode": currentViewMode,
9293
- "data-theme": theme,
9294
- "data-file-count": String(files.length)
9295
- };
9296
- if (!currentSidebarOpen) {
9297
- dataAttributes["data-sidebar-collapsed"] = "";
9298
- }
9299
- function selectFile(index) {
9300
- if (index >= 0 && index < files.length) {
9301
- currentIndex = index;
9302
- state.activeFileIndex = index;
9303
- state.language = language || getLanguageForFile(files[index].path);
9304
- onFileSelect?.(index);
9305
- }
9306
- }
9307
- function nextFile() {
9308
- if (currentIndex < files.length - 1) {
9309
- selectFile(currentIndex + 1);
9310
- }
9311
- }
9312
- function prevFile() {
9313
- if (currentIndex > 0) {
9314
- selectFile(currentIndex - 1);
9315
- }
9316
- }
9317
- function toggleViewMode() {
9318
- currentViewMode = currentViewMode === "side-by-side" ? "inline" : "side-by-side";
9319
- state.viewMode = currentViewMode;
9320
- dataAttributes["data-view-mode"] = currentViewMode;
9321
- onViewModeChange?.(currentViewMode);
9322
- }
9323
- function toggleSidebar() {
9324
- currentSidebarOpen = !currentSidebarOpen;
9325
- state.sidebarOpen = currentSidebarOpen;
9326
- if (currentSidebarOpen) {
9327
- delete dataAttributes["data-sidebar-collapsed"];
9328
- } else {
9329
- dataAttributes["data-sidebar-collapsed"] = "";
9330
- }
9331
- onSidebarToggle?.();
9332
- }
9333
- function totalAdditions() {
9334
- return files.reduce((sum, f) => sum + f.additions, 0);
9335
- }
9336
- function totalDeletions() {
9337
- return files.reduce((sum, f) => sum + f.deletions, 0);
9338
- }
9339
- return {
9340
- state,
9341
- ariaProps,
9342
- dataAttributes,
9343
- selectFile,
9344
- nextFile,
9345
- prevFile,
9346
- toggleViewMode,
9347
- toggleSidebar,
9348
- getLanguageForFile,
9349
- getFileStatusIcon: (status) => statusIcons[status] || "\u26AA",
9350
- totalAdditions,
9351
- totalDeletions
9352
- };
9353
- }
9354
- var diffViewerTokens = {
9355
- name: "diff-viewer",
9356
- tokens: {
9357
- bg: { variable: "--rfr-diff-bg", fallback: "hsl(var(--background))" },
9358
- fg: { variable: "--rfr-diff-fg", fallback: "hsl(var(--foreground))" },
9359
- sidebarBg: { variable: "--rfr-diff-sidebar-bg", fallback: "hsl(var(--muted))" },
9360
- headerBg: { variable: "--rfr-diff-header-bg", fallback: "hsl(var(--muted))" },
9361
- border: { variable: "--rfr-diff-border", fallback: "hsl(var(--border))" },
9362
- addBg: { variable: "--rfr-diff-add-bg", fallback: "rgba(46, 160, 67, 0.15)" },
9363
- delBg: { variable: "--rfr-diff-del-bg", fallback: "rgba(248, 81, 73, 0.15)" },
9364
- addFg: { variable: "--rfr-diff-add-fg", fallback: "#3fb950" },
9365
- delFg: { variable: "--rfr-diff-del-fg", fallback: "#f85149" },
9366
- statusbar: { variable: "--rfr-diff-statusbar", fallback: "hsl(var(--primary))" },
9367
- statusbarFg: { variable: "--rfr-diff-statusbar-fg", fallback: "hsl(var(--primary-foreground))" }
9368
- }
9369
- };
9370
- var diffViewerVariants = cva({
9371
- base: "flex flex-col overflow-hidden font-sans text-sm",
9372
- variants: {
9373
- theme: {
9374
- light: "bg-white text-gray-900",
9375
- dark: "bg-gray-950 text-gray-100"
9376
- },
9377
- fullscreen: {
9378
- "true": "h-screen",
9379
- "false": ""
9380
- }
9381
- },
9382
- defaultVariants: {
9383
- theme: "dark",
9384
- fullscreen: "true"
9385
- }
9386
- });
9387
- var sidebarVariants2 = cva({
9388
- base: "border-r overflow-auto flex-shrink-0",
9389
- variants: {
9390
- theme: {
9391
- light: "bg-gray-50 border-gray-200",
9392
- dark: "bg-gray-900 border-gray-800"
9393
- }
9394
- },
9395
- defaultVariants: {
9396
- theme: "dark"
9397
- }
9398
- });
9399
- var sidebarItemVariants2 = cva({
9400
- base: "px-2.5 py-1 cursor-pointer text-xs font-mono transition-colors",
9401
- variants: {
9402
- active: {
9403
- "true": "border-l-2 border-blue-500",
9404
- "false": "border-l-2 border-transparent"
9405
- },
9406
- theme: {
9407
- light: "",
9408
- dark: ""
9409
- }
9410
- },
9411
- compoundVariants: [
9412
- { active: "true", theme: "dark", class: "bg-gray-800 text-gray-100" },
9413
- { active: "false", theme: "dark", class: "text-gray-400 hover:bg-gray-800/50" },
9414
- { active: "true", theme: "light", class: "bg-blue-50 text-gray-900" },
9415
- { active: "false", theme: "light", class: "text-gray-600 hover:bg-gray-100" }
9416
- ],
9417
- defaultVariants: {
9418
- active: "false",
9419
- theme: "dark"
9420
- }
9421
- });
9422
- var tabBarVariants = cva({
9423
- base: "flex items-center border-b overflow-auto flex-shrink-0",
9424
- variants: {
9425
- theme: {
9426
- light: "bg-gray-50 border-gray-200",
9427
- dark: "bg-gray-900 border-gray-800"
9428
- }
9429
- },
9430
- defaultVariants: {
9431
- theme: "dark"
9432
- }
9433
- });
9434
- var tabVariants = cva({
9435
- base: "px-3 h-[35px] flex items-center gap-1 cursor-pointer text-xs font-mono border-r shrink-0",
9436
- variants: {
9437
- active: {
9438
- "true": "",
9439
- "false": ""
9440
- },
9441
- theme: {
9442
- light: "border-gray-200",
9443
- dark: "border-gray-800"
9444
- }
9445
- },
9446
- compoundVariants: [
9447
- { active: "true", theme: "dark", class: "bg-gray-950 text-gray-100 border-b-gray-950 -mb-px" },
9448
- { active: "false", theme: "dark", class: "text-gray-400" },
9449
- { active: "true", theme: "light", class: "bg-white text-gray-900 border-b-white -mb-px" },
9450
- { active: "false", theme: "light", class: "text-gray-500" }
9451
- ],
9452
- defaultVariants: {
9453
- active: "false",
9454
- theme: "dark"
9455
- }
9456
- });
9457
- var statusBarVariants = cva({
9458
- base: "h-[22px] flex items-center px-2.5 gap-3 text-[11px] font-mono flex-shrink-0",
9459
- variants: {
9460
- theme: {
9461
- light: "bg-blue-600 text-white",
9462
- dark: "bg-blue-700 text-white"
9463
- }
9464
- },
9465
- defaultVariants: {
9466
- theme: "dark"
9467
- }
9468
- });
9469
- var MonacoDiffEditor = React41__namespace.lazy(
9470
- () => import('@monaco-editor/react').then((m) => ({ default: m.DiffEditor }))
9471
- );
9472
- var DiffViewer = React41__namespace.forwardRef(
9473
- ({
9474
- files,
9475
- original = "",
9476
- modified = "",
9477
- language,
9478
- monacoTheme = "vs-dark",
9479
- theme = "dark",
9480
- viewMode: controlledViewMode = "side-by-side",
9481
- showSidebar = true,
9482
- showTabs = true,
9483
- showStatusBar = true,
9484
- sidebarWidth = 220,
9485
- activeFileIndex: controlledIndex = 0,
9486
- onFileSelect,
9487
- onViewModeChange,
9488
- statusBarTitle,
9489
- statusBarStatus,
9490
- className,
9491
- editorOptions
9492
- }, ref) => {
9493
- const [activeIdx, setActiveIdx] = React41__namespace.useState(controlledIndex);
9494
- const [sidebarOpen, setSidebarOpen] = React41__namespace.useState(showSidebar);
9495
- const [viewMode, setViewMode] = React41__namespace.useState(controlledViewMode);
9496
- React41__namespace.useEffect(() => setActiveIdx(controlledIndex), [controlledIndex]);
9497
- React41__namespace.useEffect(() => setViewMode(controlledViewMode), [controlledViewMode]);
9498
- const api = React41__namespace.useMemo(
9499
- () => createDiffViewer({
9500
- files,
9501
- activeFileIndex: activeIdx,
9502
- viewMode,
9503
- theme,
9504
- language,
9505
- sidebarOpen,
9506
- onFileSelect: (i) => {
9507
- setActiveIdx(i);
9508
- onFileSelect?.(i);
9509
- },
9510
- onViewModeChange: (m) => {
9511
- setViewMode(m);
9512
- onViewModeChange?.(m);
9513
- },
9514
- onSidebarToggle: () => setSidebarOpen((s) => !s)
9515
- }),
9516
- [files, activeIdx, viewMode, theme, language, sidebarOpen, onFileSelect, onViewModeChange]
9517
- );
9518
- const activeFile = files[activeIdx];
9519
- const detectedLang = language || (activeFile ? api.getLanguageForFile(activeFile.path) : "plaintext");
9520
- React41__namespace.useEffect(() => {
9521
- function onKey(e) {
9522
- if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
9523
- if (e.key === "j") {
9524
- setActiveIdx((i) => {
9525
- const next = Math.min(i + 1, files.length - 1);
9526
- onFileSelect?.(next);
9527
- return next;
9528
- });
9529
- } else if (e.key === "k") {
9530
- setActiveIdx((i) => {
9531
- const prev = Math.max(i - 1, 0);
9532
- onFileSelect?.(prev);
9533
- return prev;
9534
- });
9535
- } else if (e.key === "b") {
9536
- setSidebarOpen((s) => !s);
9537
- }
9538
- }
9539
- window.addEventListener("keydown", onKey);
9540
- return () => window.removeEventListener("keydown", onKey);
9541
- }, [files.length, onFileSelect]);
9542
- return /* @__PURE__ */ jsxRuntime.jsxs(
9543
- "div",
9544
- {
9545
- ref,
9546
- className: cn(diffViewerVariants({ theme, fullscreen: "true" }), className),
9547
- ...api.ariaProps,
9548
- ...api.dataAttributes,
9549
- children: [
9550
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
9551
- sidebarOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: sidebarVariants2({ theme }), style: { width: sidebarWidth }, children: [
9552
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-2.5 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: [
9553
- "Files (",
9554
- files.length,
9555
- ")"
9556
- ] }),
9557
- files.map((f, i) => {
9558
- const active = i === activeIdx;
9559
- const fname = f.path.split("/").pop() || f.path;
9560
- const dir = f.path.split("/").slice(0, -1).join("/");
9561
- return /* @__PURE__ */ jsxRuntime.jsxs(
9562
- "div",
9563
- {
9564
- onClick: () => {
9565
- setActiveIdx(i);
9566
- onFileSelect?.(i);
9567
- },
9568
- className: sidebarItemVariants2({ active: active ? "true" : "false", theme }),
9569
- children: [
9570
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
9571
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px]", children: api.getFileStatusIcon(f.status) }),
9572
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: active ? "" : "opacity-70", children: fname }),
9573
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ml-auto text-[10px]", children: [
9574
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-green-500", children: [
9575
- "+",
9576
- f.additions
9577
- ] }),
9578
- f.deletions > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-red-500", children: [
9579
- "-",
9580
- f.deletions
9581
- ] })
9582
- ] })
9583
- ] }),
9584
- dir && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] opacity-50 mt-0.5 pl-4", children: dir })
9585
- ]
9586
- },
9587
- f.path
9588
- );
9589
- })
9590
- ] }),
9591
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
9592
- showTabs && activeFile && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tabBarVariants({ theme }), children: files.map((f, i) => {
9593
- const active = i === activeIdx;
9594
- const fname = f.path.split("/").pop() || f.path;
9595
- return /* @__PURE__ */ jsxRuntime.jsxs(
9596
- "div",
9597
- {
9598
- onClick: () => {
9599
- setActiveIdx(i);
9600
- onFileSelect?.(i);
9601
- },
9602
- className: tabVariants({ active: active ? "true" : "false", theme }),
9603
- children: [
9604
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px]", children: api.getFileStatusIcon(f.status) }),
9605
- fname
9606
- ]
9607
- },
9608
- f.path
9609
- );
9610
- }) }),
9611
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(
9612
- React41__namespace.Suspense,
9613
- {
9614
- fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full text-xs opacity-50", children: "Loading editor..." }),
9615
- children: /* @__PURE__ */ jsxRuntime.jsx(
9616
- MonacoDiffEditor,
9617
- {
9618
- original,
9619
- modified,
9620
- language: detectedLang,
9621
- theme: monacoTheme,
9622
- options: {
9623
- readOnly: true,
9624
- renderSideBySide: viewMode === "side-by-side",
9625
- minimap: { enabled: true, scale: 1, showSlider: "mouseover" },
9626
- fontSize: 13,
9627
- lineHeight: 20,
9628
- fontFamily: "'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, monospace",
9629
- fontLigatures: true,
9630
- scrollBeyondLastLine: false,
9631
- renderOverviewRuler: true,
9632
- scrollbar: { verticalScrollbarSize: 10, horizontalScrollbarSize: 10 },
9633
- padding: { top: 8, bottom: 8 },
9634
- renderWhitespace: "selection",
9635
- bracketPairColorization: { enabled: true },
9636
- guides: { indentation: true },
9637
- smoothScrolling: true,
9638
- cursorBlinking: "smooth",
9639
- ...editorOptions
9640
- }
9641
- }
9642
- )
9643
- }
9644
- ) })
9645
- ] })
9646
- ] }),
9647
- showStatusBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: statusBarVariants({ theme }), children: [
9648
- statusBarTitle && /* @__PURE__ */ jsxRuntime.jsx("span", { children: statusBarTitle }),
9649
- activeFile && /* @__PURE__ */ jsxRuntime.jsx("span", { children: activeFile.path }),
9650
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { marginLeft: "auto" }, children: [
9651
- "+",
9652
- api.totalAdditions(),
9653
- " -",
9654
- api.totalDeletions()
9655
- ] }),
9656
- statusBarStatus && /* @__PURE__ */ jsxRuntime.jsx("span", { children: statusBarStatus }),
9657
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
9658
- files.length,
9659
- " ",
9660
- files.length === 1 ? "file" : "files"
9661
- ] })
9662
- ] })
9663
- ]
9664
- }
9665
- );
9666
- }
9667
- );
9668
- DiffViewer.displayName = "DiffViewer";
9669
-
9670
9208
  // ../emoji-picker/dist/index.js
9671
9209
  var EMOJI_DATA = {
9672
9210
  smileys: [
@@ -11875,7 +11413,7 @@ function createThreadView(props) {
11875
11413
  "aria-label": `Message from ${message.author.name}${isOwn ? " (you)" : ""} at ${formatTimestamp(message.timestamp)}`
11876
11414
  };
11877
11415
  }
11878
- function getReplyButtonAriaProps(messageId) {
11416
+ function getReplyButtonAriaProps(_messageId) {
11879
11417
  return {
11880
11418
  role: "button",
11881
11419
  "aria-label": `Reply to message`
@@ -12215,7 +11753,7 @@ var CodeBlock = () => {
12215
11753
  };
12216
11754
 
12217
11755
  // ../link-card/dist/index.js
12218
- function createLinkCard(props = {}) {
11756
+ function createLinkCard(_props = {}) {
12219
11757
  return {
12220
11758
  dataAttributes: { "data-slot": "link-card" }
12221
11759
  };
@@ -12237,7 +11775,7 @@ var LinkCard = React41__namespace.forwardRef(
12237
11775
  LinkCard.displayName = "LinkCard";
12238
11776
 
12239
11777
  // ../card-grid/dist/index.js
12240
- function createCardGrid(props = {}) {
11778
+ function createCardGrid(_props = {}) {
12241
11779
  return {
12242
11780
  dataAttributes: { "data-slot": "card-grid" }
12243
11781
  };
@@ -12321,196 +11859,6 @@ var PaymentButton = React41__namespace.forwardRef(
12321
11859
  );
12322
11860
  PaymentButton.displayName = "PaymentButton";
12323
11861
 
12324
- // ../command-input/dist/index.js
12325
- var CommandInput2 = class {
12326
- state = {
12327
- nodes: [],
12328
- rawText: "",
12329
- cursorPosition: 0,
12330
- activeTrigger: null,
12331
- activeCommandText: null
12332
- };
12333
- options;
12334
- constructor(options) {
12335
- this.options = { ...options };
12336
- }
12337
- handleInput(text, cursorPosition) {
12338
- this.state.rawText = text;
12339
- this.state.cursorPosition = cursorPosition;
12340
- this.parseInput();
12341
- this.notifyStateChange();
12342
- }
12343
- handleKeyDown(key, event) {
12344
- if (this.state.activeTrigger) {
12345
- if (key === "Escape") {
12346
- if (event) event.preventDefault();
12347
- this.state.activeTrigger = null;
12348
- this.state.activeCommandText = null;
12349
- if (this.options.onCommandCancel) {
12350
- this.options.onCommandCancel();
12351
- }
12352
- this.notifyStateChange();
12353
- } else if (key === "Enter") {
12354
- if (event) event.preventDefault();
12355
- const trigger = this.state.activeTrigger;
12356
- const text = this.state.activeCommandText || "";
12357
- this.state.activeTrigger = null;
12358
- this.state.activeCommandText = null;
12359
- if (this.options.onCommandCommit) {
12360
- this.options.onCommandCommit(trigger, text);
12361
- }
12362
- this.notifyStateChange();
12363
- }
12364
- }
12365
- }
12366
- get value() {
12367
- return this.state.nodes;
12368
- }
12369
- getState() {
12370
- return { ...this.state };
12371
- }
12372
- parseInput() {
12373
- const { rawText, cursorPosition } = this.state;
12374
- this.state.activeTrigger = null;
12375
- this.state.activeCommandText = null;
12376
- for (let i = cursorPosition - 1; i >= 0; i--) {
12377
- const char = rawText[i];
12378
- const matchedTrigger = this.options.triggers.find((t) => t.char === char);
12379
- if (matchedTrigger) {
12380
- const isStartOfWord = i === 0 || /\\s/.test(rawText[i - 1]);
12381
- if (isStartOfWord) {
12382
- const commandText = rawText.slice(i + 1, cursorPosition);
12383
- if (!/\\s/.test(commandText)) {
12384
- let isValid = true;
12385
- if (matchedTrigger.pattern) {
12386
- isValid = matchedTrigger.pattern.test(commandText);
12387
- }
12388
- if (isValid) {
12389
- this.state.activeTrigger = matchedTrigger;
12390
- this.state.activeCommandText = commandText;
12391
- if (this.options.onCommandTriggered) {
12392
- this.options.onCommandTriggered(matchedTrigger, commandText);
12393
- }
12394
- }
12395
- }
12396
- }
12397
- break;
12398
- }
12399
- if (/\\s/.test(char)) {
12400
- break;
12401
- }
12402
- }
12403
- const nodes = [];
12404
- if (this.options.triggers.length === 0) {
12405
- nodes.push({ type: "text", text: rawText });
12406
- this.state.nodes = nodes;
12407
- return;
12408
- }
12409
- const triggerChars = this.options.triggers.map((t) => t.char.replace(/[.*+?^\${}()|[\\]\\\\]/g, "\\\\$&"));
12410
- const patternStr = `(^|\\\\s)(${triggerChars.join("|")})([^\\\\s]*)`;
12411
- const regex = new RegExp(patternStr, "g");
12412
- let currentIndex = 0;
12413
- let match;
12414
- while ((match = regex.exec(rawText)) !== null) {
12415
- const precedingWhitespace = match[1];
12416
- const triggerChar = match[2];
12417
- const commandText = match[3];
12418
- const matchStart = match.index;
12419
- const triggerStart = matchStart + precedingWhitespace.length;
12420
- const triggerConfig = this.options.triggers.find((t) => t.char === triggerChar);
12421
- let isValid = true;
12422
- if (triggerConfig?.pattern && commandText.length > 0) {
12423
- isValid = triggerConfig.pattern.test(commandText);
12424
- }
12425
- if (isValid) {
12426
- if (triggerStart > currentIndex) {
12427
- nodes.push({ type: "text", text: rawText.slice(currentIndex, triggerStart) });
12428
- }
12429
- nodes.push({ type: "command", trigger: triggerChar, text: commandText });
12430
- currentIndex = regex.lastIndex;
12431
- }
12432
- }
12433
- if (currentIndex < rawText.length) {
12434
- nodes.push({ type: "text", text: rawText.slice(currentIndex) });
12435
- }
12436
- this.state.nodes = nodes;
12437
- }
12438
- notifyStateChange() {
12439
- if (this.options.onStateChange) {
12440
- this.options.onStateChange({ ...this.state });
12441
- }
12442
- }
12443
- };
12444
- var CommandInput3 = React41.forwardRef(
12445
- ({
12446
- value = "",
12447
- onChange,
12448
- triggers = [],
12449
- renderPopover,
12450
- className,
12451
- ...props
12452
- }, ref) => {
12453
- const localRef = React41.useRef(null);
12454
- const containerRef = ref || localRef;
12455
- const [popoverState, setPopoverState] = React41.useState({
12456
- isOpen: false,
12457
- trigger: "",
12458
- search: "",
12459
- position: { top: 0, left: 0 }
12460
- });
12461
- const coreRef = React41.useRef(null);
12462
- React41.useEffect(() => {
12463
- if (containerRef.current && !coreRef.current) {
12464
- coreRef.current = new CommandInput2({
12465
- triggers,
12466
- onCommandTriggered: (trigger, search) => {
12467
- setPopoverState({
12468
- isOpen: true,
12469
- trigger: trigger.char,
12470
- search,
12471
- position: { top: 0, left: 0 }
12472
- });
12473
- },
12474
- onCommandCancel: () => {
12475
- setPopoverState((prev) => ({ ...prev, isOpen: false }));
12476
- },
12477
- onStateChange: (state) => {
12478
- onChange?.(state.rawText);
12479
- }
12480
- });
12481
- }
12482
- }, [triggers, onChange]);
12483
- React41.useEffect(() => {
12484
- if (containerRef.current && containerRef.current.innerHTML !== value && coreRef.current) {
12485
- containerRef.current.innerHTML = value;
12486
- }
12487
- }, [value]);
12488
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative w-full", className), children: [
12489
- /* @__PURE__ */ jsxRuntime.jsx(
12490
- "div",
12491
- {
12492
- ref: containerRef,
12493
- contentEditable: true,
12494
- suppressContentEditableWarning: true,
12495
- className: "w-full min-h-[40px] p-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500",
12496
- onInput: (e) => {
12497
- coreRef.current?.handleInput(e.currentTarget.textContent || "", 0);
12498
- },
12499
- onKeyDown: (e) => {
12500
- coreRef.current?.handleKeyDown(e.key, e);
12501
- },
12502
- ...props
12503
- }
12504
- ),
12505
- renderPopover && renderPopover({
12506
- ...popoverState,
12507
- close: () => setPopoverState((prev) => ({ ...prev, isOpen: false }))
12508
- })
12509
- ] });
12510
- }
12511
- );
12512
- CommandInput3.displayName = "CommandInput";
12513
-
12514
11862
  exports.Accordion = Accordion;
12515
11863
  exports.AccordionContent = AccordionContent;
12516
11864
  exports.AccordionItem = AccordionItem;
@@ -12552,6 +11900,7 @@ exports.CollapsibleTrigger = CollapsibleTrigger;
12552
11900
  exports.Command = Command;
12553
11901
  exports.CommandEmpty = CommandEmpty;
12554
11902
  exports.CommandGroup = CommandGroup;
11903
+ exports.CommandInput = CommandInput;
12555
11904
  exports.CommandItem = CommandItem;
12556
11905
  exports.CommandList = CommandList;
12557
11906
  exports.CommandSeparator = CommandSeparator;
@@ -12568,7 +11917,6 @@ exports.DialogHeader = DialogHeader;
12568
11917
  exports.DialogOverlay = DialogOverlay;
12569
11918
  exports.DialogTitle = DialogTitle;
12570
11919
  exports.DialogTrigger = DialogTrigger;
12571
- exports.DiffViewer = DiffViewer;
12572
11920
  exports.DropdownMenu = DropdownMenu;
12573
11921
  exports.DropdownMenuContent = DropdownMenuContent;
12574
11922
  exports.DropdownMenuItem = DropdownMenuItem;
@@ -12691,12 +12039,9 @@ exports.commandItemVariants = commandItemVariants;
12691
12039
  exports.commandVariants = commandVariants;
12692
12040
  exports.contentProtectionVariants = contentProtectionVariants;
12693
12041
  exports.controlsVariants = controlsVariants;
12694
- exports.createDiffViewer = createDiffViewer;
12695
12042
  exports.dayVariants = dayVariants;
12696
12043
  exports.deviceFrameVariants = deviceFrameVariants;
12697
12044
  exports.dialogContentVariants = dialogContentVariants;
12698
- exports.diffViewerTokens = diffViewerTokens;
12699
- exports.diffViewerVariants = diffViewerVariants;
12700
12045
  exports.editorVariants = editorVariants;
12701
12046
  exports.emojiPickerContainerStyles = emojiPickerContainerStyles;
12702
12047
  exports.emojiPickerEmojiButtonStyles = emojiPickerEmojiButtonStyles;
@@ -12769,6 +12114,8 @@ exports.selectorVariants = selectorVariants;
12769
12114
  exports.shortcutBadgeStyles = shortcutBadgeStyles;
12770
12115
  exports.shortcutKeyStyles = shortcutKeyStyles;
12771
12116
  exports.shortcutSeparatorStyles = shortcutSeparatorStyles;
12117
+ exports.sidebarItemVariants = sidebarItemVariants;
12118
+ exports.sidebarVariants = sidebarVariants;
12772
12119
  exports.skeletonVariants = skeletonVariants;
12773
12120
  exports.slideTypeBadgeVariants = slideTypeBadgeVariants;
12774
12121
  exports.slideViewerProgressBarVariants = progressBarVariants2;
@@ -12776,7 +12123,6 @@ exports.slideViewerTokens = slideViewerTokens;
12776
12123
  exports.slideViewerVariants = slideViewerVariants;
12777
12124
  exports.statCardVariants = statCardVariants;
12778
12125
  exports.statsGridVariants = statsGridVariants;
12779
- exports.statusBarVariants = statusBarVariants;
12780
12126
  exports.statusContainerStyles = statusContainerStyles;
12781
12127
  exports.statusDotVariants = statusDotVariants;
12782
12128
  exports.statusLabelStyles = statusLabelStyles;
@@ -12784,8 +12130,6 @@ exports.statusPulseVariants = statusPulseVariants;
12784
12130
  exports.switchThumbVariants = switchThumbVariants;
12785
12131
  exports.switchTokens = switchTokens;
12786
12132
  exports.switchVariants = switchVariants;
12787
- exports.tabBarVariants = tabBarVariants;
12788
- exports.tabVariants = tabVariants;
12789
12133
  exports.tableVariants = tableVariants;
12790
12134
  exports.tabsListVariants = tabsListVariants;
12791
12135
  exports.tabsTriggerVariants = tabsTriggerVariants;