import {LitElement, html, unsafeCSS} from 'lit'; import {customElement, property} from 'lit/decorators.js'; import componentStyle from './brilliance-menu.css?inline'; import '../icon-button/icon-button'; import '../slider/slider'; import '../toggle-switch/toggle-switch'; import '../toggle-button-group/toggle-button-group'; import '../toggle-button-option/toggle-button-option'; import '../../icons/icon-display-brilliance-low'; import '../../icons/icon-display-brilliance-proposal'; import '../../icons/icon-palette-night'; import '../../icons/icon-palette-dusk'; import '../../icons/icon-palette-day'; import '../../icons/icon-palette-day-bright'; import {localized, msg} from '@lit/localize'; /** * @element obc-brilliance-menu * * @prop {String} palette - The palette to use. Possible values are 'night', 'dusk', 'day', 'bright' * @prop {Number} brightness - The brightness value * @prop {Boolean} showAutoBrightness - Show the auto brightness toggle * @prop {Boolean} showAutoPalette - Show the auto palette toggle * @prop {Boolean} hideBrightness - Show the auto brightness toggle * * @fires palette-changed - Fires when the palette is changed * @fires brightness-changed - Fires when the brightness is changed */ @localized() @customElement('obc-brilliance-menu') export class ObcBrillianceMenu extends LitElement { @property({type: String}) palette: 'night' | 'dusk' | 'day' | 'bright' = 'day'; @property({type: Number}) brightness = 50; @property({type: Boolean}) showAutoBrightness = false; @property({type: Boolean}) showAutoPalette = false; @property({type: Boolean}) hideBrightness = false; onPaletteChanged(event: CustomEvent) { this.palette = event.detail.value; this.dispatchEvent( new CustomEvent('palette-changed', { detail: {value: event.detail.value}, }) ); } onBrightnessChanged(event: CustomEvent) { this.brightness = event.detail; this.dispatchEvent( new CustomEvent('brightness-changed', { detail: {value: event.detail}, }) ); } override render() { return html`