UNPKG

@metricinsights/concierge

Version:

Metric Insights Concierge Component

757 lines (726 loc) 16.2 kB
@charset "UTF-8"; @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .action-badge, .query-info { display: block; position: relative; padding: 5px 0; max-height: 1000px; } .action-badge__title, .query-info__title { font-family: "Custom Font", Arial, Helvetica, sans-serif; font-size: 12px; font-weight: 600; line-height: 18px; letter-spacing: 0; text-align: left; color: #37809F; } .action-badge .read-more-target, .query-info .read-more-target { opacity: 0; max-height: 0; font-size: 0; font-family: "Custom Font", Arial, Helvetica, sans-serif; font-weight: 400; line-height: 18px; letter-spacing: 0; text-align: left; color: #666666; transition: 0.25s ease; } .action-badge .read-more-trigger, .query-info .read-more-trigger { display: inline-block; padding: 0; text-decoration: underline; font-family: "Custom Font", Arial, Helvetica, sans-serif; font-size: 11px; font-weight: 400; line-height: 18px; letter-spacing: 0; color: #37809F; cursor: pointer; } .action-badge__title, .query-info__title { padding-bottom: 2px; } .action-badge .read-more-state, .query-info .read-more-state { display: none; } .action-badge .read-more-state ~ .read-more-wrap .read-more-trigger:before, .query-info .read-more-state ~ .read-more-wrap .read-more-trigger:before { content: "Show more"; } .action-badge .read-more-state:checked ~ .read-more-wrap .read-more-trigger:before, .query-info .read-more-state:checked ~ .read-more-wrap .read-more-trigger:before { content: "Show less"; transition: 0.25s ease; } .action-badge .read-more-state:checked ~ .read-more-wrap .read-more-target, .query-info .read-more-state:checked ~ .read-more-wrap .read-more-target { opacity: 1; font-size: 12px; max-height: 999em; } .action-badge .action-badge-body, .query-info .action-badge-body { padding-left: 0; margin-top: -5px; } .action-badge-body, .query-info-body { display: block; padding-left: 30px; } .action-badge:last-child::before, .query-info:last-child::before { content: ""; display: block; position: absolute; width: 15px; height: 15px; border: 2px solid #37809F; border-radius: 50%; border-top-color: transparent; right: 10px; top: calc(50% - 7.5px); animation: spin 1s linear infinite; } .only-one-badge .action-badge:not(:last-child) { border: 0; max-height: 0; margin: 0; padding: 0; overflow: hidden; } .action-badge .read-more-wrap { display: none; } .query-info { margin-bottom: 0; z-index: 1000; } .query-info.show { padding-top: 10px; border-top: 1px solid #EEEEEE; border-radius: 0; } .query-info .action-badge__title { display: none; } .query-info::before { display: none !important; } .query-info .read-more-target { font-size: 12px; padding-left: 54px; } .query-info .read-more-target.show { opacity: 1; font-size: 12px; max-height: 999em; } .query-info .read-more-wrap { text-align: center; margin-left: -54px; margin-right: -74px; } .query-info .read-more-trigger { position: relative; opacity: 0; transition: max-height 0.3s ease, opacity 0.3s ease !important; margin-bottom: 0; width: 100%; left: 0; right: 0; cursor: pointer; } .query-info .read-more-trigger::before { content: "Show Search Request" !important; transition: 0.25s ease; } .query-info .read-more-trigger.show::before { content: "Hide Search Request" !important; transition: 0.25s ease; } .message.assistant:hover .query-info .read-more-trigger { opacity: 1; visibility: visible; } .concierge-toggle { position: fixed; z-index: 1001; width: 48px; height: 48px; border-radius: 50%; background-color: #2563eb; color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; } .concierge-toggle:hover { transform: scale(1.05); background-color: #1e40af; } .concierge-toggle.bottom-right { bottom: 20px; right: 20px; } .concierge-toggle.bottom-left { bottom: 20px; left: 20px; } .concierge-toggle.top-right { top: 20px; right: 20px; } .concierge-toggle.top-left { top: 20px; left: 20px; } .concierge-toggle svg { width: 24px; height: 24px; fill: currentColor; } .concierge-send-button { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; background-color: #2563eb; color: white; cursor: pointer; border-radius: 4px; transition: all 0.3s ease; padding: 0; position: relative; } .concierge-send-button:hover:not(:disabled) { background-color: #1e40af; transform: scale(1.05); } .concierge-send-button:disabled { opacity: 0.5; cursor: not-allowed; } .concierge-send-button:focus { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3); } .concierge-send-button .concierge-loading-spinner { position: absolute; width: 30px; height: 30px; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: white; animation: spin 1s linear infinite; } .concierge-send-button .concierge-stop-icon { opacity: 0; animation: fadeIn 0.2s ease forwards; } .concierge-send-button svg { width: 20px; height: 20px; fill: currentColor; } @keyframes spin { to { transform: rotate(360deg); } } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } .dark .concierge-send-button { background-color: #1e40af; color: #f3f4f6; } .dark .concierge-send-button:hover:not(:disabled) { background-color: #2563eb; } .dark .concierge-send-button:focus { box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.3); } .dark .concierge-send-button svg { fill: #f3f4f6; } .concierge-close { display: flex; align-items: center; justify-content: center; padding: 6px; margin: 0; border: none; border-radius: 50%; background: transparent; cursor: pointer; color: #1f2937; transition: opacity 0.2s, background-color 0.2s, box-shadow 0.2s; align-self: center; } .concierge-close:hover, .concierge-close:focus-visible { opacity: 0.85; background-color: #ffffff; box-shadow: 0 0 0 2px rgb(177.1428571429, 199.2857142857, 247.8571428571); outline: none; } .concierge-close:active { opacity: 0.7; background-color: hsl(0, 0%, 105%); } .concierge-close svg { width: 24px; height: 24px; pointer-events: none; } .dark .concierge-close { color: #f3f4f6; } .dark .concierge-close:hover, .dark .concierge-close:focus-visible { background-color: #1f2937; box-shadow: 0 0 0 2px rgb(16.4285714286, 67.3571428571, 179.0714285714); } .dark .concierge-close:active { background-color: rgb(21.8081395349, 28.8430232558, 38.6918604651); } .concierge-new-chat-button { width: 100%; padding: 8px; margin-top: 8px; background: none; border: none; color: #1e40af; font-size: 14px; cursor: pointer; text-decoration: underline; transition: color 0.2s ease; } .concierge-new-chat-button:hover { color: #2563eb; background-color: unset; } .dark .concierge-new-chat-button { color: #f3f4f6; } .dark .concierge-new-chat-button:hover { color: #2563eb; background-color: unset; } .concierge-loading { padding: 0.75rem 1rem; text-align: center; color: rgba(0, 0, 0, 0.5); font-size: 0.875rem; } .concierge-loading { display: flex; align-items: center; justify-content: center; padding: 1rem; gap: 0.5rem; } .concierge-loading-spinner { width: 20px; height: 20px; border: 2px solid #f3f3f3; border-top: 2px solid #3498db; border-radius: 50%; animation: spin 1s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .concierge-input-container { display: flex; gap: 8px; padding: 12px; background: #ffffff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .dark .concierge-input-container { background: #1a1a1a; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); } .concierge-input { flex: 1; padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 4px; font-size: 14px; outline: none; transition: border-color 0.2s ease; color: #333333; background: #ffffff; } .concierge-input:focus { border-color: #007bff; } .concierge-input:disabled { background-color: #f5f5f5; cursor: not-allowed; } .dark .concierge-input { background: #2d2d2d; border-color: #404040; color: #ffffff; } .dark .concierge-input:focus { border-color: #4dabff; } .dark .concierge-input:disabled { background-color: #333333; color: #666666; } .concierge-stop-icon { position: relative; z-index: 1; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .concierge-messages { flex: 1; overflow-y: auto; padding: 1rem 0.5rem; display: flex; flex-direction: column; gap: 1rem; width: 100%; box-sizing: border-box; } .concierge-messages::-webkit-scrollbar { width: 6px; } .concierge-messages::-webkit-scrollbar-track { background: transparent; } .concierge-messages::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.2); border-radius: 3px; } .concierge-messages .message { max-width: 85%; min-width: 150px; display: flex; flex-direction: column; padding: 0.75rem 1rem; border-radius: 8px; position: relative; animation: fadeIn 0.3s ease; } .concierge-messages .message.user { align-self: flex-end; background-color: #2563eb; color: white; } .concierge-messages .message.assistant { align-self: flex-start; background-color: rgba(0, 0, 0, 0.05); color: #222; } .concierge-messages .message .message-content { word-break: break-word; } .concierge-messages .message .message-timestamp { font-size: 0.7rem; color: rgba(0, 0, 0, 0.4); margin-top: 6px; align-self: flex-end; background: transparent; pointer-events: none; } .concierge-messages .message.user .message-timestamp { color: rgba(255, 255, 255, 0.7); } .concierge-messages .message.assistant .message-timestamp { color: rgba(0, 0, 0, 0.4); } .concierge-messages a { color: #2563eb; text-decoration: underline; } .concierge-messages a:visited { color: #1e40af; } .concierge-messages a:hover, .concierge-messages a:focus { color: rgb(20.5714285714, 84.3428571429, 224.2285714286); } .dark .concierge-messages .message.user { background-color: #2563eb; color: white; } .dark .concierge-messages .message.assistant { background-color: rgba(255, 255, 255, 0.08); color: white; } .dark .concierge-messages .message-timestamp { color: rgba(255, 255, 255, 0.5); } .dark .concierge-messages .message.user .message-timestamp { color: rgba(255, 255, 255, 0.7); } .dark .concierge-messages .message.assistant .message-timestamp { color: rgba(255, 255, 255, 0.5); } .dark .concierge-messages a { color: rgb(80.6, 130.2, 239); } .dark .concierge-messages a:visited { color: rgb(46.7073170732, 87.1756097561, 219.2926829268); } .dark .concierge-messages a:hover, .dark .concierge-messages a:focus { color: white; } .concierge-header { padding: 1rem 1.5rem; background: #ffffff; color: #1f2937; font-weight: 700; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0, 0, 0, 0.05); border-top-left-radius: 8px; border-top-right-radius: 8px; box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.03); } .concierge-header .concierge-title { margin: 0; font-size: 1.25rem; font-weight: 600; } .dark .concierge-header { background: #1f2937; color: #f3f4f6; border-bottom: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15); } .concierge-footer { padding: 1rem 0.5rem; border-top: 1px solid rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.02); width: 100%; box-sizing: border-box; } .concierge-footer input { width: 100%; padding: 0.75rem 1rem; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 8px; font-size: 0.875rem; transition: all 0.3s ease; box-sizing: border-box; } .concierge-footer input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); } .concierge-error { background-color: #ef4444; color: white; padding: 0.75rem 1rem; margin: 0.5rem 0; border-radius: 8px; font-size: 0.95rem; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 0.5rem; box-shadow: 0 2px 8px 0 rgba(239, 68, 68, 0.08); word-break: break-word; } .concierge-error::before { content: "⚠"; font-size: 1.2em; margin-right: 0.5rem; display: inline-block; } .concierge-component.dark .concierge-error { background-color: #b91c1c; color: #fff; box-shadow: 0 2px 8px 0 rgba(185, 28, 28, 0.12); } .concierge-component { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; position: fixed; z-index: 1000; width: 380px; max-width: 90vw; height: 500px; max-height: 80vh; display: flex; flex-direction: column; border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); border: 1px solid rgba(0, 0, 0, 0.1); transition: all 0.3s ease; overflow: hidden; opacity: 0; transform: translateY(20px); pointer-events: none; padding: 0 0.5rem; } .concierge-component.open { opacity: 1; transform: translateY(0); pointer-events: all; } .concierge-component.bottom-right { bottom: 80px; right: 20px; } .concierge-component.bottom-left { bottom: 80px; left: 20px; } .concierge-component.top-right { top: 80px; right: 20px; } .concierge-component.top-left { top: 80px; left: 20px; } .concierge-component.light { background-color: #ffffff; color: #1f2937; } .concierge-component.dark { background-color: #1f2937; color: #f3f4f6; } .concierge-component.dark .concierge-messages .message.assistant { background-color: rgba(255, 255, 255, 0.1); } .concierge-component.dark .concierge-footer { border-top-color: rgba(255, 255, 255, 0.1); background-color: rgba(255, 255, 255, 0.05); } .concierge-component.dark .concierge-footer input { background-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #f3f4f6; } .concierge-component.dark .concierge-footer input::placeholder { color: rgba(255, 255, 255, 0.5); } .concierge-component .concierge-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; width: 100%; box-sizing: border-box; } .concierge-component .concierge-error { background-color: #ef4444; color: white; padding: 0.75rem 1rem; margin: 0.5rem 0; border-radius: 8px; font-size: 0.95rem; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 0.5rem; box-shadow: 0 2px 8px 0 rgba(239, 68, 68, 0.08); word-break: break-word; } .concierge-component .concierge-error::before { content: "⚠"; font-size: 1.2em; margin-right: 0.5rem; display: inline-block; } .concierge-component .concierge-loading { padding: 0.75rem 1rem; text-align: center; color: rgba(0, 0, 0, 0.5); font-size: 0.875rem; } .concierge-component .concierge-footer { padding: 1rem 0.5rem; border-top: 1px solid rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.02); width: 100%; box-sizing: border-box; } .concierge-component .concierge-footer input { width: 100%; padding: 0.75rem 1rem; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 8px; font-size: 0.875rem; transition: all 0.3s ease; box-sizing: border-box; } .concierge-component .concierge-footer input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } @media (max-width: 640px) { .concierge-component { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0; position: fixed; top: 0; left: 0; right: 0; bottom: 0; } } /*# sourceMappingURL=styles.css.map */