- Implemented DeesInputFileupload component with file upload functionality, including drag-and-drop support, file previews, and clear all option. - Developed DeesInputRichtext component featuring a rich text editor with a formatting toolbar, link management, and word count display. - Created demo for DeesInputRichtext showcasing various use cases including basic editing, placeholder text, different heights, and disabled state. - Added styles for both components to ensure a consistent and user-friendly interface. - Introduced types for toolbar buttons in the rich text editor for better type safety and maintainability.
239 lines
5.6 KiB
TypeScript
239 lines
5.6 KiB
TypeScript
import { css, cssManager } from '@design.estate/dees-element';
|
|
|
|
export const appuiAppbarStyles = [
|
|
cssManager.defaultStyles,
|
|
css`
|
|
:host {
|
|
/* CSS Variables for theming */
|
|
--appbar-height: 40px;
|
|
--appbar-font-size: 12px;
|
|
|
|
display: block;
|
|
position: relative;
|
|
width: 100%;
|
|
height: var(--appbar-height);
|
|
border-bottom: 1px solid ${cssManager.bdTheme('#e0e0e0', '#202020')};
|
|
background: ${cssManager.bdTheme('#ffffff', '#000000')};
|
|
color: ${cssManager.bdTheme('#00000080', '#ffffff80')};
|
|
font-size: var(--appbar-font-size);
|
|
display: grid;
|
|
grid-template-columns: ${cssManager.cssGridColumns(3, 20)};
|
|
-webkit-app-region: drag;
|
|
user-select: none;
|
|
}
|
|
|
|
.menus {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 0 8px;
|
|
cursor: default;
|
|
}
|
|
|
|
.menuItem {
|
|
position: relative;
|
|
line-height: 24px;
|
|
padding: 0px 12px;
|
|
margin: 8px 0px;
|
|
border-radius: 4px;
|
|
-webkit-app-region: no-drag;
|
|
transition: all 0.2s ease;
|
|
cursor: default;
|
|
outline: none;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
/* Optional: Style for menu items with icons (not typically used for top-level items) */
|
|
.menuItem dees-icon {
|
|
font-size: 14px;
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.menuItem:hover {
|
|
background: ${cssManager.bdTheme('#00000010', '#ffffff20')};
|
|
color: ${cssManager.bdTheme('#000000', '#ffffff')};
|
|
}
|
|
|
|
.menuItem.active {
|
|
background: ${cssManager.bdTheme('#00000020', '#ffffff30')};
|
|
color: ${cssManager.bdTheme('#000000', '#ffffff')};
|
|
}
|
|
|
|
.menuItem[disabled] {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.menuItem:focus-visible {
|
|
box-shadow: 0 0 0 2px ${cssManager.bdTheme('#00000080', '#ffffff80')};
|
|
}
|
|
|
|
|
|
/* Dropdown styles */
|
|
.dropdown {
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 0;
|
|
min-width: 200px;
|
|
background: ${cssManager.bdTheme('#ffffff', '#000000')};
|
|
border: 1px solid ${cssManager.bdTheme('#e0e0e0', '#202020')};
|
|
border-radius: 4px;
|
|
box-shadow: ${cssManager.bdTheme('0 4px 12px rgba(0, 0, 0, 0.15)', '0 4px 12px rgba(0, 0, 0, 0.3)')};
|
|
margin-top: 4px;
|
|
z-index: 1000;
|
|
opacity: 0;
|
|
transform: translateY(-10px);
|
|
transition: opacity 0.2s, transform 0.2s;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.dropdown.open {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.dropdown-item {
|
|
padding: 8px 16px;
|
|
cursor: default;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
transition: background 0.1s;
|
|
}
|
|
|
|
.dropdown-item:hover,
|
|
.dropdown-item.focused {
|
|
background: ${cssManager.bdTheme('#00000010', '#ffffff20')};
|
|
}
|
|
|
|
.dropdown-divider {
|
|
height: 1px;
|
|
background: ${cssManager.bdTheme('#e0e0e0', '#202020')};
|
|
margin: 4px 0;
|
|
}
|
|
|
|
.dropdown-item[disabled] {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.dropdown-item .shortcut {
|
|
margin-left: auto;
|
|
opacity: 0.6;
|
|
font-size: 11px;
|
|
}
|
|
|
|
/* Breadcrumbs */
|
|
.breadcrumbs {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100%;
|
|
padding: 0 16px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.breadcrumb-item {
|
|
color: ${cssManager.bdTheme('#00000080', '#ffffff80')};
|
|
cursor: default;
|
|
transition: color 0.2s;
|
|
}
|
|
|
|
.breadcrumb-item:hover {
|
|
color: ${cssManager.bdTheme('#000000', '#ffffff')};
|
|
}
|
|
|
|
.breadcrumb-separator {
|
|
margin: 0 8px;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
/* Account section */
|
|
.account {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
padding: 0 16px;
|
|
gap: 12px;
|
|
}
|
|
|
|
.search-icon {
|
|
cursor: default;
|
|
opacity: 0.7;
|
|
transition: opacity 0.2s;
|
|
}
|
|
|
|
.search-icon:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.user-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
cursor: default;
|
|
padding: 4px 8px;
|
|
border-radius: 4px;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
.user-info:hover {
|
|
background: ${cssManager.bdTheme('#00000010', '#ffffff20')};
|
|
}
|
|
|
|
.user-avatar {
|
|
position: relative;
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 50%;
|
|
background: ${cssManager.bdTheme('#00000020', '#ffffff30')};
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 10px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.user-avatar img {
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: 50%;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.user-status {
|
|
position: absolute;
|
|
bottom: -2px;
|
|
right: -2px;
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
border: 2px solid ${cssManager.bdTheme('#ffffff', '#000000')};
|
|
}
|
|
|
|
.user-status.online {
|
|
background: #4caf50;
|
|
}
|
|
|
|
.user-status.offline {
|
|
background: #757575;
|
|
}
|
|
|
|
.user-status.busy {
|
|
background: #f44336;
|
|
}
|
|
|
|
.user-status.away {
|
|
background: #ff9800;
|
|
}
|
|
`,
|
|
];
|
|
|