UNPKG

react-select-popover

Version:

A react component to convert a select box into a nifty popover with prepopulated options

113 lines (112 loc) 3.44 kB
.react-select-popover { position: relative; display: block; } .react-select-popover .hidden-select-box { display: none; } .react-select-popover .popover { position: absolute; left: 0; box-sizing: border-box; width: 100%; max-width: 28em; padding: 1em; border: 1px solid #dadada; background: #fff; margin-top: 20px; } .react-select-popover .popover .tag { cursor: pointer; } .react-select-popover .popover .empty-list { color: #ccc; text-transform: uppercase; text-align: center; font-size: 12px; letter-spacing: 1px; display: block; font-weight: 100; margin: 10px 0; } .react-select-popover .popover, .react-select-popover .popover:before { box-shadow: 0 0 2px rgba(0, 0, 0, 0.2); } .react-select-popover .popover:before, .react-select-popover .popover:after { content: ''; display: block; position: absolute; width: 15px; height: 15px; border: 1px solid #dadada; background: #fff; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } .react-select-popover .popover:before { z-index: -1; } .react-select-popover .popover.arrow-top:before, .react-select-popover .popover.arrow-top:after { bottom: 100%; left: 20px; margin-bottom: -7px; border-bottom: 0; border-right: 0; } .react-select-popover .select-input { width: 100%; max-width: 28em; min-height: 30px; border: 1px solid #dadada; border-radius: 2px; background: #fff; padding: 10px; margin: 0; padding: 0; } .react-select-popover .select-input.active { border-color: #91A0D3; box-shadow: 0 0 5px rgba(126, 146, 208, 0.4); } .react-select-popover .select-input .empty-list { color: #ccc; display: inline-block; line-height: 12px; padding-left: 10px; font-size: 12px; } .react-select-popover .select-input .search-input { width: 50px; height: 20px; margin: 0; padding: 0; line-height: 20px; margin: 10px; display: inline-block; outline: none; font-size: 14px; border: none; background: transparent; box-shadow: none; color: #333; } .react-select-popover .tag { display: inline-block; padding: 5px 8px; border-radius: 3px; line-height: 15px; font-size: 15px; margin: 5px; background-color: #e4e4e4; filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 ); background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%); color: #333; box-shadow: 0 0 2px #ffffff inset, 0 1px 2px rgba(0, 0, 0, 0.15); border: 1px solid #bdbdbd; } .react-select-popover .tag.active { border-color: #4C66BE; color: #4C66BE; } .react-select-popover .tag.active button { color: #4C66BE; } .react-select-popover .tag button { background: none; border: none; outline: none; cursor: pointer; color: #999999; font-size: 14px; line-height: 12px; padding: 0 6px 0 2px; position: relative; top: -1px; } .react-select-popover .tag button:hover { color: #333; }