75 lines
2.0 KiB
TypeScript
75 lines
2.0 KiB
TypeScript
import { html } from '@design.estate/dees-element';
|
|
import { injectCssVariables } from '../../00variables.js';
|
|
|
|
export const demoFunc = () => {
|
|
injectCssVariables();
|
|
return html`
|
|
<style>
|
|
.demo-section {
|
|
margin-bottom: 2rem;
|
|
}
|
|
.demo-section h3 {
|
|
margin: 0 0 1rem 0;
|
|
font-size: 0.875rem;
|
|
color: var(--dees-muted-foreground);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
.modal-content {
|
|
padding: 1rem 0;
|
|
}
|
|
</style>
|
|
|
|
<div class="demo-section">
|
|
<h3>Modal (click button to open)</h3>
|
|
<dees-mobile-button
|
|
@click=${(e: Event) => {
|
|
const modal = (e.target as HTMLElement).parentElement?.querySelector('dees-mobile-modal');
|
|
if (modal) (modal as any).open = true;
|
|
}}
|
|
>Open Modal</dees-mobile-button>
|
|
|
|
<dees-mobile-modal
|
|
title="Confirm Action"
|
|
@close=${(e: Event) => {
|
|
(e.target as any).open = false;
|
|
}}
|
|
>
|
|
<div class="modal-content">
|
|
<p>Are you sure you want to proceed with this action?</p>
|
|
</div>
|
|
<div slot="footer">
|
|
<dees-mobile-button variant="ghost">Cancel</dees-mobile-button>
|
|
<dees-mobile-button variant="primary">Confirm</dees-mobile-button>
|
|
</div>
|
|
</dees-mobile-modal>
|
|
</div>
|
|
|
|
<div class="demo-section">
|
|
<h3>Modal without Close Button</h3>
|
|
<dees-mobile-button
|
|
variant="outline"
|
|
@click=${(e: Event) => {
|
|
const modal = (e.target as HTMLElement).parentElement?.querySelector('dees-mobile-modal');
|
|
if (modal) (modal as any).open = true;
|
|
}}
|
|
>Open Required Modal</dees-mobile-button>
|
|
|
|
<dees-mobile-modal
|
|
title="Terms & Conditions"
|
|
.showCloseButton=${false}
|
|
@close=${(e: Event) => {
|
|
(e.target as any).open = false;
|
|
}}
|
|
>
|
|
<div class="modal-content">
|
|
<p>You must accept the terms to continue.</p>
|
|
</div>
|
|
<div slot="footer">
|
|
<dees-mobile-button variant="primary">I Accept</dees-mobile-button>
|
|
</div>
|
|
</dees-mobile-modal>
|
|
</div>
|
|
`;
|
|
};
|