import { html, css, cssManager } from '@design.estate/dees-element'; import { DeesModal } from './dees-modal.js'; export const demoFunc = () => html`

Header Buttons

Modals can have optional header buttons for help and closing.

{ DeesModal.createAndShow({ heading: 'With Help Button', showHelpButton: true, onHelp: async () => { const helpModal = await DeesModal.createAndShow({ heading: 'Help', width: 'small', showCloseButton: true, showHelpButton: false, content: html`

This is the help content for the modal.

You can provide context-specific help here.

`, menuOptions: [{ name: 'Got it', action: async (modal) => modal.destroy() }], }); }, content: html`

This modal has a help button in the header. Click it to see help content.

The close button is also visible by default.

`, menuOptions: [{ name: 'OK', action: async (modal) => modal.destroy() }], }); }}>With Help Button
{ DeesModal.createAndShow({ heading: 'No Close Button', showCloseButton: false, content: html`

This modal has no close button in the header.

You must use the action buttons or click outside to close it.

`, menuOptions: [{ name: 'Close', action: async (modal) => modal.destroy() }], }); }}>No Close Button
{ DeesModal.createAndShow({ heading: 'Both Buttons', showHelpButton: true, showCloseButton: true, onHelp: () => alert('Help clicked!'), content: html`

This modal has both help and close buttons.

`, menuOptions: [{ name: 'Done', action: async (modal) => modal.destroy() }], }); }}>Both Buttons
{ DeesModal.createAndShow({ heading: 'Clean Header', showCloseButton: false, showHelpButton: false, content: html`

This modal has a clean header with no buttons.

`, menuOptions: [{ name: 'Close', action: async (modal) => modal.destroy() }], }); }}>Clean Header

Modal Width Variations

Modals can have different widths: small, medium, large, fullscreen, or custom pixel values.

{ DeesModal.createAndShow({ heading: 'Small Modal', width: 'small', content: html`

This is a small modal with a width of 380px. Perfect for simple confirmations or brief messages.

`, menuOptions: [{ name: 'Cancel', action: async (modal) => modal.destroy() }, { name: 'OK', action: async (modal) => modal.destroy() }], }); }}>Small Modal
{ DeesModal.createAndShow({ heading: 'Medium Modal (Default)', width: 'medium', content: html` `, menuOptions: [{ name: 'Cancel', action: async (modal) => modal.destroy() }, { name: 'Sign Up', action: async (modal) => modal.destroy() }], }); }}>Medium Modal { DeesModal.createAndShow({ heading: 'Large Modal', width: 'large', content: html`

Wide Content Area

This large modal is 800px wide and perfect for displaying more complex content like forms with multiple columns, tables, or detailed information.

`, menuOptions: [{ name: 'Cancel', action: async (modal) => modal.destroy() }, { name: 'Save', action: async (modal) => modal.destroy() }], }); }}>Large Modal
{ DeesModal.createAndShow({ heading: 'Fullscreen Editor', width: 'fullscreen', showHelpButton: true, onHelp: async () => { alert('In a real app, this would show editor documentation'); }, content: html`

Fullscreen Experience with Header Controls

This modal takes up almost the entire viewport with a 20px margin on all sides. The header buttons are particularly useful in fullscreen mode.

The content area can be as tall as needed and will scroll if necessary.

Large content area
`, menuOptions: [{ name: 'Save', action: async (modal) => modal.destroy() }, { name: 'Cancel', action: async (modal) => modal.destroy() }], }); }}>Fullscreen Modal

Custom Width & Constraints

You can also set custom pixel widths and min/max constraints.

{ DeesModal.createAndShow({ heading: 'Custom Width (700px)', width: 700, content: html`

This modal has a custom width of exactly 700 pixels.

`, menuOptions: [{ name: 'Close', action: async (modal) => modal.destroy() }], }); }}>Custom 700px
{ DeesModal.createAndShow({ heading: 'With Max Width', width: 'large', maxWidth: 600, content: html`

This modal is set to 'large' but constrained by a maxWidth of 600px.

`, menuOptions: [{ name: 'Got it', action: async (modal) => modal.destroy() }], }); }}>Max Width 600px
{ DeesModal.createAndShow({ heading: 'With Min Width', width: 300, minWidth: 400, content: html`

This modal width is set to 300px but has a minWidth of 400px, so it will be 400px wide.

`, menuOptions: [{ name: 'OK', action: async (modal) => modal.destroy() }], }); }}>Min Width 400px

Button Variations

Modals can have different button configurations with proper spacing.

{ DeesModal.createAndShow({ heading: 'Multiple Actions', content: html`

This modal demonstrates multiple buttons with proper spacing between them.

`, menuOptions: [{ name: 'Delete', action: async (modal) => modal.destroy() }, { name: 'Cancel', action: async (modal) => modal.destroy() }, { name: 'Save Changes', action: async (modal) => modal.destroy() }], }); }}>Three Buttons
{ DeesModal.createAndShow({ heading: 'Single Action', content: html`

Sometimes you just need one button.

`, menuOptions: [{ name: 'Acknowledge', action: async (modal) => modal.destroy() }], }); }}>Single Button
{ DeesModal.createAndShow({ heading: 'No Actions', content: html`

This modal has no bottom buttons. Use the X button or click outside to close.

This is useful for informational modals that don't require user action.

`, menuOptions: [], }); }}>No Buttons
{ DeesModal.createAndShow({ heading: 'Long Button Labels', content: html`

Testing button layout with longer labels.

`, menuOptions: [{ name: 'Discard All Changes', action: async (modal) => modal.destroy() }, { name: 'Save and Continue Editing', action: async (modal) => modal.destroy() }], }); }}>Long Labels

Responsive Behavior

All modals automatically become full-width on mobile devices (< 768px viewport width) for better usability.

{ DeesModal.createAndShow({ heading: 'Responsive Modal', width: 'large', showHelpButton: true, onHelp: () => console.log('Help requested for responsive modal'), content: html`

Resize your browser window to see how this modal adapts. On mobile viewports, it will automatically take the full width minus margins.

The header buttons remain accessible at all viewport sizes.

`, menuOptions: [{ name: 'Close', action: async (modal) => modal.destroy() }], }); }}>Test Responsive
`