diff --git a/.claude/skills/uikit/references/components.md b/.claude/skills/uikit/references/components.md index 56a7d1b5..69c1de74 100644 --- a/.claude/skills/uikit/references/components.md +++ b/.claude/skills/uikit/references/components.md @@ -236,11 +236,31 @@ Wraps form inputs with label and validation messages. ## LfxDrawer ```vue - - + + + ``` +| Prop | Type | Default | Notes | +| ------------------ | --------------------------- | ------------ | -------------------------------------------------- | +| `modelValue` | `boolean` | — | v-model open/closed state | +| `position` | `'left' \| 'right' \| 'bottom'` | `'right'` | Slide direction | +| `width` | `string` | `'37.5rem'` | max-width for left/right positions | +| `height` | `string` | `'85vh'` | max-height for bottom position | +| `closeFunction` | `() => boolean` | `() => true` | Return false to veto close (e.g. unsaved changes) | +| `hideCloseButton` | `boolean` | `false` | Hide the built-in × button to add your own | + +The `bottom` position adds `rounded-t-2xl` to the panel and fills the full viewport width. + --- ## LfxTooltip diff --git a/frontend/app/components/modules/donate/components/donate-drawer-global.vue b/frontend/app/components/modules/donate/components/donate-drawer-global.vue new file mode 100644 index 00000000..4cdc6d0d --- /dev/null +++ b/frontend/app/components/modules/donate/components/donate-drawer-global.vue @@ -0,0 +1,26 @@ + + + + + + diff --git a/frontend/app/components/modules/donate/components/donate-drawer.vue b/frontend/app/components/modules/donate/components/donate-drawer.vue new file mode 100644 index 00000000..feb68a05 --- /dev/null +++ b/frontend/app/components/modules/donate/components/donate-drawer.vue @@ -0,0 +1,283 @@ + + + + + + diff --git a/frontend/app/components/modules/donate/components/donate-step-amount.vue b/frontend/app/components/modules/donate/components/donate-step-amount.vue new file mode 100644 index 00000000..2f61d524 --- /dev/null +++ b/frontend/app/components/modules/donate/components/donate-step-amount.vue @@ -0,0 +1,203 @@ + + + + + + diff --git a/frontend/app/components/modules/donate/components/donate-step-contact.vue b/frontend/app/components/modules/donate/components/donate-step-contact.vue new file mode 100644 index 00000000..300c0b32 --- /dev/null +++ b/frontend/app/components/modules/donate/components/donate-step-contact.vue @@ -0,0 +1,169 @@ + + + + + + diff --git a/frontend/app/components/modules/donate/components/donate-step-payment.vue b/frontend/app/components/modules/donate/components/donate-step-payment.vue new file mode 100644 index 00000000..88ea5524 --- /dev/null +++ b/frontend/app/components/modules/donate/components/donate-step-payment.vue @@ -0,0 +1,259 @@ + + + + + + diff --git a/frontend/app/components/modules/donate/components/donate-step-success.vue b/frontend/app/components/modules/donate/components/donate-step-success.vue new file mode 100644 index 00000000..abc7cbe1 --- /dev/null +++ b/frontend/app/components/modules/donate/components/donate-step-success.vue @@ -0,0 +1,117 @@ + + + + + + diff --git a/frontend/app/components/modules/donate/store/donate-drawer.store.ts b/frontend/app/components/modules/donate/store/donate-drawer.store.ts new file mode 100644 index 00000000..9c7cad81 --- /dev/null +++ b/frontend/app/components/modules/donate/store/donate-drawer.store.ts @@ -0,0 +1,28 @@ +// Copyright The Linux Foundation and each contributor to LFX. +// SPDX-License-Identifier: MIT + +import { defineStore } from 'pinia'; +import { ref } from 'vue'; + +export interface DonateDrawerInitiative { + id: string; + name: string; + logoUrl?: string; +} + +export const useDonateDrawerStore = defineStore('donateDrawer', () => { + const isOpen = ref(false); + const initiative = ref(null); + + const openDonateDrawer = (data: DonateDrawerInitiative) => { + initiative.value = data; + isOpen.value = true; + }; + + const closeDonateDrawer = () => { + isOpen.value = false; + initiative.value = null; + }; + + return { isOpen, initiative, openDonateDrawer, closeDonateDrawer }; +}); diff --git a/frontend/app/components/modules/initiatives/components/initiative-detail-header.vue b/frontend/app/components/modules/initiatives/components/initiative-detail-header.vue index e54a11ea..b8486ee4 100644 --- a/frontend/app/components/modules/initiatives/components/initiative-detail-header.vue +++ b/frontend/app/components/modules/initiatives/components/initiative-detail-header.vue @@ -81,6 +81,7 @@ SPDX-License-Identifier: MIT icon="hand-heart" icon-position="left" class="!text-accent-500" + @click="openDonateDrawer({ id: initiative.id, name: initiative.name, logoUrl: initiative.logoUrl })" /> @@ -122,12 +123,15 @@ import LfxAvatar from '~/components/uikit/avatar/avatar.vue'; import LfxIcon from '~/components/uikit/icon/icon.vue'; import LfxChip from '~/components/uikit/chip/chip.vue'; import LfxButton from '~/components/uikit/button/button.vue'; +import { useDonateDrawerStore } from '~/components/modules/donate/store/donate-drawer.store'; const props = defineProps<{ initiative: InitiativeDetail; activeTab?: string; }>(); +const { openDonateDrawer } = useDonateDrawerStore(); + defineEmits<{ (e: 'update:activeTab', value: string): void }>(); const tabs = [ diff --git a/frontend/app/components/uikit/checkbox/checkbox.scss b/frontend/app/components/uikit/checkbox/checkbox.scss index f9bc6a70..a80f1e53 100644 --- a/frontend/app/components/uikit/checkbox/checkbox.scss +++ b/frontend/app/components/uikit/checkbox/checkbox.scss @@ -1,11 +1,11 @@ // Copyright The Linux Foundation and each contributor to LFX. // SPDX-License-Identifier: MIT .c-checkbox { - @apply inline-flex items-center flex-wrap relative; + @apply inline-flex items-center flex-wrap relative gap-2; input { - @apply h-3.5 w-3.5 border border-solid border-neutral-300 rounded-sm bg-white; - @apply transition-all appearance-none p-0 my-0 ml-0 inline-block cursor-pointer; + @apply absolute inset-0 h-full w-full border border-solid border-neutral-300 rounded-sm bg-white; + @apply transition-all appearance-none p-0 m-0 cursor-pointer; // Checked &:checked { @@ -42,8 +42,11 @@ } } - // Icon - i.c-icon { - @apply absolute top-0.5 left-0.5; + &__box { + @apply relative flex items-center justify-center shrink-0 h-3.5 w-3.5; + } + + &__check { + @apply absolute pointer-events-none; } } diff --git a/frontend/app/components/uikit/checkbox/checkbox.vue b/frontend/app/components/uikit/checkbox/checkbox.vue index 76cad42a..fc0ce6cd 100644 --- a/frontend/app/components/uikit/checkbox/checkbox.vue +++ b/frontend/app/components/uikit/checkbox/checkbox.vue @@ -4,20 +4,22 @@ SPDX-License-Identifier: MIT -->