import { html, type TemplateResult } from 'lit'; import { formatUsageFromDefaults, type PlaygroundControl, type PlaygroundDefinition, type PlaygroundProps, whenString, } from '../types.js'; const ATTRIBUTE_NAMES: Record = { buttonText: 'button-text', buttonClass: 'button-class', buttonStyle: 'button-style', popoverClass: 'popover-class', nuiType: 'nui-type', }; export const NUI_POPOVER_DEFAULTS: PlaygroundProps = { buttonText: 'Show chat dashboard', icon: 'mdi:chat', src: '', buttonClass: '', buttonStyle: '', popoverClass: '', position: 'bottom', nuiType: '', }; const CONTROLS: PlaygroundControl[] = [ { key: 'buttonText', label: 'button-text', type: 'text', section: 'Content', }, { key: 'icon', label: 'icon', type: 'text', section: 'Content', }, { key: 'src', label: 'src (image)', type: 'text', section: 'Content', }, { key: 'position', label: 'position', type: 'select', section: 'Appearance', options: [ { value: 'top', label: 'top' }, { value: 'bottom', label: 'bottom' }, { value: 'left', label: 'left' }, { value: 'right', label: 'right' }, ], }, { key: 'buttonStyle', label: 'button-style', type: 'text', section: 'Appearance', }, { key: 'buttonClass', label: 'button-class', type: 'text', section: 'Appearance', }, { key: 'popoverClass', label: 'popover-class', type: 'text', section: 'Appearance', }, { key: 'nuiType', label: 'nui-type', type: 'text', section: 'Appearance', }, ]; function renderPreview(props: PlaygroundProps): TemplateResult { return html`
Live Support

Welcome to the Nucleify support agent! How can we assist you today? Our team is online and ready to help.

`; } export const nuiPopoverPlayground: PlaygroundDefinition = { tag: 'nui-popover', label: 'Popover', description: 'Fixed bottom-right chat widget or panel triggered by a floating action button.', defaults: NUI_POPOVER_DEFAULTS, controls: CONTROLS, renderPreview, formatUsage: (props) => formatUsageFromDefaults( 'nui-popover', props, NUI_POPOVER_DEFAULTS, ATTRIBUTE_NAMES, ), };