besteadfast / carbon

Steadfast's starter project - Craft CMS, Vite, and DDEV
3 stars 2 forks source link

Modal #62

Open btbunze opened 3 weeks ago

btbunze commented 3 weeks ago

Name of Component(s) Modal

Filename(s) Modal.vue

Purpose Display information in a focus-locked panel

Functionality

State

Props

Content Slots

Dependencies

DrewTJohnson commented 3 weeks ago

@btbunze This looks great to me! I love the global state, I think that's a great idea.

jakedohm commented 2 weeks ago

@btbunze looks good to me too. Let's build/ship!!

btbunze commented 2 weeks ago

https://github.com/besteadfast/carbon/commit/1191143c16bfc8218640fde3d8359d1bc75c2dba

Ready for review! @jakedohm @DrewTJohnson

Usage:

<button @click="$store.modal.openModal('1')">Open</button>
<modal modal-id="1">
    <div class="modal-body">
        <div class="px-s8 py-s10 border-t-2 border-gray-200 group">
            <dialog-title>Example Title</dialog-title>
            <dialog-description>Example Description </dialog-description>
            <p>Other Body content</p>
        </div>
    </div>
</modal>