import { html } from '@design.estate/dees-element';
import { injectCssVariables } from '../../00variables.js';
export const demoFunc = () => {
injectCssVariables();
return html`
Action Sheet
{
const container = (e.target as HTMLElement).parentElement;
const existing = container?.querySelector('dees-mobile-actionsheet');
if (existing) existing.remove();
const sheet = document.createElement('dees-mobile-actionsheet');
(sheet as any).title = 'Add Photo';
(sheet as any).options = [
{
id: 'camera',
icon: 'camera',
iconColor: 'var(--dees-primary)',
iconBackground: 'rgba(59, 130, 246, 0.1)',
title: 'Take Photo',
subtitle: 'Use camera to capture a new photo'
},
{
id: 'gallery',
icon: 'image',
iconColor: '#16a34a',
iconBackground: '#dcfce7',
title: 'Choose from Gallery',
subtitle: 'Select an existing photo'
}
];
sheet.addEventListener('close', () => sheet.remove());
sheet.addEventListener('select', (ev: any) => {
console.log('Selected:', ev.detail);
sheet.remove();
});
document.body.appendChild(sheet);
}}
>Show Photo Options
Opens an iOS-style action sheet from the bottom of the screen.
Share Options
{
const sheet = document.createElement('dees-mobile-actionsheet');
(sheet as any).title = 'Share';
(sheet as any).options = [
{
id: 'copy',
icon: 'copy',
title: 'Copy Link'
},
{
id: 'email',
icon: 'mail',
title: 'Send via Email'
},
{
id: 'message',
icon: 'message-circle',
title: 'Send Message'
}
];
sheet.addEventListener('close', () => sheet.remove());
sheet.addEventListener('select', (ev: any) => {
console.log('Share via:', ev.detail);
sheet.remove();
});
document.body.appendChild(sheet);
}}
>Share Options
`;
};