import { DeesElement, customElement, html, css, property, cssManager } from '@design.estate/dees-element'; @customElement('view-settings') export class ViewSettings extends DeesElement { public static demo = [ () => html``, () => html``, () => html``, ]; @property() accessor activeTab: 'profile' | 'notifications' | 'security' = 'profile'; @property() accessor userName: string = 'John Doe'; @property() accessor userEmail: string = 'john@example.com'; public static styles = [ cssManager.defaultStyles, css` :host { display: block; min-height: 100%; background: ${cssManager.bdTheme('#f5f5f5', '#0a0a0a')}; color: ${cssManager.bdTheme('#1a1a1a', '#e5e5e5')}; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; } .settings-layout { max-width: 1000px; margin: 0 auto; padding: 40px 24px; } .settings-header { margin-bottom: 32px; } .settings-header h1 { font-size: 28px; font-weight: 700; margin: 0 0 8px 0; } .settings-header p { color: ${cssManager.bdTheme('#666', '#888')}; margin: 0; } .settings-content { display: grid; grid-template-columns: 200px 1fr; gap: 32px; } .settings-nav { display: flex; flex-direction: column; gap: 4px; } .nav-item { padding: 12px 16px; border-radius: 6px; cursor: pointer; transition: all 0.15s ease; color: ${cssManager.bdTheme('#666', '#999')}; } .nav-item:hover { background: ${cssManager.bdTheme('#e5e5e5', '#1a1a1a')}; color: ${cssManager.bdTheme('#1a1a1a', '#fff')}; } .nav-item.active { background: ${cssManager.bdTheme('#1a1a1a', '#3b82f6')}; color: #fff; } .settings-panel { background: ${cssManager.bdTheme('#fff', '#111')}; border: 1px solid ${cssManager.bdTheme('#e5e5e5', '#222')}; border-radius: 12px; padding: 24px; } .panel-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid ${cssManager.bdTheme('#e5e5e5', '#222')}; } .panel-header h2 { font-size: 18px; font-weight: 600; margin: 0 0 4px 0; } .panel-header p { font-size: 14px; color: ${cssManager.bdTheme('#666', '#888')}; margin: 0; } .form-group { margin-bottom: 20px; } .form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; } .form-group input { width: 100%; padding: 10px 14px; border: 1px solid ${cssManager.bdTheme('#ddd', '#333')}; border-radius: 6px; font-size: 14px; background: ${cssManager.bdTheme('#fff', '#0a0a0a')}; color: ${cssManager.bdTheme('#1a1a1a', '#e5e5e5')}; box-sizing: border-box; } .form-group input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); } .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .toggle-group { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid ${cssManager.bdTheme('#f0f0f0', '#1a1a1a')}; } .toggle-group:last-child { border-bottom: none; } .toggle-label { display: flex; flex-direction: column; gap: 4px; } .toggle-label .title { font-weight: 500; } .toggle-label .description { font-size: 13px; color: ${cssManager.bdTheme('#666', '#888')}; } .toggle { width: 44px; height: 24px; background: ${cssManager.bdTheme('#ddd', '#333')}; border-radius: 12px; position: relative; cursor: pointer; transition: background 0.2s ease; } .toggle.active { background: #3b82f6; } .toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform 0.2s ease; } .toggle.active::after { transform: translateX(20px); } .button-group { display: flex; gap: 12px; margin-top: 24px; padding-top: 24px; border-top: 1px solid ${cssManager.bdTheme('#e5e5e5', '#222')}; } .btn { padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; } .btn-primary { background: #3b82f6; color: white; border: none; } .btn-primary:hover { background: #2563eb; } .btn-secondary { background: transparent; color: ${cssManager.bdTheme('#666', '#999')}; border: 1px solid ${cssManager.bdTheme('#ddd', '#333')}; } .btn-secondary:hover { background: ${cssManager.bdTheme('#f5f5f5', '#1a1a1a')}; } .btn-danger { background: #ef4444; color: white; border: none; } .btn-danger:hover { background: #dc2626; } .security-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: ${cssManager.bdTheme('#f9f9f9', '#0a0a0a')}; border-radius: 8px; margin-bottom: 12px; } .security-item .info { display: flex; flex-direction: column; gap: 4px; } .security-item .title { font-weight: 500; } .security-item .status { font-size: 13px; color: ${cssManager.bdTheme('#666', '#888')}; } .security-item .status.enabled { color: #22c55e; } `, ]; private handleTabClick(tab: 'profile' | 'notifications' | 'security') { this.activeTab = tab; } public render() { return html`

Settings

Manage your account settings and preferences

${this.activeTab === 'profile' ? this.renderProfile() : null} ${this.activeTab === 'notifications' ? this.renderNotifications() : null} ${this.activeTab === 'security' ? this.renderSecurity() : null}
`; } private renderProfile() { return html`

Profile Information

Update your personal details and email address

`; } private renderNotifications() { return html`

Notification Preferences

Choose what notifications you want to receive

Email Notifications Receive email updates about your account activity
Push Notifications Receive push notifications on your device
Weekly Digest Get a weekly summary of your activity
Marketing Emails Receive tips, updates, and promotions
`; } private renderSecurity() { return html`

Security Settings

Manage your password and security options

Password Last changed 30 days ago
Two-Factor Authentication Enabled
Active Sessions 3 devices
`; } }