1+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
12import { Component , h , Method , Prop , State , Watch } from '@stencil/core' ;
23
34/**
@@ -306,24 +307,24 @@ export class JsonViewer {
306307 < div class = "ml-4" >
307308 < details class = "mb-1" open = { expandedState } onToggle = { toggleExpand } id = { nodeId } >
308309 < summary
309- class = { `list-none relative pl-5 cursor-pointer font-mono flex items-center py-1 rounded group ${
310+ class = { `group relative flex cursor-pointer list-none items-center rounded py-1 pl-5 font-mono ${
310311 this . theme === 'dark' ? 'hover:bg-gray-700' : 'hover:bg-gray-50'
311- } focus:outline-none focus: ring-2 focus:ring-blue-500 focus:ring-offset-1`}
312+ } focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 focus:outline-none `}
312313 onKeyDown = { handleKeyDown }
313314 tabIndex = { 0 }
314315 role = "button"
315316 aria-expanded = { expandedState ? 'true' : 'false' }
316317 aria-controls = { `${ nodeId } -content` }
317318 aria-label = { `${ key } : ${ nodeType } with ${ itemText } , ${ expandedState ? 'click to collapse' : 'click to expand' } ` }
318319 >
319- < div class = "flex items-center w-full" >
320- < span class = { `font-medium mr-2 ${ this . theme === 'dark' ? 'text-blue-400' : 'text-blue-600' } ` } > { key } : </ span >
320+ < div class = "flex w-full items-center " >
321+ < span class = { `mr-2 font-medium ${ this . theme === 'dark' ? 'text-blue-400' : 'text-blue-600' } ` } > { key } : </ span >
321322 < span class = { `flex items-center gap-1 ${ this . theme === 'dark' ? 'text-gray-400' : 'text-gray-500' } ` } >
322323 < span > { isArray ? '[' : '{' } </ span >
323324 < span > { itemText } </ span >
324325 < span > { isArray ? ']' : '}' } </ span >
325326 < span
326- class = { `text-xs ml-2 opacity-0 transition-opacity duration-200 group-hover:opacity-100 ${ this . theme === 'dark' ? 'text-blue-400' : 'text-blue-500' } ` }
327+ class = { `ml-2 text-xs opacity-0 transition-opacity duration-200 group-hover:opacity-100 ${ this . theme === 'dark' ? 'text-blue-400' : 'text-blue-500' } ` }
327328 aria-hidden = "true"
328329 >
329330 { expandedState ? 'Click to collapse' : 'Click to expand' }
@@ -396,7 +397,7 @@ export class JsonViewer {
396397 // Show error if JSON is invalid
397398 if ( this . error ) {
398399 return (
399- < div class = "p-4 text-red-500 text-center " role = "alert" aria-live = "assertive" >
400+ < div class = "p-4 text-center text-red-500 " role = "alert" aria-live = "assertive" >
400401 < p > Invalid JSON: { this . error } </ p >
401402 < slot > </ slot >
402403 </ div >
@@ -406,7 +407,7 @@ export class JsonViewer {
406407 // Show message if no data
407408 if ( ! this . parsedData ) {
408409 return (
409- < div class = "p-4 text-gray-500 text-center " role = "status" aria-live = "polite" >
410+ < div class = "p-4 text-center text-gray-500 " role = "status" aria-live = "polite" >
410411 < p > No data provided</ p >
411412 < slot > </ slot >
412413 </ div >
@@ -423,13 +424,13 @@ export class JsonViewer {
423424
424425 return (
425426 < div
426- class = { `rounded-lg overflow-hidden shadow border ${ this . theme === 'dark' ? 'bg-gray-800 text-gray-50 border-gray-600' : ' bg-white text-gray-800 border-gray-200 '} ` }
427+ class = { `overflow-hidden rounded-lg border shadow ${ this . theme === 'dark' ? 'border-gray-600 bg-gray-800 text-gray-50' : ' border-gray-200 bg-white text-gray-800'} ` }
427428 role = "region"
428429 aria-labelledby = { `${ viewerId } -title` }
429430 >
430- < div class = { `flex justify-between items-center p-3 border-b ${ this . theme === 'dark' ? 'border-gray-600' : 'border-gray-200' } ` } >
431+ < div class = { `flex items-center justify-between border-b p-3 ${ this . theme === 'dark' ? 'border-gray-600' : 'border-gray-200' } ` } >
431432 < div class = "flex items-center gap-2" >
432- < span id = { `${ viewerId } -title` } class = { `font-medium text-sm ${ this . theme === 'dark' ? 'text-gray-200' : 'text-gray-800' } ` } >
433+ < span id = { `${ viewerId } -title` } class = { `text-sm font-medium ${ this . theme === 'dark' ? 'text-gray-200' : 'text-gray-800' } ` } >
433434 JSON Viewer
434435 </ span >
435436 < span class = { `text-xs ${ this . theme === 'dark' ? 'text-gray-400' : 'text-gray-500' } ` } aria-live = "polite" >
@@ -439,11 +440,11 @@ export class JsonViewer {
439440
440441 < button
441442 onClick = { this . toggleView }
442- class = { `flex items-center gap-1 py-1.5 px-3 rounded-md text-xs font-medium cursor-pointer transition-all duration-200 ${
443+ class = { `flex cursor-pointer items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-all duration-200 ${
443444 this . theme === 'dark'
444- ? 'bg-gray-900 border border-gray-600 text -gray-50 hover:bg -gray-700 hover:border-blue-600'
445- : 'bg-gray-100 border border-gray-200 text -gray-800 hover:bg -gray-50 hover:border-blue-400'
446- } focus:outline-none focus: ring-2 focus:ring-blue-500 focus:ring-offset-1`}
445+ ? 'border border-gray-600 bg -gray-900 text -gray-50 hover:border-blue-600 hover:bg-gray-700 '
446+ : 'border border-gray-200 bg -gray-100 text -gray-800 hover:border-blue-400 hover:bg-gray-50 '
447+ } focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 focus:outline-none `}
447448 aria-controls = { contentId }
448449 aria-label = { `Switch to ${ this . currentViewMode === 'tree' ? 'code' : 'tree' } view` }
449450 type = "button"
@@ -462,15 +463,15 @@ export class JsonViewer {
462463 { /* Overlay copy button */ }
463464 < button
464465 onClick = { this . copyToClipboard }
465- class = { `absolute top-2 right-2 z-10 rounded-md transition-all duration-200 p-1 ${
466+ class = { `absolute top-2 right-2 z-10 rounded-md p-1 transition-all duration-200 ${
466467 this . copied
467468 ? this . theme === 'dark'
468469 ? 'bg-green-600 text-white'
469470 : 'bg-green-100 text-green-800'
470471 : this . theme === 'dark'
471- ? 'bg-gray-700 hover:bg -gray-600 text -gray-300 hover:text-white'
472- : 'bg-gray-100 hover:bg -gray-200 text -gray-600 hover:text-gray-800'
473- } opacity-75 hover:opacity-100 focus:outline-none focus: ring-2 focus:ring-blue-500 focus:ring-offset-1`}
472+ ? 'bg-gray-700 text -gray-300 hover:bg -gray-600 hover:text-white'
473+ : 'bg-gray-100 text -gray-600 hover:bg -gray-200 hover:text-gray-800'
474+ } opacity-75 hover:opacity-100 focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 focus:outline-none `}
474475 title = { this . copied ? 'Copied!' : 'Copy JSON to clipboard' }
475476 aria-label = { this . copied ? 'JSON copied to clipboard' : 'Copy JSON to clipboard' }
476477 type = "button"
@@ -488,7 +489,7 @@ export class JsonViewer {
488489 stroke-width = "2"
489490 stroke-linecap = "round"
490491 stroke-linejoin = "round"
491- class = "w -4 h -4"
492+ class = "h -4 w -4"
492493 aria-hidden = "true"
493494 >
494495 < title > Check mark</ title >
@@ -503,7 +504,7 @@ export class JsonViewer {
503504 stroke-width = "2"
504505 stroke-linecap = "round"
505506 stroke-linejoin = "round"
506- class = "w -4 h -4"
507+ class = "h -4 w -4"
507508 aria-hidden = "true"
508509 >
509510 < title > Copy icon</ title >
@@ -524,26 +525,26 @@ export class JsonViewer {
524525
525526 { /* Code View */ }
526527 { this . currentViewMode === 'code' && (
527- < div class = { `font-mono text-sm pr-12 ${ this . theme === 'dark' ? '' : 'bg-gray-50' } ` } >
528+ < div class = { `pr-12 font-mono text-sm ${ this . theme === 'dark' ? '' : 'bg-gray-50' } ` } >
528529 { this . showLineNumbers ? (
529530 < div class = "flex" >
530531 < div
531- class = { `py-4 px-2 text-right border-r select-none ${ this . theme === 'dark' ? 'border-gray-600 text -gray-400 bg -gray-900 ' : 'border-gray-200 text -gray-500 bg -gray-100 ' } ` }
532+ class = { `border-r px-2 py-4 text-right select-none ${ this . theme === 'dark' ? 'border-gray-600 bg -gray-900 text -gray-400 ' : 'border-gray-200 bg -gray-100 text -gray-500 ' } ` }
532533 >
533534 { formattedJson . split ( '\n' ) . map ( ( _ , i ) => (
534535 < div class = "min-h-5" key = { `line-${ i } ` } >
535536 { i + 1 }
536537 </ div >
537538 ) ) }
538539 </ div >
539- < pre class = { `p-4 whitespace-pre-wrap flex-grow overflow-x-auto ${ this . theme === 'dark' ? 'text-gray-200' : 'text-gray-800' } ` } >
540+ < pre class = { `flex-grow overflow-x-auto p-4 whitespace-pre-wrap ${ this . theme === 'dark' ? 'text-gray-200' : 'text-gray-800' } ` } >
540541 { formattedJson . split ( '\n' ) . map ( ( line , i ) => (
541542 < div class = "min-h-5" key = { `code-${ i } ` } innerHTML = { this . formatCodeLine ( line ) } />
542543 ) ) }
543544 </ pre >
544545 </ div >
545546 ) : (
546- < pre class = "p-4 whitespace-pre-wrap flex-grow overflow-x-auto" >
547+ < pre class = "flex-grow overflow-x-auto p-4 whitespace-pre-wrap " >
547548 { formattedJson . split ( '\n' ) . map ( ( line , i ) => (
548549 < div class = "min-h-5" key = { `code-${ i } ` } innerHTML = { this . formatCodeLine ( line ) } />
549550 ) ) }
0 commit comments