690 lines
13 KiB
TypeScript
690 lines
13 KiB
TypeScript
import { css } from '@design.estate/dees-element';
|
|
|
|
/**
|
|
* Shared component styles for geo components
|
|
*/
|
|
export const geoComponentStyles = css`
|
|
:host {
|
|
display: block;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:host([hidden]) {
|
|
display: none;
|
|
}
|
|
|
|
*,
|
|
*::before,
|
|
*::after {
|
|
box-sizing: inherit;
|
|
}
|
|
`;
|
|
|
|
/**
|
|
* Map container styles
|
|
*/
|
|
export const mapContainerStyles = css`
|
|
.map-container {
|
|
position: relative;
|
|
width: 100%;
|
|
height: 100%;
|
|
min-height: 300px;
|
|
overflow: hidden;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.map-wrapper {
|
|
position: absolute;
|
|
inset: 0;
|
|
}
|
|
`;
|
|
|
|
/**
|
|
* Toolbar styles
|
|
*/
|
|
export const toolbarStyles = css`
|
|
.toolbar {
|
|
position: absolute;
|
|
top: 12px;
|
|
left: 12px;
|
|
z-index: 10;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
padding: 8px;
|
|
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.9));
|
|
border: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(8px);
|
|
-webkit-backdrop-filter: blur(8px);
|
|
}
|
|
|
|
.toolbar-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.toolbar-divider {
|
|
height: 1px;
|
|
margin: 4px 0;
|
|
background: var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
|
|
}
|
|
|
|
.tool-button {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 36px;
|
|
height: 36px;
|
|
padding: 0;
|
|
border: none;
|
|
border-radius: 6px;
|
|
background: transparent;
|
|
color: var(--geo-text, #fff);
|
|
cursor: pointer;
|
|
transition: background-color 0.15s ease, color 0.15s ease;
|
|
}
|
|
|
|
.tool-button:hover {
|
|
background: var(--geo-tool-hover, rgba(255, 255, 255, 0.1));
|
|
}
|
|
|
|
.tool-button.active {
|
|
background: var(--geo-tool-active, #0084ff);
|
|
color: #fff;
|
|
}
|
|
|
|
.tool-button svg {
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.tool-button:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
`;
|
|
|
|
/**
|
|
* Search styles for address search functionality
|
|
*/
|
|
export const searchStyles = css`
|
|
.search-container {
|
|
position: absolute;
|
|
top: 12px;
|
|
right: 12px;
|
|
z-index: 10;
|
|
width: 280px;
|
|
}
|
|
|
|
.search-input-wrapper {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.9));
|
|
border: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(8px);
|
|
-webkit-backdrop-filter: blur(8px);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.search-input-wrapper:focus-within {
|
|
border-color: var(--geo-tool-active, #0084ff);
|
|
}
|
|
|
|
.search-icon {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 36px;
|
|
height: 36px;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.search-icon svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
|
|
.search-input {
|
|
flex: 1;
|
|
height: 36px;
|
|
padding: 0 12px 0 0;
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--geo-text, #fff);
|
|
font-size: 13px;
|
|
font-family: inherit;
|
|
outline: none;
|
|
}
|
|
|
|
.search-input::placeholder {
|
|
color: rgba(255, 255, 255, 0.4);
|
|
}
|
|
|
|
.search-spinner {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 36px;
|
|
height: 36px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.search-spinner svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
from { transform: rotate(0deg); }
|
|
to { transform: rotate(360deg); }
|
|
}
|
|
|
|
.search-clear {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 28px;
|
|
height: 28px;
|
|
margin-right: 4px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
transition: background-color 0.15s ease, color 0.15s ease;
|
|
}
|
|
|
|
.search-clear:hover {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: rgba(255, 255, 255, 0.8);
|
|
}
|
|
|
|
.search-clear svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
.search-results {
|
|
position: absolute;
|
|
top: calc(100% + 4px);
|
|
left: 0;
|
|
right: 0;
|
|
max-height: 300px;
|
|
overflow-y: auto;
|
|
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.95));
|
|
border: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(8px);
|
|
-webkit-backdrop-filter: blur(8px);
|
|
}
|
|
|
|
.search-results:empty {
|
|
display: none;
|
|
}
|
|
|
|
.search-result {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
padding: 10px 12px;
|
|
cursor: pointer;
|
|
transition: background-color 0.1s ease;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.search-result:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.search-result:hover,
|
|
.search-result.highlighted {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.search-result-name {
|
|
font-size: 13px;
|
|
color: var(--geo-text, #fff);
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.search-result-type {
|
|
font-size: 11px;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
text-transform: capitalize;
|
|
}
|
|
|
|
.search-no-results {
|
|
padding: 12px;
|
|
text-align: center;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
font-size: 13px;
|
|
}
|
|
`;
|
|
|
|
/**
|
|
* Navigation panel styles for A-to-B routing
|
|
*/
|
|
export const navigationStyles = css`
|
|
.navigation-panel {
|
|
position: absolute;
|
|
top: 12px;
|
|
left: 60px;
|
|
z-index: 10;
|
|
width: 300px;
|
|
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.95));
|
|
border: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
|
|
border-radius: 8px;
|
|
backdrop-filter: blur(8px);
|
|
-webkit-backdrop-filter: blur(8px);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.nav-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 12px;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.nav-header-icon {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 24px;
|
|
height: 24px;
|
|
color: var(--geo-tool-active, #0084ff);
|
|
}
|
|
|
|
.nav-header-icon svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
|
|
.nav-header-title {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--geo-text, #fff);
|
|
}
|
|
|
|
.nav-mode-selector {
|
|
display: flex;
|
|
gap: 4px;
|
|
padding: 8px 12px;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.nav-mode-btn {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 4px;
|
|
padding: 8px 12px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
background: transparent;
|
|
color: rgba(255, 255, 255, 0.6);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
transition: background-color 0.15s ease, color 0.15s ease;
|
|
}
|
|
|
|
.nav-mode-btn:hover {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: rgba(255, 255, 255, 0.9);
|
|
}
|
|
|
|
.nav-mode-btn.active {
|
|
background: var(--geo-tool-active, #0084ff);
|
|
color: #fff;
|
|
}
|
|
|
|
.nav-mode-btn svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
|
|
.nav-inputs {
|
|
padding: 12px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.nav-input-group {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.nav-input-marker {
|
|
width: 12px;
|
|
height: 12px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.nav-input-marker.start {
|
|
background: #22c55e;
|
|
box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
|
|
}
|
|
|
|
.nav-input-marker.end {
|
|
background: #ef4444;
|
|
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
|
|
}
|
|
|
|
.nav-input-wrapper {
|
|
flex: 1;
|
|
position: relative;
|
|
}
|
|
|
|
.nav-input {
|
|
width: 100%;
|
|
height: 36px;
|
|
padding: 0 36px 0 12px;
|
|
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
border-radius: 6px;
|
|
background: rgba(0, 0, 0, 0.2);
|
|
color: var(--geo-text, #fff);
|
|
font-size: 13px;
|
|
font-family: inherit;
|
|
outline: none;
|
|
transition: border-color 0.15s ease;
|
|
}
|
|
|
|
.nav-input:focus {
|
|
border-color: var(--geo-tool-active, #0084ff);
|
|
}
|
|
|
|
.nav-input::placeholder {
|
|
color: rgba(255, 255, 255, 0.4);
|
|
}
|
|
|
|
.nav-input.has-value {
|
|
padding-right: 60px;
|
|
}
|
|
|
|
.nav-set-map-btn {
|
|
position: absolute;
|
|
right: 4px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 28px;
|
|
height: 28px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
cursor: pointer;
|
|
transition: background-color 0.15s ease, color 0.15s ease;
|
|
}
|
|
|
|
.nav-set-map-btn:hover {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: rgba(255, 255, 255, 0.9);
|
|
}
|
|
|
|
.nav-set-map-btn.active {
|
|
background: var(--geo-tool-active, #0084ff);
|
|
color: #fff;
|
|
}
|
|
|
|
.nav-set-map-btn svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
.nav-input-clear {
|
|
position: absolute;
|
|
right: 32px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 24px;
|
|
height: 24px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: rgba(255, 255, 255, 0.4);
|
|
cursor: pointer;
|
|
transition: color 0.15s ease;
|
|
}
|
|
|
|
.nav-input-clear:hover {
|
|
color: rgba(255, 255, 255, 0.8);
|
|
}
|
|
|
|
.nav-input-clear svg {
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
.nav-search-results {
|
|
position: absolute;
|
|
top: calc(100% + 4px);
|
|
left: 0;
|
|
right: 0;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
background: var(--geo-toolbar-bg, rgba(30, 30, 30, 0.98));
|
|
border: 1px solid var(--geo-toolbar-border, rgba(255, 255, 255, 0.1));
|
|
border-radius: 6px;
|
|
z-index: 100;
|
|
}
|
|
|
|
.nav-search-result {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
padding: 8px 12px;
|
|
cursor: pointer;
|
|
transition: background-color 0.1s ease;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.nav-search-result:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.nav-search-result:hover,
|
|
.nav-search-result.highlighted {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.nav-search-result-name {
|
|
font-size: 12px;
|
|
color: var(--geo-text, #fff);
|
|
line-height: 1.3;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.nav-search-result-type {
|
|
font-size: 10px;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
text-transform: capitalize;
|
|
}
|
|
|
|
.nav-actions {
|
|
display: flex;
|
|
gap: 8px;
|
|
padding: 0 12px 12px;
|
|
}
|
|
|
|
.nav-action-btn {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 6px;
|
|
padding: 10px 16px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background-color 0.15s ease, opacity 0.15s ease;
|
|
}
|
|
|
|
.nav-action-btn.primary {
|
|
background: var(--geo-tool-active, #0084ff);
|
|
color: #fff;
|
|
}
|
|
|
|
.nav-action-btn.primary:hover:not(:disabled) {
|
|
background: #0073e6;
|
|
}
|
|
|
|
.nav-action-btn.primary:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.nav-action-btn.secondary {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: rgba(255, 255, 255, 0.8);
|
|
}
|
|
|
|
.nav-action-btn.secondary:hover {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
}
|
|
|
|
.nav-action-btn svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
|
|
.nav-summary {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 16px;
|
|
padding: 12px;
|
|
background: rgba(0, 132, 255, 0.1);
|
|
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.nav-summary-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
color: var(--geo-text, #fff);
|
|
}
|
|
|
|
.nav-summary-item svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
color: var(--geo-tool-active, #0084ff);
|
|
}
|
|
|
|
.nav-steps {
|
|
max-height: 250px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.nav-step {
|
|
display: flex;
|
|
gap: 12px;
|
|
padding: 10px 12px;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
transition: background-color 0.15s ease;
|
|
}
|
|
|
|
.nav-step:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.nav-step:hover {
|
|
background: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.nav-step-icon {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 28px;
|
|
height: 28px;
|
|
border-radius: 6px;
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: rgba(255, 255, 255, 0.8);
|
|
font-size: 14px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.nav-step-content {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.nav-step-instruction {
|
|
font-size: 13px;
|
|
color: var(--geo-text, #fff);
|
|
line-height: 1.4;
|
|
margin-bottom: 2px;
|
|
}
|
|
|
|
.nav-step-distance {
|
|
font-size: 11px;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
}
|
|
|
|
.nav-error {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 10px 12px;
|
|
background: rgba(239, 68, 68, 0.15);
|
|
border-top: 1px solid rgba(239, 68, 68, 0.3);
|
|
color: #fca5a5;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.nav-error svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.nav-loading {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
padding: 16px;
|
|
color: rgba(255, 255, 255, 0.6);
|
|
font-size: 13px;
|
|
}
|
|
|
|
.nav-loading svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
.nav-empty-steps {
|
|
padding: 16px 12px;
|
|
text-align: center;
|
|
color: rgba(255, 255, 255, 0.5);
|
|
font-size: 12px;
|
|
}
|
|
`;
|