UNPKG

file-surf

Version:

A React package that extends Monaco Editor with VS Code-like file explorer capabilities, allowing users to navigate through multiple files and folders with a familiar interface

919 lines 22.5 kB
/*! tailwindcss v4.0.14 | MIT License | https://tailwindcss.com */ .pointer-events-auto { pointer-events: auto; } .absolute { position: absolute; } .fixed { position: fixed; } .relative { position: relative; } .z-\[100\] { z-index: 100; } .container { width: 100%; } .container { margin-inline: auto; padding-inline: 2rem; @media (width >= 1400px) { max-width: 1400px; } } .flex { display: flex; } .grid { display: grid; } .inline-flex { display: inline-flex; } .h-\[2\.5rem\] { height: 2.5rem; } .h-\[2\.6rem\] { height: 2.6rem; } .h-full { height: 100%; } .h-screen { height: 100vh; } .max-h-screen { max-height: 100vh; } .w-full { width: 100%; } .max-w-\[150px\] { max-width: 150px; } .flex-1 { flex: 1; } .flex-shrink-0 { flex-shrink: 0; } .shrink-0 { flex-shrink: 0; } .flex-grow { flex-grow: 1; } .transform { transform: var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y); } .cursor-col-resize { cursor: col-resize; } .cursor-pointer { cursor: pointer; } .flex-col { flex-direction: column; } .flex-col-reverse { flex-direction: column-reverse; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .overflow-hidden { overflow: hidden; } .rounded-md { border-radius: calc(var(--radius) - 2px); } .border { border-style: var(--tw-border-style); border-width: 1px; } .border-b { border-bottom-style: var(--tw-border-style); border-bottom-width: 1px; } .border-destructive { border-color: hsl(var(--destructive)); } .border-explorer-border { border-color: #313244; } .border-input { border-color: hsl(var(--input)); } .bg-background { background-color: hsl(var(--background)); } .bg-destructive { background-color: hsl(var(--destructive)); } .bg-editor-background { background-color: #1E1E2E; } .bg-explorer-background { background-color: #131921; } .bg-primary { background-color: hsl(var(--primary)); } .bg-secondary { background-color: hsl(var(--secondary)); } .bg-transparent { background-color: transparent; } .text-center { text-align: center; } .whitespace-nowrap { white-space: nowrap; } .text-destructive-foreground { color: hsl(var(--destructive-foreground)); } .text-explorer-foreground { color: #A6ADC8; } .text-foreground { color: hsl(var(--foreground)); } .text-foreground\/50 { color: color-mix(in oklab, hsl(var(--foreground)) 50%, transparent); } .text-primary { color: hsl(var(--primary)); } .text-primary-foreground { color: hsl(var(--primary-foreground)); } .text-secondary-foreground { color: hsl(var(--secondary-foreground)); } .uppercase { text-transform: uppercase; } .underline-offset-4 { text-underline-offset: 4px; } .accent-foreground { accent-color: hsl(var(--foreground)); } .opacity-0 { opacity: 0%; } .opacity-50 { opacity: 50%; } .opacity-90 { opacity: 90%; } .ring { --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentColor); box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } .ring-offset-background { --tw-ring-offset-color: hsl(var(--background)); } .outline { outline-style: var(--tw-outline-style); outline-width: 1px; } .transition-all { transition-property: all; transition-timing-function: var(--tw-ease, ease); transition-duration: var(--tw-duration, 0s); } .transition-colors { transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to; transition-timing-function: var(--tw-ease, ease); transition-duration: var(--tw-duration, 0s); } .transition-opacity { transition-property: opacity; transition-timing-function: var(--tw-ease, ease); transition-duration: var(--tw-duration, 0s); } .duration-200 { --tw-duration: 200ms; transition-duration: 200ms; } .select-none { -webkit-user-select: none; user-select: none; } .duration-200 { animation-duration: 200ms; } .ease-in-out { animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); } .ease-out { animation-timing-function: cubic-bezier(0, 0, 0.2, 1); } .fade-in { --tw-enter-opacity: 0; } .fade-out { --tw-exit-opacity: 0; } .group-hover\:opacity-100 { &:is(:where(.group):hover *) { @media (hover: hover) { opacity: 100%; } } } .group-\[\.destructive\]\:border-muted\/40 { &:is(:where(.group):is(.destructive) *) { border-color: color-mix(in oklab, hsl(var(--muted)) 40%, transparent); } } .group-\[\.toast\]\:bg-muted { &:is(:where(.group):is(.toast) *) { background-color: hsl(var(--muted)); } } .group-\[\.toast\]\:bg-primary { &:is(:where(.group):is(.toast) *) { background-color: hsl(var(--primary)); } } .group-\[\.toast\]\:text-muted-foreground { &:is(:where(.group):is(.toast) *) { color: hsl(var(--muted-foreground)); } } .group-\[\.toast\]\:text-primary-foreground { &:is(:where(.group):is(.toast) *) { color: hsl(var(--primary-foreground)); } } .group-\[\.toaster\]\:border-border { &:is(:where(.group):is(.toaster) *) { border-color: hsl(var(--border)); } } .group-\[\.toaster\]\:bg-background { &:is(:where(.group):is(.toaster) *) { background-color: hsl(var(--background)); } } .group-\[\.toaster\]\:text-foreground { &:is(:where(.group):is(.toaster) *) { color: hsl(var(--foreground)); } } .hover\:bg-accent { &:hover { @media (hover: hover) { background-color: hsl(var(--accent)); } } } .hover\:bg-destructive\/90 { &:hover { @media (hover: hover) { background-color: color-mix(in oklab, hsl(var(--destructive)) 90%, transparent); } } } .hover\:bg-primary\/90 { &:hover { @media (hover: hover) { background-color: color-mix(in oklab, hsl(var(--primary)) 90%, transparent); } } } .hover\:bg-secondary { &:hover { @media (hover: hover) { background-color: hsl(var(--secondary)); } } } .hover\:bg-secondary\/80 { &:hover { @media (hover: hover) { background-color: color-mix(in oklab, hsl(var(--secondary)) 80%, transparent); } } } .hover\:bg-secondary\/90 { &:hover { @media (hover: hover) { background-color: color-mix(in oklab, hsl(var(--secondary)) 90%, transparent); } } } .hover\:text-accent-foreground { &:hover { @media (hover: hover) { color: hsl(var(--accent-foreground)); } } } .hover\:text-foreground { &:hover { @media (hover: hover) { color: hsl(var(--foreground)); } } } .hover\:underline { &:hover { @media (hover: hover) { text-decoration-line: underline; } } } .group-\[\.destructive\]\:hover\:border-destructive\/30 { &:is(:where(.group):is(.destructive) *) { &:hover { @media (hover: hover) { border-color: color-mix(in oklab, hsl(var(--destructive)) 30%, transparent); } } } } .group-\[\.destructive\]\:hover\:bg-destructive { &:is(:where(.group):is(.destructive) *) { &:hover { @media (hover: hover) { background-color: hsl(var(--destructive)); } } } } .group-\[\.destructive\]\:hover\:text-destructive-foreground { &:is(:where(.group):is(.destructive) *) { &:hover { @media (hover: hover) { color: hsl(var(--destructive-foreground)); } } } } .focus\:opacity-100 { &:focus { opacity: 100%; } } .focus\:ring-2 { &:focus { --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentColor); box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } } .focus\:ring-ring { &:focus { --tw-ring-color: hsl(var(--ring)); } } .focus\:ring-offset-2 { &:focus { --tw-ring-offset-width: 2px; --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); } } .focus\:outline-none { &:focus { --tw-outline-style: none; outline-style: none; } } .group-\[\.destructive\]\:focus\:ring-destructive { &:is(:where(.group):is(.destructive) *) { &:focus { --tw-ring-color: hsl(var(--destructive)); } } } .focus-visible\:ring-2 { &:focus-visible { --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentColor); box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } } .focus-visible\:ring-ring { &:focus-visible { --tw-ring-color: hsl(var(--ring)); } } .focus-visible\:ring-offset-2 { &:focus-visible { --tw-ring-offset-width: 2px; --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); } } .focus-visible\:outline-none { &:focus-visible { --tw-outline-style: none; outline-style: none; } } .disabled\:pointer-events-none { &:disabled { pointer-events: none; } } .disabled\:opacity-50 { &:disabled { opacity: 50%; } } .data-\[state\=closed\]\:animate-out { &[data-state="closed"] { animation-name: exit; animation-duration: undefined; --tw-exit-opacity: initial; --tw-exit-scale: initial; --tw-exit-rotate: initial; --tw-exit-translate-x: initial; --tw-exit-translate-y: initial; } } .data-\[state\=closed\]\:fade-out-80 { &[data-state="closed"] { --tw-exit-opacity: 0.8; } } .data-\[state\=closed\]\:slide-out-to-right-full { &[data-state="closed"] { --tw-exit-translate-x: 100%; } } .data-\[state\=open\]\:animate-in { &[data-state="open"] { animation-name: enter; animation-duration: undefined; --tw-enter-opacity: initial; --tw-enter-scale: initial; --tw-enter-rotate: initial; --tw-enter-translate-x: initial; --tw-enter-translate-y: initial; } } .data-\[state\=open\]\:slide-in-from-top-full { &[data-state="open"] { --tw-enter-translate-y: -100%; } } .data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\] { &[data-swipe="end"] { --tw-translate-x: var(--radix-toast-swipe-end-x); translate: var(--tw-translate-x) var(--tw-translate-y); } } .data-\[swipe\=end\]\:animate-out { &[data-swipe="end"] { animation-name: exit; animation-duration: undefined; --tw-exit-opacity: initial; --tw-exit-scale: initial; --tw-exit-rotate: initial; --tw-exit-translate-x: initial; --tw-exit-translate-y: initial; } } .data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\] { &[data-swipe="move"] { --tw-translate-x: var(--radix-toast-swipe-move-x); translate: var(--tw-translate-x) var(--tw-translate-y); } } .data-\[swipe\=move\]\:transition-none { &[data-swipe="move"] { transition-property: none; } } .\[\&_svg\]\:pointer-events-none { & svg { pointer-events: none; } } .\[\&_svg\]\:shrink-0 { & svg { flex-shrink: 0; } } @layer base { :root { --background: 225 29% 7%; --foreground: 210 40% 98%; --card: 222.2 84% 4.9%; --card-foreground: 210 40% 98%; --popover: 222.2 84% 4.9%; --popover-foreground: 210 40% 98%; --primary: 217 91.2% 59.8%; --primary-foreground: 210 40% 98%; --secondary: 217.2 32.6% 17.5%; --secondary-foreground: 210 40% 98%; --muted: 217.2 32.6% 17.5%; --muted-foreground: 215 20.2% 65.1%; --accent: 217.2 32.6% 17.5%; --accent-foreground: 210 40% 98%; --destructive: 0 62.8% 30.6%; --destructive-foreground: 210 40% 98%; --border: 217.2 32.6% 17.5%; --input: 217.2 32.6% 17.5%; --ring: 212.7 26.8% 83.9%; --radius: 0.5rem; --sidebar-background: 223 24% 10%; --sidebar-foreground: 240 4.8% 95.9%; --sidebar-primary: 224.3 76.3% 48%; --sidebar-primary-foreground: 0 0% 100%; --sidebar-accent: 240 3.7% 15.9%; --sidebar-accent-foreground: 240 4.8% 95.9%; --sidebar-border: 240 3.7% 15.9%; --sidebar-ring: 217.2 91.2% 59.8%; } } .file-explorer { overflow: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "ss01", "ss02", "cv01", "cv02", "cv03"; } @layer utilities { .scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; } .scrollbar-none::-webkit-scrollbar { display: none; } .glass-morphism { border-style: var(--tw-border-style); border-width: 1px; --tw-shadow: 0 4px 12px -2px var(--tw-shadow-color, rgba(0, 0, 0, 0.3)); box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); --tw-backdrop-blur: blur(24px); -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); background-color: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); } .neo-blur { border-style: var(--tw-border-style); border-width: 1px; --tw-backdrop-blur: blur(40px); -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); background-color: rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.1); } .text-gradient { background-clip: text; color: transparent; background: linear-gradient(to bottom right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7)); } .text-gradient-primary { --tw-gradient-position: to bottom right in oklab; background-image: linear-gradient(var(--tw-gradient-stops)); --tw-gradient-from: hsl(var(--primary)); --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position)); --tw-gradient-via: color-mix(in oklab, hsl(var(--primary)) 80%, transparent); --tw-gradient-via-stops: var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-via-stops); --tw-gradient-to: color-mix(in oklab, hsl(var(--primary)) 60%, transparent); --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position)); background-clip: text; color: transparent; } } .file-explorer .resize-handle { cursor: col-resize; background-color: #313244; transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to; transition-timing-function: var(--tw-ease, ease); transition-duration: var(--tw-duration, 0s); &:hover { @media (hover: hover) { background-color: color-mix(in oklab, hsl(var(--primary)) 50%, transparent); } } width: 0.25rem; } .file-explorer { overflow: hidden; background-color: #131921; color: #A6ADC8; } .file-explorer .file-tree { height: 100%; overflow-x: hidden; overflow-y: auto; padding-left: 0.5rem; } .file-explorer .file-item { display: flex; cursor: pointer; align-items: center; transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to; transition-timing-function: var(--tw-ease, ease); transition-duration: var(--tw-duration, 0s); &:hover { @media (hover: hover) { background-color: rgba(73, 77, 100, 0.3); } } padding: 0.25rem 0.5rem; border-radius: 0.25rem; } .file-explorer .file-item.active { background-color: #1E1E2E; color: rgb(255, 255, 255); } .file-explorer .file-icon { flex-shrink: 0; color: #6C7086; margin-right: 0.25rem; } .file-explorer .monaco-editor-container { height: 100%; width: 100%; overflow: hidden; text-align: left; } .file-explorer .tabs-container { display: flex; flex-wrap: nowrap; overflow-x: auto; border-bottom-style: var(--tw-border-style); border-bottom-width: 1px; border-color: #313244; background-color: #181825; } .file-explorer .tab { display: flex; flex-shrink: 0; align-items: center; border-right-style: var(--tw-border-style); border-right-width: 1px; border-color: #313244; color: #A6ADC8; padding: 0.5rem 0.75rem; font-size: 0.875rem; user-select: none; } .file-explorer .tab.active { background-color: #1E1E2E; color: rgb(255, 255, 255); } .file-explorer .tab-close { opacity: 50%; transition-property: opacity; transition-timing-function: var(--tw-ease, ease); transition-duration: var(--tw-duration, 0s); &:hover { @media (hover: hover) { opacity: 100%; } } margin-left: 0.5rem; } .tab-close { display: flex; align-items: center; justify-content: center; padding: 0.2em 0.4em; } .file-explorer .editor-container { display: flex; height: 100%; width: 100%; flex-direction: column; } .file-explorer .highlight-animation { animation: highlight 1s ease-in-out; } @keyframes highlight { 0% { background-color: transparent; } 50% { background-color: rgba(156, 220, 254, 0.3); } 100% { background-color: transparent; } } @keyframes enter { from { opacity: var(--tw-enter-opacity, 1); transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0)); } } @keyframes exit { to { opacity: var(--tw-exit-opacity, 1); transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0)); } } @property --tw-rotate-x { syntax: "*"; inherits: false; initial-value: rotateX(0); } @property --tw-rotate-y { syntax: "*"; inherits: false; initial-value: rotateY(0); } @property --tw-rotate-z { syntax: "*"; inherits: false; initial-value: rotateZ(0); } @property --tw-skew-x { syntax: "*"; inherits: false; initial-value: skewX(0); } @property --tw-skew-y { syntax: "*"; inherits: false; initial-value: skewY(0); } @property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; } @property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; } @property --tw-shadow-color { syntax: "*"; inherits: false; } @property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; } @property --tw-inset-shadow-color { syntax: "*"; inherits: false; } @property --tw-ring-color { syntax: "*"; inherits: false; } @property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; } @property --tw-inset-ring-color { syntax: "*"; inherits: false; } @property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; } @property --tw-ring-inset { syntax: "*"; inherits: false; } @property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; } @property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; } @property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; } @property --tw-outline-style { syntax: "*"; inherits: false; initial-value: solid; } @property --tw-duration { syntax: "*"; inherits: false; } @property --tw-translate-x { syntax: "*"; inherits: false; initial-value: 0; } @property --tw-translate-y { syntax: "*"; inherits: false; initial-value: 0; } @property --tw-translate-z { syntax: "*"; inherits: false; initial-value: 0; } @property --tw-backdrop-blur { syntax: "*"; inherits: false; } @property --tw-backdrop-brightness { syntax: "*"; inherits: false; } @property --tw-backdrop-contrast { syntax: "*"; inherits: false; } @property --tw-backdrop-grayscale { syntax: "*"; inherits: false; } @property --tw-backdrop-hue-rotate { syntax: "*"; inherits: false; } @property --tw-backdrop-invert { syntax: "*"; inherits: false; } @property --tw-backdrop-opacity { syntax: "*"; inherits: false; } @property --tw-backdrop-saturate { syntax: "*"; inherits: false; } @property --tw-backdrop-sepia { syntax: "*"; inherits: false; } @property --tw-gradient-position { syntax: "*"; inherits: false; } @property --tw-gradient-from { syntax: "<color>"; inherits: false; initial-value: #0000; } @property --tw-gradient-via { syntax: "<color>"; inherits: false; initial-value: #0000; } @property --tw-gradient-to { syntax: "<color>"; inherits: false; initial-value: #0000; } @property --tw-gradient-stops { syntax: "*"; inherits: false; } @property --tw-gradient-via-stops { syntax: "*"; inherits: false; } @property --tw-gradient-from-position { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; } @property --tw-gradient-via-position { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; } @property --tw-gradient-to-position { syntax: "<length-percentage>"; inherits: false; initial-value: 100%; }