Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 14d87bff2e | |||
| 0182174153 | |||
| 6f8c4518ce |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jmespath-playground",
|
"name": "jmespath-playground",
|
||||||
"version": "1.0.1",
|
"version": "1.0.4",
|
||||||
"description": "A React-based web application for testing JMESPath expressions against JSON data",
|
"description": "A React-based web application for testing JMESPath expressions against JSON data",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
465
src/App.css
465
src/App.css
@@ -1,13 +1,64 @@
|
|||||||
/* JMESPath Testing Tool Custom Styles */
|
/* JMESPath Testing Tool Custom Styles */
|
||||||
|
|
||||||
|
:root {
|
||||||
|
/* Light theme colors */
|
||||||
|
--bg-primary-light: #ffffff;
|
||||||
|
--bg-secondary-light: #f8f9fa;
|
||||||
|
--text-primary-light: #212529;
|
||||||
|
--text-secondary-light: #495057;
|
||||||
|
--text-muted-light: #6c757d;
|
||||||
|
--border-light: #dee2e6;
|
||||||
|
--border-input-light: #ced4da;
|
||||||
|
--accent-color: #007bff;
|
||||||
|
--accent-shadow: rgba(0, 123, 255, 0.25);
|
||||||
|
|
||||||
|
/* Dark theme colors */
|
||||||
|
--bg-primary-dark: #1a1a1a;
|
||||||
|
--bg-secondary-dark: #2d2d2d;
|
||||||
|
--bg-card-dark: #323232;
|
||||||
|
--text-primary-dark: #ffffff;
|
||||||
|
--text-secondary-dark: #e9ecef;
|
||||||
|
--text-muted-dark: #adb5bd;
|
||||||
|
--border-dark: #495057;
|
||||||
|
--border-input-dark: #6c757d;
|
||||||
|
|
||||||
|
/* State colors */
|
||||||
|
--success-bg-light: #d4edda;
|
||||||
|
--success-border-light: #c3e6cb;
|
||||||
|
--success-text-light: #155724;
|
||||||
|
--success-bg-dark: #1e4a1e;
|
||||||
|
--success-border-dark: #2c6d2c;
|
||||||
|
--success-text-dark: #d4edda;
|
||||||
|
|
||||||
|
--error-bg-light: #f8d7da;
|
||||||
|
--error-border-light: #f5c6cb;
|
||||||
|
--error-text-light: #721c24;
|
||||||
|
--error-bg-dark: #4a1e1e;
|
||||||
|
--error-border-dark: #6d2c2c;
|
||||||
|
--error-text-dark: #f8d7da;
|
||||||
|
|
||||||
|
/* Button variants */
|
||||||
|
--btn-success: #28a745;
|
||||||
|
--btn-info: #17a2b8;
|
||||||
|
--btn-primary: #007bff;
|
||||||
|
--btn-danger: #dc3545;
|
||||||
|
--btn-secondary: #6c757d;
|
||||||
|
|
||||||
|
/* Common transitions */
|
||||||
|
--transition-fast: 0.2s ease;
|
||||||
|
--transition-normal: 0.3s ease;
|
||||||
|
|
||||||
|
/* Font families */
|
||||||
|
--font-sans: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
--font-mono: 'Noto Sans Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
/* Base font family */
|
/* Base font family */
|
||||||
body {
|
body {
|
||||||
font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
font-family: var(--font-sans);
|
||||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
||||||
sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
transition: background-color 0.3s ease, color 0.3s ease;
|
transition: background-color var(--transition-normal), color var(--transition-normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Layout structure */
|
/* Layout structure */
|
||||||
@@ -38,31 +89,31 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Input and textarea styling */
|
/* Input and textarea styling */
|
||||||
|
.jmespath-input, .json-input, .result-output {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-weight: 400;
|
||||||
|
transition: background-color var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal);
|
||||||
|
}
|
||||||
|
|
||||||
.jmespath-input {
|
.jmespath-input {
|
||||||
font-family: 'Noto Sans Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
font-weight: 400;
|
background-color: var(--bg-primary-light);
|
||||||
background-color: #ffffff;
|
border: 1px solid var(--border-input-light);
|
||||||
border: 1px solid #ced4da;
|
color: var(--text-secondary-light);
|
||||||
color: #495057;
|
|
||||||
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.json-input, .result-output {
|
.json-input, .result-output {
|
||||||
font-family: 'Noto Sans Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
background-color: #f8f9fa;
|
background-color: var(--bg-secondary-light);
|
||||||
border: 1px solid #dee2e6;
|
border: 1px solid var(--border-light);
|
||||||
color: #495057;
|
color: var(--text-secondary-light);
|
||||||
font-weight: 400;
|
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Button styling */
|
/* Button styling */
|
||||||
.btn {
|
.btn {
|
||||||
transition: all 0.2s ease;
|
transition: all var(--transition-fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn:hover {
|
.btn:hover {
|
||||||
@@ -75,12 +126,12 @@ footer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
footer a {
|
footer a {
|
||||||
color: #6c757d;
|
color: var(--text-muted-light);
|
||||||
transition: color 0.2s ease;
|
transition: color var(--transition-fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
footer a:hover {
|
footer a:hover {
|
||||||
color: #495057;
|
color: var(--text-secondary-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Responsive adjustments */
|
/* Responsive adjustments */
|
||||||
@@ -132,9 +183,9 @@ footer a:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .jmespath-input {
|
.theme-light .jmespath-input {
|
||||||
background-color: #ffffff !important;
|
background-color: #ffffff;
|
||||||
border: 1px solid #ced4da !important;
|
border: 1px solid #ced4da;
|
||||||
color: #495057 !important;
|
color: #495057;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .json-input,
|
.theme-light .json-input,
|
||||||
@@ -144,32 +195,47 @@ footer a:hover {
|
|||||||
color: #495057 !important;
|
color: #495057 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Success and Error state overrides - must come after base input rules */
|
||||||
|
.theme-light .jmespath-input.success {
|
||||||
|
background-color: #d4edda !important;
|
||||||
|
border-color: #c3e6cb !important;
|
||||||
|
color: #155724 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .jmespath-input.error {
|
||||||
|
background-color: #f8d7da !important;
|
||||||
|
border-color: #f5c6cb !important;
|
||||||
|
color: #721c24 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.theme-light .text-muted {
|
.theme-light .text-muted {
|
||||||
color: #6c757d !important;
|
color: #6c757d !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .jmespath-input:focus {
|
.theme-light .jmespath-input:focus {
|
||||||
background-color: #ffffff !important;
|
border-color: var(--accent-color);
|
||||||
border-color: #007bff !important;
|
box-shadow: 0 0 0 0.2rem var(--accent-shadow);
|
||||||
color: #495057 !important;
|
|
||||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .jmespath-input::placeholder {
|
.theme-light .jmespath-input::placeholder {
|
||||||
color: #6c757d !important;
|
color: var(--text-muted-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .json-input::placeholder,
|
.theme-light .json-input::placeholder,
|
||||||
.theme-light .result-output::placeholder {
|
.theme-light .result-output::placeholder {
|
||||||
color: #6c757d !important;
|
color: var(--text-muted-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .json-input:focus,
|
.theme-light .json-input:focus,
|
||||||
.theme-light .result-output:focus {
|
.theme-light .result-output:focus {
|
||||||
background-color: #ffffff !important;
|
background-color: var(--bg-primary-light) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--accent-color) !important;
|
||||||
color: #495057 !important;
|
color: var(--text-secondary-light) !important;
|
||||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
|
box-shadow: 0 0 0 0.2rem var(--accent-shadow) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .output-section .form-control {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .alert-danger {
|
.theme-light .alert-danger {
|
||||||
@@ -178,65 +244,71 @@ footer a:hover {
|
|||||||
color: #721c24 !important;
|
color: #721c24 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.theme-light .alert-success {
|
||||||
|
background-color: #d4edda !important;
|
||||||
|
border-color: #c3e6cb !important;
|
||||||
|
color: #155724 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.theme-light .btn-primary {
|
.theme-light .btn-primary {
|
||||||
background-color: #007bff !important;
|
background-color: var(--btn-primary) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--btn-primary) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-secondary {
|
.theme-light .btn-outline-secondary {
|
||||||
color: #6c757d !important;
|
color: var(--btn-secondary) !important;
|
||||||
border-color: #6c757d !important;
|
border-color: var(--btn-secondary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-secondary:hover {
|
.theme-light .btn-outline-secondary:hover {
|
||||||
background-color: #6c757d !important;
|
background-color: var(--btn-secondary) !important;
|
||||||
border-color: #6c757d !important;
|
border-color: var(--btn-secondary) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-success {
|
.theme-light .btn-outline-success {
|
||||||
color: #28a745 !important;
|
color: var(--btn-success) !important;
|
||||||
border-color: #28a745 !important;
|
border-color: var(--btn-success) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-success:hover {
|
.theme-light .btn-outline-success:hover {
|
||||||
background-color: #28a745 !important;
|
background-color: var(--btn-success) !important;
|
||||||
border-color: #28a745 !important;
|
border-color: var(--btn-success) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-info {
|
.theme-light .btn-outline-info {
|
||||||
color: #17a2b8 !important;
|
color: var(--btn-info) !important;
|
||||||
border-color: #17a2b8 !important;
|
border-color: var(--btn-info) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-info:hover {
|
.theme-light .btn-outline-info:hover {
|
||||||
background-color: #17a2b8 !important;
|
background-color: var(--btn-info) !important;
|
||||||
border-color: #17a2b8 !important;
|
border-color: var(--btn-info) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-primary {
|
.theme-light .btn-outline-primary {
|
||||||
color: #007bff !important;
|
color: var(--btn-primary) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--btn-primary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-primary:hover {
|
.theme-light .btn-outline-primary:hover {
|
||||||
background-color: #007bff !important;
|
background-color: var(--btn-primary) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--btn-primary) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-danger {
|
.theme-light .btn-outline-danger {
|
||||||
color: #dc3545 !important;
|
color: var(--btn-danger) !important;
|
||||||
border-color: #dc3545 !important;
|
border-color: var(--btn-danger) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .btn-outline-danger:hover {
|
.theme-light .btn-outline-danger:hover {
|
||||||
background-color: #dc3545 !important;
|
background-color: var(--btn-danger) !important;
|
||||||
border-color: #dc3545 !important;
|
border-color: var(--btn-danger) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light footer {
|
.theme-light footer {
|
||||||
@@ -255,60 +327,75 @@ footer a:hover {
|
|||||||
|
|
||||||
/* Force dark theme regardless of system preference */
|
/* Force dark theme regardless of system preference */
|
||||||
.theme-dark {
|
.theme-dark {
|
||||||
background-color: #1a1a1a !important;
|
background-color: var(--bg-primary-dark) !important;
|
||||||
color: #e9ecef !important;
|
color: var(--text-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .header-section {
|
.theme-dark .header-section {
|
||||||
background-color: #2d2d2d !important;
|
background-color: var(--bg-secondary-dark) !important;
|
||||||
border-bottom: 1px solid #404040 !important;
|
border-bottom: 1px solid #404040 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .card {
|
.theme-dark .card {
|
||||||
background-color: #2d2d2d !important;
|
background-color: var(--bg-secondary-dark) !important;
|
||||||
box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
|
box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
|
||||||
color: #e9ecef !important;
|
color: var(--text-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .card-header {
|
.theme-dark .card-header {
|
||||||
background-color: #3a3a3a !important;
|
background-color: var(--bg-card-dark) !important;
|
||||||
border-bottom: 2px solid #505050 !important;
|
border-bottom: 2px solid #505050 !important;
|
||||||
color: #f8f9fa !important;
|
color: var(--text-primary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .jmespath-input {
|
.theme-dark .jmespath-input {
|
||||||
background-color: #3a3a3a !important;
|
background-color: var(--bg-card-dark);
|
||||||
border: 1px solid #505050 !important;
|
border: 1px solid #505050;
|
||||||
color: #f8f9fa !important;
|
color: var(--text-primary-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Success and Error state overrides - must come after base input rules */
|
||||||
|
.theme-dark .jmespath-input.success {
|
||||||
|
background-color: #1e4a1e !important;
|
||||||
|
border-color: #2c6d2c !important;
|
||||||
|
color: #d4edda !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark .jmespath-input.error {
|
||||||
|
background-color: #4a1e1e !important;
|
||||||
|
border-color: #6d2c2c !important;
|
||||||
|
color: #f8d7da !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .jmespath-input::placeholder {
|
.theme-dark .jmespath-input::placeholder {
|
||||||
color: #adb5bd !important;
|
color: var(--text-muted-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .jmespath-input:focus {
|
.theme-dark .jmespath-input:focus {
|
||||||
background-color: #404040 !important;
|
border-color: var(--accent-color);
|
||||||
border-color: #007bff !important;
|
|
||||||
color: #ffffff !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .json-input,
|
.theme-dark .json-input,
|
||||||
.theme-dark .result-output {
|
.theme-dark .result-output {
|
||||||
background-color: #2a2a2a !important;
|
background-color: #2a2a2a !important;
|
||||||
border: 1px solid #505050 !important;
|
border: 1px solid #505050 !important;
|
||||||
color: #e9ecef !important;
|
color: var(--text-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .json-input::placeholder,
|
.theme-dark .json-input::placeholder,
|
||||||
.theme-dark .result-output::placeholder {
|
.theme-dark .result-output::placeholder {
|
||||||
color: #6c757d !important;
|
color: var(--text-muted-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .json-input:focus,
|
.theme-dark .json-input:focus,
|
||||||
.theme-dark .result-output:focus {
|
.theme-dark .result-output:focus {
|
||||||
background-color: #323232 !important;
|
background-color: var(--bg-card-dark) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--accent-color) !important;
|
||||||
color: #ffffff !important;
|
color: var(--text-primary-dark) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark .output-section .form-control {
|
||||||
|
background-color: var(--bg-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .alert-danger {
|
.theme-dark .alert-danger {
|
||||||
@@ -317,181 +404,201 @@ footer a:hover {
|
|||||||
color: #f8d7da !important;
|
color: #f8d7da !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.theme-dark .alert-success {
|
||||||
|
background-color: #1e4a1e !important;
|
||||||
|
border-color: #2c6d2c !important;
|
||||||
|
color: #d4edda !important;
|
||||||
|
}
|
||||||
|
|
||||||
.theme-dark .text-muted {
|
.theme-dark .text-muted {
|
||||||
color: #adb5bd !important;
|
color: var(--text-muted-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark footer {
|
.theme-dark footer {
|
||||||
background-color: #2d2d2d !important;
|
background-color: var(--bg-secondary-dark) !important;
|
||||||
border-top: 1px solid #404040 !important;
|
border-top: 1px solid #404040 !important;
|
||||||
color: #e9ecef !important;
|
color: var(--text-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark footer a {
|
.theme-dark footer a {
|
||||||
color: #adb5bd !important;
|
color: var(--text-muted-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark footer a:hover {
|
.theme-dark footer a:hover {
|
||||||
color: #e9ecef !important;
|
color: var(--text-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-primary {
|
.theme-dark .btn-primary {
|
||||||
background-color: #007bff !important;
|
background-color: var(--btn-primary) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--btn-primary) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-secondary {
|
.theme-dark .btn-outline-secondary {
|
||||||
color: #6c757d !important;
|
color: var(--btn-secondary) !important;
|
||||||
border-color: #6c757d !important;
|
border-color: var(--btn-secondary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-secondary:hover {
|
.theme-dark .btn-outline-secondary:hover {
|
||||||
background-color: #6c757d !important;
|
background-color: var(--btn-secondary) !important;
|
||||||
border-color: #6c757d !important;
|
border-color: var(--btn-secondary) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-success {
|
.theme-dark .btn-outline-success {
|
||||||
color: #28a745 !important;
|
color: var(--btn-success) !important;
|
||||||
border-color: #28a745 !important;
|
border-color: var(--btn-success) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-success:hover {
|
.theme-dark .btn-outline-success:hover {
|
||||||
background-color: #28a745 !important;
|
background-color: var(--btn-success) !important;
|
||||||
border-color: #28a745 !important;
|
border-color: var(--btn-success) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-info {
|
.theme-dark .btn-outline-info {
|
||||||
color: #17a2b8 !important;
|
color: var(--btn-info) !important;
|
||||||
border-color: #17a2b8 !important;
|
border-color: var(--btn-info) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-info:hover {
|
.theme-dark .btn-outline-info:hover {
|
||||||
background-color: #17a2b8 !important;
|
background-color: var(--btn-info) !important;
|
||||||
border-color: #17a2b8 !important;
|
border-color: var(--btn-info) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-primary {
|
.theme-dark .btn-outline-primary {
|
||||||
color: #007bff !important;
|
color: var(--btn-primary) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--btn-primary) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-primary:hover {
|
.theme-dark .btn-outline-primary:hover {
|
||||||
background-color: #007bff !important;
|
background-color: var(--btn-primary) !important;
|
||||||
border-color: #007bff !important;
|
border-color: var(--btn-primary) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-danger {
|
.theme-dark .btn-outline-danger {
|
||||||
color: #dc3545 !important;
|
color: var(--btn-danger) !important;
|
||||||
border-color: #dc3545 !important;
|
border-color: var(--btn-danger) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-dark .btn-outline-danger:hover {
|
.theme-dark .btn-outline-danger:hover {
|
||||||
background-color: #dc3545 !important;
|
background-color: var(--btn-danger) !important;
|
||||||
border-color: #dc3545 !important;
|
border-color: var(--btn-danger) !important;
|
||||||
color: #ffffff !important;
|
color: var(--bg-primary-light) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dark mode support */
|
/* Dark mode support */
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
body {
|
body:not(.theme-light):not(.theme-dark) {
|
||||||
background-color: #1a1a1a;
|
background-color: var(--bg-primary-dark);
|
||||||
color: #e9ecef;
|
color: var(--text-secondary-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-section {
|
body:not(.theme-light):not(.theme-dark) .header-section {
|
||||||
background-color: #2d2d2d;
|
background-color: var(--bg-secondary-dark);
|
||||||
border-bottom: 1px solid #404040;
|
border-bottom: 1px solid var(--border-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
body:not(.theme-light):not(.theme-dark) .card {
|
||||||
background-color: #2d2d2d;
|
background-color: var(--bg-secondary-dark);
|
||||||
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
||||||
color: #e9ecef;
|
color: var(--text-secondary-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header {
|
body:not(.theme-light):not(.theme-dark) .card-header {
|
||||||
background-color: #3a3a3a;
|
background-color: var(--bg-card-dark);
|
||||||
border-bottom: 2px solid #505050;
|
border-bottom: 2px solid var(--border-dark);
|
||||||
color: #f8f9fa;
|
color: var(--text-primary-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.jmespath-input {
|
body:not(.theme-light):not(.theme-dark) .jmespath-input {
|
||||||
background-color: #3a3a3a;
|
background-color: var(--bg-card-dark) !important;
|
||||||
border: 1px solid #505050;
|
border: 1px solid var(--border-input-dark) !important;
|
||||||
color: #f8f9fa;
|
color: var(--text-primary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jmespath-input::placeholder {
|
body:not(.theme-light):not(.theme-dark) .jmespath-input.success {
|
||||||
color: #adb5bd;
|
background-color: var(--success-bg-dark) !important;
|
||||||
|
border-color: var(--success-border-dark) !important;
|
||||||
|
color: var(--success-text-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jmespath-input:focus {
|
body:not(.theme-light):not(.theme-dark) .jmespath-input.error {
|
||||||
background-color: #404040;
|
background-color: var(--error-bg-dark) !important;
|
||||||
border-color: #007bff;
|
border-color: var(--error-border-dark) !important;
|
||||||
color: #ffffff;
|
color: var(--error-text-dark) !important;
|
||||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.json-input, .result-output {
|
body:not(.theme-light):not(.theme-dark) .jmespath-input::placeholder {
|
||||||
|
color: var(--text-muted-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
body:not(.theme-light):not(.theme-dark) .jmespath-input:focus {
|
||||||
|
border-color: var(--accent-color);
|
||||||
|
box-shadow: 0 0 0 0.2rem var(--accent-shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
body:not(.theme-light):not(.theme-dark) .json-input,
|
||||||
|
body:not(.theme-light):not(.theme-dark) .result-output {
|
||||||
background-color: #2a2a2a;
|
background-color: #2a2a2a;
|
||||||
border: 1px solid #505050;
|
border: 1px solid var(--border-input-dark);
|
||||||
color: #e9ecef;
|
color: var(--text-secondary-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.json-input::placeholder, .result-output::placeholder {
|
body:not(.theme-light):not(.theme-dark) .json-input::placeholder,
|
||||||
color: #6c757d;
|
body:not(.theme-light):not(.theme-dark) .result-output::placeholder {
|
||||||
|
color: var(--text-muted-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.json-input:focus, .result-output:focus {
|
body:not(.theme-light):not(.theme-dark) .json-input:focus,
|
||||||
|
body:not(.theme-light):not(.theme-dark) .result-output:focus {
|
||||||
background-color: #323232;
|
background-color: #323232;
|
||||||
border-color: #007bff;
|
border-color: var(--accent-color);
|
||||||
color: #ffffff;
|
color: var(--text-primary-dark);
|
||||||
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
|
box-shadow: 0 0 0 0.2rem var(--accent-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-danger {
|
body:not(.theme-light):not(.theme-dark) .alert-danger {
|
||||||
background-color: #3d1a1a;
|
background-color: var(--error-bg-dark);
|
||||||
border-color: #dc3545;
|
border-color: var(--error-border-dark);
|
||||||
color: #f8d7da;
|
color: var(--error-text-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-muted {
|
body:not(.theme-light):not(.theme-dark) .alert-success {
|
||||||
color: #adb5bd !important;
|
background-color: var(--success-bg-dark);
|
||||||
|
border-color: var(--success-border-dark);
|
||||||
|
color: var(--success-text-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
body:not(.theme-light):not(.theme-dark) .text-muted {
|
||||||
background-color: #2d2d2d !important;
|
color: var(--text-muted-dark) !important;
|
||||||
border-top: 1px solid #404040 !important;
|
|
||||||
color: #e9ecef;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
footer .text-muted {
|
body:not(.theme-light):not(.theme-dark) footer.bg-light {
|
||||||
color: #adb5bd !important;
|
background-color: var(--bg-secondary-dark) !important;
|
||||||
|
border-top: 1px solid var(--border-dark) !important;
|
||||||
|
color: var(--text-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer a {
|
body:not(.theme-light):not(.theme-dark) footer .text-muted {
|
||||||
color: #adb5bd;
|
color: var(--text-muted-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer a:hover {
|
body:not(.theme-light):not(.theme-dark) footer a {
|
||||||
color: #e9ecef;
|
color: var(--text-muted-dark) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
body:not(.theme-light):not(.theme-dark) footer a:hover {
|
||||||
|
color: var(--text-secondary-dark) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bootstrap dark mode overrides */
|
/* Bootstrap dark mode overrides */
|
||||||
.btn-outline-success {
|
body:not(.theme-light):not(.theme-dark) .btn-outline-success {
|
||||||
color: #28a745;
|
color: var(--btn-success);
|
||||||
border-color: #28a745;
|
border-color: var(--btn-success);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-success:hover {
|
body:not(.theme-light):not(.theme-dark) .btn-outline-success:hover {
|
||||||
background-color: #28a745;
|
background-color: var(--btn-success);
|
||||||
border-color: #28a745;
|
border-color: var(--btn-success);
|
||||||
color: #fff;
|
color: var(--bg-primary-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-info {
|
.btn-outline-info {
|
||||||
@@ -523,18 +630,18 @@ footer a:hover {
|
|||||||
|
|
||||||
.btn-outline-secondary:hover {
|
.btn-outline-secondary:hover {
|
||||||
background-color: #6c757d;
|
background-color: #6c757d;
|
||||||
border-color: #6c757d;
|
border-color: var(--btn-secondary);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-danger {
|
.btn-outline-danger {
|
||||||
color: #dc3545;
|
color: var(--btn-danger);
|
||||||
border-color: #dc3545;
|
border-color: var(--btn-danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-outline-danger:hover {
|
.btn-outline-danger:hover {
|
||||||
background-color: #dc3545;
|
background-color: var(--btn-danger);
|
||||||
border-color: #dc3545;
|
border-color: var(--btn-danger);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
23
src/App.js
23
src/App.js
@@ -1,5 +1,6 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import jmespath from 'jmespath';
|
import jmespath from 'jmespath';
|
||||||
|
import packageJson from '../package.json';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
|
|
||||||
// JMESPath Testing Tool - Main Application Component
|
// JMESPath Testing Tool - Main Application Component
|
||||||
@@ -33,12 +34,16 @@ function App() {
|
|||||||
// Apply theme to document
|
// Apply theme to document
|
||||||
const applyTheme = (selectedTheme) => {
|
const applyTheme = (selectedTheme) => {
|
||||||
const root = document.documentElement;
|
const root = document.documentElement;
|
||||||
root.className = ''; // Clear existing theme classes
|
const body = document.body;
|
||||||
|
|
||||||
|
// Clear existing theme classes from both html and body
|
||||||
|
root.className = '';
|
||||||
|
body.classList.remove('theme-light', 'theme-dark');
|
||||||
|
|
||||||
if (selectedTheme === 'light') {
|
if (selectedTheme === 'light') {
|
||||||
root.classList.add('theme-light');
|
body.classList.add('theme-light');
|
||||||
} else if (selectedTheme === 'dark') {
|
} else if (selectedTheme === 'dark') {
|
||||||
root.classList.add('theme-dark');
|
body.classList.add('theme-dark');
|
||||||
}
|
}
|
||||||
// 'auto' uses CSS media queries (no class needed)
|
// 'auto' uses CSS media queries (no class needed)
|
||||||
};
|
};
|
||||||
@@ -310,16 +315,14 @@ function App() {
|
|||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className={`form-control jmespath-input ${error ? 'error' : ''}`}
|
className={`form-control jmespath-input ${error ? 'error' : 'success'}`}
|
||||||
value={jmespathExpression}
|
value={jmespathExpression}
|
||||||
onChange={handleJmespathChange}
|
onChange={handleJmespathChange}
|
||||||
placeholder="Enter JMESPath expression (e.g., people[*].name)"
|
placeholder="Enter JMESPath expression (e.g., people[*].name)"
|
||||||
/>
|
/>
|
||||||
{error && (
|
<div className={`alert mt-2 mb-0 ${error ? 'alert-danger' : 'alert-success'}`}>
|
||||||
<div className="alert alert-danger mt-2 mb-0">
|
<small>{error || 'Expression is correct'}</small>
|
||||||
<small>{error}</small>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -386,12 +389,12 @@ function App() {
|
|||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-md-6">
|
<div className="col-md-6">
|
||||||
<p className="mb-0 text-muted small">
|
<p className="mb-0 text-muted small">
|
||||||
<strong>JMESPath Testing Tool</strong> - Created for testing and validating JMESPath expressions
|
<strong>JMESPath Testing Tool</strong> v{packageJson.version} - Created for testing and validating JMESPath expressions
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-md-6 text-md-end">
|
<div className="col-md-6 text-md-end">
|
||||||
<p className="mb-0 text-muted small">
|
<p className="mb-0 text-muted small">
|
||||||
Licensed under <a href="#" className="text-decoration-none">MIT License</a> |
|
Licensed under <a href="https://opensource.org/licenses/MIT" target="_blank" rel="noopener noreferrer" className="text-decoration-none">MIT License</a> |
|
||||||
<a href="https://jmespath.org/" target="_blank" rel="noopener noreferrer" className="text-decoration-none ms-2">
|
<a href="https://jmespath.org/" target="_blank" rel="noopener noreferrer" className="text-decoration-none ms-2">
|
||||||
Learn JMESPath
|
Learn JMESPath
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
||||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
||||||
sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
background-color: #f8f9fa;
|
background-color: #f8f9fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,8 +27,6 @@ code {
|
|||||||
|
|
||||||
.form-control {
|
.form-control {
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-section .form-control {
|
.input-section .form-control {
|
||||||
@@ -48,27 +41,15 @@ code {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.error {
|
.error {
|
||||||
background-color: #f8d7da !important;
|
background-color: var(--error-bg-light) !important;
|
||||||
border-color: #f5c6cb !important;
|
border-color: var(--error-border-light) !important;
|
||||||
color: #721c24;
|
color: var(--error-text-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
.success {
|
.success {
|
||||||
background-color: #d4edda !important;
|
background-color: var(--success-bg-light) !important;
|
||||||
border-color: #c3e6cb !important;
|
border-color: var(--success-border-light) !important;
|
||||||
color: #155724;
|
color: var(--success-text-light);
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-success:hover {
|
|
||||||
background-color: #28a745;
|
|
||||||
border-color: #28a745;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-outline-info:hover {
|
|
||||||
background-color: #17a2b8;
|
|
||||||
border-color: #17a2b8;
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-section {
|
.header-section {
|
||||||
@@ -78,39 +59,49 @@ code {
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.jmespath-input {
|
|
||||||
background-color: #fff3cd;
|
|
||||||
border-color: #ffeaa7;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.json-input {
|
|
||||||
background-color: #e8f5e8;
|
|
||||||
border-color: #c3e6cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
.result-output {
|
|
||||||
background-color: #e7f3ff;
|
|
||||||
border-color: #b3d7ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dark mode support for error states */
|
/* Dark mode support for error states */
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
.error {
|
.error {
|
||||||
background-color: #4a1e1e !important;
|
background-color: var(--error-bg-dark) !important;
|
||||||
border-color: #6d2c2c !important;
|
border-color: var(--error-border-dark) !important;
|
||||||
color: #f8d7da !important;
|
color: var(--error-text-dark) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Manual theme overrides for error states */
|
/* Manual theme overrides for error states */
|
||||||
.theme-dark .error {
|
.theme-dark .error {
|
||||||
|
background-color: var(--error-bg-dark) !important;
|
||||||
|
border-color: var(--error-border-dark) !important;
|
||||||
|
color: var(--error-text-dark) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .error {
|
||||||
|
background-color: var(--error-bg-light) !important;
|
||||||
|
border-color: var(--error-border-light) !important;
|
||||||
|
color: var(--error-text-light) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Manual theme overrides for success states */
|
||||||
|
.theme-dark .success {
|
||||||
|
background-color: var(--success-bg-dark) !important;
|
||||||
|
border-color: var(--success-border-dark) !important;
|
||||||
|
color: var(--success-text-dark) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .success {
|
||||||
|
background-color: var(--success-bg-light) !important;
|
||||||
|
border-color: var(--success-border-light) !important;
|
||||||
|
color: var(--success-text-light) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Additional specificity for jmespath-input with error class */
|
||||||
|
.theme-dark .jmespath-input.error {
|
||||||
background-color: #4a1e1e !important;
|
background-color: #4a1e1e !important;
|
||||||
border-color: #6d2c2c !important;
|
border-color: #6d2c2c !important;
|
||||||
color: #f8d7da !important;
|
color: #f8d7da !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-light .error {
|
.theme-light .jmespath-input.error {
|
||||||
background-color: #f8d7da !important;
|
background-color: #f8d7da !important;
|
||||||
border-color: #f5c6cb !important;
|
border-color: #f5c6cb !important;
|
||||||
color: #721c24 !important;
|
color: #721c24 !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user