UNPKG

contact-input-component

Version:

![Tag Input Component Demo](https://github.com/ViniciusBenfica/contact-input-component/raw/main/demo.png)

178 lines (153 loc) 2.75 kB
body, html { margin: 0; padding: 0; } input, button { all: unset; } input { width: auto; min-width: 20px; } button { cursor: pointer; } .contact-input-wrapper { position: relative; width: 100%; } .contact-input-container { display: flex; align-items: center; min-height: 40px; width: 100%; border-radius: 4px; border: 1px solid #dbdde1; padding: 6px 12px; font-size: 14px; transition: all 0.2s ease; background-color: white; box-sizing: border-box; } .contact-input-container:focus-within { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.3); } .contact-input-focused { background-color: #f1f3f4; } .contact-input-label { color: #5f6368; margin-right: 8px; font-weight: 500; flex-shrink: 0; } .contact-input-tags { display: flex; flex-wrap: wrap; gap: 6px; } .contact-tag { display: inline-flex; align-items: center; gap: 6px; background-color: #e8eaed; border-radius: 16px; padding: 2px 4px; font-size: 14px; transition: background-color 0.2s ease; } .contact-tag:hover { background-color: #dadce0; } .contact-avatar { display: flex; align-items: center; justify-content: center; border-radius: 50%; width: 24px; height: 24px; font-size: 12px; color: white; font-weight: 500; background-color: #4285f4; overflow: hidden; } .contact-tag-name { font-weight: 500; margin-top: -2px; } .contact-tag-remove { color: #5f6368; border-radius: 50%; padding: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center; } .contact-tag-remove:hover { color: #202124; background-color: rgba(0, 0, 0, 0.05); } .contact-input { flex: 1; background-color: transparent; border: none; outline: none; min-width: 120px; height: 28px; } .contact-suggestions { position: absolute; z-index: 50; width: 100%; margin-top: 4px; background-color: white; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); overflow: hidden; animation: scaleIn 0.2s ease; } @keyframes scaleIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } .contact-suggestions-list { padding: 4px 0; max-height: 280px; overflow-y: auto; } .contact-suggestion-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; transition: background-color 0.2s ease; } .contact-suggestion-item:hover, .highlighted { background-color: #f1f3f4; } .suggestion-details { display: flex; flex-direction: column; } .suggestion-name { font-weight: 500; } .suggestion-contact { font-size: 13px; color: #5f6368; } .suggestion-check { margin-left: auto; color: #1a73e8; }