@memori.ai/memori-react
Version:
[](https://www.npmjs.com/package/@memori.ai/memori-react)   • 10.3 kB
CSS
/* Core Container */
.memori--unified-upload-wrapper {
position: relative;
display: inline-block;
margin-right: 0.5rem;
}
/* Component Containers - Combined selectors for shared properties */
.memori--document-upload-wrapper,
.memori--image-upload-wrapper {
position: relative;
display: inline-block;
margin-right: 0.5rem;
}
/* Hidden File Inputs */
.memori--upload-file-input {
display: none;
}
/* Hidden Uploader Container - Using more accessible approach */
.memori--hidden-uploader {
position: absolute;
overflow: hidden;
width: 1px;
height: 1px;
padding: 0;
border: 0;
margin: -1px;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
}
/* Base button styles */
.memori--base-upload-button {
position: relative;
display: flex;
width: 40px;
height: 40px;
align-items: center;
justify-content: center;
border: 1px solid #e0e0e0;
border-radius: 50%;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: all 0.2s ease;
}
.memori--base-upload-button:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
}
.memori--base-upload-button:active {
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
transform: translateY(0);
}
.memori--base-upload-button.memori--error {
border-color: #ff4d4f;
animation: pulse 1.5s infinite;
}
/* Main Upload Button */
.memori--unified-upload-button {
position: relative;
display: flex;
width: 40px;
height: 40px;
align-items: center;
justify-content: center;
border: 1px solid #e0e0e0;
border-radius: 50%;
background-color: #f5f5f5;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: all 0.2s ease;
}
.memori--unified-upload-button:hover {
background-color: #efefef;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
}
/* Document Button */
.memori--document-upload-button {
position: relative;
display: flex;
width: 40px;
height: 40px;
align-items: center;
justify-content: center;
border: 1px solid #fd7e14;
border-radius: 50%;
background-color: #fff9db;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: all 0.2s ease;
}
.memori--document-upload-button:hover {
background-color: #fff3bf;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
}
/* Image Button */
.memori--image-upload-button {
position: relative;
display: flex;
width: 40px;
height: 40px;
align-items: center;
justify-content: center;
border: 1px solid #4dabf7;
border-radius: 50%;
background-color: #e7f5ff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: all 0.2s ease;
}
.memori--image-upload-button:hover {
background-color: #d0ebff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
}
/* Disabled button - Simplified */
.memori--image-upload-button:disabled {
box-shadow: none;
cursor: not-allowed;
opacity: 0.5;
transform: none;
}
/* Pulse animation */
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.4);
}
70% {
box-shadow: 0 0 0 10px rgba(255, 77, 79, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(255, 77, 79, 0);
}
}
/* Upload Icon */
.memori--upload-icon {
width: 18px;
height: 18px;
color: #666;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
/* Menu Items - Base styling */
.memori--upload-menu-item {
display: flex;
align-items: center;
padding: 12px 16px;
border-radius: 8px;
margin: 4px 8px;
cursor: pointer;
transition: all 0.2s;
}
.memori--upload-menu-item:hover {
background-color: #f5f5f5;
transform: translateX(4px);
}
/* Menu icons - Consolidated styles */
.memori--upload-menu-icon,
.memori--upload-menu-icon-image {
margin-right: 12px;
color: var(--memori-primary, #4dabf7);
}
.memori--upload-menu-icon {
width: 24px;
height: 24px;
}
.memori--upload-menu-icon-image {
width: 20px;
height: 20px;
}
.memori--absolute-preview {
position: absolute;
z-index: 100;
right: 0;
bottom: 50px;
left: auto;
width: 300px;
max-height: 300px;
overflow-y: auto;
}
/* Preview Item - Base styling */
.memori--preview-item {
position: relative;
display: flex;
align-items: center;
padding: 10px 12px;
border-radius: 8px;
border-left: 3px solid transparent;
margin-bottom: 8px;
background-color: #f8f9fa;
cursor: pointer;
gap: 12px;
transition: all 0.2s ease;
}
.memori--preview-item:hover {
background-color: #f1f3f5;
transform: translateX(4px);
}
/* Preview item variants */
.memori--preview-item--document {
background-color: #fff9db;
}
.memori--preview-item--image {
background-color: #e7f5ff;
}
.memori--preview-item--error {
border-left-color: #fa5252;
}
/* Preview Icon */
.memori--preview-icon {
width: 20px;
height: 20px;
flex-shrink: 0;
fill: var(--memori-primary, #4dabf7);
}
/* Preview Thumbnail */
.memori--preview-thumbnail {
overflow: hidden;
width: 36px;
height: 36px;
flex-shrink: 0;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.memori--preview-thumbnail img {
width: 100%;
height: 100%;
object-fit: cover;
}
/* Preview File Info */
.memori--preview-file-info {
display: flex;
overflow: hidden;
flex-direction: column;
flex-grow: 1;
}
.memori--preview-filename {
overflow: hidden;
max-width: 200px;
color: #495057;
font-size: 14px;
font-weight: 500;
text-overflow: ellipsis;
white-space: nowrap;
}
.memori--preview-filetype {
display: flex;
align-items: center;
padding: 2px 0;
margin-top: 2px;
color: #868e96;
font-size: 12px;
}
/* Upload Status */
.memori--upload-status {
margin-left: 6px;
color: #40c057;
font-weight: 500;
}
.memori--upload-status-error {
color: #fa5252;
}
/* Remove Button */
.memori--remove-button {
position: absolute ;
top: -4px;
right: -4px;
width: 20px ;
height: 20px ;
padding: 4px;
margin: 0;
opacity: 0;
transform: scale(0.75);
transition: all 0.2s ease;
}
.memori--remove-button.visible {
opacity: 1;
transform: scale(1);
}
.memori--remove-button:hover {
transform: scale(1.1) ;
}
/* Modal Preview Content */
.memori--preview-content {
padding: 16px;
border-radius: 8px;
margin: 0;
/* background-color: #f8f9fa; */
font-family: monospace;
line-height: 1.5;
}
.memori--modal-preview-file .memori--asset-info {
padding: 12px;
border: 1px solid #b2f2bb;
border-radius: 8px;
margin-top: 16px;
/* background-color: #ebfbee; */
text-align: left;
}
.memori--asset-url {
overflow: hidden;
padding: 8px 12px;
border-radius: 4px;
margin-top: 8px;
background-color: #f5f5f5;
font-family: monospace;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Positioned containers */
.memori--error-message-container,
.memori--login-tip {
position: fixed;
z-index: 10001;
top: 80px;
right: 20px;
}
/* Responsive adjustments for mobile */
@media (max-width: 768px) {
.memori--error-message-container,
.memori--login-tip {
top: 100px;
right: 10px;
max-width: calc(100vw - 20px);
}
}
/* File Stats */
.memori--file-stats {
position: absolute;
z-index: 10;
right: 0;
bottom: -35px;
padding: 4px 8px;
border-radius: 4px;
margin: 0;
background-color: #f5f5f5;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
color: #666;
font-size: 12px;
}
.memori--file-stats p {
padding: 2px 0;
margin: 0;
}
/* Improved image count indicator */
.memori--image-count {
position: absolute;
z-index: 5;
top: -8px;
right: -8px;
padding: 1px 6px;
border-radius: 10px;
background-color: #4dabf7;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
color: white;
font-size: 11px;
font-weight: bold;
}
.memori--upload-image {
min-width: 140px;
min-height: 42px;
border-radius: 8px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.memori--image-count-full {
background-color: #fa5252;
}
/* Document count indicator */
.memori--document-count {
position: absolute;
z-index: 5;
top: -20px;
right: -10px;
padding: 1px 6px;
border-radius: 10px;
background-color: #51cf66;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
color: white;
font-size: 11px;
font-weight: bold;
}
.memori--document-count-full {
background-color: #fa5252;
}
/* Styled upload slots info */
.memori--upload-slots-info {
margin-left: 4px;
color: #868e96;
font-size: 12px;
font-style: italic;
}
/* Disabled menu item styling */
.memori--upload-menu-item--disabled {
cursor: not-allowed;
opacity: 0.5;
}
.memori--upload-menu-item--disabled:hover {
background-color: transparent;
transform: none;
}
/* Enhanced floating menu */
.memori--upload-menu {
position: absolute;
z-index: 1000;
right: 0;
bottom: 50px;
width: 220px; /* Slightly wider to accommodate the text */
padding: 8px 0;
border-radius: 12px;
animation: fadeIn 0.2s ease;
background-color: #fff;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
transform-origin: bottom right;
}
/* Menu item hover effect */
.memori--upload-menu-item:hover:not(.memori--upload-menu-item--disabled) {
background-color: #f5f5f5;
transform: translateX(4px);
}
input.memori--upload-title-input {
min-height: 2.5rem;
border: 1px solid #e0e0e0;
border-radius: 0.375rem;
appearance: none;
background: inherit;
font-size: 1rem;
outline: transparent solid 2px;
outline-offset: 2px;
padding-inline-end: 1rem;
padding-inline-start: 1rem;
transition-duration: 0.2s;
transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
}
.memori--error-message-alert{
position: relative;
z-index: 10002;
top: 0;
right: 0;
}
/* Animation Keyframes */
@keyframes slide-in {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slide-down {
from {
opacity: 1;
transform: translateY(0);
}
to {
opacity: 0;
transform: translateY(10px);
}
}
/* Responsive adjustments */
@media (max-width: 768px) {
.memori--absolute-preview {
width: 250px;
}
.memori--upload-menu {
width: 180px;
}
}